/// <summary> /// 设置仓库默认收货储位 /// </summary> /// <param name="warehouseId"></param> /// <param name="locationId"></param> public ActionResult SubmitSetLocation(string warehouseId, string locationId) { try { var entity = Repositoryfactory.Repository().FindEntity("warehouseId", warehouseId); if (entity == null) { throw new Exception("仓库信息不存在"); } var location = _warehouseLocationBLL.GetLocation(warehouseId, locationId); if (location == null || location.IsEnable != (int)YesNoStatus.Yes) { throw new Exception("储位信息无效"); } entity.Modify(entity.WarehouseId); entity.ReceiptLocationId = location.LocationId; bool flag = _warehouseBLL.UpdateReceiptLocationId(entity); if (!flag) { throw new Exception("设置默认收货储位失败"); } WriteLog(1, warehouseId, "设置默认收货储位成功"); return(Content(new JsonMessage { Success = true, Code = "1", Message = "设置默认收货储位成功" }.ToString())); } catch (Exception ex) { WriteLog(-1, warehouseId, "操作失败:" + ex.Message); return(Content(new JsonMessage { Success = false, Code = "-1", Message = "操作失败:" + ex.Message }.ToString())); } }