DelegationInfoRepository.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. using Newtonsoft.Json;
  2. using OASystem.Domain;
  3. using OASystem.Domain.Dtos;
  4. using OASystem.Domain.Dtos.Financial;
  5. using OASystem.Domain.Dtos.Groups;
  6. using OASystem.Domain.Dtos.UserDto;
  7. using OASystem.Domain.Entities.Groups;
  8. using OASystem.Domain.ViewModels.CRM;
  9. using OASystem.Domain.ViewModels.Financial;
  10. using OASystem.Domain.ViewModels.Groups;
  11. using OASystem.Infrastructure.Repositories.System;
  12. using Org.BouncyCastle.Asn1.Cms;
  13. using Org.BouncyCastle.Utilities.Collections;
  14. using Serilog;
  15. using SqlSugar;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Linq;
  19. using System.Text;
  20. using System.Threading.Tasks;
  21. namespace OASystem.Infrastructure.Repositories.Groups
  22. {
  23. /// <summary>
  24. /// 接团信息
  25. /// </summary>
  26. public class DelegationInfoRepository : BaseRepository<Grp_DelegationInfo, DelegationInfoView>
  27. {
  28. private readonly SetDataRepository _setDataRepository;
  29. private readonly UsersRepository _usersRepository;
  30. private readonly TaskAssignmentRepository _taskAssignmentRep;
  31. //public readonly Logs _logs;
  32. public DelegationInfoRepository(SqlSugarClient sqlSugar, SetDataRepository setDataRepository, UsersRepository usersRepository, TaskAssignmentRepository taskAssignmentRep)
  33. : base(sqlSugar)
  34. {
  35. _setDataRepository = setDataRepository;
  36. _usersRepository = usersRepository;
  37. _taskAssignmentRep = taskAssignmentRep;
  38. }
  39. #region 团组
  40. /// <summary>
  41. /// 获取接团信息 Page List
  42. /// </summary>
  43. /// <param name="dto"></param>
  44. /// <returns></returns>
  45. public async Task<Result> GetGroupPageList(GroupCommissionDto dto)
  46. {
  47. Result result = new Result() { Code = -2, Msg = "未知错误" };
  48. ListViewBase<DelegationPageListView> groupsInfoPageList = new ListViewBase<DelegationPageListView>()
  49. {
  50. ReceiveDt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
  51. };
  52. if (dto.PortType == 1 || dto.PortType == 2) //web
  53. {
  54. int startIndex = (dto.PageIndex - 1) * dto.PageSize + 1;
  55. int endIndex = startIndex + dto.PageSize - 1;
  56. int taskUserId = -1;
  57. string taskGroupIds = string.Empty;
  58. #region 处理用户团组操作权限
  59. if (dto.UserId != -1)
  60. {
  61. }
  62. #endregion
  63. string sql = string.Format(@"Select * From(Select row_number() over (order by gdi.Id Desc) as RowNumber,
  64. gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,
  65. ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,
  66. su.CnName JietuanOperator,IsSure
  67. From Grp_DelegationInfo gdi
  68. Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id
  69. Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
  70. Left Join Sys_Users su On gdi.JietuanOperator = su.Id
  71. Where gdi.IsDel = 0
  72. )temp Where RowNumber Between {0} and {1}", startIndex, endIndex);
  73. string sqlCount = string.Format(@"Select Count(1) as Count From Grp_DelegationInfo gdi
  74. Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id
  75. Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
  76. Left Join Sys_Users su On gdi.JietuanOperator = su.Id
  77. Where gdi.IsDel = 0 ");
  78. List<DelegationPageListView> _DeleInfoList = await _sqlSugar.SqlQueryable<DelegationPageListView>(sql).ToListAsync();
  79. DelegationPageCountView _DeleCount = await _sqlSugar.SqlQueryable<DelegationPageCountView>(sqlCount).FirstAsync();
  80. int count = _DeleCount.Count;
  81. groupsInfoPageList = new ListViewBase<DelegationPageListView>
  82. {
  83. CurrPageIndex = dto.PageIndex,
  84. CurrPageSize = dto.PageSize,
  85. DataCount = count,
  86. DataList = _DeleInfoList
  87. };
  88. result.Code = 0;
  89. result.Msg = "成功!";
  90. result.Data = groupsInfoPageList;
  91. }
  92. return result;
  93. }
  94. /// <summary>
  95. /// 获取接团信息List
  96. /// </summary>
  97. /// <param name="dto"></param>
  98. /// <returns></returns>
  99. public async Task<Result> GetGroupList(GroupListDto dto)
  100. {
  101. Result result = new Result() { Code = -2, Msg = "未知错误" };
  102. if (dto.PortType == 1 || dto.PortType == 2) //web
  103. {
  104. string sql = string.Format(@"Select gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure
  105. From Grp_DelegationInfo gdi
  106. Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id
  107. Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
  108. Left Join Sys_Users su On gdi.JietuanOperator = su.Id
  109. Where gdi.IsDel = 0
  110. Order By gdi.CreateTime Desc");
  111. var _DelegationList = await _sqlSugar.SqlQueryable<DelegationListView>(sql).ToListAsync();
  112. if (_DelegationList.Count > 0)
  113. {
  114. result.Code = 0;
  115. result.Msg = "成功!";
  116. result.Data = _DelegationList;
  117. }
  118. else
  119. {
  120. result.Msg = "暂无该团组信息";
  121. }
  122. }
  123. return result;
  124. }
  125. /// <summary>
  126. /// 获取接团信息Info
  127. /// </summary>
  128. /// <param name="dto"></param>
  129. /// <returns></returns>
  130. public async Task<Result> GetGroupInfo(GroupInfoDto dto)
  131. {
  132. Result result = new Result() { Code = -2, Msg = "未知错误" };
  133. if (dto.PortType == 1 || dto.PortType == 2) //web
  134. {
  135. string sql = string.Format(@"Select Id,SalesQuoteNo,TourCode,JietuanOperator,TeamLevSId,TeamDid,TeamName,ClientName,
  136. ClientUnit,VisitCountry,VisitDate,VisitDays,VisitPNumber,TontractTime,
  137. PayDay,PaymentMoney,VisitPurpose,SpecialNeeds,OtherNeeds,CGRWSPBMMC,CGRWSPWH,
  138. ZZSCBMMC,ZZSCSPWH,Remark,TellPhone
  139. From Grp_DelegationInfo Where Id = {0} And IsDel = 0", dto.Id);
  140. var _DelegationInfo = await _sqlSugar.SqlQueryable<DelegationInfoWebView>(sql).FirstAsync();
  141. if (_DelegationInfo != null)
  142. {
  143. result.Code = 0;
  144. result.Msg = "成功!";
  145. result.Data = _DelegationInfo;
  146. }
  147. else
  148. {
  149. result.Msg = "暂无该团组信息";
  150. }
  151. }
  152. return result;
  153. }
  154. /// <summary>
  155. /// 获取接团信息 编辑
  156. /// 基础 数据源
  157. /// </summary>
  158. /// <param name="dto"></param>
  159. /// <returns></returns>
  160. public async Task<Result> GroupEditBasicSource(GroupListDto dto)
  161. {
  162. Result result = new Result() { Code = -2, Msg = "未知错误" };
  163. try
  164. {
  165. if (dto.PortType == 1 || dto.PortType == 2) //web
  166. {
  167. dynamic? teamTypeData1 = null;
  168. string teamTypeSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = {0} And IsDel = {1}", 10, 0);
  169. var teamTypeData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamTypeSql).ToListAsync(); ; //团组分类 10
  170. if (teamTypeData.Count > 0)
  171. {
  172. teamTypeData1 = teamTypeData;
  173. }
  174. dynamic? teamLevData1 = null;
  175. string teamLevSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = {0} And IsDel = {1}", 56, 0);
  176. var teamLevData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamLevSql).ToListAsync(); ; //团组等级 56
  177. if (teamLevData.Count > 0)
  178. {
  179. teamLevData1 = teamLevData;
  180. }
  181. dynamic? userData1 = null;
  182. string userSql = string.Format(@"Select Id,CnName From Sys_Users Where IsDel = {0}", 0);
  183. var userData = await _sqlSugar.SqlQueryable<UserNameView>(userSql).ToListAsync(); ;
  184. if (userData.Count > 0)
  185. {
  186. userData1 = userData;
  187. }
  188. result.Code = 0;
  189. result.Msg = "成功!";
  190. result.Data = new
  191. {
  192. teamTypeData = teamTypeData1,
  193. teamLevData = teamLevData1,
  194. userData = userData1
  195. };
  196. }
  197. }
  198. catch (Exception)
  199. {
  200. throw;
  201. }
  202. return result;
  203. }
  204. /// <summary>
  205. /// 团组信息操作
  206. /// </summary>
  207. /// <param name="dto"></param>
  208. /// <returns></returns>
  209. public async Task<Result> GroupOperation(GroupOperationDto dto)
  210. {
  211. Result result = new Result() { Code = -2, Msg = "未知错误" };
  212. if (dto.PortType == 1 || dto.PortType == 2) //web
  213. {
  214. if (dto.Status == 1) //添加
  215. {
  216. string selectSql = string.Format(@"Select * From Grp_DelegationInfo
  217. Where IsDel = 0
  218. And TeamName = '{0}'
  219. And ClientName = '{1}'
  220. And ClientUnit ='{2}'
  221. And VisitDate ='{3}'",dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
  222. var selectGroupInfo = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).FirstAsync();
  223. if (selectGroupInfo != null)
  224. {
  225. result.Msg = "数据已存在,请勿重复添加!";
  226. return result;
  227. }
  228. //string teamCodeSql = string.Format("Select SalesQuoteNo From Grp_DelegationInfo");
  229. //var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
  230. //string SalesQuoteNo = "";
  231. //while (true)
  232. //{
  233. // SalesQuoteNo = Tools.CommonFun.GetRandomStr(6);
  234. // if (!teamCodeItem.Equals(SalesQuoteNo))
  235. // {
  236. // break;
  237. // }
  238. //}
  239. Grp_DelegationInfo delegationInfo = new Grp_DelegationInfo()
  240. {
  241. SalesQuoteNo = dto.SalesQuoteNo,
  242. TeamLevSId = dto.TeamLevSId,
  243. ClientName = dto.ClientName,
  244. ClientUnit = dto.ClientUnit,
  245. TeamName = dto.TeamName,
  246. TeamDid = dto.TeamDid,
  247. VisitDate = Convert.ToDateTime(dto.VisitDate),
  248. VisitCountry = dto.VisitCountry,
  249. VisitPurpose = dto.VisitPurpose,
  250. VisitDays = dto.VisitDays,
  251. VisitPNumber = dto.VisitPNumber,
  252. SpecialNeeds = dto.SpecialNeeds,
  253. OtherNeeds = dto.OtherNeeds,
  254. Remark = dto.Remark,
  255. JietuanOperator = dto.UserId,
  256. TellPhone = dto.TellPhone,
  257. CGRWSPBMMC = dto.CGRWSPBMMC,
  258. CGRWSPWH = dto.CGRWSPWH,
  259. ZZSCBMMC = dto.ZZSCBMMC,
  260. ZZSCSPWH = dto.ZZSCSPWH,
  261. TontractTime = Convert.ToDateTime(dto.TontractTime),
  262. PaymentMoney = dto.PaymentMoney,
  263. PayDay = dto.PayDay,
  264. TourCode = "",
  265. SalesDate = DateTime.Now,
  266. IsState = 0, //默认团组未完成 0
  267. JietuanTime = DateTime.Now,
  268. IsDel = 0,
  269. BudgetCost = 0.00M,
  270. HotelComplain = 0,
  271. OPComplain = 0,
  272. OAComplain = 0,
  273. AirComplain = 0,
  274. VisaComplain = 0,
  275. CreateUserId = dto.UserId,
  276. CreateTime = DateTime.Now,
  277. DeleteUserId = null,
  278. DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss")
  279. };
  280. Log.Information("添加:"+ JsonConvert.SerializeObject(delegationInfo));
  281. var addId = await _sqlSugar.Insertable(delegationInfo).ExecuteReturnIdentityAsync();
  282. if (addId > 0)
  283. {
  284. result.Code = 0;
  285. result.Msg = "添加成功!";
  286. }
  287. else
  288. {
  289. result.Msg = "添加失败!";
  290. }
  291. }
  292. else if (dto.Status == 2) //修改
  293. {
  294. var updateStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
  295. {
  296. SalesQuoteNo = dto.SalesQuoteNo,
  297. TeamLevSId = dto.TeamLevSId,
  298. ClientName = dto.ClientName,
  299. ClientUnit = dto.ClientUnit,
  300. TeamName = dto.TeamName,
  301. TeamDid = dto.TeamDid,
  302. VisitDate = Convert.ToDateTime(dto.VisitDate),
  303. VisitCountry = dto.VisitCountry,
  304. VisitPurpose = dto.VisitPurpose,
  305. VisitDays = dto.VisitDays,
  306. VisitPNumber = dto.VisitPNumber,
  307. SpecialNeeds = dto.SpecialNeeds,
  308. OtherNeeds = dto.OtherNeeds,
  309. Remark = dto.Remark,
  310. JietuanOperator = dto.UserId,
  311. TellPhone = dto.TellPhone,
  312. CGRWSPBMMC = dto.CGRWSPBMMC,
  313. CGRWSPWH = dto.CGRWSPWH,
  314. ZZSCBMMC = dto.ZZSCBMMC,
  315. ZZSCSPWH = dto.ZZSCSPWH,
  316. TontractTime = Convert.ToDateTime(dto.TontractTime),
  317. PaymentMoney = dto.PaymentMoney,
  318. PayDay = dto.PayDay
  319. });
  320. if (updateStatus)
  321. {
  322. result.Code = 0;
  323. result.Msg = "修改成功!";
  324. }
  325. else
  326. {
  327. result.Msg = "修改失败!";
  328. }
  329. }
  330. else if (dto.Status == 3) //删除
  331. {
  332. var deleteStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
  333. {
  334. DeleteUserId = dto.UserId,
  335. DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  336. IsDel = 1
  337. });
  338. if (deleteStatus)
  339. {
  340. result.Code = 0;
  341. result.Msg = "删除成功!";
  342. }
  343. else
  344. {
  345. result.Msg = "删除失败!";
  346. }
  347. }
  348. }
  349. return result;
  350. }
  351. /// <summary>
  352. /// 团组信息操作 - 删除
  353. /// </summary>
  354. /// <param name="dto"></param>
  355. /// <returns></returns>
  356. public async Task<Result> GroupDel(GroupDelDto dto)
  357. {
  358. Result result = new Result() { Code = -2, Msg = "未知错误" };
  359. if (dto.PortType == 1 || dto.PortType == 2) //web
  360. {
  361. var deleteStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
  362. {
  363. DeleteUserId = dto.UserId,
  364. DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  365. IsDel = 1
  366. });
  367. if (deleteStatus)
  368. {
  369. result.Code = 0;
  370. result.Msg = "删除成功!";
  371. }
  372. else
  373. {
  374. result.Msg = "删除失败!";
  375. }
  376. }
  377. return result;
  378. }
  379. /// <summary>
  380. /// 获取销售报价号
  381. /// </summary>
  382. /// <returns></returns>
  383. public async Task<Result> GetGroupSalesQuoteNo()
  384. {
  385. Result result = new Result() { Code = -2, Msg = "未知错误" };
  386. string teamCodeSql = string.Format("Select SalesQuoteNo From Grp_DelegationInfo");
  387. var teamCodeItem = await _sqlSugar.SqlQueryable<SalesQuoteNoView>(teamCodeSql).ToListAsync();
  388. string teamCode = "";
  389. while (true)
  390. {
  391. teamCode = Tools.CommonFun.GetRandomAllStr(6);
  392. if (!teamCodeItem.Equals(teamCode))
  393. {
  394. break;
  395. }
  396. }
  397. result.Code = 0;
  398. result.Msg = "成功!";
  399. result.Data = teamCode;
  400. return result;
  401. }
  402. /// <summary>
  403. /// 团组删除
  404. /// </summary>
  405. /// <returns></returns>
  406. public async Task<Result> GroupDeleteById()
  407. {
  408. Result result = new Result() { Code = -2, Msg = "未知错误" };
  409. string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
  410. var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
  411. string teamCode = "";
  412. while (true)
  413. {
  414. teamCode = Tools.CommonFun.GetRandomAllStr(6);
  415. if (!teamCodeItem.Equals(teamCode))
  416. {
  417. break;
  418. }
  419. }
  420. result.Code = 0;
  421. result.Msg = "成功!";
  422. result.Data = teamCode;
  423. return result;
  424. }
  425. /// <summary>
  426. /// 团组确认出团
  427. /// </summary>
  428. /// <returns></returns>
  429. public async Task<Result> ConfirmationGroup(ConfirmationGroupDto dto)
  430. {
  431. Result result = new Result() { Code = -2, Msg = "未知错误" };
  432. string teamCode = "";
  433. if (dto.PortType == 1 || dto.PortType == 2) //web
  434. {
  435. string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
  436. var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
  437. while (true)
  438. {
  439. teamCode = Tools.CommonFun.GetRandomAllStr(6);
  440. if (!teamCodeItem.Equals(teamCode))
  441. {
  442. break;
  443. }
  444. }
  445. var deleteStatus = await UpdateAsync(a => a.Id == dto.GroupId, a => new Grp_DelegationInfo
  446. {
  447. TourCode = teamCode,
  448. GroupsOperator = dto.GroupsOperator,
  449. GroupsTime = DateTime.Now
  450. });
  451. if (deleteStatus)
  452. {
  453. result.Code = 0;
  454. result.Msg = "确认出团成功!";
  455. }
  456. else
  457. {
  458. result.Msg = "确认出团失败!";
  459. }
  460. }
  461. result.Code = 0;
  462. result.Msg = "成功!";
  463. result.Data = teamCode;
  464. return result;
  465. }
  466. /// <summary>
  467. /// 获取接团名称List
  468. /// </summary>
  469. /// <param name="dto"></param>
  470. /// <returns></returns>
  471. public async Task<Result> GetGroupNameList(GroupNameDto dto)
  472. {
  473. Result result = new Result() { Code = -2, Msg = "未知错误" };
  474. if (dto.PortType == 1 || dto.PortType == 2) //web
  475. {
  476. string sql = string.Format(@"Select Id,TeamName GroupName From Grp_DelegationInfo
  477. Where TeamName != '' And IsDel = 0
  478. Order By Id Desc");
  479. var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
  480. if (_groupNameList.Count > 0)
  481. {
  482. result.Code = 0;
  483. result.Msg = "成功!";
  484. result.Data = _groupNameList;
  485. }
  486. else
  487. {
  488. result.Msg = "暂无团组信息";
  489. }
  490. }
  491. return result;
  492. }
  493. /// <summary>
  494. /// 获取接团名称List And 签证国别
  495. /// </summary>
  496. /// <param name="dto"></param>
  497. /// <returns></returns>
  498. public async Task<Result> GetGroupNameAndVisaNationality(GroupNameDto dto)
  499. {
  500. Result result = new Result() { Code = -2, Msg = "未知错误" };
  501. if (dto.PortType == 1 || dto.PortType == 2) //web
  502. {
  503. string sql = string.Format(@"Select Id,TeamName GroupName From Grp_DelegationInfo
  504. Where TeamName != '' And IsDel = 0
  505. Order By Id Desc");
  506. var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
  507. string visaSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = 41 And IsDel = 0");
  508. var _setDataList = await _sqlSugar.SqlQueryable<SetDataInfoView>(visaSql).ToListAsync();
  509. var data = new {
  510. groupNameData = _groupNameList,
  511. visaNationalityData = _setDataList
  512. };
  513. result.Data = data;
  514. result.Code = 0;
  515. }
  516. return result;
  517. }
  518. #endregion
  519. #region 团组&签证
  520. /// <summary>
  521. /// 根据团组Id查询客户
  522. /// </summary>
  523. /// <param name="dto"></param>
  524. /// <returns></returns>
  525. public async Task<Result> GetCrmByGroupId(ClientByGroupIdDto dto)
  526. {
  527. Result result = new Result() { Code = -2 };
  528. if (dto.PortType == 1 || dto.PortType == 2)
  529. {
  530. string sql = string.Format(@"Select gdjc.GrpDCId grpId,cdc.Id,cdc.LastName+cdc.FirstName clientName,cdc.Tel,ccc.CertNo CerdNo
  531. From Grp_DelegationJoinCustomer gdjc
  532. Inner join Crm_DeleClient cdc On gdjc.CrmDCId = cdc.Id
  533. Left Join Crm_CustomerCert ccc On ccc.SdId = 773 And cdc.Id = ccc.DcId
  534. Where gdjc.GrpDCId = {0}", dto.GroupId);
  535. var clientList = await _sqlSugar.SqlQueryable<CrmByGroupIdView>(sql).ToListAsync();
  536. if (clientList.Count > 0)
  537. {
  538. result.Code = 0;
  539. result.Msg = "成功!";
  540. result.Data = clientList;
  541. }
  542. else
  543. {
  544. result.Msg = "暂无数据!";
  545. }
  546. }
  547. return result;
  548. }
  549. #endregion
  550. }
  551. }