This commit is contained in:
张光起 2025-03-28 09:42:10 +08:00
parent 8f682f4bea
commit 0642ad29a2
13 changed files with 572 additions and 53 deletions

View File

@ -3,13 +3,13 @@
"id" : "copy1724404999212d47014", "id" : "copy1724404999212d47014",
"script" : null, "script" : null,
"groupId" : "6ee06a9b9fe04b85b70a9364ef324ab4", "groupId" : "6ee06a9b9fe04b85b70a9364ef324ab4",
"name" : "保存设备BOM", "name" : "保存人员同步日志",
"createTime" : null, "createTime" : null,
"updateTime" : 1741679160582, "updateTime" : 1743054112942,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
"path" : "/savesbbom", "path" : "/saveuser",
"method" : "POST", "method" : "POST",
"parameters" : [ ], "parameters" : [ ],
"options" : [ { "options" : [ {
@ -47,4 +47,4 @@
} }
================================ ================================
data.create_time = new Date() data.create_time = new Date()
return db.table('send_log_sbbom').primary('log_id',uuid()).save(data) return db.table('send_log_user').primary('log_id',uuid()).save(data)

View File

@ -3,13 +3,13 @@
"id" : "copy1701349941295d22163", "id" : "copy1701349941295d22163",
"script" : null, "script" : null,
"groupId" : "4506c21162d24d4c81bad5bc8707672a", "groupId" : "4506c21162d24d4c81bad5bc8707672a",
"name" : "PLMBOM保存", "name" : "人员待同步保存",
"createTime" : null, "createTime" : null,
"updateTime" : 1740044319573, "updateTime" : 1743047168232,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
"path" : "/save", "path" : "/saveuser",
"method" : "POST", "method" : "POST",
"parameters" : [ ], "parameters" : [ ],
"options" : [ { "options" : [ {
@ -122,5 +122,5 @@
data.create_time = new Date() data.create_time = new Date()
return db.table("send_syn_plmbom").primary('send_id', () => uuid()) return db.table("send_syn_user").primary('send_id', () => uuid())
.save(data) .save(data)

View File

@ -3,13 +3,13 @@
"id" : "copy1701349998399d81042", "id" : "copy1701349998399d81042",
"script" : null, "script" : null,
"groupId" : "4506c21162d24d4c81bad5bc8707672a", "groupId" : "4506c21162d24d4c81bad5bc8707672a",
"name" : "修改", "name" : "修改人员同步",
"createTime" : null, "createTime" : null,
"updateTime" : 1740193090239, "updateTime" : 1743047188007,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
"path" : "/update", "path" : "/updateuser",
"method" : "POST", "method" : "POST",
"parameters" : [ ], "parameters" : [ ],
"options" : [ { "options" : [ {
@ -122,5 +122,5 @@
data.update_time = new Date() data.update_time = new Date()
return db.table("send_syn_plmbom").primary('send_id') return db.table("send_syn_user").primary('send_id')
.update(data) .update(data)

View File

@ -0,0 +1,173 @@
{
"properties" : { },
"id" : "copy1743047080239d23438",
"script" : null,
"groupId" : "4506c21162d24d4c81bad5bc8707672a",
"name" : "查询人员同步",
"createTime" : null,
"updateTime" : 1743047414999,
"lock" : null,
"createBy" : null,
"updateBy" : null,
"path" : "/queryuser",
"method" : "GET",
"parameters" : [ {
"name" : "sendType",
"value" : "user",
"description" : null,
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : null,
"error" : null,
"expression" : null,
"children" : null
}, {
"name" : "sendStatus3",
"value" : "3",
"description" : null,
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : null,
"error" : null,
"expression" : null,
"children" : null
}, {
"name" : "crmId",
"value" : "665532391d23d0000111cab9",
"description" : null,
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : null,
"error" : null,
"expression" : null,
"children" : null
}, {
"name" : "sendSyn",
"value" : "0",
"description" : null,
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : null,
"error" : null,
"expression" : null,
"children" : null
} ],
"options" : [ ],
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [],\n \"timestamp\": 1716889610473,\n \"executeTime\": 8\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "200",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "message",
"value" : "success",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "data",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Array",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1716889610473",
"description" : "",
"required" : false,
"dataType" : "Long",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "8",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
}
}
================================
//查询本机mysql
return db.select(
"""
SELECT * FROM `send_syn_user` where
send_type=#{sendType}
<if test="dataId != null">
and dsf_id=#{dataId}
</if>
<if test="datapId != null">
and dsfzhu_id=#{datapId}
</if>
<if test="sendSyn != null">
and send_syn=#{sendSyn}
</if>
<if test="sendStatus != null">
and send_status=#{sendStatus}
</if>
<if test="crmId != null">
and crm_id=#{crmId}
</if>
<if test="dsfId != null">
and dsf_id=#{dsfId}
</if>
<if test="sendStatus3 != null">
and send_status!=#{sendStatus3}
</if>
order by create_time desc
""");

View File

@ -0,0 +1,316 @@
package org.ssssssss.magicboot.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xxl.job.core.context.XxlJobHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.ssssssss.magicboot.fxapi.HttpClientResult;
import org.ssssssss.magicboot.fxapi.HttpClientUtils;
import org.ssssssss.magicboot.fxapi.XKTokenAccess;
import org.ssssssss.magicboot.zdyutils.FXHTTP;
import org.ssssssss.magicboot.zdyutils.FXTIC;
import org.ssssssss.magicboot.zdyutils.GcjJson;
import org.ssssssss.magicboot.zdyutils.MagicApi;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 人员同步
*/
@RestController
@RequestMapping("/User")
public class UsceController {
private final Logger log = LoggerFactory.getLogger(UsceController.class);
public static void main(String[] args) throws Exception {
new UsceController().getUserData();
new UsceController().saveSynUser();
}
@PostMapping("/getUserData")
public void getUserData() throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = sdf.format(System.currentTimeMillis() - (1000 * 60 * 62 * 24));
// time = "2024-05-01";
String sendUrl = "http://192.168.31.121:8022/ierp/kapi/v2/f9w5/base/bos_user/userQuery";
Map<String, String> headers = new HashMap<String, String>();
String token = "2095350818281620480_9IJI28EuhdoKjvDlKJfdpmQuw3GJS28reo9vbBaMkf1U3t3djnTvWv6D36PjAaQr4k9nmBf6KWvdReC78XbPCQvjADli8lA2reOR08";
headers.put("accessToken", token);//放token
JSONObject params = new JSONObject();
JSONObject datajson = new JSONObject();
datajson.put("createtime","2012-02-26 11:04:43");
JSONArray arr = new JSONArray();
String[] strings = {
"ZHY002.001.005.003",
"ZHY002.001.005.002"
};
// 将字符串添加到 JSONArray
for (String str : strings) {
arr.add(str);
}
datajson.put("dpt_number",arr);
params.put("data",datajson);
params.put("pageNo",1);
params.put("pageSize",1000);
HttpClientResult rtn = HttpClientUtils.doPostJson(sendUrl, headers, params.toJSONString());
String resStr = rtn.getContent();
JSONObject resjs = JSONObject.parseObject(resStr);
if (resjs!=null){
if("0".equals(resjs.getString("errorCode"))){//查询成功
JSONObject data = resjs.getJSONObject("data");
System.out.println("查询人员总数量" + data.getInteger("totalCount"));
JSONArray resJson = data.getJSONArray("rows");
System.out.println("待同步人员数量" + resJson.size());
for (int i = 0; i < resJson.size(); i++) {
JSONObject str = resJson.getJSONObject(i);
//ERPID
String dataId = GcjJson.getNodeValue(str, "JSON.id") != null ? GcjJson.getNodeValue(str, "JSON.id").toString() : "";
//ERP人员编码
String number = GcjJson.getNodeValue(str, "JSON.number") != null ? GcjJson.getNodeValue(str, "JSON.number").toString() : "";
String name = GcjJson.getNodeValue(str, "JSON.name") != null ? GcjJson.getNodeValue(str, "JSON.name").toString() : "";
String endtime = GcjJson.getNodeValue(str, "JSON.modifytime") != null ? GcjJson.getNodeValue(str, "JSON.modifytime").toString() : "";
String syn_type = "0";//同步类型 0新增 1修改 2删除
log.info("-------------------开始执行人员" + i + " -------------------" + number);
XxlJobHelper.log("-------------------开始执行人员" + i + " -------------------" + number);
Boolean sendFlag = false;
StringBuffer stringBuffer = new StringBuffer();
try {
boolean tbflag = false;
//验证数据是否已存在
JSONObject dataSyn = MagicApi.getSendSYNUser("user", syn_type, dataId);
if (dataSyn != null && endtime.equals(dataSyn.getString("mark"))) {
log.info("数据已存在-" + name);
XxlJobHelper.log("--数据已存在---" + name);
tbflag = true;
}
if (tbflag) {
continue;
}
log.info("人员待同步数据-" + i + " ------" + name);
JSONObject jsonObjectData = new JSONObject();
jsonObjectData.put("send_type", "user"); //业务类型
jsonObjectData.put("send_syn", syn_type); //同步类型 0新增 1修改 2删除
jsonObjectData.put("dsf_id", dataId);//数据id
jsonObjectData.put("dsfzhu_id", dataId);//数据id
jsonObjectData.put("send_status", 3);//同步状态 true同步成功 false同步失败 3待同步
jsonObjectData.put("dsf_code", name);//数据名称
jsonObjectData.put("mark", endtime);//标识
jsonObjectData.put("dsf_json", str.toJSONString());//标识
MagicApi.saveSendSYNUser(jsonObjectData);
} catch (Exception e) {
continue;
}
}
}
}
}
//@PostMapping("/getSynProduct")
public void saveSynUser() throws Exception {
FXHTTP fxapi = new FXHTTP();
String resJsonStr = MagicApi.getWNRES("http://127.0.0.1:18088/syn/queryuser?sendType=user&sendStatus=3", "");
JSONObject resJson = JSON.parseObject(resJsonStr);
if (resJson != null) {
log.info("待同步人员数" + resJson.getJSONArray("data").size());
for (int i = 0; i < resJson.getJSONArray("data").size(); i++) {
XKTokenAccess xktonken = new XKTokenAccess();
JSONObject getData = resJson.getJSONArray("data").getJSONObject(i);
JSONObject str = getData.getJSONObject("dsfJson");
String syn_type = "0";//同步类型 0新增 1修改 2删除
Boolean sendFlag = false;
StringBuffer stringBuffer = new StringBuffer();
boolean tbflag = false;
// 构建json
JSONObject obj = new JSONObject();
LinkedHashMap map = new LinkedHashMap<String, Object>();
Boolean flag = true;
//ID
String dataId = GcjJson.getNodeValue(str, "JSON.id") != null ? GcjJson.getNodeValue(str, "JSON.id").toString() : "";
//编码
String number = GcjJson.getNodeValue(str, "JSON.number") != null ? GcjJson.getNodeValue(str, "JSON.number").toString() : "";
String name = GcjJson.getNodeValue(str, "JSON.name") != null ? GcjJson.getNodeValue(str, "JSON.name").toString() : "";
//最后修改时间
String endtime = GcjJson.getNodeValue(str, "JSON.modifytime") != null ? GcjJson.getNodeValue(str, "JSON.modifytime").toString() : "";
//性别
String gender = GcjJson.getNodeValue(str, "JSON.gender") != null ? GcjJson.getNodeValue(str, "JSON.gender").toString() : "";
String email = GcjJson.getNodeValue(str, "JSON.email") != null ? GcjJson.getNodeValue(str, "JSON.email").toString() : "";
String phone = GcjJson.getNodeValue(str, "JSON.phone") != null ? GcjJson.getNodeValue(str, "JSON.phone").toString() : "";
//状态
String enable = GcjJson.getNodeValue(str, "JSON.enable") != null ? GcjJson.getNodeValue(str, "JSON.enable").toString() : "";
JSONArray entryentity = str.getJSONArray("entryentity");
String deptNumber = "";
if(entryentity!=null){
JSONObject deptobj = (JSONObject) entryentity.get(0);
deptNumber = deptobj.getString("dpt_number");
}
try{
JSONObject dataSyn = MagicApi.getSendSYNDataUser("user", syn_type, dataId,"3");
if (dataSyn != null && dataId.equals(dataSyn.getString("dsfId")) && endtime.equals(dataSyn.getString("mark")) ) {
log.info("数据已存在-" + name);
XxlJobHelper.log("--数据已存在---" + name);
tbflag = true;
}
if (tbflag) {
continue;
}
//查询人员CRMID
String crmId = fxapi.getDataBYID("PersonnelObj", "field_T1xid__c", number, "JSON.data.dataList[0]._id");
if (crmId != null && !crmId.equals("")) {
//人员id
map.put("body.data.object_data._id", crmId);
flag=false;
}
String crmdeptID = "999999";
if (deptNumber!=""){
crmdeptID = fxapi.getDataBYID("DepartmentObj", "field_Vj6sf__c", deptNumber, "JSON.data.dataList[0]._id");
System.out.println(crmdeptID);
}
map.put("body.data.object_data.phone", phone);
map.put("body.data.object_data.name", name);
map.put("body.data.object_data.full_name", name);
map.put("body.data.object_data.erp_id__c", dataId);//ID
map.put("body.data.object_data.field_T1xid__c", number);//编码
map.put("body.data.object_data.user_name", phone);
map.put("body.data.object_data.email", email);
if(enable.equals("2")){
map.put("body.data.object_data.status", "1");
map.put("body.data.object_data.is_pause_login", true);
}else {
map.put("body.data.object_data.status", "0");
map.put("body.data.object_data.is_pause_login", false);
}
if(gender.equals("1")){
map.put("body.data.object_data.sex", "M");
}if(gender.equals("2")){
map.put("body.data.object_data.sex", "F");
}else {
map.put("body.data.object_data.sex", "P");
}
map.put("body.data.object_data.main_department[0]", crmdeptID);//主属部门
map.put("body.data.object_data.dataObjectApiName", "PersonnelObj");
map.put("body.corpId", FXTIC.CORPID);
map.put("body.corpAccessToken", xktonken.getCorpAccessToken().getCorpAccessToken());
map.put("body.currentOpenUserId", FXTIC.CURRENTOPENUSERID);
for (Object key : map.keySet()) {
GcjJson.setNodeValue(obj, key.toString(), map.get(key));
}
log.info("--请求json---" + obj);
XxlJobHelper.log("--请求json---" + obj);
}catch (Exception e) {
sendFlag = true;
stringBuffer.append("参数解析错误,请联系开发人员");
e.printStackTrace();
}
getSynDataSave(stringBuffer,sendFlag,flag,fxapi,dataId,name,obj,getData);
}
}
}
/**
* 写数据
*/
public void getSynDataSave(StringBuffer stringBuffer,Boolean sendFlag,Boolean flag,FXHTTP fxapi,String dataId,String nameData,JSONObject obj,JSONObject str) {
String syn_type = "0";//同步类型 0新增 1修改 2删除
String res_url = "";
String res_param = "";
String res = "";
try {
if (flag) {
res = fxapi.saveV2Obj(obj);
res_url=FXTIC.URL_FX_CREATE;
} else {
syn_type = "1";
res = fxapi.updateV2Obj(obj);
res_url=FXTIC.URL_FX_UPDATE;
}
res_param=obj.toJSONString();
log.info("返回值:"+res);
JSONObject resjs = JSON.parseObject(res);
if (resjs != null && "0".equals(resjs.getString("errorCode"))) {
} else {
sendFlag = true;
stringBuffer.append(resjs.getString("errorMessage") + "");
}
} catch (Exception e) {
sendFlag = true;
stringBuffer.append("纷享销客接口调用失败,请检查网络配置");
}
JSONObject sendData = new JSONObject();
sendData.put("send_status", !sendFlag);//同步状态 true同步成功 false同步失败 3待同步
sendData.put("crm_code", nameData);//数据名称
sendData.put("send_id", str.getString("sendId")); //send_id
MagicApi.updateSendSYUPDATENUser(sendData);
JSONObject logData = new JSONObject();
logData.put("log_type", "user"); //业务类型
logData.put("log_status", !sendFlag);//同步状态 true同步成功 false同步失败 3待同步
logData.put("syn_type", syn_type);//同步类型 0新增 1修改 2删除
logData.put("data_id", dataId);//数据id
logData.put("data_name", nameData);//数据名称
logData.put("res_body", "同步成功");//返回值
logData.put("res_url", res_url);//
logData.put("res_param", res_param);//
logData.put("res_res", res);//
if (sendFlag) {
logData.put("res_body", stringBuffer.toString());//返回值
}
//写入传输日志
MagicApi.saveUserLog(logData);
}
}

View File

@ -59,7 +59,37 @@ public class HttpClientUtils {
public static HttpClientResult doGet(String url, Map<String, String> params) throws Exception { public static HttpClientResult doGet(String url, Map<String, String> params) throws Exception {
return doGet(url, null, params); return doGet(url, null, params);
} }
public static HttpClientResult doPostJsonfromdata(String url, Map<String, String> headers,List<NameValuePair> params) throws Exception {
// 创建httpClient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
// 创建http对象
HttpPost httpPost = new HttpPost(url);
/**
* setConnectTimeout设置连接超时时间单位毫秒
* setConnectionRequestTimeout设置从connect Manager(连接池)获取Connection
* 超时时间单位毫秒这个属性是新加的属性因为目前版本是可以共享连接池的
* setSocketTimeout请求获取数据的超时时间(即响应时间)单位毫秒 如果访问一个接口多少时间内无法返回数据就直接放弃此次调用
*/
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(CONNECT_TIMEOUT).setSocketTimeout(SOCKET_TIMEOUT).build();
httpPost.setConfig(requestConfig);
//封装请求头
packageHeader(headers, httpPost);
httpPost.setEntity(new UrlEncodedFormEntity(params));
// 创建httpResponse对象
CloseableHttpResponse httpResponse = null;
try {
// 执行请求并获得响应结果
return getHttpClientResult(httpResponse, httpClient, httpPost);
} finally {
// 释放资源
release(httpResponse, httpClient);
}
}
/** /**
* 发送get请求带请求头和请求参数 * 发送get请求带请求头和请求参数
* *

View File

@ -28,9 +28,9 @@ public class XKTokenAccess {
private static final String APP_ACCESS_TOKEN_KEY_PREX = "appAccessToken_"; private static final String APP_ACCESS_TOKEN_KEY_PREX = "appAccessToken_";
private static final String CORP_ACCESS_TOKEN_KEY_PREX = "corpAccessToken_"; private static final String CORP_ACCESS_TOKEN_KEY_PREX = "corpAccessToken_";
private static final String appId = "FSAID_131ee7a"; private static final String appId = "FSAID_131f56a";
private static final String appSecret= "b9d85f718d46460aaf5c45b0afa27792"; private static final String appSecret= "5bda722932a54e80a05d2cc9b1722fed";
private static final String permanentCode= "334912202A8400E338E6A7BD8C45C219"; private static final String permanentCode= "1A49B50861909007935CAB5E33E52BAA";
private static final String prefix = "https://open.fxiaoke.com"; private static final String prefix = "https://open.fxiaoke.com";

View File

@ -14,8 +14,8 @@ public class FXTIC {
//解锁 //解锁
public static String URL_FX_UNLOCK="https://open.fxiaoke.com/cgi/crm/v2/object/unlock"; public static String URL_FX_UNLOCK="https://open.fxiaoke.com/cgi/crm/v2/object/unlock";
public static String CURRENTOPENUSERID="FSUID_0097DB273ACDA67353E1C0BAB997D8AC"; public static String CURRENTOPENUSERID="FSUID_A9AD0C360309427B3F431487883B73B9";
public static String CORPID="FSCID_79069F6B50BC5CCF704283C5DEFD5670"; public static String CORPID="FSCID_11F505C980B5FE43D5D7230567802E09";
public static String URL_DESCRIBE="https://open.fxiaoke.com/cgi/crm/v2/object/describe"; public static String URL_DESCRIBE="https://open.fxiaoke.com/cgi/crm/v2/object/describe";

View File

@ -22,7 +22,7 @@ public class MagicApi {
public static void saveApiDataLog(JSONObject data) { public static void saveApiDataLog(JSONObject data) {
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/SYNCLOG/STOCK/SAVE" "http://127.0.0.1:18088/SYNCLOG/STOCK/SAVE"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -32,17 +32,17 @@ public class MagicApi {
System.out.println(data); System.out.println(data);
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/send/log/save" "http://127.0.0.1:18088/send/log/save"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static void saveDataLogSbbom(JSONObject data) { public static void saveUserLog(JSONObject data) {
System.out.println(data); System.out.println(data);
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/send/log/savesbbom" "http://127.0.0.1:18088/send/log/saveuser"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -52,7 +52,7 @@ public class MagicApi {
//System.out.println(data.toJSONString()); //System.out.println(data.toJSONString());
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/cpfx/save" "http://127.0.0.1:18088/cpfx/save"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -72,7 +72,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/ZHRY/V_CRM_PSNDOC?NAME=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/ZHRY/V_CRM_PSNDOC?NAME=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].PK_PSNDOC"); , "JSON.data[0].PK_PSNDOC");
} catch (Exception e) { } catch (Exception e) {
@ -84,7 +84,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/ZHRY/V_CRM_ORG?PK_ORG=" + name "http://127.0.0.1:18088/NCC/ZHRY/V_CRM_ORG?PK_ORG=" + name
, "JSON.data[0].ORG_CODE"); , "JSON.data[0].ORG_CODE");
} catch (Exception e) { } catch (Exception e) {
@ -98,7 +98,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/SYNCLOG/GELOGDATA" + "http://127.0.0.1:18088/SYNCLOG/GELOGDATA" +
"?stock_code=" + URLEncoder.encode(stock_code, "UTF-8") + "?stock_code=" + URLEncoder.encode(stock_code, "UTF-8") +
"&pro_code=" + URLEncoder.encode(pro_code, "UTF-8")+ "&pro_code=" + URLEncoder.encode(pro_code, "UTF-8")+
"&batch=" + URLEncoder.encode(batch, "UTF-8")+ "&batch=" + URLEncoder.encode(batch, "UTF-8")+
@ -119,7 +119,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/SYNCLOG/GELOGDATA?type=" + URLEncoder.encode(type, "UTF-8") + "&dataId=" + URLEncoder.encode(dataId, "UTF-8") "http://127.0.0.1:18088/SYNCLOG/GELOGDATA?type=" + URLEncoder.encode(type, "UTF-8") + "&dataId=" + URLEncoder.encode(dataId, "UTF-8")
, ""); , "");
JSONObject resJson = JSONObject.parseObject(res); JSONObject resJson = JSONObject.parseObject(res);
@ -135,7 +135,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/KH/V_CRM_CUSTOMER?DATAID=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/KH/V_CRM_CUSTOMER?DATAID=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].CODE"); , "JSON.data[0].CODE");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -147,7 +147,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/WL/V_CRM_TAXCODE?NAME=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/WL/V_CRM_TAXCODE?NAME=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].PK_TAXCODE"); , "JSON.data[0].PK_TAXCODE");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -159,7 +159,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002"+table+"?TS=" + URLEncoder.encode(TS, "UTF-8") "http://127.0.0.1:18088"+table+"?TS=" + URLEncoder.encode(TS, "UTF-8")
, null); , null);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -171,7 +171,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002"+table+"?TS=" + URLEncoder.encode(TS, "UTF-8") + "&GT="+ URLEncoder.encode(GT, "UTF-8") "http://127.0.0.1:18088"+table+"?TS=" + URLEncoder.encode(TS, "UTF-8") + "&GT="+ URLEncoder.encode(GT, "UTF-8")
, null); , null);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -183,7 +183,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002"+table "http://127.0.0.1:18088"+table
, jsonPath); , jsonPath);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -194,7 +194,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002"+table+"?NAME=" + URLEncoder.encode(TS, "UTF-8") "http://127.0.0.1:18088"+table+"?NAME=" + URLEncoder.encode(TS, "UTF-8")
, null); , null);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -207,7 +207,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/KH/V_CRM_CUSTCLASS?NAME=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/KH/V_CRM_CUSTCLASS?NAME=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].PK_CUSTCLASS"); , "JSON.data[0].PK_CUSTCLASS");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -219,7 +219,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/KH/V_CRM_COUNTRYZONE?NAME=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/KH/V_CRM_COUNTRYZONE?NAME=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].PK_COUNTRY"); , "JSON.data[0].PK_COUNTRY");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -231,7 +231,7 @@ public class MagicApi {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/KH/V_CRM_REGION?NAME=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/KH/V_CRM_REGION?NAME=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].PK_REGION"); , "JSON.data[0].PK_REGION");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -243,7 +243,7 @@ public class MagicApi {
public static String bibie(String name) { public static String bibie(String name) {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/KH/V_CRM_CURRTYPE?NAME=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/KH/V_CRM_CURRTYPE?NAME=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].PK_CURRTYPE"); , "JSON.data[0].PK_CURRTYPE");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -254,7 +254,7 @@ public class MagicApi {
public static String khyh(String name) { public static String khyh(String name) {
try { try {
return HttpSend.sendMagicGet( return HttpSend.sendMagicGet(
"http://127.0.0.1:3002/NCC/KH/V_CRM_BANKDOC?PKBANKDOC=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/NCC/KH/V_CRM_BANKDOC?PKBANKDOC=" + URLEncoder.encode(name, "UTF-8")
, "JSON.data[0].PK_BANKTYPE"); , "JSON.data[0].PK_BANKTYPE");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -267,17 +267,17 @@ public class MagicApi {
System.out.println(data.toJSONString()); System.out.println(data.toJSONString());
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/syn/save" "http://127.0.0.1:18088/syn/save"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static void saveSendSYNDataSBBom(JSONObject data) { public static void saveSendSYNUser(JSONObject data) {
System.out.println(data.toJSONString()); System.out.println(data.toJSONString());
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/syn/savesbbom" "http://127.0.0.1:18088/syn/saveuser"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -287,17 +287,17 @@ public class MagicApi {
System.out.println(data.toJSONString()); System.out.println(data.toJSONString());
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/syn/update" "http://127.0.0.1:18088/syn/update"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static void updateSendSYUPDATENDataSbBom(JSONObject data) { public static void updateSendSYUPDATENUser(JSONObject data) {
System.out.println(data.toJSONString()); System.out.println(data.toJSONString());
try { try {
String res = HttpSend.sendMagicPost( String res = HttpSend.sendMagicPost(
"http://127.0.0.1:3002/syn/updatesbbom" "http://127.0.0.1:18088/syn/updateuser"
, data); , data);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -307,7 +307,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8") "http://127.0.0.1:18088/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8")
+ "&crmId=" + URLEncoder.encode(dataId, "UTF-8") + "&crmId=" + URLEncoder.encode(dataId, "UTF-8")
+ "&sendSyn=" + URLEncoder.encode(syn, "UTF-8") + "&sendSyn=" + URLEncoder.encode(syn, "UTF-8")
, ""); , "");
@ -326,7 +326,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/querysbbom?sendType=" + URLEncoder.encode(type, "UTF-8") "http://127.0.0.1:18088/syn/querysbbom?sendType=" + URLEncoder.encode(type, "UTF-8")
+ "&crmId=" + URLEncoder.encode(dataId, "UTF-8") + "&crmId=" + URLEncoder.encode(dataId, "UTF-8")
+ "&sendSyn=" + URLEncoder.encode(syn, "UTF-8") + "&sendSyn=" + URLEncoder.encode(syn, "UTF-8")
, ""); , "");
@ -346,7 +346,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8") "http://127.0.0.1:18088/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8")
+ "&crmId=" + URLEncoder.encode(dataId, "UTF-8") + "&crmId=" + URLEncoder.encode(dataId, "UTF-8")
+ "&sendSyn=" + URLEncoder.encode(syn, "UTF-8") + "&sendSyn=" + URLEncoder.encode(syn, "UTF-8")
+ "&sendStatus3="+sendStatus3 + "&sendStatus3="+sendStatus3
@ -365,7 +365,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8") "http://127.0.0.1:18088/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8")
+ "&dsfId=" + URLEncoder.encode(dataId, "UTF-8") + "&dsfId=" + URLEncoder.encode(dataId, "UTF-8")
+ "&sendSyn=" + URLEncoder.encode(syn, "UTF-8") + "&sendSyn=" + URLEncoder.encode(syn, "UTF-8")
, ""); , "");
@ -379,11 +379,11 @@ public class MagicApi {
} }
return null; return null;
} }
public static JSONObject getSendSYNDataDSF2(String type, String syn, String dataId) { public static JSONObject getSendSYNUser(String type, String syn, String dataId) {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/query2?sendType=" + URLEncoder.encode(type, "UTF-8") "http://127.0.0.1:18088/syn/queryuser?sendType=" + URLEncoder.encode(type, "UTF-8")
+ "&dsfId=" + URLEncoder.encode(dataId, "UTF-8") + "&dsfId=" + URLEncoder.encode(dataId, "UTF-8")
+ "&sendSyn=" + URLEncoder.encode(syn, "UTF-8") + "&sendSyn=" + URLEncoder.encode(syn, "UTF-8")
, ""); , "");
@ -401,7 +401,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/queryunit?name=" + URLEncoder.encode(name, "UTF-8") "http://127.0.0.1:18088/syn/queryunit?name=" + URLEncoder.encode(name, "UTF-8")
, ""); , "");
JSONObject resJson = JSONObject.parseObject(res); JSONObject resJson = JSONObject.parseObject(res);
@ -419,7 +419,7 @@ public class MagicApi {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8") "http://127.0.0.1:18088/syn/query?sendType=" + URLEncoder.encode(type, "UTF-8")
+ "&dsfId=" + URLEncoder.encode(dataId, "UTF-8") + "&dsfId=" + URLEncoder.encode(dataId, "UTF-8")
+ "&sendSyn=" + URLEncoder.encode(syn, "UTF-8") + "&sendSyn=" + URLEncoder.encode(syn, "UTF-8")
+ "&sendStatus3="+sendStatus3 + "&sendStatus3="+sendStatus3
@ -435,11 +435,11 @@ public class MagicApi {
return null; return null;
} }
public static JSONObject getSendSYNDataDSFBom(String type, String syn, String dataId, String sendStatus3) { public static JSONObject getSendSYNDataUser(String type, String syn, String dataId, String sendStatus3) {
try { try {
String res = HttpSend.sendMagicGet( String res = HttpSend.sendMagicGet(
"http://127.0.0.1:3002/syn/querysbbom?sendType=" + URLEncoder.encode(type, "UTF-8") "http://127.0.0.1:18088/syn/queryuser?sendType=" + URLEncoder.encode(type, "UTF-8")
+ "&crmId=" + URLEncoder.encode(dataId, "UTF-8") + "&crmId=" + URLEncoder.encode(dataId, "UTF-8")
+ "&sendSyn=" + URLEncoder.encode(syn, "UTF-8") + "&sendSyn=" + URLEncoder.encode(syn, "UTF-8")
+ "&sendStatus3="+sendStatus3 + "&sendStatus3="+sendStatus3