|
|
|
@ -10,13 +10,16 @@ using log4net;
|
|
|
|
|
using Org.BouncyCastle.Asn1.Tsp;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using Admin.Core.Common;
|
|
|
|
|
using Admin.Core.Model.Sys;
|
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
|
|
|
|
|
|
namespace Admin.Core.Service
|
|
|
|
|
{
|
|
|
|
|
public class RealTaskInfoServices : BaseServices<RealTaskInfo>, IRealTaskInfoServices
|
|
|
|
|
{
|
|
|
|
|
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(RealTaskInfoServices));
|
|
|
|
|
private readonly IBaseRepository<RealTaskInfo> _dal;
|
|
|
|
|
|
|
|
|
|
IBaseRepository<RealTaskInfo> _dal;
|
|
|
|
|
private readonly IRealTaskInfoRepository _realTaskInfoRepository;
|
|
|
|
|
public RealTaskInfoServices(IBaseRepository<RealTaskInfo> dal, IRealTaskInfoRepository realTaskInfoRepository)
|
|
|
|
|
{
|
|
|
|
@ -147,7 +150,11 @@ namespace Admin.Core.Service
|
|
|
|
|
RealTaskInfo taskInfo = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
taskInfo = (await _dal.QueryAsync(x => x.StoreCode == storeCode && x.TaskStatus == 1 && x.TaskType == taskType)).OrderBy(x => x.CreateTime).FirstOrDefault();
|
|
|
|
|
var list = await _dal.QueryAsync(x => x.StoreCode == storeCode && x.TaskStatus == 1 && x.TaskType == taskType);
|
|
|
|
|
if (list.Count()>0)
|
|
|
|
|
{
|
|
|
|
|
taskInfo = list.OrderBy(x => x.CreateTime).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -210,7 +217,14 @@ namespace Admin.Core.Service
|
|
|
|
|
List<RealTaskInfo> taskInfos = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
taskInfos =await _dal.QueryAsync(x => x.TaskType == taskType);
|
|
|
|
|
//Expression<Func<RealTaskInfo, bool>> exp = s1 => true;
|
|
|
|
|
//exp = exp.And(d =>d.TaskType == taskType && storeCode.Contains(d.StoreCode));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expression<Func<RealTaskInfo, bool>> whereExpression = x => true;
|
|
|
|
|
whereExpression = whereExpression.And(d => d.TaskType == taskType && storeCode.Contains(d.StoreCode));
|
|
|
|
|
|
|
|
|
|
taskInfos = await _dal.QueryAsync(whereExpression);
|
|
|
|
|
if (taskStatus != 0)
|
|
|
|
|
{
|
|
|
|
|
taskInfos = taskInfos.Where(x => x.TaskStatus == taskStatus).ToList();
|
|
|
|
|