//扫描序列号和EAN public JsonResult getbarcode(T_StockInfo model) { if (currentUser == null) { return(Json(new { state = false, obj = "Cookie失效,重新登陆!" }, JsonRequestBehavior.AllowGet)); } model.ScanType = 3; List <T_StockInfo> modelList = new List <T_StockInfo>(); List <T_OutStockDetailInfo> outStockDetailList = new List <T_OutStockDetailInfo>(); string strError = ""; T_OutStockDetail_Func fun = new T_OutStockDetail_Func(); int ID = 0; bool isSuccess = fun.GetReviewStockModel(currentUser, model, ref modelList, ref outStockDetailList, ref ID, ref strError); if (isSuccess && model.Barcode.Contains("@") && outStockDetailList.Count > 0) { for (int i = 0; i < outStockDetailList.Count; i++) { if (outStockDetailList[i].ID == ID) { outStockDetailList[i].isLight = true; } else { outStockDetailList[i].isLight = false; } } return(Json(new { state = isSuccess, obj = outStockDetailList, type = "1" }, JsonRequestBehavior.AllowGet)); } if (isSuccess && !model.Barcode.Contains("@") && modelList.Count > 0) { return(Json(new { state = isSuccess, obj = modelList, type = "2" }, JsonRequestBehavior.AllowGet)); } return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet)); }
public string GetT_OutStockReviewDetailListByHeaderIDADF(string ModelDetailJson) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.GetT_OutStockReviewDetailListByHeaderIDADF(ModelDetailJson)); //return tfunc.GetModelListByHeaderIDADF(ModelDetailJson); }
private void button12_Click(object sender, EventArgs e) { UserModel user = new UserModel(); user.UserNo = "admin"; user.UserName = "******"; string strError = string.Empty; T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); T_OutStockInfo model = new T_OutStockInfo(); tfunc.CreateOutStockByEmsLabel("7f21b00f-f24f-4d95-bed4-eca1bc45d2ff", "FY2-HH2-1908260002", 1, 1.444M, user, ref model, ref strError); }
public bool GetOutStockDetailForPrint(string strErpVoucherNo, ref T_OutStockInfo model, ref string strError) { try { if (string.IsNullOrEmpty(strErpVoucherNo)) { strError = "传入的ERP单号为空!"; return(false); } T_OutStock_DB tdb = new T_OutStock_DB(); model = tdb.GetOutStockDetailForPrint(strErpVoucherNo); if (model == null) { strError = "单号不存在!" + strErpVoucherNo; return(false); } if (model.VoucherType == 24) { if (string.IsNullOrEmpty(model.ShipDFlg) || model.ShipDFlg == "N") { strError = "单据不需要打印发货清单!" + strErpVoucherNo; return(false); } } List <T_OutStockDetailInfo> modelList = new List <T_OutStockDetailInfo>(); T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); bool bSucc = tfunc.GetModelListByHeaderID(ref modelList, model.ID, ref strError); if (bSucc == false) { return(false); } if (string.IsNullOrEmpty(model.ShipPFlg) || model.ShipPFlg == "N") { modelList.ForEach(t => t.Price = 0); modelList.ForEach(t => t.Amount = 0); } model.lstDetail = modelList; return(true); } catch (Exception ex) { strError = ex.Message; return(false); } }
public JsonResult CreatePalletByEmsLabel(String ErpVoucherno, int PrintQty) { if (currentUser == null) { return(Json(new { state = false, obj = "Cookie失效,重新登陆!" }, JsonRequestBehavior.AllowGet)); } string PalletNo = ""; string strError = ""; T_OutStockDetail_Func func = new T_OutStockDetail_Func(); bool isSuccess = func.CreatePalletByEmsLabel(ErpVoucherno, PrintQty, ref PalletNo, currentUser, ref strError); if (isSuccess) { return(Json(new { state = isSuccess, obj = PalletNo }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet)); } }
public JsonResult reviewpost(String ErpVoucherno) { if (currentUser == null) { return(Json(new { state = false, obj = "Cookie失效,重新登陆!" }, JsonRequestBehavior.AllowGet)); } string strError = ""; T_OutStockDetail_Func func = new T_OutStockDetail_Func(); //获取cookie string guid = ""; HttpCookie cookie = Request.Cookies[ErpVoucherno]; if (cookie == null) { guid = Guid.NewGuid().ToString(); HttpCookie hc = new HttpCookie(ErpVoucherno); hc["guid"] = guid; Response.Cookies.Add(hc);//保存到客户端 } else { guid = cookie["guid"].ToString(); } bool isSuccess = func.PostT_OutStockReviewDetail(currentUser, ErpVoucherno.Trim(), guid, ref strError); //if (isSuccess) //{ // HttpCookie hc = new HttpCookie(ErpVoucherno); // hc.Expires = DateTime.Now.AddDays(-1); // Response.Cookies.Add(hc); // //复核完成释放地标 // T_LandMarkWithTask_DB db = new T_LandMarkWithTask_DB(); // string strErrordb = ""; // db.DelTaskwithandmark(ErpVoucherno.Trim(),ref strErrordb); // strError += strErrordb; //} return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet)); }
public string GetStockPickByErpNoGroup(string ErpVoucherNo) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.GetStockPickByErpNoGroup(ErpVoucherNo)); }
/// <summary> /// 保存复核数据 /// </summary> /// <param name="UserJson"></param> /// <param name="ModelJson"></param> /// <returns></returns> public string SaveT_OutStockReviewDetailADF(string UserJson, string ModelJson) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.SaveT_OutStockReviewDetailADF(UserJson, ModelJson)); }
/// <summary> /// 复核过账 /// </summary> /// <param name="UserJson"></param> /// <param name="ErpVoucherNo"></param> /// <returns></returns> public string PostT_OutStockReviewDetailADF(string UserJson, string ErpVoucherNo, string Guid, string Remark) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.PostT_OutStockReviewDetailADF(UserJson, ErpVoucherNo, Guid, Remark)); }
public bool SaveT_OutStockDetail(UserInfo user, ref T_OutStockDetailInfo t_outstockdetail, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.SaveModelBySqlToDB(user, ref t_outstockdetail, ref strError)); }
/// <summary> /// 复核扫描条码 /// </summary> /// <param name="BarCode"></param> /// <returns></returns> public string GetReviewStockModelADF(string ModelStockJson) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.GetReviewStockModelADF(ModelStockJson)); }
public bool DeleteT_OutStockDetailByModel(UserInfo user, T_OutStockDetailInfo model, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.DeleteModelByModelSql(user, model, ref strError)); }
public string ScanOutStockReviewByBarCodeADF(string BarCode) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.ScanOutStockReviewByBarCode(BarCode)); }
public bool GetT_OutStockDetailByID(ref T_OutStockDetailInfo model, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.GetModelByID(ref model, ref strError)); }
public JsonResult scanEAN(T_StockInfo model) { if (currentUser == null) { return(Json(new { state = false, obj = "Cookie失效,重新登陆!" }, JsonRequestBehavior.AllowGet)); } if (model.Barcode.Contains("@")) { return(Json(new { state = false, obj = "扫描物料标签不能修改数量!" }, JsonRequestBehavior.AllowGet)); } else { model.ScanType = 3; } List <T_OutStockDetailInfo> outStockDetailList = new List <T_OutStockDetailInfo>(); string strError = ""; T_OutStockDetail_Func fun = new T_OutStockDetail_Func(); //重新构造库存类 T_StockInfo modelnew = new T_StockInfo(); modelnew.ErpVoucherNo = model.ErpVoucherNo; modelnew.Barcode = model.Barcode; List <T_StockInfo> modelList = new List <T_StockInfo>(); int ID = 0; bool isSuccessF = fun.GetReviewStockModel(currentUser, model, ref modelList, ref outStockDetailList, ref ID, ref strError); if (isSuccessF && modelList != null && modelList.Count > 0) { //第二次进来带了materialnoid if (model.MaterialNoID != 0) { foreach (T_StockInfo item in modelList) { if (item.MaterialNoID == model.MaterialNoID) { modelnew = item; break; } } if (modelnew.MaterialNoID == 0) { return(Json(new { state = false, obj = "没有找到对应的条码!" }, JsonRequestBehavior.AllowGet)); } } else { modelnew = modelList[0]; } } else { return(Json(new { state = isSuccessF, obj = strError }, JsonRequestBehavior.AllowGet)); } if (model.ScanQty > modelnew.Qty) { return(Json(new { state = false, obj = "提交数量不能超过库存数量!" }, JsonRequestBehavior.AllowGet)); } modelnew.Barcode = model.Barcode; modelnew.ErpVoucherNo = model.ErpVoucherNo; modelnew.ScanQty = model.ScanQty; modelnew.ScanQty = model.ScanQty; bool isSuccess = fun.SaveT_OutStockReviewDetailENA(currentUser, modelnew, ref outStockDetailList, ref ID, ref strError); if (isSuccess) { for (int i = 0; i < outStockDetailList.Count; i++) { if (outStockDetailList[i].ID == ID) { outStockDetailList[i].isLight = true; } else { outStockDetailList[i].isLight = false; } } return(Json(new { state = isSuccess, obj = outStockDetailList }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 生成物流箱码 /// </summary> /// <param name="user"></param> /// <param name="lstErpVoucherNo"></param> /// <param name="HeadName"></param> /// <param name="strError"></param> /// <returns></returns> public bool CreatePrintBoxInfo(UserModel user, List <string> lstID, string HeadName, ref string strError) { try { List <T_BoxInfo> lstBox = new List <T_BoxInfo>();//存放需要提交的数据 List <T_BoxInfo> CreateLstBox = new List <T_BoxInfo>(); T_Box_DB _tdb = new T_Box_DB(); string strErpNote = string.Empty; string strCustomerName = string.Empty; string strErpNoteCat = string.Empty; string strErpVoucherNoCat = string.Empty; int iDelNo = 0; bool bSucc = true; List <T_OutStockInfo> outNewStockList = new List <T_OutStockInfo>(); if (lstID == null || lstID.Count == 0) { strError = "提交的生成箱子数据为空!"; return(false); } string strFilter = string.Empty;//"erpvoucherno = '" + ErpVoucherNo + "'"; T_OutStock_Func tfunc = new T_OutStock_Func(); List <T_OutStockInfo> outStockList = new List <T_OutStockInfo>(); foreach (var item in lstID) { T_OutStockInfo model = new T_OutStockInfo(); strFilter = "id = '" + item + "'"; tfunc.GetModelByFilter(ref model, strFilter, ref strError); outStockList.Add(model); } if (outStockList == null || outStockList.Count == 0) { strError = "未能获取订单数据"; return(false); } GetPinErpvoucherNo(ref outNewStockList, CreateNewOutStock(outStockList)); if (outNewStockList != null && outNewStockList.Count > 0) { foreach (var item in outNewStockList) { T_OutStockInfo model1 = new T_OutStockInfo(); strFilter = "erpvoucherno = '" + item.ErpVoucherNo + "'"; tfunc.GetModelByFilter(ref model1, strFilter, ref strError); outStockList.Add(model1); } } if (CheckVoucherTypeIsSame(outStockList, ref strError) == false) { return(false); } foreach (var item in outStockList) { if (item.Status == 1) { strError += "订单号:" + item.ErpVoucherNo + "处于新建状态,不能生成物流标签!" + "\r\n"; bSucc = false; } } if (bSucc == false) { return(false); } T_OutTaskDetails_DB tdb = new T_OutTaskDetails_DB(); List <T_OutStockTaskDetailsInfo> modelListTaskDetail = new List <T_OutStockTaskDetailsInfo>(); foreach (var item in outStockList) { if (tdb.GetOutTaskDetailByErpVoucherNo(item.ErpVoucherNo, ref modelListTaskDetail, ref strError) == false) { return(false); } if (modelListTaskDetail.Where(t => t.UnReviewQty > 0).Count() > 0) { strError = "订单:" + item.ErpVoucherNo + "没有全部复核完成,不能生成物流标签!"; bSucc = false; break; } } if (bSucc == false) { return(false); } T_Box_DB boxdb = new T_Box_DB(); foreach (var item in outStockList) { if (boxdb.GetErpVoucherNoIsPrint(item.ErpVoucherNo, ref strError) == false) { bSucc = false; break; } } if (bSucc == false) { return(false); } //其他出库单,需要判断客户是否相同 if (outStockList[0].VoucherType == 24) { if (CheckCustomerIsSame(outStockList, ref strError) == false) { return(false); } strCustomerName = outStockList[0].CustomerName; } else ///调拨出库单,验证调入仓库是否相同 { T_OutStockDetail_Func tfuncd = new T_OutStockDetail_Func(); List <T_OutStockDetailInfo> lstOutStockDetail = new List <T_OutStockDetailInfo>(); List <T_OutStockDetailInfo> lstOutStockDetailSum = new List <T_OutStockDetailInfo>(); foreach (var item in lstID) { strFilter = "headerid = '" + item + "'"; tfuncd.GetModelListByFilter(ref lstOutStockDetail, ref strError, "", strFilter, "*"); lstOutStockDetailSum.AddRange(lstOutStockDetail); } if (CheckWarehouseIsSame(lstOutStockDetailSum, ref strError) == false) { return(false); } strCustomerName = lstOutStockDetailSum[0].ToErpWarehouseName; } foreach (var item in outStockList) { CreateLstBox.AddRange(GetNeBox(_tdb.GetPrintBoxInfo(item.ErpVoucherNo), item.ErpVoucherNo, strCustomerName, item.ERPNote, HeadName)); } if (CreateLstBox == null || CreateLstBox.Count == 0) { strError = "可以生成箱子的数据为空!"; return(false); } List <T_BoxInfo> lstNewCreateBox = ModelListGroupBy(CreateLstBox); List <T_BoxInfo> lstFserialNo = new List <T_BoxInfo>(); string strFserialNoCat = string.Empty; foreach (var item in lstNewCreateBox) { lstFserialNo = _tdb.GetSerialNoByFserialNo(item.SerialNo); if (lstFserialNo != null && lstFserialNo.Count > 0) { foreach (var item1 in lstFserialNo) { strFserialNoCat += item1.SerialNo + ","; } item.SerialNo = strFserialNoCat.TrimEnd(','); } } foreach (var item in lstNewCreateBox) { iDelNo += 1; item.DelNo = iDelNo.ToString().PadLeft(4, '0'); //item.Remark = strErpNoteCat; //item.ErpVoucherNo = strErpVoucherNoCat; } //lstNewCreateBox.OrderBy(t => t.IsAmount); return(_tdb.SaveBoxByModelList(user, lstNewCreateBox.OrderBy(t => t.IsAmount).ToList(), ref strError)); } catch (Exception ex) { strError = ex.Message; return(false); } }
public bool GetT_OutStockDetailListByPage(ref List <T_OutStockDetailInfo> modelList, UserInfo user, T_OutStockDetailInfo t_outstockdetail, ref DividPage page, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.GetModelListByPage(ref modelList, user, t_outstockdetail, ref page, ref strError)); }
public bool SaveT_ChangeMaterial(UserInfo userModel, List <T_InStockDetailInfo> InStockDetailList, List <T_OutStockDetailInfo> OutStockDetailList, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.SaveT_ChangeMaterial(userModel, InStockDetailList, OutStockDetailList, ref strError)); }
public bool UpdateChangeMaterial(ref T_OutStockDetailInfo model, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.UpdateChangeMaterial(ref model, ref strError)); }
public bool GetChangeMaterialForStock(ref T_OutStockDetailInfo model, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.GetChengeMaterialForStock(ref model, ref strError)); }
public bool UpdateT_OutStockDetailStatus(UserInfo user, ref T_OutStockDetailInfo t_outstockdetail, int NewStatus, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.UpdateModelStatus(user, ref t_outstockdetail, NewStatus, ref strError)); }
public bool GetAllT_OutStockDetailByHeaderID(ref List <T_OutStockDetailInfo> modelList, int headerID, ref string strError) { T_OutStockDetail_Func tfunc = new T_OutStockDetail_Func(); return(tfunc.GetModelListByHeaderID(ref modelList, headerID, ref strError)); }