瀏覽代碼

修改上料未更新nextmacode字段的问题

章政 8 年之前
父節點
當前提交
ff03014346

+ 2 - 5
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -209,10 +209,7 @@ namespace UAS_MES.Make
                         string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
                         if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                         {
-                            if (sp_barcoderule == "TSN")
-                            {
-                                TSN.Add(code.Text);
-                            }
+                            TSN.Add(code.Text);
                             if (sp_barcoderule == "BARCODE")
                             {
                                 sp_soncode = ErrorMessage;
@@ -247,7 +244,7 @@ namespace UAS_MES.Make
                             sql.Append("where ma_code='" + ma_code.Text + "'and sp_id=:sp_id1 and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
                             dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
                             //更新半成品SN已被工单使用
-                            dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_makecode<>'" + ma_code.Text + "')", new string[] { "sncode" }, TSN.ToArray());
+                            dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_nextmacode is null and ms_makecode<>'" + ma_code.Text + "')", new string[] { "sncode" }, TSN.ToArray());
                             OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的物料已经采集完成\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "上料采集", "上料成功", ms_sncode.Text, "");
                             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);

+ 2 - 5
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -144,10 +144,7 @@ namespace UAS_MES.Make
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                             {
-                                if (sp_barcoderule == "TSN")
-                                {
-                                    TSN.Add(code.Text);
-                                }
+                                TSN.Add(code.Text);
                                 if (sp_barcoderule == "BARCODE")
                                 {
                                     sp_soncode = ErrorMessage;
@@ -399,7 +396,7 @@ namespace UAS_MES.Make
                 sql.Append("where ma_code='" + make_code + "'and sp_id=:sp_id1 and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
                 dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
                 //更新序列号半成品已被使用
-                dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_makecode<>'" + ma_code + "')", new string[] { "sncode" }, TSN.ToArray());
+                dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_nextmacode is null and ms_makecode<>'" + ma_code + "')", new string[] { "sncode" }, TSN.ToArray());
                 if (ma_ecncode_label.Checked || ma_softversion_label.Checked)
                 {
                     string ecnText = ma_ecncode_label.Checked ? ma_ecncode.Text : "";