Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d0c69bbb
authored
Feb 08, 2022
by
邓敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到记录修改
1 parent
7d846edc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
src/main/java/com/subsidy/util/RedisUtil.java
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
View file @
d0c69bb
...
@@ -28,12 +28,14 @@ import com.subsidy.vo.sign.SignInStatusVO;
...
@@ -28,12 +28,14 @@ import com.subsidy.vo.sign.SignInStatusVO;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.time.ZoneOffset
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
...
@@ -75,12 +77,18 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
...
@@ -75,12 +77,18 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
.
orderByDesc
(
SignInRecordDO:
:
getCreateDate
));
.
orderByDesc
(
SignInRecordDO:
:
getCreateDate
));
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
signIn
(
SignInRecordDO
signInRecordDO
)
{
public
String
signIn
(
SignInRecordDO
signInRecordDO
)
{
//查看学生所有在读班级
//查看学生所有在读班级
List
<
ClassDictDO
>
classDictDOS
=
classMemberMappingMapper
.
getMemberClass
(
signInRecordDO
.
getMemberId
());
List
<
ClassDictDO
>
classDictDOS
=
classMemberMappingMapper
.
getMemberClass
(
signInRecordDO
.
getMemberId
());
for
(
ClassDictDO
classDictDO
:
classDictDOS
)
{
for
(
ClassDictDO
classDictDO
:
classDictDOS
)
{
Set
<
String
>
set
=
redisUtil
.
scan
(
RedisPrefixConstant
.
SUBSIDY_SIGN_INFO_PREFIX
+
signInRecordDO
.
getMemberId
()
+
":classId:"
+
classDictDO
.
getId
()
+
":"
+
DateFormatUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
)+
":*"
);
if
(
set
.
size
()
>
0
)
{
redisUtil
.
del
(
set
);
}
redisUtil
.
set
(
RedisPrefixConstant
.
SUBSIDY_SIGN_INFO_PREFIX
+
signInRecordDO
.
getMemberId
()
+
":classId:"
+
classDictDO
.
getId
()
+
":"
+
DateFormatUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
)
+
":"
+
System
.
currentTimeMillis
(),
null
);
redisUtil
.
set
(
RedisPrefixConstant
.
SUBSIDY_SIGN_INFO_PREFIX
+
signInRecordDO
.
getMemberId
()
+
":classId:"
+
classDictDO
.
getId
()
+
":"
+
DateFormatUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
)
+
":"
+
System
.
currentTimeMillis
(),
null
);
}
}
...
...
src/main/java/com/subsidy/util/RedisUtil.java
View file @
d0c69bb
...
@@ -102,6 +102,16 @@ public class RedisUtil {
...
@@ -102,6 +102,16 @@ public class RedisUtil {
}
}
}
}
/**
* 删除缓存
* @param key 集合数据
*/
public
void
del
(
Set
<
String
>
key
)
{
if
(
key
!=
null
&&
key
.
size
()
>
0
)
{
redisTemplate
.
delete
(
key
);
}
}
//============================String=============================
//============================String=============================
/**
/**
* 普通缓存获取
* 普通缓存获取
...
...
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