Browse Source

分开支付,首页消杀,申报

qzyReal 3 years ago
parent
commit
22e43d67fc

+ 124 - 30
app/pages/business-entering/business-entering.vue

@@ -31,7 +31,40 @@
 				</u-col>
 			</u-row>
 		</view>
-		<view class="box" v-show="!hs.visible">
+		<view class="box" v-show="china.visible">
+			<view class="top">
+				<text class="title">中国车录入</text>
+			</view>
+			<view style="display: flex;margin-top: 40rpx;">
+				<u-button type="primary" @click="china.visible=false" text="返回" style="width: 20px;" size="mini" />
+				<u-button type="primary" @click="showChinaModal" text="添加" icon="plus" style="width: 20px;"
+					size="mini" />
+			</view>
+			<u-row style="margin-top: 70rpx;">
+				<u-col span="3" style="text-align: center;">车牌号</u-col>
+				<u-col span="3" style="text-align: center;">联系人</u-col>
+				<u-col span="3" style="text-align: center;">联系号码</u-col>
+				<u-col span="3" style="text-align: center;">操作</u-col>
+			</u-row>
+			<u-row v-for="(item,index) in china.list" style="margin-top: 40rpx;">
+				<u-col span="3" style="text-align: center;">{{item.carNo}}</u-col>
+				<u-col span="3" style="text-align: center;">{{item.driverName}}</u-col>
+				<u-col span="3" style="text-align: center;">{{item.driverPhone}}</u-col>
+				<u-col span="3" style="text-align: center;">
+					<u-row>
+						<u-col span="6">
+							<u-button type="primary" text="编辑" style="width: 20px;" @click="editChinaCar(item,index)" size="mini">
+							</u-button>
+						</u-col>
+						<u-col span="6">
+							<u-button type="error" style="width: 20px;" text="删除" @click="deleteChinaCar(item,index)" size="mini">
+							</u-button>
+						</u-col>
+					</u-row>
+				</u-col>
+			</u-row>
+		</view>
+		<view class="box" v-show="!hs.visible&&!china.visible">
 			<view class="top">
 				<text class="title">业务录入</text>
 			</view>
@@ -79,36 +112,14 @@
 					</u-input>
 				</view>
 			</view>
-
-			<view class="item">
-				<view class="l"><text style="color: red;">*</text>预计入场:</view>
-				<view class="r">
-					<view class="r">
-						<uni-datetime-picker placeholder="请选择" @change="expectDayChange" :clear-icon="false"
-							:start="exprctStart" type="datetime" v-model="form.expectInDay" @close="closeFn" />
-					</view>
-				</view>
-			</view>
 			<view class="item">
-				<view class="l"><text style="color: red;">*</text>中国车牌号:</view>
+				<view class="l">中国车:</view>
 				<view class="r">
-					<u-input placeholder="中国车牌号" @input="handler()" v-model="form.chinaCarNo" />
-				</view>
-			</view>
-			<view class="item">
-				<view class="l"><text style="color: red;">*</text>中国司机:</view>
-				<view class="r">
-					<u-input placeholder="司机姓名" @input="handler()" v-model="form.driverName" />
-				</view>
-			</view>
-			<view class="item">
-				<view class="l"><text style="color: red;">*</text>联系号码:</view>
-				<view class="r">
-					<u-input placeholder="司机联系号码" @input="handler()" type="number" v-model="form.driverPhone" />
+					<u-input placeholder="中国车" v-model="chinaCarNo" readonly>
+						<text slot="suffix" style="font-size: 50rpx;" @click="addCar">+</text>
+					</u-input>
 				</view>
 			</view>
-
-			
 			<view class="item-line">
 				业务项
 			</view>
@@ -136,7 +147,7 @@
 				合计:{{totalPrice}}元
 			</view>
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn" v-show="!hs.visible"></u-button>
+		<u-button type="primary" text="确定" @click="saveFn" v-show="!hs.visible&&!china.visible"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
 		<u-popup :show="car.carInput" :overlay="false" @close="car.carInput=false" borderRadius="10">
