oa对接u8扩展类

This commit is contained in:
xiang2lin 2024-06-14 08:41:34 +08:00
parent 7fc8a2876a
commit 549cf2a345
2 changed files with 27 additions and 14 deletions

View File

@ -294,8 +294,8 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
//物料明细表
JSONArray formson0228Arr = businessData.getJSONArray("formson_0228");
for (int i=0; i< formson0228Arr.size(); i++){
JSONObject jsonObject1 = formson0228Arr.getJSONObject(i);
if (jsonObject1.getString("id").equals("4321107568383836461")) {
// JSONObject jsonObject1 = formson0228Arr.getJSONObject(i);
//if (jsonObject1.getString("id").equals("4321107568383836461")) {
JSONObject param = new JSONObject();
param.put("formmain_0227",formmain0227);
param.put("formson_0228",formson0228Arr.getJSONObject(i));
@ -308,7 +308,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
.build();
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSON.toJSONString(entity)).timeout(60000).execute().body();
logger.info("调用中台返回的参数:{}",body);
}
//
}
}
}

View File

@ -139,13 +139,14 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
sql = "";
break;
case "6223456019738676230"://供应商
sql = "update formmain_0229 set field0002 = "+ code + " where field0001 = "+hzyaExtData.getString("billCode");
sql = "update formmain_0229 set field0002 = '"+ code + "' where field0001 = '"+hzyaExtData.getString("billCode")+"'";
break;
case "-9122508232154527168"://客户
sql = "update formmain_0230 set field0002 = "+ code + " where field0001 = "+hzyaExtData.getString("billCode");
sql = "update formmain_0230 set field0002 = '"+ code + "' where field0001 = '"+hzyaExtData.getString("billCode")+"'";
break;
}
if (StrUtil.isNotEmpty(sql)){
System.out.println("要执行的sql"+sql);
String sign = SecureUtil.md5(sql);
String data = SecureUtil.aes(KEY.getBytes()).encryptHex(sql);
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
@ -157,7 +158,7 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
JSONObject params = new JSONObject();
params.put("sign",sign);
params.put("data",data);
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSON.toJSONString(params)).timeout(60000).execute().body();
//String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSON.toJSONString(params)).timeout(60000).execute().body();
}
}
}
@ -216,11 +217,11 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
*/
JSONObject oArchives = new JSONObject();
oArchives.put("cInvCode", formson0228.getString("field0002"));
oArchives.put("cInvCCode", formson0228.getString("field0005"));
oArchives.put("cInvCCode", formson0228.getString("field0016"));
oArchives.put("cInvName", formson0228.getString("field0003"));
//todo 这个没值
oArchives.put("cGroupCode", "01");
oArchives.put("cComUnitCode", formson0228.getString("field0006"));
oArchives.put("cGroupCode", formson0228.getString("field0018"));
oArchives.put("cComUnitCode", formson0228.getString("field0017"));
//存货属性勾选
String attr = formson0228.getString("field0007");
if (StrUtil.isNotEmpty(attr)){
@ -249,7 +250,7 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
}
}
oArchives.put("iSupplyType","0");
oArchives.put("iDrawType","申请领用");
// oArchives.put("iDrawType","申请领用");
oArchives.put("cValueType","全月平均法");
oArchives.put("iImpTaxRate","13");
oArchives.put("iTaxRate","13");
@ -273,8 +274,8 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
oArchives.put("cVenCode", formmain0225.getString("field0002"));
oArchives.put("cVenName", formmain0225.getString("field0003"));
oArchives.put("cVenAbbName", formmain0225.getString("field0004"));
oArchives.put("cVCCode", formmain0225.getString("field0006"));
oArchives.put("cVenExch_name", formmain0225.getString("field0010"));
oArchives.put("cVCCode", formmain0225.getString("field0021"));
oArchives.put("cVenExch_name", getExchName(formmain0225.getString("field0010")));
//oArchives.put("bVenTax", "false");
//oArchives.put("bLicenceDate", "false");
//oArchives.put("bBusinessDate", "false");
@ -315,12 +316,14 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
oArchives.put("cCusCode", formmain0226.getString("field0002"));
oArchives.put("cCusName", formmain0226.getString("field0007"));
oArchives.put("cCusAbbName", formmain0226.getString("field0008"));
oArchives.put("cCCCode", formmain0226.getString("field0012"));
oArchives.put("cCusExch_name", formmain0226.getString("field0013"));
oArchives.put("cCCCode", formmain0226.getString("field0026"));
oArchives.put("cCusExch_name", getExchName(formmain0226.getString("field0013")));
//客户管理类型 默认 999
oArchives.put("cCusMngTypeCode", "999");
//bCusOverseas 是否国外
//bCusDomestic 是否国内
oArchives.put("bCusDomestic","1");
oArchives.put("bCusOverseas","1");
jsonObject.put("oArchives", oArchives);
param.setBodys(JSON.toJSONString(jsonObject));
hzyaExtData.put("billCode",formmain0226.getString("field0001"));
@ -328,4 +331,14 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
}
return param;
}
//币种枚举
private String getExchName(String exchId){
if ("-4937388245590851205".equals(exchId)){
return "人民币";
}else if ("-4041702741131967213".equals(exchId)){
return "美元";
}
return "人民币";
}
}