Commit 9700e7e7 authored by suhuiguang's avatar suhuiguang

生产bug:

1.使用登记气瓶详情接口慢问题,查询由单次查询调整为匹配查询,原有好本次不行是因为判断后续业务时,增加了更名变更登记,存储的为json
parent f1d203b0
......@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jg.api.bo.JgBizCountDataBO;
......@@ -241,10 +242,10 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
/**
* 查询指定设备,使用登记后,后续业务的数据
*
* @param record 设备标识
* @param equipTransferId 使用登记主表id
* @return 后续业务数量
*/
Integer countBizNumAfterUseReg(@Param("record") String record);
Long countBizNumAfterUseReg(@Param("equipTransferId") String equipTransferId);
/**
* 车用气瓶-使用登记证编号全库唯一校验
......
......@@ -2461,7 +2461,7 @@
where record = #{record}
</if>
</update>
<select id="countBizNumAfterUseReg" resultType="java.lang.Integer">
<select id="countBizNumAfterUseReg" resultType="java.lang.Long">
select
sum(inUseNumber)
from (
......@@ -2472,7 +2472,7 @@
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and b.equ_id in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION all
select
......@@ -2482,7 +2482,7 @@
tzs_jg_change_registration_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and b.equ_id in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION all
select
......@@ -2492,7 +2492,7 @@
tzs_jg_change_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and b.equ_id in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '已作废')
UNION all
select
......@@ -2502,7 +2502,7 @@
tzs_jg_scrap_cancel_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and b.equ_id in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION all
select
......@@ -2517,7 +2517,7 @@
n.sequence_nbr = e.name_change_registration_id
and n.audit_status <![CDATA[ <> ]]> '使用单位待提交' and n.audit_status <![CDATA[ <> ]]> '已作废') ne
where
ne.record = #{record}
ne.record in (SELECT equ_id FROM "amos_tzs_biz"."tzs_jg_use_registration_eq" WHERE "equip_transfer_id" = #{equipTransferId})
)
</select>
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
......@@ -41,22 +42,12 @@ public class FillingUseRegisterResult extends BaseUseRegisterResultData {
*/
private void fillingEditPermission(JSONObject jsonObject) {
jsonObject.put(HAPPEN_AFTER_BIZ, false);
List<JgUseRegistrationEq> useRegistrationEqs = getJgUseRegistrationEqService().list(new LambdaQueryWrapper<JgUseRegistrationEq>()
.eq(JgUseRegistrationEq::getEquipTransferId, userRegisterId)
.select(JgUseRegistrationEq::getEquId, BaseEntity::getSequenceNbr));
for (JgUseRegistrationEq useRegistrationEq : useRegistrationEqs) {
Integer useTimes = getCommonMapper().countBizNumAfterUseReg(useRegistrationEq.getEquId());
Long useTimes = getCommonMapper().countBizNumAfterUseReg(userRegisterId + "");
if (useTimes > 0) {
log.warn("设备:{}做过后续业务, 此使用登记:{}不可再变更设备信息", useRegistrationEq.getEquId(), userRegisterId);
log.warn("此使用登记:{},存在设备做过后续业务,不可再变更设备信息", userRegisterId);
jsonObject.put(HAPPEN_AFTER_BIZ, true);
break;
}
}
}
private JgUseRegistrationEqServiceImpl getJgUseRegistrationEqService() {
return applicationContext.getBean(JgUseRegistrationEqServiceImpl.class);
}
private CommonMapper getCommonMapper() {
return applicationContext.getBean(CommonMapper.class);
......
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