Commit fddc283a authored by hcing's avatar hcing

设备认领-管道认领

parent d105c9aa
...@@ -46,4 +46,11 @@ public class EquipClaimController extends BaseController { ...@@ -46,4 +46,11 @@ public class EquipClaimController extends BaseController {
return ResponseHelper.buildResponse(equipClaimService.pipeEquipPage(new JSONObject(map))); return ResponseHelper.buildResponse(equipClaimService.pipeEquipPage(new JSONObject(map)));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/pipeEquip/claim")
@ApiOperation(value = "认领-管道设备", httpMethod = "POST")
public ResponseModel<Object> pipeEquipClaim(@RequestBody Map<String, Object> map) {
return ResponseHelper.buildResponse(equipClaimService.pipeEquipClaim(new JSONObject(map)));
}
} }
...@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException; import java.text.ParseException;
...@@ -147,8 +148,8 @@ public class JgUseRegistrationController extends BaseController { ...@@ -147,8 +148,8 @@ public class JgUseRegistrationController extends BaseController {
list.getRecords().forEach(x -> { list.getRecords().forEach(x -> {
x.put("companyType", info.getCompany().getCompanyType()); x.put("companyType", info.getCompany().getCompanyType());
x.put("regType", "1".equals(x.get("regType")) ? "历史登记": "2".equals(x.get("regType")) ? "特殊历史登记": "新增登记"); x.put("regType", "1".equals(x.get("regType")) ? "历史登记": "2".equals(x.get("regType")) ? "特殊历史登记": "新增登记");
if ("8000".equals(String.valueOf(x.get("equListCode"))) && !ValidationUtil.isEmpty(x.get("projectContraptionId"))){ if ("8000".equals(String.valueOf(x.get("equListCode"))) && !ValidationUtil.isEmpty(x.get("projectContraptionId"))) {
x.put("canVoided", jgProjectContraptionMapper.countContraptionInUseTimesForDeleteByIntoManagement(Long.parseLong((String) x.get("projectContraptionId"))) == 0); x.put("canVoided", jgProjectContraptionMapper.countContraptionInUseTimesForDeleteByIntoManagement(Objects.toString(x.get("projectContraptionId"))) == 0);
} else { } else {
x.put("canVoided", Optional.ofNullable(x.get("useRegistrationCode")).map(jgUseRegistrationServiceImpl::countUseTimesForInvalid) x.put("canVoided", Optional.ofNullable(x.get("useRegistrationCode")).map(jgUseRegistrationServiceImpl::countUseTimesForInvalid)
.orElse(true)); .orElse(true));
......
...@@ -18,4 +18,6 @@ public interface IIdxBizJgConstructionInfoService extends IService<IdxBizJgConst ...@@ -18,4 +18,6 @@ public interface IIdxBizJgConstructionInfoService extends IService<IdxBizJgConst
boolean saveOrUpdateBatch(List<IdxBizJgConstructionInfo> constructionInfoList); boolean saveOrUpdateBatch(List<IdxBizJgConstructionInfo> constructionInfoList);
IdxBizJgConstructionInfo queryNewestDetailByRecord(String record); IdxBizJgConstructionInfo queryNewestDetailByRecord(String record);
void updateBatchByRecord(List<IdxBizJgConstructionInfo> toUpdateConstructionInfoList);
} }
...@@ -18,4 +18,6 @@ public interface IIdxBizJgDesignInfoService { ...@@ -18,4 +18,6 @@ public interface IIdxBizJgDesignInfoService {
boolean saveOrUpdateBatch(List<IdxBizJgDesignInfo> designInfoList); boolean saveOrUpdateBatch(List<IdxBizJgDesignInfo> designInfoList);
IdxBizJgDesignInfo getOneData(String record); IdxBizJgDesignInfo getOneData(String record);
void updateBatchByRecord(List<IdxBizJgDesignInfo> toUpdateDesignInfoList);
} }
...@@ -18,4 +18,6 @@ public interface IIdxBizJgFactoryInfoService { ...@@ -18,4 +18,6 @@ public interface IIdxBizJgFactoryInfoService {
IdxBizJgFactoryInfo getOneData(String record); IdxBizJgFactoryInfo getOneData(String record);
boolean saveOrUpdateBatch(List<IdxBizJgFactoryInfo> factoryInfoList); boolean saveOrUpdateBatch(List<IdxBizJgFactoryInfo> factoryInfoList);
void updateBatchByRecord(List<IdxBizJgFactoryInfo> toUpdateFactoryInfoList);
} }
package com.yeejoin.amos.boot.module.jg.biz.service; package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import java.util.List; import java.util.List;
/** /**
* 安全追溯-检验检测信息表接口类 * 安全追溯-检验检测信息表接口类
...@@ -27,4 +28,5 @@ public interface IIdxBizJgInspectionDetectionInfoService { ...@@ -27,4 +28,5 @@ public interface IIdxBizJgInspectionDetectionInfoService {
*/ */
List<IdxBizJgInspectionDetectionInfo> queryLastedGroupByInspectType(String record); List<IdxBizJgInspectionDetectionInfo> queryLastedGroupByInspectType(String record);
void updateBatchByRecord(List<IdxBizJgInspectionDetectionInfo> toUpdateInspectionDetectionInfoList);
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import java.util.List; import java.util.List;
/** /**
...@@ -19,4 +20,6 @@ public interface IIdxBizJgOtherInfoService { ...@@ -19,4 +20,6 @@ public interface IIdxBizJgOtherInfoService {
void saveBatch(List<IdxBizJgOtherInfo> otherInfoList); void saveBatch(List<IdxBizJgOtherInfo> otherInfoList);
boolean saveOrUpdateBatch(List<IdxBizJgOtherInfo> otherInfoList); boolean saveOrUpdateBatch(List<IdxBizJgOtherInfo> otherInfoList);
void updateBatchByRecord(List<IdxBizJgOtherInfo> toUpdateOtherInfoList);
} }
...@@ -19,4 +19,6 @@ public interface IIdxBizJgSupervisionInfoService extends IService<IdxBizJgSuperv ...@@ -19,4 +19,6 @@ public interface IIdxBizJgSupervisionInfoService extends IService<IdxBizJgSuperv
IdxBizJgSupervisionInfo getOneData(String record); IdxBizJgSupervisionInfo getOneData(String record);
boolean saveOrUpdateBatch(List<IdxBizJgSupervisionInfo> supervisionInfoList); boolean saveOrUpdateBatch(List<IdxBizJgSupervisionInfo> supervisionInfoList);
void updateBatchByRecord(List<IdxBizJgSupervisionInfo> toUpdateSupervisionInfoList);
} }
...@@ -4,6 +4,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service; ...@@ -4,6 +4,8 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline;
import java.util.List;
/** /**
* 安全追溯-压力管道接口类 * 安全追溯-压力管道接口类
* *
...@@ -15,4 +17,6 @@ public interface IIdxBizJgTechParamsPipelineService extends IService<IdxBizJgTec ...@@ -15,4 +17,6 @@ public interface IIdxBizJgTechParamsPipelineService extends IService<IdxBizJgTec
void saveOrUpdateData(IdxBizJgTechParamsPipeline pipeline); void saveOrUpdateData(IdxBizJgTechParamsPipeline pipeline);
IdxBizJgTechParamsPipeline getOneData(String record); IdxBizJgTechParamsPipeline getOneData(String record);
void updateBatchByRecord(List<IdxBizJgTechParamsPipeline> toUpdateParamsPipelineList);
} }
...@@ -23,4 +23,6 @@ public interface IIdxBizJgUseInfoService extends IService<IdxBizJgUseInfo> { ...@@ -23,4 +23,6 @@ public interface IIdxBizJgUseInfoService extends IService<IdxBizJgUseInfo> {
boolean saveBatch(List<IdxBizJgUseInfo> useInfoList); boolean saveBatch(List<IdxBizJgUseInfo> useInfoList);
boolean saveOrUpdateBatch(List<IdxBizJgUseInfo> useInfoList); boolean saveOrUpdateBatch(List<IdxBizJgUseInfo> useInfoList);
void updateBatchByRecord(List<IdxBizJgUseInfo> toUpdateUseInfoList);
} }
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity; import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgConstructionInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgConstructionInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgConstructionInfoMapper;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -43,6 +43,11 @@ public class IdxBizJgConstructionInfoServiceImpl extends BaseService<IdxBizJgCon ...@@ -43,6 +43,11 @@ public class IdxBizJgConstructionInfoServiceImpl extends BaseService<IdxBizJgCon
return result; return result;
} }
@Override
public void updateBatchByRecord(List<IdxBizJgConstructionInfo> toUpdateConstructionInfoList) {
toUpdateConstructionInfoList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgConstructionInfo>().eq(IdxBizJgConstructionInfo::getRecord, info.getRecord())));
}
/** /**
* 查询最新的一条施工信息主键 * 查询最新的一条施工信息主键
* @param record 设备唯一标识 * @param record 设备唯一标识
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgDesignInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgDesignInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgDesignInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgDesignInfoMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -36,6 +38,11 @@ public class IdxBizJgDesignInfoServiceImpl extends BaseService<IdxBizJgDesignInf ...@@ -36,6 +38,11 @@ public class IdxBizJgDesignInfoServiceImpl extends BaseService<IdxBizJgDesignInf
return this.getOne(new QueryWrapper<IdxBizJgDesignInfo>().eq("RECORD", record)); return this.getOne(new QueryWrapper<IdxBizJgDesignInfo>().eq("RECORD", record));
} }
@Override
public void updateBatchByRecord(List<IdxBizJgDesignInfo> toUpdateDesignInfoList) {
toUpdateDesignInfoList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgDesignInfo>().eq(IdxBizJgDesignInfo::getRecord, info.getRecord())));
}
public List<IdxBizJgDesignInfo> checkOverDesignRegNum(List<String> records) { public List<IdxBizJgDesignInfo> checkOverDesignRegNum(List<String> records) {
if (records == null || records.isEmpty()) { if (records == null || records.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgFactoryInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgFactoryInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo;
...@@ -31,4 +32,9 @@ public class IdxBizJgFactoryInfoServiceImpl extends BaseService<IdxBizJgFactoryI ...@@ -31,4 +32,9 @@ public class IdxBizJgFactoryInfoServiceImpl extends BaseService<IdxBizJgFactoryI
public boolean saveOrUpdateBatch(List<IdxBizJgFactoryInfo> factoryInfoList) { public boolean saveOrUpdateBatch(List<IdxBizJgFactoryInfo> factoryInfoList) {
return super.saveOrUpdateBatch(factoryInfoList); return super.saveOrUpdateBatch(factoryInfoList);
} }
@Override
public void updateBatchByRecord(List<IdxBizJgFactoryInfo> toUpdateFactoryInfoList) {
toUpdateFactoryInfoList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgFactoryInfo>().eq(IdxBizJgFactoryInfo::getRecord, info.getRecord())));
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service; ...@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -79,4 +78,9 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB ...@@ -79,4 +78,9 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB
public List<IdxBizJgInspectionDetectionInfo> queryLastedGroupByInspectType(String record) { public List<IdxBizJgInspectionDetectionInfo> queryLastedGroupByInspectType(String record) {
return this.getBaseMapper().selectLastedGroupByInspectType(record); return this.getBaseMapper().selectLastedGroupByInspectType(record);
} }
@Override
public void updateBatchByRecord(List<IdxBizJgInspectionDetectionInfo> toUpdateInspectionDetectionInfoList) {
toUpdateInspectionDetectionInfoList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgInspectionDetectionInfo>().eq(IdxBizJgInspectionDetectionInfo::getRecord, info.getRecord())));
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgOtherInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgOtherInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
...@@ -36,4 +37,9 @@ public class IdxBizJgOtherInfoServiceImpl extends BaseService<IdxBizJgOtherInfoM ...@@ -36,4 +37,9 @@ public class IdxBizJgOtherInfoServiceImpl extends BaseService<IdxBizJgOtherInfoM
public boolean saveOrUpdateBatch(List<IdxBizJgOtherInfo> otherInfoList) { public boolean saveOrUpdateBatch(List<IdxBizJgOtherInfo> otherInfoList) {
return super.saveOrUpdateBatch(otherInfoList); return super.saveOrUpdateBatch(otherInfoList);
} }
@Override
public void updateBatchByRecord(List<IdxBizJgOtherInfo> toUpdateOtherInfoList) {
toUpdateOtherInfoList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgOtherInfo>().eq(IdxBizJgOtherInfo::getRecord, info.getRecord())));
}
} }
\ No newline at end of file
...@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -826,34 +827,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -826,34 +827,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE); String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE);
if (dataSource.contains("his")) { if (dataSource.contains("his")) {
String useRegistrationCode = Optional.ofNullable(equipmentInfoForm.get("useRegistrationCode")) // 使用登记证编号校验
.map(String::valueOf) this.checkUseRegistrationCode(equipmentInfoForm);
.map(String::trim)
.orElse(null);
if (useRegistrationCode == null) {
throw new BadRequest("请填写使用登记证编号后进行暂存!");
}
String equipId = String.valueOf(equipmentInfoForm.get("RECORD"));
// 校验使用登记证编号的唯一性
if (!CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY")) && commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId)) {
throw new BadRequest("使用登记证编号已存在!");
} else {
if (CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY"))) {
// 需求 35094 历史设备(有使用登记证)需按证录入。录入时先录入使用登记证编号。
// 需验证录入的使用登记证编号平台是否跟当前用户(使用单位类型)一致,如跟当前用户不一致,系统给出提示“该使用登记证编号”已被“单位名称“使用”,请确认后再录入”。
// 历史设备不限制使用登记证编号在一个单位重复录入,但需验证使用登记证编号+单位内编号唯一。(下面方法checkFactoryNumUniqueWithGasCylinder中已经校验)
String occupiedUseUnitName = commonService.isRegistrationNumberUsedByOtherUnits(useRegistrationCode);
if (!ValidationUtil.isEmpty(occupiedUseUnitName)) {
throw new BadRequest("该使用登记证编号已被【" + occupiedUseUnitName + "】使用,请确认后再录入!");
}
}
}
String regType = Optional.ofNullable(equipmentInfoForm.get("EQU_LIST"))
.filter(code -> CylinderTypeEnum.CYLINDER.getCode().equals(code))
.map(code -> "1".equals(equipmentInfoForm.get("WHETHER_VEHICLE_CYLINDER")) ? "vehicle" : "cylinder")
.orElse("set");
// 判断是否使用未来系统生成编号
idxBizJgRegisterInfoService.checkUseRegistrationCode(useRegistrationCode, regType);
} }
try { try {
...@@ -896,7 +871,40 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -896,7 +871,40 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return ResponseHelper.buildResponse(record); return ResponseHelper.buildResponse(record);
} }
/**
* 使用登记证编号相关校验
* @param equipmentInfoForm
*/
public void checkUseRegistrationCode(LinkedHashMap equipmentInfoForm) {
String useRegistrationCode = Optional.ofNullable(equipmentInfoForm.get("useRegistrationCode"))
.map(String::valueOf)
.map(String::trim)
.orElse(null);
if (useRegistrationCode == null) {
throw new BadRequest("请填写使用登记证编号后进行暂存!");
}
String equipId = String.valueOf(equipmentInfoForm.get("RECORD"));
// 校验使用登记证编号的唯一性
if (!CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY")) && commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId)) {
throw new BadRequest("使用登记证编号已存在!");
} else {
if (CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY"))) {
// 需求 35094 历史设备(有使用登记证)需按证录入。录入时先录入使用登记证编号。
// 需验证录入的使用登记证编号平台是否跟当前用户(使用单位类型)一致,如跟当前用户不一致,系统给出提示“该使用登记证编号”已被“单位名称“使用”,请确认后再录入”。
// 历史设备不限制使用登记证编号在一个单位重复录入,但需验证使用登记证编号+单位内编号唯一。(下面方法checkFactoryNumUniqueWithGasCylinder中已经校验)
String occupiedUseUnitName = commonService.isRegistrationNumberUsedByOtherUnits(useRegistrationCode);
if (!ValidationUtil.isEmpty(occupiedUseUnitName)) {
throw new BadRequest("该使用登记证编号已被【" + occupiedUseUnitName + "】使用,请确认后再录入!");
}
}
}
String regType = Optional.ofNullable(equipmentInfoForm.get("EQU_LIST"))
.filter(code -> CylinderTypeEnum.CYLINDER.getCode().equals(code))
.map(code -> "1".equals(equipmentInfoForm.get("WHETHER_VEHICLE_CYLINDER")) ? "vehicle" : "cylinder")
.orElse("set");
// 判断是否使用未来系统生成编号
idxBizJgRegisterInfoService.checkUseRegistrationCode(useRegistrationCode, regType);
}
private Object checkAndCast(Object obj) { private Object checkAndCast(Object obj) {
...@@ -5232,4 +5240,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -5232,4 +5240,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
return result; return result;
} }
public void updateBatchByRecord(List<IdxBizJgRegisterInfo> toUpdateRegisterInfoList) {
toUpdateRegisterInfoList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgRegisterInfo>().eq(IdxBizJgRegisterInfo::getRecord, info.getRecord())));
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgSupervisionInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgSupervisionInfoService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgSupervisionInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgSupervisionInfoMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
/** /**
...@@ -30,4 +32,9 @@ public class IdxBizJgSupervisionInfoServiceImpl extends BaseService<IdxBizJgSupe ...@@ -30,4 +32,9 @@ public class IdxBizJgSupervisionInfoServiceImpl extends BaseService<IdxBizJgSupe
public boolean saveOrUpdateBatch(List<IdxBizJgSupervisionInfo> supervisionInfoList) { public boolean saveOrUpdateBatch(List<IdxBizJgSupervisionInfo> supervisionInfoList) {
return super.saveOrUpdateBatch(supervisionInfoList); return super.saveOrUpdateBatch(supervisionInfoList);
} }
@Override
public void updateBatchByRecord(List<IdxBizJgSupervisionInfo> toUpdateSupervisionInfoList) {
toUpdateSupervisionInfoList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgSupervisionInfo>().eq(IdxBizJgSupervisionInfo::getRecord, info.getRecord())));
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgTechParamsPipelineService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgTechParamsPipelineService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsPipelineMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsPipelineMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 安全追溯-压力管道服务实现类 * 安全追溯-压力管道服务实现类
* *
...@@ -23,4 +26,9 @@ public class IdxBizJgTechParamsPipelineServiceImpl extends BaseService<IdxBizJgT ...@@ -23,4 +26,9 @@ public class IdxBizJgTechParamsPipelineServiceImpl extends BaseService<IdxBizJgT
public IdxBizJgTechParamsPipeline getOneData(String record) { public IdxBizJgTechParamsPipeline getOneData(String record) {
return this.getOne(new QueryWrapper<IdxBizJgTechParamsPipeline>().eq("RECORD", record)); return this.getOne(new QueryWrapper<IdxBizJgTechParamsPipeline>().eq("RECORD", record));
} }
@Override
public void updateBatchByRecord(List<IdxBizJgTechParamsPipeline> toUpdateParamsPipelineList) {
toUpdateParamsPipelineList.forEach(info -> super.update(info, new LambdaUpdateWrapper<IdxBizJgTechParamsPipeline>().eq(IdxBizJgTechParamsPipeline::getRecord, info.getRecord())));
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.jg.biz.core.BaseService; import com.yeejoin.amos.boot.module.jg.biz.core.BaseService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgUseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -44,4 +44,9 @@ public class IdxBizJgUseInfoServiceImpl extends BaseService<IdxBizJgUseInfoMappe ...@@ -44,4 +44,9 @@ public class IdxBizJgUseInfoServiceImpl extends BaseService<IdxBizJgUseInfoMappe
public boolean saveOrUpdateBatch(List<IdxBizJgUseInfo> useInfoList) { public boolean saveOrUpdateBatch(List<IdxBizJgUseInfo> useInfoList) {
return super.saveOrUpdateBatch(useInfoList); return super.saveOrUpdateBatch(useInfoList);
} }
@Override
public void updateBatchByRecord(List<IdxBizJgUseInfo> toUpdateUseInfoList) {
toUpdateUseInfoList.forEach(useInfo -> super.update(useInfo, new LambdaUpdateWrapper<IdxBizJgUseInfo>().eq(IdxBizJgUseInfo::getRecord, useInfo.getRecord())));
}
} }
\ No newline at end of file
...@@ -396,7 +396,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -396,7 +396,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
}); });
// 压力管道添加作废标识:不在流程中即可作废 // 压力管道添加作废标识:不在流程中即可作废
if (EquipmentClassifityEnum.YLGD.getCode().equals(notice.get("equListCode")) && !ValidationUtil.isEmpty(notice.get("projectContraptionId"))) { if (EquipmentClassifityEnum.YLGD.getCode().equals(notice.get("equListCode")) && !ValidationUtil.isEmpty(notice.get("projectContraptionId"))) {
notice.put("canVoided", idxBizJgProjectContraptionMapper.countContraptionInUseTimesForDeleteByIntoManagement(Long.parseLong(String.valueOf(notice.get("projectContraptionId")))) == 0); notice.put("canVoided", idxBizJgProjectContraptionMapper.countContraptionInUseTimesForDeleteByIntoManagement(String.valueOf(notice.get("projectContraptionId"))) == 0);
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -57,7 +57,7 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro ...@@ -57,7 +57,7 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
* @param projectContraptionId 设备唯一标识 * @param projectContraptionId 设备唯一标识
* @return 被引用次数 > 0 则设备不可删除 * @return 被引用次数 > 0 则设备不可删除
*/ */
Integer countContraptionInUseTimesForDeleteByIntoManagement(@Param("projectContraptionId") Long projectContraptionId); Integer countContraptionInUseTimesForDeleteByIntoManagement(@Param("projectContraptionId") String projectContraptionId);
List<IdxBizJgProjectContraption> selectErrorManagementProject(); List<IdxBizJgProjectContraption> selectErrorManagementProject();
......
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