소스 검색

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

LEIYI 7 달 전
부모
커밋
bda2063697

+ 42 - 9
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -4763,6 +4763,8 @@ Group by PriceType ", dto.diId);
 
             var teamLv = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 56 && x.IsDel == 0).ToList();
 
+            var auditState = new int[] { 1 , 3 };
+
             if (AirTicket.Contains(userId))
             {
                 //提成方式:¥10/人×人数×段数(每个组团涉及的换机次数)
@@ -4771,7 +4773,7 @@ Group by PriceType ", dto.diId);
                     JoinType.Left, a.Id == x.DIId ,
                     JoinType.Left, b.CTable == 85 && b.CId == x.Id )
                 ).Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId  && (b.IsAuditGM == 1 || b.IsAuditGM == 3)
-                    && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && a.IsSure == 1 )
+                    && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) )
                     .Select((x, a, b) => new
                     {
                         x.FlightsDescription,
@@ -4900,12 +4902,12 @@ Group by PriceType ", dto.diId);
             }
             else if (Hotel.Contains(userId))
             {
-                //标准团组:¥10/间/晚 * 实际订房间数 * 实际订房晚数;
+                //标准团组:¥10/间/晚 * 实际订房间数 * 实际订房晚数; setdata id 1001 客人房
                 var listHotel = _sqlSugar.Queryable<Grp_HotelReservations, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new JoinQueryInfos(
                      JoinType.Left,x.DiId == a.Id,
                      JoinType.Left,b.CTable == 76 && b.CId == x.Id  ))
                     .Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.VisitDate >= StartDateTime 
-                    && a.VisitDate <= EndDateTime && a.IsDel == 0 && b.IsDel == 0 && x.CardPrice > 0).Select((x,a,b)=> new
+                    && a.VisitDate <= EndDateTime && a.IsDel == 0 && b.IsDel == 0 && x.CardPrice > 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) && x.CheckType == 1001).Select((x,a,b)=> new
                     {
                         a.Id,
                         a.TeamName,
@@ -4974,7 +4976,7 @@ Group by PriceType ", dto.diId);
             else if (OP.Contains(userId))
             {
                 var OPList = _sqlSugar.Queryable<Grp_DelegationInfo>().Where((a) => a.IsDel == 0
-                     && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime
+                     && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && a.IsSure == 1
                  ).ToList();
 
                 var LvArr = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 70 && x.IsDel == 0).ToList();
@@ -5009,7 +5011,7 @@ Group by PriceType ", dto.diId);
                 var officialList = _sqlSugar.Queryable<Res_OfficialActivities, Grp_DelegationInfo>((x,a)=> 
                     new JoinQueryInfos(JoinType.Left,a.Id == x.DiId)
                 ).Where((x,a) => x.IsSubmitApproval == 0 && x.IsDel == 0 && a.IsDel == 0
-                    && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime
+                    && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && a.IsSure == 1
                 )
                 .Select((x, a) => new
                 {
@@ -5099,11 +5101,13 @@ Group by PriceType ", dto.diId);
             {
                 // 1)办理英国、加拿大、美国签证¥50元 / 人 / 团;
                 // 申根国家及其他所有国家¥30元 / 人 / 团;
+                // setdata id 974 客人
                 var existsCountry = new string[] { "英国", "加拿大", "美国" };
                 var whereExpression = Expressionable.Create<Grp_VisaInfo, Grp_DelegationInfo, Grp_CreditCardPayment>()
                     .And(
                         (x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && (b.IsAuditGM == 1 || b.IsAuditGM == 3)
                         && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && x.IsThird == 0 && x.PassengerType == 974
+                        && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) && x.PassengerType == 974
                     );
                 var listVisa = _sqlSugar.Queryable<Grp_VisaInfo, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new
                     JoinQueryInfos(
@@ -5324,7 +5328,8 @@ Group by PriceType ", dto.diId);
                     Price = x.Price,
                     VisitDate = x.VisitDate,
                     TeamName = x.TeamName,
-                    Temp = x.Temp
+                    Temp = x.Temp,
+                    IsSeed = 0
                 }).ToList();
 
                 var expressionSoftDeleteWhere = Expressionable.Create<Fin_RoyaltyConfirm>()
@@ -5332,7 +5337,7 @@ Group by PriceType ", dto.diId);
                     .And(it => it.VisitDate <= EndDateTime)
                     .And(it => it.IsDel == 0)
                     .And(it => it.UserId == dto.UserId)
-                    .And(it => it.IsConfirm == 0)
+                    .And(it => it.IsSeed == 0)
                     .ToExpression();
 
                 var expressionSelectWhere = Expressionable.Create<Fin_RoyaltyConfirm>()
@@ -5340,7 +5345,7 @@ Group by PriceType ", dto.diId);
                     .And(it => it.VisitDate <= EndDateTime)
                     .And(it => it.IsDel == 0)
                     .And(it => it.UserId == dto.UserId)
-                    .And(it => it.IsConfirm == 1)
+                    .And(it => it.IsSeed == 1)
                     .ToExpression();
 
                 _sqlSugar.BeginTran();
@@ -5362,7 +5367,7 @@ Group by PriceType ", dto.diId);
                     //调用通知
                     var title = "提成确认";
                     var center = $@"{dto.StartData}-{dto.EndData}提成财务已确认,请尽快查看!
-【{dto.StartData}-{dto.EndData}】";
+【{dto.StartData}-{dto.EndData}-{dto.CompanyId}-{dto.DeparId}-{dto.UserId}】";
                     var ids = new List<int> { 235 }; //dto.UserId
                     await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations,title, center, ids);
 
@@ -5428,6 +5433,7 @@ Group by PriceType ", dto.diId);
                     x.TeamLvStr,
                     x.Temp,
                     x.VisitDate,
+                    x.IsSeed
                 });
 
                 jw = JsonView(true, "获取成功!", query);
@@ -5479,6 +5485,33 @@ Group by PriceType ", dto.diId);
             }
             return Ok(jw);
         }
