Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
07fae7dc69

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -179,7 +179,7 @@ namespace UAS_MES.Make
                     {
                         //获取工单的其他信息
                         sql.Clear();
-                        sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
+                        sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,nvl(ma_unlimitin,0)ma_unlimitin,ma_prodcode as pr_code ,pr_detail,");
                         sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
                         sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + (oMakeCode == "null" ? ma_code.Text : oMakeCode) + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -211,7 +211,7 @@ namespace UAS_MES.Make
                         }
                         string ErrorMessage = "";
                         string result = "";
-                        if (int.Parse(mcd_remainqty.Text) <= 0)
+                        if (int.Parse(mcd_remainqty.Text) <= 0 &&dt.Rows[0]["ma_unlimitin"].ToString()=="0")
                         {
                             macode = ma_code.Text;
                             ErrorMessage = "工单" + macode + "打印结束\n>请输入SN";
@@ -298,7 +298,7 @@ namespace UAS_MES.Make
         //根据产品编号获取打印模板
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' and PL_LABELTYPE='彩盒标' order by PL_ISDEFAULT DESC", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' and PL_LABELTYPE='彩盒标' order by PL_ISDEFAULT DESC", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_name";
             PrintLabel.ValueMember = "pl_labelcode";
@@ -335,7 +335,7 @@ namespace UAS_MES.Make
                 sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
                 sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
                 sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
                 {
                     BaseUtil.SetFormValue(this.Controls, dt);

+ 7 - 4
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -28,6 +28,8 @@ namespace UAS_MES.Make
 
         System.DateTime[] indate;
 
+        string ma_unlimitin = "";
+
         ApplicationClass lbl;
 
         string oErrorMessage = "";
@@ -97,13 +99,14 @@ namespace UAS_MES.Make
                         {
                             //获取工单的其他信息
                             sql.Clear();
-                            sql.Append("select ma_code,nvl(mcd_okqty,0),ma_prodcode,pr_detail,");
+                            sql.Append("select ma_code,nvl(mcd_okqty,0),ma_prodcode,pr_detail,nvl(ma_unlimitin,0)ma_unlimitin,");
                             sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
                             sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                             mapB = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             //如果有数据的话
                             if (mapB.Rows.Count > 0)
                             {
+                                ma_unlimitin = mapB.Rows[0]["ma_unlimitin"].ToString();
                                 //将工单的其他信息赋值到对应的控件
                                 BaseUtil.SetFormValue(this.Controls, mapB);
                                 //提示用户“<<工单号:取ma_makecode”
@@ -157,11 +160,11 @@ namespace UAS_MES.Make
                             sncode.Text = "";
                             sncode.Focus();
                             //刷新打印数量和剩余数量
-                            dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+                            dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty,nvl(ma_unlimitin,0)ma_unlimitin from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
                             BaseUtil.SetFormValue(Controls, dt);
                             mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
                             //IF 剩余数=0,则清空form中的数据, 提示用户“工单:xx已经打印完成,>>请输入SN”, 清空mapB,listC 中的数据
-                            if (int.Parse(mcd_remainqty.Text) == 0)
+                            if (int.Parse(mcd_remainqty.Text) == 0 && ma_unlimitin == "0")
                             {
                                 OperateResult.AppendText(">>工单:" + ma_code.Text + "打印完成,>>请输入SN\n", Color.Green);
                             }
@@ -190,7 +193,7 @@ namespace UAS_MES.Make
         }
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + ma_prodcode.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + ma_prodcode.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc", "select");
             if (dt.Rows.Count == 0)
             {
                 return;