|
|
@ -2225,6 +2225,7 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp |
|
|
|
return rb.setMsg(String.join(",", vinNoList) + "已提交或已出库"); |
|
|
|
} |
|
|
|
//判断是否存在优惠包超出的情况
|
|
|
|
int giveNumBySid = 0; |
|
|
|
for (int i = 0; i < carList.size(); i++) { |
|
|
|
AppCarListVo appCarListVo = carList.get(i); |
|
|
|
List<BusDeliveredDetailsDiscountsVo> discountUse = appCarListVo.getDiscountUse(); |
|
|
@ -2234,6 +2235,7 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp |
|
|
|
//根据discountSid查询已通过或已提交的申请的赠送套餐的数量
|
|
|
|
int count = busDeliveredDetailsDiscountService.selectGiveNumBySid(busDeliveredDetailsDiscountsVo.getDiscountSid()); |
|
|
|
int giveNum = count + busDeliveredDetailsDiscountsVo.getDiscountNum(); |
|
|
|
giveNumBySid = giveNumBySid+busDeliveredDetailsDiscountsVo.getDiscountNum(); |
|
|
|
if (busSalesOrderDiscount.getNum() < giveNum) { |
|
|
|
return rb.setMsg("车辆赠送的优惠包已超出"); |
|
|
|
} |
|
|
@ -2258,6 +2260,7 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp |
|
|
|
if (isTrue) { |
|
|
|
//是否存在未赠送的套餐,如果存在则不允许提交
|
|
|
|
int num = baseMapper.selectNumByContractNo(dto.getContractId()); |
|
|
|
num = num+giveNumBySid; |
|
|
|
int orderNum = busSalesOrderDiscountService.selectByContractNo(dto.getContractId()); |
|
|
|
if (orderNum > num) { |
|
|
|
return rb.setMsg("本次出库为该订单最后一批出库,还存在未赠送的套餐,不允许提交"); |
|
|
|