From 220dfd5d0edd5867a22737c1db922555fc697746 Mon Sep 17 00:00:00 2001 From: ch <37327@LLOOCCY> Date: 星期二, 23 十一月 2021 16:44:08 +0800 Subject: [PATCH] 新增了LMES快速条码打印模块 --- WebAPI/Controllers/WebAPIController.cs | 245 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 227 insertions(+), 18 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index e783b85..a693ef5 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -83,10 +83,11 @@ /// </summary> /// <param name="UserName">鐢ㄦ埛鍚�</param> /// <param name="PassWord">瀵嗙爜</param> + /// <param name="PassWord">缁勭粐</param> /// <returns></returns> [Route("Web/GetUser")] [HttpGet] - public object GetUser(string UserName, string PassWord) + public object GetUser(string UserName, string PassWord, string HOrgName) { try { @@ -102,14 +103,24 @@ objjson.data = null; return objjson; } - else + string sql = string.Format(@" select a.* from Gy_UserByOrgRelation a + where a.HUserID = '{0}' and a.HOrgID = '{1}'", UserName, HOrgName); + DataSet _ds = oCnLoc.RunProcReturn(sql, "h_p_Xt_UserRelationOrg_Check"); + if (_ds == null || _ds.Tables[0].Rows.Count == 0) { objjson.code = "0"; - objjson.count = 1; - objjson.Message = "鐧诲綍鎴愬姛锛�"; - objjson.data = ds.Tables[0]; + objjson.count = 0; + objjson.Message = "鐢ㄦ埛" + UserName + "娌℃湁璇ョ粍缁囨潈闄�"; + objjson.data = null; return objjson; } + + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鐧诲綍鎴愬姛锛�"; + objjson.data = ds.Tables[0]; + return objjson; + } catch (Exception) { @@ -1281,7 +1292,7 @@ { //sWhere = " Where HStopFlag=0 and HEndFlag=1"; //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); - if (BadReason != ""&& BadReason != null) + if (BadReason != "" && BadReason != null) { sWhere = sWhere + " and ( HNumber like '%" + BadReason + "%' or HName like '%" + BadReason + "%' ) "; } @@ -1737,9 +1748,9 @@ sWhere = " Where HStopFlag=0 and HEndFlag=1"; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); - if (CheckItem != ""&& CheckItem!=null) + if (CheckItem != "" && CheckItem != null) { - sWhere = sWhere + " and ( HNumber like '%" + CheckItem + "%' or HName like '%" + CheckItem + "%' ) "; + sWhere = sWhere + " and ( HNumber like '%" + CheckItem + "%' or HName like '%" + CheckItem + "%' ) "; ds = oCN.RunProcReturn("Select HItemID,HNumber,HName from Gy_DotCheck " + sWhere + " Order by HItemID ", "Gy_DotCheck"); } else @@ -1782,7 +1793,7 @@ /// <returns></returns> [Route("Web/GetSc_ICMOBillListView")] [HttpGet] - public object GetSc_ICMOBillListView(string ICMOBill,int OrganizationID) + public object GetSc_ICMOBillListView(string ICMOBill, int OrganizationID) { if (ICMOBill != "") { @@ -1797,7 +1808,7 @@ } else { - string sql = "select * from h_v_IF_ICMOBillList "+ sWhere+ " and isnull(瀹℃牳浜�,'')<>'' and isnull(鍏抽棴浜�,'')='' and isnull(琛屽叧闂汉,'')='' order by 鍗曟嵁鍙� desc,hsubid "; + string sql = "select * from h_v_IF_ICMOBillList " + sWhere + " and isnull(瀹℃牳浜�,'')<>'' and isnull(鍏抽棴浜�,'')='' and isnull(琛屽叧闂汉,'')='' order by 鍗曟嵁鍙� desc,hsubid "; ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOBillList"); } if (ds == null || ds.Tables[0].Rows.Count <= 0) @@ -1937,7 +1948,7 @@ /// <returns></returns> [Route("Web/GetGy_QCCheckItem")] [HttpGet] - public object GetGy_QCCheckItem(string CheckItem,int OrganizationID) + public object GetGy_QCCheckItem(string CheckItem, int OrganizationID) { if (CheckItem != "") { @@ -2075,6 +2086,204 @@ } /// <summary> + /// 鏍规嵁鍣ㄥ叿涓诲唴鐮佽幏鍙栧櫒鍏蜂繚鍏绘楠岄」鐩� + /// </summary> + /// <returns></returns> + [Route("Web/GetMaintainItemtemByMouldProjectID")] + [HttpGet] + public object GetMaintainItemtemByMouldProjectID(int MouldProjectID) + { + if (MouldProjectID <= 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 t.HMaintainItemID HMaintainItemID,m.HNumber HMaintainItemNumber,t.HMaintainItem HMaintainItem,t.HMaintainPart HMaintainPart,t.HClaim HClaim,t.HManagerID HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark + from Sc_MouldMaintainRuleBillMain a left join Sc_MouldMaintainRuleBillSub_Item t on a.HInterID=t.HInterID + left join Gy_Maintain m on m.HItemID=t.HMaintainItemID + left join Gy_Employee e on e.HItemID=t.HManagerID + where a.HInterID=(select HMouldMaintainRuleInterID from Gy_MouldFileMain where HInterID=" + MouldProjectID + ") "); + ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainRuleBillMain"); + 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("Sc_MouldDotCheckRuleInter/GetMouldDotCheckRuleInterList")] + [HttpGet] + public object GetMouldDotCheckRuleInterList(string sWhere) + { + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql = string.Format(@"select * from h_v_Sc_MouldDotCheckRuleBillList "); + ds = oCN.RunProcReturn(sql+sWhere, "h_v_Sc_MouldDotCheckRuleBillList"); + 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/GetMaintainItemtemByEquipProjectID")] + [HttpGet] + public object GetMaintainItemtemByEquipProjectID(int EquipProjectID) + { + if (EquipProjectID <= 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 t.HMaintainItemID HMaintainItemID,m.HNumber HMaintainItemNumber,t.HMaintainItem HMaintainItem,t.HMaintainPart HMaintainPart,t.HClaim HClaim,t.HManagerID HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark + from Sb_EquipMaintainRuleBillMain a left join Sb_EquipMaintainRuleBillSub_Item t on a.HInterID=t.HInterID + left join Gy_Maintain m on m.HItemID=t.HMaintainItemID + left join Gy_Employee e on e.HItemID=t.HManagerID + where a.HInterID=(select HEquipMaintainRuleInterID from Gy_EquipFileBillMain where HInterID=" + EquipProjectID + ") "); + ds = oCN.RunProcReturn(sql, "Sb_EquipMaintainRuleBillMain"); + 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/GetDotCheckRuleItemByEquipProjectID")] + [HttpGet] + public object GetDotCheckRuleItemByEquipProjectID(int EquipProjectID) + { + if (EquipProjectID <= 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 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_QCCheckItem c on c.HItemID=b.HDotCheckItemID + left join Gy_Employee e on e.HItemID=b.HManagerID + where a.HInterID=(select HEquipDotCheckRuleInterID from Gy_EquipFileBillMain where HInterID=" + EquipProjectID + ") "); + ds = oCN.RunProcReturn(sql, "Sb_EquipDotCheckRuleBillMain"); + 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> @@ -2132,7 +2341,7 @@ /// <returns></returns> [Route("Web/GetWMSBarCodeDetailsList")] [HttpGet] - public object GetWMSBarCodeDetailsList(int HInterID,string HBillType) + public object GetWMSBarCodeDetailsList(int HInterID, string HBillType) { try { @@ -2214,32 +2423,32 @@ //string json = JsonConvert.SerializeObject(dd); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //杩欓噷鏄惊鐜墍鏈� { - if (ds.Tables[0].Rows[i]["HPartentID"].ToString()=="0" || ds.Tables[0].Rows[i]["HitemID"].ToString() == ds.Tables[0].Rows[i]["HPartentID"].ToString()) //鍒ゆ柇鏄惁鏈�澶栧眰鏍硅妭鐐� + if (ds.Tables[0].Rows[i]["HPartentID"].ToString() == "0" || ds.Tables[0].Rows[i]["HitemID"].ToString() == ds.Tables[0].Rows[i]["HPartentID"].ToString()) //鍒ゆ柇鏄惁鏈�澶栧眰鏍硅妭鐐� { Menu tbj = new Menu(); tbj.HitemID = ds.Tables[0].Rows[i]["HitemID"].ToString(); tbj.HNumber = ds.Tables[0].Rows[i]["HNumber"].ToString(); tbj.HName = ds.Tables[0].Rows[i]["HName"].ToString(); - tbj.HPartentID =ds.Tables[0].Rows[i]["HPartentID"].ToString(); + tbj.HPartentID = ds.Tables[0].Rows[i]["HPartentID"].ToString(); tbj.HLevel = int.Parse(ds.Tables[0].Rows[i]["HLevel"].ToString()); tbj.Hurl = ds.Tables[0].Rows[i]["Hurl"].ToString(); mu.Add(tbj); } } ToHierarchy.digui(ds.Tables[0], mu); - + objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; - objJsonResult.data =Newtonsoft.Json.JsonConvert.SerializeObject(mu); + objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; + objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(mu); return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍒犻櫎澶辫触锛�"; + objJsonResult.Message = "鏌ヨ澶辫触锛�"; objJsonResult.data = e.ToString(); return objJsonResult; } -- Gitblit v1.9.1