Browse Source

更新版本

master
赵新宇 3 days ago
parent
commit
4402953bfe
  1. 29
      API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs
  2. 2
      API/Wood.Service/Controllers/CherySupplierMrpDataService.cs
  3. 2
      API/Wood.Service/Controllers/CherySupplierMrpMonthService.cs
  4. 2
      API/Wood.Service/Controllers/CherySupplierPoService.cs
  5. 20
      API/Wood.Service/Controllers/LogServices/CherySupplierBomLogsService.cs
  6. 23
      API/Wood.Service/Controllers/LogServices/CherySupplierConDateService.cs
  7. 25
      API/Wood.Service/Controllers/LogServices/CherySupplierConMmrpService.cs
  8. 23
      API/Wood.Service/Controllers/LogServices/CherySupplierConPoService.cs
  9. 21
      API/Wood.Service/Controllers/LogServices/CherySupplierDelStateService.cs
  10. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierEmployeeService.cs
  11. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierInfoService.cs
  12. 22
      API/Wood.Service/Controllers/LogServices/CherySupplierInvDataService.cs
  13. 23
      API/Wood.Service/Controllers/LogServices/CherySupplierMrpDataService.cs
  14. 29
      API/Wood.Service/Controllers/LogServices/CherySupplierMrpMonthService.cs
  15. 22
      API/Wood.Service/Controllers/LogServices/CherySupplierMrpService.cs
  16. 22
      API/Wood.Service/Controllers/LogServices/CherySupplierMrpWarningService.cs
  17. 25
      API/Wood.Service/Controllers/LogServices/CherySupplierPoService.cs
  18. 22
      API/Wood.Service/Controllers/LogServices/CherySupplierPorHSCHEDULService.cs
  19. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProAttachmentDataService.cs
  20. 20
      API/Wood.Service/Controllers/LogServices/CherySupplierProCSCHEDULService.cs
  21. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProCpsService.cs
  22. 18
      API/Wood.Service/Controllers/LogServices/CherySupplierProDataService.cs
  23. 20
      API/Wood.Service/Controllers/LogServices/CherySupplierProEnvironmentService.cs
  24. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProFirstPassyieldService.cs
  25. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProFlawService.cs
  26. 16
      API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialDataService.cs
  27. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProMaterialStockService.cs
  28. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProOeeAchievementRateService.cs
  29. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProOeeTimeDetailsService.cs
  30. 21
      API/Wood.Service/Controllers/LogServices/CherySupplierProPlanService.cs
  31. 19
      API/Wood.Service/Controllers/LogServices/CherySupplierProProcessEquipmentService.cs
  32. 24
      API/Wood.Service/Controllers/LogServices/CherySupplierProProcessService.cs
  33. 27
      API/Wood.Service/Controllers/LogServices/CherySupplierProSchedulingService.cs
  34. 18
      API/Wood.Service/Controllers/LogServices/CherySupplierProStationFirstPassYieldService.cs
  35. 20
      API/Wood.Service/Controllers/LogServices/CherySupplierProTSCHEDULService.cs
  36. 20
      API/Wood.Service/Controllers/LogServices/CherySupplierReturnService.cs
  37. 2
      API/Wood.Service/Controllers/TaskConifgureController.cs
  38. 95
      API/Wood.Service/Controllers/TaskSubService.cs

29
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<TLOGS> logs = new List<TLOGS>();
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<TaskSub>().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<TaskSub>().Update(sub);
_jobDbContext.SaveChanges();
}
}
}
}

2
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} ;

2
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 };
});

2
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};
});

20
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
{
/// <summary>
/// BOM主数据
/// </summary>
public class CherySupplierBomLogService : NormalBaseController<SUPPLIER_BOM_LOGS>
{
public CherySupplierBomLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_BOM_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

23
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
{
/// <summary>
/// 日物料需求计划风险确认
/// </summary>
public class CherySupplierConDatelogService : NormalBaseController<SUPPLIER_CON_DATE_LOGS>
{
public CherySupplierConDatelogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_CON_DATE_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

25
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
{
/// <summary>
/// M+6月物料需求计划风险确认
/// </summary>
public class CherySupplierConMmrpLogService : NormalBaseController<SUPPLIER_CON_MMRP_LOGS>
{
public CherySupplierConMmrpLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_CON_MMRP_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

23
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
{
/// <summary>
/// 采购订单风险确认
/// </summary>
public class CherySupplierConPoLogService : NormalBaseController<SUPPLIER_CON_PO>
{
public CherySupplierConPoLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_CON_PO> repository) : base(context, builder, configuration, repository)
{
}
}
}

21
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
{
/// <summary>
/// 看板送货单
/// </summary>
public class CherySupplierDelStateLogService : NormalBaseController<SUPPLIER_DEL_STATE_LOGS>
{
public CherySupplierDelStateLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_DEL_STATE_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 人员资质信息
/// </summary>
public class CherySupplierEmployeeLogService : NormalBaseController<SUPPLIER_EMPLOYEE_LOGS>
{
public CherySupplierEmployeeLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_EMPLOYEE_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 供应商基础信息
/// </summary>
public class CherySupplierInfoLogService : NormalBaseController<SUPPLIER_INFO_LOGS>
{
public CherySupplierInfoLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_INFO_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

22
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
{
/// <summary>
/// 奇瑞RDC共享库存
/// </summary>
public class SupplierInvDataLogService : NormalBaseController<SUPPLIER_INV_DATA_LOGS>
{
public SupplierInvDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_INV_DATA_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

23
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
{
/// <summary>
/// 日物料需求计划
/// </summary>
public class CherySupplierMrpDatalogService : NormalBaseController<SUPPLIER_MRP_DATE_LOGS>
{
public CherySupplierMrpDatalogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_MRP_DATE_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

29
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
{
/// <summary>
/// M+6月物料需求计划风险
/// </summary>
public class CherySupplierMrpMonthLogService : NormalBaseController<SUPPLIER_MRP_MONTH_LOGS>
{
public CherySupplierMrpMonthLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_MRP_MONTH_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

22
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
{
/// <summary>
/// 日MRP状态监控
/// </summary>
public class CherySupplierMrpLogService : NormalBaseController<SUPPLIER_MRP_STATE_LOGS>
{
public CherySupplierMrpLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_MRP_STATE_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

22
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
{
/// <summary>
/// 日MRP预警推移
/// </summary>
public class CherySupplierMrpWarningLogService : NormalBaseController<SUPPLIER_MRP_WARNING_LOGS>
{
public CherySupplierMrpWarningLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_MRP_WARNING_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

25
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
{
/// <summary>
/// 采购订单
/// </summary>
public class CherySupplierPoLogService : NormalBaseController<SUPPLIER_PO_LOGS>
{
public CherySupplierPoLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PO_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

22
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
{
/// <summary>
/// 过焊装未过总装
/// </summary>
public class CherySupplierPorHSCHEDULLogService : NormalBaseController<SUPPLIER_PRO_HSCHEDUL_LOGS>
{
public CherySupplierPorHSCHEDULLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_HSCHEDUL_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 附件类数据
/// </summary>
public class CherySupplierProAttachmentDataLogService : NormalBaseController<SUPPLIER_PRO_ATTACHMENT_DATA_LOGS>
{
public CherySupplierProAttachmentDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_ATTACHMENT_DATA_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

20
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
{
/// <summary>
/// 排序供货
/// </summary>
public class CherySupplierProCSCHEDULLogService : NormalBaseController<SUPPLIER_PRO_CSCHEDUL_LOGS>
{
public CherySupplierProCSCHEDULLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_CSCHEDUL_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 过程控制项质量数据
/// </summary>
public class CherySupplierProCpsLogService : NormalBaseController<SUPPLIER_PRO_CPS_LOGS>
{
public CherySupplierProCpsLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_CPS_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

18
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
{
/// <summary>
/// 生产过程数据
/// </summary>
public class CherySupplierProDataLogService : NormalBaseController<SUPPLIER_PRO_DATA_LOGS>
{
public CherySupplierProDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_DATA_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

20
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
{
/// <summary>
/// 环境业务数据
/// </summary>
public class CherySupplierProEnvironmentLogService : NormalBaseController<SUPPLIER_PRO_ENVIRONMENT_LOGS>
{
public CherySupplierProEnvironmentLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_ENVIRONMENT_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 产品一次合格率
/// </summary>
public class CherySupplierProFirstPassyieldLogService : NormalBaseController<SUPPLIER_PRO_FIRST_PASSYIELD_LOGS>
{
public CherySupplierProFirstPassyieldLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_FIRST_PASSYIELD_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 缺陷业务数据
/// </summary>
public class CherySupplierProFlawLogService : NormalBaseController<SUPPLIER_PRO_FLAW_LOGS>
{
public CherySupplierProFlawLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_FLAW_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

16
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<SUPPLIER_PRO_MATERIAL_DATA_LOGS>
{
public CherySupplierProMaterialDataLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_MATERIAL_DATA_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 来料检验数据
/// </summary>
public class SupplierProMaterialStockLogService : NormalBaseController<SUPPLIER_PRO_MATERIAL_STOCK_LOGS>
{
public SupplierProMaterialStockLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_MATERIAL_STOCK_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 设备OEE达成率
/// </summary>
public class CherySupplierProOeeAchievementRateLogService : NormalBaseController<SUPPLIER_PRO_OEE_ACHIEVEMENT_RATE_LOGS>
{
public CherySupplierProOeeAchievementRateLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_OEE_ACHIEVEMENT_RATE_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// OEE时间明细
/// </summary>
public class CherySupplierProOeeTimeDetailsLogService : NormalBaseController<SUPPLIER_PRO_OEE_TIME_DETAILS_LOGS>
{
public CherySupplierProOeeTimeDetailsLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_OEE_TIME_DETAILS_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

21
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
{
//整车月度生产计划
/// <summary>
/// 整车月度生产计划
/// </summary>
public class SupplierProPlaningLogService : NormalBaseController<SUPPLIER_PRO_PLANING_LOGS>
{
public SupplierProPlaningLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_PLANING_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

19
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
{
/// <summary>
/// 工艺装备
/// </summary>
public class CherySupplierProProcessEquipmentLogService : NormalBaseController<SUPPLIER_PRO_PROCESS_EQUIPMENT_LOGS>
{
public CherySupplierProProcessEquipmentLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_PROCESS_EQUIPMENT_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

24
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
{
/// <summary>
/// 工艺
/// </summary>
public class CherySupplierProProcessLogService : NormalBaseController<SUPPLIER_PRO_PROCESS_LOGS>
{
public CherySupplierProProcessLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_PROCESS_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

27
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
{
/// <summary>
/// 排产数据
/// </summary>
public class CherySupplierProSchedulingLogService : NormalBaseController<SUPPLIER_PRO_SCHEDULING_LOGS>
{
public CherySupplierProSchedulingLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_SCHEDULING_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

18
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
{
/// <summary>
/// 工位一次合格率
/// </summary>
public class CherySupplierProStationFirstPassyieldLogService : NormalBaseController<SUPPLIER_PRO_STATION_FIRST_PASSYIELD_LOGS>
{
public CherySupplierProStationFirstPassyieldLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_STATION_FIRST_PASSYIELD_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

20
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
{
/// <summary>
/// 过涂装未过总装
/// </summary>
public class CherySupplierProTSCHEDULLogService : NormalBaseController<SUPPLIER_PRO_TSCHEDUL_LOGS>
{
public CherySupplierProTSCHEDULLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_PRO_TSCHEDUL_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

20
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
{
/// <summary>
/// 退货单
/// </summary>
public class CherySupplierReturnLogService : NormalBaseController<SUPPLIER_RETURN_LOGS>
{
public CherySupplierReturnLogService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<SUPPLIER_RETURN_LOGS> repository) : base(context, builder, configuration, repository)
{
}
}
}

2
API/Wood.Service/Controllers/TaskConifgureController.cs

@ -173,7 +173,7 @@ namespace TaskManager.Controllers
switch (task.TaskName)
{
case "来料检验数据":
RecurringJob.AddOrUpdate<SupplierProMaterialStockService>(
RecurringJob.AddOrUpdate<SupplierProMaterialStockLogService>(
task.TaskName,
x => ((IDoExecute)x).ExecuteAsync(url, path, task.TaskName, client,pagesize),
task.Corn,

95
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<TaskSub> repository) : base(context, builder, configuration, repository)
private readonly LogController _log;
public TaskSubService(JobDbContext context, IServiceProvider builder, IConfiguration configuration, IRepository<TaskSub> repository, LogController log) : base(context, builder, configuration, repository)
{
_log = log;
}
//private async Task<PagedResult<T>> GetDataPagedAsync<T,TService,TDTO>(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<CherySupplierProFirstPassyieldService>();
@ -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<CherySupplierProStationFirstPassyieldService>();
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<CherySupplierProFlawService>();
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<CherySupplierProMaterialDataService>();
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<CherySupplierProProcessService>();
var processtask = requestInputBase.Condition.Filters.FirstOrDefault(p => p.Column == "TableName");
@ -205,6 +210,71 @@ namespace Wood.Service.Controllers
}
return Ok();
}
/// <summary>
/// 撤销风险确认任务
/// </summary>
/// <param name="taskId"></param>
/// <returns></returns>
[HttpGet]
public async Task<ActionResult> CancelTask(Guid taskId)
{
var task = _context.TaskSub.FirstOrDefault(p => p.TaskId == taskId && p.WriteState == true && p.FailedCount > 0);
var list = new List<string>() {
"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>("SUPPLIER_CON_MMRP", taskId,task.TaskName);
break;
case "SUPPLIER_CON_DATE"://日物料需求计划风险确认
await CancelTask<SUPPLIER_CON_DATE>("SUPPLIER_CON_DATE", taskId, task.TaskName);
break;
case "SUPPLIER_CON_PO"://采购订单风险确认
await CancelTask<SUPPLIER_CON_PO>("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<T>(string tablename, Guid taskId,string taskname) where T : CherryWriteBaseEnity, new()
{
try
{
var mmrplist = _context.Database.GetDbConnection().Query<T>($"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
}

Loading…
Cancel
Save