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
128a1094
Commit
128a1094
authored
Jul 12, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://10.5.52.3/youjj/cloud-platform
into base-modify
parents
fd795a90
ab50a0cf
Changes
51
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
1502 additions
and
260 deletions
+1502
-260
UserTeamMemberBo.java
...om/github/wxiaoqi/security/admin/bo/UserTeamMemberBo.java
+1
-1
WalletDTO.java
...java/com/github/wxiaoqi/security/admin/dto/WalletDTO.java
+68
-0
AppUserSellingWater.java
...ub/wxiaoqi/security/admin/entity/AppUserSellingWater.java
+2
-2
MyWallet.java
...va/com/github/wxiaoqi/security/admin/entity/MyWallet.java
+4
-4
MyWalletDetail.java
.../github/wxiaoqi/security/admin/entity/MyWalletDetail.java
+5
-5
AppletWalletVo.java
.../com/github/wxiaoqi/security/admin/vo/AppletWalletVo.java
+39
-0
SellingWalletPagVo.java
.../github/wxiaoqi/security/admin/vo/SellingWalletPagVo.java
+27
-0
SellingWalletVo.java
...com/github/wxiaoqi/security/admin/vo/SellingWalletVo.java
+58
-0
UserTeamMemberVo.java
...om/github/wxiaoqi/security/admin/vo/UserTeamMemberVo.java
+36
-0
WalletCathPageVo.java
...om/github/wxiaoqi/security/admin/vo/WalletCathPageVo.java
+28
-0
WalletCathVo.java
...va/com/github/wxiaoqi/security/admin/vo/WalletCathVo.java
+65
-0
WalletVo.java
...n/java/com/github/wxiaoqi/security/admin/vo/WalletVo.java
+68
-0
AppUserPositionBiz.java
...github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
+1
-1
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+144
-17
MyWalletBiz.java
...va/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
+38
-0
MyWalletCathBiz.java
...om/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
+62
-0
MyWalletDetailBiz.java
.../github/wxiaoqi/security/admin/biz/MyWalletDetailBiz.java
+21
-0
MyWaterBiz.java
...ava/com/github/wxiaoqi/security/admin/biz/MyWaterBiz.java
+111
-0
UserBusinessBiz.java
...om/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
+18
-14
IntegralMQHandler.java
...hub/wxiaoqi/security/admin/handler/IntegralMQHandler.java
+30
-0
MyWalletMapper.java
.../github/wxiaoqi/security/admin/mapper/MyWalletMapper.java
+4
-0
MyWalletController.java
...ithub/wxiaoqi/security/admin/rest/MyWalletController.java
+49
-0
UserBussinessController.java
.../wxiaoqi/security/admin/rest/UserBussinessController.java
+4
-3
UserMemberController.java
...hub/wxiaoqi/security/admin/rest/UserMemberController.java
+0
-21
UserSellingWaterController.java
...iaoqi/security/admin/rest/UserSellingWaterController.java
+51
-0
WalletCathController.java
...hub/wxiaoqi/security/admin/rest/WalletCathController.java
+50
-0
UserMemberAdminController.java
.../security/admin/rest/admin/UserMemberAdminController.java
+7
-0
MyWaterMapper.xml
...les/ace-admin/src/main/resources/mapper/MyWaterMapper.xml
+48
-0
IntegralRule.java
.../java/com/xxfc/platform/activity/entity/IntegralRule.java
+6
-0
IntegralUserRecord.java
...com/xxfc/platform/activity/entity/IntegralUserRecord.java
+5
-2
IntegralRuleDto.java
...n/java/com/xxfc/platform/activity/vo/IntegralRuleDto.java
+2
-100
IntegralUserRecordDto.java
.../com/xxfc/platform/activity/vo/IntegralUserRecordDto.java
+19
-1
IntegralRuleBiz.java
.../java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
+6
-3
IntegralSignRecordBiz.java
...com/xxfc/platform/activity/biz/IntegralSignRecordBiz.java
+12
-10
IntegralUserRecordBiz.java
...com/xxfc/platform/activity/biz/IntegralUserRecordBiz.java
+101
-67
IntegralUserTotalBiz.java
.../com/xxfc/platform/activity/biz/IntegralUserTotalBiz.java
+28
-0
IntegralMQHandler.java
...com/xxfc/platform/activity/handler/IntegralMQHandler.java
+34
-0
IntegralRuleController.java
...m/xxfc/platform/activity/rest/IntegralRuleController.java
+2
-2
IntegralSignRecordController.java
.../platform/activity/rest/IntegralSignRecordController.java
+2
-2
IntegralUserRecordController.java
.../platform/activity/rest/IntegralUserRecordController.java
+2
-2
IntegralRuleMapper.xml
...y-server/src/main/resources/mapper/IntegralRuleMapper.xml
+4
-0
IntegralUserRecordMapper.xml
...er/src/main/resources/mapper/IntegralUserRecordMapper.xml
+2
-2
pom.xml
xx-universal/xx-universal-api/pom.xml
+4
-0
Dictionary.java
...n/java/com/xxfc/platform/universal/entity/Dictionary.java
+2
-1
MQSerderFeign.java
...java/com/xxfc/platform/universal/feign/MQSerderFeign.java
+14
-0
MQAutoConfiguration.java
...a/com/xxfc/platform/universal/mq/MQAutoConfiguration.java
+65
-0
RabbitConfig.java
...ain/java/com/xxfc/platform/universal/mq/RabbitConfig.java
+30
-0
RabbitMQSender.java
...n/java/com/xxfc/platform/universal/mq/RabbitMQSender.java
+78
-0
pom.xml
xx-universal/xx-universal-server/pom.xml
+1
-0
MQServiceBiZ.java
...in/java/com/xxfc/platform/universal/biz/MQServiceBiZ.java
+20
-0
MQSenderController.java
...xfc/platform/universal/controller/MQSenderController.java
+24
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/bo/UserTeamMemberBo.java
View file @
128a1094
...
@@ -24,7 +24,7 @@ public class UserTeamMemberBo {
...
@@ -24,7 +24,7 @@ public class UserTeamMemberBo {
/**
/**
* 用户名
* 用户名
*/
*/
private
String
userName
m
;
private
String
userName
;
/**
/**
* 昵称
* 昵称
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletDTO.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 8:42
*/
@Data
public
class
WalletDTO
{
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
/**
* 用户ID
*/
@ApiModelProperty
(
"用户ID"
)
private
Integer
userId
;
/**
* 余额(分)
*/
@ApiModelProperty
(
value
=
"余额(元)"
)
private
BigDecimal
balance
;
/**
* 已提现金额
*/
@ApiModelProperty
(
value
=
"已提现金额"
)
private
BigDecimal
withdrawals
;
/**
* 进账总额(元)
*/
@ApiModelProperty
(
value
=
"进账总额(元)"
)
private
BigDecimal
totalAmount
;
/**
* 进账总额(分)
*/
@ApiModelProperty
(
value
=
"进账总额(元)"
)
private
BigDecimal
todayAmount
;
/**
* 未入账金额
*/
@ApiModelProperty
(
value
=
"未入账金额"
)
private
BigDecimal
unbooked
;
/**
* 是否冻结:0-正常,1-冻结
*/
@ApiModelProperty
(
value
=
"是否冻结:0-正常,1-冻结"
)
private
Integer
isFrozen
;
/**
* 最后进账时间
*/
@ApiModelProperty
(
value
=
"最后进账时间"
)
private
Long
lastIntime
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserSellingWater.java
View file @
128a1094
...
@@ -131,14 +131,14 @@ public class AppUserSellingWater implements Serializable {
...
@@ -131,14 +131,14 @@ public class AppUserSellingWater implements Serializable {
*/
*/
@Column
(
name
=
"crt_time"
)
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Integer
crtTime
;
private
Long
crtTime
;
/**
/**
* 更新时间
* 更新时间
*/
*/
@Column
(
name
=
"upd_time"
)
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Integer
updTime
;
private
Long
updTime
;
/**
/**
* 所获佣金
* 所获佣金
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/MyWallet.java
View file @
128a1094
...
@@ -25,7 +25,7 @@ public class MyWallet implements Serializable {
...
@@ -25,7 +25,7 @@ public class MyWallet implements Serializable {
*/
*/
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
@ApiModelProperty
(
value
=
"id"
)
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
private
Integer
id
;
/**
/**
* 用户ID
* 用户ID
...
@@ -39,7 +39,7 @@ public class MyWallet implements Serializable {
...
@@ -39,7 +39,7 @@ public class MyWallet implements Serializable {
* 余额(分)
* 余额(分)
*/
*/
@Column
(
name
=
"balance"
)
@Column
(
name
=
"balance"
)
@ApiModelProperty
(
value
=
"余额(
分
)"
)
@ApiModelProperty
(
value
=
"余额(
元
)"
)
private
BigDecimal
balance
;
private
BigDecimal
balance
;
/**
/**
...
@@ -53,14 +53,14 @@ public class MyWallet implements Serializable {
...
@@ -53,14 +53,14 @@ public class MyWallet implements Serializable {
* 进账总额(分)
* 进账总额(分)
*/
*/
@Column
(
name
=
"total_amount"
)
@Column
(
name
=
"total_amount"
)
@ApiModelProperty
(
value
=
"进账总额(
分
)"
)
@ApiModelProperty
(
value
=
"进账总额(
元
)"
)
private
BigDecimal
totalAmount
;
private
BigDecimal
totalAmount
;
/**
/**
* 进账总额(分)
* 进账总额(分)
*/
*/
@Column
(
name
=
"today_amount"
)
@Column
(
name
=
"today_amount"
)
@ApiModelProperty
(
value
=
"进账总额(
分
)"
)
@ApiModelProperty
(
value
=
"进账总额(
元
)"
)
private
BigDecimal
todayAmount
;
private
BigDecimal
todayAmount
;
/**
/**
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/MyWalletDetail.java
View file @
128a1094
...
@@ -26,14 +26,14 @@ public class MyWalletDetail implements Serializable {
...
@@ -26,14 +26,14 @@ public class MyWalletDetail implements Serializable {
@Id
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键ID"
)
@ApiModelProperty
(
"主键ID"
)
private
Long
id
;
private
Integer
id
;
/**
/**
* 用户ID
* 用户ID
*/
*/
@Column
(
name
=
"user_id"
)
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户ID"
)
@ApiModelProperty
(
value
=
"用户ID"
)
private
String
userId
;
private
Integer
userId
;
/**
/**
* 来源:0-活动,1-佣金,2-会员充值,10-提现,11-转账,12-购买
* 来源:0-活动,1-佣金,2-会员充值,10-提现,11-转账,12-购买
...
@@ -75,7 +75,7 @@ public class MyWalletDetail implements Serializable {
...
@@ -75,7 +75,7 @@ public class MyWalletDetail implements Serializable {
*/
*/
@Column
(
name
=
"cono"
)
@Column
(
name
=
"cono"
)
@ApiModelProperty
(
value
=
"单号"
)
@ApiModelProperty
(
value
=
"单号"
)
private
String
cono
;
private
Integer
cono
;
/**
/**
* 加上当时的收入的余额
* 加上当时的收入的余额
...
@@ -87,9 +87,9 @@ public class MyWalletDetail implements Serializable {
...
@@ -87,9 +87,9 @@ public class MyWalletDetail implements Serializable {
/**
/**
* 操作者ID(如果系统操作,-1)
* 操作者ID(如果系统操作,-1)
*/
*/
@Column
(
name
=
"
oper
_user"
)
@Column
(
name
=
"
crt
_user"
)
@ApiModelProperty
(
value
=
"操作者ID(如果系统操作,-1)"
)
@ApiModelProperty
(
value
=
"操作者ID(如果系统操作,-1)"
)
private
Integer
oper
User
;
private
Integer
crt
User
;
/**
/**
* 操作时间
* 操作时间
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppletWalletVo.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 9:20
*/
@Data
public
class
AppletWalletVo
{
/**
* 用户ID
*/
@ApiModelProperty
(
"用户ID"
)
private
Integer
userId
;
/**
* 余额(元)
*/
@ApiModelProperty
(
value
=
"余额(元)"
)
private
BigDecimal
balance
;
/**
* 进账总额(元)
*/
@ApiModelProperty
(
value
=
"进账总额(元)"
)
private
BigDecimal
totalAmount
;
/**
* 今日收益(元)
*/
@ApiModelProperty
(
value
=
"今日收益(元)"
)
private
BigDecimal
todayAmount
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/SellingWalletPagVo.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 11:02
*/
@Data
public
class
SellingWalletPagVo
{
private
BigDecimal
totalIncome
;
private
List
<
SellingWalletVo
>
sellingWaters
;
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Integer
totalCount
;
private
Integer
totalPage
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/SellingWalletVo.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 11:02
*/
@Data
public
class
SellingWalletVo
{
/**
* 用户名
*/
private
String
username
;
/**
* 昵称
*/
private
String
nickName
;
/**
* 用户头像
*/
private
String
headUrl
;
@ApiModelProperty
(
value
=
"商品数量"
)
private
Integer
goodNumber
;
@ApiModelProperty
(
value
=
"商品标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"图片"
)
private
String
img
;
@ApiModelProperty
(
value
=
"售价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Long
updTime
;
private
Integer
waiting
;
private
Integer
status
;
/**
* 所获佣金
*/
private
BigDecimal
commission
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/UserTeamMemberVo.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description 用户的团队成员
* @data 2019/7/11 14:46
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
UserTeamMemberVo
{
private
BigDecimal
totalIncome
;
private
List
<
UserTeamMemberBo
>
userTeamMemberBos
;
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Integer
totalCount
;
private
Integer
totalPage
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletCathPageVo.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 10:31
*/
@Data
public
class
WalletCathPageVo
{
private
BigDecimal
totalWithdraw
;
private
List
<
WalletCathVo
>
walletCaths
;
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Integer
totalCount
;
private
Integer
totalPage
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletCathVo.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 10:45
*/
@Data
public
class
WalletCathVo
{
/**
* 用户iD
*/
@ApiModelProperty
(
value
=
"用户iD"
)
private
String
userId
;
/**
* 提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)
*/
@ApiModelProperty
(
value
=
"提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)"
)
private
Integer
cathType
;
/**
* 商户订单号
*/
@ApiModelProperty
(
value
=
"商户订单号"
)
private
String
orderno
;
/**
* 第三方订单号:如微信,支付宝,银行卡等
*/
@ApiModelProperty
(
value
=
"第三方订单号:如微信,支付宝,银行卡等"
)
private
String
cono
;
/**
* 提现金额
*/
@ApiModelProperty
(
value
=
"提现金额"
)
private
BigDecimal
amount
;
/**
* 订单状态:0-未提现,待审核,1-已审核
*/
@ApiModelProperty
(
value
=
"订单状态:0-未提现,待审核,1-已审核"
)
private
Integer
stauts
;
/**
* 提现日期
*/
@ApiModelProperty
(
value
=
"提现日期"
,
hidden
=
true
)
private
Long
crtTime
;
/**
* 审核日期
*/
@ApiModelProperty
(
value
=
"审核日期"
)
private
Long
finishTime
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletVo.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 9:20
*/
@Data
public
class
WalletVo
{
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
/**
* 用户ID
*/
@ApiModelProperty
(
"用户ID"
)
private
Integer
userId
;
/**
* 余额(元)
*/
@ApiModelProperty
(
value
=
"余额(元)"
)
private
BigDecimal
balance
;
/**
* 已提现金额
*/
@ApiModelProperty
(
value
=
"已提现金额"
)
private
BigDecimal
withdrawals
;
/**
* 进账总额(元)
*/
@ApiModelProperty
(
value
=
"进账总额(元)"
)
private
BigDecimal
totalAmount
;
/**
* 进账总额(分)
*/
@ApiModelProperty
(
value
=
"进账总额(元)"
)
private
BigDecimal
todayAmount
;
/**
* 未入账金额
*/
@ApiModelProperty
(
value
=
"未入账金额"
)
private
BigDecimal
unbooked
;
/**
* 是否冻结:0-正常,1-冻结
*/
@ApiModelProperty
(
value
=
"是否冻结:0-正常,1-冻结"
)
private
Integer
isFrozen
;
/**
* 最后进账时间
*/
@ApiModelProperty
(
value
=
"最后进账时间"
)
private
Long
lastIntime
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
View file @
128a1094
...
@@ -19,6 +19,6 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
...
@@ -19,6 +19,6 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
//获取用户职位的折扣
//获取用户职位的折扣
public
Integer
getExtract
(
Integer
userId
){
public
Integer
getExtract
(
Integer
userId
){
return
getExtract
(
userId
);
return
mapper
.
getExtractByUserId
(
userId
);
}
}
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
128a1094
This diff is collapsed.
Click to expand it.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.MyWallet
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletMapper
;
import
com.github.wxiaoqi.security.admin.vo.AppletWalletVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 9:18
*/
@Transactional
@Service
public
class
MyWalletBiz
extends
BaseBiz
<
MyWalletMapper
,
MyWallet
>
{
public
AppletWalletVo
findMyWallet
(
Integer
userId
){
AppletWalletVo
appletWalletVo
=
new
AppletWalletVo
();
Example
example
=
new
Example
(
MyWallet
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userId"
,
userId
);
List
<
MyWallet
>
wallets
=
mapper
.
selectByExample
(
example
);
MyWallet
myWallet
=
wallets
.
get
(
0
);
BeanUtils
.
copyProperties
(
myWallet
,
appletWalletVo
);
return
appletWalletVo
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletCath
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper
;
import
com.github.wxiaoqi.security.admin.vo.WalletCathPageVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletCathVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 10:21
*/
@Transactional
@Service
public
class
MyWalletCathBiz
extends
BaseBiz
<
MyWalletCathMapper
,
MyWalletCath
>
{
public
WalletCathPageVo
findWatchCatchByWithdrawalState
(
Integer
userId
,
Integer
state
,
Integer
pageNo
,
Integer
pageSize
){
WalletCathPageVo
walletCathPageVo
=
new
WalletCathPageVo
();
Example
example
=
new
Example
(
MyWalletCath
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"stauts"
,
state
);
criteria
.
andEqualTo
(
"userId"
,
userId
);
PageDataVO
<
MyWalletCath
>
walletCathPage
=
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
selectByExample
(
example
));
List
<
MyWalletCath
>
walletCaths
=
walletCathPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
walletCaths
)){
return
walletCathPageVo
;
}
WalletCathVo
walletCathVo
=
null
;
BigDecimal
totalWithdraw
=
new
BigDecimal
(
0
);
List
<
WalletCathVo
>
walletCatchPageVos
=
new
ArrayList
<>();
for
(
MyWalletCath
walletCath
:
walletCaths
)
{
walletCathVo
=
new
WalletCathVo
();
BeanUtils
.
copyProperties
(
walletCath
,
walletCathVo
);
totalWithdraw
=
totalWithdraw
.
add
(
walletCathVo
.
getAmount
());
walletCatchPageVos
.
add
(
walletCathVo
);
}
walletCathPageVo
.
setPageNum
(
walletCathPage
.
getPageNum
());
walletCathPageVo
.
setPageSize
(
walletCathPage
.
getPageSize
());
walletCathPageVo
.
setTotalCount
(
walletCathPage
.
getTotalCount
().
intValue
());
walletCathPageVo
.
setTotalPage
(
walletCathPage
.
getTotalPage
());
walletCathPageVo
.
setTotalWithdraw
(
totalWithdraw
);
walletCathPageVo
.
setWalletCaths
(
walletCatchPageVos
);
return
walletCathPageVo
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletDetailBiz.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletDetail
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletDetailMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 9:18
*/
@Transactional
@Service
public
class
MyWalletDetailBiz
extends
BaseBiz
<
MyWalletDetailMapper
,
MyWalletDetail
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWaterBiz.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
cn.hutool.core.date.DateTime
;
import
com.github.wxiaoqi.security.admin.entity.MyWallet
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletDetail
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletDetailMapper
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* 钱包
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-09 10:00:42
*/
@Service
@Slf4j
public
class
MyWaterBiz
extends
BaseBiz
<
MyWalletMapper
,
MyWallet
>{
@Autowired
MyWalletDetailBiz
walletDetailBiz
;
//我的钱包入账
public
void
updMyWater
(
Integer
userId
,
Integer
orderId
,
BigDecimal
amount
){
log
.
info
(
"---我的钱包入账----userId==="
+
userId
+
"----orderId===="
+
orderId
+
"----amount===="
+
amount
);
MyWallet
wallet
=
new
MyWallet
();
wallet
.
setUserId
(
userId
);
wallet
=
selectOne
(
wallet
);
//进账之前余额
BigDecimal
oldBalance
=
new
BigDecimal
(
"0.00"
);
BigDecimal
balance
=
new
BigDecimal
(
"0.00"
);
//进账总额(元)
BigDecimal
totalAmount
=
new
BigDecimal
(
"0.00"
);
//今日收益
BigDecimal
todayAmount
=
new
BigDecimal
(
"0.00"
);
//未入账金额
BigDecimal
unbooked
=
new
BigDecimal
(
"0.00"
);
Integer
id
=
0
;
if
(
wallet
==
null
){
wallet
=
new
MyWallet
();
wallet
.
setUserId
(
userId
);
totalAmount
=
amount
;
todayAmount
=
amount
;
balance
=
amount
;
}
else
{
id
=
wallet
.
getId
();
oldBalance
=
wallet
.
getBalance
();
balance
=
wallet
.
getBalance
().
add
(
amount
);
totalAmount
=
wallet
.
getTotalAmount
().
add
(
amount
);
Long
lastTime
=
wallet
.
getLastIntime
();
todayAmount
=
amount
;
if
(
lastTime
!=
null
&&(
lastTime
==
0
||
isToday
(
lastTime
))){
todayAmount
=
wallet
.
getTodayAmount
().
add
(
amount
);
}
unbooked
=
wallet
.
getUnbooked
().
subtract
(
unbooked
);
}
log
.
info
(
"---我的钱包入账----userId==="
+
userId
+
"----balance===="
+
balance
+
"----totalAmount===="
+
totalAmount
+
"---todayAmount==="
+
todayAmount
+
"---unbooked=="
+
unbooked
);
MyWalletDetail
walletDetail
=
new
MyWalletDetail
();
walletDetail
.
setUserId
(
userId
);
walletDetail
.
setSource
(
1
);
walletDetail
.
setCono
(
orderId
);
walletDetail
.
setItype
(
1
);
walletDetail
.
setAmount
(
amount
);
walletDetail
.
setBalance
(
oldBalance
);
walletDetailBiz
.
insertSelective
(
walletDetail
);
Long
time
=
System
.
currentTimeMillis
();
wallet
.
setBalance
(
balance
);
wallet
.
setTodayAmount
(
todayAmount
);
wallet
.
setTotalAmount
(
totalAmount
);
wallet
.
setUnbooked
(
unbooked
);
wallet
.
setLastIntime
(
time
);
wallet
.
setUpdTime
(
time
);
if
(
id
>
0
){
mapper
.
updMyWater
(
wallet
);
}
else
{
wallet
.
setCrtTime
(
time
);
insertSelective
(
wallet
);
}
log
.
info
(
"---我的钱包入账----userId==="
+
userId
+
"----成功"
);
}
// 这个时间戳是不是今天
public
boolean
isToday
(
long
time
)
{
boolean
isToday
=
false
;
Date
date
;
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
date
=
sdf
.
parse
(
sdf
.
format
(
new
Date
()));
if
(
time
<
date
.
getTime
()
&&
time
>
date
.
getTime
())
{
isToday
=
true
;
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
isToday
;
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
View file @
128a1094
...
@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo;
...
@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -38,28 +39,29 @@ public class UserBusinessBiz {
...
@@ -38,28 +39,29 @@ public class UserBusinessBiz {
@Autowired
@Autowired
private
AppUserDetailBiz
appUserDetailBiz
;
private
AppUserDetailBiz
appUserDetailBiz
;
public
PageDataVO
<
UserTeamMemberBo
>
findTeamMemberPageByUserId
(
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
)
{
public
UserTeamMemberVo
findTeamMemberPageByUserId
(
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
)
{
PageDataVO
<
UserTeamMemberBo
>
teamMemberPage
=
new
PageDataVO
<>
();
UserTeamMemberVo
userTeamMemberVo
=
new
UserTeamMemberVo
();
//根据用户id去关系表里查询下级
//根据用户id去关系表里查询下级
PageDataVO
<
AppUserRelation
>
memberPage
=
appUserRelationBiz
.
findMemberPageByLeaderId
(
userId
,
pageNo
,
pageSize
);
PageDataVO
<
AppUserRelation
>
memberPage
=
appUserRelationBiz
.
findMemberPageByLeaderId
(
userId
,
pageNo
,
pageSize
);
List
<
AppUserRelation
>
teamMemberBos
=
memberPage
.
getData
();
List
<
AppUserRelation
>
teamMemberBos
=
memberPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
teamMemberBos
))
{
if
(
CollectionUtils
.
isEmpty
(
teamMemberBos
))
{
return
teamMemberPage
;
return
userTeamMemberVo
;
}
}
List
<
Integer
>
memberIds
=
teamMemberBos
.
stream
().
map
(
team
->
team
.
getUserId
()).
collect
(
Collectors
.
toList
());
List
<
Integer
>
memberIds
=
teamMemberBos
.
stream
().
map
(
team
->
team
.
getUserId
()).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
BigDecimal
>
memberIdAndIncomeMap
=
appUserSellingWaterBiz
.
findMemberIdAndIncomeMapByMemberIds
(
memberIds
);
Map
<
Integer
,
BigDecimal
>
memberIdAndIncomeMap
=
appUserSellingWaterBiz
.
findMemberIdAndIncomeMapByMemberIds
(
memberIds
);
if
(
memberIdAndIncomeMap
==
null
)
{
if
(
memberIdAndIncomeMap
==
null
)
{
return
teamMemberPage
;
return
userTeamMemberVo
;
}
}
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
U
serIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
u
serIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
List
<
UserTeamMemberBo
>
userTeamMemberBos
=
new
ArrayList
<>();
List
<
UserTeamMemberBo
>
userTeamMemberBos
=
new
ArrayList
<>();
UserTeamMemberBo
userTeamMemberBo
;
UserTeamMemberBo
userTeamMemberBo
;
BigDecimal
totalIncome
=
new
BigDecimal
(
0
);
for
(
AppUserRelation
appUserRelation
:
teamMemberBos
)
{
for
(
AppUserRelation
appUserRelation
:
teamMemberBos
)
{
userTeamMemberBo
=
new
UserTeamMemberBo
();
userTeamMemberBo
=
new
UserTeamMemberBo
();
...
@@ -68,21 +70,23 @@ public class UserBusinessBiz {
...
@@ -68,21 +70,23 @@ public class UserBusinessBiz {
if
(
userIdAndAppUserLoginMap
!=
null
){
if
(
userIdAndAppUserLoginMap
!=
null
){
AppUserLogin
appUserLogin
=
userIdAndAppUserLoginMap
.
get
(
appUserRelation
.
getUserId
());
AppUserLogin
appUserLogin
=
userIdAndAppUserLoginMap
.
get
(
appUserRelation
.
getUserId
());
userTeamMemberBo
.
setUserName
m
(
appUserLogin
.
getUsername
());
userTeamMemberBo
.
setUserName
(
appUserLogin
.
getUsername
());
}
}
if
(
U
serIdAndAppUserDetailMap
!=
null
){
if
(
u
serIdAndAppUserDetailMap
!=
null
){
AppUserDetail
appUserDetail
=
U
serIdAndAppUserDetailMap
.
get
(
appUserRelation
.
getUserId
());
AppUserDetail
appUserDetail
=
u
serIdAndAppUserDetailMap
.
get
(
appUserRelation
.
getUserId
());
userTeamMemberBo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
userTeamMemberBo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
userTeamMemberBo
.
setNickName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getNickname
());
userTeamMemberBo
.
setNickName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getNickname
());
}
}
userTeamMemberBo
.
setIncome
(
memberIdAndIncomeMap
.
get
(
appUserRelation
.
getUserId
()));
userTeamMemberBo
.
setIncome
(
memberIdAndIncomeMap
.
get
(
appUserRelation
.
getUserId
()));
totalIncome
=
totalIncome
.
add
(
userTeamMemberBo
.
getIncome
());
userTeamMemberBos
.
add
(
userTeamMemberBo
);
userTeamMemberBos
.
add
(
userTeamMemberBo
);
}
}
teamMemberPage
.
setPageNum
(
memberPage
.
getPageNum
());
userTeamMemberVo
.
setPageNum
(
memberPage
.
getPageNum
());
teamMemberPage
.
setPageSize
(
memberPage
.
getPageSize
());
userTeamMemberVo
.
setPageSize
(
memberPage
.
getPageSize
());
teamMemberPage
.
setTotalCount
(
memberPage
.
getTotalCount
());
userTeamMemberVo
.
setTotalCount
(
memberPage
.
getTotalCount
().
intValue
());
teamMemberPage
.
setTotalPage
(
memberPage
.
getTotalPage
());
userTeamMemberVo
.
setTotalPage
(
memberPage
.
getTotalPage
());
teamMemberPage
.
setData
(
userTeamMemberBos
);
userTeamMemberVo
.
setUserTeamMemberBos
(
userTeamMemberBos
);
return
teamMemberPage
;
userTeamMemberVo
.
setTotalIncome
(
totalIncome
);
return
userTeamMemberVo
;
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/handler/IntegralMQHandler.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
handler
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz
;
import
com.github.wxiaoqi.security.admin.dto.OrderWaterDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
@Component
@Slf4j
public
class
IntegralMQHandler
{
@Autowired
AppUserSellingWaterBiz
waterBiz
;
@RabbitListener
(
queues
=
"orderWater_queue"
)
public
void
integralHandler
(
String
json
)
{
log
.
info
(
"接收到的消息:json = {}"
,
json
);
try
{
OrderWaterDTO
orderWaterDTO
=
JSONObject
.
parseObject
(
json
,
OrderWaterDTO
.
class
);
waterBiz
.
orderWater
(
orderWaterDTO
);
}
catch
(
Exception
e
){
log
.
info
(
"接收到的消息失败"
);
e
.
printStackTrace
();
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MyWalletMapper.java
View file @
128a1094
...
@@ -11,5 +11,9 @@ import tk.mybatis.mapper.common.Mapper;
...
@@ -11,5 +11,9 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2019-07-11 14:14:54
* @date 2019-07-11 14:14:54
*/
*/
public
interface
MyWalletMapper
extends
Mapper
<
MyWallet
>
{
public
interface
MyWalletMapper
extends
Mapper
<
MyWallet
>
{
public
void
updMyWater
(
MyWallet
myWallet
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/MyWalletController.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.MyWalletBiz
;
import
com.github.wxiaoqi.security.admin.vo.AppletWalletVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 9:17
*/
@RestController
@RequestMapping
(
"/wallet"
)
public
class
MyWalletController
{
@Autowired
private
UserAuthUtil
userAuthUtil
;
@Autowired
private
UserAuthConfig
userAuthConfig
;
@Autowired
private
MyWalletBiz
myWalletBiz
;
@GetMapping
public
ObjectRestResponse
<
AppletWalletVo
>
findMyWallet
(
HttpServletRequest
request
){
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
AppletWalletVo
wallet
=
myWalletBiz
.
findMyWallet
(
Integer
.
valueOf
(
infoFromToken
.
getId
()));
return
ObjectRestResponse
.
succ
(
wallet
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserBussinessController.java
View file @
128a1094
...
@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.rest;
...
@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.rest;
import
com.github.wxiaoqi.security.admin.biz.UserBusinessBiz
;
import
com.github.wxiaoqi.security.admin.biz.UserBusinessBiz
;
import
com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo
;
import
com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo
;
import
com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
...
@@ -36,11 +37,11 @@ public class UserBussinessController {
...
@@ -36,11 +37,11 @@ public class UserBussinessController {
private
UserBusinessBiz
businessBiz
;
private
UserBusinessBiz
businessBiz
;
@GetMapping
(
"/teams"
)
@GetMapping
(
"/teams"
)
public
ObjectRestResponse
<
PageDataVO
<
UserTeamMemberBo
>
>
findTeamPage
(
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
HttpServletRequest
request
){
public
ObjectRestResponse
<
UserTeamMemberVo
>
findTeamPage
(
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
HttpServletRequest
request
){
try
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
PageDataVO
<
UserTeamMemberBo
>
teamMemberBoPageDataVO
=
businessBiz
.
findTeamMemberPageByUserId
(
Integer
.
valueOf
(
infoFromToken
.
getId
()),
pageNo
,
pageSize
);
UserTeamMemberVo
userTeamMemberVo
=
businessBiz
.
findTeamMemberPageByUserId
(
Integer
.
valueOf
(
infoFromToken
.
getId
()),
pageNo
,
pageSize
);
return
ObjectRestResponse
.
succ
(
teamMemberBoPageDataVO
);
return
ObjectRestResponse
.
succ
(
userTeamMemberVo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
throw
new
BaseException
(
e
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserMemberController.java
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.AdminBootstrap
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberExportBiz
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.List
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -33,9 +19,6 @@ public class UserMemberController {
...
@@ -33,9 +19,6 @@ public class UserMemberController {
@Autowired
@Autowired
private
BaseUserMemberBiz
memberBiz
;
private
BaseUserMemberBiz
memberBiz
;
@Autowired
private
BaseUserMemberExportBiz
baseUserMemberExportBiz
;
/**
/**
* 购买会员
* 购买会员
*
*
...
@@ -66,8 +49,4 @@ public class UserMemberController {
...
@@ -66,8 +49,4 @@ public class UserMemberController {
)
throws
Exception
{
)
throws
Exception
{
return
memberBiz
.
upMemberDays
(
userId
,
days
,
type
);
return
memberBiz
.
upMemberDays
(
userId
,
days
,
type
);
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserSellingWaterController.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletPagVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 11:35
*/
@RestController
@RequestMapping
(
"/sellingwater"
)
public
class
UserSellingWaterController
{
@Autowired
private
AppUserSellingWaterBiz
appUserSellingWaterBiz
;
@Autowired
private
UserAuthUtil
userAuthUtil
;
@Autowired
private
UserAuthConfig
userAuthConfig
;
@GetMapping
(
"/page"
)
public
ObjectRestResponse
<
SellingWalletPagVo
>
findSellingWaterPage
(
@RequestParam
(
required
=
false
,
value
=
"type"
)
Integer
wating
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
HttpServletRequest
request
)
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
SellingWalletPagVo
sellingWalletPagVo
=
appUserSellingWaterBiz
.
findSellingWaterPageByWaiting
(
wating
,
Integer
.
valueOf
(
infoFromToken
.
getId
()),
pageNo
,
pageSize
);
return
ObjectRestResponse
.
succ
(
sellingWalletPagVo
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/WalletCathController.java
0 → 100644
View file @
128a1094
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.MyWalletCathBiz
;
import
com.github.wxiaoqi.security.admin.vo.WalletCathPageVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 14:17
*/
@RestController
@RequestMapping
(
"/walletcath"
)
public
class
WalletCathController
{
@Autowired
private
MyWalletCathBiz
myWalletCathBiz
;
@Autowired
private
UserAuthUtil
userAuthUtil
;
@Autowired
private
UserAuthConfig
userAuthConfig
;
@GetMapping
public
ObjectRestResponse
<
WalletCathPageVo
>
findWatchCatchByWithdrawalState
(
@RequestParam
(
"state"
)
Integer
state
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
HttpServletRequest
request
)
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
WalletCathPageVo
catchByWithdrawa
=
myWalletCathBiz
.
findWatchCatchByWithdrawalState
(
Integer
.
valueOf
(
infoFromToken
.
getId
()),
state
,
pageNo
,
pageSize
);
return
ObjectRestResponse
.
succ
(
catchByWithdrawa
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/UserMemberAdminController.java
View file @
128a1094
...
@@ -6,6 +6,8 @@ import com.github.wxiaoqi.security.admin.dto.UserMemberSaveDTO;
...
@@ -6,6 +6,8 @@ import com.github.wxiaoqi.security.admin.dto.UserMemberSaveDTO;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
...
@@ -26,11 +28,13 @@ import java.util.List;
...
@@ -26,11 +28,13 @@ import java.util.List;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/admin/member"
)
@RequestMapping
(
"/admin/member"
)
@Api
(
"后台*会员管理"
)
public
class
UserMemberAdminController
{
public
class
UserMemberAdminController
{
@Autowired
@Autowired
private
BaseUserMemberExportBiz
baseUserMemberExportBiz
;
private
BaseUserMemberExportBiz
baseUserMemberExportBiz
;
@ApiOperation
(
"批量导入会员"
)
@PostMapping
(
"/user/export"
)
@PostMapping
(
"/user/export"
)
public
ObjectRestResponse
importUserMember
(
@RequestPart
(
"file"
)
MultipartFile
userMemberExcel
)
{
public
ObjectRestResponse
importUserMember
(
@RequestPart
(
"file"
)
MultipartFile
userMemberExcel
)
{
List
<
String
[]>
userMemberData
=
ExcelImport
.
getExcelData
(
userMemberExcel
);
List
<
String
[]>
userMemberData
=
ExcelImport
.
getExcelData
(
userMemberExcel
);
...
@@ -52,6 +56,7 @@ public class UserMemberAdminController {
...
@@ -52,6 +56,7 @@ public class UserMemberAdminController {
}
}
@ApiOperation
(
"会员excel模板下载"
)
@GetMapping
(
"/app/unauth/user/excel_model/dowload"
)
@GetMapping
(
"/app/unauth/user/excel_model/dowload"
)
public
ResponseEntity
<
byte
[]>
dowloadUserMemberExcelModel
(
HttpServletResponse
response
){
public
ResponseEntity
<
byte
[]>
dowloadUserMemberExcelModel
(
HttpServletResponse
response
){
// 重置response
// 重置response
...
@@ -68,6 +73,8 @@ public class UserMemberAdminController {
...
@@ -68,6 +73,8 @@ public class UserMemberAdminController {
}
}
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
null
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
null
);
}
}
@ApiOperation
(
"会员新增"
)
@PostMapping
(
"/save"
)
@PostMapping
(
"/save"
)
public
ObjectRestResponse
<
Void
>
saveUserMember
(
@RequestBody
UserMemberSaveDTO
userMemberSaveDTO
)
{
public
ObjectRestResponse
<
Void
>
saveUserMember
(
@RequestBody
UserMemberSaveDTO
userMemberSaveDTO
)
{
baseUserMemberExportBiz
.
saveUserMember
(
userMemberSaveDTO
);
baseUserMemberExportBiz
.
saveUserMember
(
userMemberSaveDTO
);
...
...
ace-modules/ace-admin/src/main/resources/mapper/MyWaterMapper.xml
0 → 100644
View file @
128a1094
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.MyWalletMapper"
>
<update
id=
"updMyWater"
parameterType=
"com.github.wxiaoqi.security.admin.entity.MyWallet"
>
update my_wallet
<set>
<if
test=
" userId!=null and userId!=''"
>
user_id=#{userId},
</if>
<if
test=
"balance!=null and balance!='' "
>
balance=#{balance},
</if>
<if
test=
"balance!=null and balance!='' "
>
withdrawals=#{withdrawals},
</if>
<if
test=
"totalAmount!=null and totalAmount!='' "
>
total_amount=#{totalAmount},
</if>
<if
test=
"todayAmount!=null and todayAmount!='' "
>
today_amount=#{todayAmount},
</if>
<if
test=
"unbooked!=null and unbooked!='' "
>
unbooked=#{unbooked},
</if>
<if
test=
"isFrozen!=null and isFrozen!='' "
>
is_frozen=#{isFrozen},
</if>
<if
test=
"lastIntime!=null and lastIntime!='' "
>
last_intime=#{lastIntime},
</if>
<if
test=
"crtTime!=null and crtTime!='' "
>
crt_time=#{crtTime},
</if>
<if
test=
"updTime!=null and updTime!='' "
>
upd_time=#{updTime},
</if>
<if
test=
"version!=null and version!='' "
>
version=version+1,
</if>
</set>
<where>
id=#{id} and version=#{version}
</where>
</update>
</mapper>
\ No newline at end of file
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/entity/IntegralRule.java
View file @
128a1094
...
@@ -114,6 +114,12 @@ public class IntegralRule{
...
@@ -114,6 +114,12 @@ public class IntegralRule{
*/
*/
private
String
name
;
private
String
name
;
/**
* 规则名称
*/
private
String
code
;
/**
/**
* 获取积分规则
* 获取积分规则
*/
*/
...
...
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/entity/IntegralUserRecord.java
View file @
128a1094
package
com
.
xxfc
.
platform
.
activity
.
entity
;
package
com
.
xxfc
.
platform
.
activity
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
...
@@ -8,6 +10,7 @@ import javax.persistence.Table;
...
@@ -8,6 +10,7 @@ import javax.persistence.Table;
@Table
(
name
=
"integral_user_record"
)
@Table
(
name
=
"integral_user_record"
)
@Data
@Data
@Builder
public
class
IntegralUserRecord
{
public
class
IntegralUserRecord
{
/**
/**
* 主键id
* 主键id
...
@@ -34,8 +37,8 @@ public class IntegralUserRecord {
...
@@ -34,8 +37,8 @@ public class IntegralUserRecord {
/**
/**
* 积分规则id
* 积分规则id
*/
*/
@Column
(
name
=
"integral_rule_
id
"
)
@Column
(
name
=
"integral_rule_
code
"
)
private
Integer
integralRuleId
;
private
String
integralRuleCode
;
/**
/**
* 积分时间
* 积分时间
...
...
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/IntegralRuleDto.java
View file @
128a1094
...
@@ -10,105 +10,7 @@ public class IntegralRuleDto extends PageParam {
...
@@ -10,105 +10,7 @@ public class IntegralRuleDto extends PageParam {
/**
/**
* 主键id
* 主键id
*/
*/
private
Integer
id
;
Integer
id
;
/**
String
code
;
* 周期单位:0-天,1-周;3-月;4-季;5-年
*/
private
Integer
period
;
/**
* 次数
*/
private
Integer
number
;
/**
* 积分
*/
private
Integer
point
;
/**
* 积分兑换:金额/分
*/
private
BigDecimal
price
;
/**
* 是否连续:0-不连续;1-连续
*/
private
Boolean
isContinuity
;
/**
* 多少天后连续算
*/
private
Integer
finishDay
;
/**
* n天获取的积分
*/
private
Integer
finishPoint
;
/**
* 是否启用:1-启用;0-停用
*/
private
Boolean
status
;
/**
* 创建时间
*/
private
Long
crtTime
;
/**
* 是否删除:0-正常;1-删除
*/
private
Boolean
isdel
;
/**
* 规则开始时间
*/
private
Long
startTime
;
/**
* 规则结束时间
*/
private
Long
endTime
;
/**
* 更新时间
*/
private
Long
updTime
;
/**
* 备注
*/
private
String
remarks
;
/**
* 描述
*/
private
String
desc
;
/**
* 规则图片
*/
private
String
img
;
/**
* 排序
*/
private
Integer
orderId
;
/**
* 规则名称
*/
private
String
name
;
/**
* 获取积分规则
*/
private
String
regulation
;
/**
* json字符串 如:[{"day":4,"integeral":8},{"day":4,"integeral":8}]
*/
private
String
otherRule
;
}
}
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/IntegralUserRecordDto.java
View file @
128a1094
package
com
.
xxfc
.
platform
.
activity
.
vo
;
package
com
.
xxfc
.
platform
.
activity
.
vo
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.activity.entity.IntegralUserRecord
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
...
@@ -8,6 +9,23 @@ public class IntegralUserRecordDto extends PageParam {
...
@@ -8,6 +9,23 @@ public class IntegralUserRecordDto extends PageParam {
Integer
userId
;
Integer
userId
;
Long
startTime
;
Long
startTime
;
Long
endTime
;
Long
endTime
;
Integer
integralRuleId
;
String
integralRuleCode
;
String
amount
;
/**
* 0-获取积分;1-抵扣积分
*/
private
Integer
type
;
/**
* 积分数
*/
private
Integer
point
;
/**
* 获取积分的途径id:如订单id,评论id,签到记录id
*/
private
Integer
channelId
;
public
IntegralUserRecord
getIntegralUserRecord
()
{
return
IntegralUserRecord
.
builder
().
integralRuleCode
(
integralRuleCode
).
userId
(
userId
).
channelId
(
channelId
).
point
(
point
).
type
(
type
).
isdel
(
false
).
isValid
(
true
).
build
();
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
View file @
128a1094
...
@@ -60,12 +60,15 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
...
@@ -60,12 +60,15 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
public
ObjectRestResponse
<
IntegralRule
>
getOne
(
IntegralRule
integralRule
)
{
public
ObjectRestResponse
<
IntegralRule
>
getOne
(
IntegralRule
Dto
integralRule
)
{
if
(
integralRule
==
null
)
{
if
(
integralRule
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
}
IntegralRule
oldValue
=
mapper
.
selectByPrimaryKey
(
integralRule
.
getId
());
List
<
IntegralRule
>
oldValue
=
mapper
.
selectAllByParam
(
integralRule
);
return
ObjectRestResponse
.
succ
(
oldValue
);
if
(
oldValue
!=
null
&&
oldValue
.
size
()
>
0
)
{
return
ObjectRestResponse
.
succ
(
oldValue
.
get
(
0
));
}
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralSignRecordBiz.java
View file @
128a1094
...
@@ -14,6 +14,7 @@ import com.xxfc.platform.activity.entity.IntegralUserTotal;
...
@@ -14,6 +14,7 @@ import com.xxfc.platform.activity.entity.IntegralUserTotal;
import
com.xxfc.platform.activity.mapper.IntegralSignRecordMapper
;
import
com.xxfc.platform.activity.mapper.IntegralSignRecordMapper
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.activity.util.IntegralToolsUtils
;
import
com.xxfc.platform.activity.util.IntegralToolsUtils
;
import
com.xxfc.platform.activity.vo.IntegralRuleDto
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
com.xxfc.platform.activity.vo.IntegralUserTotalDto
;
import
com.xxfc.platform.activity.vo.IntegralUserTotalDto
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -44,17 +45,20 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
...
@@ -44,17 +45,20 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
* 签到
* 签到
* @return
* @return
*/
*/
public
ObjectRestResponse
add
(
Integer
integralRuleId
)
{
public
ObjectRestResponse
add
(
String
code
)
{
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
if
(
appUserDTO
==
null
)
{
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
}
}
if
(
StringUtils
.
isBlank
(
code
))
{
return
ObjectRestResponse
.
createDefaultFail
();
}
List
<
IntegralSignRecord
>
integralSignRecordList
=
mapper
.
selectByUserId
(
appUserDTO
.
getUserid
());
List
<
IntegralSignRecord
>
integralSignRecordList
=
mapper
.
selectByUserId
(
appUserDTO
.
getUserid
());
//第一次签到 默认连续1
//第一次签到 默认连续1
if
(
integralSignRecordList
==
null
||
integralSignRecordList
.
size
()
<=
0
)
{
if
(
integralSignRecordList
==
null
||
integralSignRecordList
.
size
()
<=
0
)
{
IntegralSignRecord
integralSignRecord
=
new
IntegralSignRecord
();
IntegralSignRecord
integralSignRecord
=
new
IntegralSignRecord
();
IntegralRule
integralRule
=
new
IntegralRule
();
IntegralRule
Dto
integralRule
=
new
IntegralRuleDto
();
integralRule
.
set
Id
(
integralRuleId
);
integralRule
.
set
Code
(
code
);
ObjectRestResponse
<
IntegralRule
>
objectRestResponse
=
integralRuleBiz
.
getOne
(
integralRule
);
ObjectRestResponse
<
IntegralRule
>
objectRestResponse
=
integralRuleBiz
.
getOne
(
integralRule
);
if
(
objectRestResponse
.
getData
()
!=
null
)
{
if
(
objectRestResponse
.
getData
()
!=
null
)
{
integralSignRecord
.
setUserId
(
appUserDTO
.
getUserid
());
integralSignRecord
.
setUserId
(
appUserDTO
.
getUserid
());
...
@@ -73,8 +77,8 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
...
@@ -73,8 +77,8 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
IntegralSignRecord
integralSignRecord
=
integralSignRecordList
.
get
(
0
);
IntegralSignRecord
integralSignRecord
=
integralSignRecordList
.
get
(
0
);
//判断最后签到的时间和当前时间是不是相差一天
//判断最后签到的时间和当前时间是不是相差一天
int
day
=
IntegralToolsUtils
.
differentDaysByMillisecond
(
integralSignRecord
.
getLastTime
(),
new
Date
().
getTime
());
int
day
=
IntegralToolsUtils
.
differentDaysByMillisecond
(
integralSignRecord
.
getLastTime
(),
new
Date
().
getTime
());
IntegralRule
integralRule
=
new
IntegralRule
();
IntegralRule
Dto
integralRule
=
new
IntegralRuleDto
();
integralRule
.
set
Id
(
integralRuleId
);
integralRule
.
set
Code
(
code
);
ObjectRestResponse
<
IntegralRule
>
objectRestResponse
=
integralRuleBiz
.
getOne
(
integralRule
);
ObjectRestResponse
<
IntegralRule
>
objectRestResponse
=
integralRuleBiz
.
getOne
(
integralRule
);
if
(
objectRestResponse
.
getData
()
!=
null
)
{
if
(
objectRestResponse
.
getData
()
!=
null
)
{
if
(
day
==
1
)
{
//第二天续签
if
(
day
==
1
)
{
//第二天续签
...
@@ -139,13 +143,11 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
...
@@ -139,13 +143,11 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
}
}
//添加积分记录
//添加积分记录
List
<
IntegralSignRecord
>
integralSignRecords
=
mapper
.
selectByUserId
(
appUserDTO
.
getUserid
());
List
<
IntegralSignRecord
>
integralSignRecords
=
mapper
.
selectByUserId
(
appUserDTO
.
getUserid
());
IntegralUserRecord
integralUserRecord
=
new
IntegralUserRecord
();
IntegralUserRecord
Dto
integralUserRecord
=
new
IntegralUserRecordDto
();
integralUserRecord
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserRecord
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserRecord
.
setType
(
0
);
integralUserRecord
.
setType
(
0
);
integralUserRecord
.
setIsdel
(
false
);
integralUserRecord
.
setChannelId
(
integralSignRecords
.
get
(
0
).
getId
());
integralUserRecord
.
setChannelId
(
integralSignRecords
.
get
(
0
).
getId
());
integralUserRecord
.
setIntegralRuleId
(
integralRule
.
getId
());
integralUserRecord
.
setIntegralRuleCode
(
integralRule
.
getCode
());
integralUserRecord
.
setIsValid
(
true
);
integralUserRecord
.
setPoint
(
point
);
integralUserRecord
.
setPoint
(
point
);
integralUserRecordBiz
.
add
(
integralUserRecord
);
integralUserRecordBiz
.
add
(
integralUserRecord
);
}
}
...
@@ -170,7 +172,7 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
...
@@ -170,7 +172,7 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
public
boolean
getSignNumberBoolean
(
AppUserDTO
appUserDTO
,
IntegralRule
integralRule
)
{
public
boolean
getSignNumberBoolean
(
AppUserDTO
appUserDTO
,
IntegralRule
integralRule
)
{
IntegralUserRecordDto
integralUserRecordDto
=
new
IntegralUserRecordDto
();
IntegralUserRecordDto
integralUserRecordDto
=
new
IntegralUserRecordDto
();
integralUserRecordDto
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserRecordDto
.
setUserId
(
appUserDTO
.
getUserid
());
integralUserRecordDto
.
setIntegralRule
Id
(
integralRule
.
getId
());
integralUserRecordDto
.
setIntegralRule
Code
(
integralRule
.
getCode
());
switch
(
integralRule
.
getPeriod
())
{
switch
(
integralRule
.
getPeriod
())
{
case
0
:
//日
case
0
:
//日
return
getBoolean
(
IntegralToolsUtils
.
getDayStart
(),
IntegralToolsUtils
.
getDayStart
()
+
24
*
60
*
60
*
1000
-
1
,
integralUserRecordDto
,
integralRule
);
return
getBoolean
(
IntegralToolsUtils
.
getDayStart
(),
IntegralToolsUtils
.
getDayStart
()
+
24
*
60
*
60
*
1000
-
1
,
integralUserRecordDto
,
integralRule
);
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralUserRecordBiz.java
View file @
128a1094
This diff is collapsed.
Click to expand it.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralUserTotalBiz.java
View file @
128a1094
...
@@ -55,6 +55,34 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
...
@@ -55,6 +55,34 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
public
ObjectRestResponse
update
(
IntegralUserTotalDto
integralUserTotalDto
)
{
if
(
integralUserTotalDto
==
null
||
integralUserTotalDto
.
getUserId
()
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
List
<
IntegralUserTotal
>
integralUserTotalList
=
mapper
.
selectAllByParam
(
integralUserTotalDto
);
if
(
integralUserTotalList
!=
null
&&
integralUserTotalList
.
size
()
>
0
)
{
if
(
integralUserTotalDto
.
getPoint
()
>
0
)
{
//加
integralUserTotalList
.
get
(
0
).
setTotalPoint
(
integralUserTotalList
.
get
(
0
).
getTotalPoint
()
+
integralUserTotalDto
.
getPoint
());
integralUserTotalList
.
get
(
0
).
setRestPoint
(
integralUserTotalList
.
get
(
0
).
getRestPoint
()
+
integralUserTotalDto
.
getPoint
());
updateByIdRe
(
integralUserTotalList
.
get
(
0
));
return
ObjectRestResponse
.
succ
();
}
else
{
//减积分
integralUserTotalList
.
get
(
0
).
setRestPoint
(
integralUserTotalList
.
get
(
0
).
getTotalPoint
()
+
integralUserTotalDto
.
getPoint
());
updateByIdRe
(
integralUserTotalList
.
get
(
0
));
return
ObjectRestResponse
.
succ
();
}
}
IntegralUserTotal
integralUserTotal
=
new
IntegralUserTotal
();
integralUserTotal
.
setUserId
(
integralUserTotalDto
.
getUserId
());
integralUserTotal
.
setTotalPoint
(
integralUserTotalDto
.
getPoint
());
integralUserTotal
.
setRestPoint
(
integralUserTotalDto
.
getPoint
());
integralUserTotal
.
setIsdel
(
false
);
insertSelective
(
integralUserTotal
);
return
ObjectRestResponse
.
succ
();
}
/**
/**
* 删除信息
* 删除信息
* @return
* @return
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/handler/IntegralMQHandler.java
0 → 100644
View file @
128a1094
package
com
.
xxfc
.
platform
.
activity
.
handler
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xxfc.platform.activity.biz.IntegralUserRecordBiz
;
import
com.xxfc.platform.activity.vo.IntegralUserRecordDto
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
@Component
@Slf4j
public
class
IntegralMQHandler
{
@Autowired
IntegralUserRecordBiz
integralUserRecordBiz
;
@RabbitListener
(
queues
=
"integral_queue"
)
public
void
integralHandler
(
String
json
)
{
log
.
info
(
"接收到的消息:json = {}"
,
json
);
try
{
if
(
StringUtils
.
isNotBlank
(
json
))
{
IntegralUserRecordDto
integralUserRecordDto
=
JSONObject
.
parseObject
(
json
,
IntegralUserRecordDto
.
class
);
integralUserRecordBiz
.
add
(
integralUserRecordDto
);
}
}
catch
(
Exception
e
){
log
.
info
(
"接收到的消息失败"
);
e
.
printStackTrace
();
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/IntegralRuleController.java
View file @
128a1094
...
@@ -37,8 +37,8 @@ public class IntegralRuleController {
...
@@ -37,8 +37,8 @@ public class IntegralRuleController {
@GetMapping
(
value
=
"/one"
)
@GetMapping
(
value
=
"/one"
)
@ApiOperation
(
value
=
"根据id获取制定规则"
)
@ApiOperation
(
value
=
"根据id获取制定规则"
)
public
ObjectRestResponse
<
IntegralRule
>
getOne
(
IntegralRule
integralRule
)
{
public
ObjectRestResponse
<
IntegralRule
>
getOne
(
IntegralRule
Dto
integralRuleDto
)
{
return
integralRuleBiz
.
getOne
(
integralRule
);
return
integralRuleBiz
.
getOne
(
integralRule
Dto
);
}
}
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/IntegralSignRecordController.java
View file @
128a1094
...
@@ -17,8 +17,8 @@ public class IntegralSignRecordController {
...
@@ -17,8 +17,8 @@ public class IntegralSignRecordController {
IntegralSignRecordBiz
integralSignRecordBiz
;
IntegralSignRecordBiz
integralSignRecordBiz
;
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
ObjectRestResponse
add
(
Integer
integralRuleId
)
{
public
ObjectRestResponse
add
(
String
integralRuleCode
)
{
return
integralSignRecordBiz
.
add
(
integralRule
Id
);
return
integralSignRecordBiz
.
add
(
integralRule
Code
);
}
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/IntegralUserRecordController.java
View file @
128a1094
...
@@ -21,8 +21,8 @@ public class IntegralUserRecordController {
...
@@ -21,8 +21,8 @@ public class IntegralUserRecordController {
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
ObjectRestResponse
add
(
IntegralUserRecord
integralUserRecord
)
{
public
ObjectRestResponse
add
(
IntegralUserRecord
Dto
integralUserRecordDto
)
{
return
integralUserRecordBiz
.
add
(
integralUserRecord
);
return
integralUserRecordBiz
.
add
(
integralUserRecord
Dto
);
}
}
@PostMapping
(
value
=
"/delete"
)
@PostMapping
(
value
=
"/delete"
)
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralRuleMapper.xml
View file @
128a1094
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<result
column=
"img"
property=
"img"
jdbcType=
"VARCHAR"
/>
<result
column=
"img"
property=
"img"
jdbcType=
"VARCHAR"
/>
<result
column=
"order_id"
property=
"orderId"
jdbcType=
"INTEGER"
/>
<result
column=
"order_id"
property=
"orderId"
jdbcType=
"INTEGER"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"code"
property=
"code"
jdbcType=
"VARCHAR"
/>
<result
column=
"regulation"
property=
"regulation"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"regulation"
property=
"regulation"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"other_rule"
property=
"otherRule"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"other_rule"
property=
"otherRule"
jdbcType=
"LONGVARCHAR"
/>
</resultMap>
</resultMap>
...
@@ -35,6 +36,9 @@
...
@@ -35,6 +36,9 @@
<if
test=
"id != null"
>
<if
test=
"id != null"
>
and id = #{id}
and id = #{id}
</if>
</if>
<if
test=
"code != null"
>
and code = #{code}
</if>
and isdel = 0 and status = 1
and isdel = 0 and status = 1
</where>
</where>
order by order_id DESC ,crt_time DESC
order by order_id DESC ,crt_time DESC
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralUserRecordMapper.xml
View file @
128a1094
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"point"
property=
"point"
jdbcType=
"INTEGER"
/>
<result
column=
"point"
property=
"point"
jdbcType=
"INTEGER"
/>
<result
column=
"integral_rule_
id"
property=
"integralRuleId
"
jdbcType=
"INTEGER"
/>
<result
column=
"integral_rule_
code"
property=
"integralRuleCode
"
jdbcType=
"INTEGER"
/>
<result
column=
"crt_time"
property=
"crtTime"
jdbcType=
"BIGINT"
/>
<result
column=
"crt_time"
property=
"crtTime"
jdbcType=
"BIGINT"
/>
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"BIT"
/>
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"BIT"
/>
<result
column=
"isdel"
property=
"isdel"
jdbcType=
"BIT"
/>
<result
column=
"isdel"
property=
"isdel"
jdbcType=
"BIT"
/>
...
@@ -27,6 +27,6 @@
...
@@ -27,6 +27,6 @@
</select>
</select>
<select
id=
"selectByUserAndTime"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserRecord"
parameterType=
"com.xxfc.platform.activity.vo.IntegralUserRecordDto"
>
<select
id=
"selectByUserAndTime"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserRecord"
parameterType=
"com.xxfc.platform.activity.vo.IntegralUserRecordDto"
>
select * from integral_user_record
select * from integral_user_record
where user_id = #{userId} and crt_time between #{startTime} and #{endTime} and integral_rule_
id = #{integralRuleId
}
where user_id = #{userId} and crt_time between #{startTime} and #{endTime} and integral_rule_
code = #{integralRuleCode
}
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-universal/xx-universal-api/pom.xml
View file @
128a1094
...
@@ -30,6 +30,10 @@
...
@@ -30,6 +30,10 @@
<artifactId>
jsoup
</artifactId>
<artifactId>
jsoup
</artifactId>
<version>
1.7.2
</version>
<version>
1.7.2
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-amqp
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.jdom
</groupId>
<groupId>
org.jdom
</groupId>
<artifactId>
jdom
</artifactId>
<artifactId>
jdom
</artifactId>
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/Dictionary.java
View file @
128a1094
...
@@ -3,11 +3,12 @@ package com.xxfc.platform.universal.entity;
...
@@ -3,11 +3,12 @@ package com.xxfc.platform.universal.entity;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.util.Set
;
import
java.util.Set
;
@Data
@Data
@Table
(
name
=
"data_dictionary"
)
@Table
(
name
=
"data_dictionary"
)
public
class
Dictionary
{
public
class
Dictionary
implements
Serializable
{
@Id
@Id
private
Integer
id
;
private
Integer
id
;
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/MQSerderFeign.java
0 → 100644
View file @
128a1094
package
com
.
xxfc
.
platform
.
universal
.
feign
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@FeignClient
(
value
=
"xx-universal"
,
contextId
=
"sendMessage"
)
public
interface
MQSerderFeign
{
@GetMapping
(
value
=
"/message/sendMessage"
)
public
ObjectRestResponse
sendMessage
(
@RequestParam
(
value
=
"exchange"
)
String
exchange
,
@RequestParam
(
value
=
"routingKey"
)
String
routKey
,
@RequestParam
(
value
=
"jsonParam"
)
String
jsonParam
);
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/mq/MQAutoConfiguration.java
0 → 100644
View file @
128a1094
package
com
.
xxfc
.
platform
.
universal
.
mq
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.connection.CachingConnectionFactory
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.amqp.rabbit.transaction.RabbitTransactionManager
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Scope
;
/**
* 项目中Mq的自动配置
*
* @author Vangelis
* @date 2019-06-01 20:36
*/
@Configuration
@Slf4j
@AllArgsConstructor
public
class
MQAutoConfiguration
{
private
final
ConnectionFactory
connectionFactory
;
@Bean
@Scope
(
"prototype"
)
public
RabbitTemplate
rabbitTemplate
()
{
RabbitTemplate
rabbitTemplate
=
new
RabbitTemplate
(
connectionFactory
);
//开启回调 必须设置为true
rabbitTemplate
.
setMandatory
(
true
);
rabbitTemplate
.
setConfirmCallback
((
correlationData
,
ack
,
cause
)->{
//实现消息到达交换器的回调方法
log
.
info
(
"RabbitMQ sendMessage-->confirm-->start correlationData:{},ack:{},cause:{}"
,
correlationData
,
ack
,
cause
);
log
.
info
(
"RabbitMQ sendMessage-->confirm-->end"
);
});
rabbitTemplate
.
setReturnCallback
((
message
,
replyCode
,
replyText
,
exchange
,
routingKey
)->{
//实现消息到达队列的回调方法
log
.
info
(
"RabbitMQ sendMessage-->returnedMessage-->start message:{},replyCode:{},replyText:{},exchange:{},routingKey:{}"
,
message
.
toString
(),
replyCode
,
replyText
,
exchange
,
routingKey
);
log
.
info
(
"RabbitMQ sendMessage-->returnedMessage-->end"
);
});
return
rabbitTemplate
;
}
/**
* 监听器中默认封装实现
*/
@Bean
public
SimpleRabbitListenerContainerFactory
rabbitListenerContainerFactory
()
{
SimpleRabbitListenerContainerFactory
factory
=
new
SimpleRabbitListenerContainerFactory
();
factory
.
setConnectionFactory
(
connectionFactory
);
factory
.
setConcurrentConsumers
(
3
);
factory
.
setMaxConcurrentConsumers
(
10
);
return
factory
;
}
/**
* 配置启用rabbitmq事务
*/
@Bean
public
RabbitTransactionManager
rabbitTransactionManager
(
CachingConnectionFactory
connectionFactory
)
{
return
new
RabbitTransactionManager
(
connectionFactory
);
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/mq/RabbitConfig.java
0 → 100644
View file @
128a1094
package
com
.
xxfc
.
platform
.
universal
.
mq
;
import
org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer
;
import
org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.messaging.converter.MappingJackson2MessageConverter
;
import
org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory
;
import
org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory
;
@Configuration
public
class
RabbitConfig
implements
RabbitListenerConfigurer
{
@Override
public
void
configureRabbitListeners
(
RabbitListenerEndpointRegistrar
registrar
)
{
registrar
.
setMessageHandlerMethodFactory
(
messageHandlerMethodFactory
());
}
@Bean
MessageHandlerMethodFactory
messageHandlerMethodFactory
()
{
DefaultMessageHandlerMethodFactory
messageHandlerMethodFactory
=
new
DefaultMessageHandlerMethodFactory
();
messageHandlerMethodFactory
.
setMessageConverter
(
consumerJackson2MessageConverter
());
return
messageHandlerMethodFactory
;
}
@Bean
public
MappingJackson2MessageConverter
consumerJackson2MessageConverter
()
{
return
new
MappingJackson2MessageConverter
();
}
}
\ No newline at end of file
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/mq/RabbitMQSender.java
0 → 100644
View file @
128a1094
package
com
.
xxfc
.
platform
.
universal
.
mq
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.rabbit.connection.CorrelationData
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.PostConstruct
;
/**
* RabbitMQ封装发送消息
*
* @author Vangelis
* @date 2019-06-02 11:56
*/
@AllArgsConstructor
@Slf4j
@Component
@Scope
(
"prototype"
)
public
class
RabbitMQSender
implements
RabbitTemplate
.
ConfirmCallback
,
RabbitTemplate
.
ReturnCallback
{
private
RabbitTemplate
rabbitTemplate
;
@PostConstruct
private
void
init
()
{
// 使用当前类作为发送后回调通知
rabbitTemplate
.
setConfirmCallback
(
this
);
//是否当前类作为返回失败错误处理
rabbitTemplate
.
setReturnCallback
(
this
);
}
/**
* Confirmation callback.
*
* @param correlationData correlation data for the callback.
* @param ack true for ack, false for nack
* @param cause An optional cause, for nack, when available, otherwise null.
*/
@Override
public
void
confirm
(
CorrelationData
correlationData
,
boolean
ack
,
String
cause
)
{
if
(
ack
)
{
log
.
info
(
"消息已经确认收到"
);
}
else
{
log
.
info
(
"消息没有确认收到,你该在这里写没有收到消息的处理代码"
);
}
}
/**
* 开启事务发送消息的封装
* @param exchange exchange
* @param routingKey routingKey
* @param msg 消息体
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
sendMsg
(
String
exchange
,
String
routingKey
,
Object
msg
)
{
log
.
info
(
"使用事务发送消息,msg{}"
,
msg
);
rabbitTemplate
.
convertAndSend
(
exchange
,
routingKey
,
msg
);
}
/**
* Returned message callback.
*
* @param message the returned message.
* @param replyCode the reply code.
* @param replyText the reply text.
* @param exchange the exchange.
* @param routingKey the routing key.
*/
@Override
public
void
returnedMessage
(
Message
message
,
int
replyCode
,
String
replyText
,
String
exchange
,
String
routingKey
)
{
log
.
info
(
"消息返回没有收到"
);
}
}
xx-universal/xx-universal-server/pom.xml
View file @
128a1094
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
<artifactId>
aliyun-java-sdk-dysmsapi
</artifactId>
<artifactId>
aliyun-java-sdk-dysmsapi
</artifactId>
<version>
1.1.0
</version>
<version>
1.1.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<artifactId>
hutool-all
</artifactId>
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/MQServiceBiZ.java
0 → 100644
View file @
128a1094
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
lombok.AllArgsConstructor
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.stereotype.Service
;
@Service
@AllArgsConstructor
public
class
MQServiceBiZ
{
private
RabbitTemplate
rabbitTemplate
;
public
ObjectRestResponse
sendMessage
(
String
exchange
,
String
routKey
,
String
json
)
{
rabbitTemplate
.
convertAndSend
(
exchange
,
routKey
,
json
);
return
ObjectRestResponse
.
succ
();
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/MQSenderController.java
0 → 100644
View file @
128a1094
package
com
.
xxfc
.
platform
.
universal
.
controller
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.biz.MQServiceBiZ
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
value
=
"message"
)
public
class
MQSenderController
{
@Autowired
private
MQServiceBiZ
mqServiceBiZ
;
@GetMapping
(
value
=
"/sendMessage"
)
public
ObjectRestResponse
sendMessage
(
String
exchange
,
String
routKey
,
String
json
)
{
return
mqServiceBiZ
.
sendMessage
(
exchange
,
routKey
,
json
);
}
}
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