Commit 4aa617a4 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/dev' into dev

parents 96f0f7ad fcd60ab2
...@@ -8,8 +8,8 @@ public class ResultCode { ...@@ -8,8 +8,8 @@ public class ResultCode {
////////////////////////////参数相关/////////////////////////// ////////////////////////////参数相关///////////////////////////
//参数非法,请修改 //参数非法,请修改
public static int PARAM_ILLEGAL_CODE = Integer.valueOf(SystemProperty.getResultConfig("PARAM_ILLEGAL_CODE")); public static int PARAM_ILLEGAL_CODE = Integer.valueOf(SystemProperty.getResultConfig("PARAM_ILLEGAL_CODE"));
//参数时效已过时,不能使用 //参数时效已过时,不能使用X
public static int PARAM_EXPIRE_CODE = Integer.valueOf(SystemProperty.getResultConfig("PARAM_EXPIRE_CODE")); public static int PARAM_EPIRE_CODE = Integer.valueOf(SystemProperty.getResultConfig("PARAM_EXPIRE_CODE"));
public static int VEHICLE_IS_BOOKED = Integer.valueOf(SystemProperty.getResultConfig("VEHICLE_IS_BOOKED")); public static int VEHICLE_IS_BOOKED = Integer.valueOf(SystemProperty.getResultConfig("VEHICLE_IS_BOOKED"));
// 操作成功 // 操作成功
public static int SUCCESS_CODE = Integer.valueOf(SystemProperty.getResultConfig("SUCCESS_CODE")); public static int SUCCESS_CODE = Integer.valueOf(SystemProperty.getResultConfig("SUCCESS_CODE"));
......
...@@ -35,6 +35,7 @@ import com.xxfc.platform.vehicle.entity.SysRegion; ...@@ -35,6 +35,7 @@ import com.xxfc.platform.vehicle.entity.SysRegion;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail; import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import lombok.extern.log4j.Log4j; import lombok.extern.log4j.Log4j;
import org.mockito.internal.util.collections.Sets;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -47,7 +48,7 @@ import java.util.HashSet; ...@@ -47,7 +48,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.*;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER; import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
@Service @Service
...@@ -135,8 +136,18 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To ...@@ -135,8 +136,18 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
setSiteId(bo.getSiteId()); setSiteId(bo.getSiteId());
}})).getData().get(0).getId()); }})).getData().get(0).getId());
Integer departureStatus = tourFeign.selectDepartureStatusByVerificationId(bo.getVerificationId());
//1为已发车
if(!SYS_FALSE.equals(departureStatus)) {
throw new BaseException(ResultCode.PARAM_EPIRE_CODE, Sets.newSet("旅程已发车,不能下单"));
}
//扣減庫存 //扣減庫存
tourFeign.stock(bo.getSpePriceId(), bo.getTotalNumber(), TourFeign.STOCK_SUBTRACT); ObjectRestResponse<TourSpePriceVo> response = tourFeign.stock(bo.getSpePriceId(), bo.getTotalNumber(), TourFeign.STOCK_SUBTRACT);
if(!SYS_JSON_TRUE.equals(response.getStatus())) {
throw new BaseException(ResultCode.PARAM_EPIRE_CODE, Sets.newSet("库存不足"));
}
OrderItem tourAdultItem = bo.getItemByTypeEnum(ItemTypeEnum.TOUR_ADULT); OrderItem tourAdultItem = bo.getItemByTypeEnum(ItemTypeEnum.TOUR_ADULT);
OrderItem tourChildItem = bo.getItemByTypeEnum(ItemTypeEnum.TOUR_CHILD); OrderItem tourChildItem = bo.getItemByTypeEnum(ItemTypeEnum.TOUR_CHILD);
......
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