@@ -175,6 +186,29 @@
 				</u--input>
 			</view>
 		</u-modal>
+		<u-modal :show="chinaAddModal.visible" title="中国车" @confirm="sureCarFn" @cancel="chinaAddModal.visible=false"
+			showCancelButton cancelText="关闭">
+			<view class="slot-content">
+				<u-row>
+					<u-col span="4">车牌号</u-col>
+					<u-col span="8">
+						<u--input placeholder="车牌号" v-model="chinaAddModal.form.carNo"></u--input>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">联系人</u-col>
+					<u-col span="8">
+						<u--input placeholder="联系人" v-model="chinaAddModal.form.driverName"></u--input>
+					</u-col>
+				</u-row>
+				<u-row>
+					<u-col span="4">联系号码</u-col>
+					<u-col span="8">
+						<u--input placeholder="联系号码" v-model="chinaAddModal.form.driverPhone"></u--input>
+					</u-col>
+				</u-row>
+			</view>
+		</u-modal>
 	</view>
 </template>
 
@@ -205,7 +239,6 @@
 					cardSize: '',
 					goodsName: '',
 					netWeight: '',
-					chinaCarNo: '',
 					driverName: '',
 					driverPhone: '',
 					expectInDay: ''
@@ -242,6 +275,19 @@
 						name: '',
 						phone: ''
 					}
+				},
+				china: {
+					visible: false,
+					index:-1,
+					list: []
+				},
+				chinaAddModal: {
+					visible: false,
+					form: {
+						carNo: '',
+						driverName: '',
+						driverPhone: ''
+					}
 				}
 			}
 		},
@@ -264,6 +310,9 @@
 					}
 				}
 				return price;
+			},
+			chinaCarNo(){
+				return this.china.list.map(obj=>obj.carNo).join("、");
 			}
 		},
 		created() {
@@ -274,6 +323,51 @@
 			this.getUnit();
 		},
 		methods: {
+			addCar() {
+				this.china.visible = true;
+			},
+			showChinaModal() {
+				Object.assign(this.chinaAddModal, {
+					visible: true,
+					index:-1,
+					form: {
+						carNo: '',
+						driverName: '',
+						driverPhone: ''
+					}
+				})
+			},
+			sureCarFn() {
+				let form = this.chinaAddModal.form;
+				let carNo = form.carNo;
+				let phone = form.driverPhone;
+				if (carNo && !this.$common.isCarNo(carNo)) {
+					this.$common.toast('请输入正确的车牌号')
+					return;
+				}
+				if (phone && !this.$common.isPhone(phone)) {
+					this.$common.toast('请输入正确的手机号')
+					return;
+				}
+				let list = this.china.list;
+				let index=this.chinaAddModal.index;
+				console.log(this.chinaAddModal.index)
+				if(index>-1){
+					list.splice(index, 1)
+				}
+				list.push(form)
+				this.chinaAddModal.visible = false;
+			},
+			deleteChinaCar(item,index){
+				this.china.list.splice(index,1);
+			},
+			editChinaCar(item,index){
+				Object.assign(this.chinaAddModal, {
+					visible: true,
+					index:index,
+					form: item
+				})
+			},
 			whChange(event) {
 				let index = event.detail.value; //当前picker选中的值
 				this.goods.index = index;
@@ -507,7 +601,7 @@
 					return false;
 				}
 
-				if (!this.form.chinaCarNo) {
+				if (!this.chinaCarNo) {
 					this.$common.toast('请录入中国车牌')
 					return false;
 				}

+ 7 - 7
app/pages/index/index.vue

@@ -73,13 +73,13 @@
 					url: '/pages/enterprise-reg/enterprise-reg',
 					show:uni.getStorageSync('info')?false:true
 				},
-				// {
-				// 	auth: true,
-				// 	icon: '../../static/home-icon-02.png',
-				// 	text: '业务录入',
-				// 	url: '/pages/business-entering/business-entering',
-				// 	show: uni.getStorageSync('perList').indexOf('tb-business-add')!==-1
-				// },
+				{
+					auth: true,
+					icon: '../../static/home-icon-02.png',
+					text: '业务录入',
+					url: '/pages/business-entering/business-entering',
+					show: uni.getStorageSync('perList').indexOf('tb-business-add')!==-1
+				},
 				{
 					auth: true,
 					icon: '../../static/home-icon-03.png',

+ 2 - 2
app/pages/wx/pay.vue

@@ -126,10 +126,10 @@
 						return pre + cur;
 					}, 0);
 				let itemIds = this.itemSelect;
