Commit 8a89354f authored by suhuiguang's avatar suhuiguang

refeat(jyjc): 报检规则4.0开发

1.报检规则联调自测,大型游乐设施AB级过滤
parent af39bcc7
......@@ -361,7 +361,7 @@ public class InspectionApplicationPushEventListener {
equipData.setUseCertFilePath(jgRegisterInfo.getLastUseCertFilePath());
}
// 登记机关
if (equipData.getUseRegistrationCode() != null) {
if (StringUtils.isNotBlank(equipData.getUseRegistrationCode())) {
LambdaQueryWrapper<JgUseRegistrationManage> queryWrapper = new LambdaQueryWrapper<JgUseRegistrationManage>()
.eq(JgUseRegistrationManage::getUseRegistrationCode, equipData.getUseRegistrationCode())
.eq(JgUseRegistrationManage::getIsDelete, 0)
......
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jyjc.biz.event.rule.service;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -20,10 +19,10 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jyjc.biz.rule.InspectionEquipInfo;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.RuleCommonServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
......@@ -52,7 +51,7 @@ public class EnableRuleDataPreparationService {
private final SnowflakeIdUtil sequence;
private final RegistrationInfoMapper registrationInfoMapper;
private final IdxBizJgRegisterInfoMapper registrationInfoMapper;
private final RuleCommonServiceImpl ruleCommonService;
......@@ -138,7 +137,7 @@ public class EnableRuleDataPreparationService {
inspectionEquipInfo.setTechParams(new HashMap<>());
} else {
// 非管道逻辑
RegistrationInfo registrationInfo = fetchRegistrationInfo(equipInfoModel.getRecord());
IdxBizJgRegisterInfo registrationInfo = fetchRegistrationInfo(equipInfoModel.getRecord());
if (registrationInfo == null) {
log.error("未找到设备,报检规则匹配流程结束!");
return;
......@@ -149,6 +148,8 @@ public class EnableRuleDataPreparationService {
inspectionEquipInfo.setTechParams(this.getTechParams(registrationInfo, equipInfoModel));
// 是否球罐 0 1 转 boolean
inspectionEquipInfo.setIsBallValve(!"0".equals(registrationInfo.getWhetherSphericalTank()));
// 标签
inspectionEquipInfo.setEquipTag1(registrationInfo.getTag1());
}
if (PRESSURE_EQU_LIST.contains(equipInfoModel.getEquList())) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(equipInfoModel.getUserId(), equipInfoModel.getToken())).toString(), ReginParams.class);
......@@ -189,7 +190,7 @@ public class EnableRuleDataPreparationService {
}
private Map<String, Object> getTechParams(RegistrationInfo registrationInfo, InspectionEquipInfoModel equipInfoModel) {
private Map<String, Object> getTechParams(IdxBizJgRegisterInfo registrationInfo, InspectionEquipInfoModel equipInfoModel) {
if (NEED_TECH_PARAM_EQU_CATEGORY.contains(equipInfoModel.getEquCategory())) {
return applicationPushEventListener.populateEquipInfoWithTechParams(registrationInfo.getEquList(), registrationInfo.getRecord());
}
......@@ -218,11 +219,16 @@ public class EnableRuleDataPreparationService {
return inspectionApplicationNoAcceptLogMapper.selectOne(wrapper);
}
private RegistrationInfo fetchRegistrationInfo(String record) {
private IdxBizJgRegisterInfo fetchRegistrationInfo(String record) {
return registrationInfoMapper.selectOne(
Wrappers.<RegistrationInfo>lambdaQuery().select(RegistrationInfo::getRecord, RegistrationInfo::getEquCategory,
RegistrationInfo::getEquDefine, RegistrationInfo::getEquList, RegistrationInfo::getWhetherSphericalTank)
.eq(RegistrationInfo::getRecord, record));
new LambdaQueryWrapper<IdxBizJgRegisterInfo>()
.select(IdxBizJgRegisterInfo::getRecord,
IdxBizJgRegisterInfo::getEquCategory,
IdxBizJgRegisterInfo::getEquDefine,
IdxBizJgRegisterInfo::getEquList,
IdxBizJgRegisterInfo::getWhetherSphericalTank,
IdxBizJgRegisterInfo::getTag1)
.eq(IdxBizJgRegisterInfo::getRecord, record));
}
}
......@@ -635,6 +635,11 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
BeanUtil.beanToMap(equip, objectHashMap, false, false);
objectHashMap.put("record", equip.getSEQUENCE_NBR());
objectHashMap.put("ADDRESS", concatDetailAddress(equip));
objectHashMap.forEach((k,v)->{
if(ObjectUtils.isEmpty(v) || "null".equals(v)){
objectHashMap.put(k, "");
}
});
arrayList.add(objectHashMap);
});
return arrayList;
......@@ -1479,6 +1484,10 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
String test = QueryParser.escape(map.getString("USE_INNER_CODE"));
boolMust.must(QueryBuilders.matchPhraseQuery("USE_INNER_CODE", test));
}
// 大型游乐设施时按照设备分类过滤
if(!ObjectUtils.isEmpty(map.getString("tag1")) && EquipmentClassifityEnum.YLSS.getCode().equals(map.getString("EQU_LIST_CODE"))){
boolMust.must(QueryBuilders.termQuery("tag1.keyword", QueryParser.escape(map.getString("tag1"))));
}
this.setFilterOfInFlowing(boolMust, map.getString("EQU_LIST_CODE"), map.getString("inspectionType"), map.getString("EQU_CATEGORY_CODE"));
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
......@@ -1567,7 +1576,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
private Object removeSplitLine(JSONObject item) {
String fullAddress = item.getString("USE_PLACE") + item.getString("ADDRESS");
fullAddress = fullAddress.replace("/", "");
fullAddress = fullAddress.replace("/", "").replace("null", "");
return fullAddress;
}
......
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