Commit c50ec5c7 authored by chenzhao's avatar chenzhao

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents f001e4ec 5fe57328
...@@ -41,4 +41,14 @@ public class EquipRequestParamsDto { ...@@ -41,4 +41,14 @@ public class EquipRequestParamsDto {
private String equCode; private String equCode;
private String inspectUnitCreditCode; private String inspectUnitCreditCode;
private String inspectUnitName; 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
...@@ -43,7 +43,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -43,7 +43,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -1535,7 +1535,7 @@ public class DataDockServiceImpl { ...@@ -1535,7 +1535,7 @@ public class DataDockServiceImpl {
* @param paramsDto * @param paramsDto
*/ */
public void checkTheUnitRegManageAlreadyExists(EquipRequestParamsDto paramsDto) { public void checkTheUnitRegManageAlreadyExists(EquipRequestParamsDto paramsDto) {
idxBizJgRegisterInfoServiceImpl.checkUseRegistrationCode(paramsDto.getUseOrgCode(),"unit"); idxBizJgRegisterInfoServiceImpl.checkUseRegistrationCode(paramsDto.getUseOrgCode(), "unit");
Integer useRegManageCount = jgUseRegistrationManageService.lambdaQuery() Integer useRegManageCount = jgUseRegistrationManageService.lambdaQuery()
.eq(JgUseRegistrationManage::getUseUnitCreditCode, paramsDto.getCompanyCode()) .eq(JgUseRegistrationManage::getUseUnitCreditCode, paramsDto.getCompanyCode())
.eq(JgUseRegistrationManage::getUseUnitName, paramsDto.getCompanyName()) .eq(JgUseRegistrationManage::getUseUnitName, paramsDto.getCompanyName())
...@@ -1566,7 +1566,24 @@ public class DataDockServiceImpl { ...@@ -1566,7 +1566,24 @@ public class DataDockServiceImpl {
String inspectUnitCreditCode = Optional.ofNullable(equLists.get(0).getInspectOrgCode()).orElse(""); String inspectUnitCreditCode = Optional.ofNullable(equLists.get(0).getInspectOrgCode()).orElse("");
String inspectUnitName = Optional.ofNullable(equLists.get(0).getInspectOrgName()).orElse(""); String inspectUnitName = Optional.ofNullable(equLists.get(0).getInspectOrgName()).orElse("");
String useOrgCode = String.valueOf(equipInfo.get("USE_ORG_CODE")); 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]) 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()) .setCompanyName(company.getCompanyName())
.setCompanyAddress(company.getAddress()) .setCompanyAddress(company.getAddress())
.setExecUserId(userModel.getUserId()) .setExecUserId(userModel.getUserId())
...@@ -1595,6 +1612,24 @@ public class DataDockServiceImpl { ...@@ -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 { ...@@ -1662,6 +1697,7 @@ public class DataDockServiceImpl {
useInfo.setUseUnitName(paramsDto.getCompanyName()); useInfo.setUseUnitName(paramsDto.getCompanyName());
useInfo.setProjectContraption(paramsDto.getProjectContraption()); useInfo.setProjectContraption(paramsDto.getProjectContraption());
useInfo.setProjectContraptionId(paramsDto.getProjectContraptionSeq()); useInfo.setProjectContraptionId(paramsDto.getProjectContraptionSeq());
BeanUtils.copyProperties(paramsDto, useInfo);
useInfoList.add(useInfo); useInfoList.add(useInfo);
// 检验检测信息 // 检验检测信息
...@@ -1763,6 +1799,17 @@ public class DataDockServiceImpl { ...@@ -1763,6 +1799,17 @@ public class DataDockServiceImpl {
esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName()); esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName());
esEquipmentDto.setProjectContraptionId(paramsDto.getProjectContraptionSeq()); esEquipmentDto.setProjectContraptionId(paramsDto.getProjectContraptionSeq());
esEquipmentDto.setUSE_ORG_CODE(paramsDto.getUseOrgCode()); 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) { if (inspectionDetectionInfo.getNextInspectDate() != null) {
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime()); esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime());
} }
...@@ -1945,7 +1992,9 @@ public class DataDockServiceImpl { ...@@ -1945,7 +1992,9 @@ public class DataDockServiceImpl {
.orgCode(paramsDto.getOrgBranchCode()) .orgCode(paramsDto.getOrgBranchCode())
.orgName(paramsDto.getOrgBranchName()) .orgName(paramsDto.getOrgBranchName())
.productQualificationCertificate(paramsDto.getProductQualificationCertificate()) .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(); .supervisoryCode(idxBizJgRegisterInfoServiceImpl.getSupervisoryCode(paramsDto.getVehicleApanage(), paramsDto.getEquCategoryCode())).isIntoManagement(Boolean.TRUE).dataSource(paramsDto.getDataSource()).equCode(paramsDto.getEquCode()).isFirstMerge(Boolean.FALSE).build();
contraption.setSequenceNbr(seq); contraption.setSequenceNbr(seq);
paramsDto.setProjectContraptionSeq(String.valueOf(seq)); paramsDto.setProjectContraptionSeq(String.valueOf(seq));
......
...@@ -310,7 +310,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -310,7 +310,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
Page<Map<String, Object>> page=new Page<>(); Page<Map<String, Object>> page=new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); 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)); page.setTotal(baseMapper.selectEquipCount(sequenceNbr));
return page; return page;
} }
...@@ -334,6 +334,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -334,6 +334,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
Map map = (LinkedHashMap)record; Map map = (LinkedHashMap)record;
detectionInfo.setRecDate(new Date()); detectionInfo.setRecDate(new Date());
detectionInfo.setSequenceNbr((String) map.get("detectionInfoSequenceNbr")); detectionInfo.setSequenceNbr((String) map.get("detectionInfoSequenceNbr"));
detectionInfo.setInspectConclusion((String)map.get("inspectConclusionCode"));
jgInspectionDetectionInfos.add(detectionInfo); jgInspectionDetectionInfos.add(detectionInfo);
} }
} }
......
...@@ -532,6 +532,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -532,6 +532,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
JSONObject dto = jsonObject.getJSONObject("sourceAsMap"); JSONObject dto = jsonObject.getJSONObject("sourceAsMap");
dto.put("record", dto.get("SEQUENCE_NBR")); dto.put("record", dto.get("SEQUENCE_NBR"));
dto.put("equipAddress", dto.get("USE_PLACE") + "/" + dto.get("ADDRESS")); 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); list.add(dto);
} }
totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value; totle = Objects.requireNonNull(response.getInternalResponse().hits().getTotalHits()).value;
......
...@@ -2399,6 +2399,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2399,6 +2399,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
for (int i = 0; i < equipmentLists.size(); i++) { for (int i = 0; i < equipmentLists.size(); i++) {
JSONObject equipmentItem = equipmentLists.getJSONObject(i); JSONObject equipmentItem = equipmentLists.getJSONObject(i);
equipmentItem.put("useDate", timeToMonths(useDateValue)); equipmentItem.put("useDate", timeToMonths(useDateValue));
// 过滤出目前在用的设备
if(!this.checkEquStatusInUse(equipmentItem.getString("record"))){
equipmentLists.remove(i);
}
} }
allEquipment.addAll(equipmentLists); allEquipment.addAll(equipmentLists);
} }
...@@ -2449,6 +2453,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2449,6 +2453,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
return futureList; return futureList;
} }
/**
* 根据record判断设备状态是否为【在用】
* @param record
* @return
*/
private boolean checkEquStatusInUse(String record) {
IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.lambdaQuery().select(IdxBizJgUseInfo::getEquState).eq(IdxBizJgUseInfo::getRecord, record).one();
return EquimentEnum.ZAIYONG.getCode().toString().equals(useInfo.getEquState());
}
/** /**
* 导出基本信息汇总表(工业管道/气瓶) * 导出基本信息汇总表(工业管道/气瓶)
* *
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
SELECT ibjtpp."SEQUENCE_NBR" AS sequenceNbr, SELECT ibjtpp."SEQUENCE_NBR" AS sequenceNbr,
ibjtpp."PIPE_NAME" AS pipeName, ibjtpp."PIPE_NAME" AS pipeName,
ibjtpp."PIPELINE_NUMBER" AS pipelineNumber, 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."NOMINAL_DIAMETER" AS nominalDiameter,
ibjtpp."WALL_THICKNESS" AS wallThickness, ibjtpp."WALL_THICKNESS" AS wallThickness,
ibjtpp."PIPE_LENGTH" AS pipeLength, ibjtpp."PIPE_LENGTH" AS pipeLength,
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
ibjtpp."REMARKS" AS remarks, 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 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_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 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,
(select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) nextInspectDate, (select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) 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_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, (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,
......
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