Commit 15c41684 authored by hezhuozhi's avatar hezhuozhi

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

parents cd913b80 6b647cc1
......@@ -128,6 +128,10 @@ public class PipingExcelDto extends BaseDto {
@ExcelProperty(value = "检验报告编号")
private String inspectReportNo;
@ApiModelProperty(value = "检验报告附件")
@ExcelIgnore
private String inspectReport;
//-----------------------------------------------------------------------设计信息
@ApiModelProperty(value = "设计单位统一社会信用代码")
......
......@@ -80,6 +80,7 @@
ur.supervision_org_code,
ur.use_address as fullAddress,
ur.cancel_reason as cancelReason,
ur.project_contraption_id as projectContraptionId,
(select group_concat(re.equ_id) from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id) as equipId,
(SELECT
group_concat(DISTINCT other.supervisory_code)
......@@ -645,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
......@@ -1073,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>
......
......@@ -75,7 +75,7 @@ public class DataDockController {
**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/savePipingData")
@ApiOperation(httpMethod = "POST", value = "工业管道批量保存", notes = "工业管道批量保存")
@ApiOperation(httpMethod = "POST", value = "工业 、公用、长输管道批量保存", notes = "工业 、公用、长输管道批量保存")
@RestEventTrigger(value = "operateLogRestEventHandler")
public ResponseModel<?> savePipingData(@RequestBody Map<String, Object> paramMap) {
return ResponseHelper.buildResponse(dataDockService.savePipingData(paramMap));
......
......@@ -195,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 = "导出基本信息汇总表(长输/公用管道)")
......
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege;
......@@ -29,6 +30,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -45,6 +47,8 @@ public class JgUseRegistrationController extends BaseController {
@Autowired
JgUseRegistrationServiceImpl jgUseRegistrationServiceImpl;
@Resource
private IdxBizJgProjectContraptionMapper jgProjectContraptionMapper;
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -143,6 +147,9 @@ public class JgUseRegistrationController extends BaseController {
list.getRecords().forEach(x -> {
x.put("companyType", info.getCompany().getCompanyType());
x.put("regType", "1".equals(x.get("regType")) ? "历史登记": "2".equals(x.get("regType")) ? "特殊历史登记": "新增登记");
if ("8000".equals(String.valueOf(x.get("equListCode")))){
x.put("canVoided", jgProjectContraptionMapper.countContraptionInUseTimesForDeleteByIntoManagement(Long.parseLong((String) x.get("projectContraptionId"))) == 0);
}
});
return ResponseHelper.buildResponse(list);
}
......@@ -382,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));
}
}
......@@ -513,7 +513,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
String equListName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquListCode());
String equCategoryName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquCategoryCode());
String equDefineName = jgVehicleInformationMapper.getEquCategoryNameByCode(model.getEquDefineCode());
projectContraption.setDataSource("new");
projectContraption.setDataSource("jg");
projectContraption.setIsIntoManagement(true);
projectContraption.setProvinceName("陕西省");
projectContraption.setEquList(model.getEquListCode());
......@@ -605,4 +605,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
}
}
public IdxBizJgInspectionDetectionInfo getNewInspectionDetailByRecord(String record) {
return detectionInfoService.queryNewestDetailByRecord(record);
}
}
\ No newline at end of file
......@@ -27,4 +27,6 @@ public interface JyjcInspectionApplicationEquipMapper extends BaseMapper<JyjcIns
List<InspectTimeCountDto> countInspectTimeCountByTypeAndEquList(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
Integer inspectTimeCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto);
List<JyjcInspectionApplicationEquip> queryWaitFlushData();
}
......@@ -75,4 +75,24 @@
GROUP BY
C.equ_category
</select>
<select id="queryWaitFlushData"
resultType="com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEquip">
SELECT
a.sequence_nbr as application_seq,
ae.sequence_nbr,
ui."PROJECT_CONTRAPTION_ID",
AE.equ_category
FROM
"amos_tzs_biz"."tz_jyjc_inspection_application" a,
tz_jyjc_inspection_application_equip ae,
idx_biz_jg_use_info ui,
idx_biz_jg_project_contraption pc
WHERE
a."equip_classify" = '8000'
and a.sequence_nbr =ae.application_seq
and ui."RECORD" = ae.equip_unicode
and a.inspection_type in ('AZJDJY','DQJY')
and pc.sequence_nbr = ui."PROJECT_CONTRAPTION_ID"
and a.project_contraption_id is null
</select>
</mapper>
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.HisDataHandlerServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController
@RequestMapping(value = "/hisDataHandler")
@Api(tags = "检验检测历史数据处理")
public class HisDataHandlerController {
private final HisDataHandlerServiceImpl hisDataHandlerService;
public HisDataHandlerController(HisDataHandlerServiceImpl hisDataHandlerService) {
this.hisDataHandlerService = hisDataHandlerService;
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "压力管道批量报检,报检单据历史数据处理")
@PutMapping(value = "/v1/pieLine/data")
public ResponseModel<Boolean> pieLineDataHandlerV1() {
hisDataHandlerService.pieLineDataHandlerV1();
return ResponseHelper.buildResponse(true);
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEquip;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationEquipMapper;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import javax.annotation.Resource;
import java.util.List;
@Service
@Slf4j
public class HisDataHandlerServiceImpl {
@Resource
private JyjcInspectionApplicationEquipMapper jyjcInspectionApplicationEquipMapper;
@Resource
private JyjcInspectionApplicationMapper jyjcInspectionApplicationMapper;
@Transactional(rollbackFor = Exception.class)
public void pieLineDataHandlerV1() {
List<JyjcInspectionApplicationEquip> applicationEquips = jyjcInspectionApplicationEquipMapper.queryWaitFlushData();
log.info("处理前:待压力管道数据条数: {}", applicationEquips.size());
applicationEquips.forEach(applicationEquip -> {
// 更新设备表装置id
LambdaUpdateWrapper<JyjcInspectionApplicationEquip> updateWrapperEquip = new LambdaUpdateWrapper<>();
updateWrapperEquip.eq(BaseEntity::getSequenceNbr, applicationEquip.getSequenceNbr());
updateWrapperEquip.set(JyjcInspectionApplicationEquip::getProjectContraptionId, applicationEquip.getProjectContraptionId());
jyjcInspectionApplicationEquipMapper.update(null, updateWrapperEquip);
// 更新报检申请表装置id
LambdaUpdateWrapper<JyjcInspectionApplication> updateWrapperApp = new LambdaUpdateWrapper<>();
updateWrapperApp.eq(BaseEntity::getSequenceNbr, applicationEquip.getApplicationSeq());
updateWrapperApp.set(JyjcInspectionApplication::getProjectContraptionId, applicationEquip.getProjectContraptionId());
jyjcInspectionApplicationMapper.update(null, updateWrapperApp);
});
List<JyjcInspectionApplicationEquip> applicationEquipAfter = jyjcInspectionApplicationEquipMapper.queryWaitFlushData();
log.info("处理前:待压力管道数据条数: {}", applicationEquipAfter.size());
}
}
......@@ -206,13 +206,14 @@
<otherwise>
and pc.use_unit_credit_code=#{companyCode}
and pc.is_into_management = true
and exists (select 1 from idx_biz_jg_use_info ibjui, idx_biz_jg_inspection_detection_info di where ibjui."RECORD" = di."RECORD" and ibjui.project_contraption_id=pc.sequence_nbr limit 1)
and exists (select 1 from idx_biz_jg_use_info ibjui, idx_biz_jg_inspection_detection_info di where ibjui."RECORD" = di."RECORD" and ibjui.project_contraption_id=pc.sequence_nbr and di."INSPECT_TYPE" <![CDATA[<>]]> '' )
</otherwise>
</choose>
</otherwise>
</choose>
and not EXISTS (SELECt 1 FROM tz_jyjc_inspection_application a where a.status='6611' and a.application_unit_code=#{companyCode} and a.project_contraption_id = pc.sequence_nbr)
and (pc.project_contraption_parent_id is null or pc.project_contraption_parent_id = '')
and pc.equ_category = #{equCategory}
</select>
<select id="selectEquipListByExport" resultType="java.util.Map">
......
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