|
|
|
using AttributeQuartz;
|
|
|
|
using Coldairarrow.Business.HuiYan;
|
|
|
|
using Coldairarrow.Business.MDS;
|
|
|
|
using Coldairarrow.Entity.DTO;
|
|
|
|
using Coldairarrow.Entity.HuiYan;
|
|
|
|
using Coldairarrow.Entity.MDS;
|
|
|
|
using Coldairarrow.Util;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace Coldairarrow.Api.Controllers.HuiYan
|
|
|
|
{
|
|
|
|
[Route("/HuiYan/[controller]/[action]")]
|
|
|
|
public class pricetasklogController : BaseApiController
|
|
|
|
{
|
|
|
|
#region DI
|
|
|
|
|
|
|
|
IuserBusiness _iuserBusiness;
|
|
|
|
public pricetasklogController(IpricetasklogBusiness pricetasklogBus, IuserBusiness iuserBusiness)
|
|
|
|
{
|
|
|
|
_iuserBusiness = iuserBusiness;
|
|
|
|
_pricetasklogBus = pricetasklogBus;
|
|
|
|
}
|
|
|
|
|
|
|
|
IpricetasklogBusiness _pricetasklogBus { get; }
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 获取
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
public async Task<PageResult<pricetasklog>> GetDataList(PageInput<ConditionDTO> input)
|
|
|
|
{
|
|
|
|
return await _pricetasklogBus.GetDataListAsync(input);
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
public async Task<pricetasklog> GetTheData(IdInputDTO input)
|
|
|
|
{
|
|
|
|
return await _pricetasklogBus.GetTheDataAsync(input.id);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 提交
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
public async Task SaveData(pricetasklog data)
|
|
|
|
{
|
|
|
|
if (data.Id.IsNullOrEmpty())
|
|
|
|
{
|
|
|
|
InitEntity(data);
|
|
|
|
|
|
|
|
await _pricetasklogBus.AddDataAsync(data);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
await _pricetasklogBus.UpdateDataAsync(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
public async Task DeleteData(List<string> ids)
|
|
|
|
{
|
|
|
|
await _pricetasklogBus.DeleteDataAsync(ids);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 发布比价任务
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
public AjaxResult AddTask(string id)
|
|
|
|
{
|
|
|
|
return _pricetasklogBus.AddTask(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取列表
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
public PageResult<TeamitemDto> GetItems(PageInput<ConditionDTO> input, string keyWord)
|
|
|
|
{
|
|
|
|
return _pricetasklogBus.GetItems(input, keyWord);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 取消发布任务
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
public AjaxResult CanelTask(string id)
|
|
|
|
{
|
|
|
|
return _pricetasklogBus.CanelTask(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取我的数量信息
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
public AjaxResult GetMyCount()
|
|
|
|
{
|
|
|
|
return _pricetasklogBus.GetMyCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 设置状态
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <param name="state"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
public AjaxResult SetState(string id, int state)
|
|
|
|
{
|
|
|
|
return _pricetasklogBus.SetState(id, state);
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpGet("/task/dayrun")]
|
|
|
|
[AllowAnonymous]
|
|
|
|
[QuartzTask(CronExpression = "0 0 7 * * ?", Router ="/task/dayrun")]
|
|
|
|
public AjaxResult DayTaskSet()
|
|
|
|
{
|
|
|
|
_pricetasklogBus.DayTaskSet();
|
|
|
|
return Success();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
public AjaxResult GetTaskCount()
|
|
|
|
{
|
|
|
|
return _pricetasklogBus.GetTaskCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 接取任务
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="teamItemId"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
public AjaxResult AcceptTask(string teamItemId)
|
|
|
|
{
|
|
|
|
return _pricetasklogBus.AcceptTask(teamItemId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|