oa对接u8扩展类

This commit is contained in:
xiang2lin 2024-06-06 14:45:39 +08:00
parent 8ff964c6cd
commit 869a8014ea
2 changed files with 63 additions and 40 deletions

View File

@ -278,6 +278,8 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
return BaseResult.getFailureMessageEntity("根据formApp" + formApp+"查询出多条数据", ""); return BaseResult.getFailureMessageEntity("根据formApp" + formApp+"查询出多条数据", "");
} }
SysApplicationApiEntity sysApp = applist.get(0); SysApplicationApiEntity sysApp = applist.get(0);
//存货要循环调用
if (!formApp.equals("-8691606453890363968")){
Map<String, String> headerMap = MapBuilder.<String, String>create(true) Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", String.valueOf(sysApp.getApiCode())) .put("apiCode", String.valueOf(sysApp.getApiCode()))
.put("publicKey","ZJYAlF4yjkjZaXmjLOUqsoGzTHAlWpoTdqT7/AEYaXIwpXNCe7eDIk+3zDUT+v578prj") .put("publicKey","ZJYAlF4yjkjZaXmjLOUqsoGzTHAlWpoTdqT7/AEYaXIwpXNCe7eDIk+3zDUT+v578prj")
@ -286,6 +288,26 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
.build(); .build();
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body();
logger.info("调用中台返回的参数:{}",body); logger.info("调用中台返回的参数:{}",body);
}else {
//物料主表
JSONObject formmain0227 = businessData.getJSONObject("formmain_0227");
//物料明细表
JSONArray formson0228Arr = businessData.getJSONArray("formson_0228");
for (int i=0; i< formson0228Arr.size(); i++){
JSONObject param = new JSONObject();
param.put("formmain_0227",formmain0227);
param.put("formson_0228",formson0228Arr.getJSONObject(i));
entity.setBusinessDataStr(JSON.toJSONString(param));
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("apiCode", String.valueOf(sysApp.getApiCode()))
.put("publicKey","ZJYAlF4yjkjZaXmjLOUqsoGzTHAlWpoTdqT7/AEYaXIwpXNCe7eDIk+3zDUT+v578prj")
.put("secretKey","RJTPEoOSDdaBeoxoMs465tcTqy38bRag+12S7kIv2Lxd38wgLeVfWVl/ipVKVu8Qj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
.put("appId","800018")
.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);
}
}
} }
} }
break; break;

View File

@ -183,18 +183,25 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
if (null != businessData){ if (null != businessData){
//物料主表 //物料主表
JSONObject formmain0227 = businessData.getJSONObject("formmain_0227"); JSONObject formmain0227 = businessData.getJSONObject("formmain_0227");
//物料明细表 //物料明细表 上层方法处理了这里是单条传
JSONArray formson0228Arr = businessData.getJSONArray("formson_0228"); JSONObject formson0228 = businessData.getJSONObject("formson_0228");
//用来放物料明细表的id
List<SysExtensionApiEntity> sysExtensionList = new ArrayList<>();
for (int i=0; i< formson0228Arr.size(); i++){
SysExtensionApiEntity sysExtensionApiEntity = new SysExtensionApiEntity();
JSONObject formson0228 = formson0228Arr.getJSONObject(i);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("Token", "Hzya1314_CheckSkip"); jsonObject.put("Token", "Hzya1314_CheckSkip");
jsonObject.put("billid", formson0228.getString("id")); jsonObject.put("billid", formson0228.getString("id"));
jsonObject.put("AccId", formmain0227.getString("field0015")); jsonObject.put("AccId", formmain0227.getString("field0015"));
/**
* bPurchase 是否外购
* bComsume 是否生产耗用
* bSale 是否销售
* bSelf 是否自制
* bService 应税劳务
* bInvAsset 资产
*
* iSupplyType 供应类型 默认领用 0
* iDrawType 领料方式 默认申请领用
* cValueType 计价方式 默认 全月平均法 全月平均法
* iImpTaxRate 进项税率 默认13
*/
JSONObject oArchives = new JSONObject(); JSONObject oArchives = new JSONObject();
oArchives.put("cInvCode", formson0228.getString("field0002")); oArchives.put("cInvCode", formson0228.getString("field0002"));
oArchives.put("cInvCCode", formson0228.getString("field0005")); oArchives.put("cInvCCode", formson0228.getString("field0005"));
@ -203,16 +210,9 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
oArchives.put("cGroupCode", "01"); oArchives.put("cGroupCode", "01");
oArchives.put("cComUnitCode", formson0228.getString("field0006")); oArchives.put("cComUnitCode", formson0228.getString("field0006"));
jsonObject.put("oArchives", oArchives); jsonObject.put("oArchives", oArchives);
sysExtensionApiEntity.setBodys(JSON.toJSONString(jsonObject)); param.setBodys(JSON.toJSONString(jsonObject));
JSONObject hzyaExt = new JSONObject(); hzyaExtData.put("billCode",formson0228.getString("id"));
hzyaExt.put("billCode",formson0228.getString("id")); hzyaExtData.put("formmainId",formmain0227.getString("id"));
hzyaExt.put("formsonId",formson0228.getString("id"));
Map<String,String> headers = new HashMap<>();
headers.put("hzyaExtData",JSONObject.toJSONString(hzyaExt));
sysExtensionApiEntity.setHeaders(headers);
sysExtensionList.add(sysExtensionApiEntity);
}
param.setList(sysExtensionList);
} }
return param; return param;
} }
@ -273,9 +273,10 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
oArchives.put("cCusAbbName", formmain0226.getString("field0008")); oArchives.put("cCusAbbName", formmain0226.getString("field0008"));
oArchives.put("cCCCode", formmain0226.getString("field0012")); oArchives.put("cCCCode", formmain0226.getString("field0012"));
oArchives.put("cCusExch_name", formmain0226.getString("field0013")); oArchives.put("cCusExch_name", formmain0226.getString("field0013"));
// todo 这个字段没值 //客户管理类型 默认 999
oArchives.put("cCusMngTypeCode", "999"); oArchives.put("cCusMngTypeCode", "999");
//bCusOverseas 是否国外
//bCusDomestic 是否国内
jsonObject.put("oArchives", oArchives); jsonObject.put("oArchives", oArchives);
param.setBodys(JSON.toJSONString(jsonObject)); param.setBodys(JSON.toJSONString(jsonObject));
hzyaExtData.put("billCode",formmain0226.getString("field0001")); hzyaExtData.put("billCode",formmain0226.getString("field0001"));