|
@@ -1,6 +1,8 @@
|
|
|
using Hotline.Application.ExportWord;
|
|
|
+using Hotline.Caching.Interfaces;
|
|
|
using Hotline.Configurations;
|
|
|
using Hotline.Orders;
|
|
|
+using Hotline.Settings;
|
|
|
using Hotline.Share.Dtos.OrderExportWord;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using MapsterMapper;
|
|
@@ -19,6 +21,7 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
|
|
|
private readonly ILogger<ExportWordController> _logger;
|
|
|
private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
+ private readonly ISystemSettingCacheManager _systemSettingCacheManager;
|
|
|
|
|
|
public ExportWordController(IOrderRepository orderRepository,
|
|
|
IWordHelperService wordHelperService,
|
|
@@ -26,7 +29,8 @@ namespace Hotline.Api.Controllers
|
|
|
IRepository<OrderVisit> orderVisitRepository,
|
|
|
IRepository<OrderVisitDetail> orderVisitedDetailRepository,
|
|
|
ILogger<ExportWordController> logger,
|
|
|
- IOptionsSnapshot<AppConfiguration> appOptions)
|
|
|
+ IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
+ ISystemSettingCacheManager systemSettingCacheManager)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_wordHelperService = wordHelperService;
|
|
@@ -35,6 +39,7 @@ namespace Hotline.Api.Controllers
|
|
|
_orderVisitedDetailRepository = orderVisitedDetailRepository;
|
|
|
_logger = logger;
|
|
|
_appOptions = appOptions;
|
|
|
+ _systemSettingCacheManager = systemSettingCacheManager;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -47,6 +52,7 @@ namespace Hotline.Api.Controllers
|
|
|
var streams = new Dictionary<string, Stream>();
|
|
|
var path = $"{Directory.GetCurrentDirectory()}/Template/AssignmentForm.doc";
|
|
|
int num = 1;
|
|
|
+ var isTheAssignmentFormConfidential = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsTheAssignmentFormConfidential).SettingValue[0]);
|
|
|
foreach (var item in Ids)
|
|
|
{
|
|
|
var order = await _orderRepository.GetAsync(item, HttpContext.RequestAborted);
|
|
@@ -54,7 +60,7 @@ namespace Hotline.Api.Controllers
|
|
|
continue;
|
|
|
|
|
|
//处理保密数据
|
|
|
- if (_appOptions.Value.IsZiGong && order.IsSecret)
|
|
|
+ if (isTheAssignmentFormConfidential && order.IsSecret)
|
|
|
{
|
|
|
var maskString = "***";
|
|
|
order.Contact = maskString;
|