소스 검색

1、团组信息 新增字段( 额外超支额度(extOverLimit)、额外超支额度币种(extOverCurrency))及相关接口更改
2、费用验证新增只在删除和修改时触发

Lyyyi 5 일 전
부모
커밋
a0c0356356

+ 40 - 25
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -8170,8 +8170,11 @@ FROM
         public async Task<IActionResult> OpAirTicketRes(AirTicketResOpDto dto)
         {
             //验证
-            (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.AirTicketResOpData.Id, 85);
-            if (vaild) return Ok(JsonView(false, msg));
+            if (dto.Status == 2)
+            {
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.AirTicketResOpData.Id, 85);
+                if (!valid) return Ok(JsonView(false, msg));
+            }
 
             Result groupData = await _airTicketResRep.OpAirTicketRes(dto, _setDataRep.PostCurrencyByDiid);
             if (groupData.Code != 0)
@@ -8513,8 +8516,8 @@ FROM
             try
             {
                 //验证
-                (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 85);
-                if (vaild) return Ok(JsonView(false, msg));
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 85);
+                if (!valid) return Ok(JsonView(false, msg));
 
                 var res = await _airTicketResRep.SoftDeleteByIdAsync<Grp_AirTicketReservations>(dto.Id.ToString(), dto.DeleteUserId);
                 if (res)
@@ -9875,8 +9878,11 @@ FROM
         public async Task<IActionResult> OpInvitationOfficialActivities(OpInvitationOfficialActivitiesDto dto)
         {
             //验证
-            (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 81);
-            if (vaild) return Ok(JsonView(false, msg));
+            if (dto.Status == 2)
+            {
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 81);
+                if (!valid) return Ok(JsonView(false, msg));
+            }
 
             Result groupData = await _InvitationOfficialActivitiesRep.OpInvitationOfficialActivities(dto, _setDataRep.PostCurrencyByDiid);
             if (groupData.Code != 0)
@@ -9926,8 +9932,8 @@ FROM
             try
             {
                 //验证
-                (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 81);
-                if (vaild) return Ok(JsonView(false, msg));
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 81);
+                if (!valid) return Ok(JsonView(false, msg));
 
                 _sqlSugar.BeginTran();
 
@@ -19947,8 +19953,8 @@ FROM
             _sqlSugar.BeginTran();
 
             //验证 
