using Autofac.Core;
|
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using WIDESEA_Core;
|
using WIDESEA_Core.Attributes;
|
using WIDESEA_Core.BaseController;
|
using WIDESEA_Core.BaseRepository;
|
using WIDESEA_Core.CodeConfigEnum;
|
using WIDESEA_Core.Helper;
|
using WIDESEA_DTO.Basic;
|
using WIDESEA_DTO.Outbound;
|
using WIDESEA_IBasicService;
|
using WIDESEA_Model.Models;
|
using WIDESEA_Model.Models.Basic;
|
|
namespace WIDESEA_WMSServer.Controllers.Basic
|
{
|
/// <summary>
|
/// 物料
|
/// </summary>
|
[Route("api/MaterielInfo")]
|
[ApiController]
|
public class MaterielInfoController : ApiBaseController<IMaterielInfoService, Dt_MaterielInfo>
|
{
|
public readonly IMaterialExpirationDateService _materialExpirationDateService;
|
public MaterielInfoController(IMaterielInfoService service, IMaterialExpirationDateService materialExpirationDateService) : base(service)
|
{
|
_materialExpirationDateService = materialExpirationDateService;
|
}
|
|
|
/// <summary>
|
/// 接收MES 物料有效期
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
[HttpPost, Route("ReceiveMaterialExpirationDate"), AllowAnonymous, MethodParamsValidate]
|
public WebResponseContent ReceiveMaterialExpirationDate([FromBody] MaterialExpirationDateDTO model)
|
{
|
var data = new Dt_MaterialExpirationDate() { };
|
|
data.MaterialCode = model.materialCode;
|
data.ThreeExtensionDays = model.threeExtensionDays;
|
data.OneExtensionDays = model.oneExtensionDays;
|
data.TwoExtensionDays = model.twoExtensionDays;
|
data.Enable = model.enable;
|
data.ValidityDays = model.validityDays;
|
|
data.ModifyDate = DateTime.Now;
|
|
var content = _materialExpirationDateService.ReceiveMaterialExpirationDate(data, model.operationType);
|
|
if (content.Status) return WebResponseContent.Instance.OK(200);
|
else return WebResponseContent.Instance.Error(content.Message);
|
}
|
}
|
}
|