Commit 8dbba929 authored by hcing's avatar hcing

设备认领-台套认领

parent f7d3a2a2
...@@ -65,7 +65,9 @@ public enum BusinessTypeEnum { ...@@ -65,7 +65,9 @@ public enum BusinessTypeEnum {
JG_NEW_EQUIP("122", "新增设备"), JG_NEW_EQUIP("122", "新增设备"),
JG_NEW_PROJECT("123", "新增装置"); JG_NEW_PROJECT("123", "新增装置"),
JG_EQUIP_CLAIM("124", "设备认领");
private final String code; private final String code;
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.EquipClaimServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
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;
import java.util.Map;
@Api(tags = "设备认领")
@RestController
@RequestMapping(value = "/equipClaim")
@RequiredArgsConstructor
public class EquipClaimController extends BaseController {
private final EquipClaimServiceImpl equipClaimService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/setEquip/page")
@ApiOperation(value = "待认领-台套设备分页", httpMethod = "GET")
public ResponseModel<Page<JSONObject>> setEquipPage(@RequestParam Map<String, Object> map) {
return ResponseHelper.buildResponse(equipClaimService.setEquipPage(new JSONObject(map)));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/setEquip/claim")
@ApiOperation(value = "认领-台套设备", httpMethod = "POST")
public ResponseModel<Object> setEquipClaim(@RequestBody Map<String, Object> map) {
return ResponseHelper.buildResponse(equipClaimService.setEquipClaim(new JSONObject(map)));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pipeEquip/page")
@ApiOperation(value = "待认领-管道装置设备分页", httpMethod = "GET")
public ResponseModel<IPage<IdxBizJgProjectContraption>> pipeEquipPage(@RequestParam Map<String, Object> map) {
return ResponseHelper.buildResponse(equipClaimService.pipeEquipPage(new JSONObject(map)));
}
}
...@@ -907,7 +907,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -907,7 +907,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
private void checkEquCodeUniqueness(LinkedHashMap equipmentInfoForm) { public void checkEquCodeUniqueness(LinkedHashMap equipmentInfoForm) {
// 根据设备代码检查唯一性 // 根据设备代码检查唯一性
String equCode = (String) equipmentInfoForm.get(EQU_CODE); String equCode = (String) equipmentInfoForm.get(EQU_CODE);
String sequenceNbr = (String) equipmentInfoForm.get(SEQUENCE_NBR); String sequenceNbr = (String) equipmentInfoForm.get(SEQUENCE_NBR);
...@@ -928,7 +928,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -928,7 +928,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
* @param record * @param record
* @param dataSource * @param dataSource
*/ */
private void checkCarNumberUniquenessWithHisCC(LinkedHashMap<?, ?> equipmentInfoForm, String record, String dataSource) { public void checkCarNumberUniquenessWithHisCC(LinkedHashMap<?, ?> equipmentInfoForm, String record, String dataSource) {
if (dataSource.contains("his") && EquipmentClassifityEnum.CC.getCode().equals(equipmentInfoForm.get(EQU_LIST)) && !ValidationUtil.isEmpty(equipmentInfoForm.get(CAR_NUMBER))) { if (dataSource.contains("his") && EquipmentClassifityEnum.CC.getCode().equals(equipmentInfoForm.get(EQU_LIST)) && !ValidationUtil.isEmpty(equipmentInfoForm.get(CAR_NUMBER))) {
String carNumber = String.valueOf(equipmentInfoForm.get(CAR_NUMBER)); String carNumber = String.valueOf(equipmentInfoForm.get(CAR_NUMBER));
if (!"无".equals(carNumber)) { if (!"无".equals(carNumber)) {
...@@ -940,7 +940,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -940,7 +940,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
private void check96333Code(LinkedHashMap equipmentInfoForm) { public void check96333Code(LinkedHashMap equipmentInfoForm) {
if (!ObjectUtils.isEmpty(equipmentInfoForm.get(CODE96333))) { if (!ObjectUtils.isEmpty(equipmentInfoForm.get(CODE96333))) {
// 根据96333码检查唯一性 // 根据96333码检查唯一性
LambdaQueryWrapper<IdxBizJgOtherInfo> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizJgOtherInfo> wrapper = new LambdaQueryWrapper<>();
...@@ -954,7 +954,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -954,7 +954,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
private void checkFactoryNumUniqueWithGasCylinder(LinkedHashMap equipmentInfoForm, String record) { public void checkFactoryNumUniqueWithGasCylinder(LinkedHashMap equipmentInfoForm, String record) {
if (equipmentInfoForm.get(EQU_LIST).equals("2000") if (equipmentInfoForm.get(EQU_LIST).equals("2000")
&& equipmentInfoForm.get(EQU_CATEGORY).equals("2300") && equipmentInfoForm.get(EQU_CATEGORY).equals("2300")
&& commonMapper.checkFactoryNumUnique(String.valueOf(equipmentInfoForm.get(FACTORY_NUM)), record, String.valueOf(equipmentInfoForm.get("PRODUCE_UNIT_CREDIT_CODE"))) > 0) { && commonMapper.checkFactoryNumUnique(String.valueOf(equipmentInfoForm.get(FACTORY_NUM)), record, String.valueOf(equipmentInfoForm.get("PRODUCE_UNIT_CREDIT_CODE"))) > 0) {
...@@ -962,7 +962,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -962,7 +962,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
private void checkFactoryNumUniqueness(LinkedHashMap equipmentInfoForm) { public void checkFactoryNumUniqueness(LinkedHashMap equipmentInfoForm) {
// 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一) // 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)
Integer factoryNum = commonMapper.checkFactoryNumUniquenessForVehicleCylinder((String) equipmentInfoForm.get(FACTORY_NUM), (String) equipmentInfoForm.get(RECORD)); Integer factoryNum = commonMapper.checkFactoryNumUniquenessForVehicleCylinder((String) equipmentInfoForm.get(FACTORY_NUM), (String) equipmentInfoForm.get(RECORD));
if (factoryNum > 0) { if (factoryNum > 0) {
...@@ -970,7 +970,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -970,7 +970,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
} }
private void hisEquCheckUseRegCodeAndVINUniqueness(LinkedHashMap<?, ?> equipmentInfoForm, String record) { public void hisEquCheckUseRegCodeAndVINUniqueness(LinkedHashMap<?, ?> equipmentInfoForm, String record) {
// 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一 // 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一
if ("2000".equals(equipmentInfoForm.get(EQU_LIST)) && "2300".equals(equipmentInfoForm.get(EQU_CATEGORY)) && "23T0".equals(equipmentInfoForm.get(EQU_DEFINE)) && "1".equals(equipmentInfoForm.get(WHETHER_VEHICLE_CYLINDER))) { if ("2000".equals(equipmentInfoForm.get(EQU_LIST)) && "2300".equals(equipmentInfoForm.get(EQU_CATEGORY)) && "23T0".equals(equipmentInfoForm.get(EQU_DEFINE)) && "1".equals(equipmentInfoForm.get(WHETHER_VEHICLE_CYLINDER))) {
String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE); String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE);
...@@ -3571,7 +3571,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3571,7 +3571,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
otherInfo.setCode96333(null); otherInfo.setCode96333(null);
} }
iIdxBizJgOtherInfoService.saveOrUpdateData(otherInfo); iIdxBizJgOtherInfoService.saveOrUpdateData(otherInfo);
// 保存或者更新设备技术参数
this.saveOrUpdateEquParams(equipmentInfoForm, equipmentParamsForm, equList, record, date, operateType);
return record;
}
/**
* 保存或者更新设备技术参数
* @param equipmentInfoForm
* @param equipmentParamsForm
* @param equList
* @param record
* @param date
* @param operateType
*/
public void saveOrUpdateEquParams(LinkedHashMap equipmentInfoForm, LinkedHashMap equipmentParamsForm, String equList, String record, Date date, String operateType) {
// 八大类技术参数和主要零部件和安全附件表 // 八大类技术参数和主要零部件和安全附件表
List<IdxBizJgMainParts> mainPartsList = new ArrayList<>(); List<IdxBizJgMainParts> mainPartsList = new ArrayList<>();
List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>(); List<IdxBizJgProtectionDevices> protectionDevicesList = new ArrayList<>();
...@@ -3715,7 +3729,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3715,7 +3729,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ValidationUtil.isEmpty(protectionDevicesList)) { if (!ValidationUtil.isEmpty(protectionDevicesList)) {
iIdxBizJgProtectionDevicesService.saveOrUpdateBatchData(protectionDevicesList); iIdxBizJgProtectionDevicesService.saveOrUpdateBatchData(protectionDevicesList);
} }
return record;
} }
/** /**
...@@ -3777,29 +3790,27 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3777,29 +3790,27 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (EQUIP_MAINPARTS_FORM_ID.equals(subFormType) && !ValidationUtil.isEmpty(list)) { if (EQUIP_MAINPARTS_FORM_ID.equals(subFormType) && !ValidationUtil.isEmpty(list)) {
for (Object s : list) { for (Object s : list) {
List subFormMainPartsList = (ArrayList) map.get(s); JSONArray subFormMainPartsList = JSON.parseArray(toJSONString(map.get(s)));
if (!ObjectUtils.isEmpty(subFormMainPartsList)) { subFormMainPartsList.forEach(data -> {
for (Object obj : subFormMainPartsList) { JSONObject jsonObject = (JSONObject) data;
HashMap<String, Object> objMap = (HashMap<String, Object>) obj; IdxBizJgMainParts mainParts = jsonObject.toJavaObject(IdxBizJgMainParts.class);
IdxBizJgMainParts mainParts = JSON.parseObject(JSON.toJSONString(objMap), IdxBizJgMainParts.class); mainParts.setRecord(record);
mainParts.setRecord(record); mainParts.setRecDate(date);
mainParts.setRecDate(date); mainParts.setSequenceNbr("save".equals(type) ? null : String.valueOf(jsonObject.get("MAINPARTS_SEQ")));
mainParts.setSequenceNbr("save".equals(type) ? null : String.valueOf(objMap.get("MAINPARTS_SEQ"))); mainPartsList.add(mainParts);
mainPartsList.add(mainParts); });
}
}
} }
return mainPartsList; return mainPartsList;
} else if (EQUIP_PROTECTIONDEVICES_FORM_ID.equals(subFormType) && !ValidationUtil.isEmpty(list)) { } else if (EQUIP_PROTECTIONDEVICES_FORM_ID.equals(subFormType) && !ValidationUtil.isEmpty(list)) {
for (Object s : list) { for (Object s : list) {
List subFormProtectionDevicesList = (ArrayList) map.get(s); JSONArray subFormProtectionDevicesList = JSON.parseArray(toJSONString(map.get(s)));
if (!ObjectUtils.isEmpty(subFormProtectionDevicesList)) { if (!ObjectUtils.isEmpty(subFormProtectionDevicesList)) {
for (Object obj : subFormProtectionDevicesList) { for (Object obj : subFormProtectionDevicesList) {
HashMap<String, Object> objMap = (HashMap<String, Object>) obj; JSONObject jsonObject = (JSONObject) obj;
IdxBizJgProtectionDevices protectionDevices = JSON.parseObject(JSON.toJSONString(objMap), IdxBizJgProtectionDevices.class); IdxBizJgProtectionDevices protectionDevices = jsonObject.toJavaObject(IdxBizJgProtectionDevices.class);
protectionDevices.setRecord(record); protectionDevices.setRecord(record);
protectionDevices.setRecDate(date); protectionDevices.setRecDate(date);
protectionDevices.setSequenceNbr("save".equals(type) ? null : String.valueOf(objMap.get("PROTECTIONDEVICES_SEQ"))); protectionDevices.setSequenceNbr("save".equals(type) ? null : String.valueOf(jsonObject.get("PROTECTIONDEVICES_SEQ")));
protectionDevicesList.add(protectionDevices); protectionDevicesList.add(protectionDevices);
} }
} }
......
...@@ -31,7 +31,6 @@ import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil; ...@@ -31,7 +31,6 @@ import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.enums.JYJCResultEnum; import com.yeejoin.amos.boot.module.common.api.enums.JYJCResultEnum;
import com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.*; import com.yeejoin.amos.boot.module.jg.api.enums.*;
...@@ -4483,7 +4482,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -4483,7 +4482,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
} }
private void historyEquGenManageRelated(JSONObject map, JgUseRegistration jgUseRegistration, IdxBizJgRegisterInfo registerInfo, IdxBizJgFactoryInfo idxBizJgFactoryInfo) { public void historyEquGenManageRelated(JSONObject map, JgUseRegistration jgUseRegistration, IdxBizJgRegisterInfo registerInfo, IdxBizJgFactoryInfo idxBizJgFactoryInfo) {
Optional.ofNullable(registerInfo).ifPresent(info -> { Optional.ofNullable(registerInfo).ifPresent(info -> {
// 生成证书管理表记录 // 生成证书管理表记录
generateRegistrationManage(jgUseRegistration, registerInfo, Boolean.FALSE, null); generateRegistrationManage(jgUseRegistration, registerInfo, Boolean.FALSE, null);
......
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