Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
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
platform
hg-smart
Commits
e1ff59ba
Commit
e1ff59ba
authored
Nov 13, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化设备台账
parent
c8145030
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
ServiceHGSB001.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB001.java
+9
-4
HGSB001.xml
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB001.xml
+3
-0
No files found.
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB001.java
View file @
e1ff59ba
...
@@ -27,6 +27,7 @@ import java.util.Arrays;
...
@@ -27,6 +27,7 @@ import java.util.Arrays;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* @author LiuYang
* @author LiuYang
...
@@ -97,11 +98,15 @@ public class ServiceHGSB001 extends ServiceEPBase {
...
@@ -97,11 +98,15 @@ public class ServiceHGSB001 extends ServiceEPBase {
@OperationLogAnnotation
(
operModul
=
"设备台账"
,
operType
=
"保存"
,
operDesc
=
"保存操作"
)
@OperationLogAnnotation
(
operModul
=
"设备台账"
,
operType
=
"保存"
,
operDesc
=
"保存操作"
)
public
EiInfo
save
(
EiInfo
inInfo
)
{
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
HGSB001
>
resultRows
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGSB001
.
class
);
List
<
String
>
groupCodes
=
resultRows
.
stream
().
map
(
HGSB001:
:
getGroupCode
).
collect
(
Collectors
.
toList
());
List
<
Org
>
groupOrgs
=
HGXSTools
.
XsOrg
.
list
(
groupCodes
);
// 写入数据
// 写入数据
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
HGSB001
hgsb001
:
resultRows
)
{
HGSB001
hgsb001
=
new
HGSB001
();
Map
<
String
,
Org
>
orgMap
=
groupOrgs
.
stream
().
filter
(
org
->
org
.
getOrgId
().
equals
(
hgsb001
.
getGroupCode
())).
collect
(
Collectors
.
toMap
(
Org:
:
getOrgId
,
org
->
org
));
hgsb001
.
fromMap
(
resultRows
.
get
(
i
));
if
(!
orgMap
.
isEmpty
()){
hgsb001
.
setFactoryCode
(
orgMap
.
get
(
hgsb001
.
getGroupCode
()).
getFactoryCode
());
}
if
(
hgsb001
.
getId
()
==
null
||
hgsb001
.
getId
()
==
0
)
{
if
(
hgsb001
.
getId
()
==
null
||
hgsb001
.
getId
()
==
0
)
{
this
.
add
(
hgsb001
);
this
.
add
(
hgsb001
);
}
else
{
}
else
{
...
...
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB001.xml
View file @
e1ff59ba
...
@@ -179,6 +179,9 @@
...
@@ -179,6 +179,9 @@
<isNotEmpty
prepend=
" AND "
property=
"address"
>
<isNotEmpty
prepend=
" AND "
property=
"address"
>
ADDRESS = #address#
ADDRESS = #address#
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"deviceCodes"
>
DEVICE_CODE IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"deviceCodes"
>
#deviceCodes[]#
</iterate>
</isNotEmpty>
</sql>
</sql>
<select
id=
"query"
parameterClass=
"java.util.HashMap"
<select
id=
"query"
parameterClass=
"java.util.HashMap"
...
...
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