Kaynağa Gözat

Merge branch 'dev' of http://47.101.143.145:8090/77975466/pco into dev

qzyReal 2 yıl önce
ebeveyn
işleme
ef76263290

+ 2 - 2
sp-admin/sa-view/tb-fee-statistics/month-statistcs-list.html

@@ -110,9 +110,9 @@
 					f5: function() {
 						if ( this.selectMonth != null && this.selectMonth.length != 0) {
 							this.selectMonthRange.beginMonth = this.selectMonth[0];
-							this.selectMonthRange.beginMonth = this.selectMonth[1];
+							this.selectMonthRange.endMonth = this.selectMonth[1];
 						}
-						sa.ajax('/TbFeeStatistics/getMonth?beginMonth='+this.selectMonthRange.beginMonth+"&endMonth="+this.selectMonthRange.beginMonth,
+						sa.ajax('/TbFeeStatistics/getMonth?beginMonth='+this.selectMonthRange.beginMonth+"&endMonth="+this.selectMonthRange.endMonth,
 								sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 

+ 1 - 0
sp-admin/sa-view/tb-fee-statistics/tb-fee-details-list.html

@@ -21,6 +21,7 @@
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
 					<div class="c-item">
+						<sa-item type="text" name="车牌号" v-model="p.carNo"></sa-item>
 						<label class="c-label">收费项目:</label>
 						<el-select v-model="p.feeType" placeholder="请选择" filterable>
 							<el-option label="核酸检测" value="1"></el-option>

+ 7 - 4
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -288,11 +288,14 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
             feeDetailsLIst.forEach(fee -> fee.setCarNo(carNo));
             tbFeeDetailsService.updateBatchById(feeDetailsLIst);
         } else{
-            TbFeeDetails feeDetail = tbFeeDetailsService.getByBusinessCarIdAndCarNoAndFeeType(t.getId(), oldCarNo, TbFeeDetails.fee.PARK_FEE.getCode());
-            if(feeDetail != null){
-                feeDetail.setCarNo(carNo);
-                tbFeeDetailsService.updateById(feeDetail);
+            List<TbFeeDetails> feeDetailsList = tbFeeDetailsService.getByBusinessCarIdAndCarNoAndFeeType(t.getId(), oldCarNo, TbFeeDetails.fee.PARK_FEE.getCode());
+            for (TbFeeDetails feeDetail : feeDetailsList) {
+                if(feeDetail != null){
+                    feeDetail.setCarNo(carNo);
+                    tbFeeDetailsService.updateById(feeDetail);
+                }
             }
+
         }
 
     }

+ 11 - 60
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

@@ -122,12 +122,12 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         return getOne(qw);
     }
 
-    public TbFeeDetails getByBusinessCarIdAndCarNoAndFeeType(String businessCarId, String carNo, Integer feeType){
+    public List<TbFeeDetails> getByBusinessCarIdAndCarNoAndFeeType(String businessCarId, String carNo, Integer feeType){
         QueryWrapper<TbFeeDetails> qw = new QueryWrapper<>();
         qw.eq("business_car_id", businessCarId);
         qw.eq("car_no", carNo);
         qw.eq("fee_type", feeType);
-        return getOne(qw);
+        return list(qw);
     }
 
 
@@ -142,21 +142,21 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             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 {
-                parkFee = getByBusinessCarIdAndCarNoAndFeeType(car.getId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
-            }
+            TbFeeDetails parkFee = null;
+//            if(business != null){
+//                parkFee = getByBusinessIdAndCarNoAndFeeType(car.getBusinessId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
+//            } else {
+//                parkFee = getByBusinessCarIdAndCarNoAndFeeType(car.getId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
+//            }
             if(parkFee == null){
                 parkFee = new TbFeeDetails();
                 parkFee.setTaxRate(partConfig.getTaxRate());
             }
-            BigDecimal taxPrice = car.getMoney().divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()),2, BigDecimal.ROUND_HALF_UP).multiply(parkFee.getTaxRate());
-            BigDecimal noTaxPrice = car.getMoney().subtract(taxPrice);
+            BigDecimal taxPrice = bo1.getP().divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()),2, BigDecimal.ROUND_HALF_UP).multiply(parkFee.getTaxRate());
+            BigDecimal noTaxPrice = bo1.getP().subtract(taxPrice);
             parkFee.setBusinessId(car.getBusinessId()).setBusinessCarId(car.getId())
                     .setCarNo(car.getCarNo())
-                    .setItemPrice(car.getMoney()).setUnitPrice(car.getMoney()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
+                    .setItemPrice(bo1.getP()).setUnitPrice(car.getMoney()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
                     .setFeeType(TbFeeDetails.fee.PARK_FEE.getCode()).setItemTypeName("停车业务")
                     .setPayDay(toDay).setPayType(3).setCreateTime(now)
                     .setNum(1).setIsSettle(1).setPayMode(1).setPayTime(nowStr)
@@ -169,56 +169,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         }
     }
 
