Commit 9129ee8f authored by 刘林's avatar 刘林

fix:(监管):去掉重复代码,修改车用气瓶单位变更bug

parent 3a18ed3f
......@@ -22,65 +22,6 @@
</if>
</select>
<select id="countEquipInUseTimesWithOutZFBatch" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
select
sum(inUseNumber) longValue,
record as keyStr
from (
select
count(1) as inUseNumber,
b.equ_id AS record
from
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = ANY(ARRAY[
<foreach collection="records" item="record" separator=",">
#{record}
</foreach>
])
and a.is_delete = 0
and ( a.status <![CDATA[ <> ]]> '已作废')
GROUP BY b.equ_id
UNION ALL
select
count(1) as inUseNumber,
b.equ_id AS record
from
tzs_jg_installation_notice a,
tzs_jg_installation_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = ANY(ARRAY[
<foreach collection="records" item="record" separator=",">
#{record}
</foreach>
])
and a.is_delete = 0
and (a.notice_status <![CDATA[ <> ]]> '6617')
GROUP BY b.equ_id
UNION ALL
select
count(1) as inUseNumber,
b.equ_id AS record
from
tzs_jg_vehicle_information a,
tzs_jg_vehicle_information_eq b
where
a.sequence_nbr = b.vehicle_id
and b.equ_id = ANY(ARRAY[
<foreach collection="records" item="record" separator=",">
#{record}
</foreach>
])
and a.is_delete = 0
and (a.status <![CDATA[ <> ]]> '已作废')
GROUP BY b.equ_id
)
GROUP BY record
</select>
<select id="getUnitInfoListByType" resultType="java.util.Map">
SELECT sequence_nbr AS useCode,
CASE
......
......@@ -874,16 +874,17 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
})
public Map<String, Object> getEquList(String useRegistrationCode) {
HashMap<String, Object> map = new HashMap<>();
// 组件回显
map.put("useRegistrationCode", useRegistrationCode);
JgUseRegistrationManage registrationManage = jgUseRegistrationManageService.lambdaQuery()
.eq(JgUseRegistrationManage::getUseRegistrationCode, useRegistrationCode)
.eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName())
.eq(JgUseRegistrationManage::getIsDelete,0)
.one();
List<JSONObject> jsonObjects = jgUseRegistrationManageService.queryEquByCertificateSeq(registrationManage.getSequenceNbr());
JgUseRegistrationManage registrationManage =
jgUseRegistrationManageService.lambdaQuery()
.eq(JgUseRegistrationManage::getUseRegistrationCode, useRegistrationCode)
.eq(JgUseRegistrationManage::getIsDelete, 0)
.last("LIMIT 1")
.one();
List<JSONObject> jsonObjects = registrationManage == null ? Collections.emptyList():
Optional.ofNullable(jgUseRegistrationManageService.queryEquByCertificateSeq(registrationManage.getSequenceNbr())
).orElse(Collections.emptyList());
if (!ObjectUtils.isEmpty(jsonObjects)) {
// JgVehicleInformation information = jgVehicleInformationService.lambdaQuery().eq(JgVehicleInformation::getUseRegistrationCode, useRegistrationCode).one();
List<String> records = jsonObjects.stream().map(a -> String.valueOf(a.get("SEQUENCE_NBR"))).collect(Collectors.toList());
List<Map<String, Object>> equList = this.getBaseMapper().getEquList(records);
equList.forEach(a -> {
......
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