@ -31,6 +31,7 @@ using DSWeb.MvcShipping.Models.MsOpOther;
using DSWeb.Areas.Account.Models.BSNOLB ;
using DSWeb.Areas.MvcShipping.DAL.BookingConfirm ;
using DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL ;
using DSWeb.Areas.MvcShipping.Models.Message.VGM ;
namespace DSWeb.Areas.TruckMng.DAL.MsRptPcHeadEdit
@ -728,7 +729,7 @@ namespace DSWeb.Areas.TruckMng.DAL.MsRptPcHeadEdit
data . RowNumber = Convert . ToString ( reader [ "RowNumber" ] ) ;
data . BillNo = Convert . ToString ( reader [ "BillNo" ] ) ;
if ( reader [ "ExpDate" ] ! = DBNull . Value )
data . ExpDate = Convert . ToDateTime ( reader [ "ExpDate" ] ) . ToString ( "yyyy-MM-dd ") ; //到港日期
data . ExpDate = Convert . ToDateTime ( reader [ "ExpDate" ] ) . ToString ( "yyyy-MM-dd HH:mm:ss ") ; //到港日期
data . GroupDate = Convert . ToString ( reader [ "GroupDate" ] ) ;
data . ArriveDate = Convert . ToString ( reader [ "ArriveDate" ] ) ;
data . ReturnDate = Convert . ToString ( reader [ "ReturnDate" ] ) ;
@ -1549,13 +1550,14 @@ namespace DSWeb.Areas.TruckMng.DAL.MsRptPcHeadEdit
string str = "" ;
var strSql = new StringBuilder ( ) ;
strSql . Append ( "SELECT " ) ;
strSql . Append ( " VISIBLERANGE,OPERATERANGE ") ;
strSql . Append ( " VISIBLERANGE,OPERATERANGE ,AUTHORITYID,VSSQL ") ;
strSql . Append ( " from VW_User_Authority " ) ;
strSql . Append ( " where [NAME]='modMsPc' and USERID='" + userid + "' and ISDELETE=0" ) ;
string visiblerange = "4" ;
string operaterange = "4" ;
string AUTHORITYID = "" ;
string VSSQL = "" ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = db . ExecuteReader ( CommandType . Text , strSql . ToString ( ) ) )
{
@ -1563,6 +1565,8 @@ namespace DSWeb.Areas.TruckMng.DAL.MsRptPcHeadEdit
{
visiblerange = Convert . ToString ( reader [ "VISIBLERANGE" ] ) ;
operaterange = Convert . ToString ( reader [ "OPERATERANGE" ] ) ;
AUTHORITYID = Convert . ToString ( reader [ "AUTHORITYID" ] ) ;
VSSQL = Convert . ToString ( reader [ "VSSQL" ] ) ;
break ;
}
reader . Close ( ) ;
@ -1588,6 +1592,41 @@ namespace DSWeb.Areas.TruckMng.DAL.MsRptPcHeadEdit
str = " (t.UserCode in (select CODENAME from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "'))"
+ " OR t.UserName in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "')))" ;
}
else if ( visiblerange = = "5" )
{
var userstr = new StringBuilder ( ) ;
userstr . Append ( " select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1" ) ;
Database userdb = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = userdb . ExecuteReader ( CommandType . Text , userstr . ToString ( ) ) )
{
str = "" ;
while ( reader . Read ( ) )
{
if ( str = = "" )
{
str = " (t.UserName in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert . ToString ( reader [ "COMPANYID" ] ) + "'))) " ;
}
else
{
str = str + " or (t.UserName in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert . ToString ( reader [ "COMPANYID" ] ) + "'))) " ;
} ;
}
str = str + ")" ;
reader . Close ( ) ;
}
}
else if ( visiblerange = = "6" )
{
str = " EXISTS (select 1 from user_authority_range_op P left join [user] u on (u.GID=P.OPID) where (t.UserName=U.SHOWNAME ) AND P.userid='" + userid + "' and P.AUTHORITYID='" + AUTHORITYID + "' and P.VISIBLERANGE=1) " ;
}
else if ( visiblerange = = "0" )
{
str = " 1=1 " ;
@ -1600,6 +1639,307 @@ namespace DSWeb.Areas.TruckMng.DAL.MsRptPcHeadEdit
# endregion
static public List < MsWlPcHead_WFSDEdit > GetHYRDList ( string strCondition , string userid , string usercode , string username , string companyid , string sort )
{ //合同信息/商品信息
if ( ! string . IsNullOrWhiteSpace ( userid ) | | ! string . IsNullOrWhiteSpace ( usercode ) | | ! string . IsNullOrWhiteSpace ( username ) | | ! string . IsNullOrWhiteSpace ( companyid ) )
{
var rangstr = GetRangDAStr ( "index" , userid , usercode , username , companyid ) ;
if ( ! string . IsNullOrEmpty ( rangstr ) )
{
if ( ! string . IsNullOrEmpty ( strCondition ) )
{
strCondition = strCondition + " and " + rangstr ;
}
else
{
strCondition = rangstr ;
}
}
}
var strSql = new StringBuilder ( ) ;
strSql . Append ( " select CargoID,LoadFactory,PcBillType,PGid,BLTYPE,TRANSSTATUS " ) ;
strSql . Append ( " ,(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=99046 and EnumValueID=t.PcBillType) PcBillTypeREF " ) ;
strSql . Append ( " ,convert(bigint ,t.TimeMark) as timeMark,gId,UserName " ) ;
strSql . Append ( " ,ROW_NUMBER()over (partition by dbo.trimdate(expdate) order by expdate ) RowNumber " ) ;
strSql . Append ( " ,BillNo,dbo.trimtime(ExpDate) ExpDate, dbo.trimdate(expdate) GroupDate ,ArriveDate,ReturnDate " ) ;
strSql . Append ( " ,CustomerName,F_CustomerName,t.DrvName,t.DdName,t.DrvCode,t.TruckNo,MblNo,LinkMan,DstArea,DetiNation,ContainerQty,GOODSCOUNT,CBM " ) ;
strSql . Append ( " ,Ton,t.LoadCount,LoadPlace,TruckSpec,IsDouble,Property,RefBillNo,RefBillNose,MblNoSe,dbo.trimdate(EndPortDate) EndPortDate,VoyVeg,VoyVegSe,dbo.trimdate(EtDate) EtDate " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='运费' and FEETYPE=1)YUNFEI " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='回程合计' and FEETYPE=1)HCHJ " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='装卸费' and FEETYPE=1)ZXF " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='代垫费' and FEETYPE=1)DDF " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename not in('运费','回程合计','装卸费','代垫费') and FEETYPE=1)QTFee " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and FEETYPE=1)TotalFee,t.Remark,t.FeeStatus,dbo.trimdate(LrDate) LrDate" ) ;
strSql . Append ( " ,case when t.TruckNo='' then '接单' else case when isnull(isend,0)=0 then '派车' else '完成' end end PCSTATUSREF " ) ;
strSql . Append ( " ,ContainerType,LinkTel,YardName,LinkManSe,LinkTelSe,RtnYardName,BsType,CustName,CustLikeManName,CustTel,ChangedReson,DispatchName,RoadFee,FactoryAddr,ContainerNo,SealNo" ) ;
strSql . Append ( ",dbo.F_GetBillDrFeeStatus(t.GId) DRFEESTATUS" ) ;
strSql . Append ( ",dbo.F_GetBillCrFeeStatus(t.GId) CRFEESTATUS" ) ;
strSql . Append ( ",(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=t.GId ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS" ) ;
strSql . Append ( ",(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=t.GId ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO =t.GId ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR" ) ;
strSql . Append ( ",t.SALECORPID,(select [NAME] from [company] where GID=t.SALECORPID) as SALECORP,DCLASS,DUNNO" ) ;
strSql . Append ( " ,INVOICENO,KINDPKGS,CUSTNO,SalesName,GoodsName,PORTLOAD,DESTINATION,RtnDocStatus,RtnDocTime,ACCDATE,(CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF,(CASE ISNULL(BillStatus,0) WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF " ) ;
strSql . Append ( ",FuelPrice,FuelQty,RealMil,isEnd,RatedMil,RatedFuel,DetiNationSe,FactoryAddrSe,ContainerNoSe,EtDateSe,YardCodeSe,YardNameSe" ) ;
strSql . Append ( ",ISSHUISHI,ISGAOWEN,ISXIANLIANG,ISCHECHUAN,ISHAIWU,ISFENGXIANG,ISWEISHENBAO,ISBAOGUAN,ISPINGTAI,FrTruckNo,FrDrvName,WmsTruckNo,WmsDrvName" ) ;
strSql . Append ( ",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,ISCANCEL" ) ;
strSql . Append ( " from tMsWlPcHead t " ) ;
strSql . Append ( " LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=t.GID) " ) ;
if ( ! string . IsNullOrEmpty ( strCondition ) )
{
//strSql.Append(" where 1=1 AND " + strCondition);
strSql . Append ( " where (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) AND EXISTS ( select 1 from tMsWlPcHead WHERE t.GID=tMsWlPcHead.PGID AND " + strCondition + " )" ) ;
}
else
{
//strSql.Append(" where 1=1 " );
strSql . Append ( " where (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) " ) ;
}
var sortstring = DatasetSort . Getsortstring ( sort ) ;
if ( ! string . IsNullOrEmpty ( sortstring ) )
{
if ( sortstring . ToUpper ( ) . IndexOf ( "DRINVSTATUS" ) > = 0 )
strSql . Append ( " order by " + sortstring . Replace ( "DRINVSTATUS" , " CASE WHEN ISNULL(I.TTLINVDR,0)=0 THEN '未开票' ELSE CASE WHEN ISNULL(I.TTLINVDR,0)=ISNULL(I.TTLDR,0) THEN '已开票' ELSE '部分开票' END END " ) ) ;
if ( sortstring . ToUpper ( ) . IndexOf ( "DRDUISTATUS" ) > = 0 )
strSql . Append ( " order by " + sortstring . Replace ( "DRDUISTATUS" , " CASE WHEN ISNULL(I.TTLDUIDR,0)=0 THEN '未对账' ELSE CASE WHEN ISNULL(I.TTLDUIDR,0)=ISNULL(I.TTLDR,0) THEN '已对账' ELSE '部分对账' END END " ) ) ;
strSql . Append ( " order by " + sortstring ) ;
}
else
{
strSql . Append ( " order by Expdate,billno " ) ;
}
return SetHYRDData ( strSql ) ;
}
static public MsWlPcHead_WFSDEdit GetHYRDData ( string condition )
{
var strSql = new StringBuilder ( ) ;
strSql . Append ( " select CargoID,LoadFactory,PcBillType,PGid,BLTYPE,TRANSSTATUS " ) ;
strSql . Append ( " ,(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=99046 and EnumValueID=t.PcBillType) PcBillTypeREF " ) ;
strSql . Append ( " ,convert(bigint ,t.TimeMark) as timeMark,gId,UserName " ) ;
strSql . Append ( " ,ROW_NUMBER()over (partition by dbo.trimdate(expdate) order by expdate ) RowNumber " ) ;
strSql . Append ( " ,BillNo,dbo.trimtime(ExpDate) ExpDate, dbo.trimdate(expdate) GroupDate ,ArriveDate,ReturnDate " ) ;
strSql . Append ( " ,CustomerName,F_CustomerName,t.DrvName,t.DdName,t.DrvCode,t.TruckNo,MblNo,LinkMan,DstArea,DetiNation,ContainerQty,GOODSCOUNT,CBM " ) ;
strSql . Append ( " ,Ton,t.LoadCount,LoadPlace,TruckSpec,IsDouble,Property,RefBillNo,RefBillNose,MblNoSe,dbo.trimdate(EndPortDate) EndPortDate,VoyVeg,VoyVegSe,dbo.trimdate(EtDate) EtDate " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='运费' and FEETYPE=1)YUNFEI " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='回程合计' and FEETYPE=1)HCHJ " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='装卸费' and FEETYPE=1)ZXF " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename='代垫费' and FEETYPE=1)DDF " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and feename not in('运费','回程合计','装卸费','代垫费') and FEETYPE=1)QTFee " ) ;
strSql . Append ( " ,(select sum(amount) from ch_Fee where bsno=t.gid and FEETYPE=1)TotalFee,t.Remark,t.FeeStatus,dbo.trimdate(LrDate) LrDate" ) ;
strSql . Append ( " ,case when t.TruckNo='' then '接单' else case when isnull(isend,0)=0 then '派车' else '完成' end end PCSTATUSREF " ) ;
strSql . Append ( " ,ContainerType,ContainerTypeSe,LinkTel,YardName,LinkManSe,LinkTelSe,RtnYardName,BsType,CustName,CustLikeManName,CustTel,ChangedReson,DispatchName,RoadFee,FactoryAddr,ContainerNo,SealNo" ) ;
strSql . Append ( ",dbo.F_GetBillDrFeeStatus(t.GId) DRFEESTATUS" ) ;
strSql . Append ( ",dbo.F_GetBillCrFeeStatus(t.GId) CRFEESTATUS" ) ;
strSql . Append ( ",(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=t.GId ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS" ) ;
strSql . Append ( ",'' AS COLOR" ) ;
strSql . Append ( ",t.SALECORPID,(select [NAME] from [company] where GID=t.SALECORPID) as SALECORP,DCLASS,DUNNO" ) ;
strSql . Append ( ",ISSHUISHI,ISGAOWEN,ISXIANLIANG,ISCHECHUAN,ISHAIWU,ISFENGXIANG,ISWEISHENBAO,ISBAOGUAN,ISPINGTAI,FrTruckNo,FrDrvName,WmsTruckNo,WmsDrvName" ) ;
strSql . Append ( " ,INVOICENO,KINDPKGS,CUSTNO,SalesName,GoodsName,PORTLOAD,DESTINATION,RtnDocStatus,RtnDocTime,ACCDATE,(CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF,(CASE ISNULL(BillStatus,0) WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF" +
",FuelPrice,FuelQty,RealMil,isEnd,RatedMil,RatedFuel,DetiNationSe,FactoryAddrSe,ContainerNoSe,EtDateSe,YardCodeSe,YardNameSe " ) ;
strSql . Append ( ",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,ISCANCEL" ) ;
strSql . Append ( " from tMsWlPcHead t " ) ;
strSql . Append ( " LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=t.GID) " ) ;
if ( ! string . IsNullOrEmpty ( condition ) )
{
strSql . Append ( " where " + condition . Replace ( "~" , "" ) ) ; //str.Replace("b","**");
}
var list = SetHYRDData ( strSql ) ;
if ( list . Count > 0 )
return list [ 0 ] ;
return new MsWlPcHead_WFSDEdit ( ) ;
}
private static List < MsWlPcHead_WFSDEdit > SetHYRDData ( StringBuilder strSql )
{
var headList = new List < MsWlPcHead_WFSDEdit > ( ) ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = db . ExecuteReader ( CommandType . Text , strSql . ToString ( ) ) )
{
while ( reader . Read ( ) )
{
MsWlPcHead_WFSDEdit data = new MsWlPcHead_WFSDEdit ( ) ;
#region Set DB data to Object
data . PcBillType = Convert . ToString ( reader [ "PcBillType" ] ) ;
data . PcBillTypeREF = Convert . ToString ( reader [ "PcBillTypeREF" ] ) ;
data . timeMark = Convert . ToDecimal ( reader [ "timeMark" ] ) ;
data . gId = Convert . ToString ( reader [ "gId" ] ) ;
data . PGid = Convert . ToString ( reader [ "PGid" ] ) ;
data . BLTYPE = Convert . ToString ( reader [ "BLTYPE" ] ) ;
data . TRANSSTATUS = Convert . ToString ( reader [ "TRANSSTATUS" ] ) ;
data . RowNumber = Convert . ToString ( reader [ "RowNumber" ] ) ;
data . BillNo = Convert . ToString ( reader [ "BillNo" ] ) ;
if ( reader [ "ExpDate" ] ! = DBNull . Value )
data . ExpDate = Convert . ToDateTime ( reader [ "ExpDate" ] ) . ToString ( "yyyy-MM-dd" ) ; //到港日期
data . GroupDate = Convert . ToString ( reader [ "GroupDate" ] ) ;
data . ArriveDate = Convert . ToString ( reader [ "ArriveDate" ] ) ;
data . ReturnDate = Convert . ToString ( reader [ "ReturnDate" ] ) ;
data . CustomerName = Convert . ToString ( reader [ "CustomerName" ] ) ;
data . F_CustomerName = Convert . ToString ( reader [ "F_CustomerName" ] ) ;
data . DrvName = Convert . ToString ( reader [ "DrvName" ] ) ;
data . DdName = Convert . ToString ( reader [ "DdName" ] ) ;
data . DrvCode = Convert . ToString ( reader [ "DrvCode" ] ) ;
data . TruckNo = Convert . ToString ( reader [ "TruckNo" ] ) ;
data . MblNo = Convert . ToString ( reader [ "MblNo" ] ) ;
data . LinkMan = Convert . ToString ( reader [ "LinkMan" ] ) ;
data . DstArea = Convert . ToString ( reader [ "DstArea" ] ) ;
data . DetiNation = Convert . ToString ( reader [ "DetiNation" ] ) ;
data . ContainerQty = Convert . ToString ( reader [ "ContainerQty" ] ) ;
data . Ton = Convert . ToString ( reader [ "Ton" ] ) ;
data . GOODSCOUNT = Convert . ToString ( reader [ "GOODSCOUNT" ] ) ;
data . CBM = Convert . ToString ( reader [ "CBM" ] ) ;
data . LoadCount = Convert . ToString ( reader [ "LoadCount" ] ) ;
data . LoadPlace = Convert . ToString ( reader [ "LoadPlace" ] ) ;
data . TruckSpec = Convert . ToString ( reader [ "TruckSpec" ] ) ;
data . IsDouble = Convert . ToString ( reader [ "IsDouble" ] ) ;
data . Property = Convert . ToString ( reader [ "Property" ] ) ;
data . YUNFEI = Convert . ToString ( reader [ "yunfei" ] ) ;
data . HCHJ = Convert . ToString ( reader [ "HCHJ" ] ) ;
data . ZXF = Convert . ToString ( reader [ "ZXF" ] ) ;
data . DDF = Convert . ToString ( reader [ "DDF" ] ) ;
data . QTFee = Convert . ToString ( reader [ "QTFee" ] ) ;
data . TotalFee = Convert . ToString ( reader [ "TotalFee" ] ) ;
data . Remark = Convert . ToString ( reader [ "Remark" ] ) ;
data . FEESTATUS = Convert . ToString ( reader [ "FeeStatus" ] ) ;
data . UserName = Convert . ToString ( reader [ "UserName" ] ) ;
data . LrDate = Convert . ToString ( reader [ "LrDate" ] ) ;
data . PCSTATUSREF = Convert . ToString ( reader [ "PCSTATUSREF" ] ) ;
data . RefBillNo = Convert . ToString ( reader [ "RefBillNo" ] ) ;
data . RefBillNose = Convert . ToString ( reader [ "RefBillNose" ] ) ;
data . MblNoSe = Convert . ToString ( reader [ "MblNoSe" ] ) ;
data . ContainerType = Convert . ToString ( reader [ "ContainerType" ] ) ;
if ( BasicDataRefDAL . ReadFieldExist ( reader , "ContainerTypeSe" ) )
data . ContainerTypeSe = Convert . ToString ( reader [ "ContainerTypeSe" ] ) ;
data . LinkTel = Convert . ToString ( reader [ "LinkTel" ] ) ;
data . YardName = Convert . ToString ( reader [ "YardName" ] ) ;
data . LinkManSe = Convert . ToString ( reader [ "LinkManSe" ] ) ;
data . LinkTelSe = Convert . ToString ( reader [ "LinkTelSe" ] ) ;
data . RtnYardName = Convert . ToString ( reader [ "RtnYardName" ] ) ;
data . BsType = Convert . ToString ( reader [ "BsType" ] ) ;
data . CustName = Convert . ToString ( reader [ "CustName" ] ) ;
data . CustLikeManName = Convert . ToString ( reader [ "CustLikeManName" ] ) ;
data . CustTel = Convert . ToString ( reader [ "CustTel" ] ) ;
data . ChangedReson = Convert . ToString ( reader [ "ChangedReson" ] ) ;
data . FactoryAddr = Convert . ToString ( reader [ "FactoryAddr" ] ) ;
data . DispatchName = Convert . ToString ( reader [ "DispatchName" ] ) ;
data . INVOICENO = Convert . ToString ( reader [ "INVOICENO" ] ) ;
data . KINDPKGS = Convert . ToString ( reader [ "KINDPKGS" ] ) ;
data . CUSTNO = Convert . ToString ( reader [ "CUSTNO" ] ) ;
data . SalesName = Convert . ToString ( reader [ "SalesName" ] ) ;
data . VoyVeg = Convert . ToString ( reader [ "VoyVeg" ] ) ;
data . VoyVegSe = Convert . ToString ( reader [ "VoyVegSe" ] ) ;
data . EtDate = Convert . ToString ( reader [ "EtDate" ] ) ;
data . EndPortDate = Convert . ToString ( reader [ "EndPortDate" ] ) ;
data . GoodsName = Convert . ToString ( reader [ "GoodsName" ] ) ;
data . PORTLOAD = Convert . ToString ( reader [ "PORTLOAD" ] ) ;
data . DESTINATION = Convert . ToString ( reader [ "DESTINATION" ] ) ;
data . CargoID = Convert . ToString ( reader [ "CARGOID" ] ) ;
data . LoadFactory = Convert . ToString ( reader [ "LOADFACTORY" ] ) ;
data . RtnDocStatus = Convert . ToString ( reader [ "RtnDocStatus" ] ) ;
data . RtnDocTime = Convert . ToString ( reader [ "RtnDocTime" ] ) ;
if ( reader [ "RoadFee" ] ! = DBNull . Value )
data . RoadFee = Convert . ToDecimal ( reader [ "RoadFee" ] ) ;
data . DRFEESTATUS = getfeestatus ( Convert . ToString ( reader [ "DRFEESTATUS" ] ) ) ;
data . CRFEESTATUS = getfeestatus ( Convert . ToString ( reader [ "CRFEESTATUS" ] ) ) ;
if ( reader [ "FEESTATUSREF" ] ! = DBNull . Value )
data . FEESTATUSREF = Convert . ToString ( reader [ "FEESTATUSREF" ] ) ; //费用状态
// if (reader["BSSTATUSREF"] != DBNull.Value)
data . BSSTATUSREF = Convert . ToString ( reader [ "BSSTATUSREF" ] ) ; //费用状态
data . ACCDATE = Convert . ToString ( reader [ "ACCDATE" ] ) ;
data . ContainerNo = Convert . ToString ( reader [ "ContainerNo" ] ) ;
data . SealNo = Convert . ToString ( reader [ "SealNo" ] ) ;
data . SALECORP = Convert . ToString ( reader [ "SALECORP" ] ) ;
data . SALECORPID = Convert . ToString ( reader [ "SALECORPID" ] ) ;
data . DCLASS = Convert . ToString ( reader [ "DCLASS" ] ) ;
data . DUNNO = Convert . ToString ( reader [ "DUNNO" ] ) ;
data . OPSTATUS = Convert . ToString ( reader [ "OPSTATUS" ] ) ;
data . COLOR = Convert . ToString ( reader [ "COLOR" ] ) ;
data . FuelPrice = Convert . ToString ( reader [ "FuelPrice" ] ) ;
if ( reader [ "FuelQty" ] ! = DBNull . Value )
data . FuelQty = Convert . ToDecimal ( reader [ "FuelQty" ] ) ;
if ( reader [ "RealMil" ] ! = DBNull . Value )
data . RealMil = Convert . ToDecimal ( reader [ "RealMil" ] ) ;
if ( reader [ "RatedMil" ] ! = DBNull . Value )
data . RatedMil = Convert . ToDecimal ( reader [ "RatedMil" ] ) ;
if ( reader [ "RatedFuel" ] ! = DBNull . Value )
data . RatedFuel = Convert . ToDecimal ( reader [ "RatedFuel" ] ) ;
data . DetiNationSe = Convert . ToString ( reader [ "DetiNationSe" ] ) ;
data . FactoryAddrSe = Convert . ToString ( reader [ "FactoryAddrSe" ] ) ;
data . ContainerNoSe = Convert . ToString ( reader [ "ContainerNoSe" ] ) ;
if ( reader [ "ISSHUISHI" ] ! = DBNull . Value )
data . ISSHUISHI = Convert . ToBoolean ( reader [ "ISSHUISHI" ] ) ;
if ( reader [ "ISGAOWEN" ] ! = DBNull . Value )
data . ISGAOWEN = Convert . ToBoolean ( reader [ "ISGAOWEN" ] ) ;
if ( reader [ "ISXIANLIANG" ] ! = DBNull . Value )
data . ISXIANLIANG = Convert . ToBoolean ( reader [ "ISXIANLIANG" ] ) ;
if ( reader [ "ISCHECHUAN" ] ! = DBNull . Value )
data . ISCHECHUAN = Convert . ToBoolean ( reader [ "ISCHECHUAN" ] ) ;
if ( reader [ "ISHAIWU" ] ! = DBNull . Value )
data . ISHAIWU = Convert . ToBoolean ( reader [ "ISHAIWU" ] ) ;
if ( reader [ "ISFENGXIANG" ] ! = DBNull . Value )
data . ISFENGXIANG = Convert . ToBoolean ( reader [ "ISFENGXIANG" ] ) ;
if ( reader [ "ISWEISHENBAO" ] ! = DBNull . Value )
data . ISWEISHENBAO = Convert . ToBoolean ( reader [ "ISWEISHENBAO" ] ) ;
if ( reader [ "ISBAOGUAN" ] ! = DBNull . Value )
data . ISBAOGUAN = Convert . ToBoolean ( reader [ "ISBAOGUAN" ] ) ;
if ( reader [ "ISPINGTAI" ] ! = DBNull . Value )
data . ISPINGTAI = Convert . ToBoolean ( reader [ "ISPINGTAI" ] ) ;
data . FrTruckNo = Convert . ToString ( reader [ "FrTruckNo" ] ) ;
data . FrDrvName = Convert . ToString ( reader [ "FrDrvName" ] ) ;
data . WmsTruckNo = Convert . ToString ( reader [ "WmsTruckNo" ] ) ;
data . WmsDrvName = Convert . ToString ( reader [ "WmsDrvName" ] ) ;
data . EtDateSe = Convert . ToString ( reader [ "EtDateSe" ] ) ;
data . YardCodeSe = Convert . ToString ( reader [ "YardCodeSe" ] ) ;
data . YardNameSe = Convert . ToString ( reader [ "YardNameSe" ] ) ;
data . isEnd = Convert . ToString ( reader [ "isEnd" ] ) ;
decimal ttldr = 0 ;
decimal ttlduidr = 0 ;
if ( reader [ "TTLDR" ] ! = DBNull . Value )
ttldr = Convert . ToDecimal ( reader [ "TTLDR" ] ) ;
decimal ttlinvdr = 0 ;
if ( reader [ "TTLINVDR" ] ! = DBNull . Value )
ttlinvdr = Convert . ToDecimal ( reader [ "TTLINVDR" ] ) ;
if ( reader [ "TTLDUIDR" ] ! = DBNull . Value )
ttlduidr = Convert . ToDecimal ( reader [ "TTLDUIDR" ] ) ;
if ( ttlinvdr = = 0 ) data . DRINVSTATUS = "未开票" ;
else if ( ttlinvdr = = ttldr ) data . DRINVSTATUS = "已开票" ;
else if ( ttlinvdr ! = ttldr ) data . DRINVSTATUS = "部分开票" ;
if ( ttlduidr = = 0 ) data . DRDUISTATUS = "未对账" ;
else if ( ttlduidr = = ttldr ) data . DRDUISTATUS = "已对账" ;
else if ( ttlduidr ! = ttldr ) data . DRDUISTATUS = "部分对账" ;
data . ISCANCEL = Convert . ToString ( reader [ "ISCANCEL" ] ) ;
# endregion
headList . Add ( data ) ;
}
reader . Close ( ) ;
}
return headList ;
}
public static DBResult SaveFixFee ( string LE_ID , List < MsWlPcFixed > bodyList )
{