Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e5d41bc5
authored
Feb 06, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复新增车型的时候没有吧新车型赋值到对比的Map导致每次都会显示删除车型的bug
1 parent
905c6394
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
aus-core/src/main/java/com/glsx/usedcar/module/account/service/AccountPreferenceService.java
aus-core/src/main/java/com/glsx/usedcar/module/account/service/AccountPreferenceService.java
View file @
e5d41bc
...
...
@@ -141,7 +141,7 @@ public class AccountPreferenceService {
handlePreferenceValues
(
preferenceId
,
dto
);
// 处理车型(先删后加)
Map
<
Integer
,
String
>
newVehicleTypeMap
=
handleVehicleTypes
(
preferenceId
,
dto
);
oldData
.
newVehicleTypeMap
=
handleVehicleTypes
(
preferenceId
,
dto
);
// 生成并保存操作日志
generateAndSaveOperationLog
(
oldData
,
dto
,
isAdd
,
preferenceId
,
accountId
,
operator
);
...
...
@@ -214,11 +214,13 @@ public class AccountPreferenceService {
}
catch
(
JsonProcessingException
e
)
{
log
.
info
(
"JSON解析失败:{}"
,
e
.
getMessage
());
}
for
(
VehicleTypeInfo
typeInfo
:
vehicleTypeInfos
)
{
newVehicleTypeList
.
add
(
new
AccountPreferenceVehicleType
(
preferenceId
,
typeInfo
.
getId
(),
typeInfo
.
getName
()));
newVehicleTypeMap
.
put
(
typeInfo
.
getId
(),
typeInfo
.
getName
());
if
(
vehicleTypeInfos
!=
null
)
{
for
(
VehicleTypeInfo
typeInfo
:
vehicleTypeInfos
)
{
newVehicleTypeList
.
add
(
new
AccountPreferenceVehicleType
(
preferenceId
,
typeInfo
.
getId
(),
typeInfo
.
getName
()));
newVehicleTypeMap
.
put
(
typeInfo
.
getId
(),
typeInfo
.
getName
());
}
accountPreferenceVehicleTypeService
.
saveAll
(
newVehicleTypeList
);
}
accountPreferenceVehicleTypeService
.
saveAll
(
newVehicleTypeList
);
}
return
newVehicleTypeMap
;
}
...
...
@@ -257,6 +259,7 @@ public class AccountPreferenceService {
addValueDescription
(
opDesc
,
AccountPreferenceValue
.
PreferenceType
.
business_model
,
dto
.
getBusinessModel
(),
"经营模式"
);
addValueDescription
(
opDesc
,
AccountPreferenceValue
.
PreferenceType
.
vehicle_age
,
dto
.
getVehicleAge
(),
"偏好车龄"
);
addValueDescription
(
opDesc
,
AccountPreferenceValue
.
PreferenceType
.
vehicle_fuel_type
,
dto
.
getVehicleFuelType
(),
"燃油类型"
);
addValueDescription
(
opDesc
,
AccountPreferenceValue
.
PreferenceType
.
vehicle_type
,
dto
.
getVehicleType
(),
"车辆类型"
);
if
(!
newVehicleTypeMap
.
isEmpty
())
{
opDesc
.
append
(
"车型["
).
append
(
String
.
join
(
","
,
newVehicleTypeMap
.
values
())).
append
(
"];"
);
...
...
@@ -279,6 +282,8 @@ public class AccountPreferenceService {
splitToSet
(
dto
.
getVehicleAge
()),
"偏好车龄"
,
VehicleAgeEnum
.
getCodeDescMap
());
compareValueDesc
(
opDesc
,
oldData
.
oldValueMap
.
get
(
AccountPreferenceValue
.
PreferenceType
.
vehicle_fuel_type
),
splitToSet
(
dto
.
getVehicleFuelType
()),
"燃油类型"
,
VehicleFuelTypeEnum
.
getCodeDescMap
());
compareValueDesc
(
opDesc
,
oldData
.
oldValueMap
.
get
(
AccountPreferenceValue
.
PreferenceType
.
vehicle_type
),
splitToSet
(
dto
.
getVehicleType
()),
"车辆类型"
,
VehicleTypeEnum
.
getCodeDescMap
());
// 对比车型(增删)
compareVehicleTypeDesc
(
opDesc
,
oldData
.
oldVehicleTypeMap
,
oldData
.
newVehicleTypeMap
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment