diff --git a/src/main/java/com/lz/modules/job/task/ResultTaskNoticJob.java b/src/main/java/com/lz/modules/job/task/ResultTaskNoticJob.java index ab160bab..20e444b7 100644 --- a/src/main/java/com/lz/modules/job/task/ResultTaskNoticJob.java +++ b/src/main/java/com/lz/modules/job/task/ResultTaskNoticJob.java @@ -1,11 +1,13 @@ package com.lz.modules.job.task; +import com.alibaba.fastjson.JSON; import com.google.common.collect.Lists; import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.service.StaffService; import com.lz.modules.job.business.DingtalkBusiness; import com.lz.modules.performance.enums.ResultFlowProcessEnum; import com.lz.modules.sys.service.app.ResultRecordService; +import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -36,11 +38,15 @@ public class ResultTaskNoticJob implements ITask { @Override public void run(String params) { - + logger.info("绩效任务填写通知开始。。。"); List ids = resultRecordService.selectStaffIdsByFlowProcess(process); - List staffEntities = staffService.selectByIds(ids); - String res = dingtalkBusiness.sendTaskInputMsg(staffEntities); - logger.info("绩效任务填写通知响应:" + res); + if(CollectionUtils.isNotEmpty(ids)){ + logger.info("通知人员id: " + JSON.toJSONString(ids)); + List staffEntities = staffService.selectByIds(ids); + String res = dingtalkBusiness.sendTaskInputMsg(staffEntities); + logger.info("绩效任务填写通知响应:" + res); + } + } } diff --git a/src/main/java/com/lz/modules/performance/controller/ExportController.java b/src/main/java/com/lz/modules/performance/controller/ExportController.java index 8b917f34..9c801f47 100644 --- a/src/main/java/com/lz/modules/performance/controller/ExportController.java +++ b/src/main/java/com/lz/modules/performance/controller/ExportController.java @@ -106,7 +106,7 @@ public class ExportController { } - /* @GetMapping("/testDingTalkTask") + @GetMapping("/testDingTalkTask") public void testDingTalkTask(){ List ids = resultRecordService.selectStaffIdsByFlowProcess(process); log.info(JSON.toJSONString(ids)); @@ -114,7 +114,7 @@ public class ExportController { List staffEntities = staffService.selectByIds(objects); String res = dingtalkBusiness.sendTaskInputMsg(staffEntities); logger.info("绩效任务填写通知响应:" + res); - }*/ + } diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index 67472279..16d1eccd 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java @@ -941,6 +941,7 @@ public class ResultRecordServiceImpl extends ServiceImpl flowRecords = flowRecordService.selectFlowRecordByRecordIdGeFlowIndex(f.getRecordId(),f.getFlowIndex()); boolean flag = false ; for(FlowRecord flowRecord:flowRecords){ @@ -963,9 +964,10 @@ public class ResultRecordServiceImpl extends ServiceImpl newflowRecords = flowRecordService.selectFlowRecordByRecordId(f.getRecordId()); for(int i = 0 ;i < newflowRecords.size() ; i ++){ @@ -982,11 +984,12 @@ public class ResultRecordServiceImpl extends ServiceImpl flowRecords = flowRecordService.selectFlowRecordByRecordId(flowRecordId); + List flowRecords = flowRecordService.selectFlowRecordByRecordId(resultRecordId); List flowRecordIds =new ArrayList<>(); boolean flag = false ; for(FlowRecord f: flowRecords){ @@ -996,9 +999,9 @@ public class ResultRecordServiceImpl extends ServiceImpl newflowRecords = flowRecordService.selectFlowRecordByRecordId(flowRecordId); + flowRecordService.deleteFlowRecordByRecordId(resultRecordId); + initFlowRecord(resultRecordId); + List newflowRecords = flowRecordService.selectFlowRecordByRecordId(resultRecordId); for(int i = 0 ;i < newflowRecords.size() ; i ++){ flowRecordService.updateFlowRecordIdById(newflowRecords.get(i).getId(),flowRecordIds.get(i)); if(flag ){ //如果录入己经走了,设置新的数据,结果录入己走 @@ -1009,7 +1012,14 @@ public class ResultRecordServiceImpl extends ServiceImpl - select staff_id from lz_result_record where is_delete = 0 + select DISTINCT (staff_id) from lz_result_record where is_delete = 0 and start_id !=0 and flow_process in ( #{process}