diff --git a/API/TaskManager.Entity/11-18/SUPPLIER_CON_MMRP.cs b/API/TaskManager.Entity/11-18/SUPPLIER_CON_MMRP.cs index ebea2f2..4b1d1ba 100644 --- a/API/TaskManager.Entity/11-18/SUPPLIER_CON_MMRP.cs +++ b/API/TaskManager.Entity/11-18/SUPPLIER_CON_MMRP.cs @@ -5,7 +5,7 @@ namespace TaskManager.Entity.Entitys /// /// M+6月物料需求计划风险确认 /// - public class SUPPLIER_CON_MMRP : BaseEntity + public class SUPPLIER_CON_MMRP : BaseEntity { /// /// 供应商代码 diff --git a/API/TaskManager.Entity/Entity.cs b/API/TaskManager.Entity/Entity.cs index 9ca138f..cb9690c 100644 --- a/API/TaskManager.Entity/Entity.cs +++ b/API/TaskManager.Entity/Entity.cs @@ -476,7 +476,7 @@ namespace TaskManager.Entity /// [JsonPropertyName("version")] [ExporterHeader(DisplayName = "版本号")] - public int Version { get; set; } = 1; + public int Version { get; set; } =0; [JsonProperty("omterior")] [ExporterHeader(DisplayName = "内外饰")] // 推测拼写错误并自定义显示名 @@ -549,84 +549,84 @@ namespace TaskManager.Entity /// [JsonPropertyName("quantityDemand1")] [ExporterHeader(DisplayName = "需求数量1")] - public decimal QuantityDemand1 { get; set; } = 1; + public decimal QuantityDemand1 { get; set; } = 0; /// /// 需求数量2 /// [JsonPropertyName("quantityDemand2")] [ExporterHeader(DisplayName = "需求数量2")] - public decimal QuantityDemand2 { get; set; } = 1; + public decimal QuantityDemand2 { get; set; } = 0; /// /// 需求数量3 /// [JsonPropertyName("quantityDemand3")] [ExporterHeader(DisplayName = "需求数量3")] - public decimal QuantityDemand3 { get; set; } = 1; + public decimal QuantityDemand3 { get; set; } = 0; /// /// 需求数量4 /// [JsonPropertyName("quantityDemand4")] [ExporterHeader(DisplayName = "需求数量4")] - public decimal QuantityDemand4 { get; set; } = 1; + public decimal QuantityDemand4 { get; set; } = 0; /// /// 需求数量5 /// [JsonPropertyName("quantityDemand5")] [ExporterHeader(DisplayName = "需求数量5")] - public decimal QuantityDemand5 { get; set; } = 1; + public decimal QuantityDemand5 { get; set; } = 0; /// /// 需求数量6 /// [JsonPropertyName("quantityDemand6")] [ExporterHeader(DisplayName = "需求数量6")] - public decimal QuantityDemand6 { get; set; } = 1; + public decimal QuantityDemand6 { get; set; } = 0; /// /// 需求数量7 /// [JsonPropertyName("quantityDemand7")] [ExporterHeader(DisplayName = "需求数量7")] - public decimal QuantityDemand7 { get; set; } = 1; + public decimal QuantityDemand7 { get; set; } = 0; /// /// 需求数量8 /// [JsonPropertyName("quantityDemand8")] [ExporterHeader(DisplayName = "需求数量8")] - public decimal QuantityDemand8 { get; set; } = 1; + public decimal QuantityDemand8 { get; set; } = 0; /// /// 需求数量9 /// [JsonPropertyName("quantityDemand9")] [ExporterHeader(DisplayName = "需求数量9")] - public decimal QuantityDemand9 { get; set; } = 1; + public decimal QuantityDemand9 { get; set; } =0; /// /// 需求数量10 /// [JsonPropertyName("quantityDemand10")] [ExporterHeader(DisplayName = "需求数量10")] - public decimal QuantityDemand10 { get; set; } = 1; + public decimal QuantityDemand10 { get; set; } =0; /// /// 需求数量11 /// [JsonPropertyName("quantityDemand11")] [ExporterHeader(DisplayName = "需求数量11")] - public decimal QuantityDemand11 { get; set; } = 1; + public decimal QuantityDemand11 { get; set; } =0; /// /// 需求数量12 /// [JsonPropertyName("quantityDemand12")] [ExporterHeader(DisplayName = "需求数量12")] - public int QuantityDemand12 { get; set; } = 1; + public int QuantityDemand12 { get; set; } =0; /// /// 当文件夹数据发生变更时(更新需求=1/否则=0) @@ -742,13 +742,13 @@ namespace TaskManager.Entity /// 需求起始日期的需求数量 /// [ExporterHeader(DisplayName = "第1天需求数量")] - public int QuantityDemand1 { get; set; } = 1; + public int QuantityDemand1 { get; set; } =0; /// /// 起始日期+1天的需求数量 /// [ExporterHeader(DisplayName = "第2天需求数量")] - public int QuantityDemand2 { get; set; } = 1; + public int QuantityDemand2 { get; set; } =0; /// /// 起始日期+2天的需求数量(以此类推) @@ -876,13 +876,13 @@ namespace TaskManager.Entity /// 删除标识(0=未删除,1=已删除) /// [ExporterHeader(DisplayName = "删除标识")] - public int IsDelete { get; set; } = 1; // 默认已删除(根据原始数据默认值) + public int IsDelete { get; set; } =0; // 默认已删除(根据原始数据默认值) /// /// 数据版本号(乐观锁控制) /// [ExporterHeader(DisplayName = "数据版本号")] - public int Version { get; set; } = 1; + public int Version { get; set; } =0; @@ -1145,7 +1145,7 @@ namespace TaskManager.Entity /// 到货数量 /// [ExporterHeader(DisplayName = "到货数量")] - public int QuantityDelivery { get; set; } = 1; + public int QuantityDelivery { get; set; } =0; /// /// 备注:含批次号信息 @@ -1334,13 +1334,13 @@ namespace TaskManager.Entity /// 是否删除(0:否,1是) /// [ExporterHeader(DisplayName = "删除标记")] - public int IsDelete { get; set; } = 1; + public int IsDelete { get; set; } =0; /// /// 版本号 /// [ExporterHeader(DisplayName = "版本号")] - public int Version { get; set; } = 1; + public int Version { get; set; } =0; @@ -1445,13 +1445,13 @@ namespace TaskManager.Entity /// 是否删除(0:否,1是) /// [ExporterHeader(DisplayName = "删除标记")] - public int IsDelete { get; set; } = 1; + public int IsDelete { get; set; } =0; /// /// 版本号 /// [ExporterHeader(DisplayName = "版本号")] - public int Version { get; set; } = 1; + public int Version { get; set; } =0; @@ -1661,7 +1661,7 @@ namespace TaskManager.Entity /// 数量 /// [ExporterHeader(DisplayName = "数量")] - public int QuantityDelivery { get; set; } = 1; + public int QuantityDelivery { get; set; } =0; /// /// 创建时间 @@ -2093,7 +2093,7 @@ namespace TaskManager.Entity /// 在途数量 /// [ExporterHeader(DisplayName = "在途数量")] - public decimal? QuantityInTransit { get; set; } = 1; + public decimal? QuantityInTransit { get; set; } =0; /// /// 按时到货比(百分比,如:95表示95%) diff --git a/API/Wood.Service/Controllers/CherySupplierConDateService.cs b/API/Wood.Service/Controllers/CherySupplierConDateService.cs index 1364070..f621d30 100644 --- a/API/Wood.Service/Controllers/CherySupplierConDateService.cs +++ b/API/Wood.Service/Controllers/CherySupplierConDateService.cs @@ -9,5 +9,8 @@ namespace TaskManager.Controllers public SupplierConDateService(HttpClient httpClient, JobDbContext jobDbContext, LogController log, IRepository repository) : base(httpClient, jobDbContext, log, repository) { } + + + } } diff --git a/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs b/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs index b64264a..150fc9d 100644 --- a/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs +++ b/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs @@ -1,15 +1,64 @@ -using TaskManager.Contracts.Dtos; +using Magicodes.ExporterAndImporter.Core; +using TaskManager.Contracts.Dtos; using TaskManager.Controllers; using TaskManager.Entity; +using TaskManager.Entity.Entitys; using TaskManager.EntityFramework; -using TaskManager.EntityFramework; +using Z.BulkOperations; + namespace TaskManager.Controllers { + + /// + /// M+6月物料需求计划风险确认 + /// public class CherySupplierMrpMonthService : CheryRecurringJobOutPageController { public CherySupplierMrpMonthService(HttpClient httpClient, JobDbContext jobDbContext, LogController log, IRepository repository) : base(httpClient, jobDbContext, log, repository) { + + } + protected override async Task CreateTaskAsync(List plist, JobDbContext dbContext) + { + var taskId = Guid.NewGuid(); + var task = new TaskSub(); + task.TaskId = taskId; + task.TaskName = TaskName; + task.Subscriber = Client; + task.TableName = "SUPPLIER_CON_MMRP"; + if (plist.Count > 0) + { + List list = new List(); + plist.ForEach(p => + { + var con = new SUPPLIER_CON_MMRP(); + con.SupplierCode = "8EG"; + con.ReleaseEdition = p.ReleaseEdition; + con.MaterialCode = p.MaterialCode; + con.PlantId = p.PlantId; + con.FeedbackResults = "0"; + con.VentureType = "1"; + con.VentureSpecific = "1"; + con.Measures = "1"; + con.StartMonth = p.StartMonth; + con.QuantityMeet1 = p.QuantityDemand1; + con.QuantityMeet2 = p.QuantityDemand2; + con.QuantityMeet3 = p.QuantityDemand3; + con.QuantityMeet4 = p.QuantityDemand4; + con.QuantityMeet5 = p.QuantityDemand5; + con.QuantityMeet6 = p.QuantityDemand6; + con.QuantityMeet7 = p.QuantityDemand7; + con.QuantityMeet8 = p.QuantityDemand8; + con.QuantityMeet9 = p.QuantityDemand9; + con.QuantityMeet10 = p.QuantityDemand10; + con.QuantityMeet11 = p.QuantityDemand11; + con.QuantityMeet12 = p.QuantityDemand12; + list.Add(con); + }); + dbContext.BulkInsert(list, new BulkOperationOptions() { UseTableLock = false }); + } + return; } } }