From 00e25e4a9c9bd2fc91558c3c1a68f47db6d08b1d Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期一, 08 七月 2024 18:57:35 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs | 99 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 90 insertions(+), 9 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs
index 50923f1..2891ac6 100644
--- a/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_SeOutStockBillController.cs
@@ -75,6 +75,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBillQuery", 1, false, user))
{
@@ -95,6 +96,12 @@
string sql = sql1 + sWhere+ " order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_IF_SeOutStockBillList");
}
+ 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)
//{
@@ -102,6 +109,8 @@
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;// 灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
+
return objJsonResult;
//}
//else
@@ -128,7 +137,7 @@
/// <returns></returns>
[Route("Xs_SeOutStockBill/DeltetSeOutStockBill")]
[HttpGet]
- public object DeltetSeOutStockBill(string HInterID,string user)
+ public object DeltetSeOutStockBill(string HInterID, string HsupId, string HQty, string HSourceInterID, string HSourceEntryID, string user)
{
try
{
@@ -142,8 +151,21 @@
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;
+ }
+
oCN.BeginTran();
var ds = oCN.RunProcReturn("select * from Xs_SeOutStockBillMain where HInterID=" + HInterID, "Xs_SeOutStockBillMain");
+ //鍒犻櫎鎾ら攢 鍙戣揣閫氱煡鍗� 鍙嶅啓 閿�鍞鍗�
+ oCN.RunProcReturn("exec h_p_Xs_SeOutStockBillMain_Delete " + HInterID, "h_p_Xs_SeOutStockBillMain_Delete");
//鍒犻櫎鍓嶆帶鍒�
DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Xs_SeOutStockBill_BeforeDelCtrl");
if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
@@ -285,7 +307,7 @@
long HConveyCompID = mainList[0].HConveyCompID;//杩愯緭鍏徃
long HConveyMoney = (long)mainList[0].HConveyMoney;//杩愯垂
long HDFflag = Convert.ToInt32(mainList[0].HDFflag); //鏄惁鍨粯
-
+ long HProjectID = mainList[0].HProjectID;//宸ョ▼椤圭洰
string HBillType = mainList[0].HBillType;
string HBillSubType = mainList[0].HBillSubType;
@@ -311,8 +333,16 @@
ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_SeOutStockBillList");
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ 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;
+ }
-
if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板
{
@@ -346,36 +376,63 @@
,HAddress,HSSID,HCurID,HWHID,HExRate,HEmpID,HExplanation,HInnerBillNo,HSeOrderBillNo_M
,HConveyTypeID,HConveyCompID,HConveyMoney,HLinkMan,HLinkPhone
,HSALEORGID,HDELIVERYORGID,HOWNERID,HOWNERTYPEID
- ,HChecker,HCheckDate,HCloseMan,HCloseDate,HERPInterID,HERPBillType,HDFflag)
+ ,HChecker,HCheckDate,HCloseMan,HCloseDate,HERPInterID,HERPBillType,HDFflag,HProjectID)
values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1402 + "','" +
1402 + "','" + HDate + "','" + HBillNo + "'," + HBillStatus + "," + HCusID +
"," + HManagerID + "," + HDeptID + ",'" + HRemark + "','" + HMaker + "','" + HMakeDate +
"','" + HAddress + "'," + HSSID + "," + HCurID + "," + HWHID + "," + HExRate + "," + HEmpID + ",'" +
HExplanation + "','" + HInnerBillNo + "','" + HSeOrderBillNo_M + "','" + HConveyTypeID + "','" + HConveyCompID + "','" + HConveyMoney + "','" + HLinkMan + "','" + HLinkPhone + "'," + HSALEORGID + "," + HDELIVERYORGID + "," + HOWNERID + ",'"
+ HOWNERTYPEID + "','" + HChecker + "','" + HCheckDate + "','" + HCloseMan + "','" + HCloseDate + "'," + HERPInterID +
- ",'" + HERPBillType + "'," + HDFflag + ")";
+ ",'" + HERPBillType + "'," + HDFflag + ",'"+ HProjectID + "')";
oCN.RunProc(sql);
}
else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
{ //淇敼
+
+ DataSet dss;
+ dss = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_SeOutStockBillList");
+ //鍒ゆ柇鏄惁鍙紪杈�
+ 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 Xs_SeOutStockBillMain set " +
"HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" +
",HCusID='" + HCusID + "', HCurID='" + HCurID + "', HWHID = '" + HWHID
+ "',HExRate='" + HExRate + "',HEmpID='" + HEmpID + "',HSeOrderBillNo_M='" + HSeOrderBillNo_M + "',HManagerID='" + HManagerID + "',HDeptID='" + HDeptID + "',HOWNERID='" + HOWNERID
- + "',HAddress='" + HAddress + "' where HInterID=" + HInterID;
+ + "',HAddress='" + HAddress + "',HProjectID='"+ HProjectID + "' where HInterID=" + HInterID;
oCN.RunProc(sql);
+
+ //鍒犻櫎 鎾ら攢鍙戣揣閫氱煡鍗� 鍙嶅啓 閿�鍞鍗�
+ oCN.RunProcReturn("exec h_p_Xs_SeOutStockBillMain_Delete " + HInterID, "h_p_Xs_SeOutStockBillMain_Delete");
//鍒犻櫎瀛愯〃
oCN.RunProc("delete from Xs_SeOutStockBillSub where HInterID='" + HInterID + "'");
}
//淇濆瓨瀛愯〃
- objJsonResult = AddBillSub(msg3, HInterID, OperationType);
+ objJsonResult = AddBillSub(msg3, HInterID, OperationType,user);
+
+ //鍙戣揣閫氱煡鐨� 鍙嶅啓 鏁伴噺鍒� 閿�鍞鍗� 鍏宠仈鏁伴噺
+ oCN.RunProcReturn("exec h_p_Xs_SeOutStockBillMain " + HInterID, "h_p_Xs_SeOutStockBillMain");
//淇濆瓨鍚庢帶鍒�=========================================
- ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Xs_SeOutStockBill_AfterSaveCtrl");
+ ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Xs_SeOutStockBill_AfterSaveCtrl");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
@@ -420,7 +477,7 @@
}
}
- public json AddBillSub(string msg3, long HInterID, int OperationType)
+ public json AddBillSub(string msg3, long HInterID, int OperationType,string user)
{
List<ClsXs_SeOutStockBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsXs_SeOutStockBillSub>>(msg3);
@@ -484,6 +541,7 @@
,{oSub.HAuxPropID},'{oSub.HBatchNO}','{oSub.HMTONo}',{oSub.HERPInterID},{oSub.HERPEntryID})";
oCN.RunProc(sql);
+
}
objJsonResult.code = "1";
@@ -958,6 +1016,18 @@
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;
+ }
+
if (!BillOld.CheckBill(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
@@ -991,6 +1061,17 @@
}
}
+ //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+ 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;
+ }
+
if (BillOld.AbandonCheck(int.Parse(HInterID), BillOld.omodel.HBillNo, "h_p_Xs_SeOutStockBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
--
Gitblit v1.9.1