Browse Source

Merge repos.ubtob.net:usoft/mes-client

callm 1 week ago
parent
commit
12da9b65c1

+ 7 - 1
UAS_MES_WEIP/FunctionCode/Make/Make_SMTSStencil.cs

@@ -638,8 +638,14 @@ namespace UAS_MES_NEW.Make
                 MessageBox.Show("请扫描确认刮刀编号");
                 return;
             }
+            DataTable dt = (DataTable)dh.ExecuteSql($"SELECT * FROM stenciluse WHERE su_stcode = '{qaConfrimCodeVal.Text}' AND su_status = '12小时清洗'", "select");
+            if (dt.Rows.Count == 0)
+            {
+                MessageBox.Show("刮刀:" + qaConfrimCodeVal.Text + "没有清洗记录");
+                return;
+            }
 
-            DataTable dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + qaConfrimCodeVal.Text + "' and st_statuscode='AUDITED' and st_kind = '刮刀'", "select");
+            dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + qaConfrimCodeVal.Text + "' and st_statuscode='AUDITED' and st_kind = '刮刀'", "select");
             if (dt.Rows.Count > 0)
             {
                 string status = dt.Rows[0]["ST_USESTATUS"].ToString();

+ 7 - 1
UAS_MES_WEIP/FunctionCode/Make/Make_SMTStencil.cs

@@ -644,8 +644,14 @@ namespace UAS_MES_NEW.Make
                 MessageBox.Show("请扫描确认钢网编号");
                 return;
             }
+            DataTable dt = (DataTable)dh.ExecuteSql($"SELECT * FROM stenciluse WHERE su_stcode = '{qaConfrimCodeVal.Text}' AND su_status = '12小时清洗'", "select");
+            if (dt.Rows.Count == 0)
+            {
+                MessageBox.Show("刮刀:" + qaConfrimCodeVal.Text + "没有清洗记录");
+                return;
+            }
 
-            DataTable dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + qaConfrimCodeVal.Text + "' and st_statuscode='AUDITED' and st_kind = '钢网'", "select");
+            dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + qaConfrimCodeVal.Text + "' and st_statuscode='AUDITED' and st_kind = '钢网'", "select");
             if (dt.Rows.Count > 0)
             {
                 string status = dt.Rows[0]["ST_USESTATUS"].ToString();

+ 2 - 2
UAS_Tools_HY/Main.cs

@@ -773,7 +773,7 @@ namespace UAS_MES_Tools
                 } 
             }
 
-            Form rulesList = new RulesList("Add",_UserName);
+            Form rulesList = new RulesList("Add",_UserName, _Account);
             if (rulesList.ShowDialog() == DialogResult.OK)
             {
                 MessageBox.Show("新增规则成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
@@ -835,7 +835,7 @@ namespace UAS_MES_Tools
                             filterStr.Append($" and instr(RULE_VALUE, '{rulesInput2.Text}') > 0");
                         }
                     }
-                    Form rulesList = new RulesList("Modify",RULE_ID, _UserName);
+                    Form rulesList = new RulesList("Modify",RULE_ID, _UserName, _Account);
                     if (rulesList.ShowDialog() == DialogResult.OK)
                     {
                         MessageBox.Show("修改规则成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

+ 14 - 3
UAS_Tools_HY/RulesList.cs

@@ -14,26 +14,37 @@ namespace UAS_Tools_HY
 {
     public partial class RulesList : Form
     {
-        public RulesList(string type,string userName)
+        public RulesList(string type,string userName, string account)
         {
             InitializeComponent();
             UserName = userName;
             TYPE = type;
+            Account = account;
         }
 
-        public RulesList(string type, string ruleId, string userName)
+        public RulesList(string type, string ruleId, string userName, string account)
         {
             InitializeComponent();
             UserName = userName;
             RULE_ID = ruleId;
             TYPE = type;
+            Account = account;
         }
         
-        string TYPE,RULE_ID,UserName;
+        string TYPE,RULE_ID,UserName,Account;
         DataTable dt;
 
         private void RulesList_Load(object sender, EventArgs e)
         {
+            dt = ConnectDB.ExecuteSelect($"SELECT * FROM employee WHERE em_code = '{Account}' AND em_checkrule = 1");
+            if (dt.Rows.Count == 0)
+            {
+                MessageBox.Show("该账户没有操作核对规则权限", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                this.DialogResult = DialogResult.No;
+                this.Close();
+                return;
+            }
+
             dt = ConnectDB.ExecuteSelect($"SELECT * FROM g_packing_rules WHERE rule_id = '{RULE_ID}'");
             if(dt.Rows.Count > 0)
             {