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
8221db7a
Commit
8221db7a
authored
Jan 03, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):处理使用登记证顺延问题
parent
c1adfde9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
22 deletions
+41
-22
JgUseRegistrationManageMapper.java
...t/module/jg/api/mapper/JgUseRegistrationManageMapper.java
+2
-1
JgUseRegistrationManageMapper.xml
...c/main/resources/mapper/JgUseRegistrationManageMapper.xml
+27
-15
JgUseRegistrationManageController.java
.../jg/biz/controller/JgUseRegistrationManageController.java
+3
-3
JgUseRegistrationManageServiceImpl.java
.../biz/service/impl/JgUseRegistrationManageServiceImpl.java
+9
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationManageMapper.java
View file @
8221db7a
...
@@ -34,6 +34,7 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
...
@@ -34,6 +34,7 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
List
<
CertificateVo
>
queryCertificateInIds
(
@Param
(
"ids"
)
List
<
String
>
ids
);
List
<
CertificateVo
>
queryCertificateInIds
(
@Param
(
"ids"
)
List
<
String
>
ids
);
@MapKey
(
"year"
)
List
<
Map
<
String
,
String
>>
initUseRegistrationCodeIntoRedis
(
@Param
(
"year"
)
String
year
);
List
<
Map
<
String
,
String
>>
initUseRegistrationCodeIntoRedis
(
@Param
(
"year"
)
String
year
);
List
<
Map
<
String
,
String
>>
initVehicleUseRegCodeIntoRedis
(
@Param
(
"year"
)
String
year
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationManageMapper.xml
View file @
8221db7a
...
@@ -217,25 +217,37 @@
...
@@ -217,25 +217,37 @@
<select
id=
"initUseRegistrationCodeIntoRedis"
resultType=
"java.util.Map"
>
<select
id=
"initUseRegistrationCodeIntoRedis"
resultType=
"java.util.Map"
>
SELECT
SELECT
SUBSTR(
t.use_registration_code, 1, 5
) AS prefix,
SUBSTR(
T.use_registration_code, 1, 5
) AS prefix,
SUBSTR(
MAX(t.use_registration_code), 6, 5
) AS code
SUBSTR(
MAX ( T.use_registration_code ), 6, 5
) AS code
FROM
FROM
tzs_jg_use_registration_manage t
tzs_jg_use_registration_manage T
LEFT JOIN
RIGHT JOIN tzs_jg_use_registration tjur ON tjur.use_registration_code = T.use_registration_code
tzs_jg_use_registration tjur
ON tjur.use_registration_code = t.use_registration_code
AND (tjur.reg_type IS NULL OR tjur.reg_type = '2' OR tjur.reg_type = '0')
AND tjur.is_delete = 0
LEFT JOIN
tzs_jg_vehicle_information v
ON v.use_registration_code = t.use_registration_code
and v.reg_type = '0'
WHERE
WHERE
LENGTH(t.use_registration_code
) = 14
LENGTH ( T.use_registration_code
) = 14
AND SUBSTR(
t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车'
)
AND SUBSTR(
T.use_registration_code, 1, 1 ) IN ( '容', '锅', '管', '瓶', '梯', '起', '索', '游', '车'
)
AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')')
AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')')
AND ( tjur.reg_type IS NULL OR tjur.reg_type = '2' OR tjur.reg_type = '0' )
AND tjur.is_delete = 0
GROUP BY
GROUP BY
SUBSTR(t.use_registration_code, 1, 5)
SUBSTR( T.use_registration_code, 1, 5 )
HAVING code
<![CDATA[ <> ]]>
'00000'
ORDER BY prefix
</select>
<select
id=
"initVehicleUseRegCodeIntoRedis"
resultType=
"java.util.Map"
>
SELECT
SUBSTR(M.use_registration_code, 1, 5) AS prefix,
SUBSTR(MAX(M.use_registration_code), 6, 5) AS code
FROM
tzs_jg_use_registration_manage M
RIGHT JOIN tzs_jg_vehicle_information v ON v.use_registration_code = M.use_registration_code
WHERE
LENGTH ( M.use_registration_code ) = 14
AND SUBSTR( M.use_registration_code, 1, 1 ) IN ( '容', '锅', '管', '瓶', '梯', '起', '索', '游', '车' )
and v.reg_type is null
AND TRIM ( M.use_registration_code ) LIKE concat ( '%(',#{year}, ')' )
GROUP BY
SUBSTR( M.use_registration_code, 1, 5 )
HAVING code
<![CDATA[ <> ]]>
'00000'
HAVING code
<![CDATA[ <> ]]>
'00000'
ORDER BY prefix
ORDER BY prefix
</select>
</select>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgUseRegistrationManageController.java
View file @
8221db7a
...
@@ -318,9 +318,9 @@ public class JgUseRegistrationManageController extends BaseController {
...
@@ -318,9 +318,9 @@ public class JgUseRegistrationManageController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/initRegCodeIntoRedis"
)
@GetMapping
(
value
=
"/initRegCodeIntoRedis"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"初始化使用登记证序列号到Redis"
,
notes
=
"初始化使用登记证序列号到Redis"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"初始化使用登记证序列号到Redis"
,
notes
=
"初始化使用登记证序列号到Redis"
)
public
ResponseModel
<
Object
>
initUseRegistrationCodeIntoRedis
()
{
public
ResponseModel
<
Object
>
initUseRegistrationCodeIntoRedis
(
@RequestParam
(
value
=
"year"
,
defaultValue
=
"24"
)
String
year
)
{
jgUseRegistrationManageServiceImpl
.
initUseRegistrationCodeIntoRedis
();
jgUseRegistrationManageServiceImpl
.
initUseRegistrationCodeIntoRedis
(
year
);
return
ResponseHelper
.
buildResponse
(
"
Redis初始化完成!"
);
return
ResponseHelper
.
buildResponse
(
year
+
"年使用登记证序列码
Redis初始化完成!"
);
}
}
/**
/**
...
...
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/JgUseRegistrationManageServiceImpl.java
View file @
8221db7a
...
@@ -766,12 +766,18 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
...
@@ -766,12 +766,18 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
return
parseArray
(
json
,
FormValue
.
class
);
return
parseArray
(
json
,
FormValue
.
class
);
}
}
public
void
initUseRegistrationCodeIntoRedis
()
{
public
void
initUseRegistrationCodeIntoRedis
(
String
year
)
{
// 获取当前年份的两位数
// 获取当前年份的两位数
String
currentYearSuffix
=
String
.
valueOf
(
LocalDate
.
now
().
getYear
()
%
100
);
String
currentYearSuffix
=
String
.
valueOf
(
LocalDate
.
now
().
getYear
()
%
100
);
Date
endOfYear
=
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
common
.
DateUtils
.
calculateEndOfYear
(
new
Date
());
Date
endOfYear
=
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
common
.
DateUtils
.
calculateEndOfYear
(
new
Date
());
// 从数据库中加载数据并批量设置到 Redis
// 非车用气瓶-从数据库中加载使用登记证最大序列码刷新到Redis中
jgUseRegistrationManageMapper
.
initUseRegistrationCodeIntoRedis
(
currentYearSuffix
)
jgUseRegistrationManageMapper
.
initUseRegistrationCodeIntoRedis
(
year
)
.
forEach
(
resultMap
->
Optional
.
ofNullable
(
resultMap
)
.
ifPresent
(
map
->
setValueWithoutExpiration
(
map
.
get
(
"prefix"
),
map
.
get
(
"code"
)))
);
// 车用气瓶-从数据库中加载使用登记证最大序列码刷新到Redis中
jgUseRegistrationManageMapper
.
initVehicleUseRegCodeIntoRedis
(
year
)
.
forEach
(
resultMap
->
.
forEach
(
resultMap
->
Optional
.
ofNullable
(
resultMap
)
Optional
.
ofNullable
(
resultMap
)
.
ifPresent
(
map
->
setValueWithoutExpiration
(
map
.
get
(
"prefix"
),
map
.
get
(
"code"
)))
.
ifPresent
(
map
->
setValueWithoutExpiration
(
map
.
get
(
"prefix"
),
map
.
get
(
"code"
)))
...
...
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