增加流程流转待办事项

This commit is contained in:
wulin 2020-11-11 14:42:52 +08:00
parent b08cc0ae06
commit 8f7901cee4
3 changed files with 40 additions and 4 deletions

View File

@ -18,6 +18,7 @@ public enum WorkMsgTypeEnum {
END(5, "绩效终止", "去查看", "# 绩效终止\n ## @,你的绩效终止"),
START_WORK(6, "绩效考评待办事项", "去查看", "# 绩效目标制定\n ## @,你的绩效需要制定目标"),
START_SCORE(7, "绩效考评待办事项", "去查看", "# 绩效结果输入\n ## @,你的绩效需要输入结果"),
PROCESS(8, "绩效考评待办事项", "去查看", "# @的绩效\n ## 需您去处理"),
// 您的2020年10月绩效考核已经开始请尽快制定绩效目标
// 吴林的2020年12月绩效考核的目标需要您确认点击前往确认
;

View File

@ -163,6 +163,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
return R.error(groupStaffs.getEvaluationGroup().getName() + "——初始化考核流程失败");
}
dingtalkBusiness.sendWorkMSGWithAsyn(staffSimpleInfos, WorkMsgTypeEnum.START_WORK.getType());
}
return R.ok("发起成功").put("data", flowStart);

View File

@ -193,6 +193,31 @@ public class DingtalkBusiness {
return sendWorkMSGByEntity(appid, fromStaffEntity, toStaffEntity, workMsgTypeEnum, "https://www.baidu.com");
}
public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, int type) {
if(toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0){
//查询第三方id
List<Long> ids = toStaffids.stream().map(new Function<StaffSimpleInfo, Long>() {
@Override
public Long apply(StaffSimpleInfo staffSimpleInfo) {
return staffSimpleInfo.getId();
}
}).collect(Collectors.toList());
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
Map<Long, StaffSimpleInfo> map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e->e));
for (StaffSimpleInfo staff:staffSimpleInfos
) {
StaffSimpleInfo staff1 = map.get(staff.getId());
staff1.setEmployeeId(staff1.getEmployeeId());
}
}
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
Thread thread = new Thread(threadSendMessage);
thread.start();
return "OK";
}
public String sendWorkMSGWithAsyn(List<StaffSimpleInfo> toStaffids, int type) {
@ -215,7 +240,7 @@ public class DingtalkBusiness {
}
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
ThreadSendMessage threadSendMessage = new ThreadSendMessage(toStaffids, workMsgTypeEnum, appid);
ThreadSendMessage threadSendMessage = new ThreadSendMessage(null, toStaffids, workMsgTypeEnum, appid);
Thread thread = new Thread(threadSendMessage);
thread.start();
return "OK";
@ -287,12 +312,14 @@ public class DingtalkBusiness {
public class ThreadSendMessage implements Runnable{
List<StaffSimpleInfo> toStaffids;
StaffSimpleInfo fromStaff = null;
WorkMsgTypeEnum workMsgTypeEnum;
String appid;
String hostUrl = "https://lzmanagement.ldxinyong.com/digitization/dingTalkLogin";
public ThreadSendMessage(List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
public ThreadSendMessage(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
this.toStaffids = toStaffids;
workMsgTypeEnum = typeEnum;
this.fromStaff = fromStaff;
this.appid = appid;
}
@ -315,9 +342,16 @@ public class DingtalkBusiness {
url = URLEncoder.encode(url);
url = "dingtalk://dingtalkclient/page/link?pc_slide=true&url=" + url;
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
"&container_type=work_platform&app_id=0_" +
appid + "&redirect_type=jump&redirect_url=" + url;
String content = null;
if(fromStaff == null){
content = workMsgTypeEnum.getContent().replace("@", info.getName());
}else{
content = workMsgTypeEnum.getContent().replace("@", fromStaff.getName());
}
String content = workMsgTypeEnum.getContent().replace("@", info.getName());
StaffEntity entity = new StaffEntity();
entity.setId(info.getId());
entity.setEmployeeId(info.getEmployeeId());