using AutoMapper.Execution;
using OASystem.Domain.ViewModels.CRM;
using Org.BouncyCastle.Asn1.Ocsp;
using Org.BouncyCastle.Asn1.X9;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using static Google.Protobuf.Reflection.SourceCodeInfo.Types;
namespace OASystem.Domain.Dtos.CRM
{
public class NewClientDataQueryDto:DtoBase
{
public int OperationUserId { get; set; }
///
/// 联系人
///
public string Contact { get; set; }
///
/// 地区
///
public string Location { get; set; }
///
/// 单位
///
public string Client { get; set; }
///
/// 负责人
///
public string Userid { get; set; }
///
/// 客户级别(地市州)
///
public int Lvlid { get; set; }
///
/// 业务分类
///
public string Business { get; set; }
///
/// 省域
///
public int Range { get; set; }
///
/// 客户类别
///
public int Category { get; set; }
}
public class NewClientDataExcelDownloadDto : NewClientDataQueryDto
{
public int PageId { get; set; }
}
public class NewClientOpDto:PortDtoBase
{
///
/// 操作状态
/// 1 添加
/// 2 修改
///
public int Status { get; set; }
///
/// 编号
///
public int Id { get; set; }
///
/// 序号
///
public int Number { get; set; }
///
/// 地市州Id
///
public int Lvlid { get; set; }
///
/// 客户单位
///
public string Client { get; set; }
///
/// 权重
///
public string Weight { get; set; }
///
/// 客户单位简写
///
public string Clientshort { get; set; }
///
/// 联系人
///
public string Contact { get; set; }
///
/// 联系人性别
///
public int Gender { get; set; }
///
/// 护照
///
public string Passport { get; set; }
///
/// 护照日期
///
public string PassportDate { get; set; }
///
/// 职位
///
public string Job { get; set; }
///
/// 联系手机号
///
public string Telephone { get; set; }
///
/// 联系座机号
///
public string Phone { get; set; }
///
/// 邮件
///
public string Email { get; set; }
///
/// 所属区域(所在城市)
///
public string Location { get; set; }
///
/// 地址
///
public string Address { get; set; }
///
/// 生日
///
public string Birthday { get; set; }
///
/// 其他信息
///
public string Otherinfo { get; set; }
///
/// 微信
///
public string Wechat { get; set; }
///
/// 分类
///
public int Category { get; set; }
///
/// 预计出团
///
public int Predele { get; set; }
///
/// 已出团
///
public int FinlishedDele { get; set; }
///
/// 创建者Id
///
public int CreateUserId { get; set; }
///
/// 备注
///
public string Remark { get; set; }
///
/// 负责人
///
public List AscribedUser { get; set; }
///
/// 业务归属
///
public List AscribedDepartment { get; set; }
}
///
/// 详情 Dto
///
public class NewClientDataDetailsDto:PortDtoBase
{
public int UserId { get; set; }
public int Id { get; set; }
}
///
/// 批量指派
///
public class BatchAssignmentDto : PortDtoBase
{
public int UserId { get; set; }
///
/// 客户资料表Id集合
///
public List? ClientDataIdItem { get; set; }
///
/// 用户Id集合
///
public List? UserIdItem { get; set; }
}
public class MarketCustomerInitDto : PortDtoBase
{
public int UserId { get; set;}
}
public class QueryClientTypeDto
{
public List SetDataIdArr { get; set; }
}
public class MCRLvSettingDto
{
public List SetDataIdArr { get; set; }
}
public class RemakeComparer : IComparer
{
public int Compare(object x, object y)
{
// 使用反射获取remake属性的值
PropertyInfo xProperty = x.GetType().GetProperty("Remark");
PropertyInfo yProperty = y.GetType().GetProperty("Remark");
if (xProperty == null || yProperty == null)
{
throw new ArgumentException("Both objects must have a 'remake' property.");
}
string xRemake = xProperty.GetValue(x, null) as string;
string yRemake = yProperty.GetValue(y, null) as string;
// 使用TryParse安全地将字符串转换为整数
bool xIsInt = int.TryParse(xRemake, out int xValue);
bool yIsInt = int.TryParse(yRemake, out int yValue);
// 如果x是整数而y不是,则x应该排在y前面
if (xIsInt && !yIsInt)
return -1;
// 如果y是整数而x不是,则x应该排在后面
else if (!xIsInt && yIsInt)
return 1;
// 如果x和y都是整数,则比较它们的值
else if (xIsInt && yIsInt)
return xValue.CompareTo(yValue);
// 如果x和y都不是整数,则认为它们相等
else
return 0;
}
}
}