|
@@ -66,6 +66,8 @@ import com.pj.project.tb_item.TbItem;
|
|
|
import com.pj.project.tb_item.TbItemService;
|
|
|
import com.pj.project.tb_item_type.TbItemType;
|
|
|
import com.pj.project.tb_item_type.TbItemTypeService;
|
|
|
+import com.pj.project.tb_mild_car.TbMildCar;
|
|
|
+import com.pj.project.tb_mild_car.TbMildCarService;
|
|
|
import com.pj.project.tb_notices.TbNoticesService;
|
|
|
import com.pj.project.tb_sort_group.TbSortGroup;
|
|
|
import com.pj.project.tb_sort_group.TbSortGroupService;
|
|
@@ -174,12 +176,12 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
@Resource
|
|
|
@Lazy
|
|
|
private TbFeeStatisticsService tbFeeStatisticsService;
|
|
|
+ @Resource
|
|
|
+ private TbMildCarService tbMildCarService;
|
|
|
|
|
|
private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public void storeMsg(String businessCustomerId, String content) {
|
|
|
String currentCustomerId = StpUserUtil.getCustomerId();
|
|
|
if (StrUtil.equals(currentCustomerId, UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
|
|
@@ -358,7 +360,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
}
|
|
|
|
|
|
|
|
|
- public BigDecimal calculationPartMoney(Date iTime, Date oTime, double carSize) {
|
|
|
+ public BigDecimal calculationPartMoney(Date iTime, Date oTime, String carNo) {
|
|
|
BigDecimal zero = new BigDecimal("0");
|
|
|
if (iTime == null || oTime == null) {
|
|
|
return zero;
|
|
@@ -373,7 +375,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
BigDecimal basePrice = partConfig.getBasePrice();
|
|
|
BigDecimal uniPrice = basePrice.add(extraPrice);//超过24小时之后每24个小时收费金额
|
|
|
//4.2~9.6
|
|
|
- if (carSize <= partConfig.getMildCarLength() && carSize > partConfig.getFreeCarLength()) {
|
|
|
+ TbMildCar tbMildCar = tbMildCarService.findByCarNo(carNo);
|
|
|
+ if (tbMildCar != null) {
|
|
|
basePrice = partConfig.getMildCarBasePrice();
|
|
|
uniPrice = basePrice.add(extraPrice);
|
|
|
}
|
|
@@ -454,7 +457,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
if (StrUtil.isEmpty(carType)) {
|
|
|
carType = CarEnum.CarTypeEnum.EMPTY_TYPE.getType();
|
|
|
}
|
|
|
- BigDecimal partMoney = calculationPartMoney(inTime, outTime, tbBusinessCar.getCarSize());
|
|
|
+ BigDecimal partMoney = calculationPartMoney(inTime, outTime, tbBusinessCar.getCarNo());
|
|
|
if (StrUtil.isNotEmpty(tbBusinessCar.getColor()) && tbBusinessCar.getCarSize() != null) {
|
|
|
String freeColor = partConfig.getFreeColor();
|
|
|
//4.2米以下蓝色车辆
|
|
@@ -609,18 +612,18 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
List<PriceBO> priceBOList = new ArrayList<>();
|
|
|
TbGoods tbGoods = tbGoodsService.getById(db.getGoodsId());
|
|
|
//该确认确未确认
|
|
|
- if (tbGoods.getPayStep().equals(GoodsEnum.PayStep.AFTER_CONFIRM.getCode()) &&db.getAdminConfirmInput()==0) {
|
|
|
+ if (tbGoods.getPayStep().equals(GoodsEnum.PayStep.AFTER_CONFIRM.getCode()) && db.getAdminConfirmInput() == 0) {
|
|
|
throw new AjaxError("该业务需要确认后才能收费");
|
|
|
}
|
|
|
for (TbBusinessCar tbBusinessCar : cars) {
|
|
|
String carNo = tbBusinessCar.getCarNo().toUpperCase();
|
|
|
- String prefix=StrUtil.sub(carNo,0,1);
|
|
|
- if (CAR_LIST.contains(prefix)&&tbGoods.getChinaCarPay()==1
|
|
|
- ||!CAR_LIST.contains(prefix)&&tbGoods.getVietnamCarPay()==1) {
|
|
|
+ String prefix = StrUtil.sub(carNo, 0, 1);
|
|
|
+ if (CAR_LIST.contains(prefix) && tbGoods.getChinaCarPay() == 1
|
|
|
+ || !CAR_LIST.contains(prefix) && tbGoods.getVietnamCarPay() == 1) {
|
|
|
Date realInTime = tbBusinessCar.getRealInTime();
|
|
|
Date realOutTime = tbBusinessCar.getRealOutTime();
|
|
|
if (realInTime != null && realOutTime != null) {
|
|
|
- BigDecimal price = calculationPartMoney(realInTime, realOutTime, tbBusinessCar.getCarSize());
|
|
|
+ BigDecimal price = calculationPartMoney(realInTime, realOutTime, tbBusinessCar.getCarNo());
|
|
|
if (price.doubleValue() > 0) {
|
|
|
PriceBO priceBO = new PriceBO();
|
|
|
priceBO.setId(tbBusinessCar.getId()).setP(price);
|
|
@@ -669,9 +672,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
//生成扣费记录
|
|
|
automaticPay.createTbDeductionRecord(tbFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
|
|
|
automaticPay.unbindRun(plate);
|
|
|
- }else if (payType == PayEnum.PayType.OFF_LINE_PAY.getCode()){
|
|
|
+ } else if (payType == PayEnum.PayType.OFF_LINE_PAY.getCode()) {
|
|
|
//车辆的扣费记录
|
|
|
- if (partMoney.doubleValue() > 0){
|
|
|
+ if (partMoney.doubleValue() > 0) {
|
|
|
tbFeeDetailsService.chargeParkFee(
|
|
|
priceBOList, null, null, payTime, PayEnum.PayType.OFF_LINE_PAY);
|
|
|
}
|
|
@@ -1126,7 +1129,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
outTime = payTime;
|
|
|
}
|
|
|
//计算停车费
|
|
|
- BigDecimal parkMoney = this.calculationPartMoney(inTime, outTime, tbBusinessCar.getCarSize());
|
|
|
+ BigDecimal parkMoney = this.calculationPartMoney(inTime, outTime, tbBusinessCar.getCarNo());
|
|
|
tbBusinessCar.setMoney(parkMoney);
|
|
|
}
|
|
|
|
|
@@ -1315,7 +1318,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
if (tbCostomer != null) {
|
|
|
tbBusiness.setCustomerId(customerId).setCustomerName(tbCostomer.getName());
|
|
|
}
|
|
|
- boolean businessIsPay =PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode() == errorBusinessBO.getPayStatus();
|
|
|
+ boolean businessIsPay = PayEnum.PayStatusEnum.HAS_PAY_CONFIRM.getCode() == errorBusinessBO.getPayStatus();
|
|
|
Date businessPayTime = errorBusinessBO.getPayTime();
|
|
|
|
|
|
BigDecimal price = new BigDecimal("0");
|