Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3a5942d9
authored
Jun 05, 2021
by
黄小葱
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
导入试驾车辆优化
1 parent
269ddcf1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
12 deletions
src/main/java/cn/com/glsx/admin/common/constants/ConstantsVehicle.java
src/main/java/cn/com/glsx/admin/modules/model/imports/TrialDriveVehicleImport.java
src/main/java/cn/com/glsx/admin/modules/model/imports/TrialDriveVehicleImportListener.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/resources/templates/importVehicle.xlsx
src/test/java/cn/com/glsx/admin/modules/service/VehicleServiceTest.java
src/main/java/cn/com/glsx/admin/common/constants/ConstantsVehicle.java
View file @
3a5942d
...
...
@@ -22,6 +22,17 @@ public final class ConstantsVehicle {
*/
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
=
"已上牌"
;
}
src/main/java/cn/com/glsx/admin/modules/model/imports/TrialDriveVehicleImport.java
View file @
3a5942d
...
...
@@ -14,27 +14,27 @@ public class TrialDriveVehicleImport implements Serializable {
/**
* 特约店名称
*/
@ExcelProperty
(
value
=
"特约店名称"
,
index
=
0
)
@ExcelProperty
(
value
=
"
*
特约店名称"
,
index
=
0
)
private
String
shopName
;
/**
* 特约点代码
*/
@ExcelProperty
(
value
=
"特约店编码"
,
index
=
1
)
@ExcelProperty
(
value
=
"
*
特约店编码"
,
index
=
1
)
private
String
shopCode
;
/**
* 车架号
*/
@ExcelProperty
(
value
=
"车架号"
,
index
=
2
)
@ExcelProperty
(
value
=
"
*
车架号"
,
index
=
2
)
private
String
vin
;
/**
* 车型名称
*/
@ExcelProperty
(
value
=
"车型"
,
index
=
3
)
@ExcelProperty
(
value
=
"
*
车型"
,
index
=
3
)
private
String
modelName
;
/**
* 配置
*/
@ExcelProperty
(
value
=
"配置"
,
index
=
4
)
@ExcelProperty
(
value
=
"
*
配置"
,
index
=
4
)
private
String
configDesc
;
/**
* 车牌
...
...
@@ -44,18 +44,18 @@ public class TrialDriveVehicleImport implements Serializable {
/**
* 车辆外部颜色
*/
@ExcelProperty
(
value
=
"外色"
,
index
=
6
)
@ExcelProperty
(
value
=
"
*
外色"
,
index
=
6
)
private
String
color
;
/**
* 车辆内饰颜色
*/
@ExcelProperty
(
value
=
"内色"
,
index
=
7
)
@ExcelProperty
(
value
=
"
*
内色"
,
index
=
7
)
private
String
innerColor
;
/**
* 服役类型:0未上牌,1已上牌
*/
@ExcelProperty
(
value
=
"服役类型"
,
index
=
8
)
private
Integer
serveType
;
@ExcelProperty
(
value
=
"
*
服役类型"
,
index
=
8
)
private
String
serveTypeStr
;
/**
* 设备号
*/
...
...
src/main/java/cn/com/glsx/admin/modules/model/imports/TrialDriveVehicleImportListener.java
View file @
3a5942d
...
...
@@ -214,9 +214,12 @@ public class TrialDriveVehicleImportListener extends AnalysisEventListener<Trial
if
(
StringUtils
.
isBlank
(
vehicleImport
.
getColor
()))
{
reason
.
append
(
"外色 必填;"
);
}
if
(
StringUtils
.
isBlank
(
vehicleImport
.
get
Vin
()))
{
if
(
StringUtils
.
isBlank
(
vehicleImport
.
get
InnerColor
()))
{
reason
.
append
(
"内色 必填;"
);
}
if
(
StringUtils
.
isBlank
(
vehicleImport
.
getServeTypeStr
()))
{
reason
.
append
(
"服役类型 必填;"
);
}
return
reason
.
toString
();
}
...
...
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
3a5942d
...
...
@@ -447,6 +447,12 @@ public class VehicleService {
if
(
modelDict
!=
null
)
{
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
.
setCreatedDate
(
new
Date
());
vehicle
.
setVehicleType
(
ConstantsVehicle
.
TRIAL_DRIVE_TYPE
);
...
...
src/main/resources/templates/importVehicle.xlsx
View file @
3a5942d
No preview for this file type
src/test/java/cn/com/glsx/admin/modules/service/VehicleServiceTest.java
View file @
3a5942d
...
...
@@ -157,7 +157,7 @@ public class VehicleServiceTest {
imp
.
setColor
(
"red"
);
imp
.
setLicensePlate
(
"粤B12345"
);
imp
.
setModelName
(
"高级"
);
imp
.
setServeType
(
1
);
imp
.
setServeType
Str
(
"未上牌"
);
imp
.
setShopName
(
"广州骏延店"
);
imp
.
setSn
(
"9080909090"
);
imp
.
setVin
(
"sadfqwef90808sdfas"
);
...
...
@@ -189,7 +189,7 @@ public class VehicleServiceTest {
@Test
public
void
syncVehicleInfoFromBhgTest
()
{
SyncVehicleBo
bo
=
new
SyncVehicleBo
();
bo
.
setShopName
(
"普宁聚恒店"
);
bo
.
setShopName
(
"普宁聚恒店
11
"
);
bo
.
setColor
(
"red"
);
bo
.
setActiveTime
(
"2021-06-01"
);
bo
.
setChanle
(
"bhg"
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment