|
|
@ -55,6 +55,9 @@ public class HighOrderController { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private UserCenter userCenter; |
|
|
|
private UserCenter userCenter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private CommonService commonService; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private HighOrderService highOrderService; |
|
|
|
private HighOrderService highOrderService; |
|
|
|
|
|
|
|
|
|
|
@ -220,8 +223,18 @@ public class HighOrderController { |
|
|
|
log.error("HighOrderController --> addOrder() error!", "参数错误"); |
|
|
|
log.error("HighOrderController --> addOrder() error!", "参数错误"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
if (childOrder.getGoodsPrice().compareTo(new BigDecimal("800")) == 1){ |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "加油金额不能超过800元"); |
|
|
|
// 加油限制
|
|
|
|
|
|
|
|
if (childOrder.getGasOilType().equals(1)) { |
|
|
|
|
|
|
|
SecDictionary refuelLimit = commonService.mappingSysName("REFUEL_LIMIT", "汽油"); |
|
|
|
|
|
|
|
if (refuelLimit != null && childOrder.getGoodsPrice().compareTo(new BigDecimal(refuelLimit.getCodeValue())) == 1) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "汽油加油金额不能超过" + refuelLimit.getCodeValue()+"元"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (childOrder.getGasOilType().equals(2)){ |
|
|
|
|
|
|
|
SecDictionary refuelLimit = commonService.mappingSysName("REFUEL_LIMIT", "柴油"); |
|
|
|
|
|
|
|
if (refuelLimit != null && childOrder.getGoodsPrice().compareTo(new BigDecimal(refuelLimit.getCodeValue())) == 1) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "柴油加油金额不能超过" + refuelLimit.getCodeValue()+"元"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (highOrderService.getGasTheDayOrderNum(userInfoModel.getHighUser().getId()) >= 1) { |
|
|
|
if (highOrderService.getGasTheDayOrderNum(userInfoModel.getHighUser().getId()) >= 1) { |
|
|
|