Browse Source

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

yuanrf 1 week ago
parent
commit
79b1ec6e28
22 changed files with 4757 additions and 304 deletions
  1. 50 43
      OASystem/OASystem.Api/Controllers/FinancialController.cs
  2. 1737 89
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  3. 8 6
      OASystem/OASystem.Api/Controllers/ResourceController.cs
  4. 1227 0
      OASystem/OASystem.Api/Controllers/StatisticsController.cs
  5. 13 0
      OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs
  6. 300 0
      OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDraftDto.cs
  7. 5 0
      OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDto.cs
  8. 7 0
      OASystem/OASystem.Domain/Dtos/Groups/TourClientListDto.cs
  9. 1 1
      OASystem/OASystem.Domain/Dtos/Resource/OfficialActivitiesDto.cs
  10. 64 0
      OASystem/OASystem.Domain/Entities/Groups/Grp_DayAndCostDraft.cs
  11. 32 0
      OASystem/OASystem.Domain/Entities/Groups/Grp_DayOtherPriceDraft.cs
  12. 11 1
      OASystem/OASystem.Domain/Entities/Groups/Grp_EnterExitCost.cs
  13. 258 0
      OASystem/OASystem.Domain/Entities/Groups/Grp_EnterExitCostDraft.cs
  14. 4 0
      OASystem/OASystem.Domain/ViewModels/Groups/DelegationInfoView.cs
  15. 428 0
      OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostDraftView.cs
  16. 17 0
      OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostView.cs
  17. 9 2
      OASystem/OASystem.Domain/ViewModels/Resource/OfficialActivitiesView.cs
  18. 85 50
      OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs
  19. 361 0
      OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs
  20. 3 3
      OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs
  21. 122 109
      OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs
  22. 15 0
      OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

+ 50 - 43
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -2163,9 +2163,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostPayRequestInit()
         {
-            try
-            {
-                var conpanyDatas = _sqlSugar.Queryable<Sys_Company>()
+            var conpanyDatas = _sqlSugar.Queryable<Sys_Company>()
                                             .Where(it => it.IsDel == 0)
                                             .Select(it => new
                                             {
@@ -2175,12 +2173,7 @@ namespace OASystem.API.Controllers
                                             }).ToList();
 
 
-                return Ok(JsonView(true, "操作成功!", new { ConpanyData = conpanyDatas }));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, ex.Message));
-            }
+            return Ok(JsonView(true, "操作成功!", new { ConpanyData = conpanyDatas }));
         }
 
 
@@ -3142,7 +3135,18 @@ namespace OASystem.API.Controllers
                 dto.PageId = 51;
                 return Ok(JsonView(false, "请传入有效的PageId参数!"));
             }
-            if (dto.ConpanyId < 1 || dto.ConpanyId > 4)
+
+            var conpanyDatas = _sqlSugar.Queryable<Sys_Company>()
+                .Where(it => it.IsDel == 0)
+                .Select(it => new
+                {
+                    Id = it.Id,
+                    ConpamyName = it.CompanyName
+                
+                }).ToList();
+
+            var conpanyIds = conpanyDatas.Select(x => x.Id).ToList();
+            if (!conpanyIds.Contains(dto.ConpanyId))
             {
                 return Ok(JsonView(false, "请传入有效的ConpanyId参数!"));
             }
@@ -3184,39 +3188,42 @@ namespace OASystem.API.Controllers
                     dailyResult.childList = new List<Fin_DailyFeePaymentContentInfolView>();
                 }
 
-                List<tree_Group_DailyFeePaymentPageListView> _GroupData = new List<tree_Group_DailyFeePaymentPageListView>();
-                List<tree_Fin_DailyFeePaymentPageListView> _DailyData = new List<tree_Fin_DailyFeePaymentPageListView>();
-
-                //1	成都泛美商务有限公司
-                if (dto.ConpanyId == 1)
-                {
-                    if (groupResult.dataList != null && groupResult.dataList.Count > 0) _GroupData = groupResult.dataList.Where(it => it.CompanyId == 1).ToList();
-                    if (dailyResult.dataList != null && dailyResult.dataList.Count > 0) _DailyData = dailyResult.dataList.Where(it => it.CompanyId == 1).ToList();
-
-                }
-                //2	四川泛美交流有限公司
-                else if (dto.ConpanyId == 2)
-                {
-                    if (groupResult.dataList != null && groupResult.dataList.Count > 0) _GroupData = groupResult.dataList.Where(it => it.CompanyId == 2).ToList();
-                    if (dailyResult.dataList != null && dailyResult.dataList.Count > 0) _DailyData = dailyResult.dataList.Where(it => it.CompanyId == 2).ToList();
-
-                }
-                //3 成都纽茵教育科技有限公司
-                else if (dto.ConpanyId == 3)
-                {
-                    if (groupResult.dataList != null && groupResult.dataList.Count > 0) _GroupData = groupResult.dataList.Where(it => it.CompanyId == 3).ToList();
-                    if (dailyResult.dataList != null && dailyResult.dataList.Count > 0) _DailyData = dailyResult.dataList.Where(it => it.CompanyId == 3).ToList();
-
-                }
-                //4 成都鸿企中元科技有限公司
-                else if (dto.ConpanyId == 4)
-                {
-                    return Ok(JsonView(false, "暂未开放该类型!"));
-                }
-                else
-                {
-                    return Ok(JsonView(false, "参数ConpanyId不可使用!"));
-                }
+                var _GroupData = new List<tree_Group_DailyFeePaymentPageListView>();
+                var _DailyData = new List<tree_Fin_DailyFeePaymentPageListView>();
+
+                if (groupResult.dataList != null && groupResult.dataList.Any()) _GroupData = groupResult.dataList.Where(it => it.CompanyId == dto.ConpanyId).ToList();
+                if (dailyResult.dataList != null && dailyResult.dataList.Any()) _DailyData = dailyResult.dataList.Where(it => it.CompanyId == dto.ConpanyId).ToList();
+
+                ////1	成都泛美商务有限公司
+                //if (dto.ConpanyId == 1)
+                //{
+                //    if (groupResult.dataList != null && groupResult.dataList.Count > 0) _GroupData = groupResult.dataList.Where(it => it.CompanyId == 1).ToList();
+                //    if (dailyResult.dataList != null && dailyResult.dataList.Count > 0) _DailyData = dailyResult.dataList.Where(it => it.CompanyId == 1).ToList();
+
+                //}
+                ////2	四川泛美交流有限公司
+                //else if (dto.ConpanyId == 2)
+                //{
+                //    if (groupResult.dataList != null && groupResult.dataList.Count > 0) _GroupData = groupResult.dataList.Where(it => it.CompanyId == 2).ToList();
+                //    if (dailyResult.dataList != null && dailyResult.dataList.Count > 0) _DailyData = dailyResult.dataList.Where(it => it.CompanyId == 2).ToList();
+
+                //}
+                ////3 成都纽茵教育科技有限公司
+                //else if (dto.ConpanyId == 3)
+                //{
+                //    if (groupResult.dataList != null && groupResult.dataList.Count > 0) _GroupData = groupResult.dataList.Where(it => it.CompanyId == 3).ToList();
+                //    if (dailyResult.dataList != null && dailyResult.dataList.Count > 0) _DailyData = dailyResult.dataList.Where(it => it.CompanyId == 3).ToList();
+
+                //}
+                ////4 成都鸿企中元科技有限公司
+                //else if (dto.ConpanyId == 4)
+                //{
+                //    return Ok(JsonView(false, "暂未开放该类型!"));
+                //}
+                //else
+                //{
+                //    return Ok(JsonView(false, "参数ConpanyId不可使用!"));
+                //}
 
                 string _requestPaymentDt = DateTime.Now.ToString("yyyy-MM-dd"),//申请付款日期
                        _appliedAmount = "", //申请付款金额

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


+ 8 - 6
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -2022,16 +2022,18 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             if (_groupData.Code == 0) groupInfos = _groupData.Data;
 
             var data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0).ToList();
-            var data1 = data.Where(a => a.STid == 38).ToList();
-            var data2 = data.Where(a => a.STid == 101).ToList();
-            var data3 = data.Where(a => a.STid == 66).ToList();
+            var data1 = data.Where(a => a.STid == 38).Select(x => new { x.Id,x.Name }).ToList();
+            var data2 = data.Where(a => a.STid == 101).Select(x => new { x.Id, x.Name }).ToList();
+            var data3 = data.Where(a => a.STid == 66).Select(x => new { x.Id, x.Name ,x.Remark}).ToList();
 
             var _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel == 0 && a.Category == 970).ToList();
 
