Răsfoiți Sursa

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

LEIYI 1 an în urmă
părinte
comite
9d4959aff6

+ 1369 - 16
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -42,6 +42,7 @@ using System.Globalization;
 using System.IO.Compression;
 using static OASystem.API.OAMethodLib.JWTHelper;
 using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
+using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 using Bookmark = Aspose.Words.Bookmark;
 using Cell = Aspose.Words.Tables.Cell;
 using Table = Aspose.Words.Tables.Table;
@@ -9028,12 +9029,13 @@ FROM
 
             //默认币种显示
             var _currencyInfos = await EnterExitCostMobileGetCurrencyInit();
-
+            var viewPermissionData = await _enterExitCostRep.PermissionViewUsersAsync();
             return Ok(JsonView(true, "查询成功!", new
             {
                 WordTypeData = _WordTypeData,
                 ExcelTypeData = _ExcelTypeData,
-                CurrencyInit = _currencyInfos
+                CurrencyInit = _currencyInfos,
+                viewPermissionData = viewPermissionData
             }));
         }
 
@@ -9046,21 +9048,71 @@ FROM
         public async Task<IActionResult> EnterExitCostMobileGroupData(PostEnterExitCostMobileGroupDataDto dto)
         {
             if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
 
             RefAsync<int> total = 0;
 
             int diId = 0;
             var status = int.TryParse(dto.GroupName, out diId);
 
-            var data = await _sqlSugar.Queryable<Grp_DelegationInfo>()
-                .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.TeamName))
+            string sql = string.Format(@"SELECT
+  Id,
+  TeamName GroupName,
+  CASE WHEN EXISTS (
+    SELECT
+      1
+    FROM
+      Grp_EnterExitCost
+    WHERE
+      IsDel = 0
+      AND DiId = di.Id
+  ) THEN 1 ELSE 0 END AS [IsNull],
+  CASE WHEN EXISTS(
+    SELECT
+      TOP 1 *
+    FROM
+      Grp_EnterExitCost
+    WHERE
+      IsDel = 0
+      AND DiId = di.Id
+      AND CreateUserId = {0}
+    ORDER BY
+      CreateTime DESC
+  ) THEN 1 ELSE 0 END AS [IsEdit],
+  CASE WHEN EXISTS(
+    SELECT
+      TOP 1 *
+    FROM
+      Grp_EnterExitCost
+    WHERE
+      IsDel = 0
+      AND DiId = di.Id
+      AND CreateUserId = {0}
+    ORDER BY
+      CreateTime DESC
+  ) THEN 1 WHEN EXISTS(
+    SELECT
+      TOP 1 *
+    FROM
+      Grp_EnterExitCostPermission
+    WHERE
+      IsDel = 0
+      AND GroupId = di.Id
+      AND Permission = 1
+      AND UserId = {0}
+    ORDER BY
+      CreateTime DESC
+  ) THEN 1 ELSE 0 END AS [IsView]
+FROM
+  Grp_DelegationInfo di
+WHERE
+  di.Isdel = 0 ",dto.CurrUserId);
+
+
+            var data = await _sqlSugar.SqlQueryable<EnterExitCostMobileGroupView>(sql)
+                .Where(x => !string.IsNullOrEmpty(x.GroupName))
                 .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && diId > 0, x => x.Id == diId)
-                .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && !status, x => x.TeamName.Contains(dto.GroupName))
-                .Select(x => new
-                {
-                    Id = x.Id,
-                    GroupName = x.TeamName
-                })
+                .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && !status, x => x.GroupName.Contains(dto.GroupName))
                 .OrderByDescending(x => x.Id)
                 .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
@@ -9253,6 +9305,7 @@ FROM
         {
             if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
             if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
 
             var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
 
@@ -9260,10 +9313,10 @@ FROM
             mobileInfo.DiId = dto.DiId;
             mobileInfo.Currencys = await EnterExitCostMobileGetCurrencyInit();
             if (eecInfo == null) return Ok(mobileInfo);
-            //验证查看、操作权限
-           // var isView = await _enterExitCostRep.vi
-
 
+            //验证查看权限
+            (bool isView, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId);
+            if (!isView) return Ok(JsonView(false, msg));
 
             mobileInfo = _mapper.Map<EnterExitCostMobileParentInfoView>(eecInfo);
 
@@ -9320,6 +9373,32 @@ FROM
             return Ok(mobileInfo);
         }
 
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - 查看权限用户
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostMobileViewPermissionUsers(EnterExitCostMobileViewPermissionUsersDto dto)
+        {
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+            //验证查看权限
+            (bool isView, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId);
+            if (!isView) return Ok(JsonView(false, msg));
+
+            var userIds = Array.Empty<int>();
+
+            userIds = await _sqlSugar
+                .Queryable<Grp_EnterExitCostPermission>()
+                .Where(x => x.IsDel == 0 && x.GroupId == dto.DiId)
+                .Select(x => x.UserId)
+                .ToArrayAsync();
+
+            return Ok(userIds);
+        }
+
         /// <summary>
         /// 团组模块 - 出入境费用-移动端 - SubInfo
         /// </summary>
@@ -9330,10 +9409,16 @@ FROM
         {
             if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
             if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
 
             var subTypes = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
             if (!subTypes.Contains(dto.SubType)) return Ok(JsonView(false, $"请传入有效的subTypeId!"));
 
+            //验证查看权限
+            (bool isView, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId);
+            if (!isView) return Ok(JsonView(false, msg));
+
+
             var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
 
             if (eecInfo == null) return Ok(JsonView(false, $"出入境费用明细未录入!"));
@@ -9580,7 +9665,10 @@ FROM
             var parentId = 0;
 
             var info = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == diId).OrderByDescending(x => x.CreateTime).FirstAsync();
-            if (info != null) parentId = info.Id;
+            if (info != null) {
+
+                parentId = info.Id;
+            }
             else
             {
                 var currencys = await EnterExitCostMobileGetCurrencyInit();
@@ -9592,6 +9680,54 @@ FROM
             return parentId;
         }
 
