fenglinyong 2 yıl önce
ebeveyn
işleme
eb7fb8a1fa

+ 102 - 77
DK.Client/ReportModule/R01/M01/F_RPT_010105.Designer.cs

@@ -31,18 +31,18 @@
 			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(F_RPT_010105));
 			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
 			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
-			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
+			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
 			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
 			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
 			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
 			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
 			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
-			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
-			System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
 			this.tsrOperate = new Dongke.IBOSS.PRD.Basics.BaseControls.C_ToolStrip();
 			this.tsbtnAdaptive = new System.Windows.Forms.ToolStripButton();
 			this.tsbtnClose = new System.Windows.Forms.ToolStripButton();
 			this.gbxCondition = new Dongke.IBOSS.PRD.Basics.BaseControls.C_GroupBox();
+			this.lblGoodsType = new Dongke.IBOSS.PRD.Basics.BaseControls.C_Label();
+			this.scbGoodsType = new Dongke.IBOSS.PRD.Client.Controls.SearchBox.ScbGoodsType();
 			this.txtGroutingUserCode = new Dongke.IBOSS.PRD.Basics.BaseControls.C_TXT_Code();
 			this.c_Label3 = new Dongke.IBOSS.PRD.Basics.BaseControls.C_Label();
 			this.txtGroutingLineCode = new Dongke.IBOSS.PRD.Basics.BaseControls.C_TXT_Code();
@@ -64,17 +64,18 @@
 			this.goodscode = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.GOODSSPECIFICATION = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.goodstypename = new System.Windows.Forms.DataGridViewTextBoxColumn();
-			this.MouldQuantity = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.groutingmouldcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.gmouldstatusname = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.beginuseddate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+			this.ENDUSEDDATE = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.groutingdate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+			this.standardgroutingcount = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.mingroutingcount = new System.Windows.Forms.DataGridViewTextBoxColumn();
+			this.mingresidue = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.sumgroutingcount = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.maxGroutingCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
-			this.groutingcount = new System.Windows.Forms.DataGridViewTextBoxColumn();
-			this.lblGoodsType = new Dongke.IBOSS.PRD.Basics.BaseControls.C_Label();
-			this.scbGoodsType = new Dongke.IBOSS.PRD.Client.Controls.SearchBox.ScbGoodsType();
+			this.leftcount = new System.Windows.Forms.DataGridViewTextBoxColumn();
+			this.financecount = new System.Windows.Forms.DataGridViewTextBoxColumn();
 			this.tsrOperate.SuspendLayout();
 			this.gbxCondition.SuspendLayout();
 			((System.ComponentModel.ISupportInitialize)(this.dgvRptProcedure)).BeginInit();
@@ -149,6 +150,27 @@
 			this.gbxCondition.TabStop = false;
 			this.gbxCondition.Text = "查询条件 ▼";
 			// 
+			// lblGoodsType
+			// 
+			this.lblGoodsType.AutoSize = true;
+			this.lblGoodsType.BackColor = System.Drawing.SystemColors.Control;
+			this.lblGoodsType.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+			this.lblGoodsType.ForeColor = System.Drawing.SystemColors.ControlText;
+			this.lblGoodsType.Location = new System.Drawing.Point(394, 51);
+			this.lblGoodsType.Name = "lblGoodsType";
+			this.lblGoodsType.Size = new System.Drawing.Size(53, 12);
+			this.lblGoodsType.TabIndex = 23;
+			this.lblGoodsType.Text = "产品类别";
+			// 
+			// scbGoodsType
+			// 
+			this.scbGoodsType.CheckedData = null;
+			this.scbGoodsType.IsOnlyDisplayEnd = false;
+			this.scbGoodsType.Location = new System.Drawing.Point(453, 48);
+			this.scbGoodsType.Name = "scbGoodsType";
+			this.scbGoodsType.Size = new System.Drawing.Size(120, 21);
+			this.scbGoodsType.TabIndex = 22;
+			// 
 			// txtGroutingUserCode
 			// 
 			this.txtGroutingUserCode.BackColor = System.Drawing.SystemColors.Window;
@@ -338,15 +360,18 @@
             this.goodscode,
             this.GOODSSPECIFICATION,
             this.goodstypename,
-            this.MouldQuantity,
             this.groutingmouldcode,
             this.gmouldstatusname,
             this.beginuseddate,
+            this.ENDUSEDDATE,
             this.groutingdate,
+            this.standardgroutingcount,
             this.mingroutingcount,
+            this.mingresidue,
             this.sumgroutingcount,
             this.maxGroutingCount,
-            this.groutingcount});
+            this.leftcount,
+            this.financecount});
 			this.dgvRptProcedure.ColumnTreeView = new System.Windows.Forms.TreeView[0];
 			this.dgvRptProcedure.ContextMenuVisible = ((Dongke.IBOSS.PRD.Basics.BaseControls.C_DataGridView.ContextMenuVisibleFlags)((Dongke.IBOSS.PRD.Basics.BaseControls.C_DataGridView.ContextMenuVisibleFlags.Refine | Dongke.IBOSS.PRD.Basics.BaseControls.C_DataGridView.ContextMenuVisibleFlags.FileOut)));
 			this.dgvRptProcedure.DynamicColumnName = "";
@@ -372,8 +397,8 @@
 			this.dgvRptProcedure.RefreshAtHscroll = false;
 			this.dgvRptProcedure.RowHeadersWidth = 50;
 			this.dgvRptProcedure.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
-			dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(39)))), ((int)(((byte)(39)))));
-			this.dgvRptProcedure.RowsDefaultCellStyle = dataGridViewCellStyle10;
+			dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(39)))), ((int)(((byte)(39)))));
+			this.dgvRptProcedure.RowsDefaultCellStyle = dataGridViewCellStyle8;
 			this.dgvRptProcedure.RowTemplate.Height = 21;
 			this.dgvRptProcedure.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
 			this.dgvRptProcedure.Size = new System.Drawing.Size(1031, 368);
@@ -439,15 +464,6 @@
 			this.goodstypename.Name = "goodstypename";
 			this.goodstypename.ReadOnly = true;
 			// 
-			// MouldQuantity
-			// 
-			this.MouldQuantity.DataPropertyName = "MouldQuantity";
-			dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-			this.MouldQuantity.DefaultCellStyle = dataGridViewCellStyle3;
-			this.MouldQuantity.HeaderText = "模具数";
-			this.MouldQuantity.Name = "MouldQuantity";
-			this.MouldQuantity.ReadOnly = true;
-			// 
 			// groutingmouldcode
 			// 
 			this.groutingmouldcode.DataPropertyName = "groutingmouldcode";
@@ -465,37 +481,58 @@
 			// beginuseddate
 			// 
 			this.beginuseddate.DataPropertyName = "beginuseddate";
-			dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-			dataGridViewCellStyle4.Format = "yyyy-MM-dd";
-			this.beginuseddate.DefaultCellStyle = dataGridViewCellStyle4;
+			dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+			dataGridViewCellStyle3.Format = "yyyy-MM-dd";
+			this.beginuseddate.DefaultCellStyle = dataGridViewCellStyle3;
 			this.beginuseddate.HeaderText = "上模日期";
 			this.beginuseddate.Name = "beginuseddate";
 			this.beginuseddate.ReadOnly = true;
 			// 
+			// ENDUSEDDATE
+			// 
+			this.ENDUSEDDATE.DataPropertyName = "ENDUSEDDATE";
+			this.ENDUSEDDATE.HeaderText = "下线日期";
+			this.ENDUSEDDATE.Name = "ENDUSEDDATE";
+			this.ENDUSEDDATE.ReadOnly = true;
+			// 
 			// groutingdate
 			// 
 			this.groutingdate.DataPropertyName = "groutingdate";
