Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
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-progress
Commits
2e36366e
Commit
2e36366e
authored
Feb 25, 2022
by
wuqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/2/12 吴卿华
parent
0e0d90ad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
CodeConFig.java
...n/src/main/java/com/zehong/web/codeconfig/CodeConFig.java
+14
-0
TDeviceInfoController.java
...ehong/web/controller/supervise/TDeviceInfoController.java
+5
-0
index.vue
gassafetyprogress-web/src/views/regulation/device/index.vue
+1
-9
No files found.
gassafetyprogress-admin/src/main/java/com/zehong/web/codeconfig/CodeConFig.java
0 → 100644
View file @
2e36366e
package
com
.
zehong
.
web
.
codeconfig
;
import
java.util.Random
;
public
class
CodeConFig
{
//生成四位随机数
public
static
String
RandomCode
(){
//生成一个6位随机数
String
radom
=
String
.
valueOf
(
new
Random
().
nextInt
(
999999
));
String
substring
=
radom
.
substring
(
0
,
4
);
return
substring
;
}
}
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/supervise/TDeviceInfoController.java
View file @
2e36366e
...
@@ -6,6 +6,7 @@ import com.zehong.system.domain.Listaw;
...
@@ -6,6 +6,7 @@ import com.zehong.system.domain.Listaw;
import
com.zehong.system.domain.TDetailInfoList
;
import
com.zehong.system.domain.TDetailInfoList
;
import
com.zehong.system.domain.TDeviceInfoS
;
import
com.zehong.system.domain.TDeviceInfoS
;
import
com.zehong.system.service.ITEmployedPeopleInfoService
;
import
com.zehong.system.service.ITEmployedPeopleInfoService
;
import
com.zehong.web.codeconfig.CodeConFig
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -77,8 +78,12 @@ public class TDeviceInfoController extends BaseController
...
@@ -77,8 +78,12 @@ public class TDeviceInfoController extends BaseController
@PostMapping
@PostMapping
public
void
add
(
@RequestBody
Listaw
listaw
)
public
void
add
(
@RequestBody
Listaw
listaw
)
{
{
//生成四位随机码
String
code
=
CodeConFig
.
RandomCode
();
listaw
.
gettDeviceInfo
().
setDeviceCode
(
code
);
//添加设备信息表数据 并且返回新增id
//添加设备信息表数据 并且返回新增id
tDeviceInfoService
.
insertTDeviceInfo
(
listaw
.
gettDeviceInfo
());
tDeviceInfoService
.
insertTDeviceInfo
(
listaw
.
gettDeviceInfo
());
if
(
listaw
.
gettDeviceInfoS
()!=
null
){
if
(
listaw
.
gettDeviceInfoS
()!=
null
){
//将关联设备信息与设备进行绑定
//将关联设备信息与设备进行绑定
tDeviceInfoService
.
updatetRelationDeviceDetailInfo
(
listaw
.
gettDeviceInfoS
(),
listaw
.
gettDeviceInfo
().
getDeviceId
(),
listaw
.
gettDeviceInfo
().
getRelationDeviceType
());
tDeviceInfoService
.
updatetRelationDeviceDetailInfo
(
listaw
.
gettDeviceInfoS
(),
listaw
.
gettDeviceInfo
().
getDeviceId
(),
listaw
.
gettDeviceInfo
().
getRelationDeviceType
());
...
...
gassafetyprogress-web/src/views/regulation/device/index.vue
View file @
2e36366e
...
@@ -294,7 +294,7 @@
...
@@ -294,7 +294,7 @@
<
el
-
col
:
span
=
"11"
>
<
el
-
col
:
span
=
"11"
>
<
el
-
form
-
item
label
=
"设备编号"
prop
=
"deviceCode"
>
<
el
-
form
-
item
label
=
"设备编号"
prop
=
"deviceCode"
>
<
el
-
input
v
-
model
=
"form.deviceCode"
placeholder
=
"请输入设备编号"
/>
<
el
-
input
v
-
model
=
"form.deviceCode"
placeholder
=
"请输入设备编号"
:
disabled
=
"true"
/>
<
/el-form-item
>
<
/el-form-item
>
<
/el-col
>
<
/el-col
>
<
/el-row
>
<
/el-row
>
...
@@ -566,18 +566,10 @@ export default {
...
@@ -566,18 +566,10 @@ export default {
{
required
:
true
,
message
:
"请输入设备名称"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请输入设备名称"
,
trigger
:
"blur"
}
,
//
{
min
:
0
,
max
:
20
,
message
:
"长度20位"
,
trigger
:
"blur"
}
,
//
{
min
:
0
,
max
:
20
,
message
:
"长度20位"
,
trigger
:
"blur"
}
,
],
],
deviceCode
:
[
{
required
:
true
,
message
:
"请输入设备编号"
,
trigger
:
"blur"
}
,
//
{
min
:
0
,
max
:
20
,
message
:
"长度20位"
,
trigger
:
"blur"
}
,
],
deviceAddr
:
[
deviceAddr
:
[
{
required
:
true
,
message
:
"请输入所在地址"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请输入所在地址"
,
trigger
:
"blur"
}
,
//
{
min
:
0
,
max
:
30
,
message
:
"长度30位"
,
trigger
:
"blur"
}
,
//
{
min
:
0
,
max
:
30
,
message
:
"长度30位"
,
trigger
:
"blur"
}
,
],
],
deviceModel
:
[
{
required
:
true
,
message
:
"请输入设备型号"
,
trigger
:
"blur"
}
,
//
{
min
:
0
,
max
:
20
,
message
:
"长度20位"
,
trigger
:
"blur"
}
,
],
deviceType
:
[
deviceType
:
[
{
required
:
true
,
message
:
"请选择设备类型"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请选择设备类型"
,
trigger
:
"blur"
}
,
],
],
...
...
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