|
@@ -1,18 +1,96 @@
|
|
|
-using Hotline.Orders;
|
|
|
+using Hotline.Application.Snapshot;
|
|
|
+using Hotline.Orders;
|
|
|
+using Hotline.Settings;
|
|
|
+using Hotline.Share.Dtos;
|
|
|
+using Hotline.Share.Dtos.Article;
|
|
|
+using Hotline.Share.Dtos.Snapshot;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
|
+/// <summary>
|
|
|
+/// 随手拍接口
|
|
|
+/// </summary>
|
|
|
public class SnapshotController : BaseController
|
|
|
{
|
|
|
private readonly IRepository<Order> _orderRepository;
|
|
|
+ private readonly ISnapshotApplication _snapshotApplication;
|
|
|
+ private readonly ISystemAreaDomainService _systemAreaDomainService;
|
|
|
|
|
|
- public SnapshotController(IRepository<Order> orderRepository)
|
|
|
+ public SnapshotController(IRepository<Order> orderRepository, ISnapshotApplication snapshotApplication, ISystemAreaDomainService systemAreaDomainService)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
+ _snapshotApplication = snapshotApplication;
|
|
|
+ _systemAreaDomainService = systemAreaDomainService;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取小程序公告列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("bulletions")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public virtual async Task<IReadOnlyList<BulletinOutDto>> QueryBulletinsAsync([FromQuery] BulletinInDto dto)
|
|
|
+ => await _snapshotApplication.GetBulletinsAsync(dto);
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 公告详情
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("bulletions/{id}")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public virtual async Task<BulletinOutDto> QueryBulletionsDetailAsync(string id)
|
|
|
+ => await _snapshotApplication.GetBulletinsDetailAsync(id);
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取用户页面数据
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [AllowAnonymous]
|
|
|
+ [HttpGet("user")]
|
|
|
+ public virtual async Task<SnapshotUserInfoOutDto> GetUserInfo()
|
|
|
+ => await _snapshotApplication.GetSnapshotUserInfoAsync();
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取我提交的线索列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("order")]
|
|
|
+ public virtual async Task<PagedDto<OrderOutDto>> QueryOrderListAsync([FromQuery] OrderInDto dto)
|
|
|
+ => await _snapshotApplication.GetSnapshotOrdersAsync(dto);
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取我提交的线索详情
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("order/{id}")]
|
|
|
+ public virtual async Task<OrderDetailOutDto> QueryOrderListAsync([FromQuery] string id)
|
|
|
+ => await _snapshotApplication.GetSnapshotOrderDetailAsync(id);
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 统计红包金额, 每月的总金额
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("redpack")]
|
|
|
+ public virtual async Task<IReadOnlyList<RedPackDateOutDto>> QueryRedPackDateAsync([FromQuery] RedPackDateInDto dto)
|
|
|
+ => await _snapshotApplication.GetRedPackDateAsync(dto);
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取当月详细红包列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("redpack/month")]
|
|
|
+ public virtual async Task<PagedDto<RedPackOutDto>> QueryRedPackDateAsync([FromQuery] RedPacksInDto dto)
|
|
|
+ => await _snapshotApplication.GetRedPacksAsync(dto);
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 获取随手拍电气焊动火作业待处理工单数量
|
|
|
/// TODO 条件 电气焊作业申报
|
|
@@ -23,4 +101,11 @@ public class SnapshotController : BaseController
|
|
|
=> await _orderRepository
|
|
|
.CountAsync(m => m.SourceChannelCode == "ZGSSP" && m.Status == Share.Enums.Order.EOrderStatus.WaitForAccept);
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取区域
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("area/tree")]
|
|
|
+ public async Task<List<SystemArea>> GetAreaTreeAsync()
|
|
|
+ => await _systemAreaDomainService.GetAreaTree(0);
|
|
|
}
|