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
73525606
Commit
73525606
authored
Jul 12, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
dbda8291
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
13 deletions
+58
-13
AppUserSellingWater.java
...ub/wxiaoqi/security/admin/entity/AppUserSellingWater.java
+2
-2
AppUserPositionBiz.java
...github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
+1
-1
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+25
-10
IntegralMQHandler.java
...hub/wxiaoqi/security/admin/handler/IntegralMQHandler.java
+30
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserSellingWater.java
View file @
73525606
...
...
@@ -131,14 +131,14 @@ public class AppUserSellingWater implements Serializable {
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Integer
crtTime
;
private
Long
crtTime
;
/**
* 更新时间
*/
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Integer
updTime
;
private
Long
updTime
;
/**
* 所获佣金
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionBiz.java
View file @
73525606
...
...
@@ -19,6 +19,6 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
//获取用户职位的折扣
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 @
73525606
...
...
@@ -51,26 +51,40 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper,Ap
MyWaterBiz
myWaterBiz
;
//计算用户拥金
//购买计算用户拥金
public
void
payOrderWater
(
OrderWaterDTO
orderWaterDTO
){
public
void
orderWater
(
OrderWaterDTO
orderWaterDTO
){
if
(
orderWaterDTO
==
null
){
log
.
info
(
"购买计算用户拥金----payOrderWater----次数不能为空----"
);
log
.
info
(
"计算用户拥金----orderWater----次数不能为空----"
);
return
;
}
//订单状态
Integer
status
=
orderWaterDTO
.
getStatus
();
if
(
status
==
null
||
status
==
0
){
log
.
info
(
"购买计算用户拥金----payOrderWater----参数不能为空----status==="
+
status
);
return
;
}
if
(
status
==
1
){
payOrderWater
(
orderWaterDTO
);
}
else
if
(
status
==
2
){
finishOrderWater
(
orderWaterDTO
);
}
else
{
refundOrderWater
(
orderWaterDTO
);
}
}
//购买计算用户拥金
public
void
payOrderWater
(
OrderWaterDTO
orderWaterDTO
){
//订单id
Integer
orderId
=
orderWaterDTO
.
getOrderId
();
//订单号
String
orderNo
=
orderWaterDTO
.
getOrderNo
();
//用户id
Integer
userId
=
orderWaterDTO
.
getUserId
();
//订单状态
Integer
status
=
orderWaterDTO
.
getStatus
();
List
<
OrderGoodsDTO
>
goodsDTOList
=
orderWaterDTO
.
getGoodsDTOList
();
log
.
info
(
"购买计算用户拥金----payOrderWater----userId===="
+
userId
+
"---orderId==="
+
orderId
+
"---orderNo==="
+
orderNo
+
"--status=="
+
status
);
if
(
orderId
==
null
||
orderId
==
0
||
userId
==
null
||
userId
==
0
|
|
status
==
null
||
status
==
0
||
CollectionUtils
.
isEmpty
(
goodsDTOList
)){
log
.
info
(
"购买计算用户拥金----payOrderWater----
次
数不能为空----orderId==="
+
orderId
);
log
.
info
(
"购买计算用户拥金----payOrderWater----userId===="
+
userId
+
"---orderId==="
+
orderId
+
"---orderNo==="
+
orderNo
);
if
(
orderId
==
null
||
orderId
==
0
||
userId
==
null
||
userId
==
0
|
CollectionUtils
.
isEmpty
(
goodsDTOList
)){
log
.
info
(
"购买计算用户拥金----payOrderWater----
参
数不能为空----orderId==="
+
orderId
);
return
;
}
AppUserRelation
relation
=
relationBiz
.
getRelationByUserId
(
userId
);
...
...
@@ -120,6 +134,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper,Ap
sellingWater
.
setImg
(
goodsDto
.
getImg
());
sellingWater
.
setPrice
(
price
);
sellingWater
.
setExtract
(
extract
);
sellingWater
.
setGoodNumber
(
goodsDto
.
getGoodNumber
());
sellingWater
.
setCommission
(
commission
);
insertSelective
(
sellingWater
);
log
.
info
(
"购买计算用户拥成功----payOrderWater--------userId==="
+
userId
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/handler/IntegralMQHandler.java
0 → 100644
View file @
73525606
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
();
}
}
}
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