-				let itemMoney = this.item.list.filter(obj => itemIds.indexOf(obj.id) !== -1)
+				let itemMoney =this.item.list? this.item.list.filter(obj => itemIds.indexOf(obj.id) !== -1)
 					.map(obj => obj.price).reduce(function(pre, cur) {
 						return pre + cur;
-					}, 0);
+					}, 0):0;
 				return carMoney + itemMoney;
 			}
 		},

+ 2 - 1
app/pages/wx/payOrder.vue

@@ -123,7 +123,8 @@
 			},
 			confirmFn() {
 				let p = {
-					businessId: this.wx.id,
+					b: this.wx.id,
+					c:JSON.stringify(this.form.cars.map(obj=>{return {id:obj.id,p:obj.basePartMoney}})),
 					money: this.form.totalMoney,
 					tradeType: "JSAPI",
 					openid: this.wx.openid

+ 41 - 30
sp-admin/sa-view/tb-business/tb-business-info.html

@@ -35,31 +35,35 @@
 										基础资料
 									</div>
 									<div>
-									<el-row>
-										<el-col span="12">
-											<sa-info name="客户名称" br>{{m.customerName}}</sa-info>
-											<sa-info name="业务编号" br>{{m.no}}</sa-info>
-											<sa-info name="境外车牌号" br>{{m.cardNo}}</sa-info>
-											<sa-info name="境外车规格" br>{{m.cardSize}}(米)</sa-info>
-											<sa-info name="货物" br>{{m.goodsName}}</sa-info>
-											<sa-info name="载重" br>{{m.netWeight}}(吨)</sa-info>
-											<sa-info type="enum" name="支付状态" :value="m.payStatus"
-												:jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
-										</el-col>
-										<el-col span="12">
-											<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
-											<sa-info name="录入人" br>{{m.createBy}}</sa-info>
-											<sa-info name="中国车牌" br>{{m.chinaCarNo}}</sa-info>
-											<sa-info name="预交停车费" br>{{m.partMoney+m.chinaPartMoney}}(元)</sa-info>
-											<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
-											<sa-info name="合计费用" br>{{m.totalMoney}}(元)</sa-info>
+										<el-row>
+											<el-col span="12">
+												<sa-info name="客户名称" br>{{m.customerName}}</sa-info>
+												<sa-info name="业务编号" br>{{m.no}}</sa-info>
+												<sa-info name="境外车牌号" br>{{m.cardNo}}</sa-info>
+												<sa-info name="境外车规格" br>{{m.cardSize}}(米)</sa-info>
+												<sa-info name="货物" br>{{m.goodsName}}</sa-info>
+												<sa-info name="载重" br>{{m.netWeight}}(吨)</sa-info>
+												<sa-info type="enum" name="支付状态" :value="m.payStatus"
+													:jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
+												<sa-info type="img" name="核酸报告" :value="m.nucleicReport" br></sa-info>
+												<sa-info type="img" name="消杀合格证" :value="m.disinfectReport" br></sa-info>
+											</el-col>
+											<el-col span="12">
+												<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
+												<sa-info name="录入人" br>{{m.createBy}}</sa-info>
+												<sa-info name="中国车牌" br>{{m.chinaCarNo}}</sa-info>
+												<sa-info name="预交停车费" br>{{m.partMoney+m.chinaPartMoney}}(元)</sa-info>
+												<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
+												<sa-info name="合计费用" br>{{m.totalMoney}}(元)</sa-info>
 												<sa-info name="支付时间" br>{{m.payTime}}</sa-info>
-										</el-col>
-									</el-row>
+												<sa-info type="img" name="检验检疫证" :value="m.checkReport" br></sa-info>
+												<sa-info type="img" name="出仓证明" :value="m.outReport" br></sa-info>
+											</el-col>
+										</el-row>
 									</div>
 								</el-collapse-item>
 							</el-collapse>
-							
+
 						</el-row>
 						<el-row>
 							<el-collapse value='1'>
@@ -70,25 +74,27 @@
 									<el-table :data="m.cars" style="width: 100%">
 										<sa-td name="车牌号" prop="carNo"></sa-td>
 										<sa-td name="车辆规格" prop="carSize"></sa-td>
-										<sa-td width="130" name="支付状态" prop="pay" type="enum" :jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
+										<sa-td width="130" name="支付状态" prop="pay" type="enum"
+											:jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
 										</sa-td>
-										<sa-td width="120" name="车辆状态" prop="isLock" type="enum" :jv="{1: '锁定[#ff0000]', 0: '正常[#005500]'}">
+										<sa-td width="120" name="车辆状态" prop="isLock" type="enum"
+											:jv="{1: '锁定[#ff0000]', 0: '正常[#005500]'}">
 										</sa-td>
-										<sa-td name="联系人" prop="driverName"></sa-td>
-										<sa-td name="联系号码" prop="driverPhone"></sa-td>
-										<sa-td name="入场时间" prop="realInTime" width=180></sa-td>
-										<sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
 										<el-table-column label="预交停车费">
 											<template slot-scope="s">
 												<label>{{s.row.basePartMoney}}</label>
 											</template>
 										</el-table-column>
-										<el-table-column label="实际停车费">
+										<el-table-column label="已交费用">
 											<template slot-scope="s">
 												<label v-if="s.row.money">{{s.row.money}}</label>
-												<label v-else>未计算</label>
+												<label v-else>-</label>
 											</template>
 										</el-table-column>
+										<sa-td name="联系人" prop="driverName"></sa-td>
+										<sa-td name="联系号码" prop="driverPhone"></sa-td>
+										<sa-td name="入场时间" prop="realInTime" width=180></sa-td>
+										<sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
 									</el-table>
 								</el-collapse-item>
 							</el-collapse>
@@ -104,7 +110,7 @@
 									<el-table :data="tableData" style="width: 100%">
 										<el-table-column prop="itemTypeName" label="业务分类" width="180">
 										</el-table-column>
-										<el-table-column prop="itemName" label="具体" width="180">
+										<el-table-column prop="itemName" label="具体项目" width="180">
 										</el-table-column>
 										<el-table-column prop="itemPrice" label="单价">
 										</el-table-column>
@@ -114,6 +120,11 @@
 										</el-table-column>
 										<el-table-column prop="total" label="合计">
 										</el-table-column>
+										<sa-td width="120" name="支付状态" prop="payStatus" type="enum"
+											:jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
+										</sa-td>
+										<el-table-column prop="payTime" label="支付时间">
+										</el-table-column>
 										<sa-td type="img-list" name="凭据" prop="ticket"></sa-td>
 										<el-table-column label="其他凭据">
 											<template slot-scope="s">

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

@@ -39,9 +39,9 @@
 				<!-- ------------- 检索参数 ------------- -->
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
-					<sa-item type="text" name="客户名称" v-model="p.customerName"></sa-item>
-					<sa-item type="text" name="车牌号" v-model="p.cardNo"></sa-item>
-					<sa-item type="text" name="司机名称" v-model="p.driverName"></sa-item>
+					<sa-item type="text" name="客户名称" placeholder="客户名称" v-model="p.customerName"></sa-item>
+					<sa-item type="text" name="车牌号"  placeholder="越南车牌" v-model="p.cardNo"></sa-item>
+					<sa-item type="text" name="司机名称"  placeholder="越南司机" v-model="p.driverName"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br />
 				</el-form>
@@ -59,21 +59,12 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
-					<sa-td name="客户名称" width="200" prop="customerName"></sa-td>
+					<sa-td name="客户名称" width="150" prop="customerName"></sa-td>
 					<sa-td name="业务单号" prop="no" width="160"></sa-td>
 					<sa-td name="境外车牌号" width="130" prop="cardNo"></sa-td>
 					<sa-td name="载重(吨)" prop="netWeight"></sa-td>
-					<!-- 	<sa-td name="司机名称" prop="driverName" ></sa-td>
-					<sa-td name="司机联系" width="120" prop="driverPhone" ></sa-td> -->
 					<sa-td name="总用费(元)" prop="totalMoney"></sa-td>
-					<sa-td width="130" name="支付状态" prop="payStatus" type="enum"
-						:jv="{1: '未支付[#ff0000]', 2: '已支付(未确认)[#ffaa00]', 3: '已支付(已确认)[#005500]'}"></sa-td>
-					<sa-td width="160" name="支付时间" prop="payTime"></sa-td>
-					<!-- <sa-td name="支付凭证" prop="payTicket" type="img-list"></sa-td> -->
-					<!-- 	<sa-td  name="放行状态" prop="adminConfirmPay" type="enum"
-						:jv="{0: '不可放行[#ff0000]', 1: '可放行[#005500]'}"></sa-td> -->
-					<!-- <sa-td name="入场时间" width="140" prop="realInTime"></sa-td>
-					<sa-td name="离场时间" width="140" prop="outDayTime"></sa-td> -->
+					<sa-td name="已支付用费(元)" prop="payMoney"></sa-td>
 					<sa-td width="160" name="录入时间" prop="createTime"></sa-td>
 					</sa-td>
 					<el-table-column label="操作" width="240px" fixed="right">

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-25664
+28900

+ 49 - 32
sp-server/pom.xml

@@ -125,42 +125,59 @@
 		</dependency>
 	</dependencies>
 
-
 	<!-- 构建配置 -->
-    <build>
-        <!-- 配置资源目录  -->
-    	<resources>
+	<build>
+		<!-- 配置资源目录  -->
+		<resources>
+			<resource>
+				<directory>src/main/java</directory>
+				<includes>
+					<include>**/*.xml</include>
+				</includes>
+			</resource>
 			<resource>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**/*.xml</include>
-                </includes>
+				<directory>src/main/resources</directory>
+				<includes>
+					<include>**/*.*</include>
+				</includes>
 			</resource>
-            <resource>
-                <directory>src/main/resources</directory>
-                <includes>
-                    <include>**/*.*</include>
-                </includes>
-            </resource>
 		</resources>
-        <plugins>
-            <!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <addClasspath>true</addClasspath>
-                            <classpathPrefix>lib/</classpathPrefix>
-                           	<mainClass>${java.run.main.class}</mainClass>
-                        </manifest>
-                    </archive>
-                </configuration>
-            </plugin>
-            <!-- 拷贝依赖的jar包到lib目录 -->
-        </plugins>
-    </build>
+		<plugins>
+			<!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix>lib/</classpathPrefix>
+							<mainClass>${java.run.main.class}</mainClass>
+						</manifest>
+					</archive>
+				</configuration>
+			</plugin>
+			<!-- 拷贝依赖的jar包到lib目录 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>
+								${project.build.directory}/lib
+							</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 
 
 </project>

+ 17 - 9
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -1,6 +1,7 @@
 package com.pj.api.wx.service;
 
 import cn.hutool.core.net.URLDecoder;
+import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.XmlUtil;
@@ -35,6 +36,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.nio.charset.Charset;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 @Transactional
@@ -81,7 +83,7 @@ public class WxService {
         params.put("body", "支付中心-业务订单支付");
         params.put("out_trade_no", out_trade_no);
         params.put("attach", JSONUtil.toJsonStr(atchMap));
-        String total_free = Integer.parseInt(money) * 100 + "";
+        String total_free = NumberUtil.mul(money, 100 + "").intValue() + "";
 //        String total_free = "1";
         log.info("pay free:{}", total_free);
         params.put("total_fee", total_free);
@@ -150,7 +152,7 @@ public class WxService {
         String total_fee = notifyBO.getTotalFee();
         BigDecimal money = new BigDecimal(total_fee).divide(new BigDecimal(100), 2, BigDecimal.ROUND_UP);
         log.info("wx pay notify;{}", JSONUtil.toJsonStr(notifyBO));
-        String tradeNo =notifyBO.getOutTradeNo();
+        String tradeNo = notifyBO.getOutTradeNo();
         tradeNo = StrUtil.subBefore(tradeNo, "_", true);
         String attachStr = notifyBO.getAttach();
         String transactionId = notifyBO.getTransactionId();
@@ -160,19 +162,25 @@ public class WxService {
             List<PriceBO> cars = JSONUtil.toList(attach.getC(), PriceBO.class);
             for (PriceBO bo1 : cars) {
                 TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
-                car.setPay(1).setMoney(car.getMoney().add(bo1.getP()));
+                BigDecimal price = bo1.getP();
+                car.setPay(1).setMoney(car.getMoney().add(price));
                 tbBusinessCarService.updateById(car);
+                TbBusiness business = tbBusinessService.getById(car.getBusinessId());
+                business.setPayMoney(business.getPayMoney().add(price));
+                business.setPayStatus(business.getPayMoney().add(price).equals(business.getTotalMoney()) ? 3 : 4);
+                tbBusinessService.updateById(business);
             }
             String businessId = attach.getB();
-
             if (StrUtil.isNotEmpty(businessId)) {
-                List<TbBusinessItem>items=tbBusinessItemService.findByBusinessId(businessId);
+                List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(businessId);
                 items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(now));
+                double sum = items.stream().collect(Collectors.summarizingDouble(item -> item.getItemPrice().doubleValue())).getSum();
+                BigDecimal itemPrice=new BigDecimal(sum);
                 tbBusinessItemService.updateBatchById(items);
                 TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-                tbBusiness.setPayStatus(tbBusiness.getPayMoney().add(money).equals(tbBusiness.getTotalMoney()) ? 3 : 4);
+                tbBusiness.setPayStatus(tbBusiness.getPayMoney().add(itemPrice).equals(tbBusiness.getTotalMoney()) ? 3 : 4);
                 tbBusiness.setPayTime(now).setPayType(3).setConfirmInput(1).setConfirmInputTime(now)
-                        .setPayMoney(tbBusiness.getPayMoney().add(money))
+                        .setPayMoney(tbBusiness.getPayMoney().add(itemPrice))
                         .setPayNo(transactionId);
                 tbBusinessService.updateById(tbBusiness);
                 TbPayRecord payRecord = new TbPayRecord();
@@ -218,8 +226,8 @@ public class WxService {
         params.put("jsapi_ticket", jsTicket);
         params.put("timestamp", nowTime);
         params.put("url", url);
-       String sign= SecureUtil.sha1(params.toString().substring(1, params.toString().lastIndexOf("}")).replaceAll(", ", "&"));
-        params.put("sign",sign);
+        String sign = SecureUtil.sha1(params.toString().substring(1, params.toString().lastIndexOf("}")).replaceAll(", ", "&"));
+        params.put("sign", sign);
         params.put("appId", wxConfig.getAppId());
         return params;
     }

+ 16 - 14
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -132,11 +132,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
         }
         Double carSize = t.getCardSize();
-        if (carSize > carConfig.getMaxLength()) {
+        if (carSize!=null&&carSize > carConfig.getMaxLength()) {
             return AjaxJson.getError("车辆规格不能大于" + carConfig.getMaxLength());
         }
-        double netWeight = t.getNetWeight();
-        if (netWeight > carConfig.getMaxWeight()) {
+        Double netWeight = t.getNetWeight();
+        if (netWeight != null && netWeight > carConfig.getMaxWeight()) {
             return AjaxJson.getError("车辆载重不能大于" + carConfig.getMaxWeight());
         }
         t.setCreateBy(StpUserUtil.getAdmin().getName());
@@ -197,7 +197,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 yueCar = new TbBusinessCar();
             }
         }
-
         yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
         carList.add(yueCar);
         tbBusinessCarService.saveOrUpdateBatch(carList);
@@ -423,13 +422,16 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     public Map<String, Object> getBusinessMoney(String carId, String state) {
         Map<String, Object> result = new HashMap<>();
         TbBusinessCar car = tbBusinessCarService.getById(carId);
-        String businessId=car.getBusinessId();
-        result.put("businessId",businessId);
+        String businessId = car.getBusinessId();
+        result.put("businessId", businessId);
         List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(businessId);
         Date now = new Date();
         List<Map<String, Object>> carsList = new ArrayList<>();
-        final BigDecimal[] total = {new BigDecimal("0")};
-        cars.forEach(tbBusinessCar -> {
+        BigDecimal total = new BigDecimal("0");
+        for (TbBusinessCar tbBusinessCar : cars) {
+            if (tbBusinessCar.getPay() == 1) {
+                continue;
+            }
             double partMoney = tbBusinessCar.getBasePartMoney().doubleValue();
             if (!StrUtil.equals("STATE", state)) {
                 Date inTime = tbBusinessCar.getRealInTime();
@@ -443,14 +445,14 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 }
             }
             if (partMoney > 0) {
-                total[0] = total[0].add(new BigDecimal(partMoney));
+                total = total.add(new BigDecimal(partMoney));
                 Map<String, Object> carMap = new HashMap<>();
                 carMap.put("price", partMoney);
                 carMap.put("id", tbBusinessCar.getId());
                 carMap.put("carNo", tbBusinessCar.getCarNo());
                 carsList.add(carMap);
             }
-        });
+        }
         result.put("carList", carsList);
         TbBusiness tbBusiness = this.getById(businessId);
         if (tbBusiness != null && tbBusiness.getPayStatus() == TbBusiness.PayStatus.NO_PAY.getCode()) {
@@ -458,17 +460,17 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             result.put("itemsPrice", tbBusiness.getItemPrice());
             result.put("businessId", businessId);
             List<Map<String, Object>> itemList = new ArrayList<>();
-            items.forEach(item -> {
+            for (TbBusinessItem item : items) {
                 Map<String, Object> itemMap = new HashMap<>();
                 itemMap.put("id", item.getId());
                 itemMap.put("name", item.getItemName());
                 itemMap.put("price", item.getItemPrice());
-                total[0] = total[0].add(item.getItemPrice());
+                total = total.add(item.getItemPrice());
                 itemList.add(itemMap);
-            });
+            }
             result.put("itemList", itemList);
         }
-        result.put("total", total[0]);
+        result.put("total", total);
         return result;
     }
 

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

@@ -48,8 +48,8 @@ spring:
         domain: http://192.168.3.77:8099/pro
         web-domain: https://192.168.3.77:8080
 part-config:
-    base-price: 30 #基础费用
-    extra-price: 10 #过夜额外收费
+    base-price: 0.01 #基础费用
+    extra-price: 0.01 #过夜额外收费
     night-end: 06:00:00 #夜间结束时间
     free-minutes: 30
     free-car-length: 4.2