From 07968530fd2a7c0d818adc8a89c96a9499dbbee6 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期一, 19 一月 2026 16:17:38 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/MJGL/Sc_MouldProdBackBillController.cs | 68 ++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldProdBackBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldProdBackBillController.cs
index 841a496..c5f9787 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldProdBackBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldProdBackBillController.cs
@@ -394,6 +394,74 @@
}
#endregion
+
+ #region 鍣ㄥ叿棰嗙敤閫�搴撳崟 - 鎵樻暟鍙樻洿鍔熻兘
+ [Route("Sc_MouldProdBackBillController/UpdatePallet")]
+ [HttpPost]
+
+ public object UpdatePallet([FromBody] JObject data)
+ {
+ try
+ {
+ long hmainid = data["hmainid"]?.ToObject<long>() ?? 0;
+ int newPallet = data["newPallet"]?.ToObject<int>() ?? 0;
+ string operatorName = data["operator"]?.ToString() ?? "";
+
+ if (hmainid <= 0)
+ return new { code = "0", count = 0, Message = "鍗曟嵁ID涓嶈兘涓虹┖锛�" };
+
+ if (newPallet <= 0)
+ return new { code = "0", count = 0, Message = "鎵樻暟蹇呴』澶т簬0锛�" };
+
+
+ string checkAuditSql = $@"
+ SELECT HBillStatus
+ FROM Sc_MouldStockBillMain
+ WHERE HInterID = {hmainid}";
+
+ DataSet dsAudit = oCn.RunProcReturn(checkAuditSql, "CheckAudit");
+
+ if (dsAudit != null && dsAudit.Tables[0].Rows.Count > 0)
+ {
+ int hBillStatus = Convert.ToInt32(dsAudit.Tables[0].Rows[0]["HBillStatus"]);
+
+ if (hBillStatus == 2)
+ {
+ return new { code = "0", count = 0, Message = "鍗曟嵁宸插鏍革紝涓嶈兘淇敼鎵樻暟锛�" };
+ }
+ }
+ else
+ {
+ return new { code = "0", count = 0, Message = "鍗曟嵁涓嶅瓨鍦紒" };
+ }
+
+
+ string updateSql = $@"
+ UPDATE Sc_MouldStockBillMain
+ SET HPackQtys = {newPallet}
+ WHERE HInterID = {hmainid}";
+
+ oCn.RunProc(updateSql);
+
+ return new
+ {
+ code = "1",
+ count = 1,
+ Message = "鎵樻暟淇敼鎴愬姛锛�"
+ };
+ }
+ catch (Exception e)
+ {
+ return new
+ {
+ code = "0",
+ count = 0,
+ Message = "淇敼澶辫触锛�" + e.Message
+ };
+ }
+ }
+ #endregion
+
#region 鍣ㄥ叿棰嗙敤閫�搴撳崟 鍏抽棴/鍙嶅叧闂�
/// <summary>
/// 鍏抽棴/鍙嶅叧闂櫒鍏烽鐢ㄩ��搴撳崟
--
Gitblit v1.9.1