|
@@ -4,6 +4,7 @@ using Hotline.Application.Orders;
|
|
|
using Hotline.Application.Snapshot;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.Caching.Services;
|
|
|
+using Hotline.Configurations;
|
|
|
using Hotline.FlowEngine.Definitions;
|
|
|
using Hotline.FlowEngine.Workflows;
|
|
|
using Hotline.Orders;
|
|
@@ -20,6 +21,7 @@ using Hotline.Snapshot;
|
|
|
using Hotline.Snapshot.Interfaces;
|
|
|
using Mapster;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
+using Microsoft.Extensions.Options;
|
|
|
using System.ComponentModel;
|
|
|
using System.Text;
|
|
|
using XF.Domain.Authentications;
|
|
@@ -46,8 +48,9 @@ public class SnapshotOrderController : BaseController
|
|
|
private readonly IWorkflowApplication _workflowApplication;
|
|
|
private readonly IRepository<WorkflowDefinition> _workflowDefinitionRepository;
|
|
|
private readonly IOrderApplication _orderApplication;
|
|
|
+ private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
|
|
|
- public SnapshotOrderController(IOrderSnapshotRepository orderSnapshotRepository, IOrderSnapshotApplication orderSnapshotApplication, ISystemAreaDomainService systemAreaDomainService, ISystemDicDataCacheManager systemDicDataCacheManager, IIndustryRepository industryRepository, ISessionContext sessionContext, IWorkflowDomainService workflowDomainService, IOrderRepository orderRepository, IWorkflowApplication workflowApplication, IRepository<WorkflowDefinition> workflowDefinitionRepository, IOrderApplication orderApplication)
|
|
|
+ public SnapshotOrderController(IOrderSnapshotRepository orderSnapshotRepository, IOrderSnapshotApplication orderSnapshotApplication, ISystemAreaDomainService systemAreaDomainService, ISystemDicDataCacheManager systemDicDataCacheManager, IIndustryRepository industryRepository, ISessionContext sessionContext, IWorkflowDomainService workflowDomainService, IOrderRepository orderRepository, IWorkflowApplication workflowApplication, IRepository<WorkflowDefinition> workflowDefinitionRepository, IOrderApplication orderApplication, IOptionsSnapshot<AppConfiguration> appOptions)
|
|
|
{
|
|
|
_orderSnapshotRepository = orderSnapshotRepository;
|
|
|
_orderSnapshotApplication = orderSnapshotApplication;
|
|
@@ -60,6 +63,7 @@ public class SnapshotOrderController : BaseController
|
|
|
_workflowApplication = workflowApplication;
|
|
|
_workflowDefinitionRepository = workflowDefinitionRepository;
|
|
|
_orderApplication = orderApplication;
|
|
|
+ _appOptions = appOptions;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -90,11 +94,11 @@ public class SnapshotOrderController : BaseController
|
|
|
await _workflowDefinitionRepository.Queryable()
|
|
|
.Where(m => m.Status == EDefinitionStatus.Enable && m.Code == "gdbl")
|
|
|
.OrderByDescending(m => m.Version)
|
|
|
- .Select(m => new { m.Id, m.Steps})
|
|
|
+ .Select(m => new { m.Id, m.Steps })
|
|
|
.FirstAsync().Then(async workflowSteps =>
|
|
|
{
|
|
|
steps = workflowSteps.Steps.Adapt<IList<NameCodeDto>>()
|
|
|
- .ToList().Select(m => new Kv
|
|
|
+ .ToList().Select(m => new Kv
|
|
|
{
|
|
|
Key = m.Code,
|
|
|
Value = m.Name,
|
|
@@ -103,7 +107,7 @@ public class SnapshotOrderController : BaseController
|
|
|
return new Dictionary<string, object>
|
|
|
{
|
|
|
{ "orderStatus", EnumExts.GetDescriptions<EOrderStatus>()},
|
|
|
- { "area", await _systemAreaDomainService.GetAreaKeyValue(parentId: "510300")},
|
|
|
+ { "area", await _systemAreaDomainService.GetAreaKeyValue(parentId: _appOptions.Value.AreaCode)},
|
|
|
{ "steps", steps},
|
|
|
{ "orderTags", _systemDicDataCacheManager.OrderTag},
|
|
|
{ "industry", await _industryRepository.Queryable().Select(d => new { d.Id, d.Name, }).ToListAsync()},
|
|
@@ -145,11 +149,11 @@ public class SnapshotOrderController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("label/{id}")]
|
|
|
public async Task<LabelOrderSnapshotDetailOutDto> GetLabelOrderSnapshotDetailAsync(string id)
|
|
|
- {
|
|
|
+ {
|
|
|
var order = await _orderRepository.Queryable()
|
|
|
.LeftJoin<OrderSnapshot>((order, snapshot) => order.Id == snapshot.Id)
|
|
|
.Where((order, snapshot) => order.Id == id)
|
|
|
- .Select((order, snapshot) => new LabelOrderSnapshotDetailOutDto { Id = order.Id, Title = order.Title, Lables =snapshot.Labels })
|
|
|
+ .Select((order, snapshot) => new LabelOrderSnapshotDetailOutDto { Id = order.Id, Title = order.Title, Lables = snapshot.Labels })
|
|
|
.FirstAsync();
|
|
|
var snapshot = await _orderSnapshotRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
order.Lables = snapshot.Labels;
|
|
@@ -250,7 +254,7 @@ public class SnapshotOrderController : BaseController
|
|
|
{ "publishStatus", EnumExts.GetDescriptions<EOrderSnapshotPublishStatus>()},
|
|
|
{ "acceptCode", _systemDicDataCacheManager.AcceptType.Adapt<List<Kv>>() },
|
|
|
{ "orderStatus", EnumExts.GetDescriptions<EOrderStatus>()},
|
|
|
- { "area", await _systemAreaDomainService.GetAreaKeyValue(parentId: "510300")},
|
|
|
+ { "area", await _systemAreaDomainService.GetAreaKeyValue(parentId: _appOptions.Value.AreaCode)},
|
|
|
{ "industry", industry}
|
|
|
};
|
|
|
}
|
|
@@ -265,4 +269,13 @@ public class SnapshotOrderController : BaseController
|
|
|
{
|
|
|
await _orderApplication.HandleFromWanggeyuanToMaskAsync(id, HttpContext.RequestAborted);
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 市民追加奖励集合
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("citizen/reward")]
|
|
|
+ public async Task<PagedDto<CitizenRewardOutDto>> GetCitizenRewardItemsAsync([FromQuery] CitizenRewardInDto dto)
|
|
|
+ => (await _orderSnapshotApplication.GetCitizenRewardItems(dto).ToPagedListAsync(dto)).ToPaged();
|
|
|
}
|