@ -35,6 +35,7 @@ namespace JobCreateFee
string CustPsw = context . JobDetail . JobDataMap . GetString ( "CustPsw" ) ;
int reqTimeout = Convert . ToInt32 ( context . JobDetail . JobDataMap . GetString ( "RequestTimeout" ) ) ;
YTFEEHelper . feeName = context . JobDetail . JobDataMap . GetString ( "feeName" ) ;
YTFEEHelper . ydFeeName = context . JobDetail . JobDataMap . GetString ( "ydFeeName" ) ;
YTFEEHelper . secondPrintFeeName = context . JobDetail . JobDataMap . GetString ( "secondPrintFeeName" ) ;
@ -43,7 +44,11 @@ namespace JobCreateFee
YTFEEHelper . connStr = connStr ;
YTFEEHelper . 告 警 邮 箱 = context . JobDetail . JobDataMap . GetString ( "AlertMail" ) ;
var yesterday = DateTime . Now . AddDays ( - 2 ) . ToString ( "yyyy-MM-dd" ) ;
int DAYS = Convert . ToInt32 ( context . JobDetail . JobDataMap . GetString ( "DAYS" ) ) ;
string ENTEROPERATOR = context . JobDetail . JobDataMap . GetString ( "ENTEROPERATOR" ) ;
var yesterday = DateTime . Now . AddDays ( DAYS ) . ToString ( "yyyy-MM-dd" ) ;
JsonYtSend reqObj = new JsonYtSend ( ) ;
reqObj . custname = CustName ;
reqObj . custpsw = CustPsw ;
@ -116,7 +121,8 @@ namespace JobCreateFee
+ "','" + returndata . ydFee + "','" + returndata . secondPrintFee + "','" + returndata . applicant_code + "')" ;
SqlCommand cmd = new SqlCommand ( sql , dbcon ) ;
cmd . ExecuteNonQuery ( ) ;
D7BS . ENTEROPERATOR = ENTEROPERATOR ;
hp . addYTFee ( returndata , D7BS ) ;
}
@ -163,7 +169,7 @@ namespace JobCreateFee
var newbs = new D7BS ( ) ;
newbs . BSNO = "" ;
var strSql = new StringBuilder ( ) ;
strSql . Append ( "SELECT TOP 1 BSNO, CUSTOMERNAME,FEESTATUS,ISCANCEL from op_seae where MBLNO like '" + MBLNO + "%'" ) ;
strSql . Append ( "SELECT TOP 1 BSNO, CUSTOMERNAME,FEESTATUS,ISCANCEL,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '20%'),'') CTN20,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '40%'),'') CTN40 from op_seae where MBLNO like '" + MBLNO + "%'" ) ;
SqlDataAdapter adapter = new SqlDataAdapter ( strSql . ToString ( ) , dbcon ) ;
DataTable table = new DataTable ( ) ;
adapter . Fill ( table ) ;
@ -176,6 +182,9 @@ namespace JobCreateFee
newbs . CUSTOMERNAME = row [ "CUSTOMERNAME" ] . ToString ( ) ;
newbs . FEESTATUS = row [ "FEESTATUS" ] . ToString ( ) = = "1" ? true : false ;
newbs . ISCANCEL = row [ "ISCANCEL" ] . ToString ( ) = = "1" ? true : false ;
newbs . CTN20 = row [ "CTN20" ] . ToString ( ) ;
newbs . CTN40 = row [ "CTN40" ] . ToString ( ) ;
}
}
@ -213,14 +222,27 @@ namespace JobCreateFee
public string BSNO { get ; set ; }
public string CUSTOMERNAME { get ; set ; }
public string FEETYPE { get ; set ; }
public bool FEESTATUS { get ; set ; }
public bool ISCANCEL { get ; set ; }
public decimal AMOUNT { get ; set ; }
public int QUANTITY { get ; set ; }
public string CTN20 { get ; set ; } //业务中的20尺柜
public string CTN40 { get ; set ; } //业务中的20尺柜
public string CTN { get {
if ( ! string . IsNullOrWhiteSpace ( CTN40 ) ) {
return CTN40 ;
}
else {
return CTN20 ;
}
}
}
public string ENTEROPERATOR { get ; set ; }
}
public class YTFEEHelper
@ -270,18 +292,21 @@ namespace JobCreateFee
}
else {
addFee ( addrec , ds7info .BSNO );
addFee ( addrec , ds7info );
}
}
private void addFee ( JsonYtFee addrec , string BSNO )
private void addFee ( JsonYtFee addrec , D7BS ds7info )
{
if ( ! YTSUMFeeList . Exists ( x = > x . MBLNO = = addrec . bookingno ) )
{
var newrec = new YTSumFee ( addrec ) ;
newrec . BSNO = BSNO ;
newrec . BSNO = ds7info . BSNO ;
newrec . CTN20 = ds7info . CTN20 ;
newrec . CTN40 = ds7info . CTN40 ;
newrec . ENTEROPERATOR = ds7info . ENTEROPERATOR ;
YTSUMFeeList . Add ( newrec ) ;
}
else
@ -304,6 +329,7 @@ namespace JobCreateFee
makefee_ 应 付 ( item ) ;
}
var cdc = new CommonDataContext ( connStr ) ;
@ -314,17 +340,24 @@ namespace JobCreateFee
foreach ( var fee in FeeList ) {
if ( CurrFeeList . Exists ( x = > x . BSNO = = fee . BSNO & & x . FEENAME = = fee . FEENAME & & x . UNITPRICE = = fee . UNITPRICE ) )
{
//var updrec = CurrFeeList.First(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE);
CurrFeeList . First ( x = > x . BSNO = = fee . BSNO & & x . FEENAME = = fee . FEENAME & & x . UNITPRICE = = fee . UNITPRICE ) . AMOUNT + = fee . AMOUNT ;
CurrFeeList . First ( x = > x . BSNO = = fee . BSNO & & x . FEENAME = = fee . FEENAME & & x . UNITPRICE = = fee . UNITPRICE ) . NOTAXAMOUNT + = fee . NOTAXAMOUNT ;
CurrFeeList . First ( x = > x . BSNO = = fee . BSNO & & x . FEENAME = = fee . FEENAME & & x . UNITPRICE = = fee . UNITPRICE ) . QUANTITY + = fee . QUANTITY ;
//ChFeeHelper.setTax(ref updrec);
CurrFeeList . First ( x = > x . BSNO = = fee . BSNO & & x . FEENAME = = fee . FEENAME & & x . UNITPRICE = = fee . UNITPRICE ) . MODIFIEDUSER = fee . ENTEROPERATOR ;
CurrFeeList . First ( x = > x . BSNO = = fee . BSNO & & x . FEENAME = = fee . FEENAME & & x . UNITPRICE = = fee . UNITPRICE ) . MODIFIEDTIME = DateTime . Now ;
//updFeeList.Add(fee);
}
else {
fee . ENTERDATE = DateTime . Now ;
InsertFeeList . Add ( fee ) ;
}
}
@ -337,51 +370,77 @@ namespace JobCreateFee
private void makefee_ 应 付 ( YTSumFee YTSumFee )
{
if ( YTSumFee . fee_amount > 0 )
{
var newfee = ChFeeHelper . getNewChfee ( ) ;
newfee . BSNO = YTSumFee . BSNO ;
newfee . CUSTOMERNAME = feeCustName ;
newfee . FEETYPE = 2 ;
newfee . AMOUNT = YTSumFee . fee_amount ;
newfee . QUANTITY = YTSumFee . fee_count ;
newfee . UNIT = "箱" ;
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = feeCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.fee_amount;
//newfee.QUANTITY = YTSumFee.fee_count;
//newfee.UNIT = "箱";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "小票费";
var newfee = ChFeeHelper . getChFee ( YTSumFee . ENTEROPERATOR , YTSumFee . BSNO , feeCustName , 2 , "小票费" , YTSumFee . fee_amount , YTSumFee . CTN , YTSumFee . fee_count , "" , "" ) ;
newfee . CUSTOMERTYPE = "其他" ;
newfee . INPUTMODE = "导入亿通账单" ;
ChFeeHelper . setTax ( ref newfee ) ;
FeeList . Add ( newfee ) ;
}
if ( YTSumFee . ydFee1_amount > 0 )
{
var newfee = ChFeeHelper . getNewChfee ( ) ;
newfee . BSNO = YTSumFee . BSNO ;
newfee . CUSTOMERNAME = CarrierCustName ;
newfee . FEETYPE = 2 ;
newfee . AMOUNT = YTSumFee . ydFee1_amount ;
newfee . QUANTITY = YTSumFee . ydFee1_count ;
newfee . UNIT = "20'" ;
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = CarrierCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.ydFee1_amount;
//newfee.QUANTITY = YTSumFee.ydFee1_count;
//newfee.UNIT = "20'";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "调箱费";
var newfee = ChFeeHelper . getChFee ( YTSumFee . ENTEROPERATOR , YTSumFee . BSNO , CarrierCustName , 2 , "调箱费" , YTSumFee . ydFee1_amount , YTSumFee . CTN20 , YTSumFee . ydFee1_count , "" , "" ) ;
newfee . CUSTOMERTYPE = "其他" ;
newfee . INPUTMODE = "导入亿通账单" ;
ChFeeHelper . setTax ( ref newfee ) ;
FeeList . Add ( newfee ) ;
}
if ( YTSumFee . ydFee2_amount > 0 )
{
var newfee = ChFeeHelper . getNewChfee ( ) ;
newfee . BSNO = YTSumFee . BSNO ;
newfee . CUSTOMERNAME = CarrierCustName ;
newfee . FEETYPE = 2 ;
newfee . AMOUNT = YTSumFee . ydFee2_amount ;
newfee . QUANTITY = YTSumFee . ydFee2_count ;
newfee . UNIT = "40'" ;
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = CarrierCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.ydFee2_amount;
//newfee.QUANTITY = YTSumFee.ydFee2_count;
//newfee.UNIT = "40'";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "调箱费";
var newfee = ChFeeHelper . getChFee ( YTSumFee . ENTEROPERATOR , YTSumFee . BSNO , CarrierCustName , 2 , "调箱费" , YTSumFee . ydFee2_amount , YTSumFee . CTN40 , YTSumFee . ydFee2_count , "" , "" ) ;
newfee . CUSTOMERTYPE = "其他" ;
newfee . INPUTMODE = "导入亿通账单" ;
ChFeeHelper . setTax ( ref newfee ) ;
FeeList . Add ( newfee ) ;
}
if ( YTSumFee . secondPrintFee_amount > 0 )
{
var newfee = ChFeeHelper . getNewChfee ( ) ;
newfee . BSNO = YTSumFee . BSNO ;
newfee . CUSTOMERNAME = CarrierCustName ;
newfee . FEETYPE = 2 ;
newfee . AMOUNT = YTSumFee . secondPrintFee_amount ;
newfee . QUANTITY = YTSumFee . secondPrintFee_count ;
newfee . UNIT = "箱" ;
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = CarrierCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.secondPrintFee_amount;
//newfee.QUANTITY = YTSumFee.secondPrintFee_count;
//newfee.UNIT = "箱";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "取消小票费";
var newfee = ChFeeHelper . getChFee ( YTSumFee . ENTEROPERATOR , YTSumFee . BSNO , CarrierCustName , 2 , "取消小票费" , YTSumFee . secondPrintFee_amount , YTSumFee . CTN , YTSumFee . secondPrintFee_count , "" , "" ) ;
newfee . CUSTOMERTYPE = "其他" ;
newfee . INPUTMODE = "导入亿通账单" ;
ChFeeHelper . setTax ( ref newfee ) ;
FeeList . Add ( newfee ) ;
}