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
6a3b3676
Commit
6a3b3676
authored
Sep 28, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-vehicle-price' into dev-tiande
parents
07233313
55f43a5f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
4 deletions
+63
-4
ShuntApply.java
.../main/java/com/xxfc/platform/order/entity/ShuntApply.java
+13
-3
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+16
-0
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+17
-0
RabbitConsumer.java
...ava/com/xxfc/platform/order/mqhandler/RabbitConsumer.java
+0
-1
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+3
-0
BgShuntApplyController.java
...latform/order/rest/background/BgShuntApplyController.java
+14
-0
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/ShuntApply.java
View file @
6a3b3676
...
...
@@ -25,6 +25,12 @@ public class ShuntApply implements Serializable {
public
static
final
int
STATUS_CONFIRM
=
3
;
public
static
final
int
STATUS_ORDER
=
4
;
public
static
final
int
STATUS_AUTOCNL
=
5
;
public
static
final
int
STATUS_ERR
=
6
;
public
static
final
int
STATUS_SUCC
=
7
;
public
static
final
int
ORDER_STATUS_TOPAY
=
1
;
public
static
final
int
ORDER_STATUS_PAY
=
2
;
public
static
final
int
ORDER_STATUS_CANCEL
=
3
;
/**
* 主键
...
...
@@ -43,9 +49,13 @@ public class ShuntApply implements Serializable {
*/
@Column
(
name
=
"status"
)
@ApiModelProperty
(
value
=
"状态 0--删除 1--创建 2--取消 3--
申请成功
"
)
@ApiModelProperty
(
value
=
"状态 0--删除 1--创建 2--取消 3--
接单中 4--已下单 5--接单成功 6--接单失败
"
)
private
Integer
status
;
@Column
(
name
=
"order_status"
)
@ApiModelProperty
(
value
=
"状态 1--待支付 2--已支付 3--已取消 "
)
private
Integer
orderStatus
;
/**
* 创建时间
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
6a3b3676
...
...
@@ -149,6 +149,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
@Autowired
CompanyInfoBiz
companyInfoBiz
;
@Autowired
ShuntApplyBiz
shuntApplyBiz
;
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
@@ -799,6 +802,19 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
BeanUtil
.
copyProperties
(
this
.
updateSelectiveByIdReT
(
updateOrder
),
baseOrder
);
//记录订单账款记录
Integer
flag
=
orderAccountBiz
.
addOrderAccount
(
baseOrder
.
getId
(),
"订单支付"
,
oad
.
getOriginOrderAmount
().
add
(
oad
.
getOriginDepositAmount
()),
oad
.
getOrderAmount
().
add
(
oad
.
getDepositAmount
()),
tradeNo
,
AccountTypeEnum
.
IN_ORDER_PAY
.
getCode
(),
JSONUtil
.
toJsonStr
(
oad
));
//更新 申请状态
ShuntApply
shuntApply
=
shuntApplyBiz
.
selectOne
(
new
ShuntApply
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
null
!=
shuntApply
&&
shuntApply
.
getStatus
()
==
ShuntApply
.
STATUS_ORDER
)
{
shuntApplyBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setStatus
(
ShuntApply
.
STATUS_SUCC
);
setOrderStatus
(
ShuntApply
.
ORDER_STATUS_PAY
);
}});
}
}
finally
{
AppUserDTO
appUserDTO
=
userFeign
.
userDetailById
(
baseOrder
.
getUserId
()).
getData
();
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
6a3b3676
...
...
@@ -99,6 +99,9 @@ public class OrderCancelBiz {
@Autowired
ActivityFeign
activityFeign
;
@Autowired
ShuntApplyBiz
shuntApplyBiz
;
private
static
Map
<
Integer
,
List
<
Integer
>>
cancelAble
;
static
{
cancelAble
=
new
HashMap
<
Integer
,
List
<
Integer
>>();
...
...
@@ -419,6 +422,20 @@ public class OrderCancelBiz {
//发送队列消息
baseOrderBiz
.
sendOrderMq
(
orvd
,
otd
,
omd
,
baseOrder
,
OrderMQDTO
.
ORDER_CANCEL
);
//处理申请
//更新 申请状态
ShuntApply
shuntApply
=
shuntApplyBiz
.
selectOne
(
new
ShuntApply
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
if
(
null
!=
shuntApply
&&
shuntApply
.
getStatus
()
==
ShuntApply
.
STATUS_ORDER
)
{
shuntApplyBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setStatus
(
ShuntApply
.
STATUS_ERR
);
setOrderStatus
(
ShuntApply
.
ORDER_STATUS_CANCEL
);
}});
}
}
else
{
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mqhandler/RabbitConsumer.java
View file @
6a3b3676
...
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.order.mqhandler;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.rabbitmq.client.Channel
;
import
com.xxfc.platform.order.biz.OrderRentVehicleBiz
;
import
com.xxfc.platform.order.biz.ShuntApplyBiz
;
import
com.xxfc.platform.order.biz.inner.OrderCancelBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
View file @
6a3b3676
...
...
@@ -14,6 +14,7 @@ import com.xxfc.platform.order.biz.OrderRentVehicleBiz;
import
com.xxfc.platform.order.biz.ShuntApplyBiz
;
import
com.xxfc.platform.order.biz.inner.OrderCalculateBiz
;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.order.pojo.order.add.BgAddRentDTO
;
...
...
@@ -166,6 +167,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
baseBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setStatus
(
ShuntApply
.
STATUS_ORDER
);
setOrderStatus
(
ShuntApply
.
ORDER_STATUS_TOPAY
);
}});
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
}
...
...
@@ -178,6 +180,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@Data
public
static
class
ShuntApplyVO
extends
ShuntApply
{
VehicleModel
vehicleModel
;
OrderPageVO
orderPageVO
;
}
@Data
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/BgShuntApplyController.java
View file @
6a3b3676
...
...
@@ -15,12 +15,14 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.OrderRentVehicleBiz
;
import
com.xxfc.platform.order.biz.ShuntApplyBiz
;
import
com.xxfc.platform.order.biz.inner.OrderCalculateBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.rest.ShuntApplyController
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
...
...
@@ -68,6 +70,9 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
@Autowired
RabbitProduct
rabbitProduct
;
@Autowired
BaseOrderBiz
baseOrderBiz
;
@Override
public
UserFeign
getUserFeign
()
{
return
this
.
userFeign
;
...
...
@@ -271,6 +276,15 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
pages
.
getData
().
forEach
(
data
->
{
data
.
setVehicleModel
(
vehicleFeign
.
get
(
data
.
getModelId
()).
getData
());
if
(
StrUtil
.
isNotBlank
(
data
.
getOrderNo
()))
{
Map
<
String
,
Object
>
map
=
CollUtil
.
newHashMap
();
map
.
put
(
"no"
,
data
.
getOrderNo
());
List
<
OrderPageVO
>
list
=
baseOrderBiz
.
pageByParm
(
map
);
if
(
CollUtil
.
isNotEmpty
(
list
))
{
data
.
setOrderPageVO
(
list
.
get
(
0
));
}
}
});
return
ObjectRestResponse
.
succ
(
pages
);
...
...
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