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
9262ae96
Commit
9262ae96
authored
Aug 28, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):场车单位变更bug修改
parent
9f64e901
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
23 deletions
+20
-23
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+20
-23
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/JgChangeRegistrationUnitServiceImpl.java
View file @
9262ae96
...
...
@@ -358,6 +358,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
String
city
=
Objects
.
toString
(
noticeDto
.
getCity
(),
""
);
String
userCity
=
Optional
.
ofNullable
(
city
).
map
(
c
->
c
.
split
(
"_"
)[
0
]).
orElseThrow
(()
->
new
BadRequest
(
"请选择地市后暂存!"
));
this
.
validateDeviceCity
(
deviceList
,
userCity
,
"0"
.
equals
(
noticeDto
.
getChangeType
()));
this
.
setEquAddress
(
noticeDto
);
}
ArrayList
<
String
>
roleListAll
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListNext
=
new
ArrayList
<>();
...
...
@@ -913,7 +914,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setUseRegistCode
(
String
.
join
(
","
,
registrationNoList
));
model
.
setEquList
(
registrationList
.
get
(
0
).
get
(
"equList"
).
toString
());
this
.
setEquAddress
(
tableData
,
model
);
this
.
setEquAddress
(
model
);
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
model
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
...
...
@@ -996,30 +997,31 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
return
Collections
.
singletonList
(
model
);
}
public
void
setEquAddress
(
Map
<
String
,
Object
>
tableData
,
JgChangeRegistrationUnitDto
model
)
{
tableData
.
put
(
"region"
,
tableData
.
get
(
"county"
));
String
address
=
Stream
.
of
(
"province"
,
"city"
,
"region"
,
"street"
)
.
map
(
key
->
getRegionName
(
key
,
tableData
))
.
filter
(
s
->
!
s
.
isEmpty
())
public
void
setEquAddress
(
JgChangeRegistrationUnitDto
model
)
{
String
address
=
Stream
.
of
(
getRegionNameByCode
(
"province"
,
model
.
getProvince
()),
getRegionNameByCode
(
"city"
,
model
.
getCity
()),
getRegionNameByCode
(
"region"
,
model
.
getCounty
()),
getRegionNameByCode
(
"street"
,
model
.
getStreet
()))
.
filter
(
s
->
s
!=
null
&&
!
s
.
isEmpty
())
.
collect
(
Collectors
.
joining
())
+
Objects
.
toString
(
tableData
.
get
(
"fullAddress"
),
""
);
+
Objects
.
toString
(
model
.
getFullAddress
(
),
""
);
model
.
setEquAddress
(
address
);
model
.
setFullAddress
(
Objects
.
toString
(
tableData
.
get
(
"fullAddress"
),
""
));
model
.
setFullAddress
(
Objects
.
toString
(
model
.
getFullAddress
(
),
""
));
}
/**
* 根据code获取市区县名字
*
* @param
codeKey codeKey
* @param
type type
* @return name
*/
private
String
getRegionName
(
String
codeKey
,
Map
<
String
,
Object
>
tableData
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
regions
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
redisUtils
.
get
(
codeKey
.
toUpperCase
());
private
String
getRegionNameByCode
(
String
type
,
String
code
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
regions
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
redisUtils
.
get
(
type
.
toUpperCase
());
return
regions
.
stream
()
.
filter
(
item
->
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
tableData
.
get
(
codeKey
))))
.
filter
(
item
->
code
.
equals
(
String
.
valueOf
(
item
.
get
(
"regionCode"
))))
.
map
(
item
->
(
String
)
item
.
get
(
"regionName"
))
.
collect
(
Collectors
.
joining
(
""
));
.
findFirst
()
.
orElse
(
""
);
}
// 获取设备的地市编码
...
...
@@ -1519,15 +1521,10 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
useInfo
.
setCounty
(
registration
.
getCounty
());
useInfo
.
setFactoryUseSiteStreet
(
registration
.
getStreet
());
useInfo
.
setAddress
(
registration
.
getFullAddress
());
Map
<
String
,
Object
>
tableData
=
new
HashMap
<>();
tableData
.
put
(
"province"
,
registration
.
getProvince
());
tableData
.
put
(
"city"
,
registration
.
getCity
());
tableData
.
put
(
"region"
,
registration
.
getCounty
());
tableData
.
put
(
"street"
,
registration
.
getStreet
());
useInfo
.
setProvinceName
(
getRegionName
(
"province"
,
tableData
));
useInfo
.
setCityName
(
getRegionName
(
"city"
,
tableData
));
useInfo
.
setCountyName
(
getRegionName
(
"region"
,
tableData
));
useInfo
.
setStreetName
(
getRegionName
(
"street"
,
tableData
));
useInfo
.
setProvinceName
(
getRegionNameByCode
(
"province"
,
useInfo
.
getProvince
()));
useInfo
.
setCityName
(
getRegionNameByCode
(
"city"
,
useInfo
.
getCity
()));
useInfo
.
setCountyName
(
getRegionNameByCode
(
"region"
,
useInfo
.
getCounty
()));
useInfo
.
setStreetName
(
getRegionNameByCode
(
"street"
,
useInfo
.
getFactoryUseSiteStreet
()));
}
private
String
joinWithSeparator
(
String
separator
,
String
...
values
)
{
...
...
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