瀏覽代碼

唯一条码BUG调整

章政 6 年之前
父節點
當前提交
bab1d7bf40
共有 1 個文件被更改,包括 16 次插入6 次删除
  1. 16 6
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 16 - 6
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -398,7 +398,17 @@ namespace UAS_LabelMachine
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
             sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["BRAND"] + "','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark,'" + MidboxCapacity.Value + "','" + pi_cardcode.Text + "' ");
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
-            int rowsnum = dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
+            int rowsnum = 0;
+            try
+            {
+                rowsnum = dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
+            }
+            catch (Exception)
+            {
+                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (pi_cardcode.Text == "" ? "Default" : pi_cardcode.Text) + "' and rmn_prefix='" + Prefix + "'");
+                CollectInputData();
+                return;
+            }
             if (rowsnum == 0)
             {
                 MessageBox.Show("未成功插入数据,请核对出货单当前明细", "提示");
@@ -1182,11 +1192,11 @@ namespace UAS_LabelMachine
             {
                 Pack_Click(sender, e);
                 //记录整箱的重量
-                sql.Clear();
-                sql.Append("update prodiobarcode set pib_totalweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
-                sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
-                dh.ExecuteSql(sql.ToString(), "update");
-                LoadGridData(sender, e);
+                //sql.Clear();
+                //sql.Append("update prodiobarcode set pib_totalweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
+                //sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
+                //dh.ExecuteSql(sql.ToString(), "update");
+                //LoadGridData(sender, e);
                 thread = new Thread(OutBoxPrint);
                 stw = new SetLoadingWindow(thread, "正在打印外箱");
                 BaseUtil.SetFormCenter(stw);