Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
fb71804a
Commit
fb71804a
authored
Aug 08, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网关日志限制修改
parent
17e2e6b1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
20 deletions
+50
-20
IntegralRuleBiz.java
.../java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
+4
-4
IntegralUserStatusBiz.java
...com/xxfc/platform/activity/biz/IntegralUserStatusBiz.java
+11
-11
IntegralUserStatusMapper.java
...fc/platform/activity/mapper/IntegralUserStatusMapper.java
+3
-2
IntegralSignRecordMapper.xml
...er/src/main/resources/mapper/IntegralSignRecordMapper.xml
+1
-1
IntegralUserStatusMapper.xml
...er/src/main/resources/mapper/IntegralUserStatusMapper.xml
+5
-2
UserBiz.java
...erver/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
+20
-0
UserController.java
...c/main/java/com/xxfc/platform/im/rest/UserController.java
+6
-0
No files found.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
View file @
fb71804a
...
...
@@ -103,10 +103,10 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
public
void
getIntegralStatus
(
AppUserDTO
appUserDTO
,
IntegralRule
integralRule
)
{
IntegralUserStatus
integralUserStatus1
=
integralUserStatusBiz
.
selectByUserAndCode
(
integralRule
.
getCode
(),
appUserDTO
.
getUserid
());
if
(
integralUserStatus1
!=
null
)
{
integralRule
.
setIntegralStatus
(
integralUserStatus1
.
getIntegralStatus
());
}
List
<
IntegralUserStatus
>
oldValue
=
integralUserStatusBiz
.
selectByUserAndCode
(
integralRule
.
getCode
(),
appUserDTO
.
getUserid
());
if
(
oldValue
!=
null
&&
oldValue
.
size
()
>
0
)
{
integralRule
.
setIntegralStatus
(
oldValue
.
get
(
0
)
.
getIntegralStatus
());
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralUserStatusBiz.java
View file @
fb71804a
...
...
@@ -6,12 +6,13 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.activity.entity.IntegralUserStatus
;
import
com.xxfc.platform.activity.mapper.IntegralUserStatusMapper
;
import
com.xxfc.platform.activity.util.IntegralToolsUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.
TimeZone
;
import
java.util.
List
;
@Service
@Transactional
...
...
@@ -20,26 +21,25 @@ public class IntegralUserStatusBiz extends BaseBiz<IntegralUserStatusMapper, Int
public
ObjectRestResponse
save
(
IntegralUserStatus
integralUserStatus
)
{
if
(
integralUserStatus
!=
null
)
{
IntegralUserStatus
oldValue
=
mapper
.
selectByUserAndCode
(
integralUserStatus
);
if
(
oldValue
!=
null
)
{
BeanUtil
.
copyProperties
(
integralUserStatus
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveById
(
oldValue
);
List
<
IntegralUserStatus
>
oldValue
=
selectByUserAndCode
(
integralUserStatus
.
getIntegralRuleCode
(),
integralUserStatus
.
getUserId
()
);
if
(
oldValue
!=
null
&&
oldValue
.
size
()
>
0
)
{
BeanUtil
.
copyProperties
(
integralUserStatus
,
oldValue
.
get
(
0
)
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveById
(
oldValue
.
get
(
0
)
);
}
insertSelective
(
integralUserStatus
);
}
return
ObjectRestResponse
.
succ
();
}
public
IntegralUserStatus
selectByUserAndCode
(
String
code
,
Integer
userId
)
{
public
List
<
IntegralUserStatus
>
selectByUserAndCode
(
String
code
,
Integer
userId
)
{
if
(!
StringUtils
.
isAllBlank
(
code
,
userId
+
""
))
{
long
current
=
System
.
currentTimeMillis
();
long
startTime
=
current
/
(
1000
*
3600
*
24
)
*
(
1000
*
3600
*
24
)
-
TimeZone
.
getDefault
().
getRawOffset
();
IntegralUserStatus
integralUserStatus
=
new
IntegralUserStatus
();
integralUserStatus
.
setIntegralRuleCode
(
code
);
integralUserStatus
.
setUserId
(
userId
);
integralUserStatus
.
setStartTime
(
startTime
);
integralUserStatus
.
setEndTime
(
startTime
+
24
*
60
*
60
*
1000
-
1
);
if
(!
"REGISTER"
.
equals
(
code
)
&&
!
"CRETIFICATION"
.
equals
(
code
)
&&
!
"BINDWECHAT"
.
equals
(
code
))
{
integralUserStatus
.
setStartTime
(
IntegralToolsUtils
.
getDayStart
());
integralUserStatus
.
setEndTime
(
IntegralToolsUtils
.
getDayStart
()
+
24
*
60
*
60
*
1000
);
}
log
.
info
(
"获取用户积分状态:"
+
integralUserStatus
.
toString
());
return
mapper
.
selectByUserAndCode
(
integralUserStatus
);
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/IntegralUserStatusMapper.java
View file @
fb71804a
...
...
@@ -3,8 +3,9 @@ package com.xxfc.platform.activity.mapper;
import
com.xxfc.platform.activity.entity.IntegralUserStatus
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
IntegralUserStatusMapper
extends
Mapper
<
IntegralUserStatus
>
{
import
java.util.List
;
IntegralUserStatus
selectByUserAndCode
(
IntegralUserStatus
integralUserStatus
);
public
interface
IntegralUserStatusMapper
extends
Mapper
<
IntegralUserStatus
>
{
List
<
IntegralUserStatus
>
selectByUserAndCode
(
IntegralUserStatus
integralUserStatus
);
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralSignRecordMapper.xml
View file @
fb71804a
...
...
@@ -12,7 +12,7 @@
<result
column=
"last_time"
property=
"lastTime"
jdbcType=
"BIGINT"
/>
</resultMap>
<select
id=
"
selectByUser
Id"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.activity.entity.IntegralSignRecord"
>
<select
id=
"Id"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.activity.entity.IntegralSignRecord"
>
select * from integral_sign_record
where user_id = #{userId} and isdel = 0
order by last_time
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralUserStatusMapper.xml
View file @
fb71804a
...
...
@@ -10,7 +10,10 @@
<select
id=
"selectByUserAndCode"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserStatus"
parameterType=
"com.xxfc.platform.activity.entity.IntegralUserStatus"
>
select * from integral_user_status
where integral_rule_code = #{integralRuleCode} and user_id = #{userId}
and crt_time between #{startTime} and #{endTime} and integral_status =1
where integral_rule_code = #{integralRuleCode} and user_id = #{userId} and integral_status =1
<if
test=
"startTime != null"
>
and crt_time between #{startTime} and #{endTime}
</if>
order by upd_time DESC
</select>
</mapper>
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
View file @
fb71804a
...
...
@@ -5,14 +5,18 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.mongodb.client.result.UpdateResult
;
import
com.xxfc.platform.im.model.User
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
...
@@ -112,6 +116,22 @@ public class UserBiz {
return
json
.
toJSONString
();
}
public
ObjectRestResponse
updateUserInfo
(
String
nickname
)
{
AppUserDTO
appUserDTO
=
getUserInfo
();
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"token失效"
);
}
if
(
StringUtils
.
isBlank
(
nickname
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
String
phone
=
appUserDTO
.
getUsername
();
Query
query
=
new
Query
(
Criteria
.
where
(
"phone"
).
is
(
phone
));
Update
update
=
Update
.
update
(
"nickname"
,
nickname
);
UpdateResult
updateResult
=
mongoTemplate
.
updateFirst
(
query
,
update
,
Map
.
class
,
"user"
);
return
ObjectRestResponse
.
succ
(
updateResult
);
}
/**
* 远程请求
* @param path
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/UserController.java
View file @
fb71804a
...
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.im.rest;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.im.biz.UserBiz
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -42,4 +43,9 @@ public class UserController {
baseResponse
.
setMessage
(
result
);
return
baseResponse
;
}
@PostMapping
(
value
=
"/update"
)
public
ObjectRestResponse
updateUserInfo
(
String
nickname
)
{
return
mtBiz
.
updateUserInfo
(
nickname
);
}
}
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