From 80263c36e73042b5e30ce4dfcb89ee0eca0e9229 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 25 十二月 2023 14:26:20 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 205 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 21186e1..6267b43 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -1618,6 +1618,63 @@
}
#endregion
+ #region 宸ュ簭鍑虹珯姹囨姤鍗� 瀛愯〃鏌ヨ
+ [Route("Cj_StationOutBill/get_SubDisplay")]
+ [HttpGet]
+ public object get_SubDisplay(string sWhere, string TableName)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ string sql = "";
+
+ switch (TableName)
+ {
+ case "TechParam":
+ sql = "select * from h_v_Sc_StationOutBillSubQuery_TechParam where 1 = 1 and HInterID=" + sWhere;
+ break;
+ case "Note":
+ sql = "select * from h_v_Sc_StationOutBillSubQuery_Note where 1 = 1 and HInterID=" + sWhere;
+ break;
+ case "SN":
+ sql = "select * from h_v_Sc_StationOutBillSubQuery_SN where 1 = 1 and HInterID=" + sWhere;
+ break;
+ case "Emp":
+ sql = "select * from h_v_Sc_StationOutBillSubQuery_Emp where 1 = 1 and HInterID=" + sWhere;
+ break;
+
+ }
+
+ ds = oCN.RunProcReturn(sql, TableName);
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ 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
+
#region 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭�
[Route("Cj_StationOutBill/GetStationOutBill")]
[HttpGet]
@@ -2060,6 +2117,27 @@
objJsonResult.data = null;
return objJsonResult;
}
+ //鍒犻櫎鍓嶅垽鏂湁娌℃湁鐢熸垚閲戣澏鍗曟嵁锛堢敓浜ф眹鎶ュ崟锛岀敓浜у叆搴撳崟锛�
+ ds = oCn.RunProcReturn($"exec h_p_Cj_StationOutBill_BeforeDelCtrl {HInterID}", "h_p_Cj_StationOutBill_BeforeDelCtrl");
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍑虹珯姹囨姤鍗曞彂鐢熷紓甯革紝娌℃湁浠讳綍杩斿洖璁板綍锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ if (ds.Tables[0].Rows[0]["HBackCount"].ToString() == "1")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = ds.Tables[0].Rows[0]["HRemarkBack"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
{
@@ -2103,6 +2181,133 @@
}
#endregion
+ #region 鏍规嵁id鍒犻櫎鍑虹珯鍗� 瀛愪欢鏉$爜
+ [Route("Cj_StationOutBill/del_StationOutBill_SN")]
+ [HttpGet]
+ public object del_StationOutBill_SN(long HInterID,string HBardcode, string HDeleteMan, string HBillSubType)
+ {
+ try
+ {
+ string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
+ if (HBillSubType == "SUB")
+ {
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Drop", 1, false, HDeleteMan))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹屽伐鍗曟棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Drop", 1, false, HDeleteMan))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍑虹珯鍗曟棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ string sReturn = "";
+ if (oSystemParameter.ShowBill(ref sReturn))
+ {
+ if (oSystemParameter.omodel.MES_StationOutBill_DeleteCtl == "Y")
+ {
+ if (oBill.omodel.HMaker != HDeleteMan && (HDeleteMan != "admin" && HDeleteMan != "Admin"))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+
+
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ DataSet ds;
+ //鍒ゆ柇鏄惁瀛樺湪 鐩稿悓鍗曟嵁鍙� 鐨勯鏂欏崟 鍒ゆ柇鐢熶骇璁㈠崟鏄惁宸茬粨妗堬紝瑕佹眰璁″垝鎵嬪伐鍙嶇粨妗�
+ ds = oCn.RunProcReturn("exec h_p_MES_StationOutBill_DelCtrl '" + oBill.omodel.HBillNo + "'", "h_p_MES_StationOutBill_DelCtrl");
+ if (ds == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒ゆ柇鍏宠仈澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HChecker != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = oCn.RunProcReturn($"exec h_p_DelOutInBill {HInterID},'MES_StationOutBill_DeleteRelationCtl'", "h_p_DelOutInBill");
+
+ if (ds.Tables[0].Rows[0][0].ToString() == "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绯荤粺鍙傛暟鎺у埗,宸叉湁涓嬮亾宸ュ簭,涓嶈兘鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCn.BeginTran();
+
+ oCn.RunProc("delete from Sc_StationOutBillSub_SN where HInterID="+ HInterID+ " and HBarCode='"+ HBardcode + "'");
+
+ oCn.Commit();
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈壘鍒帮紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "寮傚父锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 鏍规嵁鍗曟嵁鍙� 鍚屾鎶ラ敊鍒犻櫎鍑虹珯鍗�
[Route("Cj_StationOutBill/DelStationOutBill")]
[HttpGet]
--
Gitblit v1.9.1