-			dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-			dataGridViewCellStyle5.Format = "yyyy-MM-dd";
-			this.groutingdate.DefaultCellStyle = dataGridViewCellStyle5;
+			dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+			dataGridViewCellStyle4.Format = "yyyy-MM-dd";
+			this.groutingdate.DefaultCellStyle = dataGridViewCellStyle4;
 			this.groutingdate.HeaderText = "首次注浆日期";
 			this.groutingdate.Name = "groutingdate";
 			this.groutingdate.ReadOnly = true;
 			// 
+			// standardgroutingcount
+			// 
+			this.standardgroutingcount.DataPropertyName = "standardgroutingcount";
+			this.standardgroutingcount.HeaderText = "标准注浆次数";
+			this.standardgroutingcount.Name = "standardgroutingcount";
+			this.standardgroutingcount.ReadOnly = true;
+			// 
 			// mingroutingcount
 			// 
 			this.mingroutingcount.DataPropertyName = "mingroutingcount";
-			dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-			this.mingroutingcount.DefaultCellStyle = dataGridViewCellStyle6;
+			dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+			this.mingroutingcount.DefaultCellStyle = dataGridViewCellStyle5;
 			this.mingroutingcount.HeaderText = "期初注浆次数";
 			this.mingroutingcount.Name = "mingroutingcount";
 			this.mingroutingcount.ReadOnly = true;
 			// 
+			// mingresidue
+			// 
+			this.mingresidue.DataPropertyName = "mingresidue";
+			this.mingresidue.HeaderText = "期初剩余注浆次数";
+			this.mingresidue.Name = "mingresidue";
+			this.mingresidue.ReadOnly = true;
+			// 
 			// sumgroutingcount
 			// 
 			this.sumgroutingcount.DataPropertyName = "sumgroutingcount";
-			dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-			this.sumgroutingcount.DefaultCellStyle = dataGridViewCellStyle7;
+			dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+			this.sumgroutingcount.DefaultCellStyle = dataGridViewCellStyle6;
 			this.sumgroutingcount.HeaderText = "本期注浆次数";
 			this.sumgroutingcount.Name = "sumgroutingcount";
 			this.sumgroutingcount.ReadOnly = true;
@@ -503,42 +540,27 @@
 			// maxGroutingCount
 			// 
 			this.maxGroutingCount.DataPropertyName = "maxGroutingCount";
-			dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-			this.maxGroutingCount.DefaultCellStyle = dataGridViewCellStyle8;
+			dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+			this.maxGroutingCount.DefaultCellStyle = dataGridViewCellStyle7;
 			this.maxGroutingCount.HeaderText = "期末注浆次数";
 			this.maxGroutingCount.Name = "maxGroutingCount";
 			this.maxGroutingCount.ReadOnly = true;
 			// 
-			// groutingcount
+			// leftcount
 			// 
-			this.groutingcount.DataPropertyName = "groutingcount";
-			dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-			this.groutingcount.DefaultCellStyle = dataGridViewCellStyle9;
-			this.groutingcount.HeaderText = "当前注浆次数";
-			this.groutingcount.Name = "groutingcount";
-			this.groutingcount.ReadOnly = true;
+			this.leftcount.DataPropertyName = "leftcount";
+			this.leftcount.HeaderText = "模具剩余注浆次数";
+			this.leftcount.Name = "leftcount";
+			this.leftcount.ReadOnly = true;
+			this.leftcount.Width = 120;
 			// 
-			// lblGoodsType
+			// financecount
 			// 
