Commit c5f058dd authored by Lambertliu's avatar Lambertliu

fix(jg):查询最新检测详情附件处理

parent 5c5277c0
...@@ -203,7 +203,7 @@ public class IdxBizJgProjectContraptionController extends BaseController { ...@@ -203,7 +203,7 @@ public class IdxBizJgProjectContraptionController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getNewInspectionDetailByRecord") @GetMapping(value = "/getNewInspectionDetailByRecord")
@ApiOperation(httpMethod = "GET", value = "获取最新检验信息详情", notes = "获取最新检验信息详情") @ApiOperation(httpMethod = "GET", value = "获取最新检验信息详情", notes = "获取最新检验信息详情")
public ResponseModel<IdxBizJgInspectionDetectionInfo> getNewInspectionDetailByRecord(@RequestParam("record") String record) { public ResponseModel<Map<String, Object>> getNewInspectionDetailByRecord(@RequestParam("record") String record) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.getNewInspectionDetailByRecord(record)); return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.getNewInspectionDetailByRecord(record));
} }
......
...@@ -2,8 +2,6 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl; ...@@ -2,8 +2,6 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; 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.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -13,18 +11,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -13,18 +11,11 @@ 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.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; 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.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.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.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.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.*;
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.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
...@@ -38,12 +29,11 @@ import org.apache.commons.io.IOUtils; ...@@ -38,12 +29,11 @@ import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
...@@ -328,7 +318,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -328,7 +318,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
if(CollectionUtil.isNotEmpty(records)){ if(CollectionUtil.isNotEmpty(records)){
List<IdxBizJgInspectionDetectionInfo> jgInspectionDetectionInfos= new ArrayList<>(); List<IdxBizJgInspectionDetectionInfo> jgInspectionDetectionInfos= new ArrayList<>();
for (Object record : records) { for (Object record : records) {
IdxBizJgInspectionDetectionInfo detectionInfo = JSON.parseObject(JSONObject.toJSONString(record), IdxBizJgInspectionDetectionInfo.class); IdxBizJgInspectionDetectionInfo detectionInfo = JSON.parseObject(toJSONString(record), IdxBizJgInspectionDetectionInfo.class);
if(Objects.nonNull(detectionInfo)){ if(Objects.nonNull(detectionInfo)){
if (record instanceof LinkedHashMap){ if (record instanceof LinkedHashMap){
Map map = (LinkedHashMap)record; Map map = (LinkedHashMap)record;
...@@ -514,7 +504,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -514,7 +504,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
String equCategoryName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquCategoryCode()); String equCategoryName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquCategoryCode());
String equDefineName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquDefineCode()); String equDefineName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquDefineCode());
projectContraption.setDataSource("jg"); projectContraption.setDataSource("jg");
projectContraption.setIsIntoManagement(true); projectContraption.setIsIntoManagement(false);
projectContraption.setProvinceName("陕西省"); projectContraption.setProvinceName("陕西省");
projectContraption.setEquList(model.getEquListCode()); projectContraption.setEquList(model.getEquListCode());
projectContraption.setEquCategory(model.getEquCategoryCode()); projectContraption.setEquCategory(model.getEquCategoryCode());
...@@ -605,14 +595,14 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -605,14 +595,14 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
} }
} }
public IdxBizJgInspectionDetectionInfo getNewInspectionDetailByRecord(String record) { public Map<String, Object> getNewInspectionDetailByRecord(String record) {
// 检验检测【一对多,暂时只取最新一条数据】
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = detectionInfoService.queryNewestDetailByRecord(record); IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = detectionInfoService.queryNewestDetailByRecord(record);
if (inspectionDetectionInfo != null) { Map<String, Object> inspectionDetectionInfoMap = Collections.emptyMap();
String inspectReport = inspectionDetectionInfo.getInspectReport(); if (!ValidationUtil.isEmpty(inspectionDetectionInfo)) {
if (inspectReport != null) { inspectionDetectionInfoMap = Bean.BeantoMap(inspectionDetectionInfo);
inspectionDetectionInfo.setInspectReport(JSON.parseArray(inspectReport).toJSONString()); inspectionDetectionInfoMap.put("inspectReport", JSON.parseArray(inspectionDetectionInfo.getInspectReport()));
}
} }
return inspectionDetectionInfo; return inspectionDetectionInfoMap;
} }
} }
\ No newline at end of file
...@@ -1128,6 +1128,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1128,6 +1128,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgProjectContraption.setCountyName(getRegionName(REGION, COUNTY.toLowerCase(), mapData)); jgProjectContraption.setCountyName(getRegionName(REGION, COUNTY.toLowerCase(), mapData));
jgProjectContraption.setStreetName(getRegionName(STREET, "factoryUseSiteStreet", mapData)); jgProjectContraption.setStreetName(getRegionName(STREET, "factoryUseSiteStreet", mapData));
jgProjectContraption.setIsFirstMerge(false); jgProjectContraption.setIsFirstMerge(false);
jgProjectContraption.setIsIntoManagement(true);
if (!StringUtils.isEmpty(mapData.get("orgBranchCode"))) { if (!StringUtils.isEmpty(mapData.get("orgBranchCode"))) {
jgProjectContraption.setOrgName(String.valueOf(mapData.getString("orgBranchCode")).split("_")[1]); jgProjectContraption.setOrgName(String.valueOf(mapData.getString("orgBranchCode")).split("_")[1]);
jgProjectContraption.setOrgCode(String.valueOf(mapData.getString("orgBranchCode")).split("_")[0]); jgProjectContraption.setOrgCode(String.valueOf(mapData.getString("orgBranchCode")).split("_")[0]);
...@@ -3982,7 +3983,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3982,7 +3983,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.collect(toSet()); .collect(toSet());
LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode, useUnitCreditCode) wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode, useUnitCreditCode)
.eq(IdxBizJgProjectContraption::getIsIntoManagement, true)
.notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds) .notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds)
.and(w -> w.isNotNull(IdxBizJgProjectContraption::getUseRegistrationCode) .and(w -> w.isNotNull(IdxBizJgProjectContraption::getUseRegistrationCode)
.or().eq(IdxBizJgProjectContraption::getIsFirstMerge, true)); .or().eq(IdxBizJgProjectContraption::getIsFirstMerge, true));
......
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