Commit d0a4af4e authored by chenzhao's avatar chenzhao

修改待办任务 给执行人只发送任务不发送消息通知

parent af0b28af
......@@ -884,10 +884,13 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
log.info(String.format("计划对象:%s", JSON.toJSON(plan)));
List<String> result = new ArrayList<>();
if (plan.getUserId() != null){
String userIdString = plan.getUserId();
FeignClientResult amosIdListByUserIds = jcsFeignClient.getAmosIdListByUserIds(userIdString);
result = (List<String>) amosIdListByUserIds.getResult();
}
String userIdString = plan.getUserId();
FeignClientResult amosIdListByUserIds = jcsFeignClient.getAmosIdListByUserIds(userIdString);
List<String> result = (List<String>) amosIdListByUserIds.getResult();
// 规则推送消息
extraUserIds.removeAll(result);//给执行人只发送待办 不发通知
......@@ -900,7 +903,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// List<String> userIdList = Arrays.asList(userIdArr);
// 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.任务型计划生成, result);
// 根据bug5569
// 根据bug5569
}
}
......
......@@ -27,10 +27,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Author: xl
......@@ -96,22 +93,30 @@ public class RulePlanService {
planRo.setIsSendApp(true);
}
if (ValidationUtil.isEmpty(userIds)) {
// 计划牵头责任人
String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())) {
leadPeopleIds += "," + plan.getUserId();
}
userIds = (List<String>) jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult();
}
//此处判断会导致给执行人和牵头人消息及任务都发送,产生Bug 先去除,如后续业务需要,在外层修改
// if (ValidationUtil.isEmpty(userIds)) {
// // 计划牵头责任人
// String leadPeopleIds = plan.getLeadPeopleIds();
// if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())) {
// leadPeopleIds += "," + plan.getUserId();
// }
// userIds = (List<String>) jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult();
// }
if (!ValidationUtil.isEmpty(extraUserIds)) {
List<String> finalUserIds = userIds;
extraUserIds.forEach(id -> {
if (!finalUserIds.contains(id)) {
finalUserIds.add(id);
}
});
userIds = finalUserIds;
if (!ValidationUtil.isEmpty(finalUserIds)) {
extraUserIds.forEach(id -> {
if (!finalUserIds.contains(id)) {
finalUserIds.add(id);
}
});
}
if (!ValidationUtil.isEmpty(finalUserIds)){
userIds = finalUserIds;
}else {
userIds = extraUserIds;
}
}
planRo.setSendTime(DateUtil.date2LongStr(new Date()));
planRo.setRecivers(userIds);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment