|
@@ -511,7 +511,6 @@ public class ActTaskController {
|
|
|
// 避免重复添加
|
|
|
List<String> list = actBusinessService.selectIRunIdentity(t.getId(), "candidate");
|
|
|
if(list==null||list.size()==0) {
|
|
|
- String ddUserIds = "";
|
|
|
// 分配了节点负责人分发给全部
|
|
|
for (LoginUser user : users) {
|
|
|
taskService.addCandidateUser(t.getId(), user.getId());
|
|
@@ -519,30 +518,35 @@ public class ActTaskController {
|
|
|
map.put("isUrl","1");
|
|
|
map.put("url","/activiti/applyList");
|
|
|
map.put("taskId",t.getId());
|
|
|
+
|
|
|
+
|
|
|
+ // 发送钉钉消息
|
|
|
+ if (oConvertUtils.isNotEmpty(user.getDingUser())){
|
|
|
+ String title = "";//actBusiness.getTitle()+"需要您审批";
|
|
|
+ String content = "";
|
|
|
+ // 质量事故单
|
|
|
+ if ("incident_ticket".equalsIgnoreCase(actBusiness.getTableName())){
|
|
|
+ content= oConvertUtils.getString(busiData.get("informant"))+
|
|
|
+ ","+oConvertUtils.getString(busiData.get("department_main"))+
|
|
|
+ ","+oConvertUtils.getString(busiData.get("accident_theme"));
|
|
|
+ title = "质量事故单";
|
|
|
+ }else if ("preparation_material_v1".equalsIgnoreCase(actBusiness.getTableName())) {
|
|
|
+ content = oConvertUtils.getString(busiData.get("ccode")) +
|
|
|
+ ","+oConvertUtils.getString(busiData.get("cvenabbname")) +
|
|
|
+ ","+oConvertUtils.getString(busiData.get("main_create_by")) +
|
|
|
+ ","+oConvertUtils.getString(busiData.get("imquantity"));
|
|
|
+ title = "备坯申请";
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(content)) {
|
|
|
+ DDMsgUtil.sendOaMessage(user.getDingUser(), user.getUsername(), title+"需要您审批", content, t.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
// 异步发消息 森语取消所有审批消息
|
|
|
// actZprocessService.sendActMessage(loginUser,user,actBusiness,task.getName(), sendMessage, sendSms, sendEmail,map);
|
|
|
}
|
|
|
taskService.setPriority(t.getId(), task.getPriority());
|
|
|
|
|
|
- // 发送钉钉消息
|
|
|
- if (oConvertUtils.isNotEmpty(ddUserIds)){
|
|
|
- String title = actBusiness.getTitle()+"需要您审批";
|
|
|
- String content = "";
|
|
|
- // 质量事故单
|
|
|
- if ("incident_ticket".equalsIgnoreCase(actBusiness.getTableName())){
|
|
|
- content= "填报人:"+oConvertUtils.getString(busiData.get("informant"))+
|
|
|
- ";责任部门:"+oConvertUtils.getString(busiData.get("department_main"))+
|
|
|
- ";主题:"+oConvertUtils.getString(busiData.get("accident_theme"));
|
|
|
- }else if ("preparation_material_v1".equalsIgnoreCase(actBusiness.getTableName())) {
|
|
|
- content = "计划单号:"+oConvertUtils.getString(busiData.get("informant")) +
|
|
|
- ";供应商:"+oConvertUtils.getString(busiData.get("cvenabbname")) +
|
|
|
- ";申请人:"+oConvertUtils.getString(busiData.get("main_create_by")) +
|
|
|
- ";申请数量:"+oConvertUtils.getString(busiData.get("imquantity"));
|
|
|
- }
|
|
|
- if (oConvertUtils.isNotEmpty(content)) {
|
|
|
- DDMsgUtil.sendOaMessage(ddUserIds, title, content, task.getId());
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
@@ -566,34 +570,34 @@ public class ActTaskController {
|
|
|
// 获取钉钉消息要发送的用户
|
|
|
List<LoginUser> allUserList = actNodeService.queryAllUser();
|
|
|
List<String> assigneeUserIdList = Arrays.asList(assignees.split(","));
|
|
|
- StringBuilder ddUserIds = new StringBuilder();
|
|
|
allUserList.forEach(u->{
|
|
|
if (oConvertUtils.isNotEmpty(u.getDingUser())){
|
|
|
- if (assigneeUserIdList.stream().filter(e->e.equals(u.getUsername())).count()>0){
|
|
|
- ddUserIds.append(u.getDingUser()+",");
|
|
|
+ if (assigneeUserIdList.stream().filter(e->e.equals(u.getUsername())).count()>0) {
|
|
|
+ // 发送钉钉消息
|
|
|
+ String title = "";//actBusiness.getTitle()+"需要您审批";
|
|
|
+ String content = "";
|
|
|
+ // 质量事故单
|
|
|
+ if ("incident_ticket".equalsIgnoreCase(actBusiness.getTableName())) {
|
|
|
+ content = oConvertUtils.getString(busiData.get("informant")) +
|
|
|
+ "," + oConvertUtils.getString(busiData.get("department_main")) +
|
|
|
+ "," + oConvertUtils.getString(busiData.get("accident_theme"));
|
|
|
+ title = "质量事故单";
|
|
|
+ } else if ("preparation_material_v1".equalsIgnoreCase(actBusiness.getTableName())) {
|
|
|
+ content = oConvertUtils.getString(busiData.get("ccode")) +
|
|
|
+ "," + oConvertUtils.getString(busiData.get("cvenabbname")) +
|
|
|
+ "," + oConvertUtils.getString(busiData.get("main_create_by")) +
|
|
|
+ "," + oConvertUtils.getString(busiData.get("imquantity"));
|
|
|
+ title = "备坯申请";
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(content)) {
|
|
|
+ DDMsgUtil.sendOaMessage(u.getDingUser(), u.getUsername(), title + "需要您审批", content, t.getId());
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // 发送钉钉消息
|
|
|
- if (ddUserIds.length()>0){
|
|
|
- String title = actBusiness.getTitle()+"需要您审批";
|
|
|
- String content = "";
|
|
|
- // 质量事故单
|
|
|
- if ("incident_ticket".equalsIgnoreCase(actBusiness.getTableName())){
|
|
|
- content= "填报人:"+oConvertUtils.getString(busiData.get("informant"))+
|
|
|
- ";责任部门:"+oConvertUtils.getString(busiData.get("department_main"))+
|
|
|
- ";主题:"+oConvertUtils.getString(busiData.get("accident_theme"));
|
|
|
- }else if ("preparation_material_v1".equalsIgnoreCase(actBusiness.getTableName())) {
|
|
|
- content = "计划单号:"+oConvertUtils.getString(busiData.get("informant")) +
|
|
|
- ";供应商:"+oConvertUtils.getString(busiData.get("cvenabbname")) +
|
|
|
- ";申请人:"+oConvertUtils.getString(busiData.get("main_create_by")) +
|
|
|
- ";申请数量:"+oConvertUtils.getString(busiData.get("imquantity"));
|
|
|
- }
|
|
|
- if (oConvertUtils.isNotEmpty(content)) {
|
|
|
- DDMsgUtil.sendOaMessage(ddUserIds.toString(), title, content, task.getId());
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|