Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
b7640683
提交
b7640683
authored
11月 15, 2023
作者:
刘明祎-运维用途
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
12651e16
ebc14bdc
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
84 行增加
和
6 行删除
+84
-6
UserPointsController.java
...iuav/user/controller/userpoints/UserPointsController.java
+7
-4
UserPointsDetailsDao.java
...om/mmc/iuav/user/dao/userpoints/UserPointsDetailsDao.java
+8
-0
UserPointChangeTypeDO.java
...mc/iuav/user/entity/userpoints/UserPointChangeTypeDO.java
+22
-0
AuthServiceImpl.java
.../java/com/mmc/iuav/user/service/impl/AuthServiceImpl.java
+3
-1
UserPointsService.java
...m/mmc/iuav/user/service/userpoints/UserPointsService.java
+9
-0
UserPointsServiceImpl.java
...v/user/service/userpoints/impl/UserPointsServiceImpl.java
+31
-0
UserPointsDetailsDao.xml
...main/resources/mapper/userpoints/UserPointsDetailsDao.xml
+3
-0
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
没有找到文件。
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/userpoints/UserPointsController.java
浏览文件 @
b7640683
...
...
@@ -15,10 +15,7 @@ import com.mmc.iuav.user.service.userpoints.UserPointsService;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -74,4 +71,10 @@ public class UserPointsController extends BaseController {
}
@ApiOperation
(
value
=
"积分变动接口"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/changeUserPoints"
)
public
ResultBody
changeUserPoints
(
HttpServletRequest
request
,
@RequestParam
(
"id"
)
Integer
id
)
{
return
userPointsService
.
changeUserPoints
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
id
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/userpoints/UserPointsDetailsDao.java
浏览文件 @
b7640683
package
com
.
mmc
.
iuav
.
user
.
dao
.
userpoints
;
import
com.mmc.iuav.user.entity.userpoints.UserPointChangeTypeDO
;
import
com.mmc.iuav.user.entity.userpoints.UserPointsDetails
;
import
com.mmc.iuav.user.model.qo.userpoints.AppPointsDetailsQO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO
;
...
...
@@ -23,4 +24,11 @@ public interface UserPointsDetailsDao {
List
<
UserPointsDetails
>
appDetailPoint
(
AppPointsDetailsQO
param
);
int
appDetailPointCount
(
AppPointsDetailsQO
param
);
/**
* 查找积分变动类型表 user_points_change_type
* @param id 积分变动表id
* @return {@link UserPointChangeTypeDO}
*/
UserPointChangeTypeDO
selectChangePoint
(
Integer
id
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/userpoints/UserPointChangeTypeDO.java
0 → 100644
浏览文件 @
b7640683
package
com
.
mmc
.
iuav
.
user
.
entity
.
userpoints
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author Admin
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
UserPointChangeTypeDO
{
@ApiModelProperty
(
value
=
"积分变动类型id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"变动多少积分"
)
private
Integer
changePoint
;
@ApiModelProperty
(
value
=
"变动积分说明"
)
private
String
pointSource
;
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/AuthServiceImpl.java
浏览文件 @
b7640683
...
...
@@ -94,6 +94,7 @@ public class AuthServiceImpl implements AuthService {
String
unionId
;
String
openId
;
String
sessionKey
;
log
.
info
(
"上级推荐人:{}"
,
wxLoginVO
.
getRcdUserId
());
if
(
wxLoginVO
.
getFromPort
().
toString
().
equals
(
WxConstant
.
APP
.
toString
()))
{
//调用小程序登录接口,里面包含unionId
String
appWxJson
=
wxService
.
appLogin
(
wxLoginVO
);
...
...
@@ -134,6 +135,7 @@ public class AuthServiceImpl implements AuthService {
nameAuthByUnionId
.
setId
(
null
);
realNameAuthDao
.
addRealNameAuth
(
nameAuthByUnionId
);
}
log
.
info
(
"用户的id是=====》{}"
,
userAccountDO
.
getId
());
}
else
{
CompanyAuthDO
companyAuthDO
=
companyAuthDao
.
getCompanyAuth
(
userAccountVO
.
getId
());
companyAuthStatus
=
companyAuthDO
==
null
?
0
:
1
;
...
...
@@ -142,7 +144,7 @@ public class AuthServiceImpl implements AuthService {
AppUserSucVO
appUserSucVO
=
authHandler
.
addAppLoginCache
(
userAccountVO
);
appUserSucVO
.
setAuthStatus
(
companyAuthStatus
);
appUserSucVO
.
setSessionKey
(
sessionKey
);
log
.
info
(
"判断是不是新用户 =====》 {}"
,
isNewPilot
);
//判断是不是新用户只有新用户才会执行添加积分代码
if
(!
isNewPilot
)
{
return
ResultBody
.
success
(
appUserSucVO
);
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/userpoints/UserPointsService.java
浏览文件 @
b7640683
...
...
@@ -22,4 +22,13 @@ public interface UserPointsService {
ResultBody
change
(
ChangeUserPointVO
changePoint
);
ResultBody
listChangeType
();
/**
* 改变用户积分,
* @param userId 用户id
* @param pointChangeTypeId 根据这个id去user_points_change_type表中查找需要修改多少积分
* @return {@link ResultBody}
*/
ResultBody
changeUserPoints
(
Integer
userId
,
Integer
pointChangeTypeId
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/userpoints/impl/UserPointsServiceImpl.java
浏览文件 @
b7640683
...
...
@@ -5,6 +5,7 @@ import com.mmc.iuav.response.ResultBody;
import
com.mmc.iuav.user.controller.userpoints.config.UserPointsEnum
;
import
com.mmc.iuav.user.dao.userpoints.UserPointsDao
;
import
com.mmc.iuav.user.dao.userpoints.UserPointsDetailsDao
;
import
com.mmc.iuav.user.entity.userpoints.UserPointChangeTypeDO
;
import
com.mmc.iuav.user.entity.userpoints.UserPointsDO
;
import
com.mmc.iuav.user.entity.userpoints.UserPointsDetails
;
import
com.mmc.iuav.user.model.dto.userpoints.UserPointsDTO
;
...
...
@@ -15,6 +16,7 @@ import com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO;
import
com.mmc.iuav.user.model.vo.userpoints.ChangeUserPointVO
;
import
com.mmc.iuav.user.model.vo.userpoints.PointTypeVO
;
import
com.mmc.iuav.user.service.userpoints.UserPointsService
;
import
io.swagger.models.auth.In
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -110,4 +112,33 @@ public class UserPointsServiceImpl implements UserPointsService {
}
return
ResultBody
.
success
(
types
);
}
@Override
public
ResultBody
changeUserPoints
(
Integer
userId
,
Integer
pointChangeTypeId
)
{
//先根据积分变动id pointChangeTypeId 去找到积分变动类型信息
UserPointChangeTypeDO
userPointChangeTypeDO
=
userPointsDetailsDao
.
selectChangePoint
(
pointChangeTypeId
);
if
(
userPointChangeTypeDO
==
null
)
{
return
ResultBody
.
error
(
"扣除积分类型不存在"
);
}
UserPointsDO
userPointsDO
=
userPointsDao
.
selectUserPoints
(
userId
);
if
(
userPointsDO
==
null
)
{
userPointsDO
.
setUserAccountId
(
userId
);
userPointsDO
.
setTotalPoints
(
0
);
userPointsDao
.
insertPoints
(
userPointsDO
);
}
//用户更改完积分后如果小于0就代表积分不够 大于0就去修改数据库用户总积分
//改变的积分
Integer
changePoint
=
userPointChangeTypeDO
.
getChangePoint
();
//改变后的用户总积分
Integer
userNowPoints
=
userPointsDO
.
getTotalPoints
()
+
changePoint
;
if
(
userNowPoints
<
0
)
{
return
ResultBody
.
error
(
"积分不足,请先去赚取积分"
);
}
userPointsDO
.
setTotalPoints
(
userNowPoints
);
userPointsDao
.
updatePoints
(
userPointsDO
);
//添加一条积分变动记录
UserPointsDetails
userPointsDetails
=
new
UserPointsDetails
(
userId
,
changePoint
,
userPointChangeTypeDO
.
getPointSource
());
userPointsDetailsDao
.
insertPointsDetails
(
userPointsDetails
);
return
ResultBody
.
success
();
}
}
csm-service/cms-service-user/src/main/resources/mapper/userpoints/UserPointsDetailsDao.xml
浏览文件 @
b7640683
...
...
@@ -74,4 +74,7 @@
WHERE ua.`disable` = 0
AND upd.user_account_id = #{userAccountId}
</select>
<select
id=
"selectChangePoint"
resultType=
"com.mmc.iuav.user.entity.userpoints.UserPointChangeTypeDO"
>
select id,change_point,point_source from user_points_change_type where id = #{id}
</select>
</mapper>
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
b7640683
...
...
@@ -18,4 +18,4 @@ patches:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag
:
d57e7944a98a52f3d842cf3d6b315a427710f632
newTag
:
45a89ad3beb8e63b5547d02f6e1e55724193c8a6
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论