Quellcode durchsuchen

新放行记录

lzm vor 3 Jahren
Ursprung
Commit
617bbc111d

+ 2 - 1
app/apis/api.js

@@ -37,7 +37,8 @@ export default {
 		return ajax.postForm('/TbBusiness/adminConfirmIn',data)
 	},
     getInOutRecord(data) {
-        return ajax.get('/api/getInOutRecord', data)
+        //return ajax.get('/api/getInOutRecord', data)
+		return ajax.get('/TbBusinessCar/getList', data)
     },
     getCustomerList(data) {
         return ajax.get('/api/getCustomerList', data)

+ 18 - 21
app/pages/inout-record/inout-record.vue

@@ -10,36 +10,36 @@
 		</u-sticky> -->
 		<view class="card-box">
 			<view class="card" v-for="(recordItem,index) in recordItemList" :key="index">
-				<view class="t">
+				<!-- <view class="t">
 					<image class="icon" src="../../static/home-icon-01.png"></image>
 					<text class="title">{{recordItem.customerName}}</text>
-				</view>
+				</view> -->
 				<view class="c">
 					<view class="item car-num-item">
-						<text class="car-num">{{recordItem.cardNo}}</text>
+						<text class="car-num">{{recordItem.carNo}}</text>
 					</view>
 					<view class="item">
 						<text class="p1">联系人:</text>
-						<text class="p2">{{recordItem.dutyPeople}}</text>
+						<text class="p2">{{recordItem.driverName}}</text>
 					</view>
 					<view class="item">
 						<text class="p1">联系电话:</text>
-						<text class="p2">{{recordItem.customerContact}}</text>
+						<text class="p2">{{recordItem.driverPhone}}</text>
 					</view>
-					<view class="item" v-if="recordItem.inTime != null">
+					<view class="item" >
 						<text class="p1">入场时间:</text>
-						<text class="p2">{{recordItem.inTime}}</text>
+						<text class="p2">{{recordItem.realInTime}}</text>
 					</view>
-					<view class="item" v-if="recordItem.outTime != null">
+					<view class="item" >
 						<text class="p1">出场时间:</text>
-						<text class="p2">{{recordItem.outTime}}</text>
+						<text class="p2">{{recordItem.realOutTime}}</text>
 					</view>
 					<view class="item">
 						<text class="p1">状态:</text>
 						<text class="p2">
-							<text v-if="recordItem.status==1">未进场</text>
-							<text v-if="recordItem.status==2">已进场</text>
-							<text v-if="recordItem.status==3">已出场</text>
+							<text v-if="recordItem.realInTime==null && recordItem.realOutTime==null">未进场</text>
+							<text v-if="recordItem.realInTime!=null && recordItem.realOutTime==null">已进场</text>
+							<text v-if="recordItem.realInTime!=null && recordItem.realOutTime!=null">已出场</text>
 						</text>
 					</view>
 				</view>
@@ -60,7 +60,7 @@
 			return {
 				current:0,
 				pageNo: 1,
-				pageSize: 3,
+				pageSize: 4,
 				dataCount: 0,
 				status: 'loadmore',
 				page: 0,
@@ -80,14 +80,11 @@
 				],
 				recordItemList:[
 					{
-						customerName:'',
-						cardNo:'',
-						carCountryName: '',
-						dutyPeople:'',
-						customerContact:'',
-						inTime:'',
-						outTime:'',
-						status:''
+						carNo:'',
+						driverName: '',
+						driverPhone:'',
+						realInTime:'',
+						realOutTime:'',
 					},
 				],
 				//recordList: [],

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

@@ -50,13 +50,22 @@ var menuList =	[
 			{id: 'tb-car-add', name: '车辆-添加', url: 'sa-view/tb-car/tb-car-add.html'},
 		]
 	},
+	// {
+	// 	id: 'tb-pass-record',
+	// 	name: '放行记录-旧',
+	// 	icon: 'el-icon-notebook-2',
+	// 	info: '放行日志表数据的维护',
+	// 	childList: [
+	// 		{id: 'tb-pass-record-list', name: '放行列表', url: 'sa-view/tb-pass-record/tb-pass-record-list.html'},
+	// 	]
+	// },
 	{
-		id: 'tb-pass-record',
+		id: 'tb-business-car',
 		name: '放行记录',
 		icon: 'el-icon-notebook-2',
 		info: '放行日志表数据的维护',
 		childList: [
-			{id: 'tb-pass-record-list', name: '放行列表', url: 'sa-view/tb-pass-record/tb-pass-record-list.html'},
+			{id: 'tb-business-car-list', name: '放行列表', url: 'sa-view/tb-business-car/tb-business-car-list.html'},
 		]
 	},
 	{

+ 14 - 9
sp-admin/sa-view/tb-business-car/tb-business-car-info.html

@@ -23,15 +23,20 @@
 			<div class="s-body">
 				<div class="c-panel">
 					<el-form v-if="m">
-						<sa-info name="" br>{{m.id}}</sa-info>
-						<sa-info name="" br>{{m.businessId}}</sa-info>
-						<sa-info name="" br>{{m.carNo}}</sa-info>
-						<sa-info name="" br>{{m.preInTime}}</sa-info>
-						<sa-info name="" br>{{m.preOutTime}}</sa-info>
-						<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 name="" br>{{m.driverPhone}}</sa-info>
+						<sa-info name="车牌号" br>{{m.carNo}}</sa-info>
+						<sa-info name="车辆规格" br>{{m.carSize}}</sa-info>
+						<sa-info name="联系人" br>{{m.driverName}}</sa-info>
+						<sa-info name="联系电话" br>{{m.driverPhone}}</sa-info>
+<!--						<sa-info name="预计入场时间" br>{{m.preInTime}}</sa-info>-->
+<!--						<sa-info name="预计出场时间" br>{{m.preOutTime}}</sa-info>-->
+						<sa-info name="入场时间" br>{{m.realInTime}}</sa-info>
+						<sa-info name="出场时间" br>{{m.realOutTime}}</sa-info>
+						<sa-info name="停车费" br>
+							<label v-if="m.money">{{m.money}}</label>
+							<label v-else>{{m.basePartMoney}}</label>
+						</sa-info>
+						<sa-info type="enum" name="支付状态" :value="m.pay"
+								 :jv="{0: '未支付', 1: '已支付'}" br></sa-info>
 					</el-form>
 				</div>
 			</div>

+ 34 - 41
sp-admin/sa-view/tb-business-car/tb-business-car-list.html

@@ -20,51 +20,34 @@
 				<!-- ------------- 检索参数 ------------- -->
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
-					<sa-item type="text" name="" v-model="p.id"></sa-item>
-					<sa-item type="text" name="" v-model="p.businessId"></sa-item>
-					<sa-item type="text" name="" v-model="p.carNo"></sa-item>
-					<sa-item type="text" name="" v-model="p.preInTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.preOutTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.realInTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.realOutTime"></sa-item>
-					<sa-item type="text" name="" v-model="p.money"></sa-item>
-					<sa-item type="text" name="" v-model="p.driverPhone"></sa-item>
+					<sa-item type="text" name="车牌号" v-model="p.carNo"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br />
-					<sa-item name="综合排序">
-						<el-radio-group v-model="p.sortType" class="s-radio-text">
-							<el-radio :label="0">默认</el-radio>
-							<el-radio :label="1"></el-radio>
-							<el-radio :label="2"></el-radio>
-							<el-radio :label="3"></el-radio>
-							<el-radio :label="4"></el-radio>
-							<el-radio :label="5"></el-radio>
-							<el-radio :label="6"></el-radio>
-							<el-radio :label="7"></el-radio>
-							<el-radio :label="8"></el-radio>
-							<el-radio :label="9"></el-radio>
-						</el-radio-group>
 					</sa-item>
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
-				<sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item>
+				<sa-item type="fast-btn" show="reset"></sa-item>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" >
 					<sa-td type="selection"></sa-td>
-					<sa-td name="" prop="id" ></sa-td>
-					<sa-td name="" prop="businessId" ></sa-td>
-					<sa-td name="" prop="carNo" ></sa-td>
-					<sa-td name="" prop="preInTime" ></sa-td>
-					<sa-td name="" prop="preOutTime" ></sa-td>
-					<sa-td name="" prop="realInTime" ></sa-td>
-					<sa-td name="" prop="realOutTime" ></sa-td>
-					<sa-td name="" prop="money" ></sa-td>
-					<sa-td name="" prop="driverPhone" ></sa-td>
+					<sa-td name="车牌号" prop="carNo" ></sa-td>
+<!--					<sa-td name="预计入场时间" prop="preInTime" ></sa-td>-->
+<!--					<sa-td name="预计出场时间" prop="preOutTime" ></sa-td>-->
+					<sa-td name="入场时间" prop="realInTime" ></sa-td>
+					<sa-td name="出场时间" prop="realOutTime" ></sa-td>
+					<el-table-column label="停车费">
+						<template slot-scope="s">
+							<label v-if="s.row.money">{{s.row.money}}</label>
+							<label v-else>{{s.row.basePartMoney}}</label>
+						</template>
+					</el-table-column>
+					<sa-td name="联系人" prop="driverName" ></sa-td>
+					<sa-td name="联系电话" prop="driverPhone" ></sa-td>
 					<el-table-column label="操作" fixed="right"  width="240px">
 						<template slot-scope="s">
 							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
-							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+<!--							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>-->
+<!--							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>-->
 						</template>
 					</el-table-column>
 				</el-table>
@@ -88,27 +71,29 @@
 						preOutTime: '',		//  
 						realInTime: '',		//  
 						realOutTime: '',		//  
-						money: '',		//  
+						money: '',		//
+						driverName: '', //
 						driverPhone: '',		//  
 						pageNo: 1,		// 当前页 
 						pageSize: 10,	// 页大小 
 						sortType: 0		// 排序方式 
 					},
 					dataCount: 0,
-					dataList: [], // 数据集合 
+					dataList: [], // 数据集合
+					currentCustomerId: '1',
 				},
 				methods: {
 					// 刷新
 					f5: function() {
 						sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
-							this.dataCount = res.dataCount; // 数据总数 
-							sa.f5TableHeight();		// 刷新表格高度 
+							this.dataCount = res.dataCount; // 数据总数
+							sa.f5TableHeight();		// 刷新表格高度
 						}.bind(this));
 					},
 					// 查看
 					get: function(data) {
-						sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id, '1050px', '90%');
+						sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id, '600px', '90%');
 					},
 					// 查看 - 根据选中的
 					getBySelect: function(data) {
@@ -153,11 +138,19 @@
 							}.bind(this))
 						}.bind(this));
 					},
+					getCurrendCustomer() {
+						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+							this.currentCustomerId = resp.data;
+						}.bind(this));
+					},
 				},
 				created: function() {
-					this.f5();
+					this.getCurrendCustomer();
 					sa.onInputEnter();
-				}
+				},
+				mounted() {
+					this.f5();
+				},
 			})
 		</script>
 	</body>

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

@@ -2,6 +2,7 @@ package com.pj.constants;
 
 import com.pj.current.satoken.AuthConst;
 import com.pj.project.tb_business.TbBusiness;
+import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.project.tb_notices.TbNotices;
 import com.pj.project.tb_pass_record.TbPassRecord;
@@ -25,7 +26,7 @@ public enum RoleEnum {
             Arrays.asList(AuthConst.ADMIN_LIST,TbCostomer.PERMISSION_CODE,TbCostomer.PERMISSION_INFO,TbBusiness.PERMISSION_CODE,TbBusiness.PERMISSION_LIST,TbBusiness.PERMISSION_PAY)),
     ADMIN_ROLE("admin","管理员", Collections.emptyList()),
     SUPER_ROLE("super","超级管理员", Collections.emptyList()),
-    COMMON_ROLE_PER("common","共同",Arrays.asList(TbPassRecord.PERMISSION_CODE,TbPassRecord.PERMISSION_LIST,TbNotices.PERMISSION_CODE,TbNotices.PERMISSION_LIST))
+    COMMON_ROLE_PER("common","共同",Arrays.asList(TbNotices.PERMISSION_CODE,TbNotices.PERMISSION_LIST, TbBusinessCar.PERMISSION_CODE, TbBusinessCar.PERMISSION_LIST))
     ;
     private String type;
     private String name;

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

@@ -46,8 +46,6 @@ public class TbBusinessController {
     @Resource
     private TbBusinessItemService tbBusinessItemService;
     @Resource
-    private TbPassRecordService tbPassRecordService;
-    @Resource
     private TbNoticesService tbNoticesService;
     @Resource
     private TbBusinessCarService tbBusinessCarService;
@@ -81,7 +79,7 @@ public class TbBusinessController {
         }
         tbBusinessService.removeById(id);
         tbBusinessItemService.removeByBusinessId(id);
-        tbPassRecordService.removeByBusinessId(id);
+
         tbBusinessCarService.removeByBusinessId(id);
         return AjaxJson.getSuccess();
     }
@@ -203,11 +201,9 @@ public class TbBusinessController {
         tbBusinessService.updateById(tbBusiness);
 
         //更新境外车入场记录
-        tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
-                tbBusiness.getCardNo(), 2, tbBusiness.getRealInTime(), null, tbBusiness.getCountryName());
+
         //更新中国车入场记录
-        tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
-                tbBusiness.getChinaCarNo(), 2, tbBusiness.getChinaCarInTime(), null, "中国车");
+
         //发送消息
         String text = "您的车辆已入场,业务单号[" + tbBusiness.getNo() + "]";
         tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);
@@ -239,13 +235,9 @@ public class TbBusinessController {
         business.setAdminConfirmOut(1);
         tbBusinessService.updateById(business);
         //更新境外车出场记录
-        tbPassRecordService.addOrUpdate(business.getId(), business.getCustomerId(), business.getCustomerName(),
-                business.getCardNo(), 3,
-                business.getRealInTime(), business.getOutDayTime(), business.getCountryName());
+
         //更新中国车出场记录
-        tbPassRecordService.addOrUpdate(business.getId(), business.getCustomerId(), business.getCustomerName(),
-                business.getChinaCarNo(), 3,
-                business.getChinaCarInTime(), business.getChinaCarOutTime(), "中国车");
+
         tbBusinessService.storeMsg(business.getCustomerId(), "业务订单【" + business.getNo() + "】已完成作业离场" + DateUtil.now() + "。");
         //发送消息
         String text = "您的车辆已离场,业务单号[" + business.getNo() + "]";

+ 6 - 20
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -98,8 +98,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     private CarConfig carConfig;
 
     @Resource
-    private TbPassRecordService tbPassRecordService;
-    @Resource
     private TbNoticesService tbNoticesService;
     @Resource
     TbBusinessCarService tbBusinessCarService;
@@ -174,26 +172,20 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             if (car != null) {
                 tbBusinessCar.setId(car.getId()).setRealInTime(car.getRealInTime());
             }
-            tbBusinessCar.setBusinessId(t.getId());
+            tbBusinessCar.setBusinessId(t.getId()).setCustomerId(t.getCustomerId());
         });
         String yueCarNo = t.getCardNo();
         TbBusinessCar yueCar = tbBusinessCarService.findInAndNoBusinessCar(yueCarNo);
         if (yueCar == null) {
             yueCar = new TbBusinessCar();
         }
-        yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo);
+        yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
         carList.add(yueCar);
         tbBusinessCarService.saveOrUpdateBatch(carList);
         t.setItemPrice(price).setTotalMoney(price);
         this.saveOrUpdate(t);
         tbBusinessItemService.saveBatch(items);
 
-        //增加或修改一条境外车未入场记录
-        tbPassRecordService.addOrUpdate(t.getId(), t.getCustomerId(), t.getCustomerName(),
-                t.getCardNo(), 1, null, null, t.getCountryName());
-        //增加或修改一条中国车未入场记录
-        tbPassRecordService.addOrUpdate(t.getId(), t.getCustomerId(), t.getCustomerName(),
-                t.getChinaCarNo(), 1, null, null, "中国车");
 
         return AjaxJson.getSuccess();
     }
@@ -319,11 +311,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         this.updateById(tbBusiness);
 
         //更新境外车入场记录
-        tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
-                tbBusiness.getCardNo(), 2, tbBusiness.getRealInTime(), null, tbBusiness.getCountryName());
+
         //更新中国车入场记录
-        tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
-                tbBusiness.getChinaCarNo(), 2, tbBusiness.getChinaCarInTime(), null, "中国车");
+
         //发送消息
         String text = "您的车辆已入场,业务单号[" + tbBusiness.getNo() + "]";
         tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);
@@ -337,13 +327,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         this.updateById(tbBusiness);
 
         //更新境外车出场记录
-        tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
-                tbBusiness.getCardNo(), 3,
-                tbBusiness.getRealInTime(), tbBusiness.getOutDayTime(), tbBusiness.getCountryName());
+
         //更新中国车出场记录
-        tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
-                tbBusiness.getChinaCarNo(), 3,
-                tbBusiness.getChinaCarInTime(), tbBusiness.getChinaCarOutTime(), "中国车");
+
         //发送消息
         String text = "您的车辆已离场,业务单号[" + tbBusiness.getNo() + "]";
         tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);

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

@@ -33,7 +33,8 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	/**
 	 * 此模块对应的权限码 
 	 */
-	public static final String PERMISSION_CODE = "tb-business-car";	
+	public static final String PERMISSION_CODE = "tb-business-car";
+	public static final String PERMISSION_LIST = "tb-business-car-list";
 
 
 	// ---------- 表中字段 ----------
@@ -47,6 +48,8 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	 */
 	private String businessId;
 
+	private String customerId;
+
 	/**
 	 *  
 	 */

+ 6 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java

@@ -2,6 +2,7 @@ package com.pj.project.tb_business_car;
 
 import java.util.List;
 
+import com.pj.constants.UserTypeEnum;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.utils.so.SoMap;
@@ -48,9 +49,14 @@ public class TbBusinessCarController {
 	@RequestMapping("getList")
 	public AjaxJson getList() { 
 		SoMap so = SoMap.getRequestSoMap();
+        String currentCustomerId = StpUserUtil.getCustomerId();
+        if (!currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
+            so.put("customerId",currentCustomerId);
+        }
 		List<TbBusinessCar> list = tbBusinessCarService.getList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
+
 	
 	
 	

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

@@ -29,7 +29,8 @@
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>
 			<if test=' this.has("businessId") '> and business_id = #{businessId} </if>
-			<if test=' this.has("carNo") '> and car_no = #{carNo} </if>
+            <if test=' this.has("customerId") '> and customer_id = #{customerId} </if>
+			<if test=' this.has("carNo") '> and car_no like concat('%',#{carNo},'%') </if>
 			<if test=' this.has("preInTime") '> and pre_in_time = #{preInTime} </if>
 			<if test=' this.has("preOutTime") '> and pre_out_time = #{preOutTime} </if>
 			<if test=' this.has("realInTime") '> and real_in_time = #{realInTime} </if>

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

@@ -1,5 +1,6 @@
 package com.pj.project.tb_business_car;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -96,4 +97,15 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
                 .isNotNull("real_in_time");
         return getOne(ew);
     }
+
+    public void adminIn(String businessId, String carNo, Date realInTime){
+        TbBusinessCar car = this.findByBusinessIdAndCarNo(businessId, carNo);
+        car.setRealInTime(realInTime);
+        this.updateById(car);
+    }
+    public void adminOut(String businessId, String carNo, Date realOutTime){
+        TbBusinessCar car = this.findByBusinessIdAndCarNo(businessId, carNo);
+        car.setRealOutTime(realOutTime);
+        this.updateById(car);
+    }
 }