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
|
{
|
/// <summary>
|
/// 经销商发货单处理
|
/// </summary>
|
/// <summary>
|
/// 页面接口
|
/// </summary>
|
[Route("api/[controller]/[action]")]
|
[ApiController]
|
[Authorize]
|
public class DistributorDeliveryController: ControllerBase
|
{
|
|
IDistributorDeliveryServices _distributorDeliveryServices ;
|
|
public DistributorDeliveryController(IDistributorDeliveryServices distributorDeliveryServices )
|
{
|
_distributorDeliveryServices= distributorDeliveryServices ;
|
}
|
/// <summary>
|
/// 获取list
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("GetList")]
|
[SwaggerResponse(200, "返回数据", typeof(WebApiCallBack))]
|
[SwaggerResponse(201, "Data类型", typeof(IPageList<CoreCmsBillDelivery>))]
|
|
public async Task<WebApiCallBack> GetList(GetDeliveryListPost param)
|
{
|
var datalist = await _distributorDeliveryServices.GetDeliveryList(param);
|
return new WebApiCallBack
|
{
|
status = true,
|
data =new { datalist= datalist.Item1,
|
total=datalist.Item2
|
}
|
|
};
|
|
}
|
|
/// <summary>
|
/// 接受发货单
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost("Accepted")]
|
public async Task<WebApiCallBack> 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
|
{
|
/// <summary>
|
/// 状态 0 为接受 3 为拒绝/取消
|
/// </summary>
|
public sendDistributionAcceptType acceptType { get; set; }
|
/// <summary>
|
/// 发货单ID
|
///
|
/// </summary>
|
public string id { get; set; }
|
/// <summary>
|
/// 校园代理拒绝原因
|
/// </summary>
|
public string noAcceptTypeMsg { get; set; }
|
}
|
|
|
}
|