瀏覽代碼

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

qzyReal 3 年之前
父節點
當前提交
08a66baefc
共有 50 個文件被更改,包括 2103 次插入335 次删除
  1. 90 75
      app/apis/api.js
  2. 8 0
      app/common/js/common.js
  3. 14 6
      app/pages.json
  4. 221 0
      app/pages/account/index.vue
  5. 3 4
      app/pages/business-order/business-order.vue
  6. 180 0
      app/pages/business-order/report.vue
  7. 180 33
      app/pages/declare/add.vue
  8. 138 35
      app/pages/disinfect/addDisinfect.vue
  9. 24 1
      app/pages/index/index.vue
  10. 88 30
      app/pages/wx/pay.vue
  11. 二進制
      app/static/home-icon-06.jpg
  12. 二進制
      app/static/home-icon-07.jpg
  13. 2 2
      app/utils/request.js
  14. 2 2
      sp-admin/login.html
  15. 11 1
      sp-admin/sa-frame/menu-list.js
  16. 103 13
      sp-admin/sa-view/car/tb-business-car-list.html
  17. 3 2
      sp-admin/sa-view/tb-business/tb-business-add.html
  18. 3 2
      sp-admin/sa-view/tb-business/tb-business-edit.html
  19. 148 0
      sp-admin/sa-view/tb-discount/tb-discount-add.html
  20. 73 0
      sp-admin/sa-view/tb-discount/tb-discount-info.html
  21. 164 0
      sp-admin/sa-view/tb-discount/tb-discount-list.html
  22. 9 1
      sp-admin/static/sa.js
  23. 1 1
      sp-server/app.pid
  24. 6 6
      sp-server/pom.xml
  25. 28 19
      sp-server/src/main/java/com/pj/api/h5/ApiController.java
  26. 8 5
      sp-server/src/main/java/com/pj/api/open/service/OpenService.java
  27. 13 3
      sp-server/src/main/java/com/pj/api/service/ApiService.java
  28. 10 10
      sp-server/src/main/java/com/pj/api/wx/api/WxController.java
  29. 15 1
      sp-server/src/main/java/com/pj/api/wx/bo/Attach.java
  30. 42 0
      sp-server/src/main/java/com/pj/api/wx/bo/NotifyBO.java
  31. 19 0
      sp-server/src/main/java/com/pj/api/wx/bo/PrePayBO.java
  32. 11 0
      sp-server/src/main/java/com/pj/api/wx/bo/PriceBO.java
  33. 1 1
      sp-server/src/main/java/com/pj/api/wx/bo/SceneInfoBO.java
  34. 47 62
      sp-server/src/main/java/com/pj/api/wx/service/WxService.java
  35. 1 1
      sp-server/src/main/java/com/pj/api/wx/vo/NotifyVO.java
  36. 1 1
      sp-server/src/main/java/com/pj/api/wx/vo/PrePayVO.java
  37. 7 1
      sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java
  38. 5 0
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java
  39. 16 8
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java
  40. 4 2
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCar.java
  41. 5 4
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java
  42. 5 1
      sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItem.java
  43. 3 1
      sp-server/src/main/java/com/pj/project/tb_declare/TbDeclare.java
  44. 83 0
      sp-server/src/main/java/com/pj/project/tb_discount/TbDiscount.java
  45. 115 0
      sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountController.java
  46. 51 0
      sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountMapper.java
  47. 88 0
      sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountMapper.xml
  48. 52 0
      sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountService.java
  49. 1 0
      sp-server/src/main/java/com/pj/project/tb_disinfect/TbDisinfect.java
  50. 1 1
      sp-server/src/main/resources/application-dev.yml

+ 90 - 75
app/apis/api.js

