修改bug

This commit is contained in:
Administrator 2023-06-27 16:01:06 +08:00
parent dec4de7dd4
commit 818838f008
12 changed files with 235 additions and 111 deletions

View File

@ -9,12 +9,13 @@ import com.zhgd.xmgl.modules.realnamestatistics.entity.vo.WorkerMonthAttendanceS
import com.zhgd.xmgl.modules.realnamestatistics.service.IProjectOperationsAnalysisService;
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
import com.zhgd.xmgl.modules.worker.entity.WorkerType;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -71,8 +72,9 @@ public class ProjectOperationsAnalysisController {
}
@ApiOperation(value = " 查询考勤统计列表", notes = "查询考勤统计列表", httpMethod = "GET")
@GetMapping(value = "/selectAttendanceDetailByPage")
public Result<Page<WorkerMonthAttendanceStatisticsVo>> selectAttendanceDetailByPage(@RequestParam(name = "workerName", required = false) String workerName,
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String")
@RequestMapping(value = "/selectAttendanceDetailByPage", method = {RequestMethod.GET, RequestMethod.POST})
public Result<Page<WorkerMonthAttendanceStatisticsVo>> selectAttendanceDetailByPage(@RequestBody(required = false) HashMap<String, Object> map, @RequestParam(name = "workerName", required = false) String workerName,
@RequestParam(name = "projectSn", required = false) String projectSn,
@RequestParam(name = "personType", required = false) String personType,
@RequestParam(name = "groupId", required = false) Long groupId,
@ -83,14 +85,13 @@ public class ProjectOperationsAnalysisController {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Result<Page<WorkerMonthAttendanceStatisticsVo>> result = new Result<>();
Page<WorkerMonthAttendanceStatisticsVo> list = projectOperationsAnalysisService.selectAttendanceDetailByPage(workerName, projectSn, groupId, workerTypeId, time, queryTime, personSn, pageNo, pageSize, personType);
Page<WorkerMonthAttendanceStatisticsVo> list = projectOperationsAnalysisService.selectAttendanceDetailByPage(map, workerName, projectSn, groupId, workerTypeId, time, queryTime, personSn, pageNo, pageSize, personType);
result.setResult(list);
result.setSuccess(true);
result.setCode(200);
return result;
}
@ApiOperation(value = " 查询今日出勤考勤统计列表", notes = "查询今日出勤考勤统计列表", httpMethod = "GET")
@GetMapping(value = "/selectWorkerTodayAttendancePageList")
public Result<Page<TodayAttendance>> selectWorkerTodayAttendancePageList(

View File

@ -9,6 +9,7 @@ import com.zhgd.xmgl.modules.realnamestatistics.entity.vo.WorkerAttendanceVo;
import com.zhgd.xmgl.modules.realnamestatistics.entity.vo.WorkerMonthAttendanceStatisticsVo;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
/**
@ -23,7 +24,7 @@ public interface ProjectOperationsAnalysisMapper extends BaseMapper<ProjectOpera
List<ProjectOperationsAnalysis> getAllDetails();
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(Page<WorkerMonthAttendanceStatisticsVo> page, @Param("workerName") String workerName, @Param("projectSn") String projectSn, @Param("groupId") Long groupId, @Param("workerTypeId") Long workerTypeId, @Param("time") String time, @Param("queryTime") String queryTime, @Param("personSn") String personSn, @Param("personType") String personType);
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(Page<WorkerMonthAttendanceStatisticsVo> page, @Param("paramMap") HashMap<String, Object> map, @Param("workerName") String workerName, @Param("projectSn") String projectSn, @Param("groupId") Long groupId, @Param("workerTypeId") Long workerTypeId, @Param("time") String time, @Param("queryTime") String queryTime, @Param("personSn") String personSn, @Param("personType") String personType);
Page<TodayAttendance> selectWorkerTodayAttendancePageList(Page<TodayAttendance> page, @Param("projectSn") String projectSn);

View File

@ -56,6 +56,13 @@
LEFT JOIN department_info d on d.id=i.department_id
LEFT JOIN enterprise_info ei on ei.id=tm.enterprise_id
where 1=1
<if test="paramMap.projectSnList != null">
and i.project_sn in
<foreach collection="paramMap.projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="projectSn != null and projectSn != ''">
AND i.project_sn=#{projectSn}
</if>

View File

@ -10,6 +10,7 @@ import com.zhgd.xmgl.modules.realnamestatistics.entity.vo.WorkerMonthAttendanceS
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
import com.zhgd.xmgl.modules.worker.entity.WorkerType;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -29,7 +30,7 @@ public interface IProjectOperationsAnalysisService extends IService<ProjectOpera
List<WorkerType> getAllWorkerType(String projectSn);
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(String workerName, String projectSn, Long groupId, Long workerTypeId, String time, String queryTime, String personSn, Integer pageNo, Integer pageSize, String personnelType);
Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(HashMap<String, Object> map, String workerName, String projectSn, Long groupId, Long workerTypeId, String time, String queryTime, String personSn, Integer pageNo, Integer pageSize, String personnelType);
Page<TodayAttendance> selectWorkerTodayAttendancePageList(String projectSn, Integer pageNo, Integer pageSize, String personType);

View File

@ -140,9 +140,9 @@ public class ProjectOperationsAnalysisServiceImpl extends ServiceImpl<ProjectOpe
}
@Override
public Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(String workerName, String projectSn, Long groupId, Long workerTypeId, String time, String queryTime, String personSn, Integer pageNo, Integer pageSize, String personType) {
public Page<WorkerMonthAttendanceStatisticsVo> selectAttendanceDetailByPage(HashMap<String, Object> map, String workerName, String projectSn, Long groupId, Long workerTypeId, String time, String queryTime, String personSn, Integer pageNo, Integer pageSize, String personType) {
Page<WorkerMonthAttendanceStatisticsVo> page = new Page<>(pageNo, pageSize);
return baseMapper.selectAttendanceDetailByPage(page, workerName, projectSn, groupId, workerTypeId, time, queryTime, personSn, personType);
return baseMapper.selectAttendanceDetailByPage(page, map, workerName, projectSn, groupId, workerTypeId, time, queryTime, personSn, personType);
}

View File

@ -139,6 +139,7 @@ public class WorkerInfoController {
@ApiImplicitParam(name = "leaderName", value = "负责人姓名(班组)", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "chargePersonName", value = "负责人姓名(部门)", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "belongingSection", value = "所属标段(部门)", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String"),
})
@PostMapping(value = "/selectWorkerInfoList")
public Result<IPage<EntityMap>> selectWorkerInfoList(@RequestBody Map<String, Object> map) {
@ -280,6 +281,7 @@ public class WorkerInfoController {
@ApiOperation(value = "人员总览人员类型和教育统计", notes = "人员总览人员类型和教育统计")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "query", required = false, dataType = "String"),
})
@PostMapping("/selectPersonTypeAndEduStatistics")
@ -347,8 +349,9 @@ public class WorkerInfoController {
}
@ApiOperation(value = "统计按工种分布的人员数量", notes = "统计按工种分布的人员数量")
@GetMapping("/countWorkerNumGroupByWorkerType")
public Result<List<TypeNumVo>> countWorkerNumGroupByWorkerType(@RequestParam Map<String, Object> map) {
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String")
@PostMapping("/countWorkerNumGroupByWorkerType")
public Result<List<TypeNumVo>> countWorkerNumGroupByWorkerType(@RequestBody Map<String, Object> map) {
return Result.success(workerInfoService.countWorkerNumGroupByWorkerType(map));
}

View File

@ -81,6 +81,7 @@ public class WorkerWagesPaymentController {
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String"),
})
@PostMapping(value = "/selectWorkerWagesPaymentPageList")
public Result<IPage<EntityMap>> selectWorkerWagesPaymentPageList(@RequestBody Map<String,Object> map) {
@ -388,11 +389,14 @@ public class WorkerWagesPaymentController {
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());
@ApiOperation(value = "薪资发放情况", notes = "薪资发放情况", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "payMonth", value = "工资发放月份 格式2022-05", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "projectSnList", value = "项目SN列表", paramType = "query", required = false, dataType = "String"),
})
@PostMapping(value = "/getPaymentStatistics")
public Result<PaymentStatisticsVo> getPaymentStatistics(@RequestBody HashMap<String, Object> map) {
return Result.success(workerWagesPaymentService.getPaymentStatistics(map));
}
}

View File

@ -51,6 +51,13 @@
<if test="param.projectSn != null and param.projectSn != ''">
and a.project_sn = #{param.projectSn}
</if>
<if test="param.projectSnList != null and param.projectSnList != ''">
and a.project_sn in
<foreach collection="param.projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="param.workerName != null and param.workerName != ''">
and a.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%')
</if>
@ -362,6 +369,13 @@
<if test="userEnterpriseId != null and userEnterpriseId != ''">
and FIND_IN_SET(w1.enterprise_id, #{userEnterpriseId})
</if>
<if test="projectSnList != null and projectSnList != ''">
and w1.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectPresenceWorkerPersonTypeTotal" resultType="java.util.Map" parameterType="java.util.Map">
@ -382,6 +396,13 @@
<if test="userEnterpriseId != null and userEnterpriseId != ''">
and FIND_IN_SET(w1.enterprise_id, #{userEnterpriseId})
</if>
<if test="projectSnList != null and projectSnList != ''">
and w1.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
@ -822,17 +843,24 @@
WHERE p.create_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
and w1.inService_type = 1
AND w1.person_type = 1
<if test="projectSn != null and projectSn != ''">
and w1.project_sn = #{projectSn}
</if>
group by w1.team_id
) tp ON e.id = tp.team_id
LEFT JOIN (SELECT w1.team_id, COUNT(DISTINCT w1.person_sn) total_person_num
FROM worker_info w1
where w1.inService_type = 1
AND w1.person_type = 1
<if test="projectSn != null and projectSn != ''">
and w1.project_sn = #{projectSn}
</if>
group by w1.team_id
) tp2 ON e.id = tp2.team_id
WHERE e.project_sn = #{projectSn}
WHERE 1=1
<if test="projectSn != null and projectSn != ''">
and e.project_sn = #{projectSn}
</if>
order by attendance_person_num desc LIMIT 10
</select>
<select id="selectAllProjectTeamList" resultType="com.zhgd.xmgl.modules.worker.entity.vo.AllProjectTeamVo"
@ -916,7 +944,14 @@
INNER JOIN worker_attendance p ON w1.person_sn = p.person_sn
<where>
<if test="projectSn != null and projectSn != ''">
w1.project_sn = #{projectSn}
and w1.project_sn = #{projectSn}
</if>
<if test="projectSnList != null and projectSnList != ''">
and w1.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
and w1.inService_type = 1
and p.create_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
@ -2304,6 +2339,13 @@
FROM worker_type wt
LEFT JOIN team_info ti ON wt.id = ti.worker_type_id
LEFT JOIN worker_info wi ON (ti.id = wi.team_id and wi.inService_type = 1)
<if test="projectSnList != null and projectSnList != ''">
and wt.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
GROUP BY wt.type_name
</select>

View File

@ -171,6 +171,13 @@
<if test="projectSn != null and projectSn != ''">
and w3.project_sn = #{projectSn}
</if>
<if test="projectSnList != null and projectSnList != ''">
and w3.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="userEnterpriseId != null and userEnterpriseId != ''">
and FIND_IN_SET(w3.enterprise_id, #{userEnterpriseId})
</if>

View File

@ -1,15 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.worker.mapper.WorkerWagesPaymentMapper">
<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,
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.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
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,
(CASE
WHEN a.person_type = 1 THEN b.team_name
WHEN a.person_type = 2 THEN c.department_name
ELSE '' END) department_team_name
from worker_info a
@ -22,6 +38,13 @@
<if test="param.projectSn != null and param.projectSn != ''">
and a.project_sn = #{param.projectSn}
</if>
<if test="param.projectSnList != null">
and a.project_sn in
<foreach collection="param.projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="param.workerName != null and param.workerName != ''">
and a.worker_name like CONCAT(CONCAT('%', #{param.workerName}), '%')
</if>
@ -51,14 +74,35 @@
</if>
</select>
<select id="selectWorkerWagesPaymentDataList" 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,
wp.id,a.person_sn,a.project_sn,IFNULL(wp.pay_month,#{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,a.enter_date,
(CASE WHEN a.person_type=1 THEN b.team_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, #{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,
a.enter_date,
(CASE
WHEN a.person_type = 1 THEN b.team_name
WHEN a.person_type = 2 THEN c.department_name
ELSE '' END) department_team_name
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=#{payMonth})
LEFT JOIN worker_wages_payment wp ON (a.person_sn = wp.person_sn and a.project_sn = wp.project_sn and
wp.pay_month = #{payMonth})
LEFT JOIN team_info b ON a.team_id = b.id
LEFT JOIN department_info c ON a.department_id = c.id
LEFT JOIN enterprise_info en ON en.id = a.enterprise_id
@ -93,12 +137,20 @@
</select>
<select id="getProjectPaymentStatistics" resultType="com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo">
SELECT
count( t.project_sn ) paidProjectNum,
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
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
<if test="projectSnList != null and projectSnList != ''">
and p.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select>
<select id="getUserPaymentStatistics" resultType="com.zhgd.xmgl.modules.worker.entity.vo.PaymentStatisticsVo">
@ -108,5 +160,12 @@
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
<if test="projectSnList != null and projectSnList != ''">
and a.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

View File

@ -28,5 +28,5 @@ public interface IWorkerWagesPaymentService extends IService<WorkerWagesPayment>
Result uploadWagesPaymentExcel(MultipartFile excelFile, String projectSn);
PaymentStatisticsVo getPaymentStatistics();
PaymentStatisticsVo getPaymentStatistics(HashMap<String, Object> map);
}

View File

@ -142,8 +142,7 @@ public class WorkerWagesPaymentServiceImpl extends ServiceImpl<WorkerWagesPaymen
}
@Override
public PaymentStatisticsVo getPaymentStatistics() {
HashMap<String, Object> map = new HashMap<>();
public PaymentStatisticsVo getPaymentStatistics(HashMap<String, Object> map) {
getPayMonth(map);
PaymentStatisticsVo vo = workerWagesPaymentMapper.getProjectPaymentStatistics(map);
PaymentStatisticsVo userVo = workerWagesPaymentMapper.getUserPaymentStatistics(map);