Commit 5a5b0351 authored by hezhen's avatar hezhen

Merge branch 'dev-chw' of http://113.105.137.151:22280/youjj/cloud-platform into dev-chw

parents b76458de 2fd68774
......@@ -24,6 +24,9 @@ import java.util.Date;
@Table(name = "base_order")
public class BaseOrder implements Serializable {
private static final long serialVersionUID = 1L;
public static final int ORDER_SIGN_NORMAL = 1;
public static final int ORDER_SIGN_APPLY = 2;
public static final int ORDER_SIGN_SPECIAL = 3;
/**
* 主键
......@@ -355,4 +358,7 @@ public class BaseOrder implements Serializable {
@Column(name = "realname")
private String realname;
@Column(name = "order_sign")
private Integer orderSign;
}
......@@ -25,14 +25,17 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
private Vehicle vehicle;
/**
* 是否调车申请下订单
* 订单标记 1--普通订单;2--需求预定申请订单;3--特惠租车订单
*/
private Integer applyOrderSign = 0;
private Integer orderSign = 0;
/**
* 是否特惠租车下订单
*/
private Integer specialOrderSign = 0;
public Integer getOrderSign() {
return orderSign;
}
public void setOrderSign(Integer orderSign) {
this.orderSign = orderSign;
}
/**
* 是否使用出租免费天数
......
......@@ -150,6 +150,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
@Autowired
ShuntApplyBiz shuntApplyBiz;
@Autowired
SpecialRentBiz specialRentBiz;
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
......@@ -802,17 +805,34 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
//记录订单账款记录
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(BaseOrder.ORDER_SIGN_APPLY == baseOrder.getOrderOrigin()) {
//更新 申请状态
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);
if(null != shuntApply && shuntApply.getStatus() == ShuntApply.STATUS_ORDER) {
shuntApplyBiz.updateSelectiveById(new ShuntApply(){{
setId(shuntApply.getId());
setStatus(ShuntApply.STATUS_SUCC);
setOrderStatus(ShuntApply.ORDER_STATUS_PAY);
}});
}
}
if(BaseOrder.ORDER_SIGN_SPECIAL == baseOrder.getOrderOrigin()) {
//更新 申请状态
SpecialRent specialRent = specialRentBiz.selectOne(new SpecialRent(){{
setOrderNo(baseOrder.getNo());
}});
if(null != specialRent && specialRent.getStatus() == SpecialRent.STATUS_ORDER) {
specialRentBiz.updateSelectiveById(new SpecialRent(){{
setId(specialRent.getId());
setStatus(SpecialRent.STATUS_SUCC);
setOrderStatus(SpecialRent.ORDER_STATUS_PAY);
}});
}
}
} finally {
AppUserDTO appUserDTO = userFeign.userDetailById(baseOrder.getUserId()).getData();
......
......@@ -87,6 +87,9 @@ public class OrderCancelBiz {
@Autowired
ShuntApplyBiz shuntApplyBiz;
@Autowired
SpecialRentBiz specialRentBiz;
@Autowired
UserFeign userFeign;
......@@ -379,22 +382,44 @@ public class OrderCancelBiz {
orderRentVehicleBiz.updateSelectiveById(orvd);
}
//更新 申请状态
ShuntApply shuntApply = shuntApplyBiz.selectOne(new ShuntApply(){{
setOrderNo(baseOrder.getNo());
}});
if(BaseOrder.ORDER_SIGN_APPLY == baseOrder.getOrderOrigin()) {
//更新 申请状态
ShuntApply shuntApply = shuntApplyBiz.selectOne(new ShuntApply(){{
setOrderNo(baseOrder.getNo());
}});
if(null != shuntApply ) {
Integer status = ShuntApply.STATUS_AUTOCNL_TOPAY;
if(SYS_TRUE.equals(baseOrder.getHasPay())) {
status = ShuntApply.STATUS_AUTOCNL_PAYED;
if(null != shuntApply ) {
Integer status = ShuntApply.STATUS_AUTOCNL_TOPAY;
if(SYS_TRUE.equals(baseOrder.getHasPay())) {
status = ShuntApply.STATUS_AUTOCNL_PAYED;
}
Integer finalStatus = status;
shuntApplyBiz.updateSelectiveById(new ShuntApply(){{
setId(shuntApply.getId());
setStatus(finalStatus);
setOrderStatus(ShuntApply.ORDER_STATUS_CANCEL);
}});
}
Integer finalStatus = status;
shuntApplyBiz.updateSelectiveById(new ShuntApply(){{
setId(shuntApply.getId());
setStatus(finalStatus);
setOrderStatus(ShuntApply.ORDER_STATUS_CANCEL);
}
if(BaseOrder.ORDER_SIGN_SPECIAL == baseOrder.getOrderOrigin()) {
//更新 申请状态
SpecialRent specialRent = specialRentBiz.selectOne(new SpecialRent(){{
setOrderNo(baseOrder.getNo());
}});
if(null != specialRent ) {
Integer status = SpecialRent.STATUS_AUTOCNL_TOPAY;
if(SYS_TRUE.equals(baseOrder.getHasPay())) {
status = SpecialRent.STATUS_AUTOCNL_PAYED;
}
Integer finalStatus = status;
specialRentBiz.updateSelectiveById(new SpecialRent(){{
setId(specialRent.getId());
setStatus(finalStatus);
setOrderStatus(SpecialRent.ORDER_STATUS_CANCEL);
}});
}
}
}else if(OrderTypeEnum.TOUR.getCode().equals(baseOrder.getType())) {
......
......@@ -30,10 +30,8 @@ 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.service.OrderRentVehicleService;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBrand;
import com.xxfc.platform.vehicle.entity.VehicleCategory;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.BookVehicleVO;
import com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO;
......@@ -218,7 +216,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
dto.setStartCompanyId(shuntApply.getStartCompanyId());
dto.setEndCompanyId(shuntApply.getEndCompanyId());
RentVehicleBO bo = orderRentVehicleBiz.initRentVehicleBO(dto);
bo.setApplyOrderSign(SYS_TRUE);
bo.setOrderSign(BaseOrder.ORDER_SIGN_APPLY);
bo.setAppUserDTO(userFeign.userDetailByToken(BaseContextHandler.getToken()).getData());
orderRentVehicleService.applyCreateOrder(bo, shuntApply.getOrderNo());
baseBiz.updateSelectiveById(new ShuntApply(){{
......
......@@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
......@@ -55,7 +54,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.NONE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.order.contant.enumerate.ItemTypeEnum.ACCOMPANY;
......@@ -285,7 +283,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
bo.setAccompanyItems(oads);
if(!SYS_TRUE.equals(bo.getApplyOrderSign())) {
if(BaseOrder.ORDER_SIGN_APPLY != bo.getOrderSign()) {
//获取可用车辆
acquireVehicle(bo, null, null);
cloudTransact = 1;
......@@ -328,7 +326,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//判断分布式事务执行到哪里
switch (cloudTransact) {
case 1 :
if(!SYS_TRUE.equals(bo.getApplyOrderSign())) {
if(!SYS_TRUE.equals(bo.getOrderSign())) {
//取消车辆预定
//未支付,拒绝之前的预约
errorRejectVehicle(bo);
......@@ -336,7 +334,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
break;
case 2 :
if(!SYS_TRUE.equals(bo.getApplyOrderSign())) {
if(!SYS_TRUE.equals(bo.getOrderSign())) {
//取消车辆预定
//未支付,拒绝之前的预约
errorRejectVehicle(bo);
......@@ -345,7 +343,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
break;
case 3 :
if(!SYS_TRUE.equals(bo.getApplyOrderSign())) {
if(!SYS_TRUE.equals(bo.getOrderSign())) {
//取消车辆预定
//未支付,拒绝之前的预约
errorRejectVehicle(bo);
......
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