notic
This commit is contained in:
parent
fb1e6480e7
commit
b3389f62ea
@ -0,0 +1,46 @@
|
||||
package com.lz.modules.job.task;
|
||||
|
||||
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.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
* @Desc:
|
||||
* @Date: 2020/12/10 10:26
|
||||
*/
|
||||
|
||||
@Component("resultTaskNoticJob")
|
||||
public class ResultTaskNoticJob implements ITask {
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Autowired
|
||||
DingtalkBusiness dingtalkBusiness;
|
||||
@Autowired
|
||||
private ResultRecordService resultRecordService;
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
static final List<Integer> process = Lists.newArrayList(ResultFlowProcessEnum.TARGET.getStatus(), ResultFlowProcessEnum.CONFIRM.getStatus(),
|
||||
ResultFlowProcessEnum.DO.getStatus(), ResultFlowProcessEnum.WRITE.getStatus());
|
||||
|
||||
@Override
|
||||
public void run(String params) {
|
||||
|
||||
List<Long> ids = resultRecordService.selectStaffIdsByFlowProcess(process);
|
||||
List<StaffEntity> staffEntities = staffService.selectByIds(ids);
|
||||
String res = dingtalkBusiness.sendTaskInputMsg(staffEntities);
|
||||
logger.info("绩效任务填写通知响应:" + res);
|
||||
|
||||
}
|
||||
}
|
||||
@ -112,5 +112,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
||||
|
||||
List<LevelDetailExportDto> selectLevelDetailList(@Param("departmentIds") List<String> departmentIds, @Param("startId")Long startId, @Param("scoreLevel")String scoreLevel);
|
||||
|
||||
List<Long> selectStaffIdsByFlowProcess(@Param("flowProcess") List<Integer> flowProcess);
|
||||
|
||||
}
|
||||
@ -131,4 +131,6 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
||||
|
||||
R resetData(Long recordId, int clearFlag);
|
||||
|
||||
List<Long> selectStaffIdsByFlowProcess(List<Integer> flowProcess);
|
||||
|
||||
}
|
||||
@ -1506,4 +1506,10 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
return R.error("无数据删除");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Long> selectStaffIdsByFlowProcess(List<Integer> flowProcess) {
|
||||
return resultRecordMapper.selectStaffIdsByFlowProcess(flowProcess);
|
||||
}
|
||||
}
|
||||
|
||||
@ -643,5 +643,15 @@
|
||||
ORDER BY all_score desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectStaffIdsByFlowProcess" resultType="long">
|
||||
select staff_id from lz_result_record where is_delete = 0
|
||||
and flow_process in (
|
||||
<foreach collection="flowProcess" item="process" separator=",">
|
||||
#{process}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user