using CoreCms.Net.IRepository;
using CoreCms.Net.IServices;
using CoreCms.Net.IServices.baifenbingfa;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SKIT.FlurlHttpClient.Wechat.Api.Models;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading.Tasks;
namespace CoreCms.Net.Web.WebApi.Controllers.baifenbingfa
{
///
/// 经销商发货单处理
///
///
/// 页面接口
///
[Route("api/[controller]/[action]")]
[ApiController]
[Authorize]
public class DistributorDeliveryController: ControllerBase
{
IDistributorDeliveryServices _distributorDeliveryServices ;
public DistributorDeliveryController(IDistributorDeliveryServices distributorDeliveryServices )
{
_distributorDeliveryServices= distributorDeliveryServices ;
}
///
/// 获取list
///
///
[HttpPost("GetList")]
[SwaggerResponse(200, "返回数据", typeof(WebApiCallBack))]
[SwaggerResponse(201, "Data类型", typeof(IPageList))]
public async Task GetList(GetDeliveryListPost param)
{
var datalist = await _distributorDeliveryServices.GetDeliveryList(param);
return new WebApiCallBack
{
status = true,
data =new { datalist= datalist.Item1,
total=datalist.Item2
}
};
}
///
/// 接受发货单
///
///
[HttpPost("Accepted")]
public async Task Accepted([FromBody] AccptedInParam param)
{
var datalist = await _distributorDeliveryServices.SetDeliveryAccepted( param.acceptType, param.id,param.noAcceptTypeMsg);
return new WebApiCallBack
{
status = true,
data = datalist
};
}
}
public class AccptedInParam
{
///
/// 状态 0 为接受 3 为拒绝/取消
///
public sendDistributionAcceptType acceptType { get; set; }
///
/// 发货单ID
///
///
public string id { get; set; }
///
/// 校园代理拒绝原因
///
public string noAcceptTypeMsg { get; set; }
}
}