Commit dff7c98e authored by suhuiguang's avatar suhuiguang

feat(jg): 压力管道后续业务

1.自测bug修改,流程完成后更新历史json
parent f610bc2e
......@@ -70,11 +70,7 @@ public class JgEnableDisableController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "停用启用执行流程", notes = "执行流程")
@RestEventTrigger(value = "operateLogRestEventHandler")
public ResponseModel<Object> flowExecute(@RequestBody JSONObject map) {
jgEnableDisableServiceImpl.flowExecute(Long.valueOf(String.valueOf(map.get("sequenceNbr"))),
String.valueOf(map.get("instanceId")),
String.valueOf(map.get("operate")),
String.valueOf(map.get("comment")),
String.valueOf(map.get("nextTaskId")), getSelectedOrgInfo());
jgEnableDisableServiceImpl.flowExecute(map, getSelectedOrgInfo());
return ResponseHelper.buildResponse("ok");
}
......
......@@ -2267,11 +2267,10 @@ public class CommonServiceImpl implements ICommonService {
lambda.eq(JgRegistrationHistory::getCurrentDocumentId, currentDocumentId);
lambda.eq(JgRegistrationHistory::getIsDelete, false);
Integer integer = jgRegistrationHistoryService.getBaseMapper().selectCount(lambda);
if (integer > 0) {
jgRegistrationHistory.setChangeData(JSON.toJSONString(json));
if (integer > 0) {
jgRegistrationHistoryService.update(jgRegistrationHistory, lambda);
} else {
jgRegistrationHistory.setChangeData(JSON.toJSONString(json));
jgRegistrationHistory.setStatus("new");
jgRegistrationHistory.setRegistrationClass(registrationClass);
jgRegistrationHistory.setEquId(equipId);
......
......@@ -567,7 +567,12 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Transactional(rollbackFor = Exception.class)
public void flowExecute(Long id, String instanceId, String operate, String comment, String nextTaskId, ReginParams reginParams) {
public void flowExecute(JSONObject map, ReginParams reginParams) {
Long id = map.getLong("sequenceNbr");
String instanceId = map.getString("instanceId");
String operate = map.getString("operate");
String comment = map.getString("comment");
String nextTaskId = map.getString("nextTaskId");
String lockKey = CommonServiceImpl.buildJgExecuteLockKey(instanceId);
RLock lock = redissonClient.getLock(lockKey);
try {
......@@ -602,6 +607,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
taskMap.put("model", jgEnableDisable);
// 更新业务数据
updateInfoOther(jgEnableDisable);
// 保存json历史数据
commonService.saveOrUpdateHistory(this.getRegistrationClass(jgEnableDisable), map, null, jgEnableDisable.getSequenceNbr().toString());
TaskV2Model taskV2Model1 = commonService.updateTaskModel(taskMap);
// 完成后发送数据刷新消息
this.sendDataRefreshMsg(jgEnableDisable);
......@@ -682,7 +689,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
}
private void createResume(JgEnableDisable jgEnableDisable, String routePath) {
if(!jgEnableDisable.getEquListCode().equals(EquipmentClassifityEnum.YLGD.getCode())){ // 非压力管道按照设备记录履历
if (!jgEnableDisable.getEquListCode().equals(EquipmentClassifityEnum.YLGD.getCode())) { // 非压力管道按照设备记录履历
LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, jgEnableDisable.getSequenceNbr());
List<JgEnableDisableEq> enableDisableEqs = jgEnableDisableEqService.list(queryWrapper);
......@@ -1040,7 +1047,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
public IPage<Map<String, Object>> findPipeLinePage(Page<Map<String, Object>> page, String projectContraptionId, String applyType, Map<String, Object> filters) {
IPage<Map<String, Object>> re = this.getBaseMapper().selectPipeLinePage(page, projectContraptionId, applyType, filters);
re.getRecords().forEach(item -> item.put("inspectReport", Optional.ofNullable(item.get("inspectReport")).map(r->JSON.parse(r.toString())).orElse(null)));
re.getRecords().forEach(item -> item.put("inspectReport", Optional.ofNullable(item.get("inspectReport")).map(r -> JSON.parse(r.toString())).orElse(null)));
return re;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment