|
@@ -2537,9 +2537,9 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
{
|
|
|
string maxid = dh.getFieldDataByCondition("product", "nvl(max(pr_id),0)", "1=1").ToString();
|
|
string maxid = dh.getFieldDataByCondition("product", "nvl(max(pr_id),0)", "1=1").ToString();
|
|
|
|
|
|
|
|
- // 辅助资料明细(产地等): 使用本地已有数据(苍穹无对应查询接口, 如需更新手动导入)
|
|
|
|
|
|
|
+ // 辅助资料明细(产地等): 使用本地已有数据(无对应查询接口, 如需更新手动导入)
|
|
|
|
|
|
|
|
- // 物料查询: 调用苍穹物料批量查询接口 POST /kapi/v2/hc68/basedata/bd_material/batchQuery-1
|
|
|
|
|
|
|
+ // 物料查询: 调用物料批量查询接口 POST /kapi/v2/hc68/basedata/bd_material/batchQuery-1
|
|
|
// 该接口返回 hc68_zhrl(中盒容量) 和 hc68_cd_name(产地) 字段
|
|
// 该接口返回 hc68_zhrl(中盒容量) 和 hc68_cd_name(产地) 字段
|
|
|
var queryBody = new Dictionary<string, object>
|
|
var queryBody = new Dictionary<string, object>
|
|
|
{
|
|
{
|
|
@@ -2659,7 +2659,7 @@ namespace UAS_LabelMachine
|
|
|
return int.Parse(result.ToString());
|
|
return int.Parse(result.ToString());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /// <summary>按多个候选列名取值, 返回第一个找到的非空值(苍穹/星空字段名兼容)</summary>
|
|
|
|
|
|
|
+ /// <summary>按多个候选列名取值, 返回第一个找到的非空值(/星空字段名兼容)</summary>
|
|
|
private static string GetCol(DataRow row, params string[] colNames)
|
|
private static string GetCol(DataRow row, params string[] colNames)
|
|
|
{
|
|
{
|
|
|
foreach (var name in colNames)
|
|
foreach (var name in colNames)
|
|
@@ -2677,7 +2677,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
{
|
|
|
string maxcuid = dh.getFieldDataByCondition("customer", "nvl(max(cu_id),0)", "1=1").ToString();
|
|
string maxcuid = dh.getFieldDataByCondition("customer", "nvl(max(cu_id),0)", "1=1").ToString();
|
|
|
|
|
|
|
|
- // 调苍穹客户批量查询接口 POST /kapi/v2/sbd/customer/batchQueryCustomer
|
|
|
|
|
|
|
+ // 调客户批量查询接口 POST /kapi/v2/sbd/customer/batchQueryCustomer
|
|
|
// 请求体格式: {data:{queryDTO:{status:["C"]}, pageNo:1, pageSize:1000}}
|
|
// 请求体格式: {data:{queryDTO:{status:["C"]}, pageNo:1, pageSize:1000}}
|
|
|
// 返回: {data:{rows:[{id,number,name,address,createorg:{id,...},...}], totalCount}, status, errorCode}
|
|
// 返回: {data:{rows:[{id,number,name,address,createorg:{id,...},...}], totalCount}, status, errorCode}
|
|
|
var allRows = new List<JObject>();
|
|
var allRows = new List<JObject>();
|
|
@@ -2700,7 +2700,7 @@ namespace UAS_LabelMachine
|
|
|
bool ok = (st != null && st.Type == JTokenType.Boolean) ? st.Value<bool>()
|
|
bool ok = (st != null && st.Type == JTokenType.Boolean) ? st.Value<bool>()
|
|
|
: string.Equals((string)st, "true", StringComparison.OrdinalIgnoreCase);
|
|
: string.Equals((string)st, "true", StringComparison.OrdinalIgnoreCase);
|
|
|
if (!ok)
|
|
if (!ok)
|
|
|
- throw new Exception("苍穹客户查询失败: " + (string)jo["message"] + "(errorCode=" + (string)jo["errorCode"] + ")");
|
|
|
|
|
|
|
+ throw new Exception("客户查询失败: " + (string)jo["message"] + "(errorCode=" + (string)jo["errorCode"] + ")");
|
|
|
|
|
|
|
|
JToken respData = jo["data"];
|
|
JToken respData = jo["data"];
|
|
|
JArray rows = null;
|
|
JArray rows = null;
|
|
@@ -2732,7 +2732,7 @@ namespace UAS_LabelMachine
|
|
|
cu_id.Add(GetJsonVal(row, "id"));
|
|
cu_id.Add(GetJsonVal(row, "id"));
|
|
|
cu_code1.Add(GetJsonVal(row, "number"));
|
|
cu_code1.Add(GetJsonVal(row, "number"));
|
|
|
cu_name.Add(GetJsonVal(row, "name"));
|
|
cu_name.Add(GetJsonVal(row, "name"));
|
|
|
- cu_shortname.Add(GetJsonVal(row, "name")); // 苍穹无短名称字段, 用名称代替
|
|
|
|
|
|
|
+ cu_shortname.Add(GetJsonVal(row, "name")); // 无短名称字段, 用名称代替
|
|
|
cu_add.Add(GetJsonVal(row, "address"));
|
|
cu_add.Add(GetJsonVal(row, "address"));
|
|
|
// 创建组织ID(嵌套对象取id)
|
|
// 创建组织ID(嵌套对象取id)
|
|
|
string srcOrgId = "";
|
|
string srcOrgId = "";
|
|
@@ -2790,7 +2790,7 @@ namespace UAS_LabelMachine
|
|
|
//SysProduct("");
|
|
//SysProduct("");
|
|
|
//SysCustomer();
|
|
//SysCustomer();
|
|
|
|
|
|
|
|
- // 苍穹发货通知单查询: POST /kapi/v2/sm/sm_delivernotice/batchQuery
|
|
|
|
|
|
|
+ // 发货通知单查询: POST /kapi/v2/sm/sm_delivernotice/batchQuery
|
|
|
// 请求体: pageSize/pageNo 在根级(层级0), 查询条件 billno/billstatus 等包在 data 对象里(层级1)
|
|
// 请求体: pageSize/pageNo 在根级(层级0), 查询条件 billno/billstatus 等包在 data 对象里(层级1)
|
|
|
// 返回: {data:{rows:[{billno,billstatus,bizdate,customer_id,dept_number,dept_id,
|
|
// 返回: {data:{rows:[{billno,billstatus,bizdate,customer_id,dept_number,dept_id,
|
|
|
// billentry:[{material_id,material_number,qty,owner_id,owner_number,...}],...}]},
|
|
// billentry:[{material_id,material_number,qty,owner_id,owner_number,...}],...}]},
|
|
@@ -2810,7 +2810,7 @@ namespace UAS_LabelMachine
|
|
|
bodyObj["pageNo"] = pageNo;
|
|
bodyObj["pageNo"] = pageNo;
|
|
|
bodyObj["pageSize"] = pageSize;
|
|
bodyObj["pageSize"] = pageSize;
|
|
|
|
|
|
|
|
- string ret = client.Invoke("/kapi/v2/sm/sm_delivernotice/batchQuery-1", bodyObj.ToString());
|
|
|
|
|
|
|
+ string ret = client.Invoke("/kapi/v2/hc68/sm/sm_delivernotice/batchQuery-1", bodyObj.ToString());
|
|
|
JObject jo = JObject.Parse(ret);
|
|
JObject jo = JObject.Parse(ret);
|
|
|
var st = jo["status"];
|
|
var st = jo["status"];
|
|
|
bool ok = (st != null && st.Type == JTokenType.Boolean) ? st.Value<bool>()
|
|
bool ok = (st != null && st.Type == JTokenType.Boolean) ? st.Value<bool>()
|
|
@@ -2833,7 +2833,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
- MessageBox.Show("苍穹发货通知单查询失败:\n" + ex.Message);
|
|
|
|
|
|
|
+ MessageBox.Show("发货通知单查询失败:\n" + ex.Message);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (billRows.Count == 0)
|
|
if (billRows.Count == 0)
|
|
@@ -2860,12 +2860,12 @@ namespace UAS_LabelMachine
|
|
|
string prcode = "";
|
|
string prcode = "";
|
|
|
int seq = 0;
|
|
int seq = 0;
|
|
|
|
|
|
|
|
- // 苍穹发货通知单为"单据头 + billentry 明细数组"两层结构, 需展开:
|
|
|
|
|
|
|
+ // 发货通知单为"单据头 + billentry 明细数组"两层结构, 需展开:
|
|
|
// 单据头: customer_id(订货客户) / dept_number(销售部门编码) / bizdate(通知日期)
|
|
// 单据头: customer_id(订货客户) / dept_number(销售部门编码) / bizdate(通知日期)
|
|
|
// 明细: material_id(物料内码) / qty(数量) / owner_id(货主)
|
|
// 明细: material_id(物料内码) / qty(数量) / owner_id(货主)
|
|
|
- // 苍穹无星空的 F_PCMN_* 系列客户物料扩展属性、FORDERNO(订单号)、FCUSTMATID(客户物料映射ID),
|
|
|
|
|
|
|
+ // 无星空的 F_PCMN_* 系列客户物料扩展属性、FORDERNO(订单号)、FCUSTMATID(客户物料映射ID),
|
|
|
// 对应的 pd_brand/pd_custprodspec/pd_custproddetail/pd_usi/pd_gsd/pd_tsmt/pd_ordercode 暂留空,
|
|
// 对应的 pd_brand/pd_custprodspec/pd_custproddetail/pd_usi/pd_gsd/pd_tsmt/pd_ordercode 暂留空,
|
|
|
- // pd_custprodcode(客户物料编码)待苍穹"客户物料映射"查询接口提供后补充。
|
|
|
|
|
|
|
+ // pd_custprodcode(客户物料编码)待"客户物料映射"查询接口提供后补充。
|
|
|
foreach (JObject bill in billRows)
|
|
foreach (JObject bill in billRows)
|
|
|
{
|
|
{
|
|
|
string customerId = GetJsonVal(bill, "customer_id");
|
|
string customerId = GetJsonVal(bill, "customer_id");
|
|
@@ -2886,14 +2886,14 @@ namespace UAS_LabelMachine
|
|
|
pd_outqty.Add(GetJsonVal(entry, "qty"));
|
|
pd_outqty.Add(GetJsonVal(entry, "qty"));
|
|
|
pd_prodcode.Add(GetJsonVal(entry, "material_id"));
|
|
pd_prodcode.Add(GetJsonVal(entry, "material_id"));
|
|
|
pi_cardcode.Add(customerId);
|
|
pi_cardcode.Add(customerId);
|
|
|
- pd_ordercode.Add(GetJsonVal(entry, "mainbillnumber")); // 苍穹发货通知单无订单号字段mainbillnumber
|
|
|
|
|
- pd_brand.Add(""); // 苍穹无 F_PCMN_BaseProperty
|
|
|
|
|
- PD_CUSTPRODSPEC.Add(GetJsonVal(entry, "cusmaterialid_cusmatmod")); // 苍穹无 F_PCMN_Text
|
|
|
|
|
- PD_CUSTPRODDETAIL.Add(GetJsonVal(entry, "cusmaterialid_cusmatname")); // 苍穹无 F_PCMN_Text1
|
|
|
|
|
- pd_USI.Add(""); // 苍穹无 F_PCMN_Text2
|
|
|
|
|
- pd_GSD.Add(""); // 苍穹无 F_PCMN_Text3
|
|
|
|
|
- pd_TSMT.Add(""); // 苍穹无 F_PCMN_Text4
|
|
|
|
|
- pd_custprodcode.Add(GetJsonVal(entry, "cusmaterialid_cusmat")); // 苍穹暂无客户物料映射查询接口
|
|
|
|
|
|
|
+ pd_ordercode.Add(GetJsonVal(entry, "mainbillnumber")); // 发货通知单无订单号字段mainbillnumber
|
|
|
|
|
+ pd_brand.Add(""); // 无 F_PCMN_BaseProperty
|
|
|
|
|
+ PD_CUSTPRODSPEC.Add(GetJsonVal(entry, "cusmaterialid_cusmatmod")); // 无 F_PCMN_Text
|
|
|
|
|
+ PD_CUSTPRODDETAIL.Add(GetJsonVal(entry, "cusmaterialid_cusmatname")); // 无 F_PCMN_Text1
|
|
|
|
|
+ pd_USI.Add(""); // 无 F_PCMN_Text2
|
|
|
|
|
+ pd_GSD.Add(""); // 无 F_PCMN_Text3
|
|
|
|
|
+ pd_TSMT.Add(""); // 无 F_PCMN_Text4
|
|
|
|
|
+ pd_custprodcode.Add(GetJsonVal(entry, "cusmaterialid_cusmat")); // 暂无客户物料映射查询接口
|
|
|
pi_departmentcode.Add(deptCode);
|
|
pi_departmentcode.Add(deptCode);
|
|
|
pi_date.Add(bizdate);
|
|
pi_date.Add(bizdate);
|
|
|
prcode += "'" + GetJsonVal(entry, "material_id") + "',";
|
|
prcode += "'" + GetJsonVal(entry, "material_id") + "',";
|