DS7Zhanhao
hanxuntao 2 years ago
parent f621b5a03d
commit c896e7c875

@ -4522,14 +4522,14 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
string str = "";
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID ");
strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID,VSSQL ");
strSql.Append(" from VW_User_Authority ");
strSql.Append(" where [NAME]='modInvoiceManagement' 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()))
{
@ -4538,7 +4538,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
visiblerange = Convert.ToString(reader["VISIBLERANGE"]);
operaterange = Convert.ToString(reader["OPERATERANGE"]);
AUTHORITYID = Convert.ToString(reader["AUTHORITYID"]);
VSSQL = Convert.ToString(reader["VSSQL"]);
break;
}
reader.Close();
@ -4556,10 +4556,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
var rangeDa = new RangeDA();
var deptid = rangeDa.GetDEPTGID(userid);
str = " CREATEUSER in (select USERID from vw_user where deptid='" + deptid + "') ";
}
else if (visiblerange == "1")
{
str = " COMPANYID='" + companyid + "' ";
str = " COMPANYID='" + companyid + "' ";
}
else if (visiblerange == "5")
{
@ -4574,11 +4575,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
{
if (str == "")
{
str = " (CREATEUSER in (select USERID from user_company where COMPANYID='" + companyid + "') ";
str = " COMPANYID='" + companyid + "' ";
}
else
{
str = str + " or CREATEUSER in (select USERID from user_company where COMPANYID='" + companyid + "')";
str = str + " or COMPANYID='" + companyid + "' ";
};
}
str = str + ")";
@ -4617,7 +4618,20 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice_HangXin
{
str = " 1=1 ";
}
VSSQL = VSSQL.Trim();
if (!string.IsNullOrEmpty(VSSQL))
{
if (!string.IsNullOrEmpty(str))
{
str = str + " and (" + VSSQL + ") ";
}
else
{
str = " (" + VSSQL + ") ";
}
}
return str;
}

@ -653,7 +653,24 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var companyid = records[0].data.GID;
this.StoreBANK.load({ params: { condition: " LINKID='" + companyid + "'" } });
var CURR = this.formEdit.getForm().findField('RECVCURR').getValue();
this.formEdit.getForm().findField('ACCOUNT').setValue('');
this.StoreBANK.load({
params: { condition: " LINKID='" + companyid + "'" },
callback: function (r, options, success) {
if (success) {
if (this.StoreBANK.getCount() > 0) {
for (var i = 0; i < this.StoreBANK.getCount(); i += 1) {
var member = this.StoreBANK.getAt(i);
if (member.data.CURRENCY == CURR && member.data.ISDEF == 'True') {
this.formEdit.getForm().findField('ACCOUNT').setValue(member.data.BANKACCOUNT);
}
}
}
}
},
scope: this
});
}

