Przeglądaj źródła

半检登记明细表最后一次登记

chenxy 6 lat temu
rodzic
commit
5cfd96cb8f

+ 15 - 0
DK.Client/ReportModule/R08/F_RPT_080108.Designer.cs

@@ -112,6 +112,7 @@
             this.ProcedureName = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.DefectUser = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.CurrProcedureName = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.chkLast = new Dongke.IBOSS.PRD.Basics.BaseControls.C_CheckBox();
             this.gbSelect.SuspendLayout();
             this.tsrOperate.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgvSemiCheck)).BeginInit();
@@ -146,6 +147,7 @@
             this.gbSelect.Controls.Add(this.cbDeliveryDate);
             this.gbSelect.Controls.Add(this.cbBackOutTime);
             this.gbSelect.Controls.Add(this.cbSemiCheck);
+            this.gbSelect.Controls.Add(this.chkLast);
             this.gbSelect.Controls.Add(this.cbGroutingDate);
             this.gbSelect.Controls.Add(this.cbCDateTime);
             this.gbSelect.Controls.Add(this.txtDeliveryDateTimeEnd);
@@ -1152,6 +1154,18 @@
             this.CurrProcedureName.ReadOnly = true;
             this.CurrProcedureName.Width = 125;
             // 
+            // chkLast
+            // 
+            this.chkLast.AutoSize = true;
+            this.chkLast.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.chkLast.Location = new System.Drawing.Point(767, 26);
+            this.chkLast.Name = "chkLast";
+            this.chkLast.Size = new System.Drawing.Size(132, 16);
+            this.chkLast.TabIndex = 4;
+            this.chkLast.Text = "只显示最后一次登记";
+            this.chkLast.UseVisualStyleBackColor = true;
+            this.chkLast.CheckedChanged += new System.EventHandler(this.cbGroutingDate_CheckedChanged);
+            // 
             // F_RPT_080108
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1251,5 +1265,6 @@
         private Controls.SearchTextBox.dkUserInfoSearchBox txtGroutingUserCode;
         private Controls.SearchTextBox.dkUserInfoSearchBox txtCUserCode;
         private Controls.SearchBox.ScbGoodsType scbGoodsType;
+        private Basics.BaseControls.C_CheckBox chkLast;
     }
 }

+ 7 - 7
DK.Client/ReportModule/R08/F_RPT_080108.cs

@@ -189,7 +189,9 @@ namespace Dongke.IBOSS.PRD.Client.ReportModule
 			this.dkSemiCheckDefectPositionSearchBox1.ClearControl();
 			this.dkProcedureSearchBox1.ClearControl();
 			this.txtDefectUser.Text = string.Empty;
-		}
+
+            this.chkLast.Checked = false;
+        }
 
 		/// <summary>
 		/// 编辑窗体打开
@@ -432,9 +434,6 @@ namespace Dongke.IBOSS.PRD.Client.ReportModule
 					entity.DeliveryDateTimeStart = this.txtDeliveryDateTimeStart.Value;// DateTime.Parse(this.txtDeliveryDateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
 					entity.DeliveryDateTimeEnd = this.txtDeliveryDateTimeEnd.Value;// DateTime.Parse(this.txtDeliveryDateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
 				}
-				string strSemiCheckType = "";
-
-				entity.SemiCheckType = strSemiCheckType;
 				if (cbSemiCheck.Checked)
 				{
 					entity.SemiCheckDateTimeStart = this.txtSemiCheckDateTimeStart.Value;// DateTime.Parse(this.txtSemiCheckDateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
@@ -442,9 +441,6 @@ namespace Dongke.IBOSS.PRD.Client.ReportModule
 				}
 				entity.SemiCheckUserCode = this.txtSemiCheckUserCode.UserCode.Trim(); //xuwei modify 选择用户取用户编码
 				entity.RProcedureIDS = this.dkRProcedureSearchBox.ProcedureIDS;
-				string strReSemiCheckType = "";
-
-				entity.ReSemiCheckType = strReSemiCheckType;
 
 				string strBackOutFlag = "";
 				if (chkVYes.Checked)
@@ -467,6 +463,10 @@ namespace Dongke.IBOSS.PRD.Client.ReportModule
 				entity.DefectPositionIDS = this.dkSemiCheckDefectPositionSearchBox1.DefectPositionIDS;
 				entity.DefectProcedureIDS = this.dkProcedureSearchBox1.ProcedureIDS;
 				entity.DefectUser = this.txtDefectUser.Text.Trim();
+                if (this.chkLast.Checked)
+                {
+                    entity.SemiCheckType = "1";
+                }
 				ServiceResultEntity resultEntity = ReportModuleProxy.Service.GetRPT080108IData(entity);
 				return resultEntity.Data;
 			}

+ 10 - 32
DK.Service/ReportModuleLogic/ReportModuleLogic.cs

@@ -12143,12 +12143,6 @@ namespace Dongke.IBOSS.PRD.Service.ReportModuleLogic
                 sqlString = sqlString + " AND gd.DeliverTime <= :DeliveryDateTimeEnd ";
                 parameters.Add(new OracleParameter(":DeliveryDateTimeEnd", OracleDbType.Date, se.DeliveryDateTimeEnd.Value, ParameterDirection.Input));
             }
-            // 半检状态
-            if (!string.IsNullOrEmpty(se.SemiCheckType))
-            {
-                sqlString = sqlString + " AND instr(','||:SemiCheckType||',',','||sr.SemiCheckType||',')>0 ";
-                parameters.Add(new OracleParameter(":SemiCheckType", OracleDbType.NVarchar2, se.SemiCheckType, ParameterDirection.Input));
-            }
             // 半检时间起始
             if (se.SemiCheckDateTimeStart.HasValue)
             {
@@ -12179,32 +12173,6 @@ namespace Dongke.IBOSS.PRD.Service.ReportModuleLogic
                 sqlString = sqlString + "  AND instr(sr.ReworkUserCode,:ReworkUserCode)>0";
                 parameters.Add(new OracleParameter(":ReworkUserCode", OracleDbType.NVarchar2, se.ReworkUserCode, ParameterDirection.Input));
             }
-            //// 复检状态
-            //if (!string.IsNullOrEmpty(se.ReSemiCheckType))
-            //{
-            //    sqlString = sqlString + " AND instr(','||:ReSemiCheckType||',',','||sr.ReSemiCheckType||',')>0 ";
-            //    parameters.Add(new OracleParameter(":ReSemiCheckType", OracleDbType.NVarchar2, se.ReSemiCheckType, ParameterDirection.Input));
-            //}
-
-            //// 复检时间起始
-            //if (se.ReSemiCheckDateTimeStart.HasValue)
-            //{
-            //    sqlString = sqlString + " AND sr.ReSemiCheckTime >= :ReSemiCheckDateTimeStart ";
-            //    parameters.Add(new OracleParameter(":ReSemiCheckDateTimeStart", OracleDbType.Date, se.ReSemiCheckDateTimeStart.Value, ParameterDirection.Input));
-            //}
-            //// 复检时间结束
-            //if (se.ReSemiCheckDateTimeEnd.HasValue)
-            //{
-            //    sqlString = sqlString + " AND sr.ReSemiCheckTime <= :ReSemiCheckDateTimeEnd ";
-            //    parameters.Add(new OracleParameter(":ReSemiCheckDateTimeEnd", OracleDbType.Date, se.ReSemiCheckDateTimeEnd.Value, ParameterDirection.Input));
-            //}
-
-            //// 复检工号
-            //if (!string.IsNullOrEmpty(se.ReSemiCheckUserCode))
-            //{
-            //    sqlString = sqlString + "  AND instr(sr.ReSemiCheckUserCode,:ReSemiCheckUserCode)>0";
-            //    parameters.Add(new OracleParameter(":ReSemiCheckUserCode", OracleDbType.NVarchar2, se.ReSemiCheckUserCode, ParameterDirection.Input));
-            //}
             // 撤销标识
             if (!string.IsNullOrEmpty(se.BackOutFlag))
             {
@@ -12259,6 +12227,16 @@ namespace Dongke.IBOSS.PRD.Service.ReportModuleLogic
                 sqlString = sqlString + "  AND instr(srd.DEFECTUSERCODE,:DefectUser)>0";
                 parameters.Add(new OracleParameter(":DefectUser", OracleDbType.NVarchar2, se.DefectUser, ParameterDirection.Input));
             }
+            // 只显示最后一条半检记录
+            if (se.SemiCheckType == "1")
+            {
+                sqlString += "  and not exists (select sw.semireworkid\n" +
+                "       from TP_PM_SEMIREWORK sw\n" +
+                "      where sw.barcode = sr.barcode\n" +
+                "        and sw.valueflag = '1'\n" +
+                "        and (sw.backoutflag = '0' or sr.backoutflag = '1')\n" +
+                "        and sw.semireworkid > sr.semireworkid)";
+            }
             return sqlString;
         }
         //xuwei end