Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
7b516e88
Commit
7b516e88
authored
Mar 21, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改校验
parent
85e06e2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+10
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
7b516e88
...
@@ -403,6 +403,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -403,6 +403,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
{
ProductEntity
productEntity
=
productService
.
get
(
entity
.
getProductId
());
ProductEntity
productEntity
=
productService
.
get
(
entity
.
getProductId
());
entity
.
setProductCode
(
productEntity
.
getProductCode
());
entity
.
setProductCode
(
productEntity
.
getProductCode
());
entity
.
setProductName
(
productEntity
.
getProductName
());
}
}
return
super
.
editAfter
(
id
,
model
,
entity
,
context
);
return
super
.
editAfter
(
id
,
model
,
entity
,
context
);
}
}
...
@@ -412,7 +413,15 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -412,7 +413,15 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
protected
void
saveBefore
(
DeviceEntity
entity
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
protected
void
saveBefore
(
DeviceEntity
entity
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
super
.
saveBefore
(
entity
,
model
,
context
);
super
.
saveBefore
(
entity
,
model
,
context
);
if
(
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
throw
new
AppException
(
"所属产品ID不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
throw
new
AppException
(
"所属产品ID不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
entity
.
getPlatformId
()))
throw
new
AppException
(
"所属平台ID不能为空!"
);
ProductEntity
productEntity
=
productService
.
get
(
entity
.
getProductId
());
if
(!
ObjectUtils
.
isEmpty
(
productEntity
.
getPlatformId
()))
{
PlatformEntity
platformEntity
=
platformService
.
getCache
(
productEntity
.
getPlatformId
().
toString
());
entity
.
setPlatformId
(
platformEntity
.
getId
());
entity
.
setPlatformCode
(
platformEntity
.
getPlatformSn
());
entity
.
setPlatformName
(
platformEntity
.
getPlatformName
());
}
// if(ObjectUtils.isEmpty(entity.getPlatformId())) throw new AppException("所属平台ID不能为空!");
//判断如果存在相同的
//判断如果存在相同的
DeviceEntity
deviceEntity
=
this
.
service
.
selectOne
(
new
DeviceQuery
().
deviceCode
(
entity
.
getDeviceCode
()));
DeviceEntity
deviceEntity
=
this
.
service
.
selectOne
(
new
DeviceQuery
().
deviceCode
(
entity
.
getDeviceCode
()));
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
)){
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
)){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment