Browse Source

修改计数器SQL

章政 7 years ago
parent
commit
55ef739209

+ 5 - 3
UAS-MES/CustomControl/TextBoxWithIcon/SourceStepCount.Designer.cs

@@ -39,8 +39,9 @@
             this.Count.Dock = System.Windows.Forms.DockStyle.Fill;
             this.Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Count.Location = new System.Drawing.Point(0, 0);
+            this.Count.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.Count.Name = "Count";
-            this.Count.Size = new System.Drawing.Size(0, 27);
+            this.Count.Size = new System.Drawing.Size(0, 21);
             this.Count.TabIndex = 0;
             // 
             // CountRefresh
@@ -49,11 +50,12 @@
             // 
             // SourceStepCount
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.Count);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Name = "SourceStepCount";
-            this.Size = new System.Drawing.Size(118, 28);
+            this.Size = new System.Drawing.Size(88, 22);
             this.Load += new System.EventHandler(this.SourceStepCount_Load);
             this.ResumeLayout(false);
             this.PerformLayout();

+ 2 - 2
UAS-MES/CustomControl/TextBoxWithIcon/SourceStepCount.cs

@@ -86,7 +86,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         public void Start()
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
             SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='"+User.UserCode+"' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
@@ -100,7 +100,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         private void CountRefresh_Tick(object sender, EventArgs e)
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
             SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "'and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();

+ 6 - 5
UAS_MES_NEW/CustomControl/TextBoxWithIcon/SourceStepCount.Designer.cs

@@ -28,9 +28,8 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             this.Count = new System.Windows.Forms.Label();
-            this.CountRefresh = new System.Windows.Forms.Timer(this.components);
+            this.CountRefresh = new System.Windows.Forms.Timer();
             this.SuspendLayout();
             // 
             // Count
@@ -39,8 +38,9 @@
             this.Count.Dock = System.Windows.Forms.DockStyle.Fill;
             this.Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Count.Location = new System.Drawing.Point(0, 0);
+            this.Count.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.Count.Name = "Count";
-            this.Count.Size = new System.Drawing.Size(0, 27);
+            this.Count.Size = new System.Drawing.Size(0, 21);
             this.Count.TabIndex = 0;
             // 
             // CountRefresh
@@ -49,11 +49,12 @@
             // 
             // SourceStepCount
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.Count);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Name = "SourceStepCount";
-            this.Size = new System.Drawing.Size(118, 28);
+            this.Size = new System.Drawing.Size(88, 22);
             this.Load += new System.EventHandler(this.SourceStepCount_Load);
             this.ResumeLayout(false);
             this.PerformLayout();

+ 3 - 4
UAS_MES_NEW/CustomControl/TextBoxWithIcon/SourceStepCount.cs

@@ -83,11 +83,10 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
             //五分钟刷新一次
             CountRefresh.Interval = 60000;
         }
-
         public void Start()
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
-            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='"+User.UserCode+"' ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
+            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
             CountRefresh.Start();
@@ -100,7 +99,7 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
 
         private void CountRefresh_Tick(object sender, EventArgs e)
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
             SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "'and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();

+ 1 - 1
UAS_MES_NEW/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -37,7 +37,7 @@ namespace UAS_MES_NEW.OQC
         {
             if (CheckStep())
             {
-                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "upper(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
+                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
                 if (temp.Rows.Count > 0)
                 {
                     if (temp.Rows[0]["ms_ifrework"].ToString() != "0")

+ 1 - 1
UAS_MES_NEW/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -69,7 +69,7 @@ namespace UAS_MES_NEW.OQC
         {
             if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
             {
-                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "upper(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
+                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
                 if (temp.Rows.Count > 0)
                 {
                     if (temp.Rows[0]["ms_ifrework"].ToString() != "0")