From e015414db93b6cf18489bedcd473e07eef409aea Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 06 六月 2024 15:31:22 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/仓存管理/验收入库/Kf_StepFoldinBillController.cs | 191 ++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 177 insertions(+), 14 deletions(-)
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\252\214\346\224\266\345\205\245\345\272\223/Kf_StepFoldinBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\252\214\346\224\266\345\205\245\345\272\223/Kf_StepFoldinBillController.cs"
index e8c9713..021f780 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\252\214\346\224\266\345\205\245\345\272\223/Kf_StepFoldinBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\252\214\346\224\266\345\205\245\345\272\223/Kf_StepFoldinBillController.cs"
@@ -243,6 +243,16 @@
string HCloseDate = mainList[0].HCloseDate;
long HCurID = mainList[0].HCurID;
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ 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_StepFoldInBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_StepFoldInBillList");
if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板
@@ -255,22 +265,51 @@
,HDeleteMan,HCloseMan
,HRemark,HExplanation,HInnerBillNo,HCurID)
values(" + HInterID + ",'" + HBillNo + "','" + HDate + "','" + 1251 + "','" +
- HBillSubType + "'," + HBillStatus + "," + DateTime.Now.Year + "," + DateTime.Now.Month + "," + HSupID +
+ 1251 + "'," + 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 + "" + ")");
}
else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
{ //淇敼
+
+ DataSet dss;
+ dss = oCN.RunProcReturn("select * from h_v_IF_StepFoldInBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_StepFoldInBillList");
+ //鍒ゆ柇鏄惁鍙紪杈�
+ 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 + " where HInterID=" + HInterID;
oCN.RunProc(sql);
+
+ //鍒嗗竷寮忚皟鍏ュ崟 缂栬緫 鎾ら攢 鍥炲~鍒嗗竷寮忚皟鍑哄崟鍏宠仈鏁伴噺
+ oCN.RunProc("exec h_p_Kf_UpDateRelation_ICStockToPOStockIn_Del " + HInterID);
+
//鍒犻櫎瀛愯〃
oCN.RunProc("delete from Kf_ICStockBillSub where HInterID='" + HInterID + "'");
}
//淇濆瓨瀛愯〃
objJsonResult = AddBillSub(msg3, HInterID, OperationType);
+
+ //鍒嗗竷寮忚皟鍏ュ崟鏂板鍥炲~鍒嗗竷寮忚皟鍑哄崟鍏宠仈鏁伴噺
+ oCN.RunProc("exec h_p_Kf_UpDateRelation_ICStockToPOStockIn_Add " + HInterID);
if (objJsonResult.code == "0")
{
@@ -373,9 +412,26 @@
{
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("exec h_p_Kf_UpDateRelation_ICStockToPOStockIn_Del " + HInterID);
+
oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -431,9 +487,19 @@
return objJsonResult;
}
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ 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;
+ }
+
ClsPub.CurUserName = user;
BillOld.MvarItemKey = "Kf_ICStockBillMain";
-
ds = oCN.RunProcReturn("select * from Kf_ICStockBillMain where HInterID = " + int.Parse(HInterID), "Kf_ICStockBillMain");
string HBillNo = "";
@@ -451,10 +517,6 @@
{
HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
}
-
-
-
-
//Type 1 瀹℃牳 2 鍙嶅鏍�
if (Type == 1)
{
@@ -478,7 +540,6 @@
objJsonResult.data = null;
return objJsonResult;
}
-
if (!BillOld.CheckBill(int.Parse(HInterID), HBillNo, "h_p_Cg_POInStockBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
@@ -724,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();//鎻愪氦浜嬪姟
@@ -764,5 +889,43 @@
}
}
#endregion
+
+ #region 鍒嗘寮忚皟鍏ュ崟 鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栧垎甯冨紡璋冨嚭鍗曟暟鎹�
+ [Route("Kf_StepFoldInBill/loadKf_ICStockBillMain_Push")]
+ [HttpGet]
+ public object loadKf_ICStockBillMain_Push(long HInterID, long HSubID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select * from h_v_IF_StepFoldOutBillList where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_StepFoldOutBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌婧愬崟淇℃伅锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1