|
@@ -122,7 +122,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
TSJobRemindService tsJobRemindService;
|
|
|
|
|
|
@Resource
|
|
|
- TBDeviceDeliveryService tbDeviceDeliveryService;
|
|
|
+ SysUserRoleService sysUserRoleService;
|
|
|
|
|
|
@Resource
|
|
|
TBCrmDetailService tbCrmDetailService;
|
|
@@ -133,6 +133,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
@Resource
|
|
|
ActivitiService activitiService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TBUserArchivesService tbUserArchivesService;
|
|
|
+
|
|
|
/**
|
|
|
* 根据deploymentId查找processDefinitionId
|
|
|
*
|
|
@@ -825,17 +828,17 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
|
|
|
TFCustomFlow tfCustomFlow = tfCustomFlowService.findById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
|
|
|
- if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW && tfFlowApprove.getSetup().intValue() >= 4
|
|
|
- && tfFlowApprove.getSetup().intValue() < 8) {
|
|
|
- FlowTaskResult flowTaskResultDeviceOut = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 4);
|
|
|
- tbDeviceDeliveryService.updateDeviceRelated(flowTaskResultDeviceOut, tfCustomFlowEntity.getCode(), null,
|
|
|
- sysUser.getId(), false);
|
|
|
- } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
|
|
|
- && tfFlowApprove.getSetup().intValue() >= 4) {
|
|
|
- FlowTaskResult flowTaskResultDeviceOut = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 4);
|
|
|
- tbDeviceDeliveryService.updateDeviceRelated(flowTaskResultDeviceOut, tfCustomFlowEntity.getCode(),
|
|
|
- DeviceDeliveryStatusEnum.RECEIVE, sysUser.getId(), true);
|
|
|
- }
|
|
|
+ // if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW && tfFlowApprove.getSetup().intValue() >= 4
|
|
|
+ // && tfFlowApprove.getSetup().intValue() < 8) {
|
|
|
+ // FlowTaskResult flowTaskResultDeviceOut = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 4);
|
|
|
+ // tbDeviceDeliveryService.updateDeviceRelated(flowTaskResultDeviceOut, tfCustomFlowEntity.getCode(), null,
|
|
|
+ // sysUser.getId(), false);
|
|
|
+ // } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
|
|
|
+ // && tfFlowApprove.getSetup().intValue() >= 4) {
|
|
|
+ // FlowTaskResult flowTaskResultDeviceOut = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 4);
|
|
|
+ // tbDeviceDeliveryService.updateDeviceRelated(flowTaskResultDeviceOut, tfCustomFlowEntity.getCode(),
|
|
|
+ // DeviceDeliveryStatusEnum.RECEIVE, sysUser.getId(), true);
|
|
|
+ // }
|
|
|
|
|
|
FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
@@ -1007,13 +1010,6 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (tfCustomFlow.getType() == TFCustomTypeEnum.QUALITY_PROBLEM_FLOW && Objects.nonNull(currFlowTaskResult) && (
|
|
|
- currFlowTaskResult.getSetup().intValue() == 3 || currFlowTaskResult.getSetup().intValue() == 4)) {
|
|
|
- List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
|
|
|
- for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
|
- f.setValue(null);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
CrmProjectResult crmProjectResult = null;
|
|
|
if (Objects.nonNull(tfCustomFlowEntity.getCrmNo())) {
|
|
@@ -1022,6 +1018,82 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
|
|
|
Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tfCustomFlowEntity.getCrmNo());
|
|
|
}
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
|
|
|
+ if (Objects.nonNull(currFlowTaskResult) && currFlowTaskResult.getSetup().intValue() == 3) {
|
|
|
+ List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
|
|
|
+ List<FlowFormWidgetResult> flowFormWidgetResultListNew = new ArrayList<>();
|
|
|
+ if (!CollectionUtils.isEmpty(taskList) && taskList.size() > 1) {
|
|
|
+ SopRoleTypeCompositeEnum sopRoleTypeCompositeEnum = null;
|
|
|
+ jump:
|
|
|
+ for (Task task : taskList) {
|
|
|
+ if (task.getAssignee().equals(sysUser.getId().toString())) {
|
|
|
+ if (Objects.equals(crmProjectResult.getRegionManagerId().toString(),
|
|
|
+ task.getAssignee())) {//大区经理
|
|
|
+ sopRoleTypeCompositeEnum = SopRoleTypeCompositeEnum.REGION_MANAGER;
|
|
|
+ } else if (Objects.equals(
|
|
|
+ crmProjectResult.getProjectManagerList().get(0).getUserId().toString(),
|
|
|
+ task.getAssignee())) {
|
|
|
+ sopRoleTypeCompositeEnum = SopRoleTypeCompositeEnum.PROJECT_MANAGER;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
|
|
|
+ for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
|
+ if (Objects.nonNull(sopRoleTypeCompositeEnum)) {
|
|
|
+ if (Objects.nonNull(sopRoleTypeCompositeEnum) && Objects.equals(f.getRoleType(),
|
|
|
+ sopRoleTypeCompositeEnum.name()) && (Objects.isNull(f.getValue()) || Objects.equals(
|
|
|
+ f.getValue(), "{\"value\":null}") || Objects.equals(f.getValue(), "{\"value\":[]}"))
|
|
|
+ && (sopRoleTypeCompositeEnum == SopRoleTypeCompositeEnum.REGION_MANAGER
|
|
|
+ || sopRoleTypeCompositeEnum == SopRoleTypeCompositeEnum.PROJECT_MANAGER)) {
|
|
|
+ f.setReadable(false);
|
|
|
+ f.setWritable(true);
|
|
|
+ f.setRequired(true);
|
|
|
+ } else {
|
|
|
+ f.setReadable(true);
|
|
|
+ f.setWritable(false);
|
|
|
+ f.setRequired(false);
|
|
|
+ }
|
|
|
+ flowFormWidgetResultListNew.add(f);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (!CollectionUtils.isEmpty(taskList) && taskList.size() == 1) {
|
|
|
+ SopRoleTypeCompositeEnum sopRoleTypeCompositeEnum = null;
|
|
|
+ jump:
|
|
|
+ for (Task task : taskList) {
|
|
|
+ if (task.getAssignee().equals(sysUser.getId().toString())) {
|
|
|
+ if (Objects.equals(crmProjectResult.getRegionManagerId().toString(),
|
|
|
+ task.getAssignee())) {//大区经理
|
|
|
+ sopRoleTypeCompositeEnum = SopRoleTypeCompositeEnum.REGION_MANAGER;
|
|
|
+ } else if (Objects.equals(
|
|
|
+ crmProjectResult.getProjectManagerList().get(0).getUserId().toString(),
|
|
|
+ task.getAssignee())) {
|
|
|
+ sopRoleTypeCompositeEnum = SopRoleTypeCompositeEnum.PROJECT_MANAGER;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
|
|
|
+ for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
|
+ if (Objects.nonNull(sopRoleTypeCompositeEnum) && !Objects.equals(f.getRoleType(),
|
|
|
+ sopRoleTypeCompositeEnum.name())) {
|
|
|
+ f.setReadable(true);
|
|
|
+ f.setWritable(false);
|
|
|
+ }
|
|
|
+ flowFormWidgetResultListNew.add(f);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(flowFormWidgetResultListNew)) {
|
|
|
+ currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (tfCustomFlow.getType() == TFCustomTypeEnum.QUALITY_PROBLEM_FLOW && Objects.nonNull(
|
|
|
+ currFlowTaskResult) && (currFlowTaskResult.getSetup().intValue() == 3
|
|
|
+ || currFlowTaskResult.getSetup().intValue() == 4)) {
|
|
|
+ List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
|
|
|
+ for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
|
+ f.setValue(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
return new FlowViewResult(flowId, tfFlowApprove.getStatus(), tfCustomFlowEntity.getCode(), taskIdList,
|
|
|
flowTaskHistoryList, currFlowTaskResult, flowApproveHistoryList, crmProjectResult,
|
|
|
flowFormSuggestionJiaResultList, flowFormSuggestionYiResultList);
|