-            var translatorData = _sqlSugar.Queryable<Res_TranslatorLibrary>().Where(a => a.IsDel == 0).Select(x => new TranslatorLibraryNameView() { Id = x.Id, Name = x.Name }).ToList();
-            foreach (var item in translatorData) EncryptionProcessor.DecryptProperties(item);
+            var translatorData = _sqlSugar.Queryable<Res_TranslatorLibrary>().Where(a => a.IsDel == 0).ToList();
 
-            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data1,DataSource = data2, currencyData = data3, DeleFile = _DeleFile , TranslatorData = translatorData }));
+            var translatorData1 = _mapper.Map<List<TranslatorView>>(translatorData);
+            foreach (var item in translatorData1) EncryptionProcessor.DecryptProperties(item);
+
+            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data1,DataSource = data2, currencyData = data3, DeleFile = _DeleFile , TranslatorData = translatorData1 }));
         }
 
         /// <summary>

File diff suppressed because it is too large
+ 1227 - 0
OASystem/OASystem.Api/Controllers/StatisticsController.cs


+ 13 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -122,6 +122,15 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<EnterExitCostOperateDto, Grp_EnterExitCost>();
             CreateMap<DayAndCostAddView, Grp_DayAndCost>();
 
+
+            CreateMap<Grp_EnterExitCostDraft, EnterExitCostDraftInfoView>();
+
+            CreateMap<EnterExitCostDraftOpDto, Grp_EnterExitCostDraft>();
+            CreateMap<DayAndCostDraftAddView, Grp_DayAndCostDraft>();
+            CreateMap<Grp_DayAndCostDraft, DayAndCostDraftAddView>();
+
+
+
             CreateMap<Grp_EnterExitCost, EnterExitCostMobileInfoView>();
             CreateMap<Grp_EnterExitCost, EnterExitCostMobileParentInfoView>();
 
@@ -133,6 +142,10 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<PostEnterExitCostMobileOpSingleStep3To6Dto, Grp_DayAndCost>();
             CreateMap<PostEnterExitCostMobileOpSingleStep7Dto, Grp_DayOtherPrice>();
 
+            CreateMap<Grp_EnterExitCostDraft, Grp_EnterExitCost>();
+            CreateMap<Grp_DayAndCostDraft, Grp_DayAndCost>();
+            CreateMap<Grp_DayOtherPriceDraft, Grp_DayOtherPrice>();
+
             #endregion
 
             #region 出入境国家费用标准

+ 300 - 0
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDraftDto.cs

@@ -0,0 +1,300 @@
+using OASystem.Domain.ViewModels.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Groups
+{
+    public class EnterExitCostDraftDto
+    {
+    }
+
+    /// <summary>
+    /// 出入境费用详情 Dto
+    /// </summary>
+    public class EnterExitCostDraftInfoByIdDto : PortDtoBase
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+    }
+
+    /// <summary>
+    /// 出入境费用 Add And Update  Dto
+    /// </summary>
+    public class EnterExitCostDraftOpDto : PortDtoBase
+    {
+        public int UserId { get; set; }
+
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 草稿名称
+        /// </summary>
+        public string DraftName { get; set; }
+
+        #region 境内费用(其他费用)
+
+        /// <summary>
+        ///  境内费用(其他费用)选择框
+        /// </summary>
+        public int ChoiceOne { get; set; }
+
+        /// <summary>
+        /// 境内费用(其他费用)
+        /// </summary>
+        public decimal InsidePay { get; set; }
+
+        #region 境内费用(其他费用)子项
+
+        /// <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; }
+
+        #endregion
+
+        #endregion
+
+        #region 国际旅费
+
+        /// <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; }
+
+
+        #region 国际旅费子项
+        /// <summary>
+        /// 国际旅费合计(经济舱)
+        /// </summary>
+        public decimal OutsideJJPay { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计(公务舱)
+        /// </summary>
+        public decimal OutsideGWPay { 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; }
+
+        /// <summary>
+        ///  多个币种存储
+        ///  存储方式: 美元(USD):6.2350|.......|墨西哥比索(MXN):1.0000
+        /// </summary>
+        public List<CurrencyInfo>? Currencys { get; set; }
+
+        #endregion
+
+        #endregion
+
+        #region 住宿费
+
+        /// <summary>
+        ///  住宿费合计选择框
+        /// </summary>
+        public int ChoiceThree { get; set; }
+
+        /// <summary>
+        /// 住宿费子项Data
+        /// </summary>
+        public List<DayAndCostDraftAddView>? QuarterageData { get; set; }
+
+        #endregion
+
+        #region 伙食费
+
+        /// <summary>
+        ///  伙食费合计选择框
+        /// </summary>
+        public int ChoiceFour { get; set; }
+
+        /// <summary>
+        /// 伙食费子项Data
+        /// </summary>
+        public List<DayAndCostDraftAddView>? BoardWagesData { get; set; }
+
+        #endregion
+
+        #region 公杂费
+
+        /// <summary>
+        ///  公杂费合计选择框
+        /// </summary>
+        public int ChoiceFive { get; set; }
+
+        /// <summary>
+        /// 公杂费子项Data
+        /// </summary>
+        public List<DayAndCostDraftAddView>? MiscellaneousFeeData { get; set; }
+
+        #endregion
+
+        #region 培训费
+
+        /// <summary>
+        ///  培训费用选择框
+        /// </summary>
+        public int ChoiceSix { get; set; }
+
+        /// <summary>
+        /// 培训费子项Data
+        /// </summary>
+        public List<DayAndCostDraftAddView>? TrainingExpenseData { get; set; }
+
+        #endregion
+
+        #region 其他费用
+
+        /// <summary>
+        ///  其他费用选择框
+        /// </summary>
+        public int OtherExpenses_Checked { get; set; }
+
+        /// <summary>
+        /// 其他费用子项Data
+        /// </summary>
+        public List<DayOtherPriceDraftAddView> DayOtherPriceData { get; set; }
+        #endregion
+
+        #region 最下面 选择框状态
+
+        /// <summary>
+        /// 经济舱选择框
+        /// </summary>
+        public int AirJJC_Checked { get; set; }
+
+        /// <summary>
+        /// 公务舱选择框
+        /// </summary>
+        public int AirGWC_Checked { get; set; }
+
+        /// <summary>
+        /// 公务舱选择框
+        /// </summary>
+        public int AirTDC_Checked { get; set; }
+
+        #endregion
+
+    }
+
+    public class EnterExitCostDraftCorrelationTipsDto : PortDtoBase { }
+
+    /// <summary>
+    /// 出入境费用 - 表格导出 Dto
+    /// </summary>
+    public class EnterExitCostDraftDownloadDto : PortDtoBase
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 模板类型
+        /// 1 明细表
+        /// 2 表格
+        /// 3 团组成员名单
+        /// </summary>
+        public int ExportType { get; set; }
+
+        /// <summary>
+        /// 类型Id
+        /// </summary>
+        public int SubTypeId { get; set; }
+    }
+
+    /// <summary>
+    /// 出入境费用 - 一键清空 dto
+    /// </summary>
+    public class EnterExitCostDraftOneClickEmptyDto : PortDtoBase
+    {
+        public int UserId { get; set; }
+
+        public int Id { get; set; }
+    }
+
+    public class EnterExitCostDraftOtherExpensesDelDto : DelBaseDto { }
+
+
+    public class EnterExitCostDraftImportDataDto: PortDtoBase {
+        public int UserId { get; set; }
+        public int DraftId { get; set; }
+        public int GroupId { get; set; }
+
+    }
+}

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

@@ -125,6 +125,10 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public int SumTDC { get; set; }
 
+        /// <summary>
+        /// 第二项备注
+        /// </summary>
+        public string TwoItemRemark { get; set; }
 
         #region 国际旅费子项
         /// <summary>
@@ -660,6 +664,7 @@ namespace OASystem.Domain.Dtos.Groups
         ///  国外城市间交通费
         /// </summary>
         public decimal CityTranffic { get; set; }
+        public string TwoItemRemark { get; set; }
     }
 
     public class PostEnterExitCostMobileOpStep3To6Dto

+ 7 - 0
OASystem/OASystem.Domain/Dtos/Groups/TourClientListDto.cs

@@ -369,6 +369,13 @@ namespace OASystem.Domain.Dtos.Groups
         public string Job { get; set; }
     }
 
+    public class ClientInfoInfo_Group : ClientInfo
+    {
+        public int DiId { get; set; }
+        public DateTime CreateTime { get; set; }
+    }
+
+
     public class ClientAirInfo: ClientInfo
     {
         public int AirType { get; set; }

+ 1 - 1
OASystem/OASystem.Domain/Dtos/Resource/OfficialActivitiesDto.cs

@@ -156,7 +156,7 @@ namespace OASystem.Domain.Dtos.Resource
         /// <summary>
         /// 翻译人员Info
         /// </summary>
-        public TranslatorView TranslatorInfo { get; set; }
+        public TranslatorView? TranslatorInfo { get; set; }
 
 
     }

