Commit 6ac4d2c6 authored by 刘林's avatar 刘林

fix(jg):西安电梯历史数据导入接口修改

parent 2e894106
...@@ -81,6 +81,17 @@ public class DictParamsConverter implements Converter<String> { ...@@ -81,6 +81,17 @@ public class DictParamsConverter implements Converter<String> {
dictMap.put("其他控制方式", "4"); dictMap.put("其他控制方式", "4");
dictMap.put("直接顶升", "1"); dictMap.put("直接顶升", "1");
dictMap.put("间接顶升", "2"); dictMap.put("间接顶升", "2");
dictMap.put("游乐场所", "6532");
dictMap.put("商业单位", "6009");
dictMap.put("学校", "6010");
dictMap.put("政府机关", "6012");
dictMap.put("医疗机构", "6011");
dictMap.put("公共场所", "6013");
dictMap.put("旅游景区", "6531");
dictMap.put("住宅小区", "6008");
dictMap.put("养老机构", "6530");
dictMap.put("工业场所", "6528");
dictMap.put("工业场所(户外)", "6529");
} }
@Override @Override
......
...@@ -110,7 +110,7 @@ public class XiAnElevatorExcelDto extends BaseDto { ...@@ -110,7 +110,7 @@ public class XiAnElevatorExcelDto extends BaseDto {
private String longitudeLatitude; private String longitudeLatitude;
@ApiModelProperty(value = "使用场所") @ApiModelProperty(value = "使用场所")
@ExcelProperty(value = "使用场所") @ExcelProperty(value = "使用场所", converter = DictParamsConverter.class)
private String usePlace; private String usePlace;
@ApiModelProperty(value = "安全管理员") @ApiModelProperty(value = "安全管理员")
...@@ -365,7 +365,7 @@ public class XiAnElevatorExcelDto extends BaseDto { ...@@ -365,7 +365,7 @@ public class XiAnElevatorExcelDto extends BaseDto {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
@ExcelProperty(value = "创建时间") @ExcelProperty(value = "创建时间")
@DateTimeFormat("yyyy-MM-dd") @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
private String createDate; private String createDate;
@ApiModelProperty(value = "创建人名称") @ApiModelProperty(value = "创建人名称")
...@@ -382,6 +382,6 @@ public class XiAnElevatorExcelDto extends BaseDto { ...@@ -382,6 +382,6 @@ public class XiAnElevatorExcelDto extends BaseDto {
@ApiModelProperty(value = "审批通过时间") @ApiModelProperty(value = "审批通过时间")
@ExcelProperty(value = "审批通过时间") @ExcelProperty(value = "审批通过时间")
@DateTimeFormat("yyyy-MM-dd") @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
private String approvalDate; private String approvalDate;
} }
\ No newline at end of file
...@@ -115,4 +115,13 @@ public interface TzsJgServiceFeignClient { ...@@ -115,4 +115,13 @@ public interface TzsJgServiceFeignClient {
*/ */
@RequestMapping(value = "/dataDock/xi-an/saveElevatorData", method = RequestMethod.POST) @RequestMapping(value = "/dataDock/xi-an/saveElevatorData", method = RequestMethod.POST)
Object saveElevatorData(@RequestBody List<XiAnElevatorExcelDto> elevatorExcelDtos); Object saveElevatorData(@RequestBody List<XiAnElevatorExcelDto> elevatorExcelDtos);
/**
* record唯一性检查
*
* @param record
* @return
*/
@RequestMapping(value = "/common/checkRecordUniqueness", method = RequestMethod.GET)
Boolean selectByRecordAndClaimStatus(@RequestParam("record") String record);
} }
...@@ -50,6 +50,7 @@ public class XiAnDataDockServiceImpl { ...@@ -50,6 +50,7 @@ public class XiAnDataDockServiceImpl {
List<String> useInnerCodeList = new ArrayList<>();// 单位内部编号集合 List<String> useInnerCodeList = new ArrayList<>();// 单位内部编号集合
List<String> equCodeList = new ArrayList<>();// 设备代码集合 List<String> equCodeList = new ArrayList<>();// 设备代码集合
List<String> factoryNumList = new ArrayList<>();// 出厂编码集合 List<String> factoryNumList = new ArrayList<>();// 出厂编码集合
List<String> recordList = new ArrayList<>();// 注册代码集合
/** /**
...@@ -464,6 +465,15 @@ public class XiAnDataDockServiceImpl { ...@@ -464,6 +465,15 @@ public class XiAnDataDockServiceImpl {
} }
/** /**
* 根据record检查唯一性
*
* @param record record
*/
private boolean checkRecordUniqueness(String record) {
return jgServiceFeignClient.selectByRecordAndClaimStatus(record);
}
/**
* 起重机械----技术参数 检查 * 起重机械----技术参数 检查
* *
* @param data * @param data
...@@ -570,6 +580,7 @@ public class XiAnDataDockServiceImpl { ...@@ -570,6 +580,7 @@ public class XiAnDataDockServiceImpl {
useInnerCodeList.clear(); useInnerCodeList.clear();
equCodeList.clear(); equCodeList.clear();
factoryNumList.clear(); factoryNumList.clear();
recordList.clear();
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
ExcelReader excelReader = EasyExcel.read(inputStream).build(); ExcelReader excelReader = EasyExcel.read(inputStream).build();
...@@ -588,6 +599,7 @@ public class XiAnDataDockServiceImpl { ...@@ -588,6 +599,7 @@ public class XiAnDataDockServiceImpl {
checkElevatorExcelData(sheetName, data, context, sheetError); checkElevatorExcelData(sheetName, data, context, sheetError);
useInnerCodeList.add(data.getUseInnerCode()); useInnerCodeList.add(data.getUseInnerCode());
equCodeList.add(data.getEquCode()); equCodeList.add(data.getEquCode());
recordList.add(data.getRecord());
dataList.add(data); dataList.add(data);
} }
...@@ -631,7 +643,7 @@ public class XiAnDataDockServiceImpl { ...@@ -631,7 +643,7 @@ public class XiAnDataDockServiceImpl {
} else { } else {
checkResumeInfo(data, rowError); checkResumeInfo(data, rowError);
} }
// data.setIsCompleteXa(this.checkIsComplete(data) ? 0 : 1); data.setIsCompleteXa(1);
if (!StringUtils.isBlank(rowError)) { if (!StringUtils.isBlank(rowError)) {
sheetError.put(String.format(excelErrorStr, rowIndex), rowError); sheetError.put(String.format(excelErrorStr, rowIndex), rowError);
} }
...@@ -645,12 +657,12 @@ public class XiAnDataDockServiceImpl { ...@@ -645,12 +657,12 @@ public class XiAnDataDockServiceImpl {
checkNotBlank(data.getResumeSeq(), "监管履历主键不能为空;", rowError); checkNotBlank(data.getResumeSeq(), "监管履历主键不能为空;", rowError);
checkNotBlank(data.getBusinessType(), "业务类型不能为空;", rowError); checkNotBlank(data.getBusinessType(), "业务类型不能为空;", rowError);
checkNotBlank(data.getCreateDate(), "创建时间不能为空;", rowError); checkNotBlank(data.getCreateDate(), "创建时间不能为空;", rowError);
Optional.ofNullable(data.getCreateDate()).ifPresent(v -> checkDateFormatCorrect(v, "创建时间格式不正确;", rowError)); // Optional.ofNullable(data.getCreateDate()).ifPresent(v -> checkDateFormatCorrect(v, "创建时间格式不正确;", rowError));
checkNotBlank(data.getCreateUserName(), "创建人名称不能为空;", rowError); checkNotBlank(data.getCreateUserName(), "创建人名称不能为空;", rowError);
checkNotBlank(data.getBusinessId(), "业务单号不能为空;", rowError); checkNotBlank(data.getBusinessId(), "业务单号不能为空;", rowError);
checkNotBlank(data.getApprovalUnit(), "审批单位不能为空;", rowError); checkNotBlank(data.getApprovalUnit(), "审批单位不能为空;", rowError);
checkNotBlank(data.getApprovalDate(), "审批通过时间不能为空;", rowError); checkNotBlank(data.getApprovalDate(), "审批通过时间不能为空;", rowError);
Optional.ofNullable(data.getApprovalDate()).ifPresent(v -> checkDateFormatCorrect(v, "审批通过时间格式不正确;", rowError)); // Optional.ofNullable(data.getApprovalDate()).ifPresent(v -> checkDateFormatCorrect(v, "审批通过时间格式不正确;", rowError));
} }
private void checkCommonInfo(XiAnElevatorExcelDto data, StringBuffer rowError) { private void checkCommonInfo(XiAnElevatorExcelDto data, StringBuffer rowError) {
...@@ -662,6 +674,12 @@ public class XiAnDataDockServiceImpl { ...@@ -662,6 +674,12 @@ public class XiAnDataDockServiceImpl {
if (useInnerCodeList.contains(data.getUseInnerCode())) { if (useInnerCodeList.contains(data.getUseInnerCode())) {
rowError.append("单位内编号不能重复;"); rowError.append("单位内编号不能重复;");
} }
if (recordList.contains(data.getRecord())) {
rowError.append("模板中注册代码不能重复;").append(data.getRecord());
}
if (this.checkRecordUniqueness(data.getRecord())){
rowError.append("系统中存在注册代码;").append(data.getRecord());
}
checkNotBlank(data.getEquType(), "设备型号不能为空;", rowError); checkNotBlank(data.getEquType(), "设备型号不能为空;", rowError);
checkNotBlank(data.getEquCodeType(), "有无设备代码不能为空;", rowError); checkNotBlank(data.getEquCodeType(), "有无设备代码不能为空;", rowError);
if ("1".equals(data.getEquCodeType())) { if ("1".equals(data.getEquCodeType())) {
......
...@@ -184,4 +184,10 @@ public class ESEquipmentCategoryDto { ...@@ -184,4 +184,10 @@ public class ESEquipmentCategoryDto {
*/ */
@Field(type = FieldType.Boolean, name = "IS_COMPLETE_XA") @Field(type = FieldType.Boolean, name = "IS_COMPLETE_XA")
private Boolean IS_COMPLETE_XA; private Boolean IS_COMPLETE_XA;
/**
* 是否可以做业务-西安电梯导入用(false-否,true-是)
*/
@Field(type = FieldType.Boolean)
private Boolean IS_DO_BUSINESS;
} }
...@@ -288,5 +288,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -288,5 +288,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
* @return 公司对象集合 * @return 公司对象集合
*/ */
List<KeyValueDto> queryAllCompanyDict(); List<KeyValueDto> queryAllCompanyDict();
Integer checkRecordUniqueness(String record);
} }
...@@ -2782,4 +2782,8 @@ ...@@ -2782,4 +2782,8 @@
WHERE ui."IS_INTO_MANAGEMENT" = true and (ri."EQU_LIST" = '6000' OR ri."EQU_LIST" = '2000') and di."DELAY_SERVICE_LIFE_DATE" > 0 WHERE ui."IS_INTO_MANAGEMENT" = true and (ri."EQU_LIST" = '6000' OR ri."EQU_LIST" = '2000') and di."DELAY_SERVICE_LIFE_DATE" > 0
) tt where tt.isExpired = true; ) tt where tt.isExpired = true;
</select> </select>
<select id="checkRecordUniqueness" resultType="java.lang.Integer">
SELECT COUNT(*) FROM idx_biz_jg_use_info jui WHERE jui.record = #{record}
</select>
</mapper> </mapper>
...@@ -63,6 +63,9 @@ ...@@ -63,6 +63,9 @@
<if test="dto.isCyl != null and dto.isCyl == 1 "> <if test="dto.isCyl != null and dto.isCyl == 1 ">
AND tjurm.reg_type != '车用气瓶登记' AND tjurm.reg_type != '车用气瓶登记'
</if> </if>
<if test="dto.isDoBusiness != null and dto.isDoBusiness != ''">
and tjurm.is_do_business = #{dto.isDoBusiness}
</if>
<if test="dto.regType != null and dto.regType != '' "> <if test="dto.regType != null and dto.regType != '' ">
AND EXISTS ( AND EXISTS (
SELECT 1 SELECT 1
...@@ -136,6 +139,9 @@ ...@@ -136,6 +139,9 @@
<if test="dto.isScrap != null and dto.isScrap != ''"> <if test="dto.isScrap != null and dto.isScrap != ''">
and tjurm.is_scrap = #{dto.isScrap} and tjurm.is_scrap = #{dto.isScrap}
</if> </if>
<if test="dto.isDoBusiness != null and dto.isDoBusiness != ''">
and tjurm.is_do_business = #{dto.isDoBusiness}
</if>
<if test="dto.cityName != null and dto.cityName != ''"> <if test="dto.cityName != null and dto.cityName != ''">
and tjurm.equ_use_address LIKE CONCAT('%', #{dto.cityName}, '%') and tjurm.equ_use_address LIKE CONCAT('%', #{dto.cityName}, '%')
</if> </if>
......
...@@ -797,6 +797,13 @@ public class CommonController extends BaseController { ...@@ -797,6 +797,13 @@ public class CommonController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/checkRecordUniqueness")
@ApiOperation(httpMethod = "GET", value = "检查record的唯一性", notes = "检查record的唯一性")
public Boolean checkRecordUniqueness(@RequestParam("record") String record) {
return commonService.checkRecordUniqueness(record);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/checkFactoryNumUniquenessForVehicleCylinder") @GetMapping(value = "/checkFactoryNumUniquenessForVehicleCylinder")
@ApiOperation(httpMethod = "GET", value = "车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)", notes = "车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)") @ApiOperation(httpMethod = "GET", value = "车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)", notes = "车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)")
public Integer checkFactoryNumUniquenessForVehicleCylinder(@RequestParam("factoryNum") String factoryNum) { public Integer checkFactoryNumUniquenessForVehicleCylinder(@RequestParam("factoryNum") String factoryNum) {
......
...@@ -163,6 +163,7 @@ public class JgChangeRegistrationNameController extends BaseController { ...@@ -163,6 +163,7 @@ public class JgChangeRegistrationNameController extends BaseController {
} }
} }
dto.setCertificateStatus("已登记"); dto.setCertificateStatus("已登记");
dto.setIsDoBusiness("1");
return ResponseHelper.buildResponse(jgChangeRegistrationNameService.getTableData(dto)); return ResponseHelper.buildResponse(jgChangeRegistrationNameService.getTableData(dto));
} }
......
...@@ -205,6 +205,7 @@ public class JgChangeRegistrationReformController extends BaseController { ...@@ -205,6 +205,7 @@ public class JgChangeRegistrationReformController extends BaseController {
} }
//区外移装查询已注销状态的证 //区外移装查询已注销状态的证
dto.setCertificateStatus("1".equals(transferType) ? "已注销" : "已登记"); dto.setCertificateStatus("1".equals(transferType) ? "已注销" : "已登记");
dto.setIsDoBusiness("1");//默认可以做业务
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getUseRegistrationCodeData(page, dto)); return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getUseRegistrationCodeData(page, dto));
} }
......
...@@ -159,6 +159,7 @@ public class JgUseRegistrationManageController extends BaseController { ...@@ -159,6 +159,7 @@ public class JgUseRegistrationManageController extends BaseController {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION); dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setReceiveCompanyCode(info.getCompany().getCompanyCode()); dto.setReceiveCompanyCode(info.getCompany().getCompanyCode());
} }
dto.setIsDoBusiness(ValidationUtil.isEmpty(dto.getIsDoBusiness()) ? "1" : "");
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort)); return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
} }
...@@ -224,6 +225,7 @@ public class JgUseRegistrationManageController extends BaseController { ...@@ -224,6 +225,7 @@ public class JgUseRegistrationManageController extends BaseController {
} else { } else {
dto.setReceiveCompanyCode(company.getCompanyCode()); dto.setReceiveCompanyCode(company.getCompanyCode());
} }
dto.setIsDoBusiness("1");
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryByUseUnitCreditCode(dto)); return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryByUseUnitCreditCode(dto));
} }
...@@ -357,6 +359,7 @@ public class JgUseRegistrationManageController extends BaseController { ...@@ -357,6 +359,7 @@ public class JgUseRegistrationManageController extends BaseController {
} else { } else {
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
dto.setIsDoBusiness("1");
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort)); return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
} }
......
...@@ -268,4 +268,11 @@ public interface ICommonService { ...@@ -268,4 +268,11 @@ public interface ICommonService {
Map<String, Object> getRegistrationChangeCertificateUrl(JSONObject formData); Map<String, Object> getRegistrationChangeCertificateUrl(JSONObject formData);
void getRegistrationChangeCertificateFormStream(JSONObject jsonObject, HttpServletResponse response); void getRegistrationChangeCertificateFormStream(JSONObject jsonObject, HttpServletResponse response);
/**
* 检查record的唯一性
* @param record
* @return
*/
Boolean checkRecordUniqueness(String record);
} }
...@@ -3002,6 +3002,18 @@ public class CommonServiceImpl implements ICommonService { ...@@ -3002,6 +3002,18 @@ public class CommonServiceImpl implements ICommonService {
} }
/** /**
* 检查record的唯一性
*
* @param record record
* @return
*/
@Override
public Boolean checkRecordUniqueness(String record) {
Integer count = commonMapper.checkRecordUniqueness(record);
return count > 0 ? Boolean.TRUE : Boolean.FALSE;
}
/**
* 使用登记证编号的全库唯一校验 * 使用登记证编号的全库唯一校验
* *
* @param useRegistrationCode 登记证编号 * @param useRegistrationCode 登记证编号
......
...@@ -134,6 +134,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -134,6 +134,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
public static final String INSPECTION_AND_TESTING_INSTITUTIONS = "检验检测机构"; public static final String INSPECTION_AND_TESTING_INSTITUTIONS = "检验检测机构";
// 设备纳管 纳管:true 未纳管:false // 设备纳管 纳管:true 未纳管:false
public static final String IS_INTO_MANAGEMENT = "IS_INTO_MANAGEMENT"; public static final String IS_INTO_MANAGEMENT = "IS_INTO_MANAGEMENT";
public static final String IS_DO_BUSINESS = "IS_DO_BUSINESS";
// 设备来源 jg:新设备录入 jg_his:历史数据录入 // 设备来源 jg:新设备录入 jg_his:历史数据录入
public static final String DATA_SOURCE = "DATA_SOURCE"; public static final String DATA_SOURCE = "DATA_SOURCE";
// 设备来源名称 jg:新设备 jg_his:历史数据 // 设备来源名称 jg:新设备 jg_his:历史数据
...@@ -2353,6 +2354,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2353,6 +2354,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
meBuilder.minimumShouldMatch(1); meBuilder.minimumShouldMatch(1);
boolMust.must(meBuilder); boolMust.must(meBuilder);
//默认条件 限制西安电梯隶属导入数据不可做业务
if (ObjectUtils.isEmpty(map.getString(IS_DO_BUSINESS))) {
BoolQueryBuilder tBuilder = QueryBuilders.boolQuery();
tBuilder.should(QueryBuilders.matchQuery(IS_DO_BUSINESS, true));
tBuilder.should(QueryBuilders.boolQuery().mustNot(QueryBuilders.existsQuery(IS_DO_BUSINESS)));
tBuilder.minimumShouldMatch(1);
boolMust.must(tBuilder);
}
// DATA_SOURCE 为“jg”开头的数据(从监管新加或复制的设备) // DATA_SOURCE 为“jg”开头的数据(从监管新加或复制的设备)
// 20240314 提出的监管业务不要让企业用户选到之前一码通认领或补录的设备,让从监管业务中去新增 // 20240314 提出的监管业务不要让企业用户选到之前一码通认领或补录的设备,让从监管业务中去新增
BoolQueryBuilder dBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder dBuilder = QueryBuilders.boolQuery();
......
...@@ -1294,6 +1294,13 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -1294,6 +1294,13 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
if (!ValidationUtil.isEmpty(type) && type.contains("个人主体")) { if (!ValidationUtil.isEmpty(type) && type.contains("个人主体")) {
map.put("USE_UNIT_CREDIT_CODE", companyCode); map.put("USE_UNIT_CREDIT_CODE", companyCode);
} }
//默认条件 限制西安电梯隶属导入数据不可做业务
BoolQueryBuilder tBuilder = QueryBuilders.boolQuery();
tBuilder.should(QueryBuilders.matchQuery("IS_DO_BUSINESS", true));
tBuilder.should(QueryBuilders.boolQuery().mustNot(QueryBuilders.existsQuery("IS_DO_BUSINESS")));
tBuilder.minimumShouldMatch(1);
boolMust.must(tBuilder);
// 使用单位 //安装改造维修单位 // 使用单位 //安装改造维修单位
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE")) && !ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE")) && !ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder ubuilder = QueryBuilders.boolQuery(); BoolQueryBuilder ubuilder = QueryBuilders.boolQuery();
......
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