Commit 9131b77e authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_main' of http://39.100.92.250:5000/moa/amos-boot-biz…

Merge branch 'develop_tzs_main' of http://39.100.92.250:5000/moa/amos-boot-biz into develop_tzs_main
parents aacf5a54 efb3e7df
......@@ -5,8 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.annotation.RecUserNameFilling;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.*;
import lombok.experimental.Accessors;
import java.util.Date;
......@@ -22,6 +21,9 @@ import java.util.Date;
@Accessors(chain = true)
@TableName("tzs_jg_resume_info")
@RecUserNameFilling
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class JgResumeInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgResumeInfoServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -50,8 +51,8 @@ public class JgResumeInfoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveBatchResume")
@ApiOperation(httpMethod = "POST", value = "批量新增", notes = "批量新增")
public void saveBatchResume(@RequestBody List<JgResumeInfoDto> jgResumeInfoDtoList) {
jgResumeInfoServiceImpl.saveBatchResume(jgResumeInfoDtoList);
public void saveBatchResume(@RequestBody List<JgResumeInfo> jgResumeInfoList) {
jgResumeInfoServiceImpl.saveBatchResume(jgResumeInfoList);
}
/**
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfoEq;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgResumeInfoEqServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.List;
/**
* 监管履历信息关系表-气瓶用
* @author LiuLin
* @date 2026-01-29
*/
@RestController
@Api(tags = "监管履历信息关系表Api")
@RequestMapping(value = "/jg-resume-info-eq")
public class JgResumeInfoEqController extends BaseController {
@Autowired
JgResumeInfoEqServiceImpl jgResumeInfoEqServiceImpl;
/**
* 新增监管履历信息关系表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveBatchResumeEq")
@ApiOperation(httpMethod = "POST", value = "批量新增", notes = "批量新增")
public void saveBatchResumeEq(@RequestBody List<JgResumeInfoEq> jgResumeInfoEqList) {
jgResumeInfoEqServiceImpl.saveBatchResumeEq(jgResumeInfoEqList);
}
}
......@@ -367,8 +367,6 @@ public class EquipChangeDataUpdateServiceImpl {
esEquipmentCategoryDto.setUSE_UNIT_CREDIT_CODE(idxBizJgUseInfo.getUseUnitCreditCode());
esEquipmentCategoryDto.setUSE_UNIT_NAME(idxBizJgUseInfo.getUseUnitName());
esEquipmentCategoryDto.setUSE_INNER_CODE(idxBizJgUseInfo.getUseInnerCode());
esEquipmentCategoryDto.setUSC_UNIT_NAME(idxBizJgUseInfo.getUscUnitName());
esEquipmentCategoryDto.setUSC_UNIT_CREDIT_CODE(idxBizJgUseInfo.getUscUnitCreditCode());
}
public void buildOtherInfoEsData(ESEquipmentCategoryDto esEquipmentCategoryDto, IdxBizJgOtherInfo data) {
......
......@@ -45,7 +45,6 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgResumeInfoEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationManageMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
......@@ -110,7 +109,6 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
......@@ -133,9 +131,7 @@ import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.DataHandlerServiceImpl.IDX_BIZ_EQUIPMENT_INFO;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationNameServiceImpl.DB_BATCH_SIZE;
/**
* 装备分类服务实现类
......@@ -324,7 +320,7 @@ public class CommonServiceImpl implements ICommonService {
@Autowired
private CodeUtil codeUtil;
@Autowired
private JgResumeInfoEqMapper jgResumeInfoEqMapper;
private JgResumeInfoEqServiceImpl jgResumeInfoEqService;
public static final String DATA_QUALITY_SCORE = "DATA_QUALITY_SCORE";
......@@ -3504,17 +3500,11 @@ public class CommonServiceImpl implements ICommonService {
}
public void batchInsertResumeEq(Long resumeId, List<Map<String, Object>> equipmentLists) {
List<JgResumeInfoEq> list = equipmentLists.stream()
jgResumeInfoEqService.saveBatchResumeEq(equipmentLists.stream()
.map(e -> JgResumeInfoEq.builder()
.resumeId(resumeId)
.equId(String.valueOf(e.get("record")))
.build())
.collect(Collectors.toList());
for (int i = 0; i < list.size(); i += DB_BATCH_SIZE) {
jgResumeInfoEqMapper.insertBatchSomeColumn(
list.subList(i, Math.min(i + DB_BATCH_SIZE, list.size()))
);
}
.collect(Collectors.toList()));
}
}
\ No newline at end of file
......@@ -141,7 +141,7 @@ public class DataDockServiceImpl {
private final CodeUtil codeUtil;
private final CommonMapper commonMapper;
private final JgResumeInfoServiceImpl jgResumeInfoService;
private final JgResumeInfoEqMapper jgResumeInfoEqMapper;
private final JgResumeInfoEqServiceImpl jgResumeInfoEqService;
private final IdxBizJgMaintenanceRecordInfoServiceImpl idxBizJgMaintenanceRecordInfoService;
private final TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
private final Map<String, Object> resultError = new HashMap<>();
......@@ -1749,7 +1749,7 @@ public class DataDockServiceImpl {
}
private void createResumeCylinderBatch(Set<String> records, String dataSource, String equipRoutePath, CompanyBo company) {
JgResumeInfoDto dto = JgResumeInfoDto.builder()
JgResumeInfo info = JgResumeInfo.builder()
.businessType(BusinessTypeEnum.JG_NEW_EQUIP.getName())
.status("正常")
.approvalUnitCode(company.getCompanyCode())
......@@ -1757,18 +1757,13 @@ public class DataDockServiceImpl {
.changeContent(BusinessTypeEnum.JG_NEW_EQUIP.getName() + "业务办理")
.routePath(String.format(equipRoutePath, dataSource))
.build();
jgResumeInfoService.saveBatchResume(Collections.singletonList(dto));
List<JgResumeInfoEq> list = records.stream()
jgResumeInfoService.save(info);
jgResumeInfoEqService.saveBatchResumeEq(records.stream()
.map(record -> JgResumeInfoEq.builder()
.resumeId(dto.getSequenceNbr())
.resumeId(info.getSequenceNbr())
.equId(record)
.build())
.collect(Collectors.toList());
for (int i = 0; i < list.size(); i += DB_BATCH_SIZE) {
jgResumeInfoEqMapper.insertBatchSomeColumn(
list.subList(i, Math.min(i + DB_BATCH_SIZE, list.size()))
);
}
.collect(Collectors.toList()));
}
private void updatePipelineLength(Set<String> projectContraptionIdSet) {
......@@ -1776,7 +1771,7 @@ public class DataDockServiceImpl {
}
private void createResumeBatch(Set<String> records, String dataSource, String routePath, CompanyBo company) {
jgResumeInfoService.saveBatchResume(records.stream().map(record->JgResumeInfoDto.builder()
jgResumeInfoService.saveBatchResume(records.stream().map(record->JgResumeInfo.builder()
.businessType(BusinessTypeEnum.JG_NEW_EQUIP.getName())
.businessId(record)
.equId(record)
......@@ -1790,7 +1785,7 @@ public class DataDockServiceImpl {
}
private void createResumePipelineBatch(Set<String> projectContraptionIdSet, String routePath, CompanyBo company) {
jgResumeInfoService.saveBatchResume(projectContraptionIdSet.stream().map(projectContraptionId ->JgResumeInfoDto.builder()
jgResumeInfoService.saveBatchResume(projectContraptionIdSet.stream().map(projectContraptionId ->JgResumeInfo.builder()
.businessType(BusinessTypeEnum.JG_NEW_PROJECT.getName())
.businessId(projectContraptionId)
.equId(projectContraptionId)
......@@ -2082,7 +2077,7 @@ public class DataDockServiceImpl {
}
private void createResumePipeline(Long sequenceNbr, String routePath, CompanyBo company) {
jgResumeInfoService.saveBatchResume(Collections.singletonList(JgResumeInfoDto.builder()
jgResumeInfoService.saveBatchResume(Collections.singletonList(JgResumeInfo.builder()
.businessType(BusinessTypeEnum.JG_NEW_PROJECT.getName())
.businessId(sequenceNbr + "")
.equId(sequenceNbr + "")
......
......@@ -739,7 +739,7 @@ public class EquipClaimServiceImpl {
*/
public void addEquipResume(JSONObject equipInfo, BusinessTypeEnum businessTypeEnum, JgUseRegistration useRegistration) {
String record = (String) equipInfo.get(RECORD);
JgResumeInfoDto resumeInfoDto = JgResumeInfoDto.builder()
JgResumeInfo resumeInfo = JgResumeInfo.builder()
.applyNo(null)
.businessType(businessTypeEnum.getName())
.businessId(record)
......@@ -750,10 +750,8 @@ public class EquipClaimServiceImpl {
.changeContent(businessTypeEnum.getName() + "业务")
.build();
if (!ObjectUtils.isEmpty(useRegistration.getSequenceNbr())) {
resumeInfoDto.setRoutePath(useRegistrationService.buildTaskModel(useRegistration, equipInfo, getSelectedOrgInfo()));
resumeInfo.setRoutePath(useRegistrationService.buildTaskModel(useRegistration, equipInfo, getSelectedOrgInfo()));
}
JgResumeInfo resumeInfo = new JgResumeInfo();
BeanUtils.copyProperties(resumeInfoDto, resumeInfo);
jgResumeInfoService.save(resumeInfo);
}
......
......@@ -895,7 +895,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
private void createResumePipeline(Long sequenceNbr, String routePath, CompanyBo company) {
jgResumeInfoService.saveBatchResume(Collections.singletonList(JgResumeInfoDto.builder()
jgResumeInfoService.save(JgResumeInfo.builder()
.businessType(BusinessTypeEnum.JG_NEW_PROJECT.getName())
.businessId(sequenceNbr + "")
.equId(sequenceNbr + "")
......@@ -904,8 +904,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.approvalUnit(company.getCompanyName())
.changeContent(BusinessTypeEnum.JG_NEW_PROJECT.getName() + "业务办理")
.routePath(routePath)
.build())
);
.build());
}
/**
......@@ -3904,7 +3903,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
private void createResume(String record, String routePath, CompanyBo company) {
jgResumeInfoService.saveBatchResume(Collections.singletonList(JgResumeInfoDto.builder()
jgResumeInfoService.save(JgResumeInfo.builder()
.businessType(BusinessTypeEnum.JG_NEW_EQUIP.getName())
.businessId(record)
.equId(record)
......@@ -3913,8 +3912,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.approvalUnit(company.getCompanyName())
.changeContent(BusinessTypeEnum.JG_NEW_EQUIP.getName() + "业务办理")
.routePath(routePath)
.build())
);
.build());
}
public void createResumeForCylinder(String record, String routePath, CompanyBo company) {
......
......@@ -161,7 +161,7 @@ public class JgCertificateReplenishServiceImpl extends BaseService<JgCertificate
private final IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService;
private final JgCertificateReplenishMapper jgCertificateReplenishMapper;
private final JgResumeInfoServiceImpl jgResumeInfoService;
private final JgResumeInfoEqMapper jgResumeInfoEqMapper;
private final JgResumeInfoEqServiceImpl jgResumeInfoEqService;
private final IdxBizJgProjectContraptionServiceImplService jgProjectContraptionServiceImplService;
/**
......@@ -551,7 +551,7 @@ public class JgCertificateReplenishServiceImpl extends BaseService<JgCertificate
List<JgCertificateReplenishEq> replenishEqs = certificateReplenishEqService.getBaseMapper().selectList(new LambdaQueryWrapper<JgCertificateReplenishEq>()
.eq(JgCertificateReplenishEq::getCertificateReplenishId, certificateReplenish.getSequenceNbr()));
if (CylinderTypeEnum.CYLINDER.getCode().equals(certificateReplenish.getEquCategoryCode())){
JgResumeInfoDto dto = JgResumeInfoDto.builder().applyNo(certificateReplenish.getApplyNo())
JgResumeInfo info = JgResumeInfo.builder().applyNo(certificateReplenish.getApplyNo())
.businessType(BusinessTypeEnum.JG_REPLACEMENT_REGISTRATION.getName())
.businessId(String.valueOf(certificateReplenish.getSequenceNbr()))
.approvalUnit(certificateReplenish.getReceiveOrgName())
......@@ -560,20 +560,15 @@ public class JgCertificateReplenishServiceImpl extends BaseService<JgCertificate
.changeContent(BusinessTypeEnum.JG_REPLACEMENT_REGISTRATION.getName() + "业务办理")
.routePath(routePath)
.build();
jgResumeInfoService.saveBatchResume(Collections.singletonList(dto));
List<JgResumeInfoEq> list = replenishEqs.stream()
jgResumeInfoService.save(info);
jgResumeInfoEqService.saveBatchResumeEq(replenishEqs.stream()
.map(eq -> JgResumeInfoEq.builder()
.resumeId(dto.getSequenceNbr())
.resumeId(info.getSequenceNbr())
.equId(eq.getEquId())
.build())
.collect(Collectors.toList());
for (int i = 0; i < list.size(); i += DB_BATCH_SIZE) {
jgResumeInfoEqMapper.insertBatchSomeColumn(
list.subList(i, Math.min(i + DB_BATCH_SIZE, list.size()))
);
}
.collect(Collectors.toList()));
}else{
jgResumeInfoService.saveBatchResume(replenishEqs.stream().map(eq-> JgResumeInfoDto.builder().applyNo(certificateReplenish.getApplyNo())
jgResumeInfoService.saveBatchResume(replenishEqs.stream().map(eq-> JgResumeInfo.builder().applyNo(certificateReplenish.getApplyNo())
.businessType(BusinessTypeEnum.JG_REPLACEMENT_REGISTRATION.getName())
.businessId(String.valueOf(certificateReplenish.getSequenceNbr()))
.equId(eq.getEquId())
......
......@@ -702,8 +702,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
* @param routePath 详情
*/
private void createResume(JgChangeRegistrationReform jgChangeRegistrationReform, String routePath) {
jgResumeInfoService.saveBatchResume(Collections.singletonList(
JgResumeInfoDto.builder()
jgResumeInfoService.save(JgResumeInfo.builder()
.applyNo(jgChangeRegistrationReform.getApplyNo())
.businessType(BusinessTypeEnum.JG_RENOVATION_REGISTRATION.getName())
.businessId(String.valueOf(jgChangeRegistrationReform.getSequenceNbr()))
......@@ -713,9 +712,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
.status("正常")
.changeContent(BusinessTypeEnum.JG_RENOVATION_REGISTRATION.getName() + "业务办理")
.routePath(routePath)
.build()
)
);
.build());
}
/**
......@@ -724,8 +721,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
* @param routePath 详情
*/
private void createResume(JgChangeRegistrationReformEq jgChangeRegistrationReformEq, JgChangeRegistrationReform jgChangeRegistrationReform, String routePath) {
jgResumeInfoService.saveBatchResume(Collections.singletonList(
JgResumeInfoDto.builder()
jgResumeInfoService.save(JgResumeInfo.builder()
.applyNo(jgChangeRegistrationReform.getApplyNo())
.businessType(BusinessTypeEnum.JG_RENOVATION_REGISTRATION.getName())
.businessId(String.valueOf(jgChangeRegistrationReform.getSequenceNbr()))
......@@ -735,9 +731,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
.status("正常")
.changeContent(BusinessTypeEnum.JG_RENOVATION_REGISTRATION.getName() + "业务办理")
.routePath(routePath)
.build()
)
);
.build());
}
private void sendDataRefreshMsg(JgChangeRegistrationReform jgChangeRegistrationReform) {
......
......@@ -899,7 +899,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
LambdaQueryWrapper<JgChangeRegistrationTransferEq> lambda = new QueryWrapper<JgChangeRegistrationTransferEq>().lambda();
lambda.eq(JgChangeRegistrationTransferEq::getEquipTransferId, jgChangeRegistrationTransfer.getSequenceNbr());
List<JgChangeRegistrationTransferEq> changeRegistrationTransferEqs = jgChangeRegistrationTransferEqService.getBaseMapper().selectList(lambda);
jgResumeInfoService.saveBatchResume(changeRegistrationTransferEqs.stream().map(eq-> JgResumeInfoDto.builder().applyNo(jgChangeRegistrationTransfer.getApplyNo())
jgResumeInfoService.saveBatchResume(changeRegistrationTransferEqs.stream().map(eq-> JgResumeInfo.builder().applyNo(jgChangeRegistrationTransfer.getApplyNo())
.businessType(BusinessTypeEnum.JG_CHANGE_REGISTRATION.getName())
.businessId(String.valueOf(jgChangeRegistrationTransfer.getSequenceNbr()))
.equId(eq.getEquId())
......
......@@ -136,7 +136,10 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
private EventPublisher eventPublisher;
@Autowired
private JgResumeInfoServiceImpl jgResumeInfoService;
private JgResumeInfoServiceImpl jgResumeInfoService;
@Autowired
private JgResumeInfoEqServiceImpl jgResumeInfoEqService;
@Autowired
private CodeUtil codeUtil;
......@@ -479,17 +482,22 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
private void createResume(JgChangeVehicleRegistrationUnit changeVehicleRegistrationUnit , String routePath) {
List<JgChangeVehicleRegistrationUnitEq> registrationUnitEqs = getJgChangeVehicleRegistrationUnitEqs(changeVehicleRegistrationUnit);
jgResumeInfoService.saveBatchResume(registrationUnitEqs.stream().map(eq-> JgResumeInfoDto.builder().applyNo(changeVehicleRegistrationUnit.getApplyNo())
JgResumeInfo info = JgResumeInfo.builder().applyNo(changeVehicleRegistrationUnit.getApplyNo())
.businessType(BusinessTypeEnum.JG_VEHICLE_GAS_CYLINDER_CHANGE.getName())
.businessId(String.valueOf(changeVehicleRegistrationUnit.getSequenceNbr()))
.equId(eq.getEquId())
.approvalUnit(changeVehicleRegistrationUnit.getReceiveOrgName())
.approvalUnitCode(changeVehicleRegistrationUnit.getReceiveOrgCode())
.status("正常")
.changeContent(BusinessTypeEnum.JG_VEHICLE_GAS_CYLINDER_CHANGE.getName() + "业务办理")
.routePath(routePath)
.build()).collect(Collectors.toList())
);
.build();
jgResumeInfoService.save(info);
jgResumeInfoEqService.saveBatchResumeEq(registrationUnitEqs.stream()
.map(eq -> JgResumeInfoEq.builder()
.resumeId(info.getSequenceNbr())
.equId(eq.getEquId())
.build())
.collect(Collectors.toList()));
}
private List<JgChangeVehicleRegistrationUnitEq> getJgChangeVehicleRegistrationUnitEqs(JgChangeVehicleRegistrationUnit changeVehicleRegistrationUnit) {
......
......@@ -96,7 +96,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Autowired
JgResumeInfoServiceImpl jgResumeInfoService;
@Autowired
private JgResumeInfoEqMapper jgResumeInfoEqMapper;
private JgResumeInfoEqServiceImpl jgResumeInfoEqService;
@Autowired
private CommonServiceImpl commonService;
......@@ -705,35 +705,34 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
String equListCode = jgEnableDisable.getEquListCode();
// 1️⃣ 压力管道:按装置记录履历
if (EquipmentClassifityEnum.YLGD.getCode().equals(equListCode)) {
JgResumeInfoDto resume = buildBaseResume(jgEnableDisable, routePath);
JgResumeInfo resume = buildBaseResume(jgEnableDisable, routePath);
resume.setEquId(jgEnableDisable.getProjectContraptionId());
jgResumeInfoService.saveBatchResume(Collections.singletonList(resume));
jgResumeInfoService.save(resume);
return;
}
// 2️⃣ 气瓶:一条履历 + 多设备关系
if (CylinderTypeEnum.CYLINDER.getCode().equals(equListCode)) {
JgResumeInfoDto resume = buildBaseResume(jgEnableDisable, routePath);
JgResumeInfo resume = buildBaseResume(jgEnableDisable, routePath);
jgResumeInfoService.saveBatchResume(Collections.singletonList(resume));
batchInsertResumeEq(resume.getSequenceNbr(), enableDisableEqs);
this.batchInsertResumeEq(resume.getSequenceNbr(), enableDisableEqs);
return;
}
// 3️⃣ 其他设备:按设备直接记履历
List<JgResumeInfoDto> resumeList = enableDisableEqs.stream()
List<JgResumeInfo> resumeList = enableDisableEqs.stream()
.map(eq -> {
JgResumeInfoDto dto = buildBaseResume(jgEnableDisable, routePath);
JgResumeInfo dto = buildBaseResume(jgEnableDisable, routePath);
dto.setEquId(eq.getEquId());
return dto;
})
.collect(Collectors.toList());
jgResumeInfoService.saveBatchResume(resumeList);
}
private JgResumeInfoDto buildBaseResume(JgEnableDisable jgEnableDisable, String routePath) {
return JgResumeInfoDto.builder()
private JgResumeInfo buildBaseResume(JgEnableDisable jgEnableDisable, String routePath) {
return JgResumeInfo.builder()
.applyNo(jgEnableDisable.getApplyNo())
.businessType(getRegistrationClass(jgEnableDisable))
.businessId(String.valueOf(jgEnableDisable.getSequenceNbr()))
......@@ -751,18 +750,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
if (CollectionUtils.isEmpty(eqs)) {
return;
}
List<JgResumeInfoEq> list = eqs.stream()
jgResumeInfoEqService.saveBatchResumeEq(eqs.stream()
.map(eq -> JgResumeInfoEq.builder()
.resumeId(resumeId)
.equId(eq.getEquId())
.build())
.collect(Collectors.toList());
for (int i = 0; i < list.size(); i += DB_BATCH_SIZE) {
jgResumeInfoEqMapper.insertBatchSomeColumn(
list.subList(i, Math.min(i + DB_BATCH_SIZE, list.size()))
);
}
.build()).collect(Collectors.toList()));
}
private void sendDataRefreshMsg(JgEnableDisable jgEnableDisable) {
......
......@@ -24,6 +24,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransfer;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransferEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferEqMapper;
......@@ -649,7 +650,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
private void createResume(List<JgEquipTransferEq> equipTransferEqList, JgEquipTransfer equipTransfer, String routePath) {
if(StringUtils.hasText(equipTransfer.getProjectContraptionSeq())){
jgResumeInfoService.saveBatchResume(Collections.singletonList(
JgResumeInfoDto.builder()
JgResumeInfo.builder()
.applyNo(equipTransfer.getApplyNo())
.businessType(BusinessTypeEnum.JG_EQUIPMENT_HANDOVER.getName())
.businessId(String.valueOf(equipTransfer.getSequenceNbr()))
......@@ -663,7 +664,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
)
);
} else {
jgResumeInfoService.saveBatchResume(equipTransferEqList.stream().map(eq-> JgResumeInfoDto.builder().applyNo(equipTransfer.getApplyNo())
jgResumeInfoService.saveBatchResume(equipTransferEqList.stream().map(eq-> JgResumeInfo.builder().applyNo(equipTransfer.getApplyNo())
.businessType(BusinessTypeEnum.JG_EQUIPMENT_HANDOVER.getName())
.businessId(String.valueOf(equipTransfer.getSequenceNbr()))
.equId(eq.getEquId())
......
......@@ -1381,7 +1381,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 处理工业管道审批后业务数据保存
this.savePipelineData(jgInstallationNotice, jgRelationEquips, finalYm, dto, taskV2Model1, esEquipmentDtos);
jgResumeInfoService.saveBatchResume(
Lists.newArrayList(JgResumeInfoDto.builder()
Lists.newArrayList(JgResumeInfo.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName())
.businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
......@@ -1469,7 +1469,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
});
jgResumeInfoService.saveBatchResume(
jgRelationEquips.stream()
.map(v -> JgResumeInfoDto.builder()
.map(v -> JgResumeInfo.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName())
.businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
......@@ -2480,7 +2480,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 处理工业管道审批后业务数据保存
this.savePipelineData(jgInstallationNotice, jgRelationEquips, finalYm, dto, taskV2Model1, esEquipmentDtos);
jgResumeInfoService.saveBatchResume(
Lists.newArrayList(JgResumeInfoDto.builder()
Lists.newArrayList(JgResumeInfo.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName())
.businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
......@@ -2568,7 +2568,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
});
jgResumeInfoService.saveBatchResume(
jgRelationEquips.stream()
.map(v -> JgResumeInfoDto.builder()
.map(v -> JgResumeInfo.builder()
.applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName())
.businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
......
......@@ -1127,7 +1127,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
private void createResume(List<JgMaintainNoticeEq> jgRelationEquips, JgMaintainNotice notice, String routePath) {
if (StringUtils.hasText(notice.getProjectContraptionId())) {
jgResumeInfoService.saveBatchResume(Collections.singletonList(
JgResumeInfoDto.builder()
JgResumeInfo.builder()
.applyNo(notice.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION.getName())
.businessId(String.valueOf(notice.getSequenceNbr()))
......@@ -1141,7 +1141,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
)
);
} else {
jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq -> JgResumeInfoDto.builder().applyNo(notice.getApplyNo())
jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq -> JgResumeInfo.builder().applyNo(notice.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION.getName())
.businessId(String.valueOf(notice.getSequenceNbr()))
.equId(eq.getEquId())
......
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
......@@ -740,7 +741,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
private void createResume(JgMaintenanceContract maintenanceContract, String routePath) {
List<JgMaintenanceContractEq> maintenanceContractEqs = getJgMaintenanceContractEqs(maintenanceContract.getSequenceNbr());
jgResumeInfoService.saveBatchResume(maintenanceContractEqs.stream().map(eq-> JgResumeInfoDto.builder().applyNo(maintenanceContract.getApplyNo())
jgResumeInfoService.saveBatchResume(maintenanceContractEqs.stream().map(eq-> JgResumeInfo.builder().applyNo(maintenanceContract.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName())
.businessId(String.valueOf(maintenanceContract.getSequenceNbr()))
.equId(eq.getEquId())
......@@ -760,7 +761,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
/**
* 流程结束后添加设备维保信息
*
* @param id
* @param jgMaintenanceContract 维保信息
*/
@SneakyThrows
private void updateEquipMessage(JgMaintenanceContract jgMaintenanceContract) {
......
......@@ -114,7 +114,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private final JgUseRegistrationManageServiceImpl useRegistrationManageService;
private final IIdxBizJgInspectionDetectionInfoService iIdxBizJgInspectionDetectionInfoService;
private final JgResumeInfoServiceImpl jgResumeInfoService;
private final JgResumeInfoEqMapper jgResumeInfoEqMapper;
private final JgResumeInfoEqServiceImpl jgResumeInfoEqService;
private final InspectionDetectionInfoMapper inspectionDetectionInfoMapper;
private final SnowflakeIdUtil sequence;
private final EventPublisher eventPublisher;
......@@ -732,7 +732,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private void saveResumeInfo(TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife, List<IdxBizJgDesignInfo> designInfoList) {
if (CylinderTypeEnum.CYLINDER.getCode().equals(jgOverDesignServiceLife.getEquCategory())){
JgResumeInfoDto dto = JgResumeInfoDto.builder().applyNo(jgOverDesignServiceLife.getApplyNo())
JgResumeInfo info = JgResumeInfo.builder().applyNo(jgOverDesignServiceLife.getApplyNo())
.businessType(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName())
.businessId(String.valueOf(jgOverDesignServiceLife.getSequenceNbr()))
.approvalUnit(jgOverDesignServiceLife.getReceiveOrgName())
......@@ -741,20 +741,15 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
.changeContent(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName() + "业务办理")
.routePath(taskV2Model.getRoutePath())
.build();
jgResumeInfoService.saveBatchResume(Collections.singletonList(dto));
List<JgResumeInfoEq> list = designInfoList.stream()
jgResumeInfoService.save(info);
jgResumeInfoEqService.saveBatchResumeEq(designInfoList.stream()
.map(eq -> JgResumeInfoEq.builder()
.resumeId(dto.getSequenceNbr())
.resumeId(info.getSequenceNbr())
.equId(eq.getRecord())
.build())
.collect(Collectors.toList());
for (int i = 0; i < list.size(); i += DB_BATCH_SIZE) {
jgResumeInfoEqMapper.insertBatchSomeColumn(
list.subList(i, Math.min(i + DB_BATCH_SIZE, list.size()))
);
}
.collect(Collectors.toList()));
}else{
jgResumeInfoService.saveBatchResume(designInfoList.stream().map(eq-> JgResumeInfoDto.builder().applyNo(jgOverDesignServiceLife.getApplyNo())
jgResumeInfoService.saveBatchResume(designInfoList.stream().map(eq-> JgResumeInfo.builder().applyNo(jgOverDesignServiceLife.getApplyNo())
.businessType(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName())
.businessId(String.valueOf(jgOverDesignServiceLife.getSequenceNbr()))
.equId(eq.getRecord())
......
......@@ -31,6 +31,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper;
......@@ -1063,8 +1064,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private void createResume(List<JgReformNoticeEq> jgRelationEquips, JgReformNotice notice, String routePath) {
if(StringUtils.hasText(notice.getProjectContraptionId())){
jgResumeInfoService.saveBatchResume(Collections.singletonList(
JgResumeInfoDto.builder()
jgResumeInfoService.save(JgResumeInfo.builder()
.applyNo(notice.getApplyNo())
.businessType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName())
.businessId(String.valueOf(notice.getSequenceNbr()))
......@@ -1074,11 +1074,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
.status("正常")
.changeContent(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName() + "业务办理")
.routePath(routePath)
.build()
)
);
.build());
} else {
jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq-> JgResumeInfoDto.builder().applyNo(notice.getApplyNo())
jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq-> JgResumeInfo.builder().applyNo(notice.getApplyNo())
.businessType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName())
.businessId(String.valueOf(notice.getSequenceNbr()))
.equId(eq.getEquId())
......
......@@ -29,4 +29,8 @@ public class JgResumeInfoEqServiceImpl extends BaseService<JgResumeInfoEq,JgResu
public List<JgResumeInfoEq> queryForJgResumeInfoEqList() {
return this.queryForList("" , false);
}
public void saveBatchResumeEq(List<JgResumeInfoEq> jgResumeInfoEqList) {
this.baseMapper.insertBatchSomeColumn(jgResumeInfoEqList,500);
}
}
\ No newline at end of file
......@@ -39,15 +39,8 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu
return this.queryForList("", false, isDelete);
}
public void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) {
List<JgResumeInfo> jgResumeInfoCollection = jgResumeInfoDtoList.stream()
.map(dto -> {
JgResumeInfo info = new JgResumeInfo();
BeanUtils.copyProperties(dto, info);
return info;
})
.collect(Collectors.toList());
this.baseMapper.insertBatchSomeColumn(jgResumeInfoCollection,200);
public void saveBatchResume(List<JgResumeInfo> jgResumeInfoList) {
this.baseMapper.insertBatchSomeColumn(jgResumeInfoList,200);
}
/**
......
......@@ -1142,7 +1142,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
lambdaEq.eq(JgScrapCancelEq::getEquipTransferId, jgScrapCancel.getSequenceNbr());
lambdaEq.select(JgScrapCancelEq::getEquId, BaseEntity::getSequenceNbr);
List<JgScrapCancelEq> scrapCancelEqs = jgScrapCancelEqService.list(lambdaEq);
jgResumeInfoService.saveBatchResume(scrapCancelEqs.stream().map(eq-> JgResumeInfoDto.builder().applyNo(jgScrapCancel.getApplyNo())
jgResumeInfoService.saveBatchResume(scrapCancelEqs.stream().map(eq-> JgResumeInfo.builder().applyNo(jgScrapCancel.getApplyNo())
.businessType(getRegistrationClass(jgScrapCancel.getCancelType()))
.businessId(String.valueOf(jgScrapCancel.getSequenceNbr()))
.equId(eq.getEquId())
......
......@@ -1040,7 +1040,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
private void createResume(List<JgTransferNoticeEq> jgRelationEquips, JgTransferNotice notice, String routePath) {
jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq-> JgResumeInfoDto.builder().applyNo(notice.getApplyNo())
jgResumeInfoService.saveBatchResume(jgRelationEquips.stream().map(eq-> JgResumeInfo.builder().applyNo(notice.getApplyNo())
.businessType(BusinessTypeEnum.JG_ADVICE_REMOVAL.getName())
.businessId(String.valueOf(notice.getSequenceNbr()))
.equId(eq.getEquId())
......
......@@ -1339,13 +1339,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
List<String> records = new ArrayList<>();
List<JgResumeInfoDto> resumeList = new ArrayList<>();
List<JgResumeInfo> resumeList = new ArrayList<>();
List<ESEquipmentCategoryDto> esEquipmentCategoryDtos = new ArrayList<>();
if (!CollectionUtils.isEmpty(equipmentLists)) {
// 装置更新管道的技术参数、设计信息、安装信息
if (jgProjectContraption != null) {
updatePieLineTechAndInspection(equipmentLists);
resumeList.add(JgResumeInfoDto.builder()
resumeList.add(JgResumeInfo.builder()
.applyNo(jgUseRegistration.getApplyNo())
.businessType(BusinessTypeEnum.JG_USAGE_REGISTRATION.getName())
.businessId(String.valueOf(jgUseRegistration.getSequenceNbr()))
......@@ -1357,7 +1357,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.routePath(taskV2Model.getRoutePath())
.build());
}else{
JgResumeInfoDto dto = JgResumeInfoDto.builder()
JgResumeInfo info = JgResumeInfo.builder()
.applyNo(jgUseRegistration.getApplyNo())
.businessType(BusinessTypeEnum.JG_USAGE_REGISTRATION.getName())
.businessId(jgUseRegistration.getSequenceNbr() + "")
......@@ -1367,8 +1367,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.status("正常")
.routePath(taskV2Model.getRoutePath())
.build();
jgResumeInfoService.saveBatchResume(Collections.singletonList(dto));
commonServiceImpl.batchInsertResumeEq(dto.getSequenceNbr(),equipmentLists);
jgResumeInfoService.save(info);
commonServiceImpl.batchInsertResumeEq(info.getSequenceNbr(),equipmentLists);
}
// 批量收集的结果
List<JgCertificateChangeRecordEq> jgCertificateChangeRecordEqBatchList = new ArrayList<>();
......
......@@ -171,7 +171,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
@Autowired
private JgResumeInfoServiceImpl jgResumeInfoService;
@Autowired
private JgResumeInfoEqMapper jgResumeInfoEqMapper;
private JgResumeInfoEqServiceImpl jgResumeInfoEqService;
@Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
......@@ -1053,7 +1053,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord(jgVehicleInformation, registerInfo, changeRecordId, taskV2Model);
JgResumeInfoDto dto = JgResumeInfoDto.builder()
JgResumeInfo info = JgResumeInfo.builder()
.applyNo(jgVehicleInformation.getApplyNo())
.businessType(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName())
.businessId(String.valueOf(jgVehicleInformation.getSequenceNbr()))
......@@ -1063,19 +1063,13 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.changeContent(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName() + "业务办理")
.routePath(taskV2Model.getRoutePath())
.build();
jgResumeInfoService.saveBatchResume(Collections.singletonList(dto));
List<JgResumeInfoEq> list = equipIdList.stream()
jgResumeInfoService.save(info);
jgResumeInfoEqService.saveBatchResumeEq(equipIdList.stream()
.map(equipId -> JgResumeInfoEq.builder()
.resumeId(dto.getSequenceNbr())
.resumeId(info.getSequenceNbr())
.equId(equipId)
.build())
.collect(Collectors.toList());
for (int i = 0; i < list.size(); i += DB_BATCH_SIZE) {
jgResumeInfoEqMapper.insertBatchSomeColumn(
list.subList(i, Math.min(i + DB_BATCH_SIZE, list.size()))
);
}
.collect(Collectors.toList()));
// 车用气瓶评分
eventPublisher.publish(new EquipCreateOrEditEvent(this, BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.name(), Sets.newHashSet(equipIdList), EquipCreateOrEditEvent.EquipType.equip));
}
......@@ -2198,7 +2192,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
equipList.add(equip);
//新增添加设备履历
if (StringUtils.isEmpty(vehicleInfoDto.getSequenceNbr())) {
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
jgResumeInfoService.save(JgResumeInfo.builder()
.applyNo(vehicleInformation.getApplyNo())
.businessType(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName())
.businessId(vehicleInformation.getSequenceNbr() + "")
......
......@@ -3,7 +3,8 @@ package com.yeejoin.amos.boot.module.jyjc.biz.feign;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.boot.module.jyjc.api.model.JgResumeInfoDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfoEq;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.springframework.cloud.openfeign.FeignClient;
......@@ -25,7 +26,7 @@ public interface JgFeignClient {
* 设备注册信息分页查询
* */
@RequestMapping(value = "/jg-resume-info/saveBatchResume", method = RequestMethod.POST)
FeignClientResult saveBatchResume(@RequestBody List<JgResumeInfoDto> jgResumeInfoDtoList);
FeignClientResult saveBatchResume(@RequestBody List<JgResumeInfo> jgResumeInfoList);
/***
......@@ -34,5 +35,11 @@ public interface JgFeignClient {
@RequestMapping(value = "/common/getRegion", method = RequestMethod.GET)
FeignClientResult<List<RegionModel>> getRegion(@RequestParam(value = "level", required = false) String level,
@RequestParam(value = "parentId", required = false) String parentId);
/***
* 批量插入履历信息关系表
* */
@RequestMapping(value = "/jg-resume-info-eq/saveBatchResumeEq", method = RequestMethod.POST)
FeignClientResult saveBatchResumeEq(@RequestBody List<JgResumeInfoEq> jgResumeInfoEqList);
}
......@@ -23,8 +23,11 @@ import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.ContraptionQueryParams;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.JYJCBusinessTypeEnum;
import com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfoEq;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jyjc.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.jyjc.api.entity.*;
......@@ -816,7 +819,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
TaskV2Model taskV2Model = updateTaskModel(model);
List<JyjcInspectionApplicationEquipModel> applicationEquipModels = applicationEquipService.listApplicationEquipByApplicationSeq(sequenceNbr);
List<JyjcInspectionResult> resultModels = new ArrayList<>();
List<JgResumeInfoDto> jgResumeInfoDtoList = new ArrayList<>();
List<JgResumeInfo> jgResumeInfoList = new ArrayList<>();
List<JgResumeInfoEq> jgResumeInfoEqList = new ArrayList<>();
Date now = DateUtil.date();
if (model.getEquipClassify().equals(EquipmentClassifityEnum.YLGD.getCode())) {
List<String> codes = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.SE.getCode(), 1).getResult();
......@@ -858,7 +862,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
resultParam.setParamType("IdxBizJgTechParamsPipeline");
resultParam.setRecDate(new Date());
jyjcInspectionResultParamServiceImpl.save(resultParam);
jgResumeInfoDtoList.add(JgResumeInfoDto.builder().applyNo(jyjcInspectionApplication.getApplicationNo())
jgResumeInfoList.add(JgResumeInfo.builder().applyNo(jyjcInspectionApplication.getApplicationNo())
.businessType(resultModel.getInspectionTypeName())
.businessId(String.valueOf(jyjcInspectionApplication.getSequenceNbr()))
.changeContent(resultModel.getInspectionTypeName() + "业务办理")
......@@ -869,6 +873,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
.routePath(taskV2Model.getRoutePath()).build());
} else {
List<String> codes = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.SE.getCode(), applicationEquipModels.size()).getResult();
JgResumeInfo cylinderMainResumeInfo = null;
for (int i = 0; i < applicationEquipModels.size(); i++) {
JyjcInspectionResult resultModel = new JyjcInspectionResult();
resultModel.setInspectionUnitCode(model.getInspectionUnitCode());
......@@ -896,16 +901,41 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
resultModel.setSequenceNbr(resultSeq);
resultModels.add(resultModel);
// TODO 暂存json,在结果录入后,将数据更新技术参数-检验详情使用 考虑兼容老数据
// 新增设备履历信息
jgResumeInfoDtoList.add(JgResumeInfoDto.builder().applyNo(jyjcInspectionApplication.getApplicationNo())
.businessType(resultModel.getInspectionTypeName())
.businessId(String.valueOf(jyjcInspectionApplication.getSequenceNbr()))
.changeContent(resultModel.getInspectionTypeName() + "业务办理")
.equId(applicationEquipModels.get(i).getEquipUnicode())
.approvalUnit(model.getInspectionUnitName())
.approvalUnitCode(model.getInspectionUnitCode())
.status("正常")
.routePath(taskV2Model.getRoutePath()).build());
if (model.getEquCategory().equals(CylinderTypeEnum.CYLINDER.getCode())){
jgResumeInfoEqList.add(JgResumeInfoEq.builder()
.resumeId(resultSeq)
.equId(applicationEquipModels.get(i).getEquipUnicode())
.build());
// 主表只创建一次
if (cylinderMainResumeInfo == null) {
cylinderMainResumeInfo = JgResumeInfo.builder()
.applyNo(jyjcInspectionApplication.getApplicationNo())
.businessType(resultModel.getInspectionTypeName())
.businessId(String.valueOf(jyjcInspectionApplication.getSequenceNbr()))
.changeContent(resultModel.getInspectionTypeName() + "业务办理")
.approvalUnit(model.getInspectionUnitName())
.approvalUnitCode(model.getInspectionUnitCode())
.status("正常")
.routePath(taskV2Model.getRoutePath())
.build();
cylinderMainResumeInfo.setSequenceNbr(resultSeq);
}
} else {
// 新增设备履历信息
jgResumeInfoList.add(JgResumeInfo.builder().applyNo(jyjcInspectionApplication.getApplicationNo())
.businessType(resultModel.getInspectionTypeName())
.businessId(String.valueOf(jyjcInspectionApplication.getSequenceNbr()))
.changeContent(resultModel.getInspectionTypeName() + "业务办理")
.equId(applicationEquipModels.get(i).getEquipUnicode())
.approvalUnit(model.getInspectionUnitName())
.approvalUnitCode(model.getInspectionUnitCode())
.status("正常")
.routePath(taskV2Model.getRoutePath()).build());
}
}
// 气瓶主表单独保存
if (cylinderMainResumeInfo != null) {
this.saveBatchResume(Collections.singletonList(cylinderMainResumeInfo));
}
}
inspectionResultService.saveOrUpdateBatch(resultModels);
......@@ -913,7 +943,12 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
this.pushInspectionApplication(model);
this.createHisAfterReceive(model);
// 设备检验履历
this.saveBatchResume(jgResumeInfoDtoList);
if (!jgResumeInfoList.isEmpty()) {
this.saveBatchResume(jgResumeInfoList);
}
if (!jgResumeInfoEqList.isEmpty()) {
this.saveBatchResumeEq(jgResumeInfoEqList);
}
// 更新流程中的流程数据
commonService.saveExecuteFlowData2Redis(model.getProcessInstanceId(), this.buildInstanceRuntimeData(jyjcInspectionApplication));
// 事务提交后,生成报检申请表
......@@ -986,9 +1021,17 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
private void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) {
private void saveBatchResume(List<JgResumeInfo> jgResumeInfoList) {
try {
jgFeignClient.saveBatchResume(jgResumeInfoList);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
private void saveBatchResumeEq(List<JgResumeInfoEq> jgResumeInfoEqList) {
try {
jgFeignClient.saveBatchResume(jgResumeInfoDtoList);
jgFeignClient.saveBatchResumeEq(jgResumeInfoEqList);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
......
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