Просмотр исходного кода

Statistics/PostMarketingSalesGroupList(市场部销售额 - 团组列表)、Statistics/PostMarketingSalesGroupStatistics(市场部销售额 - 客户类型、客户等级 统计)、Statistics/PostMarketingSalesOrderRanking(市场部销售额 - 接单排名)、Statistics/PostMarketingSalesGroupItem(市场部销售额 - 团组列表、客户类型、客户等级、接单排名) 等接口 新增条件 销售额>0

LEIYI месяцев назад: 4
Родитель
Сommit
acf824486c

+ 4 - 20
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -2830,27 +2830,11 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         {
             if (id <1 ) return Ok(JsonView(false,"请传入有效的Id!"));
 
-            var view = await _translatorRep.Query(x => x.Id == id)
-                .Select(x => new { 
-                    x.Id,
-                    x.Area,
-                    x.Name,
-                    x.Sex,
-                    x.Photo,
-                    x.Tel,
-                    x.Email,
-                    x.WechatNo,
-                    x.OtherSocialAccounts,
-                    x.Language,
-                    x.Price,
-                    x.Currency,
-                    x.Files,
-                    x.Remark,
-                })
-                .FirstAsync();
-            
+            var view = await _translatorRep.Query(x => x.Id == id).FirstAsync();
 
-            return Ok(JsonView(view));
+            var view1 = _mapper.Map<TranslatorLibraryInfoView>(view);
+
+            return Ok(JsonView(view1));
         }
 
 

+ 111 - 11
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -2598,7 +2598,9 @@ FROM
   ) Temp ");
 
             RefAsync<int> total = 0;
-            var groupData = await _sqlSugar.SqlQueryable<MarketingSalesGroupList>(sql).ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+            var groupData = await _sqlSugar.SqlQueryable<MarketingSalesGroupList>(sql)
+                .Where(x => x.GroupSales > 0) 
+                .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
 
             return Ok(JsonView(true, "操作成功!", groupData, total));
         }
@@ -2668,6 +2670,18 @@ FROM
 From Grp_DelegationInfo di
 Left Join Sys_SetData sd On di.TeamDid = sd.Id
 Where di.Isdel = 0 
+And (
+  SELECT
+    CAST(
+      COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+    ) AS GroupSales
+  FROM
+    Fin_ForeignReceivables fr
+  WHERE
+    fr.IsDel = 0
+    AND di.Id = fr.Diid
+    AND AddingWay IN (0, 1, 2)
+) > 0
  {userSql} 
 And VisitDate Between '{beginDt}' And  '{endDt}'
 Group By [Name]
@@ -2681,6 +2695,18 @@ Order By Count Desc");
 From Grp_DelegationInfo di
 Left Join Sys_SetData sd On di.TeamLevSId = sd.Id
 Where di.Isdel = 0 
+And (
+  SELECT
+    CAST(
+      COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+    ) AS GroupSales
+  FROM
+    Fin_ForeignReceivables fr
+  WHERE
+    fr.IsDel = 0
+    AND di.Id = fr.Diid
+    AND AddingWay IN (0, 1, 2)
+) > 0
  {userSql} 
 And VisitDate Between '{beginDt}' And  '{endDt}'
 Group By [Name]
@@ -2696,6 +2722,18 @@ Order By Count Desc");
 From Grp_DelegationInfo di
 Left Join Sys_SetData sd On di.TeamDid = sd.Id
 Where di.Isdel = 0 
+And (
+  SELECT
+    CAST(
+      COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+    ) AS GroupSales
+  FROM
+    Fin_ForeignReceivables fr
+  WHERE
+    fr.IsDel = 0
+    AND di.Id = fr.Diid
+    AND AddingWay IN (0, 1, 2)
+) > 0
  {userSql} 
 And VisitDate Between '{beginDt}' And  '{endDt}'
 Group By [Name]
@@ -2709,6 +2747,18 @@ Order By Count Desc");
 From Grp_DelegationInfo di
 Left Join Sys_SetData sd On di.TeamLevSId = sd.Id
 Where di.Isdel = 0 
+And (
+  SELECT
+    CAST(
+      COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+    ) AS GroupSales
+  FROM
+    Fin_ForeignReceivables fr
+  WHERE
+    fr.IsDel = 0
+    AND di.Id = fr.Diid
+    AND AddingWay IN (0, 1, 2)
+) > 0
  {userSql} 
 And VisitDate Between '{beginDt}' And  '{endDt}'
 Group By [Name]
@@ -2778,6 +2828,18 @@ Order By Count Desc");
 	From Grp_DelegationInfo di
 	Left Join Sys_Users u On di.JietuanOperator = u.Id
 	Where di.Isdel = 0 
+	And (
+      SELECT
+        CAST(
+          COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+        ) AS GroupSales
+      FROM
+        Fin_ForeignReceivables fr
+      WHERE
+        fr.IsDel = 0
+        AND di.Id = fr.Diid
+        AND AddingWay IN (0, 1, 2)
+    ) > 0
      {userSql} 
 	And VisitDate Between '{beginDt}' And  '{endDt}'
 	Group By CnName");
@@ -2883,7 +2945,9 @@ FROM
       AND VisitDate Between '{beginDt}' And  '{endDt}'
   ) Temp ");
             RefAsync<int> total = 0;
-            var groupData = await _sqlSugar.SqlQueryable<MarketingSalesGroupList>(sql).ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+            var groupData = await _sqlSugar.SqlQueryable<MarketingSalesGroupList>(sql)
+                .Where(x => x.GroupSales > 0)
+                .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
             #endregion
 
             #region 客户类型、客户等级 统计
