Browse Source

外箱条码生成BUG调整

章政 5 years ago
parent
commit
1145096086
1 changed files with 7 additions and 5 deletions
  1. 7 5
      UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

+ 7 - 5
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -1586,27 +1586,29 @@ namespace UAS_LabelMachine
                         {
                             GetCustRule();
                             string custoutboxcode = LogicHandler.BarcodeMethod1(Prefix, Suffix, SerialNumIndex, SerialNumLength, Radix);
+                            string updateCondition = "";
                             //勾选了这些参数并且打印的时候需要才进行更新
                             if (cu_print_outprod.Checked && dt.Columns.Contains("pd_custprodcode"))
                             {
-                                dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' and pd_custprodcode='" + dt.Rows[i]["pd_custprodcode"].ToString() + "')", "update");
+                                updateCondition += " and pd_custprodcode='" + dt.Rows[i]["pd_custprodcode"].ToString() + "'";
                             }
                             if (cu_print_outpo.Checked && dt.Columns.Contains("pd_pocode"))
                             {
-                                dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' and pd_pocode='" + dt.Rows[i]["pd_pocode"].ToString() + "')", "update");
+                                updateCondition += " and pd_pocode='" + dt.Rows[i]["pd_pocode"].ToString() + "'";
                             }
                             if (cu_print_ordercode.Checked && dt.Columns.Contains("pd_ordercode"))
                             {
-                                dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' and pd_ordercode='" + dt.Rows[i]["pd_ordercode"].ToString() + "')", "update");
+                                updateCondition += " and pd_ordercode='" + dt.Rows[i]["pd_ordercode"].ToString() + "'";
                             }
                             if (cu_print_outdc.Checked && dt.Columns.Contains("pib_datecode"))
                             {
-                                dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' and pib_datecode='" + dt.Rows[i]["pib_datecode"].ToString() + "')", "update");
+                                updateCondition += " and pib_datecode='" + dt.Rows[i]["pib_datecode"].ToString() + "'";
                             }
                             if (cu_print_outlotno.Checked && dt.Columns.Contains("pib_lotno"))
                             {
-                                dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' and pib_lotno='" + dt.Rows[i]["pib_lotno"].ToString() + "')", "update");
+                                updateCondition += " and pib_lotno='" + dt.Rows[i]["pib_lotno"].ToString() + "'";
                             }
+                            dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' "+ updateCondition + " )", "update");
                             dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
                         }
                     }