Commit d0a4af4e authored by chenzhao's avatar chenzhao

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

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