Merge branch 'lvleigang' of http://192.168.2.237:3000/root/kangarooDataCenterV3 into lvleigang

This commit is contained in:
lvleigang 2024-05-31 15:26:45 +08:00
commit 479cfce7ff
1 changed files with 80 additions and 53 deletions

View File

@ -1,5 +1,6 @@
package com.hzya.frame.seeyon.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -60,17 +61,15 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
}
//根据forApp组装不同参数
switch (formApp){
case "4728403652378707515"://
case "-8691606453890363968"://
hzyaExtData.put("billCode", "cunhuoabc123456");
getInventory(businessData,param);
break;
case "供应商":
hzyaExtData.put("billCode", "");
getSupplier(businessData,param);
case "6223456019738676230":
getSupplier(businessData,param,hzyaExtData);
break;
case "客户":
hzyaExtData.put("billCode", "");
getCustomer(businessData,param);
case "-9122508232154527168":
getCustomer(businessData,param,hzyaExtData);
break;
default:
param.setBodys("未匹配到表单当前formID"+ formApp);
@ -93,6 +92,8 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
*/
@Override
public void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity) {
//在这里记录日志
JSONObject targetData = JSON.parseObject(logEntity.getTargetData());//这个对象里的body是 发送到u8的请求报文
JSONObject sourceData = JSON.parseObject(logEntity.getSourceData());
@ -102,11 +103,25 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
JSONArray formMainIds = new JSONArray();
formMainIds.add(sourceBody.getString("id"));
JSONObject param = new JSONObject();
param.put("formAppId",sourceBody.getString("formApp"));
String formApp = sourceBody.getString("formApp");
param.put("formAppId",formApp);
param.put("formMainIds",formMainIds);
param.put("dataSourceCode","ht_oa_sqlserver");
param.put("eventType",sourceBody.getString("eventType"));
//把返回的单号更新到oa档案表
String sql = "";
switch (formApp){
case "-8691606453890363968"://存货
sql = "";
break;
case "6223456019738676230"://供应商
sql = "update formmain_0229 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode");
break;
case "-9122508232154527168"://客户
sql = "update formmain_0230 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode");
break;
}
IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity();
logDetails.setRootAppPk(JSON.toJSONString(param));
logDetails.setRootAppBill(hzyaExtData.getString("billCode"));
@ -138,76 +153,88 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
//存货参数组装
private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param){
if (null != businessData){
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token", "Hzya1314_CheckSkip");
jsonObject.put("billid", "123");
jsonObject.put("AccId", "005");
JSONObject formmain0227 = businessData.getJSONObject("formmain_0227");
JSONArray formson0228Arr = businessData.getJSONArray("formson_0228");
for (int i=0; i< formson0228Arr.size(); i++){
JSONObject formson0228 = formson0228Arr.getJSONObject(i);
JSONObject jsonObject = new JSONObject();
jsonObject.put("Token", "Hzya1314_CheckSkip");
jsonObject.put("billid", formson0228.getString("id"));
jsonObject.put("AccId", formmain0227.getString("field0015"));
JSONObject oArchives = new JSONObject();
oArchives.put("cInvCode", "cyp12");
oArchives.put("cInvCCode", "0101");
oArchives.put("cInvName", "测试");
oArchives.put("cGroupCode", "01");
oArchives.put("cComUnitCode", "0101");
JSONObject oArchives = new JSONObject();
oArchives.put("cInvCode", formson0228.getString("field0002"));
oArchives.put("cInvCCode", formson0228.getString("field0005"));
oArchives.put("cInvName", formson0228.getString("field0003"));
//todo 这个没值
oArchives.put("cGroupCode", "01");
oArchives.put("cComUnitCode", formson0228.getString("field0006"));
jsonObject.put("oArchives", oArchives);
param.setBodys(JSON.toJSONString(jsonObject));
jsonObject.put("oArchives", oArchives);
param.setBodys(JSON.toJSONString(jsonObject));
}
}
return param;
}
//供应商参数组装
private SysExtensionApiEntity getSupplier(JSONObject businessData,SysExtensionApiEntity param){
private SysExtensionApiEntity getSupplier(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){
if (null != businessData){
JSONObject formmain0225 = businessData.getJSONObject("formmain_0225");
JSONObject jsonObject = new JSONObject();
jsonObject.put("billid", "123");
jsonObject.put("AccId", "888");
jsonObject.put("billid", formmain0225.getString("id"));
jsonObject.put("AccId", formmain0225.getString("field0020"));
jsonObject.put("Token", U8Util.getToken());
JSONObject oArchives = new JSONObject();
oArchives.put("cVenCode", "0001");
oArchives.put("cVenName ", "测试0001");
oArchives.put("cVenAbbName", "测试0001简称");
oArchives.put("cVCCode", "01");
oArchives.put("cVenExch_name", "人民币");
oArchives.put("bVenTax", "false");
oArchives.put("bLicenceDate", "false");
oArchives.put("bBusinessDate", "false");
oArchives.put("bProxyDate", "false");
oArchives.put("bPassGMP", "false");
oArchives.put("bVenCargo", "false");
oArchives.put("bProxyForeign", "true");
oArchives.put("bVenService", "true");
oArchives.put("iVenGSPType", "0");
oArchives.put("bVenOverseas", "false");
oArchives.put("bVenAccPeriodMng", "false");
oArchives.put("bVenHomeBranch", "false");
oArchives.put("dVenCreateDatetime", "2023-01-04 10:00");
oArchives.put("cVenRegCode", "税号");
oArchives.put("cVenBank", "开户银行");
oArchives.put("cVenAccount", "银行账号");
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("bVenTax", "false");
//oArchives.put("bLicenceDate", "false");
//oArchives.put("bBusinessDate", "false");
//oArchives.put("bProxyDate", "false");
//oArchives.put("bPassGMP", "false");
//oArchives.put("bVenCargo", "false");
//oArchives.put("bProxyForeign", "true");
//oArchives.put("bVenService", "true");
//oArchives.put("iVenGSPType", "0");
//oArchives.put("bVenOverseas", "false");
//oArchives.put("bVenAccPeriodMng", "false");
//oArchives.put("bVenHomeBranch", "false");
oArchives.put("dVenCreateDatetime", DateUtil.now());
oArchives.put("cVenRegCode", formmain0225.getString("field0009"));
oArchives.put("cVenBank", formmain0225.getString("field0011"));
oArchives.put("cVenAccount", formmain0225.getString("field0012"));
jsonObject.put("oArchives", oArchives);
param.setBodys(JSON.toJSONString(jsonObject));
hzyaExtData.put("billCode", formmain0225.getString("field0001"));
hzyaExtData.put("formmainId", formmain0225.getString("id"));
}
return param;
}
//客户参数组装
private SysExtensionApiEntity getCustomer(JSONObject businessData,SysExtensionApiEntity param){
private SysExtensionApiEntity getCustomer(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){
if (null != businessData){
JSONObject formmain0226 = businessData.getJSONObject("formmain_0226");
JSONObject jsonObject = new JSONObject();
jsonObject.put("billid", "123");
jsonObject.put("AccId", "888");
jsonObject.put("billid", formmain0226.getString("id"));
jsonObject.put("AccId", formmain0226.getString("field0025"));
jsonObject.put("Token", "Hzya1314_CheckSkip");
JSONObject oArchives = new JSONObject();
oArchives.put("cCusCode", "0001");
oArchives.put("cCusName", "测试0001");
oArchives.put("cCusAbbName", "测试0001");
oArchives.put("cCCCode", "01");
oArchives.put("cCusExch_name", "人民币");
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"));
// todo 这个字段没值
oArchives.put("cCusMngTypeCode", "999");
jsonObject.put("oArchives", oArchives);
param.setBodys(JSON.toJSONString(jsonObject));
hzyaExtData.put("billCode",formmain0226.getString("field0001"));
hzyaExtData.put("formmainId",formmain0226.getString("id"));
}
return param;
}