|
|
|
@ -14,9 +14,11 @@ using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Data.Entity.Migrations;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Topshelf;
|
|
|
|
|
|
|
|
|
@ -654,7 +656,9 @@ namespace DSWeb.Service.Output.DS7
|
|
|
|
|
orderinfo.Add("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var custEdi2 = dS7Data.CodeCustEdi.AsNoTracking().FirstOrDefault(x => x.EDINAME == "DJY_OUTPUT" && x.EDICODE == orderinfo[0]);
|
|
|
|
|
var cust = orderinfo[0];
|
|
|
|
|
|
|
|
|
|
var custEdi2 = dS7Data.CodeCustEdi.AsNoTracking().FirstOrDefault(x => x.EDINAME == "DJY_OUTPUT" && x.EDICODE == cust);
|
|
|
|
|
if (custEdi2 != null)
|
|
|
|
|
{
|
|
|
|
|
CUSTOMERNAME = custEdi2.CUST;
|
|
|
|
@ -713,9 +717,16 @@ namespace DSWeb.Service.Output.DS7
|
|
|
|
|
KGS= KGS,
|
|
|
|
|
NETWEIGHT=0,
|
|
|
|
|
CBM= CBM,
|
|
|
|
|
SOURCEOP= SOURCEOP,
|
|
|
|
|
DUIYUEHAO= 对账约号
|
|
|
|
|
SOURCEOP= SOURCEOP
|
|
|
|
|
};
|
|
|
|
|
//,DUIYUEHAO = 对账约号
|
|
|
|
|
//20230317 对账约号存于opLogic
|
|
|
|
|
var cdc = new CommonDataContext();
|
|
|
|
|
var dic = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "DUIYUEHAO",对账约号 }
|
|
|
|
|
};
|
|
|
|
|
SaveLogicInfo(BSNO, "舱单业务", dic);
|
|
|
|
|
|
|
|
|
|
var billnoset = dS7Data.SysBillNoSet.AsNoTracking().FirstOrDefault(x => x.COMPANYID == Corpid && x.OPLBNAME == "舱单申报" && x.RULEBLNO == "委托编号");
|
|
|
|
|
if (billnoset != null)
|
|
|
|
@ -809,7 +820,8 @@ namespace DSWeb.Service.Output.DS7
|
|
|
|
|
BLFRT = _edi.BLFRT,
|
|
|
|
|
SENDTIME = _edi.SENDTIME,
|
|
|
|
|
YARD = _edi.YARD,
|
|
|
|
|
FORWARDER = _edi.FORWARDER
|
|
|
|
|
FORWARDER = _edi.FORWARDER,
|
|
|
|
|
CORPID= Corpid
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dS7Data.op_seae_edi.Add(newedi);
|
|
|
|
@ -1195,5 +1207,85 @@ SELECT @ps_BillNo as N'billno'";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 逻辑信息子表操作
|
|
|
|
|
|
|
|
|
|
#region 将一个dictionary转化为用;;和::隔开的文本
|
|
|
|
|
public static string DicToStr(Dictionary<string, string> dic)
|
|
|
|
|
{
|
|
|
|
|
var result = "";
|
|
|
|
|
|
|
|
|
|
foreach (var item in dic)
|
|
|
|
|
{
|
|
|
|
|
result += item.Key + "::" + item.Value + ";;";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 将一个用;;和::隔开的文本转化为dictionary
|
|
|
|
|
public static Dictionary<string, string> StrToDic(string dicstr)
|
|
|
|
|
{
|
|
|
|
|
var result = new Dictionary<string, string>();
|
|
|
|
|
|
|
|
|
|
var list = Regex.Split(dicstr, ";;").ToList();
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
var itemarray = Regex.Split(item, "::");
|
|
|
|
|
if (itemarray.Length < 2) continue;
|
|
|
|
|
result.Add(itemarray[0], itemarray[1] == null ? "" : itemarray[1]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public static Dictionary<string, string> GetLogicInfo(string BSNO, string PROPNAME)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
CommonDataContext cdc = new CommonDataContext();
|
|
|
|
|
|
|
|
|
|
var result = new Dictionary<string, string>();
|
|
|
|
|
|
|
|
|
|
var infoList = cdc.OP_LOGICINFO.Where(x => x.BSNO == BSNO && x.PROPNAME == PROPNAME).ToList();
|
|
|
|
|
|
|
|
|
|
if (infoList != null && infoList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
result = StrToDic(infoList[0].PROPVALUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void SaveLogicInfo(string BSNO, string PROPNAME, Dictionary<string, string> InfoDic)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
CommonDataContext cdc = new CommonDataContext();
|
|
|
|
|
|
|
|
|
|
var result = new Dictionary<string, string>();
|
|
|
|
|
|
|
|
|
|
var infoList = cdc.OP_LOGICINFO.Where(x => x.BSNO == BSNO && x.PROPNAME == PROPNAME).ToList();
|
|
|
|
|
|
|
|
|
|
if (infoList != null && infoList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
infoList[0].PROPVALUE = DicToStr(InfoDic);
|
|
|
|
|
cdc.OP_LOGICINFO.AddOrUpdate(infoList[0]);
|
|
|
|
|
cdc.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var newinfo = new OP_LOGICINFO_md();
|
|
|
|
|
newinfo.GID = Guid.NewGuid();
|
|
|
|
|
newinfo.BSNO = BSNO;
|
|
|
|
|
newinfo.PROPNAME = PROPNAME;
|
|
|
|
|
newinfo.PROPVALUE = DicToStr(InfoDic);
|
|
|
|
|
cdc.OP_LOGICINFO.Add(newinfo);
|
|
|
|
|
cdc.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|