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

修改bug

parent 7cfc09de
......@@ -144,11 +144,11 @@
</dependency>
<!-- 分布式锁 -->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.11.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.redisson</groupId>-->
<!-- <artifactId>redisson-spring-boot-starter</artifactId>-->
<!-- <version>3.11.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>commons-io</groupId>
......
......@@ -55,8 +55,12 @@ public class SpecialRent implements Serializable {
@Column(name = "status")
@ApiModelProperty(value = "状态 0--删除 1--创建 2--取消 3--等待下单 4--下单成功")
private Integer status;
/**
public void setStatus(Integer status) {
this.status = status;
}
/**
* 创建时间
*/
@Column(name = "crt_time")
......@@ -273,4 +277,11 @@ public class SpecialRent implements Serializable {
@Column(name = "price_type")
@ApiModelProperty(value = "超时时间戳", hidden = true )
private Integer priceType;
/**
* 历史订单号
*/
@Column(name = "old_order_no")
@ApiModelProperty(value = "历史订单号", hidden = true )
private String oldOrderNo;
}
package com.xxfc.platform.order.redis;
public class KlockConstant {
//头部
public static final String HEAD_SPECIAL_RENT = "klock:specialRent";
//功能
public static final String SPECIAL_RENT_ENTITY = HEAD_SPECIAL_RENT+ ":entity";
}
......@@ -51,6 +51,11 @@
<version>3.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>cn.keking</groupId>
<artifactId>spring-boot-klock-starter</artifactId>
<version>1.4-RELEASE</version>
</dependency>
</dependencies>
<build>
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.ace.cache.annotation.Cache;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.exception.BaseException;
......@@ -25,6 +26,7 @@ import com.xxfc.platform.vehicle.pojo.vo.VehicleVO;
import lombok.extern.slf4j.Slf4j;
import org.mockito.internal.util.collections.Sets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.klock.annotation.Klock;
import org.springframework.stereotype.Service;
import com.xxfc.platform.order.entity.SpecialRent;
......@@ -37,6 +39,7 @@ import java.util.List;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.xxfc.platform.order.entity.SpecialRent.STATUS_CRT;
import static com.xxfc.platform.order.redis.KlockConstant.SPECIAL_RENT_ENTITY;
import static com.xxfc.platform.vehicle.entity.Vehicle.STATE_DOWN;
/**
......@@ -162,6 +165,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
rabbitProduct.sendSpecialDelayMessage(selectById(specialRent.getId()), delayTime);
}
@Klock(name = SPECIAL_RENT_ENTITY, keys = {"#specialRent.id"})
public Long handleRent(@RequestBody SpecialRent specialRent, VehicleVO vehicle) {
RentVehicleBO detail = new RentVehicleBO();
detail.setStartTime(specialRent.getStartTime());
......@@ -170,6 +174,12 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
detail.setStartAddr(specialRent.getStartCompanyName());
detail.setStartCompanyId(specialRent.getStartCompanyId());
detail.setEndCompanyId(specialRent.getEndCompanyId());
if(StrUtil.isNotBlank(specialRent.getOrderNo())) {
if(StrUtil.isBlank(specialRent.getOldOrderNo())) {
specialRent.setOldOrderNo("");
}
specialRent.setOldOrderNo(specialRent.getOldOrderNo()+ ","+ specialRent.getOrderNo());
}
detail.setOrder(new BaseOrder(){{setNo(OrderUtil.GetOrderNumber("", OrderUtil.APP_MID));}});
detail.setRentFreeDay(SYS_FALSE);
detail.setBookVehicleVO(new BookVehicleVO(){{
......
......@@ -370,27 +370,23 @@ public class OrderCancelBiz {
//已支付,并且是待出行状态,取消预约
if(OrderStatusEnum.ORDER_CANCEL.getCode().equals(baseOrder.getStatus()) && SYS_TRUE.equals(baseOrder.getHasPay())){
vehicleFeign.rentUnbookVehicle(orvd.getBookRecordId());
//特惠租车 恢复排班记录
if (BaseOrder.ORDER_SIGN_SPECIAL == baseOrder.getOrderSign()) {
SpecialRent specialRent = specialRentBiz.selectOne(new SpecialRent(){{
setOrderNo(baseOrder.getNo());
}});
VehicleVO vehicle = vehicleFeign.getVehicleDetail(specialRent.getVehicleId()).getData();
Long delayTime = specialRentBiz.handleRent(specialRent, vehicle);
specialRent.setUpdTime(null);
specialRentBiz.updateSelectiveById(specialRent);
rabbitProduct.sendSpecialDelayMessage(specialRentBiz.selectById(specialRent.getId()), delayTime);
}
}else {
//非特惠租车 拒绝之前预约
if(BaseOrder.ORDER_SIGN_SPECIAL != baseOrder.getOrderSign()) {
//未支付,拒绝之前的预约
RestResponse<Integer> restResponse = vehicleFeign.rentRejectVehicleBooking(orvd.getBookRecordId());
}
//未支付,拒绝之前的预约
RestResponse<Integer> restResponse = vehicleFeign.rentRejectVehicleBooking(orvd.getBookRecordId());
}
// //特惠租车 恢复排班记录
// if (BaseOrder.ORDER_SIGN_SPECIAL == baseOrder.getOrderSign()) {
// SpecialRent specialRent = specialRentBiz.selectOne(new SpecialRent(){{
// setOrderNo(baseOrder.getNo());
// }});
// VehicleVO vehicle = vehicleFeign.getVehicleDetail(specialRent.getVehicleId()).getData();
// Long delayTime = specialRentBiz.handleRent(specialRent, vehicle);
// specialRent.setUpdTime(null);
// specialRentBiz.updateSelectiveById(specialRent);
// rabbitProduct.sendSpecialDelayMessage(specialRentBiz.selectById(specialRent.getId()), delayTime);
// }
//取消租车免费天数使用
if(null != orvd.getFreeDays() && orvd.getFreeDays() > 0) {
Integer freeDays = (null == inProgressVO) ? orvd.getFreeDays(): inProgressVO.getBackFreeDays();
......@@ -441,6 +437,13 @@ public class OrderCancelBiz {
setOrderStatus(SpecialRent.ORDER_STATUS_CANCEL);
}});
}
//特惠租车 恢复排班记录
VehicleVO vehicle = vehicleFeign.getVehicleDetail(specialRent.getVehicleId()).getData();
Long delayTime = specialRentBiz.handleRent(specialRent, vehicle);
specialRent.setUpdTime(null);
specialRentBiz.updateSelectiveById(specialRent);
rabbitProduct.sendSpecialDelayMessage(specialRentBiz.selectById(specialRent.getId()), delayTime);
}
}else if(OrderTypeEnum.TOUR.getCode().equals(baseOrder.getType())) {
......
......@@ -31,6 +31,7 @@ import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.klock.annotation.Klock;
import org.springframework.web.bind.annotation.*;
import javax.persistence.Column;
......@@ -38,6 +39,7 @@ import javax.persistence.Column;
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.entity.SpecialRent.*;
import static com.xxfc.platform.order.redis.KlockConstant.SPECIAL_RENT_ENTITY;
@RestController
@RequestMapping("/chw/specialRent")
......@@ -153,6 +155,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
@RequestMapping(value = "/app/specialOrder", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "特惠租车下单")
@Klock(name = SPECIAL_RENT_ENTITY, keys = {"#dto.specialId"})
public ObjectRestResponse specialOrder(@RequestBody SpecialOrderDTO dto) {
//查询列表数据
......
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