-			this.lblGoodsType.AutoSize = true;
-			this.lblGoodsType.BackColor = System.Drawing.SystemColors.Control;
-			this.lblGoodsType.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-			this.lblGoodsType.ForeColor = System.Drawing.SystemColors.ControlText;
-			this.lblGoodsType.Location = new System.Drawing.Point(394, 51);
-			this.lblGoodsType.Name = "lblGoodsType";
-			this.lblGoodsType.Size = new System.Drawing.Size(53, 12);
-			this.lblGoodsType.TabIndex = 23;
-			this.lblGoodsType.Text = "产品类别";
-			// 
-			// scbGoodsType
-			// 
-			this.scbGoodsType.CheckedData = null;
-			this.scbGoodsType.IsOnlyDisplayEnd = false;
-			this.scbGoodsType.Location = new System.Drawing.Point(453, 48);
-			this.scbGoodsType.MultiSelect = false;
-			this.scbGoodsType.Name = "scbGoodsType";
-			this.scbGoodsType.Size = new System.Drawing.Size(120, 21);
-			this.scbGoodsType.TabIndex = 22;
+			this.financecount.DataPropertyName = "financecount";
+			this.financecount.HeaderText = "财务分摊模型使用次数";
+			this.financecount.Name = "financecount";
+			this.financecount.ReadOnly = true;
+			this.financecount.Width = 130;
 			// 
 			// F_RPT_010105
 			// 
@@ -572,32 +594,35 @@
         private Basics.BaseControls.C_DateTimePicker dtpGDateStart;
         private Basics.BaseControls.C_TXT_Code txtGoodCode;
         private Basics.BaseControls.C_Label c_Label4;
-        private Basics.BaseControls.C_DataGridView dgvRptProcedure;
         private Basics.BaseControls.C_TXT_Code txtGroutingLineCode;
         private Basics.BaseControls.C_Label c_Label2;
         private Basics.BaseControls.C_TXT_Code txtGroutingUserCode;
         private Basics.BaseControls.C_Label c_Label3;
-        private System.Windows.Forms.DataGridViewTextBoxColumn BuildingNo;
-        private System.Windows.Forms.DataGridViewTextBoxColumn FloorNo;
-        private System.Windows.Forms.DataGridViewTextBoxColumn GroutingLineNo;
-        private System.Windows.Forms.DataGridViewTextBoxColumn groutinglinecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn usercode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn goodscode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn GOODSSPECIFICATION;
-        private System.Windows.Forms.DataGridViewTextBoxColumn goodstypename;
-        private System.Windows.Forms.DataGridViewTextBoxColumn MouldQuantity;
-        private System.Windows.Forms.DataGridViewTextBoxColumn groutingmouldcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn gmouldstatusname;
-        private System.Windows.Forms.DataGridViewTextBoxColumn beginuseddate;
-        private System.Windows.Forms.DataGridViewTextBoxColumn groutingdate;
-        private System.Windows.Forms.DataGridViewTextBoxColumn mingroutingcount;
-        private System.Windows.Forms.DataGridViewTextBoxColumn sumgroutingcount;
-        private System.Windows.Forms.DataGridViewTextBoxColumn maxGroutingCount;
-        private System.Windows.Forms.DataGridViewTextBoxColumn groutingcount;
         private Basics.BaseControls.C_Label c_Label5;
         private Basics.BaseControls.C_DateTimePicker dtpGDateEnd;
         private Basics.BaseControls.C_Label c_Label1;
 		private Basics.BaseControls.C_Label lblGoodsType;
 		private Controls.SearchBox.ScbGoodsType scbGoodsType;
+		private Basics.BaseControls.C_DataGridView dgvRptProcedure;
+		private System.Windows.Forms.DataGridViewTextBoxColumn BuildingNo;
+		private System.Windows.Forms.DataGridViewTextBoxColumn FloorNo;
+		private System.Windows.Forms.DataGridViewTextBoxColumn GroutingLineNo;
+		private System.Windows.Forms.DataGridViewTextBoxColumn groutinglinecode;
+		private System.Windows.Forms.DataGridViewTextBoxColumn usercode;
+		private System.Windows.Forms.DataGridViewTextBoxColumn goodscode;
+		private System.Windows.Forms.DataGridViewTextBoxColumn GOODSSPECIFICATION;
+		private System.Windows.Forms.DataGridViewTextBoxColumn goodstypename;
+		private System.Windows.Forms.DataGridViewTextBoxColumn groutingmouldcode;
+		private System.Windows.Forms.DataGridViewTextBoxColumn gmouldstatusname;
+		private System.Windows.Forms.DataGridViewTextBoxColumn beginuseddate;
+		private System.Windows.Forms.DataGridViewTextBoxColumn ENDUSEDDATE;
+		private System.Windows.Forms.DataGridViewTextBoxColumn groutingdate;
+		private System.Windows.Forms.DataGridViewTextBoxColumn standardgroutingcount;
+		private System.Windows.Forms.DataGridViewTextBoxColumn mingroutingcount;
+		private System.Windows.Forms.DataGridViewTextBoxColumn mingresidue;
+		private System.Windows.Forms.DataGridViewTextBoxColumn sumgroutingcount;
+		private System.Windows.Forms.DataGridViewTextBoxColumn maxGroutingCount;
+		private System.Windows.Forms.DataGridViewTextBoxColumn leftcount;
+		private System.Windows.Forms.DataGridViewTextBoxColumn financecount;
 	}
 }

