Commit b4265de6 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.100.92.250:5000/moa/amos-boot-biz into develop_tzs_register
parents 5c746668 0f994c53
...@@ -10,17 +10,13 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionIn ...@@ -10,17 +10,13 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionIn
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -46,9 +42,8 @@ public class IdxBizJgProjectContraptionController extends BaseController { ...@@ -46,9 +42,8 @@ public class IdxBizJgProjectContraptionController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增管道工程装置表", notes = "新增管道工程装置表") @ApiOperation(httpMethod = "POST", value = "新增管道工程装置表", notes = "新增管道工程装置表")
public ResponseModel<IdxBizJgProjectContraptionDto> save(@RequestBody IdxBizJgProjectContraptionDto model) { public ResponseModel<Boolean> save(@RequestBody IdxBizJgProjectContraptionDto model) {
model = idxBizJgProjectContraptionServiceImpl.createWithModel(model); return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.saveFirstMergeProjectContraption(model));
return ResponseHelper.buildResponse(model);
} }
/** /**
...@@ -226,5 +221,4 @@ public class IdxBizJgProjectContraptionController extends BaseController { ...@@ -226,5 +221,4 @@ public class IdxBizJgProjectContraptionController extends BaseController {
public ResponseModel<List<IdxBizJgProjectContraptionDto>> selectForList() { public ResponseModel<List<IdxBizJgProjectContraptionDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionList()); return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionList());
} }
} }
...@@ -369,28 +369,20 @@ public class JgUseRegistrationController extends BaseController { ...@@ -369,28 +369,20 @@ public class JgUseRegistrationController extends BaseController {
/** /**
* 查询有使用登记证,新增的,没有流程引用的数据 * 查询有使用登记证,新增的,没有流程引用的数据
* @param useUnitCreditCode 使用登记证编号 * @param useUnitCreditCode 使用登记证编号
* @param current 当前页 * @return List
* @param size 每页数
* @return page
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jgProjectContraptionPageMaster") @GetMapping(value = "/jgProjectContraptionListMaster")
@ApiOperation(value = "查询指定使用单位下的可用总装置,已纳管且使用登记证编号不为空或者首次合并为true", notes = "不包括流程中的") @ApiOperation(value = "查询指定使用单位下的可用总装置,已纳管且使用登记证编号不为空或者首次合并为true", notes = "不包括流程中的")
public ResponseModel<IPage<IdxBizJgProjectContraption>> jgProjectContraptionPageMaster(@RequestParam String useUnitCreditCode, public ResponseModel<List<IdxBizJgProjectContraption>> jgProjectContraptionListMaster(@RequestParam String useUnitCreditCode) {
@RequestParam(value = "current") int current, return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.jgProjectContraptionListMaster(useUnitCreditCode));
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
IPage<IdxBizJgProjectContraption> re = jgUseRegistrationServiceImpl.jgProjectContraptionPageMaster(useUnitCreditCode, page);
return ResponseHelper.buildResponse(re);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询工程装置下的所有做过安装告知但是为做使用登记的管道", notes = "查询工程装置下的所有做过安装告知但是为做使用登记的管道") @ApiOperation(httpMethod = "GET", value = "查询工程装置下的所有做过安装告知但是为做使用登记的管道", notes = "查询工程装置下的所有做过安装告知但是为做使用登记的管道")
@GetMapping(value = "/getDeviceListByProjectContraptionSeq") @GetMapping(value = "/getDeviceListByProjectContraptionSeq")
public ResponseModel<Object> getDeviceListByProjectContraption(@RequestParam("record") String projectContraptionSeq, public ResponseModel<Object> getDeviceListByProjectContraption(@RequestParam("record") String projectContraptionSeq,
@RequestParam("originProjectContraptionIds") String[] originProjectContraptionIds) { @RequestParam(required = false) String[] originProjectContraptionIds) {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getDeviceListByProjectContraption(projectContraptionSeq, originProjectContraptionIds)); return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getDeviceListByProjectContraption(projectContraptionSeq, originProjectContraptionIds));
} }
} }
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -10,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -10,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum; import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum; import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgProjectContraptionService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgProjectContraptionService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto; import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
...@@ -47,7 +49,7 @@ import java.util.stream.IntStream; ...@@ -47,7 +49,7 @@ import java.util.stream.IntStream;
import java.util.stream.Stream; import java.util.stream.Stream;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import static com.alibaba.fastjson.JSON.toJSONString;
/** /**
* 管道工程装置表服务实现类 * 管道工程装置表服务实现类
* *
...@@ -81,6 +83,10 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -81,6 +83,10 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper; private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired @Autowired
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
@Autowired
private JgVehicleInformationMapper jgVehicleInformationMapper;
@Autowired
private JgInstallationNoticeServiceImpl jgInstallationNoticeService;
@Override @Override
public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) { public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) {
...@@ -445,4 +451,26 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -445,4 +451,26 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
throw new RuntimeException("导出异常:", e); throw new RuntimeException("导出异常:", e);
} }
} }
public boolean saveFirstMergeProjectContraption(IdxBizJgProjectContraptionDto model) {
// 单位类型
Map<String, Object> companyInfoMap = jgInstallationNoticeService.getCompanyType();
IdxBizJgProjectContraption projectContraption = JSON.parseObject(toJSONString(model), IdxBizJgProjectContraption.class);
String equListName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquListCode());
String equCategoryName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquCategoryCode());
String equDefineName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquDefineCode());
projectContraption.setDataSource("new");
projectContraption.setIsIntoManagement(true);
projectContraption.setProvinceName("陕西省");
projectContraption.setEquList(model.getEquListCode());
projectContraption.setEquCategory(model.getEquCategoryCode());
projectContraption.setEquDefine(model.getEquDefineCode());
projectContraption.setEquListName(equListName);
projectContraption.setEquCategoryName(equCategoryName);
projectContraption.setEquDefineName(equDefineName);
projectContraption.setPipelineLength(0.0);
projectContraption.setUseUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
return this.saveOrUpdateData(projectContraption);
}
} }
\ No newline at end of file
...@@ -3159,8 +3159,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3159,8 +3159,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
inspectionDetectionInfo.setSequenceNbr(String.valueOf(equipmentInfoForm.get("INSPECTIONDETECTIONINFO_SEQ"))); inspectionDetectionInfo.setSequenceNbr(String.valueOf(equipmentInfoForm.get("INSPECTIONDETECTIONINFO_SEQ")));
iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo); iIdxBizJgInspectionDetectionInfoService.saveOrUpdateData(inspectionDetectionInfo);
} else if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategory) || "2100".equals(equCategory) || "8300".equals(equCategory)) { } else if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategory) || "2100".equals(equCategory)) {
//更新时 固定式压力容器(2100)和 气瓶(2300)工业管道(8300) 可以更新检验检测信息 //更新时 固定式压力容器(2100)和 气瓶(2300)可以更新检验检测信息
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgInspectionDetectionInfo.class); IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgInspectionDetectionInfo.class);
List<Map<String, Object>> inspectionAndTestingInstitutions = commonService.getUnitListByType("inspection", "gasCylindersForCars"); List<Map<String, Object>> inspectionAndTestingInstitutions = commonService.getUnitListByType("inspection", "gasCylindersForCars");
Optional<Map<String, Object>> optional = inspectionAndTestingInstitutions.stream().filter(x -> x.get("useCode").equals(inspectionDetectionInfo.getInspectOrgCode())).findFirst(); Optional<Map<String, Object>> optional = inspectionAndTestingInstitutions.stream().filter(x -> x.get("useCode").equals(inspectionDetectionInfo.getInspectOrgCode())).findFirst();
...@@ -3204,9 +3204,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3204,9 +3204,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
} }
if ("8300".equals(equCategory)) {
useInfo.setProjectContraption(((String) equipmentInfoForm.get("PROJECT_CONTRAPTION")).trim());
}
idxBizJgUseInfoService.saveOrUpdateData(useInfo); idxBizJgUseInfoService.saveOrUpdateData(useInfo);
// 设计信息 // 设计信息
...@@ -3538,21 +3535,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3538,21 +3535,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
jsonObject.put("useUnitCreditCode", useUnitCreditCode); jsonObject.put("useUnitCreditCode", useUnitCreditCode);
Page<JSONObject> page = new Page<>(jsonObject.getLong("number"), jsonObject.getLong("size")); Page<JSONObject> page = new Page<>(jsonObject.getLong("number"), jsonObject.getLong("size"));
Set<String> records = EquipUsedCheckStrategyContext.getUsedStrategy("useRegistration").getEquipInFlow(useUnitCreditCode); Set<String> records = EquipUsedCheckStrategyContext.getUsedStrategy("useRegistration").getEquipInFlow(useUnitCreditCode);
if ("8300".equals(jsonObject.get(EQU_CATEGORY_CODE))) {// 管道 if ("2300".equals(jsonObject.get(EQU_CATEGORY_CODE))) {// 气瓶
if (jsonObject.get("projectContraption") == null) {
throw new BadRequest("请先选择工程装置后,再选择设备信息!");
}
if (!jgUseRegistrationMapper.selectList(new LambdaQueryWrapper<JgUseRegistration>()
.eq(JgUseRegistration::getIsDelete, false)
.eq(JgUseRegistration::getProjectContraption, jsonObject.get("projectContraption"))
.eq(JgUseRegistration::getUseUnitCreditCode, useUnitCreditCode)
.eq(JgUseRegistration::getIsAddEquip, "0")
.eq(JgUseRegistration::getStatus, "已完成")
.ne(JgUseRegistration::getStatus, "已作废")).isEmpty() && "0".equals(jsonObject.get("isAddEquip"))) {
throw new BadRequest("该工程装置已做过使用登记,再选择增补功能进行登记!");
}
return jgUseRegistrationMapper.queryForUnitPipelineEquipmentPage(page, jsonObject, records);
} else if ("2300".equals(jsonObject.get(EQU_CATEGORY_CODE))) {// 气瓶
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult(); List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue)); Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
Page<JSONObject> result = jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject, records); Page<JSONObject> result = jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject, records);
......
...@@ -353,7 +353,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -353,7 +353,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambda); List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambda);
if (!ValidationUtil.isEmpty(jgInstallationNoticeEqs)) { if (!ValidationUtil.isEmpty(jgInstallationNoticeEqs)) {
// 压力管道从工程装置表查询设备信息 // 压力管道从工程装置表查询设备信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategory)) { if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategory) || PipelineEnum.LONG_DISTANCE_PIPELINE.getCode().equals(equCategory) || PipelineEnum.COMMON_PIPELINE.getCode().equals(equCategory)) {
String projectContraptionId = (String) installationInfo.get("projectContraptionId"); String projectContraptionId = (String) installationInfo.get("projectContraptionId");
IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionId); IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionId);
installationInfo.put("pipelineLength", projectContraption.getPipelineLength()); installationInfo.put("pipelineLength", projectContraption.getPipelineLength());
...@@ -665,12 +665,17 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -665,12 +665,17 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// jgInstallationNotice.setNoticeReportUrl(url); // jgInstallationNotice.setNoticeReportUrl(url);
// this.updateById(jgInstallationNotice); // this.updateById(jgInstallationNotice);
map.put("equipBasicInfoList", maps); map.put("equipBasicInfoList", maps);
// WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response); //将安装告知单和汇总表压缩到zip中 如果是压力/长输/公用管道的情况需要压缩包
String category = jgInstallationNotice.getEquCategoryCode();
if ("8300".equals(category) || "8200".equals(category) || "8100".equals(category)) {
//获取
byte[] templateToPdfData = WordTemplateUtils.getTemplateToPdfData(tempFileName, "installation-notification-report.ftl", map); byte[] templateToPdfData = WordTemplateUtils.getTemplateToPdfData(tempFileName, "installation-notification-report.ftl", map);
//获取管道和气瓶的基本信息汇总表 //获取管道和气瓶的基本信息汇总表
List<CompletableFuture<byte[]>> exportSummaryBasicInfoData = jgUseRegistrationService.getExportSummaryBasicInfoData(Collections.singletonList(Long.valueOf(sequenceNbr)), jgInstallationNotice.getEquCategoryCode(),"安装告知"); List<CompletableFuture<byte[]>> exportSummaryBasicInfoData = jgUseRegistrationService.getExportSummaryBasicInfoData(Collections.singletonList(Long.valueOf(sequenceNbr)), jgInstallationNotice.getEquCategoryCode(),"安装告知");
//将安装告知单和汇总表压缩到zip中 toZipFileByData(response, exportSummaryBasicInfoData, templateToPdfData, jgInstallationNotice.getApplyNo());
toZipFileByData(response, exportSummaryBasicInfoData, templateToPdfData, jgInstallationNotice.getApplyNo(),jgInstallationNotice.getEquCategoryCode()); }else {
WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response);
}
} }
/** /**
...@@ -679,20 +684,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -679,20 +684,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @param exportSummaryBasicInfoData * @param exportSummaryBasicInfoData
* @param templateToPdfData * @param templateToPdfData
* @param applyNo * @param applyNo
* @param category
*/ */
private void toZipFileByData(HttpServletResponse response, List<CompletableFuture<byte[]>> exportSummaryBasicInfoData, byte[] templateToPdfData, String applyNo, String category) { private void toZipFileByData(HttpServletResponse response, List<CompletableFuture<byte[]>> exportSummaryBasicInfoData, byte[] templateToPdfData, String applyNo) {
String filePrefix ="汇总表"; String filePrefix ="压力管道基本信息汇总表_";
String customFileName="设备基本信息汇总表"; String customFileName="压力管道告知单_设备基本信息汇总表_" + applyNo + ".zip";
if ("8300".equals(category) || "8200".equals(category) || "8100".equals(category)) {
// 文件名前缀
filePrefix= "压力管道基本信息汇总表_";
customFileName="压力管道告知单_设备基本信息汇总表_" + applyNo + ".zip";
}else if ("2300".equals(category)) {
// 文件名前缀
filePrefix = "气瓶基本信息汇总表_";
customFileName="气瓶告知单_设备基本信息汇总表_" + applyNo + ".zip";
}
// 打包zip // 打包zip
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ZipOutputStream zip = new ZipOutputStream(outputStream)) { ZipOutputStream zip = new ZipOutputStream(outputStream)) {
...@@ -1258,7 +1253,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1258,7 +1253,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
String finalYm = ym; String finalYm = ym;
// 工程装置id // 工程装置id
String projectContraptionId = jgInstallationNotice.getProjectContraptionId(); String projectContraptionId = jgInstallationNotice.getProjectContraptionId();
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(jgInstallationNotice.getEquCategoryCode())) { String equCategoryCode = jgInstallationNotice.getEquCategoryCode();
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)|| PipelineEnum.LONG_DISTANCE_PIPELINE.getCode().equals(equCategoryCode) || PipelineEnum.COMMON_PIPELINE.getCode().equals(equCategoryCode)) {
// 处理工业管道审批后业务数据保存 // 处理工业管道审批后业务数据保存
this.savePipelineData(jgInstallationNotice, jgRelationEquips, finalYm, dto, taskV2Model1); this.savePipelineData(jgInstallationNotice, jgRelationEquips, finalYm, dto, taskV2Model1);
jgResumeInfoService.saveBatchResume( jgResumeInfoService.saveBatchResume(
...@@ -1583,7 +1579,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1583,7 +1579,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
String equCategoryCode = jgInstallationNotice.getEquCategoryCode(); String equCategoryCode = jgInstallationNotice.getEquCategoryCode();
Map<String, Object> installationInfo = BeanUtil.beanToMap(jgInstallationNotice, false, true); Map<String, Object> installationInfo = BeanUtil.beanToMap(jgInstallationNotice, false, true);
// 压力管道从工程装置表查询设备信息 // 压力管道从工程装置表查询设备信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)) { if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)|| PipelineEnum.LONG_DISTANCE_PIPELINE.getCode().equals(equCategoryCode) || PipelineEnum.COMMON_PIPELINE.getCode().equals(equCategoryCode)) {
String projectContraptionId = jgInstallationNotice.getProjectContraptionId(); String projectContraptionId = jgInstallationNotice.getProjectContraptionId();
IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionId); IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionId);
if (!ValidationUtil.isEmpty(projectContraption)) { if (!ValidationUtil.isEmpty(projectContraption)) {
...@@ -1752,8 +1748,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1752,8 +1748,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private void deleteConstructionInfo(JgInstallationNotice installationNotice) { private void deleteConstructionInfo(JgInstallationNotice installationNotice) {
constructionInfoMapper.delete(new LambdaQueryWrapper<IdxBizJgConstructionInfo>().eq(IdxBizJgConstructionInfo::getNoticeId, installationNotice.getSequenceNbr())); constructionInfoMapper.delete(new LambdaQueryWrapper<IdxBizJgConstructionInfo>().eq(IdxBizJgConstructionInfo::getNoticeId, installationNotice.getSequenceNbr()));
String equCategoryCode = installationNotice.getEquCategoryCode();
// 如果设备类型是工业管道,则还需删除工程装置施工信息 // 如果设备类型是工业管道,则还需删除工程装置施工信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(installationNotice.getEquCategoryCode())) { if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)|| PipelineEnum.LONG_DISTANCE_PIPELINE.getCode().equals(equCategoryCode) || PipelineEnum.COMMON_PIPELINE.getCode().equals(equCategoryCode)) {
LambdaQueryWrapper<IdxBizJgProjectConstruction> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizJgProjectConstruction> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IdxBizJgProjectConstruction::getNoticeId, installationNotice.getSequenceNbr()); queryWrapper.eq(IdxBizJgProjectConstruction::getNoticeId, installationNotice.getSequenceNbr());
projectConstructionMapper.delete(queryWrapper); projectConstructionMapper.delete(queryWrapper);
...@@ -1781,7 +1778,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1781,7 +1778,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
this.rollBackEsInfo(jgRelationEquip, idxBizJgRegisterInfo); this.rollBackEsInfo(jgRelationEquip, idxBizJgRegisterInfo);
}); });
// 如果是工业管道,则回滚工程装置表信息 // 如果是工业管道,则回滚工程装置表信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(installationNotice.getEquCategoryCode())) { String equCategoryCode = installationNotice.getEquCategoryCode();
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)|| PipelineEnum.LONG_DISTANCE_PIPELINE.getCode().equals(equCategoryCode) || PipelineEnum.COMMON_PIPELINE.getCode().equals(equCategoryCode)) {
this.rollBackProjectContraptionInfo(installationNotice); this.rollBackProjectContraptionInfo(installationNotice);
} }
//删除设备履历信息 //删除设备履历信息
......
...@@ -858,6 +858,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -858,6 +858,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
List<JgUseRegistrationEq> equipList = equipmentLists.stream() List<JgUseRegistrationEq> equipList = equipmentLists.stream()
.map(x -> new JgUseRegistrationEq() .map(x -> new JgUseRegistrationEq()
.setEquId(String.valueOf(x.get("record"))) .setEquId(String.valueOf(x.get("record")))
.setOriginProjectContraptionId(String.valueOf(x.get("projectContraptionId")))
.setEquipTransferId(String.valueOf(useRegistration.getSequenceNbr()))) .setEquipTransferId(String.valueOf(useRegistration.getSequenceNbr())))
.collect(Collectors.toList()); .collect(Collectors.toList());
// 保存关联设备信息 // 保存关联设备信息
...@@ -1025,13 +1026,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1025,13 +1026,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
} }
//如果是气瓶或工业管道判断之前是否已经做过使用登记 //如果是气瓶或工业管道判断之前是否已经做过使用登记
if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategoryCode) || PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)) { if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategoryCode)) {
//如果是增补功能 //如果是增补功能
if ("1".equals(jgUseRegistration.getIsAddEquip())) { if ("1".equals(jgUseRegistration.getIsAddEquip())) {
useRegistrationCode = jgUseRegistration.getUseRegistrationCode(); useRegistrationCode = jgUseRegistration.getUseRegistrationCode();
flag = Boolean.TRUE; flag = Boolean.TRUE;
} }
} }
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) mapData.get("equipmentLists"); List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) mapData.get("equipmentLists");
String inspectConclusionName = getInspectConclusionName(mapData); String inspectConclusionName = getInspectConclusionName(mapData);
if (!CollectionUtils.isEmpty(equipmentLists)) { if (!CollectionUtils.isEmpty(equipmentLists)) {
...@@ -3884,13 +3886,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3884,13 +3886,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode,useUnitCreditCode); wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode,useUnitCreditCode);
wrapper.eq(IdxBizJgProjectContraption::getIsIntoManagement, true); wrapper.eq(IdxBizJgProjectContraption::getIsIntoManagement, true);
wrapper.eq(IdxBizJgProjectContraption::getIsFirstMerge, false);
wrapper.notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds); wrapper.notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds);
wrapper.isNull(IdxBizJgProjectContraption::getProjectContraptionParentId); wrapper.isNull(IdxBizJgProjectContraption::getProjectContraptionParentId);
wrapper.last("and (length(use_registration_code) = 0 or use_registration_code is null)"); wrapper.last("and (length(use_registration_code) = 0 or use_registration_code is null)");
return jgProjectContraptionService.page(page, wrapper); return jgProjectContraptionService.page(page, wrapper);
} }
public IPage<IdxBizJgProjectContraption> jgProjectContraptionPageMaster(String useUnitCreditCode, Page<IdxBizJgProjectContraption> page) { public List<IdxBizJgProjectContraption> jgProjectContraptionListMaster(String useUnitCreditCode) {
// 兼容个人业务 // 兼容个人业务
if(useUnitCreditCode.contains("_")){ if(useUnitCreditCode.contains("_")){
useUnitCreditCode = useUnitCreditCode.split("_")[1]; useUnitCreditCode = useUnitCreditCode.split("_")[1];
...@@ -3903,18 +3906,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3903,18 +3906,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
); );
Set<String> proIds = flowIngPros.stream() Set<String> proIds = flowIngPros.stream()
.map(JgUseRegistration::getProjectContraptionId) .map(JgUseRegistration::getProjectContraptionId)
.filter(id -> id != null && !id.isEmpty()) // 过滤 null 和空字符串 .filter(id -> id != null && !id.isEmpty())
.collect(toSet()); .collect(toSet());
// 查询已纳管且使用登记证编号为空或 null,非流程中的装置,或首次合并为 true
LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode, useUnitCreditCode) wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode, useUnitCreditCode)
.eq(IdxBizJgProjectContraption::getIsIntoManagement, true) .eq(IdxBizJgProjectContraption::getIsIntoManagement, true)
.notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds) .notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds)
.and(w -> w.isNull(IdxBizJgProjectContraption::getUseRegistrationCode) .and(w -> w.isNotNull(IdxBizJgProjectContraption::getUseRegistrationCode)
.or().eq(IdxBizJgProjectContraption::getUseRegistrationCode, "")
.or().eq(IdxBizJgProjectContraption::getIsFirstMerge, true)); .or().eq(IdxBizJgProjectContraption::getIsFirstMerge, true));
return jgProjectContraptionService.page(page, wrapper); return jgProjectContraptionService.list(wrapper);
} }
public Map<String, Object> getDeviceListByProjectContraption(String projectContraptionSeq, String[] originProjectContraptionIds) { public Map<String, Object> getDeviceListByProjectContraption(String projectContraptionSeq, String[] originProjectContraptionIds) {
...@@ -3930,7 +3930,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3930,7 +3930,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
double totalPipelineLength = equList.stream() double totalPipelineLength = equList.stream()
.map(map -> map.get("pipeLength")) .map(map -> map.get("pipeLength"))
.filter(Objects::nonNull) .filter(Objects::nonNull)
.mapToDouble(value -> (Double) value) .mapToDouble(value -> Double.parseDouble((String) value))
.sum(); .sum();
return MapBuilder.<String, Object>create() return MapBuilder.<String, Object>create()
......
package com.yeejoin.amos.boot.module.ymt.api.dto; package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...@@ -62,10 +63,10 @@ public class IdxBizJgProjectContraptionDto extends BaseDto { ...@@ -62,10 +63,10 @@ public class IdxBizJgProjectContraptionDto extends BaseDto {
private Double pipelineLength; private Double pipelineLength;
@ApiModelProperty(value = "产品照片附件") @ApiModelProperty(value = "产品照片附件")
private String productPhoto; private JSONArray productPhoto;
@ApiModelProperty(value = "其他附件") @ApiModelProperty(value = "其他附件")
private String otherAccessories; private JSONArray otherAccessories;
@ApiModelProperty(value = "属地监管单位代码") @ApiModelProperty(value = "属地监管单位代码")
private String orgCode; private String orgCode;
...@@ -74,7 +75,7 @@ public class IdxBizJgProjectContraptionDto extends BaseDto { ...@@ -74,7 +75,7 @@ public class IdxBizJgProjectContraptionDto extends BaseDto {
private String orgName; private String orgName;
@ApiModelProperty(value = "产品质量合格证明") @ApiModelProperty(value = "产品质量合格证明")
private String productQualificationCertificate; private JSONArray productQualificationCertificate;
@ApiModelProperty(value = "使用地点代码_省") @ApiModelProperty(value = "使用地点代码_省")
private String province; private String province;
......
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