|
@@ -495,23 +495,29 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
List<TbBusiness> businessList = this.findOtherBusinessByCarId(businessCarId);
|
|
List<TbBusiness> businessList = this.findOtherBusinessByCarId(businessCarId);
|
|
List<TbBusinessCar> cars = new ArrayList<>();
|
|
List<TbBusinessCar> cars = new ArrayList<>();
|
|
-
|
|
|
|
- //中国车是否需要支付
|
|
|
|
|
|
+ //越南车是否需要支付
|
|
int vietnamCarPay = businessList.stream().anyMatch(tbBusiness -> {
|
|
int vietnamCarPay = businessList.stream().anyMatch(tbBusiness -> {
|
|
TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
|
|
TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
|
|
return tbGoods.getVietnamCarPay() == 1;
|
|
return tbGoods.getVietnamCarPay() == 1;
|
|
}) ? 1 : 0;
|
|
}) ? 1 : 0;
|
|
- //越南车是否需要支付
|
|
|
|
|
|
+ //中国车是否需要支付
|
|
int chinaCarPay = businessList.stream().anyMatch(tbBusiness -> {
|
|
int chinaCarPay = businessList.stream().anyMatch(tbBusiness -> {
|
|
TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
|
|
TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
|
|
return tbGoods.getChinaCarPay() == 1;
|
|
return tbGoods.getChinaCarPay() == 1;
|
|
}) ? 1 : 0;
|
|
}) ? 1 : 0;
|
|
- //无业务的车辆
|
|
|
|
|
|
+ //无业务的车辆,中国车和越南车都需要支付
|
|
if (businessList.isEmpty()) {
|
|
if (businessList.isEmpty()) {
|
|
vietnamCarPay = 1;
|
|
vietnamCarPay = 1;
|
|
chinaCarPay = 1;
|
|
chinaCarPay = 1;
|
|
cars.add(tbBusinessCarService.getById(businessCarId));
|
|
cars.add(tbBusinessCarService.getById(businessCarId));
|
|
}
|
|
}
|
|
|
|
+ businessList = businessList.stream().filter(tbBusiness -> {
|
|
|
|
+ Integer payStep = tbBusiness.getPayStep();
|
|
|
|
+ //确认订单后方可缴费
|
|
|
|
+ return TbGoods.PayStep.AFTER_CONFIRM.getCode().equals(payStep) && tbBusiness.getAdminConfirmInput() == 1
|
|
|
|
+ //或者下单后可缴费
|
|
|
|
+ || TbGoods.PayStep.BEFORE_CONFIRM.getCode().equals(payStep);
|
|
|
|
+ }).collect(Collectors.toList());
|
|
businessList.forEach(tbBusiness -> {
|
|
businessList.forEach(tbBusiness -> {
|
|
List<TbBusinessCar> businessCars = tbBusinessCarService.findOtherBusinessCar(tbBusiness.getId());
|
|
List<TbBusinessCar> businessCars = tbBusinessCarService.findOtherBusinessCar(tbBusiness.getId());
|
|
cars.addAll(businessCars);
|
|
cars.addAll(businessCars);
|
|
@@ -661,7 +667,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
BigDecimal price = calculationPartMoney(realInTime, realOutTime);
|
|
BigDecimal price = calculationPartMoney(realInTime, realOutTime);
|
|
tbBusinessCar.setMoney(price);
|
|
tbBusinessCar.setMoney(price);
|
|
}
|
|
}
|
|
- tbBusinessCar.setPay(1);
|
|
|
|
|
|
+ tbBusinessCar.setPay(1).setPayTime(now);
|
|
tbBusinessCarService.updateById(tbBusinessCar);
|
|
tbBusinessCarService.updateById(tbBusinessCar);
|
|
});
|
|
});
|
|
List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
|
|
List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
|