ShenZhenCHJY
ddlucky 7 months ago
parent e22461f9bf
commit 48cc3318f2

@ -4063,6 +4063,247 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion
#region 乐域导出类似于INTTR导出
public ContentResult CreateLeYuList(string bsnos, string mblno, string filetype, string filerole, int isbill, string carrier, int IsNADFW, string tbNADFWID, string tbNADFW)
{
bsnos = bsnos.Replace(",", "','");
var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var path = Server.MapPath("../../EDIFiles/SeaeEdi");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
var result = new DBResult();
if (filetype == "V")
{
#region VGM
var error = MsOpSeaeEdiPortDAL.IsCreateVGM(headList, "INTTRAVGM", filetype, filerole, "", "", "", "", "");
if (error == "")
{
var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='INTTRAVGM'", Convert.ToString(Session["COMPANYID"]));// AND CARRIERID='" + carrier + "'
var filename = "";
filename = MsOpSeaeEdiPortDAL.CreateVGM(headList, CookieConfig.GetCookie_UserId(Request), path, mblno, filerole, ftpset, "INTTRAVGM", isbill, 0, carrier, "", "", filetype, "", "", "", "", "");
if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null)
{
result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset);
var afilename = Path.GetFileName(filename);
MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "INTTRAVGM", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"]));
}
else
{
result.Success = false;
result.Message = "FTP参数没有设置,请先设置FTP参数!";
}
}
else
{
result.Success = false;
result.Message = error;
}
#endregion
}
else
{
#region 订舱、确认
var error = MsOpSeaeEdiPortDAL.IsCreateLeYu(headList, filetype, filerole, isbill, carrier, IsNADFW, tbNADFWID, tbNADFW);
if (error == "")
{
var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='INTTR' AND CARRIERID='" + carrier + "'", Convert.ToString(Session["COMPANYID"]));
if (ftpset.SENDCODE == "") ftpset = MsCodeFtpSetDAL.GetData("EDINAME='INTTR'", Convert.ToString(Session["COMPANYID"]));
var filename = "";
foreach (var headdata in headList)
{
var ediheadlist = new List<MsOpSeae>();
ediheadlist.Add(headdata);
if (filetype == "E")
filename = MsOpSeaeEdiPortDAL.CreateEdiLeYuSI(ediheadlist, CookieConfig.GetCookie_UserId(Request), path, mblno, filerole, ftpset, isbill, carrier, filetype);
else
filename = MsOpSeaeEdiPortDAL.CreateEdiLeYu(ediheadlist, CookieConfig.GetCookie_UserId(Request), path, mblno, filerole, ftpset, isbill, carrier, filetype, IsNADFW, tbNADFWID, tbNADFW);
if (filetype == "E" && (ftpset.SERVERIP2 != "" && ftpset.FOLDERNAME2 != ""))
{
result = MsOpSeaeEdiPortDAL.FtpFile2(filename, ftpset);
var afilename = Path.GetFileName(filename);
MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "INTTR", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"]));
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
foreach (var bill in ediheadlist)
{
if (filetype == "B")
{
var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else
{
var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SI','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
}
}
else if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null)
{
result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset);
var afilename = Path.GetFileName(filename);
MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "INTTR", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"]));
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
foreach (var bill in ediheadlist)
{
if (filetype == "B")
{
var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else
{
var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SI','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
}
}
else
{
result.Success = false;
result.Message = "FTP参数没有设置,请先设置FTP参数!";
}
}
}
else
{
result.Success = false;
result.Message = error;
}
#endregion
}
if (result.Success)
{
string uname = CookieConfig.GetCookie_UserName(Request);
if (filetype == "B")
{
MsOpStatusNewDAL dal = new MsOpStatusNewDAL();
dal.UpdateMainStatus(bsnos, 2, uname);
}
else if (filetype == "E")
{
MsOpStatusNewDAL dal = new MsOpStatusNewDAL();
dal.UpdateMainStatus(bsnos, 4, uname);
}
MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]));
}
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult SaveLeYuList(string bsnos, string mblno, string filetype, string filerole, int isbill, string carrier, int IsNADFW, string tbNADFWID, string tbNADFW)
{
bsnos = bsnos.Replace(",", "','");
#region 点击保存EDI保存状态
string uname = CookieConfig.GetCookie_UserName(Request);
if (filetype == "B")
{
MsOpStatusNewDAL dal = new MsOpStatusNewDAL();
dal.UpdateMainStatus(bsnos, 2, uname);
}
else if (filetype == "E")
{
MsOpStatusNewDAL dal = new MsOpStatusNewDAL();
dal.UpdateMainStatus(bsnos, 4, uname);
}
#endregion
var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var path = Server.MapPath("../../EDIFiles/SeaeEdi");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
var result = new DBResult();
if (filetype == "V")
{
#region VGM
var error = MsOpSeaeEdiPortDAL.IsCreateVGM(headList, "INTTRAVGM", filetype, filerole, "", "", "", "", "");
if (error == "")
{
var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='INTTRAVGM'", Convert.ToString(Session["COMPANYID"]));// AND CARRIERID='" + carrier + "'
if (ftpset.SENDCODE == "" || ftpset.RECEIVECODE == "")
{
result.Success = false;
result.Message = "EDI参数没有设置,请先设置EDI参数!";
}
else
{
var filename = "";
filename = MsOpSeaeEdiPortDAL.CreateVGM(headList, CookieConfig.GetCookie_UserId(Request), path, mblno, filerole, ftpset, "INTTRAVGM", isbill, 0, carrier, "", "", filetype, "", "", "", "", "");
filename = Path.GetFileName(filename);
result.Data = "../../EDIFiles/SeaeEdi/" + filename;
result.Success = true;
result.Message = filename;
}
}
else
{
result.Success = false;
result.Message = error;
}
#endregion
}
else
{
#region 订舱、确认
var error = MsOpSeaeEdiPortDAL.IsCreateINTTR(headList, filetype, filerole, isbill, carrier, IsNADFW, tbNADFWID, tbNADFW);
if (error == "")
{
var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='INTTR' AND CARRIERID='" + carrier + "'", Convert.ToString(Session["COMPANYID"]));
if (ftpset.SENDCODE == "") ftpset = MsCodeFtpSetDAL.GetData("EDINAME='INTTR'", Convert.ToString(Session["COMPANYID"]));
var filename = "";
if (filetype == "E")
filename = MsOpSeaeEdiPortDAL.CreateEdiINTTRSI(headList, CookieConfig.GetCookie_UserId(Request), path, mblno, filerole, ftpset, isbill, carrier, filetype);
else
filename = MsOpSeaeEdiPortDAL.CreateEdiINTTR(headList, CookieConfig.GetCookie_UserId(Request), path, mblno, filerole, ftpset, isbill, carrier, filetype, IsNADFW, tbNADFWID, tbNADFW);
filename = Path.GetFileName(filename);
result.Data = "../../EDIFiles/SeaeEdi/" + filename;
result.Success = true;
result.Message = filename;
}
else
{
result.Success = false;
result.Message = error;
}
#endregion
}
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message, Data = result.Data };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
#endregion

