|
@@ -64,9 +64,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
@Resource
|
|
|
TFCustomFlowService tfCustomFlowService;
|
|
|
|
|
|
- @Resource
|
|
|
- TFFlowApproveService tfFlowApproveService;
|
|
|
-
|
|
|
@Resource
|
|
|
TSJobRemindService tsJobRemindService;
|
|
|
|
|
@@ -521,41 +518,48 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(tfCustomFlowEntity.getFlowId())).singleResult();
|
|
|
if (Objects.nonNull(task) && (tfFlowApprove.getStatus() != FlowStatusEnum.DRAFT && tfFlowApprove.getStatus() != FlowStatusEnum.FINISH && tfFlowApprove.getStatus() != FlowStatusEnum.END)) {
|
|
|
Long processLimitedTime = null;
|
|
|
+ String execField = null;
|
|
|
if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {//教务处sop
|
|
|
if (tfFlowApprove.getSetup().intValue() == 2) {//项目关键信息
|
|
|
FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
|
|
|
processLimitedTime = this.getProcessLimitedTime(flowTaskResult, SystemConstant.PROJECT_KEY_INFO_DATE);
|
|
|
+ execField = SystemConstant.PROJECT_KEY_INFO_DATE;
|
|
|
} else if (tfFlowApprove.getSetup().intValue() == 3 || tfFlowApprove.getSetup().intValue() == 4) {//大区经理内审或工程师内审
|
|
|
processLimitedTime = tfFlowApprove.getUpdateTime();
|
|
|
} else if (tfFlowApprove.getSetup().intValue() == 6) {//扫描准备
|
|
|
FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
|
|
|
processLimitedTime = this.getProcessLimitedTime(flowTaskResult, SystemConstant.SCAN_START_TIME);
|
|
|
+ execField = SystemConstant.SCAN_START_TIME;
|
|
|
} else if (tfFlowApprove.getSetup().intValue() == 8) {//校验收尾
|
|
|
FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
|
|
|
processLimitedTime = this.getProcessLimitedTime(flowTaskResult, SystemConstant.SCAN_END_TIME);
|
|
|
+ execField = SystemConstant.SCAN_END_TIME;
|
|
|
} else if (tfFlowApprove.getSetup().intValue() == 9) {//评卷准备
|
|
|
FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
|
|
|
processLimitedTime = this.getProcessLimitedTime(flowTaskResult, SystemConstant.MARK_START_TIME);
|
|
|
+ execField = SystemConstant.MARK_START_TIME;
|
|
|
} else if (tfFlowApprove.getSetup().intValue() == 10) {//评卷收尾
|
|
|
FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
|
|
|
processLimitedTime = this.getProcessLimitedTime(flowTaskResult, SystemConstant.MARK_END_TIME);
|
|
|
+ execField = SystemConstant.MARK_END_TIME;
|
|
|
} else if (tfFlowApprove.getSetup().intValue() == 11) {//设备入库登记
|
|
|
FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
|
|
|
processLimitedTime = this.getProcessLimitedTime(flowTaskResult, SystemConstant.SERVICE_FINISH_PLAN_DATE);
|
|
|
+ execField = SystemConstant.SERVICE_FINISH_PLAN_DATE;
|
|
|
}
|
|
|
} else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop
|
|
|
|
|
|
}
|
|
|
List<TSJobRemind> tsJobRemindList = new ArrayList<>();
|
|
|
if (Objects.nonNull(task.getAssignee())) {
|
|
|
- tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.BEFORE, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(), processLimitedTime, sysUser.getId()));
|
|
|
- tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(), processLimitedTime, sysUser.getId()));
|
|
|
+ tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.BEFORE, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(), processLimitedTime, execField, sysUser.getId()));
|
|
|
+ tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(), processLimitedTime, execField, sysUser.getId()));
|
|
|
} else {
|
|
|
List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
|
|
|
if (!CollectionUtils.isEmpty(identityLinkList)) {
|
|
|
for (IdentityLink i : identityLinkList) {
|
|
|
- tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(i.getTaskId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.BEFORE, Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), processLimitedTime, sysUser.getId()));
|
|
|
- tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(i.getTaskId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), processLimitedTime, sysUser.getId()));
|
|
|
+ tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(i.getTaskId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.BEFORE, Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), processLimitedTime, execField, sysUser.getId()));
|
|
|
+ tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(i.getTaskId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), processLimitedTime, execField, sysUser.getId()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -563,6 +567,45 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * sop编辑
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public FlowResult sopEdit(Long id) {
|
|
|
+ Optional.ofNullable(id).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("sopId不能为空"));
|
|
|
+ TBSopInfo tbSopInfo = this.getById(id);
|
|
|
+ Optional.ofNullable(tbSopInfo).orElseThrow(() -> ExceptionResultEnum.SOP_INFO_NO_DATA.exception());
|
|
|
+
|
|
|
+ TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getCode, tbSopInfo.getSopNo()));
|
|
|
+ Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
+
|
|
|
+ return JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * sop保存
|
|
|
+ *
|
|
|
+ * @param sopSaveParam
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public Boolean sopSave(SopSaveParam sopSaveParam) {
|
|
|
+ TBSopInfo tbSopInfo = this.getById(sopSaveParam.getId());
|
|
|
+ Optional.ofNullable(tbSopInfo).orElseThrow(() -> ExceptionResultEnum.SOP_INFO_NO_DATA.exception());
|
|
|
+
|
|
|
+ TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getCode, tbSopInfo.getSopNo()));
|
|
|
+ Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
+
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ tfCustomFlowEntity.updateInfo(sysUser.getId());
|
|
|
+ tfCustomFlowEntity.setFlowProcessVar(sopSaveParam.getFormProperties());
|
|
|
+ return tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取表单内容
|
|
|
*
|