From 8f8d4dbb08de3ee9d6b5206ae625c0cc7cddd68f Mon Sep 17 00:00:00 2001 From: haha Date: Wed, 30 Apr 2025 00:32:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=80=83=E5=8B=A4=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IQuartzProjectAttendanceDataService.java | 1 - ...uartzProjectAttendanceDataServiceImpl.java | 20 --- .../job/QuartzProjectAttendanceCfgMapper.xml | 2 +- .../job/QuartzProjectAttendanceDataMapper.xml | 48 +++-- .../QuartzProjectAttendanceGroupMapper.xml | 4 +- .../job/QuartzProjectAttendanceUserMapper.xml | 166 +++++------------- 6 files changed, 72 insertions(+), 169 deletions(-) diff --git a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/IQuartzProjectAttendanceDataService.java b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/IQuartzProjectAttendanceDataService.java index b9973c80..70513719 100644 --- a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/IQuartzProjectAttendanceDataService.java +++ b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/IQuartzProjectAttendanceDataService.java @@ -98,7 +98,6 @@ public interface IQuartzProjectAttendanceDataService public List groupAllByComany(QuartzProjectAttendanceData where); - public List> initOtherData(Map data); public List> initHuaZhuData(Map data); diff --git a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/impl/QuartzProjectAttendanceDataServiceImpl.java b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/impl/QuartzProjectAttendanceDataServiceImpl.java index e5703e5e..bff94b6a 100644 --- a/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/impl/QuartzProjectAttendanceDataServiceImpl.java +++ b/yanzhu-modules/yanzhu-job/src/main/java/com/yanzhu/job/service/impl/QuartzProjectAttendanceDataServiceImpl.java @@ -304,26 +304,6 @@ public class QuartzProjectAttendanceDataServiceImpl implements IQuartzProjectAtt return quartzProjectAttendanceDataMapper.groupAllByComany(where); } - @Override - public List> initOtherData(Map data) { - List> dataList = new ArrayList<>(); - List> list = quartzProjectAttendanceDataMapper.initOtherData(data); - if(StringUtils.isNotEmpty(list)){ - List workerIds = list.stream().map(Map -> Map.get("workerId").toString()).collect(Collectors.toList()); - data.put("list",workerIds); - List datas= quartzProjectAttendanceUserMapper.todayAttendanceOtherData(data); - for (Map map:list) { - for(QuartzProjectAttendanceUser sau:datas){ - if(Objects.equals(map.get("workerId").toString(),sau.getWorkerId())){ - map.put("inTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getInTime())); - map.put("outTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getOutTime())); - dataList.add(map); - } - } - } - } - return dataList; - } @Override public List> initHuaZhuData(Map data) { diff --git a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceCfgMapper.xml b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceCfgMapper.xml index 6ad1f743..01c119dd 100644 --- a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceCfgMapper.xml +++ b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceCfgMapper.xml @@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceDataMapper.xml b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceDataMapper.xml index 46377463..4dca9357 100644 --- a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceDataMapper.xml +++ b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceDataMapper.xml @@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and cfgid = #{cfgid} and app_id = #{appId} - and cfgid in (select id from sur_project_attendance_cfg where projectId = #{projectId}) + and cfgid in (select id from attendance_cfg where projectId = #{projectId}) and deptId = #{deptId} and vendors_code = #{vendorsCode} and serverid = #{serverid} @@ -343,32 +343,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select companyTypeId,count(1) id from ( ) x2 where id in ( select min(id) from ( ) x1 where date(attendance_time)=#{attendanceTime} - and project_id in ( - SELECT id FROM sur_project WHERE isdel=0 AND deptid = #{subDeptId} + and projectId in ( + SELECT id FROM pro_project_info WHERE is_del=0 AND dis_dept_id = #{subDeptId} ) - and project_id in + and projectId in #{item} - and project_id=#{projectId} + and projectId=#{projectId} group by workerId ) and companyTypeId in (1,2,3,4,5,6,8) group by companyTypeId select g.companyTypeId,count(1) id - from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g, - sur_project sp + from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g, + pro_project_info sp where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id - and sp.isDel=0 + and sp.is_Del=0 and g.companyTypeId in (0,1,2,3,4,5,6,8) and c.project_id=#{projectId} - and sp.deptId=#{subDeptId} + and sp.dis_dept_id=#{subDeptId} - and sp.projectType = #{proType} and c.project_id in @@ -436,7 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select ady.* from sur_project_attendance_data_${year} ady left join sur_project sp on sp.id = ady.projectId - where sp.isDel=0 + where sp.is_Del=0 and ady.projectId=#{projectId} @@ -467,9 +466,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ady.companyTypeId =8 - and sp.deptId=#{deptId} + and sp.dis_dept_id=#{deptId} - and sp.projectType = #{proType} and ady.projectId in @@ -481,7 +479,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady - where ady.cfgid in (select id from sur_project_attendance_cfg where + where ady.cfgid in (select id from attendance_cfg where is_del=0 and projectId=#{projectId} @@ -530,7 +528,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select '1' as type,g.companyTypeId,count(1) as total from sur_project_attendance_user u left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId - where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) + where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) and g.companyTypeId in (0,1,2,3,4,5,6,8) and u.state=0 group by g.companyTypeId @@ -538,13 +536,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select '2' as type,g.companyTypeId,count(1) as total from sur_project_attendance_user u left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId - where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) + where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) and g.companyTypeId in (0,1,2,3,4,5,6,8) and u.state=1 group by g.companyTypeId UNION ALL select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d - where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) + where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) and d.is_del=0 and date(d.attendance_time) = date(now()) group by d.companyTypeId @@ -552,7 +550,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select '3' as type, DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from( select date(d.attendance_time) as attendanceTime, DATE_FORMAT(d.attendance_time, '%m-%d'),count(1) as total from sur_project_attendance_data_${year} d - where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) + where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) and d.is_del=0 and date(d.attendance_time) between #{attendanceTime} and #{attendanceOutTime} group by date(d.attendance_time) diff --git a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceGroupMapper.xml b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceGroupMapper.xml index 37beccad..d5072469 100644 --- a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceGroupMapper.xml +++ b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceGroupMapper.xml @@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and type = #{type} and leaderId = #{leaderId} and deleted = #{deleted} - and createTime = #{createTime} + and create_Time = #{createTime} and platformGroupId = #{platformGroupId} and platformTeamId = #{platformTeamId} and enterDate = #{enterDate} @@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and type = #{type} and leaderId = #{leaderId} and deleted = #{deleted} - and createTime = #{createTime} + and create_Time = #{createTime} and platformGroupId = #{platformGroupId} and platformTeamId = #{platformTeamId} and enterDate = #{enterDate} diff --git a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml index 602be580..1541e4d7 100644 --- a/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml +++ b/yanzhu-modules/yanzhu-job/src/main/resources/mapper/job/QuartzProjectAttendanceUserMapper.xml @@ -52,8 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT * FROM ( - SELECT a.*,b.project_id,b.sub_dept_id - FROM sur_project_attendance_user a,sur_project_attendance_cfg b + SELECT a.*,b.project_id,b.dept_id + FROM sur_project_attendance_user a,attendance_cfg b WHERE a.cfgid=b.id ) sur_project_attendance_user @@ -63,8 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" u.groupId,u.leader,u.workTypeCode,u.specWorkType, u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId, u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time, - c.project_id,c.sub_dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark - FROM sur_project_attendance_user u,sur_project_attendance_cfg c,sur_project_attendance_group g + c.project_id,c.dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark + FROM sur_project_attendance_user u,attendance_cfg c,sur_project_attendance_group g WHERE u.cfgid=c.id AND g.companyid=u.companyid AND u.vendors_code='jgw' @@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and u.enterType = #{enterType} and u.other = #{other} and c.project_id = #{projectId} - and c.sub_dept_id = #{subDeptId} + and c.dept_id = #{subDeptId} and u.is_del = #{isDel} @@ -160,8 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.create_by, a.create_time, a.update_by, - a.update_time,b.project_id,b.sub_dept_id,g.companyTypeId,g.companyName as remark - FROM sur_project_attendance_user a,sur_project_attendance_cfg b,view_sur_project_attendance_group g + a.update_time,b.project_id,b.dept_id,g.companyTypeId,g.companyName as remark + FROM sur_project_attendance_user a,attendance_cfg b,view_sur_project_attendance_group g WHERE a.cfgid=b.id and a.companyId=g.companyId and g.id in(select min(id) from view_sur_project_attendance_group group by companyid) ) sur_project_attendance_user @@ -216,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and enterType = #{enterType} and other = #{other} and project_id = #{projectId} - and sub_dept_id = #{subDeptId} + and dept_id = #{subDeptId} and is_del = #{isDel} @@ -273,7 +273,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and enterType = #{enterType} and other = #{other} and project_id = #{projectId} - and sub_dept_id = #{subDeptId} + and dept_id = #{subDeptId} and is_del = #{isDel} @@ -455,51 +455,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - ( - SELECT * FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN ( - SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId} - ) ) xx - - - - + select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.workerid in( SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN ( - SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{deptId} + SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{deptId} ) group by workerid ) @@ -516,11 +477,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select count(1) cnt from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g + select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.workerid in( SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid @@ -555,43 +516,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - @@ -728,7 +656,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select '1' as type,g.companyTypeId,count(1) as total from sur_project_attendance_user u left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId - where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) + where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) and g.companyTypeId in (0,1,2,3,4,5,6,8) and u.state=0 and u.name like concat('%', #{name}, '%') @@ -737,7 +665,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select '2' as type,g.companyTypeId,count(1) as total from sur_project_attendance_user u left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId - where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) + where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) and g.companyTypeId in (0,1,2,3,4,5,6,8) and u.state=1 and u.name like concat('%', #{name}, '%') @@ -748,29 +676,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select '1' as type,g.companyTypeId,count(1) as total from sur_project_attendance_user u left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId - where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) + where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0) and g.companyTypeId in (0,1,2,3,4,5,6,8) and u.state=0 group by g.companyTypeId @@ -780,10 +707,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" u.groupId,u.leader,u.workTypeCode,u.specWorkType, u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId, u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time, - b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName, - b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName - FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp - WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id + u.companyName,u.workTypeName,u.groupName, + b.project_id,b.dept_id, g.teamname remark,g.companyName degreeName + FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp + WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id and g.companyTypeId in (1,6) @@ -797,9 +724,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and b.project_id=#{projectId} - and sp.deptId=#{deptId} + and sp.dis_dept_id=#{deptId} - and sp.projectType = #{proType} and b.project_id in