public JsonResult Sync(string ErpVoucherNo) { //if (ErpVoucherNo.Length < 10) //{ // return Json(new { state = false, obj = "ERP单据长度不能少于10位!" }, JsonRequestBehavior.AllowGet); //} T_OutStock_Func func = new T_OutStock_Func(); if (func.GetOutStockNoIsExists(ErpVoucherNo) > 0) { return(Json(new { state = false, obj = "该ERP单号已经存在" }, JsonRequestBehavior.AllowGet)); } string ErrorMsg = ""; int WmsVoucherType = -1; string syncType = "ERP"; int syncExcelVouType = -1; DataSet excelds = null; BILWeb.SyncService.ParamaterField_Func PFunc = new BILWeb.SyncService.ParamaterField_Func(); //20:出库单据 if (PFunc.Sync(20, string.Empty, ErpVoucherNo, WmsVoucherType, ref ErrorMsg, syncType, syncExcelVouType, excelds)) { return(Json(new { state = true }, JsonRequestBehavior.AllowGet)); } else { //T_OutStock_DB db = new T_OutStock_DB(); //db.insertLog(ErrorMsg); return(Json(new { state = false, obj = ErrorMsg }, JsonRequestBehavior.AllowGet)); } }
//public JsonResult printBox(String ErpVoucherno) //{ // T_OutStockDetail_Func func = new T_OutStockDetail_Func(); // string strError = ""; // List<T_PalletDetailInfo> palletModelList = new List<T_PalletDetailInfo>(); // bool isSuccess = func.CreatePalletByTaskTrans(ErpVoucherno, currentUser, ref palletModelList, ref strError); // return Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet); //} public JsonResult CheckPrint(String ErpVoucherno) { T_OutStock_Func func = new T_OutStock_Func(); T_OutStockInfo model = new T_OutStockInfo(); string strError = ""; bool isSuccess = func.GetOutStockDetailForPrint(ErpVoucherno, ref model, ref strError); if (isSuccess) { string del = ""; var FYlist = from cust in model.lstDetail where cust.StrongHoldCode == "FY2" select cust; var HMlist = from cust in model.lstDetail where cust.StrongHoldCode == "HM1" select cust; if (FYlist.Count() == 0) { del += "F"; } if (HMlist.Count() == 0) { del += "H"; } return(Json(new { state = isSuccess, obj = strError, delobj = del }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { state = isSuccess, obj = strError }, JsonRequestBehavior.AllowGet)); } }
// GET: Review public ActionResult Review(string strCarNo) { T_OutStockInfo t_OutStockInfo = new T_OutStockInfo(); T_OutStock_Func func = new T_OutStock_Func(); string strError = ""; func.GetModelListByCar(strCarNo, ref t_OutStockInfo, ref strError); ViewData["t_OutStockInfo"] = t_OutStockInfo; ViewData["strError"] = strError; return(View()); }
public JsonResult CloseOutstock(string ID) { try { string strError = ""; T_OutStock_Func tfunc = new T_OutStock_Func(); if (tfunc.CloseOutStockVoucherNo(Convert.ToInt32(ID), currentUser, ref strError)) { return(Json(new { state = true, obj = strError }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { state = false, obj = strError }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { state = false, obj = ex.ToString() }, JsonRequestBehavior.AllowGet)); } }
public string GetT_OutStockReviewListADF(string UserJson, string ModelJson) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.GetModelListADF(UserJson, ModelJson)); }
public bool GetOutStockAndDetailsModelByNo(string erpNo, ref BILWeb.OutStockTask.T_OutStockTaskInfo head, ref List <BILWeb.OutStockTask.T_OutStockTaskDetailsInfo> lstDetail, ref string ErrMsg) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.GetOutStockAndDetailsModelByNo(erpNo, ref head, ref lstDetail, ref ErrMsg)); }
public bool UpdateT_OutStockStatus(UserInfo user, ref T_OutStockInfo t_outstock, ref string strError) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.UpadteModelByModelSql(user, t_outstock, ref strError)); }
public bool GetAllT_OutStockByHeaderID(ref List <T_OutStockInfo> modelList, int headerID, ref string strError) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.GetModelListByHeaderID(ref modelList, headerID, ref strError)); }
public bool GetT_OutStockListByPage(ref List <T_OutStockInfo> modelList, UserInfo user, T_OutStockInfo t_outstock, ref DividPage page, ref string strError) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.GetModelListByPage(ref modelList, user, t_outstock, ref page, ref strError)); }
public bool GetT_OutStockByID(ref T_OutStockInfo model, ref string strError) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.GetModelByID(ref model, ref strError)); }
public bool DeleteT_OutStockByModel(UserInfo user, T_OutStockInfo model, ref string strError) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.DeleteModelByModel(user, model, ref strError)); }
public bool SaveT_OutStock(UserInfo user, ref T_OutStockInfo t_outstock, ref string strError) { T_OutStock_Func tfunc = new T_OutStock_Func(); return(tfunc.SaveModelBySqlToDB(user, ref t_outstock, ref strError)); }
/// <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); } }