using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.MaterielEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Core;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.Helper;
using WIDESEA_DTO;
using WIDESEA_DTO.Basic;
using WIDESEA_DTO.ERP;
using WIDESEA_External.ERPService;
using WIDESEA_External.Model;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IInboundService;
using WIDESEA_Model.Models;
namespace WIDESEA_WMSServer.Controllers.ERP
{
///
/// ERP接口
///
[Route("api/Erp")]
[ApiController]
public class ErpController : ControllerBase
{
private readonly IBasicService _basicService;
private readonly IInvokeERPService _invokeERPService;
private readonly IInboundService _inboundService;
public ErpController(IBasicService basicService,IInvokeERPService invokeERPService, IInboundService inboundService)
{
_basicService = basicService;
_invokeERPService = invokeERPService;
_inboundService = inboundService;
}
///
/// 添加二期物料
///
///
[HttpPost, Route("ReceiveMaterial"), AllowAnonymous]
public WebResponseContent ReceiveMaterial([FromBody] ERPRoot eRPRoot)
{
return _basicService.MaterielInfoService.ReceiveMaterial(eRPRoot.Content);
}
///
/// 添加二期供应商
///
///
[HttpPost, Route("ReceiveSupplier"), AllowAnonymous]
public WebResponseContent ReceiveSupplier([FromBody] ERPRoot eRPRoot)
{
return _basicService.SupplierInfoService.ReceiveSupplier(eRPRoot.Content);
}
///
/// 添加二期客户
///
///
[HttpPost, Route("ReceiveCustomer"), AllowAnonymous]
public WebResponseContent ReceiveCustomer([FromBody] ERPRoot eRPRoot)
{
return _basicService.CustomerInfoService.ReceiveCustomer(eRPRoot.Content);
}
///
/// 添加二期员工
///
///
[HttpPost, Route("ReceiveStaff"), AllowAnonymous]
public WebResponseContent ReceiveStaff([FromBody] ERPRoot eRPRoot)
{
return _basicService.UserInfoService.ReceiveStaff(eRPRoot.Content);
}
///
/// 添加二期采购入库信息
///
///
[HttpPost, Route("PurchaseInboundInfo"), AllowAnonymous]
public WebResponseContent PurchaseInboundInfo([FromBody] ERPRoot eRPRoot)
{
return _inboundService.PurchaseOrderService.ReceivePurchaseOrder(eRPRoot.Content);
}
///
/// 添加二期采购退货信息
///
///
[HttpPost, Route("PurchaseReturn"), AllowAnonymous]
public WebResponseContent PurchaseReturn([FromBody] ERPRoot eRPRoot)
{
return _inboundService.PurchaseOrderService.ReceivePurchaseReturn(eRPRoot.Content);
}
///
/// 添加二期销售出库信息
///
///
[HttpPost, Route("ProDeliveryOrder"), AllowAnonymous]
public WebResponseContent ProDeliveryOrder([FromBody] ERPRoot eRPRoot)
{
return _inboundService.PurchaseOrderService.ReceiveProDeliveryOrder(eRPRoot.Content);
}
///
/// 添加非生产领料信息
///
///
[HttpPost, Route("ReceiveOut"), AllowAnonymous]
public WebResponseContent ReceiveOut([FromBody] ERPRoot eRPRoot)
{
return _inboundService.PurchaseOrderService.ReceiveOutOrder(eRPRoot.Content);
}
///
/// 添加非采购生产入库单信息
///
///
[HttpPost, Route("ReceiveInbound"), AllowAnonymous]
public WebResponseContent ReceiveInbound([FromBody] ERPRoot eRPRoot)
{
return _inboundService.InboundOrderService.ReceiveInbound(eRPRoot.Content);
}
///
/// 添加销售退货信息
///
///
[HttpPost, Route("ProDeliveryBack"), AllowAnonymous]
public WebResponseContent ProDeliveryBack([FromBody] ERPRoot eRPRoot)
{
return _inboundService.PurchaseOrderService.ReceiveProDeliveryBackOrder(eRPRoot.Content);
}
///
/// ERP上传采购信息
///
///
[HttpPost, Route("ERPPurchaseUp"), AllowAnonymous]
public string ERPPurchaseUp([FromBody] ERPPurchaseUpModel eRPPurchaseUpModel)
{
return _invokeERPService.ERPPurchaseUp(eRPPurchaseUpModel);
}
///
/// ERP成品销售出库上传信息
///
///
[HttpPost, Route("ERPProOutUp"), AllowAnonymous]
public string ERPProOutUp([FromBody] ERPProOutUpModel eRPProOutUpModel)
{
return _invokeERPService.ERPProOutUp(eRPProOutUpModel);
}
///
/// ERP上传成品入库信息
///
///
[HttpPost, Route("ERPProInUp"), AllowAnonymous]
public string ERPProInUp([FromBody] ERPProInUpModel eRPProInUpModel)
{
return _invokeERPService.ERPProInUp(eRPProInUpModel);
}
///
/// ERP上传半-成品入库信息
///
///
[HttpPost, Route("ERPSemiProInUp"), AllowAnonymous]
public string ERPSemiProInUp([FromBody] ERPProInUpModel eRPProInUpModel)
{
return _invokeERPService.ERPSemiProInUp(eRPProInUpModel);
}
}
}