public void AsynAddCurrentErrorQueue(string _sEPC, string _sPICK_TASK, TagDetailInfo _dti, int _iFlag, List <InventoryOutLogDetailInfo> _outLogList, List <ShippingBoxDetail> _epcList, bool isrfid) { this.BringToFront(); epcList = _epcList; if (isrfid && errlist.Contains(_sEPC)) { return; } if (isrfid) { errlist.Add(_sEPC); } if (!this.isShow) { try { this.isShow = true; this.Show(); //new Thread(() => { this.ShowDialog(); }).Start(); } catch (Exception e) { LogHelper.WriteLine(e.Message + "\r\n" + e.StackTrace); } } //CurrentErrorQueue.Push(new error() { sEPC = _sEPC, sPICK_TASK = _sPICK_TASK, dti = _dti, iFlag = _iFlag, outLogList = _outLogList }); //if (!haderror) //{ // haderror = true; // timer.Start(); // showtimer.Start(); //} UpdateRecordInfo(_sEPC, _sPICK_TASK, _dti, _iFlag, _outLogList); }
string getBarAdd(string bar, out string pin, out string se, out string gui) { pin = ""; se = ""; gui = ""; TagDetailInfo ti = tagDetailList.FirstOrDefault(i => i.BARCD == bar); if (ti != null) { pin = ti.ZSATNR; se = ti.ZCOLSN; gui = ti.ZSIZTX; return(ti.BARCD_ADD); } HLATagInfo t = hlaTagList.FirstOrDefault(i => i.BARCD == bar); if (t != null) { MaterialInfo mi = materialList.FirstOrDefault(i => i.MATNR == t.MATNR); if (mi != null) { pin = mi.ZSATNR; se = mi.ZCOLSN; gui = mi.ZSIZTX; } return(t.BARCD_ADD); } return(""); }
void reader_TagsReportedEvent(string tagStr) { if (string.IsNullOrEmpty(tagStr)) { return; } if (!epcList.Contains(tagStr)) { mDtStart = DateTime.Now; epcList.Add(tagStr); TagDetailInfo tag = GetTagDetailInfoByEpc(tagStr); if (tag != null) //合法EPC { tagDetailList.Add(tag); if (!tag.IsAddEpc) //主条码 { mainEpcNumber++; } else { addEpcNumber++; } } else { //累加非法EPC数量 errorEpcNumber++; } UpdateView(); } }
public override bool checkTagOK(TagDetailInfo tg, out string msg) { msg = ""; if (tg == null) { msg = "商品未注册"; return(false); } if (tg.IsAddEpc) { //不处理辅条码 return(true); } if (!mBoxDetailInfo.mDetail.Exists(i => i.MATNR == tg.MATNR)) { msg = "不在本单"; return(false); } if (tagDetailList.Count(i => !i.IsAddEpc && i.MATNR == tg.MATNR) >= mBoxDetailInfo.mDetail.First(i => i.MATNR == tg.MATNR).QTY) { msg = "数量大于复核数量-" + tg.MATNR; return(false); } return(true); }
public override bool checkTagOK(TagDetailInfo tg, out string msg) { msg = ""; if (tg == null) { msg = "商品未注册"; return(false); } List <CChaYi> chayi = piPei3(getBoxNo()); foreach (var v in chayi) { if (tg.IsAddEpc && tg.BARCD == v.bar && v.barAddChaYiQty == 0) { msg = string.Format("辐条码{0}已达到复核数量", tg.BARCD_ADD); return(false); } if (!tg.IsAddEpc && tg.BARCD == v.bar && v.barChaYiQty == 0) { msg = string.Format("主条码{0}已达到复核数量", tg.BARCD); return(false); } } return(true); }
public void addgrid(CDianShangBox box) { try { List <string> mats = box.tags.Select(i => i.MATNR).Distinct().ToList(); Invoke(new Action(() => { foreach (var item in mats) { int c = box.tags.Count(i => i.MATNR == item && !i.IsAddEpc); CDianShangQty qty = new CDianShangQty(); if (box.qty.Exists(i => i.mat == item)) { qty = box.qty.FirstOrDefault(i => i.mat == item); } TagDetailInfo ti = box.tags.First(i => i.MATNR == item && !i.IsAddEpc); grid.Rows.Insert(0, box.hu, ti.ZSATNR, ti.ZCOLSN, ti.ZSIZTX, c, qty.hasQty, qty.allQty, box.inventoryMsg + " " + "SAP:" + box.sapMsg); if (box.inventoryRe == "E" || box.sapRe == FAILURE) { grid.Rows[0].DefaultCellStyle.BackColor = Color.OrangeRed; } } })); } catch (Exception) { } }
public virtual void Reader_OnTagReportedPMBar(string bar) { TagDetailInfo tag = GetTagDetailInfoByBar(bar); string errorMsg = ""; if (!checkTagOK(tag, out errorMsg)) { showErrorInfo(bar, tag, errorMsg); return; } if (tag != null) //合法EPC { mTagDetailList.Add(tag); if (!tag.IsAddEpc) //主条码 { mMainEpcNumber++; } else { mAddEpcNumber++; } } else { mErrorEpcNumber++; } UpdateView(); }
public List <CTagDetail> getTags() { List <CTagDetail> re = new List <CTagDetail>(); try { List <string> barList = tagDetailList.Select(i => i.BARCD).Distinct().ToList(); foreach (var v in barList) { TagDetailInfo ti = tagDetailList.FirstOrDefault(i => i.BARCD == v); CTagDetail t = new CTagDetail(); t.bar = ti.BARCD; t.zsatnr = ti.ZSATNR; t.zcolsn = ti.ZCOLSN; t.zsiztx = ti.ZSIZTX; t.charg = ti.CHARG; t.quan = tagDetailList.Count(i => i.BARCD == v && !i.IsAddEpc); re.Add(t); } } catch (Exception) { } return(re); }
public override CheckResult CheckData() { CheckResult result = base.CheckData(); bool pinseCheckBool = false; bool allCheckBool = false; Invoke(new Action(() => { pinseCheckBool = pinseCheck.Checked; allCheckBool = allCheck.Checked; })); if (allCheckBool) { if (tagDetailList != null && tagDetailList.Count > 0) { TagDetailInfo t = tagDetailList[0]; foreach (var v in tagDetailList) { if (v.ZSATNR == t.ZSATNR && v.ZCOLSN == t.ZCOLSN && v.ZSIZTX == t.ZSIZTX) { } else { result.UpdateMessage(@"品色规不唯一"); result.InventoryResult = false; break; } } } } if (pinseCheckBool) { if (tagDetailList != null && tagDetailList.Count > 0) { TagDetailInfo t = tagDetailList[0]; foreach (var v in tagDetailList) { if (v.ZSATNR == t.ZSATNR && v.ZCOLSN == t.ZCOLSN) { } else { result.UpdateMessage(@"品色不唯一"); result.InventoryResult = false; break; } } } } if (result.InventoryResult) { result.UpdateMessage(Consts.Default.RIGHT); } return(result); }
public List <CTagSum> getTagSum() { List <CTagSum> re = new List <CTagSum>(); try { List <string> matList = tagDetailList.Select(i => i.MATNR).Distinct().ToList(); foreach (var v in matList) { TagDetailInfo ti = tagDetailList.FirstOrDefault(i => i.MATNR == v); CTagSum t = new CTagSum(); t.mat = v; t.bar = ti.BARCD; t.barAdd = ti.BARCD_ADD; t.zsatnr = ti.ZSATNR; t.zcolsn = ti.ZCOLSN; t.zsiztx = ti.ZSIZTX; t.qty = tagDetailList.Count(i => i.MATNR == v && !i.IsAddEpc); t.qty_add = tagDetailList.Count(i => i.MATNR == v && i.IsAddEpc); re.Add(t); } } catch (Exception) { } return(re); }
public virtual void reportBar(string bar) { TagDetailInfo tag = GetTagDetailInfoByBar(bar); string errorMsg = ""; if (!checkTagOK(tag, out errorMsg)) { showErrorInfo(bar, tag, errorMsg); return; } if (tag != null) //合法EPC { tagDetailList.Add(tag); if (!tag.IsAddEpc) //主条码 { mainEpcNumber++; } else { addEpcNumber++; } } else { errorEpcNumber++; } if (tag != null && !tag.IsAddEpc) { UpdateView(); } }
private void TagHandler(string epc) { if (tabControl.SelectedTab.Name == "page1") { this.lblCount.Text = epcList.Count.ToString(); TagDetailInfo tdi = getTagDetailInfoByEpc(epc); AddGridRow(tdi, epc); } else { //page2 if (grid2.Rows.Count > 0) { foreach (DataGridViewRow row in grid2.Rows) { if (row.Cells["EPC"].Value.ToString() == epc) { grid2.Rows.Remove(row); grid2.Rows.Insert(0, row); row.Selected = true; row.Selected = false; row.Cells["IsChecked"].Value = "是"; row.DefaultCellStyle.BackColor = Color.OrangeRed; break; } } } } }
public void showErrorInfo(string epc, TagDetailInfo tag, string errormsg) { Invoke(new Action(() => { if (mErrorForm != null) { mErrorForm.showErrorInfo(epc, tag, errormsg); } })); }
/// <summary> /// 获取吊牌详细信息 /// </summary> /// <param name="epc"></param> /// <returns></returns> private TagDetailInfo getTagDetailInfoByEpc(string epc) { if (string.IsNullOrEmpty(epc) || epc.Length < 20) { return(null); } string rfidEpc = epc.Substring(0, 14) + "000000"; string rfidAddEpc = rfidEpc.Substring(0, 14); HLATagInfo tag = null; if (tagList.ContainsKey(rfidEpc)) { tag = tagList[rfidEpc]; } if (tag == null && tagList.ContainsKey(rfidAddEpc)) { tag = tagList[rfidAddEpc]; } if (tag == null) { return(null); } else { MaterialInfo mater = materialList.ContainsKey(tag.MATNR) ? materialList[tag.MATNR] : null; if (mater == null) { return(null); } else { TagDetailInfo item = new TagDetailInfo(); item.RFID_EPC = tag.RFID_EPC; item.RFID_ADD_EPC = tag.RFID_ADD_EPC; item.CHARG = tag.CHARG; item.MATNR = tag.MATNR; item.BARCD = tag.BARCD; item.ZSATNR = mater.ZSATNR; item.ZCOLSN = mater.ZCOLSN; item.ZSIZTX = mater.ZSIZTX; item.PXQTY = mater.PXQTY; item.EPC = epc; //判断是否为辅条码epc if (rfidEpc == item.RFID_EPC) { item.IsAddEpc = false; } else { item.IsAddEpc = true; } return(item); } } }
void check(string epc) { try { TagDetailInfo tag = GetTagDetailInfoByEpc(epc); string curTab = tabControl.SelectedTab.Name.Trim(); if (curTab == "checkEpc") { Invoke(new Action(() => { if (tag == null) { grid.Rows.Insert(0, "", "", "", "", epc, "EPC未注册"); grid.Rows[0].DefaultCellStyle.BackColor = Color.OrangeRed; } else { grid.Rows.Insert(0, "", tag.ZSATNR, tag.ZCOLSN, tag.ZSIZTX, epc, ""); } lblCount.Text = epcList.Count.ToString(); })); } if (curTab == "deStoreCheck") { Invoke(new Action(() => { CDeliverStoreQuery re = SAPDataService.getDeliverStore(epc); metroGrid1.Rows.Add(re.store, re.mtr, re.bar, re.shipDate, re.hu, re.msg); })); } if (curTab == "storeReturnCheck") { Invoke(new Action(() => { if (tag != null) { CStoreQuery sq = SAPDataService.getStoreFromSAP(tag.EPC); metroGrid2.Rows.Insert(0, grid.Rows.Count, tag.EPC, tag.ZSATNR, tag.ZCOLSN, tag.ZSIZTX, tag.PUT_STRA, sq.barcd, sq.storeid, sq.hu, sq.pxqty_fh, sq.flag, sq.equip_hla, sq.loucheng, sq.date, sq.time); } else { metroGrid2.Rows.Insert(0, grid.Rows.Count, "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册"); grid.Rows[0].DefaultCellStyle.BackColor = Color.OrangeRed; } })); } } catch (Exception ex) { Log4netHelper.LogError(ex); } }
/// <summary> /// 获取吊牌详细信息 /// </summary> /// <param name="epc"></param> /// <returns></returns> public static TagDetailInfo GetTagDetailInfoByEpc(string epc) { if (string.IsNullOrEmpty(epc) || epc.Length < 20) { return(null); } List <HLATagInfo> tagList = Cache.Instance[CacheKey.TAG] as List <HLATagInfo>; List <MaterialInfo> materialList = Cache.Instance[CacheKey.MATERIAL] as List <MaterialInfo>; string rfidEpc = epc.Substring(0, 14) + "000000"; string rfidAddEpc = rfidEpc.Substring(0, 14); HLATagInfo tag = tagList != null?tagList.FirstOrDefault(i => i.RFID_EPC == rfidEpc || i.RFID_ADD_EPC == rfidAddEpc) : null; if (tag == null) { return(null); } else { MaterialInfo mater = materialList != null?materialList.FirstOrDefault(i => i.MATNR == tag.MATNR) : null; if (mater == null) { return(null); } else { TagDetailInfo item = new TagDetailInfo(); item.EPC = epc; item.RFID_EPC = tag.RFID_EPC; item.RFID_ADD_EPC = tag.RFID_ADD_EPC; item.CHARG = tag.CHARG; item.MATNR = tag.MATNR; item.BARCD = tag.BARCD; item.ZSATNR = mater.ZSATNR; item.ZCOLSN = mater.ZCOLSN; item.ZSIZTX = mater.ZSIZTX; item.PXQTY = mater.PXQTY; //判断是否为辅条码epc if (rfidEpc == item.RFID_EPC) { item.IsAddEpc = false; } else { item.IsAddEpc = true; } return(item); } } }
private bool IsOnePinSe() { if (epcList.Count != tagDetailList.Count) { return(false); } TagDetailInfo tag = tagDetailList.First(); if (tagDetailList.Exists(i => i.ZSATNR != tag.ZSATNR || i.ZCOLSN != tag.ZCOLSN)) { return(false); } return(true); }
public void showErrorInfo(List <TagDetailInfo> tags, string errormsg) { try { if (string.IsNullOrEmpty(errormsg)) { return; } if (!Visible) { Show(); TopMost = true; } if (tags == null) { grid.Rows.Insert(0, "", "", "", "", "", errormsg); return; } if (tags.Count > 0) { List <string> matrList = tags.Select(i => i.MATNR).Distinct().ToList(); foreach (string mtr in matrList) { TagDetailInfo tg = tags.First(j => j.MATNR == mtr); grid.Rows.Insert(0 , tg != null ? tg.ZSATNR : "" , tg != null ? tg.ZCOLSN : "" , tg != null ? tg.ZSIZTX : "" , tags.Count(i => i.MATNR == mtr && !i.IsAddEpc) , tags.Count(i => i.MATNR == mtr && i.IsAddEpc) , errormsg); } } else { grid.Rows.Insert(0, "", "", "", "", "", errormsg); } AudioHelper.Play(".\\Res\\warningwav.wav"); } catch (Exception ex) { LogHelper.WriteLine(ex.ToString()); } }
public void showErrorInfo(List <TagDetailInfo> tags, string errormsg) { try { if (string.IsNullOrEmpty(errormsg)) { return; } if (!Visible) { Show(); TopMost = true; } if (tags == null) { dataGridView1_showGrid.Rows.Insert(0, "", "", "", "", errormsg); return; } if (tags.Count > 0) { List <string> matrList = tags.Select(i => i.MATNR).Distinct().ToList(); foreach (string mtr in matrList) { TagDetailInfo tg = tags.First(j => j.MATNR == mtr); dataGridView1_showGrid.Rows.Insert(0 , tg != null ? tg.ZSATNR : "" , tg != null ? tg.ZCOLSN : "" , tg != null ? tg.ZSIZTX : "" , tags.Count(i => i.MATNR == mtr && !i.IsAddEpc) , errormsg); } } else { dataGridView1_showGrid.Rows.Insert(0, "", "", "", "", errormsg); } CommonService.playSound(2); } catch (Exception ex) { Log4netHelper.LogError(ex); } }
string getBarAdd(string bar) { TagDetailInfo ti = tagDetailList.FirstOrDefault(i => i.BARCD == bar); if (ti != null) { return(ti.BARCD_ADD); } HLATagInfo t = hlaTagList.FirstOrDefault(i => i.BARCD == bar); if (t != null) { return(t.BARCD_ADD); } return(""); }
public virtual void reportEpc(string epc) { if (!isInventory || string.IsNullOrEmpty(epc) || ignore(epc)) { return; } if (!epcList.Contains(epc)) { lastReadTime = DateTime.Now; TagDetailInfo tag = GetTagDetailInfoByEpc(epc); string errorMsg = ""; if (!checkTagOK(tag, out errorMsg)) { showErrorInfo(epc, tag, errorMsg); return; } if (tag != null) //合法EPC { tagDetailList.Add(tag); if (!tag.IsAddEpc) //主条码 { mainEpcNumber++; } else { addEpcNumber++; } } else { errorEpcNumber++; } epcList.Add(epc); if (tag != null && !tag.IsAddEpc) { UpdateView(); } } }
CPrintErrorData getPrintErrorData() { CPrintErrorData re = new CPrintErrorData(); try { re.hu = mCurBoxNo; Dictionary <string, int> tar = new Dictionary <string, int>(); foreach (var v in tagDetailList) { if (!v.IsAddEpc) { if (tar.ContainsKey(v.MATNR)) { tar[v.MATNR] += 1; } else { tar.Add(v.MATNR, 1); } } } foreach (var v in tar) { CPSGNum psg = new CPSGNum(); TagDetailInfo ti = tagDetailList.FirstOrDefault(i => i.MATNR == v.Key); psg.p = ti != null ? ti.ZSATNR : ""; psg.s = ti != null ? ti.ZCOLSN : ""; psg.g = ti != null ? ti.ZSIZTX : ""; psg.num = v.Value.ToString(); re.psg.Add(psg); } } catch (Exception e) { Log4netHelper.LogError(e); } return(re); }
public virtual void Reader_OnTagReportedPM(string epc) { if (!mIsInventory || string.IsNullOrEmpty(epc) || ignore(epc)) { return; } if (!mEpcList.Contains(epc)) { mLastReadTime = DateTime.Now; TagDetailInfo tag = GetTagDetailInfoByEpc(epc); string errorMsg = ""; if (!checkTagOK(tag, out errorMsg)) { showErrorInfo(tag.EPC, tag, errorMsg); return; } if (tag != null) //合法EPC { mTagDetailList.Add(tag); if (!tag.IsAddEpc) //主条码 { mMainEpcNumber++; } else { mAddEpcNumber++; } } else { //累加非法EPC数量 mErrorEpcNumber++; } mEpcList.Add(epc); UpdateView(); } }
private void ShowGetMessage(string sPICK_TASK, TagDetailInfo dti, int iFlag, List <InventoryOutLogDetailInfo> outLogList, string sMessage, DataRow row, string sMATNR) { if (this.InvokeRequired) { ShowMessages show = new ShowMessages(ShowGetMessage); this.BeginInvoke(show, sPICK_TASK, dti, iFlag, outLogList, sMessage, row, sMATNR); } else { grid.Rows.Add(sMATNR, sPICK_TASK, row[1].ToString(), row[3].ToString(), row[2].ToString(), iFlag == 0 ? 0 : outLogList.FindAll(i => i.PICK_TASK == sPICK_TASK && i.PRODUCTNO == sMATNR).Sum(i => i.QTY), dti.IsAddEpc ? 0 : (1 + epcList.FindAll(i => i.IsADD == 0 && i.ZSATNR == row[1].ToString() && i.ZCOLSN == row[3].ToString() && i.ZSIZTX == row[2].ToString()).Count), (dti.IsAddEpc ? "0" : "1" + (iFlag == 0 ? sMessage : "")), iFlag == 0 ? 0 : outLogList.FindAll(i => i.PICK_TASK == sPICK_TASK && i.PRODUCTNO == sMATNR).Sum(i => i.QTY_ADD), !dti.IsAddEpc ? 0 : (1 + epcList.FindAll(i => i.IsADD == 1 && i.ZSATNR == row[1].ToString() && i.ZCOLSN == row[3].ToString() && i.ZSIZTX == row[2].ToString()).Count), (!dti.IsAddEpc ? "0" : "1" + (iFlag == 0 ? sMessage : ""))); } }
void getTagDetail() { try { foreach (string epc in epcList) { bool isAdd2 = false; TagDetailInfo tag = GetTagDetailInfoByEpc(epc, ref isAdd2); if (isAdd2) { tagAdd2DetailList.Add(tag); continue; } if (tag != null) //合法EPC { tagDetailList.Add(tag); if (!tag.IsAddEpc) //主条码 { mainEpcNumber++; } else { addEpcNumber++; } } else { //累加非法EPC数量 errorEpcNumber++; } } UpdateView(); } catch (Exception) { } }
public void showErrorInfo(string epc, TagDetailInfo tag, string errormsg) { try { if (string.IsNullOrEmpty(errormsg)) { return; } if (!Visible) { Show(); TopMost = true; } if (mTags.ContainsKey(epc)) { return; } mTags.Add(epc, tag); if (tag == null) { dataGridView1_showGrid.Rows.Insert(0, "", "", "", "", errormsg); } else { dataGridView1_showGrid.Rows.Insert(0, tag.ZSATNR, tag.ZCOLSN, tag.ZSIZTX, 1, errormsg); } CommonService.playSound(2); } catch (Exception ex) { Log4netHelper.LogError(ex); } }
public void showErrorInfo(string epc, TagDetailInfo tag, string errormsg) { try { if (string.IsNullOrEmpty(errormsg)) { return; } if (!Visible) { Show(); TopMost = true; } if (mTags.ContainsKey(epc)) { return; } mTags.Add(epc, tag); if (tag == null) { grid.Rows.Insert(0, "", "", "", "", "", errormsg); } else { grid.Rows.Insert(0, tag.ZSATNR, tag.ZCOLSN, tag.ZSIZTX, tag.IsAddEpc ? 0 : 1, tag.IsAddEpc ? 1 : 0, errormsg); } AudioHelper.Play(".\\Res\\warningwav.wav"); } catch (Exception ex) { LogHelper.WriteLine(ex.ToString()); } }
public void addgrid(CJJBox box) { try { List <string> mats = box.tags.Select(i => i.MATNR).Distinct().ToList(); Invoke(new Action(() => { foreach (var item in mats) { int c = box.tags.Count(i => i.MATNR == item && !i.IsAddEpc); TagDetailInfo ti = box.tags.First(i => i.MATNR == item && !i.IsAddEpc); grid.Rows.Insert(0, box.hu, ti.ZSATNR, ti.ZCOLSN, ti.ZSIZTX, c, box.inventoryMsg + " " + "SAP:" + box.sapMsg); if (box.inventoryRe == "E" || box.sapRe == "E") { grid.Rows[0].DefaultCellStyle.BackColor = Color.OrangeRed; } } })); } catch (Exception) { } }
void queryStore(string epc) { try { if (tabControl.SelectedTab?.Text == "门店退货查询") { TagDetailInfo tag = getTagDetailInfoByEpc(epc); if (tag != null) { CStoreQuery sq = SAPDataService.getStoreFromSAP(tag.EPC); metroGrid2.Rows.Insert(0, grid.Rows.Count, tag.EPC, tag.ZSATNR, tag.ZCOLSN, tag.ZSIZTX, tag.PUT_STRA, sq.barcd, sq.storeid, sq.hu, sq.pxqty_fh, sq.flag, sq.equip_hla, sq.loucheng, sq.date, sq.time); } else { metroGrid2.Rows.Insert(0, grid.Rows.Count, "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册", "EPC未注册"); } } } catch (Exception ex) { Log4netHelper.LogError(ex); } }
public void Reader_OnTagReported(string epc) { if (!mIsInventory) { return; } if (string.IsNullOrEmpty(epc) || ignore(epc)) { return; } if (!mEpcList.Contains(epc)) { mLastReadTime = DateTime.Now; mEpcList.Add(epc); TagDetailInfo tag = GetTagDetailInfoByEpc(epc); if (tag != null) //合法EPC { mTagDetailList.Add(tag); if (!tag.IsAddEpc) //主条码 { mMainEpcNumber++; } else { mAddEpcNumber++; } } else { //累加非法EPC数量 mErrorEpcNumber++; } UpdateView(); } }