浏览代码

收费明细修改显示无费用的记录的bug,导出调整

lzm 3 年之前
父节点
当前提交
834dba2920

+ 0 - 1
sp-server/app.pid

@@ -1 +0,0 @@
-32340

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

@@ -199,7 +199,7 @@ public class WxService {
         if (StrUtil.isNotEmpty(attachStr)) {
             Attach attach = JSONUtil.toBean(attachStr, Attach.class);
             List<PriceBO> cars = JSONUtil.toList(attach.getC(), PriceBO.class);
-            tbFeeStatisticsService.countParkFee(cars);//停车费日统计
+
             for (PriceBO bo1 : cars) {
                 TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
                 BigDecimal price = bo1.getP();
@@ -212,6 +212,7 @@ public class WxService {
                     tbBusinessService.updateById(business);
                 }
             }
+            tbFeeStatisticsService.countParkFee(cars);//停车费日统计
             tbFeeDetailsService.chargeParkFee(cars, transactionId);//添加cars的收费明细
             String businessId = attach.getB();
             if (StrUtil.isNotEmpty(businessId)) {

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_fee_details/ExportFeeDetailDTO.java

@@ -39,6 +39,7 @@ public class ExportFeeDetailDTO {
     private String businessNo;
     private String payTime;
     private String tradeNo;
+    private String pickCustomerName;
 
 
 

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetails.java

@@ -140,7 +140,7 @@ public class TbFeeDetails implements Serializable {
     /**
      * 数量
      */
-    private Integer num;
+    private Integer num = 0;
 
     /**
      * 是否结算(0=未结算, 1=已结算)

+ 6 - 2
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

@@ -136,13 +136,16 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
         String toDay = DateUtil.format(now, "yyyy-MM-dd");
         for (PriceBO bo1 : cars) {
+            if(bo1.getP().compareTo(BigDecimal.valueOf(0)) == 0){
+                continue;
+            }
             TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
             TbBusiness business = tbBusinessService.getById(car.getBusinessId());
             String carNo = car.getCarNo();
             TbFeeDetails parkFee;
             if(business != null){
                 parkFee = getByBusinessIdAndCarNoAndFeeType(car.getBusinessId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
-            }else {
+            } else {
                 parkFee = getByBusinessCarIdAndCarNoAndFeeType(car.getId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
             }
             if(parkFee == null){
@@ -237,7 +240,8 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                     .setPayMode("直接收款")
                     .setWeight(feeDetails.getWeight()).setNum(feeDetails.getNum()).setUnitPrice(feeDetails.getUnitPrice())
                     .setSettle("已结算").setTaxRate(feeDetails.getTaxRate().multiply(new BigDecimal(100)))
-                    .setTaxPrice(feeDetails.getTaxPrice()).setNoTaxPrice(feeDetails.getNoTaxPrice()).setPayTime(feeDetails.getPayTime());
+                    .setTaxPrice(feeDetails.getTaxPrice()).setNoTaxPrice(feeDetails.getNoTaxPrice()).setPayTime(feeDetails.getPayTime())
+                    .setPickCustomerName(feeDetails.getPickCustomerName());
             if(!StrUtil.isEmpty(feeDetails.getBusinessId())){
                 detailDTO.setBusinessNo(feeDetails.getBusinessNo());
             }else {

+ 14 - 6
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -96,7 +96,6 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
     }
 
     public TbFeeStatistics getByDayAndFeeType(String day, Integer feeType) {
-//        TbFeeStatistics Fee = tbFeeStatisticsMapper.getByDayAndFeeType(Day, feeType);
         QueryWrapper<TbFeeStatistics> qw = new QueryWrapper<>();
         qw.eq("day", day);
         qw.eq("fee_type", feeType);
@@ -114,14 +113,22 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             parkFee = new TbFeeStatistics();
             parkFee.setTaxRate(BigDecimal.valueOf(TbFeeStatistics.taxRate.PARK.getValue()));
         }
+        BigDecimal totalPrice = BigDecimal.valueOf(0);
+        Integer totalNum = parkFee.getNum();
         for (PriceBO bo1 : cars) {
             BigDecimal price = bo1.getP();
-            TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
-            if (car.getMoney().compareTo(new BigDecimal(0)) == 0) {
-                parkFee.setNum(parkFee.getNum() + 1);
+            if(price.compareTo(BigDecimal.valueOf(0)) != 0){
+                totalPrice = totalPrice.add(price);
+                TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
+                if(car.getMoney().compareTo(partConfig.getBasePrice()) == -1 || car.getMoney().compareTo(partConfig.getBasePrice()) == 0){
+                    totalNum++;
+                }
             }
-            parkFee.setTaxMoney(parkFee.getTaxMoney().add(price));
         }
+        if(totalPrice.compareTo(BigDecimal.valueOf(0)) == 0){
+            return;
+        }
+        parkFee.setNum(totalNum).setTaxMoney(parkFee.getTaxMoney().add(totalPrice));
         BigDecimal taxes = parkFee.getTaxMoney()
                 .divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()),2, BigDecimal.ROUND_HALF_UP)
                 .multiply(parkFee.getTaxRate());
@@ -192,8 +199,9 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             if(StrUtil.isEmpty(business.getCardNo())){
                 carNo = business.getChinaCarNo();
             }
+            TbBusinessCar businessCar = tbBusinessCarService.findByBusinessIdAndCarNo(item.getBusinessId(), carNo);
             businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
-                    .setBusinessItemNo(item.getNo())
+                    .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCar.getId()).setBusinessCarNo(businessCar.getNo())
                     .setCarNo(carNo)
                     .setItemPrice(item.getItemPrice()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
                     .setFeeType(feeType)

二进制
sp-server/src/main/resources/static/day-fee-new.xlsx