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
74e87234
Commit
74e87234
authored
Dec 20, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register' into develop_tzs_test
parents
b2e4009d
80592fb2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
5 deletions
+29
-5
JgUseRegistrationManageMapper.xml
...c/main/resources/mapper/JgUseRegistrationManageMapper.xml
+2
-2
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+1
-1
JgUseRegistrationManageServiceImpl.java
.../biz/service/impl/JgUseRegistrationManageServiceImpl.java
+26
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationManageMapper.xml
View file @
74e87234
...
...
@@ -223,8 +223,8 @@
WHERE LENGTH(t.use_registration_code) = 14
AND SUBSTR(t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车')
AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')')
and tjur.reg_type is null
and
tjur.is_delete = 0
AND (tjur.reg_type IS NULL OR tjur.reg_type = 2)
AND
tjur.is_delete = 0
GROUP BY SUBSTR(t.use_registration_code, 1, 5)
HAVING code
<![CDATA[ <> ]]>
'00000'
ORDER BY prefix
...
...
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
74e87234
...
...
@@ -751,7 +751,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String
record
=
(
String
)
equipmentInfoForm
.
get
(
RECORD
);
String
dataSource
=
(
String
)
equipmentInfoForm
.
get
(
DATA_SOURCE
);
if
(
dataSource
.
startsWith
(
"jg_
his"
))
{
if
(
dataSource
.
contains
(
"
his"
))
{
String
useRegistrationCode
=
String
.
valueOf
(
equipmentInfoForm
.
get
(
"useRegistrationCode"
)).
trim
();
String
equipId
=
String
.
valueOf
(
equipmentInfoForm
.
get
(
"RECORD"
));
// 校验使用登记证编号的唯一性
...
...
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 @
74e87234
...
...
@@ -44,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.ValueOperations
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -61,6 +62,7 @@ import java.text.SimpleDateFormat;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
...
...
@@ -765,8 +767,30 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
}
public
void
initUseRegistrationCodeIntoRedis
()
{
jgUseRegistrationManageMapper
.
initUseRegistrationCodeIntoRedis
(
String
.
valueOf
(
LocalDate
.
now
().
getYear
()
%
100
))
.
forEach
(
resultMap
->
redisTemplate
.
opsForValue
().
set
(
resultMap
.
get
(
"prefix"
),
resultMap
.
get
(
"code"
)));
// 获取当前年份的两位数
String
currentYearSuffix
=
String
.
valueOf
(
LocalDate
.
now
().
getYear
()
%
100
);
Date
endOfYear
=
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
common
.
DateUtils
.
calculateEndOfYear
(
new
Date
());
// 从数据库中加载数据并批量设置到 Redis
jgUseRegistrationManageMapper
.
initUseRegistrationCodeIntoRedis
(
currentYearSuffix
)
.
forEach
(
resultMap
->
Optional
.
ofNullable
(
resultMap
)
.
ifPresent
(
map
->
setValueWithExpiration
(
map
.
get
(
"prefix"
),
map
.
get
(
"code"
),
endOfYear
))
);
}
/**
* redis设置key
*
* @param key key
* @param value value
* @param expirationDate 过期时间
*/
public
void
setValueWithExpiration
(
String
key
,
String
value
,
Date
expirationDate
)
{
ValueOperations
<
String
,
String
>
valueOps
=
redisTemplate
.
opsForValue
();
valueOps
.
set
(
key
,
value
);
long
expirationTimeInSeconds
=
expirationDate
.
getTime
()
-
System
.
currentTimeMillis
();
redisTemplate
.
expire
(
key
,
expirationTimeInSeconds
,
TimeUnit
.
MILLISECONDS
);
}
public
Object
handleErrorDeviceCode
(
String
applyNo
)
{
...
...
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