From debfb742b27f7a5e668e6cd3f52db2ee8ddfe815 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 13 四月 2026 10:08:35 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs | 167 ++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 133 insertions(+), 34 deletions(-)
diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
index ba1fba1..63b9e06 100644
--- a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
+++ b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
@@ -1,6 +1,5 @@
锘縰sing Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-using NPOI.SS.Formula.Functions;
using Pub_Class;
using System;
using System.Collections;
@@ -9,6 +8,7 @@
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
+using System.Windows.Forms;
using SyntacticSugar.constant;
namespace WebAPI.Controllers
@@ -146,6 +146,9 @@
}
}
#endregion
+
+
+
#region 閲囪喘鍏ュ簱鍗� 淇濆瓨/缂栬緫鍔熻兘
@@ -313,7 +316,7 @@
}
String sql = $@"update Kf_ICStockBillMain set " +
- "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + ",HBillNo='" + HBillNo + "'" +
+ "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + ",HBillNo='" + HBillNo + "'" + ",HDate='" + HDate + "'" +
",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID
+ ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID
+ ",HAddress='" + HAddress + "',HInnerBillNo='" + HInnerBillNo + "',HProjectID=" + HProjectID + ",HInvoiceBillNo='" + HInvoiceBillNo + "' where HInterID=" + HInterID;
@@ -617,6 +620,102 @@
}
}
#endregion
+ #region 閲囪喘鍏ュ簱鍗� - 鎵樻暟鍙樻洿鍔熻兘
+ [Route("Kf_POStockInBill/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 = "鎵樻暟涓嶈兘涓鸿礋鏁帮紒" };
+
+
+
+
+ // 鐩存帴鏇存柊鎵樻暟
+ string updateSql = $@"
+ UPDATE Kf_ICStockBillMain
+ 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 閲囪喘鍏ュ簱鍗� - 璐存爣绛炬暟鍙樻洿鍔熻兘
+ [Route("Kf_POStockInBill/UpdateHTagCount")]
+ [HttpPost]
+ public object UpdateHTagCount([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 updateSql = $@"
+ UPDATE Kf_ICStockBillMain
+ SET HTagCount = {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>
@@ -2115,39 +2214,39 @@
List<ClsKf_ICStockBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKf_ICStockBillSub>>(entry);
// 鍒ゆ柇 鏁版嵁搴撲腑鏄惁瀛樺湪id鍜屽崟鎹彿鐩哥瓑鐨勫崟鎹紝瀛樺湪锛屽垯閲嶅缓锛屽彧鏈塱d鍙风浉绛夛紝鍒欑敵璇锋柊鐨刬d鍙�
- // var ds1 = oCN.RunProcReturn($@"
- // select hmainid HInterID, 鍗曟嵁鍙� HBillNO from h_v_Kf_POStockInBillList where hmainid = {mainList[0].HInterID}
- // ", "h_v_Kf_POStockInBillList");
- // var HInterID_Old = mainList[0].HInterID;
- // if (ds1.Tables[0].Rows.Count > 0 && ds1.Tables[0].Rows[0]["HInterID"] != null)
- // {
- // if (string.Equals(ds1.Tables[0].Rows[0]["HBillNo"].ToString(), mainList[0].HBillNo, StringComparison.OrdinalIgnoreCase))
- // {
- // string sql = string.Empty;
- // sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
- // oCN.RunProc(sql);
- // sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
- // oCN.RunProc(sql);
- // }
- // else
- // {
- // // 閲嶆柊鐢宠HInterID
- // var HInterID_Exch = DBUtility.ClsPub.CreateBillID("1201", ref DBUtility.ClsPub.sExeReturnInfo);
- // mainList[0].HInterID = HInterID_Exch;
- //
- // foreach (var oSub in subList)
- // {
- // oSub.HInterID = HInterID_Exch;
- // }
- //
- // }
- // }
+ var ds1 = oCN.RunProcReturn($@"
+ select hmainid HInterID, 鍗曟嵁鍙� HBillNO from h_v_Kf_POStockInBillList where hmainid = {mainList[0].HInterID}
+ ", "h_v_Kf_POStockInBillList");
+ var HInterID_Old = mainList[0].HInterID;
+ if (ds1.Tables[0].Rows.Count > 0 && ds1.Tables[0].Rows[0]["HInterID"] != null)
+ {
+ if (string.Equals(ds1.Tables[0].Rows[0]["HBillNo"].ToString(), mainList[0].HBillNo, StringComparison.OrdinalIgnoreCase))
+ {
+ string sql = string.Empty;
+ sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
+ oCN.RunProc(sql);
+ sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
+ oCN.RunProc(sql);
+ }
+ else
+ {
+ // 閲嶆柊鐢宠HInterID
+ var HInterID_Exch = DBUtility.ClsPub.CreateBillID("1201", ref DBUtility.ClsPub.sExeReturnInfo);
+ mainList[0].HInterID = HInterID_Exch;
+
+ foreach (var oSub in subList)
+ {
+ oSub.HInterID = HInterID_Exch;
+ }
+
+ }
+ }
- string sql = string.Empty;
- sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
- oCN.RunProc(sql);
- sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
- oCN.RunProc(sql);
+ // string sql = string.Empty;
+ // sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
+ // oCN.RunProc(sql);
+ // sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
+ // oCN.RunProc(sql);
// 涓昏〃鎻掑叆
oCN.RunProc($@"Insert Into Kf_ICStockBillMain
(
--
Gitblit v1.9.1