Explorar o código

Merge branch 'dev' into debug

qzyReal %!s(int64=3) %!d(string=hai) anos
pai
achega
e3a104a21a
Modificáronse 49 ficheiros con 1330 adicións e 591 borrados
  1. 1 0
      app/pages/wx/account-pay.vue
  2. 3 1
      app/pages/wx/pay.vue
  3. 1 0
      app/pages/wx/payOrder.vue
  4. 2 2
      app/utils/request.js
  5. 2 2
      sp-admin/sa-frame/com/sa-info.vue
  6. 70 41
      sp-admin/sa-frame/menu-list.js
  7. 2 0
      sp-admin/sa-view/tb-business-car/tb-business-car-info.html
  8. 16 11
      sp-admin/sa-view/tb-business-car/tb-business-car-list.html
  9. 113 53
      sp-admin/sa-view/tb-car/tb-car-add.html
  10. 181 0
      sp-admin/sa-view/tb-car/tb-car-edit.html
  11. 25 16
      sp-admin/sa-view/tb-car/tb-car-info.html
  12. 108 37
      sp-admin/sa-view/tb-car/tb-car-list.html
  13. 31 13
      sp-admin/sa-view/tb-fee-statistics/month-statistcs-list.html
  14. 74 22
      sp-admin/sa-view/tb-fee-statistics/tb-fee-details-list.html
  15. 33 13
      sp-admin/sa-view/tb-fee-statistics/tb-fee-statistics-list.html
  16. 4 3
      sp-admin/sa-view/tb-fee-statistics/year-statistcs-list.html
  17. BIN=BIN
      sp-admin/static/excel/批量导入车辆.xlsx
  18. 1 0
      sp-server/app.pid
  19. 1 1
      sp-server/src/main/java/com/pj/api/h5/ApiController.java
  20. 50 19
      sp-server/src/main/java/com/pj/api/open/service/OpenService.java
  21. 4 2
      sp-server/src/main/java/com/pj/api/service/ApiService.java
  22. 14 9
      sp-server/src/main/java/com/pj/api/wx/service/WxService.java
  23. 1 1
      sp-server/src/main/java/com/pj/constants/UserTypeEnum.java
  24. 1 0
      sp-server/src/main/java/com/pj/current/config/PartConfig.java
  25. 1 4
      sp-server/src/main/java/com/pj/current/task/TokenTask.java
  26. 22 16
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java
  27. 4 0
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCar.java
  28. 2 0
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.java
  29. 9 0
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml
  30. 3 0
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java
  31. 26 0
      sp-server/src/main/java/com/pj/project/tb_car/ImportCarBO.java
  32. 68 0
      sp-server/src/main/java/com/pj/project/tb_car/ImportCarListener.java
  33. 103 70
      sp-server/src/main/java/com/pj/project/tb_car/TbCar.java
  34. 19 11
      sp-server/src/main/java/com/pj/project/tb_car/TbCarController.java
  35. 0 27
      sp-server/src/main/java/com/pj/project/tb_car/TbCarMapper.java
  36. 3 50
      sp-server/src/main/java/com/pj/project/tb_car/TbCarMapper.xml
  37. 78 40
      sp-server/src/main/java/com/pj/project/tb_car/TbCarService.java
  38. 126 98
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerController.java
  39. 1 1
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerService.java
  40. 15 1
      sp-server/src/main/java/com/pj/project/tb_fee_details/ExportFeeDetailDTO.java
  41. 53 3
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetails.java
  42. 4 0
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsMapper.xml
  43. 25 13
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java
  44. 8 0
      sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsMapper.xml
  45. 15 6
      sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java
  46. 1 1
      sp-server/src/main/java/com/pj/project4sp/uploadfile/UploadConfig.java
  47. 4 3
      sp-server/src/main/java/com/pj/project4sp/uploadfile/UploadUtil.java
  48. 2 1
      sp-server/src/main/resources/application-dev.yml
  49. BIN=BIN
      sp-server/src/main/resources/static/day-fee-new.xlsx

+ 1 - 0
app/pages/wx/account-pay.vue

@@ -158,6 +158,7 @@
 					tradeType: "JSAPI",
 					openid: this.openid
 				}
+				p.desc="A1-账户充值";
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
 					let that = this;

+ 3 - 1
app/pages/wx/pay.vue

@@ -29,7 +29,8 @@
 								</u-checkbox>
 							</view>
 							<view class="c">{{item.carNo}}</view>
-							<view class="r">{{item.price}}元</view>
+							<view class="r" v-if="item.price>0">{{item.price}}元</view>
+								<view class="r" v-else>无需缴费</view>
 						</label>
 					</view>
 				</u-checkbox-group>
@@ -188,6 +189,7 @@
 					tradeType: "JSAPI",
 					openid: this.openid
 				}
+				p.desc=p.b?'A1-业务费用':'A1-停车费';
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
 					console.log(data);

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

@@ -176,6 +176,7 @@
 					tradeType: "JSAPI",
 					openid: this.wx.openid
 				}
+				p.desc="A1-业务费用"
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
 					let that = this;

+ 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://pco.aseanbusiness.cn/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/sa-frame/com/sa-info.vue

@@ -3,8 +3,8 @@
 	<div class="c-item" :class="{br: br}" v-if="$slots.default">
 		<label class="c-label" v-if="name && name.length > 0">{{name}}:</label> 
 		<span v-else-if="name === undefined"></span> 
-		<label class="c-label" v-else></label> 
-		<span v-else></span> 
+		<label class="c-label" v-else></label> 
+		<span v-else></span> 
 		<slot></slot>
 	</div>
 	<!-- 普通信息 -->

+ 70 - 41
sp-admin/sa-frame/menu-list.js

