足力健后端,使用.netcore版本,合并1个项目使用

Bus_AfterSaleRepository.cs 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.IRepositories;
  5. using System.Model;
  6. using System.Common;
  7. using System.Threading.Tasks;
  8. using SqlSugar;
  9. using System.Data;
  10. namespace System.Repositories
  11. {
  12. public class Bus_AfterSaleRepository : BaseRepository<T_Bus_AfterSale>, IBus_AfterSaleRepository
  13. {
  14. /// <summary>
  15. /// 获取某月员工绩效 售后退款 售后类型 1调换货 2退货 3部分退货 4对发货 5补发货 6补差额
  16. /// </summary>
  17. /// <param name="userid">某员工</param>
  18. /// <param name="dtStart">时间所在月</param>
  19. /// <returns></returns>
  20. public async Task<List<decimal>> BackNumberSH(int userid, DateTime dtStart)
  21. {
  22. List<decimal> intarry = new List<decimal>() { -1, -0.00M };
  23. try
  24. {
  25. List<SugarParameter> sugarParameter = new List<SugarParameter>();
  26. sugarParameter.Add(new SugarParameter("@userid", userid));
  27. sugarParameter.Add(new SugarParameter("@startTime", dtStart));
  28. sugarParameter.Add(new SugarParameter("@endTime", dtStart.AddMonths(1)));
  29. DataTable dt = await GetTableSugar("SELECT COUNT(1),SUM(F_Money) FROM T_Bus_AfterSale WHERE F_CheckUserXS= @userid AND F_Type IN(2,3,6) AND F_CheckStateSH=1 AND F_AddTime BETWEEN @startTime AND @endTime", sugarParameter);
  30. if (dt != null && dt.Rows.Count > 0)
  31. {
  32. intarry.Clear();
  33. intarry.Add(dt.Rows[0][0].ObjToInt());
  34. intarry.Add(dt.Rows[0][1].ObjToDecimal());
  35. }
  36. return intarry;
  37. }
  38. catch { return intarry; }
  39. }
  40. }
  41. }