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
6fcaa970
Commit
6fcaa970
authored
Jun 26, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(jg): 优化设备代码生成和车辆信息保存逻辑- 修改设备代码生成条件,支持新提交或暂存后提交- 优化车辆 VIN 码校验逻辑,增加对空值的处理
- 移除设备检验检测信息的完整性校验 - 修复设备总容积计算,增加对空值和空字符串的处理 - 增加设备创建或编辑事件发布
parent
c3d3f1f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+3
-1
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+18
-9
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/service/impl/JgUseRegistrationServiceImpl.java
View file @
6fcaa970
...
...
@@ -4172,7 +4172,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(
registerInfo
!=
null
)
{
registerInfo
.
setUseOrgCode
(
jgUseRegistration
.
getUseRegistrationCode
());
registerInfo
.
setEquCodeType
(
String
.
valueOf
(
map
.
get
(
"equCodeType"
)));
if
(
submitType
.
equals
(
"tempSubmit"
)){
// 新提交或暂存后提交需生成设备代码
if
(
ValidationUtil
.
isEmpty
(
submitType
)
||
"tempSubmit"
.
equals
(
submitType
)){
equCode
=
ObjectUtils
.
isEmpty
(
map
.
get
(
"equCode"
))
&&
!
StringUtils
.
isEmpty
(
jgUseRegistration
.
getReceiveCompanyCode
())
?
this
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
())
:
String
.
valueOf
(
map
.
get
(
"equCode"
));
...
...
@@ -4335,6 +4336,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
build
());
}
}
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
Sets
.
newHashSet
(
equipId
),
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
this
.
baseMapper
.
getDetailById
(
jgUseRegistration
.
getSequenceNbr
());
}
catch
(
BadRequest
|
LocalBadRequest
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/JgVehicleInformationServiceImpl.java
View file @
6fcaa970
...
...
@@ -1872,7 +1872,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
String
firstUseOrgCode
=
(
String
)
eqLists
.
stream
().
findFirst
().
orElseThrow
(()
->
new
BadRequest
(
"设备列表为空,无法获取第一个设备信息"
)).
get
(
"useOrgCode"
);
String
firstVin
=
(
String
)
eqLists
.
stream
().
findFirst
().
orElseThrow
(()
->
new
BadRequest
(
"设备列表为空,无法获取第一个设备信息"
)).
get
(
"vin"
);
boolean
isOrgCodeConsistent
=
useRegistrationCode
.
equals
(
firstUseOrgCode
);
boolean
isVinConsistent
=
identificationCode
.
equals
(
firstVin
);
boolean
isVinConsistent
=
"null"
.
equals
(
identificationCode
)
&&
ValidationUtil
.
isEmpty
(
firstVin
)
||
identificationCode
.
equals
(
firstVin
);
return
isSameChargingMedium
&&
isSameVin
&&
isOrgCodeConsistent
&&
isVinConsistent
;
})
.
orElseThrow
(()
->
new
BadRequest
(
"使用登记证号、车辆VIN码与所选设备不一致,请重新选择设备!"
));
...
...
@@ -1890,11 +1890,11 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.
collect
(
Collectors
.
toList
())
);
if
(
inspectionDetectionInfoList
.
stream
().
anyMatch
(
info
->
ObjectUtils
.
isEmpty
(
info
)
||
ObjectUtils
.
isEmpty
(
info
.
getInspectType
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectConclusion
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectOrgCode
())))
{
throw
new
BadRequest
(
"请补充设备检验检测信息后提交!"
);
}
//
if (inspectionDetectionInfoList.stream().anyMatch(info ->
//
ObjectUtils.isEmpty(info) || ObjectUtils.isEmpty(info.getInspectType()) ||
//
ObjectUtils.isEmpty(info.getInspectConclusion()) || ObjectUtils.isEmpty(info.getInspectOrgCode()))) {
//
throw new BadRequest("请补充设备检验检测信息后提交!");
//
}
vehicleInfoDto
.
setNextInspectionDate
(
inspectionDetectionInfoList
.
stream
()
.
map
(
IdxBizJgInspectionDetectionInfo:
:
getNextInspectDate
)
...
...
@@ -2008,8 +2008,14 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
vehicleInformation
.
setRegDate
(
new
Date
());
vehicleInformation
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
vehicleInformation
.
setGasNum
(
equipmentLists
.
size
());
BigDecimal
totalVolume
=
equipmentLists
.
stream
()
.
map
(
x
->
new
BigDecimal
(
String
.
valueOf
(
x
.
get
(
"singleBottleVolume"
))))
BigDecimal
totalVolume
=
Optional
.
ofNullable
(
equipmentLists
)
.
orElse
(
Collections
.
emptyList
())
.
stream
()
.
map
(
x
->
x
.
get
(
"singleBottleVolume"
))
.
filter
(
Objects:
:
nonNull
)
// 过滤 null 值
.
map
(
Object:
:
toString
)
.
filter
(
s
->
!
s
.
trim
().
isEmpty
())
// 过滤空字符串
.
map
(
BigDecimal:
:
new
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
vehicleInformation
.
setVolume
(
totalVolume
.
toPlainString
());
vehicleInformation
.
setFillingMedium
(
equipmentLists
.
stream
()
...
...
@@ -2138,7 +2144,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 保存关联设备信息
jgVehicleInformationEqService
.
saveBatch
(
equipList
);
}
Set
<
String
>
recordSet
=
equipmentLists
.
stream
()
.
map
(
v
->
(
String
)
v
.
get
(
"record"
))
.
collect
(
Collectors
.
toSet
());
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
Collections
.
singletonList
(
vehicleInformation
);
}
...
...
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