Browse Source

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

yuanrf 7 months ago
parent
commit
476c2b02a2

+ 10 - 1
OASystem/OASystem.Domain/ViewModels/Resource/OfficialActivitiesView.cs

@@ -13,7 +13,16 @@ namespace OASystem.Domain.ViewModels.Resource
 
         public List<string> ScreenshotOfMailUrls { get {
 
-                return !string.IsNullOrEmpty(ScreenshotOfMailUrl) ? JsonConvert.DeserializeObject<List<string>>(ScreenshotOfMailUrl):new List<string>();
+                List<string> urls = new List<string>();
+                urls = !string.IsNullOrEmpty(ScreenshotOfMailUrl)
+                    ? JsonConvert.DeserializeObject<List<string>>(ScreenshotOfMailUrl)
+                    : new List<string>();
+
+                List<string> urls1 = new List<string>();
+                urls.ForEach(x => {
+                    urls1.Add("http://132.232.92.186:24/" + x);
+                });
+                return urls1;
             } }
 
         public string CreateUserName { get; set; }

+ 9 - 39
OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs

@@ -7,6 +7,7 @@ using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Resource;
+using OASystem.Infrastructure.Tools;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -59,20 +60,19 @@ ORDER BY
             {
                 if (dto.PageSize == 0 && dto.PageIndex == 0)
                 {
-                    foreach (var temp in OfficialActivities)
+
+                    OfficialActivities.ForEach(x =>
                     {
                         //2024年4月1日 11:55:44  -蒋金辰 -日期处理
-
                         DateTime dt;
-                        bool b_dt = DateTime.TryParse(temp.Date, out dt);
+                        bool b_dt = DateTime.TryParse(x.Date, out dt);
                         if (b_dt)
                         {
-                            if (!string.IsNullOrEmpty(temp.Time)) temp.Date = dt.ToString("yyyy-MM-dd") + " " + temp.Time;
-                            else temp.Date = dt.ToString("yyyy-MM-dd HH:mm:ss");
-
+                            if (!string.IsNullOrEmpty(x.Time)) x.Date = dt.ToString("yyyy-MM-dd") + " " + x.Time;
+                            else x.Date = dt.ToString("yyyy-MM-dd HH:mm:ss");
                         }
 
-                    }
+                    });
 
                     result = new JsonView() { Code = 200, Msg = "查询成功!", Data = OfficialActivities };
                 }
@@ -96,7 +96,6 @@ ORDER BY
                             {
                                 OfficialActivities[RowIndex].Date = dt.ToString("yyyy-MM-dd HH:mm");
                             }
-
                             _OfficialActivities.Add(OfficialActivities[RowIndex]);
                         }
                         else
@@ -105,7 +104,6 @@ ORDER BY
                         }
                     }
 
-
                     ListViewBase<OfficialActivitiesView> rst = new ListViewBase<OfficialActivitiesView>();
                     rst.DataList = _OfficialActivities;
                     rst.DataCount = count;
@@ -152,36 +150,8 @@ FROM
   LEFT JOIN Sys_SetData sd ON oa.OfficialForm = sd.Id
 {0}", sqlWhere);
                 var OfficialActivities = await _sqlSugar.SqlQueryable<OfficialActivitiesView>(sql)
-                    //.Select(x => new
-                    //{
-                    //    x.Id,
-                    //    x.Country,
-                    //    x.Area,
-                    //    x.Client,
-                    //    x.Date,
-                    //    x.Time,
-                    //    x.Address,
-                    //    x.Contact,
-                    //    x.Job,
-                    //    x.Tel,
-                    //    x.OfficialFormName,
-                    //    x.Field,
-                    //    x.ReqSample,
-                    //    x.Setting,
-                    //    x.Dresscode,
-                    //    x.Attendees,
-                    //    x.IsNeedTrans,
-                    //    x.Translators,
-                    //    x.Language,
-                    //    x.Trip,
-                    //    x.IsSubmitApproval,
-                    //    x.IsPay,
-                    //    x.ConfirmTheInvitation,
-                    //    x.ScreenshotOfMailUrl,
-                    //    x.ScreenshotOfMailUrls,
-                    //    x.CreateUserName
-                    //})
                     .FirstAsync();
+                OfficialActivities.ScreenshotOfMailUrls.ForEach(url => { url = AppSettingsHelper.Get("GrpFileBaseUrl") + url; });
                 result = new Result() { Code = 0, Msg = "查询成功!", Data = OfficialActivities };
 
             }
@@ -326,7 +296,7 @@ FROM
                                           Where oa.IsDel = 0 And oa.Country='{country}' {sqlWhere}");
 
             //ReqReqSampleTipsView
-            var _views = await _sqlSugar.SqlQueryable< ReqReqSampleTipsView >(sql).ToListAsync();
+            var _views = await _sqlSugar.SqlQueryable<ReqReqSampleTipsView>(sql).ToListAsync();
             if (_views.Count > 0 )
             {
                 return new Result() { Code = 0, Msg = "操作成功!", Data = _views };