فهرست منبع

京东增加:结算中心-收入概览

dodo hold 1 سال پیش
والد
کامیت
03e33ca25f

+ 99 - 1
molilian.api/Controllers/admin/JdUnionController.cs

@@ -84,7 +84,7 @@ namespace molilian.api.Controllers
             string filter = string.Empty;
             if (!string.IsNullOrEmpty(name))
             {
-                filter += $" AND accountId IN (SELECT ID FROM tk_pool WHERE company=@name)";
+                filter += $" AND accountId IN (SELECT ID FROM jd_pool WHERE company=@name)";
             }
             DateTime stime = DateTime.MinValue, etime = DateTime.MinValue;
             if (report_date.Count == 2)
@@ -118,6 +118,104 @@ namespace molilian.api.Controllers
             return new APIResult(new { data = result });
         }
 
+
+
+
+        [HttpPost]
+        public ActionResult estimate_comm_total([FromBody] JsonElement form)
+        {
+            int page = form.Read("current", 1);
+            int size = form.Read("pageSize", 10);
+            bool getTotal = form.Read("getTotal", true);
+            string sort = form.Read<string>("sort");
+            string order = form.Read<string>("order");
+
+            var report_date = form.PathReadArray<string>("query_date[]");
+
+            string filter = string.Empty;
+            DateTime stime = DateTime.MinValue, etime = DateTime.MinValue;
+            if (report_date.Count == 2)
+            {
+                if (DateTime.TryParse(report_date[0], out stime) && DateTime.TryParse(report_date[1], out etime))
+                {
+                    etime = etime.AddDays(1).AddSeconds(-1);
+                    filter += $" AND report_date BETWEEN @stime AND @etime";
+                }
+            }
+
+            filter = filter.StringTrimStart(" AND ");
+
+            //排序
+            string orderBy = "report_date DESC";
+            if (!string.IsNullOrEmpty(order))
+            {
+                order = "descending".Equals(order) ? "DESC" : "ASC";
+                orderBy = sort switch
+                {
+                    _ => $"{sort} {order}",
+                };
+            }
+            var result = new DBContext.Table("v_jd_estimate_comm")
+                .Where(filter, new { stime, etime })
+                .Page(size, page)
+                .Order(orderBy)
+                .PageList<JdEstimateCommDTO>(getTotal);
+
+            return new APIResult(new { data = result });
+        }
+
+
+        [HttpPost]
+        public ActionResult estimate_comm([FromBody] JsonElement form)
+        {
+            int page = form.Read("current", 1);
+            int size = form.Read("pageSize", 10);
+            bool getTotal = form.Read("getTotal", true);
+            string sort = form.Read<string>("sort");
+            string order = form.Read<string>("order");
+            string name = form.Read<string>("keyword");
+
+            var report_date = form.PathReadArray<string>("query_date[]");
+
+            string filter = string.Empty;
+            if (!string.IsNullOrEmpty(name))
+            {
+                filter += $" AND accountId IN (SELECT ID FROM jd_pool WHERE company=@name)";
+            }
+            DateTime stime = DateTime.MinValue, etime = DateTime.MinValue;
+            if (report_date.Count == 2)
+            {
+                if (DateTime.TryParse(report_date[0], out stime) && DateTime.TryParse(report_date[1], out etime))
+                {
+                    etime = etime.AddDays(1).AddSeconds(-1);
+                    filter += $" AND report_date BETWEEN @stime AND @etime";
+                }
+            }
+
+            filter = filter.StringTrimStart(" AND ");
+
+            //排序
+            string orderBy = "report_date DESC";
+            if (!string.IsNullOrEmpty(order))
+            {
+                order = "descending".Equals(order) ? "DESC" : "ASC";
+                orderBy = sort switch
+                {
+                    _ => $"{sort} {order}",
+                };
+            }
+
+            var result = new DBContext.Table("jd_estimate_comm")
+                .Where(filter, new { name, stime, etime })
+                .Page(size, page)
+                .Order(orderBy)
+                .PageList<JdEstimateCommDTO>(getTotal);
+
+            return new APIResult(new { data = result });
+        }
+
+
+
         /// <summary>
         /// 账号列表
         /// </summary>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
