|
@@ -1,6 +1,7 @@
|
|
|
using Aspose.Cells;
|
|
|
using Aspose.Words;
|
|
|
using EyeSoft.Extensions;
|
|
|
+using Microsoft.IdentityModel.Tokens;
|
|
|
using OASystem.API.OAMethodLib;
|
|
|
using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
|
|
|
using OASystem.Domain.AesEncryption;
|
|
@@ -254,7 +255,7 @@ namespace OASystem.API.Controllers
|
|
|
var infos = await _sqlSugar.Queryable<Res_LocalGuideData>().ToListAsync();
|
|
|
foreach (var item in infos) EncryptionProcessor.EncryptProperties(item);
|
|
|
|
|
|
- var updTotal = await _sqlSugar.Updateable(infos).ExecuteCommandAsync();
|
|
|
+ await _sqlSugar.Updateable(infos).ExecuteCommandAsync();
|
|
|
|
|
|
return Ok(JsonView(true));
|
|
|
}
|
|
@@ -2305,6 +2306,167 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 公务 团组名称 Page List
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> OfficialActivitiesGroupNameList(OfficialActivitiesGroupNameListDto dto)
|
|
|
+ {
|
|
|
+ var sw = Stopwatch.StartNew();
|
|
|
+ if (!SharingStaticData.PortTypes.Contains(dto.PortType))
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.PageIndex = dto.PageIndex == 0 ? 1 : dto.PageIndex;
|
|
|
+ dto.PageSize = dto.PageSize == 0 ? 10 : dto.PageSize;
|
|
|
+
|
|
|
+ RefAsync<int> total = 0;
|
|
|
+ // 只查询需要的字段,避免Select后再赋值,减少内存占用
|
|
|
+ var groupInfos = await _officialActivitiesRep._sqlSugar
|
|
|
+ .Queryable<Grp_DelegationInfo>()
|
|
|
+ .Where(x => x.IsDel == 0)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.GroupName), x => x.TeamName.Contains(dto.GroupName))
|
|
|
+ .OrderByDescending(x => x.VisitDate)
|
|
|
+ .Select(x => new Web_ShareGroupInfoView()
|
|
|
+ {
|
|
|
+ Id = x.Id,
|
|
|
+ TeamName = x.TeamName,
|
|
|
+ TourCode = x.TourCode,
|
|
|
+ ClientName = x.ClientName,
|
|
|
+ VisitCountry = x.VisitCountry,
|
|
|
+ VisitStartDate = x.VisitStartDate,
|
|
|
+ VisitEndDate = x.VisitEndDate,
|
|
|
+ VisitDays = x.VisitDays,
|
|
|
+ VisitPNumber = x.VisitPNumber
|
|
|
+ })
|
|
|
+ .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
+
|
|
|
+ if (groupInfos.Count > 0)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < groupInfos.Count; i++)
|
|
|
+ {
|
|
|
+ var visitCountry = groupInfos[i].VisitCountry;
|
|
|
+ groupInfos[i].VisitCountry = !string.IsNullOrEmpty(visitCountry)
|
|
|
+ ? _delegationInfoRep.FormartTeamName(visitCountry)
|
|
|
+ : string.Empty;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sw.Stop();
|
|
|
+ return Ok(JsonView(true, $"操作成功!耗时:{sw.ElapsedMilliseconds}ms", groupInfos, total));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 公务 翻译人员 Page List
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> OfficialActivitiesTranslatorList(OfficialActivitiesTranslatorListDto dto)
|
|
|
+ {
|
|
|
+ var sw = Stopwatch.StartNew();
|
|
|
+ if (!SharingStaticData.PortTypes.Contains(dto.PortType))
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.PageIndex = dto.PageIndex == 0 ? 1 : dto.PageIndex;
|
|
|
+ dto.PageSize = dto.PageSize == 0 ? 10 : dto.PageSize;
|
|
|
+
|
|
|
+ var translatorIds = new List<int>();
|
|
|
+ if (!string.IsNullOrEmpty(dto.TranslatorName))
|
|
|
+ {
|
|
|
+ var translators = await _sqlSugar.Queryable<Res_TranslatorLibrary>()
|
|
|
+ .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.Name))
|
|
|
+ .Select(x => new { x.Id,x.Name })
|
|
|
+ .ToListAsync();
|
|
|
+ if (translators.Any())
|
|
|
+ {
|
|
|
+ foreach (var item in translators)
|
|
|
+ {
|
|
|
+ var decryptedName = AesEncryptionHelper.Decrypt(item.Name);
|
|
|
+ if (!string.IsNullOrEmpty(decryptedName) && decryptedName.Contains(dto.TranslatorName))
|
|
|
+ {
|
|
|
+ translatorIds.Add(item.Id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ RefAsync<int> total = 0;
|
|
|
+
|
|
|
+ var translatorInfos = await _officialActivitiesRep._sqlSugar
|
|
|
+ .Queryable<Res_TranslatorLibrary>()
|
|
|
+ .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.Name))
|
|
|
+ .WhereIF(translatorIds != null && translatorIds.Count > 0, x => translatorIds.Contains(x.Id))
|
|
|
+ .OrderByDescending(x => x.CreateTime)
|
|
|
+ .Select(x => new TranslatorView()
|
|
|
+ {
|
|
|
+ Id = x.Id,
|
|
|
+ Area = x.Area,
|
|
|
+ Name = x.Name,
|
|
|
+ Sex = x.Sex,
|
|
|
+ Tel = x.Tel,
|
|
|
+ Email = x.Email,
|
|
|
+ WechatNo = x.WechatNo,
|
|
|
+ OtherSocialAccounts = x.OtherSocialAccounts,
|
|
|
+ Language = x.Language,
|
|
|
+ Price = x.Price,
|
|
|
+ Currency = x.Currency,
|
|
|
+ })
|
|
|
+ .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
+
|
|
|
+
|
|
|
+ for (int i = 0; i < translatorInfos.Count; i++)
|
|
|
+ {
|
|
|
+ EncryptionProcessor.DecryptProperties(translatorInfos[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ sw.Stop();
|
|
|
+ string msg = translatorInfos.Count == 0 ? $"暂无翻译人员信息!耗时: {sw.ElapsedMilliseconds}ms" : $"操作成功!耗时: {sw.ElapsedMilliseconds}ms";
|
|
|
+ return Ok(JsonView(true, msg, translatorInfos, total));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 公务 绑定下拉框
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> OfficialActivitiesInitDatabase(OfficialActivitiesByDiIdDto dto)
|
|
|
+ {
|
|
|
+
|
|
|
+ var data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0).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();
|
|
|
+ //张总安排未参与对接
|
|
|
+ if (data2.Any(x => x.Name.Equals("张总安排未参与对接")))
|
|
|
+ {
|
|
|
+ var zhangZong = data2.FirstOrDefault(x => x.Name.Equals("张总安排未参与对接"));
|
|
|
+ if (zhangZong != null) data2.Remove(zhangZong);
|
|
|
+ data2.Insert(0, zhangZong);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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();
|
|
|
+
|
|
|
+ return Ok(JsonView(true,
|
|
|
+ "查询成功!",
|
|
|
+ new
|
|
|
+ {
|
|
|
+ SetData = data1,
|
|
|
+ DataSource = data2,
|
|
|
+ currencyData = data3,
|
|
|
+ DeleFile = _DeleFile
|
|
|
+ }));
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 公务List
|
|
|
/// </summary>
|