@ -1351,6 +1351,13 @@ namespace DSWeb.MvcShipping.Controllers
var hp = new InfoClientLimitHelper(_d.BSNO, "");
var = hp.GetLimit();
if ( == null) {
var _r = new DBResult();
_r.SetErrorInfo($"该业务委托单位【{hp.Bill.CUSTOMERNAME}】,没有设定本业务所属分部的欠费额度");
return BasicDataRefDAL.GetContentResult(_r);
}
headdata.TOTALLIMIT = .TOTALLIMIT;
headdata.CURRENTDEBT = .CURRENTDEBT;
headdata.REMAINLIMIT = .REMAINLIMIT;

@ -44,6 +44,7 @@ using DSWeb.Areas.Account.Models.ChfeeDetail;
using DSWeb.Areas.Account.Models.Chfee_do_detail;
using DSWeb.Areas.Account.Models.Chfee_Invoice;
using DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE;
using DSWeb.Areas.MvcShipping.DB;
namespace DSWeb.MvcShipping.DAL.MsInfoClient
{
@ -3766,14 +3767,16 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
/// </summary>
public class InfoClientLimitHelper
{
private Info_Client_Limit_md Head { get; set; }
public Info_Client_Limit_md Head { get; set; }
//private Info_Client_Limit_Change_md lastchange { get; set; }
private v_op_bill_mb Bill { get; set; }
public v_op_bill_mb Bill { get; set; }
private string CHANGEUSER { get; set; }
private info_client_md customer { get; set; }
private List<Info_Client_Limit_Change_md> ChangeDetail { get; set; }
public InfoClientLimitHelper() { }
@ -3816,13 +3819,20 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
/// <param name="USERNAME"></param>
public InfoClientLimitHelper(string BSNO, string USERNAME)
{
CHANGEUSER = USERNAME;
//cdc = new CommonDataContext();
Bill = cdc.v_op_bill.FirstOrDefault(x => x.BSNO == BSNO);
Head = cdc.Info_Client_Limit.FirstOrDefault(x => x.SALECORPID == Bill.SALECORPID && (x.CUSTOMERNAME == Bill.CUSTOMERNAME));
customer = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == Bill.CUSTOMERNAME);
CHANGEUSER = USERNAME;
if (customer != null)
{
Head = cdc.Info_Client_Limit.FirstOrDefault(x => x.SALECORPID == Bill.SALECORPID && (x.InfoClientId == customer.GID));
}
NewChange = new List<Info_Client_Limit_Change_md>();
//if (canuse()) {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save