Jelajahi Sumber

导出excel收费类型bug

qzyReal 2 tahun lalu
induk
melakukan
3f9f8b583c

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

@@ -1,215 +1,217 @@
 <!DOCTYPE html>
 <html>
-<head>
-    <title>-列表</title>
-    <meta charset="utf-8">
-    <meta name="viewport"
-          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
-    <!-- 所有的 css & js 资源 -->
-    <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
-    <link rel="stylesheet" href="../../static/sa.css">
-    <script src="../../static/kj/vue.min.js"></script>
-    <script src="../../static/kj/element-ui/index.js"></script>
-    <script src="../../static/kj/httpVueLoader.js"></script>
-    <script src="../../static/kj/jquery.min.js"></script>
-    <script src="../../static/kj/layer/layer.js"></script>
-    <script src="../../static/sa.js"></script>
-	<style>
-		.car-size .el-input__inner {
-		    width: 130px;
-		}
-	</style>
-</head>
-<body>
-<div class="vue-box" style="display: none;" :style="'display: block;'">
-    <div class="c-panel">
-        <div class="fast-btn">
-            <el-button size="mini" type="primary" @click="add()"
-                       v-if="sa.isAuth('tb-flex-business-edit')">
-                新增
-            </el-button>
-            <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
-        </div>
-        <!-- ------------- 数据列表 ------------- -->
-        <el-table class="data-table" ref="data-table" :data="dataList">
-            <sa-td name="车牌号" prop="carNo" width=120></sa-td>
-            <sa-td width="130" name="支付状态" prop="payType">
-            </sa-td>
-            <el-table-column label="停车费">
-                <template slot-scope="s">
-                    <label v-if="s.row.money">{{s.row.money}}</label>
-                    <label v-else>-</label>
-                </template>
-            </el-table-column>
-            <sa-td name="入场时间" prop="realInTime" width=160></sa-td>
-            <sa-td name="入场通道" prop="inChannel" width=180></sa-td>
-            <sa-td name="离场时间" prop="realOutTime" width=160></sa-td>
-            <sa-td name="离场通道" prop="outChannel" width=180></sa-td>
-            <el-table-column label="操作" width="100px" fixed="right">
-                <template slot-scope="s">
-                    <el-button
-                            v-if="sa.isAuth('tb-flex-business-edit')&&s.row.pay==0&&s.row.confirmJudge==0"
-                            class="c-btn" type="danger" @click="del(s.row)">删除
-                    </el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-    </div>
-    <el-dialog title="添加车辆" :visible.sync="modal.visible" width="400px">
-        <el-form >
-            <sa-item type="text" name="车牌号" v-model="modal.form.carNo" br need></sa-item>
-			<div class="c-item">
-				<label class="c-label">车辆类型:</label>
-				<el-select v-model="modal.form.carType" placeholder="请选择">
-					<el-option :label="item.name" :value="item.name" v-for="(item,index) in carTypeList">
-					</el-option>
-				</el-select>
+	<head>
+		<title>-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style>
+			.car-size .el-input__inner {
+				width: 130px;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<div class="fast-btn">
+					<el-button size="mini" type="primary" @click="add()" 
+					v-if="sa.isAuth('tb-flex-business-edit')&&confirm==0">
+						新增
+					</el-button>
+					<el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
+				</div>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<sa-td name="车牌号" prop="carNo" width=120></sa-td>
+					<sa-td name="入场时间" prop="realInTime" width=160></sa-td>
+					<sa-td name="离场时间" prop="realOutTime" width=160></sa-td>
+					<sa-td name="入场通道" prop="inChannel" width=180></sa-td>
+					<sa-td name="离场通道" prop="outChannel" width=180></sa-td>
+					<el-table-column label="停车费">
+						<template slot-scope="s">
+							<label v-if="s.row.money">{{s.row.money}}</label>
+							<label v-else>-</label>
+						</template>
+					</el-table-column>
+					<sa-td width="130" name="支付状态" prop="payType">
+					</sa-td>
+					<el-table-column label="操作" width="100px" fixed="right">
+						<template slot-scope="s">
+							<el-button v-if="sa.isAuth('tb-flex-business-edit')
+							&&s.row.pay==0
+							&&s.row.payUnloadMoney==0" class="c-btn" type="danger" @click="del(s.row)">删除
+							</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
 			</div>
-			<div class="c-item">
-			    <label class="c-label"><span style="color: red;">*</span>车辆规格:</label>
-			    <el-input-number class="car-size" v-model="modal.form.carSize" controls-position="right"
-			                     :min="4.2" :max="50"></el-input-number>
-			</div>
-			<div class="c-item" v-if="modal.form.carType.indexOf('空')==-1">
-				<label class="c-label">
-					<span ></span>
-					载重(kg):</label>
-				<el-input-number class="car-size" v-model="modal.form.netWeight" :min="1" :max="999999">
-				</el-input-number>
-			</div>
-        </el-form>
-        <span slot="footer" class="dialog-footer">
+			<el-dialog title="添加车辆" :visible.sync="modal.visible" width="400px">
+				<el-form>
+					<sa-item type="text" name="车牌号" v-model="modal.form.carNo" br need></sa-item>
+					<div class="c-item">
+						<label class="c-label">车辆类型:</label>
+						<el-select v-model="modal.form.carType" placeholder="请选择">
+							<el-option :label="item.name" :value="item.name" v-for="(item,index) in carTypeList">
+							</el-option>
+						</el-select>
+					</div>
+					<div class="c-item">
+			 		<label class="c-label"><span style="color: red;">*</span>车辆规格:</label>
+						<el-input-number class="car-size" v-model="modal.form.carSize" controls-position="right"
+							:min="4.2" :max="50"></el-input-number>
+					</div>
+					<div class="c-item" v-if="modal.form.carType.indexOf('空')==-1">
+						<label class="c-label">
+							<span></span>
+							载重(kg):</label>
+						<el-input-number class="car-size" v-model="modal.form.netWeight" :min="1" :max="999999">
+						</el-input-number>
+					</div>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
 					<el-button @click="modal.visible = false">取 消</el-button>
 					<el-button type="primary" @click="sureAddFn">确 认</el-button>
 				</span>
-    </el-dialog>
-</div>
-<script>
-    var app = new Vue({
-        components: {
-            "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
-            "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
-            "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
-        },
-        el: '.vue-box',
-        data: {
-            report: {
-                visible: false,
-                business: {},
-            },
-            payStatus: sa.p('payStatus', 1),
-            confirm: sa.p('confirm', 0),
-            p: { // 查询参数
-                businessId: sa.p('id', ''), //
-                carNo: '', //
-            },
-            dataCount: 0,
-            dataList: [], // 数据集合
-			carTypeList:[],
-            modal: {
-                visible: false,
-                form: {
-                    carNo: '',
-                    carSize: 13,
-					carType:'载重',
-					netWeight:0
-                }
-            },
-        },
-        methods: {
-			getItemType() {
-				sa.ajax('/TbItem/getItemType', function(resp) {
-					let list = resp.data;
-					if (list.length > 0) {
-						this.modal.form.carType = list[0].name;
-					}
-					this.carTypeList = list;
-				}.bind(this))
-			},
-         
-            sureAddFn() {
-				let data=this.modal.form;
-				if(!data.carNo){
-					  sa.error('请填写车牌号')
-					return;
+			</el-dialog>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					report: {
+						visible: false,
+						business: {},
+					},
+					payStatus: sa.p('payStatus', 1),
+					confirm: sa.p('confirm', 0),
+					p: { // 查询参数
+						businessId: sa.p('id', ''), //
+						carNo: '', //
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合
+					carTypeList: [],
+					modal: {
+						visible: false,
+						form: {
+							carNo: '',
+							carSize: 13,
+							carType: '载重',
+							netWeight: 0
+						}
+					},
+				},
+				methods: {
+					getItemType() {
+						sa.ajax('/TbItem/getItemType', function(resp) {
+							let list = resp.data;
+							if (list.length > 0) {
+								this.modal.form.carType = list[0].name;
+							}
+							this.carTypeList = list;
+						}.bind(this))
+					},
+
+					sureAddFn() {
+						let data = this.modal.form;
+						if (!data.carNo) {
+							sa.error('请填写车牌号')
+							return;
+						}
+						data.businessId = this.p.businessId;
+						sa.ajax('/TbBusiness/addCar', data, function(res) {
+							sa.alert('添加成功');
+							this.modal.visible = false;
+							this.f5();
+						}.bind(this));
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbBusinessCar/getBusinessByBusinessCarId', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数
+							sa.f5TableHeight(); // 刷新表格高度
+						}.bind(this));
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
+							.businessId, '800px', '80%');
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id + '&businessId=' + this.p
+							.businessId, '500px', '70%');
+					},
+					// 新增
+					add: function(data) {
+						Object.assign(this.modal, {
+							visible: true,
+							form: {
+								carNo: '',
+								carSize: 13,
+								carType: '重车',
+								netWeight: 0
+							}
+						})
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbBusiness/deleteBusinessCar?id=' + data.id + '&businessId=' + this.p
+								.businessId,
+								function(res) {
+									sa.arrayDelete(this.dataList, data);
+									sa.ok('删除成功');
+									sa.f5TableHeight(); // 刷新表格高度
+								}.bind(this))
+						}.bind(this));
+					},
+					// 改 - 状态(0=否,1=是)
+					updateStatus: function(data) {
+						if (!sa.isAuth('tb-business-car-change')) {
+							sa.error('无权限')
+							return false;
+						}
+						// 声明变量记录是否成功
+						var isOk = false;
+						var oldValue = data.isLock;
+						var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
+							id: data.id,
+							value: data.isLock
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.isLock = oldValue;
+							}
+						})
+					},
+				},
+				created: function() {
+					this.f5();
+					this.getItemType();
+					sa.onInputEnter();
 				}
-				data.businessId=this.p.businessId;
-                sa.ajax('/TbBusiness/addCar',data, function (res) {
-                    sa.alert('添加成功');
-                    this.modal.visible = false;
-                    this.f5();
-                }.bind(this));
-            },
-            // 刷新
-            f5: function () {
-                sa.ajax('/TbBusinessCar/getBusinessByBusinessCarId', sa.removeNull(this.p), function (res) {
-                    this.dataList = res.data; // 数据
-                    this.dataCount = res.dataCount; // 数据总数
-                    sa.f5TableHeight(); // 刷新表格高度
-                }.bind(this));
-            },
-            // 查看
-            get: function (data) {
-                sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
-                    .businessId, '800px', '80%');
-            },
-            // 修改
-            update: function (data) {
-                sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id + '&businessId=' + this.p
-                    .businessId, '500px', '70%');
-            },
-            // 新增
-            add: function (data) {
-                Object.assign(this.modal,{
-					visible:true,
-					form:{
-						carNo:'',
-						carSize:13,
-						carType:'重车',
-						netWeight:0
-					}
-				})
-            },
-            // 删除
-            del: function (data) {
-                sa.confirm('是否删除,此操作不可撤销', function () {
-                    sa.ajax('/TbBusiness/deleteBusinessCar?id=' + data.id+'&businessId='+this.p.businessId, function (res) {
-                        sa.arrayDelete(this.dataList, data);
-                        sa.ok('删除成功');
-                        sa.f5TableHeight(); // 刷新表格高度
-                    }.bind(this))
-                }.bind(this));
-            },
-            // 改 - 状态(0=否,1=是)
-            updateStatus: function (data) {
-                if (!sa.isAuth('tb-business-car-change')) {
-                    sa.error('无权限')
-                    return false;
-                }
-                // 声明变量记录是否成功
-                var isOk = false;
-                var oldValue = data.isLock;
-                var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
-                    id: data.id,
-                    value: data.isLock
-                }, function (res) {
-                    isOk = true;
-                    sa.msg('修改成功');
-                }.bind(this));
-                // 如果未能修改成功, 则回滚
-                $.when(ajax).done(function () {
-                    if (isOk == false) {
-                        data.isLock = oldValue;
-                    }
-                })
-            },
-        },
-        created: function () {
-            this.f5();
-			this.getItemType();
-            sa.onInputEnter();
-        }
-    })
-</script>
-</body>
+			})
+		</script>
+	</body>
 </html>

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

