/// <summary> /// 跳过指令 /// </summary> /// <returns></returns> public ActionResult PickSkip(PickViewModel model) { GetLoginInfo(); if (Login_Info == null) { return(Content("<script>location.href='/Home'</script>")); } service = new PickGoodsBase(Login_Info.User_ID, Login_Info.User_Name, Login_Info.Token); try { service.SetParameter("ToTrayNO", model.ToTrayNO); service.SetParameter("ToDoNO", model.ToDoNO); service.SetParameter("PaperNO", model.PaperNO); //service.SetParameter("FromLocationNO", model.FromLocationNO); //service.SetParameter("CheckLocationNO", model.CheckLocationNO); service.SetParameter("Barcode", model.Barcode); //service.SetParameter("PickBarcode", model.PickBarcode); service.SetParameter("DealQty", model.DealQty); service.ExecuteBusinessCheck("RF_PickSkip", "*"); service.ExecuteBusinessProcess("RF_PickSkip"); return(Content("")); } catch (Exception ex) { Loger.Error(ex); return(Content(ex.Message)); } }
/// <summary> /// 验证拣货位 /// </summary> /// <returns></returns> public ActionResult ValidateCheckLocationNO(PickViewModel model) { GetLoginInfo(); if (Login_Info == null) { return(Content("<script>location.href='/Home'</script>")); } service = new PickGoodsBase(Login_Info.User_ID, Login_Info.User_Name, Login_Info.Token); try { service.SetParameter("ToTrayNO", model.ToTrayNO); service.SetParameter("ToDoNO", model.ToDoNO); service.SetParameter("PaperNO", model.PaperNO); service.SetParameter("FromLocationNO", model.FromLocationNO); service.SetParameter("CheckLocationNO", model.CheckLocationNO); service.SetParameter("AssignTypeID", model.AssignTypeID); service.SetParameter("LocationTypeID", model.LocationTypeID); service.SetParameter("BoxPickValidateBarcode", model.BoxPickValidateBarcode); //service.ValidateCheckLocationNO(); service.ExecuteBusinessCheck("RF_PickGoods", "CheckLocationNO"); return(Content("")); } catch (Exception ex) { Loger.Error(ex); return(Content(ex.Message)); } }
/// <summary> /// 实拣数量检查 /// </summary> /// <returns></returns> public ActionResult ValidateDealQty(PickViewModel model) { GetLoginInfo(); if (Login_Info == null) { return(Content("<script>location.href='/Home'</script>")); } service = new PickGoodsBase(Login_Info.User_ID, Login_Info.User_Name, Login_Info.Token); try { //AssignTypeID=2.托拣;3.箱拣;4.零拣 service.SetParameter("ToTrayNO", model.ToTrayNO); service.SetParameter("ToDoNO", model.ToDoNO); service.SetParameter("PaperNO", model.PaperNO); service.SetParameter("FromLocationNO", model.FromLocationNO); service.SetParameter("CheckLocationNO", model.CheckLocationNO); service.SetParameter("Barcode", model.Barcode); service.SetParameter("PickBarcode", model.PickBarcode); service.SetParameter("LocationTypeID", model.LocationTypeID); service.SetParameter("AssignTypeID", model.AssignTypeID); service.SetParameter("BoxPickValidateBarcode", model.BoxPickValidateBarcode); service.SetParameter("DealQty", model.DealQty); //if (model.AssignTypeID == "3") //{ // service.SetParameter("DealQty", int.Parse(model.DealQty) * model.CaseUnits); //} //else //{ // if (model.AssignTypeID == "2") // { // service.SetParameter("DealQty", model.MinSrcQty); // } // else // { // service.SetParameter("DealQty", model.DealQty); // } //} //service.SetParameter("AssignTypeID", model.AssignTypeID); //service.ValidateDealQty(); service.ExecuteBusinessCheck("RF_PickGoods", "DealQty"); return(Content("")); } catch (Exception ex) { Loger.Error(ex); return(Content(ex.Message)); } }
/// <summary> /// 提交出库箱 /// </summary> /// <returns></returns> public ActionResult SubmitTrayNO(PickViewModel model) { GetLoginInfo(); if (Login_Info == null) { return(Content("<script>location.href='/Home'</script>")); } service = new PickGoodsBase(Login_Info.User_ID, Login_Info.User_Name, Login_Info.Token); try { service.SetParameter("ToTrayNO", model.ToTrayNO); service.ExecuteBusinessCheck("RF_PickCheck", "*"); service.ExecuteBusinessProcess("RF_PickCheck"); return(Content("")); } catch (Exception ex) { Loger.Error(ex); return(Content(ex.Message)); } }
/// <summary> /// 提交执行拣货过程 /// </summary> /// <returns></returns> public ActionResult PickGoods(PickViewModel model) { string ParamValue; GetLoginInfo(); if (Login_Info == null) { return(Content("<script>location.href='/Home'</script>")); } service = new PickGoodsBase(Login_Info.User_ID, Login_Info.User_Name, Login_Info.Token); try { service.SetParameter("ToTrayNO", model.ToTrayNO); service.SetParameter("ToDoNO", model.ToDoNO); service.SetParameter("PaperNO", model.PaperNO); service.SetParameter("FromLocationNO", model.FromLocationNO); service.SetParameter("CheckLocationNO", model.CheckLocationNO); service.SetParameter("Stroe", model.Barcode); service.SetParameter("Barcode", model.Barcode); service.SetParameter("PickBarcode", model.PickBarcode); service.SetParameter("DealQty", model.DealQty); service.SetParameter("LocationTypeID", model.LocationTypeID); service.SetParameter("AssignTypeID", model.AssignTypeID); service.SetParameter("FromTrayNO", model.FromTrayNO); service.SetParameter("CheckFromTrayNO", model.CheckFromTrayNO); service.SetParameter("BoxPickValidateBarcode", model.BoxPickValidateBarcode); service.SetParameter("PickTypeID", model.PickTypeID); //service.ExecuteBusinessProcess("RF_PickGoods"); ParamValue = service.PickGoods(); return(Content(ParamValue)); } catch (Exception ex) { Loger.Error(ex); return(Content(ex.Message)); } }
private DraftViewModel GetDraftViewModel(int draftId) { var draftLogic = GetDraftLogic.FromDraftId(draftId); var systemLogic = new SystemLogic(); if (!draftLogic.IsDraftAvailable(draftId)) { return(null); } var draft = systemLogic.GetDraftById(draftId); using (var sl = new SystemLogic()) { var picks = systemLogic.GetPickList(draftId); var dvm = new DraftViewModel { Id = draftId, MaximumNumberOfPicks = draft.MaximumPicksPerMember, Name = draft.Name, Owner = sl.GetMember(draft.Owner.Id).FullName, CreationDate = draft.CreatedDate, CurrentPickPosition = draftLogic.CurrentPickPosition(draftId), CurrentNumberOfPicks = picks.Count }; var members = systemLogic.GetDraftMembers(draftId); foreach (var draftMemberPositions in members) { var member = sl.GetMember(draftMemberPositions.Member.Id); var draftMemberVm = new DraftMemberVm { DisplayName = member.FullName, Id = member.Id, }; dvm.Members.Add(draftMemberVm); } var pickCount = picks.Count; var startIndex = pickCount - draft.DraftSize; if (startIndex < 0) { startIndex = 0; } for (int i = startIndex; i < pickCount; i++) { var pick = picks[i]; var member = sl.GetMember(pick.Member.Id); var card = sl.GetCard(pick.Card.Id); var pvm = new PickViewModel { CardId = pick.Card.Id, MemberId = pick.Member.Id, PickTime = PickTime.History, CardName = card.Name, MemberName = member.FullName }; dvm.Picks.Add(pvm); } var currentPick = new PickViewModel() { MemberId = draft.CurrentTurn.Id, MemberName = sl.GetMember(draft.CurrentTurn.Id).FullName, PickTime = PickTime.Current, }; dvm.Picks.Add(currentPick); for (int i = 0; i < draft.DraftSize; i++) { var nextDraftPosition = draftLogic.GetNextPickPosition(pickCount + 1 + i, draft.DraftSize); var nextMember = dvm.Members[nextDraftPosition - 1]; var nextPick = new PickViewModel { MemberName = nextMember.DisplayName, MemberId = nextMember.Id, PickTime = PickTime.Future }; dvm.Picks.Add(nextPick); } var authMember = GetAuthorizedMember(); if (authMember != null) { foreach (FuturePick fp in sl.GetMyFuturePicks(draftId, authMember.Id)) { Card card = sl.GetCard(fp.Card.Id); dvm.FuturePicks.Add(card.Name); } } return(dvm); } }