@ -1608,45 +1608,6 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
return SetZHData ( strCondition , strSql ) ;
}
//static public List<MsSaleMonthProfit> GetZHSaleMonthDataList(string strCondition)
//{
// //DateTime LastDateBegin = CurDateBegin.AddMonths(-1);
// //DateTime LastDateEnd = CurDateBegin.AddDays(-1);
// //DateTime LastThreeDateBegin = CurDateBegin.AddMonths(-3);
// //DateTime LastFourDateBegin = CurDateBegin.AddMonths(-4);
// var strSql = new StringBuilder();
// strSql.Append("SELECT SALE,ETDMONTH,SUM(TTLPROFIT) TTLPROFIT FROM (SELECT B.SALE,B.ACCDATE ETDMONTH,B.TTLPROFIT");
// strSql.Append(" FROM v_op_bill_gain_tc B ");
// strSql.Append("LEFT JOIN V_MAX_SETTLEMENTTIME_BSDR T ON (T.BSNO=B.BSNO) ");
// strSql.Append("where 1=1 ");
// //strSql.Append(" B.TTLDR=B.STLTTLDR AND B.TTLDR<>0 AND T.SETTLETIME<='" + LastDateEnd.ToString("yyyy-MM-dd 23:59:59") + "' ");
// strSql.Append(" AND B.ACCDATE IN (SELECT DISTINCT ACCDATE FROM ##SALEPROFITSHARE) ");
// if (!string.IsNullOrEmpty(strCondition))
// {
// strSql.Append(" and " + strCondition);
// }
// strSql.Append(" union ALL SELECT B.SALE,B.ACCDATE ETDMONTH,B.TTLPROFIT");
// strSql.Append(" FROM v_op_bill_gain_tc B ");
// strSql.Append("LEFT JOIN V_MAX_SETTLEMENTTIME_CR T ON (T.BSNO=B.BSNO) ");
// strSql.Append("where B.TTLDR=0 ");
// //strSql.Append(" AND T.SETTLETIME<='" + LastDateEnd.ToString("yyyy-MM-dd 23:59:59") + "' ");
// strSql.Append(" AND B.ACCDATE IN (SELECT DISTINCT ACCDATE FROM ##SALEPROFITSHARE) ");
// if (!string.IsNullOrEmpty(strCondition))
// {
// strSql.Append(" and " + strCondition);
// }
// strSql.Append(" ) AS V GROUP BY SALE,ETDMONTH ");
// return SetZHSaleMonthData(strSql);
//}
static public List < MsSaleMonthProfit > GetZHSaleMonthTTLDataList ( string strCondition )
{
@ -1919,6 +1880,369 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
# endregion
#region 好品佳和
static public List < MsOpBillProfit > GetHPJHDataList ( string strCondition , string isalldr , string isonlystl , string userid , string usercode , string companyid , string sort = null )
{
var rangstr = GetRangDAStr ( "index" , userid , usercode , companyid ) ;
var strConditionAll = strCondition ;
if ( ! string . IsNullOrEmpty ( rangstr ) )
{
if ( ! string . IsNullOrEmpty ( strCondition ) )
{
strConditionAll = strCondition + " and " + rangstr ;
}
else
{
strConditionAll = rangstr ;
}
}
var strSql = new StringBuilder ( ) ;
strSql . Append ( " if object_id('tempdb..##SALEPROFITSHARE') is not null Begin DROP TABLE ##SALEPROFITSHARE End " ) ;
strSql . Append ( "SELECT * into ##SALEPROFITSHARE FROM (SELECT B.BSNO, B.OPLB,B.OPTYPE,B.OPLBNAME, B.BSTYPE,B.CUSTOMERNAME, B.CUSTNO, B.MBLNO, B.HBLNO,B.VESSEL, B.VOYNO, B.INPUTBY, B.CREATETIME, B.BSSTATUS, B.SALE, B.OP, B.DOC," ) ;
strSql . Append ( "B.ETD,B.OPDATE,B.CUSTOMDATE,B.FEESTATUSREF,B.BLFRT,B.BSSOURCEDETAIL,B.STLNAME" ) ;
strSql . Append ( ",B.STLDATE " ) ;
strSql . Append ( ",B.CUSTSERVICE, B.PORTLOAD, B.PORTDISCHARGE, B.CUSTOMNO, B.ACCDATE,B.CARRIER, B.BSSOURCE, B.LANE, B.FORWARDER,B.NETWEIGHT,B.KGS,B.TEU,B.CNTRTOTAL,B.CORPID" ) ;
strSql . Append ( ",B.CNTR1,B.CNTR2,B.CNTR3,B.CNTR4,B.CNTR5,B.CNTR6,B.CNTR7,B.CNTR8,B.CNTR9,B.CNTR10,B.OTCNTR,B.TRADETYPE,B.GOODSNAME,B.FEESTATUS" ) ;
strSql . Append ( ",B.RMBDR,B.RMBCR,B.STLRMBDR,B.STLRMBCR,B.USDDR,B.USDCR,B.STLUSDDR,B.STLUSDCR,B.OTDR,B.OTCR,B.STLOTDR,B.STLOTCR,B.TTLDR,B.TTLCR,B.STLTTLDR,B.STLTTLCR" ) ;
strSql . Append ( ",B.USDPROFIT,B.RMBPROFIT,B.OTPROFIT,B.TTLPROFIT,B.PROFITRATE,B.TAXPROFIT,B.RMBNODR,B.USDNODR,B.OTNODR,B.TTLNODR,B.RMBNOCR,B.USDNOCR,B.OTNOCR,B.TTLNOCR " ) ;
strSql . Append ( ",T.SETTLETIME,f.ISFEE,T.STLTTLDR MONTHSTLTTLDR,DATEDIFF([day],B.ETD,T.SETTLETIME) ACTUALDAY,CASE WHEN B.TTLDR<0 THEN 0 ELSE DATEDIFF([day],B.STLDATE,ISNULL(T.SETTLETIME,GETDATE())) END NODAY" ) ;
strSql . Append ( ",B.ACCDATE ETDMONTH,(CASE f.ISFEE WHEN 1 THEN '已发放' else '未发放' end) as ISFEEREF,B.KXRATE " ) ;
strSql . Append ( " FROM v_op_bill_gain_hpjh B " ) ;
strSql . Append ( "LEFT JOIN V_MAX_SETTLEMENTTIME_BSDR T ON (T.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN op_sale_proftfee f ON (f.BSNO=B.BSNO) where B.TTLDR<>0 " ) ;
if ( isonlystl = = "1" )
strSql . Append ( " AND B.TTLDR=B.STLTTLDR " ) ;
if ( ! string . IsNullOrEmpty ( strConditionAll ) )
{
strSql . Append ( " and " + strConditionAll ) ;
}
if ( isalldr = = "1" )
{
strSql . Append ( " union SELECT B.BSNO, B.OPLB,B.OPTYPE,B.OPLBNAME, B.BSTYPE,B.CUSTOMERNAME, B.CUSTNO, B.MBLNO, B.HBLNO,B.VESSEL, B.VOYNO, B.INPUTBY, B.CREATETIME, B.BSSTATUS, B.SALE, B.OP, B.DOC," ) ;
strSql . Append ( "B.ETD,B.OPDATE,B.CUSTOMDATE,B.FEESTATUSREF,B.BLFRT,B.BSSOURCEDETAIL,B.STLNAME" ) ;
strSql . Append ( ",B.STLDATE " ) ;
strSql . Append ( ",B.CUSTSERVICE, B.PORTLOAD, B.PORTDISCHARGE, B.CUSTOMNO, B.ACCDATE,B.CARRIER, B.BSSOURCE, B.LANE, B.FORWARDER,B.NETWEIGHT,B.KGS,B.TEU,B.CNTRTOTAL,B.CORPID" ) ;
strSql . Append ( ",B.CNTR1,B.CNTR2,B.CNTR3,B.CNTR4,B.CNTR5,B.CNTR6,B.CNTR7,B.CNTR8,B.CNTR9,B.CNTR10,B.OTCNTR,B.TRADETYPE,B.GOODSNAME,B.FEESTATUS" ) ;
strSql . Append ( ",B.RMBDR,B.RMBCR,B.STLRMBDR,B.STLRMBCR,B.USDDR,B.USDCR,B.STLUSDDR,B.STLUSDCR,B.OTDR,B.OTCR,B.STLOTDR,B.STLOTCR,B.TTLDR,B.TTLCR,B.STLTTLDR,B.STLTTLCR" ) ;
strSql . Append ( ",B.USDPROFIT,B.RMBPROFIT,B.OTPROFIT,B.TTLPROFIT,B.PROFITRATE,B.TAXPROFIT,B.RMBNODR,B.USDNODR,B.OTNODR,B.TTLNODR,B.RMBNOCR,B.USDNOCR,B.OTNOCR,B.TTLNOCR " ) ;
strSql . Append ( ",T.SETTLETIME,f.ISFEE,0 MONTHSTLTTLDR,DATEDIFF([day],B.ETD,isnull(T.SETTLETIME,GETDATE())) ACTUALDAY,0 NODAY" ) ;
strSql . Append ( ",B.ACCDATE ETDMONTH,(CASE f.ISFEE WHEN 1 THEN '已发放' else '未发放' end) as ISFEEREF,B.KXRATE " ) ;
strSql . Append ( " FROM v_op_bill_gain_hpjh B " ) ;
strSql . Append ( "LEFT JOIN V_MAX_SETTLEMENTTIME_CR T ON (T.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN op_sale_proftfee f ON (f.BSNO=B.BSNO) where B.TTLDR=0 " ) ;
if ( isonlystl = = "1" )
strSql . Append ( " AND B.TTLCR=B.STLTTLCR " ) ;
if ( ! string . IsNullOrEmpty ( strConditionAll ) )
{
strSql . Append ( " and " + strConditionAll ) ;
}
}
strSql . Append ( " ) AS V " ) ;
/ /
var sortstring = DatasetSort . Getsortstring ( sort ) ;
if ( ! string . IsNullOrEmpty ( sortstring ) )
{
strSql . Append ( " order by " + sortstring ) ;
}
else
{
strSql . Append ( " order by SALE,(CASE WHEN TTLPROFIT<0 THEN convert(datetime,convert(varchar(7),ACCDATE)+'-01') ELSE convert(datetime,convert(varchar(7),ACCDATE)+'-02') END),SETTLETIME,CREATETIME DESC" ) ;
// strSql.Append(" order by SALE,SETTLETIME,ETD,CREATETIME DESC");
}
strSql . Append ( " SELECT * FROM ##SALEPROFITSHARE " ) ;
return SetHPJHData ( strCondition , strSql ) ;
}
static public List < MsSaleMonthProfit > GetHPJHSaleMonthTTLDataList ( string strCondition )
{
var strSql = new StringBuilder ( ) ;
strSql . Append ( "SELECT SALE,ETDMONTH,SUM(TTLPROFIT) TTLPROFIT FROM (SELECT B.SALE,B.ACCDATE ETDMONTH,B.TTLPROFIT TTLPROFIT" ) ;
strSql . Append ( " FROM v_op_bill_gain_hpjh B " ) ;
strSql . Append ( " where 1=1 " ) ;
strSql . Append ( " AND B.ACCDATE IN (SELECT DISTINCT ACCDATE FROM ##SALEPROFITSHARE) " ) ;
if ( ! string . IsNullOrEmpty ( strCondition ) )
{
strSql . Append ( " and " + strCondition ) ;
}
strSql . Append ( " ) AS V GROUP BY SALE,ETDMONTH " ) ;
//strSql.Append(" drop table ##SALEPROFITSHARE ");
return SetHPJHSaleMonthData ( strSql ) ;
}
private static List < MsOpBillProfit > SetHPJHData ( string strCondition , StringBuilder strSql )
{
//DateTime CurDateBegin = Convert.ToDateTime(Month + "-01");
//DateTime CurDateEnd = CurDateBegin.AddMonths(1).AddDays(-1);
var saleprofitlist = MsInfoSaleProfitShareSetDAL . GetSaleProfitDetailDataList ( "" ) ;
var saleprofitcqlist = MsInfoSaleProfitShareSetDAL . GetSaleProfitCqDataList ( "" ) ;
var tmpsaleprofitlist = saleprofitlist ;
var POORDAY = 0 ;
var MONTHPOORDAY = 0 ;
SqlCommand cmd = new SqlCommand ( ) ;
cmd . CommandText = strSql . ToString ( ) ;
cmd . CommandTimeout = 1200000 ; //要加这一句
var headList = new List < MsOpBillProfit > ( ) ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = db . ExecuteReader ( cmd ) )
{
//var MsSaleMonthProfitList = GetZHSaleMonthDataList(strCondition);
var MsSaleMonthTTLProfitList = GetZHSaleMonthTTLDataList ( strCondition ) ;
while ( reader . Read ( ) )
{
MsOpBillProfit data = new MsOpBillProfit ( ) ;
#region Set DB data to Object
data . BSNO = Convert . ToString ( reader [ "BSNO" ] ) ; //业务编号
data . FEESTATUSREF = Convert . ToString ( reader [ "FEESTATUSREF" ] ) ;
data . ACCDATE = Convert . ToString ( reader [ "ACCDATE" ] ) ;
data . ETDMONTH = Convert . ToString ( reader [ "ETDMONTH" ] ) ;
data . OPTYPE = Convert . ToString ( reader [ "OPTYPE" ] ) ;
data . OPLB = Convert . ToString ( reader [ "OPLB" ] ) ;
data . OPLBNAME = Convert . ToString ( reader [ "OPLBNAME" ] ) ;
data . MBLNO = Convert . ToString ( reader [ "MBLNO" ] ) ;
data . HBLNO = Convert . ToString ( reader [ "HBLNO" ] ) ;
data . CUSTNO = Convert . ToString ( reader [ "CUSTNO" ] ) ;
data . CUSTOMNO = Convert . ToString ( reader [ "CUSTOMNO" ] ) ;
data . CUSTOMERNAME = Convert . ToString ( reader [ "CUSTOMERNAME" ] ) ;
data . VESSEL = Convert . ToString ( reader [ "VESSEL" ] ) ;
data . VOYNO = Convert . ToString ( reader [ "VOYNO" ] ) ;
data . CARRIER = Convert . ToString ( reader [ "CARRIER" ] ) ;
data . FORWARDER = Convert . ToString ( reader [ "FORWARDER" ] ) ;
data . ETD = Convert . ToString ( reader [ "ETD" ] ) ;
data . OPDATE = Convert . ToString ( reader [ "OPDATE" ] ) ;
data . CUSTOMDATE = Convert . ToString ( reader [ "CUSTOMDATE" ] ) ;
data . PORTLOAD = Convert . ToString ( reader [ "PORTLOAD" ] ) ;
data . PORTDISCHARGE = Convert . ToString ( reader [ "PORTDISCHARGE" ] ) ;
data . LANE = Convert . ToString ( reader [ "LANE" ] ) ;
data . BLFRT = Convert . ToString ( reader [ "BLFRT" ] ) ;
data . CNTRTOTAL = Convert . ToString ( reader [ "CNTRTOTAL" ] ) ;
data . INPUTBY = Convert . ToString ( reader [ "INPUTBY" ] ) ;
data . OP = Convert . ToString ( reader [ "OP" ] ) ;
data . CUSTSERVICE = Convert . ToString ( reader [ "CUSTSERVICE" ] ) ;
data . DOC = Convert . ToString ( reader [ "DOC" ] ) ;
data . SALE = Convert . ToString ( reader [ "SALE" ] ) ;
data . BSSOURCE = Convert . ToString ( reader [ "BSSOURCE" ] ) ;
data . BSSOURCEDETAIL = Convert . ToString ( reader [ "BSSOURCEDETAIL" ] ) ;
data . CORPID = Convert . ToString ( reader [ "CORPID" ] ) ;
data . STLNAME = Convert . ToString ( reader [ "STLNAME" ] ) ;
data . STLDATE = Convert . ToString ( reader [ "STLDATE" ] ) ;
if ( reader [ "RMBDR" ] ! = DBNull . Value )
data . RMBDR = Convert . ToDecimal ( reader [ "RMBDR" ] ) ;
if ( reader [ "RMBCR" ] ! = DBNull . Value )
data . RMBCR = Convert . ToDecimal ( reader [ "RMBCR" ] ) ;
if ( reader [ "STLRMBDR" ] ! = DBNull . Value )
data . STLRMBDR = Convert . ToDecimal ( reader [ "STLRMBDR" ] ) ;
if ( reader [ "STLRMBCR" ] ! = DBNull . Value )
data . STLRMBCR = Convert . ToDecimal ( reader [ "STLRMBCR" ] ) ;
if ( reader [ "RMBNODR" ] ! = DBNull . Value )
data . RMBNODR = Convert . ToDecimal ( reader [ "RMBNODR" ] ) ;
if ( reader [ "RMBNOCR" ] ! = DBNull . Value )
data . RMBNOCR = Convert . ToDecimal ( reader [ "RMBNOCR" ] ) ;
if ( reader [ "RMBPROFIT" ] ! = DBNull . Value )
data . RMBPROFIT = Convert . ToDecimal ( reader [ "RMBPROFIT" ] ) ;
if ( reader [ "USDDR" ] ! = DBNull . Value )
data . USDDR = Convert . ToDecimal ( reader [ "USDDR" ] ) ;
if ( reader [ "USDCR" ] ! = DBNull . Value )
data . USDCR = Convert . ToDecimal ( reader [ "USDCR" ] ) ;
if ( reader [ "STLUSDDR" ] ! = DBNull . Value )
data . STLUSDDR = Convert . ToDecimal ( reader [ "STLUSDDR" ] ) ;
if ( reader [ "STLUSDCR" ] ! = DBNull . Value )
data . STLUSDCR = Convert . ToDecimal ( reader [ "STLUSDCR" ] ) ;
if ( reader [ "USDNODR" ] ! = DBNull . Value )
data . USDNODR = Convert . ToDecimal ( reader [ "USDNODR" ] ) ;
if ( reader [ "USDNOCR" ] ! = DBNull . Value )
data . USDNOCR = Convert . ToDecimal ( reader [ "USDNOCR" ] ) ;
if ( reader [ "USDPROFIT" ] ! = DBNull . Value )
data . USDPROFIT = Convert . ToDecimal ( reader [ "USDPROFIT" ] ) ;
if ( reader [ "OTDR" ] ! = DBNull . Value )
data . OTDR = Convert . ToDecimal ( reader [ "OTDR" ] ) ;
if ( reader [ "OTCR" ] ! = DBNull . Value )
data . OTCR = Convert . ToDecimal ( reader [ "OTCR" ] ) ;
if ( reader [ "STLOTDR" ] ! = DBNull . Value )
data . STLOTDR = Convert . ToDecimal ( reader [ "STLOTDR" ] ) ;
if ( reader [ "STLOTCR" ] ! = DBNull . Value )
data . STLOTCR = Convert . ToDecimal ( reader [ "STLOTCR" ] ) ;
if ( reader [ "OTNODR" ] ! = DBNull . Value )
data . OTNODR = Convert . ToDecimal ( reader [ "OTNODR" ] ) ;
if ( reader [ "OTNOCR" ] ! = DBNull . Value )
data . OTNOCR = Convert . ToDecimal ( reader [ "OTNOCR" ] ) ;
if ( reader [ "OTPROFIT" ] ! = DBNull . Value )
data . OTPROFIT = Convert . ToDecimal ( reader [ "OTPROFIT" ] ) ;
if ( reader [ "TTLDR" ] ! = DBNull . Value )
data . TTLDR = Convert . ToDecimal ( reader [ "TTLDR" ] ) ;
if ( reader [ "TTLCR" ] ! = DBNull . Value )
data . TTLCR = Convert . ToDecimal ( reader [ "TTLCR" ] ) ;
if ( reader [ "STLTTLDR" ] ! = DBNull . Value )
data . STLTTLDR = Convert . ToDecimal ( reader [ "STLTTLDR" ] ) ;
if ( reader [ "MONTHSTLTTLDR" ] ! = DBNull . Value )
data . MONTHSTLTTLDR = Convert . ToDecimal ( reader [ "MONTHSTLTTLDR" ] ) ;
if ( reader [ "STLTTLCR" ] ! = DBNull . Value )
data . STLTTLCR = Convert . ToDecimal ( reader [ "STLTTLCR" ] ) ;
if ( reader [ "TTLNODR" ] ! = DBNull . Value )
data . TTLNODR = Convert . ToDecimal ( reader [ "TTLNODR" ] ) ;
if ( reader [ "TTLNOCR" ] ! = DBNull . Value )
data . TTLNOCR = Convert . ToDecimal ( reader [ "TTLNOCR" ] ) ;
if ( reader [ "TTLPROFIT" ] ! = DBNull . Value )
data . TTLPROFIT = Convert . ToDecimal ( reader [ "TTLPROFIT" ] ) ;
if ( reader [ "ACTUALDAY" ] ! = DBNull . Value )
data . ACTUALDAY = Convert . ToInt32 ( reader [ "ACTUALDAY" ] ) ;
if ( reader [ "NODAY" ] ! = DBNull . Value )
data . NODAY = Convert . ToInt32 ( reader [ "NODAY" ] ) ;
decimal KXRATE = 0 ;
if ( reader [ "KXRATE" ] ! = DBNull . Value )
KXRATE = Convert . ToDecimal ( reader [ "KXRATE" ] ) ;
if ( data . TTLPROFIT < 0 )
{
data . ACTUALDAY = 0 ;
}
MsSaleMonthTTLProfitList . ForEach ( i = >
{
if ( i . SALE = = data . SALE & & i . ETDMONTH = = data . ETDMONTH )
{
i . MONTHPROFIT = i . MONTHPROFIT + data . TTLPROFIT ;
data . MONTHTTLPR = i . MONTHPROFIT ;
}
} ) ;
//if (!isfind)
//{
// var salemonthprofit = new MsSaleMonthProfit();
// salemonthprofit.SALE = data.SALE;
// salemonthprofit.ETDMONTH = data.ETDMONTH;
// salemonthprofit.TTLPROFIT = data.TTLPROFIT;
// data.COMPR = data.TTLPROFIT;
// MsSaleMonthProfitList.Add(salemonthprofit);
//}
decimal beginplan = 0 ;
decimal endplan = 0 ;
decimal SHAREPR = 0 ;
//if (data.TTLPROFIT <= 0)
//{
// data.NODAY = 0;
//}
foreach ( var i in saleprofitlist )
{
if ( i . SALE = = data . SALE & & ( ( ( data . MONTHTTLPR - data . TTLPROFIT ) > i . PROFITDOWN ) | | ( data . MONTHTTLPR > i . PROFITDOWN ) ) & & i . SHAREPR ! = 0 )
{
if ( ( ( data . MONTHTTLPR - data . TTLPROFIT ) < = i . PROFITUP | | ( data . MONTHTTLPR ) < = i . PROFITUP ) )
{
data . TiChengBiLi = i . SHAREPR / 100 ;
if ( data . MONTHTTLPR < = i . PROFITUP )
{
SHAREPR = i . SHAREPR ;
beginplan = i . PROFITDOWN ;
endplan = i . PROFITUP ;
var TTLPROFIT = data . TTLPROFIT ;
if ( ( data . MONTHTTLPR - data . TTLPROFIT ) < = i . PROFITDOWN ) TTLPROFIT = ( data . MONTHTTLPR - i . PROFITDOWN ) ;
data . TiCheng = data . TiCheng + TTLPROFIT * data . TiChengBiLi ;
}
else
{
var TTLPROFIT = data . TTLPROFIT - ( data . MONTHTTLPR - i . PROFITUP ) ;
data . TiCheng = data . TiCheng + TTLPROFIT * data . TiChengBiLi ;
}
}
}
}
// saleprofitlist.ForEach(i =>
//{
//});
if ( data . NODAY > 0 )
data . KouXi = data . TiCheng * KXRATE * data . NODAY ;
data . COMPR = data . TiCheng - data . KouXi ;
data . PROFITRATE = Convert . ToString ( reader [ "PROFITRATE" ] ) ;
if ( reader [ "SETTLETIME" ] ! = DBNull . Value )
data . SETTLETIME = Convert . ToDateTime ( reader [ "SETTLETIME" ] ) . ToString ( "yyyy-MM-dd" ) ;
data . ISSALEFEE = Convert . ToString ( reader [ "ISFEEREF" ] ) ;
# endregion
headList . Add ( data ) ;
}
reader . Close ( ) ;
}
return headList ;
}
private static List < MsSaleMonthProfit > SetHPJHSaleMonthData ( StringBuilder strSql )
{
var headList = new List < MsSaleMonthProfit > ( ) ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
SqlCommand cmd = new SqlCommand ( ) ;
cmd . CommandText = strSql . ToString ( ) ;
cmd . CommandTimeout = 1200000 ; //要加这一句
using ( IDataReader reader = db . ExecuteReader ( cmd ) )
{
while ( reader . Read ( ) )
{
MsSaleMonthProfit data = new MsSaleMonthProfit ( ) ;
#region Set DB data to Object
data . SALE = Convert . ToString ( reader [ "SALE" ] ) ;
data . ETDMONTH = Convert . ToString ( reader [ "ETDMONTH" ] ) ;
if ( reader [ "TTLPROFIT" ] ! = DBNull . Value )
data . TTLPROFIT = Convert . ToDecimal ( reader [ "TTLPROFIT" ] ) ;
# endregion
headList . Add ( data ) ;
}
reader . Close ( ) ;
}
return headList ;
}
# endregion
#region 泰邦 提成计算
static public List < MsOpBillProfit > GetTBDataList ( string strCondition , string TEU , string PROFITBOUNDS , string userid , string usercode , string companyid , string sort = null )