This commit is contained in:
杜建超 2020-12-15 14:49:12 +08:00
parent 1adcd6f556
commit 785ffda67f
3 changed files with 13 additions and 7 deletions

View File

@ -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<Long> ids = resultRecordService.selectStaffIdsByFlowProcess(process);
List<StaffEntity> staffEntities = staffService.selectByIds(ids);
String res = dingtalkBusiness.sendTaskInputMsg(staffEntities);
logger.info("绩效任务填写通知响应:" + res);
if(CollectionUtils.isNotEmpty(ids)){
logger.info("通知人员id: " + JSON.toJSONString(ids));
List<StaffEntity> staffEntities = staffService.selectByIds(ids);
String res = dingtalkBusiness.sendTaskInputMsg(staffEntities);
logger.info("绩效任务填写通知响应:" + res);
}
}
}

View File

@ -106,7 +106,7 @@ public class ExportController {
}
/* @GetMapping("/testDingTalkTask")
@GetMapping("/testDingTalkTask")
public void testDingTalkTask(){
List<Long> ids = resultRecordService.selectStaffIdsByFlowProcess(process);
log.info(JSON.toJSONString(ids));
@ -114,7 +114,7 @@ public class ExportController {
List<StaffEntity> staffEntities = staffService.selectByIds(objects);
String res = dingtalkBusiness.sendTaskInputMsg(staffEntities);
logger.info("绩效任务填写通知响应:" + res);
}*/
}

View File

@ -645,7 +645,7 @@
<select id="selectStaffIdsByFlowProcess" resultType="long">
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 (
<foreach collection="flowProcess" item="process" separator=",">
#{process}