Selaa lähdekoodia

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf 4 kuukautta sitten
vanhempi
commit
c88bfae028

+ 65 - 58
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -4996,32 +4996,7 @@ FROM
         #endregion
 
         #region 团组经理模块 出入境费用
-        ///// <summary>
-        ///// 团组模块 - 出入境费用
-        ///// </summary>
-        ///// <returns></returns>
-        //[HttpPost]
-        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        //public async Task<IActionResult> SetEnterExitCostCurrencyChange()
-        //{
-        //    try
-        //    {
-        //        var data = await _enterExitCostRep.SetEnterExitCostCurrencyChange();
-
-        //        if (data.Code != 0)
-        //        {
-        //            return Ok(JsonView(false, data.Msg));
-        //        }
-
-        //        return Ok(JsonView(true, "查询成功!"));
-        //    }
-        //    catch (Exception ex)
-        //    {
-        //        return Ok(JsonView(false, ex.Message));
-        //        throw;
-        //    }
-        //}
-
+        
         /// <summary>
         /// 团组模块 - 出入境费用 - 子项 地区更改为 nationalTravelFee 的id
         /// </summary>
@@ -7103,21 +7078,16 @@ FROM
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostNationalTravelFeeOperate(NationalTravelFeeOperateDto dto)
         {
-            try
-            {
-                var data = await _enterExitCostRep.PostNationalTravelFeeOperate(dto);
 
-                if (data.Code != 0)
-                {
-                    return Ok(JsonView(false, data.Msg));
-                }
+            var data = await _enterExitCostRep.PostNationalTravelFeeOperate(dto);
 
-                return Ok(JsonView(true, "操作成功!", data.Data));
-            }
-            catch (Exception ex)
+            if (data.Code != 0)
             {
-                return Ok(JsonView(false, ex.Message));
+                return Ok(JsonView(false, data.Msg));
             }
+
+            return Ok(JsonView(true, "操作成功!", data.Data));
+
         }
 
         /// <summary>
@@ -7128,32 +7098,26 @@ FROM
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostNationalTravelFeeDel(NationalTravelFeeDelDto dto)
         {
-            try
+            Grp_NationalTravelFee _nationalTravelFee = new Grp_NationalTravelFee()
             {
-                Grp_NationalTravelFee _nationalTravelFee = new Grp_NationalTravelFee()
-                {
-                    Id = dto.Id,
-                    DeleteUserId = dto.DeleteUserId,
-                    DeleteTime = DateTime.Now.ToString("yyyy-MM-dd"),
-                    IsDel = 1
-                };
-
-                var delStatus = await _enterExitCostRep._sqlSugar.Updateable<Grp_NationalTravelFee>(_nationalTravelFee)
-                                               .UpdateColumns(it => new { it.DeleteTime, it.DeleteUserId, it.IsDel })
-                                               .WhereColumns(it => new { it.Id })
-                                               .ExecuteCommandAsync();
+                Id = dto.Id,
+                DeleteUserId = dto.DeleteUserId,
+                DeleteTime = DateTime.Now.ToString("yyyy-MM-dd"),
+                IsDel = 1
+            };
 
-                if (delStatus <= 0)
-                {
-                    return Ok(JsonView(false, "删除失败!"));
-                }
+            var delStatus = await _enterExitCostRep._sqlSugar.Updateable<Grp_NationalTravelFee>(_nationalTravelFee)
+                                           .UpdateColumns(it => new { it.DeleteTime, it.DeleteUserId, it.IsDel })
+                                           .WhereColumns(it => new { it.Id })
+                                           .ExecuteCommandAsync();
 
-                return Ok(JsonView(true, "操作成功!"));
-            }
-            catch (Exception ex)
+            if (delStatus <= 0)
             {
-                return Ok(JsonView(false, ex.Message));
+                return Ok(JsonView(false, "删除失败!"));
             }
+
+            return Ok(JsonView(true, "操作成功!"));
+
         }
 
         /// <summary>
@@ -7867,6 +7831,8 @@ FROM
 
             //消息通知
             await EnterExitCostMobileOpNotice(dto.DiId, id,dto.CurrUserId);
+            //汇率信息记录
+            await GeneralMethod.RateRecordSave(dto.CurrUserId, id, "出入境费用");
 
             return Ok(JsonView(true));
         }
