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,14 +278,36 @@ 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);
Map<String, String> headerMap = MapBuilder.<String, String>create(true) //存货要循环调用
.put("apiCode", String.valueOf(sysApp.getApiCode())) if (!formApp.equals("-8691606453890363968")){
.put("publicKey","ZJYAlF4yjkjZaXmjLOUqsoGzTHAlWpoTdqT7/AEYaXIwpXNCe7eDIk+3zDUT+v578prj") Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("secretKey","RJTPEoOSDdaBeoxoMs465tcTqy38bRag+12S7kIv2Lxd38wgLeVfWVl/ipVKVu8Qj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("apiCode", String.valueOf(sysApp.getApiCode()))
.put("appId","800018") .put("publicKey","ZJYAlF4yjkjZaXmjLOUqsoGzTHAlWpoTdqT7/AEYaXIwpXNCe7eDIk+3zDUT+v578prj")
.build(); .put("secretKey","RJTPEoOSDdaBeoxoMs465tcTqy38bRag+12S7kIv2Lxd38wgLeVfWVl/ipVKVu8Qj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); .put("appId","800018")
logger.info("调用中台返回的参数:{}",body); .build();
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().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,36 +183,36 @@ 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 JSONObject jsonObject = new JSONObject();
List<SysExtensionApiEntity> sysExtensionList = new ArrayList<>(); jsonObject.put("Token", "Hzya1314_CheckSkip");
for (int i=0; i< formson0228Arr.size(); i++){ jsonObject.put("billid", formson0228.getString("id"));
SysExtensionApiEntity sysExtensionApiEntity = new SysExtensionApiEntity(); jsonObject.put("AccId", formmain0227.getString("field0015"));
JSONObject formson0228 = formson0228Arr.getJSONObject(i); /**
JSONObject jsonObject = new JSONObject(); * bPurchase 是否外购
jsonObject.put("Token", "Hzya1314_CheckSkip"); * bComsume 是否生产耗用
jsonObject.put("billid", formson0228.getString("id")); * bSale 是否销售
jsonObject.put("AccId", formmain0227.getString("field0015")); * bSelf 是否自制
* bService 应税劳务
JSONObject oArchives = new JSONObject(); * bInvAsset 资产
oArchives.put("cInvCode", formson0228.getString("field0002")); *
oArchives.put("cInvCCode", formson0228.getString("field0005")); * iSupplyType 供应类型 默认领用 0
oArchives.put("cInvName", formson0228.getString("field0003")); * iDrawType 领料方式 默认申请领用
//todo 这个没值 * cValueType 计价方式 默认 全月平均法 全月平均法
oArchives.put("cGroupCode", "01"); * iImpTaxRate 进项税率 默认13
oArchives.put("cComUnitCode", formson0228.getString("field0006")); */
jsonObject.put("oArchives", oArchives); JSONObject oArchives = new JSONObject();
sysExtensionApiEntity.setBodys(JSON.toJSONString(jsonObject)); oArchives.put("cInvCode", formson0228.getString("field0002"));
JSONObject hzyaExt = new JSONObject(); oArchives.put("cInvCCode", formson0228.getString("field0005"));
hzyaExt.put("billCode",formson0228.getString("id")); oArchives.put("cInvName", formson0228.getString("field0003"));
hzyaExt.put("formsonId",formson0228.getString("id")); //todo 这个没值
Map<String,String> headers = new HashMap<>(); oArchives.put("cGroupCode", "01");
headers.put("hzyaExtData",JSONObject.toJSONString(hzyaExt)); oArchives.put("cComUnitCode", formson0228.getString("field0006"));
sysExtensionApiEntity.setHeaders(headers); jsonObject.put("oArchives", oArchives);
sysExtensionList.add(sysExtensionApiEntity); param.setBodys(JSON.toJSONString(jsonObject));
} hzyaExtData.put("billCode",formson0228.getString("id"));
param.setList(sysExtensionList); hzyaExtData.put("formmainId",formmain0227.getString("id"));
} }
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"));