12 changed files with 712 additions and 76 deletions
@ -0,0 +1,13 @@ |
|||||||
|
package org.springblade.common.utils; |
||||||
|
|
||||||
|
/** |
||||||
|
* 电话校验 |
||||||
|
*/ |
||||||
|
public class PhoneCheckUtil { |
||||||
|
|
||||||
|
public static boolean checkPhone(String phone){ |
||||||
|
String regex = "^1[3-9]\\d{9}$"; |
||||||
|
return phone.matches(regex); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,332 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright notice, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package com.logpm.basicdata.excel; |
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore; |
||||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||||
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||||
|
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 车辆信息表 Excel实体类 |
||||||
|
* |
||||||
|
* @author lmy |
||||||
|
* @since 2023-05-16 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ColumnWidth(25) |
||||||
|
@HeadRowHeight(20) |
||||||
|
@ContentRowHeight(18) |
||||||
|
public class BasicdataVehicleImportExcel implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 车牌号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(45) |
||||||
|
@ExcelProperty(index = 0,value = "车牌号,必填项:{示例:川A12345}") |
||||||
|
private String vehicleNub; |
||||||
|
/** |
||||||
|
* 车辆来源;1-自有,2-承包,3-外请 |
||||||
|
*/ |
||||||
|
@ColumnWidth(45) |
||||||
|
@ExcelProperty(index = 1,value ="车辆来源;1-自有,2-承包,3-外请") |
||||||
|
private String vehicleSource; |
||||||
|
/** |
||||||
|
* 是否车头;1-车头,2-挂车 |
||||||
|
*/ |
||||||
|
@ColumnWidth(35) |
||||||
|
@ExcelProperty(index = 2,value ="是否车头;1-车头,2-挂车") |
||||||
|
private String isHead; |
||||||
|
/** |
||||||
|
* 挂车类型;1-独享,2-共享 |
||||||
|
*/ |
||||||
|
@ColumnWidth(32) |
||||||
|
@ExcelProperty(index = 3,value ="挂车类型;1-独享,2-共享") |
||||||
|
private String trailerType; |
||||||
|
/** |
||||||
|
* 车辆类型;1-挂车,2-普通货车 |
||||||
|
*/ |
||||||
|
@ColumnWidth(150) |
||||||
|
@ExcelProperty(index = 4,value ="车辆类型;1-厢式货车;2-箱式挂车;3-平板货车;4-平板挂车;5-高栏车;6-高栏挂车;7-城配面包车;8-城配金杯车") |
||||||
|
private String vehicleModel; |
||||||
|
/** |
||||||
|
* 车厢类型;1-高栏,2-平板,3-箱车 |
||||||
|
*/ |
||||||
|
@ColumnWidth(45) |
||||||
|
@ExcelProperty(index = 5,value ="车厢类型;1-高栏,2-平板,3-箱车") |
||||||
|
private String carType; |
||||||
|
/** |
||||||
|
* 车长;单位(M) |
||||||
|
*/ |
||||||
|
@ColumnWidth(25) |
||||||
|
@ExcelProperty(index = 6,value ="车长;单位(M)") |
||||||
|
private BigDecimal vehicleCommander; |
||||||
|
/** |
||||||
|
* 外廓高 |
||||||
|
*/ |
||||||
|
@ColumnWidth(25) |
||||||
|
@ExcelProperty(index = 7,value ="外廓高;单位(M)") |
||||||
|
private BigDecimal vehicleHeight; |
||||||
|
/** |
||||||
|
* 车牌颜色;1-黄色,2-蓝色,3-绿色,4-蓝绿色,5-其他 |
||||||
|
*/ |
||||||
|
@ColumnWidth(60) |
||||||
|
@ExcelProperty("车牌颜色;1-黄色,2-蓝色,3-绿色,4-蓝绿色,5-其他") |
||||||
|
private String licensePlateColor; |
||||||
|
/** |
||||||
|
* 车身颜色;1-红,2-黄,3-蓝,4-黑,5-白,6-银 |
||||||
|
*/ |
||||||
|
@ColumnWidth(55) |
||||||
|
@ExcelProperty("车身颜色;1-红,2-黄,3-蓝,4-黑,5-白,6-银") |
||||||
|
private String vehicleColor; |
||||||
|
/** |
||||||
|
* 能源类型;1-汽油,2-柴油,3-电,4-天然气,5-混合油,6-燃化石油气,7-甲醇 |
||||||
|
*/ |
||||||
|
@ColumnWidth(90) |
||||||
|
@ExcelProperty("能源类型;1-汽油,2-柴油,3-电,4-天然气,5-混合油,6-燃化石油气,7-甲醇") |
||||||
|
private String energyType; |
||||||
|
/** |
||||||
|
* 车牌类型;1-大型汽车号牌,2-小型汽车号牌 |
||||||
|
*/ |
||||||
|
@ColumnWidth(50) |
||||||
|
@ExcelProperty("车牌类型;1-大型汽车号牌,2-小型汽车号牌") |
||||||
|
private String licensePlateType; |
||||||
|
/** |
||||||
|
* 车辆总质量;单位(T) |
||||||
|
*/ |
||||||
|
@ColumnWidth(30) |
||||||
|
@ExcelProperty("车辆总质量;单位(T)") |
||||||
|
private BigDecimal vehicleQuality; |
||||||
|
/** |
||||||
|
* 整备质量;单位(T) |
||||||
|
*/ |
||||||
|
@ColumnWidth(30) |
||||||
|
@ExcelProperty("整备质量;单位(T)") |
||||||
|
private BigDecimal curbWeight; |
||||||
|
/** |
||||||
|
* 载荷质量;单位(T) |
||||||
|
*/ |
||||||
|
@ColumnWidth(30) |
||||||
|
@ExcelProperty("载荷质量;单位(T)") |
||||||
|
private BigDecimal loadMass; |
||||||
|
/** |
||||||
|
* 外廓宽;单位(M) |
||||||
|
*/ |
||||||
|
@ColumnWidth(30) |
||||||
|
@ExcelProperty("外廓宽;单位(M)") |
||||||
|
private BigDecimal outerWidth; |
||||||
|
/** |
||||||
|
* 核定体积 |
||||||
|
*/ |
||||||
|
@ColumnWidth(30) |
||||||
|
@ExcelProperty("核定体积;单位(方)") |
||||||
|
private BigDecimal approvedVolume; |
||||||
|
/** |
||||||
|
* 付款方式;1-现付,2-月付,3-到付 |
||||||
|
*/ |
||||||
|
@ColumnWidth(45) |
||||||
|
@ExcelProperty(index = 8,value ="付款方式;1-现付,2-月付,3-到付") |
||||||
|
private String paymentMethod; |
||||||
|
|
||||||
|
/** |
||||||
|
* 车辆所属人 |
||||||
|
*/ |
||||||
|
@ColumnWidth(100) |
||||||
|
@ExcelProperty("车辆所属人:{示例:张三(绑定司机需先建立司机,司机名称与手机号码保持一致)}") |
||||||
|
private String vehicleOwner; |
||||||
|
/** |
||||||
|
* 车辆所属人手机号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(100) |
||||||
|
@ExcelProperty(value = "车辆所属人手机号:{示例:156xxxxxxxxx(绑定司机需与司机手机号一致)}") |
||||||
|
private String vehicleOwnerPhone; |
||||||
|
/** |
||||||
|
* 车辆所属人身份证号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(65) |
||||||
|
@ExcelProperty("车辆所属人身份证号::{示例:510100xxxxxxxxxxxx}") |
||||||
|
private String vehicleOwnerCard; |
||||||
|
/** |
||||||
|
* 品牌型号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("品牌型号") |
||||||
|
private String vehicleBrand; |
||||||
|
/** |
||||||
|
* 车辆代号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("车辆代号") |
||||||
|
private String vehicleCode; |
||||||
|
/** |
||||||
|
* 发动机型号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("发动机型号") |
||||||
|
private String engineCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 到期时间 |
||||||
|
*/ |
||||||
|
@ColumnWidth(38) |
||||||
|
@ExcelProperty(value = "到期时间:{示例:2023/2/28}") |
||||||
|
private String expirationTime; |
||||||
|
/** |
||||||
|
* 道路运输证号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("道路运输证号") |
||||||
|
private String roadTransport; |
||||||
|
/** |
||||||
|
* 经营许可证号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("经营许可证号") |
||||||
|
private String businessLicense; |
||||||
|
/** |
||||||
|
* 车辆所属单位 |
||||||
|
*/ |
||||||
|
@ColumnWidth(40) |
||||||
|
@ExcelProperty(value = "车辆所属单位") |
||||||
|
private String vehicleUnit; |
||||||
|
/** |
||||||
|
* 车辆所属单位电话 |
||||||
|
*/ |
||||||
|
@ColumnWidth(55) |
||||||
|
@ExcelProperty(value = "车辆所属单位电话:{示例:156xxxxxxxxx}") |
||||||
|
private String vehicleUnitPhone; |
||||||
|
|
||||||
|
/** |
||||||
|
* 关联承运商Id |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("关联承运商Id") |
||||||
|
@ExcelIgnore |
||||||
|
private Long carrierId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 关联承运商Id |
||||||
|
*/ |
||||||
|
@ColumnWidth(50) |
||||||
|
@ExcelProperty("承运商名称") |
||||||
|
private String carrierName; |
||||||
|
/** |
||||||
|
* 车辆年审时间 |
||||||
|
*/ |
||||||
|
@ColumnWidth(50) |
||||||
|
@ExcelProperty("车辆年审时间:{示例:2023/2/28}") |
||||||
|
private String reviewTime; |
||||||
|
/** |
||||||
|
* 车辆年审有效期 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("车辆年审有效期") |
||||||
|
private Integer reviewValidity; |
||||||
|
/** |
||||||
|
* 车辆保险开始时间 |
||||||
|
*/ |
||||||
|
@ColumnWidth(50) |
||||||
|
@ExcelProperty("车辆保险开始时间:{示例:2023/2/28}") |
||||||
|
private String insuranceStartTime; |
||||||
|
/** |
||||||
|
* 车辆保险结束时间 |
||||||
|
*/ |
||||||
|
@ColumnWidth(50) |
||||||
|
@ExcelProperty("车辆保险结束时间:{示例:2023/2/28}") |
||||||
|
private String insuranceEndTime; |
||||||
|
/** |
||||||
|
* 有无车身广告 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("有无车身广告") |
||||||
|
private String bodyAdvertising; |
||||||
|
/** |
||||||
|
* 车身广告跟新时间 |
||||||
|
*/ |
||||||
|
@ColumnWidth(50) |
||||||
|
@ExcelProperty("车身广告更新时间:{示例:2023/2/28}") |
||||||
|
private String advertisementsNewTimes; |
||||||
|
/** |
||||||
|
* 是否有GPS;1-没有,2-有 |
||||||
|
*/ |
||||||
|
@ColumnWidth(35) |
||||||
|
@ExcelProperty("是否有GPS;1-没有,2-有") |
||||||
|
private String withGps; |
||||||
|
/** |
||||||
|
* GPS服务商 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("GPS服务商") |
||||||
|
private String gpsServiceProvider; |
||||||
|
/** |
||||||
|
* GPS型号 |
||||||
|
*/ |
||||||
|
@ColumnWidth(20) |
||||||
|
@ExcelProperty("GPS型号") |
||||||
|
private String gpsModel; |
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
@ColumnWidth(100) |
||||||
|
@ExcelProperty("备注") |
||||||
|
private String notes; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 预留1
|
||||||
|
// */
|
||||||
|
// @ColumnWidth(20)
|
||||||
|
// @ExcelProperty("预留1")
|
||||||
|
// private String reserve1;
|
||||||
|
// /**
|
||||||
|
// * 预留2
|
||||||
|
// */
|
||||||
|
// @ColumnWidth(20)
|
||||||
|
// @ExcelProperty("预留2")
|
||||||
|
// private String reserve2;
|
||||||
|
// /**
|
||||||
|
// * 预留3
|
||||||
|
// */
|
||||||
|
// @ColumnWidth(20)
|
||||||
|
// @ExcelProperty("预留3")
|
||||||
|
// private String reserve3;
|
||||||
|
// /**
|
||||||
|
// * 预留4
|
||||||
|
// */
|
||||||
|
// @ColumnWidth(20)
|
||||||
|
// @ExcelProperty("预留4")
|
||||||
|
// private String reserve4;
|
||||||
|
// /**
|
||||||
|
// * 预留5
|
||||||
|
// */
|
||||||
|
// @ColumnWidth(20)
|
||||||
|
// @ExcelProperty("预留5")
|
||||||
|
// private String reserve5;
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
package com.logpm.basicdata.excel; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.logpm.basicdata.service.IBasicdataDriverArteryService; |
||||||
|
import com.logpm.basicdata.service.IBasicdataVehicleService; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springblade.core.excel.support.ExcelImporter; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @program: LogisticsPlatform-Service |
||||||
|
* @description: |
||||||
|
* @author: lmy |
||||||
|
* @create: 2023-08-09 10:26 |
||||||
|
**/ |
||||||
|
@RequiredArgsConstructor |
||||||
|
public class BasicdataVehicleImporter implements ExcelImporter<BasicdataVehicleImportExcel> { |
||||||
|
|
||||||
|
private final IBasicdataVehicleService service; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @param data |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public void save(List<BasicdataVehicleImportExcel> data) { |
||||||
|
service.importDriverArtery(data); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue