Browse Source

出入境费用明细移动端新增 设置view权限、查看权限用户 api,查看、编辑 api 新增对应权限验证

LEIYI 2 months ago
parent
commit
9d4959aff6

File diff suppressed because it is too large
+ 1369 - 16
OASystem/OASystem.Api/Controllers/GroupsController.cs


+ 17 - 13
OASystem/OASystem.Api/Controllers/MarketCustomerResourcesController.cs

@@ -857,22 +857,26 @@ namespace OASystem.API.Controllers
                 }).ToListAsync();
 
             var view = new List<dynamic>();
-            foreach (var item in datas)
+
+            if (datas.Any()) 
             {
-                var text = item.OperationItem.GetDescription();
+                datas = datas.OrderByDescending(x => x.CreateTime).ToList();
+                foreach (var item in datas)
+                {
+                    var text = item.OperationItem.GetDescription();
 
-                view.Add(new {
-                    Client = AesEncryptionHelper.Decrypt(item.Client),
-                    item.PortType,
-                    item.OperationItem,
-                    text = text,
-                    item.DataId,
-                    item.CnName,
-                    item.CreateTime
-                });
+                    view.Add(new
+                    {
+                        Client = AesEncryptionHelper.Decrypt(item.Client),
+                        item.PortType,
+                        item.OperationItem,
+                        text = text,
+                        item.DataId,
+                        item.CnName,
+                        item.CreateTime
+                    });
+                }
             }
-
-
             return Ok(JsonView(view));
 
         }

+ 380 - 0
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDto.cs

@@ -24,6 +24,10 @@ namespace OASystem.Domain.Dtos.Groups
         public int CurrUserId { get; set; }
     }
 
+    public class EnterExitCostMobileViewPermissionUsersDto : EnterExitCostInfobyDiIdDto
+    {
+    }
+
     public class PostEnterExitCostMobileSubInfoDto : EnterExitCostInfobyDiIdDto
     {
         /// <summary>
@@ -440,6 +444,7 @@ namespace OASystem.Domain.Dtos.Groups
     public class PostEnterExitCostMobileGroupDataDto : DtoBase
     {
 
+        public int CurrUserId { get; set; }
         public string GroupName { get; set; }
     }
 
@@ -486,6 +491,15 @@ namespace OASystem.Domain.Dtos.Groups
 
     #region op
 
+    public class EnterExitCostMobileSetViewPermissiionDto 
+    {
+        public int DiId { get; set; }
+
+        public int[] UserIds { get; set; }
+
+        public int CurrUserId { get; set; }
+    }
+
     public class PostEnterExitCostMobileUpdateDtoBase : PortDtoBase {
 
         public int Id { get; set; }
@@ -811,4 +825,370 @@ namespace OASystem.Domain.Dtos.Groups
     #endregion
 
     #endregion
+
+
+    //#region Draft Mobile Request Dto
+
+    //public class PostEnterExitCostDraftMobileGroupDataDto : DtoBase
+    //{
+
+    //    public string GroupName { get; set; }
+    //}
+
+    //public class PostEnterExitCostDraftMobileCurrencyDataDto : DtoBase
+    //{
+    //    public string CurrencyName { get; set; }
+    //}
+
+    //public class PostEnterExitCostDraftMobileOtherItemCurrencyDataDto : PortDtoBase
+    //{
+    //    public int DraftId { get; set; }
+    //}
+
+    //public class EnterExitCostDraftMobileFeeTipsDto : PortDtoBase
+    //{
+
+    //    /// <summary>
+    //    /// 提示数据类型
+    //    /// 1 实时汇率
+    //    /// 2 签证费用
+    //    /// 3 机票费用
+    //    /// </summary>
+    //    public int TipsType { get; set; }
+    //}
+
+    //public class EnterExitCostDraftMobileParentInfoDto
+    //{
+    //    public int DraftId { get; set; }
+    //}
+
+
+    //#region op
+
+    //public class PostEnterExitCostMobileUpdateDtoBase : PortDtoBase
+    //{
+
+    //    public int Id { get; set; }
+
+    //    public int DiId { get; set; }
+
+    //    public int CurrUserId { get; set; }
+
+    //}
+
+    //public class PostEnterExitCostMobileFeeRateOpDto : PostEnterExitCostMobileUpdateDtoBase
+    //{
+    //    /// <summary>
+    //    ///  多个币种存储
+    //    ///  存储方式: 美元(USD):6.2350|.......|墨西哥比索(MXN):1.0000
+    //    /// </summary>
+    //    public CurrencyInfo[] Currencys { get; set; }
+    //}
+
+    //public class PostEnterExitCostMobileFeeOpCheckboxDto : PostEnterExitCostMobileUpdateDtoBase
+    //{
+
+    //    /// <summary>
+    //    ///  境内费用(其他费用)选择框
+    //    /// </summary>
+    //    public int ChoiceOne { get; set; }
+
+    //    /// <summary>
+    //    ///  国际旅费合计选择框
+    //    /// </summary>
+    //    public int ChoiceTwo { get; set; }
+
+    //    /// <summary>
+    //    ///  经济舱小计选择框
+    //    /// </summary>
+    //    public int SumJJC { get; set; }
+
+    //    /// <summary>
+    //    ///  公务舱小计选择框
+    //    /// </summary>
+    //    public int SumGWC { get; set; }
+
+    //    /// <summary>
+    //    ///  公务舱小计选择框
+    //    /// </summary>
+    //    public int SumTDC { get; set; }
+
+    //    /// <summary>
+    //    ///  住宿费合计选择框
+    //    /// </summary>
+    //    public int ChoiceThree { get; set; }
+
+    //    /// <summary>
+    //    ///  伙食费合计选择框
+    //    /// </summary>
+    //    public int ChoiceFour { get; set; }
+
+    //    /// <summary>
+    //    ///  公杂费合计选择框
+    //    /// </summary>
+    //    public int ChoiceFive { get; set; }
+
+    //    /// <summary>
+    //    ///  培训费用选择框
+    //    /// </summary>
+    //    public int ChoiceSix { get; set; }
+
+    //    /// <summary>
+    //    ///  其他费用选择框
+    //    /// </summary>
+    //    public int OtherExpenses_Checked { get; set; }
+    //}
+
+
+    //public class EnterExitCostMobileOpSingleCheckboxDto : PostEnterExitCostMobileUpdateDtoBase
+    //{
+    //    /// <summary>
+    //    /// 子项复选框类型
+    //    /// 3:住宿费; 4:伙食费; 5:公杂费; 6:培训费;7:其他;
+    //    /// </summary>
+    //    public int ItemType { get; set; }
+
+    //    /// <summary>
+    //    /// 是否选中
+    //    /// 0 未选择 1 选中
+    //    /// </summary>
+    //    public int IsSelected { get; set; }
+    //}
+    //public class PostEnterExitCostMobileOpStep1Dto : PostEnterExitCostMobileUpdateDtoBase
+    //{
+    //    /// <summary>
+    //    /// 复选框选中
+    //    ///  0 未选中 1 选中
+    //    /// </summary>
+    //    public int ChoiceOne { get; set; }
+
+    //    /// <summary>
+    //    /// 签证费
+    //    /// </summary>
+    //    public decimal Visa { get; set; }
+
+    //    /// <summary>
+    //    /// 签证费描述
+    //    /// </summary>
+    //    public string? VisaRemark { get; set; }
+
+    //    /// <summary>
+    //    /// 疫苗费
+    //    /// </summary>
+    //    public decimal YiMiao { get; set; }
+
+    //    /// <summary>
+    //    /// 核酸检测费用
+    //    /// </summary>
+    //    public decimal HeSuan { get; set; }
+
+    //    /// <summary>
+    //    /// 服务费用
+    //    /// </summary>
+    //    public decimal Service { get; set; }
+
+    //    /// <summary>
+    //    /// 参展门票
+    //    /// </summary>
+    //    public decimal Ticket { get; set; }
+
+    //    /// <summary>
+    //    /// 保险费
+    //    /// </summary>
+    //    public decimal Safe { get; set; }
+
+    //    public string FirstItemRemark { get; set; }
+    //}
+
+    //public class PostEnterExitCostMobileOpStep2Dto : PostEnterExitCostMobileUpdateDtoBase
+    //{
+    //    /// <summary>
+    //    /// 复选框选中(经济舱)
+    //    /// 0 未选中 1 选中
+    //    /// </summary>
+
+    //    public int ChoiceTwoJJ { get; set; }
+
+    //    /// <summary>
+    //    /// 国际旅费合计(经济舱)
+    //    /// </summary>
+    //    public decimal OutsideJJPay { get; set; }
+
+    //    /// <summary>
+    //    /// 复选框选中(公务舱)
+    //    /// 0 未选中 1 选中
+    //    /// </summary>
+
+    //    public int ChoiceTwoGW { get; set; }
+    //    /// <summary>
+    //    ///  国际旅费合计(公务舱)
+    //    /// </summary>
+    //    public decimal OutsideGWPay { get; set; }
+
+    //    /// <summary>
+    //    /// 复选框选中(头等舱)
+    //    /// 0 未选中 1 选中
+    //    /// </summary>
+
+    //    public int ChoiceTwoTD { get; set; }
+
+    //    /// <summary>
+    //    /// 国际旅费合计(头等舱)
+    //    /// </summary>
+    //    public decimal OutsideTDPay { get; set; }
+
+    //    /// <summary>
+    //    ///  国际机票(经济舱)
+    //    /// </summary>
+    //    public decimal AirJJ { get; set; }
+
+    //    /// <summary>
+    //    ///  国际机票(公务舱)
+    //    /// </summary>
+    //    public decimal AirGW { get; set; }
+
+    //    /// <summary>
+    //    ///  国际机票(头等舱)
+    //    /// </summary>
+    //    public decimal AirTD { get; set; }
+
+    //    /// <summary>
+    //    ///  国外城市间交通费
+    //    /// </summary>
+    //    public decimal CityTranffic { get; set; }
+    //    public string TwoItemRemark { get; set; }
+    //}
+
+    //public class PostEnterExitCostMobileOpStep3To6Dto
+    //{
+    //    public int PortType { get; set; }
+    //    public int DiId { get; set; }
+
+    //    public int CurrUserId { get; set; }
+
+    //    /// <summary>
+    //    /// 费用类型
+    //    /// 1 住宿费;2 伙食费;3 公杂费;4 培训费
+    //    /// </summary>
+    //    public int FeeType { get; set; }
+
+    //    /// <summary>
+    //    /// 详情
+    //    /// </summary>
+    //    public DayAndCostMobileInfoDto[] Infos { get; set; }
+    //}
+
+    //public class PostEnterExitCostMobileOpSingleStep3To6Dto : DayAndCostMobileInfoDto
+    //{
+    //    public int PortType { get; set; }
+    //    public int DiId { get; set; }
+
+    //    public int CurrUserId { get; set; }
+
+    //    /// <summary>
+    //    /// 数据主表Id
+    //    /// </summary>
+    //    //public int ParentId { get; set; }
+
+    //    /// <summary>
+    //    /// 复选框
+    //    /// 0 未选中 1 选中
+    //    /// </summary>
+    //    //public int IsSelect { get; set; }
+
+    //    /// <summary>
+    //    /// 费用类型
+    //    /// 3 住宿费;4 伙食费;5 公杂费;6 培训费
+    //    /// </summary>
+    //    public int FeeType { get; set; }
+
+    //}
+
+    //public class DayAndCostMobileInfoDto
+    //{
+    //    /// <summary>
+    //    /// 数据子表Id
+    //    /// </summary>
+    //    public int SubId { get; set; }
+
+    //    /// <summary>
+    //    /// 天数
+    //    /// </summary>
+    //    public int Days { get; set; }
+
+    //    /// <summary>
+    //    /// 地名Id
+    //    /// </summary>
+    //    public int NationalTravelFeeId { get; set; }
+
+    //    /// <summary>
+    //    /// 费用标准
+    //    /// </summary>
+    //    public decimal Cost { get; set; }
+
+    //    /// <summary>
+    //    /// 币种
+    //    /// Sys_SetData STid = 66
+    //    /// </summary>
+    //    public int Currency { get; set; }
+
+    //    /// <summary>
+    //    /// 小计
+    //    /// </summary>
+    //    public decimal SubTotal { get; set; }
+    //}
+
+    //public class PostEnterExitCostMobileOpStep7Dto
+    //{
+    //    public int PortType { get; set; }
+    //    public int DiId { get; set; }
+
+    //    public int CurrUserId { get; set; }
+
+    //    /// <summary>
+    //    /// 详情
+    //    /// </summary>
+    //    public DayOtherPriceMobileInfoDto[] Infos { get; set; }
+    //}
+
+    //public class PostEnterExitCostMobileOpSingleStep7Dto : DayOtherPriceMobileInfoDto
+    //{
+    //    public int PortType { get; set; }
+    //    //public int DiId { get; set; }
+
+    //    public int CurrUserId { get; set; }
+
+    //    ///// <summary>
+    //    ///// 数据主表Id
+    //    ///// </summary>
+    //    //public int ParentId { get; set; }
+
+    //    ///// <summary>
+    //    ///// 复选框
+    //    ///// 0 未选中 1 选中
+    //    ///// </summary>
+    //    //public int IsSelect { get; set; }
+
+    //}
+
+    //public class DayOtherPriceMobileInfoDto
+    //{
+    //    public int SubId { get; set; }
+    //    public int Diid { get; set; }
+
+    //    public int SetDataId { get; set; }
+
+    //    public int Index { get; set; }
+
+    //    public decimal Cost { get; set; }
+
+    //    public int Currency { get; set; }
+
+    //    public decimal SubTotal { get; set; }
+
+    //    public string Remark { get; set; }
+    //}
+    //#endregion
+
+    //#endregion
 }

+ 182 - 0
OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostView.cs

@@ -471,6 +471,16 @@ namespace OASystem.Domain.ViewModels.Groups
 
     #region 移动端
 
+    public class EnterExitCostMobileGroupView
+    {
+        public int Id { get; set; }
+        public string GroupName { get; set; }
+        public bool IsNull { get; set; }
+        public bool IsEdit { get; set; }
+        public bool IsView { get; set; }
+    }
+
+
     #region info View
     public class EnterExitCostMobileInfoView
     {
@@ -1025,8 +1035,180 @@ namespace OASystem.Domain.ViewModels.Groups
 
     #endregion
 
+
     #endregion
 
+    //#region 移动端 草稿
+
+    //#region Info Parent View
+
+    //public class EnterExitCostDraftMobileParentInfoView
+    //{
+    //    public int Id { get; set; }
+
+
+    //    #region 汇率币种
+
+    //    /// <summary>
+    //    ///  多个币种存储
+    //    ///  存储方式: 美元(USD):6.2350|.......|墨西哥比索(MXN):1.0000
+    //    /// </summary>
+    //    public List<CurrencyInfo> Currencys { get; set; } = new List<CurrencyInfo> { };
+
+    //    #endregion
+
+    //    #region 1:境内费用(其他费用)
+    //    /// <summary>
+    //    ///  境内费用(其他费用)选择框
+    //    /// </summary>
+    //    public int ChoiceOne { get; set; }
+
+    //    /// <summary>
+    //    /// 境内费用(其他费用) 合计
+    //    /// </summary>
+    //    public decimal ChoiceOneTotalCost { get; set; }
+
+    //    #endregion
+
+    //    #region 2:国际旅费
+    //    /// <summary>
+    //    ///  国际旅费合计选择框 (经济舱)
+    //    /// </summary>
+    //    public int ChoiceTwoJJ { get; set; }
+
+    //    /// <summary>
+    //    /// 国际旅费合计(经济舱)
+    //    /// </summary>
+    //    public decimal OutsideJJPay { get; set; }
+
+    //    /// <summary>
+    //    ///  国际旅费合计选择框(公务舱)
+    //    /// </summary>
+    //    public int ChoiceTwoGW { get; set; }
+
+    //    /// <summary>
+    //    ///  国际旅费合计(公务舱)
+    //    /// </summary>
+    //    public decimal OutsideGWPay { get; set; }
+
+    //    /// <summary>
+    //    ///  国际旅费合计选择框(头等舱)
+    //    /// </summary>
+    //    public int ChoiceTwoTD { get; set; }
+
+    //    /// <summary>
+    //    /// 国际旅费合计(头等舱)
+    //    /// </summary>
+    //    public decimal OutsideTDPay { get; set; }
+
+    //    #endregion
+
+    //    #region 3:住宿费
+    //    /// <summary>
+    //    /// 住宿费合计 选择框
+    //    /// </summary>
+    //    public int ChoiceThree { get; set; }
+
+    //    /// <summary>
+    //    /// 住宿费合计
+    //    /// </summary>
+    //    public decimal ChoiceThreeTotalCost { get; set; }
+
+
+    //    #endregion
+
+    //    #region 4:伙食费
+    //    /// <summary>
+    //    ///  伙食费合计 选择框
+    //    /// </summary>
+    //    public int ChoiceFour { get; set; }
+
+    //    /// <summary>
+    //    /// 伙食费合计
+    //    /// </summary>
+    //    public decimal ChoiceFourTotalCost { get; set; }
+
+
+    //    #endregion
+
+    //    #region 5:公杂费
+    //    /// <summary>
+    //    ///  公杂费合计 选择框
+    //    /// </summary>
+    //    public int ChoiceFive { get; set; }
+
+    //    /// <summary>
+    //    /// 公杂费合计
+    //    /// </summary>
+    //    public decimal ChoiceFiveTotalCost { get; set; }
+
+
+    //    #endregion
+
+    //    #region 6:培训费
+
+    //    /// <summary>
+    //    ///  培训费用选择框
+    //    /// </summary>
+    //    public int ChoiceSix { get; set; }
+
+    //    /// <summary>
+    //    /// 公杂费合计
+    //    /// </summary>
+    //    public decimal ChoiceSixTotalCost { get; set; }
+
+    //    #endregion
+
+    //    #region 7:其他
+    //    /// <summary>
+    //    /// 其他款项 选择框
+    //    /// </summary>
+    //    public int OtherExpenses_Checked { get; set; }
+
+    //    /// <summary>
+    //    /// 其他款项 选择框
+    //    /// </summary>
+    //    public decimal OtherExpensesTotalCost { get; set; }
+
+    //    #endregion
+
+    //    /// <summary>
+    //    /// 经济舱费用总计
+    //    /// </summary>
+    //    public decimal TouristClassTotalCost
+    //    {
+    //        get
+    //        {
+    //            return OutsideJJPay <= 0 ? 0.00M : OutsideJJPay + ChoiceOneTotalCost + ChoiceThreeTotalCost + ChoiceFourTotalCost + ChoiceFiveTotalCost + ChoiceSixTotalCost + OtherExpensesTotalCost;
+    //        }
+    //    }
+
+    //    /// <summary>
+    //    /// 公务舱费用总计
+    //    /// </summary>
+    //    public decimal BusinessClassTotalCost
+    //    {
+    //        get
+    //        {
+    //            return OutsideGWPay <= 0 ? 0.00M : OutsideGWPay + ChoiceOneTotalCost + ChoiceThreeTotalCost + ChoiceFourTotalCost + ChoiceFiveTotalCost + ChoiceSixTotalCost + OtherExpensesTotalCost;
+    //        }
+    //    }
+
+    //    /// <summary>
+    //    /// 头等舱费用总计
+    //    /// </summary>
+    //    public decimal FirstClassTotalCost
+    //    {
+    //        get
+    //        {
+    //            return OutsideTDPay <= 0 ? 0.00M : OutsideTDPay + ChoiceOneTotalCost + ChoiceThreeTotalCost + ChoiceFourTotalCost + ChoiceFiveTotalCost + ChoiceSixTotalCost + OtherExpensesTotalCost;
+    //        }
+    //    }
+    //}
+
+    //#endregion
+
+    //#endregion
 
 
 

+ 3 - 24
OASystem/OASystem.Domain/ViewModels/Statistics/CorporateProfitViews.cs

@@ -102,14 +102,7 @@ namespace OASystem.Domain.ViewModels.Statistics
         {
             get
             {
-                var total = ReceivedAmount - RefundedAmount; 
-                var totalInt = (int)(total * 100);
-
-                var total1 = new decimal(0, 0, 0, false, 2);
-                if (total > 0) total1 = new decimal(totalInt, 0, 0, false, 2);
-                else if (total < 0) total1 = new decimal(totalInt, 0, 0, true, 2);
-
-                return total1;
+                return ReceivedAmount - RefundedAmount; 
             }
         }
         /// <summary>
@@ -119,14 +112,7 @@ namespace OASystem.Domain.ViewModels.Statistics
         {
             get
             {
-                var total = HotelAmount + LocalGuideAmount + AirTicketAmount + VisaAmount + OAAmount + InsureAmount + OtherAmount;
-                var totalInt = (int)(total * 100);
-
-                var total1 = new decimal(0, 0, 0, false, 2);
-                if (total > 0) total1 = new decimal(totalInt, 0, 0, false, 2);
-                else if (total < 0) total1 = new decimal(totalInt, 0, 0, true, 2);
-
-                return total1;
+                return HotelAmount + LocalGuideAmount + AirTicketAmount + VisaAmount + OAAmount + InsureAmount + OtherAmount;
             }
         }
         /// <summary>
@@ -136,14 +122,7 @@ namespace OASystem.Domain.ViewModels.Statistics
         {
             get
             {
-                var total = CollectionTotal - CostTotal;
-                var totalInt = (int)(total * 100);
-
-                var total1 = new decimal(0, 0, 0, false, 2);
-                if (total > 0) total1 = new decimal(totalInt, 0, 0, false, 2);
-                else if (total < 0) total1 = new decimal(totalInt, 0, 0, true, 2);
-
-                return total1;
+                return CollectionTotal - CostTotal;
             }
         }
     }

+ 42 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -100,6 +100,48 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return result;
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="groupId"></param>
+        /// <param name="currUserId"></param>
+        /// <param name="permissionType">1 查看 2 编辑</param>
+        /// <returns></returns>
+        public async Task<(bool, string)> MobilePermissionsValidationAsync(int groupId,int currUserId,int permissionType = 1)
+        {
+            bool status = false;
+            string msg = string.Empty;
+
+            var enterExitCostData = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == groupId && it.IsDel == 0);
+            if (permissionType == 1)
+            {
+                status = await PermissionValidationAsync(groupId, currUserId);//查看权限
+                if (enterExitCostData.CreateUserId == currUserId) status = true; //查看权限
+                if (!status)
+                {
+                    var setUserName = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.Id == enterExitCostData.CreateUserId).Select(x => x.CnName).FirstAsync();
+
+                    msg = $"{setUserName}设置了你不能查看当前团组的出入境费用明细数据,如要查看,请联系{setUserName}!";
+                }
+                return (status, msg);
+            }
+            else if (permissionType == 2)
+            {
+                if (enterExitCostData.CreateUserId == currUserId) status = true; //编辑权限
+                if (!status)
+                {
+                    var setUserName = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.Id == enterExitCostData.CreateUserId).Select(x => x.CnName).FirstAsync();
+
+                    msg = $"您没有编辑权限,“{setUserName}”才可编辑!";
+                }
+                return (status, msg);
+
+            }
+            else msg = $"请传入正确的权限验证类型!";
+            return (status, msg);
+        }
+
+
         /// <summary>
         /// 查询 根据 Diid 查询
         /// </summary>
@@ -565,7 +607,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return result;
         }
 
-
         /// <summary>
         /// 一键清空
         /// 删除主表数据 Update