|
@@ -998,10 +998,34 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
} else {
|
|
|
Objects.requireNonNull(crmProjectResult.getRegionManagerId(), "未设置大区经理");
|
|
|
try {
|
|
|
+ if (currFlowTaskResult.getSetup().intValue() == 4) {
|
|
|
+ List<Long> projectUserList = crmProjectResult.getProjectManagerList().stream()
|
|
|
+ .map(s -> s.getUserId()).collect(Collectors.toList());
|
|
|
+ if (!org.apache.commons.collections4.CollectionUtils.isEqualCollection(
|
|
|
+ Arrays.asList(crmProjectResult.getRegionManagerId()), projectUserList)) {
|
|
|
+ approveUserIds.addAll(projectUserList.stream().map(s -> String.valueOf(s))
|
|
|
+ .collect(Collectors.toList()));
|
|
|
+ } else {
|
|
|
+ approveUserIds.add(crmProjectResult.getRegionManagerId().toString());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ approveUserIds.add(crmProjectResult.getRegionManagerId().toString());
|
|
|
+ }
|
|
|
tbUserArchivesService.findByUserId(crmProjectResult.getRegionManagerId());
|
|
|
List<AllocationParam> allocationParams = new ArrayList<>();
|
|
|
allocationParams.add(new AllocationParam(SopRoleTypeEnum.PROJECT_MANAGER,
|
|
|
- Arrays.asList(crmProjectResult.getRegionManagerId()), "[系统]"));
|
|
|
+ approveUserIds.stream().map(s -> Long.parseLong(s)).collect(Collectors.toList()),
|
|
|
+ "[系统]"));
|
|
|
+ if (!CollectionUtils.isEmpty(crmProjectResult.getEngineerList())) {
|
|
|
+ allocationParams.add(new AllocationParam(SopRoleTypeEnum.ENGINEER,
|
|
|
+ crmProjectResult.getEngineerList().stream().map(s -> s.getUserId())
|
|
|
+ .collect(Collectors.toList()), "[系统]"));
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(crmProjectResult.getRegionCoordinatorList())) {
|
|
|
+ allocationParams.add(new AllocationParam(SopRoleTypeEnum.REGION_COORDINATOR,
|
|
|
+ Arrays.asList(crmProjectResult.getRegionCoordinatorList().get(0).getUserId()),
|
|
|
+ "[系统]"));
|
|
|
+ }
|
|
|
tbUserArchivesAllocationService.editCrmAllocation(
|
|
|
new UserArchivesAllocationParam(allocationParams, crmDetailId));
|
|
|
} catch (Exception e) {
|
|
@@ -1013,7 +1037,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
ResultUtil.error("人员档案里未找到派单号[" + crmProjectResult.getCrmNo() + "]大区经理角色");
|
|
|
}
|
|
|
}
|
|
|
- approveUserIds.add(crmProjectResult.getRegionManagerId().toString());
|
|
|
}
|
|
|
}
|
|
|
} else if (type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop流程待审核人
|