Commit f87a83b3 authored by 刘林's avatar 刘林

fix(jg):密评完整性问题处理

parent 97b75ca6
...@@ -50,7 +50,15 @@ ...@@ -50,7 +50,15 @@
FROM tzs_jg_maintenance_contract_eq ede FROM tzs_jg_maintenance_contract_eq ede
LEFT JOIN idx_biz_jg_supervision_info si ON si."RECORD" = ede.equ_id LEFT JOIN idx_biz_jg_supervision_info si ON si."RECORD" = ede.equ_id
WHERE ede.equip_transfer_id = tjmc.sequence_nbr WHERE ede.equip_transfer_id = tjmc.sequence_nbr
) AS orgBranchCodes ) AS orgBranchCodes,
(
SELECT mri.ME_MASTER1_PHONE AS phone
FROM tzs_jg_maintenance_contract_eq ede
LEFT JOIN idx_biz_jg_maintenance_record_info mri
ON mri."RECORD" = ede.equ_id
WHERE ede.equip_transfer_id = tjmc.sequence_nbr
order by mri.REC_DATE limit 1
) AS phone
FROM FROM
tzs_jg_maintenance_contract tjmc tzs_jg_maintenance_contract tjmc
</sql> </sql>
......
...@@ -118,45 +118,58 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -118,45 +118,58 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
* 分页查询 * 分页查询
*/ */
public Page<JgMaintenanceContractVo> queryForPage(Page<JgMaintenanceContract> page, String sort, JgMaintenanceContractDto dto, ReginParams reginParams, String client) { public Page<JgMaintenanceContractVo> queryForPage(Page<JgMaintenanceContract> page, String sort, JgMaintenanceContractDto dto, ReginParams reginParams, String client) {
if (ObjectUtils.isEmpty(dto)) { try {
dto = new JgMaintenanceContractDto(); if (ObjectUtils.isEmpty(dto)) {
} dto = new JgMaintenanceContractDto();
Page<JgMaintenanceContractDto> contractList;
Page<JgMaintenanceContractVo> result = new Page<>();
CompanyBo company = reginParams.getCompany();
SortVo sortMap = commonService.sortFieldConversion(sort);
Map<String, Object> companyTypeMap = jrmInstallationNoticeService.getCompanyType();
String companyLevel = "";
String companyType = "";
if (companyTypeMap.containsKey("companyLevel")) {
companyLevel = companyTypeMap.get("companyLevel").toString();
}
if (companyTypeMap.containsKey("companyType")) {
companyType = companyTypeMap.get("companyType").toString();
}
if ("supervision".equals(companyLevel)) {
// 监管单位查询
if (client.equals("jgLook")) {
dto.setOrgBranchCode(company.getOrgCode());
} else { // 接收机构查询
dto.setReceiveOrgCodeFilter(company.getCompanyCode());
} }
} else if ("company".equals(companyLevel)) { Page<JgMaintenanceContractDto> contractList;
if (companyType.contains(CompanyTypeEnum.USE.getCode()) || companyType.contains(CompanyTypeEnum.INDIVIDUAL.getCode())) { Page<JgMaintenanceContractVo> result = new Page<>();
// 使用单位用"使用单位统一信用代码"匹配数据 CompanyBo company = reginParams.getCompany();
dto.setUseUnitCodeFilter(company.getCompanyCode()); SortVo sortMap = commonService.sortFieldConversion(sort);
dto.setRoleIds(null); Map<String, Object> companyTypeMap = jrmInstallationNoticeService.getCompanyType();
String companyLevel = "";
String companyType = "";
if (companyTypeMap.containsKey("companyLevel")) {
companyLevel = companyTypeMap.get("companyLevel").toString();
}
if (companyTypeMap.containsKey("companyType")) {
companyType = companyTypeMap.get("companyType").toString();
}
if ("supervision".equals(companyLevel)) {
// 监管单位查询
if (client.equals("jgLook")) {
dto.setOrgBranchCode(company.getOrgCode());
} else { // 接收机构查询
dto.setReceiveOrgCodeFilter(company.getCompanyCode());
}
} else if ("company".equals(companyLevel)) {
if (companyType.contains(CompanyTypeEnum.USE.getCode()) || companyType.contains(CompanyTypeEnum.INDIVIDUAL.getCode())) {
// 使用单位用"使用单位统一信用代码"匹配数据
dto.setUseUnitCodeFilter(company.getCompanyCode());
dto.setRoleIds(null);
}
if (companyType.contains(CompanyTypeEnum.CONSTRUCTION.getCode())) {
// 维保单位用"维保单位统一信用代码"匹配数据
dto.setMaintenanceUnitCodeFilter(company.getCompanyCode());
}
} }
if (companyType.contains(CompanyTypeEnum.CONSTRUCTION.getCode())) { contractList = maintenanceContractMapper.getContractList(page, sortMap, dto, reginParams.getUserModel().getUserId(), client);
// 维保单位用"维保单位统一信用代码"匹配数据 List<JgMaintenanceContractDto> records = contractList.getRecords().stream().peek(x -> x.setUnitType(company.getCompanyType())).collect(Collectors.toList());
dto.setMaintenanceUnitCodeFilter(company.getCompanyCode()); contractList.setRecords(records);
BeanUtils.copyProperties(contractList, result);
return result;
} catch (Exception ex) {
String msg = ex.getMessage() == null ? "" : ex.getMessage();
if (msg.contains("eyibc decrypt error")
|| msg.contains("EYIBCException")
|| msg.contains("olym jdbc error")
|| msg.contains("数据非法")
|| msg.contains("Code: 100023:sql parse error")
|| msg.contains("decrypt error, code: -65")) {
throw new BadRequest("数据完整性被破坏(解密失败),请联系管理员。");
} }
throw new BadRequest("系统内部错误,请联系管理员。");
} }
contractList = maintenanceContractMapper.getContractList(page, sortMap, dto, reginParams.getUserModel().getUserId(), client);
List<JgMaintenanceContractDto> records = contractList.getRecords().stream().peek(x -> x.setUnitType(company.getCompanyType())).collect(Collectors.toList());
contractList.setRecords(records);
BeanUtils.copyProperties(contractList, result);
return result;
} }
/** /**
......
...@@ -233,13 +233,17 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -233,13 +233,17 @@ public class TzBaseEnterpriseInfoServiceImpl
// } // }
SortVo sortMap = userInfoService.sortFieldConversion(sort); SortVo sortMap = userInfoService.sortFieldConversion(sort);
// 密评专用(查tz_flc_reg_unit_info表中的admin_login_pwd字段,以用于验证密评数据完整性) // 密评专用(查tz_flc_reg_unit_info表中的admin_login_pwd字段,以用于验证密评数据完整性)
regUnitInfoService.lambdaQuery().eq(RegUnitInfo::getUnitCode, tzBaseEnterpriseInfoDto.getUseUnitCode()).select(RegUnitInfo::getUnitCode, RegUnitInfo::getAdminLoginPwd);
List<RegUnitInfo> regUnitInfoList = regUnitInfoService.lambdaQuery().select(RegUnitInfo::getUnitCode, RegUnitInfo::getAdminLoginPwd)
.eq(RegUnitInfo::getName, tzBaseEnterpriseInfoDto.getUseUnit()).list();
regUnitInfoList.forEach(info -> System.out.println("unitCode=" + info.getUnitCode() + ", adminLoginPwd=" + info.getAdminLoginPwd()));
return this.baseMapper.pageList(page, tzBaseEnterpriseInfoDto, orgCode, sortMap, officeRegion); return this.baseMapper.pageList(page, tzBaseEnterpriseInfoDto, orgCode, sortMap, officeRegion);
} catch (Exception ex) { } catch (Exception ex) {
String msg = ex.getMessage() == null ? "" : ex.getMessage(); String msg = ex.getMessage() == null ? "" : ex.getMessage();
if (msg.contains("eyibc decrypt error") if (msg.contains("eyibc decrypt error")
|| msg.contains("EYIBCException") || msg.contains("EYIBCException")
|| msg.contains("olym jdbc error") || msg.contains("olym jdbc error")
|| msg.contains("100022:")
|| msg.contains("数据非法") || msg.contains("数据非法")
|| msg.contains("decrypt error, code: -65")) { || msg.contains("decrypt error, code: -65")) {
throw new BadRequest("数据完整性被破坏(解密失败),请联系管理员。"); throw new BadRequest("数据完整性被破坏(解密失败),请联系管理员。");
......
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