+ 64 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_DayAndCostDraft.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 团组 - 出入境费用 - 子项 - 草稿
+    /// </summary>
+    [SugarTable("Grp_DayAndCostDraft")]
+    public class Grp_DayAndCostDraft : EntityBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ParentId { get; set; }
+
+        /// <summary>
+        /// 类型:1为住宿费;2为伙食费;3为公杂费;4培训费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Type { get; set; }
+
+        /// <summary>
+        /// 天数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Days { get; set; }
+
+        /// <summary>
+        /// 地名Id
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int NationalTravelFeeId { get; set; }
+
+        /// <summary>
+        /// 地名 - 弃用字段不删
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string? Place { get; set; }
+
+        /// <summary>
+        /// 费用标准
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Cost { get; set; }
+
+        /// <summary>
+        /// 币种
+        /// Sys_SetData STid = 66
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 小计
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SubTotal { get; set; }
+    }
+}

+ 32 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_DayOtherPriceDraft.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 三公费用其他费用表 草稿
+    /// </summary>
+    [SugarTable("Grp_DayOtherPriceDraft")]
+    public class Grp_DayOtherPriceDraft : EntityBase
+    {
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ParentId { get; set; }
+
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SetDataId { get; set; }
+
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Index { get; set; }
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Cost { get; set; }
+
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal SubTotal { get; set; }
+    }
+}

+ 11 - 1
OASystem/OASystem.Domain/Entities/Groups/Grp_EnterExitCost.cs

@@ -68,7 +68,12 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
         public decimal Safe { get; set; }
-
+        
+        /// <summary>
+        /// 第一项费用描述
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string? FirstItemRemark { get; set; }
         #endregion
 
         /// <summary>
@@ -116,6 +121,11 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
         public decimal CityTranffic { get; set; }
 
+        /// <summary>
+        ///  第二项费用描述
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string TwoItemRemark { get; set; }
 
         #region 汇率币种
 

+ 258 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_EnterExitCostDraft.cs

@@ -0,0 +1,258 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 团组 - 出入境费用 - 草稿
+    /// </summary>
+    [SugarTable("Grp_EnterExitCostDraft")]
+    public class Grp_EnterExitCostDraft : EntityBase
+    {
+        /// <summary>
+        /// 草稿名称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string DraftName { get; set; }
+
+        /// <summary>
+        /// 境内费用(其他费用)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal InsidePay { get; set; }
+
+        #region 境内费用(其他费用)子项
+
+        /// <summary>
+        /// 签证费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Visa { get; set; }
+
+        /// <summary>
+        /// 签证费描述
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string? VisaRemark { get; set; }
+
+        /// <summary>
+        /// 疫苗费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal YiMiao { get; set; }
+
+        /// <summary>
+        /// 核酸检测费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal HeSuan { get; set; }
+
+        /// <summary>
+        /// 服务费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Service { get; set; }
+
+        /// <summary>
+        /// 参展门票
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Ticket { get; set; }
+
+        /// <summary>
+        /// 保险费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal Safe { get; set; }
+
+        /// <summary>
+        /// 第一项备注
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(500)")]
+        public string FirstItemRemark { get; set; }
+
+        #endregion
+
+        /// <summary>
+        /// 国际旅费合计(经济舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal OutsideJJPay { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计(公务舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal OutsideGWPay { get; set; }
+
+        /// <summary>
+        /// 国际旅费合计(头等舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal OutsideTDPay { get; set; }
+
+
+        #region 国际旅费合计(经济舱\公务舱\头等舱)
+
+        /// <summary>
+        ///  国际机票(经济舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal AirJJ { get; set; }
+
+        /// <summary>
+        ///  国际机票(公务舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal AirGW { get; set; }
+
+        /// <summary>
+        ///  国际机票(头等舱)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal AirTD { get; set; }
+
+        /// <summary>
+        ///  国外城市间交通费
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal CityTranffic { get; set; }
+
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string TwoItemRemark { get; set; }
+        #region 汇率币种
+
+        /// <summary>
+        ///  美元
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateUSD { get; set; }
+
+        /// <summary>
+        ///  日元
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateJPY { get; set; }
+
+        /// <summary>
+        ///  欧元
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateEUR { get; set; }
+
+        /// <summary>
+        ///  英镑 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateGBP { get; set; }
+
+        /// <summary>
+        ///  港币 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,4)")]
+        public decimal RateHKD { get; set; }
+
+
+        /// <summary>
+        ///  多个币种存储
+        ///  存储方式: 美元(USD):6.2350|.......|墨西哥比索(MXN):1.0000
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string? CurrencyRemark { get; set; }
+
+        #endregion
+
+        #endregion
+
+        #region 选择框状态
+
+        /// <summary>
+        ///  境内费用(其他费用)选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceOne { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceTwo { get; set; }
+
+        /// <summary>
+        ///  经济舱小计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SumJJC { get; set; }
+
+        /// <summary>
+        ///  公务舱小计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SumGWC { get; set; }
+
+        /// <summary>
+        ///  头等舱小计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SumTDC { get; set; }
+
+        /// <summary>
+        ///  住宿费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceThree { get; set; }
+
+        /// <summary>
+        ///  伙食费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceFour { get; set; }
+
+        /// <summary>
+        ///  公杂费合计选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceFive { get; set; }
+
+        /// <summary>
+        ///  境内费用(其他费用)选择框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ChoiceSix { get; set; }
+
+        /// <summary>
+        /// 经济舱选择框 - bottom(老OA使用 新OA弃用)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int AirJJC_Checked { get; set; }
+
+        /// <summary>
+        /// 公务舱选择框 - bottom(老OA使用 新OA弃用)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int AirGWC_Checked { get; set; }
+
+        /// <summary>
+        /// 头等舱选择框 - bottom(老OA使用 新OA弃用)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int AirTDC_Checked { get; set; }
+
+        #endregion
+
+        /// <summary>
+        /// 确认费用(确认费用后 不可更改)
+        /// 1:未确认 2:已确认
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsConfirm { get; set; } = 1;
+
+        /// <summary>
+        /// 其他费用选择框
+        /// </summary>
+        public int OtherExpenses_Checked { get; set; }
+    }
+}

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

@@ -496,6 +496,10 @@ namespace OASystem.Domain.ViewModels.Groups
         public int GrpScheduleId { get; set; } = 0;
 
         public DateTime CreateTime { get; set; }
+
+        public string GroupFirst { get; set; }
+
+        public string CreateUserName { get; set; }
     }
 
     

+ 428 - 0
OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostDraftView.cs

