Commit 039a3022 authored by tianbo's avatar tianbo

feat(jg): 实现超设计使用年限业务流程优化

- 新增 OverDesignDataChangeHandler 和 OverDesignEditUpdateService 处理器处理单据查看设备履历功能 - 超设计使用年限变更通过后,修改设备状态为在用状态、证状态为已登记 - 调整使用登记证查询逻辑,按记录日期降序取最新一条数据
parent 48fd74f2
package com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.overDesign;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.biz.event.CommonPublisher;
import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta;
import com.yeejoin.amos.boot.module.jg.api.dto.PipelineChangeItemDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgOverDesignServiceLife;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.DefaultBizDataChangeHandler;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* 设备停用启用编辑处理器
*/
@Component
public class OverDesignDataChangeHandler extends DefaultBizDataChangeHandler<BaseBizDataChangeEvent> {
private final OverDesignEditUpdateService overDesignEditUpdateService;
protected OverDesignDataChangeHandler(CommonPublisher routerEventPublisher, ApplicationContext applicationContext, OverDesignEditUpdateService overDesignEditUpdateService) {
super(routerEventPublisher, applicationContext);
this.overDesignEditUpdateService = overDesignEditUpdateService;
}
@Override
public String canHandleBizType() {
return BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.name();
}
@Override
public List<FieldChangeMeta> postSave(String bizId, String applyNo, ModelType model, Map<String, Object> changeData, List<FieldChangeMeta> allChangeColumns, Map<String, List<PipelineChangeItemDto>> pipelineChangeItemMap) {
return Collections.emptyList();
}
@Override
public Boolean beforeCheck(String bizId, String applyNo, ModelType model, Map<String, Object> changeData) {
return Boolean.TRUE;
}
@Override
public Set<String> getEqs(String applyNo) {
return overDesignEditUpdateService.getEqsByApplyNo(applyNo);
}
/**
* 管道专用-判断数据是实时落库,还是先存到json
*
* @param applyNo 单据号
* @return 是否需要临时存储
*/
@Override
public Boolean requiresTemporarySave(String applyNo) {
return false;
}
@Override
public Boolean bizIsFinished(String applyNo) {
JgOverDesignServiceLife overDesignServiceLife = overDesignEditUpdateService.getOverDesignServiceLifeService().getOne(new LambdaQueryWrapper<JgOverDesignServiceLife>().eq(JgOverDesignServiceLife::getApplyNo, applyNo).select(BaseEntity::getSequenceNbr, JgOverDesignServiceLife::getStatus));
return overDesignServiceLife.getStatus().equals(FlowStatusEnum.TO_BE_FINISHED.getName());
}
@Override
public Set<String> getProjectContraptionIds(String applyNo) {
return new HashSet<>();
}
@Override
public void preSave(String bizId, String applyNo, ModelType model, Map<String, Object> changeData) {
}
}
package com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.overDesign;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jg.api.entity.JgOverDesignServiceLife;
import com.yeejoin.amos.boot.module.jg.api.entity.JgOverDesignServiceLifeEq;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgOverDesignServiceLifeEqServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgOverDesignServiceLifeServiceImpl;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@Getter
public class OverDesignEditUpdateService {
private final JgOverDesignServiceLifeServiceImpl overDesignServiceLifeService;
private final JgOverDesignServiceLifeEqServiceImpl overDesignServiceLifeEqService;
public Set<String> getEqsByApplyNo(String applyNo) {
JgOverDesignServiceLife overDesignServiceLifeServiceOne = overDesignServiceLifeService.getOne(new LambdaQueryWrapper<JgOverDesignServiceLife>().eq(JgOverDesignServiceLife::getApplyNo, applyNo).select(BaseEntity::getSequenceNbr));
List<JgOverDesignServiceLifeEq> eqs = overDesignServiceLifeEqService.list(new LambdaQueryWrapper<JgOverDesignServiceLifeEq>().eq(JgOverDesignServiceLifeEq::getOverDesignId, overDesignServiceLifeServiceOne.getSequenceNbr()).select(JgOverDesignServiceLifeEq::getEquId, BaseEntity::getSequenceNbr));
return eqs.stream().map(JgOverDesignServiceLifeEq::getEquId).collect(Collectors.toSet());
}
public JgOverDesignServiceLife getOneByApplyNo(String applyNo) {
return overDesignServiceLifeService.getOne(new LambdaQueryWrapper<JgOverDesignServiceLife>().eq(JgOverDesignServiceLife::getApplyNo, applyNo));
}
}
\ No newline at end of file
...@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -20,13 +21,17 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; ...@@ -20,13 +21,17 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil; import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dao.EsEquipmentDao;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo;
import com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.*; import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgResumeInfoEqMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgOverDesignServiceLifeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgOverDesignServiceLifeService;
import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest; 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.EquipUsedCheckStrategyContext;
...@@ -35,12 +40,13 @@ import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent; ...@@ -35,12 +40,13 @@ import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent;
import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher; import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -74,6 +80,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -74,6 +80,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
...@@ -82,7 +89,6 @@ import java.util.concurrent.TimeUnit; ...@@ -82,7 +89,6 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationNameServiceImpl.DB_BATCH_SIZE;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
/** /**
...@@ -122,6 +128,9 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -122,6 +128,9 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private final DataDictionaryServiceImpl dataDictionaryServiceImpl; private final DataDictionaryServiceImpl dataDictionaryServiceImpl;
private final JgCertificateChangeRecordServiceImpl jgCertificateChangeRecordService; private final JgCertificateChangeRecordServiceImpl jgCertificateChangeRecordService;
private final JgCertificateChangeRecordEqServiceImpl jgCertificateChangeRecordEqService; private final JgCertificateChangeRecordEqServiceImpl jgCertificateChangeRecordEqService;
private final IdxBizJgUseInfoServiceImpl jgUseInfoService;
private final ESEquipmentCategory esEquipmentCategory;
private final EsEquipmentDao esEquipmentDao;
/** /**
* 分页查询 * 分页查询
...@@ -635,10 +644,6 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -635,10 +644,6 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private void updateEquipMessage(JSONObject jsonObject, TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife) { private void updateEquipMessage(JSONObject jsonObject, TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife) {
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) jsonObject.get("equipmentLists"); List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) jsonObject.get("equipmentLists");
List<String> useOrgCodes = equipmentLists.stream()
.map(obj -> Objects.toString(obj.get("useOrgCode"), ""))
.distinct()
.collect(Collectors.toList());
List<String> records = equipmentLists.stream() List<String> records = equipmentLists.stream()
.map(v -> Objects.toString(v.get("record"), "")) .map(v -> Objects.toString(v.get("record"), ""))
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -650,7 +655,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -650,7 +655,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
// this.updateOrCreateInspectionDetection(equipmentLists); // this.updateOrCreateInspectionDetection(equipmentLists);
this.sendOverDesignMessage(equipmentLists); this.sendOverDesignMessage(equipmentLists);
this.updateDesignInfo(taskV2Model, jgOverDesignServiceLife, equipmentLists, designInfoList); this.updateDesignInfo(taskV2Model, jgOverDesignServiceLife, equipmentLists, designInfoList);
this.updateRegistrationManage(useOrgCodes, jgOverDesignServiceLife, designInfoList, taskV2Model); this.updateRegistrationManage(jgOverDesignServiceLife, records, taskV2Model);
} }
private Date castDate2TimeStr(String date) { private Date castDate2TimeStr(String date) {
...@@ -782,29 +787,28 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -782,29 +787,28 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
} }
} }
private void updateRegistrationManage(List<String> useOrgCodes, JgOverDesignServiceLife jgOverDesignServiceLife, List<IdxBizJgDesignInfo> designInfoList, TaskV2Model taskV2Model) { private void updateRegistrationManage(JgOverDesignServiceLife jgOverDesignServiceLife, List<String> equipRecords, TaskV2Model taskV2Model) {
List<JgUseRegistrationManage> registrationList = useRegistrationManageService.lambdaQuery() JgUseRegistrationManage registrationManage = useRegistrationManageService.lambdaQuery()
.in(JgUseRegistrationManage::getUseRegistrationCode, useOrgCodes) .in(JgUseRegistrationManage::getUseRegistrationCode, jgOverDesignServiceLife.getUseRegistrationCode())
.eq(JgUseRegistrationManage::getIsDelete, 0) .eq(JgUseRegistrationManage::getIsDelete, 0)
.eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName()) .orderByDesc(JgUseRegistrationManage::getRecDate)
.list(); .last("limit 1")
.one();
if (!CollectionUtils.isEmpty(registrationList)) { if (!ValidationUtil.isEmpty(registrationManage)) {
registrationList.forEach(v -> { registrationManage.setIsOverDesign("1");
v.setIsOverDesign("1"); registrationManage.setVersion(registrationManage.getVersion() + 1);
v.setVersion(v.getVersion() + 1); registrationManage.setAuditPassDate(new Date());
}); // 注销的证改为已登记
useRegistrationManageService.updateBatchById(registrationList); registrationManage.setCertificateStatus(CertificateStatusEnum.YIDENGJI.getName());
} useRegistrationManageService.updateById(registrationManage);
FeignClientResult<AgencyUserModel> agencyUserResult = Privilege.agencyUserClient.queryByUserId(jgOverDesignServiceLife.getCreateUserId()); FeignClientResult<AgencyUserModel> agencyUserResult = Privilege.agencyUserClient.queryByUserId(jgOverDesignServiceLife.getCreateUserId());
String realName = agencyUserResult.getResult().getRealName(); String realName = agencyUserResult.getResult().getRealName();
List<JgCertificateChangeRecord> certificateChangeRecords = new ArrayList<>();
List<JgCertificateChangeRecordEq> certificateChangeRecordEqs = new ArrayList<>(); List<JgCertificateChangeRecordEq> certificateChangeRecordEqs = new ArrayList<>();
Date now = new Date(); Date now = new Date();
for (JgUseRegistrationManage v : registrationList) {
JgCertificateChangeRecord record = new JgCertificateChangeRecord(); JgCertificateChangeRecord record = new JgCertificateChangeRecord();
record.setApplyNo(jgOverDesignServiceLife.getApplyNo()); record.setApplyNo(jgOverDesignServiceLife.getApplyNo());
record.setReceiveOrgName(jgOverDesignServiceLife.getReceiveOrgName()); record.setReceiveOrgName(jgOverDesignServiceLife.getReceiveOrgName());
...@@ -820,27 +824,36 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -820,27 +824,36 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
record.setCreateDate(now); record.setCreateDate(now);
record.setCreateUserId(jgOverDesignServiceLife.getCreateUserId()); record.setCreateUserId(jgOverDesignServiceLife.getCreateUserId());
record.setUseRegistrationCode(jgOverDesignServiceLife.getUseRegistrationCode()); record.setUseRegistrationCode(jgOverDesignServiceLife.getUseRegistrationCode());
record.setCertificateNo(v.getCertificateNo()); record.setCertificateNo(registrationManage.getCertificateNo());
record.setUseUnitCreditCode(jgOverDesignServiceLife.getUseUnitCreditCode()); record.setUseUnitCreditCode(jgOverDesignServiceLife.getUseUnitCreditCode());
record.setUseUnitName(jgOverDesignServiceLife.getUseUnitName()); record.setUseUnitName(jgOverDesignServiceLife.getUseUnitName());
record.setEquCategory(jgOverDesignServiceLife.getEquCategoryName()); record.setEquCategory(jgOverDesignServiceLife.getEquCategoryName());
record.setReceiveCompanyCode(jgOverDesignServiceLife.getReceiveOrgCode()); record.setReceiveCompanyCode(jgOverDesignServiceLife.getReceiveOrgCode());
record.setRoutePath(taskV2Model.getRoutePath()); record.setRoutePath(taskV2Model.getRoutePath());
certificateChangeRecords.add(record); jgCertificateChangeRecordService.save(record);
}
jgCertificateChangeRecordService.saveBatch(certificateChangeRecords); if (!ValidationUtil.isEmpty(equipRecords)) {
for (JgCertificateChangeRecord record : certificateChangeRecords) { equipRecords.forEach(r -> {
List<JgCertificateChangeRecordEq> eqs = designInfoList.stream()
.map(p -> {
JgCertificateChangeRecordEq eq = new JgCertificateChangeRecordEq(); JgCertificateChangeRecordEq eq = new JgCertificateChangeRecordEq();
eq.setEquId(p.getRecord()); eq.setEquId(r);
eq.setChangeRecordId(record.getSequenceNbr().toString()); eq.setChangeRecordId(record.getSequenceNbr().toString());
return eq; certificateChangeRecordEqs.add(eq);
}).collect(toList()); });
certificateChangeRecordEqs.addAll(eqs);
}
jgCertificateChangeRecordEqService.saveBatch(certificateChangeRecordEqs); jgCertificateChangeRecordEqService.saveBatch(certificateChangeRecordEqs);
// 注销的设备状态改为在用
jgUseInfoService.update(new UpdateWrapper<IdxBizJgUseInfo>().lambda()
.in(IdxBizJgUseInfo::getRecord, equipRecords)
.set(IdxBizJgUseInfo::getEquState, String.valueOf(EquipmentEnum.ZAIYONG.getCode())));
// 更新es设备状态字段
Iterable<ESEquipmentCategoryDto> jgAllEsDtos = esEquipmentCategory.findAllById(equipRecords);
jgAllEsDtos.forEach(dto -> dto.setEQU_STATE(EquipmentEnum.ZAIYONG.getCode()));
esEquipmentCategory.saveAll(jgAllEsDtos);
Iterable<ESEquipmentInfo> newEsDtos = esEquipmentDao.findAllById(equipRecords);
newEsDtos.forEach(dto -> dto.setEQU_STATE(EquipmentEnum.ZAIYONG.getCode()));
esEquipmentDao.saveAll(newEsDtos);
}
}
} }
private void buildTask(JgOverDesignServiceLife jgOverDesignServiceLife, WorkflowResultDto workflowResultDto) { private void buildTask(JgOverDesignServiceLife jgOverDesignServiceLife, WorkflowResultDto workflowResultDto) {
...@@ -974,7 +987,8 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -974,7 +987,8 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
useRegistrationManageService.lambdaQuery() useRegistrationManageService.lambdaQuery()
.eq(JgUseRegistrationManage::getUseRegistrationCode, useOrgCode) .eq(JgUseRegistrationManage::getUseRegistrationCode, useOrgCode)
.eq(JgUseRegistrationManage::getIsDelete, 0) .eq(JgUseRegistrationManage::getIsDelete, 0)
.eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName()) .orderByDesc(JgUseRegistrationManage::getRecDate)
.last("limit 1")
.one(); .one();
if (registration == null) { if (registration == null) {
throw new BadRequest("未查询到使用登记信息"); throw new BadRequest("未查询到使用登记信息");
...@@ -1132,7 +1146,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -1132,7 +1146,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
Optional.ofNullable(dataDictionaryServiceImpl.getByCode(info.getInspectConclusion(), "JYJL")) Optional.ofNullable(dataDictionaryServiceImpl.getByCode(info.getInspectConclusion(), "JYJL"))
.map(DataDictionary::getName) .map(DataDictionary::getName)
.orElse("")); .orElse(""));
result.put("inspectReport", Optional.ofNullable(info.getInspectReport()).orElse("{}")); result.put("inspectReport", Optional.ofNullable(info.getInspectReport()).orElse("[]"));
result.put("jySeq", info.getSequenceNbr()); result.put("jySeq", info.getSequenceNbr());
if (overDesignServiceLifeEq != null) { if (overDesignServiceLifeEq != null) {
result.put("safetyAssessmentName", overDesignServiceLifeEq.getSafetyAssessmentName()); result.put("safetyAssessmentName", overDesignServiceLifeEq.getSafetyAssessmentName());
......
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