dev
ddlucky 5 months ago
parent 888e045328
commit a3a69a1397

@ -3877,5 +3877,18 @@ namespace DSWeb.Common.DB
public DateTime? CREATETIME { get; set; }
}
[Table("code_ctn_edi")]
public partial class code_ctn_edi_md
{
[Key]
public string GID { get; set; }
public string CTN { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
}
}

@ -133,6 +133,9 @@ namespace DSWeb.Common.DB
public DbSet<t_PublicInterface_Log_md> t_PublicInterface_Log { get; set; }
public DbSet<code_disport_edi_md> code_disport_edi { get; set; }
public DbSet<code_ctn_edi_md> code_ctn_edi { get; set; }
}

@ -14,6 +14,7 @@ using Quartz.Util;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
@ -3639,13 +3640,21 @@ SELECT @ps_BillNo as N'billno'";
}
var _ = Get("海关放行");
if (_ != null) result. = _;
if (_ != null)
{
result. = _;
result. = true;
}
var _ = Get("码放");
if (_ != null) result. = _;
var _ = Get("装载");
if (_ != null) result. = _;
if (_ != null)
{
result. = _;
result. = true;
}
var _ = Get("舱单");
if (_ != null) result. = _;

@ -66,6 +66,7 @@ using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.MvcShipping.Models.MsSysThirdPartyAccount;
using System.Collections.Specialized;
using DSWeb.MvcShipping.DAL.MsSysThirdPartyAccount;
using DSWeb.MvcShipping.Models.CodeCtnEdi;
namespace DSWeb.Areas.CommMng.DAL
{
@ -3112,6 +3113,7 @@ namespace DSWeb.Areas.CommMng.DAL
return SetCodeDisportData(strSql);
}
static public List<CodeDisportModel> GetCodeRailwayPortList(string condition)
{
String strSql = "SELECT PORTENAME PORT,PORTCNAME CNAME,'' EDICODE,(PORTENAME+'-'+PORTCNAME) as CodeAndName,'' LANE from code_railwayport where ";
@ -3232,6 +3234,122 @@ namespace DSWeb.Areas.CommMng.DAL
}
#endregion
#region edi代码对应
static public List<CodeCtnEdi> GetCustList(string strCondition, string sort = null)
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append("GID,CUST as CTN,EDICODE,EDINAME,REMARK");
strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97012 and EnumValueID=code_cust_edi.EDINAME) as EDINAMEREF,'' as PORTID");
strSql.Append(" from code_cust_edi where 1=1 ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" and " + strCondition);
}
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
strSql.Append(" order by " + sortstring);
}
else
{
strSql.Append(" order by EDINAME,CUST");
}
return SetData(strSql);
}
private static List<CodeCtnEdi> SetData(StringBuilder strSql)
{
var headList = new List<CodeCtnEdi>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
CodeCtnEdi data = new CodeCtnEdi();
#region Set DB data to Object
data.GID = Convert.ToString(reader["GID"]);
data.CTN = Convert.ToString(reader["CTN"]);
data.EDICODE = Convert.ToString(reader["EDICODE"]);
data.EDINAME = Convert.ToString(reader["EDINAME"]);
data.EDINAMEREF = Convert.ToString(reader["EDINAMEREF"]);
data.REMARK = Convert.ToString(reader["REMARK"]);
data.PORTID = Convert.ToString(reader["PORTID"]);
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
public static string GetCustEdiNameByName(string CUSTOMERNAME, string EDINAME)
{
var condition = $"code_cust_edi.CUST='{CUSTOMERNAME}' and EDINAME='{EDINAME}'";
var result = GetCustList(condition);
if (result != null && result.Count > 0)
{
return result[0].CTN;
}
else
{
return CUSTOMERNAME;
}
}
public static string GetCustEdiNameByEdiCode(string EDICODE, string EDINAME)
{
var condition = $"code_cust_edi.EDICODE='{EDICODE}' and EDINAME='{EDINAME}'";
var result = GetCustList(condition);
if (result != null && result.Count > 0)
{
return result[0].CTN;
}
else
{
return EDICODE;
}
}
static public string GetPortEDICODEByPORTNAMEorPORTIDAndEDIName(string PORTNAME, string EDINAME)
{
var cdc = new CommonDataContext();
var info = cdc.code_disport_edi.Where(x => (x.PORTDISCHARGE == PORTNAME || x.PORTID == PORTNAME) && x.EDINAME == EDINAME).ToList();
if (info == null || info.Count == 0)
{
return PORTNAME;
}
else {
return info[0].EDICODE;
}
}
static public string GetCtnEDICODEByCtnallAndEDIName(string CTNALL, string EDINAME)
{
var cdc = new CommonDataContext();
var info = cdc.code_ctn_edi.Where(x => x.CTN == CTNALL && x.EDINAME == EDINAME).ToList();
if (info == null || info.Count == 0)
{
return CTNALL;
}
else
{
return info[0].EDICODE;
}
}
#endregion
#region 品名类型
static public List<sys_template> Getsys_templateList()
{
@ -7441,6 +7559,16 @@ namespace DSWeb.Areas.CommMng.DAL
return result;
}
public static void CheckWebconfig(string itemname, ref DBResult result)
{
var item = ConfigurationManager.AppSettings[itemname];
if (string.IsNullOrWhiteSpace(item))
{
result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目");
}
}
}
public class BarCodeDrawing