+        /// <summary>
+        /// 团组模块 - 出入境费用-移动端 - 设置view权限
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> EnterExitCostMobileSetViewPermissiion(EnterExitCostMobileSetViewPermissiionDto dto)
+        {
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+            if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+            if (dto.UserIds.Length < 1) return Ok(JsonView(false, "请传入有效的userId;"));
+
+            //验证编辑权限
+            (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
+            if (!isEdit) return Ok(JsonView(false, msg));
+
+            var permissions = new List<Grp_EnterExitCostPermission>();
+            foreach (var userId in dto.UserIds)
+            {
+                permissions.Add(new Grp_EnterExitCostPermission { Permission = 1, GroupId = dto.DiId, UserId = userId, CreateUserId = dto.CurrUserId });
+            }
+            if (permissions.Any())
+            {
+                _sqlSugar.BeginTran();
+                try
+                {
+                    await _sqlSugar.Deleteable<Grp_EnterExitCostPermission>().Where(it => it.GroupId == dto.DiId).ExecuteCommandAsync();
+
+                    var result = await _sqlSugar.Insertable(permissions).ExecuteCommandAsync();
+                    if (result < 1)
+                    {
+                        _sqlSugar.RollbackTran();
+                        return Ok(JsonView(false));
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                    _sqlSugar.RollbackTran();
+                    return Ok(JsonView(false, ex.Message));
+                }
+                _sqlSugar.CommitTran();
+                return Ok(JsonView(true));
+
+            }
+            return Ok(JsonView(false));
+        }
+
         /// <summary>
         /// 团组模块 - 出入境费用-移动端 - OP --> 汇率
         /// </summary>
@@ -9604,6 +9740,7 @@ FROM
             if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
             if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
             if (dto.Currencys.Length < 1) return Ok(JsonView(false, "请传入有效的汇率信息!"));
+
             var currencyStr = CommonFun.GetCurrencyChinaToString(dto.Currencys.ToList());
             int id = dto.Id;
             if (id <= 0) //add 
@@ -9615,6 +9752,10 @@ FROM
             }
             else //update
             {
+                //验证编辑权限
+                (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
+                if (!isEdit) return Ok(JsonView(false, msg));
+
                 var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>().SetColumns(x => new Grp_EnterExitCost() { CurrencyRemark = currencyStr }).Where(x => x.Id == dto.Id).ExecuteCommandAsync();
                 if (upd < 1) return Ok(JsonView(false));
             }
@@ -9732,6 +9873,10 @@ FROM
             }
             else //update
             {
+                //验证编辑权限
+                (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
+                if (!isEdit) return Ok(JsonView(false, msg));
+
                 var upd = await _sqlSugar.Updateable(checkboxInfo)
                     .UpdateColumns(x => new { 
                         x.ChoiceOne,
@@ -9792,6 +9937,10 @@ FROM
             }
             else //update
             {
+                //验证编辑权限
+                (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
+                if (!isEdit) return Ok(JsonView(false, msg));
+
                 var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
                     .SetColumnsIF(itemTypeId == 3, it => it.ChoiceThree == isSelected)
                     .SetColumnsIF(itemTypeId == 4, it => it.ChoiceFour == isSelected)
@@ -9834,6 +9983,10 @@ FROM
             }
             else //update
             {
+                //验证编辑权限
+                (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
+                if (!isEdit) return Ok(JsonView(false, msg));
+
                 var upd = await _sqlSugar.Updateable(info)
                     .UpdateColumns(x => new {
                         x.ChoiceOne,
@@ -9852,7 +10005,6 @@ FROM
                 if (upd < 1) return Ok(JsonView(false));
             }
 
-
             //消息通知
             await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
 
@@ -9898,6 +10050,10 @@ FROM
             }
             else //update
             {
+                //验证编辑权限
+                (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
+                if (!isEdit) return Ok(JsonView(false, msg));
+
                 var upd = await _sqlSugar.Updateable(info)
                     .UpdateColumns(x => new {
                         x.SumJJC,
@@ -9915,7 +10071,6 @@ FROM
                     .Where(x => x.Id == id)
                     .ExecuteCommandAsync();
                 if (upd <1) return Ok(JsonView(false));
-
             }
 
             jjcItemTotal = info.AirJJ + info.CityTranffic;
@@ -10041,6 +10196,10 @@ FROM
             }
             else
             {
+                //验证编辑权限
+                (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
+                if (!isEdit) return Ok(JsonView(false, msg));
+
                 var subUpd = await _sqlSugar.Updateable(subInfo)
                     .UpdateColumns(x => new
                     {
@@ -10151,6 +10310,11 @@ FROM
             }
             else //upd
             {
+
+                //验证编辑权限
+                (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.Diid, dto.CurrUserId, 2);
+                if (!isEdit) return Ok(JsonView(false, msg));
+
                 var subUpd = await _sqlSugar.Updateable(subInfo)
                     .UpdateColumns(x => new
                     {
@@ -10220,6 +10384,1195 @@ FROM
 
         #endregion
 
+        //#region 团组经理模块 出入境费用-草稿 移动端(Android/IOS)
+
+        ///// <summary>
+        ///// 出入境费用-草稿 移动端
+        ///// 获取币种基础数据(含逻辑处理)
+        ///// </summary>
+        ///// <returns></returns>
+        //private async Task<List<CurrencyInfo>> EnterExitCostDratfMobileGetCurrencyInit()
+        //{
+        //    //默认币种显示
+        //    var _currencyInfos = _currencyInit;
+
+        //    var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
+        //    if (_currencyRate.Count > 0)
+        //    {
+        //        foreach (var item in _currencyInfos)
+        //        {
+        //            var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
+        //            if (rateInfo != null)
+        //            {
+        //                decimal rate1 = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
+        //                rate1 *= 1.035M;
+
+        //                item.Rate = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
+        //            }
+        //        }
+        //    }
+
+        //    return _currencyInfos;
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-草稿-移动端 - 基础数据源(Word明细类型、Excel明细类型、默认币种显示)
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostDraftMobileDataSource(PortDtoBase dto)
+        //{
+        //    string sql = string.Format("Select * From Sys_SetData Where IsDel = 0");
+        //    //SetDataInfoView
+        //    var dataSource = await _sqlSugar.SqlQueryable<Sys_SetData>(sql).ToListAsync();
+
+        //    var wordTypeData = dataSource.Where(it => it.STid == 72).ToList();  //三公费用-Word明细类型
+        //    List<SetDataInfoView> _WordTypeData = _mapper.Map<List<SetDataInfoView>>(wordTypeData);
+
+        //    var excelTypeData = dataSource.Where(it => it.STid == 73).ToList(); //三公费用-Excel明细类型
+        //    List<SetDataInfoView> _ExcelTypeData = _mapper.Map<List<SetDataInfoView>>(excelTypeData);
+
+        //    //默认币种显示
+        //    var _currencyInfos = await EnterExitCostMobileGetCurrencyInit();
+
+        //    return Ok(JsonView(true, "查询成功!", new
+        //    {
+        //        WordTypeData = _WordTypeData,
+        //        ExcelTypeData = _ExcelTypeData,
+        //        CurrencyInit = _currencyInfos
+        //    }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-草稿-移动端 - 团组基础数据Data
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostDraftMobileGroupData(PostEnterExitCostDraftMobileGroupDataDto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+
+        //    RefAsync<int> total = 0;
+
+        //    int diId = 0;
+        //    var status = int.TryParse(dto.GroupName, out diId);
+
+        //    var data = await _sqlSugar.Queryable<Grp_DelegationInfo>()
+        //        .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.TeamName))
+        //        .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && diId > 0, x => x.Id == diId)
+        //        .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && !status, x => x.TeamName.Contains(dto.GroupName))
+        //        .Select(x => new
+        //        {
+        //            Id = x.Id,
+        //            GroupName = x.TeamName
+        //        })
+        //        .OrderByDescending(x => x.Id)
+        //        .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
+
+        //    return Ok(JsonView(true, "查询成功!", data, total));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-草稿-移动端 - 币种基础数据Data
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostDraftMobileCurrencyData(PostEnterExitCostDraftMobileCurrencyDataDto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+
+        //    RefAsync<int> total = 0;
+        //    var data = await _sqlSugar.Queryable<Sys_SetData>()
+        //        .Where(x => x.IsDel == 0 && x.STid == 66)
+        //        .WhereIF(!string.IsNullOrEmpty(dto.CurrencyName), x => x.Name.ToLower().Contains(dto.CurrencyName) || x.Remark.Contains(dto.CurrencyName))
+        //        .Select(x => new
+        //        {
+        //            id = x.Id,
+        //            name = x.Name,
+        //            remark = x.Remark,
+
+        //        })
+        //        .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
+
+        //    return Ok(JsonView(true, "查询成功!", data, total));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - 其他款项 - 币种、费用类型基础数据Data
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostDraftMobileOtherItemCurrencyData(PostEnterExitCostDraftMobileOtherItemCurrencyDataDto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DraftId < 1) return Ok(JsonView(false, MsgTips.Id));
+
+        //    var groupRateData = await GeneralMethod.PostGroupTeamRateByDiIdAndCTableId(dto.PortType,2274, 98);
+
+        //    if (groupRateData == null) return Ok(JsonView(false, "请填写“团组汇率-->其他款项”汇率!"));
+        //    var groupOtherRateData = groupRateData.TeamRates;
+
+        //    var enterExitCostInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().FirstAsync(it => it.Id == dto.DraftId && it.IsDel == 0);
+        //    if (enterExitCostInfo == null) return Ok(JsonView(groupOtherRateData));
+        //    var eecRateData = (List<CurrencyInfo>?)CommonFun.GetCurrencyChinaToList(enterExitCostInfo.CurrencyRemark);
+
+        //    groupOtherRateData = groupOtherRateData
+        //        .Select(x => new TeamRateDescAddCurrencyIdView
+        //        {
+        //            CurrencyId = x.CurrencyId,
+        //            CurrencyName = x.CurrencyName,
+        //            CurrencyCode = x.CurrencyCode,
+        //            Rate = eecRateData.Find(it => it.CurrencyCode.ToUpper().Equals(x.CurrencyCode.ToUpper()))?.Rate ?? x.Rate
+
+        //        }).ToList();
+
+        //    var otherFeeTypeData = await _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 92).Select(x => new { x.Id, x.Name }).ToListAsync();
+
+        //    return Ok(JsonView(true, "查询成功!", new { groupOtherRateData = groupOtherRateData, otherFeeTypeData = otherFeeTypeData }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - 实时汇率、签证费用、机票费用 Tips
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostDraftMobileFeeTips(EnterExitCostDraftMobileFeeTipsDto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+
+        //    var tipsData = new List<int>() { 1, 2, 3 };
+        //    if (!tipsData.Contains(dto.TipsType)) return Ok(JsonView(false, $"请传入有效的TipsType参数;1 实时汇率;2 签证费用;3 机票费用;"));
+
+        //    if (dto.TipsType == 1)
+        //    {
+        //        //默认币种显示
+        //        var _currencyInfos = _currencyInit;
+        //        var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
+        //        List<dynamic> reteInfos = new List<dynamic>();
+        //        if (_currencyRate.Count > 0)
+        //        {
+        //            foreach (var item in _currencyInfos)
+        //            {
+        //                var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
+        //                if (rateInfo != null)
+        //                {
+        //                    item.Rate = Convert.ToDecimal((Convert.ToDecimal(rateInfo.FSellPri == null ? 0.00M : rateInfo.FSellPri) / 100.00M).ToString("#0.0000"));
+
+        //                    decimal rate1 = item.Rate;
+        //                    rate1 *= 1.03M;
+
+        //                    decimal rate2 = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
+
+        //                    reteInfos.Add(new
+        //                    {
+        //                        currCode = item.CurrencyCode,
+        //                        currName = item.CurrencyName,
+        //                        rate = rate2,
+        //                        lastUpdateDt = rateInfo.Date + " " + rateInfo.Time
+        //                    });
+        //                }
+        //            }
+        //        }
+
+        //        return Ok(JsonView(true, "查询成功!", reteInfos));
+        //    }
+        //    else if (dto.TipsType == 2)
+        //    {
+                
+
+        //    }
+        //    else if (dto.TipsType == 3)
+        //    {
+               
+        //    }
+        //    return Ok(JsonView(false));
+        //}
+
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - ParentInfo
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostDraftMobileParentInfo(EnterExitCostDraftMobileParentInfoDto dto)
+        //{
+        //    if (dto.DraftId < 1) return Ok(JsonView(false, MsgTips.DiId));
+
+        //    var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.Id == dto.DraftId && it.IsDel == 0);
+
+        //    var mobileInfo = new EnterExitCostDraftMobileParentInfoView();
+        //    mobileInfo.Currencys = await EnterExitCostMobileGetCurrencyInit();
+        //    if (eecInfo == null) return Ok(mobileInfo);
+        //    //验证查看、操作权限
+        //    // var isView = await _enterExitCostRep.vi
+
+
+
+        //    mobileInfo = _mapper.Map<EnterExitCostMobileParentInfoView>(eecInfo);
+
+        //    var dayAndCostData = _sqlSugar.Queryable<Grp_DayAndCost>()
+        //        .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
+        //        .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
+        //        .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId)
+        //        .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
+        //        {
+        //            SubId = dac.Id,
+        //            DiId = dac.DiId,
+        //            Type = dac.Type,
+        //            Days = dac.Days,
+        //            NationalTravelFeeId = dac.NationalTravelFeeId,
+        //            Arae = $"{ntf.Country}-{ntf.City}",
+        //            Cost = dac.Cost,
+        //            Currency = dac.Currency,
+        //            CurrencyName = sd.Name,
+        //            SubTotal = dac.SubTotal,
+        //        })
+        //        .ToList();
+
+        //    mobileInfo.ChoiceOneTotalCost = eecInfo.InsidePay;
+        //    mobileInfo.ChoiceTwoJJ = eecInfo.SumJJC;
+        //    mobileInfo.ChoiceTwoGW = eecInfo.SumGWC;
+        //    mobileInfo.ChoiceTwoTD = eecInfo.SumTDC;
+        //    mobileInfo.Currencys = !string.IsNullOrEmpty(eecInfo.CurrencyRemark) ? CommonFun.GetCurrencyChinaToList(eecInfo.CurrencyRemark) : mobileInfo.Currencys;
+        //    mobileInfo.ChoiceThreeTotalCost = dayAndCostData.Where(it => it.Type == 1).Sum(x => x.SubTotal); //住宿费 1
+        //    mobileInfo.ChoiceFourTotalCost = dayAndCostData.Where(it => it.Type == 2).Sum(x => x.SubTotal);  //伙食费 2
+        //    mobileInfo.ChoiceFiveTotalCost = dayAndCostData.Where(it => it.Type == 3).Sum(x => x.SubTotal);  //公杂费 3
+        //    mobileInfo.ChoiceSixTotalCost = dayAndCostData.Where(it => it.Type == 4).Sum(x => x.SubTotal);   //培训费 4
+        //    //其他款项
+        //    var otherData = _sqlSugar.Queryable<Grp_DayOtherPrice>()
+        //        .LeftJoin<Sys_SetData>((dop, sd1) => dop.SetDataId == sd1.Id)
+        //        .LeftJoin<Sys_SetData>((dop, sd1, sd2) => dop.Currency == sd2.Id)
+        //        .Where((dop, sd1, sd2) => dop.IsDel == 0 && dop.Diid == dto.DiId)
+        //        .OrderBy((dop, sd1, sd2) => dop.Index)
+        //        .Select((dop, sd1, sd2) => new DayOtherPriceMobileInfoView
+        //        {
+        //            SubId = dop.Id,
+        //            DiId = dop.Diid,
+        //            Index = dop.Index,
+        //            SetDataId = dop.SetDataId,
+        //            SetDataName = sd1.Name,
+        //            Cost = dop.Cost,
+        //            Currency = dop.Currency,
+        //            CurrencyName = sd2.Remark,
+        //            SubTotal = dop.SubTotal,
+        //            Remark = dop.Remark,
+        //        })
+        //        .ToArray();
+        //    mobileInfo.OtherExpensesTotalCost = otherData.Sum(x => x.SubTotal);
+
+        //    return Ok(mobileInfo);
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - SubInfo
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileSubInfo(PostEnterExitCostMobileSubInfoDto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+
+        //    var subTypes = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
+        //    if (!subTypes.Contains(dto.SubType)) return Ok(JsonView(false, $"请传入有效的subTypeId!"));
+
+        //    var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
+
+        //    if (eecInfo == null) return Ok(JsonView(false, $"出入境费用明细未录入!"));
+        //    var subType = dto.SubType;
+
+        //    if (subType == 1) //1:境内费用
+        //    {
+        //        var oneData = new ChoiceOneMobileSubInfoView()
+        //        {
+        //            Id = eecInfo.Id,
+        //            ChoiceOne = eecInfo.ChoiceOne,
+        //            ChoiceOneTotalCost = eecInfo.InsidePay,
+        //            Visa = eecInfo.Visa,
+        //            VisaRemark = eecInfo.VisaRemark,
+        //            YiMiao = eecInfo.YiMiao,
+        //            HeSuan = eecInfo.HeSuan,
+        //            Service = eecInfo.Service,
+        //            Ticket = eecInfo.Ticket,
+        //            Safe = eecInfo.Safe,
+        //            FirstItemRemark = eecInfo.FirstItemRemark
+        //        };
+        //        return Ok(JsonView(oneData));
+        //    }
+        //    else if (subType == 2) //2:国际旅费
+        //    {
+        //        var twoData = new ChoiceTwoMobileSubInfoView()
+        //        {
+        //            Id = eecInfo.Id,
+        //            ChoiceTwoJJ = eecInfo.SumJJC,
+        //            OutsideJJPay = eecInfo.OutsideJJPay,
+        //            ChoiceTwoGW = eecInfo.SumGWC,
+        //            OutsideGWPay = eecInfo.OutsideGWPay,
+        //            ChoiceTwoTD = eecInfo.SumTDC,
+        //            OutsideTDPay = eecInfo.OutsideTDPay,
+        //            AirJJ = eecInfo.AirJJ,
+        //            AirGW = eecInfo.AirGW,
+        //            AirTD = eecInfo.AirTD,
+        //            CityTranffic = eecInfo.CityTranffic,
+        //            TwoItemRemark = eecInfo.TwoItemRemark
+        //        };
+        //        return Ok(JsonView(twoData));
+        //    }
+        //    else if (subType == 3) //3:住宿费
+        //    {
+        //        var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
+        //            .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
+        //            .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
+        //            .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 1)
+        //            .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
+        //            {
+        //                SubId = dac.Id,
+        //                DiId = dac.DiId,
+        //                Type = dac.Type,
+        //                Days = dac.Days,
+        //                NationalTravelFeeId = dac.NationalTravelFeeId,
+        //                Arae = $"{ntf.Country}-{ntf.City}",
+        //                Cost = dac.Cost,
+        //                Currency = dac.Currency,
+        //                CurrencyName = sd.Name,
+        //                SubTotal = dac.SubTotal,
+        //            })
+        //             .ToArray();
+
+        //        var data = new ChoiceMobileSubInfo3To6View()
+        //        {
+        //            ParentId = eecInfo.Id,
+        //            Choice = eecInfo.ChoiceThree,
+        //            TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+        //            Details = dayAndCostDatas
+
+        //        };
+        //        return Ok(JsonView(data));
+        //    }
+        //    else if (subType == 4) //4:伙食费
+        //    {
+        //        var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
+        //            .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
+        //            .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
+        //            .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 2)
+        //            .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
+        //            {
+        //                SubId = dac.Id,
+        //                DiId = dac.DiId,
+        //                Type = dac.Type,
+        //                Days = dac.Days,
+        //                NationalTravelFeeId = dac.NationalTravelFeeId,
+        //                Arae = $"{ntf.Country}-{ntf.City}",
+        //                Cost = dac.Cost,
+        //                Currency = dac.Currency,
+        //                CurrencyName = sd.Name,
+        //                SubTotal = dac.SubTotal,
+        //            })
+        //             .ToArray();
+
+        //        var data = new ChoiceMobileSubInfo3To6View()
+        //        {
+        //            ParentId = eecInfo.Id,
+        //            Choice = eecInfo.ChoiceFour,
+        //            TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+        //            Details = dayAndCostDatas
+        //        };
+        //        return Ok(JsonView(data));
+        //    }
+        //    else if (subType == 5) //5:公杂费 
+        //    {
+        //        var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
+        //            .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
+        //            .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
+        //            .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 3)
+        //            .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
+        //            {
+        //                SubId = dac.Id,
+        //                DiId = dac.DiId,
+        //                Type = dac.Type,
+        //                Days = dac.Days,
+        //                NationalTravelFeeId = dac.NationalTravelFeeId,
+        //                Arae = $"{ntf.Country}-{ntf.City}",
+        //                Cost = dac.Cost,
+        //                Currency = dac.Currency,
+        //                CurrencyName = sd.Name,
+        //                SubTotal = dac.SubTotal,
+        //            })
+        //            .ToArray();
+
+        //        var data = new ChoiceMobileSubInfo3To6View()
+        //        {
+        //            ParentId = eecInfo.Id,
+        //            Choice = eecInfo.ChoiceFive,
+        //            TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+        //            Details = dayAndCostDatas
+        //        };
+        //        return Ok(JsonView(data));
+        //    }
+        //    else if (subType == 6) //6:培训费
+        //    {
+        //        var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
+        //             .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
+        //             .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
+        //             .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 4)
+        //             .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
+        //             {
+        //                 SubId = dac.Id,
+        //                 DiId = dac.DiId,
+        //                 Type = dac.Type,
+        //                 Days = dac.Days,
+        //                 NationalTravelFeeId = dac.NationalTravelFeeId,
+        //                 Arae = $"{ntf.Country}-{ntf.City}",
+        //                 Cost = dac.Cost,
+        //                 Currency = dac.Currency,
+        //                 CurrencyName = sd.Name,
+        //                 SubTotal = dac.SubTotal,
+        //             })
+        //             .ToArray();
+
+        //        var data = new ChoiceMobileSubInfo3To6View()
+        //        {
+        //            ParentId = eecInfo.Id,
+        //            Choice = eecInfo.ChoiceSix,
+        //            TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+        //            Details = dayAndCostDatas
+        //        };
+        //        return Ok(JsonView(data));
+        //    }
+        //    else if (subType == 7) //7:其他
+        //    {
+        //        //其他款项
+        //        var otherData = _sqlSugar.Queryable<Grp_DayOtherPrice>()
+        //            .LeftJoin<Sys_SetData>((dop, sd1) => dop.SetDataId == sd1.Id)
+        //            .LeftJoin<Sys_SetData>((dop, sd1, sd2) => dop.Currency == sd2.Id)
+        //            .Where((dop, sd1, sd2) => dop.IsDel == 0 && dop.Diid == dto.DiId)
+        //            .OrderBy((dop, sd1, sd2) => dop.Index)
+        //            .Select((dop, sd1, sd2) => new DayOtherPriceMobileInfoView
+        //            {
+        //                SubId = dop.Id,
+        //                DiId = dop.Diid,
+        //                Index = dop.Index,
+        //                SetDataId = dop.SetDataId,
+        //                SetDataName = sd1.Name,
+        //                Cost = dop.Cost,
+        //                Currency = dop.Currency,
+        //                CurrencyName = sd2.Name,
+        //                SubTotal = dop.SubTotal,
+        //                Remark = dop.Remark,
+        //            })
+        //            .ToArray();
+
+        //        var data = new ChoiceSevenMobileSubInfoView()
+        //        {
+        //            ParentId = eecInfo.Id,
+        //            OtherExpenses_Checked = eecInfo.OtherExpenses_Checked,
+        //            OtherExpensesTotalCost = otherData.Sum(x => x.SubTotal),
+        //            Details = otherData
+        //        };
+
+        //        return Ok(JsonView(data));
+        //    }
+
+        //    return Ok(JsonView(false));
+        //}
+
+        //#region op
+
+        ///// <summary>
+        ///// 移动端更新费用消息通知
+        ///// </summary>
+        ///// <param name="diid"></param>
+        ///// <param name="id"></param>
+        ///// <param name="currUserId"></param>
+        //private async Task EnterExitCostMobileOpNotice(int diid, int id, int currUserId)
+        //{
+        //    try
+        //    {
+        //        ////生成默认文件pdf并且通知人员
+        //        //var fileView = await GeneralMethod.EnterExitCostDownload(new EnterExitCostDownloadDto()
+        //        //{
+        //        //    DiId = diid,
+        //        //    ExportType = 1,
+        //        //    SubTypeId = 1005
+        //        //}, "pdf");
+
+        //        ////发送通知
+        //        //string fileUrl = (string)fileView.Data.GetType().GetProperty("Url").GetValue(fileView.Data, null);
+        //        //string md5Sign = GeneralMethod.Encrypt($"{id}&fileName={fileUrl}");
+        //        //string url = string.Format("http://oa.pan-american-intl.com:4399/#/Sankunginfo?sign={0}&fileName={1}", id, fileUrl);
+        //        //await AppNoticeLibrary.SendUserMsg_GroupShare_ToGM(diid, new List<string>() { "208", "233", "21" }, currUserId, url);
+        //        ////汇率信息记录
+        //        //await GeneralMethod.RateRecordSave(currUserId, id, "出入境费用");
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        //记录日志
+        //        throw;
+        //    }
+        //}
+
+        ///// <summary>
+        ///// 验证出入境费用数据是否存在
+        ///// 不存在添加
+        ///// </summary>
+        ///// <param name="diId"></param>
+        ///// <param name="currUserId"></param>
+        ///// <returns></returns>
+        ///// <exception cref="CustomException"></exception>
+        //private async Task<int> EnterExitCostVerifyIsNull(int diId, int currUserId)
+        //{
+        //    var parentId = 0;
+
+        //    var info = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == diId).OrderByDescending(x => x.CreateTime).FirstAsync();
+        //    if (info != null) parentId = info.Id;
+        //    else
+        //    {
+        //        var currencys = await EnterExitCostMobileGetCurrencyInit();
+        //        int addId = await _sqlSugar.Insertable(new Grp_EnterExitCost() { DiId = diId, CreateUserId = currUserId, CurrencyRemark = JsonConvert.SerializeObject(currencys) }).ExecuteReturnIdentityAsync();
+        //        if (addId < 1) throw new CustomException("出入境费用添加失败!");
+        //        parentId = addId;
+        //    }
+
+        //    return parentId;
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 汇率
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpRate(PostEnterExitCostMobileFeeRateOpDto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+        //    if (dto.Currencys.Length < 1) return Ok(JsonView(false, "请传入有效的汇率信息!"));
+        //    var currencyStr = CommonFun.GetCurrencyChinaToString(dto.Currencys.ToList());
+        //    int id = dto.Id;
+        //    if (id <= 0) //add 
+        //    {
+        //        var add = await _sqlSugar.Insertable(new Grp_EnterExitCost() { CurrencyRemark = currencyStr, CreateUserId = dto.CurrUserId }).ExecuteCommandAsync();
+
+        //        if (add < 1) return Ok(JsonView(false));
+        //        id = add;
+        //    }
+        //    else //update
+        //    {
+        //        var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>().SetColumns(x => new Grp_EnterExitCost() { CurrencyRemark = currencyStr }).Where(x => x.Id == dto.Id).ExecuteCommandAsync();
+        //        if (upd < 1) return Ok(JsonView(false));
+        //    }
+
+        //    #region 汇率变更时更改币种相关费用
+        //    var opDayCosts = new List<Grp_DayAndCost>();
+        //    var opDayOtherCosts = new List<Grp_DayOtherPrice>();
+        //    var eecCurrencys = dto.Currencys.Select(x => x.CurrencyCode.ToUpper()).ToList();
+
+        //    var dayCosts = _sqlSugar.Queryable<Grp_DayAndCost>()
+        //        .LeftJoin<Sys_SetData>((dac, sd) => dac.Currency == sd.Id)
+        //        .Where((dac, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId)
+        //        .Select((dac, sd) => new {
+        //            dac.Id,
+        //            dac.DiId,
+        //            CurrencyCode = sd.Name,
+        //            dac.Cost
+        //        })
+        //       .ToList();
+        //    var dayOtherCosts = _sqlSugar.Queryable<Grp_DayOtherPrice>()
+        //        .LeftJoin<Sys_SetData>((dop, sd) => dop.Currency == sd.Id)
+        //        .Where((dop, sd) => dop.IsDel == 0 && dop.Diid == dto.DiId)
+        //        .Select((dop, sd) => new {
+        //            dop.Id,
+        //            dop.Diid,
+        //            CurrencyCode = sd.Name,
+        //            dop.Cost
+        //        })
+        //       .ToList();
+        //    if (dayCosts.Count > 0)
+        //    {
+        //        var new_dayCosts = dayCosts.Where(x => eecCurrencys.Contains(x.CurrencyCode.ToUpper())).GroupBy(x => x.CurrencyCode);
+        //        foreach (var dc in new_dayCosts)
+        //        {
+        //            var thisCurrency = dc.Key.ToUpper();
+        //            var thisRate = dto.Currencys.Where(x => x.CurrencyCode.ToUpper().Equals(thisCurrency)).First()?.Rate ?? 0.00M;
+        //            if (thisRate == 0.00M) continue;
+
+        //            foreach (var dcSub in dc)
+        //            {
+        //                opDayCosts.Add(new Grp_DayAndCost()
+        //                {
+        //                    Id = dcSub.Id,
+        //                    DiId = dcSub.DiId,
+        //                    Cost = dcSub.Cost,
+        //                    SubTotal = dcSub.Cost * thisRate,
+        //                    Remark = $"[移动端->汇率变更时费用变更][变更信息:currency:{thisCurrency}、opDatetime:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}、opUserId:{dto.CurrUserId}]"
+        //                });
+        //            }
+        //        }
+        //        if (opDayCosts.Count > 0)
+        //        {
+        //            await _sqlSugar.Updateable(opDayCosts).UpdateColumns(x => new { x.SubTotal, x.Remark }).WhereColumns(x => new { x.Id }).ExecuteCommandAsync();
+        //        }
+        //    }
+
+        //    if (dayOtherCosts.Count > 0)
+        //    {
+        //        var new_dayOtherCosts = dayOtherCosts.Where(x => eecCurrencys.Contains(x.CurrencyCode.ToUpper())).GroupBy(x => x.CurrencyCode);
+        //        foreach (var dc in new_dayOtherCosts)
+        //        {
+        //            var thisCurrency = dc.Key.ToUpper();
+        //            var thisRate = dto.Currencys.Where(x => x.CurrencyCode.ToUpper().Equals(thisCurrency)).First()?.Rate ?? 0.00M;
+        //            if (thisRate == 0.00M) continue;
+
+        //            foreach (var dcSub in dc)
+        //            {
+        //                opDayOtherCosts.Add(new Grp_DayOtherPrice()
+        //                {
+        //                    Id = dcSub.Id,
+        //                    Diid = dcSub.Diid,
+        //                    Cost = dcSub.Cost,
+        //                    SubTotal = dcSub.Cost * thisRate,
+        //                    // Remark = $"[移动端->汇率变更时费用变更][变更信息:currency:{thisCurrency}、opDatetime:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}、opUserId:{dto.CurrUserId}]"
+        //                });
+        //            }
+        //        }
+        //        if (opDayOtherCosts.Count > 0)
+        //        {
+        //            await _sqlSugar.Updateable(opDayOtherCosts).UpdateColumns(x => new { x.SubTotal }).WhereColumns(x => new { x.Id }).ExecuteCommandAsync();
+        //        }
+        //    }
+
+        //    #endregion
+
+        //    //消息通知
+        //    await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
+        //    //汇率信息记录
+        //    await GeneralMethod.RateRecordSave(dto.CurrUserId, id, "出入境费用");
+
+        //    return Ok(JsonView(new { parentId = id }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 复选框
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpCheckbox(PostEnterExitCostMobileFeeOpCheckboxDto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+        //    var checkboxInfo = _mapper.Map<Grp_EnterExitCost>(dto);
+
+        //    int id = dto.Id;
+        //    if (id <= 0) //add 
+        //    {
+        //        checkboxInfo.CreateUserId = dto.CurrUserId;
+        //        checkboxInfo.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
+        //        var add = await _sqlSugar.Insertable(checkboxInfo).ExecuteCommandAsync();
+
+        //        if (add < 1) return Ok(JsonView(false));
+        //    }
+        //    else //update
+        //    {
+        //        var upd = await _sqlSugar.Updateable(checkboxInfo)
+        //            .UpdateColumns(x => new {
+        //                x.ChoiceOne,
+        //                x.ChoiceTwo,
+        //                x.SumJJC,
+        //                x.SumGWC,
+        //                x.SumTDC,
+        //                x.ChoiceThree,
+        //                x.ChoiceFour,
+        //                x.ChoiceFive,
+        //                x.ChoiceSix,
+        //                x.OtherExpenses_Checked
+        //            })
+        //            .Where(x => x.Id == id)
+        //            .ExecuteCommandAsync();
+        //        if (upd < 1) return Ok(JsonView(false));
+        //    }
+
+        //    return Ok(JsonView(new { parentId = id }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 3-7项复选框单个复选框更改
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpSingleCheckbox(EnterExitCostMobileOpSingleCheckboxDto dto)
+        //{
+        //    int itemTypeId = dto.ItemType, id = dto.Id, currUserId = dto.CurrUserId, diId = dto.DiId, isSelected = dto.IsSelected;
+        //    var itemTypes = new List<int>() { 3, 4, 5, 6, 7 };
+
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (diId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (currUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+        //    if (!itemTypes.Contains(itemTypeId)) return Ok(JsonView(false, $"请传入要修改的项类型;3:住宿费; 4:伙食费; 5:公杂费; 6:培训费;7:其他;"));
+
+        //    var checkboxInfo = new Grp_EnterExitCost()
+        //    {
+        //        Id = id,
+        //        DiId = diId,
+        //        CreateUserId = currUserId
+        //    };
+
+        //    if (itemTypeId == 3) checkboxInfo.ChoiceThree = isSelected;
+        //    else if (itemTypeId == 4) checkboxInfo.ChoiceFour = isSelected;
+        //    else if (itemTypeId == 5) checkboxInfo.ChoiceFive = isSelected;
+        //    else if (itemTypeId == 6) checkboxInfo.ChoiceSix = isSelected;
+        //    else if (itemTypeId == 7) checkboxInfo.OtherExpenses_Checked = isSelected;
+
+
+        //    if (id <= 0) //add 
+        //    {
+        //        checkboxInfo.CreateUserId = dto.CurrUserId;
+        //        checkboxInfo.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
+        //        var add = await _sqlSugar.Insertable(checkboxInfo).ExecuteCommandAsync();
+
+        //        if (add < 1) return Ok(JsonView(false));
+        //    }
+        //    else //update
+        //    {
+        //        var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
+        //            .SetColumnsIF(itemTypeId == 3, it => it.ChoiceThree == isSelected)
+        //            .SetColumnsIF(itemTypeId == 4, it => it.ChoiceFour == isSelected)
+        //            .SetColumnsIF(itemTypeId == 5, it => it.ChoiceFive == isSelected)
+        //            .SetColumnsIF(itemTypeId == 6, it => it.ChoiceSix == isSelected)
+        //            .SetColumnsIF(itemTypeId == 7, it => it.OtherExpenses_Checked == isSelected)
+        //            .Where(x => x.Id == id)
+        //            .ExecuteCommandAsync();
+        //        if (upd < 1) return Ok(JsonView(false));
+        //    }
+
+        //    return Ok(JsonView(new { parentId = id }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 境内费用 Step1
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpStep1(PostEnterExitCostMobileOpStep1Dto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+        //    var info = _mapper.Map<Grp_EnterExitCost>(dto);
+        //    info.FirstItemRemark = dto.FirstItemRemark;
+        //    info.InsidePay = dto.Visa + dto.Service + dto.Safe + dto.Ticket + dto.HeSuan + dto.YiMiao;
+
+        //    int id = dto.Id;
+        //    if (id <= 0) //add 
+        //    {
+        //        info.CreateUserId = dto.CurrUserId;
+        //        info.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
+        //        var add = await _sqlSugar.Insertable(info).ExecuteReturnIdentityAsync();
+
+        //        if (add < 1) return Ok(JsonView(false));
+        //        id = add;
+        //    }
+        //    else //update
+        //    {
+        //        var upd = await _sqlSugar.Updateable(info)
+        //            .UpdateColumns(x => new {
+        //                x.ChoiceOne,
+        //                x.InsidePay,
+        //                x.VisaRemark,
+        //                x.Visa,
+        //                x.Service,
+        //                x.Safe,
+        //                x.Ticket,
+        //                x.HeSuan,
+        //                x.YiMiao,
+        //                x.FirstItemRemark
+        //            })
+        //            .Where(x => x.Id == id)
+        //            .ExecuteCommandAsync();
+        //        if (upd < 1) return Ok(JsonView(false));
+        //    }
+
+
+        //    //消息通知
+        //    await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
+
+        //    return Ok(JsonView(new { parentId = id, itemTotal = info.InsidePay }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 国际旅费 Step2
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpStep2(PostEnterExitCostMobileOpStep2Dto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+        //    var info = _mapper.Map<Grp_EnterExitCost>(dto);
+
+        //    info.OutsideJJPay = dto.OutsideJJPay;
+        //    info.OutsideGWPay = dto.OutsideGWPay;
+        //    info.OutsideTDPay = dto.OutsideTDPay;
+        //    info.AirJJ = dto.AirJJ;
+        //    info.AirGW = dto.AirGW;
+        //    info.AirTD = dto.AirTD;
+        //    info.CityTranffic = dto.CityTranffic;
+        //    info.TwoItemRemark = dto.TwoItemRemark;
+        //    info.SumJJC = dto.ChoiceTwoJJ;
+        //    info.SumGWC = dto.ChoiceTwoGW;
+        //    info.SumTDC = dto.ChoiceTwoTD;
+
+        //    int id = dto.Id;
+        //    decimal jjcItemTotal = 0.00M, gwcItemTotal = 0.00M, tdcItemTotal = 0.00M;
+        //    if (id <= 0) //add 
+        //    {
+        //        info.CreateUserId = dto.CurrUserId;
+        //        info.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
+        //        var addId = await _sqlSugar.Insertable(info).ExecuteReturnIdentityAsync();
+
+        //        if (addId <= 0) return Ok(JsonView(false));
+        //        id = addId;
+        //    }
+        //    else //update
+        //    {
+        //        var upd = await _sqlSugar.Updateable(info)
+        //            .UpdateColumns(x => new {
+        //                x.SumJJC,
+        //                x.OutsideJJPay,
+        //                x.SumGWC,
+        //                x.OutsideGWPay,
+        //                x.SumTDC,
+        //                x.OutsideTDPay,
+        //                x.AirJJ,
+        //                x.AirGW,
+        //                x.AirTD,
+        //                x.CityTranffic,
+        //                x.TwoItemRemark
+        //            })
+        //            .Where(x => x.Id == id)
+        //            .ExecuteCommandAsync();
+        //        if (upd < 1) return Ok(JsonView(false));
+
+        //    }
+
+        //    jjcItemTotal = info.AirJJ + info.CityTranffic;
+        //    gwcItemTotal = info.AirGW + info.CityTranffic;
+        //    tdcItemTotal = info.AirTD + info.CityTranffic;
+
+        //    //消息通知
+        //    await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
+
+        //    return Ok(JsonView(new
+        //    {
+        //        parentId = id,
+        //        choiceTwoJJ = dto.ChoiceTwoJJ,
+        //        jjcItemTotal = jjcItemTotal,
+        //        choiceTwoGW = dto.ChoiceTwoGW,
+        //        gwcItemTotal = gwcItemTotal,
+        //        choiceTwoTD = dto.ChoiceTwoTD,
+        //        tdcItemTotal = tdcItemTotal
+        //    }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 批量(住宿、伙食、公杂、培训) Step3-Step6
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ApiExplorerSettings(IgnoreApi = true)]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpBatchStep3To6(PostEnterExitCostMobileOpStep3To6Dto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+        //    if (dto.Infos.Length < 1) return Ok(JsonView(false, "请传入有效的费用信息!"));
+        //    var feeTypeIds = new List<int>() { 1, 2, 3, 4, };
+        //    if (!feeTypeIds.Contains(dto.FeeType)) return Ok(JsonView(false, "请传入有效的费用类型!"));
+
+        //    var infos1 = _mapper.Map<List<Grp_DayAndCost>>(dto.Infos);
+        //    var infos = infos1.Select(x => new Grp_DayAndCost
+        //    {
+        //        Id = x.Id,
+        //        DiId = dto.DiId,
+        //        Type = dto.FeeType,
+        //        Days = x.Days,
+        //        NationalTravelFeeId = x.NationalTravelFeeId,
+        //        Cost = x.Cost,
+        //        Currency = x.Currency,
+        //        SubTotal = x.SubTotal,
+        //        CreateUserId = dto.CurrUserId
+        //    })
+        //        .ToList();
+
+        //    var adds = infos.Where(x => x.Id <= 0).ToList();
+        //    var upds = infos.Where(x => x.Id > 0).ToList();
+
+        //    if (adds.Count > 0)
+        //    {
+        //        var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
+        //        if (add < 1) return Ok(JsonView(false));
+
+        //    }
+        //    if (upds.Count > 0)
+        //    {
+        //        var upd = await _sqlSugar.Updateable(adds)
+        //            .UpdateColumns(x => new
+        //            {
+        //                x.Days,
+        //                x.NationalTravelFeeId,
+        //                x.Cost,
+        //                x.Currency,
+        //                x.SubTotal
+        //            })
+        //            .WhereColumns(x => new { x.Id })
+        //            .ExecuteCommandAsync();
+        //        if (upd < 1) return Ok(JsonView(false));
+        //    }
+
+        //    var itemTotal = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == dto.FeeType).Sum(x => x.SubTotal);
+
+        //    //消息通知
+        //    var id = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId).First()?.Id ?? 0;
+        //    await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
+
+        //    return Ok(JsonView(new { itemTotal = itemTotal }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 单条(住宿、伙食、公杂、培训) Step3-Step6
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpSingleStep3To6(PostEnterExitCostMobileOpSingleStep3To6Dto dto)
+        //{
+        //    var feeTypeIds = new List<int>() { 3, 4, 5, 6 };
+        //    int subId = dto.SubId, feeType = dto.FeeType;
+
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+        //    if (!feeTypeIds.Contains(dto.FeeType)) return Ok(JsonView(false, "请传入有效的费用类型!"));
+
+        //    var subInfo = _mapper.Map<Grp_DayAndCost>(dto);
+        //    subInfo.Id = subId;
+        //    subInfo.DiId = dto.DiId;
+
+        //    if (feeType == 3) subInfo.Type = 1;
+        //    else if (feeType == 4) subInfo.Type = 2;
+        //    else if (feeType == 5) subInfo.Type = 3;
+        //    else if (feeType == 6) subInfo.Type = 4;
+
+        //    subInfo.CreateUserId = dto.CurrUserId;
+
+        //    int parentId = await EnterExitCostVerifyIsNull(dto.DiId, dto.CurrUserId); //主表验证
+        //    if (parentId < 1) return Ok(JsonView(false));
+
+        //    //子表op
+        //    if (subId < 1)
+        //    {
+        //        var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
+        //        if (subAdd < 1) return Ok(JsonView(false));
+        //    }
+        //    else
+        //    {
+        //        var subUpd = await _sqlSugar.Updateable(subInfo)
+        //            .UpdateColumns(x => new
+        //            {
+        //                x.Days,
+        //                x.NationalTravelFeeId,
+        //                x.Cost,
+        //                x.Currency,
+        //                x.SubTotal
+        //            })
+        //            .WhereColumns(x => new { x.Id })
+        //            .ExecuteCommandAsync();
+        //        if (subUpd < 1) return Ok(JsonView(false));
+        //    }
+
+        //    var itemTotal = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == feeType).Sum(x => x.SubTotal);
+
+        //    await EnterExitCostMobileOpNotice(dto.DiId, parentId, dto.CurrUserId);
+
+        //    return Ok(JsonView(new { parentId = parentId, itemTotal = itemTotal }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 其他费用-批量 Step7
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ApiExplorerSettings(IgnoreApi = true)]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpBatchStep7(PostEnterExitCostMobileOpStep7Dto dto)
+        //{
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+        //    var infos1 = _mapper.Map<List<Grp_DayOtherPrice>>(dto.Infos);
+        //    var infos = infos1.Select(x => new Grp_DayOtherPrice()
+        //    {
+        //        Id = x.Id,
+        //        Diid = dto.DiId,
+        //        SetDataId = x.SetDataId,
+        //        Index = x.Index,
+        //        Cost = x.Cost,
+        //        Currency = x.Currency,
+        //        SubTotal = x.SubTotal,
+        //        CreateUserId = dto.CurrUserId,
+        //        Remark = x.Remark
+        //    }).ToList();
+
+        //    var adds = infos.Where(x => x.Id <= 0).ToList();
+        //    var upds = infos.Where(x => x.Id > 0).ToList();
+
+        //    if (adds.Count > 0)
+        //    {
+        //        var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
+        //        if (add < 1) return Ok(JsonView(false));
+        //    }
+        //    if (upds.Count > 0)
+        //    {
+        //        var upd = await _sqlSugar.Updateable(adds)
+        //            .UpdateColumns(x => new
+        //            {
+        //                x.Index,
+        //                x.SetDataId,
+        //                x.Cost,
+        //                x.Currency,
+        //                x.SubTotal,
+        //                x.Remark
+        //            })
+        //            .WhereColumns(x => new { x.Id })
+        //            .ExecuteCommandAsync();
+        //        if (upd < 1) return Ok(JsonView(false));
+        //    }
+
+        //    var itemTotal = _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == dto.DiId).Sum(x => x.SubTotal);
+        //    //消息通知
+        //    var id = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId).First()?.Id ?? 0;
+        //    await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
+        //    return Ok(JsonView(new { itemTotal = itemTotal }));
+        //}
+
+        ///// <summary>
+        ///// 团组模块 - 出入境费用-移动端 - OP --> 其他费用-单条 Step7
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpPost]
+        //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        //public async Task<IActionResult> EnterExitCostMobileOpSingleStep7(PostEnterExitCostMobileOpSingleStep7Dto dto)
+        //{
+        //    int subId = dto.SubId;
+        //    int diId = dto.Diid;
+        //    if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
+        //    if (diId < 1) return Ok(JsonView(false, MsgTips.DiId));
+        //    if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
+
+        //    var subInfo = _mapper.Map<Grp_DayOtherPrice>(dto);
+        //    subInfo.Id = subId;
+        //    subInfo.Diid = dto.Diid;
+        //    subInfo.CreateUserId = dto.CurrUserId;
+
+        //    int parentId = await EnterExitCostVerifyIsNull(diId, dto.CurrUserId); //主表验证
+        //    if (parentId < 1) return Ok(JsonView(false));
+
+        //    #region 子表op
+        //    if (subId < 1)//add
+        //    {
+        //        var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
+        //        if (subAdd < 1) return Ok(JsonView(false));
+        //    }
+        //    else //upd
+        //    {
+        //        var subUpd = await _sqlSugar.Updateable(subInfo)
+        //            .UpdateColumns(x => new
+        //            {
+        //                x.Index,
+        //                x.SetDataId,
+        //                x.Cost,
+        //                x.Currency,
+        //                x.SubTotal,
+        //                x.Remark
+        //            })
+        //            .WhereColumns(x => new { x.Id })
+        //            .ExecuteCommandAsync();
+        //        if (subUpd < 1) return Ok(JsonView(false));
+        //    }
+        //    #endregion
+
+        //    var itemTotal = _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == diId).Sum(x => x.SubTotal);
+
+        //    //消息通知
+        //    await EnterExitCostMobileOpNotice(dto.Diid, parentId, dto.CurrUserId);
+
+        //    return Ok(JsonView(new { parentId = parentId, 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
+
         #region 签证费用录入
 
         /// <summary>

+ 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