qzyReal преди 2 години
родител
ревизия
cebb861f59

+ 1 - 1
sp-admin/sa-view/tb-deduction-bind/tb-deduction-bind-list.html

@@ -160,7 +160,7 @@
                     sa.error2("没有车辆绑定信息!")
                     return;
                 }
-                sa.showIframe('修改数据', 'tb-deduction-bind-unbind.html?id=' + data.id, '1000px', '90%');
+                sa.showIframe('修改数据', 'tb-deduction-bind-unbind.html?id=' + data.id, '700px', '70%');
             },
             // 车辆绑定
             add: function (data) {

+ 0 - 5
sp-admin/sa-view/tb-deduction-bind/tb-deduction-bind-unbind.html

@@ -106,11 +106,6 @@
                 let m = this.m;
                 sa.checkNull(m.bindCar, '请输入 [绑定车辆]');
                 sa.checkNull(m.unbindTime, '解绑时间不能为空');
-                if(!sa.isCarNo(m.bindCar)){
-                    sa.error("请输入正确的车牌号!");
-                    return;
-                }
-
                 //绑定车辆
                 sa.ajax('/TbDeductionBind/unbindCar', m, function (res) {
                     sa.alert('解绑成功', this.clean);

+ 9 - 9
sp-admin/sa-view/tb-deduction-record/tb-deduction-record-list.html

@@ -73,18 +73,18 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" >
 					<sa-td type="index" name="序号"></sa-td>
-					<sa-td name="客户名称" prop="customerName" ></sa-td>
-					<sa-td name="合作伙伴" prop="pickCustomerName" ></sa-td>
-					<sa-td name="业务单号" prop="businessNo" ></sa-td>
-					<sa-td name="车牌号" prop="carNo" ></sa-td>
+					<sa-td name="客户名称" prop="customerName" width="150"></sa-td>
+					<sa-td name="合作伙伴" prop="pickCustomerName" width="150"></sa-td>
+					<sa-td name="业务单号" prop="businessNo" width="150"></sa-td>
+					<sa-td name="车牌号" prop="carNo" width="100"></sa-td>
 					<sa-td name="收费项目" prop="feeType" type="enum"
 						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="业务类型id" prop="itemTypeId" v-if="false"></sa-td>
-					<sa-td name="业务类型" prop="itemTypeName" ></sa-td>
+					<sa-td name="业务类型" prop="itemTypeName" width="150"></sa-td>
 <!--					<sa-td name="业务项" prop="itemName" ></sa-td>-->
-					<sa-td name="原金额" prop="originalMoney" ></sa-td>
-					<sa-td name="扣除金额" prop="deductMoney" ></sa-td>
-					<sa-td name="余额" prop="totalMoney" ></sa-td>
+					<sa-td name="原金额" prop="originalMoney" width="120"></sa-td>
+					<sa-td name="扣除金额" prop="deductMoney" width="90"></sa-td>
+					<sa-td name="余额" prop="totalMoney" width="150"></sa-td>
 					<sa-td name="结算状态" prop="isSettle" type="enum" :jv="{0: '未结算',1: '已结算'}"></sa-td>
 					<sa-td name="复核状态" prop="reviewStatus" type="enum" :jv="{0: '未复核',1: '已复核'}"></sa-td>
 					<sa-td name="税率%" >
@@ -97,7 +97,7 @@
 							<span>{{Number(s.row.taxPrice).toFixed(2)}}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="不含税金额(元)">
+					<el-table-column label="不含税(元)" width="100">
 						<template slot-scope="s">
 							<span>{{Number(s.row.noTaxPrice).toFixed(2)}}</span>
 						</template>

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

@@ -29,6 +29,7 @@ import com.pj.project.tb_car.TbCar;
 import com.pj.project.tb_car.TbCarService;
 import com.pj.project.tb_car_no_color.TbCarNoColor;
 import com.pj.project.tb_car_no_color.TbCarNoColorService;
+import com.pj.project.tb_deduction_bind.TbDeductionBindService;
 import com.pj.project.tb_goods.TbGoods;
 import com.pj.project.tb_goods.TbGoodsService;
 import com.pj.project.tb_item.TbItem;
@@ -82,8 +83,10 @@ public class OpenService {
     @Resource
     private TbGoodsService tbGoodsService;
     @Resource
-            @Lazy
+    @Lazy
     AutomaticPay automaticPay;
+    @Resource
+    private TbDeductionBindService tbDeductionBindService;
 
 
     public ResultJson checkCarNumber(CheckCarNumberBO checkCarNumberBO) {
@@ -256,6 +259,8 @@ public class OpenService {
                 }
             }
         }
+        //离场直接解绑
+        tbDeductionBindService.autoUnbindCar(tbBusinessCar.getCarNo());
         freeOut(tbBusinessCar, now, channel, image);
         return ResultJson.success();
     }

+ 2 - 2
sp-server/src/main/java/com/pj/project/tb_account/AutomaticPay.java

@@ -153,7 +153,7 @@ public class AutomaticPay {
         BigDecimal parkingMoneyBig = new BigDecimal(0);
         BigDecimal totalMoneyBig = new BigDecimal(totalMoney);
         BigDecimal balance = totalMoneyBig.subtract(tbBusiness.getItemPrice());
-        boolean isOut = (TbGoods.DeductionTypeEnum.OUT_KK.getCode() == tbBusiness.getAutoDeductionType()) &&
+        boolean isOut = (TbGoods.DeductionTypeEnum.OUT_KK.getCode().equals(tbBusiness.getAutoDeductionType())) &&
                 this.feeType == 3;
         if (isOut) {
             parkingMoneyBig = getParkings(cars);
@@ -193,7 +193,7 @@ public class AutomaticPay {
         createTbDeductionRecord(tbFeeDetailsList, tbAccount, totalMoneyBig, plate, bind.getCustomerName(), no);
         //生成开票信息
         createTbInvoiceOrder(tbBusiness, cars, parkingMoneyBig, plate, bind.getCustomerId(), no, isOut);
-        if (isOut) {
+        if (isOut) {//离场缴费
             deductionBindService.setDeductMoney(bind.getCustomerId(), plate, parkingMoneyBig);
             List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.autoChargeParkFee(
                     cars, null, null, now);

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

@@ -74,7 +74,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     private RelationBusinessCarService relationBusinessCarService;
     @Resource
     @Lazy
-    AutomaticPay automaticPay;
+    TbDeductionBindService tbDeductionBindService;
 
 
     /**
@@ -195,7 +195,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         TbBusinessCar db = this.getById(t.getId());
         if (db.getRealOutTime() == null && t.getRealOutTime() != null) {
             //补录放行记录,解绑扣费绑定
-            automaticPay.unbindRun(db.getCarNo());
+           tbDeductionBindService.autoUnbindCar(db.getCarNo());
         }
         String oldCarNo = db.getCarNo();
         String newCarNo = t.getCarNo();

+ 4 - 7
sp-server/src/main/java/com/pj/project/tb_deduction_bind/TbDeductionBindService.java

@@ -107,7 +107,6 @@ public class TbDeductionBindService extends ServiceImpl<TbDeductionBindMapper, T
     }
 
 
-
     /**
      * 查找最后一条未解绑绑定记录
      *
@@ -130,8 +129,8 @@ public class TbDeductionBindService extends ServiceImpl<TbDeductionBindMapper, T
      * @return
      */
     public void unbindCar(Long id) {
-        TbDeductionBind bind=this.getById(id);
-        if (bind==null){
+        TbDeductionBind bind = this.getById(id);
+        if (bind == null) {
             throw new AjaxError("记录不存在!");
         }
         bind.setUnbindTime(new Date()).setUpdateBy(StpUserUtil.getLoginName()).setUpdateTime(new Date());
@@ -146,9 +145,7 @@ public class TbDeductionBindService extends ServiceImpl<TbDeductionBindMapper, T
      */
     public boolean autoUnbindCar(String plate) {
         if (NbUtil.isNull(plate)) return false;
-
-        TbDeductionBind bind = tbDeductionBindMapper.selectOne(new LambdaQueryWrapper<TbDeductionBind>().eq(
-                true, TbDeductionBind::getBindCar, plate).isNull(TbDeductionBind::getUnbindTime));
+        TbDeductionBind bind = this.getBindCarByPlate(plate);
         if (bind == null) return false;
         bind.setUpdateBy("预充值自动缴费解绑");
         bind.setUpdateTime(new Date());
@@ -239,7 +236,7 @@ public class TbDeductionBindService extends ServiceImpl<TbDeductionBindMapper, T
      */
     public TbDeductionBind getBindCarByPlate(String plate) {
         if (NbUtil.isNull(plate)) return null;
-        return tbDeductionBindMapper.selectOne(new LambdaQueryWrapper<TbDeductionBind>().eq(
+        return this.getOne(new LambdaQueryWrapper<TbDeductionBind>().eq(
                 TbDeductionBind::getBindCar, plate).isNull(TbDeductionBind::getUnbindTime));
     }
 

+ 2 - 2
sp-server/src/main/resources/application-dev.yml

@@ -6,9 +6,9 @@ spring:
     # 数据源配置
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        url: jdbc:mysql://127.0.0.1:3306/pco_system?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://47.101.143.145:3306/pco0815?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
         username: root
-        password: 123456
+        password: 1qaz@WSX
         # 是否打开sql监控台  (生产环境请务必关闭此选项)
         druid:
             stat-view-servlet: