Browse Source

重复收停车费问题

qzyReal 2 years ago
parent
commit
a24f66cfa4

+ 4 - 4
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -206,8 +206,8 @@ public class OpenService {
             //无业务车辆===>计算停车费
             //如果已经支付过,则从支付时间算起,重新计算停车费
             Date inTime = tbBusinessCar.getRealInTime();
-            if (hasPayPartMoney.compareTo(BigDecimal.ZERO) > 0) {
-                inTime = now;
+            if (CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType().equals(tbBusinessCar.getPayType())) {
+                inTime=tbBusinessCar.getPayTime();
             }
             IOrderPriceRes res = tbBusinessService.getPartMoney(inTime, now, carNo, tbBusinessCar.getColor());
             double dif = res.getTotalOrderPrice().subtract(tbBusinessCar.getMoney()).doubleValue();
@@ -228,8 +228,8 @@ public class OpenService {
             //有业务的车--->都要交停车费
             //该车所有的业务都是到达卡口才进行扣费才会进入自动扣费
             Date inTime = tbBusinessCar.getRealInTime();
-            if (hasPayPartMoney.compareTo(BigDecimal.ZERO) > 0) {
-                inTime = now;
+            if (CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType().equals(tbBusinessCar.getPayType())) {
+                inTime=tbBusinessCar.getPayTime();
             }
             partMoneyRes = tbBusinessService.getPartMoney(inTime, now, carNo, tbBusinessCar.getColor());
             double dif = partMoneyRes.getTotalOrderPrice().doubleValue();

+ 1 - 1
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -241,7 +241,7 @@ public class WxService {
                     log.error("付款金额不正确:{}", JSONUtil.toJsonStr(notifyBO));
                     continue;
                 }
-                car.setPay(1).setMoney(price).setPayTime(payTime)
+                car.setPay(1).setMoney(price.add(car.getMoney())).setPayTime(payTime)
                         .setPayType(CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType())
                         .setOutTradeNo(outTradeNo)
                         .setPayOpenid(payopenid);

+ 11 - 8
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -354,11 +354,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             res.setOver24Hour(1);
             res.setHourDesc(PartFeeEnum.OUT_24_HOURS.getDesc());
         }
-        TbItem partItem=tbItemService.findByAliasName(SystemObject.config.getPartItemAlias());
-        if (partItem==null) {
-            throw new AjaxError("未配置停车费规则");
-        }
-        List<TbItemFac> list = tbItemFacService.getByItemId(partItem.getId());
+//        TbItem partItem=tbItemService.findByAliasName(SystemObject.config.getPartItemAlias());
+//        if (partItem==null) {
+//            throw new AjaxError("未配置停车费规则");
+//        }
+        List<TbItemFac> list = tbItemFacService.list();
         if (list.isEmpty()) {
             throw new AjaxError("未配置停车费规则");
         }
@@ -456,6 +456,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 if (CarEnum.PayTypeEnum.FEE_TYPE.getType().equals(tbBusinessCar.getPayType())) {
                     partMoney = new BigDecimal("0");
                 }
+                if (CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType().equals(tbBusinessCar.getPayType())) {
+                    inTime=tbBusinessCar.getPayTime();
+                }
                 if (partMoney.doubleValue() == 1) {
                     IOrderPriceRes partPriceRes = getPartMoney(inTime, outTime, tbBusinessCar.getCarNo(), tbBusinessCar.getColor());
                     BigDecimal partPrice = partPriceRes.getTotalOrderPrice();
@@ -693,9 +696,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         for (TbBusinessCar car : cars) {
             String carNo = car.getCarNo().trim().toUpperCase();
             String carType = car.getCarType();
-            if (car.getCarSize() == null || car.getCarSize() <= 0) {
-                throw new AjaxError(carNo + "规格不正确");
-            }
+//            if (car.getCarSize() == null || car.getCarSize() <= 0) {
+//                throw new AjaxError(carNo + "规格不正确");
+//            }
             if (StrUtil.isEmpty(carType)) {
                 throw new BusinessException(carNo + "类型不能为空");
             }