'20220722两个需求'

QDHHYT
ddlucky 2 years ago
parent 7c86575ccf
commit 54454a3d19

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
</PropertyGroup>
<ProjectExtensions>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>

@ -275,9 +275,10 @@ namespace DSWeb.MvcShipping.Controllers
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
var dataList = MsOpSeaeDAL.GetSaleDataList(condition, Convert.ToString(Session["SHOWNAME"]), sort, load, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["COMPANYID"]));
var list = dataList.Skip(start).Take(limit);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
var dataList = MsOpSeaeDAL.GetSaleDataList(start, limit,condition, Convert.ToString(Session["SHOWNAME"]), sort, load, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["COMPANYID"]));
int count = MsOpSeaeDAL.getSaleDataCount(condition, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
//var list = dataList.Skip(start).Take(limit);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}

@ -846,7 +846,7 @@ namespace DSWeb.MvcShipping.Controllers
else
strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
strSql.Append(",OP_SEAE.ORDEROP");
//strSql.Append(",OP_SEAE.ORDEROP");
strSql.Append(" FROM V_OP_BILL B ");
strSql.Append(" LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) ");
@ -1483,7 +1483,7 @@ namespace DSWeb.MvcShipping.Controllers
}
else
strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
strSql.Append(",OP_SEAE.ORDEROP");
//strSql.Append(",OP_SEAE.ORDEROP");
strSql.Append(" FROM V_OP_BS B ");
strSql.Append(" LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) ");
strSql.Append("LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) ");
@ -1552,7 +1552,7 @@ namespace DSWeb.MvcShipping.Controllers
else
strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
strSql.Append(",OP_SEAE.ORDEROP");
//strSql.Append(",OP_SEAE.ORDEROP");
strSql.Append(" FROM V_OP_BILL B ");
strSql.Append(" LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) ");
strSql.Append(" LEFT JOIN VW_user U ON (U.SHOWNAME=B.SALE) ");
@ -1966,7 +1966,7 @@ namespace DSWeb.MvcShipping.Controllers
}
else
strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
strSql.Append(" FROM V_OP_BS B ");
strSql.Append(" FROM V_OP_BILL B ");
strSql.Append(" LEFT JOIN VW_user U ON (U.SHOWNAME=B.OP) ");
strSql.Append("LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) ");
if (!string.IsNullOrEmpty(feecondition))
@ -2033,7 +2033,7 @@ namespace DSWeb.MvcShipping.Controllers
else
strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
strSql.Append(" FROM V_OP_BS B ");
strSql.Append(" FROM V_OP_BILL B ");
strSql.Append(" LEFT JOIN VW_user U ON (U.SHOWNAME=B.OP) ");
if (!string.IsNullOrEmpty(feecondition))
{
@ -2189,7 +2189,7 @@ namespace DSWeb.MvcShipping.Controllers
}
else
strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
strSql.Append(" FROM V_OP_BS B ");
strSql.Append(" FROM V_OP_BILL B ");
strSql.Append("LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) ");
if (!string.IsNullOrEmpty(feecondition))
{
@ -2254,7 +2254,7 @@ namespace DSWeb.MvcShipping.Controllers
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
strSql.Append(" FROM V_OP_BS B ");
strSql.Append(" FROM V_OP_BILL B ");
if (!string.IsNullOrEmpty(feecondition))
{
strSql.Append("LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR");

@ -304,7 +304,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
return cnt;
}
static public List<MsOpSeae> GetSaleDataList ( string strCondition, string username, string sort = null, string load = null,string userid="",string companyid="")
static public List<MsOpSeae> GetSaleDataList (int start, int limit, string strCondition, string username, string sort = null, string load = null,string userid="",string companyid="")
{
var rangstr = GetSaleRangDAStr("index", userid, username, companyid);
if (!string.IsNullOrEmpty(rangstr))
@ -321,7 +321,46 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
var strSql = new StringBuilder();
strSql.Append("SELECT B.BSNO,MASTERNO,ORDERTYPE,ORDTYPE,ORDERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,CUSTNO,APPLYNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,");
strSql.Append(@"SELECT * from (SELECT row_number() over (");
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
if (sortstring.ToUpper().IndexOf("OPSTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("OPSTATUS", "(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC)"));
else if (sortstring.ToUpper().IndexOf("DRFEESTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("DRFEESTATUS", " dbo.F_GetBillDrFeeStatus(B.BSNO) "));
else if (sortstring.ToUpper().IndexOf("CRFEESTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("CRFEESTATUS", " dbo.F_GetBillCrFeeStatus(B.BSNO) "));
else if (sortstring.ToUpper().IndexOf("BSSTATUSREF") >= 0)
strSql.Append(" order by " + sortstring.Replace("BSSTATUSREF", " BSSTATUS "));
else if (sortstring.ToUpper().IndexOf("FEESTATUSREF") >= 0)
strSql.Append(" order by " + sortstring.Replace("FEESTATUSREF", " FEESTATUS "));
else if (sortstring.ToUpper().IndexOf("AMEND") >= 0)
strSql.Append(" order by " + sortstring.Replace("AMEND", " CASE WHEN (SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=B.BSNO)>0 THEN 1 ELSE 0 END "));
else if (sortstring.ToUpper().IndexOf("DRINVSTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("DRINVSTATUS", " CASE WHEN ISNULL(I.TTLINVDR,0)=0 THEN '未开票' ELSE CASE WHEN ISNULL(I.TTLINVDR,0)=ISNULL(I.TTLDR,0) THEN '已开票' ELSE '部分开票' END END "));
else if (sortstring.ToUpper().IndexOf("DRDUISTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("DRDUISTATUS", " CASE WHEN ISNULL(I.TTLDUIDR,0)=0 THEN '未对账' ELSE CASE WHEN ISNULL(I.TTLDUIDR,0)=ISNULL(I.TTLDR,0) THEN '已对账' ELSE '部分对账' END END "));
else
{
sortstring = sortstring.Replace("SALECORP", "B.SALECORPID");
strSql.Append(" order by " + sortstring);
}
}
else
{
var SeaeDefaultSort = MsSysParamSetDAL.GetData("PARAMNAME='SeaeDefaultSort'");
if (SeaeDefaultSort.PARAMVALUE != "")
strSql.Append(" order by " + SeaeDefaultSort.PARAMVALUE);
else
strSql.Append(" order by BSDATE desc");
}
strSql.Append(@") as num , ");
strSql.Append(" B.BSNO,MASTERNO,ORDERTYPE,ORDTYPE,ORDERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,CUSTNO,APPLYNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,");
strSql.Append("CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,ETD,CLOSINGDATE,ETA,VESSEL2N,VOYNO2N,VESSELID2N,");
strSql.Append("PlACERECEIPT,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE,PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,COPYNOBILL,");
@ -341,7 +380,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,ISCANCEL,ISTUI,TRANSREMARK,PRERECORD ");
strSql.Append(",SHIPAGENCY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",'' MSHIPPERID,'' MCONSIGNEEID,'' MNOTIFYPARTYID,'' MSHIPPER,'' MCONSIGNEE,'' MNOTIFYPARTY,null ATD,DELIVERYDATE,YARDATTN,YARDTEL,'' COUNTRY ");
strSql.Append(",'' MSHIPPERID,'' MCONSIGNEEID,'' MNOTIFYPARTYID,'' MSHIPPER,'' MCONSIGNEE,'' MNOTIFYPARTY,null ATD,DELIVERYDATE,YARDATTN,YARDTEL ");//,'' COUNTRY
//20161117 邓羽 增加对提单签发状态的查询
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=B.BSNO) BLISSUESTATUS,B.BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
@ -362,42 +401,10 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
{
strSql.Append(" where " + strCondition);
}
strSql.Append(@")as t ");
strSql.Append(string.Format("where t.num>{0} and t.num<={1} order by t.num ", start, start + limit));
//
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
if (sortstring.ToUpper().IndexOf("OPSTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("OPSTATUS", "(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC)"));
else if (sortstring.ToUpper().IndexOf("DRFEESTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("DRFEESTATUS", " dbo.F_GetBillDrFeeStatus(B.BSNO) "));
else if (sortstring.ToUpper().IndexOf("CRFEESTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("CRFEESTATUS", " dbo.F_GetBillCrFeeStatus(B.BSNO) "));
else if (sortstring.ToUpper().IndexOf("BSSTATUSREF") >= 0)
strSql.Append(" order by " + sortstring.Replace("BSSTATUSREF", " BSSTATUS "));
else if (sortstring.ToUpper().IndexOf("FEESTATUSREF") >= 0)
strSql.Append(" order by " + sortstring.Replace("FEESTATUSREF", " FEESTATUS "));
else if (sortstring.ToUpper().IndexOf("AMEND") >= 0)
strSql.Append(" order by " + sortstring.Replace("AMEND", " CASE WHEN (SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=B.BSNO)>0 THEN 1 ELSE 0 END "));
else if (sortstring.ToUpper().IndexOf("DRINVSTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("DRINVSTATUS", " CASE WHEN ISNULL(I.TTLINVDR,0)=0 THEN '未开票' ELSE CASE WHEN ISNULL(I.TTLINVDR,0)=ISNULL(I.TTLDR,0) THEN '已开票' ELSE '部分开票' END END "));
else if (sortstring.ToUpper().IndexOf("DRDUISTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("DRDUISTATUS", " CASE WHEN ISNULL(I.TTLDUIDR,0)=0 THEN '未对账' ELSE CASE WHEN ISNULL(I.TTLDUIDR,0)=ISNULL(I.TTLDR,0) THEN '已对账' ELSE '部分对账' END END "));
else
{
sortstring = sortstring.Replace("SALECORP", "B.SALECORPID");
strSql.Append(" order by " + sortstring);
}
}
else
{
var SeaeDefaultSort = MsSysParamSetDAL.GetData("PARAMNAME='SeaeDefaultSort'");
if (SeaeDefaultSort.PARAMVALUE != "")
strSql.Append(" order by " + SeaeDefaultSort.PARAMVALUE);
else
strSql.Append(" order by BSDATE desc");
}
return SetData(strSql);
}
@ -509,9 +516,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
}
#region 更改单
static public List<MsOpSeae> GetAmendDataList(int start, int limit, string strCondition, string userid, string usercode, string companyid, string sort = null, string load = null)
public static int getSaleDataCount(string strCondition, string userid, string usercode, string companyid)
{
var rangstr = GetRangDAStr("index", userid, usercode, companyid);
if (!string.IsNullOrEmpty(rangstr))
@ -525,79 +530,123 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strCondition = rangstr;
}
}
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(*) ");
strSql.Append(" from OP_SEAE B");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=B.BSNO) ");
strSql.Append(" left join (select bsno, sum(case when[status] = '海关放行' then 1 else 0 end) CUSTOMSSTATUS, sum(case when [status] = '运抵报告' then 1 else 0 end) HGYDSTATUS , sum(case when[status] = '码头放行' then 1 else 0 end) PORTSTATUS");
strSql.Append(", sum(case when[status] = '装船出运' then 1 else 0 end) EXPSTATUS, sum(case when [status] = '空箱出场' then 1 else case when [status] = '部分空出' then 2 else 0 end end) TRUCKCTNSTATUS");
strSql.Append(", sum(case when[status] = '到港' then 1 else 0 end) ATASTATUS, sum(case when [status] = '目的港提箱' then 1 else case when [status] = '部分目的港提箱' then 2 else 0 end end) STCSSTATUS ");
strSql.Append(", sum(case when [status] = '目的港返空' then 1 else case when [status] = '部分目的港返空' then 2 else 0 end end) RCVESTATUS ");
strSql.Append(", sum(case when[status] = '重箱返场' then 1 else case when [status] = '部分重返' then 2 else 0 end end) CTNRETURNSTATUS from op_status WITH (NOLOCK) GROUP BY BSNO) as v on(v.bsno = B.BSNO) ");
var strSql = new StringBuilder();
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" where " + strCondition);
}
int cnt = 0;
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
cnt = Convert.ToInt32(reader[0]);
}
}
return cnt;
}
strSql.Append(@"SELECT * from (SELECT row_number() over (");
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
sortstring=sortstring.Replace("FEESTATUS", "A.FEESTATUS").Replace("TRANSNO", "A.AMENDNO").Replace("EDIREMARK", "A.REASON").Replace("ACCDATE", "A.ACCDATE")
.Replace("CREATETIME", "A.CREATETIME").Replace("REMARK", "A.REMARK").Replace("MSHIPPERID", "(select showname from [user] where gid=f.Auditoperator) ").Replace("MCONSIGNEEID", "f.AUDITDATE ");
#region 更改单
strSql.Append(" order by " + sortstring);
}
else
static public List<MsOpSeae> GetAmendDataList(int start, int limit, string strCondition, string userid, string usercode, string companyid, string sort = null, string load = null)
{
var SeaeDefaultSort = MsSysParamSetDAL.GetData("PARAMNAME='SeaeDefaultSort'");
if (SeaeDefaultSort.PARAMVALUE != "")
strSql.Append(" order by " + SeaeDefaultSort.PARAMVALUE );
var rangstr = GetRangDAStr("index", userid, usercode, companyid);
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
var strSql = new StringBuilder();
strSql.Append(@"SELECT * from (SELECT row_number() over (");
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
sortstring=sortstring.Replace("FEESTATUS", "A.FEESTATUS").Replace("TRANSNO", "A.AMENDNO").Replace("EDIREMARK", "A.REASON").Replace("ACCDATE", "A.ACCDATE")
.Replace("CREATETIME", "A.CREATETIME").Replace("REMARK", "A.REMARK").Replace("MSHIPPERID", "(select showname from [user] where gid=f.Auditoperator) ").Replace("MCONSIGNEEID", "f.AUDITDATE ");
strSql.Append(" order by " + sortstring);
}
else
strSql.Append(" order by BSDATE desc");
}
strSql.Append(@") as num , ");
{
var SeaeDefaultSort = MsSysParamSetDAL.GetData("PARAMNAME='SeaeDefaultSort'");
if (SeaeDefaultSort.PARAMVALUE != "")
strSql.Append(" order by " + SeaeDefaultSort.PARAMVALUE );
else
strSql.Append(" order by BSDATE desc");
}
strSql.Append(@") as num , ");
strSql.Append("A.BSNO,A.PARENTID MASTERNO,B.ORDERTYPE,B.ORDTYPE,B.ORDERNO,BSSTATUS,A.FEESTATUS,BSDATE,A.ACCDATE,MBLNO,HBLNO,APPLYNO,CUSTNO,A.AMENDNO TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,");
strSql.Append("CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,ETD,CLOSINGDATE,ETA,VESSEL2N,VOYNO2N,VESSELID2N,");
strSql.Append("A.BSNO,A.PARENTID MASTERNO,B.ORDERTYPE,B.ORDTYPE,B.ORDERNO,BSSTATUS,A.FEESTATUS,BSDATE,A.ACCDATE,MBLNO,HBLNO,APPLYNO,CUSTNO,A.AMENDNO TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,");
strSql.Append("CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,ETD,CLOSINGDATE,ETA,VESSEL2N,VOYNO2N,VESSELID2N,");
strSql.Append("PlACERECEIPT,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE,PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,COPYNOBILL,");
strSql.Append("NOBILL,ISSUETYPE,ISSUEDATE,ISSUEPLACE,BLFRT,PREPARDAT,PREPARDATID,PAYABLEAT,[SERVICE],MARKS,CNTRSEALNO,NOPKGS,[DESCRIPTION],GOODSNAME,");
strSql.Append("GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRNO,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,");
strSql.Append("TEU,CNTRTOTAL,INPUTBY,OP,CUSTSERVICE,FRCUSTSERVICE,LANE,A.SALE,CARRIER,FORWARDER,CUSTOMSER,TRUCKER,INVNO,CARGOID,DCLASS,DUNNO,DPAGE,DLABEL,LINKMAN,");
strSql.Append("REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,HUMIDITY,BSSOURCE,BSSOURCEDETAIL,CUSTOMSNUM,CONTRACTNO,INSURANCEER,INSURANCENO,INAMOUT,A.ISVOU,A.VOUNO,A.REMARKS REMARK,STATUS1,");
strSql.Append("STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,ISHBLNO,SERVICE9,SERVICE10,DOC,PACKINGTYPE,");
strSql.Append("WAREHOUSE,CLOSEDOCDATE,INTOPORTDATE,CORPID,SALEDEPT,MBLFRT,A.CREATETIME,STLNAME,dbo.trimdate(STLDATE) STLDATE,OPERATORCODE,OPERATOR,OPERATOREMAIL,OPERATORTEL,OPERATORFAX,");
strSql.Append("FINANCIALSTAFFCODE,FINANCIALSTAFF,FINANCIALSTAFFEMAIL,FINANCIALSTAFFTEL,FINANCIALSTAFFFAX,PLACERECEIPTID,SOURCECODE,ISCONTAINERSOC,VESSELID,ISSUEPLACEID,HSCODE");
strSql.Append(",TRANSTATUS,A.REASON EDIREMARK,SERVICECONTRACTNO,(CASE BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF ");
strSql.Append(",(CASE A.FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF,TRANSPORT ");
strSql.Append(",(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS");
strSql.Append(",'' as MANIFESTSTATUSREF");
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CLEARCUSTOMDATE,ISMOREGOOD,TERMSDELIVERY,INSPECTSERVICE,TRADETERM,0 FENPIAO,B.ISGAIQIAN,B.WARNCOUNT");
strSql.Append("PlACERECEIPT,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE,PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,COPYNOBILL,");
strSql.Append("NOBILL,ISSUETYPE,ISSUEDATE,ISSUEPLACE,BLFRT,PREPARDAT,PREPARDATID,PAYABLEAT,[SERVICE],MARKS,CNTRSEALNO,NOPKGS,[DESCRIPTION],GOODSNAME,");
strSql.Append("GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRNO,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,");
strSql.Append("TEU,CNTRTOTAL,INPUTBY,OP,CUSTSERVICE,FRCUSTSERVICE,LANE,A.SALE,CARRIER,FORWARDER,CUSTOMSER,TRUCKER,INVNO,CARGOID,DCLASS,DUNNO,DPAGE,DLABEL,LINKMAN,");
strSql.Append("REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,HUMIDITY,BSSOURCE,BSSOURCEDETAIL,CUSTOMSNUM,CONTRACTNO,INSURANCEER,INSURANCENO,INAMOUT,A.ISVOU,A.VOUNO,A.REMARKS REMARK,STATUS1,");
strSql.Append("STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,ISHBLNO,SERVICE9,SERVICE10,DOC,PACKINGTYPE,");
strSql.Append("WAREHOUSE,CLOSEDOCDATE,INTOPORTDATE,CORPID,SALEDEPT,MBLFRT,A.CREATETIME,STLNAME,dbo.trimdate(STLDATE) STLDATE,OPERATORCODE,OPERATOR,OPERATOREMAIL,OPERATORTEL,OPERATORFAX,");
strSql.Append("FINANCIALSTAFFCODE,FINANCIALSTAFF,FINANCIALSTAFFEMAIL,FINANCIALSTAFFTEL,FINANCIALSTAFFFAX,PLACERECEIPTID,SOURCECODE,ISCONTAINERSOC,VESSELID,ISSUEPLACEID,HSCODE");
strSql.Append(",TRANSTATUS,A.REASON EDIREMARK,SERVICECONTRACTNO,(CASE BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF ");
strSql.Append(",(CASE A.FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF,TRANSPORT ");
strSql.Append(",(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS");
strSql.Append(",'' as MANIFESTSTATUSREF");
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CLEARCUSTOMDATE,ISMOREGOOD,TERMSDELIVERY,INSPECTSERVICE,TRADETERM,0 FENPIAO,B.ISGAIQIAN,B.WARNCOUNT");
strSql.Append(",dbo.F_GetBillDrFeeStatus(A.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(A.BSNO) CRFEESTATUS,ISPRINTPR,B.MAILPROJECT");
strSql.Append(",dbo.F_GetBillDrFeeStatus(A.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(A.BSNO) CRFEESTATUS,ISPRINTPR,B.MAILPROJECT");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=A.PARENTID) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",0 as APPLYCOUNT ");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=A.PARENTID) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",0 as APPLYCOUNT ");
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=B.BSNO) BLISSUESTATUS,ISCANCEL,ISTUI,TRANSREMARK,PRERECORD ");
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=B.BSNO) BLISSUESTATUS,ISCANCEL,ISTUI,TRANSREMARK,PRERECORD ");
strSql.Append(",(select showname from [user] where gid=f.Auditoperator) MSHIPPERID,dbo.trimdate(f.AUDITDATE) MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,A.BillFeeStatus,B.SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS ,B.TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,b.ORDEROP");
strSql.Append(",(select showname from [user] where gid=f.Auditoperator) MSHIPPERID,dbo.trimdate(f.AUDITDATE) MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,A.BillFeeStatus,B.SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS ,B.TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,b.ORDEROP");
strSql.Append(" from OP_AMEND A ");
strSql.Append(" LEFT JOIN OP_SEAE B ON (B.BSNO=A.PARENTID)");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=A.BSNO) ");
strSql.Append(" LEFT JOIN V_FEE_LASTAUDIT f ON (f.BSNO=A.BSNO AND f.NUM=1) ");
strSql.Append(" from OP_AMEND A ");
strSql.Append(" LEFT JOIN OP_SEAE B ON (B.BSNO=A.PARENTID)");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=A.BSNO) ");
strSql.Append(" LEFT JOIN V_FEE_LASTAUDIT f ON (f.BSNO=A.BSNO AND f.NUM=1) ");
strSql.Append(" WHERE B.BSNO IS NOT NULL ");
strSql.Append(" WHERE B.BSNO IS NOT NULL ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" AND " + strCondition );
}
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" AND " + strCondition );
}
strSql.Append(@")as t ");
strSql.Append(string.Format("where t.num>={0} and t.num<={1} order by t.num", start, start + limit)); //
strSql.Append(@")as t ");
strSql.Append(string.Format("where t.num>={0} and t.num<={1} order by t.num", start, start + limit)); //
return SetData(strSql);
}
return SetData(strSql);
}
public static int getAmendTotalCount(string strCondition, string userid, string usercode, string companyid)
{

@ -1048,6 +1048,23 @@ Ext.extend(Shipping.MsOpSeaeSaleIndex, Ext.Panel, {
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',//Zi.LAN.PageNum, //每页记录数
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//定义Grid
this.gridList = new Ext.grid.GridPanel({
@ -1078,12 +1095,12 @@ Ext.extend(Shipping.MsOpSeaeSaleIndex, Ext.Panel, {
},
columns: this.girdcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
}), this.Pagenum]
});
/////////////以下部分为获取存储的gridpanel显示样式
@ -1962,6 +1979,7 @@ Ext.extend(Shipping.MsOpSeaeSaleIndex, Ext.Panel, {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
@ -1972,6 +1990,7 @@ Ext.extend(Shipping.MsOpSeaeSaleIndex, Ext.Panel, {
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
this.PageSize = this.Pagenum.getValue();
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },

@ -4,7 +4,7 @@
<ProjectView>ShowAllFiles</ProjectView>
<NameOfLastUsedPublishProfile>H:\DS7_QDHHYT\DSWeb\Properties\PublishProfiles\FolderProfile2.pubxml</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>

Loading…
Cancel
Save