-    //@Async
-    public void chargeBusinessFee(List<TbBusinessItem> items) {
-        Date now = new Date();
-        String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
-        String toDay = DateUtil.format(now, "yyyy-MM-dd");
-        for (TbBusinessItem item : items) {
-            int feeType = -1;
-            String itemType = item.getItemTypeName();
-            if (itemType.contains("核酸")) {
-                feeType = TbFeeDetails.fee.NUCLEIC_FEE.getCode();
-            } else if (itemType.contains("消毒") || itemType.contains("消杀")) {
-                feeType = TbFeeDetails.fee.DISINFECT_FEE.getCode();
-            } else if (itemType.contains("装卸")) {
-                feeType = TbFeeDetails.fee.STEVEDORE_FEE.getCode();
-            } else if (StrUtil.equals(itemType, "特殊车辆") || StrUtil.equals(itemType, "汽车吊")) {
-                feeType = TbFeeDetails.fee.STEVEDORE_FEE.getCode();
-            } else if (itemType.contains("入场管理")) {
-                feeType = TbFeeDetails.fee.MANAGE_FEE.getCode();
-            } else if (StrUtil.equals(itemType, "充电打冷")) {
-                feeType = TbFeeDetails.fee.CHARGE_FEE.getCode();
-            }
-            TbBusiness business = tbBusinessService.getById(item.getBusinessId());
-            TbFeeDetails businessFeeDetail = this.getByBusinessIdAndCarNoAndItemType(item.getBusinessId(), business.getCardNo(), item.getItemTypeId());
-            if (businessFeeDetail == null) {
-                businessFeeDetail = new TbFeeDetails();
-                businessFeeDetail.setTaxRate(BigDecimal.valueOf(TbFeeStatistics.taxRate.BUSINESS.getValue()));
-            }
-            BigDecimal taxPrice = item.getItemPrice()
-                    .divide(BigDecimal.valueOf(1).add(businessFeeDetail.getTaxRate()),2, BigDecimal.ROUND_HALF_UP)
-                    .multiply(businessFeeDetail.getTaxRate());
-            BigDecimal noTaxPrice = item.getItemPrice().subtract(taxPrice);
 
-            String carNo = business.getCardNo();
-            if(StrUtil.isEmpty(business.getCardNo())){
-                carNo = business.getChinaCarNo();
-            }
-            businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
-                    .setBusinessItemNo(item.getNo())
-                    .setCarNo(carNo)
-                    .setItemPrice(item.getItemPrice()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
-                    .setFeeType(feeType)
-                    .setItemTypeId(item.getItemTypeId()).setItemTypeName(item.getItemTypeName())
-                    .setItemId(item.getItemId()).setItemName(item.getItemName())
-                    .setPayDay(toDay).setPayType(3).setCreateTime(now)
-                    .setBusinessItemId(item.getId() + "")
-                    .setPickCustomerName(item.getPickCustomerName())
-                    .setNum(1).setIsSettle(1).setPayMode(1).setPayTime(nowStr).setWeight(business.getNetWeight());
-            this.saveOrUpdate(businessFeeDetail);
-        }
-    }
 
     public String export(SoMap so) throws Exception{
         Date now = new Date();

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

@@ -120,9 +120,10 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             if(price.compareTo(BigDecimal.valueOf(0)) != 0){
                 totalPrice = totalPrice.add(price);
                 TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
-                if(car.getMoney().compareTo(BigDecimal.valueOf(0)) == 0){
-                    totalNum++;
-                }
+//                if(car.getMoney().compareTo(BigDecimal.valueOf(0)) == 0){
+//                    totalNum++;
+//                }
+                totalNum++;
             }
         }
         if(totalPrice.compareTo(BigDecimal.valueOf(0)) == 0){
@@ -186,7 +187,8 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             /*-----------------分割线------------------*/
             //添加此item的收费明细
             TbBusiness business = tbBusinessService.getById(item.getBusinessId());
-            TbFeeDetails businessFeeDetail = tbFeeDetailsService.getByBusinessIdAndCarNoAndItemType(item.getBusinessId(), business.getCardNo(), item.getItemTypeId());
+//            TbFeeDetails businessFeeDetail = tbFeeDetailsService.getByBusinessIdAndCarNoAndItemType(item.getBusinessId(), business.getCardNo(), item.getItemTypeId());
+            TbFeeDetails businessFeeDetail = null;
             if (businessFeeDetail == null) {
                 businessFeeDetail = new TbFeeDetails();
                 businessFeeDetail.setTaxRate(BigDecimal.valueOf(TbFeeStatistics.taxRate.BUSINESS.getValue()));