Commit 2518e8bc 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 0e18e892 bcb3ed48
......@@ -15,12 +15,10 @@ import com.yeejoin.amos.api.openapi.util.MultiFieldKey;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
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 java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -45,7 +43,6 @@ public class TmCylinderFillingExamineService extends MyBaseServiceImpl<TmCylinde
private EventPublisher eventPublisher;
@DSTransactional
@Transactional(rollbackFor = Exception.class)
public String createCylinderFillingExamine(List<TmCylinderFillingExamineModel> model) {
if (ValidationUtil.isEmpty(model))
throw new BadRequest("液化气体气瓶充装信息审核为空.");
......@@ -87,11 +84,14 @@ public class TmCylinderFillingExamineService extends MyBaseServiceImpl<TmCylinde
if (!ValidationUtil.isEmpty(oldList)) {
List<String> fileUrlList = Lists.newArrayList();
oldList.forEach(old -> {
if (old.getFillingAuditUrl() != null) {
fileUrlList.addAll(Arrays.asList(ValidationUtil.isEmpty(old.getFillingAuditUrl()) ? new String[0] : old.getFillingAuditUrl().split(",")));
if (!ValidationUtil.isEmpty(old.getFillingAuditUrl())) {
fileUrlList.add(old.getFillingAuditUrl());
}
});
eventPublisher.publish(new FileToBeDeleteEvent(this, FileDeleteUtil.extractFileNames(fileUrlList)));
List<String> fileNameList = FileDeleteUtil.extractFileNames(fileUrlList);
if (!ValidationUtil.isEmpty(fileNameList)) {
eventPublisher.publish(new FileToBeDeleteEvent(this, fileNameList));
}
}
}
......
......@@ -32,6 +32,11 @@ public class FileDeleteUtil {
List<String> fileUrls = Lists.newArrayList();
if (!ValidationUtil.isEmpty(jsonStr)) {
try {
log.debug("jsonStr:{}", jsonStr);
if (!JSONObject.isValid(jsonStr)) {
fileUrls.add(jsonStr);
return fileUrls;
}
Object json = JSONObject.parse(jsonStr);
if (json instanceof JSONArray) {
JSONArray jsonArray = JSONObject.parseArray(jsonStr);
......@@ -57,7 +62,7 @@ public class FileDeleteUtil {
}
return fileUrls;
} catch (Exception e) {
log.info("Error parsing JSON: {}", jsonStr);
log.error("Error parsing JSON: {}", jsonStr);
System.err.println("Error parsing JSON: " + e.getMessage());
}
}
......
......@@ -41,4 +41,14 @@ public class EquipRequestParamsDto {
private String equCode;
private String inspectUnitCreditCode;
private String inspectUnitName;
private String province;
private String provinceName;
private String city;
private String cityName;
private String county;
private String countyName;
private String street;
private String streetName;
private String address;
private String usePlace;
}
\ No newline at end of file
......@@ -646,6 +646,7 @@
pp."WORK_TEMPERATURE" AS workTemperature,
pp."WORK_MEDIUM" AS workMedium,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectConclusionCode,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate
FROM
......@@ -1074,7 +1075,6 @@
#{item}
</foreach>
AND ui.IS_INTO_MANAGEMENT = true
AND (length(ri.USE_ORG_CODE) = 0 OR ri.USE_ORG_CODE IS NULL)
ORDER BY ui.REC_DATE DESC
)
</select>
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -42,7 +43,7 @@ public class IdxBizJgProjectContraptionController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增管道工程装置表", notes = "新增管道工程装置表")
public ResponseModel<Boolean> save(@RequestBody IdxBizJgProjectContraptionDto model) {
public ResponseModel<IdxBizJgProjectContraption> save(@RequestBody IdxBizJgProjectContraptionDto model) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.saveFirstMergeProjectContraption(model));
}
......@@ -165,8 +166,8 @@ public class IdxBizJgProjectContraptionController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveOrUpdateDetectionInfoBatch")
@ApiOperation(httpMethod = "POST", value = "新增或者更新检验信息", notes = "新增或者更新检验信息")
public ResponseModel<?> saveOrUpdateDetectionInfoBatch(@RequestBody List<IdxBizJgInspectionDetectionInfo> detectionInfos) {
idxBizJgProjectContraptionServiceImpl.saveOrUpdateDetectionInfoBatch(detectionInfos);
public ResponseModel<?> saveOrUpdateDetectionInfoBatch(@RequestBody JSONObject jsonObject) {
idxBizJgProjectContraptionServiceImpl.saveOrUpdateDetectionInfoBatch(jsonObject);
return ResponseHelper.buildResponse("更新成功");
}
......@@ -194,6 +195,18 @@ public class IdxBizJgProjectContraptionController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.getDetectionInfoDetail(sequenceNbr));
}
/**
* 获取最新检验信息详情
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getNewInspectionDetailByRecord")
@ApiOperation(httpMethod = "GET", value = "获取最新检验信息详情", notes = "获取最新检验信息详情")
public ResponseModel<IdxBizJgInspectionDetectionInfo> getNewInspectionDetailByRecord(@RequestParam("record") String record) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.getNewInspectionDetailByRecord(record));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/summaryBasicInfo/export")
@ApiOperation(httpMethod = "GET", value = "导出基本信息汇总表(长输/公用管道)", notes = "导出基本信息汇总表(长输/公用管道)")
......
......@@ -389,7 +389,7 @@ public class JgUseRegistrationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询工程装置下的所有做过安装告知但是为做使用登记的管道", notes = "查询工程装置下的所有做过安装告知但是为做使用登记的管道")
@GetMapping(value = "/getDeviceListByProjectContraptionSeq")
public ResponseModel<Object> getDeviceListByProjectContraption(@RequestParam("record") String projectContraptionSeq,
@RequestParam(required = false) String[] originProjectContraptionIds) {
@RequestParam("originProjectContraptionIds") String[] originProjectContraptionIds) {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getDeviceListByProjectContraption(projectContraptionSeq, originProjectContraptionIds));
}
}
......@@ -155,17 +155,17 @@ public class BatchDataChangeProcessStrategy implements IChangeDataProcessStrateg
List<String> records = eqs.stream().map(JgUseRegistrationEq::getEquId).collect(toList());
IdxBizJgRegisterInfo registerInfo = useRegistrationService.getRegisterInfo(jgUseRegistration);
List<Map<String, Object>> tableData;
if (CylinderTypeEnum.CYLINDER.getCode().equals(registerInfo.getEquCategory())) {
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
tableData = jgUseRegistrationMapper.queryForUnitVesselEquipment(records);
tableData.forEach(i -> i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium"))));
} else {
if (EquipmentClassifityEnum.YLGD.getCode().equals(registerInfo.getEquList())){
IdxBizJgProjectContraption idxBizJgProjectContraption = idxBizJgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
Map<String, Object> map = IdxBizJgRegisterInfoServiceImpl.convertCamelToUnderscore(idxBizJgProjectContraption, IdxBizJgProjectContraptionServiceImpl.jsonFields);
result.putAll(map);
result.put("projectContraptionId", idxBizJgProjectContraption.getSequenceNbr());
tableData = jgUseRegistrationMapper.queryForUnitPipelineEquipmentForEdit(records);
} else {
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
tableData = jgUseRegistrationMapper.queryForUnitVesselEquipment(records);
tableData.forEach(i -> i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium"))));
}
result.put("tableData", tableData);
return result;
......
......@@ -43,7 +43,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.aspectj.weaver.ast.Var;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
......@@ -1535,7 +1535,7 @@ public class DataDockServiceImpl {
* @param paramsDto
*/
public void checkTheUnitRegManageAlreadyExists(EquipRequestParamsDto paramsDto) {
idxBizJgRegisterInfoServiceImpl.checkUseRegistrationCode(paramsDto.getUseOrgCode(),"unit");
idxBizJgRegisterInfoServiceImpl.checkUseRegistrationCode(paramsDto.getUseOrgCode(), "unit");
Integer useRegManageCount = jgUseRegistrationManageService.lambdaQuery()
.eq(JgUseRegistrationManage::getUseUnitCreditCode, paramsDto.getCompanyCode())
.eq(JgUseRegistrationManage::getUseUnitName, paramsDto.getCompanyName())
......@@ -1566,7 +1566,24 @@ public class DataDockServiceImpl {
String inspectUnitCreditCode = Optional.ofNullable(equLists.get(0).getInspectOrgCode()).orElse("");
String inspectUnitName = Optional.ofNullable(equLists.get(0).getInspectOrgName()).orElse("");
String useOrgCode = String.valueOf(equipInfo.get("USE_ORG_CODE"));
String province = String.valueOf(equipInfo.get("province"));
String city = String.valueOf(equipInfo.get("city"));
String county = String.valueOf(equipInfo.get("county"));
String street = String.valueOf(equipInfo.get("street"));
String address = String.valueOf(equipInfo.get("address"));
String usePlace = String.valueOf(equipInfo.get("usePlace"));
return new EquipRequestParamsDto().setCompanyCode(company.getCompanyCode().split("_")[0])
.setProvince(province)
.setProvinceName("陕西省")
.setCity(city)
.setCityName(this.getRegionName("CITY", "CITY".toLowerCase(), equipInfo))
.setCounty(county)
.setCountyName(this.getRegionName("REGION", "COUNTY".toLowerCase(), equipInfo))
.setStreet(street)
.setStreetName(this.getRegionName("STREET", "STREET".toLowerCase(), equipInfo))
.setAddress(address)
.setUsePlace(usePlace)
.setCompanyName(company.getCompanyName())
.setCompanyAddress(company.getAddress())
.setExecUserId(userModel.getUserId())
......@@ -1595,6 +1612,24 @@ public class DataDockServiceImpl {
}
/**
* 根据code获取市区县名字
*
* @param key key
* @param codeKey codeKey
* @param mapData 表单信息
* @return name
*/
private String getRegionName(String key, String codeKey, JSONObject mapData) {
return Optional.ofNullable((List<LinkedHashMap>) redisUtils.get(key))
.flatMap(list -> list.stream()
.filter(item -> String.valueOf(item.get("regionCode"))
.equals(String.valueOf(mapData.get(codeKey))))
.map(item -> (String) item.get("regionName"))
.findFirst())
.orElse("");
}
/**
* 检查本单位是否已存在该工程装置
* 存在则抛出异常
*
......@@ -1662,6 +1697,7 @@ public class DataDockServiceImpl {
useInfo.setUseUnitName(paramsDto.getCompanyName());
useInfo.setProjectContraption(paramsDto.getProjectContraption());
useInfo.setProjectContraptionId(paramsDto.getProjectContraptionSeq());
BeanUtils.copyProperties(paramsDto, useInfo);
useInfoList.add(useInfo);
// 检验检测信息
......@@ -1762,6 +1798,18 @@ public class DataDockServiceImpl {
esEquipmentDto.setPROJECT_CONTRAPTION(paramsDto.getProjectContraption());
esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName());
esEquipmentDto.setProjectContraptionId(paramsDto.getProjectContraptionSeq());
esEquipmentDto.setUSE_ORG_CODE(paramsDto.getUseOrgCode());
esEquipmentDto.setSUPERVISORY_CODE(proCon.getSupervisoryCode());
esEquipmentDto.setUSE_UNIT_CREDIT_CODE(paramsDto.getCompanyCode());
esEquipmentDto.setUSE_UNIT_NAME(paramsDto.getCompanyName());
esEquipmentDto.setADDRESS(paramsDto.getAddress());
esEquipmentDto.setUSE_PLACE(paramsDto.getProvinceName() + "/" + paramsDto.getCityName() + "/" + paramsDto.getCountyName() + "/" + paramsDto.getStreetName());
esEquipmentDto.setUSE_PLACE_CODE(paramsDto.getProvince() + "#" + paramsDto.getCity() + "#" + paramsDto.getCounty() + "#" + paramsDto.getStreet());
esEquipmentDto.setUSE_SITE_CODE(paramsDto.getUsePlace());
esEquipmentDto.setORG_BRANCH_CODE(paramsDto.getOrgBranchCode());
esEquipmentDto.setORG_BRANCH_NAME(paramsDto.getOrgBranchName());
esEquipmentDto.setEQU_STATE(1);
esEquipmentDto.setEQU_CODE(paramsDto.getEquCode());
if (inspectionDetectionInfo.getNextInspectDate() != null) {
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime());
}
......@@ -1944,7 +1992,9 @@ public class DataDockServiceImpl {
.orgCode(paramsDto.getOrgBranchCode())
.orgName(paramsDto.getOrgBranchName())
.productQualificationCertificate(paramsDto.getProductQualificationCertificate())
// .province().provinceName().city().cityName().county().countyName().street().streetName().address()
.province(paramsDto.getProvince()).provinceName(paramsDto.getProvinceName()).city(paramsDto.getCity()).cityName(paramsDto.getCityName())
.county(paramsDto.getCounty()).countyName(paramsDto.getCountyName()).street(paramsDto.getStreet()).streetName(paramsDto.getStreetName())
.address(paramsDto.getAddress())
.supervisoryCode(idxBizJgRegisterInfoServiceImpl.getSupervisoryCode(paramsDto.getVehicleApanage(), paramsDto.getEquCategoryCode())).isIntoManagement(Boolean.TRUE).dataSource(paramsDto.getDataSource()).equCode(paramsDto.getEquCode()).isFirstMerge(Boolean.FALSE).build();
contraption.setSequenceNbr(seq);
paramsDto.setProjectContraptionSeq(String.valueOf(seq));
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.converter.DictParamsConverter;
import com.yeejoin.amos.boot.module.jg.api.dto.InspectConclusionConverter;
import com.yeejoin.amos.boot.module.jg.api.dto.InspectTypeConverter;
import com.yeejoin.amos.boot.module.jg.api.dto.PipingExcelDto;
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.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.*;
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.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
......@@ -56,6 +50,7 @@ import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static com.alibaba.fastjson.JSON.toJSONString;
/**
* 管道工程装置表服务实现类
......@@ -306,23 +301,41 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
Page<Map<String, Object>> page=new Page<>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(baseMapper.selectEquipListPage(sequenceNbr,(current-1)*size,size));
page.setRecords(baseMapper.selectEquipListPage(sequenceNbr, (current - 1) * size, size));
page.setTotal(baseMapper.selectEquipCount(sequenceNbr));
return page;
}
@Transactional(rollbackFor = Exception.class)
public void saveOrUpdateDetectionInfo(IdxBizJgInspectionDetectionInfo detectionInfo) {
detectionInfo.setRecDate(new Date());
detectionInfoService.saveOrUpdateData(detectionInfo);
}
public void saveOrUpdateDetectionInfoBatch(List<IdxBizJgInspectionDetectionInfo> detectionInfos) {
if(CollectionUtil.isNotEmpty(detectionInfos)){
for (IdxBizJgInspectionDetectionInfo detectionInfo : detectionInfos) {
detectionInfo.setRecDate(new Date());
@Transactional(rollbackFor = Exception.class)
public void saveOrUpdateDetectionInfoBatch(JSONObject jsonObject) {
if(Objects.nonNull(jsonObject)){
JSONArray records = jsonObject.getJSONArray("records");
if(CollectionUtil.isNotEmpty(records)){
List<IdxBizJgInspectionDetectionInfo> jgInspectionDetectionInfos= new ArrayList<>();
for (Object record : records) {
IdxBizJgInspectionDetectionInfo detectionInfo = JSON.parseObject(JSONObject.toJSONString(record), IdxBizJgInspectionDetectionInfo.class);
if(Objects.nonNull(detectionInfo)){
if (record instanceof LinkedHashMap){
Map map = (LinkedHashMap)record;
detectionInfo.setRecDate(new Date());
detectionInfo.setSequenceNbr((String) map.get("detectionInfoSequenceNbr"));
detectionInfo.setInspectConclusion((String)map.get("inspectConclusionCode"));
jgInspectionDetectionInfos.add(detectionInfo);
}
}
}
if(CollUtil.isNotEmpty(jgInspectionDetectionInfos)){
detectionInfoService.saveOrUpdateBatch(jgInspectionDetectionInfos);
}
}
detectionInfoService.saveOrUpdateBatch(detectionInfos);
}
}
public IdxBizJgInspectionDetectionInfo getDetectionInfoDetail(String sequenceNbr) {
......@@ -485,15 +498,15 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
}
}
public boolean saveFirstMergeProjectContraption(IdxBizJgProjectContraptionDto model) {
public IdxBizJgProjectContraption 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.setDataSource("jg");
projectContraption.setIsIntoManagement(false);
projectContraption.setProvinceName("陕西省");
projectContraption.setEquList(model.getEquListCode());
projectContraption.setEquCategory(model.getEquCategoryCode());
......@@ -504,7 +517,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
projectContraption.setPipelineLength(0.0);
projectContraption.setUseUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
return this.saveOrUpdateData(projectContraption);
this.saveOrUpdateData(projectContraption);
return projectContraption;
}
@Override
......@@ -584,4 +598,14 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
}
}
public IdxBizJgInspectionDetectionInfo getNewInspectionDetailByRecord(String record) {
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = detectionInfoService.queryNewestDetailByRecord(record);
if (inspectionDetectionInfo != null) {
String inspectReport = inspectionDetectionInfo.getInspectReport();
if (inspectReport != null) {
inspectionDetectionInfo.setInspectReport(JSON.parseArray(inspectReport).toJSONString());
}
}
return inspectionDetectionInfo;
}
}
\ No newline at end of file
......@@ -532,6 +532,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
JSONObject dto = jsonObject.getJSONObject("sourceAsMap");
dto.put("record", dto.get("SEQUENCE_NBR"));
dto.put("equipAddress", dto.get("USE_PLACE") + "/" + dto.get("ADDRESS"));
dto.put("EQU_STATE_NAME",EquimentEnum.getName.get(Integer.valueOf(dto.getString("EQU_STATE"))));
list.add(dto);
}
totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value;
......
......@@ -146,7 +146,7 @@
SELECT ibjtpp."SEQUENCE_NBR" AS sequenceNbr,
ibjtpp."PIPE_NAME" AS pipeName,
ibjtpp."PIPELINE_NUMBER" AS pipelineNumber,
ibjtpp."DEVICE_LEVEL" AS deviceLevel,
(select name from cb_data_dictionary where code = ibjtpp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
ibjtpp."NOMINAL_DIAMETER" AS nominalDiameter,
ibjtpp."WALL_THICKNESS" AS wallThickness,
ibjtpp."PIPE_LENGTH" AS pipeLength,
......@@ -159,12 +159,12 @@
ibjtpp."REMARKS" AS remarks,
(select SEQUENCE_NBR from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) detectionInfoSequenceNbr,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectConclusion,
(select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) nextInspectDate,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1),'YYYY-MM-DD') nextInspectDate,
(select USC_UNIT_NAME from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscUnitName,
(select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscDate,
to_char((select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1),'YYYY-MM-DD') as uscDate,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate,
to_char(ibjui."USE_DATE",'YYYY-MM-DD') AS useDate,
ibjui."RECORD" AS record
FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
......@@ -219,7 +219,7 @@
<select id="selectEquipListByExport" resultType="java.util.Map">
SELECT ibjtpp."PIPE_NAME" AS productName,
ibjtpp."PIPELINE_NUMBER" AS pipelineNumber,
ibjtpp."DEVICE_LEVEL" AS deviceLevel,
(select name from cb_data_dictionary where code = ibjtpp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
ibjtpp."NOMINAL_DIAMETER" AS nominalDiameter,
ibjtpp."WALL_THICKNESS" AS wallThickness,
ibjtpp."PIPE_LENGTH" AS pipeLength,
......@@ -231,12 +231,12 @@
ibjtpp."WORK_MEDIUM" AS workMedium,
ibjtpp."REMARKS" AS remarks,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectConclusion,
(select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) nextInspectDate,
(select name from cb_data_dictionary where type = 'JYJL' and code = (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1),'YYYY-MM-DD') nextInspectDate,
(select USC_UNIT_NAME from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscUnitName,
(select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscDate,
to_char((select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1),'YYYY-MM-DD') as uscDate,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate,
to_char(ibjui."USE_DATE",'YYYY-MM-DD') AS useDate,
ibjui."RECORD" AS record
FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
......@@ -261,8 +261,8 @@
ibjui.project_contraption_id = #{sequenceNbr}
) A
WHERE
A.inspectOrgName != NULL AND A.inspectOrgName != '' AND A.inspectConclusion!=NULL and A.inspectConclusion!=''
and A.nextInspectDate != NULL
A.inspectOrgName IS NOT NULL AND A.inspectOrgName != '' AND A.inspectConclusion IS NOT NULL and A.inspectConclusion!=''
and A.nextInspectDate IS NOT NULL
</select>
<select id="countContraptionInUseTimesForDeleteByIntoManagement" resultType="java.lang.Integer">
......
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