@@ -80,7 +80,7 @@
 													:jv="{0: '未审核', 1: '审核通过', 2: '审核驳回'}" br>
 												</sa-info>
 												<sa-info style="margin-top: 0;" name="审核人" br>
-													{{m.confirmJudgeBy}}
+													{{m.judgeBy}}
 												</sa-info>
 												<sa-info name="审核时间" br>{{m.confirmJudgeTime}}</sa-info>
 												<sa-info name="审核意见" br v-if="m.confirmJudgeContent">

+ 14 - 5
sp-admin/sa-view/tb-business/tb-car-disincle-list.html

@@ -93,13 +93,14 @@
 					<sa-td name="支付时间" prop="payTime" width="160"></sa-td>
 					<sa-td name="审核状态" prop="confirmJudge" type="enum" :jv="{0: '未审核', 1:'审核通过',2:'审核驳回'}">
 					</sa-td>
+					<sa-td name="审核时间" prop="confirmJudgeTime" width="160"></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="payMoney" width="140"></sa-td>
 					<sa-td name="业务状态" prop="hasError" type="enum" :jv="{1: '异常[#ff0000]', 0: '正常[#005500]'}"></sa-td>
 					<sa-td width="160" name="创建时间" prop="createTime"></sa-td>
 					</sa-td>
