Commit 8408a007 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_jyjc_rule' into develop_tzs_register

parents f0238b27 5b7148e2
......@@ -1893,7 +1893,7 @@ public class CommonServiceImpl implements ICommonService {
* 设备分类
*
* @param type 1,设备种类 2,设备类别 3,设备品种
* @return
* .c@return
*/
@Override
public List<EquipmentCategory> equipmentClassification(String type) {
......
......@@ -172,7 +172,7 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
private Long countDocumentNum(List<JgBizCountDataBO> countDataBOList, int code, JgBizCountDataDto c) {
return countDataBOList.stream().filter(d -> Objects.equals(d.getReceiveCompanyCode(), c.getReceiveCompanyCode()) &&
Objects.equals(d.getEquList(), c.getEquList()) && Objects.equals(d.getEquCategory(), c.getEquCategory()) &&
Objects.equals(d.getEquCategory(), c.getEquCategory()) &&
Objects.equals(d.getEquDefine(), c.getEquDefine()) &&
Objects.equals(d.getBizType(), c.getBizType()) &&
d.getStatus().equals(String.valueOf(code))).mapToLong(JgBizCountDataBO::getNum).sum();
......@@ -181,7 +181,7 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
private Long countDocumentNum(List<JgBizCountDataBO> countDataBOList, List<String> statusList, JgBizCountDataDto c) {
return countDataBOList.stream().filter(d -> Objects.equals(d.getReceiveCompanyCode(), c.getReceiveCompanyCode()) &&
Objects.equals(d.getEquList(), c.getEquList()) && Objects.equals(d.getEquCategory(), c.getEquCategory()) &&
Objects.equals(d.getEquCategory(), c.getEquCategory()) &&
Objects.equals(d.getEquDefine(), c.getEquDefine()) &&
Objects.equals(d.getBizType(), c.getBizType()) &&
statusList.contains(d.getStatus())).mapToLong(JgBizCountDataBO::getNum).sum();
......
......@@ -217,4 +217,10 @@ public class JyjcInspectionApplication extends BaseEntity {
@TableField(value = "plan_data", typeHandler = JacksonTypeHandler.class)
private JSONObject planData;
/**
* 是否必须处理: true-必须处理,false-可不予受理
*/
@TableField(value = "is_must_accept")
private Boolean isMustAccept;
}
package com.yeejoin.amos.boot.module.jyjc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date;
/**
* @author system_generator
* @date 2024-06-19
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_jyjc_inspection_application_no_accept_log")
public class JyjcInspectionApplicationNoAcceptLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 不予处理的检验检测单位编码
*/
@TableField("inspection_unit_code")
private String inspectionUnitCode;
/**
* 不予处理操作日期
*/
@TableField("no_accept_date")
private Date noAcceptDate;
/**
* 不予处理操作说明
*/
@TableField("remark")
private String remark;
/**
* 操作人
*/
@TableField("no_accept_user_id")
private String noAcceptUserId;
/**
* 报检申请表主键
*/
@TableField("application_seq")
private Long applicationSeq;
}
package com.yeejoin.amos.boot.module.jyjc.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author Administrator
*/
@AllArgsConstructor
@Getter
public enum InspectionCompanyType {
/**
* 检验单位分类
*/
LEGAL("legal","法定"),
THIRD("third","第3方");
private String code;
private String name;
}
package com.yeejoin.amos.boot.module.jyjc.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author Administrator
*/
@AllArgsConstructor
@Getter
public enum RequestTypeEnum {
/**
* 提交的类型
*/
FIRST_REQUEST("firstRequest", "首次的提交"),
NO_ACCEPT_REQUEST("noAcceptRequest", "不予受理的提交");
private String code;
private String name;
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationNoAcceptLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper 接口
*
* @author system_generator
* @date 2024-06-19
*/
public interface JyjcInspectionApplicationNoAcceptLogMapper extends BaseMapper<JyjcInspectionApplicationNoAcceptLog> {
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author LiuLin
* @date 2024年01月02日 16:47
......@@ -18,4 +19,7 @@ public class InspectionEquipInfoModel implements Serializable {
@ApiModelProperty(value = "检验类型(小类)")
private String inspectionType;
@ApiModelProperty(value = "申请表主键")
private String appSeq;
}
......@@ -166,6 +166,11 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty(value = "是否已经进行计划排期")
private Boolean isExistPlanData;
/**
* 是否必须处理: true-必须处理,false-可不予受理
*/
private Boolean isMustAccept;
public String getProcessInstanceId() {
return this.instanceId != null ? this.instanceId : this.processInstanceId;
}
......
package com.yeejoin.amos.boot.module.jyjc.api.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date;
/**
* @author system_generator
* @date 2024-06-19
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "JyjcInspectionApplicationNoAcceptLogModel", description = "")
public class JyjcInspectionApplicationNoAcceptLogModel extends BaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "不予处理的检验检测单位编码")
private String inspectionUnitCode;
@ApiModelProperty(value = "不予处理操作日期")
private Date noAcceptDate;
@ApiModelProperty(value = "不予处理操作说明")
private String remark;
@ApiModelProperty(value = "操作人")
private String noAcceptUserId;
@ApiModelProperty(value = "报检申请表主键")
private Long applicationSeq;
}
package com.yeejoin.amos.boot.module.jyjc.api.service;
/**
* 接口类
*
* @author system_generator
* @date 2024-06-19
*/
public interface IJyjcInspectionApplicationNoAcceptLogService {}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationNoAcceptLogMapper">
</mapper>
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationMode
import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionApplicationPushEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,17 +38,25 @@ import java.util.Map;
public class JyjcInspectionApplicationController extends BaseController {
@Autowired
JyjcInspectionApplicationServiceImpl jyjcInspectionApplicationServiceImpl;
private JyjcInspectionApplicationServiceImpl jyjcInspectionApplicationServiceImpl;
// 业务通用发起——基本信息
private static final String basic = "basic";
// 业务通用发起——设备信息
private static final String equipPageInfo = "equipPageInfo";
// 业务通用发起——技术参数-
private static final String filePageData = "filePageData";
/**
* 业务通用发起——基本信息
*/
private static final String BASIC = "basic";
/**
* 业务通用发起——设备信息
*/
private static final String EQUIP_PAGE_INFO = "equipPageInfo";
/**
* 业务通用发起——技术参数
*/
private static final String FILE_PAGE_DATA = "filePageData";
@Autowired
EventPublisher eventPublisher;
private EventPublisher eventPublisher;
/**
* 新增
......@@ -58,11 +67,11 @@ public class JyjcInspectionApplicationController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "暂存、提交", notes = "新增")
public ResponseModel<List<JyjcInspectionApplicationModel>> save(@RequestBody JSONObject model) {
if (model.containsKey(basic)) {
if (model.containsKey(BASIC)) {
JSONObject finallyJson = new JSONObject();
Map<String, Object> basicObj = (Map<String, Object>) model.get(basic);
Map<String, Object> equipPageInfoObj = (Map<String, Object>) model.get(equipPageInfo);
Map<String, Object> filePageDataObj = (Map<String, Object>) model.get(filePageData);
Map<String, Object> basicObj = (Map<String, Object>) model.get(BASIC);
Map<String, Object> equipPageInfoObj = (Map<String, Object>) model.get(EQUIP_PAGE_INFO);
Map<String, Object> filePageDataObj = (Map<String, Object>) model.get(FILE_PAGE_DATA);
finallyJson.putAll(model);
finallyJson.putAll(basicObj);
finallyJson.putAll(equipPageInfoObj);
......@@ -121,7 +130,7 @@ public class JyjcInspectionApplicationController extends BaseController {
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<Map<String, Object>> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.selectBySeq(sequenceNbr));
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.selectBySeq(sequenceNbr, getSelectedOrgInfo().getCompany().getCompanyType()));
}
......@@ -188,6 +197,21 @@ public class JyjcInspectionApplicationController extends BaseController {
}
/**
* 不予受理接口(监督检验、定(首)检、检测)-通用
*
* @param params params
* @return {@link }
* @author shg
* @date 2023/12/15 13:44
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "不予受理", notes = "不予受理")
@PostMapping(value = "/flow/noAccept")
public ResponseModel<Boolean> doNoAcceptFlow(@RequestBody Map<String, Object> params) {
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.doNoAccept(params));
}
/**
* 撤回接口(监督检验、定(首)检、检测)-通用
*
* @param sequenceNbr sequenceNbr
......@@ -238,4 +262,16 @@ public class JyjcInspectionApplicationController extends BaseController {
JSONObject jsonObject = new JSONObject(map);
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.queryForEquipmentRegisterPage(jsonObject));
}
/**
* 查询检验检测机构列表(基本信息及联系人)-工作台专用
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/workbench/getInspectionUnitList")
@ApiOperation(httpMethod = "GET", value = "查询检验检测机构列表所有已注册开通的", notes = "查询检验检测机构列表所有已注册开通的")
public ResponseModel<List<TzBaseEnterpriseInfoDto>> getInspectionUnitListForWorkbench(@RequestParam String openBizType) {
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.getInspectionUnitListForWorkbench(openBizType));
}
}
......@@ -204,7 +204,7 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
equipData.setTechParams(this.populateEquipInfoWithTechParams(equipData.getEquList(), equipUnicode));
}
private Map<String, Object> populateEquipInfoWithTechParams(String equList, String record) {
public Map<String, Object> populateEquipInfoWithTechParams(String equList, String record) {
EquipCategoryEnum productType = EquipCategoryEnum.of(Integer.parseInt(equList));
Map<String, Object> echParamMap = new HashMap<>();
switch (Objects.requireNonNull(productType)) {
......
package com.yeejoin.amos.boot.module.jyjc.biz.listener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationNoAcceptLog;
import com.yeejoin.amos.boot.module.jyjc.api.enums.JYJCTypeEnum;
import com.yeejoin.amos.boot.module.jyjc.api.enums.RequestTypeEnum;
import com.yeejoin.amos.boot.module.jyjc.api.enums.TopicEnum;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationNoAcceptLogMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.InspectionEquipInfoModel;
import com.yeejoin.amos.boot.module.jyjc.biz.event.listener.InspectionApplicationPushEventListener;
import com.yeejoin.amos.boot.module.jyjc.biz.listener.message.BizMessage;
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.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.rule.Rule;
import com.yeejoin.amos.feign.rule.model.FactBaseModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -27,6 +35,7 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
......@@ -45,23 +54,36 @@ public class InspectionOrgRefreshListener extends EmqxListener {
@Value("${inspection.rule.project-name:报检规则}")
private String ruleName;
@Autowired
private EmqKeeper emqKeeper;
@Autowired
private RuleTrigger ruleTrigger;
@Autowired
private AmosRequestContext amosRequestContext;
@Autowired
private RegistrationInfoMapper registrationInfoMapper;
@Autowired
private JyjcInspectionApplicationNoAcceptLogMapper inspectionApplicationNoAcceptLogMapper;
@Autowired
InspectionApplicationPushEventListener applicationPushEventListener;
@Value("${spring.application.name}")
private String applicationName;
private static final int repeatTime = 2;
@Autowired
Sequence sequence;
private static final int REPEAT_TIME = 2;
@Autowired
RedisUtils redisUtils;
@Autowired
RuleCommonServiceImpl ruleCommonService;
@Override
public void processMessage(String topic, MqttMessage message) {
if (log.isInfoEnabled()) {
......@@ -86,10 +108,10 @@ public class InspectionOrgRefreshListener extends EmqxListener {
BizMessage bizMessage = BLOCKING_QUEUE.take();
// 解决前端组件在属性变化时重复发送两次问题
if (!redisUtils.hasKey(bizMessage.getTopic())) {
redisUtils.set(bizMessage.getTopic(), true, repeatTime);
redisUtils.set(bizMessage.getTopic(), true, REPEAT_TIME);
processBizMessage(bizMessage);
} else {
log.warn("消息在{}秒内重复,", repeatTime);
log.warn("消息在{}秒内重复,", REPEAT_TIME);
}
} catch (Exception e) {
log.error("数据处理失败", e);
......@@ -99,7 +121,6 @@ public class InspectionOrgRefreshListener extends EmqxListener {
private void processBizMessage(BizMessage bizMessage) {
byte[] payload = bizMessage.getMessage().getPayload();
InspectionEquipInfoModel equipInfoModel = parseObject(new String(payload, StandardCharsets.UTF_8), InspectionEquipInfoModel.class);
RegistrationInfo registrationInfo = fetchRegistrationInfo(equipInfoModel.getRecord());
InspectionEquipInfo inspectionEquipInfo = new InspectionEquipInfo();
......@@ -114,30 +135,64 @@ public class InspectionOrgRefreshListener extends EmqxListener {
inspectionEquipInfo.setInspectionType(equipInfoModel.getInspectionType());
inspectionEquipInfo.setRecord(equipInfoModel.getRecord());
inspectionEquipInfo.setBizType(getCategoryByType(JYJCTypeEnum.of(inspectionEquipInfo.getInspectionType())));
inspectionEquipInfo.setUuid(sequence.nextId() + "");
inspectionEquipInfo.setTechParams(this.getTechParams(registrationInfo));
this.setReginInfo(inspectionEquipInfo, equipInfoModel.getRecord());
JyjcInspectionApplicationNoAcceptLog jyjcInspectionApplicationNoAcceptLog = getLastNoAcceptLog(equipInfoModel);
inspectionEquipInfo.setRequestType(this.buildRequestType(equipInfoModel, jyjcInspectionApplicationNoAcceptLog));
inspectionEquipInfo.setLastNoAcceptInspectionCode(this.buildLastNoAcceptInspectionCode(jyjcInspectionApplicationNoAcceptLog));
// 是否球罐 0 1 转 boolean
inspectionEquipInfo.setIsBallValve(!"0".equals(registrationInfo.getWhetherSphericalTank()));
touchRuleWithApi(inspectionEquipInfo);
}
private RegistrationInfo fetchRegistrationInfo(String record) {
return registrationInfoMapper.selectOne(
Wrappers.<RegistrationInfo>lambdaQuery().select(RegistrationInfo::getRecord, RegistrationInfo::getEquCategory,
RegistrationInfo::getEquDefine, RegistrationInfo::getEquList)
.eq(RegistrationInfo::getRecord, record));
private void setReginInfo(InspectionEquipInfo inspectionEquipInfo, String record) {
UseInfo useInfo = ruleCommonService.getUseInfo(record);
// 地市
inspectionEquipInfo.setAreaCode(ruleCommonService.getArea(useInfo));
// 区县
inspectionEquipInfo.setDistrictOrCountyCode(ruleCommonService.getCounty(useInfo));
}
private void touchRuleWithMsg(InspectionEquipInfo inspectionEquipInfo) {
if (log.isInfoEnabled()) {
log.info("发送规则的消息对象:{}", toJSONString(inspectionEquipInfo));
private String buildLastNoAcceptInspectionCode(JyjcInspectionApplicationNoAcceptLog jyjcInspectionApplicationNoAcceptLog) {
if (jyjcInspectionApplicationNoAcceptLog != null) {
return jyjcInspectionApplicationNoAcceptLog.getInspectionUnitCode();
}
return "";
}
RequestContext.setToken(amosRequestContext.getToken());
RequestContext.setAppKey(amosRequestContext.getAppKey());
RequestContext.setProduct(amosRequestContext.getProduct());
// 2.调用规则
try {
ruleTrigger.publish(inspectionEquipInfo, ruleName + "/" + inspectionEquipInfo.getBizType(), null);
} catch (Exception e) {
log.error("调用规则触发获取报检规则失败", e);
private Map<String, Object> getTechParams(RegistrationInfo registrationInfo) {
return applicationPushEventListener.populateEquipInfoWithTechParams(registrationInfo.getEquList(), registrationInfo.getRecord());
}
private String buildRequestType(InspectionEquipInfoModel equipInfoModel, JyjcInspectionApplicationNoAcceptLog jyjcInspectionApplicationNoAcceptLog) {
// 工作台发起申请
if (StringUtils.isEmpty(equipInfoModel.getAppSeq())) {
return RequestTypeEnum.FIRST_REQUEST.getCode();
}
// 没有不予受理请求记录
if (jyjcInspectionApplicationNoAcceptLog == null) {
return RequestTypeEnum.FIRST_REQUEST.getCode();
}
// 有记录
return RequestTypeEnum.NO_ACCEPT_REQUEST.getCode();
}
private JyjcInspectionApplicationNoAcceptLog getLastNoAcceptLog(InspectionEquipInfoModel equipInfoModel) {
LambdaQueryWrapper<JyjcInspectionApplicationNoAcceptLog> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JyjcInspectionApplicationNoAcceptLog::getApplicationSeq, equipInfoModel.getAppSeq());
wrapper.orderByDesc(JyjcInspectionApplicationNoAcceptLog::getRecDate);
wrapper.last("limit 1");
wrapper.select(JyjcInspectionApplicationNoAcceptLog::getApplicationSeq, JyjcInspectionApplicationNoAcceptLog::getInspectionUnitCode);
return inspectionApplicationNoAcceptLogMapper.selectOne(wrapper);
}
private RegistrationInfo fetchRegistrationInfo(String record) {
return registrationInfoMapper.selectOne(
Wrappers.<RegistrationInfo>lambdaQuery().select(RegistrationInfo::getRecord, RegistrationInfo::getEquCategory,
RegistrationInfo::getEquDefine, RegistrationInfo::getEquList, RegistrationInfo::getWhetherSphericalTank)
.eq(RegistrationInfo::getRecord, record));
}
private void touchRuleWithApi(InspectionEquipInfo inspectionEquipInfo) {
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jyjc.biz.rule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
......@@ -40,4 +41,23 @@ public class InspectionEquipInfo implements Serializable {
@ApiModelProperty(value = "检验类型(小类)")
private String inspectionType;
@ApiModelProperty(value = "请求类型:firstRequest-首次的提交,noAcceptRequest-不予受理的提交")
private String requestType;
@ApiModelProperty(value = "消息唯一标识用来判断消息重复")
private String uuid;
@ApiModelProperty(value = "最近不受理检验机构code")
private String lastNoAcceptInspectionCode;
@ApiModelProperty(value = "所在区域")
private String areaCode;
@ApiModelProperty(value = "设备所在区/县行政编码")
private String districtOrCountyCode;
@ApiModelProperty(value = "是否是球阀,压力容器定向规则使用")
private Boolean isBallValve = false;
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationNoAcceptLog;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationNoAcceptLogMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionApplicationNoAcceptLogService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationNoAcceptLogModel;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 服务实现类
*
* @author system_generator
* @date 2024-06-19
*/
@Service
public class JyjcInspectionApplicationNoAcceptLogServiceImpl extends BaseService<JyjcInspectionApplicationNoAcceptLogModel,JyjcInspectionApplicationNoAcceptLog,JyjcInspectionApplicationNoAcceptLogMapper> implements IJyjcInspectionApplicationNoAcceptLogService {
/**
* 分页查询
*/
public Page<JyjcInspectionApplicationNoAcceptLogModel> queryForJyjcInspectionApplicationNoAcceptLogPage(Page<JyjcInspectionApplicationNoAcceptLogModel> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JyjcInspectionApplicationNoAcceptLogModel> queryForJyjcInspectionApplicationNoAcceptLogList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseUnitLicence;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
......@@ -130,6 +131,12 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
@Autowired
RedissonClient redissonClient;
@Autowired
private RuleCommonServiceImpl ruleCommonService;
@Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
private static Map<String, DictionarieValueModel> permissionLevelMap;
private static List<DictionarieValueModel> permissionItemList;
......@@ -902,7 +909,24 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
@Override
public List<TzBaseEnterpriseInfoDto> getUnitListByRecord(String record) {
return ruleActionHandler.getInspectionUnitList(new ArrayList<>(), true, record, OpenBizTypeEnum.JC.getCode());
return this.getInspectionUnitList(new ArrayList<>(), true, record, OpenBizTypeEnum.JC.getCode());
}
private List<TzBaseEnterpriseInfoDto> getInspectionUnitList(List<TzBaseUnitLicence> unitLicenceList, Boolean isMatchArea, String record, String openBizType) {
// 是否进行属地过滤
String areaCode = isMatchArea ? ruleCommonService.getArea(record) : "";
// 所有符合单位的code
Set<String> unitCodes = unitLicenceList.stream().map(TzBaseUnitLicence::getUnitCode).collect(Collectors.toSet());
List<TzBaseEnterpriseInfoDto> matchEnterpriseInfos = new ArrayList<>();
// 按照资质 + areaCode,进行设备单位的筛选
if (unitCodes.size() > 0) {
matchEnterpriseInfos = tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(new ArrayList<>(unitCodes), areaCode, openBizType);
}
if (matchEnterpriseInfos.isEmpty()) {
log.info("按照资质、区域未匹配到对应的单位、按照地市未匹配到单位,将返回全部单位");
return tzBaseEnterpriseInfoMapper.getInspectionUnitListByCode(null, null, openBizType);
}
return matchEnterpriseInfos;
}
/**
......
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sun.org.apache.regexp.internal.RE;
import com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import java.util.Arrays;
/**
* @author Administrator
*/
@Component
public class RuleCommonServiceImpl {
private UseInfoMapper useInfoMapper;
/**
* 特殊独立的区县
*/
private static final String[] EXCLUSION_CITY_REGIONS = {"610403", "610581"};
public RuleCommonServiceImpl(UseInfoMapper useInfoMapper) {
this.useInfoMapper = useInfoMapper;
}
public String getArea(String record) {
UseInfo equipUseInfo = useInfoMapper.selectOne(Wrappers.<UseInfo>lambdaQuery().select(UseInfo::getCity, UseInfo::getCounty).eq(UseInfo::getRecord, record));
if (equipUseInfo == null) {
return "";
}
// 特殊地区特殊处理,目前有韩城、杨凌,原因行政区划上是有层级的,但是业务办理时,他们与所在地市是同级别的
if (StringUtils.isEmpty(equipUseInfo.getCity()) || StringUtils.isEmpty(equipUseInfo.getCounty())) {
return "";
}
if (Arrays.asList(EXCLUSION_CITY_REGIONS).contains(equipUseInfo.getCounty())) {
return equipUseInfo.getCounty();
}
return equipUseInfo.getCity();
}
public UseInfo getUseInfo(String record) {
return useInfoMapper.selectOne(Wrappers.<UseInfo>lambdaQuery().select(UseInfo::getCity, UseInfo::getCounty).eq(UseInfo::getRecord, record));
}
public String getArea(UseInfo equipUseInfo) {
if (equipUseInfo == null) {
return "";
}
// 特殊地区特殊处理,目前有韩城、杨凌,原因行政区划上是有层级的,但是业务办理时,他们与所在地市是同级别的
if (StringUtils.isEmpty(equipUseInfo.getCity()) || StringUtils.isEmpty(equipUseInfo.getCounty())) {
return "";
}
if (Arrays.asList(EXCLUSION_CITY_REGIONS).contains(equipUseInfo.getCounty())) {
return equipUseInfo.getCounty();
}
return equipUseInfo.getCity();
}
public String getCounty(UseInfo equipUseInfo) {
if (equipUseInfo == null) {
return "";
}
return equipUseInfo.getCounty();
}
}
......@@ -37,8 +37,8 @@ spring.security.user.name=admin
spring.security.user.password=a1234560
spring.security.user.roles=SBA_ADMIN
amos.system.user.user-name=robot_admin
amos.system.user.password=a1234567
amos.system.user.user-name=tzs_shg
amos.system.user.password=a1234560
amos.system.user.app-key=AMOS_STUDIO
amos.system.user.product=AMOS_STUDIO_WEB
......
......@@ -185,4 +185,13 @@ public class RegistrationInfo extends AbstractEquipBaseEntity {
@TableField("\"LAST_USE_CERT_FILE_PATH\"")
private String lastUseCertFilePath;
/**
* 是否球罐
* 1:是
* 0:不是
*/
@TableField("\"WHETHER_SPHERICAL_TANK\"")
private String whetherSphericalTank;
}
......@@ -43,7 +43,12 @@ public enum FlowStatusEnum {
/**
* 已作废
*/
TO_BE_DISCARD(6617, "已作废");
TO_BE_DISCARD(6617, "已作废"),
/**
* 不予受理
*/
NO_ACCEPT(6618, "不予受理");
private final int code;
......
......@@ -5,8 +5,8 @@
resultType="com.yeejoin.amos.boot.module.ymt.api.entity.EquipTechParamBoiler">
select
"DEVICE_LEVEL",
"RATED_EVAPORATION_CAPACITY_THERMAL_POWER",
"RATED_WORKING_PRESSURE",
COALESCE("RATED_EVAPORATION_CAPACITY_THERMAL_POWER", 0) as RATED_EVAPORATION_CAPACITY_THERMAL_POWER,
COALESCE("RATED_WORKING_PRESSURE", 0) as RATED_WORKING_PRESSURE,
"RATED_OPERATING_TEMPERATURE",
"DESIGN_THERMAL_EFFICIENCY",
"FEEDWATER_TEMPERATURE",
......
......@@ -3,17 +3,17 @@
<mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamRidesMapper">
<select id="queryTechParamInUse" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.EquipTechParamRides">
SELECT
"TRACK_HEIGHT",
"RUNNING_SPEED",
"NUMBER_OF_PASSENGERS",
"SLIDE_LENGTH",
COALESCE("TRACK_HEIGHT", 0) as TRACK_HEIGHT,
COALESCE("RUNNING_SPEED", 0) as RUNNING_SPEED,
COALESCE("NUMBER_OF_PASSENGERS", 0) as NUMBER_OF_PASSENGERS,
COALESCE("SLIDE_LENGTH", 0) as SLIDE_LENGTH,
"NUMBER_OF_VEHICLES",
"OPERATING_HEIGHT",
"ROTARY_DIAMETER",
COALESCE("OPERATING_HEIGHT", 0) as OPERATING_HEIGHT,
COALESCE("ROTARY_DIAMETER", 0) as ROTARY_DIAMETER,
"UNILATERAL_SWING_ANGLE",
"DIP",
COALESCE("DIP", 0) as DIP,
"SLEWING_SPEED",
"EQUIPMENT_HEIGHT"
COALESCE("EQUIPMENT_HEIGHT", 0) as EQUIPMENT_HEIGHT
FROM
idx_biz_jg_tech_params_rides
WHERE RECORD = #{record}
......
......@@ -33,7 +33,7 @@
heat_treatment_method,
qp_heat_treatment_temperature,
installation_position,
container_volume,
COALESCE(container_volume, 0) as container_volume,
pressure_vessel_diameter,
height,
material_cylinder_shell,
......
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