Browse Source

部分bug修复

qzyReal 3 years ago
parent
commit
258884e56c
29 changed files with 1358 additions and 418 deletions
  1. 12 0
      app/apis/api.js
  2. 2 1
      app/manifest.json
  3. 135 22
      app/pages/business-entering/business-entering.vue
  4. 36 21
      app/pages/business-order/business-order.vue
  5. 90 60
      app/pages/customer-management/customer-management.vue
  6. 51 48
      app/pages/inout-record/inout-record.vue
  7. 1 3
      app/pages/ok/registerSuccess.vue
  8. 11 11
      sp-admin/sa-frame/menu-list.js
  9. 1 1
      sp-admin/sa-frame/sa-code.js
  10. 135 56
      sp-admin/sa-view/tb-business/tb-business-add.html
  11. 17 15
      sp-admin/sa-view/tb-business/tb-business-info.html
  12. 237 132
      sp-admin/sa-view/tb-business/tb-business-list.html
  13. 50 0
      sp-server/src/main/java/com/pj/api/bo/InOutRecordBO.java
  14. 42 2
      sp-server/src/main/java/com/pj/api/h5/ApiController.java
  15. 10 21
      sp-server/src/main/java/com/pj/api/open/service/OpenService.java
  16. 76 0
      sp-server/src/main/java/com/pj/api/service/ApiService.java
  17. 1 0
      sp-server/src/main/java/com/pj/current/config/PartConfig.java
  18. 3 1
      sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java
  19. 29 16
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java
  20. 59 1
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java
  21. 71 0
      sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeople.java
  22. 99 0
      sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleController.java
  23. 50 0
      sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleMapper.java
  24. 79 0
      sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleMapper.xml
  25. 53 0
      sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleService.java
  26. 5 5
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerService.java
  27. 1 1
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemType.java
  28. 1 0
      sp-server/src/main/resources/application-dev.yml
  29. 1 1
      sp-server/src/main/resources/application.yml

+ 12 - 0
app/apis/api.js

@@ -35,5 +35,17 @@ export default {
 	},
 	adminConfirmIn(data){
 		return ajax.postForm('/TbBusiness/adminConfirmIn',data)
+	},
+    getInOutRecord(data) {
+        return ajax.get('/api/getInOutRecord', data)
+    },
+    getCustomerList(data) {
+        return ajax.get('/api/getCustomerList', data)
+    },
+    confirmCustomer(data) {
+        return ajax.postForm('/api/confirmCustomer', data)
+    },
+	deleteHsPeople(data){
+		  return ajax.postForm('/TbBusinessPeople/deleteById', data)
 	}
 }

+ 2 - 1
app/manifest.json

@@ -71,7 +71,8 @@
     "vueVersion" : "2",
     "h5" : {
         "router" : {
-            "base" : "/"
+            "base" : "./",
+            "mode" : "history"
         }
     }
 }

+ 135 - 22
app/pages/business-entering/business-entering.vue

@@ -1,6 +1,34 @@
 <template>
 	<view>
-		<view class="box">
+		<view class="box" v-show="hs.visible">
+			<view class="top">
+				<text class="title">录入核酸人员</text>
+			</view>
+			<view style="display: flex;">
+				<u-button type="primary" @click="hs.visible=false" text="返回"  style="width: 20px;" size="mini"/>
+				<u-button type="primary" @click="showHsModal" text="添加" icon="plus" style="width: 20px;" size="mini"/>
+			</view>
+			<u-row style="margin-top: 70rpx;">
+				<u-col span="4" style="text-align: center;">姓名</u-col>
+				<u-col span="4" style="text-align: center;">联系号码</u-col>
+				<u-col span="4" style="text-align: center;">操作</u-col>
+			</u-row>
+			<u-row v-for="item in hs.list" style="margin-top: 40rpx;">
+				<u-col span="4" style="text-align: center;">{{item.name}}</u-col>
+				<u-col span="4" style="text-align: center;">{{item.phone}}</u-col>
+				<u-col span="4" style="text-align: center;">
+					<u-row>
+						<u-col span="6">
+							<u-button type="primary" text="编辑" style="width: 20px;" @click="editFn(item)" size="mini"></u-button>
+						</u-col>
+						<u-col span="6">
+							<u-button type="error" style="width: 20px;" text="删除" @click="deleteFn(item)" size="mini"></u-button>
+						</u-col>
+					</u-row>
+				</u-col>
+			</u-row>
+		</view>
+		<view class="box" v-show="!hs.visible">
 			<view class="top">
 				<text class="title">业务录入</text>
 			</view>
@@ -16,12 +44,12 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">车牌:</view>
+				<view class="l">境外车牌:</view>
 				<view class="r">
 					<u-input placeholder="输入车牌号" @input="carInputFn" v-model="form.cardNo" />
 				</view>
 			</view>
-			<view class="item">
+			<!-- 	<view class="item">
 				<view class="l">国别:</view>
 				<view class="r">
 					<picker class="p-picker" id="gj" @change="bindPickerChange($event)" :value="country.index"
@@ -30,7 +58,7 @@
 						<u-icon class="p-icon" name="arrow-down-fill" size="20"></u-icon>
 					</picker>
 				</view>
-			</view>
+			</view> -->
 			<view class="item">
 				<view class="l">规格(米):</view>
 				<view class="r">
@@ -54,13 +82,13 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">身份证:</view>
+				<view class="l">中国车牌号:</view>
 				<view class="r">
-					<u-input placeholder="司机身份证号码" @input="idCardInput" v-model="form.driverIdCard" />
+					<u-input placeholder="司机身份证号码" @input="handler()" v-model="form.chinaCarNo" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">司机姓名:</view>
+				<view class="l">中国司机:</view>
 				<view class="r">
 					<u-input placeholder="司机姓名" @input="handler()" v-model="form.driverName" />
 				</view>
@@ -76,21 +104,27 @@
 			</view>
 			<view class="item" v-for="item in itemList" :key="item.id" v-if="item.items.length>0">
 				<view class="l">{{item.name}}:</view>
-				<view class="r" @click="selectItemFn(item)">
-					<u-input placeholder="请选择" v-model="item.itemName" readonly clearable>
-						<u-icon name="close" v-if="item.itemName" slot="suffix" color="#E5E5E5;" size="5"
-							@click="item.itemName=''"></u-icon>
-					</u-input>
+				<view class="r">
+					<view @click="selectItemFn(item)">
+						<u-input placeholder="请选择" v-model="item.itemName" readonly clearable style="width: 120px;">
+							<u-icon name="close" v-if="item.itemName" slot="suffix" color="#E5E5E5;" size="5"
+								@click="item.itemName=''"></u-icon>
+						</u-input>
+					</view>
+					<u--input placeholder="数量" border="surround" v-model="item.num" type="number" style="width: 10px;"
+						v-if="item.itemName"></u--input>
 					<view style="margin-left: 20rpx;color: red;" v-if="item.itemName">
-						{{item.items.filter(obj=>obj.itemName==item.itemName)[0].price}}元
+						{{item.items.filter(obj=>obj.itemName==item.itemName)[0].price*item.num}}元
 					</view>
+					<u-icon name="plus" style="position: absolute;right: 10rpx;" v-if="item.itemName&&item.name.indexOf('核酸')!==-1"
+						@click="addHsFn(item.itemName)"></u-icon>
 				</view>
 			</view>
 			<view class="hj" v-show="totalPrice>0">
 				合计:{{totalPrice}}元
 			</view>
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn"></u-button>
+		<u-button type="primary" text="确定" @click="saveFn" v-show="!hs.visible"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
 		<u-popup :show="car.carInput" :overlay="false" @close="car.carInput=false" borderRadius="10">
@@ -118,6 +152,21 @@
 				</u-radio-group>
 			</view>
 		</u-popup>
+		<u-modal :show="modal.visible" showCancelButton closeOnClickOverlay @cancel="modal.visible=false" @confirm="addHsPeopleFn">
+			<view style="">
+				 <u--input
+				    placeholder="姓名"
+				    border="surround"
+				    v-model="modal.form.name"
+				  ></u--input>
+				  <u--input
+				  style="margin-top: 20rpx;"
+				     placeholder="联系号码"
+				     border="surround"
+				     v-model="modal.form.phone"
+				   ></u--input>
+			</view>
+		</u-modal>
 	</view>
 </template>
 
@@ -144,7 +193,7 @@
 					cardSize: '',
 					goodsName: '',
 					netWeight: '',
-					driverIdCard: '',
+					chinaCarNo: '',
 					driverName: '',
 					driverPhone: ''
 
@@ -166,6 +215,17 @@
 				goods: {
 					index: 0,
 					goodsList: []
+				},
+				hs: {
+					visible: false,
+					list: []
+				},
+				modal:{
+					visible:false,
+					form:{
+						name:'',
+						phone:''
+					}
 				}
 			}
 		},