@@ -9,116 +9,131 @@ export default {
 	register(data) {
 		return ajax.postForm('/api/register', data)
 	},
-	getItemList(){
+	getItemList() {
 		return ajax.get('/TbItemType/getList')
 	},
-	getCustomerList(){
-		return ajax.get('/TbCostomer/getList',{judgeStatus:2})
+	getCustomerList() {
+		return ajax.get('/TbCostomer/getList', {
+			judgeStatus: 2
+		})
 	},
-	getCarList(){
-		return ajax.get('/TbCar/getList',{pageNo:1,pageSize:500})
+	getCarList() {
+		return ajax.get('/TbCar/getList', {
+			pageNo: 1,
+			pageSize: 500
+		})
 	},
-	getDriverList(){
-		return ajax.get('/TbDriver/getList',{pageNo:1,pageSize:500})
+	getDriverList() {
+		return ajax.get('/TbDriver/getList', {
+			pageNo: 1,
+			pageSize: 500
+		})
 	},
-	getGoodsList(){
-		return ajax.get('/TbGoods/getList',{pageNo:1,pageSize:50})
+	getGoodsList() {
+		return ajax.get('/TbGoods/getList', {
+			pageNo: 1,
+			pageSize: 50
+		})
 	},
-	saveBusiness(data){
-		return ajax.postForm('/TbBusiness/add',data)
+	saveBusiness(data) {
+		return ajax.postForm('/TbBusiness/add', data)
 	},
-	getBusinessList(data){
-		return ajax.get('/TbBusiness/getList',data)
+	getBusinessList(data) {
+		return ajax.get('/TbBusiness/getList', data)
 	},
-	adminConfirmPay(data){
-		return ajax.postForm('/TbBusiness/adminConfirmPay',data)
+	adminConfirmPay(data) {
+		return ajax.postForm('/TbBusiness/adminConfirmPay', data)
 	},
-	adminConfirmIn(data){
-		return ajax.postForm('/TbBusiness/adminConfirmIn',data)
+	adminConfirmIn(data) {
+		return ajax.postForm('/TbBusiness/adminConfirmIn', data)
 	},
-    getInOutRecord(data) {
-        //return ajax.get('/api/getInOutRecord', data)
+	getInOutRecord(data) {
+		//return ajax.get('/api/getInOutRecord', data)
 		return ajax.get('/TbBusinessCar/getList', 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)
-	},
-	getCurrentPerCode(){
+	},
+	getCustomerList(data) {
+		return ajax.get('/api/getCustomerList', data)
+	},
+	confirmCustomer(data) {
+		return ajax.postForm('/api/confirmCustomer', data)
+	},
+	deleteHsPeople(data) {
+		return ajax.postForm('/TbBusinessPeople/deleteById', data)
+	},
+	getCurrentPerCode() {
 		return ajax.get('/SpRolePermission/getPcodeByCurrRid')
 	},
-	getBusinessById(data){
-		return ajax.get('/TbBusiness/getById',data)
+	getBusinessById(data) {
+		return ajax.get('/TbBusiness/getById', data)
 	},
-	confirmBusiness(data){
-		return ajax.postForm('/TbBusiness/confirm',data)
+	confirmBusiness(data) {
+		return ajax.postForm('/TbBusiness/confirm', data)
 	},
-	confirmPay(data){
-		return ajax.postForm('/TbBusiness/pay',data)
+	confirmPay(data) {
+		return ajax.postForm('/TbBusiness/pay', data)
 	},
-	adminSetIn(data){
-		return ajax.postForm('/TbBusiness/adminSetIn',data)
+	adminSetIn(data) {
+		return ajax.postForm('/TbBusiness/adminSetIn', data)
 	},
-	calJwPartMoney(data){
-		return ajax.postForm('/TbBusiness/calJwPartMoney',data)
+	calJwPartMoney(data) {
+		return ajax.postForm('/TbBusiness/calJwPartMoney', data)
 	},
-	calChinaPartMoney(data){
-		return ajax.postForm('/TbBusiness/calChinaPartMoney',data)
+	calChinaPartMoney(data) {
+		return ajax.postForm('/TbBusiness/calChinaPartMoney', data)
 	},
-	completeOrder(data){
-		return ajax.postForm('/TbBusiness/complete',data)
+	completeOrder(data) {
+		return ajax.postForm('/TbBusiness/complete', data)
 	},
-	adminSetOut(data){
-		return ajax.postForm('/TbBusiness/adminOut',data)
+	adminSetOut(data) {
+		return ajax.postForm('/TbBusiness/adminOut', data)
 	},
-	deleteBusiness (data){
-		return ajax.postForm('/TbBusiness/delete',data)
+	deleteBusiness(data) {
+		return ajax.postForm('/TbBusiness/delete', data)
 	},
-	getBusinessPeople(data){
-		return ajax.get('/TbBusinessPeople/getList',data)
+	getBusinessPeople(data) {
+		return ajax.get('/TbBusinessPeople/getList', data)
 	},
-	getCustomerById(data){
-		return ajax.get('/TbCostomer/getById',data)
+	getCustomerById(data) {
+		return ajax.get('/TbCostomer/getById', data)
 	},
-	editCustomer(data){
-		return ajax.postForm('/TbCostomer/update',data)
+	editCustomer(data) {
+		return ajax.postForm('/TbCostomer/update', data)
 	},
-	judgeCustomer(data){
-		return ajax.postForm('/TbCostomer/judge',data)
+	judgeCustomer(data) {
+		return ajax.postForm('/TbCostomer/judge', data)
 	},
-	getUnitList(){
+	getUnitList() {
 		return ajax.get('/TbUnit/getList')
 	},
-	getPrePay(data){
-		return ajax.get('/wx/pre-pay',data)
+	getPrePay(data) {
+		return ajax.get('/wx/pre-pay', data)
 	},
-	getRedirectUrl(data){
-		return ajax.get('/wx/getRedirectUrl',data)
+	getRedirectUrl(data) {
+		return ajax.get('/wx/getRedirectUrl', data)
 	},
-	getOpenidByCode (data){
-		return ajax.get('/wx/getOpenidByCode',data)
+	getOpenidByCode(data) {
+		return ajax.get('/wx/getOpenidByCode', data)
 	},
-	searchPartCar(data){
-		return ajax.get('/api/searchPartCar',data)
+	searchPartCar(data) {
+		return ajax.get('/api/searchPartCar', data)
 	},
-	getBusinessMoney(data){
-		return ajax.get('/api/getBusinessMoney',data)
+	getBusinessMoney(data) {
+		return ajax.get('/api/getBusinessMoney', data)
 	},
-	getWxConfig(data){
-		return ajax.get('/wx/getWxConfig',data)
+	
+	getWxConfig(data) {
+		return ajax.get('/wx/getWxConfig', data)
 	},
-	getPartCarByChannel(data){
-		return ajax.get('/api/getPartCarByChannel',data)
+	getPartCarByChannel(data) {
+		return ajax.get('/api/getPartCarByChannel', data)
 	},
-	addDeclare(data){
-		return ajax.postJson('/api/addDeclare',data)
+	addDeclare(data) {
+		return ajax.postJson('/api/addDeclare', data)
 	},
-	addDisinfect(data){
-		return ajax.postJson('/api/addDisinfect',data)
+	addDisinfect(data) {
+		return ajax.postJson('/api/addDisinfect', data)
 	},
+	uploadReport(data) {
+		return ajax.postJson('/TbBusiness/uploadReport', data)
+	}
 }

+ 8 - 0
app/common/js/common.js

@@ -81,6 +81,14 @@ export default {
 		} 
 		return false;
 	},
+	isCarNo(str){
+		str=str+'';
+		let reg=/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
+		if(reg.test(str)){
+			return true;
+		}
+		return false;
+	},
 	removeNull(obj){
 		var newObj = {};
 		if(obj != undefined && obj != null) {

+ 14 - 6
app/pages.json

@@ -93,13 +93,22 @@
 				"navigationBarTitleText": ""
 			}
 
-		}, {
+		}, 
+		{
+			"path": "pages/business-order/report",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		
+		},
+		{
 			"path": "pages/business-order/surePay",
 			"style": {
 				"navigationBarTitleText": ""
 			}
 
 		},
+		
 		{
 			"path": "pages/business-order/sureOut",
 			"style": {
@@ -189,14 +198,13 @@
 		
 		},
 		{
-			"path": "pages/business-entering/item-select",
+			"path": "pages/account/index",
 			"style": {
-				"navigationBarTitleText": "选择项目",
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
+				"navigationBarTitleText": ""
 			}
-
+		
 		}
+		
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "white",

+ 221 - 0
app/pages/account/index.vue

@@ -0,0 +1,221 @@
+<template>
+	<view>
+		<view class="top-bg"></view>
+		<view class="top-box">
+			<view class="top">
+				<text class="num">{{account.activeMoney}}</text>
+				<text class="p">账户余额</text>
+			</view>
+			<view class="bottom">
+				<view class="t">
+					<view class="p">账户:</view>
+					<view class="num">{{account.accountNo}}</view>
+				</view>
+				<view class="b">
+					<view class="item">
+						<view class="num">{{account.totalMoney}}</view>
+						<view class="p">总金额</view>
+					</view>
+					<view class="item">
+						<view class="num">{{account.deposit}}</view>
+						<view class="p">保证金</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="btn-box">
+			<view class="btn t" @click="chargeFn">立即充值</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				account: {
+					totalMoney: 0,
+					lockMoney: 0,
+					activeMoney: 0,
+					deposit: 0
+				},
+				info: {
+					saleCount: 0,
+					buyCount: 0
+				}
+			}
+		},
+		onShow() {
+			
+		},
+		methods: {
+			chargeFn(){
+				
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.top-bg {
+		width: 100%;
+		height: 400rpx;
+		position: absolute;
+		z-index: 0;
+		background-image: linear-gradient(0deg, #fff 0%, #0080ff 40%);
+	}
+
+	.top-box {
+		position: relative;
+		z-index: 1;
+
+		.top {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+
+			.num {
+				color: #fff;
+				font-size: 60rpx;
+				margin-top: 50rpx;
+			}
+
+			.p {
+				color: rgba(255, 255, 255, .7);
+				margin-top: 10rpx;
+			}
+		}
+
+		.bottom {
+			display: flex;
+			background-color: #fff;
+			border-radius: 20rpx;
+			margin: 40rpx;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+
+			.t {
+				display: flex;
+				width: 100%;
+				padding: 40rpx 30rpx;
+				box-sizing: border-box;
+				border-bottom: 1px solid #eee;
+
+				.p,
+				.num {
+					font-size: 30rpx;
+					color: #191919;
+				}
+
+				.num {
+					margin-left: auto;
+				}
+			}
+
+			.b {
+				display: flex;
+				width: 100%;
+				padding-bottom: 60rpx;
+
+				.item {
+					flex: 1;
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					justify-content: center;
+					box-sizing: border-box;
+
+					.num {
+						color: #191919;
+						font-size: 40rpx;
+						margin-top: 50rpx;
+						font-weight: bold;
+					}
+
+					.p {
+						color: #999;
+						margin-top: 10rpx;
+					}
+				}
+			}
+		}
+	}
+
+	.center-box {
+		position: relative;
+		z-index: 1;
+		background-color: #fff;
+		display: flex;
+		border-radius: 20rpx;
+		display: flex;
+		margin: 30rpx 40rpx;
+		padding: 15rpx;
+		box-shadow: 0 0 50rpx rgba(0, 0, 0, 0.07);
+
+		.item {
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+			min-height: 150rpx;
+			border-radius: 999px;
+			margin: 15rpx;
+
+			.p {
+				color: #191919;
+				font-size: 32rpx;
+			}
+
+			.num {
+				font-size: 36rpx;
+				color: #0080ff;
+				margin-top: 10rpx;
+			}
+		}
+
+		.l {
+			background-color: #fff8f5;
+		}
+
+		.r {
+			background-color: #fffcf0;
+		}
+	}
+
+	.btn-box {
+		position: relative;
+		z-index: 1;
+		display: flex;
+		border-radius: 20rpx;
+		display: flex;
+		margin: 30rpx;
+		padding: 30rpx;
+		flex-direction: column;
+
+		.btn {
+			height: 88rpx;
+			width: 70%;
+			color: #fff;
+			margin: 20rpx auto;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			border-radius: 10rpx;
+		}
+
+		.t {
+			background-color: #0080ff;
+		}
+
+		.b {
+			background-color: #ffb400;
+		}
+	}
+</style>

+ 3 - 4
app/pages/business-order/business-order.vue

@@ -53,9 +53,8 @@
 								&&perList.indexOf('tb-business-confirm')!=-1
 								&&customemrId!='1'" @click="sureZdFn(businessItem)">
 						支付账单</view>
-					<!-- <view class="btn b3" v-if="perList.indexOf('tb-business-pay')!=-1
-								&&businessItem.payStatus==1&&customemrId!='1'" @click="fkFn(businessItem)">
-						马上支付</view> -->
+					<view class="btn b3"  @click="fkFn(businessItem)">
+						证明</view>
 						<view class="btn b3" @click="toDetail(businessItem)">详情</view>
 					<view class="btn b1" v-if="businessItem.confirmInput==0" @click="editFn(businessItem)">修改</view>
 					<view class="btn b4" v-if="businessItem.payStatus==1
@@ -149,7 +148,7 @@
 				this.$common.to('/pages/wx/payOrderTemp?id=' + data.id)
 			},
 			fkFn(data) {
-				this.$common.to('/pages/business-order/surePay?id=' + data.id)
+				this.$common.to('/pages/business-order/report?id=' + data.id)
 			},
 			rcFn(data) {
 				this.$common.to('/pages/business-order/sureIn?id=' + data.id)

+ 180 - 0
app/pages/business-order/report.vue

@@ -0,0 +1,180 @@
+<template>
+	<view>
+		<view class="box">
+			<view class="top">
+				<text class="title">证明上传</text>
+			</view>
+			<view class="item">
+				<view class="l">核酸证明:</view>
+				<view class="r">
+					<view class="img">
+						<uni-file-picker v-model="nucleicReport" fileMediatype="image" mode="grid" limit="1"
+							@select="nucleicSelect" @delete="form.nucleicReport=''" :image-styles="imageStyles" />
+					</view>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">消杀合格证明:</view>
+				<view class="r">
+					<view class="img">
+						<uni-file-picker v-model="disinfectReport" fileMediatype="image" mode="grid" limit="1"
+							@select="disinfectSelect" @delete="form.disinfectReport=''" :image-styles="imageStyles" />
+					</view>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">检验检疫证:</view>
+				<view class="r">
+					<view class="img">
+						<uni-file-picker ref="checkReport" v-model="checkReport" fileMediatype="image" mode="grid"
+							limit="1" @select="checkSelect" @delete="form.checkReport=''" :image-styles="imageStyles" />
+					</view>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l">签发出库证明:</view>
+				<view class="r">
+					<view class="img">
+						<uni-file-picker v-model="outReport" fileMediatype="image" mode="grid" limit="1"
+							@select="outSelect" @delete="form.outReport=''" :image-styles="imageStyles" />
+					</view>
+				</view>
+			</view>
+		</view>
+		<u-button type="primary" @click="confirmFn">保存</u-button>
+	</view>
+</template>
+
+<script>
+	import request from '../../utils/request.js'
+	export default {
+		data() {
+			return {
+				id: '',
+				form: {
+					partMoney: 0
+				},
+				imgList: [],
+				outReport: [],
+				checkReport:[],
+				disinfectReport:[],
+				nucleicReport:[],
+				imageStyles: {
+					width: 150,
+					height: 100,
+					border: {
+						color: "#eee",
+						width: 1,
+						style: 'dashed',
+						radius: '5px'
+					}
+				},
+				uploadImageUrl: request.server + '/upload/image',
+			}
+		},
+		onLoad(options) {
+			this.id = options.id;
+		},
+		onShow() {
+			this.getBusinessById();
+		},
+		methods: {
+			outSelect(e) {
+				this.handlerUpload(e, 'outReport')
+			},
+			checkSelect(e) {
+				this.handlerUpload(e, 'checkReport')
+			},
+			disinfectSelect(e) {
+				this.handlerUpload(e, 'disinfectReport')
+			},
+			nucleicSelect(e) {
+				this.handlerUpload(e, 'nucleicReport')
+			},
+			handlerUpload(e, target) {
+				let that = this;
+				uni.uploadFile({
+					url: that.uploadImageUrl,
+					filePath: e.tempFilePaths[0],
+					name: 'file',
+					success: (resp => {
+						that.form[target] = JSON.parse(resp.data).data;
+					})
+				})
+			},
+			getBusinessById() {
+				this.$api.getBusinessById({
+					id: this.id
+				}).then(resp => {
+					this.form = resp.data;
+					if(this.form.nucleicReport){
+						this.nucleicReport=[{
+							'name':'payTicket.png',
+							'extname':'.png',
+							'url':this.form.nucleicReport
+						}]
+					}
+					if(this.form.disinfectReport){
+						this.disinfectReport=[{
+							'name':'payTicket.png',
+							'extname':'.png',
+							'url':this.form.disinfectReport
+						}]
+					}
+					if(this.form.checkReport){
+						this.checkReport=[{
+							'name':'payTicket.png',
+							'extname':'.png',
+							'url':this.form.checkReport
+						}]
+					}
+					if(this.form.outReport){
+						this.outReport=[{
+							'name':'payTicket.png',
+							'extname':'.png',
+							'url':this.form.outReport
+						}]
+					}
+				})
+			},
+			confirmFn() {
+				if (!this.form.nucleicReport) {
+					this.$common.toast('请上传核酸报告');
+					return;
+				}
+				if (!this.form.disinfectReport) {
+					this.$common.toast('请上传消杀合格证明');
+					return;
+				}
+				if (!this.form.checkReport) {
+					this.$common.toast('请上传入关检验检疫证');
+					return;
+				}
+				if (!this.form.outReport) {
+					this.$common.toast('请上传签发出库证明');
+					return;
+				}
+				this.$api.uploadReport(this.form).then(Resp => {
+					this.$common.toast('上传成功');
+					setTimeout(() => {
+						this.$common.back()
+					}, 500)
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.item-line {
+		color: #a2a2a2;
+		padding: 5px 0 10px 29px;
+		border-bottom: 1px solid #E5E5E5;
+	}
+
+	@import '@/common/common.scss'
+</style>

+ 180 - 33
app/pages/declare/add.vue

@@ -35,14 +35,14 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">件数:</view>
+				<view class="l"><text style="color: red;">*</text>件数:</view>
 				<view class="r">
 					<u-input type="number" placeholder="输入件数" @input="handler()" v-model="form.num">
 					</u-input>
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">生产日期:</view>
+				<view class="l"><text style="color: red;">*</text>生产日期:</view>
 				<view class="r">
 					<view class="r">
 						<uni-datetime-picker placeholder="请选择" @input="handler()" :clear-icon="false" type="date"
@@ -51,7 +51,7 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">保质期(天):</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>保质期(天):</view>
 				<view class="r">
 					<view class="r">
 						<u-input placeholder="输入保质期" type="number" @input="handler()" v-model="form.expirationDate" />
@@ -59,62 +59,69 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">储藏条件:</view>
+				<view class="l"><text style="color: red;">*</text>储藏条件:</view>
 				<view class="r">
 					<u-input placeholder="储存条件" @input="handler()" v-model="form.storageMode" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">生产方式:</view>
+				<view class="l"><text style="color: red;">*</text>生产方式:</view>
 				<view class="r">
 					<u-input placeholder="生产方式" @input="handler()" v-model="form.productionMode" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">原产国:</view>
+				<view class="l"><text style="color: red;">*</text>原产国:</view>
 				<view class="r">
 					<u-input placeholder="原产国" @input="handler()" v-model="form.origin" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">货主单位:</view>
+				<view class="l"><text style="color: red;">*</text>货主单位:</view>
 				<view class="r">
 					<u-input placeholder="货主单位" @input="handler()" v-model="form.sendUnit" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l" style="flex: 7;">生产商注册号:</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>生产商注册号:</view>
 				<view class="r">
-					<u-input placeholder="生产商注册号" @input="handler()" v-model="form.producerCode" />
+					<u-input placeholder="生产商注册号" @input="handler()" v-model="form.producerCode" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">收货单位:</view>
+				<view class="l"><text style="color: red;">*</text>收货单位:</view>
 				<view class="r">
 					<u-input placeholder="收货单位" @input="handler()" v-model="form.receiveUnit" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">货物流向:</view>
+				<view class="l"><text style="color: red;">*</text>货物流向:</view>
 				<view class="r">
 					<u-input placeholder="货物流向" @input="handler()" v-model="form.route" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">运输车辆:</view>
+				<view class="l"><text style="color: red;">*</text>运输车辆(车头牌):</view>
 				<view class="r">
-					<u--textarea @input="handler()" v-model="form.chinaCarNo" placeholder="运输车车牌,多个请用逗号隔开">
+					<u--textarea @input="handler()" v-model="form.chinaCarNo" placeholder="运输车车牌,多个请用逗号隔开">
 					</u--textarea>
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">司机姓名:</view>
+				<view class="l"><text style="color: red;">*</text>运输车辆(车尾牌):</view>
+				<view class="r">
+					<u--textarea @input="handler()" v-model="form.chinaCarNoSuff" placeholder="运输车车尾牌,多个请用逗号隔开">
+					</u--textarea>
+				</view>
+			</view>
+			<view class="item">
+				<view class="l"><text style="color: red;">*</text>司机姓名:</view>
 				<view class="r">
 					<u--textarea @input="handler()" v-model="form.driverName" placeholder="司机姓名,多个请用逗号隔开"></u--textarea>
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">司机电话:</view>
+				<view class="l"><text style="color: red;">*</text>司机电话:</view>
 				<view class="r">
 					<u--textarea @input="handler()" v-model="form.driverPhone" placeholder="司机电话,多个请用逗号隔开">
 					</u--textarea>
@@ -122,38 +129,38 @@
 			</view>
 
 			<view class="item">
-				<view class="l" style="flex: 7;">代理商电话:</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>代理商电话:</view>
 				<view class="r">
 					<u-input placeholder="代理商电话" @input="handler()" v-model="form.agentPhone" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l" style="flex: 7;">海关报关单据:</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>海关报关单据:</view>
 				<view class="r">
 					<u-input placeholder="海关报关单据" @input="handler()" v-model="form.customProof" />
 				</view>
 			</view>
 
 			<view class="item">
-				<view class="l" style="flex: 7;">检验检疫证:</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>检验检疫证:</view>
 				<view class="r">
 					<u-input placeholder="检验检疫证" @input="handler()" v-model="form.quarantineProof" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">商铺:</view>
+				<view class="l"><text style="color: red;">*</text>商铺:</view>
 				<view class="r">
 					<u-input placeholder="商铺" @input="handler()" v-model="form.shop" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">生产批号:</view>
+				<view class="l"><text style="color: red;">*</text>生产批号:</view>
 				<view class="r">
 					<u-input placeholder="生产批号" @input="handler()" v-model="form.productionCode" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">柜号:</view>
+				<view class="l"><text style="color: red;">*</text>柜号:</view>
 				<view class="r">
 					<u-input placeholder="柜号" @input="handler()" v-model="form.containerCode" />
 				</view>
@@ -197,6 +204,7 @@
 					driverPhone: '',
 					agent: '',
 					chinaCarNo: '',
+					chinaCarNoSuff:'',
 					carNo: '',
 					customProof: '',
 					quarantineProof: '',
@@ -217,8 +225,8 @@
 					declarePeople: '',
 					declarePhone: '',
 					goodsName: '',
-					grossWeight: 0,
-					num: 0,
+					grossWeight: '',
+					num: '',
 					productionDate: '',
 					expirationDate: '',
 					productionMode: '',
@@ -232,6 +240,7 @@
 					driverPhone: '',
 					agent: '',
 					chinaCarNo: '',
+					chinaCarNoSuff:'',
 					carNo: '',
 					customProof: '',
 					quarantineProof: '',
@@ -246,20 +255,51 @@
 			},
 			cleanStore() {
 				uni.removeStorageSync('declare')
+				uni.removeStorageSync('disinfect')
 			},
 			handler() {
-				uni.setStorageSync('declare', this.form);
+				let cacheObj = {
+					count: 0,
+					cache: this.form
+				}
+				uni.setStorageSync('declare', cacheObj);
+			},
+			addStoreCount() {
+				let cacheObj = {
+					count: 1,
+					cache: this.form
+				}
+				uni.setStorageSync('declare', cacheObj);
 			},
 			checkStore() {
 				let store = uni.getStorageSync('declare');
-				if (store && JSON.stringify(store) !== JSON.stringify(this.createModal())) {
+				if (store && store.count == 0) {
 					let that = this;
+					let cache = store.cache;
 					uni.showModal({
 						title: '提示',
 						content: '检测到您有未完成表单,是否继续?',
 						success(resp) {
 							if (resp.confirm) {
-								that.form = store
+								that.form = cache
+							} else {
+								that.cleanFn();
+							}
+						}
+					})
+				}
+				let disinfectStore = uni.getStorageSync('disinfect');
+				if (disinfectStore) {
+					let that = this;
+					let cache = disinfectStore.cache;
+					that.form.declarePeople = cache.declarePeople
+					that.form.declarePhone = cache.declarePhone
+					uni.showModal({
+						title: '提示',
+						content: '检测到最近有相似消杀申报信息,是否导入?',
+						success(resp) {
+							if (resp.confirm) {
+								that.form = cache
 							} else {
 								that.cleanFn();
 							}
@@ -272,27 +312,134 @@
 					this.$common.toast('请填写申报人');
 					return;
 				}
-				if (this.$common.isPhone(this.form.declarePhone)&&!this.form.declarePhone) {
-					this.$common.toast('请填写申报电话');
+				if (!this.$common.isPhone(this.form.declarePhone)) {
+					this.$common.toast('请填写正确的申报电话');
 					return;
 				}
 				if (!this.form.goodsName) {
 					this.$common.toast('请填写产品');
 					return;
 				}
-				if (!this.form.grossWeight || this.form.grossWeight <= 0) {
-					this.$common.toast('请填写毛重');
+				if (!this.form.grossWeight || !this.$common.isNum(this.form.grossWeight)) {
+					this.$common.toast('毛重只能填写数字');
+					return;
+				}
+				if (!this.form.num || !this.$common.isNum(this.form.num)) {
+					this.$common.toast('件数只能填整数');
+					return;
+				}
+
+				if (!this.form.productionDate) {
+					this.$common.toast('请选择生产日期');
+					return;
+				}
+				if (!this.form.expirationDate || !this.$common.isNum(this.form.expirationDate)) {
+					this.$common.toast('保质期为正数');
+					return;
+				}
+				if (!this.form.storageMode) {
+					this.$common.toast('请填写储藏条件');
+					return;
+				}
+				if (!this.form.productionMode) {
+					this.$common.toast('请填写生产方式');
+					return;
+				}
+				if (!this.form.origin) {
+					this.$common.toast('请输入原产国');
 					return;
 				}
+				if (!this.form.sendUnit) {
+					this.$common.toast('请填写货主单位');
+					return;
+				}
+				if (!this.form.producerCode) {
+					this.$common.toast('请填写生产商注册号');
+					return;
+				}
+				if (!this.form.receiveUnit) {
+					this.$common.toast('请填写收货单位');
+					return;
+				}
+				if (!this.form.route) {
+					this.$common.toast('请填写货物流向');
+					return;
+				}
+				let chinaCarNo = this.form.chinaCarNo;
+				if (!chinaCarNo) {
+					this.$common.toast('请填写运输车辆车头牌');
+					return;
+				}
+				let noArray=chinaCarNo.replace(",", ",").split(",");
+				for(let i in noArray){
+					if (!this.$common.isCarNo(noArray[i])) {
+						this.$common.toast('运输车头牌不正确');
+						return;
+					}
+				}
+				let chinaCarNoSuff = this.form.chinaCarNoSuff;
+				if (!chinaCarNoSuff) {
+					this.$common.toast('请填写运输车辆车尾牌');
+					return;
+				}
+				let suffArray=chinaCarNoSuff.replace(",", ",").split(",");
+				for(let i in suffArray){
+					if (!this.$common.isCarNo(suffArray[i])) {
+						this.$common.toast('运输车尾牌不正确');
+						return;
+					}
+				}
+				if (!this.form.driverName) {
+					this.$common.toast('请填写司机姓名');
+					return;
+				}
+				let driverPhone = this.form.driverPhone;
+				if (!driverPhone) {
+					this.$common.toast('请填写司机号码');
+					return;
+				}
+				let phoneArray=driverPhone.replace(",", ",").split(",");
+				for(let i in phoneArray){
+					let phone=phoneArray[i];
+					if (!this.$common.isPhone(phone)) {
+						this.$common.toast('司机联系号码不正确');
+						return;
+					}
+				}
+				if (!this.$common.isPhone(this.form.agentPhone)) {
+					this.$common.toast('代理商联系号码不正确');
+					return;
+				}
+				if (!this.form.customProof) {
+					this.$common.toast('海关报关单据');
+					return;
+				}
+				if (!this.form.quarantineProof) {
+					this.$common.toast('请填写检验检疫证');
+					return;
+				}
+				if (!this.form.shop) {
+					this.$common.toast('请填写商铺');
+					return;
+				}
+				if (!this.form.productionCode) {
+					this.$common.toast('请填写生产批号');
+					return;
+				}
+				if (!this.form.containerCode) {
+					this.$common.toast('请填写柜号');
+					return;
+				}
+
 				if (!this.form.carNo) {
-					this.$common.toast('请填写越南车牌');
+					this.$common.toast('请填写越南车牌');
 					return;
 				}
 				this.$api.addDeclare(this.$common.removeNull(this.form)).then(resp => {
-					this.cleanStore();
+					this.addStoreCount();
 					this.$common.to('/pages/declare/addDeclareSuccess')
 				})
-			}
+			},
 		},
 
 	}

+ 138 - 35
app/pages/disinfect/addDisinfect.vue

@@ -5,20 +5,20 @@
 				<text class="title">消毒申报单录入</text>
 			</view>
 			<view class="item">
-				<view class="l"  style="flex: 7;">发货人名称:</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>发货人名称:</view>
 				<view class="r">
 					<u-input placeholder="发货人名称" @input="handler()" v-model="form.sendPeople">
 					</u-input>
 				</view>
 			</view>
 			<view class="item">
-				<view class="l"  style="flex: 7;">收货人名称:</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>收货人名称:</view>
 				<view class="r">
 					<u-input placeholder="收货人名称" @input="handler()" v-model="form.receivePeople">
 					</u-input>
 				</view>
 			</view>
-		
+
 
 			<view class="item">
 				<view class="l"><text style="color: red;">*</text>品名:</view>
@@ -28,7 +28,7 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">数量:</view>
+				<view class="l"><text style="color: red;">*</text>数量:</view>
 				<view class="r">
 					<u-input type="number" placeholder="输入数量" @input="handler()" v-model="form.num">
 					</u-input>
@@ -42,17 +42,17 @@
 					</u-input>
 				</view>
 			</view>
-			
+
 			<view class="item">
-				<view class="l">产地:</view>
+				<view class="l"><text style="color: red;">*</text>产地:</view>
 				<view class="r">
 					<u-input placeholder="输入产地" @input="handler()" v-model="form.origin">
 					</u-input>
 				</view>
 			</view>
-		
+
 			<view class="item">
-				<view class="l">规格:</view>
+				<view class="l"><text style="color: red;">*</text>规格:</view>
 				<view class="r">
 					<u-input type="number" placeholder="输入规格" @input="handler()" v-model="form.unit">
 						<text slot="suffix">米</text>
@@ -60,7 +60,7 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">包装:</view>
+				<view class="l"><text style="color: red;">*</text>包装:</view>
 				<view class="r">
 					<view class="r">
 						<u-input placeholder="输入包装" @input="handler()" v-model="form.pack" />
@@ -68,49 +68,49 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">标记:</view>
+				<view class="l"><text style="color: red;">*</text>标记:</view>
 				<view class="r">
 					<u-input placeholder="标记" @input="handler()" v-model="form.flag" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">号码:</view>
+				<view class="l"><text style="color: red;">*</text>号码:</view>
 				<view class="r">
 					<u-input type="number" placeholder="号码" @input="handler()" v-model="form.phone" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">启运地:</view>
+				<view class="l"><text style="color: red;">*</text>启运地:</view>
 				<view class="r">
 					<u-input placeholder="启运地" @input="handler()" v-model="form.sourceAddress" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">到货口岸:</view>
+				<view class="l"><text style="color: red;">*</text>到货口岸:</view>
 				<view class="r">
 					<u-input placeholder="到货口岸" @input="handler()" v-model="form.arrivePart" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">运输工具:</view>
+				<view class="l"><text style="color: red;">*</text>运输工具:</view>
 				<view class="r">
 					<u-input placeholder="运输工具" @input="handler()" v-model="form.carName" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">工具号码:</view>
+				<view class="l"><text style="color: red;">*</text>工具号码:</view>
 				<view class="r">
 					<u-input placeholder="运输工具号码" @input="handler()" v-model="form.carNo" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l" style="flex: 7;">国内运输工具:</view>
+				<view class="l" style="flex: 7;"><text style="color: red;">*</text>国内运输工具:</view>
 				<view class="r">
 					<u-input placeholder="国内运输工具" @input="handler()" v-model="form.chinaCarName" />
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">工具号码:</view>
+				<view class="l"><text style="color: red;">*</text>工具号码:</view>
 				<view class="r">
 					<u-input placeholder="工具号码" @input="handler()" v-model="form.chinaCarNo" />
 				</view>
@@ -130,7 +130,7 @@
 				</view>
 			</view>
 			<view class="item">
-				<view class="l">申报单位:</view>
+				<view class="l"><text style="color: red;">*</text>申报单位:</view>
 				<view class="r">
 					<u-input placeholder="申报单位" @input="handler()" v-model="form.applyUnit">
 					</u-input>
@@ -160,8 +160,8 @@
 					declarePeople: '',
 					declarePhone: '',
 					goodsName: '',
-					grossWeight: 0,
-					num: 0,
+					grossWeight: '',
+					num: '',
 					origin: '',
 					unit: '',
 					pack: '',
@@ -185,6 +185,8 @@
 		methods: {
 			createModal() {
 				return {
+					sendPeople:'',
+					receivePeople:'',
 					declarePeople: '',
 					declarePhone: '',
 					goodsName: '',
@@ -209,21 +211,52 @@
 				this.cleanStore();
 			},
 			cleanStore() {
+				uni.removeStorageSync('disinfect')
 				uni.removeStorageSync('declare')
 			},
 			handler() {
-				uni.setStorageSync('declare', this.form);
+				let cacheObj = {
+					count: 0,
+					cache: this.form
+				}
+				uni.setStorageSync('disinfect', cacheObj);
+			},
+			addStoreCount() {
+				let cacheObj = {
+					count: 1,
+					cache: this.form
+				}
+				uni.setStorageSync('disinfect', cacheObj);
 			},
 			checkStore() {
-				let store = uni.getStorageSync('declare');
-				if (store && JSON.stringify(store) !== JSON.stringify(this.createModal())) {
+				let disinfectStore = uni.getStorageSync('disinfect');
+				if (disinfectStore && disinfectStore.count == 0) {
 					let that = this;
+					let cache=disinfectStore.cache;
 					uni.showModal({
 						title: '提示',
 						content: '检测到您有未完成表单,是否继续?',
 						success(resp) {
 							if (resp.confirm) {
-								that.form = store
+								that.form =cache 
+							} else {
+								that.cleanFn();
+							}
+						}
+					})
+				}
+				let declareStore = uni.getStorageSync('declare');
+				if(declareStore){
+					let that = this;
+					let cache=declareStore.cache;
+					that.form.declarePeople=cache.declarePeople
+					that.form.declarePhone=cache.declarePhone
+					uni.showModal({
+						title: '提示',
+						content: '检测到最近有相似申报信息,是否导入?',
+						success(resp) {
+							if (resp.confirm) {
+								that.form=cache;
 							} else {
 								that.cleanFn();
 							}
@@ -232,22 +265,92 @@
 				}
 			},
 			saveFn() {
-				if (!this.form.declarePeople) {
-					this.$common.toast('请填写申报人');
-					return;
-				}
-				if (!this.form.declarePhone) {
-					this.$common.toast('请填写申报电话');
-					return;
-				}
-				if (!this.form.grossWeight || this.form.grossWeight <= 0) {
-					this.$common.toast('请填写重量');
+				if(!this.check()){
 					return;
 				}
 				this.$api.addDisinfect(this.$common.removeNull(this.form)).then(resp => {
-					this.cleanStore();
+					this.addStoreCount();
 					this.$common.to('/pages/disinfect/addDisinfectSuccess')
 				})
+			},
+			check(){
+				if (!this.form.sendPeople) {
+					this.$common.toast('请填写发货人信息');
+					return false;
+				}
+				if (!this.form.receivePeople) {
+					this.$common.toast('请填写接货人信息');
+					return false;
+				}
+				if (!this.form.goodsName) {
+					this.$common.toast('请填写品名');
+					return false;
+				}
+				if (!this.$common.isNum(this.form.num)) {
+					this.$common.toast('数量请填写数字');
+					return false;
+				}
+				if (!this.$common.isNum(this.form.grossWeight)) {
+					this.$common.toast('请填写重量');
+					return false;
+				}
+				if (!this.form.origin) {
+					this.$common.toast('请填写原产地');
+					return false;
+				}
+				if (!this.$common.isNum(this.form.unit)) {
+					this.$common.toast('规格只能填写数字');
+					return false;
+				}
+				if (!this.form.pack) {
+					this.$common.toast('请填写包装');
+					return false;
+				}
+				if (!this.form.flag) {
+					this.$common.toast('请填写标记');
+					return false;
+				}
+				if (!this.$common.isPhone(this.form.phone)) {
+					this.$common.toast('请填写正确号码');
+					return false;
+				}
+				if (!this.form.sourceAddress) {
+					this.$common.toast('请填写启运地');
+					return false;
+				}
+				if (!this.form.arrivePart) {
+					this.$common.toast('请填写到货口岸');
+					return false;
+				}
+				if (!this.form.carName) {
+					this.$common.toast('请填写运输工具');
+					return false;
+				}
+				if (!this.form.carNo) {
+					this.$common.toast('请填写工具号码');
+					return false;
+				}
+				if (!this.form.chinaCarName) {
+					this.$common.toast('请填写国内运输工具');
+					return false;
+				}
+				if (!this.form.chinaCarNo) {
+					this.$common.toast('请填写国内运输工具号码');
+					return false;
+				}
+				if (!this.form.declarePeople) {
+					this.$common.toast('请填写申请人');
+					return false;
+				}
+				if (!this.$common.isPhone(this.form.declarePhone)) {
+					this.$common.toast('请填写正确申请电话');
+					return false;
+				}
+				if (!this.form.applyUnit) {
+					this.$common.toast('请填写申请单位');
+					return false;
+				}
+				return true;
 			}
 		},
 

+ 24 - 1
app/pages/index/index.vue

@@ -100,7 +100,30 @@
 					text: '出入记录',
 					url: '/pages/inout-record/inout-record',
 					show:true
-				}	]
+				},
+				{
+					auth: true,
+					icon: '../../static/home-icon-07.jpg',
+					text: '申报信息录入',
+					url: '/pages/declare/add',
+					show:true
+				},
+				{
+					auth: true,
+					icon: '../../static/home-icon-06.jpg',
+					text: '消杀申报',
+					url: '/pages/disinfect/addDisinfect',
+					show:true
+				},
+				{
+					auth: true,
+					icon: '../../static/home-icon-06.jpg',
+					text: '账户充值',
+					url: '/pages/account/index',
+					show:true
+				},
+					
+					]
 			},
 			getStoreInfo() {
 				let info = uni.getStorageSync('info');

+ 88 - 30
app/pages/wx/pay.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view class="box">
 			<view class="top" style="padding-top: 50rpx;">
-				<text class="title">支付</text>
+				<text class="title">缴纳费用</text>
 			</view>
 			<u-search placeholder="输入车牌号查询" shape="square" v-model="p.carNo" @search="searchFn()" @change="searchFn"
 				:height="80" style="margin: 30rpx;">
@@ -11,7 +11,7 @@
 		<view class="list" v-show="list.length>0">
 			<u-radio-group placement="column" @change="groupChange">
 				<u-radio :customStyle="{marginBottom: '6px',borderBottom: '1px solid #e5e5e5',paddingBottom:'5px'}"
-					v-for="(item, index) in list" :key="index" :label="item.carNo" :name="item.businessId">
+					v-for="(item, index) in list" :key="index" :label="item.carNo" :name="item.id">
 				</u-radio>
 			</u-radio-group>
 		</view>
@@ -20,24 +20,39 @@
 				<view class="title">
 					停车费:
 				</view>
-				<view v-for="(tingcheItem,index) in cars" :key="index">
-					<label class="c-item">
-						<view class="c">{{tingcheItem.carNo}}</view>
-						<view class="r">{{tingcheItem.price}}元</view>
-					</label>
-				</view>
+				<u-checkbox-group v-model="carsSelect" placement="column">
+					<view v-for="(item,index) in cars" :key="index">
+						<label class="c-item">
+							<view class="l">
+								<u-checkbox :customStyle="{marginBottom: '8px'}" :name="item.id">
+								</u-checkbox>
+							</view>
+							<view class="c">{{item.carNo}}</view>
+							<view class="r">{{item.price}}元</view>
+						</label>
+					</view>
+				</u-checkbox-group>
 			</view>
 
 			<view class="card" v-if="item.itemsPrice">
 				<view class="title">
-					业务费:{{item.itemsPrice}}元
-				</view>
-				<view v-for="(yewuItem,index) in item.list" :key="index">
-					<label class="c-item">
-						<view class="c">{{yewuItem.name}}</view>
-						<view class="r">{{yewuItem.price}}元</view>
-					</label>
+					<u-checkbox-group placement="column" v-model="businessSelect" @change="businessChange">
+						<u-checkbox :customStyle="{color: 'black'}" :label="'业务费:'+item.itemsPrice+'元'" :name='1'>
+						</u-checkbox>
+					</u-checkbox-group>
 				</view>
+				<u-checkbox-group placement="column" v-model="itemSelect">
+					<view v-for="(item,index) in item.list" :key="index">
+						<label class="c-item">
+							<view class="l">
+								<u-checkbox :customStyle="{marginBottom: '8px'}" disabled :name="item.id">
+								</u-checkbox>
+							</view>
+							<view class="c">{{item.name}}</view>
+							<view class="r">{{item.price}}元</view>
+						</label>
+					</view>
+				</u-checkbox-group>
 			</view>
 		</view>
 
@@ -67,16 +82,17 @@
 				code: '',
 				selectNo: '',
 				openid: '',
-				businessId: '',
+				carsSelect: [],
+				itemSelect: [],
+				businessSelect: [],
 				state: '',
 				list: [],
 				cars: [],
 				item: {
-					itemsPrice: '',
+					itemsPrice: 0,
 					businessId: '',
 					list: []
 				},
-				total: 0,
 				payTypeList: [{
 					name: '微信支付',
 					value: 3
@@ -101,16 +117,35 @@
 		beforeDestroy() {
 			this.$common.hidingLoading()
 		},
+		computed: {
+			total() {
+				let carIds = this.carsSelect;
+
+				let carMoney = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1)
+					.map(obj => obj.price).reduce(function(pre, cur) {
+						return pre + cur;
+					}, 0);
+				let itemIds = this.itemSelect;
+				let itemMoney = this.item.list.filter(obj => itemIds.indexOf(obj.id) !== -1)
+					.map(obj => obj.price).reduce(function(pre, cur) {
+						return pre + cur;
+					}, 0);
+				return carMoney + itemMoney;
+			}
+		},
 		methods: {
+			businessChange(value) {
+				this.itemSelect = value.length == 0 ? this.itemSelect = [] : this.item.list.map(obj => obj.id)
+			},
 			getChannelCar() {
 				if (this.state !== 'STATE') {
 					this.$api.getPartCarByChannel({
 						channel: this.state
 					}).then(resp => {
 						let data = resp.data;
-						if (data.cars&&data.cars.length > 0) {
-							this.total = data.total;
+						if (data.cars && data.cars.length > 0) {
 							this.cars = data.cars;
+							this.carsSelect = [data.cars[0].id];
 						}
 					})
 				}
@@ -137,11 +172,16 @@
 				})
 			},
 			confirmPayFn() {
-				let businessId = this.state == 'STATE' ? this.businessId : null;
-				let carId = this.state == 'STATE' ? null : this.cars.map(obj => obj.id).join(',')
+				let carIds = this.carsSelect
+				let cars = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1);
 				let p = {
-					businessId: businessId,
-					carId: carId,
+					b: this.businessSelect.length > 0 ? this.item.businessId : '',
+					c: JSON.stringify(cars.map(obj => {
+						return {
+							id: obj.id,
+							p: obj.price
+						}
+					})),
 					money: this.total,
 					tradeType: "JSAPI",
 					openid: this.openid
@@ -185,21 +225,26 @@
 
 				})
 			},
-			groupChange(value) {
-				this.list = [];
-				this.businessId = value;
+			groupChange(carId) {
 				this.$api.getBusinessMoney({
-					businessId: value,
+					carId: carId,
 					state: this.state
 				}).then(resp => {
 					let data = resp.data;
 					this.cars = data.carList;
-					this.total = data.total;
+					this.carsSelect = [carId]
 					Object.assign(this.item, {
 						itemsPrice: data.itemsPrice,
-						businessId: value,
+						businessId: data.businessId,
 						list: data.itemList
 					})
+					let selectCar = this.list.filter(obj => obj.id == carId).pop();
+					let carNo = selectCar.carNo;
+					if (!this.$common.isCarNo(carNo)) {
+						this.itemSelect = data.itemList.map(obj => obj.id)
+						this.businessSelect = [1]
+					}
+					this.list = [];
 					if (data.total == 0) {
 						this.$common.toast('您无需缴费');
 						this.p.carNo = ''
@@ -209,6 +254,15 @@
 			searchFn() {
 				if (!this.p.carNo) {
 					this.list = [];
+					this.cars = [];
+					this.carsSelect = [];
+					this.itemSelect = [];
+					this.businessSelect = []
+					this.item = {
+						itemsPrice: '',
+						businessId: '',
+						list: []
+					}
 				} else {
 					this.$api.searchPartCar(this.p).then(resp => {
 						this.list = resp.data;
@@ -225,6 +279,10 @@
 		background-color: #fff;
 	}
 
+	.list {
+		margin: 40rpx;
+	}
+
 	.card {
 		.title {
 			padding: 30rpx;

二進制
app/static/home-icon-06.jpg


二進制
app/static/home-icon-07.jpg


+ 2 - 2
app/utils/request.js

@@ -1,6 +1,6 @@
-// const server = 'http://127.0.0.1:8099/pro';
+const server = 'http://127.0.0.1:8099/pro';
 // const server = 'http://47.101.143.145/pro';
- const server = 'https://dxkaa1.bgigc.com/pro';
+ // const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';
 

+ 2 - 2
sp-admin/login.html

@@ -118,8 +118,8 @@
 
 			// 所有参考属性  
 			var page_title = '场站管理系统 后台登录'; // 页面标题
-			var key = 'sa'; // 默认的账号
-			var password = '123456'; // 默认的password  
+			var key = ''; // 默认的账号
+			var password = ''; // 默认的password  
 			var logo = ''; // logo地址,为空字符串则不显示
 
 			// 点击登录按钮 

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

@@ -27,7 +27,7 @@ var menuList =	[
 			{id: 'tb-costomer-maintain', name: '信息维护', url: 'sa-view/tb-costomer/tb-costomer-maintain.html'},
 		]
 	},
-
+	
 	{
 		id: 'tb-business',
 		name: '业务录入',
@@ -131,4 +131,14 @@ var menuList =	[
 			{id: 'tb-disinfect-list', name: '申请列表', url: 'sa-view/tb-disinfect/tb-disinfect-list.html'},
 		]
 	},
+	{
+		id: 'tb-discount',
+		name: '折扣管理',
+		icon: 'el-icon-folder-opened',
+		info: '折扣管理表数据的维护',
+		childList: [
+			{id: 'tb-discount-list', name: '折扣管理-列表', url: 'sa-view/tb-discount/tb-discount-list.html'},
+			{id: 'tb-discount-add', name: '折扣管理-添加', url: 'sa-view/tb-discount/tb-discount-add.html'},
+		]
+	},
 ]

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

@@ -31,25 +31,27 @@
 					</sa-td>
 					<sa-td width=100 name="车辆状态" prop="isLock" type="switch" :jv="{1: '锁定[#ff0000]', 0: '正常[#005500]'}"
 						@change="s => updateStatus(s.row)"></sa-td>
+						<el-table-column label="预交停车费">
+							<template slot-scope="s">
+								<label>{{s.row.basePartMoney}}</label>
+							</template>
+						</el-table-column>
+						<el-table-column label="已交费用">
+							<template slot-scope="s">
+								<label v-if="s.row.money">{{s.row.money}}</label>
+								<label v-else>-</label>
+							</template>
+						</el-table-column>
 					<sa-td name="联系人" prop="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="实际停车费">
-						<template slot-scope="s">
-							<label v-if="s.row.money">{{s.row.money}}</label>
-							<label v-else>未计算</label>
-						</template>
-					</el-table-column>
-				
-					
 					<el-table-column label="操作" fixed="right" width="200px">
 						<template slot-scope="s">
+							<el-button class="c-btn" type="primary"  v-if="s.row.realInTime==null" @click="inFn(s.row)">确认入场
+							</el-button>
+							<el-button class="c-btn" type="primary"  v-if="s.row.realInTime!=null&&s.row.realOutTime==null" @click="outFn(s.row)">确认离场
+							</el-button>
 							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
 							</el-button>
 							<el-button v-if="s.row.pay==0" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
@@ -63,6 +65,38 @@
 				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
 				</sa-item>
 			</div>
+		<el-dialog title="确认入场" :visible.sync="rc.visible" width="400px">
+			<el-form label-position="left">
+				<div class="confirm-in">
+					<sa-item type="datetime" name="入场时间" v-model="rc.form.realInTime" br></sa-item>
+					<div class="c-item">
+						<label class="c-label"><span style="color: red;">*</span>入场通道:</label>
+						<el-input v-model="rc.form.inChannel" placeholder="入场通道" >
+						</el-input>
+					</div>
+				</div>
+			</el-form>
+			<span slot="footer" class="dialog-footer">
+				<el-button @click="rc.visible = false">取 消</el-button>
+				<el-button type="primary" @click="sureInFn">确 认</el-button>
+			</span>
+		</el-dialog>
+		<el-dialog title="确认离场" :visible.sync="out.visible" width="400px">
+			<el-form label-position="left">
+				<div class="confirm-in">
+					<sa-item type="datetime" name="离场时间" v-model="out.form.realOutTime" br></sa-item>
+					<div class="c-item">
+						<label class="c-label"><span style="color: red;">*</span>离场通道:</label>
+						<el-input v-model="out.form.outChannel" placeholder="离场通道" >
+						</el-input>
+					</div>
+				</div>
+			</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({
@@ -89,8 +123,64 @@
 					},
 					dataCount: 0,
 					dataList: [], // 数据集合 
+					rc:{
+						visible:false,
+						form:{
+							realInTime:'',
+							inChannel:''
+						}
+					},
+					out:{
+						visible:false,
+						form:{
+							realOutTime:'',
+							outChannel:''
+						}
+					}
 				},
 				methods: {
+					inFn(data){
+						Object.assign(this.rc,{
+							visible:true,
+							form:data
+						})
+					},
+					sureInFn(){
+						if(!this.rc.form.realInTime){
+							sa.error('请填写入场时间')
+							return;
+						}
+						if(!this.rc.form.inChannel){
+							sa.error('请填写入场通道')
+							return;
+						}
+						sa.ajax('/TbBusinessCar/update', this.rc.form, function(res) {
+							sa.alert('操作成功');
+							this.rc.visible=false;
+							this.f5();
+						}.bind(this));
+					},
+					outFn(data){
+						Object.assign(this.out,{
+							visible:true,
+							form:data
+						})
+					},
+					sureOutFn(){
+						if(!this.out.form.realOutTime){
+							sa.error('请填写离场时间')
+							return;
+						}
+						if(!this.out.form.outChannel){
+							sa.error('请填写离场通道')
+							return;
+						}
+						sa.ajax('/TbBusinessCar/update', this.out.form, function(res) {
+							sa.alert('操作成功');
+							this.out.visible=false;
+							this.f5();
+						}.bind(this));
+					},
 					// 刷新
 					f5: function() {
 						sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {

+ 3 - 2
sp-admin/sa-view/tb-business/tb-business-add.html

@@ -531,8 +531,9 @@
 					},
 					confirmAddCar() {
 						let carNo = this.car.form.carNo;
-						if (!carNo) {
-							sa.error('请填入车牌号')
+						console.log(carNo);
+						if (!sa.isCarNo(carNo)) {
+							sa.error('请填入正确的车牌号')
 							return false;
 						}
 						if (!this.car.form.carSize) {

+ 3 - 2
sp-admin/sa-view/tb-business/tb-business-edit.html

@@ -405,8 +405,9 @@
 					},
 					confirmAddCar() {
 						let carNo = this.car.form.carNo;
-						if (!carNo) {
-							sa.error('请填入车牌号')
+						
+						if (!sa.isCarNo(carNo)) {
+							sa.error('请填入正确的车牌号')
 							return false;
 						}
 						if (!this.car.form.carSize) {

+ 148 - 0
sp-admin/sa-view/tb-discount/tb-discount-add.html

@@ -0,0 +1,148 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>折扣管理-添加/修改</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
+			.discount .el-input__inner{
+				width: 130px;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m">
+						<sa-item type="text" name="标题" placeholder="优惠标题" v-model="m.title" br></sa-item>
+						<div class="c-item" class="br">
+							<label class="c-label">类型:</label>
+							<el-radio-group v-model="m.type" @change="typeChangeFn">
+								<el-radio :label="1">折扣</el-radio>
+								<el-radio :label="2">满减</el-radio>
+							</el-radio-group>
+						</div>
+						<div class="c-item" class="br">
+							<label class="c-label">充值金额:</label>
+							  <el-input-number class="discount" v-model="m.money" :step="100" controls-position="right" :min="1" :max="99999">
+							  </el-input-number>
+							  <label>元</label>
+						</div>
+						<div class="c-item" class="br" v-if="m.type==1">
+							<label class="c-label">折扣:</label>
+							  <el-input-number class="discount" v-model="m.discount" :step="0.1" controls-position="right" :min="1" :max="10">
+							  </el-input-number>
+							  <label>折</label>
+						</div>
+						<div class="c-item" class="br" v-if="m.type==2">
+							<label class="c-label">优惠金额:</label>
+							  <el-input-number class="discount" v-model="m.subtract" :step="5" controls-position="right" :min="0" :max="9999">
+							  </el-input-number>
+							  <label>元</label>
+						</div>
+						<sa-item name="" class="s-ok" br>
+							<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
+						</sa-item>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					m: null, // 实体对象 
+				},
+				methods: {
+					// 创建一个 默认Model 
+					createModel: function() {
+						return {
+							id: '', // 主键 
+							title: '', // 标题 
+							type: 1, // 类型[j] 
+							discount: 10, // 折扣 
+							subtract:0,
+							money: 100, // 充值金额 
+							status: '1', // 状态[j] 
+							createTime: '', // 创建时间 
+						}
+					},
+					typeChangeFn(value) {
+						console.log(value)
+					},
+					// 提交数据 
+					ok: function() {
+						// 表单校验 
+						let m = this.m;
+						sa.checkNull(m.title, '请输入 [标题]');
+						sa.checkNull(m.money, '请输入 [充值金额]');
+
+						// 开始增加或修改
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbDiscount/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
+							}.bind(this));
+						} else { // 修改
+							sa.ajax('/TbDiscount/update', m, function(res) {
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if (this.id == 0) {
+							this.m = this.createModel();
+						} else {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}
+					}
+				},
+				mounted: function() {
+					// 初始化数据 
+					if (this.id <= 0) {
+						this.m = this.createModel();
+					} else {
+						sa.ajax('/TbDiscount/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							if (res.data == null) {
+								sa.alert('未能查找到 id=' + this.id + " 详细数据");
+							}
+						}.bind(this))
+					}
+				}
+			})
+		</script>
+	</body>
+</html>

+ 73 - 0
sp-admin/sa-view/tb-discount/tb-discount-info.html

@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>折扣管理-详情</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .c-label {
+				width: 8em;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<el-form v-if="m">
+						<sa-info name="标题" br>{{m.title}}</sa-info>
+						<sa-info name="类型" br>
+							<label v-if="m.type==1">折扣</label>
+							<label v-if="m.type==2">满减</label>
+						</sa-info>
+						<sa-info name="充值金额" br>{{m.money}}</sa-info>
+						<sa-info v-if="m.type==1" name="折扣" br>{{m.discount}}折</sa-info>
+						<sa-info v-if="m.type==2" name="优惠" br>{{m.subtract}}元</sa-info>
+						<sa-info name="状态" br>
+							<label v-if="m.status==0">禁用</label>
+							<label v-if="m.status==1">启用</label>
+						</sa-info>
+						<sa-info name="创建时间" br>{{m.createTime}}</sa-info>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="success" @click="sa.closeCurrIframe()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取数据ID 
+					m: null
+				},
+				methods: {},
+				mounted: function() {
+					sa.ajax('/TbDiscount/getById?id=' + this.id, function(res) {
+						this.m = res.data;
+						if (res.data == null) {
+							sa.alert('未能查找到 id=' + this.id + " 详细数据");
+						}
+					}.bind(this))
+				}
+			})
+		</script>
+	</body>
+</html>

+ 164 - 0
sp-admin/sa-view/tb-discount/tb-discount-list.html

@@ -0,0 +1,164 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>折扣管理-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<div class="c-title">检索参数</div>
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="标题" v-model="p.title"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+				</el-form>
+				<!-- ------------- 快捷按钮 ------------- -->
+				<sa-item style="display: inline;" type="fast-btn" show="add,get,delete,reset"></sa-item>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 10px;">
+					<sa-td type="selection"></sa-td>
+					<sa-td name="标题" prop="title"></sa-td>
+					<sa-td width="130" name="类型" prop="type" type="enum" :jv="{1: '折扣[#005500]', 2: '满减[#005500]'}">
+					</sa-td>
+					<sa-td name="折扣" prop="discount"></sa-td>
+					<sa-td name="充值金额" prop="money"></sa-td>
+					<sa-td width=100 name="状态" prop="status" type="switch" :jv="{0: '禁用[#ff0000]', 1: '启用[#005500]'}"
+						@change="s => updateStatus(s.row)"></sa-td>
+					<sa-td name="创建时间" prop="createTime"></sa-td>
+					<el-table-column label="操作" fixed="right" width="240px">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
+							</el-button>
+							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+							</el-button>
+							<el-button class="c-btn" type="danger" icon="el-icon-delete" @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>
+			</div>
+		</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'),
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数  
+						id: '', // 主键 
+						title: '', // 标题 
+						type: '', // 类型[j] 
+						discount: '', // 折扣 
+						money: '', // 充值金额 
+						status: '', // 状态[j] 
+						createTime: '', // 创建时间 
+						pageNo: 1, // 当前页 
+						pageSize: 10, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合 
+				},
+				methods: {
+					// 改 - 状态(0=否,1=是)
+					updateStatus: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;
+						var oldValue = data.status;
+						var ajax = sa.ajax('/TbDiscount/updateStatus', {
+							id: data.id,
+							value: data.status
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.status = oldValue;
+							}
+						})
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbDiscount/getList', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight(); // 刷新表格高度 
+						}.bind(this));
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'tb-discount-info.html?id=' + data.id, '600px', '60%');
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if (selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.get(selection[0]);
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'tb-discount-add.html?id=' + data.id, '600px', '60%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'tb-discount-add.html?id=-1', '600px', '60%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbDiscount/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 批量删除
+					deleteByIds: function() {
+						// 获取选中元素的id列表 
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if (selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						// 提交删除 
+						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+							sa.ajax('/TbDiscount/deleteByIds', {
+								ids: ids.join(',')
+							}, function(res) {
+								sa.arrayDelete(this.dataList, selection);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 9 - 1
sp-admin/static/sa.js

@@ -739,11 +739,19 @@ var sa = {
 		// 正则验证是否为手机号
 		me.isPhone = function(str) {
 			str = str + '';
-			if((/^1[34578]\d{9}$/.test(str))){ 
+			if((/^1[345678]\d{9}$/.test(str))){ 
 				return true; 
 			} 
 			return false;
 		}
+		me.isCarNo=function(str){
+			str=str+'';
+			let reg=/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
+			if(reg.test(str)){
+				return true;
+			}
+			return false;
+		}
 		me.isNum = function(str) {
 			str = str + '';
 			if((/^[0-9]*$/.test(str))||(/^[0-9]+(.[0-9]{1})?$/.test(str))){ 

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-37868
+25664

+ 6 - 6
sp-server/pom.xml

@@ -117,12 +117,12 @@
         	<artifactId>spring-boot-configuration-processor</artifactId>
         	<optional>true</optional>
         </dependency>
-        <!--jwt-->
-        <dependency>
-            <groupId>com.auth0</groupId>
-            <artifactId>java-jwt</artifactId>
-            <version>3.3.0</version>
-        </dependency>
+
+		<dependency>
+			<groupId>com.fasterxml.jackson.dataformat</groupId>
+			<artifactId>jackson-dataformat-xml</artifactId>
+			<version>2.9.7</version>
+		</dependency>
 	</dependencies>
 
 

+ 28 - 19
sp-server/src/main/java/com/pj/api/h5/ApiController.java

@@ -27,6 +27,7 @@ import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.SortedMap;
 
 @RequestMapping(value = "/api")
 @RestController
@@ -41,81 +42,89 @@ public class ApiController {
     TbCostomerService tbCostomerService;
 
 
-
-    /** 账号、密码登录  */
+    /**
+     * 账号、密码登录
+     */
     @RequestMapping("doLogin")
     AjaxJson doLogin(String key, String password) {
         // 1、验证参数
-        if(NbUtil.isOneNull(key, password)) {
+        if (NbUtil.isOneNull(key, password)) {
             return AjaxJson.getError("请提供key与password参数");
         }
         return spAccAdminService.doLogin(key, password);
     }
 
     @PostMapping(value = "register")
-    public AjaxJson register(TbCostomer costomer){
+    public AjaxJson register(TbCostomer costomer) {
         tbCostomerService.register(costomer);
         return AjaxJson.getSuccess();
     }
 
     @RequestMapping(value = "getInOutRecord")
-    public AjaxJson getInOutRecord(){
+    public AjaxJson getInOutRecord() {
         SoMap so = SoMap.getRequestSoMap();
         String currentCustomerId = StpUserUtil.getCustomerId();
         if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
-            so.put("customerId",currentCustomerId);
+            so.put("customerId", currentCustomerId);
         }
         List<InOutRecordBO> recordList = apiService.getInOutRecord(so.startPage());
         return AjaxJson.getPageData(so.getDataCount(), recordList);
     }
 
     @RequestMapping(value = "getCustomerList")
-    public AjaxJson getCustomerList(){
+    public AjaxJson getCustomerList() {
         SoMap so = SoMap.getRequestSoMap();
         String currentCustomerId = StpUserUtil.getCustomerId();
         if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
-            so.put("id",currentCustomerId);
+            so.put("id", currentCustomerId);
         }
         List<TbCostomer> list = apiService.getCustomerList(so.startPage());
         return AjaxJson.getPageData(so.getDataCount(), list);
     }
 
     @PostMapping(value = "confirmCustomer")
-    public AjaxJson confirmCustomer(Long customerId, String judgeContent){
+    public AjaxJson confirmCustomer(Long customerId, String judgeContent) {
         apiService.confirmCustomer(customerId, judgeContent);
         return AjaxJson.getSuccess();
     }
+
     @PostMapping(value = "confirm")
-    public AjaxJson confirmPay(){
+    public AjaxJson confirmPay() {
         SoMap so = SoMap.getRequestSoMap();
-      String id=  so.getString("id");
-      apiService.confirm(Collections.singletonList(id));
+        String id = so.getString("id");
+        apiService.confirm(Collections.singletonList(id));
         return AjaxJson.getSuccess();
     }
+
     @GetMapping(value = "searchPartCar")
-    public AjaxJson searchPartCar(String carNo){
-       List<TbBusinessCar>list= apiService.searchPartCar(carNo);
+    public AjaxJson searchPartCar(String carNo) {
+        List<TbBusinessCar> list = apiService.searchPartCar(carNo);
         return AjaxJson.getSuccessData(list);
     }
 
     @GetMapping(value = "getBusinessMoney")
-    public AjaxJson getBusinessMoney(String businessId,@RequestParam(required = false) String state){
-        return AjaxJson.getSuccessData(apiService.getBusinessMoney(businessId,state));
+    public AjaxJson getBusinessMoney(String carId, @RequestParam(required = false) String state) {
+        return AjaxJson.getSuccessData(apiService.getBusinessMoney(carId, state));
     }
 
     @GetMapping(value = "getPartCarByChannel")
-    public AjaxJson getPartCarByChannel(String channel){
+    public AjaxJson getPartCarByChannel(String channel) {
         return AjaxJson.getSuccessData(apiService.getPartCarByChannel(channel));
     }
+
     @PostMapping(value = "addDeclare")
-    public AjaxJson addDeclare(@RequestBody TbDeclare tbDeclare){
+    public AjaxJson addDeclare(@RequestBody TbDeclare tbDeclare) {
         apiService.addDeclare(tbDeclare);
         return AjaxJson.getSuccess();
     }
+
     @PostMapping(value = "addDisinfect")
-    public AjaxJson addDisinfect(@RequestBody TbDisinfect tbDisinfect){
+    public AjaxJson addDisinfect(@RequestBody TbDisinfect tbDisinfect) {
         apiService.addDisinfect(tbDisinfect);
         return AjaxJson.getSuccess();
     }
 
+
+
+
 }

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

@@ -68,6 +68,7 @@ public class OpenService {
     }
 
     private ResultJson handlerOut(String carNo, String channel) {
+        carNo=carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findNotOutCar(carNo);
         if (tbBusinessCar == null) {
             return ResultJson.error("未查询到入场记录");
@@ -80,7 +81,13 @@ public class OpenService {
         if (StrUtil.isEmpty(businessId)) {
             return ResultJson.success();
         }
-        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now, tbBusinessCar.getCarSize());
+        if (!CAR_LIST.contains(StrUtil.sub(carNo,0,1))){
+            TbBusiness business = tbBusinessService.getById(businessId);
+            if (business.getPayStatus() != 3 && business.getCustomerType() != 2) {
+                return ResultJson.error("请缴纳业务费用");
+            }
+        }
+        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now);
         double dif = price.subtract(tbBusinessCar.getMoney()).doubleValue();
         if (dif > 0) {
             tbBusinessCar.setPay(0);
@@ -88,10 +95,6 @@ public class OpenService {
             RedisUtil.set(channel,carNo);
             return ResultJson.error("请缴停车费" + dif + "元");
         }
-        TbBusiness business = tbBusinessService.getById(businessId);
-        if (business.getPayStatus() != 3 && business.getCustomerType() != 2) {
-            return ResultJson.error("请缴纳业务费用");
-        }
         tbBusinessCar.setRealOutTime(now).setOutChannel(channel);
         tbBusinessCarService.updateById(tbBusinessCar);
         return ResultJson.success();

+ 13 - 3
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import com.pj.api.bo.InOutRecordBO;
+import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_business_car.TbBusinessCar;
@@ -19,6 +20,7 @@ import com.pj.project.tb_district.TbDistrict;
 import com.pj.project.tb_district.TbDistrictService;
 import com.pj.project.tb_pass_record.TbPassRecord;
 import com.pj.project.tb_pass_record.TbPassRecordService;
+import com.pj.project4sp.admin.SpAdmin;
 import com.pj.utils.cache.RedisUtil;
 import com.pj.utils.so.SoMap;
 import lombok.extern.slf4j.Slf4j;
@@ -91,8 +93,8 @@ public class ApiService {
         tbBusinessService.confirm(ids);
     }
 
-    public Map<String, Object> getBusinessMoney(String businessId, String state) {
-        return tbBusinessService.getBusinessMoney(businessId, state);
+    public Map<String, Object> getBusinessMoney(String carId, String state) {
+        return tbBusinessService.getBusinessMoney(carId, state);
     }
 
     public Map<String, Object> getPartCarByChannel(String channel) {
@@ -103,7 +105,7 @@ public class ApiService {
             return result;
         }
         Date now = new Date();
-        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now, tbBusinessCar.getCarSize());
+        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now);
         BigDecimal dif = price.subtract(tbBusinessCar.getMoney());
         Map<String, Object> car = new HashMap<>();
         car.put("id", tbBusinessCar.getId());
@@ -125,6 +127,10 @@ public class ApiService {
             carNo = carNo.toUpperCase();
             tbDeclare.setCarNo(carNo);
         }
+        SpAdmin admin=StpUserUtil.getAdmin();
+        if (admin!=null) {
+            tbDeclare.setCustomerId(admin.getCustomerId());
+        }
         String productionCode = tbDeclare.getProductionCode();
         Date now = new Date();
         if (StrUtil.isNotEmpty(productionCode)) {
@@ -142,6 +148,10 @@ public class ApiService {
     }
 
     public void addDisinfect(TbDisinfect tbDisinfect) {
+        SpAdmin admin=StpUserUtil.getAdmin();
+        if (admin!=null) {
+            tbDisinfect.setCustomerId(admin.getCustomerId());
+        }
         String nowStr = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
         tbDisinfect.setCode(nowStr + RandomUtil.randomNumbers(6)).setApplyTime(DateUtil.now());
         tbDisinfectService.save(tbDisinfect);

+ 10 - 10
sp-server/src/main/java/com/pj/api/wx/WxController.java → sp-server/src/main/java/com/pj/api/wx/api/WxController.java

@@ -1,13 +1,13 @@
-package com.pj.api.wx;
+package com.pj.api.wx.api;
 
 import cn.hutool.json.JSONUtil;
-import com.pj.api.service.ApiService;
+import com.pj.api.wx.bo.Attach;
+import com.pj.api.wx.bo.NotifyBO;
+import com.pj.api.wx.bo.PrePayBO;
+import com.pj.api.wx.service.WxService;
 import com.pj.utils.sg.AjaxJson;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -24,14 +24,14 @@ public class WxController {
     private WxService wxService;
 
     @RequestMapping(value = "notify")
-    public void notify(HttpServletRequest request, HttpServletResponse response) throws Exception{
+    public void notify(@RequestBody NotifyBO notifyBO, HttpServletResponse response) throws Exception{
         response.setContentType("application/json");
         response.setCharacterEncoding("UTF-8");
         Writer writer = response.getWriter();
         Map<String,String>result=new HashMap<>();
         result.put("return_code", "SUCCESS");
         result.put("return_msg", "OK");
-        wxService.WxNotify(request);
+        wxService.WxNotify(notifyBO);
         writer.write(JSONUtil.toJsonStr(result));
         writer.flush();
         writer.close();
@@ -40,11 +40,11 @@ public class WxController {
     /**
      * 统一下单接口
      *
-     * @param request
+     * @param
      * @return
      */
     @RequestMapping(value = "pre-pay")
-    public AjaxJson prePay(HttpServletRequest request) throws Exception {
+    public AjaxJson prePay( HttpServletRequest request) throws Exception {
         return AjaxJson.getSuccessData(wxService.prePay(request));
     }
 

+ 15 - 1
sp-server/src/main/java/com/pj/api/wx/Attach.java → sp-server/src/main/java/com/pj/api/wx/bo/Attach.java

@@ -1,12 +1,26 @@
-package com.pj.api.wx;
+package com.pj.api.wx.bo;
 
 import lombok.Data;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
+
 @Data
 @Accessors(chain = true)
 public class Attach implements Serializable {
+
+    /**
+     * 业务车辆表json
+     */
     private String c;
+    /**
+     * 业务Id
+     */
     private String b;
+    /**
+     * 账户充值json
+     */
+    private String a;
+
 }

+ 42 - 0
sp-server/src/main/java/com/pj/api/wx/bo/NotifyBO.java

@@ -0,0 +1,42 @@
+package com.pj.api.wx.bo;
+
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import lombok.Data;
+
+@JacksonXmlRootElement(localName = "xml")
+@Data
+public class NotifyBO {
+
+
+    // 返回状态码
+    @JacksonXmlProperty(localName = "return_code")
+    private String returnCode;
+
+    // 返回信息
+    @JacksonXmlProperty(localName = "return_msg")
+    private String returnMsg;
+
+    // 业务结果
+    @JacksonXmlProperty(localName = "result_code")
+    private String resultCode;
+
+    // 商户订单号
+    @JacksonXmlProperty(localName = "out_trade_no")
+    private String outTradeNo;
+
+    // 支付完成时间
+    @JacksonXmlProperty(localName = "time_end")
+    private String timeEnd;
+
+    // 微信支付订单号
+    @JacksonXmlProperty(localName = "transaction_id")
+    private String transactionId;
+
+    // 订单金额
+    @JacksonXmlProperty(localName = "total_fee")
+    private String totalFee;
+    @JacksonXmlProperty(localName = "attach")
+    private String attach;
+
+}

+ 19 - 0
sp-server/src/main/java/com/pj/api/wx/bo/PrePayBO.java

@@ -0,0 +1,19 @@
+package com.pj.api.wx.bo;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+public class PrePayBO implements Serializable {
+
+    private BigDecimal money;
+    private String tradeType;
+    private String openid;
+
+
+}

+ 11 - 0
sp-server/src/main/java/com/pj/api/wx/bo/PriceBO.java

@@ -0,0 +1,11 @@
+package com.pj.api.wx.bo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class PriceBO {
+    private String id;
+    private BigDecimal p;
+}

+ 1 - 1
sp-server/src/main/java/com/pj/api/wx/SceneInfoBO.java → sp-server/src/main/java/com/pj/api/wx/bo/SceneInfoBO.java

@@ -1,4 +1,4 @@
-package com.pj.api.wx;
+package com.pj.api.wx.bo;
 
 import cn.hutool.json.JSONUtil;
 import lombok.Data;

+ 47 - 62
sp-server/src/main/java/com/pj/api/wx/WxService.java → sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -1,29 +1,32 @@
-package com.pj.api.wx;
+package com.pj.api.wx.service;
 
-import cn.hutool.core.net.Ipv4Util;
 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;
+import cn.hutool.crypto.SecureUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import com.pj.api.wx.WxUtils;
+import com.pj.api.wx.bo.*;
+import com.pj.api.wx.vo.PrePayVO;
 import com.pj.current.config.MyConfig;
 import com.pj.current.config.WxConfig;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
-import com.pj.project.tb_charge_record.TbChargeRecordService;
+import com.pj.project.tb_business_item.TbBusinessItem;
+import com.pj.project.tb_business_item.TbBusinessItemService;
 import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project.tb_pay_record.TbPayRecord;
 import com.pj.project.tb_pay_record.TbPayRecordService;
 import com.pj.utils.cache.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.codec.digest.DigestUtils;
 import org.springframework.context.annotation.Lazy;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -53,6 +56,9 @@ public class WxService {
     TbCostomerService tbCostomerService;
     @Resource
     TbBusinessCarService tbBusinessCarService;
+    @Resource
+    @Lazy
+    TbBusinessItemService tbBusinessItemService;
 
     /**
      * 统一下单接口
@@ -60,29 +66,20 @@ public class WxService {
     public Map<String, String> prePay(HttpServletRequest request) throws Exception {
         String tradeType = request.getParameter("tradeType");
         String money = request.getParameter("money");
-        String carIds = request.getParameter("carId");
         String openid = request.getParameter("openid");
-        String businessId = request.getParameter("businessId");
+        String businessId = request.getParameter("b");
+        String c = request.getParameter("c");
+        String a = request.getParameter("a");
         Attach atchMap = new Attach();
-        atchMap.setC(carIds).setB(businessId);
+        atchMap.setC(c).setB(businessId).setA(a);
         String out_trade_no = RandomUtil.randomString(32);
-        if (StrUtil.isNotEmpty(businessId)) {
-            TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-            out_trade_no = tbBusiness.getNo();
-        } else {
-            for (String id : StrUtil.splitTrim(carIds, ",")) {
-                TbBusinessCar car = tbBusinessCarService.getById(id);
-                out_trade_no = "c_" + car.getId();
-                break;
-            }
-        }
         Map<String, String> params = new HashMap<>();
         params.put("appid", wxConfig.getAppId());
         params.put("mch_id", wxConfig.getMachId());
         params.put("openid", openid);
         params.put("nonce_str", RandomUtil.randomString(32));
         params.put("body", "支付中心-业务订单支付");
-        params.put("out_trade_no", out_trade_no+"_"+System.currentTimeMillis()/1000);
+        params.put("out_trade_no", out_trade_no);
         params.put("attach", JSONUtil.toJsonStr(atchMap));
         String total_free = Integer.parseInt(money) * 100 + "";
 //        String total_free = "1";
@@ -148,59 +145,46 @@ public class WxService {
         }
     }
 
-    public void WxNotify(HttpServletRequest request) throws Exception {
-        Map<String, Object> result = wxUtils.msgToMap(request);
-        String total_fee = result.get("total_fee").toString();
+    @Async
+    public void WxNotify(NotifyBO notifyBO) throws Exception {
+        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(result));
-        String tradeNo = result.get("out_trade_no").toString();
-        tradeNo=StrUtil.subBefore(tradeNo,"_",true);
-        String attachStr = result.get("attach") == null ? "" : result.get("attach").toString();
-        String transactionId = result.get("transaction_id").toString();
+        log.info("wx pay notify;{}", JSONUtil.toJsonStr(notifyBO));
+        String tradeNo =notifyBO.getOutTradeNo();
+        tradeNo = StrUtil.subBefore(tradeNo, "_", true);
+        String attachStr = notifyBO.getAttach();
+        String transactionId = notifyBO.getTransactionId();
         Date now = new Date();
         if (StrUtil.isNotEmpty(attachStr)) {
             Attach attach = JSONUtil.toBean(attachStr, Attach.class);
+            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()));
+                tbBusinessCarService.updateById(car);
+            }
             String businessId = attach.getB();
+
             if (StrUtil.isNotEmpty(businessId)) {
+                List<TbBusinessItem>items=tbBusinessItemService.findByBusinessId(businessId);
+                items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(now));
+                tbBusinessItemService.updateBatchById(items);
                 TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-                if (tbBusiness.getPayStatus() == 2) {
-                    return;
-                }
-                tbBusiness.setPayTime(now).setPayType(3)
-                        .setPayStatus(3).setAdminConfirmPay(1)
-                        .setConfirmInput(1).setConfirmInputTime(now)
+                tbBusiness.setPayStatus(tbBusiness.getPayMoney().add(money).equals(tbBusiness.getTotalMoney()) ? 3 : 4);
+                tbBusiness.setPayTime(now).setPayType(3).setConfirmInput(1).setConfirmInputTime(now)
+                        .setPayMoney(tbBusiness.getPayMoney().add(money))
                         .setPayNo(transactionId);
                 tbBusinessService.updateById(tbBusiness);
-                List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(businessId);
-                cars.forEach(tbBusinessCar -> tbBusinessCar.setPay(1).setPayTime(now).setMoney(tbBusinessCar.getBasePartMoney()));
-                tbBusinessCarService.updateBatchById(cars);
-            }
-            String carIds = attach.getC();
-            if (StrUtil.isNotEmpty(carIds) && StrUtil.isEmpty(businessId)) {
-                StrUtil.splitTrim(carIds, ",").forEach(id -> {
-                    TbBusinessCar car = tbBusinessCarService.getById(id);
-                    car.setPay(1);
-                    car.setMoney(car.getBasePartMoney().add(money));
-                    tbBusinessCarService.updateById(car);
-                });
+                TbPayRecord payRecord = new TbPayRecord();
+                TbCostomer tbCostomer = tbCostomerService.getById(tbBusiness.getCustomerId());
+                payRecord.setCreateTime(now)
+                        .setOutTradeNo(tradeNo)
+                        .setTransactionId(transactionId)
+                        .setPayMoney(money)
+                        .setCustomerId(tbCostomer.getId()).setCustomerName(tbCostomer.getName());
+                tbPayRecordService.save(payRecord);
             }
         }
-        TbBusiness tbBusiness = tbBusinessService.finByNo(tradeNo);
-        if (tradeNo.contains("c_")) {
-            String busiCarId = tradeNo.replace("c_", "");
-            TbBusinessCar tbBusinessCar = tbBusinessCarService.getById(busiCarId);
-            tbBusiness=tbBusinessService.getById(tbBusinessCar.getBusinessId());
-        }
-        if (tbBusiness != null) {
-            TbPayRecord payRecord = new TbPayRecord();
-            TbCostomer tbCostomer = tbCostomerService.getById(tbBusiness.getCustomerId());
-            payRecord.setCreateTime(now)
-                    .setOutTradeNo(tradeNo)
-                    .setTransactionId(transactionId)
-                    .setPayMoney(money)
-                    .setCustomerId(tbCostomer.getId()).setCustomerName(tbCostomer.getName());
-            tbPayRecordService.save(payRecord);
-        }
     }
 
     public String getRedirectUrl(String path, String state) {
@@ -234,7 +218,8 @@ public class WxService {
         params.put("jsapi_ticket", jsTicket);
         params.put("timestamp", nowTime);
         params.put("url", url);
-        params.put("sign", DigestUtils.sha1Hex(params.toString().substring(1, params.toString().lastIndexOf("}")).replaceAll(", ", "&")));
+       String sign= SecureUtil.sha1(params.toString().substring(1, params.toString().lastIndexOf("}")).replaceAll(", ", "&"));
+        params.put("sign",sign);
         params.put("appId", wxConfig.getAppId());
         return params;
     }

+ 1 - 1
sp-server/src/main/java/com/pj/api/wx/NotifyVO.java → sp-server/src/main/java/com/pj/api/wx/vo/NotifyVO.java

@@ -1,4 +1,4 @@
-package com.pj.api.wx;
+package com.pj.api.wx.vo;
 
 import lombok.Data;
 import lombok.experimental.Accessors;

+ 1 - 1
sp-server/src/main/java/com/pj/api/wx/PrePayVO.java → sp-server/src/main/java/com/pj/api/wx/vo/PrePayVO.java

@@ -1,4 +1,4 @@
-package com.pj.api.wx;
+package com.pj.api.wx.vo;
 
 import lombok.Data;
 import lombok.experimental.Accessors;

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

@@ -144,7 +144,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
 
 
     /**
-     * 支付状态(1=未支付,2=已支付,3=运营人员确认支付)
+     * 支付状态(1=未支付,2=已支付,3=运营人员确认支付,4部分支付)
      */
     private Integer payStatus = 1;
 
@@ -186,6 +186,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     private Long partTime;
     private Long chinaCarPartTime;
     private BigDecimal itemPrice=new BigDecimal(0);
+    private BigDecimal payMoney=new BigDecimal(0);
     private BigDecimal totalMoney=new BigDecimal(0);
     private Date createTime;
     private String createBy;
@@ -210,6 +211,11 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
      * 是否完成 0 1
      */
     private Integer complete=0;
+
+    private String nucleicReport;
+    private String disinfectReport;
+    private String checkReport;
+    private String outReport;
     private transient String itemJson;
     private transient String peopleJson;
     private transient String carJson;

+ 5 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java

@@ -278,6 +278,11 @@ public class TbBusinessController {
         return AjaxJson.getSuccessData(business);
     }
 
+    @RequestMapping("uploadReport")
+    public AjaxJson uploadReport(@RequestBody TbBusiness tbBusiness){
+        tbBusinessService.uploadReport(tbBusiness);
+        return AjaxJson.getSuccess();
+    }
 
     // ------------------------- 前端接口 -------------------------
 

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

@@ -192,11 +192,12 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         String yueCarNo = t.getCardNo().toUpperCase();
         TbBusinessCar yueCar = tbBusinessCarService.findInAndNoBusinessCar(yueCarNo);
         if (yueCar == null) {
-             yueCar = tbBusinessCarService.findByBusinessIdAndCarNo(t.getId(), yueCarNo);
+            yueCar = tbBusinessCarService.findByBusinessIdAndCarNo(t.getId(), yueCarNo);
             if (yueCar == null) {
                 yueCar = new TbBusinessCar();
             }
         }
+
         yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
         carList.add(yueCar);
         tbBusinessCarService.saveOrUpdateBatch(carList);
@@ -369,7 +370,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             iTime = tbBusiness.getChinaCarInTime();
             oTime = tbBusiness.getChinaCarOutTime();
         }
-        BigDecimal price = calculationPartMoney(iTime, oTime, tbBusiness.getCardSize());
+        BigDecimal price = calculationPartMoney(iTime, oTime);
         if (itemType.contains("中国")) {
             int len = tbBusiness.getCardNo().split(" ").length;
             tbBusiness.setChinaPartMoney(price.multiply(new BigDecimal(len)));
@@ -379,7 +380,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         tbBusiness.setTotalMoney(tbBusiness.getItemPrice().add(tbBusiness.getChinaPartMoney()).add(tbBusiness.getPartMoney()));
     }
 
-    public BigDecimal calculationPartMoney(Date iTime, Date oTime, double carSize) {
+    public BigDecimal calculationPartMoney(Date iTime, Date oTime) {
         LocalDateTime inDayTime = iTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
         LocalDateTime outDayTime = oTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
         long minutes = ChronoUnit.MINUTES.between(inDayTime, outDayTime);
@@ -387,9 +388,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         if (minutes < 0) {
             return zero;
         }
-        if (carSize < partConfig.getFreeCarLength() || minutes <= partConfig.getFreeMinutes()) {
-            return zero;
-        }
         long days = ChronoUnit.DAYS.between(inDayTime.toLocalDate(), outDayTime.toLocalDate());
         long hour = ChronoUnit.HOURS.between(inDayTime, outDayTime);
         BigDecimal basePrice = partConfig.getBasePrice();
@@ -422,8 +420,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         return getOne(ew);
     }
 
-    public Map<String, Object> getBusinessMoney(String businessId, String state) {
+    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);
         List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(businessId);
         Date now = new Date();
         List<Map<String, Object>> carsList = new ArrayList<>();
@@ -433,7 +434,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             if (!StrUtil.equals("STATE", state)) {
                 Date inTime = tbBusinessCar.getRealInTime();
                 if (inTime != null) {
-                    BigDecimal price = this.calculationPartMoney(inTime, now, tbBusinessCar.getCarSize());
+                    BigDecimal price = this.calculationPartMoney(inTime, now);
                     BigDecimal money = tbBusinessCar.getMoney();
                     BigDecimal basePrice = tbBusinessCar.getBasePartMoney();
                     partMoney = money == null ? price.subtract(basePrice).doubleValue() : price.subtract(money).doubleValue();
@@ -470,4 +471,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         result.put("total", total[0]);
         return result;
     }
+
+    public void uploadReport(TbBusiness tbBusiness) {
+        this.updateById(tbBusiness);
+        List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(tbBusiness.getId());
+        cars.forEach(tbBusinessCar -> tbBusinessCar.setIsLock(0));
+        tbBusinessCarService.updateBatchById(cars);
+    }
 }

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

@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
 
 import lombok.Data;
 import lombok.experimental.Accessors;
+import org.springframework.data.annotation.Id;
 
 /**
  * Model: tb_business_car -- 
@@ -41,7 +42,8 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	/**
 	 *  
 	 */
-	private String id;
+	@TableId(type = IdType.AUTO)
+	private Long id;
 
 	/**
 	 *  
@@ -78,7 +80,7 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	/**
 	 *  
 	 */
-	private BigDecimal money;
+	private BigDecimal money=new BigDecimal("0");
 
 	/**
 	 *  

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

@@ -128,7 +128,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
             throw new Exception("车辆已存在");
         }
         TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-        if (!CAR_LIST.contains(carNo)) {
+        if (!CAR_LIST.contains(carNo.substring(0,1))) {
             tbBusiness.setCardNo(carNo);
             tbBusiness.setCardSize(t.getCarSize());
         }
@@ -142,11 +142,11 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         this.updateById(t);
         TbBusiness tbBusiness = tbBusinessService.getById(t.getBusinessId());
         String carNo = t.getCarNo();
-        if (!CAR_LIST.contains(carNo)) {
+        if (!CAR_LIST.contains(carNo.substring(0,1))) {
             tbBusiness.setCardNo(carNo);
         } else {
             List<TbBusinessCar> cars = this.findByBusinessId(t.getBusinessId());
-            String chiaCarNo = cars.stream().filter(obj -> CAR_LIST.contains(obj.getCarNo())).map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
+            String chiaCarNo = cars.stream().filter(obj -> CAR_LIST.contains(obj.getCarNo().substring(0,1))).map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
             tbBusiness.setChinaCarNo(chiaCarNo);
         }
         tbBusinessService.updateById(tbBusiness);
@@ -174,7 +174,8 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     public AjaxJson deleteCar(String id) {
         TbBusinessCar db = this.getById(id);
-        if (!CAR_LIST.contains(db.getCarNo())) {
+        String checkStr=db.getCarNo().substring(0,1);
+        if (!CAR_LIST.contains(checkStr)) {
             return AjaxJson.getError("越南车不能删除");
         }
         this.removeById(id);

+ 5 - 1
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItem.java

@@ -40,7 +40,8 @@ public class TbBusinessItem extends Model<TbBusinessItem> implements Serializabl
 	/**
 	 * 主键 
 	 */
-	private String id;
+	@TableId(type = IdType.AUTO)
+	private Long id;
 
 	/**
 	 * 等级表id 
@@ -89,6 +90,9 @@ public class TbBusinessItem extends Model<TbBusinessItem> implements Serializabl
 	private BigDecimal total;
 	private String ticket;
 
+	private Integer payStatus;
+	private Date payTime;
+
 
 
 

+ 3 - 1
sp-server/src/main/java/com/pj/project/tb_declare/TbDeclare.java

@@ -39,6 +39,8 @@ public class TbDeclare implements Serializable {
 	 */
     private String id;
 
+    private String customerId;
+
 	/**
 	 * 业务id 
 	 */
@@ -132,7 +134,7 @@ public class TbDeclare implements Serializable {
 	 * 运输车车牌 
 	 */
     private String chinaCarNo;
-
+	private String chinaCarSuff;
 	/**
 	 * 越南车车牌 
 	 */

+ 83 - 0
sp-server/src/main/java/com/pj/project/tb_discount/TbDiscount.java

@@ -0,0 +1,83 @@
+package com.pj.project.tb_discount;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+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_discount -- 折扣管理
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbDiscount.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbDiscount extends Model<TbDiscount> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_discount";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-discount";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	private String id;
+
+	/**
+	 * 标题 
+	 */
+	private String title;	
+
+	/**
+	 * 类型[j] 
+	 */
+	private Integer type;
+
+	/**
+	 * 折扣 
+	 */
+	private Double discount;	
+
+	/**
+	 * 充值金额 
+	 */
+	private BigDecimal money;
+	private BigDecimal subtract;
+
+	/**
+	 * 状态[j] 
+	 */
+	private Integer status;
+
+	/**
+	 * 创建时间 
+	 */
+	private Date createTime;
+
+
+
+
+
+	
+
+
+}

+ 115 - 0
sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountController.java

@@ -0,0 +1,115 @@
+package com.pj.project.tb_discount;
+
+import java.util.List;
+
+import com.pj.project.tb_business.TbBusiness;
+import com.pj.project.tb_business_car.TbBusinessCar;
+import com.pj.project.tb_item.TbItem;
+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_discount -- 折扣管理
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/TbDiscount/")
+public class TbDiscountController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbDiscountService tbDiscountService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbDiscount.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
+	public AjaxJson add(TbDiscount t){
+		tbDiscountService.add(t);
+		return AjaxJson.getSuccessData(t);
+	}
+	/** 改 - 状态(0=否,1=是) */
+	@RequestMapping("updateStatus")
+	@SaCheckPermission(TbDiscount.PERMISSION_CODE)
+	public AjaxJson updateStatus(String id, int value){
+		TbDiscount db=	tbDiscountService.getById(id);
+		db.setStatus(value);
+		tbDiscountService.updateById(db);
+		return AjaxJson.getByLine(1);
+	}
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbDiscount.PERMISSION_CODE)
+	public AjaxJson delete(Long id){
+		int line = tbDiscountService.delete(id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbDiscount.PERMISSION_CODE)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(TbDiscount.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbDiscount.PERMISSION_CODE)
+	public AjaxJson update(TbDiscount t){
+		int line = tbDiscountService.update(t);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbDiscount t = tbDiscountService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbDiscount> list = tbDiscountService.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(TbDiscount.TABLE_NAME, "user_id", id);
+		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
+		// 开始修改 (请只保留需要修改的字段)
+		SoMap so = SoMap.getRequestSoMap();
+		so.clearNotIn("id", "title", "type", "discount", "money", "status", "createTime").clearNull().humpToLineCase();	
+		int line = SP.publicMapper.updateBySoMapById(TbDiscount.TABLE_NAME, so, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+	
+	
+	
+	
+
+}

+ 51 - 0
sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountMapper.java

@@ -0,0 +1,51 @@
+package com.pj.project.tb_discount;
+
+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_discount -- 折扣管理
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface TbDiscountMapper extends BaseMapper <TbDiscount> {
+
+	/**
+	 * 增  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int add(TbDiscount t);
+
+	/**
+	 * 删  
+	 * @param id 要删除的数据id  
+	 * @return 受影响行数 
+	 */
+	int delete(Long id);	 
+
+	/** 
+	 * 改  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int update(TbDiscount t);
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbDiscount> getList(SoMap so);
+
+
+}

+ 88 - 0
sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountMapper.xml

@@ -0,0 +1,88 @@
+<?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_discount.TbDiscountMapper">
+
+	<!-- 增 [G] -->
+	<insert id="add">
+		insert into 
+		tb_discount (id, title, type, discount, money, status, subtract,create_time)
+		values (#{id}, #{title}, #{type}, #{discount}, #{money}, 1,#{subtract}, now())
+	</insert>
+
+	<!-- 删 -->
+	<delete id="delete">
+		delete from tb_discount 
+		where id = #{id}
+	</delete>
+
+	<!-- 改 [G] -->
+	<update id="update">
+		update tb_discount set
+		id = #{id}, 
+		title = #{title}, 
+		type = #{type}, 
+		discount = #{discount}, 
+		money = #{money}, 
+		status = #{status}, 
+		subtract = #{subtract},
+		where id = #{id}
+	</update>
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, title, type, discount, money, status, create_time from tb_discount  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.tb_discount.TbDiscount">
+		<result property="id" column="id" />
+		<result property="title" column="title" />
+		<result property="type" column="type" />
+		<result property="discount" column="discount" />
+		<result property="money" column="money" />
+		<result property="status" column="status" />
+		<result property="subtract" column="subtract" />
+		<result property="createTime" column="create_time" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_discount 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [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("title") '> and title like concat('%',#{title},'%') </if>
+			<if test=' this.has("type") '> and type = #{type} </if>
+			<if test=' this.has("discount") '> and discount = #{discount} </if>
+			<if test=' this.has("money") '> and money = #{money} </if>
+			<if test=' this.has("status") '> and status = #{status} </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'> title desc </when>
+			<when test='sortType == 3'> type desc </when>
+			<when test='sortType == 4'> discount desc </when>
+			<when test='sortType == 5'> money desc </when>
+			<when test='sortType == 6'> status desc </when>
+			<when test='sortType == 7'> create_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 52 - 0
sp-server/src/main/java/com/pj/project/tb_discount/TbDiscountService.java

@@ -0,0 +1,52 @@
+package com.pj.project.tb_discount;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.project.tb_business.TbBusinessMapper;
+import com.pj.project.tb_business_car.TbBusinessCar;
+import com.pj.project.tb_business_car.TbBusinessCarMapper;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.pj.utils.sg.*;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Service: tb_discount -- 折扣管理
+ * @author qzy 
+ */
+@Service
+@Transactional
+public class TbDiscountService extends ServiceImpl<TbDiscountMapper, TbDiscount> implements IService<TbDiscount> {
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbDiscountMapper tbDiscountMapper;
+
+	/** 增 */
+	int add(TbDiscount t){
+		return tbDiscountMapper.add(t);
+	}
+
+	/** 删 */
+	int delete(Long id){
+		return tbDiscountMapper.delete(id);
+	}
+
+	/** 改 */
+	int update(TbDiscount t){
+		return tbDiscountMapper.update(t);
+	}
+
+
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<TbDiscount> getList(SoMap so) {
+		return tbDiscountMapper.getList(so);	
+	}
+	
+
+}

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_disinfect/TbDisinfect.java

@@ -42,6 +42,7 @@ public class TbDisinfect extends Model<TbDisinfect> implements Serializable {
 	 * 主键 
 	 */
 	private String id;
+	private String customerId;
 
 	/**
 	 * 发货人 

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

@@ -45,7 +45,7 @@ spring:
     # 项目自定义配置
     myconfig:
         # 本项目部署到的服务器域名(文件上传等等模块  要用到)
-        domain: http://192.168.3.217:8099
+        domain: http://192.168.3.77:8099/pro
         web-domain: https://192.168.3.77:8080
 part-config:
     base-price: 30 #基础费用