@ -42,6 +42,11 @@ using com.sun.tools.corba.se.idl.constExpr;
using static DSWeb . Common . DB . OP_SERVICEBILL_md ;
using static DSWeb . Common . DB . OP_SERVICEBILL_md ;
using DSWeb.Areas.CommMng.Models ;
using DSWeb.Areas.CommMng.Models ;
using DSWeb.Areas.Import.DAL.Comm ;
using DSWeb.Areas.Import.DAL.Comm ;
using DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL ;
using DSWeb.MvcShipping.Models.MsOpSeae ;
using DSWeb.Areas.Dispatch.Models ;
using DSWeb.MvcShipping.Models.MsChFee ;
using static DSWeb . Areas . CommMng . DAL . PublicAPIDAL . 泛 微 OAHelper ;
//using System.Web.Http;
//using System.Web.Http;
namespace DSWeb.Areas.Dispatch.Controllers
namespace DSWeb.Areas.Dispatch.Controllers
@ -207,6 +212,7 @@ namespace DSWeb.Areas.Dispatch.Controllers
public int limit { get ; set ; } = 30 ;
public int limit { get ; set ; } = 30 ;
public string bsno { get ; set ; }
}
}
/// <summary>
/// <summary>
@ -253,7 +259,6 @@ namespace DSWeb.Areas.Dispatch.Controllers
} ) ;
} ) ;
}
}
if ( QueryInfo . formname = = "USER" )
if ( QueryInfo . formname = = "USER" )
{
{
@ -383,7 +388,7 @@ namespace DSWeb.Areas.Dispatch.Controllers
} ) ;
} ) ;
}
}
if ( QueryInfo . formname = = "FRT ")
if ( QueryInfo . formname = = "FRT ")
{
{
var evList = new List < string > {
var evList = new List < string > {
@ -398,6 +403,30 @@ namespace DSWeb.Areas.Dispatch.Controllers
BaseInfo = evList
BaseInfo = evList
} ) ;
} ) ;
}
}
if ( QueryInfo . formname = = "ORSTATUS" )
{
var evList = new Dictionary < string , string > {
{ "9" , "录入状态" }
, { "1" , "提交审核" }
, { "2" , "驳回提交" }
, { "4" , "退舱" }
, { "8" , "确认订舱" }
, { "0" , "审核通过" }
, { "" , "全部" }
, { "-1" , "不含退舱" }
} ;
//evList.Add("委托单位");
_result = Json ( new
{
ErrorCode = 0 ,
Message = "获取成功" ,
BaseInfo = evList
} ) ;
}
return _result ;
return _result ;
}
}
catch ( Exception e )
catch ( Exception e )
@ -415,6 +444,265 @@ namespace DSWeb.Areas.Dispatch.Controllers
return Json ( new { ErrorCode = 500 , Message = "发生错误" } , JsonRequestBehavior . AllowGet ) ;
return Json ( new { ErrorCode = 500 , Message = "发生错误" } , JsonRequestBehavior . AllowGet ) ;
}
}
/// <summary>
/// 获取费用列表
/// </summary>
/// <param name="CUSTOMERNAME"></param>
/// <returns></returns>
[HttpPost]
public ActionResult GetFeeList ( EnumQueryInfo QueryInfo )
{
var cdc = new Common . DB . CommonDataContext ( ) ;
#region 正式逻辑
var openidok = BasicDataRefDAL . GetWxappUserInfo ( QueryInfo . AuthCode ) ;
if ( ! openidok . Success )
{
return Json ( new { ErrorCode = 500 , Message = $"发生错误:{openidok.Message}" } , JsonRequestBehavior . AllowGet ) ;
}
var userinfo = ( VW_user_md ) openidok . Data ;
# endregion
#region 测试逻辑
//var userinfo = cdc.VW_user .Where(x => x.CODENAME.ToUpper() == "ADMIN").FirstOrDefault();
# endregion
var _result = Json ( new { } ) ;
try
{
var bsno = QueryInfo . bsno ;
var 应 收 费 用 List = DSWeb . MvcShipping . DAL . MsChFeeDAL . MsChFeeDAL . GetDataList ( $" bsno='{bsno}' " , 1 , "seaeOrder" , userinfo . USERID , userinfo . SHOWNAME , userinfo . COMPANYID ) ;
var 应 付 费 用 List = DSWeb . MvcShipping . DAL . MsChFeeDAL . MsChFeeDAL . GetDataList ( $" bsno='{bsno}' " , 2 , "seaeOrder" , userinfo . USERID , userinfo . SHOWNAME , userinfo . COMPANYID ) ;
var evList = new List < DSWeb . MvcShipping . Models . MsChFee . MsChFee > ( ) ;
if ( 应 收 费 用 List ! = null & & 应 收 费 用 List . Count > 0 ) {
evList . AddRange ( 应 收 费 用 List ) ;
}
if ( 应 付 费 用 List ! = null & & 应 付 费 用 List . Count > 0 )
{
evList . AddRange ( 应 付 费 用 List ) ;
}
_result = Json ( new
{
ErrorCode = 0 ,
Message = "获取成功" ,
BaseInfo = evList
} ) ;
return _result ;
}
catch ( Exception e )
{
BasicDataRefDAL . SaveLog ( JsonConvert . SerializeObject ( e ) , e . Message , "wxapp" , "查询错误" ) ;
_result = Json ( new
{
ErrorCode = 500 ,
Message = e . Message ,
Data = e
} ) ;
}
return Json ( new { ErrorCode = 500 , Message = "发生错误" } , JsonRequestBehavior . AllowGet ) ;
}
/// <summary>
/// 保存费用列表
/// </summary>
/// <param name="CUSTOMERNAME"></param>
/// <returns></returns>
[HttpPost]
public ActionResult SaveFeeList ( EnumQueryInfo QueryInfo )
{
try
{
Stream postData = Request . InputStream ;
StreamReader sRead = new StreamReader ( postData ) ;
string postContent = sRead . ReadToEnd ( ) ;
sRead . Close ( ) ;
var cdc = new Common . DB . CommonDataContext ( ) ;
#region 正式逻辑
var openidok = BasicDataRefDAL . GetWxappUserInfo ( QueryInfo . AuthCode ) ;
if ( ! openidok . Success )
{
return Json ( new { ErrorCode = 500 , Message = $"发生错误:{openidok.Message}" } , JsonRequestBehavior . AllowGet ) ;
}
var userinfo = ( VW_user_md ) openidok . Data ;
# endregion
string LANGUAGES = "" ;
string userid = userinfo . USERID ;
var aaa = "" ;
var saveinfo = JsonConvert . DeserializeObject < SaveFeeListParam > ( postContent ) ;
var bodyList = saveinfo . Body ;
var result = DSWeb . MvcShipping . DAL . MsChFeeDAL . MsChFeeDAL . DoSave ( saveinfo . bsno , userinfo . USERID , userinfo . COMPANYID , bodyList , "" ) ;
if ( result . Success )
{
return Json ( new { ErrorCode = 0 , Message = result . Message , Data = result . Data } ) ;
}
else
{
return Json ( new { ErrorCode = 500 , Message = "保存错误:" + result . Message } ) ;
}
}
catch ( Exception e )
{
return Json ( new { ErrorCode = 500 , Message = "发生错误:" + e . Message } ) ;
}
}
/// <summary>
/// 删除费用列表
/// </summary>
/// <param name="CUSTOMERNAME"></param>
/// <returns></returns>
[HttpPost]
public ActionResult DelFeeList ( EnumQueryInfo QueryInfo )
{
try
{
Stream postData = Request . InputStream ;
StreamReader sRead = new StreamReader ( postData ) ;
string postContent = sRead . ReadToEnd ( ) ;
sRead . Close ( ) ;
var searchParams = JsonConvert . DeserializeObject < DelFeeListParam > ( postContent ) ;
var cdc = new Common . DB . CommonDataContext ( ) ;
#region 正式逻辑
var openidok = BasicDataRefDAL . GetWxappUserInfo ( QueryInfo . AuthCode ) ;
if ( ! openidok . Success )
{
return Json ( new { ErrorCode = 500 , Message = $"发生错误:{openidok.Message}" } , JsonRequestBehavior . AllowGet ) ;
}
var userinfo = ( VW_user_md ) openidok . Data ;
# endregion
string LAN = Convert . ToString ( Session [ "LANGUAGES" ] ) ;
var shanchuchenggong = "删除成功!" ;
if ( LAN = = "en-us" )
{
shanchuchenggong = "Successfully deleted! " ;
}
int iResult = 0 ;
var bodyList = searchParams . feeids ;
var result = new DBResult ( ) ;
if ( bodyList ! = "" | | bodyList ! = null )
{
iResult = DSWeb . MvcShipping . DAL . MsChFeeDAL . MsChFeeDAL . DeleteFee ( bodyList ) ;
DSWeb . MvcShipping . DAL . MsChFeeDAL . MsChFeeDAL . p_op_gain ( searchParams . bsno , userinfo . USERID ) ;
}
if ( iResult = = 1 )
{
result . Success = true ;
result . Message = shanchuchenggong ;
}
else if ( iResult = = 0 )
{
result . Success = false ;
result . Message = "出现错误,未删除!" ;
}
else if ( iResult = = - 1 )
{
result . Success = false ;
result . Message = "有异常,删除失败!" ;
}
else if ( iResult = = - 2 )
{
result . Success = false ;
result . Message = "删除异常,事务已回滚成功!" ;
}
return Json ( new { ErrorCode = 0 , result . Message } ) ;
}
catch ( Exception e )
{
return Json ( new { ErrorCode = 500 , Message = "发生错误:" + e . Message } ) ;
}
}
/// <summary>
/// 获取ctn列表
/// </summary>
/// <param name="CUSTOMERNAME"></param>
/// <returns></returns>
[HttpPost]
public ActionResult GetCtnList ( EnumQueryInfo QueryInfo )
{
var cdc = new Common . DB . CommonDataContext ( ) ;
#region 正式逻辑
var openidok = BasicDataRefDAL . GetWxappUserInfo ( QueryInfo . AuthCode ) ;
if ( ! openidok . Success )
{
return Json ( new { ErrorCode = 500 , Message = $"发生错误:{openidok.Message}" } , JsonRequestBehavior . AllowGet ) ;
}
var userinfo = ( VW_user_md ) openidok . Data ;
# endregion
#region 测试逻辑
//var userinfo = cdc.VW_user .Where(x => x.CODENAME.ToUpper() == "ADMIN").FirstOrDefault();
# endregion
var _result = Json ( new { } ) ;
try
{
var evList = cdc . OP_CTN . Where ( x = > x . BSNO = = QueryInfo . bsno ) . ToList ( ) ;
_result = Json ( new
{
ErrorCode = 0 ,
Message = "获取成功" ,
BaseInfo = evList
} ) ;
return _result ;
}
catch ( Exception e )
{
BasicDataRefDAL . SaveLog ( JsonConvert . SerializeObject ( e ) , e . Message , "wxapp" , "查询错误" ) ;
_result = Json ( new
{
ErrorCode = 500 ,
Message = e . Message ,
Data = e
} ) ;
}
return Json ( new { ErrorCode = 500 , Message = "发生错误" } , JsonRequestBehavior . AllowGet ) ;
}
# endregion
# endregion
@ -3003,6 +3291,62 @@ namespace DSWeb.Areas.Dispatch.Controllers
}
}
}
}
[System.Web.Http.HttpPost]
public ActionResult SaveSeaeOrderList ( EnumQueryInfo QueryInfo )
{
try
{
Stream postData = Request . InputStream ;
StreamReader sRead = new StreamReader ( postData ) ;
string postContent = sRead . ReadToEnd ( ) ;
sRead . Close ( ) ;
var cdc = new Common . DB . CommonDataContext ( ) ;
#region 正式逻辑
var openidok = BasicDataRefDAL . GetWxappUserInfo ( QueryInfo . AuthCode ) ;
if ( ! openidok . Success )
{
return Json ( new { ErrorCode = 500 , Message = $"发生错误:{openidok.Message}" } , JsonRequestBehavior . AllowGet ) ;
}
var userinfo = ( VW_user_md ) openidok . Data ;
# endregion
#region 测试逻辑
//var userinfo = cdc.VW_user.Where(x=>x.CODENAME=="admin").FirstOrDefault();
# endregion
string LANGUAGES = "" ;
string userid = userinfo . USERID ;
var aaa = "" ;
var saveinfo = JsonConvert . DeserializeObject < SaveSeaeOrderParam > ( postContent ) ;
var headData = saveinfo . Head ;
var bodyList = saveinfo . Body ;
var result = DSWeb . MvcShipping . DAL . MsSeaeOrderDAL . MsSeaeOrderDAL . DoSave ( saveinfo . opstatus , userinfo . USERID , userinfo . SHOWNAME , headData , bodyList ) ;
if ( result . Success )
{
return Json ( new { ErrorCode = 0 , Message = result . Message , Data = result . Data } ) ;
}
else
{
return Json ( new { ErrorCode = 500 , Message = "保存错误:" + result . Message } ) ;
}
}
catch ( Exception e )
{
return Json ( new { ErrorCode = 500 , Message = "发生错误:" + e . Message } ) ;
}
}
# endregion
# endregion
@ -3035,7 +3379,7 @@ namespace DSWeb.Areas.Dispatch.Controllers
result + = $" >= '{SearchValue}'" ;
result + = $" >= '{SearchValue}'" ;
}
}
if ( SearchType = = "equal ")
if ( SearchType = = "equal andsmaller ")
{
{
result + = $" <= '{SearchValue}'" ;
result + = $" <= '{SearchValue}'" ;
}
}
@ -3055,4 +3399,30 @@ namespace DSWeb.Areas.Dispatch.Controllers
}
}
}
}
public class SaveParam
{
/// <summary>
/// add edit
/// </summary>
public string opstatus { get ; set ; }
}
public class SaveSeaeOrderParam : SaveParam
{
public MsSeaeOrder Head { get ; set ; }
public List < MsSeaeOrderCtn > Body { get ; set ; }
}
public class SaveFeeListParam : SaveParam
{
public string bsno { get ; set ; }
public List < MsChFee > Body { get ; set ; }
}
public class DelFeeListParam : SaveParam
{
public string bsno { get ; set ; }
public string feeids { get ; set ; }
}
}
}