Commit 98137787 by 宋祥

1.德诚开放接口开发

parent d19747a2
...@@ -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));
} }
} }
...@@ -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);
} }
/** /**
......
...@@ -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);
......
...@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment