Commit 25db4bad authored by 刘林's avatar 刘林

fix(jg):注销报废功能修改

parent bf6d7509
...@@ -2274,13 +2274,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2274,13 +2274,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto.setUSE_UNIT_NAME(company.getCompanyName()); esEquipmentDto.setUSE_UNIT_NAME(company.getCompanyName());
} }
esEquipmentCategoryList.add(esEquipmentDto); esEquipmentCategoryList.add(esEquipmentDto);
if ("his".equals(equipInfoDto.getDataSource())){
// 生成tzs_jg_certificate_change_record_eq记录 // 生成tzs_jg_certificate_change_record_eq记录
JgCertificateChangeRecordEq changeRecordEq = new JgCertificateChangeRecordEq(); JgCertificateChangeRecordEq changeRecordEq = new JgCertificateChangeRecordEq();
changeRecordEq.setChangeRecordId(String.valueOf(changeRecordId));//登记证记录主键 changeRecordEq.setChangeRecordId(String.valueOf(changeRecordId));//登记证记录主键
changeRecordEq.setEquId(registerInfo.getRecord());//设备主键 changeRecordEq.setEquId(registerInfo.getRecord());//设备主键
changeRecordEq.setProductCode(factoryInfo.getFactoryNum());//产品编号 changeRecordEq.setProductCode(factoryInfo.getFactoryNum());//产品编号
certificateChangeRecordEqService.save(changeRecordEq); certificateChangeRecordEqService.save(changeRecordEq);
}
}); });
Optional.of(useInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgUseInfoService::saveBatch); Optional.of(useInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgUseInfoService::saveBatch);
Optional.of(designInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgDesignInfoService::saveBatch); Optional.of(designInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgDesignInfoService::saveBatch);
...@@ -2290,10 +2291,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2290,10 +2291,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
Optional.of(paramsVesselList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgTechParamsVesselService::saveBatch); Optional.of(paramsVesselList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgTechParamsVesselService::saveBatch);
Optional.of(inspectionDetectionInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgInspectionDetectionInfoService::saveBatch); Optional.of(inspectionDetectionInfoList).filter(list -> !list.isEmpty()).ifPresent(idxBizJgInspectionDetectionInfoService::saveBatch);
Optional.of(esEquipmentCategoryList).filter(list -> !list.isEmpty()).ifPresent(esEquipmentCategory::saveAll); Optional.of(esEquipmentCategoryList).filter(list -> !list.isEmpty()).ifPresent(esEquipmentCategory::saveAll);
// 生成证书管理表记录 if ("his".equals(equipInfoDto.getDataSource())){
JgUseRegistrationManage registrationManage = this.saveRegistrationManage(equipInfoDto, company); // 生成证书管理表记录
// 生成一条tzs_jg_certificate_change_record记录 JgUseRegistrationManage registrationManage = this.saveRegistrationManage(equipInfoDto, company);
generateCertificateChangeRecord(registrationManage, changeRecordId); // 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord(registrationManage, changeRecordId);
}
return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size()); return String.format("导入完成,成功导入: %d 条数据!", useInfoList.size());
} }
......
...@@ -843,11 +843,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -843,11 +843,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
Map<String, Map<String, Object>> resultMap = new HashMap<>(); Map<String, Map<String, Object>> resultMap = new HashMap<>();
// map1.put("USE_ORG_CODE", newUseRegistrationCertificateNumber); // map1.put("USE_ORG_CODE", newUseRegistrationCertificateNumber);
if (CancelTypeEnum.SCRAPPED.getCode().equals(jgScrapCancel.getCancelType())) { if (CancelTypeEnum.SCRAPPED.getCode().equals(jgScrapCancel.getCancelType())) {
IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo(); idxBizJgUseInfoMapper.batchUpdateUseInfo(equipIds, EquimentEnum.BAOFEI.getCode());
idxBizJgUseInfo.setEquState(String.valueOf(EquimentEnum.BAOFEI.getCode()));
LambdaQueryWrapper<IdxBizJgUseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.in(IdxBizJgUseInfo::getRecord, equipIds);
idxBizJgUseInfoMapper.update(idxBizJgUseInfo, wrapper);
map1.put("EQU_STATE", String.valueOf(EquimentEnum.BAOFEI.getCode())); map1.put("EQU_STATE", String.valueOf(EquimentEnum.BAOFEI.getCode()));
// 修改证管理表中的证的状态 // 修改证管理表中的证的状态
...@@ -876,11 +872,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -876,11 +872,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
map1.put("ORG_BRANCH_CODE", ""); map1.put("ORG_BRANCH_CODE", "");
map1.put("ORG_BRANCH_NAME", ""); map1.put("ORG_BRANCH_NAME", "");
map1.put("EQU_STATE", String.valueOf(EquimentEnum.ZHUXIAO.getCode())); map1.put("EQU_STATE", String.valueOf(EquimentEnum.ZHUXIAO.getCode()));
IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo(); idxBizJgUseInfoMapper.batchUpdateUseInfo(equipIds, EquimentEnum.ZHUXIAO.getCode());
idxBizJgUseInfo.setEquState(String.valueOf(EquimentEnum.ZHUXIAO.getCode()));
LambdaQueryWrapper<IdxBizJgUseInfo> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.in(IdxBizJgUseInfo::getRecord, equipIds);
idxBizJgUseInfoMapper.update(idxBizJgUseInfo, wrapper1);
// 修改证管理表中的证的状态 // 修改证管理表中的证的状态
List<String> certificateIds = jgScrapCancelEqList.stream().map(JgScrapCancelEq::getCertificateSeq).collect(Collectors.toList()); List<String> certificateIds = jgScrapCancelEqList.stream().map(JgScrapCancelEq::getCertificateSeq).collect(Collectors.toList());
......
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 使用信息表 Mapper 接口 * 使用信息表 Mapper 接口
...@@ -10,5 +12,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -10,5 +12,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @date 2023-08-16 * @date 2023-08-16
*/ */
public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> { public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> {
void batchUpdateUseInfo(@Param("records") List<String> records, Integer code);
} }
...@@ -2,4 +2,10 @@ ...@@ -2,4 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper">
<update id="batchUpdateUseInfo">
UPDATE idx_biz_jg_use_info SET "EQU_STATE" = #{code} WHERE "RECORD" IN
<foreach collection="records" separator="," item="record" open="(" close=")">
#{record}
</foreach>
</update>
</mapper> </mapper>
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