@@ -0,0 +1,428 @@
+using OASystem.Domain.Dtos;
+using OASystem.Domain.Entities.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    public class EnterExitCostDraftView:Grp_EnterExitCostDraft
+    {
+    }
+
+    /// <summary>
+    /// 出入境费用info
+    /// </summary>
+    public class EnterExitCostDraftInfoView
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public string DraftName { get; set; }
+
+        /// <summary>
+        /// 境内费用(其他费用)
+        /// </summary>
+        public decimal InsidePay { get; set; }
+
+        #region 境内费用(其他费用)子项
+
+        /// <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; }
+
+        #endregion
+
+        /// <summary>
+        /// 国际旅费合计(经济舱)
+        /// </summary>
+        public decimal OutsideJJPay { get; set; }
+
+        /// <summary>
+        ///  国际旅费合计(公务舱)
+        /// </summary>
+        public decimal OutsideGWPay { get; set; }
+
+
+        /// <summary>
+        /// 国际旅费合计(头等舱)
+        /// </summary>
+        public decimal OutsideTDPay { get; set; }
+
+        #region 国际旅费合计(经济舱\公务舱\头等舱)
+
+        /// <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; }
+
+        #region 汇率币种
+
+        /// <summary>
+        ///  多个币种存储
+        ///  存储方式: 美元(USD):6.2350|.......|墨西哥比索(MXN):1.0000
+        /// </summary>
+        public List<CurrencyInfo>? Currencys { get; set; }
+
+        #endregion
+
+        #endregion
+
+        #region 选择框状态
+
+        /// <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>
+        /// 住宿费子项Data
+        /// </summary>
+        public List<DayAndCostDraftInfoView>? QuarterageData { get; set; }
+
+        /// <summary>
+        ///  伙食费合计选择框
+        /// </summary>
+        public int ChoiceFour { get; set; }
+
+        /// <summary>
+        /// 伙食费子项Data
+        /// </summary>
+        public List<DayAndCostDraftInfoView>? BoardWagesData { get; set; }
+
+        /// <summary>
+        ///  公杂费合计选择框
+        /// </summary>
+        public int ChoiceFive { get; set; }
+
+        /// <summary>
+        /// 公杂费子项Data
+        /// </summary>
+        public List<DayAndCostDraftInfoView>? MiscellaneousFeeData { get; set; }
+
+        /// <summary>
+        ///  培训费用选择框
+        /// </summary>
+        public int ChoiceSix { get; set; }
+
+        /// <summary>
+        /// 培训费子项Data
+        /// </summary>
+        public List<DayAndCostDraftInfoView>? TrainingExpenseData { get; set; }
+
+        /// <summary>
+        /// 经济舱选择框
+        /// </summary>
+        public int AirJJC_Checked { get; set; }
+
+        /// <summary>
+        /// 公务舱选择框
+        /// </summary>
+        public int AirGWC_Checked { get; set; }
+
+        /// <summary>
+        /// 头等舱选择框
+        /// </summary>
+        public int AirTDC_Checked { get; set; }
+
+        /// <summary>
+        /// 其他款项选择框
+        /// </summary>
+        public int OtherExpenses_Checked { get; set; }
+
+        /// <summary>
+        /// 其他款项子项Data
+        /// </summary>
+        public List<DayOtherPriceDraftView> DayOtherPriceData { get; set; }
+        #endregion
+    }
+
+    /// <summary>
+    /// 出入境国家(城市)费用标准子项Info  View
+    /// </summary>
+    public class DayAndCostDraftInfoView
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int ParentId { get; set; }
+
+        /// <summary>
+        /// 类型:1为住宿费;2为伙食费;3为公杂费;4培训费用
+        /// </summary>
+        public int Type { get; set; }
+
+        /// <summary>
+        /// 类型名称
+        /// </summary>
+        public string? TypeName
+        {
+            get
+            {
+                string str = "";
+                if (Type == 1) str = string.Format("住宿费");
+                else if (Type == 2) str = string.Format("伙食费");
+                else if (Type == 3) str = string.Format("公杂费");
+                else if (Type == 4) str = string.Format("培训费");
+                return str;
+            }
+        }
+
+        /// <summary>
+        /// 天数
+        /// </summary>
+        public int Days { get; set; }
+
+        /// <summary>
+        /// 出入境国家费用标准 - Id
+        /// </summary>
+        public int NationalTravelFeeId { get; set; }
+
+        /// <summary>
+        /// 出入境国家费用标准 - 国家
+        /// </summary>
+        public string? Country { get; set; }
+
+        /// <summary>
+        /// 出入境国家费用标准 - 城市
+        /// </summary>
+        public string? City { get; set; }
+
+        ///// <summary>
+        ///// 地名
+        ///// </summary>
+        //public string? Place { get; set; }
+
+        /// <summary>
+        /// 地名
+        /// </summary>
+        public string? PlaceName
+        {
+            get
+            {
+                string str = "";
+                if (!string.IsNullOrEmpty(Country))
+                {
+                    if (City.Contains("城市")) str = Country;
+                    else str = City;
+                }
+
+                return str;
+
+            }
+        }
+
+        /// <summary>
+        /// 费用标准
+        /// </summary>
+        public decimal Cost { get; set; }
+
+        /// <summary>
+        /// 币种 Id
+        /// Sys_SetData STid = 66
+        /// </summary>
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 币种Code
+        /// </summary>
+        public string? CurremcyCode { get; set; }
+
+        /// <summary>
+        /// 币种名称
+        /// </summary>
+        public string? CurrencyName { get; set; }
+
+        /// <summary>
+        /// 小计
+        /// </summary>
+        public decimal SubTotal { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string? Remark { get; set; } = "";
+    }
+
+    public class DayOtherPriceDraftView
+    {
+        public int Id { get; set; }
+
+        public int ParentId { 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; }
+    }
+
+
+    /// <summary>
+    /// 出入境国家(城市)费用标准子项Add  View
+    /// </summary>
+    public class DayAndCostDraftAddView
+    {
+        /// <summary>
+        /// 主键编号
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 主表Id
+        /// </summary>
+        public int ParentId { get; set; }
+
+        /// <summary>
+        /// 类型:1为住宿费;2为伙食费;3为公杂费;4培训费用
+        /// </summary>
+        public int Type { 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>
+        /// 币种 Id
+        /// Sys_SetData STid = 66
+        /// </summary>
+        public int Currency { get; set; }
+
+        /// <summary>
+        /// 小计
+        /// </summary>
+        public decimal SubTotal { get; set; }
+
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string? Remark { get; set; } = "";
+    }
+
+    public class DayOtherPriceDraftAddView
+    {
+        public int Id { get; set; }
+
+        public int ParentId { 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; }
+    }
+
+    /// <summary>
+    /// 出入境费用子项删除
+    /// </summary>
+    public class EnterExitCostDraftSubItemDelDto : DelBaseDto
+    { }
+}

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

@@ -14,6 +14,16 @@ namespace OASystem.Domain.ViewModels.Groups
     /// </summary>
     public class EnterExitCostView:Grp_EnterExitCost { }
 
+
+    public class EnterExitCostGroupNameView
+    {
+        public int Id { get; set; }
+
+        public string GroupName { get; set; }
+
+        public string IsNull { get; set; }
+    }
+
     /// <summary>
     /// 出入境国家(城市)费用标准 View
     /// </summary>
@@ -343,6 +353,11 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public decimal CityTranffic { get; set; }
 
+        /// <summary>
+        /// 第二项备注
+        /// </summary>
+        public string TwoItemRemark { get; set; }
+
         #region 汇率币种
 
         /// <summary>
@@ -710,6 +725,8 @@ namespace OASystem.Domain.ViewModels.Groups
         ///  国外城市间交通费
         /// </summary>
         public decimal CityTranffic { get; set; }
+
+        public string TwoItemRemark { get; set; }
     }
 
     public class ChoiceTwoMobileSubInfoView : ChoiceTwoMobileInfoView

+ 9 - 2
OASystem/OASystem.Domain/ViewModels/Resource/OfficialActivitiesView.cs

@@ -14,7 +14,7 @@ namespace OASystem.Domain.ViewModels.Resource
         /// <summary>
         /// 翻译人员Id 
         /// </summary>
-        public int[] TranslatorIdItem { get; set; }
+        public int[] TranslatorIdItem { get; set; } = Array.Empty<int>();
 
         public List<string> ScreenshotOfMailUrls
         {
@@ -45,7 +45,7 @@ namespace OASystem.Domain.ViewModels.Resource
             }
         }
 
-        public TranslatorView TranslatorInfo { get; set; }
+        public TranslatorView TranslatorInfo { get; set; } = new TranslatorView { };
     }
 
     public class TranslatorView
@@ -55,11 +55,13 @@ namespace OASystem.Domain.ViewModels.Resource
         /// <summary>
         /// 所在地区
         /// </summary>
+        [Encrypted]
         public string Area { get; set; }
 
         /// <summary>
         /// 姓名
         /// </summary>
+        [Encrypted]
         public string Name { get; set; }
 
         /// <summary>
@@ -70,26 +72,31 @@ namespace OASystem.Domain.ViewModels.Resource
         /// <summary>
         /// 联系电话
         /// </summary>
+        [Encrypted]
         public string Tel { get; set; }
 
         /// <summary>
         /// 邮箱号
         /// </summary>
+        [Encrypted]
         public string Email { get; set; }
 
         /// <summary>
         /// 微信号
         /// </summary>
+        [Encrypted]
         public string WechatNo { get; set; }
 
         /// <summary>
         /// 其他社交账号
         /// </summary>
+        [Encrypted]
         public string OtherSocialAccounts { get; set; }
 
         /// <summary>
         /// 语种
         /// </summary>
+        [Encrypted]
         public string Language { get; set; }
 
         /// <summary>

+ 85 - 50
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -1,6 +1,7 @@
 using AutoMapper;
 using Newtonsoft.Json;
 using NPOI.OpenXmlFormats.Wordprocessing;
+using NPOI.SS.Formula.Functions;
 using OASystem.Domain;
 using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos;
@@ -493,64 +494,56 @@ namespace OASystem.Infrastructure.Repositories.Groups
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
 
