From 549df1cac1529f4fc9b5d9b64e27de5d5d8b8951 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 22 十月 2025 13:53:41 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs | 226 +++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 199 insertions(+), 27 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
index 6f67eec..a3513f1 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -366,15 +366,34 @@
objJsonResult.data = null;
return objJsonResult;
}
- if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+ if (oSystemParameter.ShowBill(ref sReturn) == true)
{
- oCN.RollBack();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "[0000-2-015]" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
- objJsonResult.data = null;
- return objJsonResult;
+ if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�") //绯荤粺鍙傛暟 鍒ゆ柇瀹㈡埛
+ {
+ if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message =DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-2-015]" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
}
+
oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID + ",1");
//鍒ゆ柇鏄惁鏄� 棣栭亾宸ュ簭
ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a " +
@@ -389,7 +408,7 @@
}
- //=========================淇濆瓨鍚庢帶鍒�
+ //=========================淇濆瓨鍚庢帶鍒� ============================
DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Sc_StationInBill_AfterSaveCtrl");
if (ds2 == null)
{
@@ -410,7 +429,7 @@
objJsonResult.data = null;
return objJsonResult;
}
- //============================
+ //=======================================================
oCN.Commit();
@@ -832,6 +851,89 @@
}
#endregion
+ #region 杩斿洖宸ュ簭杩涚珯鎺ユ敹鍗曞垪琛�
+ [Route("Cj_StationInBill/get_Display_Eng")]
+ [HttpGet]
+ public object get_Display_Eng(string sWhere, string user, string HBillSubType)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ if (HBillSubType == "SUB")
+ {
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Sub_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "寮�宸ュ崟鏃犳煡璇㈡潈闄�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "杩涚珯鍗曟棤鏌ヨ鏉冮檺!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_MES_StationInBillList_Eng order by hmainid desc", "h_v_MES_StationInBillList_Eng");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_MES_StationInBillList_Eng where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by hmainid desc";
+ ds = oCN.RunProcReturn(sql, "h_v_MES_StationInBillList_Eng");
+ }
+
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+ //{
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ 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_StationInBill/get_Display_ByPage")]
[HttpGet]
@@ -908,8 +1010,9 @@
[HttpGet]
public object set_ShowBillJudge(string HBillNo)
{
+ string sReturn = "";
try
- {
+ {
ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_DelCtrl '" + HBillNo + "'", "h_p_MES_StationInBill_DelCtrl");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
@@ -938,11 +1041,34 @@
}
catch (Exception e)
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "[0000-1-038]Exception锛�" + e.ToString();
- objJsonResult.data = null;
- return objJsonResult;
+ if (oSystemParameter.ShowBill(ref sReturn) == true)
+ {
+ if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�") //绯荤粺鍙傛暟 鍒ゆ柇瀹㈡埛
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-038]Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-038]Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
}
#endregion
@@ -990,8 +1116,6 @@
{
try
{
- string ModRightNameCheck = "";
-
if (HBillSubType == "SUB")
{
//瀹℃牳鏉冮檺
@@ -1046,7 +1170,7 @@
return objJsonResult;
}
- //瀹℃牳鍓嶆帶鍒�
+ //瀹℃牳鍓嶆帶鍒�==========================================================================
string HBillNo = oBill.omodel.HBillNo;
string sql = "exec h_p_Sc_StationInBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'";
ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeCheckCtrl");
@@ -1067,7 +1191,7 @@
objJsonResult.data = null;
return objJsonResult;
}
-
+ //=============================================================================
//瀹℃牳
if (Cj_StationInBillCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
{
@@ -1127,7 +1251,7 @@
{
}
- //瀹℃牳鍚庢帶鍒�
+ //瀹℃牳鍚庢帶鍒�=======================================================
string sql = "exec h_p_Sc_StationInBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterCheckCtrl");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
@@ -1142,7 +1266,7 @@
oCN.RollBack();
return false;
}
-
+ //====================================================================
sReturn = sReturn + " 瀹℃牳鍔熻兘锛�";
oCN.Commit();
return true;
@@ -1220,7 +1344,7 @@
return objJsonResult;
}
- //鍙嶅鏍稿墠鎺у埗
+ //鍙嶅鏍稿墠鎺у埗=============================================================================
string HBillNo = oBill.omodel.HBillNo;
string sql = "exec h_p_Sc_StationInBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'";
ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeUnCheckCtrl");
@@ -1241,7 +1365,7 @@
objJsonResult.data = null;
return objJsonResult;
}
-
+ //============================================================================================
//鍙嶅鏍�
if (Cj_StationInBillAbandonCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
{
@@ -1305,7 +1429,7 @@
{
}
- //鍙嶅鏍稿悗鎺у埗
+ //鍙嶅鏍稿悗鎺у埗========================================================================
string sql = "exec h_p_Sc_StationInBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterUnCheckCtrl");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
@@ -1320,7 +1444,7 @@
oCN.RollBack();
return false;
}
-
+ //============================================================================================
sReturn = sReturn + "鍙嶅鏍稿姛鑳斤紒";
oCN.Commit();
return true;
@@ -1420,8 +1544,32 @@
return objJsonResult;
}
}
+ var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+
+ //鍏抽棴鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl " + HInterID + ",'" +HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:鍏抽棴鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
//鍏抽棴鍗曟嵁
- if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ if (!BillOld.CloseBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ShiftsBeginInfoBill_AfterCloseCtrl", user,ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -1447,8 +1595,32 @@
return objJsonResult;
}
}
+ var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+ //鍙嶅叧闂墠鎺у埗=========================================
+ string sql1 = "exec h_p_Sc_StationInBill_BeforeUnCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationInBill_BeforeUnCloseCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:鍙嶅叧闂墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
//鍙嶅叧闂崟鎹�
- if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ if (!BillOld.CancelClose(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationInBill_AfterUnCloseCtrl", user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
--
Gitblit v1.9.1