@@ -205,6 +265,51 @@
 			}, 1000)
 		},
 		methods: {
+			addHsFn() {
+				this.hs.visible = true;
+			},
+			showHsModal(){
+				Object.assign(this.modal,{
+					visible:true,
+					form:{
+						name:'',
+						phone:'',
+						index:-1
+					}
+				});
+			},
+			addHsPeopleFn(){
+				if(!this.modal.form.name){
+					this.$common.toast('请输入名称');
+					return;
+				}
+				if(!this.modal.form.phone){
+					this.$common.toast('请输入联系号码');
+					return;
+				}
+				let dbIndex=this.modal.form.index;
+				if(dbIndex>=0){
+					this.hs.list[dbIndex].name=this.modal.form.name;
+					this.hs.list[dbIndex].phone=this.modal.form.phone;
+				}else{
+					this.modal.form.index=this.hs.list.length;
+					this.hs.list.push(this.modal.form);
+				}
+				this.modal.visible=false;
+				this.handler();
+			},
+			editFn(data){
+				Object.assign(this.modal,{
+					visible:true,
+					form:data
+				})
+			},
+			deleteFn(data){
+				this.hs.list.splice(data.index,1);
+				if(data.id){
+					this.$api.deleteHsPeople({id:data.id});
+				}
+			},
 			getGoodsList() {
 				this.$api.getGoodsList().then(resp => {
 					this.goods.goodsList = resp.data;
@@ -292,6 +397,7 @@
 				this.form.countryName = this.country.list[countryIndex];
 				this.form.goodsIndex = goodsIndex;
 				this.form.countryIndex = countryIndex;
+				this.form.peopleJson=JSON.stringify(this.hs.list);
 				let customerId = this.customerId;
 				if (customerId == '1') {
 					let customerIndex = this.customer.index;
@@ -326,9 +432,11 @@
 			},
 			rebackStore(data) {
 				this.form = data;
+				
 				this.goods.index = data.goodsIndex ? data.goodsIndex : 0;
 				this.customer.index = data.customerIndex ? data.customerIndex : 0;
 				this.country.index = data.countryIndex ? data.countryIndex : 0;
+				this.hs.list=data.peopleJson?JSON.parse(data.peopleJson):[]
 				setTimeout(() => {
 					this.car.carInput = false;
 					this.driver.show = false;
@@ -337,7 +445,7 @@
 			check() {
 				this.handler();
 				if (!this.form.cardNo) {
-					this.$common.toast('请录入车牌号')
+					this.$common.toast('请录入境外车牌号')
 					return false;
 				}
 				if (!this.form.cardSize) {
@@ -345,12 +453,12 @@
 					return false;
 				}
 
-				if (!this.form.driverIdCard) {
-					this.$common.toast('请录入司机身份证')
+				if (!this.form.chinaCarNo) {
+					this.$common.toast('请录入中国车牌')
 					return false;
 				}
 				if (!this.form.driverName) {
-					this.$common.toast('请录入司机姓名')
+					this.$common.toast('请录入中国司机')
 					return false;
 				}
 				if (!this.form.driverPhone) {
@@ -362,8 +470,8 @@
 					this.$common.toast('至少选择一项业务项')
 					return false;
 				}
-				if (this.form.countryName == '越南车' && typeList.filter(obj => obj.code == 'p01').length == 0) {
-					this.$common.toast('越南车必须选择核酸检测')
+				if (typeList.filter(obj => obj.name.indexOf('核酸')!==-1).length > 0&&this.hs.list.length==0) {
+					this.$common.toast('录入核酸检测人员')
 					return false;
 				}
 				let list = [];
@@ -392,9 +500,10 @@
 						if (resp.code == 200) {
 							uni.removeStorageSync('business_' + this.customerId);
 							this.$common.toast('录入成功');
+							this.hs.list=[];
 							setTimeout(() => {
 								this.$common.to('/pages/business-order/business-order')
-							},1000)
+							}, 1000)
 						}
 					})
 				}
@@ -424,6 +533,10 @@
 		background-color: #fff;
 	}
 
+	.hs-item {
+		text-align: center;
+	}
+
 	.item-line {
 		color: #a2a2a2;
 		padding: 5px 0 10px 29px;

+ 36 - 21
app/pages/business-order/business-order.vue

@@ -14,10 +14,16 @@
 					<image class="icon" src="../../static/home-icon-01.png"></image>
 					<text class="title">{{businessItem.customerName}}</text>
 				</view>
+				<view style="line-height: 60rpx;">
+					<view class="title">录入时间:{{businessItem.createTime}}</view>
+					<view class="title">订单号:{{businessItem.no}}</view>
+				</view>
+
 				<view class="c">
 					<view class="item car-num-item">
 						<text class="car-num">{{businessItem.cardNo}}</text>
 					</view>
+
 					<view class="item">
 						<text class="p1">车型:</text>
 						<text class="p2">{{businessItem.cardSize}}(米)</text>
@@ -39,14 +45,15 @@
 						<text class="p2">
 							<text v-if="businessItem.payStatus==1">未支付</text>
 							<text v-if="businessItem.payStatus==2">已支付未确认</text>
-							<text v-if="businessItem.payStatus==3">已确认</text>
+							<text v-if="businessItem.payStatus==3">已确认支付</text>
 						</text>
 					</view>
 				</view>
 				<view class="b">
 					<view class="btn b3" v-if="customemrId=='1'&&businessItem.payStatus<3" @click="fkFn(businessItem)">
 						确认付款</view>
-					<view class="btn b1" v-if="customemrId=='1'&&businessItem.realInTime==null" @click="rcFn(businessItem)">确认入场</view>
+					<view class="btn b1" v-if="customemrId=='1'&&businessItem.realInTime==null"
+						@click="rcFn(businessItem)">确认入场</view>
 					<view class="btn b1" v-if="businessItem.btnShow==2" @click="cc(index)">确认出场</view>
 					<view class="btn b3" v-if="businessItem.btnShow==2" @click="zd(index)">确认账单</view>
 				</view>
@@ -56,19 +63,24 @@
 		<uni-popup ref="fkpopup" type="dialog">
 			<uni-popup-dialog type="success" title="确定已付款吗?" :duration="2000" @confirm="fkconfirm"></uni-popup-dialog>
 		</uni-popup>
-		<uni-popup ref="rcpopup" type="dialog">
-			<uni-popup-dialog type="success" title="请填写入场通道" :duration="2000" @confirm="rcconfirm">
-				<view style="background-color: #fff;padding: 15px;">
+		<u-modal :show="rc.visible" title="确认入场" showCancelButton @confirm="rcconfirm">
+			<view>
+				<view style="background-color: #fff;display: block;">
 					<u-input type="text" placeholder="请输入入场通道" v-model="rc.inChannel" />
 				</view>
-			</uni-popup-dialog>
-		</uni-popup>
+				<view style="background-color: #fff;display: block;" @click="rc.showTime=true">
+					<u-input type="text" placeholder="请选择是入场时间" v-model="rc.realInTime" readonly />
+				</view>
+			</view>
+		</u-modal>
 		<uni-popup ref="ccpopup" type="dialog">
 			<uni-popup-dialog type="success" title="确定已出场吗?" :duration="2000" @confirm="ccconfirm"></uni-popup-dialog>
 		</uni-popup>
 		<uni-popup ref="zdpopup" type="dialog">
 			<uni-popup-dialog type="success" title="确认账单吗?" :duration="2000" @confirm="zdconfirm"></uni-popup-dialog>
 		</uni-popup>
+		<u-datetime-picker :show="rc.showTime"  v-model="rc.realInTime" mode="datetime">
+		</u-datetime-picker>
 	</view>
 </template>
 
@@ -78,7 +90,7 @@
 			return {
 				p: {
 					pageNo: 1,
-					pageSize: 10,
+					pageSize: 3,
 					dataCount: 0
 				},
 				customemrId: '1',
@@ -87,7 +99,10 @@
 				},
 				rc: {
 					id: '',
-					inChannel:''
+					inChannel: '',
+					showTime: false,
+					visible: false,
+					realInTime: ''
 				},
 				current: 0,
 				status: 'loadmore',
@@ -109,6 +124,7 @@
 		methods: {
 			getBusinessList() {
 				this.$api.getBusinessList(this.p).then(resp => {
+					this.status = 'loadmore';
 					this.p.pageNo = resp.pageNo;
 					this.p.pageSize = resp.pageSize;
 					this.p.dataCount = resp.dataCount;
@@ -138,11 +154,12 @@
 				})
 			},
 			rcFn(data) {
-				this.rc.id=data.id
-				this.$refs.rcpopup.open('center')
+				this.rc.id = data.id
+				this.rc.visible = true;
+				this.rc.showTime = false;
 			},
 			rcconfirm() {
-				if(!this.rc.inChannel){
+				if (!this.rc.inChannel) {
 					this.$common.toast('请填写入场通道');
 					return false;
 				}
@@ -162,20 +179,18 @@
 				this.$refs.zdpopup.open('center')
 			},
 			zdconfirm(index) {
-				console.log('账单')
 				this.$refs.zdpopup.close()
 			},
 			//------------------------------------------
 			//上拉加载更多,分页模拟数据
 			onReachBottom() {
-				if (this.page >= 3) return;
-				this.status = 'loading';
-				this.page = ++this.page;
-				setTimeout(() => {
-					this.businessItemList += 5; //接接口后把数据加上,懒得写假数据了
-					if (this.page >= 3) this.status = 'nomore';
-					else this.status = 'loading';
-				}, 2000)
+				if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
+					this.status = 'loading';
+					this.p.pageSize += 5;
+					this.getBusinessList();
+				} else {
+					this.status = 'nomore';
+				}
 			}
 		}
 	}

+ 90 - 60
app/pages/customer-management/customer-management.vue

@@ -5,7 +5,7 @@
 				<text class="title">客户管理</text>
 			</view>
 		</view>
-		<view class="t-btn">+添加客户</view>
+		<view class="t-btn" @click="addCustomer()">+添加客户</view>
 		<u-sticky offset-top="-90">
 			<u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
 		</u-sticky>
@@ -13,12 +13,12 @@
 			<view class="card" v-for="(customerItem,index) in customerItemList" :key="index">
 				<view class="t">
 					<image class="icon" src="../../static/home-icon-01.png"></image>
-					<text class="title">{{customerItem.companyName}}</text>
+					<text class="title">{{customerItem.name}}</text>
 				</view>
 				<view class="c">
 					<view class="item">
 						<text class="p1">联系人:</text>
-						<text class="p2">{{customerItem.user}}</text>
+						<text class="p2">{{customerItem.dutyPeople}}</text>
 					</view>
 					<view class="item">
 						<text class="p1">联系电话:</text>
@@ -26,22 +26,29 @@
 					</view>
 					<view class="item">
 						<text class="p1">营业执照:</text>
-						<text class="p2">{{customerItem.license}}</text>
+						<text class="p2">
+							<image class="licence" :src="customerItem.businessLicence"></image>
+						</text>
 					</view>
 					<view class="item">
 						<text class="p1">状态:</text>
-						<text class="p2">{{customerItem.state}}</text>
+						<text class="p2">
+							<text v-if="customerItem.judgeStatus==1">未审核</text>
+							<text v-if="customerItem.judgeStatus==2">审核通过</text>
+							<text v-if="customerItem.judgeStatus==3">审核不通过</text>
+						</text>
 					</view>
 				</view>
 				<view class="b">
-					<view class="btn b1" v-if="customerItem.btnShow==1" @click="sh(index)">审核</view>
+					<view class="btn b1" v-if="customerItem.btnShow==1 " @click="sh(customerItem.id)">审核</view>
 				</view>
 			</view>
 		</view>
 		<u-loadmore style="margin: 30rpx;" :status="status"/>
-		<uni-popup ref="shpopup" type="dialog">
+		<uni-popup ref="shpopup" type="center">
 		    <uni-popup-dialog type="success" title="确定审核吗?" :duration="2000" @confirm="shconfirm"></uni-popup-dialog>
 		</uni-popup>
+	
 	</view>
 </template>
 
@@ -68,80 +75,92 @@
 				],
 				customerItemList:[
 					{
-						companyName:'广西医科大一附院',
-						user:'张三',
-						phone:'18888888888',
-						license:'有',
-						state:'未审核',
-						btnShow:1
-					},
-					{
-						companyName:'广西医科大一附院',
-						user:'张三',
-						phone:'18888888888',
-						license:'有',
-						state:'审核通过',
-						btnShow:0
-					},
-					{
-						companyName:'广西医科大一附院',
-						user:'张三',
-						phone:'18888888888',
-						license:'有',
-						state:'禁用',
+						name:'',
+						dutyPeople:'',
+						phone:'',
+						businessLicence:'',
+						judgeStatus:'',
 						btnShow:0
 					},
-					{
-						companyName:'广西医科大一附院',
-						user:'张三',
-						phone:'18888888888',
-						license:'有',
-						state:'禁用',
-						btnShow:0
-					}
-				]
+				],
+				confirmCustomerId: '',
+				judgeContent: '',
 			}
 		},
 		methods: {
+			getCustomerList(){
+				this.$api.getCustomerList({
+					current: this.current,
+				}).then(resp => {
+					let customerList = resp.data;
+					//todo 还要判断当前用户是否为admin
+					for (let i in customerList) {
+						if(customerList[i].judgeStatus == 1){
+							customerList[i].btnShow = 1;
+						}
+					}
+					this.customerItemList = customerList;
+					console.log(customerList);
+				})
+			},
+			confirmCustomer(){
+				this.$api.confirmCustomer({
+					customerId: this.confirmCustomerId
+				}).then(resp =>{
+					if(resp.code == 200){
+						this.getCustomerList();
+					}
+				})
+			},
 			//点击上方切换栏,根据点击项重新加载数据
 			change(index) {
 				this.current = index;
-				if(index==0){
-					//加载全部
-				}
-				if(index==1){
-					//加载未审核
-				}
-				if(index==2){
-					//只加载审核通过
-				}
-				if(index==3){
-					//只加载禁用
-				}
+				this.getCustomerList();
+				// if(index==0){
+				// 	//加载全部
+				// }
+				// if(index==1){
+				// 	//加载未审核
+				// }
+				// if(index==2){
+				// 	//只加载审核通过
+				// }
+				// if(index==3){
+				// 	//只加载禁用
+				// }
 			},
 			//点击按钮
 			//------------------------------------------
-			sh(){
+			sh(id){
+				this.confirmCustomerId = id;
 				this.$refs.shpopup.open('center')
 			},
 			shconfirm(index) {
-				console.log('审核')
+				this.confirmCustomer();
 				this.$refs.shpopup.close()
 			},
 			
+			addCustomer() {
+				this.$common.to("/pages/enterprise-reg/enterprise-reg");
+			},
+			
 			//------------------------------------------
 			//上拉加载更多,分页模拟数据
 			onReachBottom() {
-				if(this.page >= 3) return ;
-				this.status = 'loading';
-				this.page = ++ this.page;
-				setTimeout(() => {
-					this.customerItemList += 5;//接接口后把数据加上,懒得写假数据了
-					if(this.page >= 3) this.status = 'nomore';
-					else this.status = 'loading';
-				}, 2000)
+				// if(this.page >= 3) return ;
+				// this.status = 'loading';
+				// this.page = ++ this.page;
+				// setTimeout(() => {
+				// 	this.customerItemList += 5;//接接口后把数据加上,懒得写假数据了
+				// 	if(this.page >= 3) this.status = 'nomore';
+				// 	else this.status = 'loading';
+				// }, 2000)
 			}
-		}
+		},
+		onShow() {
+			this.getCustomerList();
+		
+		},
 	}
 </script>
 