+
+        /// <summary>
+        /// 提成发放
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult RoyaltySeed(RoyaltySeedDto dto)
+        {
+            var jw = JsonView(false);
+            if (dto.Data != null && dto.Data.Count > 0)
+            {
+                var updateCount = _sqlSugar.Updateable<Fin_RoyaltyConfirm>().SetColumns(x => new Fin_RoyaltyConfirm
+                { IsSeed = 1 }).Where(x => dto.Data.Contains(x.Id) && x.IsDel == 0 && x.IsConfirm == 1).ExecuteCommand();
+                var info = $"{updateCount}个团组提成发放成功!";
+                if (dto.Data.Count > updateCount)
+                {
+                    info += $"{dto.Data.Count - updateCount}个团组未确认!";
+                }
+                jw = JsonView(true, info);
+            }
+            else
+            {
+                jw.Msg = "发放的数据为空!";
+            }
+            return Ok(jw);
+        }
         #endregion
     }
 }

+ 5 - 0
OASystem/OASystem.Domain/Dtos/Financial/ComputeRoyaltiesDto.cs

@@ -81,4 +81,9 @@ namespace OASystem.Domain.Dtos.Financial
 
         public int State { get; set; }
     }
+
+    public class RoyaltySeedDto
+    {
+        public List<int> Data { get; set; }
+    }
 }

+ 5 - 0
OASystem/OASystem.Domain/Entities/Financial/Fin_RoyaltyConfirm.cs

@@ -54,5 +54,10 @@ namespace OASystem.Domain.Entities.Financial
         /// </summary>
         public int UserId { get; set; }
 
+        /// <summary>
+        /// 是否发放  1已发放 0未发放
+        /// </summary>
+        public int IsSeed { get; set; }
+
     }
 }