You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.9 KiB
67 lines
1.9 KiB
using Microsoft.EntityFrameworkCore;
|
|
using TaskManager.Contracts.Dtos;
|
|
using TaskManager.Entity;
|
|
using TaskManager.Entity.Entitys;
|
|
using TaskManager.EntityFramework;
|
|
|
|
namespace TaskManager.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 工艺装备
|
|
/// </summary>
|
|
public class CherySupplierProProcessEquipmentService : CheryRecurringJobInputPageController<SUPPLIER_PRO_PROCESS_EQUIPMENT, SUPPLIER_PRO_PROCESS_EQUIPMENT_DTO, SUPPLIER_PRO_PROCESS_EQUIPMENT_LOGS>
|
|
{
|
|
public CherySupplierProProcessEquipmentService(HttpClient httpClient, JobDbContext jobDbContext, LogController log, IRepository<SUPPLIER_PRO_PROCESS_EQUIPMENT> repository) : base(httpClient, jobDbContext, log, repository)
|
|
{
|
|
|
|
}
|
|
|
|
protected override async Task UpdateAfter(List<SUPPLIER_PRO_PROCESS_EQUIPMENT> list)
|
|
{
|
|
|
|
var infolist = await _jobDbContext.SUPPLIER_PRO_PROCESS_EQUIPMENT.ToListAsync();
|
|
|
|
|
|
var query = from itm in infolist
|
|
join itm1 in list on
|
|
new
|
|
{
|
|
itm.SupplierCode,
|
|
itm.CheryProductNo,
|
|
itm.DeviceCode,
|
|
itm.DeviceType
|
|
}
|
|
equals
|
|
new
|
|
{
|
|
itm1.SupplierCode,
|
|
itm1.CheryProductNo,
|
|
itm1.DeviceCode,
|
|
itm1.DeviceType
|
|
|
|
}
|
|
select itm;
|
|
|
|
|
|
if (query.Any())
|
|
{
|
|
var entities = query.ToList();
|
|
foreach (var entity in entities)
|
|
{
|
|
entity.ReadState = true;
|
|
entity.WriteState = true;
|
|
}
|
|
_jobDbContext.BulkUpdate(entities);
|
|
|
|
|
|
}
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|