@@ -205,6 +224,10 @@
 						font-weight: bold;
 						margin-left: 20rpx;
 						flex: 7;
+						.licence{
+							width: 80%;
+							height: 100rpx;
+						}
 					}
 				}
 				.car-num-item{
@@ -261,5 +284,12 @@
 		background-color: #fff;
 		border: 1px solid #eee;
 	}
+	.popup-box {
+	    text-align: center;
+	    background-color: #fff;
+	    height: 280rpx;
+		width: 560rpx;
+	    border-radius: 10rpx;
+	  }
 	@import '@/common/common.scss'
 </style>

+ 51 - 48
app/pages/inout-record/inout-record.vue

@@ -12,39 +12,43 @@
 			<view class="card" v-for="(recordItem,index) in recordItemList" :key="index">
 				<view class="t">
 					<image class="icon" src="../../static/home-icon-01.png"></image>
-					<text class="title">{{recordItem.companyName}}</text>
+					<text class="title">{{recordItem.customerName}}</text>
 				</view>
 				<view class="c">
 					<view class="item car-num-item">
-						<text class="car-num">{{recordItem.carNum}}</text>
+						<text class="car-num">{{recordItem.cardNo}}</text>
 					</view>
 					<view class="item">
 						<text class="p1">联系人:</text>
-						<text class="p2">{{recordItem.user}}</text>
+						<text class="p2">{{recordItem.dutyPeople}}</text>
 					</view>
 					<view class="item">
 						<text class="p1">联系电话:</text>
-						<text class="p2">{{recordItem.phone}}</text>
+						<text class="p2">{{recordItem.customerContact}}</text>
 					</view>
-					<view class="item">
+					<view class="item" v-if="recordItem.realInTime != null">
 						<text class="p1">入场时间:</text>
-						<text class="p2">{{recordItem.intime}}</text>
+						<text class="p2">{{recordItem.realInTime}}</text>
 					</view>
-					<view class="item">
+					<view class="item" v-if="recordItem.outDayTime != null">
 						<text class="p1">出场时间:</text>
-						<text class="p2">{{recordItem.outtime}}</text>
+						<text class="p2">{{recordItem.outDayTime}}</text>
 					</view>
 					<view class="item">
 						<text class="p1">状态:</text>
-						<text class="p2">{{recordItem.state}}</text>
+						<text class="p2">
+							<text v-if="recordItem.status==1">未进场</text>
+							<text v-if="recordItem.status==2">已进场</text>
+							<text v-if="recordItem.status==3">已出场</text>
+						</text>
 					</view>
 				</view>
 			</view>
 		</view>
 		<u-loadmore style="margin: 30rpx;" :status="status"/>
-		<uni-popup ref="shpopup" type="dialog">
+		<!-- <uni-popup ref="shpopup" type="dialog">
 		    <uni-popup-dialog type="success" title="确定审核吗?" :duration="2000" @confirm="shconfirm"></uni-popup-dialog>
-		</uni-popup>
+		</uni-popup> -->
 	</view>
 </template>
 
@@ -71,65 +75,64 @@
 				],
 				recordItemList:[
 					{
-						companyName:'广西医科大一附院',
-						carNum:'桂A.B5W61',
-						user:'张三',
-						phone:'18888888888',
-						intime:'2022-01-17 19:02.01',
-						outtime:'022-01-17 23:22.41',
-						state:'未入场'
-					},
-					{
-						companyName:'广西医科大一附院',
-						carNum:'桂A.B5W61',
-						user:'张三',
-						phone:'18888888888',
-						intime:'2022-01-17 19:02.01',
-						outtime:'022-01-17 23:22.41',
-						state:'已入场'
+						customerName:'',
+						cardNo:'',
+						dutyPeople:'',
+						customerContact:'',
+						realInTime:'',
+						outDayTime:'',
+						status:''
 					},
-					{
-						companyName:'广西医科大一附院',
-						carNum:'桂A.B5W61',
-						user:'张三',
-						phone:'18888888888',
-						intime:'2022-01-17 19:02.01',
-						outtime:'022-01-17 23:22.41',
-						state:'已出场'
-					}
-				]
+				],
+				//recordList: [],
 			}
 		},
 		methods: {
+			getRecordList() {
+				this.$api.getInOutRecord({
+					current: this.current,
+				}).then(resp => {
+					let recordList = resp.data;
+					this.recordItemList = recordList;
+				})
+			},
 			//点击上方切换栏,根据点击项重新加载数据
 			change(index) {
 				this.current = index;
 				if(index==0){
 					//加载全部
+					this.getRecordList();
 				}
 				if(index==1){
 					//加载未入场
+					this.getRecordList();
 				}
 				if(index==2){
 					//只加载已入场
+					this.getRecordList();
 				}
 				if(index==3){
 					//只加载已出场
+					this.getRecordList();
 				}
 			},
 			//------------------------------------------
 			//上拉加载更多,分页模拟数据
-			onReachBottom() {
-				if(this.page >= 3) return ;
-				this.status = 'loading';
-				this.page = ++ this.page;
-				setTimeout(() => {
-					this.recordItemList += 5;//接接口后把数据加上,懒得写假数据了
-					if(this.page >= 3) this.status = 'nomore';
-					else this.status = 'loading';
-				}, 2000)
-			}
-		}
+			// onReachBottom() {
+			// 	if(this.page >= 3) return ;
+			// 	this.status = 'loading';
+			// 	this.page = ++ this.page;
+			// 	setTimeout(() => {
+			// 		this.recordItemList += 5;//接接口后把数据加上,懒得写假数据了
+			// 		if(this.page >= 3) this.status = 'nomore';
+			// 		else this.status = 'loading';
+			// 	}, 2000)
+			// }
+		},
+		onShow() {
+			this.getRecordList();
+		
+		},
 	}
 </script>
 

+ 1 - 3
app/pages/ok/registerSuccess.vue

@@ -3,9 +3,7 @@
 		<u-icon name="checkmark-circle-fill" color="#07c160" size="200"></u-icon>
 		<text class="text">您的信息已提交,请等待审核!</text>
 		<view class="count-down-box">
-			<u-count-down :timestamp="timestamp" :show-days="false" :show-hours="false" :show-minutes="false"
-				@end="goback"></u-count-down>
-			<text>秒后自动返回登录页</text>
+			<text @click="goback">返回</text>
 		</view>
 	</view>
 </template>

+ 11 - 11
sp-admin/sa-frame/menu-list.js

@@ -23,20 +23,20 @@ var menuList =	[
 		info: '客户管理表数据的维护',
 		childList: [
 			{id: 'tb-costomer-list', name: '客户列表', url: 'sa-view/tb-costomer/tb-costomer-list.html'},
-			{id: 'tb-costomer-judge', name: '客户审核', url: 'sa-view/tb-costomer/tb-costomer-judge.html'},
+			// {id: 'tb-costomer-judge', name: '客户审核', url: 'sa-view/tb-costomer/tb-costomer-judge.html'},
 			{id: 'tb-costomer-maintain', name: '信息维护', url: 'sa-view/tb-costomer/tb-costomer-maintain.html'},
 		]
 	},
