From 1fde6fd8aaf744e5c8e94894f077b872fa202d7d Mon Sep 17 00:00:00 2001 From: YL <YL@LAPTOP-SE03PLUR> Date: 星期三, 08 九月 2021 08:29:45 +0800 Subject: [PATCH] 报工台上料防错扫码接口判断获取备料信息 --- WebAPI/Controllers/PublicPageMethodController.cs | 669 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 669 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs index 6c97202..2ec055e 100644 --- a/WebAPI/Controllers/PublicPageMethodController.cs +++ b/WebAPI/Controllers/PublicPageMethodController.cs @@ -2322,5 +2322,674 @@ #endregion + #region 閫夋嫨宸ヨ壓璺嚎鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ宸ヨ壓璺嚎鍒楄〃 + [Route("PublicPageMethod/RouteList")] + [HttpGet] + public object RouteList(string sWhere) + { + try + { + ds = oCN.RunProcReturn("select HItemID,'' HParentID,HNumber,HName from h_v_IF_MouldRouting " + sWhere + " Order by HItemID ", "h_v_IF_MouldRouting"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲伐鑹鸿矾绾挎暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 + + #endregion + + #region 閫夋嫨BOM缁勫熀纭�璧勬枡 + + #region 鏉′欢鏌ヨBOM缁勫垪琛� + [Route("PublicPageMethod/BomGroupList")] + [HttpGet] + public object BomGroupList(string sWhere) + { + try + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_ICBomGroup " + sWhere + " Order by HItemID ", "Gy_ICBomGroup"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃燘OM鏁版嵁锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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鏌ユ壘BOM缁勫垪琛� + [Route("Gy_MaintenanceMode/BomGroupCX")] + [HttpGet] + public object BomGroupCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_ICBomGroup WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_ICBomGroup AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_ICBomGroup"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 鏍戝瀷鍒楄〃BOM缁勫垪琛ㄦ暟鎹� + [Route("Gy_MaintenanceMode/BomGroupLoadTree")] + [HttpGet] + public object BomGroupLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_ICBomGroup " + sWhere + "", "Gy_ICBomGroup"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃燘OM鏁版嵁锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨浠撲綅缁勫熀纭�璧勬枡 + + #region 鏉′欢鏌ヨ浠撲綅缁勫垪琛� + [Route("PublicPageMethod/HSPGroupList")] + [HttpGet] + public object HSPGroupList(string sWhere) + { + try + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_StockPlaceGroup " + sWhere + " Order by HItemID ", "Gy_StockPlaceGroup"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱粨浣嶇粍鏁版嵁锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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("Gy_MaintenanceMode/HSPGroupCX")] + [HttpGet] + public object HSPGroupCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_StockPlaceGroup WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_StockPlaceGroup AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_StockPlaceGroup"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 鏍戝瀷鍒楄〃浠撲綅缁勫垪琛ㄦ暟鎹� + [Route("Gy_MaintenanceMode/HSPGroupLoadTree")] + [HttpGet] + public object HSPGroupLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_StockPlaceGroup " + sWhere + "", "Gy_StockPlaceGroup"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱粨浣嶇粍鏁版嵁锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨鍦板尯鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ鍦板尯鍒楄〃 + [Route("PublicPageMethod/AreaList")] + [HttpGet] + public object AreaList(string sWhere) + { + try + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_AreaSet " + sWhere + " Order by HItemID ", "Gy_AreaSet"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲湴鍖烘暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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("Gy_MaintenanceMode/AreaCX")] + [HttpGet] + public object AreaCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_AreaSet WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_AreaSet AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_AreaSet"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 鏍戝瀷鍒楄〃鍦板尯鍒楄〃鏁版嵁 + [Route("Gy_MaintenanceMode/AreaLoadTree")] + [HttpGet] + public object AreaLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_AreaSet " + sWhere + "", "Gy_AreaSet"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱粨浣嶇粍鏁版嵁锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨璐у竵鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ璐у竵鍒楄〃 + [Route("PublicPageMethod/CurrencyList")] + [HttpGet] + public object CurrencyList(string sWhere) + { + try + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Currency " + sWhere + " Order by HItemID ", "Gy_Currency"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犺揣甯佹暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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("Gy_MaintenanceMode/CurrencyCX")] + [HttpGet] + public object CurrencyCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_Currency WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_Currency AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Currency"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 鏍戝瀷鍒楄〃璐у竵鍒楄〃鏁版嵁 + [Route("Gy_MaintenanceMode/CurrencyLoadTree")] + [HttpGet] + public object CurrencyLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_Currency " + sWhere + "", "Gy_Currency"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犺揣甯佹暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨缁撶畻鏂瑰紡鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ缁撶畻鏂瑰紡鍒楄〃 + [Route("PublicPageMethod/SettleStyleList")] + [HttpGet] + public object SettleStyleList(string sWhere) + { + try + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_SettleStyle " + sWhere + " Order by HItemID ", "Gy_SettleStyle"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犵粨绠楁柟寮忔暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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("Gy_MaintenanceMode/SettleStyleCX")] + [HttpGet] + public object SettleStyleCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_SettleStyle WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_SettleStyle AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_SettleStyle"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 鏍戝瀷鍒楄〃缁撶畻鏂瑰紡鍒楄〃鏁版嵁 + [Route("Gy_MaintenanceMode/SettleStyleLoadTree")] + [HttpGet] + public object SettleStyleLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_SettleStyle " + sWhere + "", "Gy_SettleStyle"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犺揣甯佹暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 閫夋嫨瀹㈡埛鍒嗙被鍩虹璧勬枡 + + #region 鏉′欢鏌ヨ瀹㈡埛鍒嗙被鍒楄〃 + [Route("PublicPageMethod/CusTypeList")] + [HttpGet] + public object CusTypeList(string sWhere) + { + try + { + ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_CusType " + sWhere + " Order by HItemID ", "Gy_CusType"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲鎴峰垎绫绘暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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("Gy_MaintenanceMode/CusTypeCX")] + [HttpGet] + public object CusTypeCX(long HInterID) + { + try + { + + ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_CusType WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_CusType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_CusType"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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 鏍戝瀷鍒楄〃瀹㈡埛鍒嗙被鍒楄〃鏁版嵁 + [Route("Gy_MaintenanceMode/CusTypeLoadTree")] + [HttpGet] + public object CusTypeLoadTree(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + + ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_CusType " + sWhere + "", "Gy_CusType"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲鎴峰垎绫绘暟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + #endregion + + #endregion } } -- Gitblit v1.9.1