wankeda
2025-06-24 1caea0fdc7ed1788d854a2aba8853984b4494e01
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/Task_HtyService.cs
@@ -1,5 +1,6 @@
锘縰sing AutoMapper;
using MailKit.Search;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using SqlSugar;
using System;
@@ -35,11 +36,11 @@
public class Task_HtyService : ServiceBase<Dt_Task_Hty, ITask_HtyRepository>, ITask_HtyService
{
    public Task_HtyService(ITask_HtyRepository BaseDal
                                    ) : base(BaseDal)
    {
    }
    /// <summary>
@@ -51,7 +52,7 @@
    {
        return BaseDal.InsertTask(task);
    }
    public WebResponseContent AddTaskHty(Dt_Task task)
    public WebResponseContent AddTaskHty(Dt_Task task, int TaskStatus)
    {
        WebResponseContent content = new WebResponseContent();
        Dt_Task_Hty task_Hty = new Dt_Task_Hty()
@@ -60,14 +61,14 @@
            PalletCode = task.PalletCode,
            Roadway = task.Roadway,
            TaskType = task.TaskType,
            TaskStatus = task.TaskStatus,
            TaskStatus = TaskStatus,
            SourceAddress = task.SourceAddress,
            TargetAddress = task.TargetAddress,
            CurrentAddress = task.CurrentAddress,
            NextAddress = task.NextAddress,
            Grade = task.Grade,
            Dispatchertime = task.Dispatchertime,
            Creater =task.Creater,
            Creater = task.Creater,
            CreateDate = task.CreateDate,
            ModifyDate = DateTime.Now,
            Modifier = task.Modifier,
@@ -76,4 +77,35 @@
        BaseDal.AddData(task_Hty);
        return content;
    }
    public WebResponseContent TaskData(SaveModel saveModel)
    {
        WebResponseContent response = new WebResponseContent();
        List<object> list = new List<object>();
        List<int> today = new List<int>();
        List<int> count = new List<int>();
        try
        {
            DateTime dateTody = DateTime.Today.AddDays(+1);
            for (int i = 1; i <= 7; i++)
            {
                DateTime date = dateTody.AddDays(-1);
                DateTime time = DateTime.Now.Date.AddDays(-i + 1);
                DateTime time1 = DateTime.Now.Date.AddDays(-i);
                List<Dt_Task_Hty> taskProIn_Hties = BaseDal.QueryData(x => x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.CreateDate >= date && x.CreateDate <= dateTody);
                var distinctList = taskProIn_Hties
                .GroupBy(x => x.TaskNum)
                .ToList();
                dateTody = date;
                list.Add(new { today = date.ToString("MM-dd"), proIn = distinctList.Count });
            }
            response.OK(data: new { list, dateNow = DateTime.Now });
        }
        catch (Exception ex)
        {
            response.Error(ex.Message);
        }
        return response;
    }
}