|
|
@@ -655,7 +655,7 @@ namespace UAS_LabelMachine
|
|
|
else
|
|
|
Print.BarTender.SinglePrint(SingleFormat, SingleLabelParam, pib_id);
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_ifprint"].Value = true;
|
|
|
- sdh.ExecuteSql("update prodibarcode set pib_ifprint=-1 where pib_id='" + pib_id + "'", "update");
|
|
|
+ sdh.ExecuteSql("update prodiobarcode set pib_ifprint=-1 where pib_id='" + pib_id + "'", "update");
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -1221,7 +1221,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
//勾选为已打印
|
|
|
LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
|
|
|
- sdh.ExecuteSql("update prodibarcode set pib_ifprint=-1 where pib_id='" + pib_id + "'", "update");
|
|
|
+ sdh.ExecuteSql("update prodiobarcode set pib_ifprint=-1 where pib_id='" + pib_id + "'", "update");
|
|
|
}
|
|
|
catch (Exception ex) { LogManager.DoLog(ex.Message); }
|
|
|
}
|
|
|
@@ -2381,13 +2381,13 @@ namespace UAS_LabelMachine
|
|
|
DataTable dt = ExcelHandler.ExcelToDataTable(ImportExcel.FileName, true);
|
|
|
if (dt == null)
|
|
|
{
|
|
|
- MessageBox.Show("文件" + ImportExcel.FileName + "被占用");
|
|
|
+ MessageBox.Show("文件" + ImportExcel.FileName + "被占用或者格式不正确");
|
|
|
return;
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pr_orispeccode,pd_outqty-nvl(sum(pib_qty),0) pd_outqty,pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,");
|
|
|
+ sql.Append("select pr_spec,pd_outqty-nvl(sum(pib_qty),0) pd_outqty,pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,");
|
|
|
sql.Append("pd_prodcode,pd_ordercode,pd_orderdetno from prodiodetail left join product on pd_prodcode=pr_code left join prodiobarcode ");
|
|
|
- sql.Append("on pd_id=pib_pdid where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode,pd_outqty,");
|
|
|
+ sql.Append("on pd_id=pib_pdid where pd_inoutno='" + pi_inoutno.Text + "' group by pr_spec,pd_outqty,");
|
|
|
sql.Append("pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,pd_id,pd_prodcode,pd_ordercode,pd_orderdetno order by pd_pdno");
|
|
|
DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
//需要插入的参数
|
|
|
@@ -2408,36 +2408,36 @@ namespace UAS_LabelMachine
|
|
|
Dictionary<string, Dictionary<string, decimal>> outsumqty = new Dictionary<string, Dictionary<string, decimal>>();
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- string pr_orispeccode = dt.Rows[i]["规格型号"].ToString();
|
|
|
+ string pr_spec = dt.Rows[i]["规格型号"].ToString();
|
|
|
string qty = dt.Rows[i]["数量"].ToString();
|
|
|
//累计Excel该型号的数量
|
|
|
- if (!sumqty.ContainsKey(pr_orispeccode))
|
|
|
+ if (!sumqty.ContainsKey(pr_spec))
|
|
|
{
|
|
|
- sumqty.Add(pr_orispeccode, 0);
|
|
|
+ sumqty.Add(pr_spec, 0);
|
|
|
}
|
|
|
//累计Excel该型号的数量
|
|
|
- sumqty[pr_orispeccode] += decimal.Parse(qty);
|
|
|
+ sumqty[pr_spec] += decimal.Parse(qty);
|
|
|
}
|
|
|
for (int i = 0; i < dt1.Rows.Count; i++)
|
|
|
{
|
|
|
//不包含型号则进行添加
|
|
|
- string pr_orispeccode = dt1.Rows[i]["pr_orispeccode"].ToString();
|
|
|
+ string pr_spec = dt1.Rows[i]["pr_spec"].ToString();
|
|
|
string pd_pdno = dt1.Rows[i]["pd_pdno"].ToString();
|
|
|
decimal pd_outqty = decimal.Parse(dt1.Rows[i]["pd_outqty"].ToString());
|
|
|
- if (!outsumqty.ContainsKey(pr_orispeccode))
|
|
|
+ if (!outsumqty.ContainsKey(pr_spec))
|
|
|
{
|
|
|
Dictionary<string, decimal> dic = new Dictionary<string, decimal>();
|
|
|
dic.Add(pd_pdno, pd_outqty);
|
|
|
- outsumqty.Add(pr_orispeccode, dic);
|
|
|
+ outsumqty.Add(pr_spec, dic);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- outsumqty[pr_orispeccode].Add(pd_pdno, pd_outqty);
|
|
|
+ outsumqty[pr_spec].Add(pd_pdno, pd_outqty);
|
|
|
}
|
|
|
}
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- string pr_orispeccode = dt.Rows[i]["规格型号"].ToString();
|
|
|
+ string pr_spec = dt.Rows[i]["规格型号"].ToString();
|
|
|
string qty = dt.Rows[i]["数量"].ToString();
|
|
|
string DateCode = "";
|
|
|
string LotNo = "";
|
|
|
@@ -2458,15 +2458,15 @@ namespace UAS_LabelMachine
|
|
|
LotNo = dt.Rows[i]["LOT NO"].ToString();
|
|
|
}
|
|
|
string pib_outboxcode2 = dt.Rows[i]["箱号"].ToString();
|
|
|
- DataRow[] dr = dt1.Select("pr_orispeccode='" + pr_orispeccode + "'");
|
|
|
+ DataRow[] dr = dt1.Select("pr_spec='" + pr_spec + "'");
|
|
|
if (dr.Length == 0)
|
|
|
{
|
|
|
- LogicHandler.FilterData(cu_code.Text, "FUDAN", pr_orispeccode, qty, DateCode, LotNo, out pr_orispeccode, out qty, out DateCode, out LotNo);
|
|
|
- dr = dt1.Select("pr_orispeccode='" + pr_orispeccode + "'");
|
|
|
+ LogicHandler.FilterData(cu_code.Text, "FUDAN", pr_spec, qty, DateCode, LotNo, out pr_spec, out qty, out DateCode, out LotNo);
|
|
|
+ dr = dt1.Select("pr_spec='" + pr_spec + "'");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogicHandler.FilterData(cu_code.Text, dr[0]["pr_brand"].ToString(), pr_orispeccode, qty, DateCode, LotNo, out pr_orispeccode, out qty, out DateCode, out LotNo);
|
|
|
+ LogicHandler.FilterData(cu_code.Text, dr[0]["pr_brand"].ToString(), pr_spec, qty, DateCode, LotNo, out pr_spec, out qty, out DateCode, out LotNo);
|
|
|
}
|
|
|
decimal outqty = decimal.Parse(Regex.Replace(qty, @"[^\d]*", ""));
|
|
|
for (int k = 0; k < dr.Length; k++)
|
|
|
@@ -2484,12 +2484,12 @@ namespace UAS_LabelMachine
|
|
|
decimal zxbzs = decimal.Parse(dr[k]["pr_zxbzs"].ToString());
|
|
|
decimal pd_outqty = 0;
|
|
|
decimal barcodenum = 0;
|
|
|
- if (outsumqty[pr_orispeccode][pd_pdno] == 0)
|
|
|
+ if (outsumqty[pr_spec][pd_pdno] == 0)
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
//如果导入行的数量小于改明细的出货数量
|
|
|
- if (outsumqty[pr_orispeccode][pd_pdno] >= outqty)
|
|
|
+ if (outsumqty[pr_spec][pd_pdno] >= outqty)
|
|
|
{
|
|
|
//使用导入明细行数量
|
|
|
pd_outqty = outqty;
|
|
|
@@ -2497,7 +2497,7 @@ namespace UAS_LabelMachine
|
|
|
else
|
|
|
{
|
|
|
////使用该出货单明细行数量,并且数量置为0
|
|
|
- pd_outqty = outsumqty[pr_orispeccode][pd_pdno];
|
|
|
+ pd_outqty = outsumqty[pr_spec][pd_pdno];
|
|
|
}
|
|
|
string pib_barcode = dh.getFieldDataByCondition("prodiobarcode", "max(pib_barcode)", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
|
|
|
if (pd_outqty % zxbzs != 0)
|
|
|
@@ -2551,18 +2551,18 @@ namespace UAS_LabelMachine
|
|
|
pdprodcode.Add(pd_prodcode);
|
|
|
}
|
|
|
}
|
|
|
- outqty -= outsumqty[pr_orispeccode][pd_pdno];
|
|
|
- outsumqty[pr_orispeccode][pd_pdno] -= pd_outqty;
|
|
|
+ outqty -= outsumqty[pr_spec][pd_pdno];
|
|
|
+ outsumqty[pr_spec][pd_pdno] -= pd_outqty;
|
|
|
}
|
|
|
}
|
|
|
//插叙所有的统计数量
|
|
|
string ErrMsg = "";
|
|
|
foreach (var item in sumqty)
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select nvl(sum(pd_outqty),0)pd_outqty,pr_orispeccode from prodiodetail left join product on pr_code=pd_prodcode where pd_piid='" + PI_ID + "' group by pr_orispeccode", "select");
|
|
|
- dt1 = (DataTable)dh.ExecuteSql("select nvl(sum(pib_qty),0)pib_qty,pr_orispeccode from prodiobarcode left join product on pib_prodcode=pr_code where pib_piid='" + PI_ID + "' group by pr_orispeccode", "select");
|
|
|
- DataRow[] dr = dt.Select("pr_orispeccode='" + item.Key + "'");
|
|
|
- DataRow[] dr1 = dt1.Select("pr_orispeccode='" + item.Key + "'");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select nvl(sum(pd_outqty),0)pd_outqty,pr_spec from prodiodetail left join product on pr_code=pd_prodcode where pd_piid='" + PI_ID + "' group by pr_spec", "select");
|
|
|
+ dt1 = (DataTable)dh.ExecuteSql("select nvl(sum(pib_qty),0)pib_qty,pr_spec from prodiobarcode left join product on pib_prodcode=pr_code where pib_piid='" + PI_ID + "' group by pr_spec", "select");
|
|
|
+ DataRow[] dr = dt.Select("pr_spec='" + item.Key + "'");
|
|
|
+ DataRow[] dr1 = dt1.Select("pr_spec='" + item.Key + "'");
|
|
|
if (dr.Length > 0)
|
|
|
{
|
|
|
decimal pd_outqty = decimal.Parse(dr[0]["pd_outqty"].ToString());
|
|
|
@@ -2575,7 +2575,7 @@ namespace UAS_LabelMachine
|
|
|
//本次导入的数量和原有导入数量累加和出库数量做对比
|
|
|
if (pd_outqty < item.Value + pib_qty)
|
|
|
{
|
|
|
- ErrMsg += "型号" + dr[0]["pr_orispeccode"].ToString() + "出货数量" + pd_outqty + ",已导入数量" + pib_qty + ",本次导入" + item.Value + ",超出数量" + (item.Value + pib_qty - pd_outqty) + "\n";
|
|
|
+ ErrMsg += "型号" + dr[0]["pr_spec"].ToString() + "出货数量" + pd_outqty + ",已导入数量" + pib_qty + ",本次导入" + item.Value + ",超出数量" + (item.Value + pib_qty - pd_outqty) + "\n";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -2585,10 +2585,10 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into prodiobarcode (PIB_ID,PIB_PRODCODE,pib_inman,PIB_INDATE,PIB_INOUTNO,PIB_PIID,pib_brand,PIB_BARCODE,PIB_PDNO,");
|
|
|
- sql.Append("PIB_PDID,PIB_PICLASS,PIB_QTY,pib_datecode,pib_lotno,PIB_OUTBOXCODE1,PIB_IFPRINT,PIB_IFPICK,PIB_ORDERCODE,pib_orderdetno,pib_outboxcode2,pib_custbarcode)");
|
|
|
- sql.Append(" values (prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,'" + pi_inoutno.Text + "'");
|
|
|
- sql.Append("," + PI_ID + ",:pr_brand,:barcode,:pd_pdno,:pd_id,");
|
|
|
- sql.Append("'" + pi_class.Text + "',:pib_inqty,:pib_datecode,:pib_lotno,0,0,:pd_ordercode,'',:pd_orderdetno,:outboxcode,:custbarcode)");
|
|
|
+ sql.Append("PIB_PDID,PIB_PICLASS,PIB_QTY,pib_datecode,pib_lotno,PIB_IFPRINT,PIB_IFPICK,PIB_ORDERCODE,pib_orderdetno,");
|
|
|
+ sql.Append("pib_outboxcode2,pib_custbarcode)values(prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,");
|
|
|
+ sql.Append("'" + pi_inoutno.Text + "'," + PI_ID + ",:pr_brand,:barcode,:pd_pdno,:pd_id,'" + pi_class.Text + "',:pib_inqty,");
|
|
|
+ sql.Append(":pib_datecode,:pib_lotno,0,-1,:pd_ordercode,:pd_orderdetno,:outboxcode,:custbarcode)");
|
|
|
dh.BatchInsert(sql.ToString(), new string[] { "pd_prodcode", "pr_brand", "barcode", "pd_pdno", "pd_id", "pib_inqty", "pib_datecode", "pib_lotno", "pd_ordercode", "pd_orderdetno", "outboxcode", "custbarcode" }, pdprodcode.ToArray(), prbrand.ToArray(), barcode.ToArray(), pdpdno.ToArray(), pdid.ToArray(), pib_inqty.ToArray(), datecode.ToArray(), lotno.ToArray(), pdordercode.ToArray(), pdorderdetno.ToArray(), piboutboxcode2.ToArray(), custbarcode.ToArray());
|
|
|
//更新流水
|
|
|
dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
|