diff --git a/ZR.Admin.WebApi/wwwroot/workorder/2024012216134397e79fbae8a188e6a19d%bf.xlsx b/ZR.Admin.WebApi/wwwroot/workorder/2024012216134397e79fbae8a188e6a19d%bf.xlsx new file mode 100644 index 00000000..06c48fce Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/workorder/2024012216134397e79fbae8a188e6a19d%bf.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/workorder/2024012216405497e79fbae8a188e6a19d%bf.xlsx b/ZR.Admin.WebApi/wwwroot/workorder/2024012216405497e79fbae8a188e6a19d%bf.xlsx new file mode 100644 index 00000000..06c48fce Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/workorder/2024012216405497e79fbae8a188e6a19d%bf.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/workorder/2024012216434597e79fbae8a188e6a19d%bf.xlsx b/ZR.Admin.WebApi/wwwroot/workorder/2024012216434597e79fbae8a188e6a19d%bf.xlsx new file mode 100644 index 00000000..06c48fce Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/workorder/2024012216434597e79fbae8a188e6a19d%bf.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/workorder/2024012216482597e79fbae8a188e6a19d%bf.xlsx b/ZR.Admin.WebApi/wwwroot/workorder/2024012216482597e79fbae8a188e6a19d%bf.xlsx new file mode 100644 index 00000000..06c48fce Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/workorder/2024012216482597e79fbae8a188e6a19d%bf.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/workorder/2024012216530097e79fbae8a188e6a19d%bf.xlsx b/ZR.Admin.WebApi/wwwroot/workorder/2024012216530097e79fbae8a188e6a19d%bf.xlsx new file mode 100644 index 00000000..06c48fce Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/workorder/2024012216530097e79fbae8a188e6a19d%bf.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/workorder/2024012216552497e79fbae8a188e6a19d%bf.xlsx b/ZR.Admin.WebApi/wwwroot/workorder/2024012216552497e79fbae8a188e6a19d%bf.xlsx new file mode 100644 index 00000000..6f35b14c Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/workorder/2024012216552497e79fbae8a188e6a19d%bf.xlsx differ diff --git a/ZR.Model/MES/pro/ProWorklplan_v2.cs b/ZR.Model/MES/pro/ProWorklplan_v2.cs index d440cc91..2e86fe48 100644 --- a/ZR.Model/MES/pro/ProWorklplan_v2.cs +++ b/ZR.Model/MES/pro/ProWorklplan_v2.cs @@ -164,7 +164,7 @@ namespace Model.DBModel /// [SugarColumn(ColumnName = "year")] [ExcelIgnore] - public float Year { get; set; } + public int Year { get; set; } /// /// 周 @@ -172,7 +172,7 @@ namespace Model.DBModel /// [SugarColumn(ColumnName = "week")] [ExcelIgnore] - public float Week { get; set; } + public int Week { get; set; } /// diff --git a/ZR.Model/MES/pro/ProWorkorder_v2.cs b/ZR.Model/MES/pro/ProWorkorder_v2.cs index 09e64d4e..0231dbea 100644 --- a/ZR.Model/MES/pro/ProWorkorder_v2.cs +++ b/ZR.Model/MES/pro/ProWorkorder_v2.cs @@ -103,13 +103,45 @@ namespace ZR.Model.MES.pro [SugarColumn(ColumnName = "remark2")] [ExcelColumn(Name = "备注2", IndexName = "L")] public string Remark2 { get; set; } + + /// - /// 备注3 + /// 备注3,识别是否需要工单 /// [SugarColumn(ColumnName = "remark3")] [ExcelIgnore] public string Remark3 { get; set; } + /// + /// 备注4 :来源 + /// + [SugarColumn(ColumnName = "remark4")] + [ExcelIgnore] + public string Remark4 { get; set; } + + /// + /// 序号 + /// + [SugarColumn(ColumnName = "sort")] + [ExcelIgnore] + public int Sort { get; set; } + + /// + /// 客户工单号 + /// + [SugarColumn(ColumnName = "client_workorder")] + [ExcelIgnore] + public string ClientWorkorder { get; set; } + + + + /// + /// 状态:0初态 1上线 + /// + [SugarColumn(ColumnName = "status")] + [ExcelIgnore] + public int Status { get; set; } + /// /// 年 /// diff --git a/ZR.Service/mes/pro/ProWorkorderServiceV2.cs b/ZR.Service/mes/pro/ProWorkorderServiceV2.cs index 9f228153..69cddb5a 100644 --- a/ZR.Service/mes/pro/ProWorkorderServiceV2.cs +++ b/ZR.Service/mes/pro/ProWorkorderServiceV2.cs @@ -42,7 +42,7 @@ namespace ZR.Service.mes.pro .ToExpression(); int totalCount = 0; - List proWorkorderList = Context.Queryable().Where(predicate).OrderBy(it => it.Id).ToPageList(pageNum, pageSize, ref totalCount); + List proWorkorderList = Context.Queryable().Where(predicate).OrderBy(it => it.Sort).ToPageList(pageNum, pageSize, ref totalCount); return (proWorkorderList, totalCount); } @@ -76,14 +76,25 @@ namespace ZR.Service.mes.pro // 更新生产计划 if (workorderList != null && workorderList.Count > 0) { - workorderList.ForEach(it => + workorderList.ForEach(item => { - it.Id = "WO" + DateTime.Now.ToString("yyyyMMdd") + max_id.ToString("000"); - it.Remark3 = "Excel导入"; + item.Id = "WO" + DateTime.Now.ToString("yyyyMMdd") + max_id.ToString("000"); + item.Remark4 = "Excel导入"; + // 添加属性 + item.Sort = Convert.ToInt32(item.Year.ToString("0000").Substring(2) + item.Week.ToString("00") + item.Date.ToString("00") + workorderList.IndexOf(item).ToString("000")); + + if (item.Remark2 == "批量") + { + item.Remark3 = "是"; + } + item.Status = 0; + max_id++; }); + foreach (ProWorkorder_v2 item in workorderList) { + // 修正计划 ProWorklplan_v2 planItem = Context.Queryable().Where(it => it.Id == item.FinishedPartNumber).First(); if (planItem != null) { @@ -104,6 +115,9 @@ namespace ZR.Service.mes.pro Context.Deleteable().Where(it => it.Year == workorderList[0].Year) .Where(it => it.Week == workorderList[0].Week) .Where(it => it.Date == workorderList[0].Date).ExecuteCommand(); + + + //插入 Context.Insertable(workorderList).ExecuteCommand(); @@ -221,6 +235,21 @@ namespace ZR.Service.mes.pro workorder.Id = "WO" + DateTime.Now.ToString("yyyyMMdd") + Getworkorderid_max().ToString("000"); + workorder.Remark4 = "手动插入"; + workorder.Status = 0; + if (workorder.Remark2 == "批量") + { + workorder.Remark3 = "是"; + } + // 更改以下工单的顺序 + if (workorder.Sort > 0) + { + int max = Convert.ToInt32(workorder.Sort.ToString().Substring(0, 6) + "999"); + Context.Updateable().Where(it => it.Sort >= workorder.Sort && it.Sort <= max).SetColumns(it => it.Sort == it.Sort + 1).ExecuteCommand(); + + } + + return Context.Insertable(workorder).ExecuteCommand(); }