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
7478fe19
Commit
7478fe19
authored
Dec 07, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.监管码前缀方法
parent
6c30ff41
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
6 deletions
+53
-6
CodeGenServiceImpl.java
...s/boot/module/jg/biz/service/impl/CodeGenServiceImpl.java
+37
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+13
-3
JgChangeRegistrationTransferServiceImpl.java
...service/impl/JgChangeRegistrationTransferServiceImpl.java
+2
-2
GenerateCodeServiceImpl.java
.../module/ymt/biz/service/impl/GenerateCodeServiceImpl.java
+1
-1
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/CodeGenServiceImpl.java
0 → 100644
View file @
7478fe19
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentCategoryEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Map
;
@Service
public
class
CodeGenServiceImpl
{
private
final
EquipmentCategoryMapper
equipmentCategoryMapper
;
// 西安行政区划code
private
static
final
String
XIAN
=
"610100"
;
// 咸阳行政区划code
private
static
final
String
XIAN_YANG
=
"610400"
;
public
CodeGenServiceImpl
(
EquipmentCategoryMapper
equipmentCategoryMapper
)
{
this
.
equipmentCategoryMapper
=
equipmentCategoryMapper
;
}
public
String
getSupervisorCodePrefix
(
String
isNotXiXian
,
String
city
,
String
county
)
{
String
division
;
if
(((
XIAN
.
equals
(
city
)
||
XIAN_YANG
.
equals
(
city
))
&&
"1"
.
equals
(
isNotXiXian
)))
{
division
=
"X"
;
}
else
{
// 生成监管码前缀
Map
<
String
,
Object
>
divisionMap
=
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQH
.
getCode
(),
county
);
division
=
ObjectUtils
.
isEmpty
(
divisionMap
)
?
equipmentCategoryMapper
.
getAdministrativeDivision
(
EquipmentCategoryEnum
.
XZQH
.
getCode
(),
city
).
get
(
"code"
).
toString
()
:
divisionMap
.
get
(
"code"
).
toString
();
}
return
division
;
}
}
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 @
7478fe19
...
...
@@ -251,6 +251,9 @@ public class CommonServiceImpl implements ICommonService {
@Autowired
private
JgChangeVehicleRegistrationUnitServiceImpl
jgChangeVehicleRegistrationUnitService
;
@Autowired
private
CodeGenServiceImpl
codeGenService
;
@Value
(
"${qrcode.prefix:https://sxtzsb.sxsei.com:19435/tzs}"
)
private
String
qrcodePrefix
;
...
...
@@ -1803,7 +1806,7 @@ public class CommonServiceImpl implements ICommonService {
* @param supervisoryCompanyCode 接收机构单位代码
* @return 使用登记编号
*/
public
String
generateRegistrationCode
(
String
equipId
,
String
supervisoryCode
,
String
supervisoryCompanyCode
,
boolean
isUnit
)
{
public
String
generateRegistrationCode
(
String
equipId
,
JgRegistrationHistory
historyData
,
String
supervisoryCompanyCode
,
boolean
isUnit
)
{
// 根据设备id查询设备类别、品种
LambdaQueryWrapper
<
RegistrationInfo
>
equipWrapper
=
new
LambdaQueryWrapper
<>();
equipWrapper
.
eq
(
RegistrationInfo:
:
getRecord
,
equipId
);
...
...
@@ -1825,9 +1828,16 @@ public class CommonServiceImpl implements ICommonService {
equipType2MidDigits
=
equDefine
.
substring
(
1
,
3
);
}
}
Map
<
String
,
Object
>
changeData
=
JSON
.
parseObject
(
historyData
.
getChangeData
(),
Map
.
class
);
String
cityCode
=
Optional
.
ofNullable
((
String
)
changeData
.
get
(
"transferCity"
))
.
map
(
s
->
s
.
split
(
"_"
)[
0
])
.
orElse
(
""
);
String
countyCode
=
Optional
.
ofNullable
((
String
)
changeData
.
get
(
"transferCounty"
))
.
map
(
s
->
s
.
split
(
"_"
)[
0
])
.
orElse
(
""
);
String
isXiXian
=
"0"
.
equals
(
changeData
.
get
(
"transferIsXixian"
))
?
"0"
:
"1"
;
// 登记机关代号
String
city
=
supervisoryCode
.
substring
(
0
,
1
);
String
city
=
codeGenService
.
getSupervisorCodePrefix
(
isXiXian
,
cityCode
,
countyCode
);
// 西咸新区监管码对应的设备使用登记证还按咸阳(D)生成
if
(
"X"
.
equals
(
city
))
{
city
=
"D"
;
...
...
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/JgChangeRegistrationTransferServiceImpl.java
View file @
7478fe19
...
...
@@ -939,7 +939,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
Map
<
String
,
String
>
supervisoryCodeMap
=
this
.
create96333Code
(
historyData
,
device
.
getEquId
());
supervisoryCode
=
supervisoryCodeMap
.
get
(
"superviseCode"
);
code96333
=
supervisoryCodeMap
.
get
(
"code96333"
);
useRegistrationCode
.
set
(
commonServiceImpl
.
generateRegistrationCode
(
device
.
getEquId
(),
supervisoryCode
,
transfer
.
getReceiveCompanyCode
(),
false
));
useRegistrationCode
.
set
(
commonServiceImpl
.
generateRegistrationCode
(
device
.
getEquId
(),
historyData
,
transfer
.
getReceiveCompanyCode
(),
false
));
useRegistrationCodeList
.
add
(
String
.
valueOf
(
useRegistrationCode
));
isUpdateRegistrationCode
.
set
(
true
);
}
else
{
...
...
@@ -961,7 +961,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
Map
<
String
,
String
>
supervisoryCodeMap
=
this
.
create96333Code
(
historyData
,
device
.
getEquId
());
supervisoryCode
=
supervisoryCodeMap
.
get
(
"superviseCode"
);
code96333
=
supervisoryCodeMap
.
get
(
"code96333"
);
useRegistrationCode
.
set
(
commonServiceImpl
.
generateRegistrationCode
(
device
.
getEquId
(),
supervisoryCode
,
transfer
.
getReceiveCompanyCode
(),
false
));
useRegistrationCode
.
set
(
commonServiceImpl
.
generateRegistrationCode
(
device
.
getEquId
(),
historyData
,
transfer
.
getReceiveCompanyCode
(),
false
));
useRegistrationCodeList
.
add
(
String
.
valueOf
(
useRegistrationCode
));
isUpdateRegistrationCode
.
set
(
true
);
}
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/GenerateCodeServiceImpl.java
View file @
7478fe19
...
...
@@ -111,7 +111,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
return
"ok"
;
}
private
String
generateSupervisorySequence
(
String
sequenceKey
)
{
private
String
generateSupervisorySequence
(
String
sequenceKey
)
{
// 使用分布式锁,确保在并发情况下只有一个线程能够生成顺序码
RLock
lock
=
redissonClient
.
getLock
(
LOCK_KEY_SUPERVISORY
);
try
{
...
...
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