Commit 228aed89 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents 0ee02718 1cae1748
...@@ -53,6 +53,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> { ...@@ -53,6 +53,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject, @Param("records") Set<String> records); Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject, @Param("records") Set<String> records);
Page<JSONObject> queryForUnitSkidMountedEquipment(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject, @Param("records") Set<String> records);
Page<JSONObject> queryForEquipUsedByVehiclePage(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject); Page<JSONObject> queryForEquipUsedByVehiclePage(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject);
@MapKey("records") @MapKey("records")
......
...@@ -548,6 +548,34 @@ ...@@ -548,6 +548,34 @@
ORDER BY ui.REC_DATE DESC ORDER BY ui.REC_DATE DESC
</select> </select>
<select id="queryForUnitSkidMountedEquipment" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-vessel"/>
WHERE
ri."EQU_CATEGORY" = '2100'
and ri."WHETHER_SKID_MOUNTED_PRESSURE_VESSEL" = '1'
and ui."DATA_SOURCE" = 'jg'
and NOT(ui."EQU_STATE" is not null )
and NOT(ri."USE_ORG_CODE" is not null )
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>
<choose>
<when test="jsonObject.record != null and jsonObject.record != ''">
and ui."RECORD" = #{jsonObject.record}
</when>
<otherwise>
<if test="records != null and records.size() > 0">
and ui."RECORD" not in
<foreach collection="records" item="record" separator="," open="(" close=")">
#{record}
</foreach>
</if>
</otherwise>
</choose>
ORDER BY ui.REC_DATE DESC
</select>
<select id="queryForEquipUsedByVehiclePage" resultType="com.alibaba.fastjson.JSONObject"> <select id="queryForEquipUsedByVehiclePage" resultType="com.alibaba.fastjson.JSONObject">
<include refid="page-list-vessel"/> <include refid="page-list-vessel"/>
WHERE WHERE
......
...@@ -250,8 +250,8 @@ public class CommonController extends BaseController { ...@@ -250,8 +250,8 @@ public class CommonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询监管业务名称列表", notes = "查询监管业务名称列表") @ApiOperation(httpMethod = "GET", value = "查询监管业务名称列表", notes = "查询监管业务名称列表")
@GetMapping(value = "/superviseBusinessCategory") @GetMapping(value = "/superviseBusinessCategory")
public ResponseModel<Object> equipTree(String type) { public ResponseModel<Object> equipTree(@RequestParam(value = "businessType") String businessType) {
return ResponseHelper.buildResponse(commonService.superviseBusinessCategory(type)); return ResponseHelper.buildResponse(commonService.superviseBusinessCategory(businessType));
} }
/** /**
...@@ -413,10 +413,16 @@ public class CommonController extends BaseController { ...@@ -413,10 +413,16 @@ public class CommonController extends BaseController {
@GetMapping(value = "/equ-category/{categoryCode}/list") @GetMapping(value = "/equ-category/{categoryCode}/list")
@ApiOperation(httpMethod = "GET", value = "按照业务类型、设备种类查询设备类别", notes = "按照业务类型、设备种类查询设备类别") @ApiOperation(httpMethod = "GET", value = "按照业务类型、设备种类查询设备类别", notes = "按照业务类型、设备种类查询设备类别")
public ResponseModel<List<DictionarieValueModel>> equCategoryList(@RequestParam(value = "type") String bizType, public ResponseModel<List<DictionarieValueModel>> equCategoryList(@RequestParam(value = "type") String bizType,
@RequestParam(value = "businessScenarios") String businessScenarios,
@PathVariable String categoryCode) { @PathVariable String categoryCode) {
// 在平台字典配置的自定义业务的设备种类:格式{bizType}_{categoryCode},如BF_YZ_1000==》移装注销-锅炉 // 在平台字典配置的自定义业务的设备种类:格式{bizType}_{categoryCode},如BF_YZ_1000==》移装注销-锅炉
String dictCode = String.format("%s_%s", bizType, categoryCode); String dictCode = String.format("%s_%s", bizType, categoryCode);
return ResponseHelper.buildResponse(Systemctl.dictionarieClient.dictValues(dictCode).getResult()); List<DictionarieValueModel> result = Systemctl.dictionarieClient.dictValues(dictCode).getResult();
//使用登记bizType(DJ_SY) + 压力容器categoryCode(2000) + 按照场景选择businessScenarios(1) => 只展示固定式压力容器(2100)
boolean isFlag = "DJ_SY".equals(bizType) && "2000".equals(categoryCode) && "1".equals(businessScenarios);
List<DictionarieValueModel> collect = result.stream()
.filter(x -> !isFlag || x.getDictDataKey().equals("2100")).collect(Collectors.toList());
return ResponseHelper.buildResponse(collect);
} }
......
...@@ -49,7 +49,7 @@ public interface ICommonService { ...@@ -49,7 +49,7 @@ public interface ICommonService {
List<LinkedHashMap> creatApproveTree(); List<LinkedHashMap> creatApproveTree();
List<Map<String, Object>> superviseBusinessCategory(String type); List<Map<String, Object>> superviseBusinessCategory(String businessType);
List<Map<String, Object>> businessScenarios(String type); List<Map<String, Object>> businessScenarios(String type);
......
...@@ -611,20 +611,20 @@ public class CommonServiceImpl implements ICommonService { ...@@ -611,20 +611,20 @@ public class CommonServiceImpl implements ICommonService {
} }
@Override @Override
public List<Map<String, Object>> superviseBusinessCategory(String type) { public List<Map<String, Object>> superviseBusinessCategory(String businessType) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(superviseBusinessCategory); Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(superviseBusinessCategory);
if (XZSB.equals(type) && CompanyTypeEnum.CONSTRUCTION.getName().equals(reginParams.getCompany().getCompanyType())){ if (XZSB.equals(businessType) && CompanyTypeEnum.CONSTRUCTION.getName().equals(reginParams.getCompany().getCompanyType())){
Iterator<Map<String, Object>> iterator = resourceJson.get(type).iterator(); Iterator<Map<String, Object>> iterator = resourceJson.get(businessType).iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Map<String, Object> item = iterator.next(); Map<String, Object> item = iterator.next();
if (item.get(CODE).equals(PL_DR)) { if (item.get(CODE).equals(PL_DR)) {
iterator.remove(); iterator.remove();
} }
} }
return resourceJson.get(type); return resourceJson.get(businessType);
} }
return resourceJson.get(type); return resourceJson.get(businessType);
} }
@Override @Override
......
...@@ -1674,9 +1674,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1674,9 +1674,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
registerInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("REGISTERINFO_SEQ"))); registerInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("REGISTERINFO_SEQ")));
// 补丁:saveOrUpdate在update数据时不会更新字段为null的字段,但是编辑设备的代码时,从有改成无,equCode解析成null,但是此时需要将equcode删掉 // 补丁:saveOrUpdate在update数据时不会更新字段为null的字段,但是编辑设备的代码时,从有改成无,equCode解析成null,但是此时需要将equcode删掉
registerInfo.setEquCode(ObjectUtils.isEmpty(registerInfo.getEquCode()) ? "" : registerInfo.getEquCode()); registerInfo.setEquCode(ObjectUtils.isEmpty(registerInfo.getEquCode()) ? "" : registerInfo.getEquCode());
// 判断是否是撬装式压力容器,条件:使用单位提交的+业务类型为场景选择(1)+ 设备种类为压力容器(2000) +设备类别为固定式压力容器(2100)
boolean whetherSkidMountedPressureVesselFlag = "1".equals(businessScenarios) && EquipmentClassifityEnum.YLRQ.getCode().equals(equList) && "2100".equals(equCategory);
registerInfo.setWhetherSkidMountedPressureVessel(whetherSkidMountedPressureVesselFlag ? "1" : "0");
// copy设备 =》 使用登记证号置空 // copy设备 =》 使用登记证号置空
registerInfo.setUseOrgCode(isCopy ? null : registerInfo.getUseOrgCode()); registerInfo.setUseOrgCode(isCopy ? null : registerInfo.getUseOrgCode());
this.saveOrUpdate(registerInfo); this.saveOrUpdate(registerInfo);
...@@ -1928,6 +1925,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1928,6 +1925,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium"))); i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium")));
}); });
return result; return result;
} else if ("2100".equals(jsonObject.get("EQU_CATEGORY_CODE"))) {
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
Page<JSONObject> result = jgUseRegistrationMapper.queryForUnitSkidMountedEquipment(page, jsonObject, records);
result.getRecords().forEach(x -> x.put("chargingMedium", fillingMediumMap.get(x.get("chargingMedium"))));
return result;
} }
return page; return page;
} }
......
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