diff --git a/BookingJieFeng/BookingJieFeng.csproj.user b/BookingJieFeng/BookingJieFeng.csproj.user index a7beae18..620a7c78 100644 --- a/BookingJieFeng/BookingJieFeng.csproj.user +++ b/BookingJieFeng/BookingJieFeng.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU FolderProfile diff --git a/BookingWeb/BookingWeb.csproj.user b/BookingWeb/BookingWeb.csproj.user index 4ea3c326..416a30e1 100644 --- a/BookingWeb/BookingWeb.csproj.user +++ b/BookingWeb/BookingWeb.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index 903bd25f..ee4a7d4f 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -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 }; } diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsRptOpProfitController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsRptOpProfitController.cs index 9602aed4..c6a5636b 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsRptOpProfitController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsRptOpProfitController.cs @@ -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"); diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs index f6dd626c..d5302a0a 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs @@ -304,7 +304,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL return cnt; } - static public List GetSaleDataList ( string strCondition, string username, string sort = null, string load = null,string userid="",string companyid="") + static public List 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 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 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) { diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeSaleIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeSaleIndex.js index e28bf882..26e3dee1 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeSaleIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeSaleIndex.js @@ -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 }, diff --git a/DSWeb/DSWeb.csproj.user b/DSWeb/DSWeb.csproj.user index 3005460f..84e0ebd0 100644 --- a/DSWeb/DSWeb.csproj.user +++ b/DSWeb/DSWeb.csproj.user @@ -4,7 +4,7 @@ ShowAllFiles H:\DS7_QDHHYT\DSWeb\Properties\PublishProfiles\FolderProfile2.pubxml true - Debug|Any CPU + Release|Any CPU diff --git a/DispatchWeb/DispatchWeb.csproj.user b/DispatchWeb/DispatchWeb.csproj.user index 4ea3c326..416a30e1 100644 --- a/DispatchWeb/DispatchWeb.csproj.user +++ b/DispatchWeb/DispatchWeb.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU diff --git a/JsonHelper/bin/Release/JsonHelper.dll b/JsonHelper/bin/Release/JsonHelper.dll index e488690f..867470c0 100644 Binary files a/JsonHelper/bin/Release/JsonHelper.dll and b/JsonHelper/bin/Release/JsonHelper.dll differ diff --git a/JsonHelper/bin/Release/JsonHelper.pdb b/JsonHelper/bin/Release/JsonHelper.pdb index 3f45d499..8a93939a 100644 Binary files a/JsonHelper/bin/Release/JsonHelper.pdb and b/JsonHelper/bin/Release/JsonHelper.pdb differ diff --git a/WebSqlHelper/bin/Release/WebSqlHelper.dll b/WebSqlHelper/bin/Release/WebSqlHelper.dll index 9824d6ee..fc8125e1 100644 Binary files a/WebSqlHelper/bin/Release/WebSqlHelper.dll and b/WebSqlHelper/bin/Release/WebSqlHelper.dll differ diff --git a/WebSqlHelper/bin/Release/WebSqlHelper.pdb b/WebSqlHelper/bin/Release/WebSqlHelper.pdb index 6e146e1c..44a3babd 100644 Binary files a/WebSqlHelper/bin/Release/WebSqlHelper.pdb and b/WebSqlHelper/bin/Release/WebSqlHelper.pdb differ