@@ -22,13 +22,13 @@ var menuList = [{
 		icon: 'el-icon-unlock',
 		childList: [{
 				id: 'role-list',
-				
+
 				name: '角色列表',
 				url: 'sa-view-sp/sp-role/role-list.html',
 			},
 			{
 				id: 'admin-list',
-				
+
 				name: '管理员列表',
 				url: 'sa-view-sp/sp-admin/admin-list.html',
 			},
@@ -57,7 +57,7 @@ var menuList = [{
 			{
 				id: 'tb-costomer-add',
 				name: '添加',
-				
+
 				isShow: false
 			},
 			{
@@ -68,25 +68,25 @@ var menuList = [{
 			{
 				id: 'tb-costomer-del',
 				name: '删除',
-				
+
 				isShow: false
 			},
 			{
 				id: 'tb-costomer-edit',
 				name: '修改',
-				
+
 				isShow: false
 			},
 			{
 				id: 'tb-costomer-account',
 				name: '账户',
-				
+
 				isShow: false,
 				childList: [{
 					id: 'tb-costomer-account-charge',
 					name: '充值',
 					isShow: false,
-					
+
 				}]
 			},
 			{
@@ -97,24 +97,25 @@ var menuList = [{
 						id: 'tb-costomer-user-add',
 						name: '添加',
 						isShow: false,
-						
+
 					},
 					{
 						id: 'tb-costomer-user-del',
 						name: '删除',
 						isShow: false,
-						
+
 					},
 					{
 						id: 'tb-costomer-user-edit',
 						name: '编辑',
 						isShow: false,
-						
+
 					},
 				]
 			},
 		]
 	},
+	
 	{
 		id: 'tb-costomer-maintain',
 		name: '信息维护',
@@ -123,19 +124,16 @@ var menuList = [{
 		childList: [{
 			id: 'tb-costomer-maintain-list',
 			name: '企业信息',
-			
 			icon: 'el-icon-s-custom',
 			url: 'sa-view/tb-costomer/tb-costomer-maintain.html',
 			childList: [{
 					id: 'tb-costomer-maintain-edit',
 					name: '编辑信息',
-					icon: 'el-icon-s-custom',
 					isShow: false
 				},
 				{
 					id: 'tb-costomer-maintain-account',
 					name: '账户管理',
-					icon: 'el-icon-s-custom',
 					isShow: false
 				},
 				{
@@ -147,19 +145,19 @@ var menuList = [{
 							id: 'tb-costomer-maintain-user-add',
 							name: '添加',
 							isShow: false,
-							
+
 						},
 						{
 							id: 'tb-costomer-maintain-user-del',
 							name: '删除',
 							isShow: false,
-							
+
 						},
 						{
 							id: 'tb-costomer-maintain-user-edit',
 							name: '编辑',
 							isShow: false,
-							
+
 						},
 					]
 				},
@@ -179,19 +177,19 @@ var menuList = [{
 					id: 'tb-partner-add',
 					name: '添加伙伴',
 					isShow: false,
-					
+
 				},
 				{
 					id: 'tb-partner-del',
 					name: '删除伙伴',
 					isShow: false,
-					
+
 				},
 				{
 					id: 'tb-partner-edit',
 					name: '编辑伙伴',
 					isShow: false,
-					
+
 				},
 				{
 					id: 'tb-partner-user',
@@ -202,19 +200,19 @@ var menuList = [{
 							id: 'tb-partner-user-add',
 							name: '添加用户',
 							isShow: false,
-							
+
 						},
 						{
 							id: 'tb-partner-user-edit',
 							name: '编辑用户',
 							isShow: false,
-							
+
 						},
 						{
 							id: 'tb-partner-user-del',
 							name: '删除用户',
 							isShow: false,
-							
+
 						},
 					]
 				},
@@ -222,23 +220,54 @@ var menuList = [{
 		}, ]
 	},
 	{
+		id: 'tb-car',
+		name: '车辆管理',
+		parent: true,
+		icon: 'el-icon-s-platform',
+		childList: [{
+			id: 'tb-car-list',
+			name: '车辆列表',
+			icon: 'el-icon-s-platform',
+			url: 'sa-view/tb-car/tb-car-list.html',
+			childList: [{
+					id: 'tb-car-add',
+					name: '添加车辆',
+					isShow: false
+				},
+				{
+					id: 'tb-car-edit',
+					name: '编辑车辆',
+					isShow: false
+				},
+				{
+					id: 'tb-car-del',
+					name: '删除车辆',
+					isShow: false
+				},
+				{
+					id: 'tb-car-import',
+					name: '批量导入',
+					isShow: false
+				},
+			]
+		}]
+	},
+	{
 		id: 'tb-business-item',
 		name: '作业管理',
 		icon: 'el-icon-edit-outline',
 		parent: true,
 		childList: [{
-			id: 'tb-business-item-list',
-			name: '作业订单',
-			url: 'sa-view/tb-partner/tb-business-item-list.html',
-			childList:[
-				{
+				id: 'tb-business-item-list',
+				name: '作业订单',
+				url: 'sa-view/tb-partner/tb-business-item-list.html',
+				childList: [{
 					id: 'tb-business-item-confirm',
 					name: '接单确认',
 					isShow: false,
-				},
-			]
-		}, 
-		
+				}, ]
+			},
+
 		]
 	},
 	{
@@ -251,13 +280,13 @@ var menuList = [{
 				name: '整车业务',
 				url: 'sa-view/tb-business/tb-business-list.html',
 				childList: [{
-						
+
 						id: 'tb-business-add',
 						name: '添加业务',
 						isShow: false
 					},
 					{
-						
+
 						id: 'tb-business-del',
 						name: '删除业务',
 						isShow: false
@@ -302,7 +331,7 @@ var menuList = [{
 		childList: [{
 			id: 'tb-business-car-list',
 			name: '放行列表',
-			
+
 			url: 'sa-view/tb-business-car/tb-business-car-list.html'
 		}, ]
 	},
@@ -317,13 +346,13 @@ var menuList = [{
 			icon: 'el-icon-coin',
 			parent: true,
 			childList: [{
-					
+
 					id: 'tb-item-list',
 					name: '收费标准',
 					url: 'sa-view/tb-item/tb-item-list.html'
 				},
 				{
-					
+
 					id: 'tb-item-list-edit-type',
 					name: '修改类型',
 					isShow: false
@@ -340,21 +369,21 @@ var menuList = [{
 				id: 'tb-notices-list',
 				name: '消息列表',
 				url: 'sa-view/tb-notices/tb-notices-list.html',
-				
+
 				childList: [{
-						
+
 						id: 'tb-notices-add',
 						name: '添加消息',
 						isShow: false
 					},
 					{
-						
+
 						id: 'tb-notices-del',
 						name: '删除消息',
 						isShow: false
 					},
 					{
-						
+
 						id: 'tb-notices-edit',
 						name: '修改消息',
 						isShow: false
@@ -395,7 +424,7 @@ var menuList = [{
 			id: 'tb-declare-list',
 			name: '申报列表',
 			url: 'sa-view/tb-declare/tb-declare-list.html',
-			
+
 			childList: [{
 					id: 'tb-declare-print',
 					name: '打印申报信息',

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

@@ -32,6 +32,7 @@
 								<sa-info name="入场时间" br>{{m.realInTime}}</sa-info>
 								<sa-info name="离场时间" br>{{m.realOutTime}}</sa-info>
 								<sa-info name="停车费" br>{{m.money}}元</sa-info>
+									<sa-info type="img" name="入场图片" :value="m.inImage" br></sa-info>
 							</el-col>
 							<el-col span=12>
 								<sa-info name="联系人" br>{{m.driverName}}</sa-info>
@@ -40,6 +41,7 @@
 									<label v-if="m.isLock==1">锁定</label>
 									<label v-else>正常</label>
 								</sa-info>
+									<sa-info type="img" name="离场图片" :value="m.outImage" br></sa-info>
 							</el-col>
 						</el-row>
 					</el-form>

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

@@ -18,11 +18,22 @@
 	<body>
 		<div class="vue-box" style="display: none;" :style="'display: block;'">
 			<div class="c-panel">
-				<div class="fast-btn">
-					<el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
+				<div class="c-title">检索参数</div>
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="车牌号" v-model="p.carNo"></sa-item>
+					<div class="c-item">
+						<label class="c-label">支付状态:</label>
+						<el-select v-model="p.pay" placeholder="请选择">
+							<el-option label="-全部-" value=""> </el-option>
+							<el-option label="未支付" value="0"> </el-option>
+							<el-option label="已支付" value="1"> </el-option>
+						</el-select>
+					</div>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
 					<el-button size="mini" type="primary"  @click="add()">
 						新增</el-button>
-				</div>
+				</el-form>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td name="车牌号" prop="carNo" width=120></sa-td>
@@ -46,12 +57,11 @@
 							<label v-else>未计算</label>
 						</template>
 					</el-table-column>
-
 					<el-table-column label="操作" width="200px">
 						<template slot-scope="s">
 							<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&&*/sa.isAuth('tb-business-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+							<el-button v-if="sa.isAuth('tb-business-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
 							</el-button>
 						</template>
 					</el-table-column>
@@ -73,12 +83,7 @@
 						id: '', //  
 						businessId: sa.p('id', ''), //  
 						carNo: '', //  
-						preInTime: '', //  
-						preOutTime: '', //  
-						realInTime: '', //  
-						realOutTime: '', //  
-						money: '', //  
-						driverPhone: '', //  
+						pay:'',  
 						pageNo: 1, // 当前页 
 						pageSize: 10, // 页大小 
 						sortType: 0 // 排序方式 

+ 113 - 53
sp-admin/sa-view/tb-car/tb-car-add.html

@@ -3,7 +3,8 @@
 	<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" />
+		<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">
@@ -14,8 +15,18 @@
 		<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;}
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.num .el-input__inner {
+				width: 96px;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
 		</style>
 	</head>
 	<body>
@@ -23,12 +34,47 @@
 			<!-- ------- 内容部分 ------- -->
 			<div class="s-body">
 				<div class="c-panel">
-                    <div class="c-title" v-if="id == 0">数据添加</div>
+					<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="车牌号" v-model="m.cardNo" placeholder="请输入车牌号" br></sa-item>
-						<sa-item type="text" name="规格" v-model="m.cardSize" placeholder="请输入规格" br></sa-item>
-						<sa-item type="enum" name="当前状态" v-model="m.status" :jv="{1: '境外', 2: '境内'}" jtype="3" br></sa-item>
+						<el-row>
+							<el-col span=12>
+								<div class="c-item">
+									<label class="c-label">归属:</label>
+									<el-select v-model="m.customerId" placeholder="请选择" size="mini" filterable>
+										<el-option v-for="item in customerList" :key="item.id" :label="item.name"
+											:value="item.id">
+										</el-option>
+									</el-select>
+								</div>
+								<div class="c-item">
+									<label class="c-label">类型:</label>
+									<el-select v-model="m.carType" placeholder="请选择" size="mini">
+										<el-option v-for="item in typeList" :key="item.value" :label="item.name"
+											:value="item.value">
+										</el-option>
+									</el-select>
+								</div>
+								<sa-item type="text" name="车牌号" v-model="m.cardNo" placeholder="请输入车牌号" br></sa-item>
+								<div class="c-item">
+									<label class="c-label">车长(米):</label>
+									<el-input-number class="num" step="0.5" :min="2" :max="40" size="small"
+										v-model="m.cardSize" controls-position="right"></el-input-number>
+								</div>
+								<div class="c-item">
+									<label class="c-label">载重(吨):</label>
+									<el-input-number class="num" step="0.5" :min="2" :max="40" size="small"
+										v-model="m.weight" controls-position="right"></el-input-number>
+								</div>
+							</el-col>
+							<el-col span=12>
+								<sa-item type="text" name="联系人" v-model="m.people" placeholder="联系人" br></sa-item>
+								<sa-item type="text" name="联系电话" v-model="m.phone" placeholder="联系电话" br></sa-item>
+								<sa-item type="textarea" name="备注" v-model="m.remark" placeholder="备注" br></sa-item>
+							</el-col>
+						</el-row>
+
+
 						<sa-item name="" class="s-ok" br>
 							<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
 						</sa-item>
@@ -37,79 +83,93 @@
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
-				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-car-add')">确定</el-button>
 				<el-button @click="sa.closeCurrIframe()">取消</el-button>
 			</div>
 		</div>
-        <script>
-			
+		<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,		// 实体对象 
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					m: {
+						id: '', // 主键
+						cardNo: '', // 名称 
+						cardSize: '', // 规格 
+						customerId: '',
+						carType: 1,
+						weight: 4.8,
+						phone: '',
+						people: '',
+						remark: ''
+					}, // 实体对象 
+					customerList: [],
+					typeList: [{
+							value: 0,
+							name: '临时车'
+						},
+						{
+							value: 1,
+							name: '行政车'
+						},
+						{
+							value: 2,
+							name: '业务车'
+						},
+					]
 				},
 				methods: {
-					// 创建一个 默认Model 
-					createModel: function() {
-						return {
-							id: '',		// 主键 
-							cardNo: '',		// 名称 
-							cardSize: '',		// 规格 
-							lastGoodsName: '',		// 最后一次运输商品 
-							lastGoodsCode: '',		// 最后一次运输商品编号 
-							lastNetWeight: '',		// 最后一次载重 
-							lastInTime: '',		// 最后一次入境时间 
-							lastOutTime: '',		// 最后一次出境时间 
-							status: '1',		// 当前状态(1=境外,2=境内) 
-						}
+					getCustomerList() {
+						sa.ajax('/TbCostomer/getListAndAdmin', function(resp) {
+							let list = resp.data;
+							this.customerList = list;
+							this.m.customerId = list[0].id;
+						}.bind(this))
 					},
 					// 提交数据 
-					ok: function(){
+					ok: function() {
 						// 表单校验 
 						let m = this.m;
-						// sa.checkNull(m.id, '请输入 [主键]');
-						sa.checkNull(m.cardNo, '请输入 [车牌号]');
-						sa.checkNull(m.cardSize, '请输入 [规格]');
+						let carNo = m.cardNo;
+						sa.checkNull(carNo, '请输入 [车牌号]');
+						m.cardNo = carNo.toUpperCase();
+						// if(!sa.isCarNo(carNo)){
+						// 	sa.error('请输入正确的车牌号');
+						// 	return;
+						// }
+						let phone = m.phone;
+						if (phone && !sa.isPhone(phone)) {
+							sa.error('请输入正确手机号');
+							return;
+						}
+						let customerId = m.customerId;
+						m.customerName = this.customerList.filter(obj => obj.id == customerId)[0].name;
 						// 开始增加或修改
-						if(this.id <= 0) {	// 添加
-							sa.ajax('/TbCar/add', m, function(res){
-								sa.alert('增加成功', this.clean); 
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbCar/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
 							}.bind(this));
-						} else {	// 修改
-							sa.ajax('/TbCar/update', m, function(res){
+						} else { // 修改
+							sa.ajax('/TbCar/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();	// 关闭本页 
+						if (this.id == 0) {} else {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
 						}
 					}
 				},
-				mounted: function(){
-					// 初始化数据 
-					if(this.id <= 0) {	
-						this.m = this.createModel();
-					} else {	
-						sa.ajax('/TbCar/getById?id=' + this.id, function(res) {
-							this.m = res.data;
-							if(res.data == null) {
-								sa.alert('未能查找到 id=' + this.id + " 详细数据");
-							}
-						}.bind(this))
-					}
+				mounted: function() {
+					this.getCustomerList();
 				}
 			})
-			
 		</script>
 	</body>
-</html>
+</html>

+ 181 - 0
sp-admin/sa-view/tb-car/tb-car-edit.html

@@ -0,0 +1,181 @@
+<!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;
+			}
+
+			.num .el-input__inner {
+				width: 96px;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
+		</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">
+						<el-row>
+							<el-col span=12>
+								<div class="c-item">
+									<label class="c-label">归属:</label>
+									<el-select v-model="m.customerId" placeholder="请选择" size="mini" filterable>
+										<el-option v-for="item in customerList" :key="item.id" :label="item.name"
+											:value="item.id">
+										</el-option>
+									</el-select>
+								</div>
+								<div class="c-item">
+									<label class="c-label">类型:</label>
+									<el-select v-model="m.carType" placeholder="请选择" size="mini">
+										<el-option v-for="item in typeList" :key="item.value" :label="item.name"
+											:value="item.value">
+										</el-option>
+									</el-select>
+								</div>
+								<sa-item type="text" name="车牌号" v-model="m.cardNo" placeholder="请输入车牌号" br></sa-item>
+								<div class="c-item">
+									<label class="c-label">车长(米):</label>
+									<el-input-number class="num" step="0.5" :min="2" :max="40" size="small"
+										v-model="m.cardSize" controls-position="right"></el-input-number>
+								</div>
+								<div class="c-item">
+									<label class="c-label">载重(吨):</label>
+									<el-input-number class="num" step="0.5" :min="2" :max="40" size="small"
+										v-model="m.weight" controls-position="right"></el-input-number>
+								</div>
+							</el-col>
+							<el-col span=12>
+								<sa-item type="text" name="联系人" v-model="m.people" placeholder="联系人" br></sa-item>
+								<sa-item type="text" name="联系电话" v-model="m.phone" placeholder="联系电话" br></sa-item>
+								<sa-item type="textarea" name="备注" v-model="m.remark" placeholder="备注" br></sa-item>
+							</el-col>
+						</el-row>
+
+
+						<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()" v-if="sa.isAuth('tb-car-edit')">确定</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: {
+						id: '', // 主键
+						cardNo: '', // 名称 
+						cardSize: '', // 规格 
+						customerId: '',
+						carType: 1,
+						weight: 4.8,
+						phone: '',
+						people: '',
+						remark: ''
+					}, // 实体对象 
+					customerList: [],
+					typeList: [{
+							value: 0,
+							name: '临时车'
+						},
+						{
+							value: 1,
+							name: '行政车'
+						},
+						{
+							value: 2,
+							name: '业务车'
+						},
+					]
+				},
+				methods: {
+					getCustomerList() {
+						sa.ajax('/TbCostomer/getListAndAdmin', function(resp) {
+							let list = resp.data;
+							this.customerList = list;
+						}.bind(this))
+					},
+					// 提交数据 
+					ok: function() {
+						// 表单校验 
+						let m = this.m;
+						let carNo = m.cardNo;
+						sa.checkNull(carNo, '请输入 [车牌号]');
+						m.cardNo = carNo.toUpperCase();
+						// if(!sa.isCarNo(carNo)){
+						// 	sa.error('请输入正确的车牌号');
+						// 	return;
+						// }
+						let phone = m.phone;
+						if (phone && !sa.isPhone(phone)) {
+							sa.error('请输入正确手机号');
+							return;
+						}
+						let customerId = m.customerId;
+						m.customerName = this.customerList.filter(obj => obj.id == customerId)[0].name;
+						// 开始增加或修改
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbCar/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
+							}.bind(this));
+						} else { // 修改
+							sa.ajax('/TbCar/update', m, function(res) {
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if (this.id == 0) {} else {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}
+					}
+				},
+				mounted: function() {
+					this.getCustomerList();
+					// 初始化数据 
+					sa.ajax('/TbCar/getById?id=' + this.id, function(res) {
+						this.m = res.data;
+						if (res.data == null) {
+							sa.alert('未能查找到 id=' + this.id + " 详细数据");
+						}
+					}.bind(this))
+				}
+			})
+		</script>
+	</body>
+</html>

+ 25 - 16
sp-admin/sa-view/tb-car/tb-car-info.html

@@ -3,7 +3,8 @@
 	<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" />
+		<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">
@@ -14,7 +15,9 @@
 		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 		<style type="text/css">
-			.c-panel .c-label{width: 8em;}
+			.c-panel .c-label {
+				width: 8em;
+			}
 		</style>
 	</head>
 	<body>
@@ -23,15 +26,23 @@
 			<div class="s-body">
 				<div class="c-panel">
 					<el-form v-if="m">
-						<sa-info type="num" name="主键" :value="m.id" br></sa-info>
-						<sa-info name="名称" br>{{m.cardNo}}</sa-info>
-						<sa-info name="规格" br>{{m.cardSize}}</sa-info>
-						<sa-info name="最后一次运输商品" br>{{m.lastGoodsName}}</sa-info>
-						<sa-info name="最后一次运输商品编号" br>{{m.lastGoodsCode}}</sa-info>
-						<sa-info name="最后一次载重" br>{{m.lastNetWeight}}</sa-info>
-						<sa-info name="最后一次入境时间" br>{{m.lastInTime}}</sa-info>
-						<sa-info name="最后一次出境时间" br>{{m.lastOutTime}}</sa-info>
-						<sa-info type="enum" name="当前状态" :value="m.status" :jv="{1: '境外', 2: '境内'}" br></sa-info>
+						<el-row>
+							<el-col span=12>
+								<sa-info name="归属" br>{{m.customerName}}</sa-info>
+								<sa-info type="enum" name="类型" :value="m.carType" :jv="{0: '临时车',1: '行政车', 2: '业务车'}"
+									br></sa-info>
+								<sa-info name="归属" br>{{m.cardNo}}</sa-info>
+								<sa-info name="车长(米)" br>{{m.cardSize}}</sa-info>
+								<sa-info name="载重(吨)" br>{{m.weight}}</sa-info>
+							</el-col>
+							<el-col span=12>
+								<sa-info name="联系人" br>{{m.people}}</sa-info>
+								<sa-info name="联系电话" br>{{m.phone}}</sa-info>
+								<sa-info name="最近入场时间" br>{{m.lastInTime}}</sa-info>
+								<sa-info name="最近离场时间" br>{{m.lastOutTime}}</sa-info>
+								<sa-info name="备注" br>{{m.remark}}</sa-info>
+							</el-col>
+						</el-row>
 					</el-form>
 				</div>
 			</div>
@@ -48,21 +59,19 @@
 				},
 				el: '.vue-box',
 				data: {
-					id: sa.p('id', 0),	// 获取数据ID 
+					id: sa.p('id', 0), // 获取数据ID 
 					m: null
 				},
-				methods: {
-				},
+				methods: {},
 				mounted: function() {
 					sa.ajax('/TbCar/getById?id=' + this.id, function(res) {
 						this.m = res.data;
-						if(res.data == null) {
+						if (res.data == null) {
 							sa.alert('未能查找到 id=' + this.id + " 详细数据");
 						}
 					}.bind(this))
 				}
 			})
-			
 		</script>
 	</body>
 </html>

+ 108 - 37
sp-admin/sa-view/tb-car/tb-car-list.html

@@ -3,7 +3,8 @@
 	<head>
 		<title>-列表</title>
 		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 		<!-- 所有的 css & js 资源 -->
 		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
@@ -13,6 +14,7 @@
 		<script src="../../static/kj/jquery.min.js"></script>
 		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
+		<script src="../../static/kj/upload-util.js"></script>
 	</head>
 	<body>
 		<div class="vue-box" style="display: none;" :style="'display: block;'">
@@ -20,65 +22,132 @@
 				<!-- ------------- 检索参数 ------------- -->
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="归属" v-model="p.customerName"></sa-item>
 					<sa-item type="text" name="车牌号" v-model="p.cardNo"></sa-item>
-					<sa-item type="text" name="规格" v-model="p.cardSize"></sa-item>
+					<div class="c-item">
+						<label class="c-label">车辆类型:</label>
+						<el-select v-model="p.carType" placeholder="请选择">
+							<el-option label="-全部-" value=""> </el-option>
+							<el-option label="临时车" value="0"> </el-option>
+							<el-option label="行政车" value="1"> </el-option>
+							<el-option label="业务车" value="2"> </el-option>
+						</el-select>
+					</div>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
-				<sa-item type="fast-btn" show="add,delete,reset"></sa-item>
+				<el-button type="primary" icon="el-icon-plus" @click="add()" v-if="sa.isAuth('tb-car-add')">新增
+				</el-button>
+				<el-button type="primary" @click="importFn()" v-if="sa.isAuth('tb-car-import')">批量导入
+				</el-button>
+				<el-button type="primary" @click="importTemplate" v-if="sa.isAuth('tb-car-import')">导入模板
+				</el-button>
+				<!--				<el-button type="success" icon="el-icon-view" @click="getBySelect()">查看</el-button>-->
+				<el-button type="danger" icon="el-icon-delete" @click="deleteByIds()" v-if="sa.isAuth('tb-car-del')">删除
+				</el-button>
+				
 				<!-- ------------- 数据列表 ------------- -->
-				<el-table class="data-table" ref="data-table" :data="dataList" >
+				<el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 10px;">
 					<sa-td type="selection"></sa-td>
-					<sa-td name="车牌号" prop="cardNo" ></sa-td>
-					<sa-td name="规格" prop="cardSize" ></sa-td>
-					<sa-td name="上次运输商品" prop="lastGoodsName" ></sa-td>
-					<sa-td name="上次载重" prop="lastNetWeight" ></sa-td>
-					<sa-td name="上次入境时间" prop="lastInTime" ></sa-td>
-					<sa-td name="上次出境时间" prop="lastOutTime" ></sa-td>
-					<sa-td name="当前状态" prop="status" type="enum" :jv="{1: '境外', 2: '境内'}"></sa-td>
-					<el-table-column label="操作" fixed="right"  width="240px">
+					<sa-td name="归属" prop="customerName"></sa-td>
+					<sa-td name="车牌号" prop="cardNo"></sa-td>
+					<sa-td name="类型" prop="carType" type="enum" :jv="{0: '临时车',1: '行政车', 2: '业务车'}"></sa-td>
+					<el-table-column label="操作" fixed="right" width="240px">
 						<template slot-scope="s">
-							<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>
+							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
+							</el-button>
+							<el-button v-if="sa.isAuth('tb-car-edit')" class="c-btn" type="primary" icon="el-icon-edit"
+								@click="update(s.row)">修改
+							</el-button>
+							<el-button v-if="sa.isAuth('tb-car-del')" 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>
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
 			</div>
+			<el-dialog title="批量导入任务" :visible="modal.visible" width="300px">
+				<div style="text-align: center;">
+					<el-upload class="upload-demo" :headers="header" accept=".xlsx,.xls" :before-upload="beforeUpload"
+						:on-success="successFn" :on-error="errorFn" :action="sa.cfg.api_url+'/TbCar/importExcel'">
+						<i class="el-icon-upload"></i>
+						<div class="el-upload__text">选择excel文档</em></div>
+					</el-upload>
+				</div>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="modal.visible=false">关闭</el-button>
+				</span>
+			</el-dialog>
 		</div>
 		<script>
 			var app = new Vue({
 				components: {
-					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),  
-					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),		
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
 				},
 				el: '.vue-box',
 				data: {
 					p: { // 查询参数  
-						id: '',		// 主键 
-						cardNo: '',		// 名称 
-						cardSize: '',		// 规格 
-						lastGoodsName: '',		// 最后一次运输商品 
-						lastGoodsCode: '',		// 最后一次运输商品编号 
-						lastNetWeight: '',		// 最后一次载重 
-						lastInTime: '',		// 最后一次入境时间 
-						lastOutTime: '',		// 最后一次出境时间 
-						status: '',		// 当前状态(1=境外,2=境内) 
-						pageNo: 1,		// 当前页 
-						pageSize: 10,	// 页大小 
-						sortType: 0		// 排序方式 
+						id: '', // 主键 
+						cardNo: '', // 名称 
+						carType: '',
+						pageNo: 1, // 当前页 
+						pageSize: 10, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					header: {
+						'satoken': localStorage.tokenValue
 					},
 					dataCount: 0,
 					dataList: [], // 数据集合 
+					modal: {
+						visible: false,
+						filename: '',
+						percentage: 0
+					}
 				},
 				methods: {
+					importTemplate() {
+						window.location.href = '../../static/excel/批量导入车辆.xlsx';
+					},
+					importFn() {
+						Object.assign(this.modal, {
+							visible: true,
+							filename: ''
+						})
+					},
+					beforeUpload() {
+						sa.loading('正在上传..')
+					},
+					successFn(res) {
+						sa.hideLoading();
+						if (res.code == 200) {
+							sa.alert('导入成功')
+							setTimeout(() => {
+								this.modal.visible = false;
+								this.f5();
+							}, 1000)
+
+						} else {
+							sa.error(res.msg);
+						}
+					},
+					errorFn() {
+						sa.hideLoading()
+					},
+					confirmFn() {
+
+					},
 					// 刷新
 					f5: function() {
 						sa.ajax('/TbCar/getList', sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 
-							sa.f5TableHeight();		// 刷新表格高度 
+							sa.f5TableHeight(); // 刷新表格高度 
 						}.bind(this));
 					},
 					// 查看
@@ -88,18 +157,18 @@
 					// 查看 - 根据选中的
 					getBySelect: function(data) {
 						var selection = this.$refs['data-table'].selection;
-						if(selection.length == 0) {
+						if (selection.length == 0) {
 							return sa.msg('请选择一条数据')
 						}
 						this.get(selection[0]);
 					},
 					// 修改
 					update: function(data) {
-						sa.showIframe('修改数据', 'tb-car-add.html?id=' + data.id, '500px', '60%');
+						sa.showIframe('修改数据', 'tb-car-edit.html?id=' + data.id, '900px', '70%');
 					},
 					// 新增
 					add: function(data) {
-						sa.showIframe('新增数据', 'tb-car-add.html?id=-1', '500px', '60%');
+						sa.showIframe('新增数据', 'tb-car-add.html?id=-1', '900px', '70%');
 					},
 					// 删除
 					del: function(data) {
@@ -107,7 +176,7 @@
 							sa.ajax('/TbCar/delete?id=' + data.id, function(res) {
 								sa.arrayDelete(this.dataList, data);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
+								sa.f5TableHeight(); // 刷新表格高度 
 							}.bind(this))
 						}.bind(this));
 					},
@@ -116,15 +185,17 @@
 						// 获取选中元素的id列表 
 						let selection = this.$refs['data-table'].selection;
 						let ids = sa.getArrayField(selection, 'id');
-						if(selection.length == 0) {
+						if (selection.length == 0) {
 							return sa.msg('请至少选择一条数据')
 						}
 						// 提交删除 
 						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
-							sa.ajax('/TbCar/deleteByIds', {ids: ids.join(',')}, function(res) {
+							sa.ajax('/TbCar/deleteByIds', {
+								ids: ids.join(',')
+							}, function(res) {
 								sa.arrayDelete(this.dataList, selection);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
+								sa.f5TableHeight(); // 刷新表格高度 
 							}.bind(this))
 						}.bind(this));
 					},

+ 31 - 13
sp-admin/sa-view/tb-fee-statistics/month-statistcs-list.html

@@ -5,13 +5,13 @@
 		<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="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
-		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
-		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
-		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
-		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
-		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<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>
@@ -21,7 +21,7 @@
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
 					<div class="c-item">
-						<label class="c-label">收费类型:</label>
+						<label class="c-label">收费项目:</label>
 						<el-select v-model="p.feeType" placeholder="请选择" filterable>
 							<el-option label="-全部-" value=""></el-option>
 							<el-option label="核酸检测" value="1"></el-option>
@@ -30,11 +30,19 @@
 							<el-option label="停车费" value="4"></el-option>
 							<el-option label="过磅费" value="5"></el-option>
 							<el-option label="入场管理费" value="6"> </el-option>
+							<el-option label="充电打冷作业" value="7"> </el-option>
 						</el-select>
 					</div>
+<!--					<div class="c-item">-->
+<!--						<label class="c-label">日期:</label>-->
+<!--						<el-date-picker type="month" value-format="yyyy-MM" v-model="p.month"></el-date-picker>-->
+<!--					</div>-->
 					<div class="c-item">
-						<label class="c-label">日期:</label>
-						<el-date-picker type="month" value-format="yyyy-MM" v-model="p.month"></el-date-picker>
+						<label class="c-label">日期范围:</label>
+						<el-date-picker size="mini" v-model="selectMonth" type="monthrange" unlink-panels="false"
+										range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
+										format="yyyy 年 MM 月" value-format="yyyy-MM">
+						</el-date-picker>
 					</div>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br/>
@@ -46,8 +54,8 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
-					<sa-td name="收费类型" prop="feeType" type="enum"
-						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费'}"></sa-td>
+					<sa-td name="收费项目" prop="feeType" type="enum"
+						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="月份" prop="month" ></sa-td>
 					<sa-td name="数量" prop="num" ></sa-td>
 					<sa-td name="收入(元)" prop="statisticsMoney"></sa-td>
@@ -90,12 +98,22 @@
 						sortType: 0		// 排序方式 
 					},
 					dataCount: 0,
-					dataList: [], // 数据集合 
+					dataList: [], // 数据集合
+					selectMonth:[],
+					selectMonthRange: {
+						beginMonth: '', //查询开始时间
+						endMonth: '', //查询结束时间
+					},
 				},
 				methods: {
 					// 刷新
 					f5: function() {
-						sa.ajax('/TbFeeStatistics/getMonth', sa.removeNull(this.p), function(res) {
+						if ( this.selectMonth != null && this.selectMonth.length != 0) {
+							this.selectMonthRange.beginMonth = this.selectMonth[0];
+							this.selectMonthRange.beginMonth = this.selectMonth[1];
+						}
+						sa.ajax('/TbFeeStatistics/getMonth?beginMonth='+this.selectMonthRange.beginMonth+"&endMonth="+this.selectMonthRange.beginMonth,
+								sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 
 							sa.f5TableHeight();		// 刷新表格高度 

+ 74 - 22
sp-admin/sa-view/tb-fee-statistics/tb-fee-details-list.html

@@ -5,13 +5,13 @@
 		<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="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
-		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
-		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
-		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
-		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
-		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<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>
@@ -21,6 +21,18 @@
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
 					<div class="c-item">
+						<label class="c-label">收费项目:</label>
+						<el-select v-model="p.feeType" placeholder="请选择" filterable>
+							<el-option label="核酸检测" value="1"></el-option>
+							<el-option label="消杀作业" value="2"></el-option>
+							<el-option label="装卸作业" value="3"></el-option>
+							<el-option label="停车费" value="4"></el-option>
+							<el-option label="过磅费" value="5"></el-option>
+							<el-option label="入场管理费" value="6"> </el-option>
+							<el-option label="充电打冷作业" value="7"> </el-option>
+						</el-select>
+					</div>
+					<div class="c-item">
 						<label class="c-label">业务类型:</label>
 						<el-select v-model="p.itemTypeName" placeholder="请选择" filterable>
 							<el-option v-for="item in itemTypeList" :key="item.id"
@@ -28,10 +40,18 @@
 							</el-option>
 						</el-select>
 					</div>
+<!--					<div class="c-item">-->
+<!--						<label class="c-label">日期:</label>-->
+<!--						<el-date-picker type="date" value-format="yyyy-MM-dd" v-model="p.payDay"></el-date-picker>-->
+<!--					</div>-->
 					<div class="c-item">
-						<label class="c-label">日期:</label>
-						<el-date-picker type="date" value-format="yyyy-MM-dd" v-model="p.payDay"></el-date-picker>
+						<label class="c-label">日期范围:</label>
+						<el-date-picker size="mini" v-model="selectTime" type="daterange" unlink-panels="false"
+										range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
+										format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
+						</el-date-picker>
 					</div>
+
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br />
 				</el-form>
@@ -44,18 +64,39 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" >
 					<sa-td type="selection"></sa-td>
-					<sa-td name="业务单号" prop="businessNo" ></sa-td>
-					<sa-td name="车牌号" prop="carNo" ></sa-td>
-					<sa-td name="收费类型" prop="feeType" type="enum"
+					<sa-td name="作业类型" prop="feeType" type="enum"
+						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
+					<sa-td name="收费项目" prop="feeType" type="enum"
 						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="业务类型" prop="itemTypeName" ></sa-td>
-					<sa-td name="业务项" prop="itemName" ></sa-td>
-					<sa-td name="作业单位" prop="pickCustomerName" ></sa-td>
-					<sa-td name="项目金额" prop="itemPrice" ></sa-td>
-					<sa-td name="税率" prop="taxRate" ></sa-td>
-					<sa-td name="不含税金额" prop="noTaxPrice" ></sa-td> 
-					<sa-td name="支付日期" prop="payDay" ></sa-td>
-					<sa-td name="支付方式" prop="payType" type="enum" :jv="{3: '微信支付'}"></sa-td>
+					<sa-td name="货品种类" prop="" ></sa-td>
+					<sa-td name="车牌号" prop="carNo" width="90px" ></sa-td>
+					<sa-td name="车型" prop="itemName" ></sa-td><!--业务项-->
+					<sa-td name="重量(吨)" prop="weight" ></sa-td>
+					<sa-td name="数量" prop="num" ></sa-td>
+					<sa-td name="单价" prop="unitPrice" ></sa-td>
+					<sa-td name="总价" prop="itemPrice" ></sa-td>
+					<sa-td name="结算状态" prop="isSettle" type="enum" :jv="{0: '未结算',1: '已结算'}"></sa-td>
+					<sa-td name="复核状态" prop="" ></sa-td>
+<!--					<sa-td name="税率(%)" prop="taxRate" ></sa-td>-->
+					<el-table-column label="税率(%)" >
+						<template slot-scope="s">
+							<span>{{s.row.taxRate * 100}}</span>
+						</template>
+					</el-table-column>
+					<sa-td name="税款(元)" prop="taxPrice" ></sa-td>
+					<sa-td name="不含税金额(元)" prop="noTaxPrice" ></sa-td>
+					<sa-td name="收款方式" prop="payType" type="enum" :jv="{3: '微信支付'}"></sa-td>
+					<sa-td name="收款种类" prop="payMode" type="enum" :jv="{1: '直接收款'}"></sa-td>
+					<sa-td name="系统流水号" prop="" ></sa-td>
+					<sa-td name="订单编号" prop="businessNo" width="140px" ></sa-td>
+					<sa-td name="作业编号" prop="businessItemNo" width="145px" ></sa-td>
+					<sa-td name="企业名称" prop="pickCustomerName" ></sa-td>
+					<sa-td name="发票号" prop="" ></sa-td>
+					<sa-td name="生成时间" prop="createTime" width="90px" ></sa-td>
+					<sa-td name="付款时间" prop="payTime"  width="90px" ></sa-td>
+					<sa-td name="备注" prop="remark" ></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>-->
@@ -91,7 +132,8 @@
 					p: { // 查询参数  
 						id: '',		// 主键 
 						businessNo: '',		// 业务单号 
-						carNo: '',		// 车牌号 
+						carNo: '',		// 车牌号
+						feeType: '',		//收费类型
 						itemTypeId: '',		// 业务类型id 
 						itemTypeName: '',		// 业务类型 
 						itemId: '',		//  
@@ -101,12 +143,17 @@
 						payType: '',		// 支付方式(3=微信支付) 
 						createTime: '',		// 创建时间 
 						pageNo: 1,		// 当前页 
-						pageSize: 10,	// 页大小 
-						sortType: 9		// 排序方式
+						pageSize: 10,	// 页大小
+						sortType: 11		// 排序方式
 					},
 					dataCount: 0,
 					dataList: [], // 数据集合
 					itemTypeList: [],
+					selectTime:[],
+					selectTimeRange: {
+						beginTime: '', //查询开始时间
+						endTime: '', //查询结束时间
+					},
 					emodel: {
 						visible: false,
 						form: {
@@ -132,7 +179,12 @@
 					},
 					// 刷新
 					f5: function() {
-						sa.ajax('/TbFeeDetails/getList', sa.removeNull(this.p), function(res) {
+						if ( this.selectTime != null && this.selectTime.length != 0) {
+							this.selectTimeRange.beginTime = this.selectTime[0];
+							this.selectTimeRange.endTime = this.selectTime[1];
+						}
+						sa.ajax('/TbFeeDetails/getList?beginTime='+this.selectTimeRange.beginTime+'&endTime='+this.selectTimeRange.endTime,
+								sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 
 							sa.f5TableHeight();		// 刷新表格高度 

+ 33 - 13
sp-admin/sa-view/tb-fee-statistics/tb-fee-statistics-list.html

@@ -5,13 +5,13 @@
 		<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="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
 		<link rel="stylesheet" href="../../static/sa.css">
-		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
-		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
-		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
-		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
-		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
+		<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>
@@ -23,7 +23,7 @@
 <!--					<sa-item type="enum" name="收费类型" v-model="p.feeType" -->
 <!--						:jv="{1: '核酸检测', 3: '装卸作业', 4: '停车费', 5: '过磅费'}" jtype="2" def="不限"></sa-item>-->
 					<div class="c-item">
-						<label class="c-label">收费类型:</label>
+						<label class="c-label">收费项目:</label>
 						<el-select v-model="p.feeType" placeholder="请选择" filterable>
 							<el-option label="-全部-" value=""> </el-option>
 							<el-option label="核酸检测" value="1"> </el-option>
@@ -32,11 +32,19 @@
 							<el-option label="停车费" value="4"> </el-option>
 							<el-option label="过磅费" value="5"> </el-option>
 							<el-option label="入场管理费" value="6"> </el-option>
+							<el-option label="充电打冷作业" value="7"> </el-option>
 						</el-select>
 					</div>
+<!--					<div class="c-item">-->
+<!--						<label class="c-label">日期:</label>-->
+<!--						<el-date-picker type="date" value-format="yyyy-MM-dd" v-model="p.dayTime"></el-date-picker>-->
+<!--					</div>-->
 					<div class="c-item">
-						<label class="c-label">日期:</label>
-						<el-date-picker type="date" value-format="yyyy-MM-dd" v-model="p.dayTime"></el-date-picker>
+						<label class="c-label">日期范围:</label>
+						<el-date-picker size="mini" v-model="selectDay" type="daterange" unlink-panels="false"
+										range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
+										format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
+						</el-date-picker>
 					</div>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br />
@@ -48,9 +56,9 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" >
 					<sa-td type="selection"></sa-td>
-					<sa-td name="收费类型" prop="feeType" type="enum"
+					<sa-td name="收费项目" prop="feeType" type="enum"
 						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
-					<sa-td name="业务类型" prop="itemTypeName" ></sa-td>
+<!--					<sa-td name="业务类型" prop="itemTypeName" ></sa-td>-->
 					<sa-td name="日期" type="date" prop="dayTime" ></sa-td>
 					<sa-td name="数量" prop="num" ></sa-td>
 					<sa-td name="含税收入(元)" prop="taxMoney" ></sa-td>
@@ -97,12 +105,24 @@
 						sortType: 9		// 排序方式
 					},
 					dataCount: 0,
-					dataList: [], // 数据集合 
+					dataList: [], // 数据集合
+					selectDay:[],
+					selectDayRange: {
+						beginDay: '', //查询开始时间
+						endDay: '', //查询结束时间
+					},
 				},
 				methods: {
 					// 刷新
 					f5: function() {
-						sa.ajax('/TbFeeStatistics/getList', sa.removeNull(this.p), function(res) {
+						if ( this.selectDay != null && this.selectDay.length != 0) {
+							this.selectDayRange.beginDay = this.selectDay[0];
+							this.selectDayRange.endDay = this.selectDay[1];
+						}
+						console.log(this.selectDayRange.beginDay);
+						console.log(this.selectDayRange.endDay);
+						sa.ajax('/TbFeeStatistics/getList?beginDay='+this.selectDayRange.beginDay+"&endDay="+this.selectDayRange.endDay,
+								sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 
 							sa.f5TableHeight();		// 刷新表格高度 

+ 4 - 3
sp-admin/sa-view/tb-fee-statistics/year-statistcs-list.html

@@ -30,6 +30,7 @@
 							<el-option label="停车费" value="4"></el-option>
 							<el-option label="过磅费" value="5"></el-option>
 							<el-option label="入场管理费" value="6"> </el-option>
+							<el-option label="充电打冷作业" value="7"> </el-option>
 						</el-select>
 					</div>
 					<div class="c-item">
@@ -46,8 +47,8 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
-					<sa-td name="收费类型" prop="feeType" type="enum"
-						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费'}"></sa-td>
+					<sa-td name="收费项目" prop="feeType" type="enum"
+						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="年份" prop="year"></sa-td>
 					<sa-td name="数量" prop="num" ></sa-td>
 					<sa-td name="收入(元)" prop="statisticsMoney"></sa-td>
@@ -90,7 +91,7 @@
 						sortType: 0		// 排序方式 
 					},
 					dataCount: 0,
-					dataList: [], // 数据集合 
+					dataList: [], // 数据集合
 				},
 				methods: {
 					// 刷新

BIN=BIN
sp-admin/static/excel/批量导入车辆.xlsx


+ 1 - 0
sp-server/app.pid

@@ -0,0 +1 @@
+32340

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

@@ -103,7 +103,7 @@ public class ApiController {
 
     @GetMapping(value = "searchPartCar")
     public AjaxJson searchPartCar(String carNo) {
-
+        carNo=carNo.toUpperCase();
         List<TbBusinessCar> list = apiService.searchPartCar(carNo);
 
         return AjaxJson.getSuccessData(list);

+ 50 - 19
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -15,6 +15,8 @@ import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
 import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_business_item.TbBusinessItemService;
+import com.pj.project.tb_car.TbCar;
+import com.pj.project.tb_car.TbCarService;
 import com.pj.utils.cache.RedisUtil;
 import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
 import org.springframework.context.annotation.Lazy;
@@ -22,6 +24,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import javax.xml.crypto.Data;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -40,6 +43,8 @@ public class OpenService {
     @Resource
     @Lazy
     private TbBusinessItemService tbBusinessItemService;
+    @Resource
+    private TbCarService tbCarService;
 
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
@@ -47,46 +52,66 @@ public class OpenService {
     public ResultJson checkCarNumber(CheckCarNumberBO checkCarNumberBO) {
         String carNo = checkCarNumberBO.getCarNumber();
         int inOrOut = checkCarNumberBO.getInOrOut();
+        String image = checkCarNumberBO.getImageData();
         if (inOrOut == 1) {
-            handlerIn(carNo, checkCarNumberBO.getChannelName());
+            handlerIn(carNo, checkCarNumberBO.getChannelName(), image);
             return ResultJson.success();
         }
-        return handlerOut(carNo, checkCarNumberBO.getChannelName());
+        return handlerOut(carNo, checkCarNumberBO.getChannelName(), image);
 
     }
 
-    private void handlerIn(String carNo, String channel) {
+    private void handlerIn(String carNo, String channel, String image) {
         carNo = carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(carNo);
         Date now = new Date();
+        checkFree(carNo, 1, now);
         if (tbBusinessCar == null || (tbBusinessCar.getRealInTime() != null && tbBusinessCar.getRealOutTime() != null)) {
             tbBusinessCar = new TbBusinessCar();
-            tbBusinessCar.setCarNo(carNo).setPay(0).setCarSize(3D).setIsLock(0).setInChannel(channel).setRealInTime(now);
+            tbBusinessCar.setCarNo(carNo).setPay(0).setCarSize(3D).setIsLock(0).setInImage(image)
+                    .setInChannel(channel).setRealInTime(now).setBasePartMoney(new BigDecimal("0"));
             tbBusinessCarService.save(tbBusinessCar);
             return;
         }
-        tbBusinessCar.setRealInTime(now).setInChannel(channel);
+        tbBusinessCar.setRealInTime(now).setInChannel(channel).setInImage(image);
         tbBusinessCarService.saveOrUpdate(tbBusinessCar);
         if (!CAR_LIST.contains(carNo)) {
             TbBusiness tbBusiness = tbBusinessService.getById(tbBusinessCar.getBusinessId());
-            tbBusiness.setRealInTime(now).setInChannel(channel);
-            tbBusinessService.updateById(tbBusiness);
+            if (tbBusiness != null) {
+                tbBusiness.setRealInTime(now).setInChannel(channel);
+                tbBusinessService.updateById(tbBusiness);
+            }
         }
+
     }
 
-    private ResultJson handlerOut(String carNo, String channel) {
+    private ResultJson handlerOut(String carNo, String channel, String image) {
         carNo = carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findNotOutCar(carNo);
         if (tbBusinessCar == null) {
             return ResultJson.error("未查询到入场记录");
         }
+        Date now = new Date();
+        if (checkFree(carNo, 2, now)) {
+            tbBusinessCar.setRealOutTime(now).setOutImage(image);
+            tbBusinessCarService.updateById(tbBusinessCar);
+            return ResultJson.success();
+        }
         if (tbBusinessCar.getIsLock() == 1) {
             return ResultJson.error("车辆已锁定");
         }
-        Date now = new Date();
+
         String businessId = tbBusinessCar.getBusinessId();
+        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now, StrUtil.isNotEmpty(businessId));
+        double dif = price.subtract(tbBusinessCar.getMoney()).doubleValue();
+        if (dif > 0) {
+            tbBusinessCar.setPay(0).setOutImage(image);
+            tbBusinessCarService.updateById(tbBusinessCar);
+            RedisUtil.set(channel, carNo);
+            return ResultJson.error("请缴停车费" + dif + "元");
+        }
         if (StrUtil.isEmpty(businessId)) {
-            tbBusinessCar.setRealOutTime(now).setOutChannel(channel);
+            tbBusinessCar.setRealOutTime(now).setOutChannel(channel).setOutImage(image);
             tbBusinessCarService.updateById(tbBusinessCar);
             return ResultJson.success();
         }
@@ -103,21 +128,27 @@ public class OpenService {
                 return ResultJson.error("请缴纳业务费用");
             }
         }
-        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now);
-        double dif = price.subtract(tbBusinessCar.getMoney()).doubleValue();
-        if (dif > 0) {
-            tbBusinessCar.setPay(0);
-            tbBusinessCarService.updateById(tbBusinessCar);
-            RedisUtil.set(channel, carNo);
-            return ResultJson.error("请缴停车费" + dif + "元");
-        }
+
         if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(business.getBusinessType()) && !business.getItemPrice().equals(itemPayPrice)) {
             return ResultJson.error("请缴纳业务费用");
         }
-        tbBusinessCar.setRealOutTime(now).setOutChannel(channel);
+        tbBusinessCar.setRealOutTime(now).setOutChannel(channel).setOutImage(image);
         tbBusinessCarService.updateById(tbBusinessCar);
         return ResultJson.success();
     }
 
+    private boolean checkFree(String carNo, int inOrOut, Date now) {
+        TbCar tbCar = tbCarService.findByCardNo(carNo);
+        if (tbCar != null) {
+            if (inOrOut == 1) {
+                tbCar.setLastInTime(now);
+            } else {
+                tbCar.setLastOutTime(now);
+            }
+            tbCarService.updateById(tbCar);
+        }
+        return tbCar != null && !TbCar.CarTypeEnum.BUSINESS_CAR.getType().equals(tbCar.getCarType());
+    }
+
 
 }

+ 4 - 2
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -134,6 +134,8 @@ public class ApiService {
             TbBusiness tbBusiness = tbBusinessService.getById(businessId);
             return tbBusiness.getAdminConfirmInput() == 1;
         }).collect(Collectors.toList());
+       List<TbBusinessCar>cars= tbBusinessCarService.findTheNoBusinessCar(carNo);
+       list.addAll(cars);
         return list;
     }
 
@@ -153,7 +155,7 @@ public class ApiService {
             return result;
         }
         Date now = new Date();
-        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now);
+        BigDecimal price = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now,StrUtil.isNotEmpty(tbBusinessCar.getBusinessId()));
         BigDecimal dif = price.subtract(tbBusinessCar.getMoney());
         Map<String, Object> car = new HashMap<>();
         car.put("id", tbBusinessCar.getId());
@@ -239,7 +241,7 @@ public class ApiService {
         TbBusiness tbBusiness = tbBusinessService.getById(tbBusinessItem.getBusinessId());
         MsgDataBO msgDataBO = new MsgDataBO("订单号:" + tbBusinessItem.getNo(), tbCostomer.getName(), DateUtil.now(), tbBusiness.getGoodsName() + "(" + tbBusinessItem.getItemTypeName() + tbBusinessItem.getItemName() + ")");
         spAdminList.stream().filter(admin -> StrUtil.isNotEmpty(admin.getOpenid())).forEach(admin -> {
-            String detailUrl = myConfig.getWebDomain() + "/pages/business-order/business-item?id=" + tbBusiness.getId() + "&itemId=" + tbBusinessItem.getId() + "&openid=" + openid;
+            String detailUrl = myConfig.getWebDomain() + "/pages/business-order/business-item?id=" + tbBusiness.getId() +"&itemId="+tbBusinessItem.getId()+ "&openid=" + openid;
             log.info("admin confirm business:[{}]", detailUrl);
             wxService.sendTemplateMsg(wxConfig.getBusinessPickTemplate(), admin.getOpenid(), msgDataBO, detailUrl);
         });

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

@@ -16,6 +16,7 @@ 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.PartConfig;
 import com.pj.current.config.WxConfig;
 import com.pj.project.tb_account.TbAccountService;
 import com.pj.project.tb_business.TbBusiness;
@@ -57,6 +58,8 @@ public class WxService {
     WxConfig wxConfig;
     @Resource
     MyConfig myConfig;
+    @Resource
+    PartConfig partConfig;
 
     @Resource
     WxUtils wxUtils;
@@ -83,6 +86,7 @@ public class WxService {
         String tradeType = request.getParameter("tradeType");
         String money = request.getParameter("money");
         String openid = request.getParameter("openid");
+        String desc = request.getParameter("desc");
 //        String openid = "oDWvn5w-hVkzUuKeY7OBXBV_l1rU";
         String businessId = request.getParameter("b");
         String c = request.getParameter("c");
@@ -95,11 +99,10 @@ public class WxService {
         params.put("mch_id", wxConfig.getMachId());
         params.put("openid", openid);
         params.put("nonce_str", RandomUtil.randomString(32));
-        params.put("body", "支付中心-业务订单支付");
+        params.put("body", desc);
         params.put("out_trade_no", out_trade_no);
         params.put("attach", JSONUtil.toJsonStr(atchMap));
-        String total_free = NumberUtil.mul(money, 100 + "").intValue() + "";
-//        String total_free = "1";
+        String total_free = partConfig.isTestEnv() ? "1" : NumberUtil.mul(money, 100 + "").intValue() + "";
         log.info("pay free:{}", total_free);
         params.put("total_fee", total_free);
 //        params.put("total_fee", "1");
@@ -132,7 +135,6 @@ public class WxService {
     }
 
 
-
     public Map<String, String> getPayParams(String openid, String prePayId) {
         Map<String, String> signMap = new HashMap<>(10);
         signMap.put("appId", wxConfig.getAppId());
@@ -145,7 +147,8 @@ public class WxService {
         signMap.put("openId", openid);
         return signMap;
     }
-    public Map<String, String> getPayP(String timeStamp,String nonceStr,String openid, String pack) {
+
+    public Map<String, String> getPayP(String timeStamp, String nonceStr, String openid, String pack) {
         Map<String, String> signMap = new HashMap<>(10);
         signMap.put("appId", wxConfig.getAppId());
         signMap.put("timeStamp", timeStamp);
@@ -203,9 +206,11 @@ public class WxService {
                 car.setPay(1).setMoney(car.getMoney().add(price));
                 tbBusinessCarService.updateById(car);
                 TbBusiness business = tbBusinessService.getById(car.getBusinessId());
-                business.setPayMoney(business.getPayMoney().add(price));
-                business.setPayStatus(business.getPayMoney().equals(business.getTotalMoney()) ? 3 : 4);
-                tbBusinessService.updateById(business);
+                if (business != null) {
+                    business.setPayMoney(business.getPayMoney().add(price));
+                    business.setPayStatus(business.getPayMoney().equals(business.getTotalMoney()) ? 3 : 4);
+                    tbBusinessService.updateById(business);
+                }
             }
             tbFeeDetailsService.chargeParkFee(cars);//添加cars的收费明细
             String businessId = attach.getB();
@@ -226,7 +231,7 @@ public class WxService {
                         .setOutTradeNo(tradeNo)
                         .setTransactionId(transactionId)
                         .setPayMoney(money);
-                if (tbCostomer!=null){
+                if (tbCostomer != null) {
                     payRecord.setCustomerId(tbCostomer.getId()).setCustomerName(tbCostomer.getName());
                 }
                 tbPayRecordService.save(payRecord);

+ 1 - 1
sp-server/src/main/java/com/pj/constants/UserTypeEnum.java

@@ -8,7 +8,7 @@ import lombok.Getter;
 @AllArgsConstructor
 public enum  UserTypeEnum {
     SUPER_ADMIN("-1","超级管理员"),
-    PLATFORM_ADMIN("1","平台管理员");
+    PLATFORM_ADMIN("1","广西东兴北投口岸投资有限公司");
     private String customerId;
     private String desc;
 }

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

@@ -16,6 +16,7 @@ public class PartConfig {
     private BigDecimal extraPrice;
     private BigDecimal taxRate;
     private String  nightEnd;
+    private boolean  testEnv;
     private long freeMinutes;
 
 }

+ 1 - 4
sp-server/src/main/java/com/pj/current/task/TokenTask.java

@@ -19,16 +19,14 @@ public class TokenTask implements Runnable {
 
     @Override
     public void run() {
-        log.info("start to get wx access token");
         String tokenKey = wxConfig.getAccessTokenKey();
         String ticketKey = wxConfig.getJsApiTicketKey();
         String tokenUrl = wxConfig.getAccessTokenUrl();
         String resp = HttpUtil.get(tokenUrl);
         JSONObject result = JSONUtil.parseObj(resp);
         String accessToken = result.getStr("access_token");
-        log.info("get access token result:{}", resp);
         if (StrUtil.isEmpty(accessToken)) {
-            log.error("=======获取accessToken失败==========");
+            log.error("get access token fail:{}", resp);
             return;
         }
         RedisUtil.set(tokenKey, accessToken);
@@ -36,7 +34,6 @@ public class TokenTask implements Runnable {
         String jsResp = HttpUtil.get(jsUrl);
         JSONObject jsResult = JSONUtil.parseObj(jsResp);
         String ticket = jsResult.getStr("ticket");
-        log.info("get js ticket result:{}", jsResult);
         if (StrUtil.isEmpty(ticket)) {
             log.error("=======ticket=====fail======");
             return;

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

@@ -412,7 +412,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             iTime = tbBusiness.getChinaCarInTime();
             oTime = tbBusiness.getChinaCarOutTime();
         }
-        BigDecimal price = calculationPartMoney(iTime, oTime);
+        BigDecimal price = calculationPartMoney(iTime, oTime, true);
         if (itemType.contains("中国")) {
             int len = tbBusiness.getCardNo().split(" ").length;
             tbBusiness.setChinaPartMoney(price.multiply(new BigDecimal(len)));
@@ -422,7 +422,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) {
+    public BigDecimal calculationPartMoney(Date iTime, Date oTime, boolean businessCar) {
         LocalDateTime inDayTime = iTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
         LocalDateTime outDayTime = oTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
         long minutes = ChronoUnit.MINUTES.between(inDayTime, outDayTime);
@@ -432,11 +432,17 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         }
         long days = ChronoUnit.DAYS.between(inDayTime.toLocalDate(), outDayTime.toLocalDate());
         long hour = ChronoUnit.HOURS.between(inDayTime, outDayTime);
-        BigDecimal basePrice = partConfig.getBasePrice();
+        BigDecimal basePrice = businessCar ? partConfig.getBasePrice() : new BigDecimal("0");
+        BigDecimal p = partConfig.getBasePrice();//乘积因子
         BigDecimal extraPrice = partConfig.getExtraPrice();
-        return basePrice.add(basePrice.multiply(new BigDecimal(hour / 24))).add(new BigDecimal(days).multiply(extraPrice));
+        BigDecimal unit = new BigDecimal(hour / 24);
+        if (minutes > partConfig.getFreeMinutes() && minutes < 24 * 60) {
+            unit = new BigDecimal("1");
+        }
+        return basePrice.add(p.multiply(unit)).add(new BigDecimal(days).multiply(extraPrice));
     }
 
+
     /**
      * @param carNo
      * @param inOrOut 1入 2出
@@ -468,29 +474,29 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         String businessId = car.getBusinessId();
         result.put("businessId", businessId);
         List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(businessId);
-        if (cars.isEmpty()){
+        if (cars.isEmpty()) {
             cars.add(car);
         }
         Date now = new Date();
         List<Map<String, Object>> carsList = new ArrayList<>();
         for (TbBusinessCar tbBusinessCar : cars) {
-            double partMoney = tbBusinessCar.getBasePartMoney().doubleValue();
-            if (!StrUtil.equals("STATE", state)) {
-                Date inTime = tbBusinessCar.getRealInTime();
-                if (inTime != null) {
-                    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();
-                } else {
-                    partMoney = 0D;
-                }
+            BigDecimal basePrice = StrUtil.isEmpty(tbBusinessCar.getBusinessId()) ? new BigDecimal("0") : tbBusinessCar.getBasePartMoney();
+            double partMoney = basePrice.doubleValue();
+            Date inTime = tbBusinessCar.getRealInTime();
+            if (inTime != null) {
+                BigDecimal price = this.calculationPartMoney(inTime, now, StrUtil.isNotEmpty(tbBusinessCar.getBusinessId()));
+                BigDecimal money = tbBusinessCar.getMoney();
+                partMoney = money == null ? price.subtract(basePrice).doubleValue() : price.subtract(money).doubleValue();
             }
             Map<String, Object> carMap = new HashMap<>();
             carMap.put("price", partMoney);
             carMap.put("id", tbBusinessCar.getId());
             carMap.put("carNo", tbBusinessCar.getCarNo());
             carMap.put("pay", tbBusinessCar.getPay());
+            TbCar tbCar = tbCarService.findByCardNo(tbBusinessCar.getCarNo());
+            if (tbCar != null && !TbCar.CarTypeEnum.BUSINESS_CAR.getType().equals(tbCar.getCarType())) {
+                carMap.put("price", 0);
+            }
             carsList.add(carMap);
         }
         result.put("carList", carsList);

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

@@ -97,9 +97,13 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	private BigDecimal basePartMoney;
 	private String inChannel;
 	private String outChannel;
+
 	@TableField(value = "is_lock")
 	private Integer isLock;
 
+	private String inImage;
+	private String outImage;
+
 
 
 

+ 2 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.java

@@ -28,4 +28,6 @@ public interface TbBusinessCarMapper extends BaseMapper <TbBusinessCar> {
 
 
     List<TbBusinessCar> searchPartCar(String carNo);
+
+	List<TbBusinessCar> findTheNoBusinessCar(String carNo);
 }

+ 9 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml

@@ -37,6 +37,7 @@
             <if test=' this.has("realOutTime") '>and real_out_time = #{realOutTime}</if>
             <if test=' this.has("money") '>and money = #{money}</if>
             <if test=' this.has("driverPhone") '>and driver_phone = #{driverPhone}</if>
+            <if test=' this.has("pay") '>and pay = #{pay}</if>
         </where>
         order by
         <choose>
@@ -63,6 +64,14 @@
             AND b.total_money> b.pay_money
             AND a.car_no LIKE CONCAT( '%', #{carNo}, '%' )
 	</select>
+    <select id="findTheNoBusinessCar" resultType="com.pj.project.tb_business_car.TbBusinessCar">
+            SELECT * from tb_business_car
+             WHERE (business_id is null or business_id='')
+             and car_no like CONCAT('%',#{carNo},'%')
+             and real_in_time is not null
+             and real_out_time is null
+             AND pay=0
+    </select>
 
 
 </mapper>

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

@@ -253,4 +253,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     }
 
+    public List<TbBusinessCar> findTheNoBusinessCar(String carNo) {
+        return tbBusinessCarMapper.findTheNoBusinessCar(carNo);
+    }
 }

+ 26 - 0
sp-server/src/main/java/com/pj/project/tb_car/ImportCarBO.java

@@ -0,0 +1,26 @@
+package com.pj.project.tb_car;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class ImportCarBO implements Serializable {
+    @ExcelProperty(index = 0)
+    private String customerName;
+    @ExcelProperty(index = 1)
+    private String carType;
+    @ExcelProperty(index = 2)
+    private String cardNo;
+    @ExcelProperty(index = 4)
+    private String people;
+    @ExcelProperty(index = 3)
+    private String phone;
+    @ExcelProperty(index = 5)
+    private Double cardSize;
+    @ExcelProperty(index = 6)
+    private Double weight;
+    @ExcelProperty(index = 7)
+    private String remark;
+
+}

+ 68 - 0
sp-server/src/main/java/com/pj/project/tb_car/ImportCarListener.java

@@ -0,0 +1,68 @@
+package com.pj.project.tb_car;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.validation.ValidationUtil;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.pj.constants.UserTypeEnum;
+import com.pj.project.tb_costomer.TbCostomer;
+import com.pj.project.tb_costomer.TbCostomerService;
+import com.pj.project4sp.global.BusinessException;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Component
+public class ImportCarListener extends AnalysisEventListener<ImportCarBO> {
+    @Resource
+    @Lazy
+    private TbCarService tbCarService;
+
+    @Resource
+    private TbCostomerService tbCostomerService;
+
+
+    public List<ImportCarBO> list = new ArrayList<>();
+
+    @Override
+    public void invoke(ImportCarBO importCarBO, AnalysisContext analysisContext) {
+        if (StrUtil.isNotEmpty(importCarBO.getCustomerName())) {
+            list.add(importCarBO);
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+        List<TbCar> cars = new ArrayList<>();
+        list.forEach(importCarBO -> {
+            String customerName = importCarBO.getCustomerName();
+            String customerId = UserTypeEnum.PLATFORM_ADMIN.getCustomerId();
+            if (!StrUtil.equals(customerName, UserTypeEnum.PLATFORM_ADMIN.getDesc())) {
+                TbCostomer tbCostomer = tbCostomerService.findByName(customerName);
+                if (tbCostomer == null) {
+                    throw new BusinessException("系统找不到:" + customerName + "企业");
+                }
+                customerId = tbCostomer.getId();
+            }
+            String carNo = importCarBO.getCardNo();
+            if (StrUtil.isEmpty(carNo)) {
+                throw new BusinessException(customerName + "的车牌号不能为空");
+            }
+            carNo = carNo.toUpperCase();
+            TbCar db = tbCarService.findByCardNo(carNo);
+            if (db == null) {
+                db = new TbCar();
+            }
+            String carType = importCarBO.getCarType();
+            Integer type = TbCar.CarTypeEnum.getType(carType);
+            BeanUtil.copyProperties(importCarBO, db, "carType");
+            db.setCardNo(carNo).setCarType(type).setCustomerId(customerId);
+            cars.add(db);
+        });
+        tbCarService.saveOrUpdateBatch(cars);
+    }
+}

+ 103 - 70
sp-server/src/main/java/com/pj/project/tb_car/TbCar.java

@@ -1,18 +1,24 @@
 package com.pj.project.tb_car;
 
 import java.io.Serializable;
+import java.util.Arrays;
 import java.util.Date;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.pj.project4sp.global.BusinessException;
+import lombok.AllArgsConstructor;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
+import lombok.Getter;
 import lombok.experimental.Accessors;
 
 /**
- * Model: tb_car -- 
- * @author qzy 
+ * Model: tb_car --
+ *
+ * @author qzy
  */
 @Data
 @Accessors(chain = true)
@@ -20,74 +26,101 @@ import lombok.experimental.Accessors;
 @EqualsAndHashCode(callSuper = false)
 public class TbCar extends Model<TbCar> implements Serializable {
 
-	// ---------- 模块常量 ----------
-	/**
-	 * 序列化版本id 
-	 */
-	private static final long serialVersionUID = 1L;	
-	/**
-	 * 此模块对应的表名 
-	 */
-	public static final String TABLE_NAME = "tb_car";	
-	/**
-	 * 此模块对应的权限码 
-	 */
-	public static final String PERMISSION_CODE = "tb-car";	
-
-
-	// ---------- 表中字段 ----------
-	/**
-	 * 主键 
-	 */
-	private String id;
-
-	/**
-	 * 名称 
-	 */
-	private String cardNo;
-
-
-	/**
-	 * 规格 
-	 */
-	private Double cardSize;
-	private String countryName;
-
-	/**
-	 * 最后一次运输商品 
-	 */
-	private String lastGoodsName;	
-
-	/**
-	 * 最后一次运输商品编号 
-	 */
-	private String lastGoodsCode;	
-
-	/**
-	 * 最后一次载重 
-	 */
-	private Double lastNetWeight;	
-
-	/**
-	 * 最后一次入境时间 
-	 */
-	private Date lastInTime;
-
-	/**
-	 * 最后一次出境时间 
-	 */
-	private Date lastOutTime;
-
-	/**
-	 * 当前状态(1=境外,2=境内) 
-	 */
-	private int status;
-
-
-
-
-
-	
+    // ---------- 模块常量 ----------
+    /**
+     * 序列化版本id
+     */
+    private static final long serialVersionUID = 1L;
+    /**
+     * 此模块对应的表名
+     */
+    public static final String TABLE_NAME = "tb_car";
+    public static final String ADD = "tb-car-add";
+    public static final String EDIT = "tb-car-edit";
+    public static final String DEL = "tb-car-del";
+    public static final String IMPORT = "tb-car-import";
+    /**
+     * 此模块对应的权限码
+     */
+    public static final String PERMISSION_CODE = "tb-car";
+
+
+    // ---------- 表中字段 ----------
+    /**
+     * 主键
+     */
+    private String id;
+
+    /**
+     * 名称
+     */
+    private String cardNo;
+    private String customerId;
+    private String customerName;
+    /**
+     * 0临时车、1行政车、2业务车
+     */
+    private Integer carType;
+    /**
+     * 规格
+     */
+    private Double cardSize;
+    private Double weight;
+    private String phone;
+    private String people;
+
+
+    private String countryName;
+
+    /**
+     * 最后一次运输商品
+     */
+    private String lastGoodsName;
+
+    /**
+     * 最后一次运输商品编号
+     */
+    private String lastGoodsCode;
+
+    /**
+     * 最后一次载重
+     */
+    private Double lastNetWeight;
+
+    /**
+     * 最后一次入境时间
+     */
+    private Date lastInTime;
+
+    /**
+     * 最后一次出境时间
+     */
+    private Date lastOutTime;
+
+    /**
+     * 当前状态(1=境外,2=境内)
+     */
+    private int status;
+
+
+    @Getter
+    @AllArgsConstructor
+    public static enum CarTypeEnum {
+        /**
+         * 0临时车、1行政车、2业务车
+         */
+        TEMPORARY_CAR("临时车",0),
+        ADMINISTRATIVE_CAR("行政车",1),
+        BUSINESS_CAR("业务车",2)
+        ;
+        private String name;
+        private Integer type;
+
+        public static Integer getType(String des){
+          return   Arrays.stream(CarTypeEnum.values()).filter(obj-> StrUtil.equals(obj.getName(),des))
+                    .findAny().orElseThrow(()->new BusinessException("系统找不到"+des)).getType();
+        }
+    }
 
 
 }

+ 19 - 11
sp-server/src/main/java/com/pj/project/tb_car/TbCarController.java

@@ -12,6 +12,7 @@ import com.pj.project4sp.SP;
 
 import com.pj.current.satoken.StpUserUtil;
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.web.multipart.MultipartFile;
 
 
 /**
@@ -28,25 +29,24 @@ public class TbCarController {
 
 	/** 增 */  
 	@RequestMapping("add")
-	@SaCheckPermission(TbCar.PERMISSION_CODE)
+	@SaCheckPermission(TbCar.ADD)
 	@Transactional(rollbackFor = Exception.class)
 	public AjaxJson add(TbCar t){
 		tbCarService.add(t);
-		t = tbCarService.getById(SP.publicMapper.getPrimarykey());
-		return AjaxJson.getSuccessData(t);
+		return AjaxJson.getSuccess();
 	}
 
 	/** 删 */  
 	@RequestMapping("delete")
-	@SaCheckPermission(TbCar.PERMISSION_CODE)
+	@SaCheckPermission(TbCar.DEL)
 	public AjaxJson delete(Long id){
-		int line = tbCarService.delete(id);
-		return AjaxJson.getByLine(line);
+		 tbCarService.delete(id);
+		return AjaxJson.getSuccess();
 	}
 	
 	/** 删 - 根据id列表 */  
 	@RequestMapping("deleteByIds")
-	@SaCheckPermission(TbCar.PERMISSION_CODE)
+	@SaCheckPermission(TbCar.DEL)
 	public AjaxJson deleteByIds(){
 		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
 		int line = SP.publicMapper.deleteByIds(TbCar.TABLE_NAME, ids);
@@ -55,10 +55,10 @@ public class TbCarController {
 	
 	/** 改 */  
 	@RequestMapping("update")
-	@SaCheckPermission(TbCar.PERMISSION_CODE)
+	@SaCheckPermission(TbCar.EDIT)
 	public AjaxJson update(TbCar t){
-		int line = tbCarService.update(t);
-		return AjaxJson.getByLine(line);
+		tbCarService.update(t);
+		return AjaxJson.getSuccess();
 	}
 
 	/** 查 - 根据id */  
@@ -75,7 +75,15 @@ public class TbCarController {
 		List<TbCar> list = tbCarService.getList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
-	
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("importExcel")
+	@SaCheckPermission(TbCar.IMPORT)
+	public AjaxJson importExcel(MultipartFile file)throws Exception {
+		tbCarService.importExcel(file);
+		return AjaxJson.getSuccess();
+	}
+
 	
 	
 	

+ 0 - 27
sp-server/src/main/java/com/pj/project/tb_car/TbCarMapper.java

@@ -17,33 +17,6 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface TbCarMapper extends BaseMapper <TbCar> {
 
-	/**
-	 * 增  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int add(TbCar t);
-
-	/**
-	 * 删  
-	 * @param id 要删除的数据id  
-	 * @return 受影响行数 
-	 */
-	int delete(Long id);	 
-
-	/** 
-	 * 改  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int update(TbCar t);
-
-	/** 
-	 * 查 - 根据id  
-	 * @param id 要查询的数据id 
-	 * @return 实体对象 
-	 */
-	TbCar getById(Long id);	 
 
 	/**
 	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)

+ 3 - 50
sp-server/src/main/java/com/pj/project/tb_car/TbCarMapper.xml

@@ -2,65 +2,18 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.pj.project.tb_car.TbCarMapper">
 
-	<!-- 增 [G] -->
-	<insert id="add">
-		insert into 
-		tb_car (id, card_no, card_size, last_goods_name, last_goods_code, last_net_weight, last_in_time, last_out_time, status) 
-		values (#{id}, #{cardNo}, #{cardSize}, #{lastGoodsName}, #{lastGoodsCode}, #{lastNetWeight}, #{lastInTime}, #{lastOutTime}, #{status}) 
-	</insert>
-
-	<!-- 删 -->
-	<delete id="delete">
-		delete from tb_car 
-		where id = #{id}
-	</delete>
-
-	<!-- 改 [G] -->
-	<update id="update">
-		update tb_car set
-		id = #{id}, 
-		card_no = #{cardNo}, 
-		card_size = #{cardSize}, 
-		last_goods_name = #{lastGoodsName}, 
-		last_goods_code = #{lastGoodsCode}, 
-		last_net_weight = #{lastNetWeight}, 
-		last_in_time = #{lastInTime}, 
-		last_out_time = #{lastOutTime}, 
-		status = #{status}
-		where id = #{id}
-	</update>
-
-
 	<!-- ================================== 查询相关 ================================== -->
 
-	
-	<!-- 通用映射:手动模式 -->
-	<resultMap id="model" type="com.pj.project.tb_car.TbCar">
-		<result property="id" column="id" />
-		<result property="cardNo" column="card_no" />
-		<result property="cardSize" column="card_size" />
-		<result property="lastGoodsName" column="last_goods_name" />
-		<result property="lastGoodsCode" column="last_goods_code" />
-		<result property="lastNetWeight" column="last_net_weight" />
-		<result property="lastInTime" column="last_in_time" />
-		<result property="lastOutTime" column="last_out_time" />
-		<result property="status" column="status" />
-	</resultMap>
-	
+
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
 		select *
 		from tb_car 
 	</sql>
-	
-	<!-- 查 - 根据id -->
-	<select id="getById" resultMap="model">
-		<include refid="select_sql"></include>
-		where id = #{id}
-	</select>
+
 	
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
-	<select id="getList" resultMap="model">
+	<select id="getList" resultType="com.pj.project.tb_car.TbCar">
 		<include refid="select_sql"></include>
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>

+ 78 - 40
sp-server/src/main/java/com/pj/project/tb_car/TbCarService.java

@@ -1,58 +1,96 @@
 package com.pj.project.tb_car;
 
+import java.io.InputStream;
 import java.util.List;
 
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.log.StaticLog;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelReader;
+import com.alibaba.excel.read.metadata.ReadSheet;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.project4sp.global.BusinessException;
 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;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
 
 /**
- * Service: tb_car -- 
- * @author qzy 
+ * Service: tb_car --
+ *
+ * @author qzy
  */
 @Service
 @Transactional
-public class TbCarService extends ServiceImpl<TbCarMapper,TbCar>implements IService<TbCar> {
-
-	/** 底层 Mapper 对象 */
-	@Autowired
-	TbCarMapper tbCarMapper;
-
-	/** 增 */
-	int add(TbCar t){
-		return tbCarMapper.add(t);
-	}
-
-	/** 删 */
-	int delete(Long id){
-		return tbCarMapper.delete(id);
-	}
-
-	/** 改 */
-	int update(TbCar t){
-		return tbCarMapper.update(t);
-	}
-
-	/** 查 */
-	TbCar getById(Long id){
-		return tbCarMapper.getById(id);
-	}
-
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	List<TbCar> getList(SoMap so) {
-		return tbCarMapper.getList(so);	
-	}
-
-
-	public TbCar findByCardNo(String cardNo) {
-		QueryWrapper<TbCar>ew=new QueryWrapper<>();
-		ew.eq("card_no",cardNo);
-		return getOne(ew);
-	}
+public class TbCarService extends ServiceImpl<TbCarMapper, TbCar> implements IService<TbCar> {
+
+    /**
+     * 底层 Mapper 对象
+     */
+    @Autowired
+    TbCarMapper tbCarMapper;
+    @Resource
+    private ImportCarListener importCarListener;
+
+    /**
+     * 增
+     */
+    void add(TbCar t) {
+        if (StrUtil.isEmpty(t.getCustomerId())) {
+            throw new BusinessException("请选择车辆所属");
+        }
+        super.save(t);
+    }
+
+    /**
+     * 删
+     */
+    void delete(Long id) {
+        tbCarMapper.deleteById(id);
+    }
+
+    /**
+     * 改
+     */
+    void update(TbCar t) {
+        super.updateById(t);
+    }
+
+    /**
+     * 查
+     */
+    TbCar getById(Long id) {
+        return super.getById(id);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    List<TbCar> getList(SoMap so) {
+        return tbCarMapper.getList(so);
+    }
+
+
+    public TbCar findByCardNo(String cardNo) {
+        QueryWrapper<TbCar> ew = new QueryWrapper<>();
+        ew.eq("card_no", cardNo);
+        return getOne(ew);
+    }
+
+    public void importExcel(MultipartFile file) throws Exception {
+        StaticLog.info("file size:{}", file.getSize());
+        InputStream is = file.getInputStream();
+        importCarListener.list.clear();
+        ExcelReader reader = EasyExcel.read(is, ImportCarBO.class, importCarListener).build();
+        ReadSheet readSheet = EasyExcel.readSheet(0).build();
+        reader.read(readSheet);
+        reader.finish();
+        is.close();
+    }
 }

+ 126 - 98
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerController.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import cn.dev33.satoken.annotation.SaMode;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.pj.constants.UserTypeEnum;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,77 +20,97 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 
 /**
  * Controller: tb_costomer -- 客户管理
- * @author qzy 
+ *
+ * @author qzy
  */
 @RestController
 @RequestMapping("/TbCostomer/")
 public class TbCostomerController {
 
-	/** 底层 Service 对象 */
-	@Autowired
-	TbCostomerService tbCostomerService;
-
-	/** 增 */  
-	@RequestMapping("add")
-	@SaCheckPermission(TbCostomer.PERMISSION_CODE)
-	@Transactional(rollbackFor = Exception.class)
-	public AjaxJson add(TbCostomer t){
-		tbCostomerService.add(t);
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 删 */  
-	@RequestMapping("delete")
-	@SaCheckPermission(TbCostomer.PERMISSION_CODE)
-	public AjaxJson delete(String id){
-		int line = tbCostomerService.delete(id);
-		return AjaxJson.getByLine(line);
-	}
-	
-	/** 删 - 根据id列表 */  
-	@RequestMapping("deleteByIds")
-	@SaCheckPermission(TbCostomer.PERMISSION_CODE)
-	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
-		ids.forEach(id->tbCostomerService.delete(id+""));
-		return AjaxJson.getByLine(1);
-	}
-	
-	/** 改 */  
-	@RequestMapping("update")
-	@SaCheckPermission(value = {TbCostomer.PERMISSION_CODE,TbCostomer.PERMISSION_INFO},mode = SaMode.OR)
-	public AjaxJson update(TbCostomer t){
-		int line = tbCostomerService.update(t);
-		return AjaxJson.getByLine(line);
-	}
-	/** 改 */
-	@RequestMapping("update/partner")
-	@SaCheckPermission(TbCostomer.PARTNER_PERMISSION_CODE)
-	public AjaxJson updatePartner(TbCostomer t){
-		int line = tbCostomerService.update(t);
-		return AjaxJson.getByLine(line);
-	}
-
-	/** 查 - 根据id */  
-	@RequestMapping("getById")
-	public AjaxJson getById(String id){
-		TbCostomer t = tbCostomerService.getById(id);
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	@RequestMapping("getList")
-	public AjaxJson getList() { 
-		SoMap so = SoMap.getRequestSoMap();
-		String cusotmerId=StpUserUtil.getCustomerId();
-		if(StrUtil.isNotEmpty(so.getString("partner"))&& !StrUtil.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId(),cusotmerId)){
-			so.put("id",cusotmerId);
-		}
-		List<TbCostomer> list = tbCostomerService.getList(so.startPage());
-		return AjaxJson.getPageData(so.getDataCount(), list);
-	}
-
-    /** 查集合 - 客户登录时查询自己 */
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    TbCostomerService tbCostomerService;
+
+    /**
+     * 增
+     */
+    @RequestMapping("add")
+    @SaCheckPermission(TbCostomer.PERMISSION_CODE)
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxJson add(TbCostomer t) {
+        tbCostomerService.add(t);
+        return AjaxJson.getSuccessData(t);
+    }
+
+    /**
+     * 删
+     */
+    @RequestMapping("delete")
+    @SaCheckPermission(TbCostomer.PERMISSION_CODE)
+    public AjaxJson delete(String id) {
+        int line = tbCostomerService.delete(id);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 删 - 根据id列表
+     */
+    @RequestMapping("deleteByIds")
+    @SaCheckPermission(TbCostomer.PERMISSION_CODE)
+    public AjaxJson deleteByIds() {
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        ids.forEach(id -> tbCostomerService.delete(id + ""));
+        return AjaxJson.getByLine(1);
+    }
+
+    /**
+     * 改
+     */
+    @RequestMapping("update")
+    @SaCheckPermission(value = {TbCostomer.PERMISSION_CODE, TbCostomer.PERMISSION_INFO}, mode = SaMode.OR)
+    public AjaxJson update(TbCostomer t) {
+        int line = tbCostomerService.update(t);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 改
+     */
+    @RequestMapping("update/partner")
+    @SaCheckPermission(TbCostomer.PARTNER_PERMISSION_CODE)
+    public AjaxJson updatePartner(TbCostomer t) {
+        int line = tbCostomerService.update(t);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 查 - 根据id
+     */
+    @RequestMapping("getById")
+    public AjaxJson getById(String id) {
+        TbCostomer t = tbCostomerService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("getList")
+    public AjaxJson getList() {
+        SoMap so = SoMap.getRequestSoMap();
+        String cusotmerId = StpUserUtil.getCustomerId();
+        if (StrUtil.isNotEmpty(so.getString("partner")) && !StrUtil.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId(), cusotmerId)) {
+            so.put("id", cusotmerId);
+        }
+        List<TbCostomer> list = tbCostomerService.getList(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+    /**
+     * 查集合 - 客户登录时查询自己
+     */
     @RequestMapping("getOwnList")
     public AjaxJson getOwnList() {
         SoMap so = SoMap.getRequestSoMap();
@@ -99,43 +120,50 @@ public class TbCostomerController {
     }
 
     @RequestMapping("getAll")
-    public AjaxJson getAll(){
+    public AjaxJson getAll() {
         SoMap so = SoMap.getRequestSoMap();
         so.put("status", 1);
         so.put("judgeStatus", 2);
         List<TbCostomer> list = tbCostomerService.getList(so);
         return AjaxJson.getSuccessData(list);
     }
-	
-	/** 改 - 状态(0=否,1=是) */  
-	@RequestMapping("updateStatus")
-	@SaCheckPermission(TbCostomer.PERMISSION_CODE)
-	public AjaxJson updateStatus(String id, int value){
-		tbCostomerService.updateStatus(id,value);
-
-		return AjaxJson.getByLine(1);
-	}
-
-
-	@RequestMapping("getCurrentCustomerId")
-	public AjaxJson getCurrentCustomer(){
-		String id=StpUserUtil.getCustomerId();
-		return AjaxJson.getSuccessData(id);
-	}
-
-	@RequestMapping("judge")
-	@SaCheckPermission(TbCostomer.PERMISSION_CODE)
-	public AjaxJson judge(){
-		SoMap so = SoMap.getRequestSoMap();
-		tbCostomerService.judge(so.getString("id"),so.getInt("judgeStatus"),so.getString("judgeContent"));
-		return AjaxJson.getSuccess();
-	}
-
-
-	
-	
-	
-	
-	
+
+    /**
+     * 改 - 状态(0=否,1=是)
+     */
+    @RequestMapping("updateStatus")
+    @SaCheckPermission(TbCostomer.PERMISSION_CODE)
+    public AjaxJson updateStatus(String id, int value) {
+        tbCostomerService.updateStatus(id, value);
+
+        return AjaxJson.getByLine(1);
+    }
+
+
+    @RequestMapping("getCurrentCustomerId")
+    public AjaxJson getCurrentCustomer() {
+        String id = StpUserUtil.getCustomerId();
+        return AjaxJson.getSuccessData(id);
+    }
+
+    @RequestMapping("judge")
+    @SaCheckPermission(TbCostomer.PERMISSION_CODE)
+    public AjaxJson judge() {
+        SoMap so = SoMap.getRequestSoMap();
+        tbCostomerService.judge(so.getString("id"), so.getInt("judgeStatus"), so.getString("judgeContent"));
+        return AjaxJson.getSuccess();
+    }
+
+    @RequestMapping("getListAndAdmin")
+    public AjaxJson getListAndAdmin() {
+        QueryWrapper<TbCostomer> ew = new QueryWrapper<>();
+        ew.eq("judge_status", 2);
+        List<TbCostomer> costomers = tbCostomerService.list(ew);
+        TbCostomer tbCostomer = new TbCostomer();
+        tbCostomer.setId(UserTypeEnum.PLATFORM_ADMIN.getCustomerId()).setName("广西东兴北投口岸投资有限公司");
+        costomers.add(0, tbCostomer);
+        return AjaxJson.getSuccessData(costomers);
+    }
+
 
 }

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

@@ -89,7 +89,7 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
         return StrUtil.equals(db.getId(), t.getId());
     }
 
-    TbCostomer findByName(String name){
+   public TbCostomer findByName(String name){
         QueryWrapper<TbCostomer> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("name", name);
         return this.getOne(queryWrapper);

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

@@ -22,12 +22,26 @@ import java.util.List;
 public class ExportFeeDetailDTO {
 
     private Integer index;
-    private String businessNo;
     private String carNo;
     private String feeType;
     private String itemTypeName;
     private String itemName;
+    private Double weight;
+    private Integer num;
+    private BigDecimal unitPrice;
     private BigDecimal itemPrice;
+    private  String settle;
+    private BigDecimal taxRate;
+    private BigDecimal taxPrice;
+    private BigDecimal noTaxPrice;
     private String payType;
+    private String payMode;
+    private String businessNo;
+    private String payTime;
+
+
+
+
+
 
 }

+ 53 - 3
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetails.java

@@ -70,7 +70,7 @@ public class TbFeeDetails implements Serializable {
     private String itemTypeName;
 
 	/**
-	 *  
+	 *  业务项 id
 	 */
     private String itemId;
 
@@ -82,18 +82,22 @@ public class TbFeeDetails implements Serializable {
 	/**
 	 * 项目金额(元) 
 	 */
-    private BigDecimal itemPrice;
+    private BigDecimal itemPrice = new BigDecimal(0);
 
 	/**
 	 * 支付日期 
 	 */
     private String payDay;
 
+
+    private String payTime;
+
 	/**
 	 * 支付方式(3=微信支付) 
 	 */
     private Integer payType;
 
+
 	/**
 	 * 创建时间 
 	 */
@@ -101,12 +105,21 @@ public class TbFeeDetails implements Serializable {
 
     private String businessItemId;
 
+    private String businessItemNo;
+
     private String pickCustomerName;
 
+
+
     /**
      * 不含税款
      */
-    public BigDecimal noTaxPrice = new BigDecimal(0);
+    private BigDecimal noTaxPrice = new BigDecimal(0);
+
+    /**
+     * 税款
+     */
+    private BigDecimal taxPrice = new BigDecimal(0);
 
     /**
      * 税率
@@ -114,6 +127,43 @@ public class TbFeeDetails implements Serializable {
     private BigDecimal taxRate = new BigDecimal(0);
 
 
+    /**
+     * 单价
+     */
+    private BigDecimal unitPrice = new BigDecimal(0);
+
+    /**
+     * 重量
+     */
+    private Double weight;
+
+    /**
+     * 数量
+     */
+    private Integer num;
+
+    /**
+     * 是否结算(0=未结算, 1=已结算)
+     */
+    private Integer isSettle;
+
+    /**
+     * 支付方式(1=直接支付)
+     */
+    private Integer payMode;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 发票
+     */
+    private String invoice;
+
+
+
     @Getter
     @AllArgsConstructor
     //(1=核酸检测,2=消杀作业,3=装卸作业,4=停车费,5=过磅费)

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

@@ -84,6 +84,10 @@
 			<if test=' this.has("payDay") '> and pay_day = #{payDay} </if>
 			<if test=' this.has("payType") '> and pay_type = #{payType} </if>
 			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+            <if test=' this.has("beginTime") and this.has("endTime") '>
+                and pay_day >= #{beginTime}
+                and pay_day  &lt;= #{endTime}
+            </if>
 		</where>
 		order by
 		<choose>

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

@@ -123,6 +123,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     public void chargeParkFee(List<PriceBO> cars) {
         Date now = new Date();
+        String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
         String toDay = DateUtil.format(now, "yyyy-MM-dd");
         for (PriceBO bo1 : cars) {
             TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
@@ -133,13 +134,17 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                 parkFee = new TbFeeDetails();
                 parkFee.setTaxRate(partConfig.getTaxRate());
             }
-
             BigDecimal noTaxPrice = car.getMoney().subtract(car.getMoney().multiply(parkFee.getTaxRate()));
-            parkFee.setBusinessId(car.getBusinessId()).setBusinessNo(business.getNo())
+            BigDecimal taxPrice = car.getMoney().multiply(parkFee.getTaxRate());
+            parkFee.setBusinessId(car.getBusinessId())
                     .setCarNo(car.getCarNo())
-                    .setItemPrice(car.getMoney()).setNoTaxPrice(noTaxPrice)
-                    .setFeeType(TbFeeDetails.fee.PARK_FEE.getCode()).setItemTypeName(TbFeeDetails.fee.PARK_FEE.getDesc())
-                    .setPayDay(toDay).setPayType(3).setCreateTime(now);
+                    .setItemPrice(car.getMoney()).setUnitPrice(car.getMoney()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
+                    .setFeeType(TbFeeDetails.fee.PARK_FEE.getCode()).setItemTypeName("停车业务")
+                    .setPayDay(toDay).setPayType(3).setCreateTime(now)
+                    .setNum(1).setIsSettle(1).setPayMode(1).setPayTime(nowStr);
+            if (business!=null){
+                parkFee.setWeight(business.getNetWeight()).setBusinessNo(business.getNo());
+            }
             saveOrUpdate(parkFee);
         }
     }
@@ -153,7 +158,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             String itemType = item.getItemTypeName();
             if (itemType.contains("核酸")) {
                 feeType = TbFeeDetails.fee.NUCLEIC_FEE.getCode();
-            } else if (itemType.contains("消毒")) {
+            } else if (itemType.contains("消毒") || itemType.contains("消杀")) {
                 feeType = TbFeeDetails.fee.DISINFECT_FEE.getCode();
             } else if (itemType.contains("装卸")) {
                 feeType = TbFeeDetails.fee.STEVEDORE_FEE.getCode();
@@ -180,10 +185,13 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         }
     }
 
-    public String export(SoMap so) throws Exception {
+    public String export(SoMap so) throws Exception{
+        Date now = new Date();
+        String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm");
         Map<String, String> head = new HashMap<>();
         head.put("time", so.getString("payDay"));
-        List<ExportFeeDetailDTO> exportList = new ArrayList<>();
+        head.put("exportTime", nowStr);
+	    List<ExportFeeDetailDTO> exportList = new ArrayList<>();
         List<TbFeeDetails> list = this.getList(so);
         Integer index = 1;
         for (TbFeeDetails feeDetails : list) {
@@ -192,7 +200,11 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             detailDTO.setBusinessNo(feeDetails.getBusinessNo()).setCarNo(feeDetails.getCarNo())
                     .setFeeType(feeType).setItemTypeName(feeDetails.getItemTypeName())
                     .setItemName(feeDetails.getItemName()).setItemPrice(feeDetails.getItemPrice())
-                    .setPayType("微信支付").setIndex(index++);
+                    .setPayType("微信支付").setIndex(index++)
+                    .setPayMode("直接收款")
+                    .setWeight(feeDetails.getWeight()).setNum(feeDetails.getNum()).setUnitPrice(feeDetails.getUnitPrice())
+                    .setSettle("已结算").setTaxRate(feeDetails.getTaxRate().multiply(new BigDecimal(100)))
+                    .setTaxPrice(feeDetails.getTaxPrice()).setNoTaxPrice(feeDetails.getNoTaxPrice()).setPayTime(feeDetails.getPayTime());
             exportList.add(detailDTO);
         }
 
@@ -201,15 +213,15 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         String rootPath = UploadUtil.uploadConfig.rootFolder + separator + UploadUtil.uploadConfig.httpPrefix;
         String prefix = myConfig.getDomain() + UploadUtil.uploadConfig.httpPrefix;
         String extPath = "feeDetails" + separator + today + separator;
-        String fileName = "收费登记表_" + today + ".xlsx";
+        String fileName = "收费明细表_" + today + ".xlsx";
         String savePath = rootPath + separator + extPath;
         File saveFIle = new File(savePath);
         if (!saveFIle.exists()) {
             saveFIle.mkdirs();
         }
 
-        ClassPathResource classPathResource = new ClassPathResource("static/day-fee.xlsx");
-        InputStream tempInputStream = classPathResource.getInputStream();
+        ClassPathResource classPathResource = new ClassPathResource("static/day-fee-new.xlsx");
+        InputStream tempInputStream =classPathResource.getInputStream();
 
         ExcelWriter excelWriter = EasyExcel.write(savePath + fileName, ExportFeeDetailDTO.class)
                 .withTemplate(tempInputStream).build();
@@ -217,7 +229,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         excelWriter.fill(exportList, writeSheet);
         excelWriter.fill(head, writeSheet);
         excelWriter.finish();
-        return prefix + "/feeDetails/" + today + "/收费登记表_" + today + ".xlsx";
+        return prefix + "/feeDetails/" + today + "/收费明细表_" + today + ".xlsx";
     }
 
 }

+ 8 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsMapper.xml

@@ -82,6 +82,10 @@
 			<if test=' this.has("taxRate") '> and tax_rate = #{taxRate} </if>
 			<if test=' this.has("noTaxMoney") '> and no_tax_money = #{noTaxMoney} </if>
 			<if test=' this.has("payType") '> and pay_type = #{payType} </if>
+            <if test=' this.has("beginDay") and this.has("endDay") '>
+                and day_time >= #{beginDay}
+                and day_time  &lt;= #{endDay}
+            </if>
 		</where>
 		order by
 		<choose>
@@ -107,6 +111,10 @@
         <where>
             <if test=' this.has("feeType") '> and fee_type = #{feeType} </if>
             <if test=' this.has("month") '> and month = #{month} </if>
+            <if test=' this.has("beginMonth") and this.has("endMonth") '>
+                and month >= #{beginMonth}
+                and month  &lt;= #{endMonth}
+            </if>
         </where>
         group by month, fee_type
         order by month desc

+ 15 - 6
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -112,7 +112,7 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
         TbFeeStatistics parkFee = this.getByDayAndFeeType(toDay, TbFeeStatistics.feeType.PARK_FEE.getCode());
         if (parkFee == null) {
             parkFee = new TbFeeStatistics();
-            parkFee.setTaxRate(partConfig.getTaxRate());
+            parkFee.setTaxRate(new BigDecimal(TbFeeStatistics.taxRate.PARK.getValue()));
         }
         for (PriceBO bo1 : cars) {
             BigDecimal price = bo1.getP();
@@ -133,6 +133,7 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
     //@Async
     public void countBusinessFee(List<TbBusinessItem> items) {
         Date now = new Date();
+        String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
         String toDay = DateUtil.format(now, "yyyy-MM-dd");
         String thisYear = StrUtil.sub(toDay, 0, 4);
         String thisMonth = StrUtil.sub(toDay, 0, 7);
@@ -141,7 +142,7 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             String itemType = item.getItemTypeName();
             if (itemType.contains("核酸")) {
                 feeType = TbFeeStatistics.feeType.NUCLEIC_FEE.getCode();
-            } else if (itemType.contains("消毒")) {
+            } else if (itemType.contains("消毒") || itemType.contains("消杀")) {
                 feeType = TbFeeStatistics.feeType.DISINFECT_FEE.getCode();
             } else if (itemType.contains("装卸")) {
                 feeType = TbFeeStatistics.feeType.STEVEDORE_FEE.getCode();
@@ -162,7 +163,8 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             BigDecimal noTaxMoney = businessFee.getTaxMoney().subtract(businessFee.getTaxMoney().multiply(businessFee.getTaxRate()));
             businessFee.setNoTaxMoney(noTaxMoney);
             businessFee.setDayTime(now).setMonth(thisMonth).setYear(thisYear).setDay(toDay)
-                    .setFeeType(feeType).setItemTypeName(itemType)
+                    .setFeeType(feeType)
+                    //.setItemTypeName(itemType)
                     .setPayType(3);
             this.saveOrUpdate(businessFee);
             /*-----------------分割线------------------*/
@@ -175,15 +177,22 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             }
 
             BigDecimal noTaxPrice = item.getItemPrice().subtract(item.getItemPrice().multiply(businessFeeDetail.getTaxRate()));
+            BigDecimal taxPrice = item.getItemPrice().multiply(businessFeeDetail.getTaxRate());
+            String carNo = business.getCardNo();
+            if(StrUtil.isEmpty(business.getCardNo())){
+                carNo = business.getChinaCarNo();
+            }
             businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
-                    .setCarNo(business.getCardNo())
-                    .setItemPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice)
+                    .setBusinessItemNo(item.getNo())
+                    .setCarNo(carNo)
+                    .setItemPrice(item.getItemPrice()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
                     .setFeeType(feeType)
                     .setItemTypeId(item.getItemTypeId()).setItemTypeName(item.getItemTypeName())
                     .setItemId(item.getItemId()).setItemName(item.getItemName())
                     .setPayDay(toDay).setPayType(3).setCreateTime(now)
                     .setBusinessItemId(item.getId() + "")
-                    .setPickCustomerName(item.getPickCustomerName());
+                    .setPickCustomerName(item.getPickCustomerName())
+                    .setNum(1).setIsSettle(1).setPayMode(1).setPayTime(nowStr).setWeight(business.getNetWeight());
             tbFeeDetailsService.saveOrUpdate(businessFeeDetail);
         }
     }

+ 1 - 1
sp-server/src/main/java/com/pj/project4sp/uploadfile/UploadConfig.java

@@ -28,7 +28,7 @@ public class UploadConfig {
 	public String videoSuffix = "mp4,avi,rmvb,mov,flv";						// 视频允许的后缀 
 	public String audioSuffix = "mp3,aac,wav,wma,cda,flac,m4a,mid,mka,mp2,mpa,mpc,ape,ofr,ogg,ra,wv,tta,ac3,dts";			// 音频允许的后缀 
 	public String apkSuffix = "apk";						// apk允许的后缀  
-	public String fileSuffix = "jpg";						// file允许的后缀 (为防止上传恶意文件,这里必须手动指定可上传的类型) 
+	public String fileSuffix = "jpg,xlsx,xls";						// file允许的后缀 (为防止上传恶意文件,这里必须手动指定可上传的类型)
 	
 	public long maxSize = 1024 * 1024 * 1024 ;	// 文件最大大小,单位/B , 此为1G 
 	

+ 4 - 3
sp-server/src/main/java/com/pj/project4sp/uploadfile/UploadUtil.java

@@ -3,6 +3,7 @@ package com.pj.project4sp.uploadfile;
 import java.io.File;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Objects;
 import java.util.Random;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,7 +34,7 @@ public class UploadUtil {
 		// 根据日期计算需要保存的文件夹 
 		String currDateFolder = getCurrDateFolder();		
 		// 文件名 
-		String fileName = getMarking28() + '.' + getSuffixName(file.getOriginalFilename());				
+		String fileName = getMarking28() + '.' + getSuffixName(Objects.requireNonNull(file.getOriginalFilename()));
 		// 需要保存到的文件夹地址 
 		String fileFolder = new File(uploadConfig.rootFolder).getAbsolutePath() + "/" +
 				uploadConfig.httpPrefix + flieTypeFolder + currDateFolder + "/";	
@@ -42,7 +43,7 @@ public class UploadUtil {
 		
 		// 2、如果文件夹不存在,则先创建 
 		File dirFile = new File(fileFolder);
-		if(dirFile.exists() == false) {
+		if(!dirFile.exists()) {
 			dirFile.mkdirs();
 		}
 
@@ -77,7 +78,7 @@ public class UploadUtil {
 		String ext = getSuffixName(fileName).toLowerCase();	
 		// 去空格,加逗号   
 		String yxSuffix = suffixList.replace(" ", "") + ",";		
-		if(yxSuffix.indexOf(ext + ",") == -1) {
+		if(!yxSuffix.contains(ext + ",")) {
 			throw new RuntimeException("文件后缀验证未通过:" + ext);
 		}
 	}

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

@@ -49,11 +49,12 @@ spring:
         web-domain: https://127.0.0.1:8080
 part-config:
     base-price: 30 #基础费用
-    extra-price: 0.01 #过夜额外收费
+    extra-price: 10 #过夜额外收费
     night-end: 06:00:00 #夜间结束时间
     free-minutes: 30
     free-car-length: 4.2
     tax-rate: 0.09
+    test-env: true
 car:
     max-length: 20
     max-weight: 50

BIN=BIN
sp-server/src/main/resources/static/day-fee-new.xlsx