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
9a5617fb
Commit
9a5617fb
authored
May 22, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):设备履历信息修改
parent
e14724af
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
36 deletions
+102
-36
ChangeEquipImpactCertListener.java
...iz/edit/event/listener/ChangeEquipImpactCertListener.java
+82
-21
ChangeLogInsertListener.java
...e/jg/biz/edit/event/listener/ChangeLogInsertListener.java
+16
-15
JgBizChangeLogServiceImpl.java
...module/jg/biz/service/impl/JgBizChangeLogServiceImpl.java
+4
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/event/listener/ChangeEquipImpactCertListener.java
View file @
9a5617fb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
event
.
listener
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
edit
.
event
.
listener
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.jg.api.converter.EquDefineConverter
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq
;
...
@@ -11,9 +14,12 @@ import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeEqSe
...
@@ -11,9 +14,12 @@ import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeEqSe
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationManageServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationManageServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -28,6 +34,7 @@ import java.util.stream.Collectors;
...
@@ -28,6 +34,7 @@ import java.util.stream.Collectors;
import
java.util.stream.IntStream
;
import
java.util.stream.IntStream
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationManageServiceImpl
.*;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationManageServiceImpl
.*;
import
static
org
.
apache
.
commons
.
lang3
.
StringUtils
.
defaultString
;
@Component
@Component
@Slf4j
@Slf4j
...
@@ -43,6 +50,7 @@ public class ChangeEquipImpactCertListener {
...
@@ -43,6 +50,7 @@ public class ChangeEquipImpactCertListener {
private
final
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
private
final
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
private
final
IdxBizJgProjectContraptionServiceImpl
jgProjectContraptionService
;
private
final
IdxBizJgProjectContraptionServiceImpl
jgProjectContraptionService
;
private
final
JgInstallationNoticeEqServiceImpl
jgInstallationNoticeEqService
;
private
final
JgInstallationNoticeEqServiceImpl
jgInstallationNoticeEqService
;
private
final
IdxBizJgUseInfoMapper
useInfoMapper
;
/**
/**
* 事件监听:只把事件放入队列
* 事件监听:只把事件放入队列
...
@@ -75,36 +83,93 @@ public class ChangeEquipImpactCertListener {
...
@@ -75,36 +83,93 @@ public class ChangeEquipImpactCertListener {
/**
/**
* 根据 bizType 路由处理逻辑
* 根据 bizType 路由处理逻辑
*/
*/
private
JSONObject
handleFieldChange
(
List
<
FieldChangeMeta
>
fieldChangeMetaList
,
JSONObject
certificatePrintTag
)
{
private
void
handleFieldChange
(
List
<
FieldChangeMeta
>
fieldChangeMetaList
,
JgUseRegistrationManage
manage
)
{
Set
<
String
>
keysToJson
=
fieldChangeMetaList
.
stream
()
JSONObject
certificatePrintTag
=
Optional
.
ofNullable
(
manage
.
getCertificatePrintTag
())
.
filter
(
v
->
ChangeFieldWatchConstants
.
isWatched
(
v
.
getColumnKey
()))
.
map
(
JSONObject:
:
parseObject
)
.
peek
(
v
->
log
.
info
(
"字段 [{}] 是影响字段"
,
v
.
getColumnKey
()))
.
orElse
(
new
JSONObject
());
.
flatMap
(
v
->
ChangeFieldWatchConstants
.
getMatchedCategories
(
v
.
getColumnKey
()).
stream
())
Set
<
String
>
keysToJson
=
new
HashSet
<>();
.
flatMap
(
category
->
{
for
(
FieldChangeMeta
meta
:
fieldChangeMetaList
)
{
String
columnKey
=
meta
.
getColumnKey
();
if
(!
ChangeFieldWatchConstants
.
isWatched
(
columnKey
))
{
continue
;
}
log
.
info
(
"字段 [{}] 是影响字段"
,
columnKey
);
for
(
String
category
:
ChangeFieldWatchConstants
.
getMatchedCategories
(
columnKey
))
{
switch
(
category
)
{
switch
(
category
)
{
case
"USE_CERT"
:
case
"USE_CERT"
:
return
Stream
.
of
(
CERTIFICATE_NORMAL
,
CERTIFICATE_NESTED
);
this
.
updateUseCertField
(
manage
,
meta
);
keysToJson
.
addAll
(
Arrays
.
asList
(
"CERTIFICATE_NORMAL"
,
"CERTIFICATE_NESTED"
));
break
;
case
"USE_FLAG"
:
case
"USE_FLAG"
:
case
"USE_FLAG_VEHICLE"
:
case
"USE_FLAG_VEHICLE"
:
return
Stream
.
of
(
USE_FLAG_NORMAL
,
USE_FLAG_NESTED
);
keysToJson
.
addAll
(
Arrays
.
asList
(
"USE_FLAG_NORMAL"
,
"USE_FLAG_NESTED"
));
break
;
case
"PIPELINE_SUMMARY"
:
case
"PIPELINE_SUMMARY"
:
case
"NOTICE"
:
case
"NOTICE"
:
return
Stream
.
of
(
EXPORT_SUMMARY_TABLE
);
keysToJson
.
add
(
"EXPORT_SUMMARY_TABLE"
);
break
;
case
"USE_CYLINDER_SUMMARY"
:
case
"USE_CYLINDER_SUMMARY"
:
return
Stream
.
of
(
CERTIFICATE_NORMAL
);
keysToJson
.
add
(
"CERTIFICATE_NORMAL"
);
break
;
default
:
default
:
log
.
warn
(
"未知分类字段:[{}]"
,
category
);
log
.
warn
(
"未知分类字段:[{}]"
,
category
);
return
Stream
.
empty
();
}
}
})
}
.
collect
(
Collectors
.
toSet
());
}
keysToJson
.
forEach
(
key
->
{
for
(
String
key
:
keysToJson
)
{
Object
value
=
certificatePrintTag
.
get
(
key
);
Object
value
=
certificatePrintTag
.
get
(
key
);
if
(
value
instanceof
Number
&&
((
Number
)
value
).
intValue
()
==
2
)
{
if
(
value
instanceof
Number
&&
((
Number
)
value
).
intValue
()
==
2
)
{
certificatePrintTag
.
put
(
key
,
1
);
certificatePrintTag
.
put
(
key
,
1
);
}
}
});
}
return
certificatePrintTag
;
manage
.
setCertificatePrintTag
(
JSONObject
.
toJSONString
(
certificatePrintTag
));
jgUseRegistrationManageService
.
updateById
(
manage
);
}
private
void
updateUseCertField
(
JgUseRegistrationManage
manage
,
FieldChangeMeta
meta
)
{
String
columnKey
=
meta
.
getColumnKey
();
String
afterValue
=
Objects
.
toString
(
meta
.
getColumnNewValue
(),
null
);
if
(
StringUtils
.
isBlank
(
afterValue
))
{
return
;
}
switch
(
columnKey
)
{
case
"equDefine"
:
manage
.
setEquDefineCode
(
afterValue
);
manage
.
setEquDefine
(
EquDefineConverter
.
getKeyByValue
(
afterValue
));
break
;
case
"useOrgCode"
:
manage
.
setUseRegistrationCode
(
afterValue
);
break
;
case
"city"
:
case
"county"
:
case
"street"
:
case
"address"
:
if
(!
"unit"
.
equals
(
manage
.
getManageType
()))
{
updateEquUseAddressByChangeId
(
manage
,
meta
.
getChangeId
());
}
break
;
default
:
log
.
warn
(
"未处理的USE_CERT字段:[{}]"
,
columnKey
);
break
;
}
}
private
void
updateEquUseAddressByChangeId
(
JgUseRegistrationManage
manage
,
Object
changeId
)
{
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgUseInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
String
.
valueOf
(
changeId
));
IdxBizJgUseInfo
useInfo
=
useInfoMapper
.
selectOne
(
lambda
);
if
(
useInfo
!=
null
)
{
String
fullAddress
=
String
.
join
(
""
,
defaultString
(
useInfo
.
getProvinceName
()),
defaultString
(
useInfo
.
getCityName
()),
defaultString
(
useInfo
.
getCountyName
()),
defaultString
(
useInfo
.
getStreetName
()),
defaultString
(
useInfo
.
getAddress
())
);
manage
.
setEquUseAddress
(
fullAddress
);
}
else
{
log
.
warn
(
"未找到对应的使用信息记录,ChangeId: {}"
,
changeId
);
}
}
}
/**
/**
...
@@ -164,11 +229,7 @@ public class ChangeEquipImpactCertListener {
...
@@ -164,11 +229,7 @@ public class ChangeEquipImpactCertListener {
.
eq
(
JgUseRegistrationManage:
:
getApplyNo
,
event
.
getBizRelationData
().
getBizId
())
.
eq
(
JgUseRegistrationManage:
:
getApplyNo
,
event
.
getBizRelationData
().
getBizId
())
.
eq
(
JgUseRegistrationManage:
:
getIsDelete
,
0
)
.
eq
(
JgUseRegistrationManage:
:
getIsDelete
,
0
)
.
one
();
.
one
();
JSONObject
certificatePrintTag
=
Optional
.
ofNullable
(
jgUseRegistrationManage
.
getCertificatePrintTag
())
this
.
handleFieldChange
(
event
.
getData
(),
jgUseRegistrationManage
);
.
map
(
JSONObject:
:
parseObject
).
orElse
(
new
JSONObject
());
JSONObject
tagJson
=
this
.
handleFieldChange
(
event
.
getData
(),
certificatePrintTag
);
jgUseRegistrationManage
.
setCertificatePrintTag
(
JSONObject
.
toJSONString
(
tagJson
));
jgUseRegistrationManageService
.
updateById
(
jgUseRegistrationManage
);
String
equId
=
Stream
.
concat
(
String
equId
=
Stream
.
concat
(
Optional
.
ofNullable
(
event
.
getBizRelationData
().
getProjectContraptionIds
()).
orElse
(
Collections
.
emptySet
()).
stream
(),
Optional
.
ofNullable
(
event
.
getBizRelationData
().
getProjectContraptionIds
()).
orElse
(
Collections
.
emptySet
()).
stream
(),
Optional
.
ofNullable
(
event
.
getBizRelationData
().
getRecords
()).
orElse
(
Collections
.
emptySet
()).
stream
()
Optional
.
ofNullable
(
event
.
getBizRelationData
().
getRecords
()).
orElse
(
Collections
.
emptySet
()).
stream
()
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/event/listener/ChangeLogInsertListener.java
View file @
9a5617fb
...
@@ -108,21 +108,22 @@ public class ChangeLogInsertListener {
...
@@ -108,21 +108,22 @@ public class ChangeLogInsertListener {
).
findFirst
().
orElse
(
null
);
).
findFirst
().
orElse
(
null
);
String
businessTypeName
=
BusinessTypeEnum
String
businessTypeName
=
BusinessTypeEnum
.
findNameByEnumName
(
changeLog
.
getBizType
()).
orElse
(
"设备编辑"
);
.
findNameByEnumName
(
changeLog
.
getBizType
()).
orElse
(
"设备编辑"
);
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
JgResumeInfoDto
resumeInfoDto
=
new
JgResumeInfoDto
();
.
applyNo
(
event
.
getBizRelationData
().
getBizId
())
resumeInfoDto
.
setApplyNo
(
event
.
getBizRelationData
().
getBizId
());
.
businessType
(
businessTypeName
)
resumeInfoDto
.
setBusinessType
(
businessTypeName
);
.
businessId
(
event
.
getBizRelationData
().
getBizId
())
resumeInfoDto
.
setBusinessId
(
event
.
getBizRelationData
().
getBizId
());
.
equId
(
equId
)
resumeInfoDto
.
setEquId
(
equId
);
.
resumeType
(
"1"
)
resumeInfoDto
.
setResumeType
(
"1"
);
.
changeContent
(
"设备编辑"
)
resumeInfoDto
.
setChangeContent
(
"设备编辑"
);
.
changeLogId
(
String
.
valueOf
(
changeLog
.
getSequenceNbr
()))
resumeInfoDto
.
setChangeLogId
(
String
.
valueOf
(
changeLog
.
getSequenceNbr
()));
.
approvalUnit
(
event
.
getBizRelationData
().
getUnitName
())
resumeInfoDto
.
setApprovalUnit
(
event
.
getBizRelationData
().
getUnitName
());
.
approvalUnitCode
(
event
.
getBizRelationData
().
getUnitCode
())
resumeInfoDto
.
setApprovalUnitCode
(
event
.
getBizRelationData
().
getUnitCode
());
.
createUserName
(
event
.
getBizRelationData
().
getRecUserName
())
resumeInfoDto
.
setRecDate
(
new
Date
());
.
createUserId
(
event
.
getRequestContext
().
getExcutedUserId
())
resumeInfoDto
.
setRecUserName
(
event
.
getBizRelationData
().
getRecUserName
());
.
status
(
"正常"
)
resumeInfoDto
.
setRecUserId
(
event
.
getRequestContext
().
getExcutedUserId
());
.
routePath
(
routePath
)
resumeInfoDto
.
setStatus
(
"正常"
);
.
build
());
resumeInfoDto
.
setRoutePath
(
routePath
);
jgResumeInfoService
.
createWithModel
(
resumeInfoDto
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
}
}
...
...
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/JgBizChangeLogServiceImpl.java
View file @
9a5617fb
...
@@ -102,9 +102,13 @@ public class JgBizChangeLogServiceImpl extends BaseService<JgBizChangeLogDto, Jg
...
@@ -102,9 +102,13 @@ public class JgBizChangeLogServiceImpl extends BaseService<JgBizChangeLogDto, Jg
if
(!
ValidationUtil
.
isEmpty
(
source
.
get
(
"columnType"
))
&&
!
"String"
.
equals
(
source
.
get
(
"columnType"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
source
.
get
(
"columnType"
))
&&
!
"String"
.
equals
(
source
.
get
(
"columnType"
)))
{
Object
before
=
source
.
get
(
"beforeData"
);
Object
before
=
source
.
get
(
"beforeData"
);
Object
after
=
source
.
get
(
"afterData"
);
Object
after
=
source
.
get
(
"afterData"
);
Object
displayOldValue
=
source
.
get
(
"displayOldValue"
);
Object
displayNewValue
=
source
.
get
(
"displayNewValue"
);
if
(
Objects
.
toString
(
before
,
""
).
trim
().
startsWith
(
"["
)
&&
Objects
.
toString
(
after
,
""
).
trim
().
startsWith
(
"["
))
{
if
(
Objects
.
toString
(
before
,
""
).
trim
().
startsWith
(
"["
)
&&
Objects
.
toString
(
after
,
""
).
trim
().
startsWith
(
"["
))
{
source
.
put
(
"beforeData"
,
JSONObject
.
parseArray
(
Objects
.
toString
(
before
,
""
)));
source
.
put
(
"beforeData"
,
JSONObject
.
parseArray
(
Objects
.
toString
(
before
,
""
)));
source
.
put
(
"afterData"
,
JSONObject
.
parseArray
(
Objects
.
toString
(
after
,
""
)));
source
.
put
(
"afterData"
,
JSONObject
.
parseArray
(
Objects
.
toString
(
after
,
""
)));
source
.
put
(
"displayOldValue"
,
JSONObject
.
parseArray
(
Objects
.
toString
(
displayOldValue
,
""
)));
source
.
put
(
"displayNewValue"
,
JSONObject
.
parseArray
(
Objects
.
toString
(
displayNewValue
,
""
)));
}
}
}
}
list
.
add
(
source
);
list
.
add
(
source
);
...
...
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