Commit 9eea996d authored by 赵啸非's avatar 赵啸非

修改统计查询结果

parent dfb6745d
......@@ -46,6 +46,10 @@ public class AttendanceSummaryQuery {
private Integer dayOfWeek;
private Integer summaryType;
private List<Long> staffIdList;
public AttendanceSummaryQuery(String summaryTime) {
this.summaryTime = summaryTime;
}
......
......@@ -681,13 +681,27 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
}
Result<AttendanceStatEntity> result = dao.getListExt(params, pageInfo);
if (CollectionUtils.isNotEmpty(result.getList())) {
for (AttendanceStatEntity item : result.getList()) {
//todo 循环查询改造
List<Long> staffIdList = result.getList().parallelStream().map(AttendanceStatEntity::getStaffId).collect(Collectors.toList());
params.setStaffIdList(staffIdList);
Map<Long, List<AttendanceStaffStatEntity>> staffGroupCollect = attendanceStaffStatService.getListExt(params).parallelStream().collect(Collectors.groupingBy(AttendanceStaffStatEntity::getStaffId));
Iterator<AttendanceStatEntity> iterator = result.getList().iterator();
while (iterator.hasNext()) {
AttendanceStatEntity item = iterator.next();
List<AttendanceStaffStatEntity> statEntities = staffGroupCollect.get(item.getStaffId());
if (CollectionUtils.isNotEmpty(statEntities)) {
item.setAttendanceStaffStatEntities(statEntities);
}
}
/* for (AttendanceStatEntity item : result.getList()) {
params.setStaffId(item.getStaffId());
List<AttendanceStaffStatEntity> statEntities = attendanceStaffStatService.getListExt(params);
if (CollectionUtils.isNotEmpty(statEntities)) {
item.setAttendanceStaffStatEntities(statEntities);
}
}
}*/
}
return result;
}
......
......@@ -9,7 +9,12 @@
where s.staffId=#{staffId}
AND STR_TO_DATE(CONCAT(s.`year`,'-',s.`month`,'-',s.`day`),'%Y-%m-%d') <![CDATA[ >= ]]> STR_TO_DATE(#{summaryTimeStart},'%Y-%m-%d')
AND STR_TO_DATE(CONCAT(s.`year`,'-',s.`month`,'-',s.`day`),'%Y-%m-%d') <![CDATA[ <= ]]> STR_TO_DATE(#{summaryTimeEnd},'%Y-%m-%d')
<if test="staffIdList != null and staffIdList.size>0">
AND s.staffId in
<foreach collection="staffIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -2,7 +2,7 @@ ALTER TABLE mortals_xhx_staff ADD COLUMN `score` decimal(10,2) default 0.00
ALTER TABLE mortals_xhx_dept ADD COLUMN `score` decimal(10,2) default 0.00 COMMENT '绩效分数' AFTER updateTime;
-- ----------------------------
2023-7-05
-- 2023-7-05
-- ----------------------------
-- ----------------------------
......@@ -282,7 +282,7 @@ INSERT INTO `mortals_xhx_resource` VALUES (null, '员工反馈问卷-菜单管
-- ----------------------------
2023-7-08
-- 2023-7-08
-- ----------------------------
ALTER TABLE mortals_xhx_user ADD COLUMN `customerId` bigint(20) DEFAULT -1 COMMENT '员工id' AFTER status;
......@@ -332,7 +332,7 @@ ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `filePaths` varchar(256)
-- ----------------------------
2023-7-09
-- 2023-7-09
-- ----------------------------
ALTER TABLE mortals_xhx_feedback ADD COLUMN `ruleContent` varchar(1024) DEFAULT '' COMMENT '规则内容' AFTER formContent;
......@@ -381,7 +381,7 @@ ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `categoryName` varchar(128
ALTER TABLE mortals_xhx_perform_rules ADD COLUMN `ruleCode` varchar(64) COMMENT '规则编码,唯一,默认规则类型内容简称拼音首字母。'AFTER id;
-- ----------------------------
2023-7-10
-- 2023-7-10
-- ----------------------------
ALTER TABLE mortals_xhx_perform_review_record ADD COLUMN `subAddType` tinyint(1) DEFAULT '1' COMMENT '增减类型(1.增加,2.扣除)' AFTER deductTime;
......@@ -406,7 +406,7 @@ ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `subAddType` tinyint(1)
-- ----------------------------
2023-7-10 2
-- 2023-7-10 2
-- ----------------------------
......@@ -542,7 +542,7 @@ PRIMARY KEY (`id`)
-- ----------------------------
2023-7-14
-- 2023-7-14
-- ----------------------------
-- ----------------------------
......@@ -643,7 +643,7 @@ PRIMARY KEY (`id`)
-- ----------------------------
2023-7-15
-- 2023-7-15
-- ----------------------------
......@@ -697,7 +697,7 @@ ALTER TABLE mortals_xhx_check_attend_record ADD COLUMN `windowNum` varchar(64)
-- ----------------------------
2023-7-16
-- 2023-7-16
-- ----------------------------
-- ----------------------------
-- 员工入职信息菜单 SQL
......@@ -726,7 +726,7 @@ INSERT INTO `mortals_xhx_param` VALUES (null, '员工状态', 'StaffOnboard', 'o
-- ----------------------------
2023-7-17
-- 2023-7-17
-- ----------------------------
-- ----------------------------
-- 请假记录信息表
......@@ -1251,7 +1251,7 @@ ALTER TABLE `mortals_xhx_staff_perform_summary`
-- ----------------------------
2024-03-18
-- 2024-03-18
-- ----------------------------
-- ----------------------------
-- 门禁设备表
......@@ -1277,7 +1277,7 @@ PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='门禁设备';
-- ----------------------------
2024-04-26
-- 2024-04-26
-- ----------------------------
-- ----------------------------
-- 窗口负责人
......@@ -1286,7 +1286,7 @@ ALTER TABLE `mortals_xhx_window_owner` ADD COLUMN `roleType` tinyint(2) COMMENT
ADD COLUMN `inspect` tinyint(2) DEFAULT '0' COMMENT '是否允许巡检' AFTER `roleType`,
ADD COLUMN `staffIds` varchar(255) COMMENT '管辖人员' AFTER `inspect`;
-- ----------------------------
2024-04-28
-- 2024-04-28
-- ----------------------------
-- ----------------------------
-- 绩效异常信息表
......@@ -1329,14 +1329,14 @@ ADD COLUMN `processPerson` varchar(128) COMMENT '处理人员' AFTER `proce
ADD KEY `appealPerson` (`appealPerson`) USING BTREE;
-- ----------------------------
2024-07-08
-- 2024-07-08
-- ----------------------------
INSERT INTO `mortals_xhx_perform_rules` (`ruleCode`, `categoryId`, `categoryName`, `name`, `content`, `subAddType`, `score`, `assoOwner`, `ownerScore`, `remark`, `type`, `createUserId`, `createTime`, `updateUserId`, `updateTime`) VALUES ('ATTEND1010', '1', '', '事假半天', '事假半天', '2', '0.5', '0', '0.00', '', '1', '1', NOW(), NULL, NULL);
INSERT INTO `mortals_xhx_perform_rules` (`ruleCode`, `categoryId`, `categoryName`, `name`, `content`, `subAddType`, `score`, `assoOwner`, `ownerScore`, `remark`, `type`, `createUserId`, `createTime`, `updateUserId`, `updateTime`) VALUES ('ATTEND1011', '1', '', '事假全天', '事假全天', '2', '1', '0', '0.00', '', '1', '1', NOW(), NULL, NULL);
-- ----------------------------
2024-07-22
-- 2024-07-22
-- ----------------------------
ALTER TABLE `mortals_xhx_staff_perform_summary`
ADD COLUMN `remarkAdd` VARCHAR (2048) DEFAULT NULL COMMENT '加分备注' AFTER `month`,
......@@ -1346,8 +1346,8 @@ ALTER TABLE `mortals_xhx_staff_perform_summary`
UPDATE `mortals_xhx_staff_perform_summary` SET sumScore=totalScore,addTotalScore=0;
-- ----------------------------
2024-09-02
-- 2024-09-02
-- ----------------------------
ALTER TABLE `mortals_xhx_attendance_stat`
ADD COLUMN `goWorks` int(9) DEFAULT '0' COMMENT '实际出勤天数',
ADD COLUMN `leaveTime` double(4,1) DEFAULT '0.0' COMMENT '请假天数';
\ No newline at end of file
ADD COLUMN `leaveTime` double(4,1) DEFAULT '0.0' COMMENT '请假天数';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment