Browse Source

放行记录显示停车时长;消息内容调整(消息列表)

lzm 3 years ago
parent
commit
158df56cdb

+ 1 - 1
sp-admin/sa-view/tb-notices/tb-notices-list.html

@@ -41,7 +41,7 @@
 					<sa-td name="主题" prop="text" ></sa-td>
 <!--					<sa-td name="详情内容" prop="content" type="richtext"></sa-td>-->
 					<sa-td name="类型" prop="type" type="enum" :jv="{0: '公告消息', 1: '业务消息'}"></sa-td>
-					<sa-td name="更新时间" prop="updateTime" type="datetime"></sa-td>
+					<sa-td name="通知时间" prop="updateTime" type="datetime"></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>

+ 2 - 1
sp-admin/sa-view/tb-pass-record/tb-pass-record-list.html

@@ -40,7 +40,8 @@
 					<sa-td name="入场时间" prop="inTime" ></sa-td>
 					<sa-td name="出场时间" prop="outTime" ></sa-td>
 					<sa-td name="状态" prop="status" type="enum" :jv="{1: '未入场', 2: '已入场', 3: '已出场'}"></sa-td>
-					<sa-td name="更新时间" prop="updateTime" ></sa-td>
+					<sa-td name="停车时长(分钟)" prop="partTime" ></sa-td>
+<!--					<sa-td name="更新时间" prop="updateTime" ></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>-->

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

@@ -217,7 +217,7 @@ public class TbBusinessController {
         tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
                 tbBusiness.getChinaCarNo(), 2, tbBusiness.getChinaCarInTime(), null, "中国车");
         //发送消息
-        String text = "您的车辆已入场,业务单号["+ tbBusiness.getNo() + "]";
+        String text = "业务订单【"+tbBusiness.getNo()+"】已开始入场作业"+ DateUtil.now()+"。";
         tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);
 
         return AjaxJson.getSuccess();
@@ -256,7 +256,7 @@ public class TbBusinessController {
                 business.getChinaCarInTime(), business.getChinaCarOutTime(), "中国车");
         tbBusinessService.storeMsg(business.getCustomerId(), "业务订单【"+business.getNo()+"】已完成作业离场"+ DateUtil.now()+"。");
         //发送消息
-        String text = "您的车辆已离场,业务单号["+ business.getNo() + "]";
+        String text = "业务订单【"+business.getNo()+"】已完成作业离场"+ DateUtil.now()+"。";
         tbNoticesService.sendNotice(business.getId(), business.getNo(), business.getCustomerId(), text);
         return AjaxJson.getSuccess();
     }
@@ -287,7 +287,7 @@ public class TbBusinessController {
         tbBusinessService.updateById(business);
         tbBusinessService.storeMsg(business.getCustomerId(), "业务订单【"+business.getNo()+"】账单已生成!"+ DateUtil.now()+"。");
         //发送消息
-        String text = "您的账单已生成,业务单号["+ business.getNo() + "]";
+        String text = "业务订单【"+business.getNo()+"】账单已生成!"+ DateUtil.now()+"。";
         tbNoticesService.sendNotice(business.getId(), business.getNo(), business.getCustomerId(), text);
         return AjaxJson.getSuccessData(business);
     }

+ 7 - 4
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -246,7 +246,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         this.updateById(tbBusiness);
         storeMsg(tbBusiness.getCustomerId(), "业务订单【" + tbBusiness.getNo() + "】已支付" + DateUtil.now() + "。");
         //发送消息
-        String text = "您的费用已支付,业务单号["+ tbBusiness.getNo() + "]";
+        String text = "业务订单【" + tbBusiness.getNo() + "】已支付" + DateUtil.now() + "。";
         tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);
     }
 
@@ -256,6 +256,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             business.setConfirmInput(1).setConfirmInputTime(new Date()).setConfirmInputBy(StpUserUtil.getAdmin().getName());
             this.updateById(business);
             storeMsg(business.getCustomerId(), "业务订单【" + business.getNo() + "】已确认" + DateUtil.now() + "。");
+            //发送消息
+            String text = "业务订单【" + business.getNo() + "】已确认" + DateUtil.now() + "。";
+            tbNoticesService.sendNotice(business.getId(), business.getNo(), business.getCustomerId(), text);
         });
     }
 
@@ -267,7 +270,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             this.updateById(business);
             storeMsg(business.getCustomerId(), "业务订单【" + business.getNo() + "】已确认支付" + DateUtil.now() + "。");
             //发送消息
