Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
aebfde68
提交
aebfde68
authored
3月 09, 2024
作者:
刘明祎-运维用途
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
97f3fee1
202a75b5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
506 行增加
和
14 行删除
+506
-14
BuyPointsVO.java
...src/main/java/com/mmc/iuav/user/model/vo/BuyPointsVO.java
+31
-0
MessageTimePointsVO.java
.../java/com/mmc/iuav/user/model/vo/MessageTimePointsVO.java
+27
-0
MessageTimeVO.java
...c/main/java/com/mmc/iuav/user/model/vo/MessageTimeVO.java
+30
-0
OrderRequestParamsVO.java
...java/com/mmc/iuav/user/model/vo/OrderRequestParamsVO.java
+24
-0
ResultEnum.java
...-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
+1
-0
pom.xml
csm-service/cms-service-user/pom.xml
+24
-1
UserApplication.java
...user/src/main/java/com/mmc/iuav/user/UserApplication.java
+2
-1
MessageController.java
.../java/com/mmc/iuav/user/controller/MessageController.java
+61
-0
UserPointsController.java
...iuav/user/controller/userpoints/UserPointsController.java
+36
-0
UserPointsEnum.java
...uav/user/controller/userpoints/config/UserPointsEnum.java
+2
-1
MessageDao.java
...-user/src/main/java/com/mmc/iuav/user/dao/MessageDao.java
+5
-0
UserPointsDao.java
.../java/com/mmc/iuav/user/dao/userpoints/UserPointsDao.java
+9
-1
PaymentAppApi.java
.../src/main/java/com/mmc/iuav/user/feign/PaymentAppApi.java
+19
-0
FeignConfiguration.java
...va/com/mmc/iuav/user/feign/config/FeignConfiguration.java
+20
-0
PaymentAppApiHystrix.java
...com/mmc/iuav/user/feign/hystrix/PaymentAppApiHystrix.java
+23
-0
MessageService.java
...c/main/java/com/mmc/iuav/user/service/MessageService.java
+24
-0
MessageServiceImpl.java
...va/com/mmc/iuav/user/service/impl/MessageServiceImpl.java
+0
-0
UserPointsService.java
...m/mmc/iuav/user/service/userpoints/UserPointsService.java
+10
-0
UserPointsServiceImpl.java
...v/user/service/userpoints/impl/UserPointsServiceImpl.java
+77
-3
PayWalletServiceImpl.java
...c/iuav/user/service/wallet/impl/PayWalletServiceImpl.java
+1
-1
MessageDao.xml
...cms-service-user/src/main/resources/mapper/MessageDao.xml
+44
-5
UserPointsDao.xml
...er/src/main/resources/mapper/userpoints/UserPointsDao.xml
+33
-0
not-check.yml
...service/cms-service-user/src/main/resources/not-check.yml
+2
-0
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
没有找到文件。
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/BuyPointsVO.java
0 → 100644
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
BuyPointsVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1481188328848093579L
;
@ApiModelProperty
(
value
=
"购买积分类型展示"
,
example
=
"1"
)
@NotNull
(
message
=
"类型不能为空"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"微信支付金额"
,
example
=
"10"
)
private
BigDecimal
money
;
@ApiModelProperty
(
value
=
"购买的积分数额"
,
example
=
"200"
)
private
Integer
points
;
private
Date
createTime
;
private
Date
updateTime
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/MessageTimePointsVO.java
0 → 100644
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
MessageTimePointsVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1481188328848093579L
;
@ApiModelProperty
(
value
=
"购买聊天时长的类型id,唯一识别id"
,
example
=
"1"
)
@NotNull
(
message
=
"类型id不能为空"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"购买的积分数额"
,
example
=
"200"
)
private
Integer
points
;
@ApiModelProperty
(
value
=
"聊天时长,单位(天)"
,
example
=
"7"
)
private
Integer
chatDuration
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/MessageTimeVO.java
0 → 100644
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
MessageTimeVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1481188328848093579L
;
@ApiModelProperty
(
value
=
"购买聊天时长的类型id,唯一识别id"
,
example
=
"1"
)
@NotNull
(
message
=
"类型id不能为空"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"微信支付金额,单位(元)"
,
example
=
"5"
)
private
BigDecimal
money
;
@ApiModelProperty
(
value
=
"购买的积分数额"
,
example
=
"200"
)
private
Integer
points
;
@ApiModelProperty
(
value
=
"聊天时长,单位(天)"
,
example
=
"7"
)
private
Integer
chatDuration
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/OrderRequestParamsVO.java
0 → 100644
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
OrderRequestParamsVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"订单编号"
)
private
String
orderNo
;
@ApiModelProperty
(
value
=
"商品描述"
)
private
String
description
;
@ApiModelProperty
(
value
=
"订单金额(分为单位)"
)
private
Integer
amount
;
@ApiModelProperty
(
value
=
"订单来源 0:产品商城 1:租赁订单 2:培训订单 3:充值云享金 ...其他后续加"
)
private
Integer
orderPort
;
@ApiModelProperty
(
value
=
"附加参数 :附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用,实际情况下只有支付完成状态才会返回该字段。"
)
private
String
attach
;
}
cms-common/cms-common-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
浏览文件 @
aebfde68
...
...
@@ -66,6 +66,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR
(
"8012"
,
"绑定企业为加盟公司,禁止使用该单位"
),
NO_RIGHT_UPDATE_ERROR
(
"8013"
,
"无权限操作"
),
NO_CHAT_ERROR
(
"9001"
,
"请先花费积分购买聊天时长"
),
ID_INFO_AND_ID_card_MISMATCH
(
"3904"
,
"身份信息与身份证不匹配"
),
INTERFACE_ACCESS_EXCEPTION
(
"36894"
,
"接口访问异常/次数用尽"
),
FRONT_BACK_VAGUE
(
"35556"
,
"身份证正反面不明确"
),
...
...
csm-service/cms-service-user/pom.xml
浏览文件 @
aebfde68
...
...
@@ -39,7 +39,30 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<!-- 引入 Feign, 可以以声明的方式调用微服务 -->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
<version>
2.2.9.RELEASE
</version>
</dependency>
<!-- 使用okhttp-feign-连接池技术 -->
<dependency>
<groupId>
io.github.openfeign
</groupId>
<artifactId>
feign-okhttp
</artifactId>
<version>
10.12
</version>
</dependency>
<!-- 引入服务容错 Hystrix 的依赖 -->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-hystrix
</artifactId>
<exclusions>
<exclusion>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
</exclusion>
</exclusions>
<version>
2.2.9.RELEASE
</version>
</dependency>
<!-- mybatis驱动&Druid数据源-start -->
<dependency>
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/UserApplication.java
浏览文件 @
aebfde68
...
...
@@ -2,16 +2,17 @@ package com.mmc.iuav.user;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.web.client.RestTemplate
;
/**
* @author:zhenjie
* @Date:2023/5/15 15:35
*/
@EnableScheduling
@SpringBootApplication
@EnableFeignClients
(
basePackages
=
"com.mmc.iuav.user.feign"
)
// 所有FeignClient放在client-feign-springboot-starter里面进行管理
public
class
UserApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
UserApplication
.
class
,
args
);
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/MessageController.java
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
controller
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.qo.MessageQO
;
import
com.mmc.iuav.user.model.qo.MessageUserQO
;
import
com.mmc.iuav.user.model.vo.MessageTimePointsVO
;
import
com.mmc.iuav.user.model.vo.MessageTimeVO
;
import
com.mmc.iuav.user.model.vo.SystemMessageVO
;
import
com.mmc.iuav.user.model.vo.UserMessageVO
;
import
com.mmc.iuav.user.service.MessageService
;
...
...
@@ -76,6 +79,13 @@ public class MessageController extends BaseController{
return
messageService
.
insertUserMessage
(
messageVO
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
@ApiOperation
(
value
=
"查看用户是否购买聊天"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/isPurchaseTime"
)
public
ResultBody
isPurchaseTime
(
HttpServletRequest
request
){
return
messageService
.
isPurchaseTime
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
@ApiOperation
(
value
=
"用户聊天详细信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/selectUserMessage"
)
...
...
@@ -102,4 +112,55 @@ public class MessageController extends BaseController{
return
messageService
.
removeUserMessage
(
id
);
}
// @ApiOperation(value = "购买聊天时长(积分或微信支付)")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @PostMapping("/purchaseTime")
// public ResultBody purchaseTime(HttpServletRequest request,@RequestBody MessageTimeVO messageTimeVO){
// LoginSuccessDTO userLoginInfoFromRedis = this.getUserLoginInfoFromRedis(request);
// Integer userAccountId = userLoginInfoFromRedis.getUserAccountId();
// String token = userLoginInfoFromRedis.getToken();
// return messageService.purchaseTime(userAccountId,messageTimeVO,token);
// }
@ApiOperation
(
value
=
"购买聊天时长(积分)"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/purchaseTimeByPoints"
)
public
ResultBody
purchaseTimeByPoints
(
HttpServletRequest
request
,
@RequestBody
MessageTimePointsVO
messageTimeVO
){
LoginSuccessDTO
userLoginInfoFromRedis
=
this
.
getUserLoginInfoFromRedis
(
request
);
Integer
userAccountId
=
userLoginInfoFromRedis
.
getUserAccountId
();
return
messageService
.
purchaseTimeByPoints
(
userAccountId
,
messageTimeVO
);
}
@ApiOperation
(
value
=
"购买聊天时长(微信支付成功)"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/purchaseTimeByWechat"
)
public
ResultBody
purchaseTimeByWechat
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"购买聊天时长的类型id,唯一识别id"
,
required
=
true
)
@RequestParam
Integer
typeId
){
LoginSuccessDTO
userLoginInfoFromRedis
=
this
.
getUserLoginInfoFromRedis
(
request
);
Integer
userAccountId
=
userLoginInfoFromRedis
.
getUserAccountId
();
return
messageService
.
purchaseTimeByWechat
(
userAccountId
,
typeId
);
}
@ApiOperation
(
value
=
"返回给小程序端聊天时长选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/listTimeType"
)
public
ResultBody
listTimeType
(){
return
messageService
.
listTimeType
();
}
@ApiOperation
(
value
=
"后台管理——修改聊天时长选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/updateTimeType"
)
public
ResultBody
updateTimeType
(
@RequestBody
MessageTimeVO
messageTimeVO
){
return
messageService
.
updateTimeType
(
messageTimeVO
);
}
@ApiOperation
(
value
=
"后台管理——新增聊天时长选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/insertTimeType"
)
public
ResultBody
insertTimeType
(
@RequestBody
MessageTimeVO
messageTimeVO
){
return
messageService
.
insertTimeType
(
messageTimeVO
);
}
@ApiOperation
(
value
=
"根据类型ID返回聊天时长选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/timeTypeById"
)
public
Integer
timeTypeById
(
@ApiParam
(
value
=
"购买聊天时长的类型id,唯一识别id"
,
required
=
true
)
Integer
typeId
){
return
messageService
.
timeTypeById
(
typeId
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/userpoints/UserPointsController.java
浏览文件 @
aebfde68
...
...
@@ -10,6 +10,7 @@ import com.mmc.iuav.user.model.dto.userpoints.UserPointsDetailsDTO;
import
com.mmc.iuav.user.model.qo.userpoints.AppPointsDetailsQO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointQO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO
;
import
com.mmc.iuav.user.model.vo.BuyPointsVO
;
import
com.mmc.iuav.user.model.vo.userpoints.ChangeUserPointVO
;
import
com.mmc.iuav.user.service.userpoints.UserPointsService
;
import
io.swagger.annotations.*
;
...
...
@@ -86,4 +87,39 @@ public class UserPointsController extends BaseController {
public
ResultBody
feignChangeUserPoints
(
HttpServletRequest
request
,
@RequestParam
(
"id"
)
int
changePoint
,
String
reason
)
{
return
userPointsService
.
changeUserPoints
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
null
,
changePoint
,
reason
);
}
@ApiOperation
(
value
=
"用户购买积分(微信支付已成功)"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/weixinBuyPoints"
)
public
ResultBody
weixinBuyPoints
(
@RequestBody
BuyPointsVO
buyPointsVO
,
HttpServletRequest
request
)
{
return
userPointsService
.
weixinBuyPoints
(
buyPointsVO
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
this
.
getUserLoginInfoFromRedis
(
request
).
getToken
());
}
@ApiOperation
(
value
=
"返回购买积分选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/selectAllBuyPointsType"
)
public
ResultBody
selectAllBuyPointsType
(){
return
userPointsService
.
selectAllBuyPointsType
();
}
@ApiOperation
(
value
=
"后台管理——修改购买积分选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/updateBuyPointsType"
)
public
ResultBody
updateBuyPointsType
(
@RequestBody
BuyPointsVO
buyPointsVO
){
return
userPointsService
.
updateBuyPointsType
(
buyPointsVO
);
}
@ApiOperation
(
value
=
"后台管理——新增购买积分选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/insertBuyPointsType"
)
public
ResultBody
insertBuyPointsType
(
@RequestBody
BuyPointsVO
buyPointsVO
){
return
userPointsService
.
insertBuyPointsType
(
buyPointsVO
);
}
@ApiOperation
(
value
=
"根据类型ID返回购买积分选购类型"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/buyPointsTypeById"
)
public
Integer
buyPointsTypeById
(
@ApiParam
(
value
=
"购买积分的类型id,唯一识别id"
,
required
=
true
)
Integer
typeId
){
return
userPointsService
.
buyPointsTypeById
(
typeId
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/userpoints/config/UserPointsEnum.java
浏览文件 @
aebfde68
...
...
@@ -15,8 +15,9 @@ public enum UserPointsEnum {
OTHER_CHANGE
(
5
,
"其他变动"
),
USER_USE
(
6
,
"使用"
),
INVITE_USER
(
7
,
"邀请用户"
),
BUY_TIME
(
8
,
"购买聊天时长"
),
BUY_POINT
(
9
,
"购买积分"
)
;
private
int
code
;
private
String
message
;
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/MessageDao.java
浏览文件 @
aebfde68
...
...
@@ -5,6 +5,7 @@ import com.mmc.iuav.user.entity.UserMessageDO;
import
com.mmc.iuav.user.entity.UserMessageLogDO
;
import
com.mmc.iuav.user.model.qo.MessageQO
;
import
com.mmc.iuav.user.model.qo.MessageUserQO
;
import
com.mmc.iuav.user.model.vo.MessageTimeVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -113,4 +114,8 @@ public interface MessageDao {
void
removeUserMessageLog
(
@Param
(
"id"
)
Integer
logId
);
UserMessageDO
selectUserMessageById
(
@Param
(
"id"
)
Integer
id
);
MessageTimeVO
selectUserMessageTimeType
(
@Param
(
"id"
)
Integer
id
);
List
<
MessageTimeVO
>
listTimeType
();
void
updateTimeType
(
MessageTimeVO
messageTimeVO
);
void
insertTimeType
(
MessageTimeVO
messageTimeVO
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/userpoints/UserPointsDao.java
浏览文件 @
aebfde68
...
...
@@ -2,7 +2,9 @@ package com.mmc.iuav.user.dao.userpoints;
import
com.mmc.iuav.user.entity.userpoints.UserPointsDO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointQO
;
import
com.mmc.iuav.user.model.vo.BuyPointsVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -22,5 +24,11 @@ public interface UserPointsDao {
List
<
UserPointsDO
>
userPointList
(
UserPointQO
param
);
int
count
(
UserPointQO
param
);
BuyPointsVO
selectBuyPointsType
(
@Param
(
"id"
)
Integer
id
);
List
<
BuyPointsVO
>
selectAllBuyPointsType
();
void
insertBuyPointsType
(
BuyPointsVO
buyPointsVO
);
void
updateBuyPointsType
(
BuyPointsVO
buyPointsVO
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/feign/PaymentAppApi.java
0 → 100644
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
feign
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.feign.hystrix.PaymentAppApiHystrix
;
import
com.mmc.iuav.user.model.vo.OrderRequestParamsVO
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
@FeignClient
(
url
=
"${iuav.pay.uri}"
,
name
=
"payment-svc"
,
fallback
=
PaymentAppApiHystrix
.
class
)
public
interface
PaymentAppApi
{
@PostMapping
(
"/payment/wechat/pay"
)
Map
orderPay
(
@RequestBody
OrderRequestParamsVO
orderRequestParamsVO
,
@RequestHeader
(
"token"
)
String
token
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/feign/config/FeignConfiguration.java
0 → 100644
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
feign
.
config
;
import
com.mmc.iuav.user.feign.hystrix.PaymentAppApiHystrix
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
/**
* @author: zj
* @Date: 2023/5/18 18:21
*/
@ComponentScan
(
basePackages
=
"com.mmc.iuav.user.feign"
)
@Configuration
public
class
FeignConfiguration
{
@Bean
(
name
=
"paymentAppApiHystrix"
)
public
PaymentAppApiHystrix
userAppApi
(){
return
new
PaymentAppApiHystrix
();
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/feign/hystrix/PaymentAppApiHystrix.java
0 → 100644
浏览文件 @
aebfde68
package
com
.
mmc
.
iuav
.
user
.
feign
.
hystrix
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.feign.PaymentAppApi
;
import
com.mmc.iuav.user.model.vo.OrderRequestParamsVO
;
import
lombok.extern.slf4j.Slf4j
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
/**
* @author: zj
* @Date: 2023/6/10 20:24
*/
@Slf4j
public
class
PaymentAppApiHystrix
implements
PaymentAppApi
{
@Override
public
Map
orderPay
(
OrderRequestParamsVO
orderRequestParamsVO
,
String
token
)
{
log
.
info
(
"熔断--feignOrderPay:"
);
return
null
;
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/MessageService.java
浏览文件 @
aebfde68
...
...
@@ -4,6 +4,8 @@ import com.mmc.iuav.page.PageResult;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.qo.MessageQO
;
import
com.mmc.iuav.user.model.qo.MessageUserQO
;
import
com.mmc.iuav.user.model.vo.MessageTimePointsVO
;
import
com.mmc.iuav.user.model.vo.MessageTimeVO
;
import
com.mmc.iuav.user.model.vo.SystemMessageVO
;
import
com.mmc.iuav.user.model.vo.UserMessageVO
;
...
...
@@ -63,6 +65,16 @@ public interface MessageService {
*/
ResultBody
insertUserMessage
(
UserMessageVO
messageVO
,
Integer
senderUserId
);
/**
* 查看用户是否购买聊天时长
* @param UserId
* @return {@link ResultBody}
*/
ResultBody
isPurchaseTime
(
Integer
UserId
);
PageResult
selectUserMessage
(
MessageUserQO
messageQO
,
Integer
senderUserId
);
ResultBody
selectUserList
(
Integer
senderUserId
);
...
...
@@ -70,4 +82,16 @@ public interface MessageService {
ResultBody
removeUserMessage
(
Integer
id
);
ResultBody
removeUser
(
Integer
senderUserId
,
Integer
receiverUserId
);
// ResultBody purchaseTime(Integer userAccountId, MessageTimeVO messageTimeVO, String token);
ResultBody
purchaseTimeByPoints
(
Integer
userAccountId
,
MessageTimePointsVO
messageTimeVO
);
ResultBody
purchaseTimeByWechat
(
Integer
userAccountId
,
Integer
id
);
ResultBody
listTimeType
();
ResultBody
updateTimeType
(
MessageTimeVO
messageTimeVO
);
ResultBody
insertTimeType
(
MessageTimeVO
messageTimeVO
);
Integer
timeTypeById
(
Integer
id
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/MessageServiceImpl.java
浏览文件 @
aebfde68
差异被折叠。
点击展开。
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/userpoints/UserPointsService.java
浏览文件 @
aebfde68
...
...
@@ -5,6 +5,7 @@ import com.mmc.iuav.response.ResultBody;
import
com.mmc.iuav.user.model.qo.userpoints.AppPointsDetailsQO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointQO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO
;
import
com.mmc.iuav.user.model.vo.BuyPointsVO
;
import
com.mmc.iuav.user.model.vo.userpoints.ChangeUserPointVO
;
/**
...
...
@@ -34,4 +35,13 @@ public interface UserPointsService {
*/
ResultBody
changeUserPoints
(
Integer
userId
,
Integer
pointChangeTypeId
,
int
changePoint
,
String
reason
);
ResultBody
weixinBuyPoints
(
BuyPointsVO
buyPointsVO
,
Integer
userAccountId
,
String
token
);
ResultBody
insertBuyPointsType
(
BuyPointsVO
buyPointsVO
);
ResultBody
updateBuyPointsType
(
BuyPointsVO
buyPointsVO
);
ResultBody
selectAllBuyPointsType
();
Integer
buyPointsTypeById
(
Integer
typeId
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/userpoints/impl/UserPointsServiceImpl.java
浏览文件 @
aebfde68
...
...
@@ -8,21 +8,31 @@ 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.feign.PaymentAppApi
;
import
com.mmc.iuav.user.model.dto.userpoints.UserPointsDTO
;
import
com.mmc.iuav.user.model.dto.userpoints.UserPointsDetailsDTO
;
import
com.mmc.iuav.user.model.qo.userpoints.AppPointsDetailsQO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointQO
;
import
com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO
;
import
com.mmc.iuav.user.model.vo.BuyPointsVO
;
import
com.mmc.iuav.user.model.vo.MessageTimeVO
;
import
com.mmc.iuav.user.model.vo.OrderRequestParamsVO
;
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.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -39,6 +49,10 @@ public class UserPointsServiceImpl implements UserPointsService {
@Autowired
private
UserPointsDetailsDao
userPointsDetailsDao
;
@Qualifier
(
"com.mmc.iuav.user.feign.PaymentAppApi"
)
@Autowired
private
PaymentAppApi
paymentAppApi
;
@Override
public
PageResult
userPointList
(
UserPointQO
param
)
{
int
count
=
userPointsDao
.
count
(
param
);
...
...
@@ -85,10 +99,18 @@ public class UserPointsServiceImpl implements UserPointsService {
public
ResultBody
change
(
ChangeUserPointVO
changePoint
)
{
UserPointsDO
userPointsDO
=
userPointsDao
.
selectUserPoints
(
changePoint
.
getUserAccountId
());
//如果邀请人没有绑定手机号 是没有积分的
if
(
userPointsDO
==
null
)
{
return
ResultBody
.
success
();
if
(
userPointsDO
==
null
)
{
userPointsDO
=
new
UserPointsDO
();
userPointsDO
.
setUserAccountId
(
changePoint
.
getUserAccountId
());
userPointsDO
.
setTotalPoints
(
0
);
userPointsDao
.
insertPoints
(
userPointsDO
);
}
userPointsDO
.
setTotalPoints
(
userPointsDO
.
getTotalPoints
()
+
changePoint
.
getChangePoint
());
//改变后的用户总积分
Integer
userNowPoints
=
userPointsDO
.
getTotalPoints
()
+
changePoint
.
getChangePoint
();
if
(
userNowPoints
<
0
)
{
return
ResultBody
.
error
(
"积分不足,请先去赚取积分"
);
}
userPointsDO
.
setTotalPoints
(
userNowPoints
);
// 修改用户积分
userPointsDao
.
updatePoints
(
userPointsDO
);
// 添加记录
...
...
@@ -147,4 +169,56 @@ public class UserPointsServiceImpl implements UserPointsService {
userPointsDetailsDao
.
insertPointsDetails
(
userPointsDetails
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
weixinBuyPoints
(
BuyPointsVO
buyPointsVO
,
Integer
userAccountId
,
String
token
)
{
if
(
buyPointsVO
.
getId
()
==
null
){
return
ResultBody
.
error
(
"购买积分类型不能传递为空"
);
}
BuyPointsVO
buyPointsVO1
=
userPointsDao
.
selectBuyPointsType
(
buyPointsVO
.
getId
());
// OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO();
// SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
// String content = "WP" + sdf.format(new Date());
// orderRequestParamsVO.setOrderNo(content);
// orderRequestParamsVO.setDescription("购买积分");
// BigDecimal money = buyPointsVO1.getMoney();
// BigDecimal amountInFen = money.multiply(new BigDecimal("100")).setScale(0, RoundingMode.DOWN);
// orderRequestParamsVO.setAmount(amountInFen.intValue());
// orderRequestParamsVO.setOrderPort(4);
// // 扣除金额
// Map map = paymentAppApi.orderPay(orderRequestParamsVO, token);
// 增加积分
ChangeUserPointVO
changeUserPointVO
=
new
ChangeUserPointVO
();
changeUserPointVO
.
setUserAccountId
(
userAccountId
);
changeUserPointVO
.
setChangePoint
(
buyPointsVO1
.
getPoints
());
changeUserPointVO
.
setChangeType
(
9
);
ResultBody
change
=
change
(
changeUserPointVO
);
return
change
;
}
@Override
public
ResultBody
insertBuyPointsType
(
BuyPointsVO
buyPointsVO
)
{
userPointsDao
.
insertBuyPointsType
(
buyPointsVO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
updateBuyPointsType
(
BuyPointsVO
buyPointsVO
)
{
userPointsDao
.
updateBuyPointsType
(
buyPointsVO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
selectAllBuyPointsType
()
{
List
<
BuyPointsVO
>
buyPointsVOS
=
userPointsDao
.
selectAllBuyPointsType
();
return
ResultBody
.
success
(
buyPointsVOS
);
}
@Override
public
Integer
buyPointsTypeById
(
Integer
typeId
)
{
BuyPointsVO
buyPointsVO
=
userPointsDao
.
selectBuyPointsType
(
typeId
);
BigDecimal
money
=
buyPointsVO
.
getMoney
();
BigDecimal
amountInFen
=
money
.
multiply
(
new
BigDecimal
(
"100"
)).
setScale
(
0
,
RoundingMode
.
DOWN
);
return
amountInFen
.
intValue
();
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/wallet/impl/PayWalletServiceImpl.java
浏览文件 @
aebfde68
...
...
@@ -692,7 +692,7 @@ public class PayWalletServiceImpl implements PayWalletService {
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
ResultBody
handleGiveBackPledge
(
PayUavWalletVO
payUavWalletVO
,
PayWalletDO
userWalletInfo
,
PayLogDO
payLogDO
,
PayWalletDO
payWalletDO
)
{
public
ResultBody
handleGiveBackPledge
(
PayUavWalletVO
payUavWalletVO
,
PayWalletDO
userWalletInfo
,
PayLogDO
payLogDO
,
PayWalletDO
payWalletDO
)
{
payLogDO
.
setPayMethod
(
payUavWalletVO
.
getOrderStatus
());
payLogDO
.
setCashAmtPaid
(
payUavWalletVO
.
getCashAmount
());
payLogDO
.
setSalaryAmtPaid
(
payUavWalletVO
.
getSalaryAmount
());
...
...
csm-service/cms-service-user/src/main/resources/mapper/MessageDao.xml
浏览文件 @
aebfde68
...
...
@@ -92,6 +92,15 @@
order by create_time desc
LIMIT 1
</select>
<select
id=
"selectUserMessageTimeType"
resultType=
"com.mmc.iuav.user.model.vo.MessageTimeVO"
>
select *
from user_message_time_type
where id = #{id}
</select>
<select
id=
"listTimeType"
resultType=
"com.mmc.iuav.user.model.vo.MessageTimeVO"
>
select *
from user_message_time_type
</select>
<insert
id=
"insertSystemMessage"
>
insert into message
...
...
@@ -143,6 +152,19 @@
<if
test=
"messageCount != null"
>
#{messageCount,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert
id=
"insertTimeType"
>
insert into user_message_time_type
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"money != null"
>
money,
</if>
<if
test=
"points != null"
>
points,
</if>
<if
test=
"chatDuration != null"
>
chat_duration,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"money != null"
>
#{money},
</if>
<if
test=
"points != null"
>
#{points},
</if>
<if
test=
"chatDuration != null"
>
#{chatDuration},
</if>
</trim>
</insert>
<update
id=
"removeMessage"
>
update message
set is_deleted = 1, deleted_time = NOW()
...
...
@@ -161,12 +183,14 @@
<update
id=
"updateSystemMessage"
>
UPDATE message
<set>
<if
test=
"subject != null"
>
subject,
</if>
<if
test=
"content != null"
>
content
</if>
<if
test=
"subject != null"
>
subject = #{subject},
</if>
<if
test=
"content != null"
>
content = #{content}
</if>
</set>
<where>
id = #{id}
</where>
WHERE id = #{id}
</update>
<update
id=
"removeUserMessage"
>
update user_message
...
...
@@ -192,5 +216,20 @@
message_count = message_count - 1
where id = #{id}
</update>
<update
id=
"updateTimeType"
>
update user_message_time_type
<set>
<if
test=
"money != null"
>
money = #{money},
</if>
<if
test=
"points != null"
>
points = #{points},
</if>
<if
test=
"chatDuration != null"
>
chat_duration = #{chatDuration}
</if>
</set>
where id = #{id}
</update>
</mapper>
csm-service/cms-service-user/src/main/resources/mapper/userpoints/UserPointsDao.xml
浏览文件 @
aebfde68
...
...
@@ -27,11 +27,35 @@
</set>
where user_account_id = #{userAccountId}
</update>
<update
id=
"updateBuyPointsType"
>
update user_points_buy
<set>
<if
test=
"money != null"
>
money = #{money},
</if>
<if
test=
"points != null"
>
points = #{points},
</if>
update_time = NOW()
</set>
where id = #{id}
</update>
<insert
id=
"insertPoints"
parameterType=
"com.mmc.iuav.user.entity.userpoints.UserPointsDO"
>
insert into user_points(total_points, user_account_id, create_time,
update_time)
values (#{totalPoints}, #{userAccountId}, NOW(), NOW())
</insert>
<insert
id=
"insertBuyPointsType"
>
insert into user_points_buy
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"money != null"
>
money,
</if>
<if
test=
"points != null"
>
points
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"money != null"
>
#{money},
</if>
<if
test=
"points != null"
>
#{points}
</if>
</trim>
</insert>
<select
id=
"userPointList"
resultMap=
"pointList"
parameterType=
"com.mmc.iuav.user.model.qo.userpoints.UserPointQO"
>
SELECT up.id,
...
...
@@ -66,6 +90,15 @@
and ua.nick_name like CONCAT("%",#{nickName},"%")
</if>
</select>
<select
id=
"selectBuyPointsType"
resultType=
"com.mmc.iuav.user.model.vo.BuyPointsVO"
>
select *
from user_points_buy
where id = #{id}
</select>
<select
id=
"selectAllBuyPointsType"
resultType=
"com.mmc.iuav.user.model.vo.BuyPointsVO"
>
select *
from user_points_buy
</select>
</mapper>
csm-service/cms-service-user/src/main/resources/not-check.yml
浏览文件 @
aebfde68
...
...
@@ -48,4 +48,6 @@ data-filter:
-
/userapp/auth/getVerifyCode
-
/userapp/auth/webRegister
-
/userapp/auth/webLogin
-
/userapp/message/timeTypeById
-
/userapp/userPoint/buyPointsTypeById
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
aebfde68
...
...
@@ -18,4 +18,4 @@ patches:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag
:
6f3df64d961dc539e9da0d90ee09f4c5603f6085
newTag
:
d09e9d1d159f90fefe98d9993c70839d0122f4f7
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论