From 63fc13d046c10532f2c9c436beb997426a703f26 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 14 十一月 2023 17:51:31 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/LMESController.cs | 203 +++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 157 insertions(+), 46 deletions(-)
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 942bf90..69caa42 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -58,20 +58,35 @@
/// </summary>
[Route("LEMS/MES_Sc_ProcessExchangeBillQuery_Json")]
[HttpGet]
- public object MES_Sc_ProcessExchangeBillList_Json(string sWhere, string user)
+ public object MES_Sc_ProcessExchangeBillList_Json(string sWhere, string user,string HBillSubType)
{
DataSet ds;
try
{
List<object> columnNameList = new List<object>();
- //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
- if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
+ if (HBillSubType == "SUB")
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
- objJsonResult.data = null;
- return objJsonResult;
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_SubQuery", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎸囧紩鍗℃棤鏌ヨ鏉冮檺!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else {
+
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娴佽浆鍗℃棤鏌ヨ鏉冮檺!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
//鑾峰彇绯荤粺鍙傛暟
@@ -211,11 +226,21 @@
{
DataSet ds;
DataSet ds1;
+ DataSet ds2;
try
{
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎸囧紩鍗℃棤缂栬緫鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
var HNum = HInterID_S.Split(',');
- oCN.BeginTran();
+
for (int j = 0; j < HNum.Length; j++)
{
@@ -236,12 +261,21 @@
string HMaterID = ds.Tables[0].Rows[0]["HMaterID"].ToString();
string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
+ ds2 = oCN.RunProcReturn(@"select a.HMaterID,a.HMainProcID,b.* from Gy_RoutingBillMain a inner join Gy_RoutingBillSub b on a.HInterID=b.HInterID where a.HMaterID=" + HMaterID + " and a.HMainProcID=" + HProcID + " and a.HBillSubType='SUB'", "Gy_RoutingBillMain");
+ if (ds2.Tables[0].Rows.Count == 0)
+ {
+ long HGYInterID = DBUtility.ClsPub.CreateBillID("3301", ref DBUtility.ClsPub.sExeReturnInfo);
+ string HGYBillNo = DBUtility.ClsPub.CreateBillCode("3301", ref DBUtility.ClsPub.sExeReturnInfo, true);
+ oCN.RunProc("exec h_p_gy_Materl_PG " + HGYInterID + ",'" + HGYBillNo + "'," + HMaterID);
+ }
+
+
ds1 = oCN.RunProcReturn(@"select a.HMaterID,a.HMainProcID,b.* from Gy_RoutingBillMain a inner join Gy_RoutingBillSub b on a.HInterID=b.HInterID where a.HMaterID=" + HMaterID + " and a.HMainProcID=" + HProcID + " and a.HBillSubType='SUB'", "Gy_RoutingBillMain");
if (ds1.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁鐩稿搴旂殑榛樿宸ヨ壓璺嚎,璇峰厛璁剧疆宸ヨ壓璺嚎锛�";
+ objJsonResult.Message = "鏃犻粯璁ゅ伐鑹鸿矾绾匡紒";
objJsonResult.data = null;
return objJsonResult;
}
@@ -251,8 +285,11 @@
DBUtility.ClsPub.HOrgID = HOrgID;
oBill.ShowBill(HInterID, ref sReturn);
+ oCN.BeginTran();
+
long HInterID1 = DBUtility.ClsPub.CreateBillID(oBill.omodel.HBillType, ref DBUtility.ClsPub.sExeReturnInfo);
string HBillNo = DBUtility.ClsPub.CreateBillCode(oBill.omodel.HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
+ HBillNo = HBillNo.Replace("GXLX", "ZYK0");
oBill.omodel.HInterID = HInterID1;
oBill.omodel.HBillNo = HBillNo;
oBill.omodel.HBillSubType = "SUB";
@@ -285,7 +322,6 @@
oBill.DetailColl.Add(oSub);
}
-
bool bResult = false;
bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
@@ -300,9 +336,10 @@
objJsonResult.data = null;
return objJsonResult;
}
+ oCN.Commit();
}
- oCN.Commit();
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "娲惧伐鎴愬姛锛�";
@@ -330,6 +367,15 @@
DataSet ds1;
try
{
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎸囧紩鍗℃棤缂栬緫鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
var HNum = HInterID_S.Split(',');
oCN.BeginTran();
@@ -658,20 +704,38 @@
/// </summary>
[Route("LEMS/MES_Gy_RoutingBillList_Json")]
[HttpGet]
- public object MES_Gy_RoutingBillList_Json(string sWhere, string user)
+ public object MES_Gy_RoutingBillList_Json(string sWhere, string user,string HBillSubType)
{
DataSet ds;
try
{
- //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
- if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+ if (HBillSubType == "SUB")
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
- objJsonResult.data = null;
- return objJsonResult;
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺鏌ヨ!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
}
+ else {
+
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愭煡璇�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+
//鑾峰彇绯荤粺鍙傛暟
string Ret = "";
@@ -885,22 +949,37 @@
/// <returns></returns>
[Route("LEMS/DeltetGy_RoutingBillSub")]
[HttpGet]
- public object DeltetGy_RoutingBillSub(Int64 lngBillKey, string user)
+ public object DeltetGy_RoutingBillSub(Int64 lngBillKey, string user,string HBillSubType)
{
DataSet ds;
- string ModRightNameCheck = "Gy_RoutingBill_Drop";
+
try
{
- string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
- //鍒犻櫎鏉冮檺
- if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user))
+ if (HBillSubType == "SUB")
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触锛佹棤鏉冮檺锛�";
- objJsonResult.data = null;
- return objJsonResult;
+ //鍒犻櫎鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Drop", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀛愬伐鑹鸿矾绾垮垹闄ゅけ璐ワ紒鏃犳潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
+ else {
+ //鍒犻櫎鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Drop", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "宸ヨ壓璺嚎鍒犻櫎澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
+
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
if (lngBillKey == 0)
@@ -2191,19 +2270,35 @@
#region 宸ヨ壓璺嚎瀹℃牳/鍙嶅鏍稿姛鑳�
[Route("Gy_RoutingBill/CheckGy_RoutingBill")]
[HttpGet]
- public object CheckGy_RoutingBill(string HInterID, int Type, string user)
+ public object CheckGy_RoutingBill(string HInterID, int Type, string user,string HBillSubType)
{
try
{
- //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
- if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Check", 1, false, user))
+ if (HBillSubType == "SUB")
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳潈闄愬鏍�!";
- objJsonResult.data = null;
- return objJsonResult;
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Check", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
+ else
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Check", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愬鏍�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
if (string.IsNullOrWhiteSpace(HInterID))
{
@@ -2310,19 +2405,35 @@
#region 宸ヨ壓璺嚎鍗曞叧闂�/鍙嶅叧闂姛鑳�
[Route("Gy_RoutingBill/CloseGy_RoutingBill_1")]
[HttpGet]
- public object CloseGy_RoutingBill(string HInterID, int Type, string user)
+ public object CloseGy_RoutingBill(string HInterID, int Type, string user,string HBillSubType)
{
try
{
- //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
- if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Close", 1, false, user))
+ if (HBillSubType == "SUB")
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
- objJsonResult.data = null;
- return objJsonResult;
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Close", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺鍏抽棴!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
+ else
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Close", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愬叧闂�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
if (string.IsNullOrWhiteSpace(HInterID))
{
--
Gitblit v1.9.1