qzyReal 3 лет назад
Родитель
Сommit
c654093e2e

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

@@ -91,6 +91,7 @@
 				state: '',
 				list: [],
 				cars: [],
+				type:0,
 				businessAble: true,
 				item: {
 					itemsPrice: 0,
@@ -177,6 +178,7 @@
 			confirmPayFn() {
 				let carIds = this.carsSelect
 				let cars = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1);
+				let carNos=this.cars.map(obj=>obj.carNo).join('、')
 				let p = {
 					b: this.businessSelect.length > 0 ? this.item.businessId : '',
 					c: JSON.stringify(cars.map(obj => {
@@ -189,7 +191,14 @@
 					tradeType: "JSAPI",
 					openid: this.openid
 				}
-				p.desc=p.b?'A1-业务费用':'A1-停车费';
+				let type=this.type;
+				let con='A1停车费';
+				if(type==2){
+					con='A1整车业务';
+				}else if(type==1){
+					con='A1车辆消杀'
+				}
+				p.desc=con+'-'+carNos;
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
 					console.log(data);
@@ -237,6 +246,7 @@
 				}).then(resp => {
 					let data = resp.data;
 					this.cars = data.carList;
+					this.type=data.type;
 					let list = data.itemList;
 					this.carsSelect = this.cars.filter(obj => obj.id == carId && obj.pay == 0).map(obj => obj.id)
 					Object.assign(this.item, {

+ 7 - 0
sp-admin/sa-view/tb-business-car/tb-business-car-add.html

@@ -43,6 +43,13 @@
 								:min="4.2" :max="50"></el-input-number>
 						</div>
 						<div class="c-item">
+							<label class="c-label">车牌颜色:</label>
+							<el-select v-model="m.color" placeholder="请选择">
+								<el-option label="蓝牌" value="蓝牌"> </el-option>
+								<el-option label="黄牌" value="黄牌"> </el-option>
+							</el-select>
+						</div>
+						<div class="c-item">
 							<label class="c-label">联系人:</label>
 							<el-input v-model="m.driverName" placeholder="联系人" readonly>
 							</el-input>

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

@@ -29,18 +29,16 @@
 						<el-row>
 							<el-col span=12>
 								<sa-info name="车牌号" br>{{m.carNo}}</sa-info>
+								<sa-info name="车牌颜色" br>{{m.color}}</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 type="img" name="入场图片" :value="m.inImage" br></sa-info>
+								<sa-info name="入场通道" br>{{m.inChannel}}</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>
-								<sa-info name="联系号码" br>{{m.driverPhone}}</sa-info>
-								<sa-info name="状态" br>
-									<label v-if="m.isLock==1">锁定</label>
-									<label v-else>正常</label>
-								</sa-info>
+								<sa-info name="离场时间" br>{{m.realOutTime}}</sa-info>
+								<sa-info name="离场通道" br>{{m.outChannel}}</sa-info>
+								<sa-info name="停车费" br>{{m.money}}元</sa-info>
+								<sa-info name="支付状态" br>{{m.payType}}</sa-info>
 								<sa-info type="img" name="离场图片" :value="m.outImage" br></sa-info>
 							</el-col>
 						</el-row>

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

@@ -15,6 +15,11 @@
 		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 	</head>
+	<style>
+		.self .el-input__inner {
+			width: 130px;
+		}
+	</style>
 	<body>
 		<div class="vue-box" style="display: none;" :style="'display: block;'">
 			<div class="c-panel">
@@ -29,21 +34,51 @@
 							<el-option label="已支付" value="1"> </el-option>
 						</el-select>
 					</div>
+					<div class="c-item" style="width: 120px;">
+						<label class="c-label">是否离场:</label>
+						<el-select v-model="p.leave" placeholder="请选择">
+							<el-option label="-全部-" value="1"> </el-option>
+							<el-option label="已离场" value="2"> </el-option>
+							<el-option label="未离场" value="3"> </el-option>
+						</el-select>
+					</div>
+				</el-form>
+				<el-form>
+					<div class="c-item">
+						<label class="c-label">入场时间:</label>
+						<el-date-picker :clearable="false" v-model="inTime" type="datetimerange" range-separator="至"
+							start-placeholder="开始日期" end-placeholder="结束日期">
+						</el-date-picker>
+					</div>
+					<div class="c-item">
+						<label class="c-label">离场时间:</label>
+						<el-date-picker :clearable="false" v-model="leveTime" type="datetimerange" range-separator="至"
+							start-placeholder="开始日期" end-placeholder="结束日期">
+						</el-date-picker>
+					</div>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<el-button size="mini" type="primary" @click="exportFn">导出</el-button>
 					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
-					<el-button size="mini" type="primary"  @click="add()">
+					<el-button size="mini" type="primary" @click="add()">
 						新增</el-button>
 				</el-form>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td name="车牌号" prop="carNo" width=120></sa-td>
-					<sa-td name="车辆规格" prop="carSize"></sa-td>
-					<sa-td width="130" name="支付状态" prop="pay" type="enum" :jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
-					</sa-td>
-<!--					<sa-td width="130" name="车辆状态" prop="pay" type="enum" :jv="{0: '锁定[#ff0000]', 1: '正常[#005500]'}">-->
-					</sa-td>
-					<sa-td name="联系人" prop="driverName"></sa-td>
-					<sa-td name="联系号码" prop="driverPhone"></sa-td>
+					<el-table-column label="车辆规格">
+						<template slot-scope="s">
+							<label v-if="!s.row.carSize">-</label>
+							<label v-else>{{s.row.carSize}}</label>
+						</template>
+					</el-table-column>
+					<el-table-column label="车牌颜色">
+						<template slot-scope="s">
+							<label v-if="!s.row.color">-</label>
+							<label v-else>{{s.row.color}}</label>
+						</template>
+					</el-table-column>
+					<sa-td name="入场通道" prop="inChannel"></sa-td>
+					<sa-td name="离场通道" prop="outChannel"></sa-td>
 					<sa-td name="入场时间" prop="realInTime" width=180></sa-td>
 					<sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
 					<el-table-column label="停车费">
@@ -52,11 +87,13 @@
 							<label v-else>-</label>
 						</template>
 					</el-table-column>
+					<sa-td name="支付状态" prop="payType"></sa-td>
 					<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="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>
@@ -74,21 +111,54 @@
 				},
 				el: '.vue-box',
 				data: {
+					leveTime: [],
+					inTime: [],
 					p: { // 查询参数  
 						id: '', //  
 						businessId: sa.p('id', ''), //  
 						carNo: '', //  
-						pay:'',  
+						leave: '1',
+						pay: '',
+						leaveStart: '',
+						leaveEnd: '',
 						pageNo: 1, // 当前页 
 						pageSize: 10, // 页大小 
-						sortType: 0 // 排序方式 
+						sortType: 10 // 排序方式 
 					},
 					dataCount: 0,
 					dataList: [], // 数据集合 
 				},
 				methods: {
+					exportFn() {
+						this.$confirm('确定导出符合条件的数据?', '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+							type: 'warning'
+						}).then(() => {
+							sa.ajax('/TbBusinessCar/export', sa.removeNull(this.p), function(resp) {
+								window.location.href = resp.data;
+							}.bind(this))
+						}).catch(() => {
+
+						});
+					},
 					// 刷新
 					f5: function() {
+
+						if (this.inTime && this.inTime.length > 0) {
+							this.p.inStart = sa.forDatetime(this.inTime[0]);
+							this.p.inEnd = sa.forDatetime(this.inTime[1]);
+						} else {
+							this.p.inStart = '';
+							this.p.inEnd = '';
+						}
+						if (this.leveTime && this.leveTime.length > 0) {
+							this.p.leaveStart = sa.forDatetime(this.leveTime[0]);
+							this.p.leaveEnd = sa.forDatetime(this.leveTime[1]);
+						} else {
+							this.p.leaveStart = '';
+							this.p.leaveEnd = '';
+						}
 						sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-17080
+18924

+ 83 - 0
sp-server/src/main/java/com/pj/api/open/bo/InRecordBO.java

@@ -0,0 +1,83 @@
+package com.pj.api.open.bo;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.io.Serializable;
+
+
+public class InRecordBO implements Serializable {
+    /**
+     * 当前设别车牌的通道名称
+     */
+   private String ChannelName;
+    private String    CarNumber;
+    /**
+     * 1 入场 2 出场
+     */
+    private int  EventType;
+    /**
+     * 入场时间
+     */
+    private String  InTime;
+    /**
+     * 流水号
+     */
+    private String     Parkingserial;
+    /**
+     * 操作员
+     */
+    private String OperationUserName;
+
+    @JsonProperty("ChannelName")
+    public String getChannelName() {
+        return ChannelName;
+    }
+
+    public void setChannelName(String channelName) {
+        ChannelName = channelName;
+    }
+
+
+    @JsonProperty("CarNumber")
+    public String getCarNumber() {
+        return CarNumber;
+    }
+
+    public void setCarNumber(String carNumber) {
+        CarNumber = carNumber;
+    }
+
+
+    @JsonProperty("EventType")
+    public int getEventType() {
+        return EventType;
+    }
+
+    public void setEventType(int eventType) {
+        EventType = eventType;
+    }
+    @JsonProperty("InTime")
+    public String getInTime() {
+        return InTime;
+    }
+
+    public void setInTime(String inTime) {
+        InTime = inTime;
+    }
+    @JsonProperty("Parkingserial")
+    public String getParkingserial() {
+        return Parkingserial;
+    }
+
+    public void setParkingserial(String parkingserial) {
+        Parkingserial = parkingserial;
+    }
+    @JsonProperty("OperationUserName")
+    public String getOperationUserName() {
+        return OperationUserName;
+    }
+
+    public void setOperationUserName(String operationUserName) {
+        OperationUserName = operationUserName;
+    }
+}

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

@@ -81,7 +81,7 @@ public class OpenService {
         TbCar tbCar = tbCarService.findByCardNo(carNo);
         if (tbBusinessCar == null || (tbBusinessCar.getRealInTime() != null && tbBusinessCar.getRealOutTime() != null)) {
             tbBusinessCar = new TbBusinessCar();
-            tbBusinessCar.setCarNo(carNo).setPay(0).setCarSize(3D).setIsLock(0).setCarCompany(tbCar!=null?tbCar.getCustomerName():"临时")
+            tbBusinessCar.setCarNo(carNo).setPay(0).setCarSize(0D).setIsLock(0).setCarCompany(tbCar!=null?tbCar.getCustomerName():"临时")
                     .setInChannel(channel).setRealInTime(now).setBasePartMoney(new BigDecimal("0"));
             tbBusinessCarService.save(tbBusinessCar);
             CoverBase64ToUrl(image, tbBusinessCar.getId(), 1);

+ 3 - 0
sp-server/src/main/java/com/pj/api/open/web/OpenController.java

@@ -31,6 +31,9 @@ public class OpenController {
         if ("CheckCarNumber".equals(dataType)) {
             CheckCarNumberBO checkCarNumberBO = BeanUtil.toBean(params, CheckCarNumberBO.class);
             return checkCarNumber(checkCarNumberBO);
+        }else  if ("Inrecord".equals(dataType)) {
+            CheckCarNumberBO checkCarNumberBO = BeanUtil.toBean(params, CheckCarNumberBO.class);
+            return checkCarNumber(checkCarNumberBO);
         }
         return ResultJson.error("未知异常");
     }

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

@@ -46,6 +46,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     public static final String PERMISSION_CONFIRM = "tb-business-confirm";
     public static final String PERMISSION_PAY = "tb-business-pay";
     public static final String PERMISSION_INPUT = "tb-business-add";
+    public static final String PERMISSION_EXPORT = "tb-business-car-export";
 
 
     // ---------- 表中字段 ----------

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

@@ -472,6 +472,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         TbBusinessCar car = tbBusinessCarService.getById(carId);
         String businessId = car.getBusinessId();
         result.put("businessId", businessId);
+        result.put("type", 0);
         List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(businessId);
         if (cars.isEmpty()) {
             cars.add(car);
@@ -498,6 +499,12 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
             carsList.add(carMap);
         }
+        if (StrUtil.isNotEmpty(businessId)){
+            TbBusiness tbBusiness=this.getById(businessId);
+            if (tbBusiness!=null){
+                result.put("type", tbBusiness.getBusinessType());
+            }
+        }
         result.put("carList", carsList);
         result.put("itemList", Collections.emptyList());
         TbBusiness tbBusiness = this.getById(businessId);

+ 41 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/ExportTbBusinessDTO.java

@@ -0,0 +1,41 @@
+package com.pj.project.tb_business_car;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@EqualsAndHashCode
+public class ExportTbBusinessDTO {
+    @ExcelProperty("车牌号")
+    private String carNo;
+
+    @ExcelProperty("车牌颜色")
+    private String color;
+
+    @ExcelProperty("车辆规格")
+    private String size;
+
+    @ExcelProperty("入场时间")
+    private Date realInTime;
+
+    @ExcelProperty("入场通道")
+    private String inChannel;
+
+    @ExcelProperty("离场时间")
+    private Date realOutTime;
+    @ExcelProperty("离场通道")
+    private String outChannel;
+
+    @ExcelProperty("停车费")
+    private BigDecimal money;
+
+    @ExcelProperty("支付状态")
+    private String payType;
+
+    @ExcelProperty("支付时间")
+    private Date payTime;
+}

+ 23 - 5
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCar.java

@@ -2,10 +2,15 @@ package com.pj.project.tb_business_car;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.Date;
 
+import cn.hutool.extra.spring.SpringUtil;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.pj.current.config.PartConfig;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -56,6 +61,7 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	 *  
 	 */
 	private String carNo;	
+	private String color;
 
 	/**
 	 *  
@@ -105,11 +111,23 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	private String inImage;
 	private String outImage;
 
-
-
-
-
-	
+	@TableField(exist = false)
+	private String payType;
+
+	public String getPayType() {
+		Date inTime = this.getRealInTime();
+		Date outTime = this.getRealOutTime();
+		if (inTime != null && outTime != null) {
+			LocalDateTime inDayTime = inTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+			LocalDateTime outDayTime = outTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+			long minutes = ChronoUnit.MINUTES.between(inDayTime, outDayTime);
+			PartConfig partConfig= SpringUtil.getBean(PartConfig.class);
+			if (minutes < partConfig.getFreeMinutes()) {
+				return "免费";
+			}
+		}
+		return this.pay==null||this.pay==0?"未支付":"已支付";
+	}
 
 
 }

+ 7 - 21
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java

@@ -98,28 +98,14 @@ public class TbBusinessCarController {
         tbBusinessCarService.updateCarRecord(t);
         return AjaxJson.getSuccess();
     }
+    @RequestMapping("export")
+    @SaCheckPermission(TbBusiness.PERMISSION_CODE)
+    public AjaxJson export() {
+    	SoMap soMap=SoMap.getRequestSoMap();
+        return AjaxJson.getSuccessData( tbBusinessCarService.export(soMap));
+    }
+
 
-	
-	
-	
-	
-	// ------------------------- 前端接口 -------------------------
-	
-	
-	/** 改 - 不传不改 [G] */
-	@RequestMapping("updateByNotNull")
-	public AjaxJson updateByNotNull(Long id){
-		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
-		// 鉴别身份,是否为数据创建者 
-		long userId = SP.publicMapper.getColumnByIdToLong(TbBusinessCar.TABLE_NAME, "user_id", id);
-		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
-		// 开始修改 (请只保留需要修改的字段)
-		SoMap so = SoMap.getRequestSoMap();
-		so.clearNotIn("id", "businessId", "carNo", "preInTime", "preOutTime", "realInTime", "realOutTime", "money", "driverPhone").clearNull().humpToLineCase();	
-		int line = SP.publicMapper.updateBySoMapById(TbBusinessCar.TABLE_NAME, so, id);
-		return AjaxJson.getByLine(line);
-	}
-	
 	
 	
 	

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

@@ -38,6 +38,24 @@
             <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>
+            <if test='leave==2 '>
+              and   real_out_time is not null
+            </if>
+            <if test='leave==3 '>
+                and   real_out_time is  null
+            </if>
+            <if test="leaveStart!=null and leaveStart !=''">
+              and  date_format(real_out_time,'%Y-%m-%d %H:%m:%s') &gt;=#{leaveStart}
+            </if>
+            <if test="leaveEnd!=null and leaveEnd !=''">
+                and  date_format(real_out_time,'%Y-%m-%d %H:%m:%s') &lt;=#{leaveEnd}
+            </if>
+            <if test="inStart!=null and inStart !=''">
+                and  date_format(real_in_time,'%Y-%m-%d %H:%m:%s') &gt;=#{inStart}
+            </if>
+            <if test="inEnd!=null and inEnd !=''">
+                and  date_format(real_in_time,'%Y-%m-%d %H:%m:%s') &lt;=#{inEnd}
+            </if>
         </where>
         order by
         <choose>
@@ -50,6 +68,7 @@
             <when test='sortType == 7'>real_out_time desc</when>
             <when test='sortType == 8'>money desc</when>
             <when test='sortType == 9'>driver_phone desc</when>
+            <when test='sortType == 10'>real_out_time desc,real_in_time desc</when>
             <otherwise>id desc</otherwise>
         </choose>
     </select>

+ 46 - 6
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -1,19 +1,30 @@
 package com.pj.project.tb_business_car;
 
+import java.io.File;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.excel.EasyExcel;
 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.current.config.PartConfig;
+import com.pj.current.config.SystemObject;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_business_item.TbBusinessItemService;
 import com.pj.project.tb_fee_details.TbFeeDetails;
 import com.pj.project.tb_fee_details.TbFeeDetailsService;
+import com.pj.project4sp.uploadfile.UploadConfig;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
@@ -48,6 +59,9 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     @Lazy
     TbFeeDetailsService tbFeeDetailsService;
 
+    @Resource
+    private UploadConfig uploadConfig;
+
 
     /**
      * 查集合 - 根据条件(参数为空时代表忽略指定条件)
@@ -91,7 +105,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
 
     public List<TbBusinessCar> searchPartCar(String carNo) {
-        return   tbBusinessCarMapper.searchPartCar(carNo.toUpperCase());
+        return tbBusinessCarMapper.searchPartCar(carNo.toUpperCase());
     }
 
 
@@ -206,10 +220,10 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     }
 
     public void updateCarRecord(TbBusinessCar t) throws Exception {
-        if(StrUtil.isEmpty(t.getBusinessId())) {
+        if (StrUtil.isEmpty(t.getBusinessId())) {
             t.setBusinessId(null);
         }
-        if(StrUtil.isEmpty(t.getCustomerId())) {
+        if (StrUtil.isEmpty(t.getCustomerId())) {
             t.setCustomerId(null);
         }
         String carNo = t.getCarNo().toUpperCase();
@@ -227,12 +241,12 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
         this.updateById(t);
         TbBusiness tbBusiness = tbBusinessService.getById(t.getBusinessId());
-        if(tbBusiness != null) {
-            if (!CAR_LIST.contains(carNo.substring(0,1))) {
+        if (tbBusiness != null) {
+            if (!CAR_LIST.contains(carNo.substring(0, 1))) {
                 tbBusiness.setCardNo(carNo);
             } else {
                 List<TbBusinessCar> cars = this.findByBusinessId(t.getBusinessId());
-                String chiaCarNo = cars.stream().filter(obj -> CAR_LIST.contains(obj.getCarNo().substring(0,1))).map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
+                String chiaCarNo = cars.stream().filter(obj -> CAR_LIST.contains(obj.getCarNo().substring(0, 1))).map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
                 tbBusiness.setChinaCarNo(chiaCarNo);
             }
             tbBusinessService.updateById(tbBusiness);
@@ -247,4 +261,30 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     public List<TbBusinessCar> findTheNoBusinessCar(String carNo) {
         return tbBusinessCarMapper.findTheNoBusinessCar(carNo);
     }
+
+    public String export(SoMap soMap) {
+        List<TbBusinessCar> cars = this.getList(soMap);
+        List<ExportTbBusinessDTO> list = new ArrayList<>(cars.size());
+        cars.forEach(tbBusinessCar -> {
+            ExportTbBusinessDTO dto = new ExportTbBusinessDTO();
+            BeanUtil.copyProperties(tbBusinessCar, dto);
+            Double carSize = tbBusinessCar.getCarSize();
+            dto.setSize(carSize + "");
+            if (carSize == null || carSize == 0) {
+                dto.setSize("-");
+            }
+            list.add(dto);
+        });
+        String flieTypeFolder = "/export/";
+        String currDateFolder = DateUtil.today();
+        String fileName = "car-record-" + RandomUtil.randomNumbers(6) + ".xlsx";
+        String fileFolder = new File(uploadConfig.rootFolder).getAbsolutePath() +
+                uploadConfig.httpPrefix + flieTypeFolder + currDateFolder + "/";
+        if (!FileUtil.exist(fileFolder)) {
+            FileUtil.mkdir(fileFolder);
+        }
+        EasyExcel.write(fileFolder + fileName, ExportTbBusinessDTO.class).sheet("车辆放行记录")
+                .doWrite(() -> list);
+        return SystemObject.config.getDomain() + uploadConfig.httpPrefix + flieTypeFolder + currDateFolder + "/" + fileName;
+    }
 }