Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
wangming
/
kzy-wx
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 55200f89
authored
Mar 16, 2020
by
魏文甫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wei_master' into '105'
Wei master See merge request
!18
2 parents
45b1d178
0740af45
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
src/main/java/com/server/web/common/mapping/IntegralMapper.java
src/main/java/com/server/web/common/service/Impl/UserServiceImpl.java
src/main/resources/mybatis/mapping/IntegralMapper.xml
src/main/java/com/server/web/common/mapping/IntegralMapper.java
View file @
55200f8
...
...
@@ -9,5 +9,5 @@ import java.util.Map;
public
interface
IntegralMapper
{
List
<
Map
<
String
,
Object
>>
signInList
(
Map
<
String
,
Object
>
param
);
Map
<
String
,
Object
>
query
Tod
aySign
(
Map
<
String
,
Object
>
param2
);
Map
<
String
,
Object
>
query
D
aySign
(
Map
<
String
,
Object
>
param2
);
}
src/main/java/com/server/web/common/service/Impl/UserServiceImpl.java
View file @
55200f8
...
...
@@ -59,12 +59,27 @@ public class UserServiceImpl implements UserService {
if
(
loginUser
.
getSignInCount
()
==
null
)
{
loginUser
.
setSignInCount
(
0
);
}
String
firstDay
=
simpleDateFormat
.
format
(
DateUtils
.
firstDayOfMonth
());
Integer
integral
=
1
;
if
(
firstDay
.
equals
(
simpleDateFormat
.
format
(
new
Date
())))
{
loginUser
.
setSignInCount
(
1
);
tKzyUserIntegralFlowing
.
setIntegral
(
1
);
}
else
{
//判断昨天是否签到,昨天未签到,签到哦连续天数置0;
Map
<
String
,
Object
>
param2
=
new
HashMap
<
String
,
Object
>();
param2
.
put
(
"userId"
,
loginUser
.
getId
());
param2
.
put
(
"today"
,
simpleDateFormat
.
format
(
org
.
apache
.
commons
.
lang
.
time
.
DateUtils
.
addDays
(
new
Date
(),
-
1
)));
Map
<
String
,
Object
>
yestoday
=
integralMapper
.
queryDaySign
(
param2
);
if
(
yestoday
==
null
||
yestoday
.
get
(
"id"
)
==
null
)
{
loginUser
.
setSignInCount
(
0
);
}
if
(
loginUser
.
getSignInCount
()
==
5
)
{
loginUser
.
setSignInCount
(
1
);
integral
=
1
;
}
else
{
if
(
loginUser
.
getSignInCount
()
<
2
)
{
integral
=
1
;
}
else
if
(
loginUser
.
getSignInCount
()
==
2
)
{
...
...
@@ -73,12 +88,12 @@ public class UserServiceImpl implements UserService {
integral
=
1
;
}
else
if
(
loginUser
.
getSignInCount
()
==
4
)
{
integral
=
5
;
tKzyUserIntegralFlowing
.
setIntegral
(
5
);
}
else
{
integral
=
1
;
}
loginUser
.
setSignInCount
(
loginUser
.
getSignInCount
()
+
1
);
}
}
loginUser
.
setIntegral
(
loginUser
.
getIntegral
()
+
integral
);
tKzyUserIntegralFlowing
.
setIntegral
(
integral
);
loginUser
.
setLastSignDt
(
new
Date
());
...
...
@@ -127,7 +142,7 @@ public class UserServiceImpl implements UserService {
param2
.
put
(
"userId"
,
loginUser
.
getId
());
param2
.
put
(
"today"
,
simpleDateFormat2
.
format
(
new
Date
()));
Map
<
String
,
Object
>
todaySign
=
integralMapper
.
query
Tod
aySign
(
param2
);
Map
<
String
,
Object
>
todaySign
=
integralMapper
.
query
D
aySign
(
param2
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"list"
,
list
);
dataMap
.
put
(
"todaySign"
,
todaySign
);
...
...
src/main/resources/mybatis/mapping/IntegralMapper.xml
View file @
55200f8
...
...
@@ -15,7 +15,7 @@
AND t.user_id = #{userId,jdbcType=BIGINT}
AND DATE_FORMAT(t.create_dt, '%Y-%m') = #{month,jdbcType=VARCHAR}
</select>
<select
id=
"query
Tod
aySign"
parameterType=
"java.util.HashMap"
resultType=
"java.util.HashMap"
>
<select
id=
"query
D
aySign"
parameterType=
"java.util.HashMap"
resultType=
"java.util.HashMap"
>
SELECT
t.id,
t.create_dt AS createDt,
...
...
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