@ -674,7 +674,23 @@ Ext.extend(Shipping.MsChInvoiceBLEdit, Ext.Panel, {
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var companyid = records[0].data.GID;
this.StoreBANK.load({ params: { condition: " LINKID='" + companyid + "'" } });
var CURR = this.formEdit.getForm().findField('RECVCURR').getValue();
this.formEdit.getForm().findField('ACCOUNT').setValue('');
this.StoreBANK.load({
params: { condition: " LINKID='" + companyid + "'" },
callback: function (r, options, success) {
if (success) {
if (this.StoreBANK.getCount() > 0) {
for (var i = 0; i < this.StoreBANK.getCount(); i += 1) {
var member = this.StoreBANK.getAt(i);
if (member.data.CURRENCY == CURR && member.data.ISDEF == 'True') {
this.formEdit.getForm().findField('ACCOUNT').setValue(member.data.BANKACCOUNT);
}
}
}
}
},
scope: this });
}

@ -32,6 +32,15 @@ namespace DSWeb.MvcShipping.Controllers
{
return View();
}
/// <summary>
/// 好品佳和 入口
/// </summary>
/// <returns></returns>
public ActionResult HPJHIndex()
{
return View();
}
public ActionResult PlanIndex()
{
return View();
@ -84,6 +93,9 @@ namespace DSWeb.MvcShipping.Controllers
{
return View();
}
public ContentResult BsListData(int start, int limit, string condition, string stlcondition, bool isdrzero, string dcondition,bool isallstl,string sort, string printstr, string sortstr, string dcondition2="")
{
@ -212,6 +224,26 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = json };
}
/// <summary>
/// 好品佳和 提成计算
/// </summary>
/// <param name="start"></param>
/// <param name="limit"></param>
/// <param name="condition"></param>
/// <param name="isalldr"></param>
/// <param name="isonlystl"></param>
/// <param name="sort"></param>
/// <param name="printstr"></param>
/// <param name="sortstr"></param>
/// <returns></returns>
public ContentResult GetHPJHDataList(int start, int limit, string condition, string isalldr, string isonlystl, string sort, string printstr, string sortstr)
{
var dataList = MsRptSaleBalProfitShareDAL.GetHPJHDataList(condition, isalldr, isonlystl, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
var list = dataList.Skip(start).Take(limit);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
return new ContentResult() { Content = json };
}
/// <summary>
/// 泰邦 提成计算
/// </summary>

@ -34118,6 +34118,30 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
// icount = icount + 3;
//}
var Shipping = "";
Shipping = formatEdiStr("txt", bill.EDIREMARK);
Shipping = Shipping.Replace("\n", "\\");
Shipping = Shipping.Replace("\r", " ");
string[] EdiRemarkList = Shipping.Split('\\');
if (EdiRemarkList.Length != 0)
{
for (var i = 0; i < EdiRemarkList.Length; i++)
{
if (carrier == "CMA2")
{
r.WriteLine("FTX+AAI+++" + EdiRemarkList[i] + "'");
}
else
r.WriteLine("FTX+AAA+++" + EdiRemarkList[i] + "'");
icount = icount + 1;
}
}
if (carrier == "CMA2")
{
@ -34145,27 +34169,6 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
}
var Shipping = "";
Shipping = formatEdiStr("txt", bill.EDIREMARK);
Shipping = Shipping.Replace("\n", "\\");
Shipping = Shipping.Replace("\r", " ");
string[] EdiRemarkList = Shipping.Split('\\');
if (EdiRemarkList.Length != 0)
{
for (var i = 0; i < EdiRemarkList.Length; i++)
{
if (carrier == "CMA2")
{
r.WriteLine("FTX+AAI+++" + EdiRemarkList[i] + "'");
}
else
r.WriteLine("FTX+AAA+++" + EdiRemarkList[i] + "'");
icount = icount + 1;
}
}
if (carrier == "UASC")
{
@ -34460,7 +34463,10 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
for (var i = 0; i < ShippingList.Count; i++)
{
if (i == 0) Shipping = "NAD+N1+++" + ShippingList[0] + "+";
if (carrier == "CMA2")
if (i == 0) Shipping = "NAD+NI+++" + ShippingList[0] + "+";
else
if (i == 0) Shipping = "NAD+N1+++" + ShippingList[0] + "+";
if (i == 1) Shipping = Shipping + ShippingList[i];
if (i == 2 || i == 3) Shipping = Shipping + ":" + ShippingList[i];
if (i >= 4 && ShippingList.Count > 5)
@ -34621,10 +34627,25 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
{
if (billams.FORWARD != "")
{
if (billams.FORWARD.Length > 35)
r.WriteLine("NAD+FW+++" + formatEdiStr("txt", billams.FORWARD.Substring(0, 35)) + "+" + formatEdiStr("txt", billams.FORWARD.Substring(35)) + "'");
else
r.WriteLine("NAD+FW+++" + formatEdiStr("txt", billams.FORWARD) + "'");
Shipping = formatEdiStr("txt", billams.FORWARD);
ShippingList = formatlengthStr(Shipping, 35);
if (ShippingList.Count != 0 && Shipping.Length > 0)
{
for (var i = 0; i < ShippingList.Count; i++)
{
if (i == 0) Shipping = "NAD+FW+++" + ShippingList[0] + "+";
if (i == 1) Shipping = Shipping + ShippingList[i];
if (i >= 2) Shipping = Shipping + ":" + ShippingList[i];
}
}
r.WriteLine(Shipping + "'");
//if (billams.FORWARD.Length > 35)
// r.WriteLine("NAD+FW+++" + formatEdiStr("txt", billams.FORWARD.Substring(0, 35)) + "+" + formatEdiStr("txt", billams.FORWARD.Substring(35)) + "'");
//else
// r.WriteLine("NAD+FW+++" + formatEdiStr("txt", billams.FORWARD) + "'");
}
else
@ -34822,7 +34843,11 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("MEA+AAE+AAS+CBM:" + bill.REEFERF + "'");
if (bill.HUMIDITY != "")
r.WriteLine("MEA+AAE+AAO+HMD:" + bill.HUMIDITY + "'");
r.WriteLine("TMP+2+" + bill.TEMPSET + ":CEL'");
var tempset = bill.TEMPSET;
while (tempset.Length < 3) {
tempset = "0" + tempset;
};
r.WriteLine("TMP+2+" + tempset + ":CEL'");
icount = icount + 2;

@ -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)

@ -38,6 +38,7 @@ Ext.extend(Shipping.MsCodeFeeTemplateEdit, Ext.Panel, {
this.StoreOpLb.add({ "OPLB": 5, "OPLBNAME": "大宗散货" });
this.StoreOpLb.add({ "OPLB": 6, "OPLBNAME": "综合业务" });
this.StoreOpLb.add({ "OPLB": 8, "OPLBNAME": "陆运业务" });
this.StoreOpLb.add({ "OPLB": 9, "OPLBNAME": "铁路运输" });
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.OPTYPE, //'业务类别',

@ -468,6 +468,8 @@ Ext.extend(Shipping.FeeTemplateAdd, Ext.Panel, {
sql = ' OpType=6 and FeeType=' + this.feeType;
} else if (this.stroplb == 'op_truck') {
sql = ' OpType=8 ';
} else if (this.stroplb == 'op_railway') {
sql = ' OpType=9 and FeeType=' + this.feeType;
}
this.storeList.load({
@ -771,6 +773,10 @@ Ext.extend(Shipping.FeeTemplateAdd, Ext.Panel, {
sql = ' OpType=5 and FeeType=' + this.feeType;
} else if (this.stroplb == 'op_other') {
sql = ' OpType=6 and FeeType=' + this.feeType;
} else if (this.stroplb == 'op_truck') {
sql = ' OpType=8 ';
} else if (this.stroplb == 'op_railway') {
sql = ' OpType=9 and FeeType=' + this.feeType;
}
var custName = form.findField('NAME').getValue();

@ -526,6 +526,8 @@ Ext.extend(Shipping.FeeTemplatePLAdd, Ext.Panel, {
sql = ' OpType=6 ';
} else if (this.stroplb == 'OP_TRUCK') {
sql = ' OpType=8 ';
} else if (this.stroplb == 'OP_RAILWAY') {
sql = ' OpType=9 ';
}
this.storeList.load({
@ -649,6 +651,8 @@ Ext.extend(Shipping.FeeTemplatePLAdd, Ext.Panel, {
sql = ' OpType=6 ';
} else if (this.stroplb == 'OP_TRUCK') {
sql = ' OpType=8 ';
} else if (this.stroplb == 'OP_RAILWAY') {
sql = ' OpType=9 ';
}
//if (this.stroplb == 'op_Seae') {

@ -1661,6 +1661,7 @@
<Content Include="Areas\MvcShipping\Viewsjs\MsRptOpProfit\Zi_zh-cn.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptSaleBalProfitShare\MsRptSaleCXTCIndex.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptSaleBalProfitShare\MsRptSaleTBProfitShareIndex.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptSaleBalProfitShare\MsRptSaleHPJHProfitShareIndex.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptSaleBalProfitShare\MsRptSaleZHProfitShareIndex.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptSaleBalProfitShare\MsRptSaleCXProfitShareIndex.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptZjTotal\MsRptZJZYIndex.js" />
@ -2735,6 +2736,7 @@
<Content Include="Areas\MvcShipping\Views\MsRptOpProfit\ZJIndex.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptSaleBalProfitShare\TCIndex.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptSaleBalProfitShare\TBIndex.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptSaleBalProfitShare\HPJHIndex.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptSaleBalProfitShare\ZHIndex.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptSaleBalProfitShare\CXIndex.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptZjTotal\ZJZY_TBIndex.aspx" />

@ -661,13 +661,13 @@
<publishTime>06/28/2022 12:17:30</publishTime>
</File>
<File Include="Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceAppEdit.js">
<publishTime>06/28/2022 12:17:30</publishTime>
<publishTime>07/29/2022 14:24:35</publishTime>
</File>
<File Include="Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceAppEdit_P2.js">
<publishTime>06/28/2022 12:17:30</publishTime>
</File>
<File Include="Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceBLEdit.js">
<publishTime>06/28/2022 12:17:30</publishTime>
<publishTime>07/29/2022 14:23:23</publishTime>
</File>
<File Include="Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceBookEdit.js">
<publishTime>06/28/2022 12:17:30</publishTime>
@ -2767,7 +2767,7 @@
<publishTime>06/28/2022 12:17:32</publishTime>
</File>
<File Include="Areas/Import/Viewsjs/ImportTrade/MsOpBillEdit.js">
<publishTime>06/28/2022 12:17:32</publishTime>
<publishTime>07/26/2022 11:58:41</publishTime>
</File>
<File Include="Areas/Import/Viewsjs/ImportTrade/MsOpBillIndex.js">
<publishTime>06/28/2022 12:17:32</publishTime>
@ -4998,6 +4998,9 @@
<File Include="Areas/MvcShipping/Views/MsRptSaleBalProfitShare/CXIndex.aspx">
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Views/MsRptSaleBalProfitShare/HPJHIndex.aspx">
<publishTime>08/01/2022 08:18:41</publishTime>
</File>
<File Include="Areas/MvcShipping/Views/MsRptSaleBalProfitShare/HYIndex.aspx">
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
@ -5512,7 +5515,7 @@
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsChFee/FeeDrCrGrid.js">
<publishTime>07/20/2022 16:21:29</publishTime>
<publishTime>07/25/2022 16:42:00</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsChFee/FeeDrCrGridCtnTk.js">
<publishTime>06/28/2022 12:17:34</publishTime>
@ -5782,7 +5785,7 @@
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsCodeFeeTemplate/MsCodeFeeTemplateEdit.js">
<publishTime>06/28/2022 12:17:34</publishTime>
<publishTime>07/28/2022 17:28:22</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsCodeFeeTemplate/MsCodeFeeTemplateIndex.js">
<publishTime>06/28/2022 12:17:34</publishTime>
@ -6517,13 +6520,13 @@
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplateAdd.js">
<publishTime>06/28/2022 12:17:34</publishTime>
<publishTime>07/28/2022 17:26:36</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplateMode.js">
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplatePLAdd.js">
<publishTime>06/28/2022 12:17:34</publishTime>
<publishTime>07/28/2022 17:27:48</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsHome/drag.js">
<publishTime>06/28/2022 12:17:34</publishTime>
@ -7078,7 +7081,7 @@
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpBulk/MsOpBulkEdit.js">
<publishTime>06/28/2022 12:17:34</publishTime>
<publishTime>07/26/2022 11:58:41</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpBulk/MsOpBulkIndex.js">
<publishTime>06/28/2022 12:17:34</publishTime>
@ -7603,7 +7606,7 @@
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpBillEdit.js">
<publishTime>06/28/2022 12:17:34</publishTime>
<publishTime>07/26/2022 11:58:41</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpBillIndex.js">
<publishTime>06/28/2022 12:17:34</publishTime>
@ -7612,10 +7615,10 @@
<publishTime>06/04/2020 16:03:55</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpBillLSEdit.js">
<publishTime>07/01/2022 09:55:14</publishTime>
<publishTime>07/26/2022 11:58:50</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpBillLSEditIndex.js">
<publishTime>06/28/2022 12:17:34</publishTime>
<publishTime>07/26/2022 11:58:41</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpBillModel.js">
<publishTime>06/28/2022 12:17:34</publishTime>
@ -7645,7 +7648,7 @@
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js">
<publishTime>07/20/2022 15:03:18</publishTime>
<publishTime>07/27/2022 09:24:39</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEditView.js">
<publishTime>06/28/2022 12:17:34</publishTime>
@ -7666,7 +7669,7 @@
<publishTime>06/28/2022 12:17:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js">
<publishTime>07/15/2022 15:24:33</publishTime>
<publishTime>07/27/2022 11:05:14</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeModel.js">
<publishTime>07/08/2022 14:47:09</publishTime>
@ -8349,6 +8352,9 @@
<File Include="Areas/MvcShipping/Viewsjs/MsRptSaleBalProfitShare/MsRptSaleCXTCIndex.js">
<publishTime>06/28/2022 12:17:35</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsRptSaleBalProfitShare/MsRptSaleHPJHProfitShareIndex.js">
<publishTime>08/01/2022 10:30:12</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsRptSaleBalProfitShare/MsRptSaleHYProfitShareIndex.js">
<publishTime>06/28/2022 12:17:35</publishTime>
</File>
@ -10939,7 +10945,7 @@
<publishTime>06/28/2022 12:17:39</publishTime>
</File>
<File Include="Areas/SysMng/ViewJs/USERINFO/USERINFOEdit.js">
<publishTime>06/28/2022 12:17:39</publishTime>
<publishTime>07/26/2022 11:58:41</publishTime>
</File>
<File Include="Areas/SysMng/ViewJs/USERINFO/USERINFOMode.js">
<publishTime>06/28/2022 12:17:39</publishTime>
@ -12775,28 +12781,28 @@
<publishTime>06/28/2022 12:17:58</publishTime>
</File>
<File Include="bin/DSWeb.Common.dll">
<publishTime>07/01/2022 17:44:04</publishTime>
<publishTime>07/28/2022 11:31:49</publishTime>
</File>
<File Include="bin/DSWeb.Common.dll.config">
<publishTime>06/28/2022 12:17:26</publishTime>
</File>
<File Include="bin/DSWeb.Common.pdb">
<publishTime>07/01/2022 17:44:04</publishTime>
<publishTime>07/28/2022 11:31:49</publishTime>
</File>
<File Include="bin/DSWeb.dll">
<publishTime>07/22/2022 14:28:25</publishTime>
<publishTime>08/01/2022 11:20:04</publishTime>
</File>
<File Include="bin/DSWeb.Interface.dll">
<publishTime>07/01/2022 17:44:05</publishTime>
<publishTime>07/28/2022 11:31:50</publishTime>
</File>
<File Include="bin/DSWeb.Interface.pdb">
<publishTime>07/01/2022 17:44:05</publishTime>
<publishTime>07/28/2022 11:31:50</publishTime>
</File>
<File Include="bin/DSWeb.pdb">
<publishTime>07/22/2022 14:28:25</publishTime>
<publishTime>08/01/2022 11:20:04</publishTime>
</File>
<File Include="bin/DSWeb.XmlSerializers.dll">
<publishTime>07/22/2022 14:28:28</publishTime>
<publishTime>08/01/2022 11:20:11</publishTime>
</File>
<File Include="bin/DSWebComponent.dll">
<publishTime>07/01/2022 17:44:01</publishTime>
@ -12829,10 +12835,10 @@
<publishTime>06/29/2022 15:44:07</publishTime>
</File>
<File Include="bin/HcDBUtility.dll">
<publishTime>07/01/2022 17:44:01</publishTime>
<publishTime>07/26/2022 11:58:48</publishTime>
</File>
<File Include="bin/HcDBUtility.pdb">
<publishTime>07/01/2022 17:44:01</publishTime>
<publishTime>07/26/2022 11:58:48</publishTime>
</File>
<File Include="bin/HtmlTextBoxControl.dll">
<publishTime>06/28/2022 12:17:59</publishTime>
@ -13057,7 +13063,7 @@
<publishTime>06/28/2022 12:17:42</publishTime>
</File>
<File Include="bin/Spire.Pdf.dll">
<publishTime>06/28/2022 12:17:42</publishTime>
<publishTime>07/26/2022 11:58:42</publishTime>
</File>
<File Include="bin/System.Json.dll">
<publishTime>06/28/2022 12:18:00</publishTime>
@ -23989,7 +23995,7 @@
<publishTime>06/28/2022 12:17:56</publishTime>
</File>
<File Include="Web.config">
<publishTime>07/21/2022 14:57:48</publishTime>
<publishTime>07/26/2022 14:00:50</publishTime>
</File>
<File Include="WebSearchEngine/SearchEngineAdapter.aspx">
<publishTime>06/28/2022 12:17:56</publishTime>

Loading…
Cancel
Save