From 06905858858c53175dde5dc467e0f75803a13f61 Mon Sep 17 00:00:00 2001
From: cnf <3200815559@qq.com>
Date: 星期二, 18 三月 2025 13:37:48 +0800
Subject: [PATCH] 生产制造单接口完成
---
MES.Service/Dto/webApi/ErpProductionOrder.cs | 9 +
MESApplication/Controllers/BasicData/SentLaboratoryTestingItemsControllor.cs | 48 ++++++
MES.Service/Modes/SentLaboratoryTestingItems.cs | 23 +++
MESApplication/bin/Debug/net8.0/MES.Service.pdb | 0
MESApplication/bin/Debug/net8.0/MESApplication.dll | 0
MES.Service/bin/Debug/net8.0/MES.Service.dll | 0
MESApplication/Controllers/BasicData/ProductionOrderController.cs | 135 +++++++++++++++++++
MESApplication/bin/Debug/net8.0/MESApplication.xml | 12 +
MES.Service/Dto/webApi/ProductionOrder.cs | 13 +
MES.Service/service/BasicData/SentLaboratoryTestingItemsManager.cs | 75 ++++++++++
MESApplication/bin/Debug/net8.0/MES.Service.dll | 0
MES.Service/Modes/ProductionOrders.cs | 20 ++
MESApplication/Controllers/PLM/PLMController.cs | 2
MESApplication/bin/Debug/net8.0/MESApplication.pdb | 0
MESApplication/bin/Debug/net8.0/MESApplication.exe | 0
MES.Service/bin/Debug/net8.0/MES.Service.pdb | 0
MES.Service/service/BasicData/ProductionOrderManager.cs | 47 ++++++
17 files changed, 383 insertions(+), 1 deletions(-)
diff --git a/MES.Service/Dto/webApi/ErpProductionOrder.cs b/MES.Service/Dto/webApi/ErpProductionOrder.cs
new file mode 100644
index 0000000..65776dc
--- /dev/null
+++ b/MES.Service/Dto/webApi/ErpProductionOrder.cs
@@ -0,0 +1,9 @@
+锘縩amespace MES.Service.Dto.webApi
+{
+ public class ErpProductionOrder
+ {
+ //public string? Id { get; set; }
+ public string? SalesOrder { get; set; }
+ public string? ImageUrl { get; set; }
+ }
+}
diff --git a/MES.Service/Dto/webApi/ProductionOrder.cs b/MES.Service/Dto/webApi/ProductionOrder.cs
new file mode 100644
index 0000000..4255a0d
--- /dev/null
+++ b/MES.Service/Dto/webApi/ProductionOrder.cs
@@ -0,0 +1,13 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MES.Service.Dto.webApi
+{
+ public class ProductionOrder
+ {
+ public ErpProductionOrder erpProductionOrder { get; set; }
+ }
+}
diff --git a/MES.Service/Modes/ProductionOrders.cs b/MES.Service/Modes/ProductionOrders.cs
new file mode 100644
index 0000000..33d81f8
--- /dev/null
+++ b/MES.Service/Modes/ProductionOrders.cs
@@ -0,0 +1,20 @@
+锘縰sing SqlSugar;
+
+namespace MES.Service.Modes;
+
+//閫佽揣鍗曞ご
+[SugarTable("MES_PRODUCTION_ORDER")]
+public class ProductionOrders
+{
+ //SEQ_MES_SCZZD
+ [SugarColumn(ColumnName = "ID", IsPrimaryKey = true, OracleSequenceName = "SEQ_MES_SCZZD")]
+ public decimal Id { get; set; }
+
+ //閫佽揣鍗曞彿
+ [SugarColumn(ColumnName = "SALES_ORDER")]
+ public string? SalesOrder { get; set; }
+
+ //渚涘簲鍟�
+ [SugarColumn(ColumnName = "IMAGE_URL")]
+ public string? ImageUrl { get; set; }
+}
diff --git a/MES.Service/Modes/SentLaboratoryTestingItems.cs b/MES.Service/Modes/SentLaboratoryTestingItems.cs
new file mode 100644
index 0000000..dfe92b9
--- /dev/null
+++ b/MES.Service/Modes/SentLaboratoryTestingItems.cs
@@ -0,0 +1,23 @@
+锘縰sing SqlSugar;
+
+namespace MES.Service.Modes;
+
+/// <summary>
+/// 瀹為獙瀹ら�佹椤圭洰琛�
+/// </summary>
+[SugarTable("MES_QMS_SAMPLE_CHECK")]
+public class SentLaboratoryTestingItems
+{
+ /// <summary>
+ /// SEQ_sales搴忓垪
+ /// </summary>
+ [SugarColumn(ColumnName = "ID")]
+ public decimal Id { get; set; }
+
+ /// <summary>
+ /// 閫佹椤圭洰
+ /// </summary>
+ [SugarColumn(ColumnName = "INSPECTION_ITEMS")]
+ public string? InspectionItems { get; set; }
+
+}
diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.dll b/MES.Service/bin/Debug/net8.0/MES.Service.dll
index 323a6b7..bb7c9f5 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.dll
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.pdb b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
index df0f089..ed9d4b2 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.pdb
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MES.Service/service/BasicData/ProductionOrderManager.cs b/MES.Service/service/BasicData/ProductionOrderManager.cs
new file mode 100644
index 0000000..da712d9
--- /dev/null
+++ b/MES.Service/service/BasicData/ProductionOrderManager.cs
@@ -0,0 +1,47 @@
+锘縰sing MES.Service.DB;
+using MES.Service.Dto.webApi;
+using MES.Service.Dto.webApi.DeliveryNote;
+using MES.Service.Modes;
+using MES.Service.Modes.DeliveryNote;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+public class ProductionOrderManager : Repository<ProductionOrders>
+{
+ public dynamic Save(ErpProductionOrder erpProductionOrder)
+ {
+ //var erpProductionOrder = productionOrder.erpProductionOrder;
+ var mesProductionOrder = GetMesProductionOrder(erpProductionOrder);
+
+ return UseTransaction(db =>
+ {
+ return SaveOrUpdateData(db, mesProductionOrder) ? 1 : 0;
+ }) > 0;
+ }
+
+ public dynamic SaveList(List<ErpProductionOrder> erpProductionOrder)
+ {
+ var result = erpProductionOrder.Select(Save).ToList();
+ return result.All(b => b);
+ }
+
+ public ProductionOrders GetMesProductionOrder(ErpProductionOrder erpProductionOrder)
+ {
+ var mesProductionOrders = new ProductionOrders
+ {
+ ImageUrl = erpProductionOrder.ImageUrl,
+ SalesOrder = erpProductionOrder.SalesOrder
+ };
+
+ return mesProductionOrders;
+ }
+
+ private bool SaveOrUpdateData(SqlSugarScope db, ProductionOrders productionOrders)
+ {
+ var orUpdate = base.Insert(productionOrders);
+ if (orUpdate) return true;
+ throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�");
+ }
+}
\ No newline at end of file
diff --git a/MES.Service/service/BasicData/SentLaboratoryTestingItemsManager.cs b/MES.Service/service/BasicData/SentLaboratoryTestingItemsManager.cs
new file mode 100644
index 0000000..8afcff2
--- /dev/null
+++ b/MES.Service/service/BasicData/SentLaboratoryTestingItemsManager.cs
@@ -0,0 +1,75 @@
+锘縰sing MES.Service.DB;
+using MES.Service.Modes;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MES.Service.service.BasicData;
+public class SentLaboratoryTestingItemsManager : Repository<SentLaboratoryTestingItems>
+{
+ /// <summary>
+ /// 浠撳偍鏂规硶婊¤冻涓嶄簡澶嶆潅涓氬姟闇�姹傦紝涓氬姟浠g爜璇峰湪杩欓噷闈㈠畾涔夋柟娉�
+ /// </summary>
+ public void Study()
+ {
+ /*********鏌ヨ*********/
+
+ var data1 = base.GetById(1); //鏍规嵁ID鏌ヨ
+ var data2 = base.GetList(); //鏌ヨ鎵�鏈�
+ var data3 = base.GetList(it => 1 == 1); //鏍规嵁鏉′欢鏌ヨ
+ //var data4 = base.GetSingle(it => 1 == 1);//鏍规嵁鏉′欢鏌ヨ涓�鏉�,濡傛灉瓒呰繃涓�鏉′細鎶ラ敊
+
+ var p = new PageModel { PageIndex = 1, PageSize = 2 }; // 鍒嗛〉鏌ヨ
+ var data5 = base.GetPageList(it => 1 == 1, p);
+ Console.Write(p.TotalCount); //杩斿洖鎬绘暟
+
+ var data6 =
+ base.GetPageList(it => 1 == 1, p,
+ it => SqlFunc.GetRandom()); // 鍒嗛〉鏌ヨ鍔犳帓搴�
+ Console.Write(p.TotalCount); //杩斿洖鎬绘暟
+
+ var conModels = new List<IConditionalModel>(); //缁勮鏉′欢鏌ヨ浣滀负鏉′欢瀹炵幇 鍒嗛〉鏌ヨ鍔犳帓搴�
+ conModels.Add(new ConditionalModel
+ {
+ FieldName = typeof(SalesOrder).GetProperties()[0].Name,
+ ConditionalType = ConditionalType.Equal,
+ FieldValue = "1"
+ }); //id=1
+ var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom());
+
+ AsQueryable().Where(x => 1 == 1)
+ .ToList(); //鏀寔浜嗚浆鎹㈡垚queryable,鎴戜滑鍙互鐢╭ueryable瀹炵幇澶嶆潅鍔熻兘
+
+
+ /*********鎻掑叆*********/
+ var insertData = new SentLaboratoryTestingItems(); //娴嬭瘯鍙傛暟
+ var insertArray = new[] { insertData };
+ base.Insert(insertData); //鎻掑叆
+ base.InsertRange(insertArray); //鎵归噺鎻掑叆
+ var id = base.InsertReturnIdentity(insertData); //鎻掑叆杩斿洖鑷鍒�
+ AsInsertable(insertData).ExecuteCommand(); //鎴戜滑鍙互杞垚 Insertable瀹炵幇澶嶆潅鎻掑叆
+
+
+ /*********鏇存柊*********/
+ var updateData = new SentLaboratoryTestingItems(); //娴嬭瘯鍙傛暟
+ var updateArray = new[] { updateData }; //娴嬭瘯鍙傛暟
+ base.Update(updateData); //鏍规嵁瀹炰綋鏇存柊
+ base.UpdateRange(updateArray); //鎵归噺鏇存柊
+ //base.Update(it => new SalesOrder() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// 鍙洿鏂癈lassName鍒楀拰CreateTime鍒楋紝鍏跺畠鍒椾笉鏇存柊锛屾潯浠秈d=1
+ AsUpdateable(updateData).ExecuteCommand(); //杞垚Updateable鍙互瀹炵幇澶嶆潅鐨勬彃鍏�
+
+
+ /*********鍒犻櫎*********/
+ var deldata = new SentLaboratoryTestingItems(); //娴嬭瘯鍙傛暟
+ base.Delete(deldata); //鏍规嵁瀹炰綋鍒犻櫎
+ base.DeleteById(1); //鏍规嵁涓婚敭鍒犻櫎
+ base.DeleteById(new[] { 1, 2 }); //鏍规嵁涓婚敭鏁扮粍鍒犻櫎
+ base.Delete(it => 1 == 2); //鏍规嵁鏉′欢鍒犻櫎
+ AsDeleteable().Where(it => 1 == 2)
+ .ExecuteCommand(); //杞垚Deleteable瀹炵幇澶嶆潅鐨勬搷浣�
+ }
+
+}
diff --git a/MESApplication/Controllers/BasicData/ProductionOrderController.cs b/MESApplication/Controllers/BasicData/ProductionOrderController.cs
new file mode 100644
index 0000000..c3d65cf
--- /dev/null
+++ b/MESApplication/Controllers/BasicData/ProductionOrderController.cs
@@ -0,0 +1,135 @@
+锘縰sing MES.Service.Dto.webApi;
+using MES.Service.Dto.webApi.DeliveryNote;
+using MES.Service.Modes;
+using MES.Service.service;
+using MES.Service.util;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using System.Dynamic;
+
+namespace MESApplication.Controllers.BasicData;
+
+[ApiController]
+[Route("api/ProductionOrder")]
+public class ProductionOrderController : ControllerBase
+{
+ private readonly MessageCenterManager _manager = new();
+ private readonly ProductionOrderManager m = new();
+
+ private readonly string METHOD = "POST";
+
+ private readonly string TableName = "MES_PRODUCTION_ORDER";
+
+ private readonly string URL = "http://localhost:10054/api/ProductionOrder/";
+
+ /// <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);
+ }
+ }
+
+ [HttpPost("Save")]
+ public ResponseResult Save(ErpProductionOrder erpProductionOrder)
+ {
+ var entity = new MessageCenter();
+ entity.TableName = TableName;
+ entity.Url = URL + "Save";
+ entity.Method = METHOD;
+ entity.Data = JsonConvert.SerializeObject(erpProductionOrder);
+ entity.Status = 1;
+ entity.CreateBy = "PL017";
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ var save = m.Save(erpProductionOrder);
+ resultInfos.tbBillList = save;
+
+ entity.Result = 0;
+ if (save) entity.Result = 1;
+
+ entity.DealWith = 1;
+ _manager.save(entity);
+
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ entity.Result = 0;
+
+ entity.DealWith = 0;
+
+ entity.ResultData = ex.Message;
+
+ _manager.save(entity);
+
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
+ [HttpPost("SaveList")]
+ public ResponseResult SaveList(List<ErpProductionOrder> erpProductionOrder)
+ {
+ var entity = new MessageCenter();
+ entity.TableName = TableName;
+ entity.Url = URL + "SaveList";
+ entity.Method = METHOD;
+ entity.Data = JsonConvert.SerializeObject(erpProductionOrder);
+ entity.Status = 1;
+ entity.CreateBy = "PL017";
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ var save = m.SaveList(erpProductionOrder);
+ resultInfos.tbBillList = save;
+
+ entity.Result = 0;
+ if (save) entity.Result = 1;
+
+ entity.DealWith = 1;
+ _manager.save(entity);
+
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ entity.Result = 0;
+
+ entity.DealWith = 0;
+
+ entity.ResultData = ex.Message;
+
+ _manager.save(entity);
+
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+}
+
diff --git a/MESApplication/Controllers/BasicData/SentLaboratoryTestingItemsControllor.cs b/MESApplication/Controllers/BasicData/SentLaboratoryTestingItemsControllor.cs
new file mode 100644
index 0000000..ec6835e
--- /dev/null
+++ b/MESApplication/Controllers/BasicData/SentLaboratoryTestingItemsControllor.cs
@@ -0,0 +1,48 @@
+锘縰sing System.Dynamic;
+using MES.Service.Dto.webApi;
+using MES.Service.Modes;
+using MES.Service.service;
+using MES.Service.service.BasicData;
+using MES.Service.util;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+
+namespace MESApplication.Controllers.BasicData;
+
+[ApiController]
+[Route("api/[controller]")]
+public class SentLaboratoryTestingItemsControllor : ControllerBase
+{
+ private readonly MessageCenterManager _manager = new();
+ private readonly SentLaboratoryTestingItemsManager m = new();
+
+ private readonly string METHOD = "POST";
+
+ private readonly string TableName = "MES_QMS_SAMPLE_CHECK";
+
+ private readonly string URL = "http://localhost:10054/api/SentLaboratoryTestingItems/";
+
+ /// <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);
+ }
+ }
+}
diff --git a/MESApplication/Controllers/PLM/PLMController.cs b/MESApplication/Controllers/PLM/PLMController.cs
index e264562..a20d80b 100644
--- a/MESApplication/Controllers/PLM/PLMController.cs
+++ b/MESApplication/Controllers/PLM/PLMController.cs
@@ -71,7 +71,7 @@
return Convert.ToBase64String(fileBytes);
}
- [HttpDelete("DeleteImageFile")]
+ [HttpPost("DeleteImageFile")]
public IActionResult DeleteImageFile([FromQuery] string filePath)
{
// 妫�鏌ユ枃浠惰矾寰勬槸鍚︿负绌�
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.dll b/MESApplication/bin/Debug/net8.0/MES.Service.dll
index 323a6b7..bb7c9f5 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.dll
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.pdb b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
index df0f089..ed9d4b2 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.pdb
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.dll b/MESApplication/bin/Debug/net8.0/MESApplication.dll
index 5f3079d..52cf42d 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.dll
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.exe b/MESApplication/bin/Debug/net8.0/MESApplication.exe
index dcb4e2c..b910c46 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.exe
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.pdb b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
index d5942ba..51a78f0 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.pdb
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.xml b/MESApplication/bin/Debug/net8.0/MESApplication.xml
index 086076f..1b3b302 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.xml
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.xml
@@ -462,6 +462,12 @@
</summary>
<returns></returns>
</member>
+ <member name="M:MESApplication.Controllers.BasicData.ProductionOrderController.GetList">
+ <summary>
+ 鑾峰彇鎵�鏈�
+ </summary>
+ <returns></returns>
+ </member>
<member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.Save(MES.Service.Dto.webApi.SaleDeliveryNotice)">
<summary>
鍗曟潯涓昏〃鏁版嵁淇濆瓨鎿嶄綔
@@ -714,6 +720,12 @@
</summary>
<returns></returns>
</member>
+ <member name="M:MESApplication.Controllers.BasicData.SentLaboratoryTestingItemsControllor.GetList">
+ <summary>
+ 鑾峰彇鎵�鏈�
+ </summary>
+ <returns></returns>
+ </member>
<member name="M:MESApplication.Controllers.BasicData.ShipmentDetailController.GetList">
<summary>
鑾峰彇鎵�鏈�
--
Gitblit v1.9.3