浏览代码

调到业务审核

qzyReal 2 年之前
父节点
当前提交
3ab576ee66

+ 5 - 0
sp-admin/sa-frame/menu-list-sp.js

@@ -399,6 +399,11 @@ window.menuList.unshift({
 						isShow: false
 					},
 					{
+						id: 'tb-flex-business-judge',
+						name: '业务审核',
+						isShow: false
+					},
+					{
 
 						id: 'tb-business-car-bind',
 						name: '车辆绑定',

+ 6 - 6
sp-admin/sa-view/tb-business-car/tb-business-car-info.html

@@ -38,7 +38,7 @@
 				<div class="c-panel">
 					<el-form v-if="m">
 						<el-row>
-							<el-col :span="m.businessType==1?8:12">
+							<el-col span="12">
 								<sa-info name="车牌号" br>{{m.carNo}}</sa-info>
 								<sa-info name="车牌颜色" br>{{m.color}}</sa-info>
 								<sa-info name="车牌规格(米)" br>{{m.carSize}}</sa-info>
@@ -50,7 +50,7 @@
 								<sa-info name="备注" br v-if="m.remark">{{m.remark}}</sa-info>
 								<sa-info type="img" name="入场图片" :value="m.inImage" br></sa-info>
 							</el-col>
-							<el-col :span="m.businessType==1?8:12">
+							<el-col span="12">
 								<sa-info name="离场时间" br>{{m.realOutTime}}<label
 										v-if="m.outTimeSupplement===1">(补)</label></sa-info>
 								<sa-info name="补录时间" br v-if="m.outTimeSupplementTime">{{m.outTimeSupplementTime}}
@@ -61,7 +61,7 @@
 								<sa-info name="出场确认说明" br v-if="m.outRemark">{{m.outRemark}}</sa-info>
 								<sa-info type="img" name="离场图片" :value="m.outImage" br></sa-info>
 							</el-col>
-							<el-col span=8 v-if="m.businessType==1">
+							<!-- <el-col span=8 v-if="m.businessType==1">
 								<sa-info style="margin-top: 0;" type="enum" name="审核状态" :value="m.confirmJudge"
 									:jv="{0: '未审核', 1: '审核通过', 2: '审核驳回'}" br>
 								</sa-info>
@@ -72,7 +72,7 @@
 								<sa-info name="审核意见" br v-if="m.confirmJudgeContent">
 									{{m.confirmJudgeContent}}
 								</sa-info>
-							</el-col>
+							</el-col> -->
 						</el-row>
 						<el-row v-if="businessList.length>0">
 							<el-collapse value='1'>
@@ -141,10 +141,10 @@
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
-				<el-button v-if="sa.isAuth('tb-business-car-judge')&&m.businessType===1&&m.confirmJudge!=1"
+			<!-- 	<el-button v-if="sa.isAuth('tb-business-car-judge')&&m.businessType===1&&m.confirmJudge!=1"
 					class="c-btn" type="success" icon="el-icon" @click="pass()">审核通过</el-button>
 				<el-button v-if="sa.isAuth('tb-business-car-judge')&&m.businessType===1&&m.confirmJudge==1"
-					class="c-btn" type="warning" icon="el-icon" @click="callback()">审核驳回</el-button>
+					class="c-btn" type="warning" icon="el-icon" @click="callback()">审核驳回</el-button> -->
 				<el-button v-if="sa.isAuth('tb-business-car-print')&&m.pay===1&&m.businessType===1" type="success"
 					@click="printFn()">打印</el-button>
 				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>

+ 1 - 1
sp-admin/sa-view/tb-business-car/tb-business-car-list.html

@@ -128,7 +128,7 @@
 							</label>
 						</template>
 					</el-table-column>
-					<sa-td name="审核状态" prop="confirmJudge" type="enum" :jv="{0: '未审核', 1:'审核通过',2:'审核驳回',3:'无需审核'}"></sa-td>
+					
 					<sa-td name="支付状态" prop="payType"></sa-td>
 					<sa-td name="支付时间" prop="payTime" width="140"></sa-td>
 					<sa-td name="出场确认说明" prop="outRemark" width="180"></sa-td>

+ 49 - 3
sp-admin/sa-view/tb-business/tb-car-disincle-info.html

@@ -36,7 +36,7 @@
 									</div>
 									<div>
 										<el-row>
-											<el-col span="12">
+											<el-col span="8">
 												<sa-info name="客户名称" br v-if="m.customerName">{{m.customerName}}
 												</sa-info>
 												<sa-info name="业务项目" br>{{m.goodsName}}</sa-info>
@@ -59,7 +59,7 @@
 												</sa-info>
 
 											</el-col>
-											<el-col span="12">
+											<el-col span="8">
 												<sa-info name="企业" br v-if="m.pickCustomerName">{{m.pickCustomerName}}
 												</sa-info>
 												<sa-info name="业务编号" br>{{m.no}}</sa-info>
@@ -75,6 +75,18 @@
 												<sa-info name="审批结果" br v-if="m.oaResult">{{m.oaResult}}</sa-info>
 												<sa-info name="审批意见" br v-if="m.oaContent">{{m.oaContent}}</sa-info>
 											</el-col>
+											<el-col span=8 >
+												<sa-info style="margin-top: 0;" type="enum" name="审核状态" :value="m.confirmJudge"
+													:jv="{0: '未审核', 1: '审核通过', 2: '审核驳回'}" br>
+												</sa-info>
+												<sa-info style="margin-top: 0;" name="审核人" br>
+													{{m.confirmJudgeBy}}
+												</sa-info>
+												<sa-info name="审核时间" br>{{m.confirmJudgeTime}}</sa-info>
+												<sa-info name="审核意见" br v-if="m.confirmJudgeContent">
+													{{m.confirmJudgeContent}}
+												</sa-info>
+											</el-col>
 										</el-row>
 									</div>
 								</el-collapse-item>
@@ -164,6 +176,10 @@
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
 				<!-- <el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印单据</el-button> -->
+				<el-button v-if="sa.isAuth('tb-flex-business-judge')&&m.confirmJudge!=1"
+					class="c-btn" type="success" icon="el-icon" @click="pass()">审核通过</el-button>
+				<el-button v-if="sa.isAuth('tb-flex-business-judge')&&m.confirmJudge==1"
+					class="c-btn" type="warning" icon="el-icon" @click="callback()">审核驳回</el-button>
 				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
 			</div>
 
@@ -188,7 +204,7 @@
 				el: '.vue-box',
 				data: {
 					id: sa.p('id', 0), // 获取数据ID
-					m: null,
+					m: {},
 					tableData: [],
 					upload: {
 						visible: false,
@@ -199,6 +215,36 @@
 					}
 				},
 				methods: {
+					pass() {
+						sa.ajax('/TbBusiness/confirmJudgePass', {
+							id: this.id
+						}, function(res) {
+							let msg = res.msg;
+							if (msg) {
+								sa.alert(msg, this.clean);
+								return;
+							}
+							sa.alert('审核通过', this.clean);
+						}.bind(this))
+					},
+					callback() {
+						let that = this;
+						layer.prompt({
+							title: '填写审核意见'
+						}, function(content, index) {
+							layer.close(index);
+							sa.ajax('/TbBusiness/callback', {
+								id: that.id,
+								judgeContent: content
+							}, function(res) {
+								sa.alert('已驳回', that.clean);
+							})
+						});
+					},
+					clean() {
+						parent.app.f5();
+						sa.closeCurrIframe();
+					},
 					delFn(data) {
 						sa.confirm('是否确认删除该收费项?', function() {
 							sa.ajax('/TbBusinessItem/del', {

+ 10 - 6
sp-admin/sa-view/tb-business/tb-car-disincle-list.html

@@ -69,7 +69,8 @@
 					<div>
 						<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 						<el-button type="info" icon="el-icon-search"
-							@click="p.carNo = '';p.adminConfirmInput=-1;p.customerName='';p.pickCustomerName='';p.owner='';p.no=''; f5()">重置
+							@click="p.carNo = '';p.adminConfirmInput=-1;p.customerName='';p.pickCustomerName='';p.owner='';p.no=''; f5()">
+							重置
 						</el-button>
 						<el-button v-if="sa.isAuth('tb-flex-business-add')" size="mini" type="primary" @click="add()">
 							新增
@@ -90,8 +91,9 @@
 						</template>
 					</el-table-column>
 					<sa-td name="支付时间" prop="payTime" width="160"></sa-td>
-
-					<sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td>
+					<sa-td name="审核状态" prop="confirmJudge" type="enum" :jv="{0: '未审核', 1:'审核通过',2:'审核驳回'}">
+					</sa-td>
+					<!-- <sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td> -->
 					<sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
 					<sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
 					<sa-td name="业务状态" prop="hasError" type="enum" :jv="{1: '异常[#ff0000]', 0: '正常[#005500]'}"></sa-td>
@@ -99,9 +101,10 @@
 					</sa-td>
 					<el-table-column label="操作" width="300px" fixed="right">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
+							<!-- <el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
 								&&currentCustomerId=='1'&&s.row.adminConfirmInput==0" @click="confirmFn(s.row)">账单确认
-							</el-button>
+							</el-button> -->
+							
 							<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-business-confirm')
 									&&currentCustomerId=='1'&&s.row.adminConfirmInput==1" @click="checkConfirmFn(s.row)">查看账单
 							</el-button>
@@ -207,7 +210,7 @@
 					p: { // 查询参数
 						hasError: -1,
 						adminConfirmInput: -1,
-						pickCustomerName:'',
+						pickCustomerName: '',
 						confirmJudge: '',
 						customerName: '',
 						supplement: 0,
@@ -229,6 +232,7 @@
 					goodsList: [],
 				},
 				methods: {
+					
 					sureAddFn() {
 
 					},

+ 17 - 1
sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java

@@ -47,6 +47,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     public static final String PERMISSION_PAY = "tb-business-pay";
     public static final String PERMISSION_INPUT = "tb-business-add";
     public static final String PERMISSION_MANUAL_PAY = "tb-flex-business-pay";
+    public static final String PERMISSION__JUDGE = "tb-flex-business-judge";
     //其他业务
     public static final String PERMISSION_FLAX_BUSINESS_ADD = "tb-flex-business-add";
     public static final String PERMISSION_FLAX_BUSINESS_EDIT = "tb-flex-business-edit";
@@ -315,7 +316,22 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
      */
     private int hasError=0;
 
-
+    /**
+     * 确认审核(0=未审核,1=审核通过,2=审核驳回)[j]
+     */
+    private Integer confirmJudge=0;
+    /**
+     * 审核时间
+     */
+    private Date confirmJudgeTime;
+    /**
+     * 审核意见
+     */
+    private String confirmJudgeContent;
+    /**
+     * 审核人
+     */
+    private String judgeBy;
 
 
     @TableField(exist = false)

+ 29 - 1
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java

@@ -373,7 +373,7 @@ public class TbBusinessController {
     }
 
     /**
-     * 
+     * 删除车辆
      */
     @RequestMapping("deleteBusinessCar")
     @SaCheckPermission(TbBusiness.PERMISSION_FLAX_BUSINESS_EDIT)
@@ -381,4 +381,32 @@ public class TbBusinessController {
         tbBusinessService.deleteBusinessCar(id,businessId);
         return AjaxJson.getSuccess();
     }
+
+    /**
+     * 审核通过
+     *
+     * @return
+     */
+    @RequestMapping("confirmJudgePass")
+    @SaCheckPermission(TbBusiness.PERMISSION__JUDGE)
+    public AjaxJson confirmJudge() {
+        SoMap soMap = SoMap.getRequestSoMap();
+        String id = soMap.getString("id");
+       tbBusinessService.confirmJudgePass(id);
+        return AjaxJson.getSuccess();
+    }
+    /**
+     * 驳回
+     *
+     * @return
+     */
+    @RequestMapping("callback")
+    @SaCheckPermission(TbBusiness.PERMISSION__JUDGE)
+    public AjaxJson callback() {
+        SoMap soMap = SoMap.getRequestSoMap();
+        String id = soMap.getString("id");
+        String judgeContent = soMap.getString("judgeContent");
+        tbBusinessCarService.callback(id,judgeContent);
+        return AjaxJson.getSuccess();
+    }
 }

+ 86 - 7
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -978,14 +978,14 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             dbBusiness.setGoodsId(otherBusinessBO.getGoodsId())
                     .setGoodsName(tbGoods.getName()).setPayStep(tbGoods.getPayStep());
         }
-        String customerId=otherBusinessBO.getCustomerId();
-        if (StrUtil.isNotEmpty(customerId)){
-            TbCostomer tbCostomer=tbCostomerService.getById(customerId);
+        String customerId = otherBusinessBO.getCustomerId();
+        if (StrUtil.isNotEmpty(customerId)) {
+            TbCostomer tbCostomer = tbCostomerService.getById(customerId);
             dbBusiness.setCustomerId(customerId).setCustomerName(tbCostomer.getName());
         }
-        String pickCustomerId=otherBusinessBO.getPickCustomerId();
-        if (StrUtil.isNotEmpty(pickCustomerId)){
-            TbCostomer tbCostomer=tbCostomerService.getById(pickCustomerId);
+        String pickCustomerId = otherBusinessBO.getPickCustomerId();
+        if (StrUtil.isNotEmpty(pickCustomerId)) {
+            TbCostomer tbCostomer = tbCostomerService.getById(pickCustomerId);
             dbBusiness.setPickCustomerId(pickCustomerId).setPickCustomerName(tbCostomer.getName());
         }
 
@@ -1586,4 +1586,83 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
         }
     }
-}
+
+    public void confirmJudgePass(String id) {
+        TbBusiness tbBusiness = this.getById(id);
+        if (tbBusiness == null) {
+            throw new AjaxError("业务不存在");
+        }
+        Date now = new Date();
+        List<TbBusinessCar> tbBusinessCars = tbBusinessCarService.findOtherBusinessCar(tbBusiness.getId());
+        //审核
+        List<TbBusinessItem> tbBusinessItems = tbBusinessItemService.findByBusinessId(tbBusiness.getId());
+        String customerId = tbBusiness.getPickCustomerId();
+        TbAccount tbAccount = tbAccountService.getAccountByCustomerId(customerId);
+        for (TbBusinessCar tbBusinessCar : tbBusinessCars) {
+            for (TbBusinessItem item : tbBusinessItems) {
+                String itemName = item.getItemName();
+                // todo 扣除 人工、机械装卸车辆---->每辆车都要支付----->
+                if (SystemObject.config.getEveryCarPay().contains(itemName) && tbBusinessCar.getPayUnloadMoney() == 0) {
+                    List<IOrderItem> expenses = new ArrayList<>();
+                    IOrderItem orderItem = new IOrderItem();
+                    orderItem.setExpenseNum(Integer.parseInt(item.getNum()))
+                            .setUniqExpenseId(item.getItemCode());
+                    expenses.add(orderItem);
+                    IOrderPriceRes res = syncService.orderPriceCal(expenses);
+                    BigDecimal price = res.getTotalOrderPrice();
+                    BigDecimal balance = tbAccount.getTotalMoney();
+                    if (price.compareTo(balance) > 0) {
+                        throw new AjaxError("[" + tbAccount.getCustomerName() + "]账户余额不足扣除" + item.getItemName());
+                    } else {
+                        tbBusinessCar.setPayUnloadMoney(1);
+                        item.setPayTime(now).setPayStatus(1).setPayType(PayEnum.PayType.PER_PAY.getCode())
+                                .setPayTypeName(PayEnum.PayType.PER_PAY.getDesc());
+                        tbBusinessItemService.updateById(item);
+                        tbBusiness.setPayMoney(price.add(tbBusiness.getPayMoney()));
+                        this.updateById(tbBusiness);
+                        BigDecimal afterBalance = balance.subtract(price);
+                        tbAccount.setTotalMoney(afterBalance);//增加累计扣款
+                        tbAccountService.updateById(tbAccount);
+                        TbFeeDetails details = tbFeeDetailsService.savePrePayDetails(res, item, tbBusinessCar, tbBusiness, FeeTypeEnum.STEVEDORE_FEE);
+                        tbFeeStatisticsService.addOrUpdateStatistic(now, PayEnum.PayType.PER_PAY.getCode());//更新当前日期的日统计
+                        automaticPay.createTbDeductionRecord(details, balance, afterBalance, tbBusiness.getPickCustomerId(), tbBusiness.getPickCustomerName(), tbBusinessCar.getCarNo(), tbBusinessCar.getId(), FeeTypeEnum.STEVEDORE_FEE);
+                    }
+                }
+            }
+        }
+
+
+        //其他费项 装卸业务管理费” 进行预存款扣除
+        for (TbBusinessItem item : tbBusinessItems) {
+            //业务类型是装卸业务管理费且未支付的进行扣款
+            if (item.getPayStatus() == 0 && SystemObject.config.getUnLoadItem().contains(item.getItemTypeName())) {
+                List<IOrderItem> expenses = new ArrayList<>();
+                IOrderItem orderItem = new IOrderItem();
+                orderItem.setExpenseNum(Integer.parseInt(item.getNum()))
+                        .setUniqExpenseId(item.getItemCode());
+                expenses.add(orderItem);
+                IOrderPriceRes res = syncService.orderPriceCal(expenses);
+                BigDecimal price = res.getTotalOrderPrice();
+                BigDecimal balance = tbAccount.getTotalMoney();
+                if (price.compareTo(balance) > 0) {
+                    throw new AjaxError("[" + tbAccount.getCustomerName() + "]账户余额不足扣除" + item.getItemName());
+                } else {
+                    BigDecimal afterBalance = balance.subtract(price);
+                    tbAccount.setTotalMoney(afterBalance);//增加累计扣款
+                    tbAccountService.updateById(tbAccount);
+                    item.setPayTime(now).setPayStatus(1).setPayType(PayEnum.PayType.PER_PAY.getCode())
+                            .setPayTypeName(PayEnum.PayType.PER_PAY.getDesc());
+                    tbBusinessItemService.updateById(item);
+                    tbBusiness.setPayMoney(price.add(tbBusiness.getPayMoney()));
+                    this.updateById(tbBusiness);
+                    //查找越南车--->统计以
+                    TbBusinessCar tbBusinessCar = tbBusinessCars.stream().filter(car -> !CAR_LIST.contains(car.getCarNo().substring(0, 1)))
+                            .findAny().orElse(tbBusinessCars.get(0));
+                    TbFeeDetails details = tbFeeDetailsService.savePrePayDetails(res, item, tbBusinessCar, tbBusiness, FeeTypeEnum.STEVEDORE_FEE);
+                    tbFeeStatisticsService.addOrUpdateStatistic(now, PayEnum.PayType.PER_PAY.getCode());//更新当前日期的日统计
+                    automaticPay.createTbDeductionRecord(details, balance, afterBalance, tbBusiness.getPickCustomerId(), tbBusiness.getPickCustomerName(), tbBusinessCar.getCarNo(), tbBusinessCar.getId(), FeeTypeEnum.STEVEDORE_FEE);
+                }
+            }
+        }
+    }
+}

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java

@@ -218,6 +218,7 @@ public class TbBusinessCarController {
      */
     @RequestMapping("confirmJudgePass")
     @SaCheckPermission(TbBusinessCar.PERMISSION__JUDGE)
+    @Deprecated
     public AjaxJson confirmJudge() {
         SoMap soMap = SoMap.getRequestSoMap();
         String id = soMap.getString("id");
@@ -238,7 +239,6 @@ public class TbBusinessCarController {
         String judgeContent = soMap.getString("judgeContent");
         tbBusinessCarService.callback(id,judgeContent);
         return AjaxJson.getSuccess();
-
     }
     @RequestMapping("getListByCarId")
     public AjaxJson getListByCarId(String businessCarId) {

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

@@ -521,49 +521,46 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         for (TbBusiness tbBusiness : businessList) {
             Date now = new Date();
             List<TbBusinessCar> tbBusinessCars = this.findOtherBusinessCar(tbBusiness.getId());
-
             //审核
             List<TbBusinessItem> tbBusinessItems = tbBusinessItemService.findByBusinessId(tbBusiness.getId());
             String customerId = tbBusiness.getPickCustomerId();
             TbAccount tbAccount = tbAccountService.getAccountByCustomerId(customerId);
             for (TbBusinessCar tbBusinessCar : tbBusinessCars) {
-                if (tbBusinessCar.getConfirmJudge()!=CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
-                    tbBusinessCar.setConfirmJudge(CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode())
-                            .setConfirmJudgeContent("审核通过").setConfirmJudgeTime(now)
-                            .setConfirmJudgeBy(StpUserUtil.getCreateBy());
-                    for (TbBusinessItem item : tbBusinessItems) {
-                        String itemName = item.getItemName();
-                        // todo 扣除 人工、机械装卸车辆---->每辆车都要支付----->
-                        if (SystemObject.config.getEveryCarPay().contains(itemName) && tbBusinessCar.getPayUnloadMoney() == 0) {
-                            List<IOrderItem> expenses = new ArrayList<>();
-                            IOrderItem orderItem = new IOrderItem();
-                            orderItem.setExpenseNum(Integer.parseInt(item.getNum()))
-                                    .setUniqExpenseId(item.getItemCode());
-                            expenses.add(orderItem);
-                            IOrderPriceRes res = syncService.orderPriceCal(expenses);
-                            BigDecimal price = res.getTotalOrderPrice();
-                            BigDecimal balance = tbAccount.getTotalMoney();
-                            if (price.compareTo(balance) > 0) {
-                                throw new AjaxError("[" + tbAccount.getCustomerName() + "]账户余额不足扣除" + item.getItemName());
-                            } else {
-                                tbBusinessCar.setPayUnloadMoney(1);
-                                item.setPayTime(now).setPayStatus(1).setPayType(PayEnum.PayType.PER_PAY.getCode())
-                                        .setPayTypeName(PayEnum.PayType.PER_PAY.getDesc());
-                                tbBusinessItemService.updateById(item);
-                                tbBusiness.setPayMoney(price.add(tbBusiness.getPayMoney()));
-                                tbBusinessService.updateById(tbBusiness);
-                                BigDecimal afterBalance = balance.subtract(price);
-                                tbAccount.setTotalMoney(afterBalance);//增加累计扣款
-                                tbAccountService.updateById(tbAccount);
-                                TbFeeDetails details = tbFeeDetailsService.savePrePayDetails(res, item, tbBusinessCar, tbBusiness, FeeTypeEnum.STEVEDORE_FEE);
-                                tbFeeStatisticsService.addOrUpdateStatistic(now, PayEnum.PayType.PER_PAY.getCode());//更新当前日期的日统计
-                                automaticPay.createTbDeductionRecord(details, balance, afterBalance, tbBusiness.getPickCustomerId(),tbBusiness.getPickCustomerName(), tbBusinessCar.getCarNo(), tbBusinessCar.getId(), FeeTypeEnum.STEVEDORE_FEE);
-                            }
+                for (TbBusinessItem item : tbBusinessItems) {
+                    String itemName = item.getItemName();
+                    // todo 扣除 人工、机械装卸车辆---->每辆车都要支付----->
+                    if (SystemObject.config.getEveryCarPay().contains(itemName) && tbBusinessCar.getPayUnloadMoney() == 0) {
+                        List<IOrderItem> expenses = new ArrayList<>();
+                        IOrderItem orderItem = new IOrderItem();
+                        orderItem.setExpenseNum(Integer.parseInt(item.getNum()))
+                                .setUniqExpenseId(item.getItemCode());
+                        expenses.add(orderItem);
+                        IOrderPriceRes res = syncService.orderPriceCal(expenses);
+                        BigDecimal price = res.getTotalOrderPrice();
+                        BigDecimal balance = tbAccount.getTotalMoney();
+                        if (price.compareTo(balance) > 0) {
+                            throw new AjaxError("[" + tbAccount.getCustomerName() + "]账户余额不足扣除" + item.getItemName());
+                        } else {
+                            tbBusinessCar.setPayUnloadMoney(1);
+                            item.setPayTime(now).setPayStatus(1).setPayType(PayEnum.PayType.PER_PAY.getCode())
+                                    .setPayTypeName(PayEnum.PayType.PER_PAY.getDesc());
+                            tbBusinessItemService.updateById(item);
+                            tbBusiness.setPayMoney(price.add(tbBusiness.getPayMoney()));
+                            tbBusinessService.updateById(tbBusiness);
+                            BigDecimal afterBalance = balance.subtract(price);
+                            tbAccount.setTotalMoney(afterBalance);//增加累计扣款
+                            tbAccountService.updateById(tbAccount);
+                            TbFeeDetails details = tbFeeDetailsService.savePrePayDetails(res, item, tbBusinessCar, tbBusiness, FeeTypeEnum.STEVEDORE_FEE);
+                            tbFeeStatisticsService.addOrUpdateStatistic(now, PayEnum.PayType.PER_PAY.getCode());//更新当前日期的日统计
+                            automaticPay.createTbDeductionRecord(details, balance, afterBalance, tbBusiness.getPickCustomerId(), tbBusiness.getPickCustomerName(), tbBusinessCar.getCarNo(), tbBusinessCar.getId(), FeeTypeEnum.STEVEDORE_FEE);
                         }
                     }
-                    this.updateById(tbBusinessCar);
                 }
+                tbBusinessCar.setConfirmJudge(CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode())
+                        .setConfirmJudgeContent("审核通过").setConfirmJudgeTime(now)
+                        .setConfirmJudgeBy(StpUserUtil.getCreateBy());
             }
+            this.updateBatchById(tbBusinessCars);
             //其他费项 装卸业务管理费” 进行预存款扣除
             for (TbBusinessItem item : tbBusinessItems) {
                 //业务类型是装卸业务管理费且未支付的进行扣款
@@ -592,7 +589,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
                                 .findAny().orElse(tbBusinessCars.get(0));
                         TbFeeDetails details = tbFeeDetailsService.savePrePayDetails(res, item, tbBusinessCar, tbBusiness, FeeTypeEnum.STEVEDORE_FEE);
                         tbFeeStatisticsService.addOrUpdateStatistic(now, PayEnum.PayType.PER_PAY.getCode());//更新当前日期的日统计
-                        automaticPay.createTbDeductionRecord(details, balance, afterBalance, tbBusiness.getPickCustomerId(),tbBusiness.getPickCustomerName(), tbBusinessCar.getCarNo(), tbBusinessCar.getId(), FeeTypeEnum.STEVEDORE_FEE);
+                        automaticPay.createTbDeductionRecord(details, balance, afterBalance, tbBusiness.getPickCustomerId(), tbBusiness.getPickCustomerName(), tbBusinessCar.getCarNo(), tbBusinessCar.getId(), FeeTypeEnum.STEVEDORE_FEE);
                     }
                 }
             }