Commit c0317601 authored by 刘林's avatar 刘林

fix(jg):已纳管管道编辑bug处理

parent 70a2fb63
......@@ -31,7 +31,10 @@ public class NewProjectEditUpdateService {
public void updateBizInfo(String projectContraptionId) {
IdxBizJgProjectContraption projectContraption = commonEquipDataProcessService.getIdxBizJgProjectContraptionServiceImpl().getOne(new LambdaQueryWrapper<IdxBizJgProjectContraption>().eq(BaseEntity::getSequenceNbr, projectContraptionId).select(BaseEntity::getSequenceNbr, IdxBizJgProjectContraption::getUseRegistrationCode));
// 按照装置id查询装置下管道,更新为已纳管状态写入使用登记证编号
List<IdxBizJgUseInfo> useInfos = useInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>().eq(IdxBizJgUseInfo::getProjectContraptionId, projectContraptionId).eq(IdxBizJgUseInfo::getIsIntoManagement, false).select(IdxBizJgUseInfo::getRecord, TzsBaseEntity::getSequenceNbr));
List<IdxBizJgUseInfo> useInfos = useInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>()
.eq(IdxBizJgUseInfo::getProjectContraptionId, projectContraptionId)
//.eq(IdxBizJgUseInfo::getIsIntoManagement, false)修改已纳管管道编辑使用登记证号,不更新bug
.select(IdxBizJgUseInfo::getRecord, TzsBaseEntity::getSequenceNbr));
useInfos.parallelStream().forEach(e -> {
commonEquipDataProcessService.setNewPipelineUseState(e, projectContraption.getUseRegistrationCode());
commonEquipDataProcessService.updateUseOrgCode2NewPipeline(e, projectContraption.getUseRegistrationCode());
......
......@@ -1137,7 +1137,10 @@ public class CommonEquipDataProcessService {
}
public void updatePipeline2InUse(String projectContraptionId, String useRegistrationCode) {
List<IdxBizJgUseInfo> useInfos = idxBizJgUseInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>().eq(IdxBizJgUseInfo::getProjectContraptionId, projectContraptionId).eq(IdxBizJgUseInfo::getIsIntoManagement, false).select(TzsBaseEntity::getSequenceNbr, IdxBizJgUseInfo::getRecord));
List<IdxBizJgUseInfo> useInfos = idxBizJgUseInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>()
.eq(IdxBizJgUseInfo::getProjectContraptionId, projectContraptionId)
.eq(IdxBizJgUseInfo::getIsIntoManagement, false)
.select(TzsBaseEntity::getSequenceNbr, IdxBizJgUseInfo::getRecord));
useInfos.parallelStream().forEach(e -> {
this.setNewPipelineUseState(e, useRegistrationCode);
this.updateUseOrgCode2NewPipeline(e, useRegistrationCode);
......
......@@ -206,6 +206,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private static final Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
public static final String CAR_NUMBER = "CAR_NUMBER";
public static final String USE_UNIT_NAME = "USE_UNIT_NAME";
private static final String PRODUCT_NAME = "PRODUCT_NAME";
// 需要转化成jsonObject的附件字段
public static String[] jsonFields = {"insOtherAccessories", "installContractAttachment", "installProxyStatementAttachment"};
private final List<String> resultError = new ArrayList<>();
......@@ -2746,6 +2747,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
pBuilder.must(QueryBuilders.matchPhraseQuery("USE_PLACE", "*" + param + "*"));
boolMust.must(pBuilder);
}
// 设备名称
if (!ObjectUtils.isEmpty(map.getString(PRODUCT_NAME))) {
BoolQueryBuilder elcBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString(PRODUCT_NAME));
elcBuilder.must(QueryBuilders.matchPhraseQuery(PRODUCT_NAME, test));
boolMust.must(elcBuilder);
}
// 设备状态
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE"))) {
BoolQueryBuilder esBuilder = QueryBuilders.boolQuery();
......
......@@ -25,7 +25,9 @@ import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationUnitService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest;
import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext;
import com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext;
import com.yeejoin.amos.boot.module.jg.biz.edit.permission.FillingEditPermForCurrentUser;
import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
......@@ -327,6 +329,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
*/
@GlobalTransactional(rollbackFor = Exception.class)
public JgChangeRegistrationUnitDto updateInstallationNotice(String submitType, JgChangeRegistrationUnitDto noticeDto, String op, ReginParams reginParams) {
try {
if (Objects.isNull(noticeDto) || StringUtils.isEmpty(submitType)) {
throw new IllegalArgumentException("参数不能为空");
}
......@@ -496,6 +499,17 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
return noticeDto;
} catch (BadRequest | LocalBadRequest e) {
log.error(e.getMessage(), e);
this.rollBackForDelRedisData();
throw e;
} catch (Exception e) {
log.error(e.getMessage(), e);
this.rollBackForDelRedisData();
throw new BadRequest(e.getMessage());
} finally {
FlowingEquipRedisContext.clean();
}
}
/**
......@@ -802,6 +816,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Override
@GlobalTransactional(rollbackFor = Exception.class)
public List<JgChangeRegistrationUnitDto> saveNotice(String submitType, JSONObject map, ReginParams reginParams) {
try {
JgChangeRegistrationUnitDto model = BeanUtil.toBeanIgnoreError(map.get("changeRegisInfo"), JgChangeRegistrationUnitDto.class);
Map<String, Object> tableData = (Map<String, Object>) map.get("changeRegisInfo");
String[] taskName = new String[]{"流程结束"};
......@@ -995,6 +1010,23 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.eq(JgRegistrationHistory::getCurrentDocumentId, registrationUnit.getApplyNo()));
registrationHistoryService.save(jgRegistrationHistory);
return Collections.singletonList(model);
} catch (BadRequest | LocalBadRequest e) {
log.error(e.getMessage(), e);
this.rollBackForDelRedisData();
throw e;
} catch (Exception e) {
log.error(e.getMessage(), e);
this.rollBackForDelRedisData();
throw new BadRequest(e.getMessage());
} finally {
FlowingEquipRedisContext.clean();
}
}
private void rollBackForDelRedisData() {
FlowingEquipRedisContext.getContext().forEach(e -> {
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).delDataForCheckWithKey(e.getData(), e.getRedisKey());
});
}
public void setEquAddress(JgChangeRegistrationUnitDto model) {
......
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