96 lines
2.7 KiB
C#
96 lines
2.7 KiB
C#
using Infrastructure.Attribute;
|
|
using Microsoft.AspNetCore.Http;
|
|
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Infrastructure;
|
|
using ARW.Model;
|
|
using ARW.Repository;
|
|
using ARW.Repository.Business.OrderTasks;
|
|
using ARW.Service.Business.IBusinessService.OrderTasks;
|
|
using ARW.Model.Dto.Business.OrderTasks;
|
|
using ARW.Model.Models.Business.OrderTasks;
|
|
using ARW.Model.Vo.Business.OrderTasks;
|
|
|
|
namespace ARW.Service.Business.BusinessService.OrderTasks
|
|
{
|
|
/// <summary>
|
|
/// 订单取消任务接口实现类
|
|
///
|
|
/// @author lwh
|
|
/// @date 2023-10-23
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IOrderTaskService), ServiceLifetime = LifeTime.Transient)]
|
|
public class OrderTaskServiceImpl : BaseService<OrderTask>, IOrderTaskService
|
|
{
|
|
private readonly OrderTaskRepository _OrderTaskRepository;
|
|
|
|
public OrderTaskServiceImpl(OrderTaskRepository OrderTaskRepository)
|
|
{
|
|
this._OrderTaskRepository = OrderTaskRepository;
|
|
}
|
|
|
|
#region 业务逻辑代码
|
|
|
|
|
|
/// <summary>
|
|
/// 查询订单取消任务分页列表
|
|
/// </summary>
|
|
public async Task<PagedInfo<OrderTaskVo>> GetOrderTaskList(OrderTaskQueryDto parm)
|
|
{
|
|
//开始拼装查询条件d
|
|
var predicate = Expressionable.Create<OrderTask>();
|
|
|
|
var query = _OrderTaskRepository
|
|
.Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.OrderBy(s => s.Update_time,OrderByType.Desc)
|
|
.Select(s => new OrderTaskVo
|
|
{
|
|
OrderTaskId = s.OrderTaskId,
|
|
OrderTaskGuid = s.OrderTaskGuid,
|
|
CustomerGuid = s.CustomerGuid,
|
|
OrderGuid = s.OrderGuid,
|
|
EndTime = s.EndTime,
|
|
PayStatus = s.PayStatus,
|
|
CancelStatus = s.CancelStatus,
|
|
ErrorMsg = s.ErrorMsg,
|
|
});
|
|
|
|
|
|
return await query.ToPageAsync(parm);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加或修改订单取消任务
|
|
/// </summary>
|
|
public async Task<string> AddOrUpdateOrderTask(OrderTask model)
|
|
{
|
|
if (model.OrderTaskId != 0)
|
|
{
|
|
var response = await _OrderTaskRepository.UpdateAsync(model);
|
|
return "修改成功!";
|
|
}
|
|
else
|
|
{
|
|
|
|
var response = await _OrderTaskRepository.InsertReturnSnowflakeIdAsync(model);
|
|
return "添加成功!";
|
|
}
|
|
}
|
|
|
|
#region Excel处理
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|