提交 6da89b42 authored 作者: 000516's avatar 000516

修改t100环境编码

...@@ -181,9 +181,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{ ...@@ -181,9 +181,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{
private void createOrUpdateDept(JSONObject deptT100){ private void createOrUpdateDept(JSONObject deptT100){
JSONObject service = new JSONObject(); JSONObject service = new JSONObject();
service.put("name","department.create"); service.put("name","department.create");
JSONObject datakey = new JSONObject();
datakey.put("CompanyId","BJHQ");
datakey.put("EntId","80");
JSONObject host = new JSONObject(); JSONObject host = new JSONObject();
host.put("acct","tiptop"); host.put("acct","tiptop");
host.put("ip","192.168.100.20"); host.put("ip","192.168.100.20");
...@@ -194,7 +191,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{ ...@@ -194,7 +191,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{
payload.putObject("std_data").putObject("parameter").putArray("master_data").add(deptT100); payload.putObject("std_data").putObject("parameter").putArray("master_data").add(deptT100);
JSONObject deptJson = new JSONObject(); JSONObject deptJson = new JSONObject();
deptJson.put("service",service); deptJson.put("service",service);
deptJson.put("datakey",datakey);
deptJson.put("host",host); deptJson.put("host",host);
deptJson.put("payload",payload); deptJson.put("payload",payload);
t100Util.createOrUpdateDept(deptJson); t100Util.createOrUpdateDept(deptJson);
...@@ -203,9 +199,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{ ...@@ -203,9 +199,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{
private void createOrUpdateUser(JSONObject userT100){ private void createOrUpdateUser(JSONObject userT100){
JSONObject service = new JSONObject(); JSONObject service = new JSONObject();
service.put("name","employee.create"); service.put("name","employee.create");
JSONObject datakey = new JSONObject();
datakey.put("CompanyId","BJHQ");
datakey.put("EntId","80");
JSONObject host = new JSONObject(); JSONObject host = new JSONObject();
host.put("acct","tiptop"); host.put("acct","tiptop");
host.put("ip","192.168.100.20"); host.put("ip","192.168.100.20");
...@@ -216,7 +209,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{ ...@@ -216,7 +209,6 @@ public class EventCallbackServiceImpl implements IEventCallbackService{
payload.putObject("std_data").putObject("parameter").putArray("master_data").add(userT100); payload.putObject("std_data").putObject("parameter").putArray("master_data").add(userT100);
JSONObject userJson = new JSONObject(); JSONObject userJson = new JSONObject();
userJson.put("service",service); userJson.put("service",service);
userJson.put("datakey",datakey);
userJson.put("host",host); userJson.put("host",host);
userJson.put("payload",payload); userJson.put("payload",payload);
t100Util.createOrUpdateUser(userJson); t100Util.createOrUpdateUser(userJson);
......
...@@ -20,13 +20,21 @@ public class T100Util { ...@@ -20,13 +20,21 @@ public class T100Util {
@Value("${t100.url}") @Value("${t100.url}")
private String url; private String url;
@Value("${t100.ent_id}")
private String entId;
public void createOrUpdateDept(JSONObject deptJson){ public void createOrUpdateDept(JSONObject deptJson){
JSONObject datakey = new JSONObject();
datakey.put("CompanyId","BJHQ");
datakey.put("EntId",entId);
deptJson.put("datakey",datakey);
HashMap<String,String> header = new HashMap<>(); HashMap<String,String> header = new HashMap<>();
header.put("Content-Type","application/json;charset=utf-8"); header.put("Content-Type","application/json;charset=utf-8");
header.put("digi-protocol","raw"); header.put("digi-protocol","raw");
header.put("digi-srvver","1.0"); header.put("digi-srvver","1.0");
header.put("digi-srvcode","000"); header.put("digi-srvcode","000");
header.put("digi-type","sync"); header.put("digi-type","syndd c");
header.put("digi-key","f63b06af224e90ea3f9f08e0226fc91e"); header.put("digi-key","f63b06af224e90ea3f9f08e0226fc91e");
log.info("T100-AU-DEPT参数:{}",deptJson); log.info("T100-AU-DEPT参数:{}",deptJson);
String body = HttpUtil.createPost(url).addHeaders(header).body(deptJson.toString()).execute().body(); String body = HttpUtil.createPost(url).addHeaders(header).body(deptJson.toString()).execute().body();
...@@ -35,6 +43,11 @@ public class T100Util { ...@@ -35,6 +43,11 @@ public class T100Util {
} }
public void createOrUpdateUser(JSONObject userJson) { public void createOrUpdateUser(JSONObject userJson) {
JSONObject datakey = new JSONObject();
datakey.put("CompanyId","BJHQ");
datakey.put("EntId",entId);
userJson.put("datakey",datakey);
HashMap<String,String> header = new HashMap<>(); HashMap<String,String> header = new HashMap<>();
header.put("Content-Type","application/json;charset=utf-8"); header.put("Content-Type","application/json;charset=utf-8");
header.put("digi-protocol","raw"); header.put("digi-protocol","raw");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论