Commit cea9e1ac authored by 周健威's avatar 周健威

修改我的接单状态

parent 80a92e6b
......@@ -25,8 +25,14 @@ 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;
/**
* 主键
*/
@Id
......@@ -43,8 +49,12 @@ 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--已取消 4--已下单 5--接单成功 6--接单失败")
private Integer orderStatus;
/**
* 创建时间
......
......@@ -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();
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -166,6 +166,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());
}
......
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