+ 13 - 1
DK.Client/ReportModule/R01/M01/F_RPT_010105.resx

@@ -218,12 +218,24 @@
   <metadata name="goodstypename.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="MouldQuantity.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="ENDUSEDDATE.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="standardgroutingcount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="mingroutingcount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="mingresidue.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="leftcount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="financecount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>33</value>
   </metadata>

+ 172 - 68
DK.Service/ReportModuleLogic/ReportModuleLogic.cs

@@ -686,74 +686,178 @@ namespace Dongke.IBOSS.PRD.Service.ReportModuleLogic
 			try
 			{
 				conn = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
-				string sqlString =
-					"SELECT t.groutinglinecode\n" +
-					"      ,gl.BuildingNo\n" +
-					"      ,gl.FloorNo\n" +
-					"      ,gl.GroutingLineNo\n" +
-					"      ,t.usercode\n" +
-					"      ,t.goodscode\n" +
-					"      ,t.GOODSSPECIFICATION\n" +
-					"      ,t.goodstypename\n" +
-					"      ,t.MouldQuantity\n" +
-					"      ,gld.groutingmouldcode\n" +
-					"      ,gms.gmouldstatusname\n" +
-					"      ,gld.beginuseddate\n" +
-					"      ,(SELECT MIN(ggg.groutingdate)\n" +
-					"          FROM tp_pm_groutingdailydetail ggg\n" +
-					"         WHERE ggg.groutinglinedetailid = t.groutinglinedetailid) groutingdate\n" +
-					"      ,MAX(t.GroutingCount)-SUM(t.groutingflag) mingroutingcount\n" +
-					"      ,SUM(t.groutingflag) sumgroutingcount\n" +
-					"      ,MAX(t.GroutingCount) maxGroutingCount\n" +
-					"      ,gld.groutingcount\n" +
-					"  FROM (SELECT gd.groutinglinecode\n" +
-					"              ,gd.usercode\n" +
-					"              ,gdd.goodsid\n" +
-					"              ,gd.MouldQuantity\n" +
-					"              ,gdd.groutinglinedetailid\n" +
-					"              ,decode(gdd.groutingflag, '1', 1, 0) groutingflag\n" +
-					"              ,gdd.GroutingCount\n" +
-					"              ,gt.goodstypename\n" +
-					"              ,g.goodscode\n" +
-					"              ,g.GOODSSPECIFICATION\n" +
-					"          FROM TP_PM_GroutingDaily gd\n" +
-					"         INNER JOIN TP_PM_GroutingDailyDetail gdd\n" +
-					"            ON gdd.groutingdailyid = gd.groutingdailyid\n" +
-					"         INNER JOIN TP_MST_Goods g\n" +
-					"            ON g.goodsid = gdd.goodsid\n" +
-					"         INNER JOIN TP_MST_GOODSTYPE gt\n" +
-					"            ON gt.goodstypeid = g.goodstypeid\n" +
-					"         WHERE gd.accountid = :AccountID\n" +
-					"           AND gd.groutingdate >= :GDateBegin\n" +
-					"           AND gd.groutingdate <= :GDateEnd\n" +
-					"           AND (:groutinglinecode is null or instr(gd.groutinglinecode, :groutinglinecode) > 0)\n" +
-					"           AND (:groutingusercode is null or instr(gdd.usercode, :groutingusercode) > 0)\n" +
-					"           AND (:goodscode is null or instr(gdd.goodscode, :goodscode) > 0)\n" +
-					"           AND (:goodstypecode is null or instr(gt.goodstypecode, :goodstypecode) = 1)\n" +
-					"           ) t\n" +
-					" INNER JOIN tp_pc_groutinglinedetail gld\n" +
-					"    ON gld.groutinglinedetailid = t.groutinglinedetailid\n" +
-					" INNER JOIN tp_pc_groutingline gl\n" +
-					"    ON gld.groutinglineid = gl.groutinglineid\n" +
-					" INNER JOIN TP_SYS_GMouldStatus gms\n" +
-					"    ON gms.gmouldstatusid = gld.gmouldstatus\n" +
-					" GROUP BY t.groutinglinecode\n" +
-					"         ,gl.BuildingNo\n" +
-					"         ,gl.FloorNo\n" +
-					"         ,gl.GroutingLineNo\n" +
-					"         ,t.usercode\n" +
-					"         ,t.goodscode\n" +
-					"         ,t.GOODSSPECIFICATION\n" +
-					"         ,t.goodstypename\n" +
-					"         ,t.MouldQuantity\n" +
-					"         ,gld.groutingmouldcode\n" +
-					"         ,gms.gmouldstatusname\n" +
-					"         ,gld.beginuseddate\n" +
-					"         ,gld.groutingcount\n" +
-					"         ,t.groutinglinedetailid\n" +
-					" ORDER BY t.groutinglinecode, gld.groutingmouldcode, t.groutinglinedetailid";
-
-				List<OracleParameter> parameters = new List<OracleParameter>();
+				//string sqlString =
+				//	"SELECT t.groutinglinecode\n" +
+				//	"      ,gl.BuildingNo\n" +
+				//	"      ,gl.FloorNo\n" +
+				//	"      ,gl.GroutingLineNo\n" +
+				//	"      ,t.usercode\n" +
+				//	"      ,t.goodscode\n" +
+				//	"      ,t.GOODSSPECIFICATION\n" +
+				//	"      ,t.goodstypename\n" +
+				//	"      ,t.MouldQuantity\n" +
+				//	"      ,gld.groutingmouldcode\n" +
+				//	"      ,gms.gmouldstatusname\n" +
+				//	"      ,gld.beginuseddate\n" +
+				//	"      ,(SELECT MIN(ggg.groutingdate)\n" +
+				//	"          FROM tp_pm_groutingdailydetail ggg\n" +
+				//	"         WHERE ggg.groutinglinedetailid = t.groutinglinedetailid) groutingdate\n" +
+				//	"      ,MAX(t.GroutingCount)-SUM(t.groutingflag) mingroutingcount\n" +
+				//	"      ,SUM(t.groutingflag) sumgroutingcount\n" +
+				//	"      ,MAX(t.GroutingCount) maxGroutingCount\n" +
+				//	"      ,gld.groutingcount\n" +
+				//	"      ,MAX(gld.standardgroutingcount) standardgroutingcount\n" +
+				//	"      ,gld.ENDUSEDDATE\n" +
+				//	"     ,gld.standardgroutingcount - (MAX(t.GroutingCount)+SUM(t.groutingflag)) - SUM(t.groutingflag) leftcount\n" +
+				//	"  FROM (SELECT gd.groutinglinecode\n" +
+				//	"              ,gd.usercode\n" +
+				//	"              ,gdd.goodsid\n" +
+				//	"              ,gd.MouldQuantity\n" +
+				//	"              ,gdd.groutinglinedetailid\n" +
+				//	"              ,decode(gdd.groutingflag, '1', 1, 0) groutingflag\n" +
+				//	"              ,gdd.GroutingCount\n" +
+				//	"              ,gt.goodstypename\n" +
+				//	"              ,g.goodscode\n" +
+				//	"              ,g.GOODSSPECIFICATION\n" +
+				//	"          FROM TP_PM_GroutingDaily gd\n" +
+				//	"         INNER JOIN TP_PM_GroutingDailyDetail gdd\n" +
+				//	"            ON gdd.groutingdailyid = gd.groutingdailyid\n" +
+				//	"         INNER JOIN TP_MST_Goods g\n" +
+				//	"            ON g.goodsid = gdd.goodsid\n" +
+				//	"         INNER JOIN TP_MST_GOODSTYPE gt\n" +
+				//	"            ON gt.goodstypeid = g.goodstypeid\n" +
+				//	"         WHERE gd.accountid = :AccountID\n" +
+				//	"           AND gd.groutingdate >= :GDateBegin\n" +
+				//	"           AND gd.groutingdate <= :GDateEnd\n" +
+				//	"           AND (:groutinglinecode is null or instr(gd.groutinglinecode, :groutinglinecode) > 0)\n" +
+				//	"           AND (:groutingusercode is null or instr(gdd.usercode, :groutingusercode) > 0)\n" +
+				//	"           AND (:goodscode is null or instr(gdd.goodscode, :goodscode) > 0)\n" +
+				//	"           AND (:goodstypecode is null or instr(gt.goodstypecode, :goodstypecode) = 1)\n" +
+				//	"           ) t\n" +
+				//	" INNER JOIN tp_pc_groutinglinedetail gld\n" +
+				//	"    ON gld.groutinglinedetailid = t.groutinglinedetailid\n" +
+				//	" INNER JOIN tp_pc_groutingline gl\n" +
+				//	"    ON gld.groutinglineid = gl.groutinglineid\n" +
+				//	" INNER JOIN TP_SYS_GMouldStatus gms\n" +
+				//	"    ON gms.gmouldstatusid = gld.gmouldstatus\n" +
+				//	" GROUP BY t.groutinglinecode\n" +
+				//	"         ,gl.BuildingNo\n" +
+				//	"         ,gl.FloorNo\n" +
+				//	"         ,gl.GroutingLineNo\n" +
+				//	"         ,t.usercode\n" +
+				//	"         ,t.goodscode\n" +
+				//	"         ,t.GOODSSPECIFICATION\n" +
+				//	"         ,t.goodstypename\n" +
+				//	"         ,t.MouldQuantity\n" +
+				//	"         ,gld.groutingmouldcode\n" +
+				//	"         ,gms.gmouldstatusname\n" +
+				//	"         ,gld.beginuseddate\n" +
+				//	"         ,gld.groutingcount\n" +
+				//	"         ,gld.ENDUSEDDATE\n" +
+				//	"         ,t.groutinglinedetailid\n" +
+				//	" ORDER BY t.groutinglinecode, gld.groutingmouldcode, t.groutinglinedetailid";
+
+				string sqlString = @"SELECT
+													groutinglinecode,
+													BuildingNo,
+													FloorNo,
+													GroutingLineNo,
+													usercode,
+													goodscode,
+													GOODSSPECIFICATION,
+													goodstypename,
+													MouldQuantity,
+													groutingmouldcode,
+													gmouldstatusname,
+													beginuseddate,
+													groutingdate,
+													mingroutingcount,
+													sumgroutingcount,
+													maxGroutingCount,
+													groutingcount,
+													standardgroutingcount,
+													ENDUSEDDATE,
+													standardgroutingcount - mingroutingcount - sumgroutingcount leftcount,
+													CASE WHEN gmouldstatusname <> '正常' AND standardgroutingcount-sumgroutingcount+mingroutingcount > standardgroutingcount THEN 0 
+															 WHEN gmouldstatusname <> '正常' AND standardgroutingcount-sumgroutingcount+mingroutingcount < standardgroutingcount THEN standardgroutingcount-sumgroutingcount+mingroutingcount 
+													ELSE sumgroutingcount END financecount,
+													standardgroutingcount - mingroutingcount mingresidue 
+												FROM
+													(
+													SELECT
+														t.groutinglinecode,
+														gl.BuildingNo,
+														gl.FloorNo,
+														gl.GroutingLineNo,
+														t.usercode,
+														t.goodscode,
+														t.GOODSSPECIFICATION,
+														t.goodstypename,
+														t.MouldQuantity,
+														gld.groutingmouldcode,
+														gms.gmouldstatusname,
+														gld.beginuseddate,
+														( SELECT MIN( ggg.groutingdate ) FROM tp_pm_groutingdailydetail ggg WHERE ggg.groutinglinedetailid = t.groutinglinedetailid ) groutingdate,
+														MAX( t.GroutingCount ) - SUM( t.groutingflag ) mingroutingcount,
+														SUM( t.groutingflag ) sumgroutingcount,
+														MAX( t.GroutingCount ) maxGroutingCount,
+														gld.groutingcount,
+														MAX( gld.standardgroutingcount ) standardgroutingcount,
+														gld.ENDUSEDDATE 
+													FROM
+														(
+														SELECT
+															gd.groutinglinecode,
+															gd.usercode,
+															gdd.goodsid,
+															gd.MouldQuantity,
+															gdd.groutinglinedetailid,
+															decode( gdd.groutingflag, '1', 1, 0 ) groutingflag,
+															gdd.GroutingCount,
+															gt.goodstypename,
+															g.goodscode,
+															g.GOODSSPECIFICATION 
+														FROM
+															TP_PM_GroutingDaily gd
+															INNER JOIN TP_PM_GroutingDailyDetail gdd ON gdd.groutingdailyid = gd.groutingdailyid
+															INNER JOIN TP_MST_Goods g ON g.goodsid = gdd.goodsid
+															INNER JOIN TP_MST_GOODSTYPE gt ON gt.goodstypeid = g.goodstypeid 
+														WHERE
+															gd.accountid = 1 
+															AND gd.groutingdate >= :GDateBegin
+															AND gd.groutingdate <= :GDateEnd
+												 			AND ( : groutinglinecode IS NULL OR instr( gd.groutinglinecode, : groutinglinecode ) > 0 ) 
+												 			AND ( : groutingusercode IS NULL OR instr( gdd.usercode, : groutingusercode ) > 0 ) 
+												 			AND ( : goodscode IS NULL OR instr( gdd.goodscode, : goodscode ) > 0 ) 
+												 			AND ( : goodstypecode IS NULL OR instr( gt.goodstypecode, : goodstypecode ) = 1 ) 
+														) t
+														INNER JOIN tp_pc_groutinglinedetail gld ON gld.groutinglinedetailid = t.groutinglinedetailid
+														INNER JOIN tp_pc_groutingline gl ON gld.groutinglineid = gl.groutinglineid
+														INNER JOIN TP_SYS_GMouldStatus gms ON gms.gmouldstatusid = gld.gmouldstatus 
+													GROUP BY
+														t.groutinglinecode,
+														gl.BuildingNo,
+														gl.FloorNo,
+														gl.GroutingLineNo,
+														t.usercode,
+														t.goodscode,
+														t.GOODSSPECIFICATION,
+														t.goodstypename,
+														t.MouldQuantity,
+														gld.groutingmouldcode,
+														gms.gmouldstatusname,
+														gld.beginuseddate,
+														gld.groutingcount,
+														gld.ENDUSEDDATE,
+														t.groutinglinedetailid 
+													ORDER BY
+														BuildingNo,
+														GroutingLineNo,
+														groutinglinecode,
+													groutingmouldcode 
+													)";
+
+				List <OracleParameter> parameters = new List<OracleParameter>();
 				parameters.Add(new OracleParameter(":AccountID", OracleDbType.Int32, user.AccountID, ParameterDirection.Input));
 				parameters.Add(new OracleParameter(":GDateBegin", OracleDbType.Date, se.GDateBegin, ParameterDirection.Input));
 				parameters.Add(new OracleParameter(":GDateEnd", OracleDbType.Date, se.GDateEnd, ParameterDirection.Input));