From a27f32ecbfc7390ceb9e3a8d8651c57ada88bfa0 Mon Sep 17 00:00:00 2001
From: zjh <2207896513@qq.com>
Date: 星期五, 19 十二月 2025 20:51:42 +0800
Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/XB_MES_API

---
 StandardPda/MESApplication/Controllers/BasicData/ShipmentPlanDeliveryController.cs |  262 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 262 insertions(+), 0 deletions(-)

diff --git a/StandardPda/MESApplication/Controllers/BasicData/ShipmentPlanDeliveryController.cs b/StandardPda/MESApplication/Controllers/BasicData/ShipmentPlanDeliveryController.cs
new file mode 100644
index 0000000..4abeba7
--- /dev/null
+++ b/StandardPda/MESApplication/Controllers/BasicData/ShipmentPlanDeliveryController.cs
@@ -0,0 +1,262 @@
+using System.Dynamic;
+using MES.Service.Dto.webApi;
+using MES.Service.Modes;
+using MES.Service.service;
+using MES.Service.util;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+
+namespace MESApplication.Controllers;
+
+/// <summary>
+///     鏉ユ簮鍑鸿揣璁″垝鐨勬爣鍑嗗嚭璐ф帴鍙�
+/// </summary>
+[ApiController]
+[Route("api/[controller]")]
+public class ShipmentPlanDeliveryController : ControllerBase
+{
+    private readonly MessageCenterManager _manager = new();
+    private readonly ShipmentPlanDeliveryManager m = new();
+    private readonly string METHOD = "POST";
+    private readonly string TableName = "SHIPMENT_PLAN_DELIVERY";
+    private readonly string URL = "http://localhost:10054/api/ShipmentPlanDelivery/";
+
+    /// <summary>
+    ///     淇濆瓨鍑鸿揣璁″垝鍑鸿揣鏁版嵁锛堟爣鍑嗘帴鍙o級
+    /// </summary>
+    /// <param name="data">鍑鸿揣璁″垝鍑鸿揣鏁版嵁</param>
+    /// <returns></returns>
+    [HttpPost("Save")]
+    public ResponseResult Save(ErpShipmentPlanDelivery data)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "Save";
+        entity.Method = METHOD;
+        entity.Route = data.OrderDto.BillNo;
+        entity.Data = JsonConvert.SerializeObject(data);
+        entity.Status = (short)1;
+        entity.CreateBy = "SYSTEM";
+
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.Save(data);
+
+            resultInfos.tbBillList = save;
+
+            entity.Result = (short)(save ? 1 : 0);
+            entity.DealWith = (short)1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = (short)0;
+            entity.DealWith = (short)0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
+
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     鎵归噺淇濆瓨鍑鸿揣璁″垝鍑鸿揣鏁版嵁
+    /// </summary>
+    /// <param name="dataList">鍑鸿揣璁″垝鍑鸿揣鏁版嵁鍒楄〃</param>
+    /// <returns></returns>
+    [HttpPost("SaveList")]
+    public ResponseResult SaveList(List<ErpShipmentPlanDelivery> dataList)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "SaveList";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(dataList);
+        entity.Status = (short)1;
+        entity.CreateBy = "SYSTEM";
+
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var save = m.SaveList(dataList);
+            resultInfos.tbBillList = save;
+
+            entity.Result = (short)(save ? 1 : 0);
+            entity.DealWith = (short)1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = (short)0;
+            entity.DealWith = (short)0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
+
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <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>
+    /// <param name="id">涓婚敭ID</param>
+    /// <returns></returns>
+    [HttpPost("GetById")]
+    public ResponseResult GetById(decimal 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>
+    /// <param name="ids">涓婚敭ID鏁扮粍</param>
+    /// <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>
+    /// <param name="data">鍑鸿揣璁″垝鍑鸿揣鏁版嵁</param>
+    /// <returns></returns>
+    [HttpPost("Insert")]
+    public ResponseResult Add([FromBody] ShipmentPlanDelivery 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>
+    ///     娣诲姞鍑鸿揣璁″垝鍑鸿揣鏁版嵁骞惰繑鍥炶嚜澧濱D
+    /// </summary>
+    /// <param name="data">鍑鸿揣璁″垝鍑鸿揣鏁版嵁</param>
+    /// <returns></returns>
+    [HttpPost("InsertReturnIdentity")]
+    public ResponseResult InsertReturnIdentity([FromBody] ShipmentPlanDelivery 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>
+    /// <param name="data">鍑鸿揣璁″垝鍑鸿揣鏁版嵁</param>
+    /// <returns></returns>
+    [HttpPost("Update")]
+    public ResponseResult Update([FromBody] ShipmentPlanDelivery 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);
+        }
+    }
+}

--
Gitblit v1.9.3