@ -843,7 +843,7 @@ namespace DSWeb.Areas.CommMng.DAL
// 船公司 = 船公司edi代码List[0].CUST;
//}
= MsCodeCtnEdiDAL.GetCustEdiNameByName(carrier, "DJY");
= BasicDataRefDAL.GetCustEdiNameByEdiCode(carrier, "DJY");
//var carrier_clientList = cdc.info_client.Where(x => x.SHORTNAME == 船公司).ToList();
//if (carrier_clientList != null && carrier_clientList.Count > 0)
@ -858,12 +858,12 @@ namespace DSWeb.Areas.CommMng.DAL
= issutypeedicode.BLTYPE;
}
var =MsCodeCtnEdiDAL.GetCustEdiNameByName(customername, "DJY");
var = BasicDataRefDAL.GetCustEdiNameByEdiCode(customername, "DJY");
var = MsCodeCtnEdiDAL.GetCustEdiNameByName(shipagency, "DJY");
var = BasicDataRefDAL.GetCustEdiNameByEdiCode(shipagency, "DJY");
var = MsCodeCtnEdiDAL.GetCustEdiNameByName(yard, "DJY");
var = BasicDataRefDAL.GetCustEdiNameByEdiCode(yard, "DJY");
//int? 申请箱使天数 = null;

File diff suppressed because it is too large Load Diff

@ -1495,7 +1495,7 @@ namespace DSWeb.MvcShipping.Controllers
//{
var djylist = new List<MsOpSeae>();
djylist.Add(headData);
MsOpSeaeEdiPortDAL.SendToDJY(djylist, Convert.ToString(Session["COMPANYID"]));
MsOpSeaeEdiPortDAL.SendToDJY(djylist, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
//}
if (result.Success) {
@ -4315,7 +4315,7 @@ namespace DSWeb.MvcShipping.Controllers
MsOpStatusNewDAL dal = new MsOpStatusNewDAL();
dal.UpdateMainStatus(bsnos, 4, uname);
}
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]));
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
@ -4681,7 +4681,7 @@ namespace DSWeb.MvcShipping.Controllers
// result.Success = false;
// result.Message = aFtpWeb.err;
//}
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]));
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
else
{
@ -5025,7 +5025,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]));
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
else
@ -5194,7 +5194,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]));
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
else
@ -5969,7 +5969,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]));
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
else
{
@ -7507,7 +7507,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]));
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]));
}
catch

@ -7,6 +7,7 @@ using DSWeb.MvcShipping.Models.MsCodeAfrEdi;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DSWeb.Areas.CommMng.Models;
using HcUtility.Comm;
using Kingdee.BOS.WebApi.Client.Utils;
namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi
@ -69,19 +70,6 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi
return result;
}
public static string GetCustEdiNameByName(string CUSTOMERNAME, string EDINAME)
{
var condition = $"code_cust_edi.CUST='{CUSTOMERNAME}' and EDINAME='{EDINAME}'";
var result = GetCustList(condition);
if (result != null && result.Count > 0)
{
return result[0].CTN;
}
else {
return CUSTOMERNAME;
}
}
static public List<CodeCtnEdi> GetPkgsList(string strCondition, string sort = null)

