ProjectsService.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. using Microsoft.AspNetCore.Http.Metadata;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Qiniu.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Linq.Expressions;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using ZhonTai.Admin.Core.Attributes;
  11. using ZhonTai.Admin.Core.Configs;
  12. using ZhonTai.Admin.Core.Consts;
  13. using ZhonTai.Admin.Core.Dto;
  14. using ZhonTai.Admin.Domain.User;
  15. using ZhonTai.Admin.Repositories.Project;
  16. using ZhonTai.Admin.Repositories.ProjectLink;
  17. using ZhonTai.Admin.Services.DiTuiAPI.Dto;
  18. using ZhonTai.Admin.Services.Notice.Dto;
  19. using ZhonTai.Admin.Services.Project;
  20. using ZhonTai.Admin.Services.ProjectLink.Dto;
  21. using ZhonTai.DynamicApi;
  22. using ZhonTai.DynamicApi.Attributes;
  23. namespace ZhonTai.Admin.Services.DiTuiAPI
  24. {
  25. /// <summary>
  26. /// 项目接口
  27. /// </summary>
  28. [DynamicApi(Area = AdminConsts.DiTuiName)]
  29. //public class DiTuiAPIService : BaseService, IDiTuiAPIService, IDynamicApi
  30. public class ProjectsService : BaseService, IProjectsService, IDynamicApi
  31. {
  32. private ProjectLinkRepository _ProjectLinkRepository;
  33. private ProjectRepository _projectRepository;
  34. private ProjectPriceRepository _projectPriceRepository;
  35. private ProjectStatRepository _projectStatRepository;
  36. private ProjectConfigRepository _projectConfigRepository;
  37. public ProjectsService(
  38. ProjectLinkRepository projectLinkRepository,
  39. ProjectRepository projectRepository,
  40. ProjectPriceRepository projectPriceRepository,
  41. ProjectStatRepository projectStatRepository,
  42. ProjectConfigRepository projectConfigRepository)
  43. {
  44. _ProjectLinkRepository = projectLinkRepository;
  45. _projectRepository = projectRepository;
  46. _projectPriceRepository = projectPriceRepository;
  47. _projectStatRepository = projectStatRepository;
  48. _projectConfigRepository = projectConfigRepository;
  49. }
  50. /// <summary>
  51. /// 我的项目
  52. /// </summary>
  53. /// <returns></returns>
  54. [HttpGet]
  55. [NoOprationLog]
  56. public async Task<MyProjectOutput> MyProjectAsync()
  57. {
  58. MyProjectOutput myProjectOutput = new MyProjectOutput();
  59. var linkList = _ProjectLinkRepository.Select
  60. .DisableGlobalFilter(FilterNames.Tenant)
  61. .Where(a => a.ModifiedUserId == User.Id)
  62. .GroupBy(m => new { m.ProjectId, m.Company })
  63. .ToList(m => new ProjectLinkManagePageOutput()
  64. {
  65. ProjectId = m.Key.ProjectId,
  66. Company = m.Key.Company,
  67. Count = m.Count(),
  68. UseCount = m.Sum(m.Value.IsUse == 1 ? 1 : 0),
  69. ProjectName = ""
  70. });
  71. var priceList = await _projectConfigRepository.Select
  72. .Where(m=> m.EffectDate < DateTime.Now)
  73. .OrderByDescending(m => m.DrawAmount)
  74. //.GroupBy(m => m.ProjectId)
  75. .ToListAsync(
  76. m => new
  77. {
  78. ProjectId = m.ProjectId,
  79. ProjectPriceId = m.ProjectPriceId,
  80. DrawAmount = m.DrawAmount,
  81. EffectDate = m.EffectDate,
  82. });
  83. var listProjectId = linkList.Select(m => m.ProjectId).Distinct().ToList();
  84. if (listProjectId.Count() > 0)
  85. {
  86. var listProject = await _projectRepository.Select.DisableGlobalFilter(FilterNames.Tenant).Where(m => listProjectId.Contains(m.Id)).ToListAsync(m => new MyProject(
  87. m.Id,
  88. m.Name,
  89. m.Logo,
  90. //m.MaxPrice.ToString(),
  91. "",
  92. "T+" + m.SettleDay.ToString() + "结算"
  93. ));
  94. foreach(var projectItem in listProject)
  95. {
  96. var maxPrice = await _projectPriceRepository
  97. .Select
  98. .DisableGlobalFilter(FilterNames.Tenant)
  99. .Where(m => m.ProjectId == projectItem.Id)
  100. .OrderByDescending(m => m.Price)
  101. .FirstAsync(m => new
  102. {
  103. ProjectPriceId = m.Id,
  104. ProjectPrice = m.Price
  105. });
  106. var priceConfig = await _projectConfigRepository
  107. .Select
  108. .DisableGlobalFilter(FilterNames.Tenant)
  109. .Where(m => m.ProjectPriceId == maxPrice.ProjectPriceId)
  110. .FirstAsync(m => new
  111. {
  112. DrawAmount = m.DrawAmount
  113. }) ;
  114. if(priceConfig is null)
  115. {
  116. // 未单独设置佣金抽成 默认抽取 5% 取 一位小数
  117. projectItem.Price = (Convert.ToDecimal(projectItem.Price) - ProjectPriceService.GetDrawAmount(Convert.ToDecimal( projectItem.Price),Convert.ToDecimal(5.00))).ToString();
  118. }
  119. else
  120. {
  121. projectItem.Price = (maxPrice.ProjectPrice - priceConfig.DrawAmount).ToString();
  122. }
  123. }
  124. foreach (var proItem in listProject)
  125. {
  126. proItem.Price = proItem.Price + "元";
  127. }
  128. myProjectOutput.MyProjects = listProject;
  129. }
  130. return myProjectOutput;
  131. }
  132. /// <summary>
  133. /// 项目详情
  134. /// </summary>
  135. /// <param name="id"></param>
  136. /// <returns></returns>
  137. [HttpGet]
  138. [NoOprationLog]
  139. public async Task<ProjectDescOutput> ProjectDescAsync(long id = 0)
  140. {
  141. if(id == 0)
  142. {
  143. throw ResultOutput.Exception($"ID 不可为空");
  144. }
  145. // 根据ID查询到项目的相关信息返回
  146. var result = await _projectRepository.Select.DisableGlobalFilter()
  147. .Where(a => a.Id == id)
  148. .FirstAsync(a => new ProjectDescOutput(a.Id,a.Logo,a.Name,"",a.SettleDay.ToString(),a.Tips));
  149. var maxPrice = await _projectPriceRepository
  150. .Select
  151. .DisableGlobalFilter(FilterNames.Tenant)
  152. .Where(m => m.ProjectId == id)
  153. .OrderByDescending(m => m.Price)
  154. .FirstAsync(m => new
  155. {
  156. ProjectPriceId = m.Id,
  157. ProjectPrice = m.Price
  158. });
  159. var priceConfig = await _projectConfigRepository
  160. .Select
  161. .DisableGlobalFilter(FilterNames.Tenant)
  162. .Where(m => m.ProjectPriceId == maxPrice.ProjectPriceId)
  163. .FirstAsync(m => new
  164. {
  165. DrawAmount = m.DrawAmount
  166. });
  167. if (priceConfig is null)
  168. {
  169. // 未单独设置佣金抽成 默认抽取 5% 取 一位小数
  170. result.Price = (Convert.ToDecimal(maxPrice.ProjectPrice) - ProjectPriceService.GetDrawAmount(Convert.ToDecimal(maxPrice.ProjectPrice), Convert.ToDecimal(5.00))).ToString();
  171. }
  172. else
  173. {
  174. result.Price = (maxPrice.ProjectPrice - priceConfig.DrawAmount).ToString();
  175. }
  176. return result;
  177. }
  178. /// <summary>
  179. /// 项目说明
  180. /// </summary>
  181. /// <param name="id"></param>
  182. /// <returns></returns>
  183. [HttpGet]
  184. [NoOprationLog]
  185. public async Task<ProjectSpecOutput> ProjectSpecAsync(long id = 0)
  186. {
  187. if (id == 0)
  188. {
  189. throw ResultOutput.Exception($"ID 不可为空");
  190. }
  191. var result = await _projectRepository.Select.DisableGlobalFilter()
  192. .Where(a => a.Id == id)
  193. .FirstAsync(a => new ProjectSpecOutput(a.Id, a.VideoUrl, a.Detail));
  194. result.Prices = await _projectPriceRepository.Select.DisableGlobalFilter()
  195. .Where(a => a.ProjectId == id)
  196. .ToListAsync(a => new ProjectPrice(
  197. a.Id,
  198. a.Name,
  199. a.Price.ToString()
  200. ));
  201. var priceList = await _projectConfigRepository.Select
  202. .Where(m => m.EffectDate < DateTime.Now)
  203. .Where(m => m.ProjectId == id)
  204. .OrderByDescending(m => m.DrawAmount)
  205. .ToListAsync(
  206. m => new
  207. {
  208. ProjectId = m.ProjectId,
  209. ProjectPriceId = m.ProjectPriceId,
  210. DrawAmount = m.DrawAmount,
  211. EffectDate = m.EffectDate,
  212. });
  213. if(priceList.Count() == 0)
  214. {
  215. foreach (var priceItem in result.Prices)
  216. {
  217. priceItem.Price = (Convert.ToDecimal(priceItem.Price) - ProjectPriceService.GetDrawAmount(Convert.ToDecimal(priceItem.Price), Convert.ToDecimal(5.00))).ToString();
  218. }
  219. }
  220. else
  221. {
  222. foreach (var item in priceList)
  223. {
  224. foreach (var priceItem in result.Prices)
  225. {
  226. if (item.ProjectPriceId == priceItem.Id)
  227. {
  228. priceItem.Price = (Convert.ToDecimal(priceItem.Price) - item.DrawAmount).ToString();
  229. }
  230. else
  231. {
  232. priceItem.Price = (Convert.ToDecimal(priceItem.Price) - ProjectPriceService.GetDrawAmount(Convert.ToDecimal(priceItem.Price), Convert.ToDecimal(5.00))).ToString();
  233. }
  234. }
  235. }
  236. }
  237. return result;
  238. //ProjectSpecOutput projectSpecOutput = new ProjectSpecOutput();
  239. //projectSpecOutput.VideoUrl = "https://test-dt.zhongjie51.com/assetsImg/test.mp4";
  240. //projectSpecOutput.Detail = "<p><b id=\"4g60c\" style=\"letter-spacing: 0.00735em;\"><font id=\"8o15r\" color=\"#1c487f\">注意事项:</font></b><br/></p><p>\r\n1.<font color=\"#f9963b\">新老用户均可下单,从未在抖店下过单的即可。成功领取抖音平台通用新人券的为电商新用户</font></p><p>2.提醒用户第二天务必打开APP,查看物流信息,确保商家正常发货&nbsp;</p><p>3.<font color=\"#c24f4a\"><b>仅限抖音APP</b>,请勿使用极速版、火山版下单</font></p><p><font color=\"#c24f4a\">4.<b>复购订单必须直接在抖音商城下单!直播间下单无法结算!</b></font></p><p>5.必须真实推广,禁止机刷,机刷不结算并上报司法机关&nbsp;</p><p>6.禁止一机多单,禁止一个支付账号(微信、支付宝、银行卡)多次支付,禁止代付等行为&nbsp;</p><p>7.禁止填写同一收货人姓名、手机号、地址,必项填写注册手机号及客户真实收货信息&nbsp;</p><p>8.禁止使用WIFI、热点作业\r\n\r\n</p><p>9.为了避免活动下线,做单没有数据。请所有业务员务必<font color=\"#c24f4a\">每天扫描一次母码,获取新的作业码!</font></p><p>(具体步骤请参考下图)<br/><img src=\"https://media.jietui.cn/article/20230420223625687184.png\" contenteditable=\"false\" style=\"font-size: 14px; max-width: 100%;\"/></p><hr/><h4><b id=\"4g60c\" style=\"letter-spacing: 0.00735em;\"><font id=\"de97j\" color=\"#1c487f\">拉新流程:</font></b></h4><p>\r\n1.使用抖音扫描拉新二维码&nbsp;</p><p>2.扫码以后弹出的活动界面,完成新人首购,挑选任意商品,点击领券购买</p><p>3.填写收货信息(注意必须填写真实的收货信息)选择任意支付方式,支付即可</p><p>4.第二天,再次扫码(不扫码也可复购,只是没有实时数据)跳转到活动界面,完成复购,复购无金额要求!</p><h4><hr/><p><b style=\"letter-spacing: 0.00735em;\"><font id=\"g98c4\" color=\"#1c487f\">图文教程:</font></b><br/></p></h4>\r\n<p><img src=\"https://media.jietui.cn/personal/douyin_dianshang/123.png\" style=\"max-width:100%;\" contenteditable=\"false\"/></p><p><br/></p>";
  241. //List<ProjectPrice> projectPrices = new List<ProjectPrice>();
  242. ////projectPrices.Add(new ProjectPrice( ));
  243. //projectPrices.Add(new ProjectPrice("新设备次播", "25"));
  244. //projectPrices.Add(new ProjectPrice("新设备3留", "8"));
  245. //projectPrices.Add(new ProjectPrice("申领礼品", "20"));
  246. //projectPrices.Add(new ProjectPrice("老设备次留", "5"));
  247. //projectSpecOutput.Prices = projectPrices;
  248. //return projectSpecOutput;
  249. }
  250. /// <summary>
  251. /// 项目详情-推广码
  252. /// </summary>
  253. /// <param name="input"></param>
  254. /// <returns></returns>
  255. [HttpGet]
  256. public async Task<PageOutput<ProjectQrcodePageOutput>> ProjectQrcodePageAsync(PageInput<ProjectQrcodePageInput> input)
  257. {
  258. var keyWrods = input.Filter?.Keywords;
  259. string Salesman = null;
  260. string SalesmanPhone = null;
  261. //var Salesman = input.Filter?.Salesman;
  262. //var Salesman = input.Filter?.Salesman;
  263. //var SalesmanPhone = input.Filter?.SalesmanPhone;
  264. //var SalesmanPhone = input.Filter?.SalesmanPhone;
  265. //var SalesmanPhone = input.Filter?.SalesmanPhone;
  266. if (!string.IsNullOrEmpty(keyWrods))
  267. {
  268. if(IsPhoneNumber(keyWrods))
  269. {
  270. SalesmanPhone = keyWrods;
  271. }
  272. else
  273. {
  274. Salesman = keyWrods;
  275. }
  276. }
  277. var ProjectId = input.Filter?.ProjectId;
  278. if (ProjectId == 0 || string.IsNullOrEmpty(ProjectId.ToString()))
  279. {
  280. throw ResultOutput.Exception("项目 ID 不可为空");
  281. }
  282. var list = _ProjectLinkRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
  283. .WhereIf(ProjectId.HasValue && ProjectId.Value > 0, a => a.ProjectId == ProjectId)
  284. .WhereIf(Salesman.NotNull(), a => a.Salesman.Contains(Salesman))
  285. .WhereIf(SalesmanPhone.NotNull(), a => a.SalesmanPhone.Contains(SalesmanPhone))
  286. .Where(a=> a.IsUse == 1 && a.TenantId == User.TenantId)
  287. .OrderByDescending(a => a.UseTime)
  288. .Count(out var total)
  289. .Page(input.CurrentPage, input.PageSize)
  290. .ToList(m => new ProjectQrcodePageOutput()
  291. {
  292. Id = m.Id,
  293. Salesman = m.Salesman,
  294. UseTime = m.UseTime,
  295. QrcodeUrl = m.QrcodeUrl,
  296. QueryUrl = m.QueryUrl
  297. });
  298. var data = new PageOutput<ProjectQrcodePageOutput>()
  299. {
  300. List = list,
  301. Total = total
  302. };
  303. return data;
  304. }
  305. /// <summary>
  306. /// 项目统计
  307. /// </summary>
  308. /// <param name="input"></param>
  309. /// <returns></returns>
  310. [HttpGet]
  311. public async Task<PageOutput<ProjectCountPageOutput>> ProjectCountPageAsync(PageInput<ProjectCountPageInput> input)
  312. {
  313. var ProjectId = input.Filter?.ProjectId;
  314. var Date = input.Filter?.Date;
  315. if(ProjectId == null)
  316. {
  317. ProjectId = 0;
  318. }
  319. if(ProjectId == 0)
  320. {
  321. throw ResultOutput.Exception("项目 ID 不可为空");
  322. }
  323. var listStat = _projectStatRepository
  324. .Select
  325. .DisableGlobalFilter(FilterNames.Tenant)
  326. .Where(a => a.ProjectId == ProjectId)
  327. .WhereIf(Date.NotNull(), a => a.EffectDate.ToString().Contains(Date))
  328. .GroupBy(a => a.EffectDate)
  329. .Page(input.CurrentPage, input.PageSize)
  330. .ToList(m => new { SettleDate = m.Key});
  331. List<ProjectCountPageOutput> list = new List<ProjectCountPageOutput>();
  332. foreach (var countDate in listStat)
  333. {
  334. //string.Format("{0:yyyy-MM-dd HH:mm:ss}", m.CreatedTime)
  335. string countDateString = string.Format("{0:yyyy-MM-dd}", countDate.SettleDate);
  336. //List<SettleCount> settleCounts = new List<SettleCount>();
  337. var sr = _projectStatRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
  338. .Where(a => a.ProjectId == ProjectId)
  339. .Where(a => a.EffectDate.ToString().Contains(countDateString))
  340. .ToList(m => new SettleRecord(m.Name,m.ValidCount.ToString(),m.ValidCount.ToString()){});
  341. List<SettleCount> sc = new List<SettleCount>();
  342. long validCount = 0;
  343. long Count = 0;
  344. long commission = 0;
  345. foreach(var item in sr)
  346. {
  347. validCount += Convert.ToInt16(item.ValidCount);
  348. Count += Convert.ToInt16( item.Count);
  349. //commission += Convert.ToInt16(item.Commission);
  350. sc.Add(new SettleCount(item.SettleStandard, item.ValidCount + "/" + item.ValidCount));
  351. }
  352. sc.Add(new SettleCount("汇总", validCount + "/" + Count, "--"));
  353. list.Add(new ProjectCountPageOutput((long)ProjectId, countDateString, "", sc));
  354. }
  355. var total = list.Count;
  356. var data = new PageOutput<ProjectCountPageOutput>()
  357. {
  358. List = list,
  359. Total = total
  360. };
  361. return data;
  362. }
  363. /// <summary>
  364. /// 开码
  365. /// </summary>
  366. /// <param name="id"></param>
  367. /// <returns></returns>
  368. [HttpPost]
  369. [NoOprationLog]
  370. public async Task<string> BindQrcodeAsync(BindQrcodeInput input)
  371. {
  372. var project = await _projectRepository.Select.DisableGlobalFilter().Where(a => a.Id == input.ProjectId).FirstAsync(a => new {a.Status});
  373. if(project.Status == 4)
  374. {
  375. throw ResultOutput.Exception($"项目暂停");
  376. }
  377. if(project.Status == 5)
  378. {
  379. throw ResultOutput.Exception($"项目名额已满");
  380. }
  381. if (project.Status == 3)
  382. {
  383. throw ResultOutput.Exception($"项目已下架");
  384. }
  385. if (project.Status == 1)
  386. {
  387. throw ResultOutput.Exception($"项目未上架");
  388. }
  389. // 判断用户是否已经 开码 同租户 同项目 手机号唯一
  390. var doubleUser = await _ProjectLinkRepository.Select.Where(a => a.SalesmanPhone == input.SalesmanPhone && a.ProjectId == input.ProjectId)
  391. .FirstAsync(a => new { a.Salesman, a.SalesmanPhone, a.Id });
  392. if(doubleUser != null)
  393. {
  394. throw ResultOutput.Exception($"手机号已开码");
  395. }
  396. // 查询未使用的链接的第一条数据 TODO 当前需要查询 TenantID 为空的数据 后期会查询 各平台自己的链接
  397. var existsLink = await _ProjectLinkRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
  398. .Where(a => a.IsUse == 0 && a.ProjectId == input.ProjectId)
  399. .FirstAsync(a => new { a.Id, a.ModifiedTime});
  400. if (existsLink == null)
  401. {
  402. throw ResultOutput.Exception($"当前项目已无可用链接");
  403. }
  404. var qrcode = await _ProjectLinkRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
  405. .Where(a => a.Id == existsLink.Id)
  406. .FirstAsync();
  407. Mapper.Map(input, qrcode);
  408. qrcode.IsUse = 1;
  409. qrcode.TenantId = User.TenantId;
  410. qrcode.UsedUserId = User.Id;
  411. qrcode.UseTime = DateTime.Now;
  412. var resault = await _ProjectLinkRepository.UpdateDiy.DisableGlobalFilter(FilterNames.Tenant)
  413. .SetSource(qrcode)
  414. .UpdateColumns(a => new { a.TenantId, a.IsUse, a.Salesman,a.SalesmanPhone,a.SalesmanProvince,a.SalesmanCity,a.SalesmanRemark,a.UsedUserId,a.UseTime})
  415. .ExecuteAffrowsAsync();
  416. // 返回 链接ID
  417. return qrcode.Id.ToString();
  418. }
  419. /// <summary>
  420. /// 获取开码信息
  421. /// </summary>
  422. /// <param name="id">二维码ID(链接ID)</param>
  423. /// <returns></returns>
  424. [HttpGet]
  425. [NoOprationLog]
  426. public async Task<BindQrcodeOutput> GetBindQrcodeAsync(long id = 0)
  427. {
  428. if (id == 0)
  429. {
  430. throw ResultOutput.Exception($"无效参数");
  431. }
  432. var result = await _ProjectLinkRepository.GetAsync<BindQrcodeOutput>(id);
  433. return result;
  434. }
  435. /// <summary>
  436. /// 推广码每日统计
  437. /// </summary>
  438. /// <param name="input"></param>
  439. /// <returns></returns>
  440. [HttpGet]
  441. public async Task<PageOutput<ProjectCountPageOutput>> QrcodeCountPageAsync(PageInput<QrcodeCountPageInput> input)
  442. {
  443. var Id = input.Filter?.Id;
  444. if (Id == null)
  445. {
  446. Id = 0;
  447. }
  448. //var list = _ProjectLinkRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
  449. // .WhereIf(ProjectId.HasValue && ProjectId.Value > 0, a => a.ProjectId == ProjectId)
  450. // .WhereIf(Salesman.NotNull(), a => a.Salesman.Contains(Salesman))
  451. // .WhereIf(SalesmanPhone.NotNull(), a => a.SalesmanPhone.Contains(SalesmanPhone))
  452. //.Count(out var total)
  453. //.Page(input.CurrentPage, input.PageSize)
  454. //.ToList(m => new ProjectQrcodePageOutput()
  455. //{
  456. // Id = m.Id,
  457. // Salesman = m.Salesman,
  458. // UseTime = m.UseTime,
  459. // QrcodeUrl = m.QrcodeUrl,
  460. // QueryUrl = m.QueryUrl
  461. //});
  462. List<ProjectCountPageOutput> list = new List<ProjectCountPageOutput>();
  463. List<SettleCount> settleCounts = new List<SettleCount>();
  464. settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
  465. settleCounts.Add(new SettleCount("电商首购B级", "201/300单", "201元"));
  466. settleCounts.Add(new SettleCount("电商首购C级", "202/300单", "202元"));
  467. settleCounts.Add(new SettleCount("今日汇总", "603/900单", "603元"));
  468. //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
  469. //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
  470. list.Add(new ProjectCountPageOutput((long)(Id != 0 ? Id : 416237348180038), "2023-05-02", "", settleCounts));
  471. List<SettleCount> settleCounts1 = new List<SettleCount>();
  472. settleCounts1.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
  473. settleCounts1.Add(new SettleCount("电商首购B级", "199/300单", "199元"));
  474. settleCounts1.Add(new SettleCount("电商首购C级", "198/300单", "198元"));
  475. settleCounts1.Add(new SettleCount("今日汇总", "597/900单", "597元"));
  476. //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
  477. //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
  478. list.Add(new ProjectCountPageOutput((long)(Id != 0 ? Id : 416237348180038), "2023-05-01", "", settleCounts1));
  479. var total = list.Count;
  480. var data = new PageOutput<ProjectCountPageOutput>()
  481. {
  482. List = list,
  483. Total = total
  484. };
  485. return data;
  486. }
  487. /// <summary>
  488. /// 判断字符串是否是手机号
  489. /// </summary>
  490. /// <param name="str_handset"></param>
  491. /// <returns></returns>
  492. private static bool IsPhoneNumber(string str_handset)
  493. {
  494. return System.Text.RegularExpressions.Regex.IsMatch(str_handset, @"^1[3456789]\d{9}$");
  495. }
  496. }
  497. }