zhengqifeng
2025-12-30 e254b1f4efa18b3c84ce75e9da2aeff64a1c7cbe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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;
        }
    }
}