34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Dlhis.ScheduledTask.SyncSapInfo.Dto;
|
|
|
|
namespace Dlhis.ScheduledTask.SyncSapInfo.Comparers;
|
|
|
|
/// <summary>
|
|
/// 机构数据比较器
|
|
/// </summary>
|
|
public class SapOrganizationComparer : IEqualityComparer<SapOrganizationItem>
|
|
{
|
|
public bool Equals(SapOrganizationItem x, SapOrganizationItem y)
|
|
{
|
|
if (ReferenceEquals(x, y)) return true;
|
|
if (ReferenceEquals(x, null) || ReferenceEquals(y, null)) return false;
|
|
if (x.GetType() != y.GetType()) return false;
|
|
|
|
return x.BEGDA == y.BEGDA
|
|
&& x.ENDDA == y.ENDDA
|
|
&& x.LANGU == y.LANGU
|
|
&& x.OBJID == y.OBJID
|
|
&& x.STEXT == y.STEXT
|
|
&& x.SOBID == y.SOBID
|
|
&& x.ORGID01 == y.ORGID01
|
|
&& x.ORGID02 == y.ORGID02;
|
|
}
|
|
|
|
public int GetHashCode(SapOrganizationItem obj)
|
|
{
|
|
return obj.BEGDA.SafeGetHashCode() ^ obj.ENDDA.SafeGetHashCode()
|
|
^ obj.LANGU.SafeGetHashCode() ^ obj.OBJID.SafeGetHashCode()
|
|
^ obj.STEXT.SafeGetHashCode() ^ obj.SOBID.SafeGetHashCode()
|
|
^ obj.ORGID01.SafeGetHashCode() ^ obj.ORGID02.SafeGetHashCode();
|
|
}
|
|
}
|