@ -889,7 +889,6 @@ namespace DSWeb.MvcShipping.Controllers
}
# endregion
#region 保存
// public ContentResult Save(string opstatus, string data, string data2, string data3, string body)
// {
@ -1443,17 +1442,18 @@ namespace DSWeb.MvcShipping.Controllers
data2 = data2 . Replace ( "❥" , "<" ) ;
var headData = JsonConvert . Deserialize < MsOpSeae > ( data . Replace ( "}" , "," ) + data2 . Replace ( "{" , "" ) . Replace ( "}" , "," ) + data3 . Replace ( "{" , "" ) ) ;
var bodyList = JsonConvert . Deserialize < List < MsOpSeaeDetail > > ( body ) ;
var result = MsOpSeaeDAL . DoSave ( opstatus , headData , bodyList , Convert . ToString ( Session [ "USERID" ] ) , Convert . ToString ( Session [ "SHOWNAME" ] ) , Convert . ToString ( Session [ "COMPANYID" ] ) , Session [ "COMPANYNAME" ] . ToString ( ) ) ;
var result = MsOpSeaeDAL . DoSave ( opstatus , headData , bodyList , Convert . ToString ( Session [ "USERID" ] ) , Convert . ToString ( Session [ "SHOWNAME" ] ) , Convert . ToString ( Session [ "COMPANYID" ] ) , Session [ "COMPANYNAME" ] . ToString ( ) ) ;
//var bsopstatus = MsOpStatusDAL.GetData(" BSNO='" + headData.BSNO + "' AND (STATUS='已发确认' or STATUS='已发订舱') ");
//if (bsopstatus != null && !string.IsNullOrEmpty(bsopstatus.STATUS))
//{
var djylist = new List < MsOpSeae > ( ) ;
djylist . Add ( headData ) ;
MsOpSeaeEdiPortDAL . SendToDJY ( djylist , Convert . ToString ( Session [ "COMPANYID" ] ) ) ;
var djylist = new List < MsOpSeae > ( ) ;
djylist . Add ( headData ) ;
MsOpSeaeEdiPortDAL . SendToDJY ( djylist , Convert . ToString ( Session [ "COMPANYID" ] ) ) ;
//}
if ( result . Success ) {
if ( result . Success )
{
var jsonRespose = new JsonResponse
{
Success = result . Success ,
@ -1470,7 +1470,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
public ContentResult PLCopy ( string bsno , int copynum )
public ContentResult PLCopy ( string bsno , int copynum )
{
string userid = Convert . ToString ( Session [ "USERID" ] ) ;
@ -1481,8 +1481,8 @@ namespace DSWeb.MvcShipping.Controllers
}
var headData = MsOpSeaeDAL . GetData ( "BSNO='" + bsno + "'" ) ;
var bodyList = MsOpSeaeDAL . GetBodyList ( "BSNO='" + bsno + "'" ) ;
var headData = MsOpSeaeDAL . GetData ( "BSNO='" + bsno + "'" ) ;
var bodyList = MsOpSeaeDAL . GetBodyList ( "BSNO='" + bsno + "'" ) ;
//var mblnohead = "";
//var mblnonum = "";
//var mblno = headData.MBLNO;
@ -1502,7 +1502,7 @@ namespace DSWeb.MvcShipping.Controllers
DBResult result = new DBResult ( ) ;
for ( int i = 1 ; i < = copynum ; i + + )
for ( int i = 1 ; i < = copynum ; i + + )
{
//mblnonum = (Convert.ToInt32(mblnonum)+1).ToString();
//while (mblnonum.Length < numlength) {
@ -1510,7 +1510,7 @@ namespace DSWeb.MvcShipping.Controllers
// mblnonum = "0" + mblnonum;
//}
//var newmblno = mblnohead + mblnonum;
headData . MBLNO = "" ;
headData . MBLNO = "" ;
headData . CUSTNO = "" ;
headData . ORDERNO = "" ;
headData . BSNO = "topseae" + Guid . NewGuid ( ) . ToString ( ) ;
@ -1527,13 +1527,14 @@ namespace DSWeb.MvcShipping.Controllers
}
result = MsOpSeaeDAL . DoSave ( "add" , headData , bodyList , Convert . ToString ( Session [ "USERID" ] ) , Convert . ToString ( Session [ "SHOWNAME" ] ) , Convert . ToString ( Session [ "COMPANYID" ] ) , Session [ "COMPANYNAME" ] . ToString ( ) ) ;
if ( result . Success ) {
var head = MsOpSeaeEdiPortDAL . GetAmsData ( "BSNO='" + bsno + "'" ) ;
if ( result . Success )
{
var head = MsOpSeaeEdiPortDAL . GetAmsData ( "BSNO='" + bsno + "'" ) ;
head . BSNO = headData . BSNO ;
head . DbOperationType = DbOperationType . DbotIns ;
head . AMSNO = Guid . NewGuid ( ) . ToString ( ) ;
var modb = new ModelObjectDB ( ) ;
modb . Save ( head ) ;
modb . Save ( head ) ;
}
@ -1775,9 +1776,9 @@ namespace DSWeb.MvcShipping.Controllers
}
}
if ( detailpkgs ! = pkgs ) errorstr = errorstr + " 多品名中 件数总和与集装箱件数不一致!" ;
if ( detailkgs ! = kgs ) errorstr = errorstr + " 多品名中 重量总和与集装箱重量不一致!" ;
if ( detailcbm ! = cbm ) errorstr = errorstr + " 多品名中 立方数总和与集装箱立方不一致!" ;
if ( detailpkgs ! = pkgs ) errorstr = errorstr + " 多品名中 件数总和与集装箱件数不一致!" ;
if ( detailkgs ! = kgs ) errorstr = errorstr + " 多品名中 重量总和与集装箱重量不一致!" ;
if ( detailcbm ! = cbm ) errorstr = errorstr + " 多品名中 立方数总和与集装箱立方不一致!" ;
if ( errorstr ! = "" )
{
@ -1977,8 +1978,8 @@ namespace DSWeb.MvcShipping.Controllers
}
headData . SIREMARK = FullWidthToHalfWidth( ToDBC ( headData . SIREMARK ) ) ;
headData . SIREMARK = DelEndSpace( headData . SIREMARK ) ;
headData . SIREMARK = MsOpSeaeDAL. FullWidthToHalfWidth( MsOpSeaeDAL . ToDBC ( headData . SIREMARK ) ) ;
headData . SIREMARK = MsOpSeaeDAL. DelEndSpace( headData . SIREMARK ) ;
if ( isPost )
@ -2009,6 +2010,9 @@ namespace DSWeb.MvcShipping.Controllers
}
# endregion
#region 删除
@ -3089,16 +3093,16 @@ namespace DSWeb.MvcShipping.Controllers
//headData.CONSIGNEE = ToDBC(headData.CONSIGNEE);
//headData.NOTIFYPARTY = ToDBC(headData.NOTIFYPARTY);
//20191126 保存方法改为和主业务内的处理方法一致
headData . SHIPPER = FullWidthToHalfWidth( ToDBC ( headData . SHIPPER ) ) ;
headData . SHIPPER = DelEndSpace( headData . SHIPPER ) ;
headData . CONSIGNEE = FullWidthToHalfWidth( ToDBC ( headData . CONSIGNEE ) ) ;
headData . CONSIGNEE = DelEndSpace( headData . CONSIGNEE ) ;
headData . NOTIFYPARTY = FullWidthToHalfWidth( ToDBC ( headData . NOTIFYPARTY ) ) ;
headData . NOTIFYPARTY = DelEndSpace( headData . NOTIFYPARTY ) ;
headData . SHIPPER = MsOpSeaeDAL. FullWidthToHalfWidth( MsOpSeaeDAL . ToDBC ( headData . SHIPPER ) ) ;
headData . SHIPPER = MsOpSeaeDAL. DelEndSpace( headData . SHIPPER ) ;
headData . CONSIGNEE = MsOpSeaeDAL. FullWidthToHalfWidth( MsOpSeaeDAL . ToDBC ( headData . CONSIGNEE ) ) ;
headData . CONSIGNEE = MsOpSeaeDAL. DelEndSpace( headData . CONSIGNEE ) ;
headData . NOTIFYPARTY = MsOpSeaeDAL. FullWidthToHalfWidth( MsOpSeaeDAL . ToDBC ( headData . NOTIFYPARTY ) ) ;
headData . NOTIFYPARTY = MsOpSeaeDAL. DelEndSpace( headData . NOTIFYPARTY ) ;
headData . MARKS = ToDBC( headData . MARKS ) ;
headData . DESCRIPTION = ToDBC( headData . DESCRIPTION ) ;
headData . MARKS = MsOpSeaeDAL. ToDBC( headData . MARKS ) ;
headData . DESCRIPTION = MsOpSeaeDAL. ToDBC( headData . DESCRIPTION ) ;
headData . MODIFYUSER = Convert . ToString ( Session [ "USERID" ] ) ;
headData . MODIFYTIME = DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) ;
@ -4803,6 +4807,39 @@ namespace DSWeb.MvcShipping.Controllers
# endregion
#region 亿通EDI导出
public ContentResult IsCreateYTList ( string bsnos , string mblno , string filetype , string filerole , int isbill , string carrier )
{
var result = new DBResult ( ) ;
bsnos = bsnos . Replace ( "," , "','" ) ;
var headList = MsOpSeaeDAL . GetDataList ( "BSNO IN ('" + bsnos + "')" , CookieConfig . GetCookie_UserId ( Request ) , Convert . ToString ( Session [ "SHOWNAME" ] ) , Convert . ToString ( Session [ "COMPANYID" ] ) ) ;
var error = "" ;
foreach ( var head in headList ) {
if ( head . CARGOID = = "R" & & carrier = = "ZIM" & & filetype = = "E" )
{
var OpAms = MsOpSeaeEdiPortDAL . GetAmsData ( "BSNO='" + head . BSNO + "'" ) ;
if ( string . IsNullOrEmpty ( OpAms . SIREMARK ) )
{ error = error + "<br />主提单号:" + head . MBLNO + " SI备注为空" ; }
}
}
if ( ! string . IsNullOrEmpty ( error ) )
{
var jsonRespose2 = new JsonResponse { Success = false , Message = error + " 确定要发送SI吗? " } ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose2 ) } ;
}
else {
var jsonRespose = new JsonResponse { Success = true , Message = "" } ;
return new ContentResult ( ) { Content = JsonConvert . Serialize ( jsonRespose ) } ;
}
}
public ContentResult CreateYTList ( string bsnos , string mblno , string filetype , string filerole , int isbill , string carrier )
{
bsnos = bsnos . Replace ( "," , "','" ) ;