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
98137787
Commit
98137787
authored
Aug 30, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.德诚开放接口开发
parent
d19747a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
11 deletions
+26
-11
DcOpenApi.java
.../com/baosight/hggp/core/extapp/decheng/api/DcOpenApi.java
+4
-3
DcApiUtils.java
...m/baosight/hggp/core/extapp/decheng/utils/DcApiUtils.java
+6
-7
ServiceHGWD003.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD003.java
+2
-1
HGWD003.js
src/main/webapp/HG/WD/HGWD003.js
+14
-0
No files found.
src/main/java/com/baosight/hggp/core/extapp/decheng/api/DcOpenApi.java
View file @
98137787
...
@@ -124,19 +124,20 @@ public class DcOpenApi {
...
@@ -124,19 +124,20 @@ public class DcOpenApi {
* @return
* @return
* @throws IOException
* @throws IOException
*/
*/
public
static
List
<
DcContractList
>
interactionAdd
(
String
title
,
String
content
,
String
ords
)
throws
IOException
{
public
static
void
interactionAdd
(
String
title
,
String
content
,
String
ords
)
throws
IOException
{
JSONArray
dataJsons
=
new
JSONArray
();
JSONArray
dataJsons
=
new
JSONArray
();
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"title"
,
title
));
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"title"
,
title
));
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"sort2"
,
451
));
// 451:默认分类
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"sort2"
,
451
));
// 451:默认分类
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"intro"
,
content
));
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"intro"
,
content
));
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"member"
,
1
));
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"member"
,
1
));
// 0:全部,1: 不分,-1:私密
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"share"
,
ords
));
dataJsons
.
add
(
DcApiUtils
.
buildValueJson
(
"share"
,
ords
));
String
param
=
JSON
.
toJSONString
(
DcApiUtils
.
buildParamJson
(
dataJsons
,
"__sys_dosave"
));
String
param
=
JSON
.
toJSONString
(
DcApiUtils
.
buildParamJson
(
dataJsons
,
"__sys_dosave"
));
String
result
=
HttpUtils
.
post
(
DeChengConst
.
INTERACTION_ADD
,
param
,
HttpUtils
.
JSON_MEDIA_TYPE
);
String
result
=
HttpUtils
.
post
(
DeChengConst
.
INTERACTION_ADD
,
param
,
HttpUtils
.
JSON_MEDIA_TYPE
);
if
(
StringUtils
.
isBlank
(
result
))
{
if
(
StringUtils
.
isBlank
(
result
))
{
throw
new
PlatException
(
"【德诚】添加工作互动失败"
);
throw
new
PlatException
(
"【德诚】添加工作互动失败"
);
}
}
return
DcApiUtils
.
handleResult
(
result
,
DcContractList
.
class
);
// 异常处理
DcApiUtils
.
handleMessage
(
JSONObject
.
parseObject
(
result
));
}
}
}
}
src/main/java/com/baosight/hggp/core/extapp/decheng/utils/DcApiUtils.java
View file @
98137787
...
@@ -143,8 +143,6 @@ public class DcApiUtils {
...
@@ -143,8 +143,6 @@ public class DcApiUtils {
String
msg
=
resultJson
.
getString
(
"Msg"
);
String
msg
=
resultJson
.
getString
(
"Msg"
);
if
(
DeChengConst
.
ApiStatus
.
S400
.
equals
(
code
))
{
if
(
DeChengConst
.
ApiStatus
.
S400
.
equals
(
code
))
{
DcTokenApi
.
refreshToken
();
DcTokenApi
.
refreshToken
();
}
else
if
(
DeChengConst
.
ApiStatus
.
S2
.
equals
(
code
))
{
DcTokenApi
.
refreshToken
();
}
}
throw
new
PlatException
(
"【智邦】"
+
msg
);
throw
new
PlatException
(
"【智邦】"
+
msg
);
}
}
...
@@ -209,14 +207,15 @@ public class DcApiUtils {
...
@@ -209,14 +207,15 @@ public class DcApiUtils {
public
static
void
handleMessage
(
JSONObject
resultJson
)
{
public
static
void
handleMessage
(
JSONObject
resultJson
)
{
JSONObject
headerJson
=
resultJson
.
getJSONObject
(
"header"
);
JSONObject
headerJson
=
resultJson
.
getJSONObject
(
"header"
);
String
message
=
headerJson
.
getString
(
"message"
);
String
message
=
headerJson
.
getString
(
"message"
);
String
status
=
headerJson
.
getString
(
"status"
);
Integer
status
=
headerJson
.
getInteger
(
"status"
);
// 会话非法
if
(
status
!=
null
&&
status
==
0
)
{
return
;
}
// 会话超时
if
(
DeChengConst
.
ApiStatus
.
S400
.
equals
(
status
))
{
if
(
DeChengConst
.
ApiStatus
.
S400
.
equals
(
status
))
{
DcTokenApi
.
refreshToken
();
DcTokenApi
.
refreshToken
();
}
else
if
(
DeChengConst
.
ApiStatus
.
S2
.
equals
(
status
))
{
DcTokenApi
.
refreshToken
();
throw
new
PlatException
(
"【智邦】"
+
message
);
}
}
throw
new
PlatException
(
"【智邦】"
+
message
);
}
}
/**
/**
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD003.java
View file @
98137787
...
@@ -105,7 +105,8 @@ public class ServiceHGWD003 extends ServiceEPBase {
...
@@ -105,7 +105,8 @@ public class ServiceHGWD003 extends ServiceEPBase {
return
results
;
return
results
;
}
}
for
(
HGSC001
dbSc001
:
dbSc001s
)
{
for
(
HGSC001
dbSc001
:
dbSc001s
)
{
results
.
add
(
buildLeaf
(
parentLabel
,
dbSc001
.
getProjCode
(),
dbSc001
.
getProjName
(),
HgWdConstant
.
LeafType
.
P
));
String
text
=
"["
+
dbSc001
.
getProjCode
()
+
"]"
+
dbSc001
.
getProjName
();
results
.
add
(
buildLeaf
(
parentLabel
,
dbSc001
.
getProjCode
(),
text
,
HgWdConstant
.
LeafType
.
P
));
}
}
// 设置叶子节点
// 设置叶子节点
setTreeNodeLeaf
(
results
);
setTreeNodeLeaf
(
results
);
...
...
src/main/webapp/HG/WD/HGWD003.js
View file @
98137787
...
@@ -21,6 +21,20 @@ $(function () {
...
@@ -21,6 +21,20 @@ $(function () {
// 显示授权按钮
// 显示授权按钮
showAuthButton
();
showAuthButton
();
},
},
template
:
function
(
node
)
{
var
item
=
node
.
item
;
let
icon
=
'fa fa-globe'
switch
(
item
.
leafType
)
{
case
'P'
:
icon
=
'fa fa-clipboard'
break
;
case
'C'
:
icon
=
'fa fa-folder'
break
;
}
return
'<span class="'
+
icon
+
'" style="padding-right: 8px"> </span>'
+
'<span class="titleClass" title="'
+
item
.
label
+
'">'
+
item
.
text
+
'</span>'
},
selectNode
:
{
selectNode
:
{
treeId
:
''
,
treeId
:
''
,
leaf
:
false
,
leaf
:
false
,
...
...
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