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
eebe824e
Commit
eebe824e
authored
Oct 21, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev-tiande' into dev-tiande
parents
7f6f8c21
db1dc544
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
569 additions
and
9 deletions
+569
-9
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+1
-2
CompanyWalletDetailV2DTO.java
...xfc/platform/order/pojo/dto/CompanyWalletDetailV2DTO.java
+137
-0
CompanyWalletDetailV2Biz.java
...com/xxfc/platform/order/biz/CompanyWalletDetailV2Biz.java
+383
-0
OrderExtractMQHandler.java
.../xxfc/platform/order/mqhandler/OrderExtractMQHandler.java
+44
-4
CompanyWalletDetailController.java
...fc/platform/order/rest/CompanyWalletDetailController.java
+3
-2
CompanyWaterDetailMapper.xml
...er/src/main/resources/mapper/CompanyWaterDetailMapper.xml
+1
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
eebe824e
...
...
@@ -346,7 +346,6 @@ public class AppPermissionService {
//生成邀请码 长度改为8 不然重复率太高
rsUserDetail
.
setCode
(
ReferralCodeUtil
.
encode
(
userid
));
log
.
info
(
"register------username====="
+
username
+
"----channel===="
+
channel
);
channel
=-
1
;
rsUserDetail
.
setChannel
(
channel
);
rsUserDetail
.
setRegisterSource
(
registerSource
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
...
...
@@ -1088,7 +1087,7 @@ public class AppPermissionService {
rsUserDetail
.
setCode
(
ReferralCodeUtil
.
encode
(
userid
));
//设置来源
log
.
info
(
"register------username====="
+
username
+
"----channel===="
+
UserSourceEnum
.
APPLET
.
getCode
());
rsUserDetail
.
setChannel
(
-
1
);
rsUserDetail
.
setChannel
(
2
);
rsUserDetail
.
setCrtHost
(
getIp
());
//setCreateIPInfo(rsUserDetail);
rsUserDetail
.
setState
(
1
);
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/dto/CompanyWalletDetailV2DTO.java
0 → 100644
View file @
eebe824e
package
com
.
xxfc
.
platform
.
order
.
pojo
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
/**
* 门店收支明细DTO
* @author libin
* @version 1.0
* @description
* @data 2019/12/25 14:53
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
CompanyWalletDetailV2DTO
{
@ApiModelProperty
(
"订单号"
)
private
String
orderNo
;
@ApiModelProperty
(
"是否取消订单:0-否;1-是"
)
private
Integer
isCanelOrder
=
0
;
@ApiModelProperty
(
"出发门店"
)
private
Integer
startCompanyId
;
@ApiModelProperty
(
"结束门店"
)
private
Integer
endCompanyId
;
@ApiModelProperty
(
"所属门店"
)
private
Integer
vehicleCompanyId
;
@ApiModelProperty
(
"平台门店"
)
private
Integer
platformCompanyId
;
@ApiModelProperty
(
"平台门店"
)
private
Long
platformBranchId
;
@ApiModelProperty
(
"消费金额"
)
private
BigDecimal
orderAmount
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"收车服务费"
)
private
BigDecimal
closedVehicleAmout
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"不计免赔费"
)
private
BigDecimal
damageSafeAmount
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"其他费用-延迟用车不记免赔"
)
private
BigDecimal
damageSafeAmount2
=
BigDecimal
.
ZERO
;
//算出来
@ApiModelProperty
(
"分销金额"
)
private
BigDecimal
comssion
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"定损费"
)
private
BigDecimal
lossSpecifiedAmount
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"违章费"
)
private
BigDecimal
breakRulesRegulation
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"违约金"
)
private
BigDecimal
violateAmount
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"更换还车公司费用"
)
private
BigDecimal
chageAmount
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"订单抽成比例"
)
private
BigDecimal
orderExtract
=
new
BigDecimal
(
1
);
@ApiModelProperty
(
"平台抽成比例"
)
private
BigDecimal
platformExtract
=
new
BigDecimal
(
1
);
//算出来
@ApiModelProperty
(
"车辆费用"
)
private
BigDecimal
vehicleAmount
;
public
BigDecimal
getVehicleAmount
(){
return
orderAmount
.
subtract
(
closedVehicleAmout
).
subtract
(
damageSafeAmount
).
subtract
(
comssion
);
}
@ApiModelProperty
(
"订单抽成"
)
private
BigDecimal
orderComssion
;
public
BigDecimal
getOrderComssion
(){
return
(
getVehicleAmount
().
multiply
(
orderExtract
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)).
add
(
chageAmount
);
}
@ApiModelProperty
(
"平台抽成"
)
private
BigDecimal
platformComssion
;
public
BigDecimal
getPlatformComssion
(){
return
getVehicleAmount
().
multiply
(
platformExtract
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
//算出来
@ApiModelProperty
(
"车辆租赁费"
)
private
BigDecimal
rentVehicleAmount
;
public
BigDecimal
getRentVehicleAmount
(){
return
getVehicleAmount
().
subtract
(
getOrderComssion
()).
subtract
(
getPlatformComssion
());
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/CompanyWalletDetailV2Biz.java
0 → 100644
View file @
eebe824e
This diff is collapsed.
Click to expand it.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mqhandler/OrderExtractMQHandler.java
View file @
eebe824e
...
...
@@ -4,6 +4,7 @@ package com.xxfc.platform.order.mqhandler;
import
cn.hutool.json.JSONUtil
;
import
com.rabbitmq.client.Channel
;
import
com.xxfc.platform.order.biz.CompanyWalletDetailBiz
;
import
com.xxfc.platform.order.biz.CompanyWalletDetailV2Biz
;
import
com.xxfc.platform.order.biz.OrderAccountBiz
;
import
com.xxfc.platform.order.biz.OrderRefundBiz
;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
...
...
@@ -22,15 +23,14 @@ import java.util.Map;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
static
com
.
xxfc
.
platform
.
order
.
config
.
RabbitOrderConfig
.
ORDER_DEPOSIT_FINISH_QUEUE
;
import
static
com
.
xxfc
.
platform
.
order
.
config
.
RabbitOrderConfig
.
ORDER_DEPOSIT_REFUND_QUEUE
;
import
static
com
.
xxfc
.
platform
.
order
.
config
.
RabbitOrderConfig
.*;
@Component
@Slf4j
public
class
OrderExtractMQHandler
{
@Autowired
CompanyWalletDetailBiz
companyWalletDetailBiz
;
CompanyWalletDetail
V2
Biz
companyWalletDetailBiz
;
...
...
@@ -55,7 +55,47 @@ public class OrderExtractMQHandler {
OrderMQDTO
orderMQDTO
=
JSONUtil
.
toBean
(
msg
,
OrderMQDTO
.
class
);
CompanyWalletDetail
companyWalletDetail
=
new
CompanyWalletDetail
();
companyWalletDetail
.
setCono
(
orderMQDTO
.
getNo
());
companyWalletDetailBiz
.
addOrUpd
(
companyWalletDetail
);
companyWalletDetailBiz
.
addOrUpd
(
companyWalletDetail
,
1
);
executorService
.
shutdown
();
Long
deliveryTag
=
(
Long
)
headers
.
get
(
AmqpHeaders
.
DELIVERY_TAG
);
// 手动签收
channel
.
basicAck
(
deliveryTag
,
false
);
}
catch
(
Exception
e
)
{
log
.
info
(
"接收到的消息失败"
);
try
{
channel
.
basicNack
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
,
false
);
}
catch
(
IOException
i
)
{
log
.
error
(
e
.
getMessage
(),
i
);
}
log
.
error
(
e
.
getMessage
(),
e
);
}
}
});
}
/**
* 退款
* @param
*/
@RabbitListener
(
queues
=
ORDER_DEPOSIT_END2_QUEUE
)
public
void
orderHandler
(
Message
message
,
@Headers
Map
<
String
,
Object
>
headers
,
Channel
channel
)
{
try
{
Thread
.
sleep
(
5000L
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
ExecutorService
executorService
=
Executors
.
newCachedThreadPool
();
executorService
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
String
messageId
=
message
.
getMessageProperties
().
getMessageId
();
String
msg
=
new
String
(
message
.
getBody
(),
"UTF-8"
);
OrderMQDTO
orderMQDTO
=
JSONUtil
.
toBean
(
msg
,
OrderMQDTO
.
class
);
CompanyWalletDetail
companyWalletDetail
=
new
CompanyWalletDetail
();
companyWalletDetail
.
setCono
(
orderMQDTO
.
getNo
());
companyWalletDetailBiz
.
addOrUpd
(
companyWalletDetail
,
2
);
executorService
.
shutdown
();
Long
deliveryTag
=
(
Long
)
headers
.
get
(
AmqpHeaders
.
DELIVERY_TAG
);
// 手动签收
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/CompanyWalletDetailController.java
View file @
eebe824e
...
...
@@ -4,6 +4,7 @@ package com.xxfc.platform.order.rest;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.order.biz.CompanyWalletDetailBiz
;
import
com.xxfc.platform.order.biz.CompanyWalletDetailV2Biz
;
import
com.xxfc.platform.order.entity.CompanyWalletDetail
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -12,12 +13,12 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping
(
"wallet/detail"
)
public
class
CompanyWalletDetailController
extends
BaseController
<
CompanyWalletDetailBiz
,
CompanyWalletDetail
>
{
public
class
CompanyWalletDetailController
extends
BaseController
<
CompanyWalletDetail
V2
Biz
,
CompanyWalletDetail
>
{
@RequestMapping
(
value
=
"upd"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
refundAmount
(
@RequestBody
CompanyWalletDetail
companyWalletDetail
)
{
baseBiz
.
addOrUpd
(
companyWalletDetail
);
baseBiz
.
addOrUpd
(
companyWalletDetail
,
2
);
return
ObjectRestResponse
.
succ
();
}
...
...
xx-order/xx-order-server/src/main/resources/mapper/CompanyWaterDetailMapper.xml
View file @
eebe824e
...
...
@@ -16,7 +16,7 @@
LEFT JOIN branch_company c ON d.company_id=c.id
LEFT JOIN company_info ci ON d.branch_id=ci.id
<where>
d.itype != 5
<!--d.itype != 5-->
<if
test=
"companyId != null and companyId > 0"
>
and d.company_id=#{companyId}
</if>
...
...
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