From 4b878755c446c957608065c11d2f5f31edbba072 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期五, 22 三月 2024 10:25:33 +0800 Subject: [PATCH] 工序流转卡:反作废是判断生产订单下推的流转卡总数量是否超出计划数量 --- WebAPI/Controllers/WebAPIController.cs | 89 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 84 insertions(+), 5 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index abc503b..d6ccfb0 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -143,6 +143,56 @@ } } + /// <summary> + /// 鑷姩鑾峰彇鍩虹璧勬枡 娴佹按鍙� 灏辨槸浠g爜 + /// </summary> + /// <param name="HBillType"></param> + /// <returns></returns> + [Route("Web/GetMAXNumber")] + [HttpGet] + public object GetMAXNumber(string HBillType,string HName,string TableName) + { + try + { + string HNumber = ""; + HNumber = DBUtility.ClsPub.CreateHNumber(HBillType,HName, TableName, ref DBUtility.ClsPub.sExeReturnInfo, true); + //----------鍒涘缓铏氳〃------------------------ + DataTable dt_Main = new DataTable("Json"); + dt_Main.Columns.Add("HNumber", typeof(string)); + + //---------鍒涘缓鏂拌------------------------ + DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 + dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑 + dr_main["HNumber"] = DBUtility.ClsPub.isStrNull(HNumber); + + + if (HNumber == null) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触"; + objjson.data = null; + return objjson; + } + else + { + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛"; + objjson.data = dt_Main; + return objjson; + } + } + catch (Exception e) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + e.ToString(); + objjson.data = null; + return objjson; + } + } + //[Route("Web/Get_MaxBillNoAndID")] //[HttpGet] @@ -8109,14 +8159,34 @@ return objJsonResult; } oCN.BeginTran();//寮�濮嬩簨鍔� + ds = oCN.RunProcReturn("select * from Gy_ProjectMoney where HItemID=" + HItemID, "Gy_ProjectMoney"); - if (ds == null || ds.Tables[0].Rows.Count == 0) + if (ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + else { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒"; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; objJsonResult.data = null; - return objJsonResult; ; + return objJsonResult; } @@ -10050,7 +10120,7 @@ /// <returns></returns> [Route("Web/GetEquipmentBillsList")] [HttpGet] - public object GetEquipmentBillsList(string sWhere, string Type) + public object GetEquipmentBillsList(string sWhere, string Type,string user) { try { @@ -10065,7 +10135,7 @@ HView = "h_v_Sb_EquipMaintainBillList"; break; case "WX": - HView = "h_v_Sb_EquipRepairCheckBillList"; + HView = "h_v_Sb_EquipRepairWorkBillList"; break; case "GZ": HView = "h_v_Sb_EquipConkBookBillList"; @@ -10082,6 +10152,15 @@ } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl"); + if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"]) //鏄惁绠$悊鍛� + { + //涓嶆槸绠$悊鍛� + sWhere += " and 鍒跺崟浜� = '" + user + "'"; + } + + string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere); ds = oCN.RunProcReturn(sql, HView); //娣诲姞鍒楀悕 -- Gitblit v1.9.1