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
012ab4fd
Commit
012ab4fd
authored
Nov 13, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整同步设备日志接口
parent
0497ddfd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
SbOpenApi.java
.../com/baosight/hggp/core/extapp/decheng/api/SbOpenApi.java
+6
-1
ServiceHGSB010.java
.../java/com/baosight/hggp/hg/sb/service/ServiceHGSB010.java
+15
-2
HGSB010.xml
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB010.xml
+8
-0
No files found.
src/main/java/com/baosight/hggp/core/extapp/decheng/api/SbOpenApi.java
View file @
012ab4fd
...
@@ -3,9 +3,12 @@ package com.baosight.hggp.core.extapp.decheng.api;
...
@@ -3,9 +3,12 @@ package com.baosight.hggp.core.extapp.decheng.api;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baosight.hggp.hg.sb.domain.HGSB010
;
import
com.baosight.hggp.util.HttpUtils
;
import
com.baosight.hggp.util.HttpUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.hggp.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
...
@@ -32,10 +35,12 @@ public class SbOpenApi {
...
@@ -32,10 +35,12 @@ public class SbOpenApi {
*/
*/
public
static
JSONArray
list
(
EiInfo
eiInfo
)
throws
IOException
,
InstantiationException
,
public
static
JSONArray
list
(
EiInfo
eiInfo
)
throws
IOException
,
InstantiationException
,
IllegalAccessException
{
IllegalAccessException
{
EiInfo
eiInfo1
=
new
EiInfo
();
eiInfo1
.
set
(
HGSB010
.
FIELD_CREATED_TIME
,
eiInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB010
.
FIELD_CREATED_TIME
));
Map
headerMap
=
new
HashMap
();
Map
headerMap
=
new
HashMap
();
headerMap
.
put
(
"x-token"
,
SbTokenApi
.
getToken
());
headerMap
.
put
(
"x-token"
,
SbTokenApi
.
getToken
());
String
url
=
PlatApplicationContext
.
getProperty
(
"hpjx.url"
);
String
url
=
PlatApplicationContext
.
getProperty
(
"hpjx.url"
);
String
result
=
HttpUtils
.
post
(
url
+
"/S_HP_SB_01"
,
headerMap
,
JSON
.
toJSONString
(
eiInfo
),
String
result
=
HttpUtils
.
post
(
url
+
"/S_HP_SB_01"
,
headerMap
,
JSON
.
toJSONString
(
eiInfo
1
),
HttpUtils
.
JSON_MEDIA_TYPE
);
HttpUtils
.
JSON_MEDIA_TYPE
);
if
(
StringUtils
.
isBlank
(
result
))
{
if
(
StringUtils
.
isBlank
(
result
))
{
throw
new
PlatException
(
"【鸿鹏】获取设备日志列表失败"
);
throw
new
PlatException
(
"【鸿鹏】获取设备日志列表失败"
);
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB010.java
View file @
012ab4fd
...
@@ -14,9 +14,11 @@ import com.baosight.hggp.util.DateUtils;
...
@@ -14,9 +14,11 @@ import com.baosight.hggp.util.DateUtils;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
org.apache.commons.collections4.CollectionUtils
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.*
;
...
@@ -176,10 +178,20 @@ public class ServiceHGSB010 extends ServiceEPBase {
...
@@ -176,10 +178,20 @@ public class ServiceHGSB010 extends ServiceEPBase {
public
EiInfo
add
(
EiInfo
inInfo
){
public
EiInfo
add
(
EiInfo
inInfo
){
try
{
try
{
Map
paramMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
Map
<
String
,
String
>
paramMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
accountCode
=
MapUtils
.
getString
(
paramMap
,
HGPZ009
.
FIELD_ACCOUNT_CODE
);
String
accountCode
=
MapUtils
.
getString
(
paramMap
,
HGPZ009
.
FIELD_ACCOUNT_CODE
);
List
<
Map
>
mapList
=
dao
.
query
(
"HGSB010.queryMax"
,
paramMap
);
if
(
CollectionUtils
.
isEmpty
(
mapList
)){
String
year
=
DateUtils
.
shortDate
().
substring
(
0
,
4
);
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB010
.
FIELD_CREATED_TIME
,
year
+
"0101000000"
);
}
else
{
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB010
.
FIELD_CREATED_TIME
,
mapList
.
get
(
0
).
get
(
HGSB010
.
FIELD_CREATED_TIME
));
}
JSONArray
jsonArray
=
SbOpenApi
.
list
(
inInfo
);
JSONArray
jsonArray
=
SbOpenApi
.
list
(
inInfo
);
User
user
=
HGXSTools
.
XsUser
.
getByLogin
(
paramMap
.
get
(
User
.
FIELD_LOGIN_NAME
).
toString
());
User
user
=
null
;
if
(
paramMap
.
containsKey
(
User
.
FIELD_LOGIN_NAME
)){
user
=
HGXSTools
.
XsUser
.
getByLogin
(
paramMap
.
get
(
User
.
FIELD_LOGIN_NAME
));
}
List
<
Map
>
list
=
jsonArray
.
stream
().
map
(
o
->
(
Map
)
o
).
collect
(
Collectors
.
toList
());
List
<
Map
>
list
=
jsonArray
.
stream
().
map
(
o
->
(
Map
)
o
).
collect
(
Collectors
.
toList
());
for
(
Map
map:
list
)
{
for
(
Map
map:
list
)
{
HGSB010
hgsb010
=
new
HGSB010
();
HGSB010
hgsb010
=
new
HGSB010
();
...
@@ -187,6 +199,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
...
@@ -187,6 +199,7 @@ public class ServiceHGSB010 extends ServiceEPBase {
if
(
user
!=
null
){
if
(
user
!=
null
){
hgsb010
.
setCompanyCode
(
user
.
getAccountCode
());
hgsb010
.
setCompanyCode
(
user
.
getAccountCode
());
}
else
{
}
else
{
accountCode
=
accountCode
.
length
()
==
0
?
"Q24072514"
:
accountCode
;
hgsb010
.
setCompanyCode
(
accountCode
);
hgsb010
.
setCompanyCode
(
accountCode
);
}
}
dao
.
insert
(
HGSB010
.
INSERT
,
hgsb010
);
dao
.
insert
(
HGSB010
.
INSERT
,
hgsb010
);
...
...
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB010.xml
View file @
012ab4fd
...
@@ -482,4 +482,11 @@
...
@@ -482,4 +482,11 @@
) a
) a
order by a.DEVICE_CODE
order by a.DEVICE_CODE
</select>
</select>
<select
id=
"queryMax"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT
MAX(CREATED_TIME) as "createdTime"
FROM ${hggpSchema}.HGSB010 WHERE 1=1 AND DELETE_FLAG = 0
<include
refid=
"condition"
/>
</select>
</sqlMap>
</sqlMap>
\ No newline at end of file
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