Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
7cbce420
Commit
7cbce420
authored
Apr 01, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务作废,设备回归未纳管问题处理,添加log
parent
42443e24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
26 deletions
+55
-26
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+23
-0
CancellationEventListener.java
...dule/jg/biz/event/listener/CancellationEventListener.java
+25
-23
EventPublisher.java
...os/boot/module/jg/biz/event/publisher/EventPublisher.java
+5
-3
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+2
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
7cbce420
...
...
@@ -2353,6 +2353,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and ( a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION
select
...
...
@@ -2363,6 +2364,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION
select
...
...
@@ -2373,6 +2375,7 @@
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.status
<![CDATA[ <> ]]>
'已作废')
UNION
select
...
...
@@ -2383,6 +2386,7 @@
where
a.sequence_nbr = b.enable_disable_apply_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION
select
...
...
@@ -2393,6 +2397,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.notice_status
<![CDATA[ <> ]]>
'6617')
UNION
select
...
...
@@ -2403,6 +2408,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.notice_status
<![CDATA[ <> ]]>
'6617')
UNION
select
...
...
@@ -2413,6 +2419,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.status
<![CDATA[ <> ]]>
'已作废')
UNION
select
...
...
@@ -2423,6 +2430,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.notice_status
<![CDATA[ <> ]]>
'6617')
UNION
select
...
...
@@ -2433,6 +2441,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION
select
...
...
@@ -2443,6 +2452,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and ( a.notice_status
<![CDATA[ <> ]]>
'6617')
UNION
select
...
...
@@ -2453,6 +2463,7 @@
where
a.sequence_nbr = b.vehicle_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.status
<![CDATA[ <> ]]>
'已作废')
UNION
select
...
...
@@ -2463,7 +2474,19 @@
where
a.sequence_nbr = b.unit_change_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.status
<![CDATA[ <> ]]>
'已作废')
UNION
select
count(1) as inUseNumber
from
tzs_jg_certificate_replenish a,
tzs_jg_certificate_replenish_eq b
where
a.sequence_nbr = b.certificate_replenish_id
and b.equ_id = #{record}
and a.is_delete = 0
and (a.apply_status
<![CDATA[ <> ]]>
'6617')
)
</select>
<update
id=
"updateTechParamDynamic"
>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/event/listener/CancellationEventListener.java
View file @
7cbce420
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
event
.
listener
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent
;
...
...
@@ -10,8 +9,6 @@ import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgRegisterInfoServ
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgUseInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -77,28 +74,33 @@ public class CancellationEventListener {
Boolean
inUsed
=
commonService
.
checkEquipIsUsed
(
record
);
// 无引用则进行修改纳管状态为未纳管
if
(!
inUsed
)
{
// 更新已纳管为未纳管 - 数据库
idxBizJgUseInfoService
.
lambdaUpdate
()
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
)
.
set
(
IdxBizJgUseInfo:
:
getIsIntoManagement
,
false
)
.
update
();
log
.
info
(
"进行设备作废处理:{}"
,
record
);
try
{
// 更新已纳管为未纳管 - 数据库
idxBizJgUseInfoService
.
lambdaUpdate
()
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
)
.
set
(
IdxBizJgUseInfo:
:
getIsIntoManagement
,
false
)
.
update
();
// 清除系统自动生成的设备代码`equCode`
boolean
isRegisterUpdated
=
idxBizJgRegisterInfoService
.
lambdaUpdate
()
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
)
.
eq
(
IdxBizJgRegisterInfo:
:
getEquCodeType
,
"2"
)
.
set
(
IdxBizJgRegisterInfo:
:
getEquCode
,
null
)
.
update
();
// 清除系统自动生成的设备代码`equCode`
boolean
isRegisterUpdated
=
idxBizJgRegisterInfoService
.
lambdaUpdate
()
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
)
.
eq
(
IdxBizJgRegisterInfo:
:
getEquCodeType
,
"2"
)
.
set
(
IdxBizJgRegisterInfo:
:
getEquCode
,
null
)
.
update
();
// 同步修改ES数据
Optional
<
ESEquipmentCategoryDto
>
optional
=
esEquipmentCategoryDao
.
findById
(
record
);
optional
.
ifPresent
(
esEquipmentCategoryDto
->
{
esEquipmentCategoryDto
.
setIS_INTO_MANAGEMENT
(
false
);
if
(
isRegisterUpdated
)
{
esEquipmentCategoryDto
.
setEQU_CODE
(
null
);
}
esEquipmentCategoryDao
.
save
(
esEquipmentCategoryDto
);
});
// 同步修改ES数据
Optional
<
ESEquipmentCategoryDto
>
optional
=
esEquipmentCategoryDao
.
findById
(
record
);
optional
.
ifPresent
(
esEquipmentCategoryDto
->
{
esEquipmentCategoryDto
.
setIS_INTO_MANAGEMENT
(
false
);
if
(
isRegisterUpdated
)
{
esEquipmentCategoryDto
.
setEQU_CODE
(
null
);
}
esEquipmentCategoryDao
.
save
(
esEquipmentCategoryDto
);
});
}
catch
(
Exception
e
)
{
log
.
error
(
"设备作废异常:{}"
,
e
.
getMessage
());
}
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/event/publisher/EventPublisher.java
View file @
7cbce420
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.event.publisher;
import
org.springframework.context.ApplicationEvent
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisherAware
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
...
...
@@ -9,11 +10,12 @@ import org.springframework.stereotype.Component;
* @author Administrator
*/
@Component
public
class
EventPublisher
{
public
class
EventPublisher
implements
ApplicationEventPublisherAware
{
private
ApplicationEventPublisher
publisher
;
public
EventPublisher
(
ApplicationEventPublisher
publisher
)
{
this
.
publisher
=
publisher
;
@Override
public
void
setApplicationEventPublisher
(
ApplicationEventPublisher
applicationEventPublisher
)
{
this
.
publisher
=
applicationEventPublisher
;
}
@Async
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
7cbce420
...
...
@@ -95,6 +95,7 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.PostConstruct
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -2153,6 +2154,7 @@ public class CommonServiceImpl implements ICommonService {
@Override
public
Boolean
checkEquipIsUsed
(
String
record
)
{
Integer
useTime
=
commonMapper
.
countEquipInUseTimesWithOutZF
(
record
);
log
.
info
(
"检查设备是否被使用,设备:{},业务数:{}"
,
record
,
useTime
);
return
useTime
>
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment