You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using SlnMesnac.Model.domain;
|
|
|
|
|
using SlnMesnac.Repository.service.@base;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.Repository.service.Impl
|
|
|
|
|
{
|
|
|
|
|
public class ProdPlanExecuteUserServiceImpl: BaseServiceImpl<ProdPlanExecuteUser>, ProdPlanExecuteUserService
|
|
|
|
|
{
|
|
|
|
|
private ILogger<ProdPlanExecuteUserServiceImpl> _logger;
|
|
|
|
|
public ProdPlanExecuteUserServiceImpl(Repository<ProdPlanExecuteUser> repository, ILogger<ProdPlanExecuteUserServiceImpl> logger) : base(repository)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据计划号和批次号删除所有执行信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="planCode"></param>
|
|
|
|
|
/// <param name="batch"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public bool DeleteByPlanCodeAndTheBatchNumber(string planCode, int batch)
|
|
|
|
|
{
|
|
|
|
|
bool result = false;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<ProdPlanExecuteUser> prodPlanExecuteUsers = _rep.AsQueryable().Where(x => x.PlanCode == planCode && x.BatchNumber == batch).ToList();
|
|
|
|
|
foreach (var execute in prodPlanExecuteUsers)
|
|
|
|
|
{
|
|
|
|
|
_rep.Delete(execute);
|
|
|
|
|
}
|
|
|
|
|
result = true;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"根据计划编号删指定锅数的数据异常{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|