IQC
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
@@ -7,6 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Model.MES.op.DTO;
|
||||
using ZR.Model.MES.pro.DTO;
|
||||
|
||||
namespace ZR.Service.mes.pro.IService
|
||||
{
|
||||
@@ -21,6 +23,9 @@ namespace ZR.Service.mes.pro.IService
|
||||
public int SortWorkorderSchedule(string id, int sort);
|
||||
|
||||
public int ReleaseProduction(string id, HttpContext httpContext);
|
||||
|
||||
|
||||
|
||||
public GanttTaskDTO GetGanttList(int year,int week,int date);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ using static System.Net.WebRequestMethods;
|
||||
|
||||
using JinianNet.JNTemplate;
|
||||
using static Aliyun.OSS.Model.LiveChannelStat;
|
||||
using ZR.Model.MES.pro.DTO;
|
||||
|
||||
namespace ZR.Service.mes.pro
|
||||
{
|
||||
@@ -150,5 +151,64 @@ namespace ZR.Service.mes.pro
|
||||
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取甘特图
|
||||
/// </summary>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="week"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
public GanttTaskDTO GetGanttList(int year, int week, int date)
|
||||
{
|
||||
|
||||
|
||||
var predicate = Expressionable.Create<ProWorkorder>()
|
||||
.AndIF(year > 0, it => it.Year == year)
|
||||
.AndIF(week > 0, it => it.Week == week)
|
||||
.AndIF(date > 0, it => it.Date == date)
|
||||
.And(it=>it.Wrokerorder_status==1)
|
||||
.ToExpression();
|
||||
|
||||
|
||||
List<ProWorkorder> proWorkorderList = Context.Queryable<ProWorkorder>().Where(predicate).ToList();
|
||||
|
||||
|
||||
GanttTaskDTO ganttTask = new GanttTaskDTO();
|
||||
|
||||
List<GanttTask_data> ganttTask_data = new List<GanttTask_data>();
|
||||
List<GanttTask_link> ganttTask_Links = new List<GanttTask_link>();
|
||||
|
||||
foreach (var item in proWorkorderList)
|
||||
{
|
||||
GanttTask_data data = new GanttTask_data();
|
||||
data.id = item.Id;
|
||||
data.text = item.ProductionName;
|
||||
data.start_date = ((DateTime)item.ArrangeStarttime).ToString("yyyy-MM-dd");
|
||||
data.duration = item.ProductionTime;
|
||||
data.planned_start = ((DateTime)item.ArrangeStarttime).ToString("yyyy-MM-dd");
|
||||
data.planned_end = ((DateTime)item.ArrangeEndtime).ToString("yyyy-MM-dd");
|
||||
data.progress = 1;
|
||||
data.show = false;
|
||||
data.open = true;
|
||||
data.type = "project";
|
||||
|
||||
|
||||
GanttTask_link link = new GanttTask_link();
|
||||
link.id = item.Order;
|
||||
link.source = item.Order;
|
||||
int index = proWorkorderList.IndexOf(item);
|
||||
if (index < proWorkorderList.Count-1)
|
||||
link.target = (int)proWorkorderList[index + 1]?.Order;
|
||||
link.type = 0;
|
||||
|
||||
ganttTask_data.Add(data);
|
||||
ganttTask_Links.Add(link);
|
||||
|
||||
|
||||
}
|
||||
ganttTask.Data = ganttTask_data;
|
||||
ganttTask.Links = ganttTask_Links;
|
||||
return ganttTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user