-	{
-		id: 'tb-goods',
-		name: '商品管理',
-		icon: 'el-icon-folder-opened',
-		info: '商品管理表数据的维护',
-		childList: [
-			{id: 'tb-goods-list', name: '商品管理-列表', url: 'sa-view/tb-goods/tb-goods-list.html'},
-			{id: 'tb-goods-add', name: '商品管理-添加', url: 'sa-view/tb-goods/tb-goods-add.html'},
-		]
-	},
+	// {
+	// 	id: 'tb-goods',
+	// 	name: '商品管理',
+	// 	icon: 'el-icon-folder-opened',
+	// 	info: '商品管理表数据的维护',
+	// 	childList: [
+	// 		{id: 'tb-goods-list', name: '商品管理-列表', url: 'sa-view/tb-goods/tb-goods-list.html'},
+	// 		{id: 'tb-goods-add', name: '商品管理-添加', url: 'sa-view/tb-goods/tb-goods-add.html'},
+	// 	]
+	// },
 	{
 		id: 'tb-business',
 		name: '业务录入',

+ 1 - 1
sp-admin/sa-frame/sa-code.js

@@ -21,7 +21,7 @@ sa.ajax('/AccAdmin/fristOpenAdmin', function(res) {
 	// }	
 	
 	// 配置 
-	sa_admin.title = "sa-plus 后台";
+	sa_admin.title = "场站管理后台";
 	sa_admin.logo = 'sa-frame/admin-logo.png';    // 设置logo图标地址 
 	sa_admin.icon = "sa-frame/admin-logo.png";    // 设置logo图标地址 
 	

+ 135 - 56
sp-admin/sa-view/tb-business/tb-business-add.html

@@ -99,6 +99,7 @@
 										</div>
 										<sa-item type="text" name="中国司机" v-model="m.driverName" br></sa-item>
 										<sa-item type="text" name="联系号码" v-model="m.driverPhone" br></sa-item>
+										<sa-item type="datetime" name="预计入场" v-model="m.expectInDay" br></sa-item>
 									</div>
 								</el-card>
 							</el-col>
@@ -124,6 +125,8 @@
 													style="margin-left: 5px;cursor: pointer">(<i
 														class="el-icon-delete"></i>)</label>
 											</div>
+											<el-button v-if="type.code=='p09'&&type.itemId"
+												@click="addPeopleFn(type.itemId)">操作</el-button>
 										</el-form-item>
 										<div class="hj" v-if="totalPrice>0">
 											合计费用:{{totalPrice}}<label>元</label>
@@ -132,57 +135,55 @@
 								</el-card>
 							</el-col>
 						</el-row>
-						<el-card class="box-card" v-if="false">
-							<div slot="header">
-								<span>人员核酸检测</span>
-								<el-button style="float: right;" icon="el-icon-plus" type="primary"
-									@click="modal.visible=true">添加</el-button>
-							</div>
-							<el-table :data="tableData" style="width: 100%">
-								<el-table-column prop="name" label="姓名" width="180">
-								</el-table-column>
-								<el-table-column prop="phone" label="联系号码" width="180">
-								</el-table-column>
-								<el-table-column prop="type" label="类型">
-								</el-table-column>
-								<sa-td type="img-list" name="核酸报告" prop="ticket"></sa-td>
-								<el-table-column label="操作">
-									<template slot-scope="s">
-										<el-button class="c-btn" type="primary" @click="uploadFn(s.row)">上传</el-button>
-										<el-button class="c-btn" type="info" @click="editFn(s.row)">修改</el-button>
-										<el-button class="c-btn" type="danger" @click="deleteFn(s.row)">删除</el-button>
-									</template>
-								</el-table-column>
-							</el-table>
-						</el-card>
+
 					</el-form>
 				</div>
-				<el-dialog title="人员核酸检测" :visible.sync="modal.visible" width="30%">
-					<span>
-						<el-form label-position="left">
-							<sa-item type="text" name="姓名" v-model="modal.form.name" br></sa-item>
-							<sa-item type="text" name="联系号码" v-model="modal.form.phone" br></sa-item>
-							<div class="c-item">
-								<label class="c-label">类型:</label>
-								<el-select v-model="modal.form.type" placeholder="请选择" filterable>
-									<el-option v-for="item in typeList" :key="item.name" :label="item.name"
-										:value="item.name">
-									</el-option>
-								</el-select>
-							</div>
-						</el-form>
-					</span>
-					<span slot="footer" class="dialog-footer">
-						<el-button @click="modal.visible = false">取 消</el-button>
-						<el-button type="primary" @click="confirmAdd">确 定</el-button>
-					</span>
-				</el-dialog>
+
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
 				<el-button type="primary" @click="ok()">确定</el-button>
 				<el-button @click="sa.closeCurrIframe()">取消</el-button>
 			</div>
+			<el-dialog title="人员核酸检测" :visible.sync="modal.visible" width="80%">
+				<el-card class="box-card">
+					<div slot="header">
+						<span>列表</span>
+						<el-button style="float: right;" icon="el-icon-plus" type="primary" @click="showAddModal">添加
+						</el-button>
+					</div>
+					<el-table :data="modal.list">
+						<el-table-column prop="name" label="姓名">
+						</el-table-column>
+						<el-table-column prop="phone" label="联系号码">
+						</el-table-column>
+						<!-- <sa-td type="img-list" name="核酸报告" prop="ticket"></sa-td> -->
+						<el-table-column label="操作">
+							<template slot-scope="s">
+								<!-- <el-button class="c-btn" type="primary" @click="uploadFn(s.row)">上传</el-button> -->
+								<el-button class="c-btn" type="info" @click="editFn(s.row)">修改</el-button>
+								<el-button class="c-btn" type="danger" @click="deleteFn(s.row)">删除</el-button>
+							</template>
+						</el-table-column>
+					</el-table>
+				</el-card>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="cancelAdd">取 消</el-button>
+					<el-button type="primary" @click="modal.visible=false">确 定</el-button>
+				</span>
+			</el-dialog>
+			<el-dialog title="人员核酸检测" :visible.sync="addModal.visible" width="400">
+				<span>
+					<el-form label-position="left">
+						<sa-item type="text" name="姓名" v-model="addModal.form.name" br></sa-item>
+						<sa-item type="text" name="联系号码" v-model="addModal.form.phone" br></sa-item>
+					</el-form>
+				</span>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="addModal.visible = false">取 消</el-button>
+					<el-button type="primary" @click="confirmAdd">确 定</el-button>
+				</span>
+			</el-dialog>
 		</div>
 		<script>
 			var app = new Vue({
@@ -203,7 +204,8 @@
 						cardSize: '', // 车规格 
 						netWeight: '', // 载重(kg) 
 						goodsName: '', // 商品 
-						chinaCarNo:'',
+						chinaCarNo: '',
+						expectInDay: '',
 						driverName: '', // 司机名称 
 						driverPhone: '', // 司机联系号码 
 						driverIdCard: '', // 司机身份证 
@@ -223,17 +225,18 @@
 					tableData: [],
 					modal: {
 						visible: false,
+						itemId: 4,
+						list: []
+					},
+					addModal: {
+						visible: false,
 						form: {
 							name: '',
 							phone: '',
-							type: '单人'
+							itemId: 4,
+							ticket: ''
 						}
-					},
-					typeList: [{
-						name: '单人'
-					}, {
-						name: '集体'
-					}]
+					}
 				},
 				computed: {
 					totalPrice() {
@@ -255,14 +258,80 @@
 					}
 				},
 				methods: {
+					addPeopleFn(itemId) {
+						sa.ajax('/TbBusinessPeople/getList', {
+							businessId: this.m.id?this.m.id:-1
+						}, function(resp) {
+							let list = resp.data;
+							let index = 0;
+							let r = [];
+							for (let i in list) {
+								r.push({
+									name: list[i].name,
+									phone: list[i].phone,
+									index: index,
+									id: list[i].id
+								})
+								index++;
+							}
+							this.modal.list = r;
+							this.modal.itemId = itemId;
+							this.modal.visible = true;
+						}.bind(this));
+					},
+					showAddModal() {
+						Object.assign(this.addModal, {
+							visible: true,
+							form: {
+								index: -1,
+								name: '',
+								phone: '',
+								itemId: this.modal.itemId,
+								ticket: ''
+							}
+						})
+					},
+					cancelAdd() {
+						this.modal.list = [];
+						this.modal.visible = false;
+					},
 					confirmAdd() {
-						if (!this.modal.form.name) {
+						if (!this.addModal.form.name) {
 							sa.error('请输入检测人姓名')
 							return false;
 						}
+						if (!this.addModal.form.phone) {
+							sa.error('请输入检测人联系号码')
+							return false;
+						}
+						let dbIndex = this.addModal.form.index;
+						if (dbIndex >= 0) {
+							this.modal.list[dbIndex].name = this.addModal.form.name;
+							this.modal.list[dbIndex].phone = this.addModal.form.phone;
+						} else {
+							this.addModal.form.index = this.modal.list.length;
+							this.modal.list.push(this.addModal.form);
+						}
+						this.addModal.visible = false;
+					},
+					editFn(data) {
+						Object.assign(this.addModal, {
+							visible: true,
+							form: data
+						})
+					},
+					deleteFn(data) {
+						this.modal.list.splice(data.index, 1);
+						if (data.id) {
+							sa.ajax('/TbBusinessPeople/deleteById', {
+								id: data.id
+							}, function(resp) {
+
+							}.bind(this))
+						}
 					},
-					handleSelectChinaCar(){
-						
+					handleSelectChinaCar() {
+
 					},
 					getGoods() {
 						sa.ajax('/TbGoods/getList', {
@@ -339,7 +408,7 @@
 						sa.ajax('/TbCostomer/getList', {
 							pageNo: 1,
 							pageSize: 100,
-							judgeStatus:2
+							judgeStatus: 2
 						}, function(resp) {
 							this.customerList = resp.data;
 							if (resp.data.length > 0) {
@@ -362,6 +431,10 @@
 					ok: function() {
 						let itemList = this.itemTypeList.filter(obj => obj.itemId);
 						let list = [];
+						if (itemList.length == 0) {
+							sa.error('至少选择一项业务');
+							return false;
+						}
 						for (let i in itemList) {
 							let item = itemList[i];
 							if (!item.num || item.num <= 0) {
@@ -376,9 +449,15 @@
 								num: item.num
 							})
 						}
+						if (itemList.filter(obj => obj.itemId == 4 || obj.itemId == 9).length > 0 && this.modal.list
+							.length == 0) {
+							sa.error('请添加核酸检测人员');
+							return false;
+						}
 						// 表单校验 
 						let m = this.m;
 						m.itemJson = JSON.stringify(list);
+						m.peopleJson = JSON.stringify(this.modal.list);
 						m.items = [];
 						if (this.currentCustomerId == 1) {
 							sa.checkNull(m.customerId, '请选择 [客户名称]');
@@ -402,6 +481,7 @@
 					},
 					// 添加/修改 完成后的动作
 					clean: function() {
+						this.modal.list = [];
 						if (this.id == 0) {
 							this.m = this.createModel();
 						} else {
@@ -411,7 +491,6 @@
 					}
 				},
 				mounted: function() {
-
 					this.getCustomer();
 					this.getCardList();
 					this.getDriverList();

+ 17 - 15
sp-admin/sa-view/tb-business/tb-business-info.html

@@ -29,27 +29,29 @@
 							<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="载重(kg)" br>{{m.netWeight}}</sa-info>
-								<sa-info name="货物" br>{{m.goodsName}}</sa-info>
-								<sa-info name="司机名称" br>{{m.driverName}}</sa-info>
-								<sa-info name="司机联系号码" br>{{m.driverPhone}}</sa-info>
-								<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
-								<sa-info name="录入人" br>{{m.createBy}}</sa-info>
-								<sa-info name="确认时间" br>{{m.confirmInputTime}}</sa-info>
-								<sa-info name="确认人" br>{{m.confirmInputBy}}</sa-info>
-							</el-col>
-							<el-col span="12">
+								<sa-info name="境外车牌号" br>{{m.cardNo}}</sa-info>
+								<sa-info name="境外车规格" br>{{m.cardSize}}(米)</sa-info>
 								<sa-info name="入场时间" br>
 									<label v-if="m.realInTime">{{m.realInTime}}</label>
 									<label v-else>未入场</label>
-									</sa-info>
+								</sa-info>
 								<sa-info name="出场时间" br>{{m.outDayTime}}</sa-info>
-								<sa-info name="停车时常(分)" br>{{m.partTime}}</sa-info>
-								<sa-info name="停车费用(元)" br>{{m.partMoney}}</sa-info>
+								<sa-info name="停车时常" br>{{m.partTime}}(分)</sa-info>
+								<sa-info name="停车费用" br>{{m.partMoney}}(元)</sa-info>
+								<sa-info name="载重" br>{{m.netWeight}}(吨)</sa-info>
+								<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
+								<sa-info name="录入人" br>{{m.createBy}}</sa-info>
+								
+							</el-col>
+							<el-col span="12">
+								<sa-info name="货物" br>{{m.goodsName}}</sa-info>
+								<sa-info name="中国车牌" br>{{m.chinaCarNo}}</sa-info>
+								<sa-info name="中国司机" br>{{m.driverName}}</sa-info>
+								<sa-info name="联系号码" br>{{m.driverPhone}}</sa-info>
 								<sa-info name="业务费用(元)" br>{{m.itemPrice}}</sa-info>
 								<sa-info name="合计费用(元)" br>{{m.totalMoney}}</sa-info>
+								<sa-info name="确认时间" br>{{m.confirmInputTime}}</sa-info>
+								<sa-info name="确认人" br>{{m.confirmInputBy}}</sa-info>
 								<sa-info type="enum" name="支付状态" :value="m.payStatus" :jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
 								<sa-info name="支付人" br>{{m.payBy}}</sa-info>
 								<sa-info name="支付时间" br>{{m.payTime}}</sa-info>

+ 237 - 132
sp-admin/sa-view/tb-business/tb-business-list.html

@@ -3,7 +3,8 @@
 	<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" />
+		<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">
@@ -29,189 +30,290 @@
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
 				<div class="fast-btn">
-					<el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-add')!=-1"  @click="add()">新增</el-button>
-					<el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-confirm')!=-1"  @click="confirmBatch()">确认</el-button>
-					<el-button size="mini" type="success"  @click="getBySelect()">查看</el-button>
-					<el-button size="mini" type="danger"  @click="deleteByIds()">删除</el-button>
+					<el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-add')!=-1" @click="add()">
+						新增</el-button>
+					<el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-confirm')!=-1"
+						@click="confirmBatch()">确认</el-button>
+					<el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
+					<el-button size="mini" type="danger" @click="deleteByIds()">删除</el-button>
 					<!-- <el-button size="mini" type="warning" icon="el-icon-download" @click="sa.exportExcel()">导出</el-button> -->
-					<el-button size="mini" type="info"    @click="sa.f5()">重置</el-button>
+					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
 				</div>
 				<!-- ------------- 数据列表 ------------- -->
-				<el-table class="data-table" ref="data-table" :data="dataList" >
+				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
-					<sa-td name="客户名称" prop="customerName" ></sa-td>
-					<sa-td name="境外车牌号" prop="cardNo" ></sa-td>
-					<sa-td name="载重(吨)" prop="netWeight" ></sa-td>
-			<!-- 	<sa-td name="司机名称" prop="driverName" ></sa-td>
+					<sa-td name="客户名称" 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="payTicket" type="img-list"></sa-td>
-					<sa-td name="业务费(元)" prop="itemPrice" ></sa-td>
-					<sa-td width="120" name="停车时长(分)" prop="partTime" ></sa-td>
-					<sa-td name="停车费用" prop="partMoney" ></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 width="160" name="录入时间" prop="createTime" ></sa-td>
-					<sa-td  name="确认" prop="confirmInput" type="enum" :jv="{0: '未确认[#ff0000]', 1: '已确认[#005500]'}"></sa-td>
-					<el-table-column label="操作"  width="240px" fixed="right">
+					<sa-td name="业务费(元)" prop="itemPrice"></sa-td>
+					<sa-td name="入场时间" width="140" prop="realInTime"></sa-td>
+					<sa-td name="离场时间"  width="140" prop="outDayTime"></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 width="160" name="录入时间" prop="createTime"></sa-td>
+					<sa-td name="账单确认" prop="confirmInput" type="enum" :jv="{0: '未确认[#ff0000]', 1: '已确认[#005500]'}">
+					</sa-td>
+					<el-table-column label="操作" width="240px" fixed="right">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0&&perCode.indexOf('tb-business-confirm')!=-1"  @click="confirmFn(s.row)">确认</el-button>
-							<el-button class="c-btn" type="success" v-if="s.row.confirmInput==1&&perCode.indexOf('tb-business-pay')!=-1&&s.row.payStatus==1" @click="payFn(s.row)">支付</el-button>
-									<el-button class="c-btn" type="success" v-if="adminId=='1'&&s.row.payStatus==2" @click="adminSurePayFn(s.row)">确认支付</el-button>
-							<el-button class="c-btn" type="success"  @click="get(s.row)">查看</el-button>
-							<!-- <el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0&&perCode.indexOf('tb-business-add')!=-1"   @click="update(s.row)">修改</el-button> -->
-							<el-button class="c-btn" type="danger"  v-if="s.row.payStatus==1&&perCode.indexOf('tb-business-add')!=-1" @click="del(s.row)">删除</el-button>
+							<el-button class="c-btn" type="success"
+								v-if="perCode.indexOf('tb-business-pay')!=-1&&s.row.payStatus==1" @click="payFn(s.row)">
+								支付</el-button>
+							<el-button class="c-btn" type="primary"
+								v-if="s.row.confirmInput==0&&perCode.indexOf('tb-business-confirm')!=-1&&currentCustomerId!='1'"
+								@click="confirmFn(s.row)">确认账单</el-button>
+							<el-button class="c-btn" type="primary"
+								v-if="currentCustomerId=='1'&&s.row.realInTime==null" @click="inFn(s.row)">确认入场
+							</el-button>
+							<el-button class="c-btn" type="primary"
+								v-if="currentCustomerId=='1'&&s.row.outDayTime==null" @click="outFn(s.row)">确认离场
+							</el-button>
+							<el-button class="c-btn" type="success" v-if="adminId=='1'&&s.row.payStatus<3"
+								@click="adminSurePayFn(s.row)">确认支付</el-button>
+							<el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
+							<el-button class="c-btn" type="primary" v-if="currentCustomerId=='1'"
+								@click="update(s.row)">修改</el-button>
+							<el-button class="c-btn" type="danger"
+								v-if="s.row.payStatus==1&&perCode.indexOf('tb-business-add')!=-1" @click="del(s.row)">删除
+							</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
 				<!-- ------------- 分页 ------------- -->
-				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
 			</div>
-			<el-dialog
-			  title="支付业务"
-			  :visible.sync="modal.visible"
-			  width="400px">
-			  <sa-item type="img-list" name="支付凭据" v-model="modal.form.payTicket" br></sa-item>
-			  <span slot="footer" class="dialog-footer">
-			    <el-button @click="modal.visible=false">取 消</el-button>
-			    <el-button type="primary" @click="surePayFn">确 定</el-button>
-			  </span>
+			<el-dialog title="支付业务" :visible.sync="modal.visible" width="400px">
+				<sa-item type="img-list" name="支付凭据" v-model="modal.form.payTicket" br></sa-item>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="modal.visible=false">取 消</el-button>
+					<el-button type="primary" @click="surePayFn">确 定</el-button>
+				</span>
 			</el-dialog>
-			<el-dialog
-			  title="业务确认"
-			  :visible.sync="confirm.visible"
-			  width="30%">
-			  <span>是否确认所选业务?</span>
-			  <span slot="footer" class="dialog-footer">
-			    <el-button @click="confirm.visible = false">取 消</el-button>
-			    <el-button type="primary" @click="sureConfirmFn">确 认</el-button>
-			  </span>
+			<el-dialog title="确认账单" :visible.sync="confirm.visible" width="30%">
+				<span>是否确认所选业务?</span>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="confirm.visible = false">取 消</el-button>
+					<el-button type="primary" @click="sureConfirmFn">确 认</el-button>
+				</span>
 			</el-dialog>
-			<el-dialog
-			  title="支付确认"
-			  :visible.sync="pay.visible"
-			  width="30%">
-			  <span>是否确认所选业务的支付?</span>
-			  <span slot="footer" class="dialog-footer">
-			    <el-button @click="pay.visible = false">取 消</el-button>
-			    <el-button type="primary" @click="surePayirmFn">确 认</el-button>
-			  </span>
+			<el-dialog title="支付确认" :visible.sync="pay.visible" width="30%">
+				<span>是否确认所选业务的支付?</span>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="pay.visible = false">取 消</el-button>
+					<el-button type="primary" @click="surePayirmFn">确 认</el-button>
+				</span>
+			</el-dialog>
+			<el-dialog title="确认入场" :visible.sync="rc.visible" width="30%">
+				<el-form label-position="left">
+					<sa-item type="text" name="入场通道" v-model="rc.form.inChannel" br></sa-item>
+					<sa-item type="datetime" name="入场时间" v-model="rc.form.realInTime" br></sa-item>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="rc.visible = false">取 消</el-button>
+					<el-button type="primary" @click="sureRcFn">确 认</el-button>
+				</span>
+			</el-dialog>
+			<el-dialog title="确认离场" :visible.sync="out.visible" width="30%">
+				<el-form label-position="left">
+					<sa-item type="text" name="离场通道" v-model="out.form.outChannel" br></sa-item>
+					<sa-item type="datetime" name="离场时间" v-model="out.form.outDayTime" br></sa-item>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="out.visible = false">取 消</el-button>
+					<el-button type="primary" @click="sureOutFn">确 认</el-button>
+				</span>
 			</el-dialog>
 		</div>
 		<script>
 			var app = new Vue({
 				components: {
-					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),  
-					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),		
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
 				},
 				el: '.vue-box',
 				data: {
-					confirm:{
-						visible:false,
-						form:{
-							ids:''
+					currentCustomerId: '1',
+					confirm: {
+						visible: false,
+						form: {
+							ids: ''
 						}
 					},
-					pay:{
-						visible:false,
-						form:{
-							ids:''
+					pay: {
+						visible: false,
+						form: {
+							ids: ''
 						}
 					},
-					modal:{
-						visible:false,
-						form:{
-							id:'',
-							payTicket:''
+					modal: {
+						visible: false,
+						form: {
+							id: '',
+							payTicket: ''
 						}
 					},
 					p: { // 查询参数  
-						id: '',		// 主键 
-						customerId: '',		// 客户id 
-						customerName: '',		// 客户名称 
-						no: '',		// 编号 
-						cardNo: '',		// 车牌号 
-						cardSize: '',		// 车规格 
-						netWeight: '',		// 载重(kg) 
-						goodsName: '',		// 商品 
-						goodsCode: '',		// 商品编号 
-						driverName: '',		// 司机名称 
-						driverId: '',		// 司机id 
-						driverPhone: '',		// 司机联系号码 
-						driverIdCard: '',		// 司机身份证 
-						expectInDay: '',		// 预计进边境日期 
-						realInDay: '',		// 实际进边境日期 
-						realInTime: '',		// 实际进境时间 
-						payStatus: '',		// 支付状态(1=未支付,2=已支付) 
-						payTime: '',		// 支付时间 
-						payType: '',		// 支付方式(1=线下支付,2现金支付,3=第三方支付) 
-						outDayTime: '',		// 离境时间 
-						partMoney: '',		// 停车费用 
-						partTime: '',		// 停车时常(分) 
-						pageNo: 1,		// 当前页 
-						pageSize: 10,	// 页大小 
-						sortType: 0		// 排序方式 
+						id: '', // 主键 
+						customerId: '', // 客户id 
+						customerName: '', // 客户名称 
+						no: '', // 编号 
+						cardNo: '', // 车牌号 
+						cardSize: '', // 车规格 
+						netWeight: '', // 载重(kg) 
+						goodsName: '', // 商品 
+						goodsCode: '', // 商品编号 
+						driverName: '', // 司机名称 
+						driverId: '', // 司机id 
+						driverPhone: '', // 司机联系号码 
+						driverIdCard: '', // 司机身份证 
+						expectInDay: '', // 预计进边境日期 
+						realInDay: '', // 实际进边境日期 
+						realInTime: '', // 实际进境时间 
+						payStatus: '', // 支付状态(1=未支付,2=已支付) 
+						payTime: '', // 支付时间 
+						payType: '', // 支付方式(1=线下支付,2现金支付,3=第三方支付) 
+						outDayTime: '', // 离境时间 
+						partMoney: '', // 停车费用 
+						partTime: '', // 停车时常(分) 
+						pageNo: 1, // 当前页 
+						pageSize: 10, // 页大小 
+						sortType: 0 // 排序方式 
 					},
 					dataCount: 0,
 					dataList: [], // 数据集合 
-					perCode:[],
-					adminId:'0'
+					perCode: [],
+					adminId: '0',
+					rc: {
+						visible: false,
+						form: {
+							inChannel: '',
+							realInTime: ''
+						}
+					},
+					out: {
+						visible: false,
+						form: {
+							outChannel: '',
+							realInTime: ''
+						}
+					}
 				},
 				methods: {
-					adminSurePayFn(data){
-						Object.assign(this.pay,{
-							visible:true,
-							form:{
-								ids:data.id
+					inFn(data) {
+						Object.assign(this.rc, {
+							visible: true,
+							form: {
+								id: data.id,
+								inChannel: '',
+								realInTime: ''
+							}
+						})
+					},
+					sureRcFn() {
+						if (!this.rc.form.inChannel) {
+							sa.error('填写入场通道')
+							return;
+						}
+						if (!this.rc.form.realInTime) {
+							sa.error('选择入场时间')
+							return;
+						}
+						sa.ajax('/TbBusiness/adminSetIn', this.rc.form, function(resp) {
+							this.f5();
+							this.rc.visible = false;
+						}.bind(this))
+					},
+					outFn(data) {
+						Object.assign(this.out, {
+							visible: true,
+							form: {
+								id: data.id,
+								outDayTime: '',
+								outChannel: ''
+							}
+						})
+					},
+					sureOutFn() {
+						if (!this.out.form.outChannel) {
+							sa.error('请填写离场通道')
+							return;
+						}
+						if (!this.out.form.outDayTime) {
+							sa.error('选择离场时间')
+							return;
+						}
+						sa.ajax('/TbBusiness/adminOut', this.out.form, function(resp) {
+							this.f5();
+							this.out.visible = false;
+						}.bind(this))
+					},
+					getCurrendCustomer() {
+						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+							this.currentCustomerId = resp.data;
+						}.bind(this));
+					},
+					adminSurePayFn(data) {
+						Object.assign(this.pay, {
+							visible: true,
+							form: {
+								ids: data.id
 							}
 						})
 					},
-					surePayirmFn (){
-						sa.ajax('/TbBusiness/adminConfirmPay',this.pay.form,function(resp){
-							this.pay.visible=false;
+					surePayirmFn() {
+						sa.ajax('/TbBusiness/adminConfirmPay', this.pay.form, function(resp) {
+							this.pay.visible = false;
 							this.f5();
 						})
 					},
-					confirmBatch(){
+					confirmBatch() {
 						// 获取选中元素的id列表
 						let selection = this.$refs['data-table'].selection;
-						selection=selection.filter(obj=>obj.confirmInput==0)
+						selection = selection.filter(obj => obj.confirmInput == 0)
 						let ids = sa.getArrayField(selection, 'id');
-						if(selection.length == 0) {
+						if (selection.length == 0) {
 							return sa.msg('至少选择一条未确认数据')
 						}
 					},
-					getPcodeByCurrRid(){
-						sa.ajax('/SpRolePermission/getPcodeByCurrRid',function(resp){
-							this.perCode=resp.data;
+					getPcodeByCurrRid() {
+						sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
+							this.perCode = resp.data;
 						}.bind(this))
 					},
-					confirmFn(data){
-						Object.assign(this.confirm,{
-							visible:true,
-							form:{
-								ids:data.id
+					confirmFn(data) {
+						Object.assign(this.confirm, {
+							visible: true,
+							form: {
+								ids: data.id
 							}
 						})
 					},
-					sureConfirmFn(){
-						sa.ajax('/TbBusiness/confirm',{ids:this.confirm.form.ids},function(resp){
-							this.confirm.visible=false;
+					sureConfirmFn() {
+						sa.ajax('/TbBusiness/confirm', {
+							ids: this.confirm.form.ids
+						}, function(resp) {
+							this.confirm.visible = false;
 							this.f5();
 						}.bind(this))
 					},
-					payFn(data){
-						Object.assign(this.modal,{
-							visible:true,
-							form:{
-								id:data.id,
-								payTicket:data.payTicket
+					payFn(data) {
+						Object.assign(this.modal, {
+							visible: true,
+							form: {
+								id: data.id,
+								payTicket: data.payTicket
 							}
 						})
 					},
-					surePayFn(){
-						sa.ajax('/TbBusiness/pay',this.modal.form,function(resp){
+					surePayFn() {
+						sa.ajax('/TbBusiness/pay', this.modal.form, function(resp) {
 							this.f5();
-							this.modal.visible=false;
+							this.modal.visible = false;
 						}.bind(this))
 					},
 					// 刷新
@@ -219,7 +321,7 @@
 						sa.ajax('/TbBusiness/getList', sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 
-							sa.f5TableHeight();		// 刷新表格高度 
+							sa.f5TableHeight(); // 刷新表格高度 
 						}.bind(this));
 					},
 					// 查看
@@ -229,7 +331,7 @@
 					// 查看 - 根据选中的
 					getBySelect: function(data) {
 						var selection = this.$refs['data-table'].selection;
-						if(selection.length == 0) {
+						if (selection.length == 0) {
 							return sa.msg('请选择一条数据')
 						}
 						this.get(selection[0]);
@@ -248,7 +350,7 @@
 							sa.ajax('/TbBusiness/delete?id=' + data.id, function(res) {
 								sa.arrayDelete(this.dataList, data);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
+								sa.f5TableHeight(); // 刷新表格高度 
 							}.bind(this))
 						}.bind(this));
 					},
@@ -257,15 +359,17 @@
 						// 获取选中元素的id列表 
 						let selection = this.$refs['data-table'].selection;
 						let ids = sa.getArrayField(selection, 'id');
-						if(selection.length == 0) {
+						if (selection.length == 0) {
 							return sa.msg('请至少选择一条数据')
 						}
 						// 提交删除 
 						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
-							sa.ajax('/TbBusiness/deleteByIds', {ids: ids.join(',')}, function(res) {
+							sa.ajax('/TbBusiness/deleteByIds', {
+								ids: ids.join(',')
+							}, function(res) {
 								sa.arrayDelete(this.dataList, selection);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
+								sa.f5TableHeight(); // 刷新表格高度 
 							}.bind(this))
 						}.bind(this));
 					},
@@ -273,6 +377,7 @@
 				created: function() {
 					this.f5();
 					sa.onInputEnter();
+					this.getCurrendCustomer();
 					this.getPcodeByCurrRid();
 				}
 			})

+ 50 - 0
sp-server/src/main/java/com/pj/api/bo/InOutRecordBO.java

@@ -0,0 +1,50 @@
+package com.pj.api.bo;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * Created with IntelliJ IDEA.
+ *
+ * @Auther: lzm
+ * @Date: 2022/01/19/18:15
+ * @Description:
+ */
+@Data
+@Accessors(chain = true)
+public class InOutRecordBO {
+
+    private String businessId;
+
+    /**
+     * 客户名称
+     */
+    private String customerName;
+
+    private String customerContact;
+
+    private String dutyPeople;
+
+    /**
+     * 车牌号
+     */
+    private String cardNo;
+
+    /**
+     * 实际进境时间
+     */
+    private Date realInTime;
+
+    /**
+     * 离境时间
+     */
+    private Date outDayTime;
+
+    /**
+     * 状态(1=未入场, 2=已入场, 3=已出场)
+     */
+    private int status;
+
+}

+ 42 - 2
sp-server/src/main/java/com/pj/api/h5/ApiController.java

@@ -1,19 +1,25 @@
 package com.pj.api.h5;
 
 
+import com.pj.api.bo.InOutRecordBO;
+import com.pj.api.service.ApiService;
+import com.pj.constants.UserTypeEnum;
+import com.pj.current.satoken.StpUserUtil;
+import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project4sp.admin4login.SpAccAdminService;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.sg.NbUtil;
+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.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
 
 @RequestMapping(value = "/api")
 @RestController
@@ -21,9 +27,14 @@ import javax.annotation.Resource;
 public class ApiController {
 
     @Resource
+    ApiService apiService;
+    @Resource
     SpAccAdminService spAccAdminService;
     @Resource
     TbCostomerService tbCostomerService;
+    @Resource
+    TbBusinessService tbBusinessService;
+
     /** 账号、密码登录  */
     @RequestMapping("doLogin")
     AjaxJson doLogin(String key, String password) {
@@ -39,4 +50,33 @@ public class ApiController {
         tbCostomerService.register(costomer);
         return AjaxJson.getSuccess();
     }
+
+    @RequestMapping(value = "getInOutRecord")
+    public AjaxJson getInOutRecord(){
+        SoMap so = SoMap.getRequestSoMap();
+        String currentCustomerId = StpUserUtil.getCustomerId();
+        if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
+            so.put("customerId",currentCustomerId);
+        }
+        List<InOutRecordBO> recordList = apiService.getInOutRecord(so);
+        return AjaxJson.getSuccessData(recordList);
+    }
+
+    @RequestMapping(value = "getCustomerList")
+    public AjaxJson getCustomerList(){
+        SoMap so = SoMap.getRequestSoMap();
+        String currentCustomerId = StpUserUtil.getCustomerId();
+        if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
+            so.put("id",currentCustomerId);
+        }
+        List<TbCostomer> list = apiService.getCustomerList(so);
+        return AjaxJson.getSuccessData(list);
+    }
+
+    @PostMapping(value = "confirmCustomer")
+    public AjaxJson confirmCustomer(Long customerId){
+        apiService.confirmCustomer(customerId);
+        return AjaxJson.getSuccess();
+    }
+
 }

+ 10 - 21
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -33,8 +33,6 @@ public class OpenService {
     @Resource
     private TbCarService tbCarService;
 
-    @Resource
-    private PartConfig partConfig;
 
     public ResultJson checkCarNumber(CheckCarNumberBO checkCarNumberBO) {
         String carNo=checkCarNumberBO.getCarNumber();
@@ -64,8 +62,13 @@ public class OpenService {
               TbCostomer tbCostomer= tbCostomerService.getById(tbBusiness.getCustomerId());
               car.setLastOutTime(now);
                tbCarService.updateById(car);
-              handlerOut(tbBusiness,checkCarNumberBO);
-              if (tbCostomer.getPayType()==2){
+               tbBusiness.setOutChannel(checkCarNumberBO.getChannelName());
+               try {
+                   handlerOut(tbBusiness);
+               } catch (Exception e) {
+                   e.printStackTrace();
+               }
+               if (tbCostomer.getPayType()==2){
                   return ResultJson.success();
               }else {
                   if (tbBusiness.getPayStatus() != 3) {
@@ -80,23 +83,9 @@ public class OpenService {
 
     }
 
-    private void handlerOut(TbBusiness tbBusiness, CheckCarNumberBO checkCarNumberBO) {
-        LocalDateTime inTime=  tbBusiness.getRealInTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
-       LocalDateTime outTime=LocalDateTime.now();
-       LocalDateTime zero=LocalDateTime.of(LocalDate.now(), LocalTime.of(0,0,0));
-       long days= ChronoUnit.DAYS.between(inTime,outTime);
-        BigDecimal basePrice=partConfig.getBasePrice();
-        BigDecimal extraPirce=partConfig.getExtraPrice();
-       BigDecimal price= basePrice.add(basePrice.multiply(new BigDecimal(days)));
-        if (outTime.isBefore(LocalDateTime.parse(partConfig.getNightEnd(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))&&outTime.isAfter(zero)){
-            price=  price.add(extraPirce);
-        }
-        tbBusiness.setPartMoney(price);
-       long minutes= ChronoUnit.MINUTES.between(inTime,outTime);
-       if (minutes<=partConfig.getFreeMinutes()){
-           tbBusiness.setPartMoney(new BigDecimal(0));
-       }
-       tbBusiness.setPartTime(minutes).setOutDayTime(new Date()).setOutChannel(checkCarNumberBO.getChannelName());
+    private void handlerOut(TbBusiness tbBusiness) throws Exception{
+        tbBusiness.setOutDayTime(new Date());
+       tbBusinessService.calculationPartMoney(tbBusiness);
        tbBusinessService.updateById(tbBusiness);
     }
 }

+ 76 - 0
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -0,0 +1,76 @@
+package com.pj.api.service;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.pj.api.bo.InOutRecordBO;
+import com.pj.project.tb_business.TbBusiness;
+import com.pj.project.tb_business.TbBusinessService;
+import com.pj.project.tb_costomer.TbCostomer;
+import com.pj.project.tb_costomer.TbCostomerService;
+import com.pj.utils.so.SoMap;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ */
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+@Slf4j
+public class ApiService {
+
+    @Resource
+    TbCostomerService tbCostomerService;
+    @Resource
+    TbBusinessService tbBusinessService;
+
+    public List<InOutRecordBO> getInOutRecord(SoMap so){
+        int current = so.getInt("current");
+        List<TbBusiness> businessList = tbBusinessService.getList(so);
+        List<InOutRecordBO> recordList = new ArrayList<>();
+        for (TbBusiness business : businessList) {
+            InOutRecordBO record = new InOutRecordBO();
+            BeanUtil.copyProperties(business, record);
+            TbCostomer costomer = tbCostomerService.getById(business.getCustomerId());
+            record.setBusinessId(business.getId()).setCustomerContact(costomer.getPhone()).setDutyPeople(costomer.getDutyPeople());
+            if(record.getRealInTime() != null && record.getOutDayTime() != null){
+                record.setStatus(3);//已出场
+            }else if(record.getRealInTime() != null && record.getOutDayTime() == null){
+                record.setStatus(2);//已入场
+            }else{
+                record.setStatus(1);//未入场
+            }
+            if(current == 0){
+                recordList.add(record);
+            }else if(current == record.getStatus()) {
+                recordList.add(record);
+            }
+        }
+        return recordList;
+    }
+
+    public List<TbCostomer> getCustomerList(SoMap so) {
+        int current = so.getInt("current");
+        List<TbCostomer> costomerList = new ArrayList<>();
+        List<TbCostomer> list = tbCostomerService.getList(so);
+        for (TbCostomer costomer : list) {
+            if(current == 0){
+                costomerList.add(costomer);
+            }else if(current == costomer.getJudgeStatus()){
+                costomerList.add(costomer);
+            }
+        }
+        return costomerList;
+    }
+
+    public void confirmCustomer(Long customerId) {
+        TbCostomer costomer = tbCostomerService.getById(customerId);
+        if(costomer != null && costomer.getJudgeStatus() == 1){
+            tbCostomerService.judge(customerId + "", 2, "H5端审核");
+        }
+    }
+}

+ 1 - 0
sp-server/src/main/java/com/pj/current/config/PartConfig.java

@@ -11,6 +11,7 @@ import java.math.BigDecimal;
 @Component
 @ConfigurationProperties(prefix = "part-config")
 public class PartConfig {
+    private Double freeCarLength;
     private BigDecimal basePrice;
     private BigDecimal extraPrice;
     private String  nightEnd;

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

@@ -119,7 +119,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
 	/**
 	 * 预计进边境日期 
 	 */
-	private String expectInDay;
+	private Date expectInDay;
 
 	/**
 	 * 实际进边境日期 
@@ -183,10 +183,12 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
 	private Integer adminConfirmPay;
 	private Date adminConfirmPayTime;
 	private String adminConfirmPayBy;
+	//结账方式(1=现结,2=月结)[j]
 	private int customerType;
 	private String chinaCarNo;
 
 	private transient String itemJson;
+	private transient String peopleJson;
 	@TableField(exist = false)
 	private List<TbBusinessItem>items=new ArrayList<>();
 

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

@@ -1,5 +1,6 @@
 package com.pj.project.tb_business;
 
+import java.util.Date;
 import java.util.List;
 
 import cn.dev33.satoken.stp.StpUtil;
@@ -46,6 +47,7 @@ public class TbBusinessController {
 	/** 删 */  
 	@RequestMapping("delete")
 	@SaCheckPermission(TbBusiness.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
 	public AjaxJson delete(String id){
 		tbBusinessService.removeById(id);
 		tbBusinessItemService.removeByBusinessId(id);
@@ -55,6 +57,7 @@ public class TbBusinessController {
 	/** 删 - 根据id列表 */  
 	@RequestMapping("deleteByIds")
 	@SaCheckPermission(TbBusiness.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
 	public AjaxJson deleteByIds(){
 		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
 		ids.forEach(id->{
@@ -73,6 +76,7 @@ public class TbBusinessController {
 	}
 	/** 确认业务 */
 	@RequestMapping("confirm")
+	@Transactional(rollbackFor = Exception.class)
 	public AjaxJson confirm(){
 		if (!StpUtil.hasPermissionAnd(TbBusiness.PERMISSION_CONFIRM)&&!
 				StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
@@ -85,6 +89,7 @@ public class TbBusinessController {
 	}
 	/** 确认业务 */
 	@RequestMapping("adminConfirmPay")
+	@Transactional(rollbackFor = Exception.class)
 	public AjaxJson adminConfirmPay(){
 		if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
 			return AjaxJson.getError("无确认支付权限");
@@ -97,6 +102,7 @@ public class TbBusinessController {
 
 	/** 手动入场确认 */
 	@RequestMapping("adminConfirmIn")
+	@Transactional(rollbackFor = Exception.class)
 	public AjaxJson adminConfirmIn(){
 		if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
 			return AjaxJson.getError("无确认入场权限");
@@ -144,26 +150,33 @@ public class TbBusinessController {
 		tbBusinessService.pay(id,payTicket);
 		return AjaxJson.getSuccess();
 	}
-	
-	
-	// ------------------------- 前端接口 -------------------------
-	
-	
-	/** 改 - 不传不改 [G] */
-	@RequestMapping("updateByNotNull")
-	public AjaxJson updateByNotNull(Long id){
-		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
-		// 鉴别身份,是否为数据创建者 
-		long userId = SP.publicMapper.getColumnByIdToLong(TbBusiness.TABLE_NAME, "user_id", id);
-		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
-		// 开始修改 (请只保留需要修改的字段)
+
+	@RequestMapping("adminSetIn")
+	public AjaxJson adminSetIn(){
+		if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
+			return AjaxJson.getError("无入场权限");
+		}
 		SoMap so = SoMap.getRequestSoMap();
-		so.clearNotIn("id", "customerId", "customerName", "no", "cardNo", "cardSize", "netWeight", "goodsName", "goodsCode", "driverName", "driverId", "driverPhone", "driverIdCard", "payTicket", "expectInDay", "realInDay", "realInTime", "payStatus", "payTime", "payType", "outDayTime", "partMoney", "partTime").clearNull().humpToLineCase();	
-		int line = SP.publicMapper.updateBySoMapById(TbBusiness.TABLE_NAME, so, id);
-		return AjaxJson.getByLine(line);
+		String id=so.getString("id");
+		TbBusiness tbBusiness=tbBusinessService.getById(id);
+		tbBusiness.setRealInTime(new Date()).setInChannel(so.getString("inChannel"));
+		tbBusinessService.updateById(tbBusiness);
+		return AjaxJson.getSuccess();
+	}
+	@RequestMapping("adminOut")
+	public AjaxJson adminOut()throws Exception{
+		if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
+			return AjaxJson.getError("无离场权限");
+		}
+		SoMap so = SoMap.getRequestSoMap();
+		String id=so.getString("id");
+		tbBusinessService.adminOut(id,so.getDateTime("outDayTime"),so.getString("outChannel"));
+		return AjaxJson.getSuccess();
 	}
+	// ------------------------- 前端接口 -------------------------
 	
 	
+
 	
 	
 	

+ 59 - 1
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -1,11 +1,16 @@
 package com.pj.project.tb_business;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
 import java.util.Date;
 import java.util.List;
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
@@ -14,9 +19,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.constants.UserTypeEnum;
+import com.pj.current.config.PartConfig;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_business_item.TbBusinessItemService;
+import com.pj.project.tb_business_people.TbBusinessPeople;
+import com.pj.project.tb_business_people.TbBusinessPeopleService;
 import com.pj.project.tb_car.TbCar;
 import com.pj.project.tb_car.TbCarService;
 import com.pj.project.tb_costomer.TbCostomer;
@@ -70,6 +78,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
     @Resource
     TbUnitService tbUnitService;
+    @Resource
+    TbBusinessPeopleService tbBusinessPeopleService;
+    @Resource
+    private PartConfig partConfig;
+
 
     public TbBusiness checkCarNo(String carNo){
         QueryWrapper<TbBusiness>ew=new QueryWrapper<>();
@@ -83,6 +96,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         if (checkCarNo(t.getCardNo())!=null){
          return AjaxJson.getError("该车辆【"+t.getCardNo()+"】有未完成业务");
         }
+
         t.setCreateBy(StpUserUtil.getAdmin().getName());
         createCar(t);
         createCarUnit(t);
@@ -104,6 +118,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             t.setCreateTime(new Date());
         }
         saveOrUpdate(t);
+
+        createBusinessPeople(t);
         tbBusinessItemService.removeByBusinessId(t.getId());
         BigDecimal price = new BigDecimal(0);
         for (TbBusinessItem item : items) {
@@ -122,6 +138,13 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         return AjaxJson.getSuccess();
     }
 
+    private void createBusinessPeople(TbBusiness t) {
+        tbBusinessPeopleService.removeByBusinessId(t.getId());
+        List<TbBusinessPeople>peopleList=JSONUtil.toList(t.getPeopleJson(),TbBusinessPeople.class);
+        peopleList.forEach(tbBusinessPeople -> tbBusinessPeople.setBusinessId(t.getId()).setCreateTime(new Date()));
+        tbBusinessPeopleService.saveBatch(peopleList);
+    }
+
     private void createCarUnit(TbBusiness t) {
        TbUnit tbUnit= tbUnitService.findByUnit(t.getCardSize());
        if (tbUnit==null){
@@ -163,7 +186,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     /**
      * 查集合 - 根据条件(参数为空时代表忽略指定条件)
      */
-    List<TbBusiness> getList(SoMap so) {
+    public List<TbBusiness> getList(SoMap so) {
         return tbBusinessMapper.getList(so);
     }
 
@@ -212,4 +235,39 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         tbBusiness.setRealInTime(new Date()).setInChannel(inChannel);
         this.updateById(tbBusiness);
     }
+
+    public void adminOut(String id, Date outDayTime,String outChannel) throws Exception{
+       TbBusiness tbBusiness= this.getById(id);
+       if (tbBusiness.getCustomerType()==1&&tbBusiness.getPayStatus()==1){
+           throw new Exception("现结客户,请先确认支付");
+       }
+      tbBusiness.setOutDayTime(outDayTime).setOutChannel(outChannel);
+
+      calculationPartMoney(tbBusiness);
+      this.updateById(tbBusiness);
+    }
+    public void calculationPartMoney(TbBusiness tbBusiness)throws Exception{
+        LocalDateTime inDayTime=  tbBusiness.getRealInTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+        LocalDateTime outDayTime=tbBusiness.getOutDayTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+        long minutes= ChronoUnit.MINUTES.between(inDayTime,outDayTime);
+        if (minutes<0){
+            throw new Exception("离场时间不正确");
+        }
+        if (tbBusiness.getCardSize()<partConfig.getFreeCarLength()||minutes<=partConfig.getFreeMinutes()){
+            return;
+        }
+        LocalTime zero=LocalTime.of(0,0,0);
+        long days= ChronoUnit.DAYS.between(inDayTime.toLocalDate(),outDayTime.toLocalDate());
+        BigDecimal basePrice=partConfig.getBasePrice();
+        BigDecimal extraPrice=partConfig.getExtraPrice();
+        BigDecimal price= basePrice.add(basePrice.multiply(new BigDecimal(days)));
+        LocalTime outTime=outDayTime.toLocalTime();
+        if (outTime.isBefore(LocalTime.parse(partConfig.getNightEnd(), DateTimeFormatter.ofPattern("HH:mm:ss")))
+                &&outTime.isAfter(zero)){
+            price=  price.add(extraPrice);
+        }
+        tbBusiness.setPartMoney(price);
+        tbBusiness.setTotalMoney(tbBusiness.getPartMoney().add(tbBusiness.getItemPrice()))
+                .setPartTime(minutes);
+    }
 }

+ 71 - 0
sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeople.java

@@ -0,0 +1,71 @@
+package com.pj.project.tb_business_people;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_business_people -- 核酸检测人员
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbBusinessPeople.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbBusinessPeople extends Model<TbBusinessPeople> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_business_people";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-business-people";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 *  
+	 */
+	private String id;
+
+	/**
+	 *  
+	 */
+	private String name;	
+
+	/**
+	 *  
+	 */
+	private String phone;	
+
+	/**
+	 *  
+	 */
+	private String businessId;
+
+	/**
+	 *  
+	 */
+	private Date createTime;
+
+
+
+
+
+	
+
+
+}

+ 99 - 0
sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleController.java

@@ -0,0 +1,99 @@
+package com.pj.project.tb_business_people;
+
+import java.util.List;
+
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_business_people -- 核酸检测人员
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/TbBusinessPeople/")
+public class TbBusinessPeopleController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbBusinessPeopleService tbBusinessPeopleService;
+
+	/** 增 */
+	@RequestMapping("deleteById")
+	@Transactional(rollbackFor = Exception.class)
+	public AjaxJson deleteById(){
+		SoMap so = SoMap.getRequestSoMap();
+		String id=so.getString("id");
+		tbBusinessPeopleService.removeById(id);
+		return AjaxJson.getSuccess();
+	}
+
+
+
+	/** 删 - 根据id列表 */
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbBusinessPeople.PERMISSION_CODE)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(TbBusinessPeople.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 改 */
+	@RequestMapping("update")
+	@SaCheckPermission(TbBusinessPeople.PERMISSION_CODE)
+	public AjaxJson update(TbBusinessPeople t){
+		int line = tbBusinessPeopleService.update(t);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbBusinessPeople t = tbBusinessPeopleService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getList")
+	public AjaxJson getList() {
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbBusinessPeople> list = tbBusinessPeopleService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+
+
+
+	// ------------------------- 前端接口 -------------------------
+
+
+	/** 改 - 不传不改 [G] */
+	@RequestMapping("updateByNotNull")
+	public AjaxJson updateByNotNull(Long id){
+		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
+		// 鉴别身份,是否为数据创建者
+		long userId = SP.publicMapper.getColumnByIdToLong(TbBusinessPeople.TABLE_NAME, "user_id", id);
+		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
+		// 开始修改 (请只保留需要修改的字段)
+		SoMap so = SoMap.getRequestSoMap();
+		so.clearNotIn("id", "name", "phone", "businessId", "createTime").clearNull().humpToLineCase();
+		int line = SP.publicMapper.updateBySoMapById(TbBusinessPeople.TABLE_NAME, so, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+	
+	
+	
+	
+
+}

+ 50 - 0
sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleMapper.java

@@ -0,0 +1,50 @@
+package com.pj.project.tb_business_people;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_business_people -- 核酸检测人员
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface TbBusinessPeopleMapper extends BaseMapper <TbBusinessPeople> {
+
+	/**
+	 * 增  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int add(TbBusinessPeople t);
+
+
+	/** 
+	 * 改  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int update(TbBusinessPeople t);
+
+	/** 
+	 * 查 - 根据id  
+	 * @param id 要查询的数据id 
+	 * @return 实体对象 
+	 */
+	TbBusinessPeople getById(Long id);	 
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbBusinessPeople> getList(SoMap so);
+
+
+}

+ 79 - 0
sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.project.tb_business_people.TbBusinessPeopleMapper">
+
+	<!-- 增 [G] -->
+	<insert id="add">
+		insert into 
+		tb_business_people (id, name, phone, business_id, create_time) 
+		values (#{id}, #{name}, #{phone}, #{businessId}, #{createTime}) 
+	</insert>
+
+
+	<!-- 改 [G] -->
+	<update id="update">
+		update tb_business_people set
+		id = #{id}, 
+		name = #{name}, 
+		phone = #{phone}, 
+		business_id = #{businessId}, 
+		create_time = #{createTime}
+		where id = #{id}
+	</update>
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, name, phone, business_id, create_time from tb_business_people  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.tb_business_people.TbBusinessPeople">
+		<result property="id" column="id" />
+		<result property="name" column="name" />
+		<result property="phone" column="phone" />
+		<result property="businessId" column="business_id" />
+		<result property="createTime" column="create_time" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_business_people 
+	</sql>
+	
+	<!-- 查 - 根据id -->
+	<select id="getById" resultMap="model">
+		<include refid="select_sql"></include>
+		where id = #{id}
+	</select>
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("name") '> and name = #{name} </if>
+			<if test=' this.has("phone") '> and phone = #{phone} </if>
+			<if test=' this.has("businessId") '> and business_id = #{businessId} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> name desc </when>
+			<when test='sortType == 3'> phone desc </when>
+			<when test='sortType == 4'> business_id desc </when>
+			<when test='sortType == 5'> create_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 53 - 0
sp-server/src/main/java/com/pj/project/tb_business_people/TbBusinessPeopleService.java

@@ -0,0 +1,53 @@
+package com.pj.project.tb_business_people;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.pj.utils.sg.*;
+
+/**
+ * Service: tb_business_people -- 核酸检测人员
+ * @author qzy 
+ */
+@Service
+public class TbBusinessPeopleService extends ServiceImpl<TbBusinessPeopleMapper,TbBusinessPeople>  implements IService<TbBusinessPeople> {
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbBusinessPeopleMapper tbBusinessPeopleMapper;
+
+	/** 增 */
+	int add(TbBusinessPeople t){
+		return tbBusinessPeopleMapper.add(t);
+	}
+
+
+
+	/** 改 */
+	int update(TbBusinessPeople t){
+		return tbBusinessPeopleMapper.update(t);
+	}
+
+	/** 查 */
+	TbBusinessPeople getById(Long id){
+		return tbBusinessPeopleMapper.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<TbBusinessPeople> getList(SoMap so) {
+		return tbBusinessPeopleMapper.getList(so);	
+	}
+
+
+	public void removeByBusinessId(String businessId) {
+		QueryWrapper<TbBusinessPeople>ew=new QueryWrapper<>();
+		ew.eq("business_id",businessId);
+		this.remove(ew);
+	}
+}

+ 5 - 5
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerService.java

@@ -53,9 +53,6 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
      */
     int add(TbCostomer t) {
         t.setCreareTime(new Date()).setJudgeContent("平台创建,直接通过").setJudgeTime(new Date());
-        List<TbDistrict> districts = tbDistrictService.listByIds(StrUtil.splitTrim(t.getAddressIds(), ","));
-        String address = districts.stream().map(TbDistrict::getDistrict).collect(Collectors.joining(""));
-        t.setAddressStr(address);
         this.save(t);
         List<RoleEnum> roleEnums = RoleEnum.getCustomerInitRoleList();
         roleEnums.forEach(roleEnum -> {
@@ -76,6 +73,9 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
         SoMap soMap = SoMap.getRequestSoMap();
         soMap.put("customerId", id);
         List<SpRole> roles = spRoleMapper.getList(soMap);
+        if (roles.isEmpty()){
+            return 1;
+        }
         spRoleMapper.removeByCustomerId(id);
         spRolePermissionMapper.removeByRoleIds(roles.stream().map(SpRole::getId).collect(Collectors.toList()));
         spAdminMapper.removeByCustomerId(id);
@@ -98,7 +98,7 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
     /**
      * 查集合 - 根据条件(参数为空时代表忽略指定条件)
      */
-    List<TbCostomer> getList(SoMap so) {
+    public List<TbCostomer> getList(SoMap so) {
         return tbCostomerMapper.getList(so);
     }
 
@@ -119,6 +119,6 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
 
     public void register(TbCostomer costomer) {
         costomer.setJudgeStatus(1).setStatus(1);
-        this.save(costomer);
+        this.add(costomer);
     }
 }

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemType.java

@@ -60,7 +60,7 @@ public class TbItemType extends Model<TbItemType> implements Serializable {
 	@TableField(exist = false)
 	private String itemId;
 	@TableField(exist = false)
-	private Integer num=0;
+	private Integer num=1;
 	@TableField(exist = false)
 	private String itemName;
 

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

@@ -51,3 +51,4 @@ part-config:
     extra-price: 10 #过夜额外收费
     night-end: 06:00:00 #夜间结束时间
     free-minutes: 20
+    free-car-length: 4.2

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

@@ -29,7 +29,7 @@ spring:
         # 默认的日期转换格式  
         date-format: yyyy-MM-dd HH:mm:ss
         # 解决因为时区问题,date少8小时的bug 
-        # time-zone: GMT+8
+        time-zone: GMT+8
         
     # 文件上传相关配置
     upload-config: