diff --git a/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs b/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs index a9a3194..ffcefbf 100644 --- a/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs +++ b/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs @@ -12,6 +12,7 @@ using Microsoft.Extensions.DependencyInjection; using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using Omu.ValueInjecter; using SkiaSharp; +using SqlSugar; using System.ComponentModel.DataAnnotations; using System.Data; using System.Drawing.Printing; @@ -207,6 +208,8 @@ namespace TaskManager.Controllers sub.DataCount = total; int totalPages = (int)Math.Ceiling((double)total / pageSize); int startPage = sub.SyncedPageCount == 0 ? 1 : sub.SyncedPageCount; + + int errorNumber = 0; for (int i = startPage; i <= totalPages; i++) { var records = entites.Skip((i - 1) * pageSize) @@ -238,22 +241,27 @@ namespace TaskManager.Controllers { await _logger.AddSuccess($"第 {i} 页奇瑞数据保存成功", TaskName, sub.TaskId, version); _jobDbContext.BulkUpdate(records, options => options.UseTableLock = true); - - + List logs = new List(); + foreach (var itm in records) + { + TLOGS entity = new TLOGS(); + logs.Add(entity); + } + _jobDbContext.BulkInsert(logs, options => options.UseTableLock = true); sub.SyncedPageCount = i; if (i == totalPages) { sub.WriteState = true; _jobDbContext.Set().Update(sub); _jobDbContext.SaveChanges(); - await _logger.AddSuccess($"奇瑞数{sub.TaskId}任务完成据保存成功", TaskName, sub.TaskId, version); + await _logger.AddSuccess($"奇瑞{sub.TaskId}任务完成据保存成功", TaskName, sub.TaskId, version); } } else { - sub.FailedCount = i * pageSize; - sub.FailedInfo = $"第 {i} 页奇瑞数据保存失败 {result.message}。"; - + //sub.FailedCount = i * pageSize; + //sub.FailedInfo = $"第 {i} 页奇瑞数据保存失败 {result.message}。"; + errorNumber++; string inputjson = string.Empty; if (TaskName == "日物料需求计划风险确认")//格式特殊处理 { @@ -291,6 +299,15 @@ namespace TaskManager.Controllers await _logger.AddError($"第 {i} 页奇瑞数据保存失败 {result.message}。", TaskName, sub.TaskId, version,inputjson); } } + if (errorNumber> 0) + { + await _logger.AddError($"奇瑞{sub.TaskId}任务失败,请检查数据。", TaskName, sub.TaskId, version); + sub.FailedCount = errorNumber * pageSize; + sub.FailedInfo = $"奇瑞{sub.TaskId}任务失败,请检查数据。"; + sub.WriteState = true; + _jobDbContext.Set().Update(sub); + _jobDbContext.SaveChanges(); + } } } } diff --git a/API/Wood.Service/Controllers/CherySupplierMrpDataService.cs b/API/Wood.Service/Controllers/CherySupplierMrpDataService.cs index bfd8c6b..92635c4 100644 --- a/API/Wood.Service/Controllers/CherySupplierMrpDataService.cs +++ b/API/Wood.Service/Controllers/CherySupplierMrpDataService.cs @@ -72,7 +72,7 @@ namespace TaskManager.Controllers await dbContext.BulkMergeAsync(list, options => { options.Transaction = dbTransaction; options.UseTableLock = false; - options.ColumnPrimaryKeyExpression = p => p.Id ; + options.ColumnPrimaryKeyExpression = p =>new { p.Id, p.ReadState} ; diff --git a/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs b/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs index c240903..9680506 100644 --- a/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs +++ b/API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs @@ -76,7 +76,7 @@ namespace TaskManager.Controllers await dbContext.BulkMergeAsync(list, options=> { options.Transaction = dbTransaction; options.UseTableLock = false; - options.ColumnPrimaryKeyExpression = p => p.Id; + options.ColumnPrimaryKeyExpression = p =>new { p.Id, p.ReadState }; }); diff --git a/API/Wood.Service/Controllers/CherySupplierPoService.cs b/API/Wood.Service/Controllers/CherySupplierPoService.cs index b3ba35b..7f15891 100644 --- a/API/Wood.Service/Controllers/CherySupplierPoService.cs +++ b/API/Wood.Service/Controllers/CherySupplierPoService.cs @@ -43,7 +43,7 @@ namespace TaskManager.Controllers await dbContext.BulkMergeAsync(list, options => { options.Transaction = dbTransaction; options.UseTableLock = false; - options.ColumnPrimaryKeyExpression = p => p.Id; + options.ColumnPrimaryKeyExpression = p => new { p.Id, p.ReadState}; }); diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierBomLogsService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierBomLogsService.cs new file mode 100644 index 0000000..63626ec --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierBomLogsService.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.Configuration; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Information; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// BOM主数据 + /// + public class CherySupplierBomLogService : NormalBaseController + { + public CherySupplierBomLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierConDateService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierConDateService.cs new file mode 100644 index 0000000..f70b98c --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierConDateService.cs @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.Configuration; +using System.Collections.Generic; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 日物料需求计划风险确认 + /// + public class CherySupplierConDatelogService : NormalBaseController + { + public CherySupplierConDatelogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierConMmrpService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierConMmrpService.cs new file mode 100644 index 0000000..135f5da --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierConMmrpService.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.Configuration; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; +using Org.BouncyCastle.Bcpg.Sig; +using SkiaSharp; +using System.Xml; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// M+6月物料需求计划风险确认 + /// + public class CherySupplierConMmrpLogService : NormalBaseController + { + public CherySupplierConMmrpLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierConPoService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierConPoService.cs new file mode 100644 index 0000000..8b16d8b --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierConPoService.cs @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.Configuration; +using System.Collections.Generic; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 采购订单风险确认 + /// + public class CherySupplierConPoLogService : NormalBaseController + { + public CherySupplierConPoLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierDelStateService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierDelStateService.cs new file mode 100644 index 0000000..4dd843a --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierDelStateService.cs @@ -0,0 +1,21 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; + +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 看板送货单 + /// + public class CherySupplierDelStateLogService : NormalBaseController + { + public CherySupplierDelStateLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierEmployeeService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierEmployeeService.cs new file mode 100644 index 0000000..358c41d --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierEmployeeService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 人员资质信息 + /// + public class CherySupplierEmployeeLogService : NormalBaseController + { + public CherySupplierEmployeeLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierInfoService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierInfoService.cs new file mode 100644 index 0000000..ad0f51c --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierInfoService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 供应商基础信息 + /// + public class CherySupplierInfoLogService : NormalBaseController + { + public CherySupplierInfoLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierInvDataService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierInvDataService.cs new file mode 100644 index 0000000..55a64f0 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierInvDataService.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + + +namespace TaskManager.Controllers +{ + + /// + /// 奇瑞RDC共享库存 + /// + public class SupplierInvDataLogService : NormalBaseController + { + public SupplierInvDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierMrpDataService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpDataService.cs new file mode 100644 index 0000000..ec3e147 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpDataService.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.Configuration; +using System.Data.Common; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + + /// + /// 日物料需求计划 + /// + public class CherySupplierMrpDatalogService : NormalBaseController + { + public CherySupplierMrpDatalogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierMrpMonthService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpMonthService.cs new file mode 100644 index 0000000..eeac838 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpMonthService.cs @@ -0,0 +1,29 @@ +using Magicodes.ExporterAndImporter.Core; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using System.Data.Common; +using System.Linq.Dynamic.Core; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; +using Z.BulkOperations; +using Z.EntityFramework.Extensions; + + +namespace TaskManager.Controllers +{ + + /// + /// M+6月物料需求计划风险 + /// + public class CherySupplierMrpMonthLogService : NormalBaseController + { + public CherySupplierMrpMonthLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierMrpService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpService.cs new file mode 100644 index 0000000..4685f36 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpService.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + + /// + /// 日MRP状态监控 + /// + public class CherySupplierMrpLogService : NormalBaseController + { + public CherySupplierMrpLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierMrpWarningService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpWarningService.cs new file mode 100644 index 0000000..04b36db --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierMrpWarningService.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + + +namespace TaskManager.Controllers +{ + + /// + /// 日MRP预警推移 + /// + public class CherySupplierMrpWarningLogService : NormalBaseController + { + public CherySupplierMrpWarningLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierPoService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierPoService.cs new file mode 100644 index 0000000..bdd0bab --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierPoService.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.Configuration; +using System.Data.Common; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + + +namespace TaskManager.Controllers +{ + /// + /// 采购订单 + /// + public class CherySupplierPoLogService : NormalBaseController + { + public CherySupplierPoLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } + + + +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierPorHSCHEDULService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierPorHSCHEDULService.cs new file mode 100644 index 0000000..2267abf --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierPorHSCHEDULService.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + + /// + /// 过焊装未过总装 + /// + public class CherySupplierPorHSCHEDULLogService : NormalBaseController + { + public CherySupplierPorHSCHEDULLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } + +} + diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProAttachmentDataService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProAttachmentDataService.cs new file mode 100644 index 0000000..9db460e --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProAttachmentDataService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 附件类数据 + /// + public class CherySupplierProAttachmentDataLogService : NormalBaseController + { + public CherySupplierProAttachmentDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProCSCHEDULService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProCSCHEDULService.cs new file mode 100644 index 0000000..6a78603 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProCSCHEDULService.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + + +namespace TaskManager.Controllers +{ + /// + /// 排序供货 + /// + public class CherySupplierProCSCHEDULLogService : NormalBaseController + { + public CherySupplierProCSCHEDULLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProCpsService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProCpsService.cs new file mode 100644 index 0000000..02f9d92 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProCpsService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 过程控制项质量数据 + /// + public class CherySupplierProCpsLogService : NormalBaseController + { + public CherySupplierProCpsLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProDataService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProDataService.cs new file mode 100644 index 0000000..b80d840 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProDataService.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 生产过程数据 + /// + public class CherySupplierProDataLogService : NormalBaseController + { + public CherySupplierProDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProEnvironmentService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProEnvironmentService.cs new file mode 100644 index 0000000..bd8c6e6 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProEnvironmentService.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 环境业务数据 + /// + public class CherySupplierProEnvironmentLogService : NormalBaseController + { + public CherySupplierProEnvironmentLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } + +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProFirstPassyieldService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProFirstPassyieldService.cs new file mode 100644 index 0000000..dbb4d60 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProFirstPassyieldService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 产品一次合格率 + /// + public class CherySupplierProFirstPassyieldLogService : NormalBaseController + { + public CherySupplierProFirstPassyieldLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProFlawService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProFlawService.cs new file mode 100644 index 0000000..a5f9df6 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProFlawService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 缺陷业务数据 + /// + public class CherySupplierProFlawLogService : NormalBaseController + { + public CherySupplierProFlawLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialDataService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialDataService.cs new file mode 100644 index 0000000..c9ccc00 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialDataService.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + public class CherySupplierProMaterialDataLogService : NormalBaseController + { + public CherySupplierProMaterialDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialStockService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialStockService.cs new file mode 100644 index 0000000..7830858 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialStockService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 来料检验数据 + /// + public class SupplierProMaterialStockLogService : NormalBaseController + { + public SupplierProMaterialStockLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProOeeAchievementRateService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProOeeAchievementRateService.cs new file mode 100644 index 0000000..b15aacf --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProOeeAchievementRateService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 设备OEE达成率 + /// + public class CherySupplierProOeeAchievementRateLogService : NormalBaseController + { + public CherySupplierProOeeAchievementRateLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProOeeTimeDetailsService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProOeeTimeDetailsService.cs new file mode 100644 index 0000000..2ca8e50 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProOeeTimeDetailsService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// OEE时间明细 + /// + public class CherySupplierProOeeTimeDetailsLogService : NormalBaseController + { + public CherySupplierProOeeTimeDetailsLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProPlanService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProPlanService.cs new file mode 100644 index 0000000..4297f74 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProPlanService.cs @@ -0,0 +1,21 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + //整车月度生产计划 + /// + /// 整车月度生产计划 + /// + public class SupplierProPlaningLogService : NormalBaseController + { + public SupplierProPlaningLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProProcessEquipmentService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProProcessEquipmentService.cs new file mode 100644 index 0000000..d8afd9e --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProProcessEquipmentService.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 工艺装备 + /// + public class CherySupplierProProcessEquipmentLogService : NormalBaseController + { + public CherySupplierProProcessEquipmentLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProProcessService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProProcessService.cs new file mode 100644 index 0000000..c95ca10 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProProcessService.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; + +namespace Wood.Service.Controllers +{ + /// + /// 工艺 + /// + public class CherySupplierProProcessLogService : NormalBaseController + { + public CherySupplierProProcessLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProSchedulingService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProSchedulingService.cs new file mode 100644 index 0000000..20995a3 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProSchedulingService.cs @@ -0,0 +1,27 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.Entity.Entitys; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 排产数据 + /// + public class CherySupplierProSchedulingLogService : NormalBaseController + { + public CherySupplierProSchedulingLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} + + + + + + + + diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProStationFirstPassYieldService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProStationFirstPassYieldService.cs new file mode 100644 index 0000000..64b3114 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProStationFirstPassYieldService.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Entity; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + /// + /// 工位一次合格率 + /// + public class CherySupplierProStationFirstPassyieldLogService : NormalBaseController + { + public CherySupplierProStationFirstPassyieldLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierProTSCHEDULService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierProTSCHEDULService.cs new file mode 100644 index 0000000..de52c64 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierProTSCHEDULService.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + + /// + /// 过涂装未过总装 + /// + public class CherySupplierProTSCHEDULLogService : NormalBaseController + { + public CherySupplierProTSCHEDULLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/LogServices/CherySupplierReturnService.cs b/API/Wood.Service/Controllers/LogServices/CherySupplierReturnService.cs new file mode 100644 index 0000000..9bb49b3 --- /dev/null +++ b/API/Wood.Service/Controllers/LogServices/CherySupplierReturnService.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.Configuration; +using TaskManager.Contracts.Dtos; +using TaskManager.Controllers; +using TaskManager.Entity; +using TaskManager.EntityFramework; +using Wood.Service.Controllers; + +namespace TaskManager.Controllers +{ + + /// + /// 退货单 + /// + public class CherySupplierReturnLogService : NormalBaseController + { + public CherySupplierReturnLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + { + } + } +} diff --git a/API/Wood.Service/Controllers/TaskConifgureController.cs b/API/Wood.Service/Controllers/TaskConifgureController.cs index 7c1aa47..33371ab 100644 --- a/API/Wood.Service/Controllers/TaskConifgureController.cs +++ b/API/Wood.Service/Controllers/TaskConifgureController.cs @@ -173,7 +173,7 @@ namespace TaskManager.Controllers switch (task.TaskName) { case "来料检验数据": - RecurringJob.AddOrUpdate( + RecurringJob.AddOrUpdate( task.TaskName, x => ((IDoExecute)x).ExecuteAsync(url, path, task.TaskName, client,pagesize), task.Corn, diff --git a/API/Wood.Service/Controllers/TaskSubService.cs b/API/Wood.Service/Controllers/TaskSubService.cs index 8568892..d0beaaa 100644 --- a/API/Wood.Service/Controllers/TaskSubService.cs +++ b/API/Wood.Service/Controllers/TaskSubService.cs @@ -1,5 +1,7 @@ -using Hangfire; +using Dapper; +using Hangfire; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System; @@ -8,9 +10,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Web; using TaskManager.Contracts.Dtos; using TaskManager.Controllers; using TaskManager.Entity; +using TaskManager.Entity.Entitys; using TaskManager.EntityFramework; using TaskManager.EntityFramework.Repository; using Wood.Util.Filters; @@ -25,9 +29,10 @@ namespace Wood.Service.Controllers { - - public TaskSubService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository) : base(context, builder, configuration, repository) + private readonly LogController _log; + public TaskSubService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository repository, LogController log) : base(context, builder, configuration, repository) { + _log = log; } //private async Task> GetDataPagedAsync(RequestInputBase input) @@ -106,7 +111,7 @@ namespace Wood.Service.Controllers requestInputBase.Condition.Filters.Remove(datatask); var dataresult = await dataservice.GetTaskDataPaged(requestInputBase); return Ok(dataresult); - + case "SUPPLIER_PRO_FIRST_PASSYIELD"://产品一次合格率 var passyieldservice = _builder.GetRequiredService(); @@ -115,14 +120,14 @@ namespace Wood.Service.Controllers var passyieldresult = await passyieldservice.GetTaskDataPaged(requestInputBase); return Ok(passyieldresult); - + case "SUPPLIER_PRO_STATION_FIRST_PASSYIELD"://工位一次合格率 var pasyservice = _builder.GetRequiredService(); var pasytask = requestInputBase.Condition.Filters.FirstOrDefault(p => p.Column == "TableName"); requestInputBase.Condition.Filters.Remove(pasytask); var pasyresult = await pasyservice.GetTaskDataPaged(requestInputBase); return Ok(pasyresult); - + case "SUPPLIER_PRO_FLAW"://缺陷业务数据 var flawservice = _builder.GetRequiredService(); var flawtask = requestInputBase.Condition.Filters.FirstOrDefault(p => p.Column == "TableName"); @@ -150,7 +155,7 @@ namespace Wood.Service.Controllers requestInputBase.Condition.Filters.Remove(detailtask); var detailresult = await detailservice.GetTaskDataPaged(requestInputBase); return Ok(detailresult); - + case "SUPPLIER_PRO_MATERIAL_DATA"://物料主数据 var materialservice = _builder.GetRequiredService(); var materialtask = requestInputBase.Condition.Filters.FirstOrDefault(p => p.Column == "TableName"); @@ -171,7 +176,7 @@ namespace Wood.Service.Controllers requestInputBase.Condition.Filters.Remove(eqtask); var eqresult = await eqservice.GetTaskDataPaged(requestInputBase); return Ok(eqresult); - + case "SUPPLIER_PRO_PROCESS"://工艺 var processservice = _builder.GetRequiredService(); var processtask = requestInputBase.Condition.Filters.FirstOrDefault(p => p.Column == "TableName"); @@ -205,6 +210,71 @@ namespace Wood.Service.Controllers } return Ok(); } + /// + /// 撤销风险确认任务 + /// + /// + /// + [HttpGet] + public async Task CancelTask(Guid taskId) + { + var task = _context.TaskSub.FirstOrDefault(p => p.TaskId == taskId && p.WriteState == true && p.FailedCount > 0); + var list = new List() { + "M+6月物料需求计划风险确认", + "日物料需求计划风险确认", + "采购订单风险确认" + }; + if (!list.Contains(task.TaskName) && task.FailedCount == 0) + { + return new JsonResult(new { code = 400, message = "任务不是失败任务或不是风险确认单,不能取消 " }); + } + switch (task.TableName) + { + case "SUPPLIER_CON_MMRP"://M+6月物料需求计划风险确认 + await CancelTask("SUPPLIER_CON_MMRP", taskId,task.TaskName); + break; + case "SUPPLIER_CON_DATE"://日物料需求计划风险确认 + await CancelTask("SUPPLIER_CON_DATE", taskId, task.TaskName); + break; + case "SUPPLIER_CON_PO"://采购订单风险确认 + await CancelTask("SUPPLIER_CON_MMRP", taskId, task.TaskName); + break; + } + task.FailedInfo = "取消成功,失败记录已经还原到业务数据,重新填写!"; + _context.TaskSub.Update(task); + _context.SaveChanges(); + + + + return new JsonResult(new { code = 200, message = "取消成功!" }); + } + private async Task CancelTask(string tablename, Guid taskId,string taskname) where T : CherryWriteBaseEnity, new() + { + try + { + var mmrplist = _context.Database.GetDbConnection().Query($"select * from {tablename} where taskid='{taskId}' and writestate=0"); + foreach (var item in mmrplist) + { + item.ReadState = false; + } + await _context.BulkUpdateAsync(mmrplist); + + } + catch (Exception ex) + { + + await _log.AddError($"撤销任务风险确认任务{taskId}失败,原因:{ex.Message}", taskname, taskId, DateTime.Now.ToString("yyyyMMdd")); + + } + + } + + + + + + + } @@ -213,5 +283,12 @@ namespace Wood.Service.Controllers - + + + + + + + + }