oa对接u8扩展类

This commit is contained in:
xiang2lin 2024-06-07 10:20:39 +08:00
parent 869a8014ea
commit 7fc8a2876a
2 changed files with 60 additions and 13 deletions

View File

@ -294,18 +294,21 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
//物料明细表
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);
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));
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);
}
}
}
}

View File

@ -36,9 +36,21 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
static final String KEY = "`o7eotan9ws8c:aj";
Logger logger = LogManager.getLogger(getClass());
//存货属性枚举
private static Map<String,String> inventoryAttrMap;
@Autowired
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
static {
inventoryAttrMap = new HashMap<>();
inventoryAttrMap.put("4447593729630683530","采购");
inventoryAttrMap.put("-387621385918919664","生产耗用");
inventoryAttrMap.put("5069685839370801039","内销");
inventoryAttrMap.put("6067929382885409752","自制");
inventoryAttrMap.put("-8216072224610695901","资产");
inventoryAttrMap.put("-949779340021054755","应税劳务");
}
/**
* 英德赛 OA档案传U8
* 根据不同formApp来调U8不同接口
@ -209,6 +221,38 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
//todo 这个没值
oArchives.put("cGroupCode", "01");
oArchives.put("cComUnitCode", formson0228.getString("field0006"));
//存货属性勾选
String attr = formson0228.getString("field0007");
if (StrUtil.isNotEmpty(attr)){
String[] attrArr = attr.split(",");
for (String s : attrArr) {
switch (s){
case "4447593729630683530"://采购
oArchives.put("bPurchase","1");
break;
case "-387621385918919664"://生产耗用
oArchives.put("bComsume","1");
break;
case "5069685839370801039"://内销
oArchives.put("bSale","1");
break;
case "6067929382885409752"://自制
oArchives.put("bSelf","1");
break;
case "-8216072224610695901"://资产
oArchives.put("bInvAsset","1");
break;
case "-949779340021054755"://应税劳务
oArchives.put("bService","1");
break;
}
}
}
oArchives.put("iSupplyType","0");
oArchives.put("iDrawType","申请领用");
oArchives.put("cValueType","全月平均法");
oArchives.put("iImpTaxRate","13");
oArchives.put("iTaxRate","13");
jsonObject.put("oArchives", oArchives);
param.setBodys(JSON.toJSONString(jsonObject));
hzyaExtData.put("billCode",formson0228.getString("id"));