Commit 1aa9179c authored by 刘林's avatar 刘林

fix(JG):使用登记按单位办理代码提交

parent 1e2406d4
...@@ -44,8 +44,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> { ...@@ -44,8 +44,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject); Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject);
@MapKey("records")
List<Map<String, Object>> queryForUnitVesselEquipment(@Param("records")List<String> records);
Page<JSONObject> queryForUnitPipelineEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject); Page<JSONObject> queryForUnitPipelineEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject);
@MapKey("records")
List<Map<String, Object>> queryForUnitPipelineEquipment(@Param("records")List<String> records);
@MapKey("id") @MapKey("id")
List<Map<String, Object>> selectEquipList(@Param("id")Long id); List<Map<String, Object>> selectEquipList(@Param("id")Long id);
} }
...@@ -335,84 +335,110 @@ ...@@ -335,84 +335,110 @@
LEFT JOIN idx_biz_jg_other_info other on other.RECORD = jui.RECORD LEFT JOIN idx_biz_jg_other_info other on other.RECORD = jui.RECORD
WHERE tjure.equip_transfer_id = #{id} WHERE tjure.equip_transfer_id = #{id}
</select> </select>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject"> <sql id="page-list-pipeline">
SELECT SELECT
ui."USE_UNIT_NAME" useUnitName, ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode, ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
to_char(ui."USE_DATE", 'YYYY-MM') useDate, to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName, (SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName,
(SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE limit 1) uscUnitName, (SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE limit 1) uscUnitName,
to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE limit 1), 'YYYY-MM') uscDate, to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE limit 1), 'YYYY-MM') uscDate,
ui."RECORD" record, ui."RECORD" record,
ri."EQU_CODE" equCode, ri."EQU_CODE" equCode,
ri."EQU_LIST" equList, ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName, (select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory, ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName, (select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine, ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName, (select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
ri."PRODUCT_NAME" productName, ri."PRODUCT_NAME" productName,
ri."BRAND_NAME" brandName, ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType, ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType, ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder, ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pp."DEVICE_NAME" deviceName, pp."DEVICE_NAME" deviceName,
pp."DEVICE_LEVEL" deviceLevel, pp."DEVICE_LEVEL" deviceLevel,
pp."PIPE_NAME" pipeName, pp."PIPE_NAME" pipeName,
pp."PIPELINE_NUMBER" pipelineNumber, pp."PIPELINE_NUMBER" pipelineNumber,
pp."NOMINAL_DIAMETER" nominalDiameter, pp."NOMINAL_DIAMETER" nominalDiameter,
pp."WALL_THICKNESS" wallThickness, pp."WALL_THICKNESS" wallThickness,
pp."PIPE_LENGTH" pipeLength, pp."PIPE_LENGTH" pipeLength,
pp."PRESSURE" pressure, pp."PRESSURE" pressure,
pp."TEMPERATURE" temperature, pp."TEMPERATURE" temperature,
pp."MEDIUM" medium, pp."MEDIUM" medium,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1) inspectOrgName, (select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1) inspectConclusion, (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') nextInspectDate to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') nextInspectDate
FROM FROM
idx_biz_jg_use_info ui idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD" LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD" LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
</sql>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-pipeline"/>
WHERE ri."EQU_CATEGORY" = '8300' WHERE ri."EQU_CATEGORY" = '8300'
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" > <if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode} and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if> </if>
ORDER BY ui.REC_DATE DESC ORDER BY ui.REC_DATE DESC
</select> </select>
<select id="queryForUnitVesselEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
<select id="queryForUnitPipelineEquipment" resultType="java.util.Map">
<include refid="page-list-pipeline"/>
WHERE ri."EQU_CATEGORY" = '8300'
and ui.record in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
</foreach>
ORDER BY ui.REC_DATE DESC
</select>
<sql id="page-list-vessel">
SELECT SELECT
ui."USE_UNIT_NAME" useUnitName, ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode, ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
to_char(ui."USE_DATE", 'YYYY-MM') useDate, to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT "PRODUCE_UNIT_NAME" from idx_biz_jg_factory_info where "RECORD" = ui."RECORD") produceUnitName, (SELECT "PRODUCE_UNIT_NAME" from idx_biz_jg_factory_info where "RECORD" = ui."RECORD") produceUnitName,
to_char((SELECT "PRODUCE_DATE" from idx_biz_jg_factory_info where "RECORD" = ui."RECORD"), 'YYYY-MM') produceDate, to_char((SELECT "PRODUCE_DATE" from idx_biz_jg_factory_info where "RECORD" = ui."RECORD"), 'YYYY-MM') produceDate,
ui."RECORD" record, ui."RECORD" record,
ui."USE_INNER_CODE" useInnerCode, ui."USE_INNER_CODE" useInnerCode,
ri."EQU_CODE" equCode, ri."EQU_CODE" equCode,
ri."EQU_LIST" equList, ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName, (select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory, ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName, (select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine, ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName, (select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
ri."PRODUCT_NAME" productName, ri."PRODUCT_NAME" productName,
ri."BRAND_NAME" brandName, ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType, ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType, ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder, ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pv."CHARGING_MEDIUM" chargingMedium, pv."CHARGING_MEDIUM" chargingMedium,
pv."NOMINAL_WORKING_PRESSURE" nominalWorkingPressure, pv."NOMINAL_WORKING_PRESSURE" nominalWorkingPressure,
pv."SINGLE_BOTTLE_VOLUME" singleBottleVolume, pv."SINGLE_BOTTLE_VOLUME" singleBottleVolume,
to_char((select INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') inspectDate, to_char((select INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') inspectDate,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') nextInspectDate to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') nextInspectDate
FROM FROM
idx_biz_jg_use_info ui idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD" LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
LEFT JOIN idx_biz_jg_tech_params_vessel pv ON pv."RECORD" = ui."RECORD" LEFT JOIN idx_biz_jg_tech_params_vessel pv ON pv."RECORD" = ui."RECORD"
</sql>
<select id="queryForUnitVesselEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-vessel"/>
WHERE ri."EQU_CATEGORY" = '2300' and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1) WHERE ri."EQU_CATEGORY" = '2300' and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" > <if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode} and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if> </if>
ORDER BY ui.REC_DATE DESC ORDER BY ui.REC_DATE DESC
</select> </select>
<select id="queryForUnitVesselEquipment" resultType="java.util.Map">
<include refid="page-list-vessel"/>
WHERE ri."EQU_CATEGORY" = '2300' and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
and ui.record in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
</foreach>
ORDER BY ui.REC_DATE DESC
</select>
</mapper> </mapper>
...@@ -165,9 +165,8 @@ public class JgUseRegistrationController extends BaseController { ...@@ -165,9 +165,8 @@ public class JgUseRegistrationController extends BaseController {
@GetMapping(value = "/export") @GetMapping(value = "/export")
@ApiOperation(httpMethod = "GET", value = "导出使用登记证", notes = "导出使用登记证") @ApiOperation(httpMethod = "GET", value = "导出使用登记证", notes = "导出使用登记证")
public void exportImageZip(HttpServletResponse response, @RequestParam("sequenceNbr") String sequenceNbr, public void exportImageZip(HttpServletResponse response, @RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam(value = "printType", defaultValue = "0") String printType, @RequestParam(value = "printType", defaultValue = "0") String printType) {
@RequestParam(value = "manageType", defaultValue = "") String manageType) { jgUseRegistrationServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response, printType);
jgUseRegistrationServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response, printType, manageType);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -132,6 +132,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -132,6 +132,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private JgUseRegistrationEqServiceImpl jgUseRegistrationEqService; private JgUseRegistrationEqServiceImpl jgUseRegistrationEqService;
@Autowired @Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService; private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
@Autowired
private JgUseRegistrationMapper jgUseRegistrationMapper;
/** /**
* @param auditPassDate 通过时间 * @param auditPassDate 通过时间
...@@ -1166,6 +1168,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1166,6 +1168,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper<IdxBizJgRegisterInfo> wrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda().eq(IdxBizJgRegisterInfo::getRecord, record); LambdaQueryWrapper<IdxBizJgRegisterInfo> wrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda().eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo idxBizJgRegisterInfo = idxBizJgRegisterInfoMapper.selectOne(wrapper); IdxBizJgRegisterInfo idxBizJgRegisterInfo = idxBizJgRegisterInfoMapper.selectOne(wrapper);
jsonObject.put("carNumber", idxBizJgRegisterInfo.getCarNumber()); jsonObject.put("carNumber", idxBizJgRegisterInfo.getCarNumber());
} else {
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) jsonObject.get("equipmentLists");
List<String> records = equipmentLists.stream().map(v -> (String) v.get("record")).collect(Collectors.toList());
jsonObject.remove("equipmentLists");
if ("2300".equals(jsonObject.get("EQU_CATEGORY_CODE"))){
jsonObject.put("equipmentLists",jgUseRegistrationMapper.queryForUnitVesselEquipment(records));
}else {
jsonObject.put("equipmentLists",jgUseRegistrationMapper.queryForUnitPipelineEquipment(records));
}
} }
// 转化 附件 字段 // 转化 附件 字段
commonServiceImpl.convertStringToJsonobject(jsonObject, jsonFields); commonServiceImpl.convertStringToJsonobject(jsonObject, jsonFields);
...@@ -1295,11 +1306,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1295,11 +1306,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return null; return null;
} }
public void exportUseRegistrationCertificate(String sequenceNbr, HttpServletResponse response, String printType, String manageType) { public void exportUseRegistrationCertificate(String sequenceNbr, HttpServletResponse response, String printType) {
Map<String, Object> exportParamsMap = new HashMap<>(); Map<String, Object> exportParamsMap = new HashMap<>();
exportParamsMap.put("manageType", manageType);
// 查询使用登记详情 // 查询使用登记详情
JgUseRegistration useRegistration = this.getById(sequenceNbr); JgUseRegistration useRegistration = this.getById(sequenceNbr);
exportParamsMap.put("manageType", useRegistration.getManageType());
LambdaQueryWrapper<JgUseRegistrationEq> useEqLambda = new QueryWrapper<JgUseRegistrationEq>().lambda(); LambdaQueryWrapper<JgUseRegistrationEq> useEqLambda = new QueryWrapper<JgUseRegistrationEq>().lambda();
useEqLambda.eq(JgUseRegistrationEq::getEquipTransferId, sequenceNbr); useEqLambda.eq(JgUseRegistrationEq::getEquipTransferId, sequenceNbr);
JgUseRegistrationEq useRegistrationEq = jgRelationEquipMapper.selectOne(useEqLambda); JgUseRegistrationEq useRegistrationEq = jgRelationEquipMapper.selectOne(useEqLambda);
......
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