Commit 3a5942d9 by 黄小葱

导入试驾车辆优化

1 parent 269ddcf1
...@@ -22,6 +22,17 @@ public final class ConstantsVehicle { ...@@ -22,6 +22,17 @@ public final class ConstantsVehicle {
*/ */
public static final int VEHICLE_TYPE_PLATE = 1; public static final int VEHICLE_TYPE_PLATE = 1;
/**
* 服役类型:未上牌
*/
public static final String UN_VEHICLE_TYPE_PLATE_STR = "未上牌";
/**
* 服役类型:已上牌
*/
public static final String VEHICLE_TYPE_PLATE_STR = "已上牌";
} }
...@@ -14,27 +14,27 @@ public class TrialDriveVehicleImport implements Serializable { ...@@ -14,27 +14,27 @@ public class TrialDriveVehicleImport implements Serializable {
/** /**
* 特约店名称 * 特约店名称
*/ */
@ExcelProperty(value = "特约店名称", index = 0) @ExcelProperty(value = "*特约店名称", index = 0)
private String shopName; private String shopName;
/** /**
* 特约点代码 * 特约点代码
*/ */
@ExcelProperty(value = "特约店编码", index = 1) @ExcelProperty(value = "*特约店编码", index = 1)
private String shopCode; private String shopCode;
/** /**
* 车架号 * 车架号
*/ */
@ExcelProperty(value = "车架号", index = 2) @ExcelProperty(value = "*车架号", index = 2)
private String vin; private String vin;
/** /**
* 车型名称 * 车型名称
*/ */
@ExcelProperty(value = "车型", index = 3) @ExcelProperty(value = "*车型", index = 3)
private String modelName; private String modelName;
/** /**
* 配置 * 配置
*/ */
@ExcelProperty(value = "配置", index = 4) @ExcelProperty(value = "*配置", index = 4)
private String configDesc; private String configDesc;
/** /**
* 车牌 * 车牌
...@@ -44,18 +44,18 @@ public class TrialDriveVehicleImport implements Serializable { ...@@ -44,18 +44,18 @@ public class TrialDriveVehicleImport implements Serializable {
/** /**
* 车辆外部颜色 * 车辆外部颜色
*/ */
@ExcelProperty(value = "外色", index = 6) @ExcelProperty(value = "*外色", index = 6)
private String color; private String color;
/** /**
* 车辆内饰颜色 * 车辆内饰颜色
*/ */
@ExcelProperty(value = "内色", index = 7) @ExcelProperty(value = "*内色", index = 7)
private String innerColor; private String innerColor;
/** /**
* 服役类型:0未上牌,1已上牌 * 服役类型:0未上牌,1已上牌
*/ */
@ExcelProperty(value = "服役类型", index = 8) @ExcelProperty(value = "*服役类型", index = 8)
private Integer serveType; private String serveTypeStr;
/** /**
* 设备号 * 设备号
*/ */
......
...@@ -214,9 +214,12 @@ public class TrialDriveVehicleImportListener extends AnalysisEventListener<Trial ...@@ -214,9 +214,12 @@ public class TrialDriveVehicleImportListener extends AnalysisEventListener<Trial
if (StringUtils.isBlank(vehicleImport.getColor())) { if (StringUtils.isBlank(vehicleImport.getColor())) {
reason.append("外色 必填;"); reason.append("外色 必填;");
} }
if (StringUtils.isBlank(vehicleImport.getVin())) { if (StringUtils.isBlank(vehicleImport.getInnerColor())) {
reason.append("内色 必填;"); reason.append("内色 必填;");
} }
if (StringUtils.isBlank(vehicleImport.getServeTypeStr())) {
reason.append("服役类型 必填;");
}
return reason.toString(); return reason.toString();
} }
......
...@@ -447,6 +447,12 @@ public class VehicleService { ...@@ -447,6 +447,12 @@ public class VehicleService {
if (modelDict != null) { if (modelDict != null) {
vehicle.setConfigId(Math.toIntExact(modelDict.getId())); vehicle.setConfigId(Math.toIntExact(modelDict.getId()));
} }
String serveType = vi.getServeTypeStr();
if (ConstantsVehicle.VEHICLE_TYPE_PLATE_STR.equals(serveType.trim())) {
vehicle.setServeType(ConstantsVehicle.VEHICLE_TYPE_PLATE);
} else {
vehicle.setServeType(ConstantsVehicle.UN_VEHICLE_TYPE_PLATE);
}
vehicle.setCreatedBy(ShieldContextHolder.getUserId()); vehicle.setCreatedBy(ShieldContextHolder.getUserId());
vehicle.setCreatedDate(new Date()); vehicle.setCreatedDate(new Date());
vehicle.setVehicleType(ConstantsVehicle.TRIAL_DRIVE_TYPE); vehicle.setVehicleType(ConstantsVehicle.TRIAL_DRIVE_TYPE);
......
...@@ -157,7 +157,7 @@ public class VehicleServiceTest { ...@@ -157,7 +157,7 @@ public class VehicleServiceTest {
imp.setColor("red"); imp.setColor("red");
imp.setLicensePlate("粤B12345"); imp.setLicensePlate("粤B12345");
imp.setModelName("高级"); imp.setModelName("高级");
imp.setServeType(1); imp.setServeTypeStr("未上牌");
imp.setShopName("广州骏延店"); imp.setShopName("广州骏延店");
imp.setSn("9080909090"); imp.setSn("9080909090");
imp.setVin("sadfqwef90808sdfas"); imp.setVin("sadfqwef90808sdfas");
...@@ -189,7 +189,7 @@ public class VehicleServiceTest { ...@@ -189,7 +189,7 @@ public class VehicleServiceTest {
@Test @Test
public void syncVehicleInfoFromBhgTest() { public void syncVehicleInfoFromBhgTest() {
SyncVehicleBo bo = new SyncVehicleBo(); SyncVehicleBo bo = new SyncVehicleBo();
bo.setShopName("普宁聚恒店"); bo.setShopName("普宁聚恒店11");
bo.setColor("red"); bo.setColor("red");
bo.setActiveTime("2021-06-01"); bo.setActiveTime("2021-06-01");
bo.setChanle("bhg"); bo.setChanle("bhg");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!