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 b8d94d0a
authored
Mar 14, 2020
by
魏文甫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wei_master' into '105'
Wei master See merge request
!13
2 parents
73bbaa40
b729b12c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 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 @
b8d94d0
...
...
@@ -8,4 +8,6 @@ import java.util.Map;
*/
public
interface
IntegralMapper
{
List
<
Map
<
String
,
Object
>>
signInList
(
Map
<
String
,
Object
>
param
);
Map
<
String
,
Object
>
queryTodaySign
(
Map
<
String
,
Object
>
param2
);
}
src/main/java/com/server/web/common/service/Impl/UserServiceImpl.java
View file @
b8d94d0
...
...
@@ -54,7 +54,7 @@ public class UserServiceImpl implements UserService {
tKzyUserIntegralFlowing
.
setCreateDt
(
new
Date
());
tKzyUserIntegralFlowing
.
setSourceType
(
1
);
tKzyUserIntegralFlowing
.
setType
(
1
);
tKzyUserIntegralFlowing
.
setUserId
(
loginUser
.
getId
());
if
(
loginUser
.
getIntegral
()
==
null
)
{
loginUser
.
setIntegral
(
0
);
}
...
...
@@ -90,16 +90,27 @@ public class UserServiceImpl implements UserService {
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"integral"
,
integral
);
dataMap
.
put
(
"signInCount"
,
loginUser
.
getSignInCount
());
return
ResultMapUtil
.
returnMap
(
"1"
,
"操作成功!"
,
null
);
return
ResultMapUtil
.
returnMap
(
"1"
,
"操作成功!"
,
dataMap
);
}
@Override
public
Map
<
String
,
Object
>
signInList
(
TKzyUser
loginUser
)
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM"
);
SimpleDateFormat
simpleDateFormat2
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"userId"
,
loginUser
.
getId
());
param
.
put
(
"month"
,
simpleDateFormat
.
format
(
new
Date
()));
List
<
Map
<
String
,
Object
>>
list
=
integralMapper
.
signInList
(
param
);
Map
<
String
,
Object
>
param2
=
new
HashMap
<
String
,
Object
>();
param2
.
put
(
"userId"
,
loginUser
.
getId
());
param2
.
put
(
"today"
,
simpleDateFormat2
.
format
(
new
Date
()));
Map
<
String
,
Object
>
todaySign
=
integralMapper
.
queryTodaySign
(
param2
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"list"
,
list
);
dataMap
.
put
(
"todaySign"
,
todaySign
);
return
ResultMapUtil
.
returnMap
(
"1"
,
""
,
list
);
}
...
...
src/main/resources/mybatis/mapping/IntegralMapper.xml
View file @
b8d94d0
...
...
@@ -14,4 +14,17 @@
AND t.user_id = #{userId,jdbcType=BIGINT}
AND DATE_FORMAT(t.create_dt, '%Y-%m') = #{month,jdbcType=VARCHAR}
</select>
<select
id=
"queryTodaySign"
parameterType=
"java.util.HashMap"
resultType=
"java.util.HashMap"
>
SELECT
t.id,
t.create_dt AS createDt,
t.integral
FROM
t_kzy_user_integral_flowing t
WHERE
t.source_type = 1
AND t.user_id = #{userId,jdbcType=BIGINT}
AND DATE_FORMAT(t.create_dt, '%Y-%m-%') = #{todya,jdbcType=VARCHAR}
limit t.id DESC limit 0,1
</select>
</mapper>
\ No newline at end of file
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