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 f608dd96
authored
Aug 23, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增车辆-车型管理-异步保存
1 parent
f7ca3c82
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
View file @
f608dd9
package
cn
.
com
.
glsx
.
admin
.
modules
.
controller
;
package
cn
.
com
.
glsx
.
admin
.
modules
.
controller
;
import
cn.com.glsx.admin.common.constants.Constants
;
import
cn.com.glsx.admin.common.constants.Constants
;
import
cn.com.glsx.admin.common.enums.ResultEnum
;
import
cn.com.glsx.admin.common.exception.AdminException
;
import
cn.com.glsx.admin.modules.model.*
;
import
cn.com.glsx.admin.modules.model.*
;
import
cn.com.glsx.admin.modules.model.export.TrialDriveVehicleExport
;
import
cn.com.glsx.admin.modules.model.export.TrialDriveVehicleExport
;
import
cn.com.glsx.admin.modules.model.imports.TrialDriveVehicleImport
;
import
cn.com.glsx.admin.modules.model.imports.TrialDriveVehicleImport
;
...
@@ -220,7 +222,15 @@ public class VehicleController {
...
@@ -220,7 +222,15 @@ public class VehicleController {
@ApiOperation
(
value
=
"保存车型库"
)
@ApiOperation
(
value
=
"保存车型库"
)
@PostMapping
(
"/savetypes"
)
@PostMapping
(
"/savetypes"
)
public
R
<
List
<
Cartype
>>
saveVehicleTypes
(
@RequestBody
VehicleTypesBO
typesBO
)
{
public
R
<
List
<
Cartype
>>
saveVehicleTypes
(
@RequestBody
VehicleTypesBO
typesBO
)
{
TenantTypesDTO
typesDTO
=
vehicleService
.
getTenantTypes
(
typesBO
.
getTenantId
());
//新增且车型库已经存在
if
(
typesBO
.
getFrom
()
==
1
&&
typesDTO
!=
null
)
{
throw
new
AdminException
(
ResultEnum
.
TENANT_VEHICLE_TYPES_EXISTED
);
}
vehicleService
.
saveVehicleTypes
(
typesBO
);
vehicleService
.
saveVehicleTypes
(
typesBO
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
...
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
f608dd9
...
@@ -41,6 +41,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
...
@@ -41,6 +41,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -785,15 +786,9 @@ public class VehicleService {
...
@@ -785,15 +786,9 @@ public class VehicleService {
return
cartypeService
.
getByCarTypeId
(
typeId
);
return
cartypeService
.
getByCarTypeId
(
typeId
);
}
}
@Async
public
void
saveVehicleTypes
(
VehicleTypesBO
typesBO
)
{
public
void
saveVehicleTypes
(
VehicleTypesBO
typesBO
)
{
TenantTypesDTO
typesDTO
=
getTenantTypes
(
typesBO
.
getTenantId
());
//新增且车型库已经存在
if
(
typesBO
.
getFrom
()
==
1
&&
typesDTO
!=
null
)
{
throw
new
AdminException
(
ResultEnum
.
TENANT_VEHICLE_TYPES_EXISTED
);
}
Date
now
=
new
Date
();
Date
now
=
new
Date
();
List
<
TenantVehicleType
>
tvTypeList
=
Lists
.
newArrayListWithCapacity
(
typesBO
.
getTypeIds
().
size
());
List
<
TenantVehicleType
>
tvTypeList
=
Lists
.
newArrayListWithCapacity
(
typesBO
.
getTypeIds
().
size
());
...
...
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