using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEAWCS_Core.BaseRepository;
|
using WIDESEAWCS_Core.BaseServices;
|
using WIDESEAWCS_Model.Models;
|
|
namespace WIDESEAWCS_BasicInfoService
|
{
|
public class BoxingDetailService : ServiceBase<Dt_BoxingDetail, IRepository<Dt_BoxingDetail>>, IBoxingDetailService
|
{
|
public BoxingDetailService(IRepository<Dt_BoxingDetail> BaseDal) : base(BaseDal)
|
{
|
}
|
|
public IRepository<Dt_BoxingDetail> Repository => BaseDal;
|
|
|
/// <summary>
|
/// 比较零件是否齐全
|
/// </summary>
|
/// <param name="boxingDetails"></param>
|
/// <param name="formulaDetails"></param>
|
/// <returns></returns>
|
public bool IsComponentCodesEqual(List<Dt_BoxingDetail> boxingDetails, List<Dt_FormulaDetail> formulaDetails)
|
{
|
if (boxingDetails == null || formulaDetails == null || boxingDetails.Count != formulaDetails.Count)
|
{
|
return false;
|
}
|
|
List<string> BoxingIdList = new List<string>();
|
List<string> FormulaIdList = new List<string>();
|
|
for (int i = 0; i < boxingDetails.Count; i++)
|
{
|
BoxingIdList.Add(boxingDetails[i].ComponentCode);
|
FormulaIdList.Add(formulaDetails[i].ComponentCode);
|
}
|
BoxingIdList.Sort();
|
FormulaIdList.Sort();
|
|
for (int i = 0; i < BoxingIdList.Count; i++)
|
{
|
if (BoxingIdList[i] != FormulaIdList[i])
|
{
|
return false;
|
}
|
}
|
return true;
|
}
|
}
|
}
|