Commit c6744180 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.100.92.250:5000/moa/amos-boot-biz into develop_tzs_register
parents 77e92940 8dbba929
...@@ -11,6 +11,7 @@ import com.yeejoin.amos.api.common.restful.utils.ResponseHelper; ...@@ -11,6 +11,7 @@ import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.openapi.dto.XiAnElevatorExcelDto; import com.yeejoin.amos.api.openapi.dto.XiAnElevatorExcelDto;
import com.yeejoin.amos.api.openapi.dto.XiAnEquipInfoExcelDto; import com.yeejoin.amos.api.openapi.dto.XiAnEquipInfoExcelDto;
import com.yeejoin.amos.api.openapi.feign.TzsJgServiceFeignClient; import com.yeejoin.amos.api.openapi.feign.TzsJgServiceFeignClient;
import com.yeejoin.amos.boot.biz.common.utils.RequestContextWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -84,18 +85,13 @@ public class XiAnDataDockServiceImpl { ...@@ -84,18 +85,13 @@ public class XiAnDataDockServiceImpl {
int batchSize = 1000; int batchSize = 1000;
int totalSize = equipInfoExcelDtos.size(); int totalSize = equipInfoExcelDtos.size();
// 主线程中获取登录信息传递到异步线程中 // 主线程中获取登录信息传递到异步线程中
String appKey = RequestContext.getAppKey(); RequestContextWrapper contextWrapper = RequestContextWrapper.capture();
String product = RequestContext.getProduct();
String token = RequestContext.getToken();
List<CompletableFuture<Void>> futures = new ArrayList<>(); List<CompletableFuture<Void>> futures = new ArrayList<>();
for (int i = 0; i < totalSize; i += batchSize) { for (int i = 0; i < totalSize; i += batchSize) {
List<XiAnEquipInfoExcelDto> batch = equipInfoExcelDtos.subList(i, Math.min(totalSize, i + batchSize)); List<XiAnEquipInfoExcelDto> batch = equipInfoExcelDtos.subList(i, Math.min(totalSize, i + batchSize));
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> { CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
try { try {
RequestContext.setAppKey(appKey); contextWrapper.apply();
RequestContext.setProduct(product);
RequestContext.setToken(token);
jgServiceFeignClient.saveEquipmentData(batch); jgServiceFeignClient.saveEquipmentData(batch);
} catch (Exception e) { } catch (Exception e) {
log.error("西安数据上传,保存设备数据失败: ", e); log.error("西安数据上传,保存设备数据失败: ", e);
......
...@@ -23,6 +23,9 @@ public class JgNoticeToBeSubmitDto extends BaseDto { ...@@ -23,6 +23,9 @@ public class JgNoticeToBeSubmitDto extends BaseDto {
@ApiModelProperty(value = "业务类型") @ApiModelProperty(value = "业务类型")
private String businessType; private String businessType;
@ApiModelProperty(value = "业务类型Code")
private String type;
@ApiModelProperty(value = "申请单号") @ApiModelProperty(value = "申请单号")
private String applyNo; private String applyNo;
......
...@@ -510,4 +510,10 @@ public class JgInstallationNotice extends BaseEntity { ...@@ -510,4 +510,10 @@ public class JgInstallationNotice extends BaseEntity {
*/ */
@TableField("certificate_print_tag") @TableField("certificate_print_tag")
private String certificatePrintTag; private String certificatePrintTag;
/**
* 是否暂存状态(0-否,1-是)
*/
@TableField("is_temporary_status")
private String isTemporaryStatus;
} }
...@@ -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;
......
...@@ -390,6 +390,7 @@ ...@@ -390,6 +390,7 @@
SELECT SELECT
isn.sequence_nbr AS sequenceNbr, isn.sequence_nbr AS sequenceNbr,
'安装告知' AS businessType, '安装告知' AS businessType,
'GZ_AZ' AS type,
isn.apply_no AS applyNo, isn.apply_no AS applyNo,
ec1.name AS equListName, ec1.name AS equListName,
ec2.name AS equCategoryName, ec2.name AS equCategoryName,
...@@ -405,6 +406,7 @@ ...@@ -405,6 +406,7 @@
SELECT SELECT
isn.sequence_nbr AS sequenceNbr, isn.sequence_nbr AS sequenceNbr,
'改造告知' AS businessType, '改造告知' AS businessType,
'GZ_GZ' AS type,
isn.apply_no AS applyNo, isn.apply_no AS applyNo,
isn.equ_list_name AS equListName, isn.equ_list_name AS equListName,
isn.equ_category_name AS equCategoryName, isn.equ_category_name AS equCategoryName,
...@@ -418,6 +420,7 @@ ...@@ -418,6 +420,7 @@
SELECT SELECT
isn.sequence_nbr AS sequenceNbr, isn.sequence_nbr AS sequenceNbr,
'维修告知' AS businessType, '维修告知' AS businessType,
'GZ_WX' AS type,
isn.apply_no AS applyNo, isn.apply_no AS applyNo,
ec1.name AS equListName, ec1.name AS equListName,
ec2.name AS equCategoryName, ec2.name AS equCategoryName,
...@@ -433,6 +436,7 @@ ...@@ -433,6 +436,7 @@
SELECT SELECT
isn.sequence_nbr AS sequenceNbr, isn.sequence_nbr AS sequenceNbr,
'移装告知' AS businessType, '移装告知' AS businessType,
'GZ_YZ' AS type,
isn.apply_no AS applyNo, isn.apply_no AS applyNo,
ec1.name AS equListName, ec1.name AS equListName,
ec2.name AS equCategoryName, ec2.name AS equCategoryName,
...@@ -441,7 +445,7 @@ ...@@ -441,7 +445,7 @@
DATE_FORMAT(isn.create_date, '%Y-%m-%d') AS createDate DATE_FORMAT(isn.create_date, '%Y-%m-%d') AS createDate
FROM tzs_jg_transfer_notice isn FROM tzs_jg_transfer_notice isn
LEFT JOIN tz_equipment_category ec1 ON ec1.code = isn.equ_list_code LEFT JOIN tz_equipment_category ec1 ON ec1.code = isn.equ_list_code
LEFT JOIN tz_equipment_category ec2 ON ec2.code = isn.equ_category LEFT JOIN tz_equipment_category ec2 ON ec2.code = isn.equ_category_code
WHERE isn.is_delete = false WHERE isn.is_delete = false
AND isn.notice_status = '6610' AND isn.notice_status = '6610'
AND isn.install_unit_credit_code = #{companyCode} AND isn.install_unit_credit_code = #{companyCode}
......
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)));
}
}
...@@ -18,10 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; ...@@ -18,10 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.*;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.dao.ExcelImportErrorLogDao; import com.yeejoin.amos.boot.module.common.api.dao.ExcelImportErrorLogDao;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
...@@ -172,15 +169,11 @@ public class DataDockServiceImpl { ...@@ -172,15 +169,11 @@ public class DataDockServiceImpl {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class) @GlobalTransactional(rollbackFor = Exception.class)
public boolean xiAnSaveEquipmentData(List<Map<String, Object>> equLists) { public boolean xiAnSaveEquipmentData(List<Map<String, Object>> equLists) {
String appKey = RequestContext.getAppKey(); RequestContextWrapper contextWrapper = RequestContextWrapper.capture();
String product = RequestContext.getProduct();
String token = RequestContext.getToken();
Set<String> recordSet = new HashSet<>(); Set<String> recordSet = new HashSet<>();
CompletableFuture.allOf( CompletableFuture.allOf(
equLists.parallelStream().map(equ -> CompletableFuture.runAsync(() -> { equLists.parallelStream().map(equ -> CompletableFuture.runAsync(() -> {
RequestContext.setAppKey(appKey); contextWrapper.apply();
RequestContext.setProduct(product);
RequestContext.setToken(token);
String record = saveEquipmentDataInTransaction(equ, "jg_his_xa", null); String record = saveEquipmentDataInTransaction(equ, "jg_his_xa", null);
recordSet.add(record); recordSet.add(record);
})).toArray(CompletableFuture[]::new) })).toArray(CompletableFuture[]::new)
......
...@@ -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);
} }
} }
......
...@@ -107,6 +107,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -107,6 +107,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Autowired @Autowired
UseInfoMapper useInfoMapper; UseInfoMapper useInfoMapper;
@Autowired @Autowired
IdxBizJgRegisterInfoMapper registerInfoMapper;
@Autowired
TzsServiceFeignClient tzsServiceFeignClient; TzsServiceFeignClient tzsServiceFeignClient;
@Autowired @Autowired
...@@ -1203,27 +1205,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -1203,27 +1205,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List<JgChangeRegistrationUnitEq> jgChangeRegistrationUnitEqs = JgChangeRegistrationUnitEqMapper.selectList(queryWrapper); List<JgChangeRegistrationUnitEq> jgChangeRegistrationUnitEqs = JgChangeRegistrationUnitEqMapper.selectList(queryWrapper);
//修改ES中使用单位信息和使用单位代码 //修改ES中使用单位信息和使用单位代码
Map<String, Map<String, Object>> resultMap = new HashMap<>(); Map<String, Map<String, Object>> resultMap = new HashMap<>();
for (JgChangeRegistrationUnitEq jgChangeRegistrationUnitEq : jgChangeRegistrationUnitEqs) {
String equipId = jgChangeRegistrationUnitEq.getEquId();
LambdaQueryWrapper<UseInfo> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(UseInfo::getRecord, equipId);
UseInfo useInfo = useInfoMapper.selectOne(queryWrapper2);
if (ObjectUtils.isNotEmpty(useInfo)) {
useInfo.setUseUnitName(registration.getNewUseUnitName());
useInfo.setUseUnitCreditCode(registration.getNewUseUnitCreditCode());
useInfoMapper.updateById(useInfo);
}
Map<String, Object> map1 = new HashMap<>();
String[] companyCode = registration.getNewUseUnitCreditCode().split("_");
map1.put("USE_UNIT_CREDIT_CODE", companyCode.length > 1 ? companyCode[1] : registration.getNewUseUnitCreditCode());
map1.put("USE_UNIT_NAME", registration.getNewUseUnitName());
map1.put("REC_DATE", new Date());// 更新时间,设备筛选时排在前面 bug-21476
map1.put("EQU_STATE", "1");
resultMap.put(equipId, map1);
//修改各类告知列表,置为废弃
this.updataInvalidStatusByHistory(equipId, registration.getApplyNo());
tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap);
}
//更新产权信息 //更新产权信息
dto.getRegistrationList().forEach(v -> { dto.getRegistrationList().forEach(v -> {
String useCode = String.valueOf(v.get("useRegistrationCode")); String useCode = String.valueOf(v.get("useRegistrationCode"));
...@@ -1256,6 +1238,34 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -1256,6 +1238,34 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
} }
}); });
for (JgChangeRegistrationUnitEq jgChangeRegistrationUnitEq : jgChangeRegistrationUnitEqs) {
String equipId = jgChangeRegistrationUnitEq.getEquId();
LambdaQueryWrapper<UseInfo> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(UseInfo::getRecord, equipId);
UseInfo useInfo = useInfoMapper.selectOne(queryWrapper2);
if (ObjectUtils.isNotEmpty(useInfo)) {
useInfo.setUseUnitName(registration.getNewUseUnitName());
useInfo.setUseUnitCreditCode(registration.getNewUseUnitCreditCode());
useInfoMapper.updateById(useInfo);
}
LambdaQueryWrapper<IdxBizJgRegisterInfo> registerInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
registerInfoLambdaQueryWrapper.eq(IdxBizJgRegisterInfo::getRecord, equipId);
IdxBizJgRegisterInfo registerInfo = registerInfoMapper.selectOne(registerInfoLambdaQueryWrapper);
Map<String, Object> map1 = new HashMap<>();
String[] companyCode = registration.getNewUseUnitCreditCode().split("_");
map1.put("USE_UNIT_CREDIT_CODE", companyCode.length > 1 ? companyCode[1] : registration.getNewUseUnitCreditCode());
map1.put("USE_UNIT_NAME", registration.getNewUseUnitName());
map1.put("REC_DATE", new Date());// 更新时间,设备筛选时排在前面 bug-21476
map1.put("EQU_STATE", "1");
if (ObjectUtils.isNotEmpty(registerInfo) && ObjectUtils.isNotEmpty(registerInfo.getCarNumber())) {
map1.put("CAR_NUMBER", registerInfo.getCarNumber());
}
resultMap.put(equipId, map1);
//修改各类告知列表,置为废弃
this.updataInvalidStatusByHistory(equipId, registration.getApplyNo());
tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap);
}
registration.setNextTaskId(nextTaskId); registration.setNextTaskId(nextTaskId);
updateTaskModel(registration, op); updateTaskModel(registration, op);
//新增使用登记证和设备变更记录 //新增使用登记证和设备变更记录
......
...@@ -120,6 +120,7 @@ import static com.alibaba.fastjson.JSON.parseArray; ...@@ -120,6 +120,7 @@ import static com.alibaba.fastjson.JSON.parseArray;
public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationNoticeDto, JgInstallationNotice, JgInstallationNoticeMapper> implements IJgInstallationNoticeService, ICompensateFlowDataOfRedis<JgInstallationNotice> { public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationNoticeDto, JgInstallationNotice, JgInstallationNoticeMapper> implements IJgInstallationNoticeService, ICompensateFlowDataOfRedis<JgInstallationNotice> {
private static final String SUBMIT_TYPE_FLOW = "1"; private static final String SUBMIT_TYPE_FLOW = "1";
private static final String SUBMIT_TYPE_TEMP = "3";
private static final String PROCESS_DEFINITION_KEY = "installationNotificationNew"; private static final String PROCESS_DEFINITION_KEY = "installationNotificationNew";
private static final String PROCESS_INSTALL_NOTICE_KEY = "installNotice"; private static final String PROCESS_INSTALL_NOTICE_KEY = "installNotice";
...@@ -878,7 +879,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -878,7 +879,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 获取告知设备列表 // 获取告知设备列表
List<Map<String, Object>> deviceList = model.getDeviceList(); List<Map<String, Object>> deviceList = model.getDeviceList();
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请) todo 回滚异常未写 // 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请) todo 回滚异常未写
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {//提交
if (CollectionUtils.isEmpty(deviceList)) { if (CollectionUtils.isEmpty(deviceList)) {
throw new BadRequest("设备列表为空"); throw new BadRequest("设备列表为空");
} }
......
...@@ -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.*;
...@@ -1927,6 +1926,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1927,6 +1926,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("EQU_CODE", dataMap.get("equCode")); param.put("EQU_CODE", dataMap.get("equCode"));
param.put("USE_ORG_CODE", jgUseRegistration.getUseRegistrationCode()); param.put("USE_ORG_CODE", jgUseRegistration.getUseRegistrationCode());
param.put("CYLINDER_CATEGORY", dataMap.get("cylinderCategory")); param.put("CYLINDER_CATEGORY", dataMap.get("cylinderCategory"));
if((!ObjectUtils.isEmpty(carNumber))) {
param.put("CAR_NUMBER", dataMap.get("carNumber"));
}
objMap.put((String) dataMap.get("equipId"), param); objMap.put((String) dataMap.get("equipId"), param);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap); tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
} }
...@@ -4480,7 +4482,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -4480,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);
......
...@@ -17,9 +17,9 @@ public enum DataQualityScoreEnum { ...@@ -17,9 +17,9 @@ public enum DataQualityScoreEnum {
* *设备等级 * *设备等级
*/ */
I("一级(使用登记证信息齐全)","一级", "1"), I("一类(使用登记证信息齐全)","一类", "1"),
II("二级(只有设备名称和使用登记证编号)","二级", "2"), II("二类(只有设备名称和使用登记证编号)","二类", "2"),
III("三级(只有设备名称)","三级", "3"); III("三类(只有设备名称)","三类", "3");
private String name; private String name;
private String label; private String label;
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -16,11 +17,11 @@ public enum EquipStateEnum { ...@@ -16,11 +17,11 @@ public enum EquipStateEnum {
* *设备状态 * *设备状态
*/ */
WDJ("未登记", "0"), // WDJ("未登记", "0"),
ZY("在用", "1"), ZY("在用", "1"),
TY("停用", "2"), TY("停用", "2"),
BF("报废", "3"),
ZX("注销", "4"), ZX("注销", "4"),
BF("报废", "3")
; ;
private String name; private String name;
...@@ -48,4 +49,13 @@ public enum EquipStateEnum { ...@@ -48,4 +49,13 @@ public enum EquipStateEnum {
} }
return jsonArray; return jsonArray;
} }
public static String getNameByCode(String code) {
for (EquipStateEnum e : EnumSet.allOf(EquipStateEnum.class)) {
if(e.getCode().equals(code)){
return e.getName();
}
}
return null;
}
} }
...@@ -54,7 +54,7 @@ public enum UnitTypeNewEnum { ...@@ -54,7 +54,7 @@ public enum UnitTypeNewEnum {
} }
public static JSONArray getUnitTypeByType(String category) { public static JSONArray getUnitTypeByType(String category) {
if (ObjectUtils.isEmpty(category)) { if (ObjectUtils.isEmpty(category) || category.equals("all")) {
return getAll(); return getAll();
} }
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
......
...@@ -404,6 +404,21 @@ ...@@ -404,6 +404,21 @@
"value": "4000" "value": "4000"
}, },
{ {
"key": "144",
"label": "客运索道",
"value": "9000"
},
{
"key": "80",
"label": "大型游乐设施",
"value": "6000"
},
{
"key": "76",
"label": "场(厂)内专用机动车辆",
"value": "5000"
},
{
"key": "1", "key": "1",
"label": "锅炉", "label": "锅炉",
"value": "1000" "value": "1000"
...@@ -417,21 +432,6 @@ ...@@ -417,21 +432,6 @@
"key": "133", "key": "133",
"label": "压力管道", "label": "压力管道",
"value": "8000" "value": "8000"
},
{
"key": "80",
"label": "大型游乐设施",
"value": "6000"
},
{
"key": "144",
"label": "客运索道",
"value": "9000"
},
{
"key": "76",
"label": "场(厂)内专用机动车辆",
"value": "5000"
} }
] ]
} }
\ No newline at end of file
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