-            try
+            if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
             {
-                if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
+                dynamic? teamTypeData1 = null;
+                string teamTypeSql = string.Format(@"Select Id,Name From  Sys_SetData Where STid = {0} And IsDel = {1}", 10, 0);
+                var teamTypeData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamTypeSql).ToListAsync(); ;  //团组分类 10
+                if (teamTypeData.Any())
                 {
-                    dynamic? teamTypeData1 = null;
-                    string teamTypeSql = string.Format(@"Select Id,Name From  Sys_SetData Where STid = {0} And IsDel = {1}", 10, 0);
-                    var teamTypeData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamTypeSql).ToListAsync(); ;  //团组分类 10
-                    if (teamTypeData.Count > 0)
-                    {
-                        teamTypeData1 = teamTypeData;
-                    }
-
-                    dynamic? teamLevData1 = null;
-                    string teamLevSql = string.Format(@"Select Id,Name From  Sys_SetData Where STid = {0} And IsDel = {1}", 56, 0);
-                    var teamLevData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamLevSql).ToListAsync(); ;  //团组等级 56
-                    if (teamLevData.Count > 0)
-                    {
-                        teamLevData1 = teamLevData;
-                    }
+                    teamTypeData1 = teamTypeData;
+                }
 
-                    dynamic? userData1 = null;
-                    string userSql = string.Format(@"Select Id,CnName From  Sys_Users Where IsDel = {0}", 0);
-                    var userData = await _sqlSugar.SqlQueryable<UserNameView>(userSql).ToListAsync(); 
-                    if (userData.Count > 0)
-                    {
-                        userData1 = userData;
-                    }
+                dynamic? teamLevData1 = null;
+                string teamLevSql = string.Format(@"Select Id,Name From  Sys_SetData Where STid = {0} And IsDel = {1}", 56, 0);
+                var teamLevData = await _sqlSugar.SqlQueryable<SetDataInfoView>(teamLevSql).ToListAsync(); ;  //团组等级 56
+                if (teamLevData.Any())
+                {
+                    teamLevData1 = teamLevData;
+                }
 
-                    //客户单位数据源 来源市场客户资料
-                    dynamic? clientData1 = null;
-                    string clientSql = $@"Select Client,Contact,Telephone,WeChat From Crm_NewClientData Where IsDel = 0";
-                    var clientData = await _sqlSugar.SqlQueryable<Crm_NewClientData>(clientSql).ToListAsync();
-                    if (clientData.Count > 0)
-                    {
-                        clientData1 = clientData.Select(it => new
-                        {
-                            Client = AesEncryptionHelper.Decrypt(it.Client),
-                            Contact = AesEncryptionHelper.Decrypt(it.Contact),
-                            Telephone = AesEncryptionHelper.Decrypt(it.Telephone),
-                            Wechat = AesEncryptionHelper.Decrypt(it.Wechat)
-                        }).ToList();
-                    }
+                dynamic? userData1 = null;
+                string userSql = string.Format(@"Select Id,CnName From  Sys_Users Where IsDel = {0}", 0);
+                var userData = await _sqlSugar.SqlQueryable<UserNameView>(userSql).ToListAsync();
+                if (userData.Any())
+                {
+                    userData1 = userData;
+                }
 
-                    result.Code = 0;
-                    result.Msg = "成功!";
-                    result.Data = new
+                //客户单位数据源 来源市场客户资料
+                dynamic? clientData1 = null;
+                string clientSql = $@"Select Client,Contact,Telephone,WeChat From Crm_NewClientData Where IsDel = 0";
+                var clientData = await _sqlSugar.SqlQueryable<Crm_NewClientData>(clientSql).ToListAsync();
+                if (clientData.Any())
+                {
+                    clientData1 = clientData.Select(it => new
                     {
-                        teamTypeData = teamTypeData1,
-                        teamLevData = teamLevData1,
-                        userData = userData1,
-                        clientData = clientData1
-                    };
+                        Client = AesEncryptionHelper.Decrypt(it.Client),
+                        Contact = AesEncryptionHelper.Decrypt(it.Contact),
+                        Telephone = AesEncryptionHelper.Decrypt(it.Telephone),
+                        Wechat = AesEncryptionHelper.Decrypt(it.Wechat)
+                    }).ToList();
                 }
-            }
-            catch (Exception ex)
-            {
 
-                result.Msg = ex.Message;
+                result.Code = 0;
+                result.Msg = "成功!";
+                result.Data = new
+                {
+                    teamTypeData = teamTypeData1,
+                    teamLevData = teamLevData1,
+                    userData = userData1,
+                    clientData = clientData1
+                };
             }
 
 
@@ -1088,6 +1081,48 @@ namespace OASystem.Infrastructure.Repositories.Groups
         }
 
 
+        #endregion
+
+
+        #region 团组&出入境费用
+
+        /// <summary>
+        /// 获取单组名称并验证出入境费用明细是否填写
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> EnterExitCostGroupNameAsync()
+        {
+            var result = new Result() { Code = -2, Msg = "未知错误" };
+
+            var groupSql = string.Format(@$"SELECT
+  Id,
+  TeamName GroupName,
+  CASE
+    WHEN (
+      SELECT
+        COUNT(*)
+      FROM
+        Grp_EnterExitCost
+      WHERE
+        IsDel = 0
+        AND DiId = di.Id
+    ) > 0 THEN 'false'
+    ELSE 'true'
+  END AS [IsNull]
+FROM
+  Grp_DelegationInfo di
+WHERE
+  di.Isdel = 0
+ORDER BY
+  CreateTime Desc");
+
+            result.Data = await _sqlSugar.SqlQueryable<EnterExitCostGroupNameView>(groupSql).ToListAsync();
+            result.Code = 0;
+            return result;
+
+        }
+
         #endregion
     }
 }

+ 361 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs

@@ -0,0 +1,361 @@
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.ViewModels.Groups;
+using OASystem.Domain;
+using OASystem.Infrastructure.Repositories.System;
+using OASystem.Infrastructure.Tools;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AutoMapper;
+
+namespace OASystem.Infrastructure.Repositories.Groups
+{
+    /// <summary>
+    /// 出入境费用-草稿 仓库
+    /// </summary>
+    public class EnterExitCostDraftRepository : BaseRepository<Grp_EnterExitCostDraft, EnterExitCostDraftView>
+    {
+        private readonly IMapper _mapper;
+        private readonly SetDataRepository _setDataRep;
+
+
+        public EnterExitCostDraftRepository(SqlSugarClient sqlSugar, IMapper mapper, SetDataRepository setDataRep)
+            : base(sqlSugar)
+        {
+            _setDataRep = setDataRep;
+            _mapper = mapper;
+        }
+
+        /// <summary>
+        /// 查询 根据 Id 查询
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> EnterExitCostDraftInfoById(EnterExitCostDraftInfoByIdDto dto)
+        {
+            var result = new JsonView() { Code = 400, Msg = "暂无数据" };
+
+            var id = dto.Id;
+            var enterExitCostDraftData = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.Id == id && it.IsDel == 0);
+
+            var enterExitCostInfoView = new EnterExitCostDraftInfoView();
+
+            if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) 
+            {
+                if (enterExitCostDraftData != null)
+                {
+                    enterExitCostInfoView = _mapper.Map<EnterExitCostDraftInfoView>(enterExitCostDraftData);
+
+                    var dayAndCostDraftSql = string.Format(@"Select ntf.Country,ntf.City,ssd.Name CurremcyCode,ssd.Remark CurrencyName,gdac.* From Grp_DayAndCostDraft gdac
+                                                        Left Join Grp_NationalTravelFee ntf On ntf.Id = gdac.NationalTravelFeeId
+                                                        Left Join Sys_SetData ssd On ssd.STid = 66 And gdac.Currency = ssd.Id
+                                                        Where gdac.Isdel = 0 And ntf.IsDel = 0 And gdac.ParentId = {0} Order By [Type] ASC,[Days] ASC", id);
+                    var dayAndCostDraftData = await _sqlSugar.SqlQueryable<DayAndCostDraftInfoView>(dayAndCostDraftSql).ToListAsync();
+
+
+                    enterExitCostInfoView.QuarterageData = dayAndCostDraftData.Where(it => it.Type == 1).ToList(); //住宿费 1
+                    enterExitCostInfoView.BoardWagesData = dayAndCostDraftData.Where(it => it.Type == 2).ToList(); //伙食费 2
+                    enterExitCostInfoView.MiscellaneousFeeData = dayAndCostDraftData.Where(it => it.Type == 3).ToList();  //公杂费 3
+                    enterExitCostInfoView.TrainingExpenseData = dayAndCostDraftData.Where(it => it.Type == 4).ToList();  //培训费 4
+
+                    enterExitCostInfoView.DayOtherPriceData = _sqlSugar.Queryable<Grp_DayOtherPriceDraft>()
+                                                                .Where(x => x.IsDel == 0 && x.ParentId == id)
+                                                                .Select(x => new DayOtherPriceDraftView
+                                                                {
+                                                                    ParentId = x.ParentId,
+                                                                    Id = x.Id,
+                                                                    Cost = x.Cost,
+                                                                    Currency = x.Currency,
+                                                                    Index = x.Index,
+                                                                    SetDataId = x.SetDataId,
+                                                                    SubTotal = x.SubTotal,
+                                                                    Remark = x.Remark,
+                                                                })
+                                                                .OrderBy(x => x.Index)
+                                                                .ToList();
+
+                    enterExitCostInfoView.Currencys = (List<CurrencyInfo>?)CommonFun.GetCurrencyChinaToList(enterExitCostDraftData.CurrencyRemark);
+
+                    result.Msg = "操作成功";
+                    result.Code = 200;
+                }
+                else
+                {
+                    //    List<DayAndCostInfoView> views = new List<DayAndCostInfoView>()
+                    //    {
+                    //            new DayAndCostInfoView {Days=1},
+                    //            new DayAndCostInfoView {Days=2},
+                    //            new DayAndCostInfoView {Days=3},
+                    //            new DayAndCostInfoView {Days=4},
+                    //            new DayAndCostInfoView {Days=5},
+                    //            new DayAndCostInfoView {Days=6},
+                    //            new DayAndCostInfoView {Days=7},
+                    //            new DayAndCostInfoView {Days=8},
+                    //    };
+                    //    enterExitCostInfoView.QuarterageData = views;
+                    //    enterExitCostInfoView.BoardWagesData = views;
+                    //    enterExitCostInfoView.MiscellaneousFeeData = views;
+                    //    enterExitCostInfoView.TrainingExpenseData = views;
+                    //    result.Code = 0;
+                    result.Msg = "未查询出数据!!!";
+                }
+
+                result.Data = enterExitCostInfoView;
+            }
+            else result.Msg = MsgTips.Port;
+
+            return result;
+        }
+
+        /// <summary>
+        /// Add Or Update
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> EnterExitCostDraftOp(EnterExitCostDraftOpDto dto)
+        {
+            Result result = new Result() { Code = -1, Msg = "操作失败!" };
+
+            if (dto.SumJJC == 0) dto.OutsideJJPay = 0;
+            if (dto.SumGWC == 0) dto.OutsideGWPay = 0;
+            if (dto.SumTDC == 0) dto.OutsideTDPay = 0;
+
+            var enterExitCost = _mapper.Map<Grp_EnterExitCostDraft>(dto);
+            enterExitCost.Remark = dto.FirstItemRemark;
+            //enterExitCost.InsidePay = enterExitCost.Visa + enterExitCost.YiMiao + enterExitCost.HeSuan + enterExitCost.Service + enterExitCost.Safe + enterExitCost.Ticket;
+
+            var subData = new List<Grp_DayAndCostDraft>();
+            var quarterageData = _mapper.Map<List<Grp_DayAndCostDraft>>(dto.QuarterageData);  //住宿费 1
+            quarterageData = quarterageData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (quarterageData.Any()) subData.AddRange(quarterageData);
+
+            var boardWagesData = _mapper.Map<List<Grp_DayAndCostDraft>>(dto.BoardWagesData);  //伙食费 2
+            boardWagesData = boardWagesData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (boardWagesData.Any()) subData.AddRange(boardWagesData);
+
+            var miscellaneousFeeData = _mapper.Map<List<Grp_DayAndCostDraft>>(dto.MiscellaneousFeeData);  //公杂费 3
+            miscellaneousFeeData = miscellaneousFeeData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (miscellaneousFeeData.Any()) subData.AddRange(miscellaneousFeeData);
+
+            var trainingExpenseData = _mapper.Map<List<Grp_DayAndCostDraft>>(dto.TrainingExpenseData);    //培训费 4
+            trainingExpenseData = trainingExpenseData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
+            if (trainingExpenseData.Any()) subData.AddRange(trainingExpenseData);
+
+            //处理币种string
+            enterExitCost.CurrencyRemark = CommonFun.GetCurrencyChinaToString(dto.Currencys);
+            enterExitCost.CreateUserId = dto.UserId;
+
+            _sqlSugar.BeginTran();
+
+            if (dto.PortType == 1)
+            {
+                try
+                {
+                    int enterExitId = 0;
+
+                    var isNull = _sqlSugar.Queryable<Grp_EnterExitCostDraft>().Where(it => it.IsDel == 0 && it.DraftName.Equals(dto.DraftName)).First();
+                    if (isNull != null) //修改
+                    {
+                        var updateId = _sqlSugar.Updateable(enterExitCost)
+                                                .IgnoreColumns(it => new { it.DeleteUserId, it.DeleteTime, it.CreateUserId, it.CreateTime, it.IsDel })
+                                                .WhereColumns(it => it.DraftName)
+                                                .ExecuteCommand();
+                        if (updateId > 0)
+                        {
+                            enterExitId = isNull.Id;
+                        }
+                        else
+                        {
+                            _sqlSugar.RollbackTran();
+                            result.Msg = "修改操作失败!";
+                            return result;
+                        }
+                    }
+                    else //添加
+                    {
+                        //添加
+                        enterExitId = _sqlSugar.Insertable(enterExitCost).ExecuteReturnIdentity();
+                        if (enterExitId < 1)
+                        {
+                            _sqlSugar.RollbackTran();
+                            result.Msg = "添加操作失败!";
+                            return result;
+                        }
+                        subData.Select(x => { x.Id = 0; return x; }).ToList();
+                        dto.DayOtherPriceData.Select(x => { x.Id = 0; return x; }).ToList();
+
+                    }
+
+                    if (enterExitId > 0)
+                    {
+                        subData = subData.Select(x => { x.ParentId = enterExitId; return x; }).ToList();
+
+                        var addList = subData.Where(x => x.Id == 0).ToList();
+                        var updateList = subData.Where(x => x.Id > 0).ToList();
+
+                        if (addList.Any())
+                        {
+                            var rowCount = _sqlSugar.Insertable(addList).ExecuteCommand();
+                        }
+                        if (updateList.Any())
+                        {
+                            var rowCount = _sqlSugar.Updateable(updateList).ExecuteCommand();
+                        }
+
+                        if (dto.DayOtherPriceData.Any())
+                        {
+                            var inserList = dto.DayOtherPriceData
+                                .Where(x => x.Id == 0)
+                                .Select(x => new Grp_DayOtherPriceDraft
+                                {
+                                    Cost = x.Cost,
+                                    Id = x.Id,
+                                    CreateTime = DateTime.Now,
+                                    CreateUserId = dto.UserId,
+                                    Currency = x.Currency,
+                                    ParentId = enterExitId,
+                                    Index = x.Index,
+                                    IsDel = 0,
+                                    SetDataId = x.SetDataId,
+                                    SubTotal = x.SubTotal,
+                                    Remark = x.Remark,
+                                    
+                                })
+                                .ToList();
+                            var updateList1 = dto.DayOtherPriceData
+                                .Where(x => x.Id != 0)
+                                .Select(x => new Grp_DayOtherPriceDraft
+                                {
+                                    Cost = x.Cost,
+                                    Id = x.Id,
+                                    CreateTime = DateTime.Now,
+                                    CreateUserId = dto.UserId,
+                                    Currency = x.Currency,
+                                    ParentId = enterExitId,
+                                    Index = x.Index,
+                                    IsDel = 0,
+                                    SetDataId = x.SetDataId,
+                                    SubTotal = x.SubTotal,
+                                    Remark = x.Remark
+                                })
+                                .ToList();
+
+                            if (inserList.Any())
+                            {
+                                var rowCount = _sqlSugar.Insertable(inserList).ExecuteCommand();
+                            }
+                            if (updateList1.Any())
+                            {
+                                var rowCount = _sqlSugar.Updateable(updateList1).ExecuteCommand();
+                            }
+                        }
+
+                    }
+                    _sqlSugar.CommitTran();
+                    result.Code = 0;
+                    result.Msg = "操作成功!";
+                    result.Data = new { sign = enterExitId, draftName = enterExitCost.DraftName };
+
+                }
+                catch (Exception ex)
+                {
+                    _sqlSugar.RollbackTran();
+                    result.Msg = ex.Message;
+                }
+            }
+            else result.Msg = MsgTips.Port;
+
+
+            return result;
+        }
+
+        /// <summary>
+        /// Del
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> EnterExitCostDraftSubItemDel(EnterExitCostDraftSubItemDelDto dto)
+        {
+            Result result = new Result();
+
+            var data = new Grp_DayAndCostDraft()
+            {
+                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) result.Code = 0;
+            else result.Msg = string.Format("删除失败!");
+
+            return result;
+        }
+
+        /// <summary>
+        /// 一键清空
+        /// 删除主表数据 Update
+        /// 删除子表数据 delete
+        /// </summary>
+        /// <param name="id"></param>
+        /// <param name="userId"></param>
+        /// <returns></returns>
+        public async Task<Result> OneClickEmpty(int id, int userId)
+        {
+            Result result = new Result() { Code = -1, Msg = "操作成功!" };
+
+            if (id < 1) return result = new Result() { Code = -1, Msg = "请传入有效的Id参数!" };
+            if (userId < 1) return result = new Result() { Code = -1, Msg = "请传入有效的UserId参数!" };
+
+            BeginTran();
+
+            int update = await _sqlSugar.Updateable<Grp_EnterExitCostDraft>()
+                .SetColumns(it => new Grp_EnterExitCostDraft()
+                {
+                    IsDel = 1,
+                    DeleteUserId = userId,
+                    DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+                })
+                .Where(it => it.Id == id)
+                .ExecuteCommandAsync();
+
+            if (update > 0)
+            {
+                await _sqlSugar.Updateable<Grp_DayAndCostDraft>()
+                    .SetColumns(it => new Grp_DayAndCostDraft()
+                    {
+                        IsDel = 1,
+                        DeleteUserId = userId,
+                        DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+                    })
+                    .Where(it => it.ParentId == id)
+                    .ExecuteCommandAsync();
+
+                await _sqlSugar.Updateable<Grp_DayOtherPriceDraft>()
+                    .SetColumns(it => new Grp_DayOtherPriceDraft()
+                    {
+                        IsDel = 1,
+                        DeleteUserId = userId,
+                        DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+                    })
+                    .Where(it => it.ParentId == id)
+                    .ExecuteCommandAsync();
+
+                result.Code = 0;
+                result.Msg = "操作成功!";
+                CommitTran();
+            }
+            else
+            {
+                result.Msg = "操作失败";
+                RollbackTran();
+            }
+
+            return result;
+        }
+    }
+}

