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 f71572ab
authored
May 27, 2021
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]试驾服务
1 parent
ddf263bb
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
10 deletions
src/main/java/cn/com/glsx/admin/modules/entity/Vehicle.java
src/main/java/cn/com/glsx/admin/modules/model/param/TrialDriveVehicleEditBo.java
src/main/java/cn/com/glsx/admin/modules/model/param/VehicleDocSearch.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleDocService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/resources/mapper/VehicleMapper.xml
src/main/java/cn/com/glsx/admin/modules/entity/Vehicle.java
View file @
f71572a
package
cn
.
com
.
glsx
.
admin
.
modules
.
entity
;
package
cn
.
com
.
glsx
.
admin
.
modules
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -171,6 +172,12 @@ public class Vehicle extends BaseEntity {
...
@@ -171,6 +172,12 @@ public class Vehicle extends BaseEntity {
*/
*/
@Column
(
name
=
"buy_type"
)
@Column
(
name
=
"buy_type"
)
private
String
buyType
;
private
String
buyType
;
/**
* 购置方式
*/
@Column
(
name
=
"registration_date"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
registrationDate
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/admin/modules/model/param/TrialDriveVehicleEditBo.java
View file @
f71572a
...
@@ -4,6 +4,7 @@ import cn.com.glsx.admin.modules.model.ValidateGroups;
...
@@ -4,6 +4,7 @@ import cn.com.glsx.admin.modules.model.ValidateGroups;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
/**
* @Desc:
* @Desc:
...
@@ -37,5 +38,9 @@ public class TrialDriveVehicleEditBo extends TrialDriveVehicleBo {
...
@@ -37,5 +38,9 @@ public class TrialDriveVehicleEditBo extends TrialDriveVehicleBo {
* 备注
* 备注
*/
*/
private
String
remark
;
private
String
remark
;
/**
* 备注
*/
private
Date
registrationDate
;
}
}
src/main/java/cn/com/glsx/admin/modules/model/param/VehicleDocSearch.java
View file @
f71572a
...
@@ -4,7 +4,7 @@ import lombok.AllArgsConstructor;
...
@@ -4,7 +4,7 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Not
Blank
;
import
javax.validation.constraints.Not
Null
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
...
@@ -15,7 +15,7 @@ import javax.validation.constraints.NotBlank;
...
@@ -15,7 +15,7 @@ import javax.validation.constraints.NotBlank;
@AllArgsConstructor
@AllArgsConstructor
public
class
VehicleDocSearch
{
public
class
VehicleDocSearch
{
@Not
Blank
(
message
=
"车辆id不能为空"
)
@Not
Null
(
message
=
"车辆id不能为空"
)
private
Long
vehicleId
;
private
Long
vehicleId
;
private
Integer
docType
;
private
Integer
docType
;
...
...
src/main/java/cn/com/glsx/admin/modules/service/VehicleDocService.java
View file @
f71572a
...
@@ -54,9 +54,11 @@ public class VehicleDocService {
...
@@ -54,9 +54,11 @@ public class VehicleDocService {
TrialDriveVehicleEditBo
trialDriveVehicleEditBo
=
new
TrialDriveVehicleEditBo
();
TrialDriveVehicleEditBo
trialDriveVehicleEditBo
=
new
TrialDriveVehicleEditBo
();
BeanUtils
.
copyProperties
(
vehicleInfoBo
,
trialDriveVehicleEditBo
);
BeanUtils
.
copyProperties
(
vehicleInfoBo
,
trialDriveVehicleEditBo
);
trialDriveVehicleEditBo
.
setTempId
(
vehicleInfoBo
.
getTempId
()
+
""
);
trialDriveVehicleEditBo
.
setTempId
(
vehicleInfoBo
.
getTempId
()
+
""
);
vehicleService
.
updateDriveVehicleById
(
trialDriveVehicleEditBo
);
trialDriveVehicleEditBo
.
setRegistrationDate
(
new
Date
());
vehicleService
.
updateVehicle
(
trialDriveVehicleEditBo
);
// 2.更新上牌资料信息
// 2.更新上牌资料信息
List
<
VehicleDocBo
>
vehicleDocBoList
=
vehicleInfoBo
.
getList
();
List
<
VehicleDocBo
>
vehicleDocBoList
=
vehicleInfoBo
.
getList
();
if
(
CollectionUtils
.
isNotEmpty
(
vehicleDocBoList
))
{
List
<
VehicleDoc
>
vehicleDocList
=
vehicleDocBoList
.
stream
().
map
(
index
->
{
List
<
VehicleDoc
>
vehicleDocList
=
vehicleDocBoList
.
stream
().
map
(
index
->
{
VehicleDoc
vehicleDoc
=
new
VehicleDoc
();
VehicleDoc
vehicleDoc
=
new
VehicleDoc
();
BeanUtils
.
copyProperties
(
index
,
vehicleDoc
);
BeanUtils
.
copyProperties
(
index
,
vehicleDoc
);
...
@@ -78,6 +80,7 @@ public class VehicleDocService {
...
@@ -78,6 +80,7 @@ public class VehicleDocService {
}
}
});
});
}
}
}
// 3.提交上牌资料审核信息
// 3.提交上牌资料审核信息
approvalService
.
saveApproval
(
new
ApprovalBo
(
ConstantsApproval
.
VEL_DOC_APPROVAL
,
vehicleInfoBo
.
getTempId
()));
approvalService
.
saveApproval
(
new
ApprovalBo
(
ConstantsApproval
.
VEL_DOC_APPROVAL
,
vehicleInfoBo
.
getTempId
()));
}
}
...
...
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
f71572a
...
@@ -117,20 +117,29 @@ public class VehicleService {
...
@@ -117,20 +117,29 @@ public class VehicleService {
/**
/**
* 修改试驾车辆信息
* 修改试驾车辆信息
*
*
* @param driveVehicleoBo
* @param driveVehicleoBo
车辆入参
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
update
DriveVehicleById
(
TrialDriveVehicleEditBo
driveVehicleoBo
)
{
public
void
update
Vehicle
(
TrialDriveVehicleEditBo
driveVehicleoBo
)
{
Vehicle
vehicle
=
vehicleMapper
.
selectById
(
Long
.
parseLong
(
driveVehicleoBo
.
getTempId
()));
Vehicle
vehicle
=
vehicleMapper
.
selectById
(
Long
.
parseLong
(
driveVehicleoBo
.
getTempId
()));
BeanUtils
.
copyProperties
(
driveVehicleoBo
,
vehicle
);
BeanUtils
.
copyProperties
(
driveVehicleoBo
,
vehicle
);
vehicle
.
setUpdatedBy
(
ShieldContextHolder
.
getUserId
());
vehicle
.
setUpdatedBy
(
ShieldContextHolder
.
getUserId
());
vehicle
.
setUpdatedDate
(
new
Date
());
vehicle
.
setUpdatedDate
(
new
Date
());
vehicleMapper
.
updateByPrimaryKey
(
vehicle
);
vehicleMapper
.
updateByPrimaryKey
(
vehicle
);
List
<
VehicleDevice
>
bindVehicleDevice
=
listVehicleDeviceByVehicleIdStatus
(
vehicle
.
getId
());
}
String
sn
=
driveVehicleoBo
.
getSn
();
/**
* 修改试驾车辆信息(车辆设备关系维护)
*
* @param driveVehicleoBo
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateDriveVehicleById
(
TrialDriveVehicleEditBo
driveVehicleoBo
)
{
updateVehicle
(
driveVehicleoBo
);
List
<
VehicleDevice
>
bindVehicleDevice
=
listVehicleDeviceByVehicleIdStatus
(
Long
.
valueOf
(
driveVehicleoBo
.
getTempId
()));
String
sn
=
driveVehicleoBo
.
getSn
();
if
(
StringUtils
.
isBlank
(
sn
)
&&
CollectionUtils
.
isEmpty
(
bindVehicleDevice
))
{
if
(
StringUtils
.
isBlank
(
sn
)
&&
CollectionUtils
.
isEmpty
(
bindVehicleDevice
))
{
return
;
return
;
}
else
if
(
StringUtils
.
isBlank
(
sn
)
&&
CollectionUtils
.
isNotEmpty
(
bindVehicleDevice
))
{
}
else
if
(
StringUtils
.
isBlank
(
sn
)
&&
CollectionUtils
.
isNotEmpty
(
bindVehicleDevice
))
{
throw
new
AdminException
(
ResultEnum
.
UN_BIND_DEVICE
);
throw
new
AdminException
(
ResultEnum
.
UN_BIND_DEVICE
);
}
else
if
(
StringUtils
.
isNotBlank
(
sn
)
&&
CollectionUtils
.
isNotEmpty
(
bindVehicleDevice
))
{
}
else
if
(
StringUtils
.
isNotBlank
(
sn
)
&&
CollectionUtils
.
isNotEmpty
(
bindVehicleDevice
))
{
...
@@ -147,12 +156,13 @@ public class VehicleService {
...
@@ -147,12 +156,13 @@ public class VehicleService {
}
}
}
else
if
(
StringUtils
.
isNotBlank
(
sn
)
&&
CollectionUtils
.
isEmpty
(
bindVehicleDevice
))
{
}
else
if
(
StringUtils
.
isNotBlank
(
sn
)
&&
CollectionUtils
.
isEmpty
(
bindVehicleDevice
))
{
//绑定
//绑定
saveVehicleDevice
(
sn
,
vehicle
.
getId
(
));
saveVehicleDevice
(
sn
,
Long
.
valueOf
(
driveVehicleoBo
.
getTempId
()
));
}
}
}
}
/**
/**
* 保存车辆设备绑定关系
* 保存车辆设备绑定关系
*
* @param sn
* @param sn
* @param vehicleId
* @param vehicleId
*/
*/
...
@@ -168,6 +178,7 @@ public class VehicleService {
...
@@ -168,6 +178,7 @@ public class VehicleService {
/**
/**
* 查询车辆绑定了哪些设备
* 查询车辆绑定了哪些设备
*
* @param vehicleId
* @param vehicleId
* @return
* @return
*/
*/
...
@@ -331,6 +342,7 @@ public class VehicleService {
...
@@ -331,6 +342,7 @@ public class VehicleService {
/**
/**
* 下载失败的数据
* 下载失败的数据
*
* @param failSeqNoFile
* @param failSeqNoFile
* @return
* @return
* @throws FileNotFoundException
* @throws FileNotFoundException
...
@@ -343,6 +355,7 @@ public class VehicleService {
...
@@ -343,6 +355,7 @@ public class VehicleService {
/**
/**
* 批量插入
* 批量插入
*
* @param vehicleList
* @param vehicleList
*/
*/
public
int
insertList
(
List
<
Vehicle
>
vehicleList
)
{
public
int
insertList
(
List
<
Vehicle
>
vehicleList
)
{
...
@@ -351,6 +364,7 @@ public class VehicleService {
...
@@ -351,6 +364,7 @@ public class VehicleService {
/**
/**
* 查找特约店(账户)是否存在
* 查找特约店(账户)是否存在
*
* @param userRequest
* @param userRequest
* @return
* @return
*/
*/
...
@@ -366,6 +380,7 @@ public class VehicleService {
...
@@ -366,6 +380,7 @@ public class VehicleService {
/**
/**
* 保存车辆、车辆和设备的绑定关系
* 保存车辆、车辆和设备的绑定关系
*
* @param vi
* @param vi
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -380,13 +395,14 @@ public class VehicleService {
...
@@ -380,13 +395,14 @@ public class VehicleService {
//保存车辆和设备的绑定关系
//保存车辆和设备的绑定关系
String
sn
=
vi
.
getSn
();
String
sn
=
vi
.
getSn
();
if
(
StringUtils
.
isBlank
(
sn
))
{
if
(
StringUtils
.
isBlank
(
sn
))
{
return
;
return
;
}
}
saveVehicleDevice
(
sn
,
vehicle
.
getId
());
saveVehicleDevice
(
sn
,
vehicle
.
getId
());
}
}
/**
/**
* 保存导入失败的数据
* 保存导入失败的数据
*
* @param failList
* @param failList
*/
*/
public
String
saveFialData
(
List
<
TrialDriveVehicleImport
>
failList
)
{
public
String
saveFialData
(
List
<
TrialDriveVehicleImport
>
failList
)
{
...
...
src/main/resources/mapper/VehicleMapper.xml
View file @
f71572a
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
<result
column=
"registration_date"
jdbcType=
"TIMESTAMP"
property=
"registrationDate"
/>
</resultMap>
</resultMap>
<resultMap
id=
"TearDownAlarmMap"
type=
"cn.com.glsx.admin.modules.model.export.TearDownModelExport"
>
<resultMap
id=
"TearDownAlarmMap"
type=
"cn.com.glsx.admin.modules.model.export.TearDownModelExport"
>
...
...
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