Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gassafety
Commits
b45d0c9b
Commit
b45d0c9b
authored
Mar 31, 2023
by
吴卿华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备信息添加报错bug
parent
3ef1b5d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
GasSafetyApplication.java
...-admin/src/main/java/com/zehong/GasSafetyApplication.java
+2
-1
TDeviceInfoController.java
...m/zehong/web/controller/device/TDeviceInfoController.java
+0
-1
TDeviceInfoServiceImpl.java
...om/zehong/system/service/impl/TDeviceInfoServiceImpl.java
+8
-8
No files found.
gassafety-admin/src/main/java/com/zehong/GasSafetyApplication.java
View file @
b45d0c9b
...
...
@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* 启动程序
*
*
* @author zehong
*/
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
})
...
...
@@ -15,5 +15,6 @@ public class GasSafetyApplication
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
GasSafetyApplication
.
class
,
args
);
System
.
out
.
println
(
"启动成功"
);
}
}
gassafety-admin/src/main/java/com/zehong/web/controller/device/TDeviceInfoController.java
View file @
b45d0c9b
...
...
@@ -105,7 +105,6 @@ public class TDeviceInfoController extends BaseController {
@Log
(
title
=
"设备信息"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TDeviceInfo
tDeviceInfo
)
{
System
.
out
.
println
(
tDeviceInfo
.
getEquipmentList
());
int
result
=
tDeviceInfoService
.
insertTDeviceInfo
(
tDeviceInfo
);
if
(
result
<=
0
)
{
new
Exception
(
"设备信息插入失败"
);
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceInfoServiceImpl.java
View file @
b45d0c9b
...
...
@@ -318,14 +318,14 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
public
int
insertTDeviceInfo
(
TDeviceInfo
tDeviceInfo
)
{
int
deviceId
=
tDeviceInfoMapper
.
insertTDeviceInfo
(
tDeviceInfo
);
for
(
int
i
=
0
;
i
<
tDeviceInfo
.
getEquipmentList
().
size
();
i
++
){
tDeviceInfo
.
getEquipmentList
().
get
(
i
).
setCreateTime
(
new
Date
());
tDeviceInfo
.
getEquipmentList
().
get
(
i
).
setRelationDeviceId
(
tDeviceInfo
.
getDeviceId
());
}
/*添加下级设备*/
tDeviceInfoMapper
.
insertTrelation
(
tDeviceInfo
.
getEquipmentList
());
/**添加*/
System
.
out
.
println
(
tDeviceInfo
.
getDeviceId
());
if
(
tDeviceInfo
.
getEquipmentList
().
size
()!=
0
){
for
(
int
i
=
0
;
i
<
tDeviceInfo
.
getEquipmentList
().
size
();
i
++){
tDeviceInfo
.
getEquipmentList
().
get
(
i
).
setCreateTime
(
new
Date
());
tDeviceInfo
.
getEquipmentList
().
get
(
i
).
setRelationDeviceId
(
tDeviceInfo
.
getDeviceId
());
}
/*添加下级设备*/
tDeviceInfoMapper
.
insertTrelation
(
tDeviceInfo
.
getEquipmentList
());
}
return
deviceId
;
}
...
...
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