public ActionResult WarhouseMachiningAddSave(string IDS, string CustomerName, int Flag, string SKU, string GoodsName, string ShowSubmit, long CustomerID = 0, float Qty = 0, long ID = 0) { //Flag 1新增 2查看 3编辑 IndexViewModel vm = new IndexViewModel(); GetMachiningByConditionRequest requests = new GetMachiningByConditionRequest(); vm.searchCondition = new MachiningSearchCondition(); vm.searchCondition.ExpectDate = DateTime.Now; vm.searchCondition.CustomerID = CustomerID; requests.SearchCondition = vm.searchCondition; vm.ViewType = Flag; ViewBag.Qty = Qty; ViewBag.IDS = IDS; ViewBag.CustomerID = CustomerID; ViewBag.CustomerName = CustomerName; ViewBag.SKU = SKU; ViewBag.GoodsName = GoodsName; vm.ShowSubmit = ShowSubmit; var UnitAndSpecificationsList = ApplicationConfigHelper.GetWMS_UnitAndSpecifications_Config(base.UserInfo.ProjectID, CustomerID, 14); var UnitAndSpecificationsLists = UnitAndSpecificationsList.Select(t => new { Code = t.Unit, Name = t.Specifications }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Name }); var SpecificationsList = UnitAndSpecificationsLists.Where(m => m.Value == "桶").Select(t => new { Code = t.Text, Name = t.Text }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Code }); var WashSpecificationsList = UnitAndSpecificationsLists.Where(m => m.Value == "冲洗桶").Select(t => new { Code = t.Text, Name = t.Text }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Code }); var MoreThanSpecificationsList = UnitAndSpecificationsLists.Where(m => m.Value == "余料桶").Select(t => new { Code = t.Text, Name = t.Text }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Code }); ViewBag.SpecificationsList = SpecificationsList; ViewBag.WashSpecificationsList = WashSpecificationsList; ViewBag.MoreThanSpecificationsList = MoreThanSpecificationsList; if (Flag == 1) { vm.searchCondition = new MachiningSearchCondition(); vm.searchCondition.ExpectDate = DateTime.Now; } if (Flag == 2 || Flag == 3) { var getMachiningByConditionResponse = new MachiningManagementService().GetMachiningByID(ID); if (getMachiningByConditionResponse.IsSuccess) { vm.MachiningCollection = getMachiningByConditionResponse.Result.MachiningCollection; } } var getMachiningByConditionResponse2 = new MachiningManagementService().GetLittleInventoryBySearchCondition(requests); if (getMachiningByConditionResponse2.IsSuccess) { vm.InventoryCollection = getMachiningByConditionResponse2.Result.InventoryCollection; } return(View(vm)); }
public ActionResult BucketMachiningIndex(int?PageIndex, long?customerID, bool?ShowSubmit) { var CustomerListAll = ApplicationConfigHelper.GetProjectUserCustomers(base.UserInfo.ProjectID, base.UserInfo.ID).Where(t => t.StoreType == 2 || t.StoreType == 3); var CustomerListID = CustomerListAll.Select(t => t.CustomerID); var CustomerList = CustomerListAll.Select(c => new SelectListItem() { Value = c.CustomerID.ToString(), Text = c.CustomerName }); ViewBag.CustomerList = CustomerList; ViewBag.ShowSubmit = ShowSubmit; IndexViewModel vm = new IndexViewModel(); vm.searchCondition = new MachiningSearchCondition(); vm.searchCondition.MachiningType = "槽车加工单"; GetMachiningByConditionRequest getMachiningByConditionRequest = new GetMachiningByConditionRequest(); getMachiningByConditionRequest.SearchCondition = vm.searchCondition; getMachiningByConditionRequest.PageSize = UtilConstants.PAGESIZE; getMachiningByConditionRequest.PageIndex = PageIndex ?? 0; var getMachiningByConditionResponse = new MachiningManagementService().GetMachiningByCondition(getMachiningByConditionRequest); if (getMachiningByConditionResponse.IsSuccess) { vm.MachiningCollection = getMachiningByConditionResponse.Result.MachiningCollection; vm.PageIndex = getMachiningByConditionResponse.Result.PageIndex; vm.PageCount = getMachiningByConditionResponse.Result.PageCount; } return(View(vm)); }
public ActionResult WarhouseMachiningAddView(IndexViewModel vm, int?PageIndex, string Action) { var CustomerListAll = ApplicationConfigHelper.GetProjectUserCustomers(base.UserInfo.ProjectID, base.UserInfo.ID).Where(t => t.StoreType == 2 || t.StoreType == 3); var CustomerListID = CustomerListAll.Select(t => t.CustomerID); var CustomerList = CustomerListAll.Select(c => new SelectListItem() { Value = c.CustomerID.ToString(), Text = c.CustomerName }); ViewBag.CustomerList = CustomerList; GetMachiningByConditionRequest requests = new GetMachiningByConditionRequest(); requests.SearchCondition = vm.searchCondition; requests.PageSize = UtilConstants.PAGESIZE; requests.PageIndex = PageIndex ?? 0; var getMachiningByConditionResponse = new MachiningManagementService().GetInventoryBySearchCondition(requests); if (getMachiningByConditionResponse.IsSuccess) { vm.InventoryCollection = getMachiningByConditionResponse.Result.InventoryCollection; vm.PageIndex = getMachiningByConditionResponse.Result.PageIndex; vm.PageCount = getMachiningByConditionResponse.Result.PageCount; } return(View(vm)); }
public ActionResult BucketMachiningAddSave(int?PageIndex, string CustomerName, int Flag, string ShowSubmit, long CustomerID = 0, long ID = 0) { //Flag 1新增 2查看 3编辑 var CustomerListAll = ApplicationConfigHelper.GetProjectUserCustomers(base.UserInfo.ProjectID, base.UserInfo.ID).Where(t => t.StoreType == 2 || t.StoreType == 3); var CustomerListID = CustomerListAll.Select(t => t.CustomerID); var CustomerList = CustomerListAll.Select(c => new SelectListItem() { Value = c.CustomerID.ToString(), Text = c.CustomerName }); ViewBag.CustomerList = CustomerList; IndexViewModel vm = new IndexViewModel(); vm.ViewType = Flag; vm.ShowSubmit = ShowSubmit; GetMachiningByConditionRequest requests = new GetMachiningByConditionRequest(); vm.searchCondition = new MachiningSearchCondition(); vm.searchCondition.ExpectDate = DateTime.Now; vm.searchCondition.CustomerID = CustomerID; requests.SearchCondition = vm.searchCondition; requests.PageSize = UtilConstants.PAGESIZE; requests.PageIndex = PageIndex ?? 0; var UnitAndSpecificationsList = ApplicationConfigHelper.GetWMS_UnitAndSpecifications_Config(base.UserInfo.ProjectID, CustomerID, 14); var UnitAndSpecificationsLists = UnitAndSpecificationsList.Select(t => new { Code = t.Unit, Name = t.Specifications }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Name }); var SpecificationsList = UnitAndSpecificationsLists.Where(m => m.Value == "桶").Select(t => new { Code = t.Text, Name = t.Text }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Code }); var WashSpecificationsList = UnitAndSpecificationsLists.Where(m => m.Value == "冲洗桶").Select(t => new { Code = t.Text, Name = t.Text }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Code }); var MoreThanSpecificationsList = UnitAndSpecificationsLists.Where(m => m.Value == "余料桶").Select(t => new { Code = t.Text, Name = t.Text }).Distinct().Select(c => new SelectListItem() { Value = c.Code.ToString(), Text = c.Code }); ViewBag.SpecificationsList = SpecificationsList; ViewBag.WashSpecificationsList = WashSpecificationsList; ViewBag.MoreThanSpecificationsList = MoreThanSpecificationsList; if (Flag == 2 || Flag == 3) { var getMachiningByConditionResponse1 = new MachiningManagementService().GetMachiningByID(ID); if (getMachiningByConditionResponse1.IsSuccess) { vm.MachiningCollection = getMachiningByConditionResponse1.Result.MachiningCollection; } } var getMachiningByConditionResponse = new MachiningManagementService().GetLittleInventoryBySearchCondition(requests); if (getMachiningByConditionResponse.IsSuccess) { vm.InventoryCollection = getMachiningByConditionResponse.Result.InventoryCollection; } return(View(vm)); }
public JsonResult WarhouseMachiningAddSave(string MachiningNumber, string CarOrBoxNumber, DateTime ExpectDate, string Tel, long CustomerID, string CustomerName, string DetailJson, string IDS, string IDDS, string MachiningType, int Flag, int ViewType) {//Flag 1暂存 2库内加工提交 3槽车直接出库 4槽车直接入库 if (ViewType == 1) { var countAsn = new MachiningManagementService().CheckMachiningNumber(MachiningNumber); if (countAsn > 0) { return(Json(new { ErrorCode = "1", OrderInfo = "加工单号已存在" })); } } GetMachiningByConditionRequest requests = new GetMachiningByConditionRequest(); var Detail = jsonlist <WMS_MachiningHeaderAndDetail>(DetailJson); Detail.Each((i, s) => { s.ExpectDate = ExpectDate; s.MachiningNumber = MachiningNumber; s.CarOrBoxNumber = CarOrBoxNumber; s.Tel = Tel; s.CreateTime = DateTime.Now; s.CustomerID = CustomerID; s.CustomerName = CustomerName; s.IDS = IDS; s.MachiningType = MachiningType; s.SKU = s.ProportioningSKU == "" ? s.SKU : s.ProportioningSKU; s.GoodsName = s.ProportioningSKU == "" ? s.GoodsName : s.ProportioningSKU; s.IDDS = IDDS == "" ? null : IDDS; }); requests.MachiningCollection = Detail; var re = ""; if (Flag == 1) { re = new MachiningManagementService().SaveMachining(requests, base.UserInfo.Name); } if (Flag == 2) { re = new MachiningManagementService().AddMachining(requests, base.UserInfo.Name, IDS == "" ? IDS : IDS.Substring(0, IDS.Length - 1), IDDS == null ? IDDS : IDDS.Substring(0, IDDS.Length - 1)); } if (Flag == 3) { re = new MachiningManagementService().BucketOutMachining(requests, base.UserInfo.Name, IDS == "" ? IDS : IDS.Substring(0, IDS.Length - 1)); } if (Flag == 4) { re = new MachiningManagementService().BucketInMachining(requests, base.UserInfo.Name, IDS == ""?IDS:IDS.Substring(0, IDS.Length - 1)); } if (re == "OK") { return(Json(new { ErrorCode = "0", OrderInfo = re })); } else { return(Json(new { ErrorCode = "1", OrderInfo = re })); } }
public string BucketInMachining(GetMachiningByConditionRequest request, string Creator, string IDS) { string str = ""; try { MachiningManagementAccessor accessor = new MachiningManagementAccessor(); str = accessor.BucketInMachining(request.MachiningCollection, Creator, IDS); } catch (Exception ex) { LogError(ex); } return(str); }
/// <summary> /// 查询 /// </summary> /// <param name="request"></param> /// <returns></returns> public Response <GetMachiningByConditionResponse> GetMachiningByCondition(GetMachiningByConditionRequest request) { Response <GetMachiningByConditionResponse> response = new Response <GetMachiningByConditionResponse>() { Result = new GetMachiningByConditionResponse() }; if (request == null || request.SearchCondition == null) { ArgumentNullException ex = new ArgumentNullException("GetMachiningByConditionRequest request"); LogError(ex); response.ErrorCode = ErrorCode.Argument; response.Exception = ex; return(response); } try { MachiningManagementAccessor accessor = new MachiningManagementAccessor(); int RowCount; if (request.PageSize > 0) { response.Result.MachiningCollection = accessor.GetMachiningByCondition(request.SearchCondition, request.PageIndex, request.PageSize, out RowCount); response.Result.PageCount = RowCount % request.PageSize == 0 ? RowCount / request.PageSize : RowCount / request.PageSize + 1; response.Result.PageIndex = request.PageIndex; } response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }