From 151a93d2dccb2043e1a97bcae51b0f91a3d4aff3 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 06 六月 2024 14:43:49 +0800
Subject: [PATCH] PDA扫码匹配设备档案,扫设备码时根据设备档案中的条形码匹配
---
WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs | 2
WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs | 2
WebAPI/Controllers/WebAPIController.cs | 57 ++++++++++++++++--
WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs | 64 +++++++++++++++++++++
WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs | 2
5 files changed, 116 insertions(+), 11 deletions(-)
diff --git a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
index fafe1d8..c083f5e 100644
--- a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
+++ b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
@@ -935,6 +935,68 @@
}
#endregion
-
+
+ #region 璁惧PDA妯″潡 鎵爜
+ [Route("Gy_EquipFileBill/txtHBarCode_KeyDown")]
+ [HttpGet]
+ public object txtHBarCode_KeyDown(string HBarCode, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ if (HBarCode == null || HBarCode.Equals(""))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏉$爜淇℃伅涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ string sql = "select * from h_v_Gy_EquipFileBill_KeyDown_PDA where 鏉″舰鐮� = '" + HBarCode + "'";
+ ds = oCN.RunProcReturn(sql, "锘縣_v_Gy_EquipFileBill_KeyDown_PDA");
+ }
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ //娣诲姞鍒楀悕
+ 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.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璁惧鏉$爜锛�" + HBarCode + " ,娌℃湁鍒涘缓姝よ澶囨。妗�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
}
}
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
index c8043de..e5c1dd5 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
@@ -473,7 +473,7 @@
return objJsonResult;
}
//寰楀埌淇℃伅
- ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_EquipFileMainList where 璁惧浠g爜= '" + HBarCode + "'", "h_v_Gy_EquipFileMainList");
+ ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_EquipFileMainList where 鏉″舰鐮�= '" + HBarCode + "'", "h_v_Gy_EquipFileMainList");
//鍐欏叆淇℃伅
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
index 9b7e312..8385d23 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
@@ -794,6 +794,6 @@
}
}
#endregion
-
+
}
}
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
index 718192f..e4c9062 100644
--- a/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
+++ b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
@@ -1315,7 +1315,7 @@
return objJsonResult;
}
//寰楀埌淇℃伅
- ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_EquipFileBillList where HEquipFileNumber= '" + HBarCode + "'", "Gy_EquipFileBillMain");
+ ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_EquipFileBillList where HBarCode= '" + HBarCode + "'", "Gy_EquipFileBillMain");
//鍐欏叆淇℃伅
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 4ffa124..e2c8636 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -12503,13 +12503,56 @@
try
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- string sql = string.Format(@"select b.HDotCheckItemID HDotCheckItemID,c.HNumber HDotCheckCode,b.HDotCheckItem,b.HDotCheckPart,b.HClaim,
- b.HManagerID,e.HNumber HManagerCode,e.HName HManagerName,b.HRemark from Sb_EquipDotCheckRuleBillMain a
- left join Sb_EquipDotCheckRuleBillSub b on a.HInterID=b.HInterID
- left join Gy_DotCheck c on c.HItemID=b.HDotCheckItemID
- left join Gy_Employee e on e.HItemID=b.HManagerID
- where a.HInterID=" + HDotCheckRuleInterID);
- ds = oCN.RunProcReturn(sql, "Sb_EquipDotCheckRuleBillMain");
+ string sql = string.Format(@"select * from h_v_Sb_EquipDotCheckRuleBillList_PDA where HInterID=" + HDotCheckRuleInterID);
+ ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleBillList_PDA");
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁璁惧淇濆吇瑙勭▼鏄剧ず璁惧淇濆吇绋嬮」鐩�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetMaintainItemByMaintainRuleID")]
+ [HttpGet]
+ public object GetMaintainItemByMaintainRuleID(int HEquipMaintainRuleInterID)
+ {
+ if (HEquipMaintainRuleInterID <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "璁惧淇濆吇瑙勭▼鏈�夋嫨";
+ objjson.data = null;
+ return objjson;
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = string.Format(@"select * from h_v_Sb_EquipMaintainRuleBillList_PDA where HInterID=" + HEquipMaintainRuleInterID);
+ ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainRuleBillList_PDA");
if (ds == null || ds.Tables[0].Rows.Count <= 0)
{
objjson.code = "0";
--
Gitblit v1.9.1