Browse Source

加入品类词

master
feng 3 years ago
parent
commit
a02391fc91
  1. 3
      src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs
  2. 2
      src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs
  3. 94
      src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs
  4. 3
      src/Coldairarrow.Entity/DTO/ItemLabelDto.cs
  5. 5
      src/Coldairarrow.Entity/DTO/TeamitemDto.cs
  6. 4
      src/Coldairarrow.Entity/HuiYan/teamitems.cs
  7. 2
      客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs
  8. 9
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs
  9. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/api/http.js

3
src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs

@ -275,7 +275,8 @@ namespace Coldairarrow.Business.HuiYan
Platform = item.Platform,
Sales = model.Sales,
Title = model.Title,
GoodsUrl=item.GoodsUrl
GoodsUrl=item.GoodsUrl,
CatId=model.CatId
}).Success)
{
throw new Exception("添加产品库失败!");

2
src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs

@ -166,7 +166,6 @@ namespace Coldairarrow.Business.HuiYan
teamItemList.ForEach(teamItem =>
{
var user = userList.Where(c => c.Count < c.MaxCount).OrderBy(c => c.Count).FirstOrDefault();
if (user == null)
@ -178,7 +177,6 @@ namespace Coldairarrow.Business.HuiYan
user.Count += 1;
pricetasklogs.Add(new pricetasklog()
{
CreateTime = DateTime.Now,

94
src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs

@ -79,54 +79,70 @@ namespace Coldairarrow.Business.HuiYan
public PageResult<TeamitemDto> GetItems(PageInput<ConditionDTO> input, string keyWord)
{
Expression<Func<teamitems, items, TeamitemDto>> select = (a, b) => new TeamitemDto
try
{
GoodsId = b.GoodsId,
HasFilter = b.HasFilter,
Platform = b.Platform,
GoodsUrl = b.GoodsUrl,
Extensions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TeamItemExtension>>(a.ExtensionJson)
};
var search = input.Search;
select = select.BuildExtendSelectExpre();
var q_titem = GetIQueryable();
var q = from a in q_titem.AsExpandable()
join b in Db.GetIQueryable<items>() on a.ItemId equals b.Id into ab
from b in ab.DefaultIfEmpty()
select @select.Invoke(a, b);
int state = int.Parse(search.Keyword);
//查询对应状态
var where = LinqHelper.True<TeamitemDto>();
if (state == 0)
{
where = where.And(c => c.State == state || c.State == (int)TeamItemState.);
}
else {
if (state == 6)
Expression<Func<teamitems, items, cats, TeamitemDto>> select = (a, b, c) => new TeamitemDto
{
where = where.And(c => c.State == state || c.State == (int)TeamItemState.);
}
else
GoodsId = b.GoodsId,
HasFilter = b.HasFilter,
Platform = b.Platform,
GoodsUrl = b.GoodsUrl,
CatName = c == null ? String.Empty : c.Name,
Extensions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TeamItemExtension>>(a.ExtensionJson)
};
var search = input.Search;
select = select.BuildExtendSelectExpre();
var q_titem = GetIQueryable();
var q = from a in q_titem.AsExpandable()
join b in Db.GetIQueryable<items>() on a.ItemId equals b.Id into ab
from b in ab.DefaultIfEmpty()
join c in Db.GetIQueryable<cats>() on a.CatId equals c.Id into bc
from c in bc.DefaultIfEmpty()
select @select.Invoke(a, b, c);
int state = 0;
bool searchState= int.TryParse(search.Keyword, out state);
//查询对应状态
var where = LinqHelper.True<TeamitemDto>();
if (searchState)
{
where = where.And(c => c.State == state);
if (state == 0)
{
where = where.And(c => c.State == state || c.State == (int)TeamItemState.);
}
else
{
if (state == 6)
{
where = where.And(c => c.State == state || c.State == (int)TeamItemState.);
}
else
{
where = where.And(c => c.State == state);
}
}
}
}
where = where.AndIf(!string.IsNullOrEmpty(keyWord), d => d.Title.Contains(keyWord));
where = where.AndIf(!string.IsNullOrEmpty(keyWord), d => string.IsNullOrEmpty(d.CatName) ? true : d.CatName.Contains(keyWord));
where = where.And(c => c.TeamId == _operator.TeamId);
where = where.And(c => c.TeamId == _operator.TeamId);
input.SortField = "CreateTime";
input.SortType = "desc";
input.SortField = "CreateTime";
input.SortType = "desc";
var list = q.Where(where).GetPageResultAsync(input).Result;
var list = q.Where(where).GetPageResultAsync(input).Result;
return list;
return list;
}
catch (Exception ex)
{
throw new Exception(ex.StackTrace);
}
}
@ -194,7 +210,7 @@ namespace Coldairarrow.Business.HuiYan
ItemImg = model.ItemImg,
Sales = model.Sales,
Title = model.Title,
CatId=model.CatId,
ItemId = model.ItemId
});

3
src/Coldairarrow.Entity/DTO/ItemLabelDto.cs

@ -17,8 +17,7 @@ namespace Coldairarrow.Entity.DTO
public string Sales { get; set; }
public string Img { get; set; }
public string CatId { get; set; }
/// <summary>
/// 标签状态
/// </summary>

5
src/Coldairarrow.Entity/DTO/TeamitemDto.cs

@ -35,6 +35,11 @@ namespace Coldairarrow.Entity.DTO
/// </summary>
public int? PriceTaskState { get; set; }
/// <summary>
/// 品类词名称
/// </summary>
public string CatName { get; set; }
/// <summary>
/// 扩展信息
/// </summary>

4
src/Coldairarrow.Entity/HuiYan/teamitems.cs

@ -111,5 +111,9 @@ namespace Coldairarrow.Entity.HuiYan
/// 接比价任务的用户ID
/// </summary>
public string PriceTaskUserId { get; set; }
/// <summary>
/// 品类词ID
/// </summary>
public string CatId { get; set; }
}
}

2
客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs

@ -16,6 +16,8 @@ namespace 齐越慧眼.Models
public string Img { get; set; }
public string CatId { get; set; }
/// <summary>
/// 标签状态
/// </summary>

9
客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs

@ -926,7 +926,8 @@ namespace 齐越慧眼.UserControls
Price = Convert.ToDecimal(price),
Sales = sales,
Status = (ItemLabelStatus)type,
Title = title
Title = title,
CatId=MainWindow.Main.LastKeyWord
});
if (result.isOk)
@ -1027,7 +1028,8 @@ namespace 齐越慧眼.UserControls
Price = Convert.ToDecimal(price),
Sales = sales,
Status = (ItemLabelStatus)type,
Title = title
Title = title,
CatId = MainWindow.Main.LastKeyWord
});
if (result.isOk)
@ -1161,7 +1163,8 @@ namespace 齐越慧眼.UserControls
Price = Convert.ToDecimal(price),
Sales = sales,
Status = (ItemLabelStatus)type,
Title = title
Title = title,
CatId = MainWindow.Main.LastKeyWord
});
if (result.isOk)

2
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/api/http.js

@ -19,7 +19,7 @@ else if (process.env.NODE_ENV == 'production') {
let ipAddress = axios.defaults.baseURL;
axios.defaults.baseURL = 'http://localhost:5000/';
//axios.defaults.baseURL = 'http://localhost:5000/';
//axios.defaults.baseURL = 'http://hyapi.qiyue666.com/';
axios.interceptors.request.use((config) => {

Loading…
Cancel
Save