南骏 池
2025-06-06 a4ae3bf5f1826e8e29a95da3dc2c947d713d4ebb
MESApplication/Controllers/BasicData/ShipmentNoticeController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,162 @@
using System.Dynamic;
using MES.Service.Modes;
using MES.Service.service.BasicData;
using MES.Service.util;
using Microsoft.AspNetCore.Mvc;
namespace MESApplication.Controllers.BasicData;
[ApiController]
[Route("api/[controller]")]
public class ShipmentNoticeController : ControllerBase
{
    private readonly ShipmentNoticeManager m = new();
    /***进入模版管理可以修改模版***/
    /// <summary>
    ///     èŽ·å–æ‰€æœ‰
    /// </summary>
    /// <returns></returns>
    [HttpPost("GetList")]
    public ResponseResult GetList()
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.GetList();
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    ///     æ ¹æ®ä¸»é”®èŽ·å–
    /// </summary>
    /// <returns></returns>
    [HttpPost("GetById")]
    public ResponseResult GetById(int id)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.GetById(id);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    ///     æ ¹æ®ä¸»é”®åˆ é™¤
    /// </summary>
    /// <returns></returns>
    [HttpPost("DeleteByIds")]
    public ResponseResult DeleteByIds([FromBody] object[] ids)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.DeleteByIds(ids);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    ///     æ·»åŠ 
    /// </summary>
    /// <returns></returns>
    [HttpPost("Insert")]
    public ResponseResult Add([FromBody] ShipmentNotice data)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.Insert(data);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    ///     æ·»åŠ è¿”å›žè‡ªå¢ž
    /// </summary>
    /// <returns></returns>
    [HttpPost("InsertReturnIdentity")]
    public ResponseResult InsertReturnIdentity([FromBody] ShipmentNotice data)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.InsertReturnIdentity(data);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    ///     ä¿®æ”¹
    /// </summary>
    /// <returns></returns>
    [HttpPost("Update")]
    public ResponseResult Update([FromBody] ShipmentNotice data)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.Update(data);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
}