薪资发放情况
This commit is contained in:
parent
cecc40d4fb
commit
c69fd3e6c5
@ -13,6 +13,7 @@ import com.zhgd.jeecg.common.util.DateUtil;
|
|||||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||||
import com.zhgd.xmgl.modules.project.service.IProjectService;
|
import com.zhgd.xmgl.modules.project.service.IProjectService;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo;
|
||||||
import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService;
|
import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService;
|
||||||
import com.zhgd.xmgl.modules.worker.service.IWorkerWagesPaymentService;
|
import com.zhgd.xmgl.modules.worker.service.IWorkerWagesPaymentService;
|
||||||
import com.zhgd.xmgl.pdf.MyHeaderFooter2;
|
import com.zhgd.xmgl.pdf.MyHeaderFooter2;
|
||||||
@ -386,4 +387,12 @@ public class WorkerWagesPaymentController {
|
|||||||
}
|
}
|
||||||
return JSONUtil.toJsonStr(result);
|
return JSONUtil.toJsonStr(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "薪资发放情况", notes = "薪资发放情况", httpMethod = "GET")
|
||||||
|
@ApiImplicitParam(name = "payMonth", value = "工资发放月份 格式2022-05", paramType = "query", required = true, dataType = "String")
|
||||||
|
@GetMapping(value = "/getPaymentStatistics")
|
||||||
|
public Result<PaymentStatisticsVo> getPaymentStatistics() {
|
||||||
|
return Result.success(workerWagesPaymentService.getPaymentStatistics());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.zhgd.xmgl.modules.worker.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PaymentStatisticsVo {
|
||||||
|
@ApiModelProperty(value = "已发放项目数量")
|
||||||
|
private Integer unpaidProjectNum;
|
||||||
|
@ApiModelProperty(value = "未发放项目数量")
|
||||||
|
private Integer paidProjectNum;
|
||||||
|
@ApiModelProperty(value = "未发人员数量")
|
||||||
|
private Integer unpaidUserNum;
|
||||||
|
@ApiModelProperty(value = "已发人员数量")
|
||||||
|
private Integer paidUserNum;
|
||||||
|
@ApiModelProperty(value = "发放异常人员数量")
|
||||||
|
private Integer paidUserExceptionNum;
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@ -25,4 +26,9 @@ public interface WorkerWagesPaymentMapper extends BaseMapper<WorkerWagesPayment>
|
|||||||
List<EntityMap> selectWorkerWagesPaymentPageList(Page<EntityMap> page, @Param("param")Map<String, Object> map);
|
List<EntityMap> selectWorkerWagesPaymentPageList(Page<EntityMap> page, @Param("param")Map<String, Object> map);
|
||||||
|
|
||||||
List<EntityMap> selectWorkerWagesPaymentDataList(HashMap<String, Object> param);
|
List<EntityMap> selectWorkerWagesPaymentDataList(HashMap<String, Object> param);
|
||||||
|
|
||||||
|
PaymentStatisticsVo getProjectPaymentStatistics(HashMap<String, Object> map);
|
||||||
|
|
||||||
|
PaymentStatisticsVo getUserPaymentStatistics(HashMap<String, Object> map);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
<mapper namespace="com.zhgd.xmgl.modules.worker.mapper.WorkerWagesPaymentMapper">
|
<mapper namespace="com.zhgd.xmgl.modules.worker.mapper.WorkerWagesPaymentMapper">
|
||||||
|
|
||||||
<select id="selectWorkerWagesPaymentPageList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
<select id="selectWorkerWagesPaymentPageList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||||
SELECT a.id worker_id,a.worker_name,a.id_card,a.person_type,a.inService_type,b.team_name,c.department_name,en.enterprise_name,
|
SELECT a.id worker_id,a.worker_name,a.id_card,a.person_type,a.inService_type,
|
||||||
|
b.team_name,c.department_name,
|
||||||
|
en.enterprise_name,
|
||||||
wp.id,a.person_sn,a.project_sn,IFNULL(wp.pay_month,#{param.payMonth}) pay_month,wp.pay_gross,wp.pay_net,wp.balance_date,wp.pay_status,
|
wp.id,a.person_sn,a.project_sn,IFNULL(wp.pay_month,#{param.payMonth}) pay_month,wp.pay_gross,wp.pay_net,wp.balance_date,wp.pay_status,
|
||||||
wp.days,wp.work_hours,wp.bank_balance_date,a.pay_roll_bank_name,a.pay_roll_bank_number,
|
wp.days,wp.work_hours,wp.bank_balance_date,a.pay_roll_bank_name,a.pay_roll_bank_number,
|
||||||
(CASE WHEN a.person_type=1 THEN b.team_name
|
(CASE WHEN a.person_type=1 THEN b.team_name
|
||||||
@ -83,7 +85,23 @@
|
|||||||
<if test="payStatus != null and payStatus != '' or payStatus == 0">
|
<if test="payStatus != null and payStatus != '' or payStatus == 0">
|
||||||
and IFNULL(wp.pay_status, 0) = #{payStatus}
|
and IFNULL(wp.pay_status, 0) = #{payStatus}
|
||||||
</if>
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getProjectPaymentStatistics" resultType="com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo">
|
||||||
|
SELECT
|
||||||
|
count( t.project_sn ) paidProjectNum,
|
||||||
|
count(*)- count( t.project_sn ) unpaidProjectNum
|
||||||
|
FROM
|
||||||
|
project p
|
||||||
|
LEFT JOIN ( SELECT DISTINCT wp.project_sn FROM worker_wages_payment wp JOIN project p1 where wp.pay_month = #{param.payMonth}) t ON t.project_sn = p.project_sn
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserPaymentStatistics" resultType="com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo">
|
||||||
|
select ifnull(sum(if(wp.pay_status = 1, 1, 0)), 0) paidUserNum,
|
||||||
|
ifnull(sum(if(wp.pay_status = 0 or wp.pay_status is null, 1, 0)), 0) unpaidUserNum
|
||||||
|
from worker_info a
|
||||||
|
LEFT JOIN worker_wages_payment wp ON (a.person_sn = wp.person_sn and a.project_sn = wp.project_sn and
|
||||||
|
wp.pay_month = #{param.payMonth})
|
||||||
|
where a.inService_type=1
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -26,4 +27,6 @@ public interface IWorkerWagesPaymentService extends IService<WorkerWagesPayment>
|
|||||||
List<EntityMap> selectWorkerWagesPaymentDataList(HashMap<String, Object> param);
|
List<EntityMap> selectWorkerWagesPaymentDataList(HashMap<String, Object> param);
|
||||||
|
|
||||||
Result uploadWagesPaymentExcel(MultipartFile excelFile, String projectSn);
|
Result uploadWagesPaymentExcel(MultipartFile excelFile, String projectSn);
|
||||||
|
|
||||||
|
PaymentStatisticsVo getPaymentStatistics();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
|||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
import com.zhgd.xmgl.modules.worker.entity.WorkerWagesPayment;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo;
|
||||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerWagesPaymentMapper;
|
import com.zhgd.xmgl.modules.worker.mapper.WorkerWagesPaymentMapper;
|
||||||
import com.zhgd.xmgl.modules.worker.service.IWorkerWagesPaymentService;
|
import com.zhgd.xmgl.modules.worker.service.IWorkerWagesPaymentService;
|
||||||
@ -43,6 +44,15 @@ public class WorkerWagesPaymentServiceImpl extends ServiceImpl<WorkerWagesPaymen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<EntityMap> selectWorkerWagesPaymentPageList(Map<String, Object> map) {
|
public IPage<EntityMap> selectWorkerWagesPaymentPageList(Map<String, Object> map) {
|
||||||
|
getPayMonth(map);
|
||||||
|
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
|
||||||
|
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
|
||||||
|
Page<EntityMap> page = new Page<>(pageNo, pageSize);
|
||||||
|
List<EntityMap> list=workerWagesPaymentMapper.selectWorkerWagesPaymentPageList(page, map);
|
||||||
|
return page.setRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getPayMonth(Map<String, Object> map) {
|
||||||
String payMonth= MapUtils.getString(map,"payMonth");
|
String payMonth= MapUtils.getString(map,"payMonth");
|
||||||
//工资发放记录默认查询上个月,且只能一个月的查询
|
//工资发放记录默认查询上个月,且只能一个月的查询
|
||||||
if(StringUtils.isEmpty(payMonth)){
|
if(StringUtils.isEmpty(payMonth)){
|
||||||
@ -54,11 +64,6 @@ public class WorkerWagesPaymentServiceImpl extends ServiceImpl<WorkerWagesPaymen
|
|||||||
payMonth=sdf1.format(calendar.getTime());
|
payMonth=sdf1.format(calendar.getTime());
|
||||||
map.put("payMonth",payMonth);
|
map.put("payMonth",payMonth);
|
||||||
}
|
}
|
||||||
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
|
|
||||||
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
|
|
||||||
Page<EntityMap> page = new Page<>(pageNo, pageSize);
|
|
||||||
List<EntityMap> list=workerWagesPaymentMapper.selectWorkerWagesPaymentPageList(page, map);
|
|
||||||
return page.setRecords(list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -135,4 +140,16 @@ public class WorkerWagesPaymentServiceImpl extends ServiceImpl<WorkerWagesPaymen
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PaymentStatisticsVo getPaymentStatistics() {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
getPayMonth(map);
|
||||||
|
PaymentStatisticsVo vo = workerWagesPaymentMapper.getProjectPaymentStatistics(map);
|
||||||
|
PaymentStatisticsVo userVo = workerWagesPaymentMapper.getUserPaymentStatistics(map);
|
||||||
|
vo.setPaidUserNum(userVo.getPaidUserNum());
|
||||||
|
vo.setUnpaidUserNum(userVo.getUnpaidUserNum());
|
||||||
|
vo.setPaidUserExceptionNum(0);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user