You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
2.7 KiB
87 lines
2.7 KiB
using BBWY.Server.API.Filters;
|
|
using BBWY.Server.Business.Sync;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Linq;
|
|
|
|
namespace BBWY.Server.API.Controllers
|
|
{
|
|
public class ServiceOrderSyncController : BaseApiController
|
|
{
|
|
private JDServiceOrderSyncBusiness jdServiceOrderSyncBusiness;
|
|
|
|
public ServiceOrderSyncController(JDServiceOrderSyncBusiness jdServiceOrderSyncBusiness, IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor)
|
|
{
|
|
this.jdServiceOrderSyncBusiness = jdServiceOrderSyncBusiness;
|
|
}
|
|
|
|
|
|
[Consumes("application/x-www-form-urlencoded")]
|
|
[HttpPost]
|
|
public IActionResult ReceiveKuaiDi100Push([FromForm] string sign, [FromForm] string param)
|
|
{
|
|
var filters = ControllerContext.ActionDescriptor.FilterDescriptors;
|
|
var filterToRemove = filters.FirstOrDefault(f => f.Filter.GetType() == typeof(ResultFilter));
|
|
if (filterToRemove != null)
|
|
{
|
|
filters.Remove(filterToRemove);
|
|
}
|
|
jdServiceOrderSyncBusiness.ReceiveKuaiDi100Push(param);
|
|
return new JsonResult(new
|
|
{
|
|
result = true,
|
|
returnCode = "200",
|
|
message = "成功"
|
|
});
|
|
}
|
|
|
|
/// <summary>
|
|
/// 指定服务单同步
|
|
/// </summary>
|
|
/// <param name="shopId"></param>
|
|
/// <param name="serviceId"></param>
|
|
[HttpPost("{shopId}/{serviceId}")]
|
|
public void SyncServiceOrder([FromRoute] long shopId, [FromRoute] string serviceId)
|
|
{
|
|
jdServiceOrderSyncBusiness.SyncServiceOrder(shopId, serviceId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 指定店铺同步
|
|
/// </summary>
|
|
/// <param name="shopId"></param>
|
|
[HttpPost("{shopId}")]
|
|
public void SyncServiceOrder([FromRoute] long shopId)
|
|
{
|
|
jdServiceOrderSyncBusiness.SyncServiceOrder(shopId, string.Empty);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 全店服务单同步
|
|
/// </summary>
|
|
[HttpPost]
|
|
public void SyncServiceOrder()
|
|
{
|
|
jdServiceOrderSyncBusiness.SyncServiceOrder();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 指定店铺订阅快递100
|
|
/// </summary>
|
|
/// <param name="shopId"></param>
|
|
[HttpPost("{shopId}")]
|
|
public void SubscribeKuaiDi100([FromRoute] long shopId)
|
|
{
|
|
jdServiceOrderSyncBusiness.SubscribeKuaiDi100(shopId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 全店订阅快递100
|
|
/// </summary>
|
|
[HttpPost]
|
|
public void SubscribeKuaiDi100()
|
|
{
|
|
jdServiceOrderSyncBusiness.SubscribeKuaiDi100();
|
|
}
|
|
}
|
|
}
|
|
|