@@ -8402,6 +8368,47 @@ FROM
             return Ok(JsonView(new { isSelect = dto.IsSelect, itemTotal = itemTotal }));
         }
 
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - 3-6子项删除
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostMobileSubItemDel(EnterExitCostSubItemDelDto dto)
+        {
+            var data = await _enterExitCostRep.PostEnterExitCostSubItemDel(dto);
+
+            if (data.Code != 0)
+            {
+                return Ok(JsonView(false, data.Msg));
+            }
+
+            return Ok(JsonView(true, "操作成功!", data.Data));
+        }
+
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - 其他费用删除
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult EnterExitCostMobileOtherFeeDel(EnterExitCostSubItemDelDto dto)
+        {
+            var data = new Grp_DayOtherPrice()
+            {
+                Id = dto.Id,
+                IsDel = 1,
+                DeleteUserId = dto.DeleteUserId,
+                DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")
+            };
+
+            var del = _sqlSugar.Updateable(data).UpdateColumns(it => new { it.IsDel, it.DeleteUserId, it.DeleteTime }).ExecuteCommand();
+
+            if (del > 0) return Ok(JsonView(true,"删除成功!"));
+
+            return Ok(JsonView(false,"删除失败!"));
+        }
+
         #endregion
 
         #endregion

+ 27 - 18
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -4216,45 +4216,54 @@ ORDER BY
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> StatisticsInvitation(YOYDto _dto)
         {
-
             if (_dto.Year < 1) return Ok(JsonView(false, "操作失败"));
 
-
             string beginDt = $"{_dto.Year}-01-01 00:00:00",
                    endDt = $"{_dto.Year}-12-31 23:59:59";
 
             string sql = string.Format(@"
 SELECT
-  ioa.DiId,
-  ioa.InviterArea AS Country
+  oa.DiId,
+  di.TeamName AS GroupName,
+  oa.Country,
+  oa.Area AS City,
+  oa.Client,
+  oa.Date
 FROM
-  Grp_InvitationOfficialActivities ioa
-  INNER JOIN Grp_CreditCardPayment ccp ON ioa.Id = ccp.CId
-  AND ccp.IsDel = 0
-  AND ccp.CTable = 81
-  INNER JOIN Grp_DelegationInfo di ON ioa.DiId = di.Id
+  Res_OfficialActivities oa
+  LEFT JOIN Grp_DelegationInfo di ON oa.DiId = di.Id
 WHERE
-  ioa.IsDel = 0
-  AND di.TeamDid IN (38,39,40,1048)
-  AND ccp.IsPay = 1
-  AND ioa.CreateTime BETWEEN '{0}' AND '{1}'
-", beginDt, endDt);
+  oa.IsDel = 0
+  AND oa.Date BETWEEN '{0}' AND '{1}'
+  ", beginDt, endDt);
 
-            var data = await _sqlSugar.SqlQueryable<StatisticsInvitation>(sql).ToListAsync();
+            var data = await _sqlSugar.SqlQueryable<StatisticsInvitation_HW>(sql).ToListAsync();
 
-            var groupByData = data.GroupBy(x => x.Country)
+            var groupByCountry = data.GroupBy(x => x.Country)
                                   .Select(g => new
                                   {
                                       Country = g.Key,
                                       TimeNum = g.Count(),
-                                      LinkGroupIds = g.Select(x => x.DIId).ToList()
+                                      LinkGroupIds = g.Select(x => x.GroupName).Distinct().ToList()
+
+                                  })
+                                  .OrderByDescending(x => x.TimeNum)
+                                  .Take(10)
+                                  .ToList();
+            var groupByClient = data.GroupBy(x => x.Client)
+                                  .Select(g => new
+                                  {
+                                      Country = g.Key,
+                                      TimeNum = g.Count(),
+                                      LinkGroupIds = g.Select(x => x.GroupName).Distinct().ToList()
 
                                   })
                                   .OrderByDescending(x => x.TimeNum)
                                   .Take(10)
                                   .ToList();
+            
 
-            return Ok(JsonView(true, "操作成功!", groupByData));
+            return Ok(JsonView(true, "操作成功!", new { groupByCountry= groupByCountry, groupByClient = groupByClient }));
         }
 
         /// <summary>

+ 10 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs

@@ -925,6 +925,16 @@ namespace OASystem.Domain.ViewModels.Financial
     #endregion
 
     #region 商邀邀请
+
+    public class StatisticsInvitation_HW
+    {
+        public int DIId { get; set; }
+        public string GroupName { get; set; }
+        public string Country { get; set; }
+        public string City { get; set; }
+        public string Client { get; set; }
+    }
+
     public class StatisticsInvitation
     {
         public int DIId { get; set; }