molilian.api/Properties/PublishProfiles/https___ccr.ccs.tencentyun.com_shaobin.pubxml.user


+ 52 - 0
molilian.core/DTO/jd/JdEstimateCommDTO.cs

@@ -0,0 +1,52 @@
+using dodohold.core;
+using System.Text.Json.Serialization;
+
+namespace molilian.core
+{
+
+    [Table("jd_estimate_comm")]
+    public class JdEstimateCommDTO
+    {
+        [Key]
+        public int id { get; set; }
+        public int accountId { get; set; } = 0;
+
+        public string accountName { get; set; } = string.Empty;
+
+        /// <summary>
+        /// 订单完成日期
+        /// </summary>
+        [JsonConverter(typeof(DateTimeConverterUsingDateTimeParse))]
+        public DateTime report_date { get; set; } = DateTime.MinValue;
+
+
+        public decimal cosFee { get; set; } = 0.0m;
+
+        public int feeType { get; set; } = 0;
+        public string feeTypeStr { get; set; } = string.Empty;
+
+        public int platform { get; set; } = 0;
+        public string platformStr { get; set; } = string.Empty;
+
+
+        public int unionType { get; set; } = 0;
+        public string unionTypeStr { get; set; } = string.Empty;
+
+
+        /// <summary>
+        /// 0未结算 2已结算
+        /// </summary>
+        public int status { get; set; } = 0;
+
+        public DateTime create_time { get; set; } = DateTime.Now;
+
+        public DateTime last_time { get; set; } = DateTime.Now;
+
+
+        public int downloadDetail { get; set; }
+        public int showDetail { get; set; }
+        public string payMonth { get; set; } = string.Empty;
+    }
+
+
+}

+ 3 - 26
molilian.core/Plus/JDUnion/EstimateComm.cs

@@ -7,30 +7,6 @@ namespace molilian.core
     public partial class JdUnionPlus
     {
 
-        public class EstimateCommDTO
-        {
-            public int id { get; set; } = 0;
-            public int accountId { get; set; } = 0;
-            public string accountName { get; set; } = string.Empty;
-            public DateTime report_date { get; set; } = DateTime.MinValue;
-            public DateTime create_time { get; set; } = DateTime.Now;
-            public DateTime last_time { get; set; } = DateTime.MinValue;
-
-
-            public decimal cosFee { get; set; }
-            public int downloadDetail { get; set; }
-            public int feeType { get; set; }
-            public string feeTypeStr { get; set; } = string.Empty;
-            public string payMonth { get; set; } = string.Empty;
-            public int platform { get; set; }
-            public string platformStr { get; set; } = string.Empty;
-            public int showDetail { get; set; }
-            public int status { get; set; }
-            public int unionType { get; set; }
-            public string unionTypeStr { get; set; } = string.Empty;
-        }
-
-
         public async Task<List<DateTime>> queryEstimateCommList(CancellationToken cancellationToken = default)
         {
             List<DateTime> changed_dates = new List<DateTime>();
@@ -96,7 +72,7 @@ namespace molilian.core
 
                     foreach (var item in list.EnumerateArray())
                     {
-                        var report = item.GetRawText().Convert2Object<EstimateCommDTO>();
+                        var report = item.GetRawText().Convert2Object<JdEstimateCommDTO>();
 
                         if (DateTime.TryParseExact(report.payMonth, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out DateTime report_date))
                         {
@@ -111,7 +87,8 @@ namespace molilian.core
                                         accountId = _account.id,
                                         report.unionType,
                                         report.feeType,
-                                        report.platform
+                                        report.platform,
+                                        report.status
                                     }
                                     );
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است