Commit 6a3b3676 authored by 周健威's avatar 周健威

Merge branch 'master-vehicle-price' into dev-tiande

parents 07233313 55f43a5f
...@@ -25,6 +25,12 @@ public class ShuntApply implements Serializable { ...@@ -25,6 +25,12 @@ public class ShuntApply implements Serializable {
public static final int STATUS_CONFIRM = 3; public static final int STATUS_CONFIRM = 3;
public static final int STATUS_ORDER = 4; public static final int STATUS_ORDER = 4;
public static final int STATUS_AUTOCNL = 5; 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 { ...@@ -43,9 +49,13 @@ public class ShuntApply implements Serializable {
*/ */
@Column(name = "status") @Column(name = "status")
@ApiModelProperty(value = "状态 0--删除 1--创建 2--取消 3--申请成功 ") @ApiModelProperty(value = "状态 0--删除 1--创建 2--取消 3--接单中 4--已下单 5--接单成功 6--接单失败")
private Integer status; private Integer status;
@Column(name = "order_status")
@ApiModelProperty(value = "状态 1--待支付 2--已支付 3--已取消 ")
private Integer orderStatus;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -149,6 +149,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -149,6 +149,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
@Autowired @Autowired
CompanyInfoBiz companyInfoBiz; CompanyInfoBiz companyInfoBiz;
@Autowired
ShuntApplyBiz shuntApplyBiz;
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); 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 ...@@ -799,6 +802,19 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
BeanUtil.copyProperties(this.updateSelectiveByIdReT(updateOrder), baseOrder); 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)); 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 { } finally {
AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData(); AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData();
......
...@@ -99,6 +99,9 @@ public class OrderCancelBiz { ...@@ -99,6 +99,9 @@ public class OrderCancelBiz {
@Autowired @Autowired
ActivityFeign activityFeign; ActivityFeign activityFeign;
@Autowired
ShuntApplyBiz shuntApplyBiz;
private static Map<Integer, List<Integer>> cancelAble; private static Map<Integer, List<Integer>> cancelAble;
static { static {
cancelAble = new HashMap<Integer, List<Integer>>(); cancelAble = new HashMap<Integer, List<Integer>>();
...@@ -419,6 +422,20 @@ public class OrderCancelBiz { ...@@ -419,6 +422,20 @@ public class OrderCancelBiz {
//发送队列消息 //发送队列消息
baseOrderBiz.sendOrderMq(orvd, otd, omd, baseOrder, OrderMQDTO.ORDER_CANCEL); 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 { }else {
throw new BaseException(ResultCode.FAILED_CODE); throw new BaseException(ResultCode.FAILED_CODE);
} }
......
...@@ -3,7 +3,6 @@ package com.xxfc.platform.order.mqhandler; ...@@ -3,7 +3,6 @@ package com.xxfc.platform.order.mqhandler;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.rabbitmq.client.Channel; 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.ShuntApplyBiz;
import com.xxfc.platform.order.biz.inner.OrderCancelBiz; import com.xxfc.platform.order.biz.inner.OrderCancelBiz;
import com.xxfc.platform.order.entity.BaseOrder; import com.xxfc.platform.order.entity.BaseOrder;
......
...@@ -14,6 +14,7 @@ import com.xxfc.platform.order.biz.OrderRentVehicleBiz; ...@@ -14,6 +14,7 @@ import com.xxfc.platform.order.biz.OrderRentVehicleBiz;
import com.xxfc.platform.order.biz.ShuntApplyBiz; import com.xxfc.platform.order.biz.ShuntApplyBiz;
import com.xxfc.platform.order.biz.inner.OrderCalculateBiz; import com.xxfc.platform.order.biz.inner.OrderCalculateBiz;
import com.xxfc.platform.order.entity.ShuntApply; 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.RentVehicleBO;
import com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO; import com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO;
import com.xxfc.platform.order.pojo.order.add.BgAddRentDTO; import com.xxfc.platform.order.pojo.order.add.BgAddRentDTO;
...@@ -166,6 +167,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -166,6 +167,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
baseBiz.updateSelectiveById(new ShuntApply(){{ baseBiz.updateSelectiveById(new ShuntApply(){{
setId(shuntApply.getId()); setId(shuntApply.getId());
setStatus(ShuntApply.STATUS_ORDER); setStatus(ShuntApply.STATUS_ORDER);
setOrderStatus(ShuntApply.ORDER_STATUS_TOPAY);
}}); }});
return ObjectRestResponse.succ(bo.getOrder()); return ObjectRestResponse.succ(bo.getOrder());
} }
...@@ -178,6 +180,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -178,6 +180,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@Data @Data
public static class ShuntApplyVO extends ShuntApply { public static class ShuntApplyVO extends ShuntApply {
VehicleModel vehicleModel; VehicleModel vehicleModel;
OrderPageVO orderPageVO;
} }
@Data @Data
......
...@@ -15,12 +15,14 @@ import com.github.wxiaoqi.security.common.util.OrderUtil; ...@@ -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.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.github.wxiaoqi.security.common.vo.PageParam; 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.OrderRentVehicleBiz;
import com.xxfc.platform.order.biz.ShuntApplyBiz; import com.xxfc.platform.order.biz.ShuntApplyBiz;
import com.xxfc.platform.order.biz.inner.OrderCalculateBiz; import com.xxfc.platform.order.biz.inner.OrderCalculateBiz;
import com.xxfc.platform.order.entity.BaseOrder; import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.ShuntApply; import com.xxfc.platform.order.entity.ShuntApply;
import com.xxfc.platform.order.mqhandler.RabbitProduct; 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.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.rest.ShuntApplyController; import com.xxfc.platform.order.rest.ShuntApplyController;
import com.xxfc.platform.order.service.OrderRentVehicleService; import com.xxfc.platform.order.service.OrderRentVehicleService;
...@@ -68,6 +70,9 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA ...@@ -68,6 +70,9 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
@Autowired @Autowired
RabbitProduct rabbitProduct; RabbitProduct rabbitProduct;
@Autowired
BaseOrderBiz baseOrderBiz;
@Override @Override
public UserFeign getUserFeign() { public UserFeign getUserFeign() {
return this.userFeign; return this.userFeign;
...@@ -271,6 +276,15 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA ...@@ -271,6 +276,15 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
pages.getData().forEach(data -> { pages.getData().forEach(data -> {
data.setVehicleModel(vehicleFeign.get(data.getModelId()).getData()); 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); return ObjectRestResponse.succ(pages);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment