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

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

parent 1e2406d4
......@@ -44,8 +44,14 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
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);
@MapKey("records")
List<Map<String, Object>> queryForUnitPipelineEquipment(@Param("records")List<String> records);
@MapKey("id")
List<Map<String, Object>> selectEquipList(@Param("id")Long id);
}
......@@ -335,7 +335,7 @@
LEFT JOIN idx_biz_jg_other_info other on other.RECORD = jui.RECORD
WHERE tjure.equip_transfer_id = #{id}
</select>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
<sql id="page-list-pipeline">
SELECT
ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
......@@ -373,13 +373,26 @@
idx_biz_jg_use_info ui
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"
</sql>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-pipeline"/>
WHERE ri."EQU_CATEGORY" = '8300'
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
ORDER BY ui.REC_DATE DESC
</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
ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
......@@ -409,10 +422,23 @@
idx_biz_jg_use_info ui
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"
</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)
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
ORDER BY ui.REC_DATE DESC
</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>
......@@ -165,9 +165,8 @@ public class JgUseRegistrationController extends BaseController {
@GetMapping(value = "/export")
@ApiOperation(httpMethod = "GET", value = "导出使用登记证", notes = "导出使用登记证")
public void exportImageZip(HttpServletResponse response, @RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam(value = "printType", defaultValue = "0") String printType,
@RequestParam(value = "manageType", defaultValue = "") String manageType) {
jgUseRegistrationServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response, printType, manageType);
@RequestParam(value = "printType", defaultValue = "0") String printType) {
jgUseRegistrationServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response, printType);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -132,6 +132,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private JgUseRegistrationEqServiceImpl jgUseRegistrationEqService;
@Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
@Autowired
private JgUseRegistrationMapper jgUseRegistrationMapper;
/**
* @param auditPassDate 通过时间
......@@ -1166,6 +1168,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper<IdxBizJgRegisterInfo> wrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda().eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo idxBizJgRegisterInfo = idxBizJgRegisterInfoMapper.selectOne(wrapper);
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);
......@@ -1295,11 +1306,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
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<>();
exportParamsMap.put("manageType", manageType);
// 查询使用登记详情
JgUseRegistration useRegistration = this.getById(sequenceNbr);
exportParamsMap.put("manageType", useRegistration.getManageType());
LambdaQueryWrapper<JgUseRegistrationEq> useEqLambda = new QueryWrapper<JgUseRegistrationEq>().lambda();
useEqLambda.eq(JgUseRegistrationEq::getEquipTransferId, sequenceNbr);
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