|
@@ -117,11 +117,14 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getarticlelist")]
|
|
|
public async Task<OpenResponse> GetArticleList([FromBody] QueryArticleListDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
RefAsync<int> total = 0;
|
|
|
var items = await _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
.Where(p => p.BulletinTypeId == dto.NoticeType)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
|
|
|
.OrderByDescending(p => p.CreationTime)
|
|
@@ -160,10 +163,13 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getarticlelistbynum")]
|
|
|
public async Task<OpenResponse> GetArticleListByNum([FromBody] ArticleIdByNumDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
var items = await _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
// .Where(p => p.BulletinTypeId == dto.BulletinTypeId)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.BulletinTypeId), p => p.BulletinTypeId == dto.BulletinTypeId)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.CheckChar), p => p.Content.Contains(dto.CheckChar))
|
|
@@ -269,10 +275,13 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getpreviousandnext")]
|
|
|
public async Task<OpenResponse> GetPreviousAndNext([FromBody] ArticlePreviousAndNextDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
var sugar = _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
;
|
|
|
if (dto.FullSearch == "1")//全文搜索
|
|
|
{
|
|
@@ -347,6 +356,9 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPost("getfulltextsearchlist")]
|
|
|
public async Task<OpenResponse> GetFullTextSearchList([FromBody] QueryArticleListDto dto)
|
|
|
{
|
|
|
+ if (string.IsNullOrEmpty(dto.PushRanges))
|
|
|
+ dto.PushRanges = "2";
|
|
|
+
|
|
|
if (string.IsNullOrEmpty(dto.Condition))
|
|
|
return OpenResponse.Ok(WebPortalDeResponse<FullTextSearchListDataDto>.Success(null));
|
|
|
|
|
@@ -354,7 +366,7 @@ namespace Hotline.Api.Controllers
|
|
|
var items = await _bulletinRepository.Queryable()
|
|
|
.Where(p => p.LoseEfficacyTime >= DateTime.Now)
|
|
|
.Where(p => p.IsArrive == true)
|
|
|
- .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
|
|
|
+ .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
|
|
|
.WhereIF(_appOptions.Value.IsYiBin, p => p.BulletinTypeId == "1" || p.BulletinTypeId == "5" || p.BulletinTypeId == "6" || p.BulletinTypeId == "7" || p.BulletinTypeId == "3" || p.BulletinTypeId == "4")
|
|
|
.WhereIF(_appOptions.Value.IsZiGong, p => p.BulletinTypeId == "5013" || p.BulletinTypeId == "5016" || p.BulletinTypeId == "5011" || p.BulletinTypeId == "5015" || p.BulletinTypeId == "5017")
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
|
|
@@ -491,6 +503,51 @@ namespace Hotline.Api.Controllers
|
|
|
}
|
|
|
return OpenResponse.Ok(WebPortalDeResponse<OrderListReturnDto>.Success(new OrderListReturnDto(), "成功"));
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 用户中心用户写信数据
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("getorderbyuserphonelist")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task<OpenResponse> GetOrderByUserPhoneList([FromBody] QueryOrderListByUserDto dto)
|
|
|
+ {
|
|
|
+ RefAsync<int> total = 0;
|
|
|
+ var items = await _webFlowAcceptRepository.Queryable()
|
|
|
+ .LeftJoin<Hotline.Orders.Order>((o, or) => o.OrderId == or.Id)
|
|
|
+ .Where(o => o.Mobile == dto.PhoneNum)
|
|
|
+ //重新构建数据
|
|
|
+ .Select((o, or) => new
|
|
|
+ {
|
|
|
+ FlowID = o.OrderId,
|
|
|
+ FlowCode = o.Code,
|
|
|
+ FlowPwd = o.Pwd,
|
|
|
+ FlowTitle = o.Title,
|
|
|
+ FlowFromName = or.SourceChannel,
|
|
|
+ FlowPurTypeName = o.PurTypeName,
|
|
|
+ ConTypeName = or.HotspotName,
|
|
|
+ FlowAddDate = o.CreationTime,
|
|
|
+ RSFlagName = or.Status < EOrderStatus.Filed ? "办理中" : "办理完成",
|
|
|
+ Mobile = o.Mobile
|
|
|
+ })
|
|
|
+ //将结果合并成一个表
|
|
|
+ .MergeTable()
|
|
|
+ .Where(p => p.Mobile == dto.PhoneNum)
|
|
|
+ .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
+
|
|
|
+ //计算总页数
|
|
|
+ int nPageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(total) / dto.PageSize));
|
|
|
+ OrderListReturnDto returnDto = new()
|
|
|
+ {
|
|
|
+ PageNum = dto.PageIndex,
|
|
|
+ PageCount = nPageCount,
|
|
|
+ Data = _mapper.Map<IReadOnlyList<OrderListDto>>(items)
|
|
|
+ };
|
|
|
+
|
|
|
+ return OpenResponse.Ok(WebPortalDeResponse<OrderListReturnDto>.Success(returnDto, "成功"));
|
|
|
+
|
|
|
}
|
|
|
#endregion
|
|
|
|