From 124dd32a34ced09ae87935e953dec6401d86f9ac Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期四, 26 十二月 2024 15:14:45 +0800
Subject: [PATCH] PDA扫码模块,根据条码删除缓存列表中对应条码记录调用方法修改,增加根据托条码删除对应记录
---
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs | 123 +++++++++++++++++++++++++++++++++++++----
1 files changed, 111 insertions(+), 12 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index daace44..e8ee20f 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -322,9 +322,23 @@
objJsonResult.data = null;
return objJsonResult;
}
-
+ string HProcID = "0";
ds = oCN.RunProcReturn("select * from gy_czygl WITH(NOLOCK) where czymc='" + user + "'", "gy_czygl");
- string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
+ }
+
+ //鍒ゆ柇褰撳墠娴佽浆鍗℃槸鍚︽槸寮�宸�
+ ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceBillNo='" + HBarCode + "' and HICMOStatus<>'0'", "Sc_ICMOBillStatus_Tmp");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗″彿:" + HBarCode + ",娴佽浆鍗℃湭寮�宸�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomList '" + HBarCode + "'," + HProcID, "h_p_Gy_BarCodeBillBomList");
if (ds.Tables[0].Rows.Count == 0)
@@ -732,8 +746,26 @@
try
{
ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "h_v_Gy_BarCodeBill");
+
+ //鍒ゆ柇鏉$爜鏄惁瀛樺湪鏉$爜妗f
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ string HSourceBillNo = ds.Tables[0].Rows[0]["HSourceBillNo"].ToString();
+ DataSet dataTable = oCN.RunProcReturn(@"select * from Sc_ProcessExchangeBillMain where HBillNo='" + HSourceBillNo + "'", "Sc_ProcessExchangeBillMain");
+ //鍒ゆ柇鏉$爜鐨勬簮鍗� 娴佽浆鍗℃槸鍚﹁鍒犻櫎
+ if (dataTable.Tables[0].Rows.Count == 0)
+ {
+ //濡傛灉婧愬崟宸茬粡鍒犻櫎 鍒欐潯鐮佷篃鍒犻櫎閲嶆柊鐢熸垚
+ oCN.RunProc("delete from Gy_BarCodeBill where HBarCode='" + HBarCode + "'");
+
+ //閲嶆柊鏌ヨ鏉$爜妗f 杩涘叆鏂板鏂规硶
+ ds = oCN.RunProcReturn(@"select * from Gy_BarCodeBill where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill");
+ }
+ }
+
if (ds.Tables[0].Rows.Count == 0)
{
+ //鍒ゆ柇闀垮害鏄惁涓�29浣� 鏃犲皹杞﹂棿
if (HBarCode.Length == 29)
{
string str1 = HBarCode.Substring(18, 8);
@@ -741,7 +773,7 @@
DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID
left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID
-where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID="+ HOrgID, "Sc_ProcessExchangeBillMain");
+where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain");
if (dataSet.Tables[0].Rows.Count == 0)
{
@@ -767,7 +799,33 @@
return get_HBardBillSave(HProcExchBillNo, HBarCode);
}
}
- else {
+ else
+ {
+ ClsPub.CurUserName = user;
+ //鏉$爜鐢熸垚
+ return get_HBardBillSave(HProcExchBillNo, HBarCode);
+ }
+ }
+ //鍒ゆ柇闀垮害鏄惁涓�50浣� 15杞﹂棿
+ else if (HBarCode.Length == 50)
+ {
+ string str1 = HBarCode.Substring(42, 8);
+
+ DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
+left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID
+left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID
+where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain");
+
+ if (dataSet.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏉$爜涓庢祦杞崱涓嶅瓨鍦ㄥ搴斿叧绯�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
ClsPub.CurUserName = user;
//鏉$爜鐢熸垚
return get_HBardBillSave(HProcExchBillNo, HBarCode);
@@ -783,19 +841,41 @@
}
}
else {
-
- string str1 = HBarCode.Substring(18, 8);
+ //鍒ゆ柇闀垮害鏄惁涓�29浣� 鏃犲皹杞﹂棿
+ if (HBarCode.Length == 29)
+ {
+ string str1 = HBarCode.Substring(18, 8);
- DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
+ DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID
left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID
where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain");
- if (dataSet.Tables[0].Rows.Count == 0)
- {
- str1 = HBarCode.Substring(23, 3);
+ if (dataSet.Tables[0].Rows.Count == 0)
+ {
+ str1 = HBarCode.Substring(23, 3);
- dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
+ dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
+left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID
+left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID
+where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain");
+
+ if (dataSet.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏉$爜涓庢祦杞崱涓嶅瓨鍦ㄥ搴斿叧绯�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ //鍒ゆ柇闀垮害鏄惁涓�50浣� 15杞﹂棿
+ else if (HBarCode.Length == 50)
+ {
+ string str1 = HBarCode.Substring(42, 8);
+
+ DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 鐗╂枡浠g爜,o.HNumber 缁勭粐浠g爜 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID
left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID
where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain");
@@ -944,7 +1024,7 @@
#region 宸ュ簭鍗曞搧杩囩珯 閰嶄欢鐮佹煡璇�
[Route("Cj_SingleStation/HBardCodeAccessoryList")]
[HttpGet]
- public object HBardCodeAccessoryList(string HBarCode, string user)
+ public object HBardCodeAccessoryList(string HBarCode, string HProcExchBillNo, string user,string HBillType)
{
try
{
@@ -977,6 +1057,25 @@
return objJsonResult;
}
+ DataSet dataSet = oCN.RunProcReturn(@"exec h_p_CJ_SNBarCodeBillMouldBathSelect '" + HBarCode + "','" + HProcExchBillNo + "','"+ HBillType + "'", "h_p_CJ_SNBarCodeBillMouldBathSelect");
+
+ if (dataSet.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "閰嶄欢鏉$爜鍒ゆ柇澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ClsPub.isStrNull(dataSet.Tables[0].Rows[0]["HBack"]) == "2")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.isStrNull(dataSet.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "";
--
Gitblit v1.9.1