-            (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 80);
-            if (vaild)
+            (bool vaild, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 80);
+            if (!vaild)
             {
                 _sqlSugar.RollbackTran();
                 return Ok(JsonView(false, msg));
@@ -20044,9 +20050,12 @@ end as 'country'
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> OpVisaPrice(OpVisaPriceDto dto)
         {
-            //验证 
-            (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 80);
-            if (vaild) return Ok(JsonView(false, msg));
+            //修改验证
+            if (dto.Status == 2)
+            {
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 80);
+                if (!valid) return Ok(JsonView(false, msg));
+            }
 
             Result groupData = await _visaPriceRep.OpVisaPrice(dto);
             if (groupData.Code != 0)
@@ -20283,8 +20292,8 @@ end as 'country'
                 _sqlSugar.BeginTran();
 
                 //验证 
-                (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 79);
-                if (vaild)
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 79);
+                if (!valid)
                 {
                     _sqlSugar.RollbackTran();
                     return Ok(JsonView(false, msg));
@@ -20429,8 +20438,8 @@ end as 'country'
                 #endregion
 
                 //验证 
-                (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.CTGGRId, 79);
-                if (vaild)
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.CTGGRId, 79);
+                if (!valid)
                 {
                     _sqlSugar.RollbackTran();
                     return Ok(JsonView(false, msg));
@@ -25587,8 +25596,11 @@ AirHotelPrice
             #endregion
 
             //验证 
-            (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(_dto.Id, 76);
-            if (vaild) return Ok(JsonView(false, msg));
+            if (_dto.Id > 0)
+            {
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(_dto.Id, 76);
+                if (!valid) return Ok(JsonView(false, msg));
+            }
 
             JsonView _view = await _hotelPriceRep.AddOrEdit(_dto);
             if (_view.Code != 200)
@@ -25832,8 +25844,8 @@ AirHotelPrice
             #endregion
 
             //验证 
-            (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(_dto.Id, 76);
-            if (vaild) return Ok(JsonView(false, msg));
+            (bool valid, string msg) = await GeneralMethod.FeeOpValid(_dto.Id, 76);
+            if (!valid) return Ok(JsonView(false, msg));
 
             var data = await _hotelPriceRep.Del(_dto.Id, _dto.UserId);
 
@@ -27843,8 +27855,11 @@ AirHotelPrice
         public async Task<IActionResult> OpCustomers(OpCustomersDto dto)
         {
             //验证 
-            (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 82);
-            if (vaild) return Ok(JsonView(false, msg));
+            if (dto.Status == 2)
+            {
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 82);
+                if (!valid) return Ok(JsonView(false, msg));
+            }
 
             Result groupData = await _customersRep.OpCustomers(dto);
             if (groupData.Code != 0)
@@ -28005,8 +28020,8 @@ AirHotelPrice
             try
             {
                 //验证 
-                (bool vaild, string msg) = await GeneralMethod.FeeOpVaild(dto.Id, 82);
-                if (vaild) return Ok(JsonView(false, msg));
+                (bool valid, string msg) = await GeneralMethod.FeeOpValid(dto.Id, 82);
+                if (!valid) return Ok(JsonView(false, msg));
 
                 var res = await _customersRep.SoftDeleteByIdAsync<Grp_Customers>(dto.Id.ToString(), dto.DeleteUserId);
                 if (!res)

+ 17 - 7
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -532,22 +532,32 @@ namespace OASystem.API.OAMethodLib
         /// 79:OP
         /// 76:酒店
         /// </param>
-        /// <returns></returns>
-        public static async Task<(bool, string)> FeeOpVaild(int id, int feeType)
+        /// <returns>
+        /// (是否验证通过, 验证失败时的错误信息)
+        /// 通过:true, null
+        /// 失败:false, 错误信息
+        /// </returns>
+        public static async Task<(bool IsValid, string? ErrorMessage)> FeeOpValid(int id, int feeType)
         {
+            // 查询费用记录
             var ccpInfo = await _sqlSugar.Queryable<Grp_CreditCardPayment>()
                 .Where(x => x.IsDel == 0 && x.CId == id && x.CTable == feeType)
                 .FirstAsync();
-            if (ccpInfo == null) 
-                return (true, "当前费用不存在,不可操作!");
 
+            // 记录不存在
+            if (ccpInfo == null)
+                return (false, "当前费用不存在,不可操作!");
+
+            // 已审核
             if (ccpInfo.IsAuditGM == 1)
-                return (true, "当前费用已审核,不可操作!");
+                return (false, "当前费用已审核,不可操作!");
 
+            // 已付款
             if (ccpInfo.IsPay == 1)
-                return (true, "当前费用已付款,不可操作!");
+                return (false, "当前费用已付款,不可操作!");
 
-            return (false, "可操作");
+            // 验证通过
+            return (true, null);
         }
 
         #endregion

+ 20 - 0
OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs

@@ -313,6 +313,16 @@ namespace OASystem.Domain.Dtos.Groups
         ///  公务需求
         /// </summary>
         public string Officialneeds { get; set; }
+
+        /// <summary>
+        /// 额外超支额度
+        /// </summary>
+        public decimal ExtOverLimit { get; set; }
+
+        /// <summary>
+        /// 额外超支额度币种
+        /// </summary>
+        public int ExtOverCurrency { get; set; }
     }
 
     /// <summary>
@@ -667,6 +677,16 @@ namespace OASystem.Domain.Dtos.Groups
         /// AddMultiple Infos
         /// </summary>
         public List<TourClientListProcessInfo> TourClientListInfos { get; set; }
+
+        /// <summary>
+        /// 额外超支额度
+        /// </summary>
+        public decimal ExtOverLimit { get; set; }
+
+        /// <summary>
+        /// 额外超支额度币种
+        /// </summary>
+        public int ExtOverCurrency { get; set; }
     }
 
 }

+ 12 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_DelegationInfo.cs

@@ -272,5 +272,17 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)",IsJson = true)]
         public List<string> FrFilePaths { get; set; }
 
+        /// <summary>
+        /// 额外超支额度
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal ExtOverLimit { get; set; }
+
+        /// <summary>
+        /// 额外超支额度币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ExtOverCurrency { get; set; }
+
     }
 }

+ 10 - 0
OASystem/OASystem.Domain/ViewModels/Groups/DelegationInfoView.cs

@@ -409,6 +409,16 @@ namespace OASystem.Domain.ViewModels.Groups
         ///  公务需求
         /// </summary>
         public string Officialneeds { get; set; }
+
+        /// <summary>
+        /// 额外超支额度
+        /// </summary>
+        public decimal ExtOverLimit { get; set; }
+
+        /// <summary>
+        /// 额外超支额度币种
+        /// </summary>
+        public int ExtOverCurrency { get; set; }
     }
 
     /// <summary>

+ 9 - 1
OASystem/OASystem.Infrastructure/Repositories/Financial/ForeignReceivablesRepository.cs

@@ -392,6 +392,13 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
             //var groupInfoData = await _delegationRep.GetGroupInfo(new GroupInfoDto() { Id = dto.DiId });
             var groupInfo = await _delegationRep.Query(x => x.Id == dto.DiId).FirstAsync();
+
+            var frFilePaths = new List<string>();
+            if (groupInfo.FrFilePaths != null && groupInfo.FrFilePaths.Count > 0)
+            {
+
+            }
+
             var groupInfoData = new
             {
                 groupInfo.Id,
@@ -403,7 +410,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 groupInfo.VisitPNumber,
                 groupInfo.VisitStartDate,
                 groupInfo.VisitEndDate,
-                IsUploadFile = groupInfo.FrFilePaths != null && groupInfo.FrFilePaths.Count > 0
+                FrFilePaths = frFilePaths,
+                IsUploadFile = frFilePaths != null && frFilePaths.Count > 0
             };
 
 

+ 24 - 7
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -435,7 +435,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 string sql = string.Format(@"Select Id,CityId,SalesQuoteNo,TourCode,JietuanOperator,TeamLevSId,TeamDid,TeamName,ClientName,
 	                                                ClientUnit,VisitCountry,VisitDate,VisitDays,VisitPNumber,TontractTime,IsBid,
 	                                                PayDay,PaymentMoney,VisitPurpose,SpecialNeeds,OtherNeeds,CGRWSPBMMC,CGRWSPWH,
-	                                                ZZSCBMMC,ZZSCSPWH,Remark,TellPhone,WeChatNo,OpRoyaltyLv,OpRoyaltyRemark,Officialneeds
+	                                                ZZSCBMMC,ZZSCSPWH,Remark,TellPhone,WeChatNo,OpRoyaltyLv,OpRoyaltyRemark,Officialneeds,
+                                                    ExtOverLimit,ExtOverCurrency
                                              From Grp_DelegationInfo Where Id = {0} And IsDel = 0", dto.Id);
 
                 var _DelegationInfo = await _sqlSugar.SqlQueryable<DelegationInfoWebView>(sql).FirstAsync();
@@ -450,11 +451,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     {
                         _DelegationInfo.CityName = cityInfo.Name;
                     }
-                    else
-                    {
-                        _DelegationInfo.CityId = 3505;
-                        _DelegationInfo.CityName = "四川-成都";
-                    }
+                    //else
+                    //{
+                    //    _DelegationInfo.CityId = 3505;
+                    //    _DelegationInfo.CityName = "四川-成都";
+                    //}
 
                     //if (_DelegationInfo.TontractTime)
                     //{
@@ -753,6 +754,17 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var rankDatas = await _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 56).Select(x => new TextView { Value = x.Id.ToString(), Text = x.Name }).ToListAsync();
                 rankDatas.Insert(0, new TextView { Value = "0", Text = "全部" });
 
+                //币种信息
+                var currencyDatas = await _sqlSugar.Queryable<Sys_SetData>()
+                    .Where(x => x.IsDel == 0 && x.STid == 66)
+                    .Select(x => new { x.Id,x.Name })
+                    .ToListAsync();
+
+                var sortedList = currencyDatas
+                    .OrderBy(x => x.Name == "CNY" ? 0 : 1)  
+                    .ThenBy(x => x.Name)                    
+                    .ToList();
+
                 result.Code = 0;
                 result.Msg = "成功!";
                 result.Data = new
@@ -763,7 +775,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     clientData = clientData1,
                     depData = userDepDatas,
                     rankData = rankDatas,
-                    cityData = await CityBasicSource()
+                    cityData = await CityBasicSource(),
+                    currencyData = sortedList
                 };
             }
 
@@ -894,6 +907,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         Officialneeds = dto.Officialneeds,
                         VisitStartDate = startTime,
                         VisitEndDate = endTime,
+                        ExtOverLimit = dto.ExtOverLimit,
+                        ExtOverCurrency = dto.ExtOverCurrency
                     };
 
                     var addId = _sqlSugar.Insertable(delegationInfo).ExecuteReturnIdentity();
@@ -945,6 +960,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         Officialneeds = dto.Officialneeds,
                         VisitStartDate = startTime,
                         VisitEndDate = endTime,
+                        ExtOverLimit = dto.ExtOverLimit,
+                        ExtOverCurrency = dto.ExtOverCurrency
                     });
 
                     if (updateStatus)