diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java index b7a69b8..513b05c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java @@ -69,24 +69,18 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl() {{ - eq(InnerDangerEntity::getCode, innerDangerEntity.getCode()); - last("limit 1"); - }}); - BeanUtil.copy(saveEntity,hiddenDangerVo); - R r = this.startProcess(JSONObject.toJSONString(hiddenDangerVo), HIDDEN_DANGER_CHECK); + String saved = saveEntity(JSONObject.toJSONString(hiddenDangerVo)); + R r = this.startProcess(saved, HIDDEN_DANGER_CHECK); return r; } @Override - @Transactional public String saveEntity(String entity) { - InnerDangerEntity innerDangerEntity= JSONObject.parseObject(entity, InnerDangerEntity.class); + InnerDangerVo hiddenDangerVo= JSONObject.parseObject(entity, InnerDangerVo.class); + InnerDangerEntity innerDangerEntity = new InnerDangerEntity(); + BeanUtil.copy(hiddenDangerVo, innerDangerEntity); if (Func.isEmpty(innerDangerEntity.getCode())) { innerDangerEntity.setCode(UUID.randomUUID().toString()); } @@ -114,7 +108,8 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl" + innerDangerVo.getHiddenDangerName(); + String processName = "[" + userName + "] 发起 " + "【风险点:" + innerDangerVo.getRiskPointName() + "】隐患处理流程" + "——>" + innerDangerEntity.getHiddenDangerName(); // 开启新的隐患处理流程 Map variable = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(innerDangerVo, DateUtil.PATTERN_DATETIME), Map.class); - R result = processClient.startProcessInstanceContainNameByKey(HIDDEN_DANGER_CHECK, innerDangerVo.getId().toString(), processName, variable); + R result = processClient.startProcessInstanceContainNameByKey(dictValue, innerDangerVo.getId().toString(), processName, variable); // 流程开启失败 if (!result.isSuccess()) { innerDangerEntity.setIsNormal(false); innerDangerEntity.setRemark(JSONObject.toJSONString(variable)); - this.baseMapper.updateById(innerDangerEntity); + this.baseMapper.updateById(innerDangerVo); log.error("隐患处理流程开启失败,错误描述 : {}", result); R r=new R(); r.setCode(result.getCode());