@@ -2894,6 +2958,18 @@ FROM
 From Grp_DelegationInfo di
 Left Join Sys_SetData sd On di.TeamDid = sd.Id
 Where di.Isdel = 0 
+And (
+  SELECT
+    CAST(
+      COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+    ) AS GroupSales
+  FROM
+    Fin_ForeignReceivables fr
+  WHERE
+    fr.IsDel = 0
+    AND di.Id = fr.Diid
+    AND AddingWay IN (0, 1, 2)
+) > 0 
  {userSql} 
 And VisitDate Between '{beginDt}' And  '{endDt}'
 Group By [Name]
@@ -2907,6 +2983,18 @@ Order By Count Desc");
 From Grp_DelegationInfo di
 Left Join Sys_SetData sd On di.TeamLevSId = sd.Id
 Where di.Isdel = 0 
+And (
+  SELECT
+    CAST(
+      COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+    ) AS GroupSales
+  FROM
+    Fin_ForeignReceivables fr
+  WHERE
+    fr.IsDel = 0
+    AND di.Id = fr.Diid
+    AND AddingWay IN (0, 1, 2)
+) > 0 
  {userSql} 
 And VisitDate Between '{beginDt}' And  '{endDt}'
 Group By [Name]
@@ -2917,15 +3005,27 @@ Order By Count Desc");
             #region 接单排名
 
             string sql4 = string.Format(@$"Select 
-	ROW_NUMBER() Over(Order By Count(*) Desc) As RowNumber,
-	u.CnName As UserName,
-	Count(*) As [Count]
-	From Grp_DelegationInfo di
-	Left Join Sys_Users u On di.JietuanOperator = u.Id
-	Where di.Isdel = 0 
-     {userSql} 
-	And VisitDate Between '{beginDt}' And  '{endDt}'
-	Group By CnName");
+ROW_NUMBER() Over(Order By Count(*) Desc) As RowNumber,
+u.CnName As UserName,
+Count(*) As [Count]
+From Grp_DelegationInfo di
+Left Join Sys_Users u On di.JietuanOperator = u.Id
+Where di.Isdel = 0 
+And (
+  SELECT
+    CAST(
+      COALESCE(SUM(ItemSumPrice * Rate), 0) AS DECIMAL(12, 2)
+    ) AS GroupSales
+  FROM
+    Fin_ForeignReceivables fr
+  WHERE
+    fr.IsDel = 0
+    AND di.Id = fr.Diid
+    AND AddingWay IN (0, 1, 2)
+) > 0
+    {userSql} 
+And VisitDate Between '{beginDt}' And  '{endDt}'
+Group By CnName");
 
             var rankingData = await _sqlSugar.SqlQueryable<MarketingSalesOrderRankingView>(sql4).ToListAsync();
 

+ 1 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -177,6 +177,7 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<OpinionaireManageInfo, Grp_Opinionaire>();
             CreateMap<Grp_Opinionaire, OpinionaireUserListView>();
             CreateMap<OpinionaireUserSaveInfo, Grp_Opinionaire>();
+            CreateMap<Res_TranslatorLibrary, TranslatorLibraryInfoView>();
             #endregion
             #endregion
 

+ 112 - 1
OASystem/OASystem.Domain/ViewModels/Resource/TranslatorLibraryView.cs

@@ -1,4 +1,5 @@
-using OASystem.Domain.Entities.Resource;
+using Newtonsoft.Json;
+using OASystem.Domain.Entities.Resource;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -10,4 +11,114 @@ namespace OASystem.Domain.ViewModels.Resource
     public class TranslatorLibraryView : Res_TranslatorLibrary
     {
     }
+
+    public class TranslatorLibraryInfoView
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 所在地区
+        /// </summary>
+        public string Area { get; set; }
+
+        /// <summary>
+        /// 姓名
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 性别(0:未设置 1:男 2:女)
+        /// </summary>
+        public int Sex { get; set; }
+
+        /// <summary>
+        /// 照片
+        /// </summary>
+        public string Photo { get; set; }
+
+
+        /// <summary>
+        /// 联系电话
+        /// </summary>
+        public string Tel { get; set; }
+
+        /// <summary>
+        /// 邮箱号
+        /// </summary>
+        public string Email { get; set; }
+
+        /// <summary>
+        /// 微信号
+        /// </summary>
+        public string WechatNo { get; set; }
+
+        /// <summary>
+        /// 其他社交账号
+        /// </summary>
+        public string OtherSocialAccounts { get; set; }
+
+        /// <summary>
+        /// 语种
+        /// </summary>
+        public string Language { get; set; }
+
+        /// <summary>
+        /// 费用
+        /// </summary>
+        public decimal Price { get; set; }
+
+        /// <summary>
+        /// 币种
+        /// </summary>
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 简历或其他证书
+        /// </summary>
+        public string Files { get; set; }
+
+        /// <summary>
+        /// 简历或其他证书
+        /// </summary>
+        public FileInfoView[] FilePaths
+        {
+            get
+            {
+                var files1 = new List<FileInfoView>();
+                var files = new List<string>();
+
+                if (!string.IsNullOrEmpty(Files))
+                {
+                    try
+                    {
+                        files = JsonConvert.DeserializeObject<List<string>>(Files);
+                        for (int i = 0; i < files.Count; i++)
+                        {
+                            files1.Add(new FileInfoView()
+                            {
+                                FileName = files[i].ToString(),
+                                FilePathName = $"http://132.232.92.186:24/Office/GrpFile/TranslatorLibrary/{files[i].ToString()}"
+                            });
+                        }
+                    }
+                    catch (Exception)
+                    {
+                    }
+                }
+                return files1.ToArray();
+            }
+        }
+
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
+
+    public class FileInfoView
+    {
+        public string FileName { get; set; }
+        public string FilePathName { get; set; }
+    }
 }