|
@@ -1205,7 +1205,40 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
|
|
|
TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
|
|
|
Objects.requireNonNull(tbCrmDetail, "未找到派单sop信息");
|
|
|
+
|
|
|
+ List<Long> enginessUserIds = new ArrayList<>();
|
|
|
FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
|
|
|
+ List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
|
|
|
+ for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
|
+ if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey()) && Objects.nonNull(f.getValue())
|
|
|
+ && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbCrmDetail.setScanStartTime(Long.parseLong(value));
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbCrmDetail.setScanEndTime(Long.parseLong(value));
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbCrmDetail.setMarkPaperStartTime(Long.parseLong(value));
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
+ tbCrmDetail.setMarkPaperEndTime(Long.parseLong(value));
|
|
|
+ } else if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey()) && Objects.nonNull(
|
|
|
+ f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
+ JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ enginessUserIds.add(Long.parseLong(jsonArray.getString(i)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (tfFlowApprove.getStatus() != FlowStatusEnum.FINISH && tfFlowApprove.getStatus() != FlowStatusEnum.END) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
|
|
@@ -1236,32 +1269,28 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
tbSopLogService.save(tbSopLog);
|
|
|
}
|
|
|
|
|
|
- tbDingService.resetDingExceptionBySopNo(tbSopInfo.getSopNo());
|
|
|
- }
|
|
|
- List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
|
|
|
- for (FlowFormWidgetResult f : flowFormWidgetResultList) {
|
|
|
- if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey()) && Objects.nonNull(f.getValue())
|
|
|
- && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
- String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
- tbCrmDetail.setScanStartTime(Long.parseLong(value));
|
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
|
|
|
- f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
- String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
- tbCrmDetail.setScanEndTime(Long.parseLong(value));
|
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
|
|
|
- f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
- String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
- tbCrmDetail.setMarkPaperStartTime(Long.parseLong(value));
|
|
|
- } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
|
|
|
- f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(f.getValue());
|
|
|
- String value = jsonObject.getString(SystemConstant.VALUE);
|
|
|
- tbCrmDetail.setMarkPaperEndTime(Long.parseLong(value));
|
|
|
+ ServiceScopeEnum scopeEnum = tbSopInfoService.findServiceScope(tfCustomFlow.getType(), flowTaskResult);
|
|
|
+ if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {//教务处sop流程待审核人
|
|
|
+ List<AllocationParam> allocationParams = new ArrayList<>();
|
|
|
+ if (Objects.nonNull(scopeEnum) && scopeEnum == ServiceScopeEnum.SCAN
|
|
|
+ && tfFlowApprove.getSetup().intValue() > 3) {
|
|
|
+ allocationParams.add(new AllocationParam(SopRoleTypeEnum.PROJECT_MANAGER,
|
|
|
+ Arrays.asList(crmProjectResult.getRegionManagerId()), "[系统]"));
|
|
|
+ } else if (Objects.nonNull(scopeEnum) && scopeEnum == ServiceScopeEnum.SCAN_MARK) {
|
|
|
+ allocationParams.add(new AllocationParam(SopRoleTypeEnum.PROJECT_MANAGER,
|
|
|
+ Arrays.asList(crmProjectResult.getProjectManagerList().get(0).getUserId()), "[系统]"));
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(allocationParams)) {
|
|
|
+ tbSopInfoService.sopApproverExchange(tbCrmDetail.getId(), new SopAllocationParam(
|
|
|
+ new UserArchivesAllocationParam(allocationParams, tbCrmDetail.getId())));
|
|
|
+ allocationParams.add(new AllocationParam(SopRoleTypeEnum.ENGINEER, enginessUserIds, "[系统]"));
|
|
|
+ tbUserArchivesAllocationService.editCrmAllocation(
|
|
|
+ new UserArchivesAllocationParam(allocationParams, tbCrmDetail.getId()));
|
|
|
+ }
|
|
|
}
|
|
|
+ tbDingService.resetDingExceptionBySopNo(tbSopInfo.getSopNo());
|
|
|
}
|
|
|
+
|
|
|
tbCrmDetailService.updateById(tbCrmDetail);
|
|
|
return tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
|
|
|
}
|