From 9382e8326714a25e04661150d0f11ad47ca0fcac Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 15 四月 2025 14:10:36 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/仓存管理/领料发货/Kf_StepFoldOutBillController.cs | 158 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 144 insertions(+), 14 deletions(-)
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs"
index e71f4bc..82c3dad 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs"
@@ -8,6 +8,7 @@
using Newtonsoft.Json.Linq;
using Model;
using DBUtility;
+using Newtonsoft.Json;
namespace WebAPI.Controllers.浠撳瓨绠$悊.棰嗘枡鍙戣揣
{
@@ -78,6 +79,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
if (sWhere == null || sWhere.Equals(""))
{
ds = oCn.RunProcReturn("select * from h_v_IF_StepFoldOutBillList order by hmainid desc", "h_v_IF_StepFoldOutBillList");
@@ -88,13 +90,19 @@
string sql = sql1 + sWhere + " order by hmainid desc";
ds = oCn.RunProcReturn(sql, "h_v_IF_StepFoldOutBillList");
}
-
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
//{
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
+ objJsonResult.data = ds.Tables[0];//浠g爜灏嗙涓�涓狣ataTable锛堢储寮曚负0锛夎祴鍊肩粰objJsonResult鐨刣ata灞炴��
+ objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
return objJsonResult;
//}
//else
@@ -238,6 +246,17 @@
string HCloseMan = mainList[0].HCloseMan;
string HCloseDate = mainList[0].HCloseDate;
long HCurID = mainList[0].HCurID;
+ long HProjectID = mainList[0].HProjectID; //-椤圭洰
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
ds = oCn.RunProcReturn("select * from h_v_IF_StepFoldOutBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_StepFoldOutBillList");
@@ -249,17 +268,40 @@
,HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID
,HMaker,HMakeDate,HChecker,HUpDater
,HDeleteMan,HCloseMan
- ,HRemark,HExplanation,HInnerBillNo,HCurID)
+ ,HRemark,HExplanation,HInnerBillNo,HCurID,HProjectID)
values(" + HInterID + ",'" + HBillNo + "','" + HDate + "','" + 1250 + "','" +
- HBillSubType + "'," + HBillStatus + "," + DateTime.Now.Year + "," + DateTime.Now.Month + "," + HSupID +
+ 1250 + "'," + HBillStatus + "," + DateTime.Now.Year + "," + DateTime.Now.Month + "," + HSupID +
"," + HWHID + "," + HSCWHID + "," + HEmpID + "," + HManagerID + "," + HSecManagerID +
"," + HKeeperID + "," + HDeptID + ",'" + HMaker + "','" + HMakeDate + "','" + HChecker + "','" + HUpDater + "','" + HDeleteMan + "','" + HCloseMan + "','"
- + HRemark + "','" + HExplanation + "','" + HInnerBillNo + "'," + HCurID + "" + ")");
+ + HRemark + "','" + HExplanation + "','" + HInnerBillNo + "'," + HCurID + "," + HProjectID + "" + ")");
}
else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
{ //淇敼
+
+ DataSet dss;
+ dss = oCn.RunProcReturn("select * from h_v_IF_StepFoldOutBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_StepFoldOutBillList");
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (dss.Tables[0].Rows[0]["瀹℃牳浜�"].ToString() != "" && dss.Tables[0].Rows[0]["瀹℃牳浜�"] != null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (dss.Tables[0].Rows[0]["鐘舵��"].ToString() != "鍒涘缓")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
String sql="update Kf_ICStockBillMain set " +
- "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + " where HInterID=" + "HInterID";
+ "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" +
+ ",HSupID=" + HSupID + ",HWHID=" + HWHID + ",HSCWHID=" + HSCWHID + ", HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HSecManagerID = " + HSecManagerID
+ + ",HKeeperID=" + HKeeperID + ",HDeptID=" + HDeptID + ",HProjectID=" + HProjectID + " where HInterID=" + HInterID;
oCn.RunProc(sql);
//鍒犻櫎瀛愯〃
@@ -369,6 +411,18 @@
{
try
{
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
+
oCn.BeginTran();
oCn.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
oCn.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
@@ -433,6 +487,20 @@
ds = oCn.RunProcReturn("select * from Kf_ICStockBillMain where HInterID = " + int.Parse(HInterID), "Kf_ICStockBillMain");
string HBillNo = "";
+
+
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ DateTime HDate = DateTime.Now;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.Message = s;
+ return objJsonResult;
+ }
+
+
oCn.BeginTran();//寮�濮嬩簨鍔�
if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -447,8 +515,6 @@
{
HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
}
-
-
//Type 1 瀹℃牳 2 鍙嶅鏍�
@@ -719,25 +785,89 @@
//Type 1 浣滃簾 2 鍙嶄綔搴�
if (Type == 1)
{
- if (!BillOld.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ DataSet ds;
+ string sql = "select * from Kf_ICStockBillMain where HinterID = " + HInterID;
+ ds = oCn.RunProcReturn(sql, "Kf_ICStockBillMain");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
objJsonResult.data = null;
return objJsonResult;
}
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶉渶瑕佸啀浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //浣滃簾鍗曟嵁
+ if (!BillOld.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
}
else
{
- if (!BillOld.AbandonCancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ DataSet ds;
+ string sql = "select * from Kf_ICStockBillMain where HinterID = " + HInterID;
+ ds = oCn.RunProcReturn(sql, "Kf_ICStockBillMain");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
objJsonResult.data = null;
return objJsonResult;
}
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶉渶瑕佸啀浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //浣滃簾鍗曟嵁
+ if (!BillOld.AbandonCancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
}
oCn.Commit();//鎻愪氦浜嬪姟
--
Gitblit v1.9.1