VisaDeleClientRepository.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using OASystem.Domain;
  2. using OASystem.Domain.Dtos;
  3. using OASystem.Domain.Dtos.UserDto;
  4. using OASystem.Domain.Entities.Customer;
  5. using OASystem.Domain.Entities.Groups;
  6. using OASystem.Domain.ViewModels.CRM;
  7. using OASystem.Domain.ViewModels.Group;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. namespace OASystem.Infrastructure.Repositories.CRM
  14. {
  15. /// <summary>
  16. /// 签证客户 仓库
  17. /// </summary>
  18. public class VisaDeleClientRepository : BaseRepository<Crm_DeleClient, VisaDeleClientView>
  19. {
  20. public VisaDeleClientRepository(SqlSugarClient sqlSugar) :
  21. base(sqlSugar)
  22. { }
  23. /// <summary>
  24. /// 签证客户list
  25. /// </summary>
  26. /// <param name="loginDto"></param>
  27. /// <returns></returns>
  28. public async Task<Result> GetCrmList(DtoBase dto)
  29. {
  30. Result result = new Result() { Code = -2 };
  31. if (dto.PortType == 1 || dto.PortType == 2)
  32. {
  33. string sql = string.Format(@"Select cdc.Id,LastName+FirstName ClientName,ccc.CompanyName,Sex,Marriage,
  34. Phone LandlinePhone,Tel,crmCard1.CertNo IDNo,crmCard2.CertNo PassportNo
  35. From Crm_DeleClient cdc
  36. Left Join Crm_CustomerCompany ccc On cdc.crmCompanyId = ccc.Id
  37. Left Join Crm_CustomerCert crmCard1 On crmCard1.SdId = 773 And cdc.Id = crmCard1.DcId
  38. Left Join Crm_CustomerCert crmCard2 On crmCard2.SdId = 774 And cdc.Id = crmCard2.DcId ");
  39. var clientList = await _sqlSugar.SqlQueryable<VisaDeleClientListView>(sql).ToListAsync();
  40. if (clientList.Count > 0)
  41. {
  42. result.Code = 0;
  43. result.Msg = "成功!";
  44. result.Data = clientList;
  45. }
  46. else
  47. {
  48. result.Msg = "暂无数据!";
  49. }
  50. }
  51. return result;
  52. }
  53. /// <summary>
  54. /// 签证客户操作
  55. /// </summary>
  56. /// <param name="loginDto"></param>
  57. /// <returns></returns>
  58. public async Task<Result> CrmClinetoperation(LoginDto loginDto)
  59. {
  60. Result result = new Result() { Code = -2 };
  61. return result;
  62. }
  63. /// <summary>
  64. /// 签证客户 新增
  65. /// </summary>
  66. /// <param name="loginDto"></param>
  67. /// <returns></returns>
  68. public async Task<int> CrmClinetAdd(Crm_DeleClient client)
  69. {
  70. int addId = -1;
  71. return addId;
  72. }
  73. }
  74. }