-            String text = "您的费用已支付,业务单号["+ business.getNo() + "]";
+            String text = "业务订单【" + business.getNo() + "】已确认支付" + DateUtil.now() + "。";
             tbNoticesService.sendNotice(business.getId(), business.getNo(), business.getCustomerId(), text);
         });
     }
@@ -296,7 +299,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         tbPassRecordService.addOrUpdate(tbBusiness.getId(), tbBusiness.getCustomerId(), tbBusiness.getCustomerName(),
                 tbBusiness.getChinaCarNo(), 2, tbBusiness.getChinaCarInTime(), null, "中国车");
         //发送消息
-        String text = "您的车辆已入场,业务单号["+ tbBusiness.getNo() + "]";
+        String text = "业务订单【"+tbBusiness.getNo()+"】已开始入场作业"+ DateUtil.now()+"。";
         tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);
 
     }
@@ -316,7 +319,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 tbBusiness.getChinaCarNo(), 3,
                 tbBusiness.getChinaCarInTime(), tbBusiness.getChinaCarOutTime(), "中国车");
         //发送消息
-        String text = "您的车辆已离场,业务单号["+ tbBusiness.getNo() + "]";
+        String text = "业务订单【"+tbBusiness.getNo()+"】已完成作业离场"+ DateUtil.now()+"。";
         tbNoticesService.sendNotice(tbBusiness.getId(), tbBusiness.getNo(), tbBusiness.getCustomerId(), text);
 
     }

+ 6 - 1
sp-server/src/main/java/com/pj/project/tb_pass_record/TbPassRecord.java

@@ -81,10 +81,15 @@ public class TbPassRecord extends Model<TbPassRecord> implements Serializable {
     private Date outTime;
 
 	/**
-	 * 更新时间 
+	 * 更新时间
 	 */
     private Date updateTime;
 
+    /**
+     * 停车时长(分)
+     */
+    private long partTime;
+
 
 
 

+ 5 - 3
sp-server/src/main/java/com/pj/project/tb_pass_record/TbPassRecordMapper.xml

@@ -5,8 +5,8 @@
 	<!-- 增 [G] -->
 	<insert id="add">
 		insert into 
-		tb_pass_record (id, business_id, customer_id, customer_name, card_no, car_country_name, status, in_time, out_time, update_time)
-		values (#{id}, #{businessId}, #{customerId}, #{customerName}, #{cardNo}, #{carCountryName}, #{status}, #{inTime}, #{outTime}, #{updateTime})
+		tb_pass_record (id, business_id, customer_id, customer_name, card_no, car_country_name, status, in_time, out_time, part_time, update_time)
+		values (#{id}, #{businessId}, #{customerId}, #{customerName}, #{cardNo}, #{carCountryName}, #{status}, #{inTime}, #{outTime}, #{partTime}, #{updateTime})
 	</insert>
 
 	<!-- 删 -->
@@ -32,7 +32,8 @@
 		car_country_name = #{carCountryName},
 		status = #{status}, 
 		in_time = #{inTime}, 
-		out_time = #{outTime}, 
+		out_time = #{outTime},
+		part_time = #{partTime},
 		update_time = #{updateTime}
 		where id = #{id}
 	</update>
@@ -52,6 +53,7 @@
 		<result property="status" column="status" />
 		<result property="inTime" column="in_time" />
 		<result property="outTime" column="out_time" />
+        <result property="partTime" column="part_time" />
 		<result property="updateTime" column="update_time" />
 	</resultMap>
 	

+ 11 - 5
sp-server/src/main/java/com/pj/project/tb_pass_record/TbPassRecordService.java

@@ -3,6 +3,8 @@ package com.pj.project.tb_pass_record;
 import java.util.Date;
 import java.util.List;
 
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -65,11 +67,15 @@ public class TbPassRecordService extends ServiceImpl<TbPassRecordMapper, TbPassR
         if(record == null)
             record = new TbPassRecord();
         record.setBusinessId(businessId)
-                .setCustomerId(customerId).setCustomerName(customerName)
-                .setCardNo(carNo).setStatus(status)
-                .setInTime(inTime).setOutTime(outTime)
-                .setCarCountryName(carCountryName)
-                .setUpdateTime(new Date());
+            .setCustomerId(customerId).setCustomerName(customerName)
+            .setCardNo(carNo).setStatus(status)
+            .setInTime(inTime).setOutTime(outTime)
+            .setCarCountryName(carCountryName)
+            .setUpdateTime(new Date());
+        if(record.getInTime() != null && record.getOutTime() != null){
+            long minutes = DateUtil.between(record.getInTime(), record.getOutTime(), DateUnit.MINUTE);
+            record.setPartTime(minutes);
+        }
         saveOrUpdate(record);
     }