Ver código fonte

更新文件引用和方法,优化代码逻辑

在 `GroupsController.cs` 中添加了 `FeeAuditOtherFileDownlaod` 方法以支持文件下载,并引入了 `System.ComponentModel.DataAnnotations`。
在 `SystemController.cs` 中修正了 `VisaAddress` 的赋值逻辑。
在 `Grp_CreditCardPaymentView.cs` 中添加了文件地址的注释。
在 `DelegationInfoRepository.cs` 中移除多余引用,优化构造函数并修正多个方法的格式和逻辑。
在 `EnterExitCostRepository.cs` 中将 `provinceId` 的默认值修改为 122,并添加了相关注释。
Lyyyi 1 semana atrás
pai
commit
2d6e98195b

+ 28 - 2
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -35,6 +35,7 @@ using OASystem.Infrastructure.Repositories.Groups;
 using Quartz.Util;
 using SqlSugar.Extensions;
 using System.Collections;
+using System.ComponentModel.DataAnnotations;
 using System.Data;
 using System.Diagnostics;
 using System.Globalization;
@@ -3527,7 +3528,6 @@ FROM
                         _detail.CurrPay = $"{OriginalCurrPay:#0.00} {hotelCurrncyCode}({CurrPayStr:#0.00} CNY)";
                     }
 
-
                     /*
                      * 剩余尾款
                      */
@@ -3978,6 +3978,12 @@ FROM
                             Grp_DecreasePayments gdpRes = _DecreasePayments.Where(s => s.Id == entity.CId).FirstOrDefault();
                             if (gdpRes != null)
                             {
+                                //var urlBase = $"http://132.232.92.186:24/Office/GrpFile/http://132.232.92.186:24/Office/GrpFile/%E5%9B%A2%E7%BB%84%E5%A2%9E%E5%87%8F%E6%AC%BE%E9%A1%B9%E7%9B%B8%E5%85%B3%E6%96%87%E4%BB%B6/";
+                                //if (!string.IsNullOrEmpty(gdpRes.FilePath))
+                                //{
+                                //    _detail.FileUrl = $"{urlBase}{gdpRes.FilePath}";
+                                //}
+
                                 _detail.PriceMsgContent = "备注:" + gdpRes.Remark;
                                 _detail.PriceNameContent = gdpRes.PriceName;
                             }
@@ -4059,7 +4065,6 @@ FROM
 
                     _detail.OverBudget = overBudgetStr;
 
-
                     decimal auditFee = 0.00M; //已审核金额 人名币
                     decimal auditedFeeOriginal = 0.00M; ////已审核金额 原始
                     decimal unAuditFeeCNY = 0.00M; //未审核款项 原始
@@ -4322,6 +4327,27 @@ FROM
             return Ok(JsonView(false, "操作失败!"));
         }
 
+        /// <summary>
+        /// 费用审核 
+        /// 其他款项 文件下载
+        /// </summary>
+        /// <param name="id">其他款项 主键编号</param>
+        /// <returns></returns>
+        [HttpGet("{id}")]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> FeeAuditOtherFileDownlaod([Range(1,int.MaxValue,ErrorMessage ="")]int id)
+        {
+            var otherInfo = await _decreasePaymentsRep.Query(x => x.Id == id && x.IsDel == 0).FirstAsync();
+            string url = "暂无附件!";
+            if (otherInfo != null)
+            {
+                url = $"http://132.232.92.186:24/Office/GrpFile/%E5%9B%A2%E7%BB%84%E5%A2%9E%E5%87%8F%E6%AC%BE%E9%A1%B9%E7%9B%B8%E5%85%B3%E6%96%87%E4%BB%B6/{otherInfo.FilePath}";
+                return Ok(JsonView(true,  "操作成功!", url));
+            }
+
+            return Ok(JsonView(true, url));
+        }
+
         #endregion
 
         #region 机票费用录入

+ 1 - 1
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -3855,7 +3855,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                     new(){
                         ProvinceId = 122,
                         ProvinceName = "四川",
-                        VisaAddress = cellVal1?.ToString() ?? "",
+                        VisaAddress = cellVal3?.ToString() ?? "",
                         VisaTime = cellVal4?.ToString() ?? "0",
                         IsVisaExemptionSmall = isVisaExemptionSmallVal,
                         SmallVisaPrice = smallVisaPrice,

+ 6 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_CreditCardPaymentView.cs

@@ -157,6 +157,12 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public string CardType { get; set; }
 
+        ///// <summary>
+        ///// 文件地址 
+        ///// 暂时用于“其他款项”存储图片等文件的URL
+        ///// </summary>
+        //public string FileUrl { get; set; }
+
         /// <summary>
         /// 申请人
         /// </summary>

+ 31 - 46
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -1,30 +1,12 @@
 using AutoMapper;
-using Newtonsoft.Json;
-using NPOI.OpenXmlFormats.Wordprocessing;
-using NPOI.POIFS.Properties;
-using NPOI.SS.Formula.Functions;
 using OASystem.Domain;
 using OASystem.Domain.AesEncryption;
-using OASystem.Domain.Dtos;
 using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
-using OASystem.Domain.Dtos.UserDto;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.ViewModels.CRM;
-using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.System;
-using Org.BouncyCastle.Asn1.Cms;
-using Org.BouncyCastle.Utilities.Collections;
-using Serilog;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
 
 namespace OASystem.Infrastructure.Repositories.Groups
 {
@@ -40,7 +22,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         //private readonly TeamRateRepository _teamRateRep;
         //public readonly Logs _logs;
 
-        public DelegationInfoRepository(SqlSugarClient sqlSugar, SetDataRepository setDataRepository, UsersRepository usersRepository, 
+        public DelegationInfoRepository(SqlSugarClient sqlSugar, SetDataRepository setDataRepository, UsersRepository usersRepository,
             TaskAssignmentRepository taskAssignmentRep, IMapper mapper)
             : base(sqlSugar)
         {
@@ -61,7 +43,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <returns></returns>
         public async Task<JsonView> ListByCTableAndUserId(GroupListByCTableAndUserIdDto dto)
         {
-            var view = new JsonView() { Code = StatusCodes.Status400BadRequest,Msg="操作失败!" };
+            var view = new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "操作失败!" };
 
             if (dto.CTable < 1)
             {
@@ -254,7 +236,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="teamName"></param>
         /// <returns></returns>
-        public string FormartTeamName(string? teamName) 
+        public string FormartTeamName(string? teamName)
         {
             string str = "";
             if (!string.IsNullOrEmpty(teamName))
@@ -279,7 +261,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="teamName"></param>
         /// <returns></returns>
-        public List<string> GroupSplitCountry (string visitCountry)
+        public List<string> GroupSplitCountry(string visitCountry)
         {
             List<string> countrys = new List<string>();
 
@@ -372,7 +354,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
 
-            if (dto.PortType == 1) {
+            if (dto.PortType == 1)
+            {
                 string sql = string.Format(@"Select gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure
                   ,gs.Id as GrpScheduleId
 				  From  Grp_DelegationInfo gdi
@@ -460,12 +443,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         _DelegationInfo.CityName = "四川-成都";
                     }
 
-                        //if (_DelegationInfo.TontractTime)
-                        //{
+                    //if (_DelegationInfo.TontractTime)
+                    //{
 
-                        //}
+                    //}
 
-                      result.Code = 0;
+                    result.Code = 0;
                     result.Msg = "成功!";
                     result.Data = _DelegationInfo;
 
@@ -483,15 +466,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         {
                             var param = new TourClientListProcessInfo();
                             var clientInfo = DeleClientArr.FirstOrDefault(x => x.Id == item.ClientId);
-                            if (clientInfo == null) clientInfo = new Crm_DeleClient(); 
-                            var clientIDInfo = _CustomerCerts.FirstOrDefault(x=>x.DcId == item.ClientId); //身份证信息
+                            if (clientInfo == null) clientInfo = new Crm_DeleClient();
+                            var clientIDInfo = _CustomerCerts.FirstOrDefault(x => x.DcId == item.ClientId); //身份证信息
                             if (clientIDInfo == null) clientIDInfo = new Crm_CustomerCert();
                             var Company = CompanyArr.FirstOrDefault(x => x.Id == clientInfo.CrmCompanyId);
-                            if(Company == null) Company = new Crm_CustomerCompany();
+                            if (Company == null) Company = new Crm_CustomerCompany();
 
                             param.IDCardNo = clientIDInfo.CertNo;
                             param.Remark = item.Remark;
-                            param.BirthDay = clientInfo.BirthDay == null ? "" : DateTime.TryParse(Convert.ToDateTime( clientInfo.BirthDay).ToString("yyyy-MM-dd"), out timeParam) ? timeParam.ToString("yyyy-MM-dd") : "";
+                            param.BirthDay = clientInfo.BirthDay == null ? "" : DateTime.TryParse(Convert.ToDateTime(clientInfo.BirthDay).ToString("yyyy-MM-dd"), out timeParam) ? timeParam.ToString("yyyy-MM-dd") : "";
                             param.FirstName = clientInfo.FirstName;
                             param.LastName = clientInfo.LastName;
                             param.CompanyFullName = Company.CompanyFullName;
@@ -643,7 +626,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 {
                     foreach (var city in province.Child)
                     {
-                        list.Add(new GroupCityBasicSourceView() { 
+                        list.Add(new GroupCityBasicSourceView()
+                        {
                             Id = city.Id,
                             Name = $"{province.Name_CN}-{city.Name_CN}"
                         });
@@ -778,7 +762,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<Result>GroupOperation(GroupOperationDto dto)
+        public async Task<Result> GroupOperation(GroupOperationDto dto)
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
 
@@ -800,8 +784,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                                        And TeamName = '{0}'
                                                        And ClientName = '{1}'
                                                        And ClientUnit ='{2}'
-                                                       And VisitDate ='{3}'",dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
-                    var selectGroupInfo =  _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).First();
+                                                       And VisitDate ='{3}'", dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
+                    var selectGroupInfo = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).First();
                     if (selectGroupInfo != null)
                     {
                         result.Msg = "数据已存在,请勿重复添加!";
@@ -822,9 +806,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     string countrys = string.Empty;
                     string countryReq = dto.VisitCountry;
-                    if (!string.IsNullOrEmpty(countryReq)) 
+                    if (!string.IsNullOrEmpty(countryReq))
                     {
-                        if (countryReq.Contains(",")) countrys = countryReq.Replace(',','|');
+                        if (countryReq.Contains(",")) countrys = countryReq.Replace(',', '|');
                         else if (countryReq.Contains(",")) countrys = countryReq.Replace(',', '|');
                         else if (countryReq.Contains(" ")) countrys = countryReq.Replace(' ', '|');
                         else if (countryReq.Contains("、")) countrys = countryReq.Replace('、', '|');
@@ -833,7 +817,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
 
                     //建团时 默认出团 设置 团组code
-                    string teamCode="";
+                    string teamCode = "";
                     string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
                     var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
 
@@ -893,9 +877,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         DeleteUserId = null,
                         DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss"),
                         OpRoyaltyLv = dto.OpRoyaltyLv,
-                        OpRoyaltyRemark=dto.opRoyaltyRemark,
+                        OpRoyaltyRemark = dto.opRoyaltyRemark,
                         Officialneeds = dto.Officialneeds,
-                        VisitStartDate = startTime, 
+                        VisitStartDate = startTime,
                         VisitEndDate = endTime,
                     };
 
@@ -912,7 +896,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
 
 
-                }  
+                }
                 else if (dto.Status == 2)     //修改
                 {
                     var updateStatus = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_DelegationInfo
@@ -1170,9 +1154,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<JsonView> GetGroupNameList(int portType,int pageIndex,int pageSize, string groupName,int userId)
+        public async Task<JsonView> GetGroupNameList(int portType, int pageIndex, int pageSize, string groupName, int userId)
         {
-            var _res = new JsonView() {  Code = 400 ,  Msg = MsgTips.Fail };
+            var _res = new JsonView() { Code = 400, Msg = MsgTips.Fail };
             string sql = "";
             string sqlWhere = "";
             string mobileSqlWhere = "";
@@ -1253,11 +1237,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                              Where TeamName != '' And IsDel = 0
                                              Order By Id Desc");
                 var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
-                
+
                 string visaSql = string.Format(@"Select Id,Name From Sys_SetData Where STid = 41 And IsDel = 0");
                 var _setDataList = await _sqlSugar.SqlQueryable<SetDataInfoView>(visaSql).ToListAsync();
 
-                var data = new {
+                var data = new
+                {
                     groupNameData = _groupNameList,
                     visaNationalityData = _setDataList
                 };
@@ -1366,7 +1351,7 @@ ORDER BY
                     }
                 }
             }
-            
+
             return groupDatas;
         }
 

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

@@ -327,14 +327,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             .ToArrayAsync();
                     }
 
-                    int provinceId = 0;
+                    int provinceId = 122;
                     var groupNames = await _groupRep.EnterExitCostGroupNameInfoAsync(dto.DiId);
                     if (groupNames!=null)
                     {
                         provinceId = groupNames.ProvinceId;
                     }
+
+                    //云南暂无三公费用标准 暂时先用四川的
+                    if (provinceId == 132) provinceId = 122; 
+
                     enterExitCostInfoView.ProvinceId = provinceId;
 
+                    //if (dto.DiId == 2775) enterExitCostInfoView.ProvinceId = 122;
+
 
                     //enterExitCostInfoView.FirstItemRemark = enterExitCostData.Remark;
                     var dayAndCostSql = string.Format(@"Select ntf.Country,ntf.City,ssd.Name CurremcyCode,ssd.Remark CurrencyName,gdac.* From Grp_DayAndCost gdac