Browse Source

修复比价统计数据不准确

master
feng 3 years ago
parent
commit
ce21eea83a
  1. 28
      src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs
  2. 4
      src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs
  3. 6
      客户端/齐越慧眼/齐越慧眼/ApiHelper.cs
  4. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/info/Index.vue

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

@ -78,7 +78,33 @@ namespace Coldairarrow.Business.HuiYan
public AjaxResult GetTaskCount()
{
var list = Db.GetIQueryable<pricetasklog>().Where(c => c.UserId == _operator.UserId).Select(c => c.State).ToList();
Expression<Func<teamitems, items, pricetasklog, TeamitemDto>> select = (a, b, c) => new TeamitemDto
{
GoodsId = b.GoodsId,
HasFilter = b.HasFilter,
Platform = b.Platform,
GoodsUrl = b.GoodsUrl,
PriceTaskId = c.Id,
PriceTaskState = (int)c.State,
Extensions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TeamItemExtension>>(a.ExtensionJson)
};
select = select.BuildExtendSelectExpre();
var q_titem = Db.GetIQueryable<teamitems>();
var q = from a in q_titem.AsExpandable()
join b in Db.GetIQueryable<items>() on a.ItemId equals b.Id into ab
from ba in ab.DefaultIfEmpty()
join c in Db.GetIQueryable<pricetasklog>() on a.Id equals c.TeamItemId into ac
from bb in ac.DefaultIfEmpty()
select @select.Invoke(a, ba, bb);
//查询对应状态
var where = LinqHelper.True<TeamitemDto>().And(c => c.PriceTaskUserId == _operator.UserId);
where = where.And(c => c.PriceTaskState != null);
var list = q.Where(where).Select(c => c.PriceTaskState).ToList();
return Success(list.GroupBy(c => c).Select(c => new { Id = c.Key, Count = c.Count() }));
}

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

@ -330,16 +330,15 @@ namespace Coldairarrow.Business.HuiYan
start = new DateTime(start.Year, start.Month, start.Day);
end = new DateTime(end.Year, end.Month, end.Day, 23, 59, 59);
where = where.And(c => c.PriceTaskCreateDate >= start && c.PriceTaskCreateDate <= end);
//团队
if (type == 0)
{
where = where.And(c => c.PriceTaskCreateDate >= start && c.PriceTaskCreateDate <= end);
where = where.And(c => c.TeamId == _operator.TeamId);
}
//比价
else
{
where = where.And(c => c.CreateTime >= start && c.CreateTime <= end);
where = where.And(c => c.UserId == _operator.UserId);
}
@ -352,6 +351,7 @@ namespace Coldairarrow.Business.HuiYan
PassCount = list.Count(c => c.IsPass==true),
PublishCount = list.Count,
FailedCount = list.Count(c => c.IsPass==false),
NeedWorkCount = list.Count(c => c.State != PriceTaskState.)
};
if (model.OverCount > 0) {

6
客户端/齐越慧眼/齐越慧眼/ApiHelper.cs

@ -12,9 +12,11 @@ namespace 齐越慧眼
{
public class ApiHelper
{
//public static string ApiBase { get; set; } = "http://111.230.132.27:8033";
#if DEBUG
public static string ApiBase { get; set; } = "http://localhost:5000";
#else
public static string ApiBase { get; set; } = "http://hyapi.qiyue666.com";
#endif
public static UserInfo LoginSystemUser { get; set; }
public static bool NoLogin { get; set; }

2
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/info/Index.vue

@ -41,7 +41,7 @@ export default {
infoData:{},
startDate:undefined,
endDate:undefined,
isPriceTaskUser:false,
isPriceTaskUser:true,
//0,1,3,7,15,30
timeTypes:[{name:'今天',value:0},{name:'昨天',value:1},{name:'近3天',value:3},{name:'近7天',value:7},{name:'近15天',value:15},{name:'近30天',value:30}]
}

Loading…
Cancel
Save