-					<el-table-column label="操作" width="300px" fixed="right">
+					<el-table-column label="操作" width="230px" fixed="right">
 						<template slot-scope="s">
 							<!-- <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)">账单确认
@@ -125,7 +126,7 @@
 								type="success" @click="zxPrint(s.row.id)">装卸打印
 							</el-button>
 							<el-button class="c-btn" type="danger"
-								v-if="sa.isAuth('tb-flex-business-del')&&s.row.adminConfirmInput==0&&s.row.payMoney==0"
+								v-if="sa.isAuth('tb-flex-business-del')&&s.row.adminConfirmInput==0&&s.row.payMoney==0&&s.row.confirmJudge!=1"
 								@click="del(s.row)">删除
 							</el-button>
 							<el-button class="c-btn" type="warning" v-if="s.row.hasError==1" @click="addErrorFn(s.row)">
@@ -291,8 +292,8 @@
 					},
 					carFn(data) {
 						this.stopTimmer();
-						sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
-							.payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '75%');
+						sa.showIframe('业务车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
+							.payStatus + '&confirm=' + data.confirmJudge, '1050px', '75%');
 					},
 					handlerPay(data) {
 						this.stopTimmer();
@@ -313,6 +314,10 @@
 						sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '1080px', '90%');
 					},
 					update(data) {
+						if(data.confirmJudge==1){
+							sa.error('业务已审核,请驳回后修改')
+							return;
+						}
 						sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '1080px', '90%');
 					},
 					getPcodeByCurrRid() {
@@ -348,6 +353,10 @@
 					},
 					// 删除
 					del: function(data) {
+						if(data.confirmJudge==1){
+							sa.error('业务已审核,无法删除')
+							return;
+						}
 						sa.confirm('是否删除,此操作不可撤销', function() {
 							sa.ajax('/TbBusiness/deleteOtherBusiness?id=' + data.id + '&businessCarId=' +
 								data.businessCarId,

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

@@ -172,12 +172,7 @@ public class OpenService {
             StaticLog.error("缓存离场图片,{}", carNo);
             IMAGE_CACHE.put(carNo, image);
         }
-        if (CarEnum.BusinessTypeEnum.BUSINESS_CAR.getType().equals(tbBusinessCar.getBusinessType())) {
-            if (tbBusinessCar.getConfirmJudge() != CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()) {
-                log.error("请求返回【业务未审核】:{}", carNo);
-                return ResultJson.error("业务未审核");
-            }
-        }
+
         //判断是否4.2米以下蓝色车牌===免停车费
         if (StrUtil.isNotEmpty(tbBusinessCar.getColor())) {
             String freeColor = partConfig.getFreeColor();
@@ -199,6 +194,13 @@ public class OpenService {
         IOrderPriceRes businessRes = new IOrderPriceRes();
         List<IOrderItem> expenses = new ArrayList<>();
         List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(businessCarId);
+        long judgeCount = businessList.stream().filter(tbBusiness -> tbBusiness.getConfirmJudge() == CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()).count();
+        int size=businessList.size();
+        if (size>judgeCount){
+            //业务未审核完
+            log.error("请求返回【业务未审核】:{}", carNo);
+            return ResultJson.error("业务未审核");
+        }
         BigDecimal hasPayPartMoney=tbBusinessCar.getMoney();
         if (businessList.isEmpty()) {
             //无业务车辆===>计算停车费

+ 6 - 5
sp-server/src/main/java/com/pj/api/pushfee/task/FeeDetailSyncTask.java

@@ -79,14 +79,14 @@ public class FeeDetailSyncTask extends Task {
         TbFeeItemService tbFeeItemService = SpringUtil.getBean(TbFeeItemService.class);
         TbItemService tbItemService = SpringUtil.getBean(TbItemService.class);
         TbFeeItem tbFeeItem = tbFeeItemService.getById(tbFeeDetails.getFeeType());
-      TbItem tbItem= tbItemService.getById(tbFeeDetails.getItemId());
-        String subBillNo = StrUtil.isEmpty(tbFeeDetails.getBusinessNo()) ? tbFeeDetails.getBusinessCarNo() : tbFeeDetails.getBusinessCarNo();
+        TbItem tbItem= tbItemService.getById(tbFeeDetails.getItemId());
+        String subBillNo = StrUtil.isEmpty(tbFeeDetails.getBusinessNo()) ? tbFeeDetails.getBusinessCarNo() : tbFeeDetails.getBusinessNo();
         String classifyPath = tbFeeDetails.getFeeType() + "-" + itemTypeId + "-" + itemId;
         opd.setSyncType(syncType)
                 .setSubjectNo(tbFeeDetails.getCarNo())
                 .setSubjectName(tbFeeDetails.getCarNo())
-                .setSubBillNo(subBillNo)
-                .setBizTypeNo(itemTypeId).setPayStatus("1")
+                .setSubBillNo(subBillNo).setCalculateId(tbFeeDetails.getCalculateId())
+                .setBizTypeNo(tbItem.getItemCode()).setPayStatus("1")
                 .setPayStatusDesc("已支付")
                 .setGoodNo(tbItem.getItemCode()).setGoodName(tbItem.getItemName())
                 .setBillStatusDesc(tbFeeDetails.getItemTypeName()+tbFeeDetails.getItemName())
@@ -121,7 +121,7 @@ public class FeeDetailSyncTask extends Task {
             return;
         }
         HelpService helpService = SpringUtil.getBean(HelpService.class);
-        log.info("开始同步订单信息:{}", detailId);
+
         TbFeeDetailsService tbFeeDetailsService = SpringUtil.getBean(TbFeeDetailsService.class);
         TbFeeDetails tbFeeDetails = tbFeeDetailsService.getById(detailId);
         if (tbFeeDetails == null || tbFeeDetails.getSyncStatus() == 1) {
@@ -131,6 +131,7 @@ public class FeeDetailSyncTask extends Task {
         List<SyncBillParam> list = buildParams(tbFeeDetails);
         SyncBillRequest detail = new SyncBillRequest();
         detail.setBillList(list);
+        log.info("同步订单信息:{}", JSONUtil.toJsonStr(list));
         SyncResultBO response = helpService.req("/data/sync/bill", detail);
         if (response.getCode() == 200) {
             tbFeeDetails.setSyncStatus(1);

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

@@ -367,6 +367,7 @@ public class TbBusinessController {
         if (StrUtil.isEmpty(tbBusinessCar.getCarNo())) {
             return AjaxJson.getError("请输入车牌号");
         }
+
         tbBusinessService.addBusinessCar(tbBusinessCar);
 
         return AjaxJson.getSuccess();
@@ -393,7 +394,7 @@ public class TbBusinessController {
         SoMap soMap = SoMap.getRequestSoMap();
         String id = soMap.getString("id");
        tbBusinessService.confirmJudgePass(id);
-        return AjaxJson.getSuccess();
+        return AjaxJson.getSuccess("审核通过");
     }
     /**
      * 驳回

+ 27 - 31
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -90,6 +90,7 @@ import com.pj.utils.cache.RedisUtil;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import lombok.extern.slf4j.Slf4j;
+import org.aspectj.weaver.loadtime.Aj;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
@@ -455,14 +456,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
         List<String> businessIdList = businessList.stream().map(TbBusiness::getId).collect(Collectors.toList());
         String businessIds = StrUtil.join(",", businessIdList);
+        long judgeCount = businessList.stream().filter(tbBusiness -> tbBusiness.getConfirmJudge() == CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()).count();
+        int size=businessList.size();
         result.put("showPay", true);
         result.put("businessId", businessIds);
-        result.put("noJudgeCount", 0);
-        if (CarEnum.BusinessTypeEnum.BUSINESS_CAR.getType().equals(tbBusinessCar.getBusinessType())) {
-            if (tbBusinessCar.getConfirmJudge() != CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()) {
-                result.put("noJudgeCount", 1);
-            }
-        }
+        result.put("noJudgeCount", judgeCount==size?0:1);
         List<TbBusinessItem> items = tbBusinessItemService.findByBusinessIdList(businessIdList);
         Date inTime = tbBusinessCar.getRealInTime();
         int pay = tbBusinessCar.getPay();
@@ -781,10 +779,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
             //最新一条记录
             TbBusinessCar db = tbBusinessCarService.findTheLastRecord(carNo);
-            //存在并且未离场+已审核
-            if (db != null && db.getConfirmJudge() == CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode() && db.getRealOutTime() == null) {
-                throw new BusinessException("车辆【" + carNo + "】已审核,请驳回再录入业务");
-            }
             if (!tbGoods.getName().contains("整车")) {
                 //记录不存在或者已离场
                 if (db == null || db.getRealOutTime() != null) {
@@ -839,15 +833,18 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         String id = otherBusinessBO.getId();
         TbBusiness dbBusiness = this.getById(id);
         if (dbBusiness == null) {
-            throw new BusinessException("记录不存在");
+            throw new AjaxError("记录不存在");
+        }
+        if (dbBusiness.getConfirmJudge()== CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
+            throw new AjaxError("业务已审核,请驳回后修改");
         }
         List<TbItem> tbItems = otherBusinessBO.getItems();
         if (tbItems.isEmpty()) {
-            throw new BusinessException("请选择收费明细");
+            throw new AjaxError("请选择收费明细");
         }
         List<TbBusinessCar> cars = otherBusinessBO.getCars();
         if (cars.isEmpty()) {
-            throw new BusinessException("作业车辆不能为空");
+            throw new AjaxError("作业车辆不能为空");
         }
 
         Date now = new Date();
@@ -914,16 +911,12 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             if (StrUtil.isNotEmpty(businessCarId)) {
                 //原来已存在的
                 TbBusinessCar dbBusinessCar = tbBusinessCarService.getById(businessCarId);
-                if (dbBusinessCar.getConfirmJudge() == CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()) {
-                    throw new BusinessException("车辆【" + carNo + "】已审核,请驳回再录入业务");
-                }
                 //如果修改了车牌号
                 String dbCarNo = dbBusinessCar.getCarNo();
                 if (!dbCarNo.equals(carNo)) {
                     //把关联删除掉,然后添加新的关联
                     relationBusinessCarService.removeByBusinessIdAndCarId(dbBusiness.getId(), businessCarId);
                     TbBusinessCar otherCar = tbBusinessCarService.findTheLastRecord(carNo);
-
                     if (otherCar == null ||//不存在或者已离场===>新建
                             (otherCar.getRealInTime() != null && otherCar.getRealOutTime() != null)) {
                         otherCar = new TbBusinessCar();
@@ -950,12 +943,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 }
             } else {
                 TbBusinessCar checkCar = tbBusinessCarService.findTheLastRecord(carNo);
-                //存在+审核+未离场的
-                if (checkCar != null
-                        && checkCar.getConfirmJudge() == CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()
-                        && checkCar.getRealOutTime() == null) {
-                    throw new BusinessException("车辆【" + carNo + "】已审核,请驳回再录入业务");
-                }
                 //不存在或者已经离场的
                 if (checkCar == null ||
                         (checkCar.getRealInTime() != null && checkCar.getRealOutTime() != null)) {
@@ -1006,11 +993,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
     public void bindOtherBusinessCar(String businessId, List<String> businessCarIdList) {
         TbBusiness tbBusiness = this.getById(businessId);
-        List<TbBusinessCar> list = tbBusinessCarService.findOtherBusinessCar(businessId);
-        long count = list.stream().filter(tbBusinessCar -> tbBusinessCar.getConfirmJudge() == 1).count();
-        if (count > 0) {
-            throw new AjaxError("业务已审核,请先驳回审核");
+        if (tbBusiness.getConfirmJudge()== CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
+            throw new AjaxError("业务已审核,请先驳回");
         }
+        List<TbBusinessCar> list = tbBusinessCarService.findOtherBusinessCar(businessId);
         list.stream().filter(tbBusinessCar -> !businessCarIdList.contains(tbBusinessCar.getId()) && tbBusinessCar.getRealInTime() == null)
                 .forEach(tbBusinessCar -> tbBusinessCarService.removeById(tbBusinessCar.getId()));
         relationBusinessCarService.removeByBusinessId(businessId);
@@ -1538,6 +1524,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     public void addBusinessCar(TbBusinessCar tbBusinessCar) {
         String businessId = tbBusinessCar.getBusinessId();
         TbBusiness tbBusiness = this.getById(businessId);
+        if (tbBusiness.getConfirmJudge()== CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
+            throw new AjaxError("业务已审核,不能绑定新车辆");
+        }
         String carNo = tbBusinessCar.getCarNo().trim().toUpperCase();
         TbBusinessCar lastRecord = tbBusinessCarService.findTheLastRecord(carNo);
         String businessCarId;
@@ -1556,8 +1545,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             businessCarId = tbBusinessCar.getId();
         } else {
             businessCarId = lastRecord.getId();
-            lastRecord.setPayType(CarEnum.PayTypeEnum.NO_PAY_TYPE.getType()).setCustomerId(tbBusiness.getCustomerId())
-                    .setCarNo(carNo).setConfirmJudge(CarEnum.ConfirmJudgeEnum.NO_JUDGE.getCode()).setPayUnloadMoney(0)
+            lastRecord.setPayType(CarEnum.PayTypeEnum.NO_PAY_TYPE.getType())
+                    .setCustomerId(tbBusiness.getCustomerId())
+                    .setCarNo(carNo).setConfirmJudge(CarEnum.ConfirmJudgeEnum.NO_JUDGE.getCode())
+                    .setPayUnloadMoney(lastRecord.getPayUnloadMoney())
                     .setTimeUpdate(now)
                     .setBusinessType(CarEnum.BusinessTypeEnum.BUSINESS_CAR.getType());
             tbBusinessCarService.updateById(lastRecord);
@@ -1615,11 +1606,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                         throw new AjaxError("[" + tbAccount.getCustomerName() + "]账户余额不足扣除" + item.getItemName());
                     } else {
                         tbBusinessCar.setPayUnloadMoney(1);
+                        tbBusinessCarService.updateById(tbBusinessCar);
                         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);
@@ -1654,7 +1645,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                             .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));
@@ -1664,5 +1654,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 }
             }
         }
+
+        tbBusiness.setConfirmJudgeTime(now).setConfirmJudgeContent("审核通过")
+                .setConfirmJudge(CarEnum.ConfirmJudgeEnum.JUDGE_PASS.getCode())
+                .setJudgeBy(StpUserUtil.getCreateBy()).setPayTime(now);
+        this.updateById(tbBusiness);
+
     }
 }

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

@@ -495,16 +495,6 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
                 .setConfirmJudgeContent(judgeContent).setConfirmJudgeTime(new Date())
                 .setConfirmJudgeBy(StpUserUtil.getCreateBy());
         this.updateById(db);
-        List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(id);
-        businessList.forEach(tbBusiness -> {
-            List<TbBusinessCar> tbBusinessCars = this.findOtherBusinessCar(tbBusiness.getId());
-            tbBusinessCars.stream().filter(tbBusinessCar -> !StrUtil.equals(tbBusinessCar.getId(), id)).forEach(tbBusinessCar -> {
-                tbBusinessCar.setConfirmJudge(CarEnum.ConfirmJudgeEnum.CALL_BACK.getCode())
-                        .setConfirmJudgeContent(judgeContent).setConfirmJudgeTime(new Date())
-                        .setConfirmJudgeBy(StpUserUtil.getCreateBy());
-                this.updateById(tbBusinessCar);
-            });
-        });
     }
 
     /**

+ 15 - 4
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsMapper.xml

@@ -139,23 +139,34 @@
         SELECT SUM(item_price) as item_price_sum, SUM(tax_price) as tax_price_sum, SUM(no_tax_price) as no_tax_price_sum
         FROM tb_fee_details
         <where>
+            <if test=' this.has("id") '>and id = #{id}</if>
+            <if test=' this.has("businessId") '>and business_id = #{businessId}</if>
+
+            <if test=' this.has("businessNo") '>and (business_no like concat('%',#{businessNo},'%')
+                or business_car_no like concat('%',#{businessNo},'%'))
+            </if>
             <if test=' this.has("carNo") '>and car_no like concat('%',#{carNo},'%')</if>
+            <if test=' this.has("transactionId") '>and transaction_id like concat('%',#{transactionId},'%')</if>
+            <if test=' this.has("pickCustomerName") '>and pick_customer_name like concat('%',#{pickCustomerName},'%')
+            </if>
             <if test=' this.has("feeType") '>and fee_type = #{feeType}</if>
             <if test=' this.has("itemTypeId") '>and item_type_id = #{itemTypeId}</if>
             <if test=' this.has("itemTypeName") '>and item_type_name = #{itemTypeName}</if>
             <if test=' this.has("itemId") '>and item_id = #{itemId}</if>
-            <if test=' this.has("transactionId") '>and transaction_id = #{transactionId}</if>
-            <if test=' this.has("itemName") '>and item_name = #{itemName}</if>
+            <if test=' this.has("itemName") '>and item_name like concat('%',#{itemName},'%')</if>
+            <if test=' this.has("itemPrice") '>and item_price = #{itemPrice}</if>
             <if test=' this.has("payDay") '>and pay_day = #{payDay}</if>
             <if test=' this.has("payType") '>and pay_type = #{payType}</if>
             <if test=' this.has("createTime") '>and create_time = #{createTime}</if>
-            <if test=' this.has("pickCustomerName") '>and pick_customer_name like concat('%',#{pickCustomerName},'%')
-            </if>
             <if test=' this.has("beginTime") and this.has("endTime") '>
                 and pay_day >= #{beginTime}
                 and pay_day &lt;= #{endTime}
             </if>
             <if test=' this.has("type")'>and fee_type in (${type})</if>
+            <if test=' this.has("isInvoice")'>
+                <if test=' isInvoice == 0'>and invoice is null</if>
+                <if test=' isInvoice == 1'>and invoice is not null</if>
+            </if>
         </where>
     </select>
 

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

@@ -400,7 +400,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             detailDTO.setBusinessNo(feeDetails.getBusinessNo()).setCarNo(feeDetails.getCarNo())
                     .setFeeType(tbFeeItem.getName()).setItemTypeName(feeDetails.getItemTypeName())
                     .setItemName(feeDetails.getItemName()).setItemPrice(feeDetails.getItemPrice())
-                    .setPayType(PayEnum.PayType.WX_PAY.getDesc()).setIndex(index++)
+                    .setPayType(PayEnum.PayType.getDescByCode(feeDetails.getPayType())).setIndex(index++)
                     .setPayMode(PayEnum.PayType.CASH_PAY.getDesc())
                     .setWeight(feeDetails.getWeight()).setNum(feeDetails.getNum()).setUnitPrice(feeDetails.getUnitPrice())
                     .setSettle("已结算").setTaxRate(feeDetails.getTaxRate().multiply(new BigDecimal(100)))

+ 1 - 1
sp-server/src/main/java/com/pj/utils/sg/AjaxJson.java

@@ -177,7 +177,7 @@ public class AjaxJson extends LinkedHashMap<String, Object> implements Serializa
      * 返回成功
      */
     public static AjaxJson getSuccess() {
-        return new AjaxJson(CODE_SUCCESS, "ok", null, null);
+        return new AjaxJson(CODE_SUCCESS, "操作成功", null, null);
     }
 
     public static AjaxJson getSuccess(String msg) {

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

@@ -100,7 +100,7 @@ ocr-config:
     bash: /opt/ocrpic/tesseract.sh
     analysis: /opt/ocrpic/ocrtxt/PIC_NAME.txt
 pushfee-config:
-    enable: false
+    enable: true
     remote-public-key-base6: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCb5yK85EKqwiQU+z1jyjOng6ecssQpEjC6STbCuSWN6KHLkijBxdqrCumXhbIyOVx4lHK9Rg5EjzlQxoaXQTgJdItaGjLC+UTE+NNAnnaFLg0x4jajNpLo473zdZxTYQaT3q/aKnTeXuKHw11PPUe4hmmfxPcdt9yJ0Iqo/XxV3QIDAQAB
     sync-url: http://117.141.148.233:3101/gateway/
     sys-id: "0110"