+ 3 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -76,14 +76,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             //Sys_PageFunctionPermission Function = _mapper.Map<Sys_PageFunctionPermission>(dto);
 
-            EnterExitCostInfoView enterExitCostInfoView = new EnterExitCostInfoView();
+            var enterExitCostInfoView = new EnterExitCostInfoView();
 
             if (dto.PortType == 1) // Web
             {
                 if (enterExitCostData != null)
                 {
                     enterExitCostInfoView = _mapper.Map<EnterExitCostInfoView>(enterExitCostData);
-                    enterExitCostInfoView.FirstItemRemark = enterExitCostData.Remark;
+                    //enterExitCostInfoView.FirstItemRemark = enterExitCostData.Remark;
                     var dayAndCostSql = string.Format(@"Select ntf.Country,ntf.City,ssd.Name CurremcyCode,ssd.Remark CurrencyName,gdac.* From Grp_DayAndCost gdac
                                                         Left Join Grp_NationalTravelFee ntf On ntf.Id = gdac.NationalTravelFeeId
                                                         Left Join Sys_SetData ssd On ssd.STid = 66 And gdac.Currency = ssd.Id
@@ -235,7 +235,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             if (dto.SumTDC == 0) dto.OutsideTDPay = 0;
 
             var enterExitCost = _mapper.Map<Grp_EnterExitCost>(dto);
-            enterExitCost.Remark = dto.FirstItemRemark;
+            //enterExitCost.Remark = dto.FirstItemRemark;
             //enterExitCost.InsidePay = enterExitCost.Visa + enterExitCost.YiMiao + enterExitCost.HeSuan + enterExitCost.Service + enterExitCost.Safe + enterExitCost.Ticket;
 
             List<Grp_DayAndCost> subData = new List<Grp_DayAndCost>();

+ 122 - 109
OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs

@@ -160,20 +160,21 @@ FROM
   LEFT JOIN Sys_Users u ON oa.CreateUserId = u.Id
   LEFT JOIN Sys_SetData sd ON oa.OfficialForm = sd.Id
 {0}", sqlWhere);
-                var oa = await _sqlSugar.SqlQueryable<OfficialActivitiesView>(sql)
-                    .FirstAsync();
-                //OfficialActivities.ScreenshotOfMailUrls.ForEach(url => { url = AppSettingsHelper.Get("GrpFileBaseUrl") + url; });
+                var oa = await _sqlSugar.SqlQueryable<OfficialActivitiesView>(sql).FirstAsync();
 
-                oa.TranslatorIdItem = _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>()
+                var array1 =  _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>()
                     .Where(x => x.IsDel == 0 && x.OfficialDutyId == dto.Id)
                     .Select(x => x.TranslatorId)
                     .ToArray();
 
-                if (oa.TranslatorIdItem.Any())
+                if (array1.Any()) 
                 {
+                    oa.TranslatorIdItem = array1;
+
+                    int translatorId = array1[0];
                     var translatorInfo = await _sqlSugar.Queryable<Res_TranslatorLibrary>()
-                   .Where(x => x.IsDel == 0 && oa.TranslatorIdItem[0] == dto.Id)
-                   .FirstAsync();
+                        .Where(x => x.IsDel == 0 && x.Id == translatorId)
+                        .FirstAsync();
 
                     EncryptionProcessor.DecryptProperties(translatorInfo);
 
@@ -191,7 +192,7 @@ FROM
         }
         public async Task<Result> OpOfficialActivities(OpOfficialActivitiesDto dto)
         {
-            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            var result = new Result() { Code = -2, Msg = "未知错误" };
 
             #region 特殊字符转码  037 - 4.28 15:17
 
@@ -220,19 +221,25 @@ FROM
             res_InvitationData.Field = dto.Field;
             EncryptionProcessor.EncryptProperties(res_InvitationData);
 
-            //翻译人员资料
-            var translatorInfo = _mapper.Map<Res_TranslatorLibrary>(dto.TranslatorInfo);
-            translatorInfo.CreateUserId = dto.CreateUserId;
-            if (dto.TranslatorIdItem.Any()) translatorInfo.Id = dto.TranslatorIdItem[0];
+            var isInserTranslator = false;
+            var translatorInfo = new Res_TranslatorLibrary();
+            if (true)
+            {
+                //翻译人员资料
+                translatorInfo = _mapper.Map<Res_TranslatorLibrary>(dto.TranslatorInfo);
+                translatorInfo.CreateUserId = dto.CreateUserId;
+                if (dto.TranslatorIdItem.Any()) translatorInfo.Id = dto.TranslatorIdItem[0];
 
-            EncryptionProcessor.EncryptProperties(translatorInfo);
+                EncryptionProcessor.EncryptProperties(translatorInfo);
+                isInserTranslator = true;
+            }
 
             int DataID = 0;
             if (dto.Status == 1)//添加
             {
                 //添加资料
                 DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
-                Res_OfficialActivities _InvitationOfficialActivityData = _mapper.Map<Res_OfficialActivities>(dto);
+                var _InvitationOfficialActivityData = _mapper.Map<Res_OfficialActivities>(dto);
                 _InvitationOfficialActivityData.DataId = DataID;
                 int id = await _sqlSugar.Insertable(_InvitationOfficialActivityData).ExecuteReturnIdentityAsync();
                 if (id == 0)
@@ -243,60 +250,62 @@ FROM
                 else
                 {
                     var translatorId = translatorInfo.Id;
-                    if (translatorId > 0) // 翻译人员资料更新
+
+                    if (isInserTranslator)
                     {
-                        var tiStatus = await _sqlSugar.Updateable<Res_TranslatorLibrary>(translatorInfo)
-                            .UpdateColumns(x => new
-                            {
-                                x.Area,
-                                x.Name,
-                                x.Sex,
-                                x.Tel,
-                                x.Email,
-                                x.WechatNo,
-                                x.OtherSocialAccounts,
-                                x.Language,
-                                x.Price,
-                                x.Currency,
-                            })
-                            .ExecuteCommandAsync();
-
-                        if (tiStatus < 1)
+                        if (translatorId > 0) // 翻译人员资料更新
                         {
-                            _sqlSugar.RollbackTran();
-                            return new Result() { Code = -1, Msg = "翻译人员资料更新失败!", Data = new { Id = id } };
+                            var tiStatus = await _sqlSugar.Updateable<Res_TranslatorLibrary>(translatorInfo)
+                                .UpdateColumns(x => new
+                                {
+                                    x.Area,
+                                    x.Name,
+                                    x.Sex,
+                                    x.Tel,
+                                    x.Email,
+                                    x.WechatNo,
+                                    x.OtherSocialAccounts,
+                                    x.Language,
+                                    x.Price,
+                                    x.Currency,
+                                })
+                                .ExecuteCommandAsync();
+
+                            if (tiStatus < 1)
+                            {
+                                _sqlSugar.RollbackTran();
+                                return new Result() { Code = -1, Msg = "翻译人员资料更新失败!", Data = new { Id = id } };
+                            }
                         }
-                    }
-                    else //添加翻译人员资料
-                    {
-                        translatorId = await _sqlSugar.Insertable(translatorInfo).ExecuteReturnIdentityAsync();
-                        if (translatorId == 0)
+                        else //添加翻译人员资料
                         {
-                            _sqlSugar.RollbackTran();
-                            return new Result() { Code = -1, Msg = "翻译人员资料添加失败!", Data = new { Id = id } };
+                            translatorId = await _sqlSugar.Insertable(translatorInfo).ExecuteReturnIdentityAsync();
+                            if (translatorId == 0)
+                            {
+                                _sqlSugar.RollbackTran();
+                                return new Result() { Code = -1, Msg = "翻译人员资料添加失败!", Data = new { Id = id } };
+                            }
                         }
-                    }
 
-                    #region 新增(公务信息关联翻译人员) 关联信息
+                        #region 新增(公务信息关联翻译人员) 关联信息
 
-                    var linkStatus = await _sqlSugar
-                        .Insertable(new Grp_OfficialDutyLinkTranslator()
+                        var linkStatus = await _sqlSugar
+                            .Insertable(new Grp_OfficialDutyLinkTranslator()
+                            {
+                                TranslatorId = translatorId,
+                                OfficialDutyId = id,
+                                CreateUserId = dto.CreateUserId,
+                                Remark = $"公务出访客户资料-->添加"
+                            }).ExecuteCommandAsync();
+
+                        if (linkStatus < 1)
                         {
-                            TranslatorId = translatorId,
-                            OfficialDutyId = id,
-                            CreateUserId = dto.CreateUserId,
-                            Remark = $"公务出访客户资料-->添加"
-                        }).ExecuteCommandAsync();
+                            _sqlSugar.RollbackTran();
+                            return new Result() { Code = -1, Msg = "公务出访关联翻译人员资料添加失败!", Data = new { Id = id } };
+                        }
 
-                    if (linkStatus < 1)
-                    {
-                        _sqlSugar.RollbackTran();
-                        return new Result() { Code = -1, Msg = "公务出访关联翻译人员资料添加失败!", Data = new { Id = id } };
+                        #endregion
                     }
-                    
-                    #endregion
-
-
                     _sqlSugar.CommitTran();
                     result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
                 }
@@ -382,73 +391,77 @@ FROM
                 });
                 if (res)
                 {
-                    #region 更新(公务信息关联翻译人员) 关联信息
-
-                    if (translatorInfo.Id > 0) //资料更新
+                    if (isInserTranslator)
                     {
-                        var tiStatus = await _sqlSugar.Updateable<Res_TranslatorLibrary>(translatorInfo)
-                            .UpdateColumns(x => new
-                            {
-                                x.Area,
-                                x.Name,
-                                x.Sex,
-                                x.Tel,
-                                x.Email,
-                                x.WechatNo,
-                                x.OtherSocialAccounts,
-                                x.Language,
-                                x.Price,
-                                x.Currency,
-                            })
-                            .ExecuteCommandAsync();
-
-                        if (tiStatus < 1)
-                        {
-                            _sqlSugar.RollbackTran();
-                            return new Result() { Code = -1, Msg = "翻译人员资料更新失败!", Data = new { Id = dto.Id } };
-                        }
+                        #region 更新(公务信息关联翻译人员) 关联信息
 
-                        var dutyLink_select = await _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>()
-                       .Where(x => x.IsDel == 0 && x.OfficialDutyId == dto.Id&& x.TranslatorId == translatorInfo.Id)
-                       .FirstAsync();
-                        if (dutyLink_select == null)
+                        if (translatorInfo.Id > 0) //资料更新
                         {
-                            var odltStatus = await _sqlSugar.Insertable(new Grp_OfficialDutyLinkTranslator()
+                            var tiStatus = await _sqlSugar.Updateable<Res_TranslatorLibrary>(translatorInfo)
+                                .UpdateColumns(x => new
+                                {
+                                    x.Area,
+                                    x.Name,
+                                    x.Sex,
+                                    x.Tel,
+                                    x.Email,
+                                    x.WechatNo,
+                                    x.OtherSocialAccounts,
+                                    x.Language,
+                                    x.Price,
+                                    x.Currency,
+                                })
+                                .ExecuteCommandAsync();
+
+                            if (tiStatus < 1)
+                            {
+                                _sqlSugar.RollbackTran();
+                                return new Result() { Code = -1, Msg = "翻译人员资料更新失败!", Data = new { Id = dto.Id } };
+                            }
+
+                            var dutyLink_select = await _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>()
+                           .Where(x => x.IsDel == 0 && x.OfficialDutyId == dto.Id && x.TranslatorId == translatorInfo.Id)
+                           .FirstAsync();
+                            if (dutyLink_select == null)
+                            {
+                                var odltStatus = await _sqlSugar.Insertable(new Grp_OfficialDutyLinkTranslator()
                                 {
                                     TranslatorId = translatorInfo.Id,
                                     OfficialDutyId = dto.Id,
                                     CreateUserId = dto.CreateUserId,
                                     Remark = $"公务出访客户资料-->添加"
                                 }).ExecuteCommandAsync();
+                                if (odltStatus < 1)
+                                {
+                                    _sqlSugar.RollbackTran();
+                                    result = new Result() { Code = -1, Msg = "公务出访关联翻译人员资料添加失败!" };
+                                }
+                            }
+                        }
+                        else // 添加
+                        {
+                            translatorInfo.Id = await _sqlSugar.Insertable(translatorInfo).ExecuteReturnIdentityAsync();
+                            if (translatorInfo.Id == 0)
+                            {
+                                _sqlSugar.RollbackTran();
+                                return new Result() { Code = -1, Msg = "翻译人员资料添加失败!", Data = new { Id = dto.Id } };
+                            }
+                            var odltStatus = await _sqlSugar.Insertable(new Grp_OfficialDutyLinkTranslator()
+                            {
+                                TranslatorId = translatorInfo.Id,
+                                OfficialDutyId = dto.Id,
+                                CreateUserId = dto.CreateUserId,
+                                Remark = $"公务出访客户资料-->添加"
+                            }).ExecuteCommandAsync();
                             if (odltStatus < 1)
                             {
                                 _sqlSugar.RollbackTran();
                                 result = new Result() { Code = -1, Msg = "公务出访关联翻译人员资料添加失败!" };
                             }
                         }
+                        #endregion
                     }
-                    else // 添加
-                    {
-                        translatorInfo.Id = await _sqlSugar.Insertable(translatorInfo).ExecuteReturnIdentityAsync();
-                        if (translatorInfo.Id == 0)
-                        {
-                            _sqlSugar.RollbackTran();
-                            return new Result() { Code = -1, Msg = "翻译人员资料添加失败!", Data = new { Id = dto.Id } };
-                        }
-                        var odltStatus = await _sqlSugar.Insertable(new Grp_OfficialDutyLinkTranslator()
-                        {
-                            TranslatorId = translatorInfo.Id,
-                            OfficialDutyId = dto.Id,
-                            CreateUserId = dto.CreateUserId,
-                            Remark = $"公务出访客户资料-->添加"
-                        }).ExecuteCommandAsync();
-                        if (odltStatus < 1)
-                        {
-                            _sqlSugar.RollbackTran();
-                            result = new Result() { Code = -1, Msg = "公务出访关联翻译人员资料添加失败!" };
-                        }
-                    }
-                    #endregion
+
 
                     _sqlSugar.CommitTran();
                     result = new Result() { Code = 0, Msg = "修改成功!", Data = new { Id = dto.Id } };

+ 15 - 0
OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

@@ -131,6 +131,21 @@ public static class CommonFun
         if (!Directory.Exists(dir))
             Directory.CreateDirectory(dir);
     }
+
+    /// <summary>
+    /// 验证文件名称
+    /// </summary>
+    /// <param name="fileName"></param>
+    /// <returns></returns>
+    public static string ValidFileName(string fileName)
+    {
+        if (string.IsNullOrEmpty(fileName)) return Guid.NewGuid().ToString();
+
+        // 获取非法文件名字符
+        char[] invalidChars = Path.GetInvalidFileNameChars();
+
+        return new string(fileName.Where(c => !invalidChars.Contains(c)).ToArray());
+    }
     #endregion
 
     #region IP