Commit 79b0fb7c authored by suhuiguang's avatar suhuiguang

1.压力管道按照装置报检,单据历史数据刷库

parent 8a33ee4e
...@@ -27,4 +27,6 @@ public interface JyjcInspectionApplicationEquipMapper extends BaseMapper<JyjcIns ...@@ -27,4 +27,6 @@ public interface JyjcInspectionApplicationEquipMapper extends BaseMapper<JyjcIns
List<InspectTimeCountDto> countInspectTimeCountByTypeAndEquList(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<InspectTimeCountDto> countInspectTimeCountByTypeAndEquList(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
Integer inspectTimeCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto); Integer inspectTimeCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto);
List<JyjcInspectionApplicationEquip> queryWaitFlushData();
} }
...@@ -75,4 +75,24 @@ ...@@ -75,4 +75,24 @@
GROUP BY GROUP BY
C.equ_category C.equ_category
</select> </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> </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 @@ ...@@ -206,13 +206,14 @@
<otherwise> <otherwise>
and pc.use_unit_credit_code=#{companyCode} and pc.use_unit_credit_code=#{companyCode}
and pc.is_into_management = true 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> </otherwise>
</choose> </choose>
</otherwise> </otherwise>
</choose> </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 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.project_contraption_parent_id is null or pc.project_contraption_parent_id = '')
and pc.equ_category = #{equCategory}
</select> </select>
<select id="selectEquipListByExport" resultType="java.util.Map"> <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