@ -11,6 +11,11 @@ using DSWeb.TruckMng.Helper.Repository;//ModelObjectRepository
using DSWeb.MvcShipping.Helper ;
using DSWeb.Areas.CommMng.DAL ; //使用获取权限子句
using DSWeb.Areas.SysMng.DAL.SysTask ;
using DSWeb.MvcShipping.DAL.ChMonthCloseDAL ;
using DSWeb.MvcShipping.DAL.MsSysBillNoSet ;
using HcUtility.Core ;
using DSWeb.MvcShipping.Models.MsChFee ;
using DSWeb.MvcShipping.DAL.MsChFeeDAL ;
namespace DSWeb.Areas.MvcShipping.DAL.MsOp_InternalTrade
{
@ -154,7 +159,806 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_InternalTrade
}
# endregion
public static DBResult ImpOpInternalTrade ( DataTable table , string userid , string username , string companyid )
{
var result = new DBResult ( ) ;
var PreCUSTNO = "" ;
var BSNO = "" ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
var cmdInsert =
db . GetSqlStringCommand (
@ "insert into op_InternalTrade_Detail (GID,BSNO,ORDERNO,LOTNO,GOODSNAME,PACKEGS,LOADDATE,LOADADDR,SEQUENCE)
values ( @GID , @BSNO , @ORDERNO , @LOTNO , @GOODSNAME , @PACKEGS , @LOADDATE , @LOADADDR , @SEQUENCE ) ");
var _date = System . DateTime . Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) ;
try
{
var CUSTOMERNAME = "" ;
var TRUCKER = "" ;
var TRUCKER2 = "" ;
var CARRIER = "" ;
int num = 0 ;
foreach ( DataRow row in table . Rows )
{
if ( row [ 1 ] . ToString ( ) ! = "" )
{
num = num + 1 ;
var CUSTNO = Convert . ToString ( row [ "委托编号" ] ) ;
if ( ! string . IsNullOrEmpty ( CUSTNO ) )
{
PreCUSTNO = CUSTNO ;
num = 0 ;
var headData = new MsOp_INTERNALTRADEmb ( ) ;
headData . GetTableField ( db ) ;
BSNO = System . Guid . NewGuid ( ) . ToString ( ) ;
headData . SetValue ( "BSNO" , BSNO ) ;
headData . SetValue ( "MASTERNO" , BSNO ) ;
headData . SetValue ( "BSSTATUS" , "0" ) ;
headData . SetValue ( "FEESTATUS" , "0" ) ;
headData . SetValue ( "BSDATE" , _date ) ;
headData . SetValue ( "CREATOR" , username ) ;
headData . SetValue ( "OP" , username ) ;
headData . SetValue ( "DOC" , username ) ;
headData . SetValue ( "CUSTSERVICE" , username ) ;
headData . SetValue ( "CORPID" , companyid ) ;
headData . SetValue ( "SALECORPID" , companyid ) ;
headData . DbOperationType = DbOperationType . DbotIns ;
headData . SetValue ( "CUSTNO" , CUSTNO ) ;
CUSTOMERNAME = Convert . ToString ( row [ "委托单位" ] ) ;
headData . SetValue ( "CUSTOMERNAME" , CUSTOMERNAME ) ;
headData . SetValue ( "MBLNO" , Convert . ToString ( row [ "主提单号" ] ) ) ;
headData . SetValue ( "OP" , Convert . ToString ( row [ "操作" ] ) ) ;
headData . SetValue ( "SALE" , Convert . ToString ( row [ "销售" ] ) ) ;
CARRIER = Convert . ToString ( row [ "船公司" ] ) ;
headData . SetValue ( "CARRIER" , CARRIER ) ;
headData . SetValue ( "VESSEL" , Convert . ToString ( row [ "船名" ] ) ) ;
headData . SetValue ( "VOYNO" , Convert . ToString ( row [ "航次" ] ) ) ;
var period = ChMonthCloseDAL . GetData ( "" , companyid ) ;
if ( Convert . ToDateTime ( period . FDAY ) > DateTime . Now )
{
headData . SetValue ( "ACCDATE" , period . PERIOD ) ;
}
else
{
headData . SetValue ( "ACCDATE" , DateTime . Now . ToString ( "yyyy-MM" ) ) ;
}
headData . SetValue ( "PORTLOADID" , Convert . ToString ( row [ "启运港" ] ) ) ;
headData . SetValue ( "ETD" , Convert . ToString ( row [ "开船日期" ] ) ) ;
headData . SetValue ( "ETA" , Convert . ToString ( row [ "到港日期" ] ) ) ;
headData . SetValue ( "EMPTYCTNTOSHIPPERDATE" , Convert . ToString ( row [ "提箱日期" ] ) ) ;
headData . SetValue ( "CTNALL" , Convert . ToString ( row [ "箱型" ] ) ) ;
headData . SetValue ( "SALEDEPT" , Convert . ToString ( row [ "所属部门" ] ) ) ;
TRUCKER = Convert . ToString ( row [ "装货车队" ] ) ;
headData . SetValue ( "TRUCKER" , TRUCKER ) ;
headData . SetValue ( "TRUCKNO" , Convert . ToString ( row [ "装货车牌号" ] ) ) ;
headData . SetValue ( "CNTRNO" , Convert . ToString ( row [ "箱号" ] ) ) ;
headData . SetValue ( "SEALNO" , Convert . ToString ( row [ "封号" ] ) ) ;
headData . SetValue ( "PORTDISCHARGEID" , Convert . ToString ( row [ "目的港" ] ) ) ;
headData . SetValue ( "CONSIGNEE" , Convert . ToString ( row [ "收货人" ] ) ) ;
headData . SetValue ( "CONSIGNEETEL" , Convert . ToString ( row [ "收货人电话" ] ) ) ;
headData . SetValue ( "PlACERECEIPT" , Convert . ToString ( row [ "收货人地址" ] ) ) ;
TRUCKER2 = Convert . ToString ( row [ "送货车队名称" ] ) ;
headData . SetValue ( "TRUCKER2" , TRUCKER2 ) ;
headData . SetValue ( "TRUCKNO2" , Convert . ToString ( row [ "送货车牌号" ] ) ) ;
headData . SetValue ( "RECEIVEDATE" , Convert . ToString ( row [ "到厂日期" ] ) ) ;
headData . SetValue ( "DISCHARGEREMARK" , Convert . ToString ( row [ "备注" ] ) ) ;
var modb = new ModelObjectDB ( ) ;
result = modb . Save ( headData ) ;
}
if ( result . Success )
{
cmdInsert . Parameters . Clear ( ) ;
db . AddInParameter ( cmdInsert , "@GID" , DbType . String , Guid . NewGuid ( ) . ToString ( ) ) ;
db . AddInParameter ( cmdInsert , "@BSNO" , DbType . String , BSNO ) ;
db . AddInParameter ( cmdInsert , "@ORDERNO" , DbType . String , Convert . ToString ( row [ "系统订单号" ] ) ) ;
db . AddInParameter ( cmdInsert , "@LOTNO" , DbType . String , Convert . ToString ( row [ "批次号" ] ) ) ;
db . AddInParameter ( cmdInsert , "@GOODSNAME" , DbType . String , Convert . ToString ( row [ "品名" ] ) ) ;
db . AddInParameter ( cmdInsert , "@PACKEGS" , DbType . String , Convert . ToString ( row [ "单柜数量" ] ) ) ;
db . AddInParameter ( cmdInsert , "@LOADDATE" , DbType . String , Convert . ToString ( row [ "装箱时间" ] ) ) ;
db . AddInParameter ( cmdInsert , "@LOADADDR" , DbType . String , Convert . ToString ( row [ "装箱地点" ] ) ) ;
db . AddInParameter ( cmdInsert , "@SEQUENCE" , DbType . Int16 , num ) ;
db . ExecuteNonQuery ( cmdInsert ) ;
var newfeelist = new List < MsChFee > ( ) ;
var baoxian = Convert . ToString ( row [ "保险费" ] ) ;
var baoxiangongs = Convert . ToString ( row [ "保险公司名称" ] ) ;
if ( ( ! string . IsNullOrEmpty ( baoxian ) ) & & ( Convert . ToDecimal ( baoxian ) ! = 0 ) ) {
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "保险费" ;
enumValueBody . CustomerName = baoxiangongs ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( baoxian ) ;
enumValueBody . Amount = Convert . ToDecimal ( baoxian ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( baoxian ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var HYF = Convert . ToString ( row [ "海运费" ] ) ;
var HYFGS = Convert . ToString ( row [ "船公司名称" ] ) ;
if ( ( ! string . IsNullOrEmpty ( HYF ) ) & & ( Convert . ToDecimal ( HYF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "海运费" ;
enumValueBody . CustomerName = HYFGS ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( HYF ) ;
enumValueBody . Amount = Convert . ToDecimal ( HYF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( HYF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var QYGLYF = Convert . ToString ( row [ "起始港陆运费" ] ) ;
var QYGLYFGS = Convert . ToString ( row [ "车队名称1" ] ) ;
if ( ( ! string . IsNullOrEmpty ( QYGLYF ) ) & & ( Convert . ToDecimal ( QYGLYF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "起始港陆运费" ;
enumValueBody . CustomerName = QYGLYFGS ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( QYGLYF ) ;
enumValueBody . Amount = Convert . ToDecimal ( QYGLYF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( QYGLYF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var QYGLXF = Convert . ToString ( row [ "落箱费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( QYGLXF ) ) & & ( Convert . ToDecimal ( QYGLXF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "落箱费" ;
enumValueBody . CustomerName = TRUCKER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( QYGLXF ) ;
enumValueBody . Amount = Convert . ToDecimal ( QYGLXF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( QYGLXF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var QYGYYFJF = Convert . ToString ( row [ "起始港燃油附加费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( QYGYYFJF ) ) & & ( Convert . ToDecimal ( QYGYYFJF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "起始港燃油附加费" ;
enumValueBody . CustomerName = TRUCKER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( QYGYYFJF ) ;
enumValueBody . Amount = Convert . ToDecimal ( QYGYYFJF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( QYGYYFJF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var QYGCZF = Convert . ToString ( row [ "船证费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( QYGCZF ) ) & & ( Convert . ToDecimal ( QYGCZF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "船证费" ;
enumValueBody . CustomerName = TRUCKER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( QYGCZF ) ;
enumValueBody . Amount = Convert . ToDecimal ( QYGCZF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( QYGCZF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var MDGLYF = Convert . ToString ( row [ "目的港陆运费" ] ) ;
var MDGLYFGS = Convert . ToString ( row [ "车队名称2" ] ) ;
if ( ( ! string . IsNullOrEmpty ( MDGLYF ) ) & & ( Convert . ToDecimal ( MDGLYF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "目的港陆运费" ;
enumValueBody . CustomerName = MDGLYFGS ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( MDGLYF ) ;
enumValueBody . Amount = Convert . ToDecimal ( MDGLYF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( MDGLYF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var MDGZF = Convert . ToString ( row [ "目的港杂费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( MDGZF ) ) & & ( Convert . ToDecimal ( MDGZF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "目的港杂费" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( MDGZF ) ;
enumValueBody . Amount = Convert . ToDecimal ( MDGZF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( MDGZF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var YYFJF = Convert . ToString ( row [ "燃油附加费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( YYFJF ) ) & & ( Convert . ToDecimal ( YYFJF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "燃油附加费" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( YYFJF ) ;
enumValueBody . Amount = Convert . ToDecimal ( YYFJF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( YYFJF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var ZXF = Convert . ToString ( row [ "装卸费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( ZXF ) ) & & ( Convert . ToDecimal ( ZXF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "装卸费" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( ZXF ) ;
enumValueBody . Amount = Convert . ToDecimal ( ZXF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( ZXF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var BW1J = Convert . ToString ( row [ "保温一级" ] ) ;
if ( ( ! string . IsNullOrEmpty ( BW1J ) ) & & ( Convert . ToDecimal ( BW1J ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "保温一级" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( BW1J ) ;
enumValueBody . Amount = Convert . ToDecimal ( BW1J ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( BW1J ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var BW2J = Convert . ToString ( row [ "保温二级" ] ) ;
if ( ( ! string . IsNullOrEmpty ( BW2J ) ) & & ( Convert . ToDecimal ( BW2J ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "保温二级" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( BW2J ) ;
enumValueBody . Amount = Convert . ToDecimal ( BW2J ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( BW2J ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var BW3J = Convert . ToString ( row [ "保温三级" ] ) ;
if ( ( ! string . IsNullOrEmpty ( BW3J ) ) & & ( Convert . ToDecimal ( BW3J ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "保温三级" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( BW3J ) ;
enumValueBody . Amount = Convert . ToDecimal ( BW3J ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( BW3J ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var CGSLYF = Convert . ToString ( row [ "船公司陆运费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( CGSLYF ) ) & & ( Convert . ToDecimal ( CGSLYF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "陆运费" ;
enumValueBody . CustomerName = CARRIER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( CGSLYF ) ;
enumValueBody . Amount = Convert . ToDecimal ( CGSLYF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( CGSLYF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var MDGHDF = Convert . ToString ( row [ "目的港换单费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( MDGHDF ) ) & & ( Convert . ToDecimal ( MDGHDF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "换单费" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( MDGHDF ) ;
enumValueBody . Amount = Convert . ToDecimal ( MDGHDF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( MDGHDF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var RYFJF = Convert . ToString ( row [ "燃油附加费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( RYFJF ) ) & & ( Convert . ToDecimal ( RYFJF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "燃油附加费" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( RYFJF ) ;
enumValueBody . Amount = Convert . ToDecimal ( RYFJF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( RYFJF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var PSF = Convert . ToString ( row [ "破损" ] ) ;
if ( ( ! string . IsNullOrEmpty ( PSF ) ) & & ( Convert . ToDecimal ( PSF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "破损" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( PSF ) ;
enumValueBody . Amount = Convert . ToDecimal ( PSF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( PSF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
enumValueBody . Remark = Convert . ToString ( row [ "破损备注" ] ) ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var DCCQF = Convert . ToString ( row [ "堆存超期费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( DCCQF ) ) & & ( Convert . ToDecimal ( DCCQF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "堆存超期费" ;
enumValueBody . CustomerName = TRUCKER2 ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( DCCQF ) ;
enumValueBody . Amount = Convert . ToDecimal ( DCCQF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( DCCQF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var XSCQF = Convert . ToString ( row [ "箱使费超期" ] ) ;
if ( ( ! string . IsNullOrEmpty ( XSCQF ) ) & & ( Convert . ToDecimal ( XSCQF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "箱使费超期" ;
enumValueBody . CustomerName = CARRIER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( XSCQF ) ;
enumValueBody . Amount = Convert . ToDecimal ( XSCQF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( XSCQF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var XTFJF = Convert . ToString ( row [ "箱体附加费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( XTFJF ) ) & & ( Convert . ToDecimal ( XTFJF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "箱体附加费" ;
enumValueBody . CustomerName = CARRIER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( XTFJF ) ;
enumValueBody . Amount = Convert . ToDecimal ( XTFJF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( XTFJF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var YSYF = Convert . ToString ( row [ "运费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( YSYF ) ) & & ( Convert . ToDecimal ( YSYF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 1 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "运费" ;
enumValueBody . CustomerName = CUSTOMERNAME ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( YSYF ) ;
enumValueBody . Amount = Convert . ToDecimal ( YSYF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( YSYF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var HYGZF = Convert . ToString ( row [ "海运港杂费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( HYGZF ) ) & & ( Convert . ToDecimal ( HYGZF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "海运港杂费" ;
enumValueBody . CustomerName = CARRIER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( HYGZF ) ;
enumValueBody . Amount = Convert . ToDecimal ( HYGZF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( HYGZF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var HYCZF = Convert . ToString ( row [ "海运操作费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( HYCZF ) ) & & ( Convert . ToDecimal ( HYCZF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "海运操作费" ;
enumValueBody . CustomerName = CARRIER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( HYCZF ) ;
enumValueBody . Amount = Convert . ToDecimal ( HYCZF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( HYCZF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
var HYDZF = Convert . ToString ( row [ "海运单证费" ] ) ;
if ( ( ! string . IsNullOrEmpty ( HYCZF ) ) & & ( Convert . ToDecimal ( HYCZF ) ! = 0 ) )
{
var enumValueBody = new MsChFee ( ) ;
enumValueBody . GId = Guid . NewGuid ( ) . ToString ( ) ;
enumValueBody . BsNo = "*" ;
enumValueBody . FeeType = 2 ;
enumValueBody . FeeStatus = 0 ;
enumValueBody . FeeName = "海运单证费" ;
enumValueBody . CustomerName = CARRIER ;
enumValueBody . EnteroPerator = userid ;
enumValueBody . Unit = "票" ;
enumValueBody . Quantity = 1 ;
enumValueBody . UnitPrice = Convert . ToDecimal ( HYDZF ) ;
enumValueBody . Amount = Convert . ToDecimal ( HYDZF ) ;
enumValueBody . NoTaxAmount = Convert . ToDecimal ( HYDZF ) ;
enumValueBody . Currency = "RMB" ;
enumValueBody . ExChangerate = 1 ;
enumValueBody . IsOpen = "0" ;
enumValueBody . IsAdvancedpay = "0" ;
enumValueBody . FeeStatus = 1 ;
enumValueBody . TaxRate = 0 ;
enumValueBody . AccTaxRate = 0 ;
enumValueBody . IsInvoice = "0" ;
enumValueBody . LOCALCURR = "RMB" ;
if ( enumValueBody . Amount ! = 0 )
newfeelist . Add ( enumValueBody ) ;
}
if ( newfeelist . Count ! = 0 )
MsChFeeDAL . SaveUpdateFee ( newfeelist , BSNO , userid ) ;
}
}
}
result . Success = true ;
result . Message = "导入成功" ;
}
catch ( Exception ex )
{
result . Success = false ;
result . Message = "导入中出错:" + ex . Message ;
}
return result ;
}
}
}