From c896e7c87586d5513519fe0441f270bc0b3c2acb Mon Sep 17 00:00:00 2001
From: hanxuntao <641739520@qq.com>
Date: Tue, 2 Aug 2022 17:46:42 +0800
Subject: [PATCH] 2
---
.../Chfee_invoice_HangXin/Chfee_InvoiceDAL.cs | 26 +-
.../Chfee_invoice_HangXin/ChInvoiceAppEdit.js | 19 +-
.../Chfee_invoice_HangXin/ChInvoiceBLEdit.js | 18 +-
.../MsRptSaleBalProfitShareController.cs | 32 ++
.../DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs | 79 ++--
.../MsRptSaleBalProfitShareDAL.cs | 402 ++++++++++++++++--
.../MsCodeFeeTemplateEdit.js | 1 +
.../Viewsjs/MsFeeTemplate/FeeTemplateAdd.js | 6 +
.../Viewsjs/MsFeeTemplate/FeeTemplatePLAdd.js | 4 +
DSWeb/DSWeb.csproj | 2 +
.../PublishProfiles/配置文件1.pubxml.user | 56 +--
11 files changed, 546 insertions(+), 99 deletions(-)
diff --git a/DSWeb/Areas/Account/DAL/Chfee_invoice_HangXin/Chfee_InvoiceDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_invoice_HangXin/Chfee_InvoiceDAL.cs
index 96b62fce..19a2091a 100644
--- a/DSWeb/Areas/Account/DAL/Chfee_invoice_HangXin/Chfee_InvoiceDAL.cs
+++ b/DSWeb/Areas/Account/DAL/Chfee_invoice_HangXin/Chfee_InvoiceDAL.cs
@@ -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;
}
diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceAppEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceAppEdit.js
index 695df583..a21eb84e 100644
--- a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceAppEdit.js
+++ b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceAppEdit.js
@@ -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
+ });
}
diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceBLEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceBLEdit.js
index 20c32599..17b251b2 100644
--- a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceBLEdit.js
+++ b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice_HangXin/ChInvoiceBLEdit.js
@@ -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 });
}
diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsRptSaleBalProfitShareController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsRptSaleBalProfitShareController.cs
index 458d8a95..50a96991 100644
--- a/DSWeb/Areas/MvcShipping/Controllers/MsRptSaleBalProfitShareController.cs
+++ b/DSWeb/Areas/MvcShipping/Controllers/MsRptSaleBalProfitShareController.cs
@@ -32,6 +32,15 @@ namespace DSWeb.MvcShipping.Controllers
{
return View();
}
+
+ ///
+ /// 好品佳和 入口
+ ///
+ ///
+ 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 };
}
+ ///
+ /// 好品佳和 提成计算
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ 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 };
+ }
+
///
/// 泰邦 提成计算
///
diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs
index 6b8cf06c..f60e1a7b 100644
--- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs
+++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs
@@ -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;
diff --git a/DSWeb/Areas/MvcShipping/DAL/MsRptSaleBalProfitShare/MsRptSaleBalProfitShareDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsRptSaleBalProfitShare/MsRptSaleBalProfitShareDAL.cs
index 369b95dd..eeaeba7f 100644
--- a/DSWeb/Areas/MvcShipping/DAL/MsRptSaleBalProfitShare/MsRptSaleBalProfitShareDAL.cs
+++ b/DSWeb/Areas/MvcShipping/DAL/MsRptSaleBalProfitShare/MsRptSaleBalProfitShareDAL.cs
@@ -1608,45 +1608,6 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
return SetZHData(strCondition, strSql);
}
- //static public List 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 GetZHSaleMonthTTLDataList(string strCondition)
{
@@ -1919,6 +1880,369 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
#endregion
+
+ #region 好品佳和
+
+ static public List 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 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 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();
+ 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 SetHPJHSaleMonthData(StringBuilder strSql)
+ {
+ var headList = new List();
+ 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 GetTBDataList(string strCondition, string TEU, string PROFITBOUNDS, string userid, string usercode, string companyid, string sort = null)
diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeTemplate/MsCodeFeeTemplateEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeTemplate/MsCodeFeeTemplateEdit.js
index 235e1c64..79179b2e 100644
--- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeTemplate/MsCodeFeeTemplateEdit.js
+++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeTemplate/MsCodeFeeTemplateEdit.js
@@ -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, //'业务类别',
diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplateAdd.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplateAdd.js
index 1c6a3cea..c0cf1b61 100644
--- a/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplateAdd.js
+++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplateAdd.js
@@ -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();
diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplatePLAdd.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplatePLAdd.js
index f7499e9f..d838a10b 100644
--- a/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplatePLAdd.js
+++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsFeeTemplate/FeeTemplatePLAdd.js
@@ -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') {
diff --git a/DSWeb/DSWeb.csproj b/DSWeb/DSWeb.csproj
index a62965c2..35213da3 100644
--- a/DSWeb/DSWeb.csproj
+++ b/DSWeb/DSWeb.csproj
@@ -1661,6 +1661,7 @@
+
@@ -2735,6 +2736,7 @@
+
diff --git a/DSWeb/Properties/PublishProfiles/配置文件1.pubxml.user b/DSWeb/Properties/PublishProfiles/配置文件1.pubxml.user
index 92c9f64b..70a324b7 100644
--- a/DSWeb/Properties/PublishProfiles/配置文件1.pubxml.user
+++ b/DSWeb/Properties/PublishProfiles/配置文件1.pubxml.user
@@ -661,13 +661,13 @@
06/28/2022 12:17:30
- 06/28/2022 12:17:30
+ 07/29/2022 14:24:35
06/28/2022 12:17:30
- 06/28/2022 12:17:30
+ 07/29/2022 14:23:23
06/28/2022 12:17:30
@@ -2767,7 +2767,7 @@
06/28/2022 12:17:32
- 06/28/2022 12:17:32
+ 07/26/2022 11:58:41
06/28/2022 12:17:32
@@ -4998,6 +4998,9 @@
06/28/2022 12:17:34
+
+ 08/01/2022 08:18:41
+
06/28/2022 12:17:34
@@ -5512,7 +5515,7 @@
06/28/2022 12:17:34
- 07/20/2022 16:21:29
+ 07/25/2022 16:42:00
06/28/2022 12:17:34
@@ -5782,7 +5785,7 @@
06/28/2022 12:17:34
- 06/28/2022 12:17:34
+ 07/28/2022 17:28:22
06/28/2022 12:17:34
@@ -6517,13 +6520,13 @@
06/28/2022 12:17:34
- 06/28/2022 12:17:34
+ 07/28/2022 17:26:36
06/28/2022 12:17:34
- 06/28/2022 12:17:34
+ 07/28/2022 17:27:48
06/28/2022 12:17:34
@@ -7078,7 +7081,7 @@
06/28/2022 12:17:34
- 06/28/2022 12:17:34
+ 07/26/2022 11:58:41
06/28/2022 12:17:34
@@ -7603,7 +7606,7 @@
06/28/2022 12:17:34
- 06/28/2022 12:17:34
+ 07/26/2022 11:58:41
06/28/2022 12:17:34
@@ -7612,10 +7615,10 @@
06/04/2020 16:03:55
- 07/01/2022 09:55:14
+ 07/26/2022 11:58:50
- 06/28/2022 12:17:34
+ 07/26/2022 11:58:41
06/28/2022 12:17:34
@@ -7645,7 +7648,7 @@
06/28/2022 12:17:34
- 07/20/2022 15:03:18
+ 07/27/2022 09:24:39
06/28/2022 12:17:34
@@ -7666,7 +7669,7 @@
06/28/2022 12:17:34
- 07/15/2022 15:24:33
+ 07/27/2022 11:05:14
07/08/2022 14:47:09
@@ -8349,6 +8352,9 @@
06/28/2022 12:17:35
+
+ 08/01/2022 10:30:12
+
06/28/2022 12:17:35
@@ -10939,7 +10945,7 @@
06/28/2022 12:17:39
- 06/28/2022 12:17:39
+ 07/26/2022 11:58:41
06/28/2022 12:17:39
@@ -12775,28 +12781,28 @@
06/28/2022 12:17:58
- 07/01/2022 17:44:04
+ 07/28/2022 11:31:49
06/28/2022 12:17:26
- 07/01/2022 17:44:04
+ 07/28/2022 11:31:49
- 07/22/2022 14:28:25
+ 08/01/2022 11:20:04
- 07/01/2022 17:44:05
+ 07/28/2022 11:31:50
- 07/01/2022 17:44:05
+ 07/28/2022 11:31:50
- 07/22/2022 14:28:25
+ 08/01/2022 11:20:04
- 07/22/2022 14:28:28
+ 08/01/2022 11:20:11
07/01/2022 17:44:01
@@ -12829,10 +12835,10 @@
06/29/2022 15:44:07
- 07/01/2022 17:44:01
+ 07/26/2022 11:58:48
- 07/01/2022 17:44:01
+ 07/26/2022 11:58:48
06/28/2022 12:17:59
@@ -13057,7 +13063,7 @@
06/28/2022 12:17:42
- 06/28/2022 12:17:42
+ 07/26/2022 11:58:42
06/28/2022 12:18:00
@@ -23989,7 +23995,7 @@
06/28/2022 12:17:56
- 07/21/2022 14:57:48
+ 07/26/2022 14:00:50
06/28/2022 12:17:56