Commit 79d0a456 authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents bbd62bcd 40beac68
...@@ -14,7 +14,7 @@ import java.io.Serializable; ...@@ -14,7 +14,7 @@ import java.io.Serializable;
@ApiModel(value = "InspectionEquipInfoModel") @ApiModel(value = "InspectionEquipInfoModel")
public class InspectionEquipInfoModel implements Serializable { public class InspectionEquipInfoModel implements Serializable {
@ApiModelProperty(value = "设备ID") @ApiModelProperty(value = "设备ID或者装置id")
private String record; private String record;
@ApiModelProperty(value = "检验类型(小类)") @ApiModelProperty(value = "检验类型(小类)")
...@@ -23,6 +23,9 @@ public class InspectionEquipInfoModel implements Serializable { ...@@ -23,6 +23,9 @@ public class InspectionEquipInfoModel implements Serializable {
@ApiModelProperty(value = "申请表主键") @ApiModelProperty(value = "申请表主键")
private String appSeq; private String appSeq;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "主题,无需上送,由topic解析出来") @ApiModelProperty(value = "主题,无需上送,由topic解析出来")
private String componentKey; private String componentKey;
} }
...@@ -166,7 +166,7 @@ public class RuleActionHandler { ...@@ -166,7 +166,7 @@ public class RuleActionHandler {
// 所有符合资质的单位code // 所有符合资质的单位code
Set<String> unitCodes = unitLicenceList.stream().map(TzBaseUnitLicence::getUnitCode).collect(Collectors.toSet()); Set<String> unitCodes = unitLicenceList.stream().map(TzBaseUnitLicence::getUnitCode).collect(Collectors.toSet());
// 按照资质 + 开通区域,进行单位的筛选 // 按照资质 + 开通区域,进行单位的筛选
if (unitCodes.size() > 0) { if (!unitCodes.isEmpty()) {
matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(new ArrayList<>(unitCodes), areaCode, openBizType); matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(new ArrayList<>(unitCodes), areaCode, openBizType);
// 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入到主表:true-必须处理,false-可不予受理 // 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入到主表:true-必须处理,false-可不予受理
this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept); this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept);
...@@ -199,7 +199,7 @@ public class RuleActionHandler { ...@@ -199,7 +199,7 @@ public class RuleActionHandler {
Set<String> unitCodes = unitLicenceList.stream().map(TzBaseUnitLicence::getUnitCode).collect(Collectors.toSet()); Set<String> unitCodes = unitLicenceList.stream().map(TzBaseUnitLicence::getUnitCode).collect(Collectors.toSet());
List<TzBaseEnterpriseInfoDto> matchEnterpriseInfos = new ArrayList<>(); List<TzBaseEnterpriseInfoDto> matchEnterpriseInfos = new ArrayList<>();
// 按照资质 + areaCode,进行设备单位的筛选 // 按照资质 + areaCode,进行设备单位的筛选
if (unitCodes.size() > 0) { if (!unitCodes.isEmpty()) {
matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(new ArrayList<>(unitCodes), areaCode, openBizType); matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(new ArrayList<>(unitCodes), areaCode, openBizType);
// 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入到主表:true-必须处理,false-可不予受理 // 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入到主表:true-必须处理,false-可不予受理
this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept); this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept);
...@@ -256,7 +256,7 @@ public class RuleActionHandler { ...@@ -256,7 +256,7 @@ public class RuleActionHandler {
List<String> legalUnitCodes = Arrays.stream(legalInspectionCodes.split(",")).filter(unitCodes::contains).collect(Collectors.toList()); List<String> legalUnitCodes = Arrays.stream(legalInspectionCodes.split(",")).filter(unitCodes::contains).collect(Collectors.toList());
List<TzBaseEnterpriseInfoDto> matchEnterpriseInfos = new ArrayList<>(); List<TzBaseEnterpriseInfoDto> matchEnterpriseInfos = new ArrayList<>();
// 按照资质 + areaCode,进行设备单位的筛选 // 按照资质 + areaCode,进行设备单位的筛选
if (legalUnitCodes.size() > 0) { if (!legalUnitCodes.isEmpty()) {
matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(legalUnitCodes, areaCode, openBizType); matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(legalUnitCodes, areaCode, openBizType);
// 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入 // 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入
this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept); this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept);
...@@ -277,7 +277,7 @@ public class RuleActionHandler { ...@@ -277,7 +277,7 @@ public class RuleActionHandler {
// 所有符合单位的code // 所有符合单位的code
Set<String> unitCodes = unitLicenceList.stream().map(TzBaseUnitLicence::getUnitCode).collect(Collectors.toSet()); Set<String> unitCodes = unitLicenceList.stream().map(TzBaseUnitLicence::getUnitCode).collect(Collectors.toSet());
List<TzBaseEnterpriseInfoDto> matchEnterpriseInfos = new ArrayList<>(); List<TzBaseEnterpriseInfoDto> matchEnterpriseInfos = new ArrayList<>();
if (unitCodes.size() > 0) { if (!unitCodes.isEmpty()) {
matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(new ArrayList<>(unitCodes), areaCode, openBizType); matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(new ArrayList<>(unitCodes), areaCode, openBizType);
// 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入到主表:true-必须处理,false-可不予受理 // 返回下一步是否可不予返回,供下一节点审核时显示判断是否显示不予受理按钮,在提交时数据会写入到主表:true-必须处理,false-可不予受理
this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept); this.setIsCanNoAccept(matchEnterpriseInfos, isCanNoAccept);
......
package com.yeejoin.amos.boot.module.jyjc.biz.event.listener; package com.yeejoin.amos.boot.module.jyjc.biz.event.listener;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil; import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
...@@ -14,8 +15,10 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.TouchRuleEvent; ...@@ -14,8 +15,10 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.TouchRuleEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher; 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.rule.InspectionEquipInfo;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.RuleCommonServiceImpl; 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.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo;
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.RegistrationInfoMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -59,6 +62,8 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In ...@@ -59,6 +62,8 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In
private List<BlockingQueue<InspectionEquipInfoModel>> hashCodeBlockingQueues = new ArrayList<>(); private List<BlockingQueue<InspectionEquipInfoModel>> hashCodeBlockingQueues = new ArrayList<>();
private final IdxBizJgProjectContraptionMapper jgProjectContraptionMapper;
@Value("${rule.data.preparation.thread.number:2}") @Value("${rule.data.preparation.thread.number:2}")
private int threadNumber; private int threadNumber;
...@@ -67,7 +72,7 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In ...@@ -67,7 +72,7 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In
RegistrationInfoMapper registrationInfoMapper, RegistrationInfoMapper registrationInfoMapper,
RuleCommonServiceImpl ruleCommonService, RuleCommonServiceImpl ruleCommonService,
InspectionRuleEnableConfig inspectionRuleEnableConfig, InspectionApplicationPushEventListener applicationPushEventListener, InspectionRuleEnableConfig inspectionRuleEnableConfig, InspectionApplicationPushEventListener applicationPushEventListener,
JyjcInspectionApplicationNoAcceptLogMapper inspectionApplicationNoAcceptLogMapper, EventPublisher publisher) { JyjcInspectionApplicationNoAcceptLogMapper inspectionApplicationNoAcceptLogMapper, EventPublisher publisher, IdxBizJgProjectContraptionMapper jgProjectContraptionMapper) {
this.sequence = sequence; this.sequence = sequence;
this.registrationInfoMapper = registrationInfoMapper; this.registrationInfoMapper = registrationInfoMapper;
this.ruleCommonService = ruleCommonService; this.ruleCommonService = ruleCommonService;
...@@ -75,6 +80,7 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In ...@@ -75,6 +80,7 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In
this.applicationPushEventListener = applicationPushEventListener; this.applicationPushEventListener = applicationPushEventListener;
this.inspectionApplicationNoAcceptLogMapper = inspectionApplicationNoAcceptLogMapper; this.inspectionApplicationNoAcceptLogMapper = inspectionApplicationNoAcceptLogMapper;
this.publisher = publisher; this.publisher = publisher;
this.jgProjectContraptionMapper = jgProjectContraptionMapper;
} }
...@@ -131,7 +137,7 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In ...@@ -131,7 +137,7 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In
inspectionEquipInfo.setBizType(getCategoryByType(JYJCTypeEnum.of(inspectionEquipInfo.getInspectionType()))); inspectionEquipInfo.setBizType(getCategoryByType(JYJCTypeEnum.of(inspectionEquipInfo.getInspectionType())));
inspectionEquipInfo.setUuid(sequence.nextId() + ""); inspectionEquipInfo.setUuid(sequence.nextId() + "");
inspectionEquipInfo.setTechParams(this.getTechParams(registrationInfo)); inspectionEquipInfo.setTechParams(this.getTechParams(registrationInfo));
this.setReginInfo(inspectionEquipInfo, equipInfoModel.getRecord()); this.setReginInfo(inspectionEquipInfo, equipInfoModel);
JyjcInspectionApplicationNoAcceptLog jyjcInspectionApplicationNoAcceptLog = getLastNoAcceptLog(equipInfoModel); JyjcInspectionApplicationNoAcceptLog jyjcInspectionApplicationNoAcceptLog = getLastNoAcceptLog(equipInfoModel);
inspectionEquipInfo.setRequestType(this.buildRequestType(equipInfoModel, jyjcInspectionApplicationNoAcceptLog)); inspectionEquipInfo.setRequestType(this.buildRequestType(equipInfoModel, jyjcInspectionApplicationNoAcceptLog));
inspectionEquipInfo.setLastNoAcceptInspectionCode(this.buildLastNoAcceptInspectionCode(jyjcInspectionApplicationNoAcceptLog)); inspectionEquipInfo.setLastNoAcceptInspectionCode(this.buildLastNoAcceptInspectionCode(jyjcInspectionApplicationNoAcceptLog));
...@@ -150,15 +156,27 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In ...@@ -150,15 +156,27 @@ public class EnableRuleDataPreparationListener implements ApplicationListener<In
* @return true-启用规则,false-不启用 * @return true-启用规则,false-不启用
*/ */
private boolean getEnableConfig(String inspectionType) { private boolean getEnableConfig(String inspectionType) {
return inspectionRuleEnableConfig.getValueByFieldName(inspectionType) == null ? false : (Boolean) inspectionRuleEnableConfig.getValueByFieldName(inspectionType); return inspectionRuleEnableConfig.getValueByFieldName(inspectionType) != null && (Boolean) inspectionRuleEnableConfig.getValueByFieldName(inspectionType);
} }
private void setReginInfo(InspectionEquipInfo inspectionEquipInfo, String record) { private void setReginInfo(InspectionEquipInfo inspectionEquipInfo,InspectionEquipInfoModel equipInfoModel) {
UseInfo useInfo = ruleCommonService.getUseInfo(record); String record = equipInfoModel.getRecord();
// 地市 // 压力管道地点取工程装置数据
inspectionEquipInfo.setAreaCode(ruleCommonService.getArea(useInfo)); if(equipInfoModel.getEquCategory() != null && equipInfoModel.getEquCategory().startsWith("8")) {
// 区县 IdxBizJgProjectContraption projectContraption = jgProjectContraptionMapper.selectById(record);
inspectionEquipInfo.setDistrictOrCountyCode(ruleCommonService.getCounty(useInfo)); // 地市
UseInfo useInfo = new UseInfo();
BeanUtil.copyProperties(projectContraption, useInfo, true);
inspectionEquipInfo.setAreaCode(ruleCommonService.getArea(useInfo));
// 区县
inspectionEquipInfo.setDistrictOrCountyCode(ruleCommonService.getCounty(useInfo));
} else {
UseInfo useInfo = ruleCommonService.getUseInfo(record);
// 地市
inspectionEquipInfo.setAreaCode(ruleCommonService.getArea(useInfo));
// 区县
inspectionEquipInfo.setDistrictOrCountyCode(ruleCommonService.getCounty(useInfo));
}
} }
private String buildLastNoAcceptInspectionCode(JyjcInspectionApplicationNoAcceptLog jyjcInspectionApplicationNoAcceptLog) { private String buildLastNoAcceptInspectionCode(JyjcInspectionApplicationNoAcceptLog jyjcInspectionApplicationNoAcceptLog) {
......
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