@ -35,6 +35,8 @@ using System.Runtime.Remoting.Messaging;
using DSWeb.Common.DB;
using System.Web;
using WinSCP;
using System.Configuration;
//using DSWeb.Areas.CommMng.Models;
namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
{
@ -49325,13 +49327,68 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
#region 上传大简云
public static DBResult SendToDJY(List<MsOpSeae> headData, string companyid)
public static DBResult SendToDJY(List<MsOpSeae> headData, string companyid,string USERID)
{
var result = new DBResult();
var DJYUPDATE = MsSysParamSetDAL.GetData("PARAMNAME='DJYUPDATE'");
if (DJYUPDATE.PARAMVALUE != "1") return result;
try
{
var usenew = false;
var haveconfig = new DBResult();
BasicDataRefDAL.CheckWebconfig("DjyNewShippingOrder",ref haveconfig);
if (haveconfig.Success) {
var 使 = ConfigurationManager.AppSettings["DjyNewShippingOrder"];
if (使 == "true")
{
usenew = true;
}
else
{
}
}
//T_ALL_DA T_ALL_DA = new T_ALL_DA();
//string strCompanyName = T_ALL_DA.GetStrSQL("FULLNAME", "select top 1 FULLNAME from [company] where gid='" + companyid + "'");
//var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='DJYURL'");
//if (!string.IsNullOrEmpty(DJYURL.PARAMVALUE))
//{
// var orderlist = CreateEdiDjy(headData);
// var strJson = JsonConvert.SerializeObject(new { COMPANY_NAME = strCompanyName, BOOKINGS = orderlist });
// string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + "/booking/ReceiveBookingData", strJson);
//}
if (!usenew) {
return SendToDJY_OLD(headData, companyid);
}
if (usenew)
{
return SendToDJY_NEW(headData, companyid,USERID);
}
}
catch(Exception e)
{
BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), "", "订舱上传大简云", "错误");
}
return result;
}
private static DBResult SendToDJY_OLD(List<MsOpSeae> headData, string companyid)
{
var result = new DBResult();
try {
T_ALL_DA T_ALL_DA = new T_ALL_DA();
string strCompanyName = T_ALL_DA.GetStrSQL("FULLNAME", "select top 1 FULLNAME from [company] where gid='" + companyid + "'");
var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='DJYURL'");
@ -49340,9 +49397,47 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
var orderlist = CreateEdiDjy(headData);
var strJson = JsonConvert.SerializeObject(new { COMPANY_NAME = strCompanyName, BOOKINGS = orderlist });
string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + "/booking/ReceiveBookingData", strJson);
result.OK();
}
}
catch(Exception e)
catch (Exception e)
{
BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), "", "订舱上传大简云", "错误");
}
return result;
}
private static DBResult SendToDJY_NEW(List<MsOpSeae> headData, string companyid,string USERID)
{
var result = new DBResult();
try
{
//T_ALL_DA T_ALL_DA = new T_ALL_DA();
//string strCompanyName = T_ALL_DA.GetStrSQL("FULLNAME", "select top 1 FULLNAME from [company] where gid='" + companyid + "'");
//var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='DJYURL'");
//if (!string.IsNullOrEmpty(DJYURL.PARAMVALUE))
//{
// var orderlist = CreateEdiDjy(headData);
// var strJson = JsonConvert.SerializeObject(new { COMPANY_NAME = strCompanyName, BOOKINGS = orderlist });
// string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + "/booking/ReceiveBookingData", strJson);
// result.OK();
//}
foreach (var head in headData)
{
var hp = new DSWeb.Areas.CommMng.Models.DjySendOrderHelper(head, USERID);
var cansend = hp.GetCanSend();
if (cansend.Success) {
hp.DoSend();
}
}
}
catch (Exception e)
{
BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), "", "订舱上传大简云", "错误");
}
@ -49350,6 +49445,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
return result;
}
public static bool DeductionFee(string _MBLNO, string bsType)
{
string KFCUSTCODE =MsSysParamSetDAL.GetData("PARAMNAME='KFCUSTCODE'").PARAMVALUE;

@ -747,13 +747,13 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
// result.SetErrorInfo($"{head.INPUTBY} 此用户基本信息当中没有配置【大简云UID】");
//}
CheckWebconfig("SERVICEBILL", ref result);
CheckWebconfig("SERVICEBILLCompanyid", ref result);
CheckWebconfig("SERVICEBILL_URL", ref result);
CheckWebconfig("SERVICEBILL_MQUri", ref result);
CheckWebconfig("SERVICEBILL_QueuePrefix", ref result);
BasicDataRefDAL.CheckWebconfig("SERVICEBILL", ref result);
BasicDataRefDAL.CheckWebconfig("SERVICEBILLCompanyid", ref result);
BasicDataRefDAL.CheckWebconfig("SERVICEBILL_URL", ref result);
BasicDataRefDAL.CheckWebconfig("SERVICEBILL_MQUri", ref result);
BasicDataRefDAL.CheckWebconfig("SERVICEBILL_QueuePrefix", ref result);
CheckWebconfig("DS7PATH", ref result);
BasicDataRefDAL.CheckWebconfig("DS7PATH", ref result);
var = GetThirdPartyInfo(head);
@ -769,14 +769,14 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
}
private static void CheckWebconfig(string itemname,ref DBResult result)
{
var item = ConfigurationManager.AppSettings[itemname];
if (string.IsNullOrWhiteSpace(item))
{
result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目");
}
}
//private static void CheckWebconfig(string itemname,ref DBResult result)
//{
// var item = ConfigurationManager.AppSettings[itemname];
// if (string.IsNullOrWhiteSpace(item))
// {
// result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目");
// }
//}
public static DBResult RefreshYunZong(string BSNO, string USERID)
{

Loading…
Cancel
Save