| | |
| | | 锘縰sing AutoMapper; |
| | | using MailKit.Search; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | |
| | | public class Task_HtyService : ServiceBase<Dt_Task_Hty, ITask_HtyRepository>, ITask_HtyService |
| | | { |
| | | |
| | | |
| | | public Task_HtyService(ITask_HtyRepository BaseDal |
| | | ) : base(BaseDal) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | 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() |
| | |
| | | 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, |
| | |
| | | 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; |
| | | } |
| | | } |