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 73bbaa40
authored
Mar 14, 2020
by
魏文甫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wei_master' into '105'
update See merge request
!12
2 parents
670aec9d
357596a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
31 deletions
src/main/java/com/server/web/common/service/Impl/UserServiceImpl.java
src/main/java/com/server/web/controller/CourseController.java
src/main/java/com/server/web/controller/UserController.java
src/main/resources/mybatis/mapping/IntegralMapper.xml
src/main/java/com/server/web/common/service/Impl/UserServiceImpl.java
View file @
73bbaa4
...
...
@@ -62,36 +62,34 @@ public class UserServiceImpl implements UserService {
loginUser
.
setSignInCount
(
0
);
}
String
firstDay
=
simpleDateFormat
.
format
(
DateUtils
.
firstDayOfMonth
());
Integer
integral
=
1
;
if
(
firstDay
.
equals
(
simpleDateFormat
.
format
(
new
Date
())))
{
loginUser
.
setIntegral
(
loginUser
.
getIntegral
()
+
1
);
loginUser
.
setSignInCount
(
1
);
tKzyUserIntegralFlowing
.
setIntegral
(
1
);
}
else
{
if
(
loginUser
.
getSignInCount
()
<=
2
)
{
loginUser
.
setIntegral
(
loginUser
.
getIntegral
()
+
1
);
loginUser
.
setSignInCount
(
loginUser
.
getSignInCount
()
+
1
);
tKzyUserIntegralFlowing
.
setIntegral
(
1
);
integral
=
1
;
}
else
if
(
loginUser
.
getSignInCount
()
==
3
)
{
loginUser
.
setIntegral
(
loginUser
.
getIntegral
()
+
3
);
loginUser
.
setSignInCount
(
loginUser
.
getSignInCount
()
+
1
);
tKzyUserIntegralFlowing
.
setIntegral
(
3
);
integral
=
3
;
}
else
if
(
loginUser
.
getSignInCount
()
==
4
)
{
loginUser
.
setIntegral
(
loginUser
.
getIntegral
()
+
3
);
loginUser
.
setSignInCount
(
loginUser
.
getSignInCount
()
+
1
);
tKzyUserIntegralFlowing
.
setIntegral
(
1
);
integral
=
1
;
}
else
if
(
loginUser
.
getSignInCount
()
==
5
)
{
loginUser
.
setIntegral
(
loginUser
.
getIntegral
()
+
5
);
loginUser
.
setSignInCount
(
1
);
integral
=
5
;
tKzyUserIntegralFlowing
.
setIntegral
(
5
);
}
else
{
loginUser
.
setIntegral
(
1
);
loginUser
.
setSignInCount
(
1
);
tKzyUserIntegralFlowing
.
setIntegral
(
1
);
integral
=
1
;
}
loginUser
.
setSignInCount
(
loginUser
.
getSignInCount
()
+
1
);
}
loginUser
.
setIntegral
(
loginUser
.
getIntegral
()
+
integral
);
tKzyUserIntegralFlowing
.
setIntegral
(
integral
);
loginUser
.
setLastSignDt
(
new
Date
());
tKzyUserMapper
.
updateByPrimaryKeySelective
(
loginUser
);
tKzyUserIntegralFlowingMapper
.
insertSelective
(
tKzyUserIntegralFlowing
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"integral"
,
integral
);
dataMap
.
put
(
"signInCount"
,
loginUser
.
getSignInCount
());
return
ResultMapUtil
.
returnMap
(
"1"
,
"操作成功!"
,
null
);
}
...
...
src/main/java/com/server/web/controller/CourseController.java
View file @
73bbaa4
...
...
@@ -7,10 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -44,7 +41,8 @@ public class CourseController extends BaseController {
*
* @return
*/
@RequestMapping
(
"/hotCourse"
)
@ResponseBody
@RequestMapping
(
value
=
"/hotCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
hotCourse
()
{
return
tKzyCourseService
.
hotCourse
();
}
...
...
@@ -54,7 +52,8 @@ public class CourseController extends BaseController {
*
* @return
*/
@RequestMapping
(
"/recordCourse"
)
@ResponseBody
@RequestMapping
(
value
=
"/recordCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
recordCourse
(
@RequestParam
(
value
=
"typeId"
,
required
=
false
)
Long
typeId
,
@RequestParam
(
value
=
"pageNo"
,
required
=
false
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
Integer
pageSize
)
{
return
tKzyCourseService
.
recordCourse
(
typeId
,
pageNo
,
pageSize
);
}
...
...
@@ -64,7 +63,8 @@ public class CourseController extends BaseController {
*
* @return
*/
@RequestMapping
(
"/livingCourse"
)
@ResponseBody
@RequestMapping
(
value
=
"/livingCourse"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
livingCourse
()
{
return
tKzyCourseService
.
livingCourse
();
}
...
...
@@ -74,7 +74,8 @@ public class CourseController extends BaseController {
*
* @return
*/
@RequestMapping
(
"/livingCourseDetail"
)
@ResponseBody
@RequestMapping
(
value
=
"/livingCourseDetail"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
livingCourseDetail
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"courseId"
,
required
=
true
)
Long
courseId
)
{
TKzyUser
tKzyUser
=
getLoginUser
(
request
);
Long
userId
=
null
;
...
...
@@ -89,7 +90,8 @@ public class CourseController extends BaseController {
*
* @return
*/
@RequestMapping
(
"/recordCourseDetail"
)
@ResponseBody
@RequestMapping
(
value
=
"/recordCourseDetail"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
recordCourseDetail
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"courseId"
,
required
=
true
)
Long
courseId
)
{
TKzyUser
tKzyUser
=
getLoginUser
(
request
);
Long
userId
=
null
;
...
...
@@ -105,7 +107,8 @@ public class CourseController extends BaseController {
* @param courseId
* @return
*/
@RequestMapping
(
"/commentList"
)
@ResponseBody
@RequestMapping
(
value
=
"/commentList"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
commentList
(
@RequestParam
(
value
=
"courseId"
)
Long
courseId
,
@RequestParam
(
value
=
"pageNo"
,
required
=
false
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
Integer
pageSize
)
{
return
tKzyCourseService
.
commentList
(
courseId
,
pageNo
,
pageSize
);
}
...
...
@@ -118,7 +121,8 @@ public class CourseController extends BaseController {
* @param comment
* @return
*/
@RequestMapping
(
"/comment"
)
@ResponseBody
@RequestMapping
(
value
=
"/comment"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
comment
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"courseId"
)
Long
courseId
,
@RequestParam
(
value
=
"comment"
)
String
comment
)
{
TKzyUser
tKzyUser
=
getLoginUser
(
request
);
Long
userId
=
null
;
...
...
@@ -135,7 +139,8 @@ public class CourseController extends BaseController {
* @param userId
* @return
*/
@RequestMapping
(
"/tmpSetSession"
)
@ResponseBody
@RequestMapping
(
value
=
"/tmpSetSession"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
tmpSetSession
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"userId"
,
required
=
true
)
Long
userId
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<
String
,
Object
>();
resultMap
.
put
(
"status"
,
"0"
);
...
...
src/main/java/com/server/web/controller/UserController.java
View file @
73bbaa4
...
...
@@ -28,7 +28,7 @@ public class UserController extends BaseController {
UserService
userService
;
@
Ge
tMapping
(
"/userData"
)
@
Pos
tMapping
(
"/userData"
)
public
Map
userData
(
HttpServletRequest
request
)
{
TKzyUser
loginUser
=
getLoginUser
(
request
);
return
returnSuccess
(
loginUser
);
...
...
@@ -221,7 +221,8 @@ public class UserController extends BaseController {
* @param request
* @return
*/
@GetMapping
(
"/signIn"
)
@ResponseBody
@RequestMapping
(
value
=
"/signIn"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
signIn
(
HttpServletRequest
request
)
{
TKzyUser
loginUser
=
getLoginUser
(
request
);
if
(
loginUser
==
null
||
loginUser
.
getId
()
==
null
)
{
...
...
@@ -236,7 +237,8 @@ public class UserController extends BaseController {
* @param request
* @return
*/
@GetMapping
(
"/signInList"
)
@ResponseBody
@RequestMapping
(
value
=
"/signInList"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
produces
=
"application/json"
)
public
Map
<
String
,
Object
>
signInList
(
HttpServletRequest
request
)
{
TKzyUser
loginUser
=
getLoginUser
(
request
);
if
(
loginUser
==
null
||
loginUser
.
getId
()
==
null
)
{
...
...
src/main/resources/mybatis/mapping/IntegralMapper.xml
View file @
73bbaa4
...
...
@@ -5,7 +5,7 @@
<select
id=
"signInList"
parameterType=
"java.util.HashMap"
resultType=
"java.util.HashMap"
>
SELECT
t.id,
t.create_dt AS
t.
createDt,
t.create_dt AS createDt,
t.integral
FROM
t_kzy_user_integral_flowing t
...
...
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