public JObject GetList(JObject json) { json = json ?? new JObject(); vw_MallGoodMainInfo goodInfo = JsonConvert.DeserializeObject <vw_MallGoodMainInfo>((json["Param"] ?? "").ToString()); var acrossId = json["Param"].Value <int>("AcrossId"); if (acrossId > 0) { goodInfo.ServerName = "Across:"; var serverList = serverService.GetDNFServerByAcross(acrossId).ToList(); foreach (var item in serverList) { goodInfo.ServerName += item.Id + ","; } } DateTime?startTime = null; if (json["startTime"] != null) { startTime = Convert.ToDateTime(json["startTime"].ToString()); } DateTime?endTime = null; if (json["endTime"] != null) { endTime = Convert.ToDateTime(json["endTime"].ToString()); } Pagination page = json["Pagination"] == null?Pagination.GetDefaultPagination("GoodNo") : JsonConvert.DeserializeObject <Pagination>(json["Pagination"].ToString()); return(service.GetGoodList(goodInfo, page)); }
public JObject GetList(JObject json) { vw_MallGoodMainInfo goodInfo = JsonConvert.DeserializeObject <vw_MallGoodMainInfo>(json.ToString()); DateTime?startTime = null; if (json["startTime"] != null) { startTime = Convert.ToDateTime(json["startTime"].ToString()); } DateTime?endTime = null; if (json["endTime"] != null) { endTime = Convert.ToDateTime(json["endTime"].ToString()); } Pagination page = json["Pagination"] == null?Pagination.GetDefaultPagination("GoodNo") : JsonConvert.DeserializeObject <Pagination>(json["Pagination"].ToString()); return(service.GetGoodList(goodInfo, startTime, endTime, page)); }
public JObject GetProcessList(JObject json) { json = json ?? new JObject(); Pagination page = json["Pagination"] == null?Pagination.GetDefaultPagination("GoodNo") : JsonConvert.DeserializeObject <Pagination>(json["Pagination"].ToString()); if (json["Param"]["SelectType"].ToString() == "good") { vw_MallGoodMainInfo goodInfo = JsonConvert.DeserializeObject <vw_MallGoodMainInfo>((json["Param"] ?? "").ToString()); return(service.GetGoodList(goodInfo, null, null, page));//获取商品信息 } else if (json["Param"]["SelectType"].ToString() == "order") { //思路:开发待处理视图。 //1.根据当前账号获取账号所有的权限(角色)。 //2.根据当前角色找到对应的虚拟账号。 //3.到最后取待处理的视图时候就是 Receiver in (‘虚拟账号1’,‘虚拟账号2 ’) v_framework_notify OrderInfo = JsonConvert.DeserializeObject <v_framework_notify>((json["Param"] ?? "").ToString()); CurrentLogin loginContent = (CurrentLogin)HttpContext.Current.Session["CurrentLogin"]; //获取处理人集合 string GetReceiverApi = AppSettingsConfig.GetBaseApi + "/api/Flow/GetReceivers"; Dictionary <string, string> parames = new Dictionary <string, string>(); parames.Add("userId", loginContent.User_Id); Tuple <string, string> parameters = WebApiHelper.GetQueryString(parames); var result = WebApiHelper.Get <dynamic>(GetReceiverApi, parameters.Item1, parameters.Item2, loginContent.User_Id); //拼接处理人的,in条件。(后续功能扩充,如果除了需要把公共账号相关表单带出来,还需要当前登录人带出来,就从session里面取UserID加到in的条件userStr里面。) string userStr = string.Empty; if ((bool)result["result"]) { List <dynamic> receives = JsonConvert.DeserializeObject <List <dynamic> >(result["content"].ToString()); foreach (var item in receives) { userStr += "," + item.ROLESERIAL; } } //把自身权限加入 userStr = userStr + "," + loginContent.User_Id; JObject ret = new JObject(); Expression <Func <v_framework_notify, bool> > expression = PredicateExtensions.True <v_framework_notify>(); if (OrderInfo != null) { if (!string.IsNullOrEmpty(OrderInfo.OrderNo)) { expression = expression.And(c => c.OrderNo.Contains(OrderInfo.OrderNo)); } if (!string.IsNullOrEmpty(OrderInfo.CURSTATUS_NAME)) { expression = expression.And(c => c.OrderNo.Contains(OrderInfo.CURSTATUS_NAME)); } if (!string.IsNullOrEmpty(OrderInfo.WFM_ID)) { expression = expression.And(c => c.WFM_ID.Contains(OrderInfo.WFM_ID)); } if (OrderInfo.Flow_ID > 0) { expression = expression.And(c => c.Flow_ID == OrderInfo.Flow_ID); } if (OrderInfo.CURSTATUS_ID > 0) { expression = expression.And(c => c.CURSTATUS_ID == OrderInfo.CURSTATUS_ID); } expression = expression.And(c => userStr.Contains(c.Receiver) && !c.IsWaster_ && c.IsFinish != 1); } //查询列表数据 ret = processService.GetList(expression, page); if ((bool)ret["result"]) { List <v_framework_notify> result_notify = JsonConvert.DeserializeObject <List <v_framework_notify> >(ret["content"].ToString()); foreach (var item in result_notify) { vw_MallGoodMainInfo good = service.FindList(c => c.GoodNo == item.GoodNo).FirstOrDefault(); item.GoodTitle = (good == null?"":good.GoodTitle); item.GameName = (good == null ? "" : good.GameName); item.GoodTypeName = (good == null ? "" : good.GoodTypeName); item.GoodKeyWord = (good == null ? "" : good.GoodKeyWord); } //插入进去。 ret["content"] = JToken.FromObject(result_notify); } return(ret); } else { return(null); } }