From 1549aca4567113f86f3bc62ee6e9f08b2ed19afd Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期五, 26 四月 2024 14:19:46 +0800 Subject: [PATCH] 计划平台优化 --- WebAPI/Controllers/ReportPlatFormController.cs | 233 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 218 insertions(+), 15 deletions(-) diff --git a/WebAPI/Controllers/ReportPlatFormController.cs b/WebAPI/Controllers/ReportPlatFormController.cs index 0a289e3..5a410a8 100644 --- a/WebAPI/Controllers/ReportPlatFormController.cs +++ b/WebAPI/Controllers/ReportPlatFormController.cs @@ -15,6 +15,48 @@ private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + + + #region 鎶ュ伐骞冲彴鏍规嵁璐d换浜虹瓫閫夊姞杞借祫婧愬垪琛� + [Route("ReportPlatForm/SearchGetLineBindBillList")] + [HttpGet] + public object SearchGetLineBindBillList(string HUserName) + { + try + { + //鏍规嵁閫夋嫨璧勬簮ID鑾峰彇褰撳墠鐢熶骇宸ュ崟銆佽矗浠讳汉 + ds = oCN.RunProcReturn("exec h_p_JIT_GetSourceInfoByUser " + HUserName + "", "h_p_JIT_GetSourceInfoByUser"); + if (ds.Tables[0].Rows.Count > 0) + { + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇璧勬簮缁戝畾鏁版嵁鎴愬姛锛�"; + objJsonResult.data = ds; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏆傛棤璧勬簮缁戝畾锛�"; + objJsonResult.data = ds; + return objJsonResult; + } + } + catch (Exception e) + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.Message.ToString(); + objJsonResult.data = null; + + } + return objJsonResult; + } + #endregion #region 鎶ュ伐骞冲彴璧勬簮淇濆瓨 /// <summary> @@ -23,24 +65,37 @@ /// <param name="msg"></param> /// <returns></returns> [Route("ReportPlatForm/SaveGetLineBindBillList")] - [HttpPost] - public object SaveGetLineBindBillList(string HUserName,string HSourceID,string HSourceName,string HManagerID,string HManagerName,string HGroupID,string HGroupName,string HCreateDate,string HRemark) + [HttpGet] + public object SaveGetLineBindBillList(string HUserName, string HSourceID, string HSourceName, string HManagerID, string HManagerName, string HGroupID, string HGroupName, string HCreateDate, string HRemark) { - + try { - oCN.BeginTran(); - //鍐欏叆浜х嚎缁戝畾 - string sql = string.Format(@"insert into Gy_SourceRelationSet (HSourceID,HUserName,HGroupID,HManagerID,HRemark,HCreateDate,HCreator,HNowFlag) - values('"+HSourceID+"','"+HUserName+"','"+HGroupID+"','"+HManagerID+"','"+HRemark+"','"+DateTime.Parse(HCreateDate).ToShortDateString()+ "','"+HUserName+"','1')"); - oCN.RunProc(sql); + ds = oCN.RunProcReturn("select * from Gy_SourceRelationSet where HSourceID='" + HSourceID + "' and HUserName='" + HUserName + "'", "Gy_SourceRelationSet"); + + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "褰撳墠浜哄憳鍒涘缓姝ょ敓浜ц祫婧�,涓嶅厑璁搁噸澶嶅垱寤猴紒"; + objJsonResult.data = null; + + } + else + { + oCN.BeginTran(); + //鍐欏叆浜х嚎缁戝畾 + string sql = string.Format(@"insert into Gy_SourceRelationSet (HSourceID,HUserName,HGroupID,HManagerID,HRemark,HCreateDate,HCreator,HNowFlag,HCheckManID) + values('" + HSourceID + "','" + HUserName + "','" + HGroupID + "','" + HManagerID + "','" + HRemark + "','" + DateTime.Parse(HCreateDate).ToShortDateString() + "','" + HUserName + "','0','')"); + oCN.RunProc(sql); + oCN.Commit(); - oCN.Commit(); - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - objJsonResult.data = 1; + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = null; + } } catch (Exception e) { @@ -48,8 +103,156 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); - objJsonResult.data = 1; - + objJsonResult.data = null; + + } + return objJsonResult; + } + #endregion + + #region 鎶ュ伐骞冲彴鏍规嵁閫変腑鐨勮祫婧怚D甯﹀嚭宸ュ崟鍒楄〃淇℃伅锛屽綋鍓嶇姸鎬佷俊鎭� + [Route("ReportPlatForm/SearchGetWorkBillList")] + [HttpGet] + public object SearchGetWorkBillList(string HSourceID) + { + try + { + oCN.BeginTran(); + //鏇存柊鍒囨崲鐘舵�佸�� + string sql = string.Format(@"update Gy_SourceRelationSet set HNowFlag='1' where HSourceID='" + HSourceID + "'"); + string sql1 = string.Format(@"update Gy_SourceRelationSet set HNowFlag='0' where HSourceID<>'" + HSourceID + "'"); + oCN.RunProc(sql); + oCN.RunProc(sql1); + oCN.Commit(); + + //鏍规嵁閫夋嫨璧勬簮ID鑾峰彇褰撳墠鐢熶骇宸ュ崟銆佽矗浠讳汉 + ds = oCN.RunProcReturn("exec h_p_JIT_GetWorkBillListInfoBySource " + HSourceID + "", "h_p_JIT_GetWorkBillListInfoBySource"); + if (ds.Tables.Count > 0) + { + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝よ祫婧愭殏鏃犲伐鍗曞垪琛ㄦ暟鎹紒"; + objJsonResult.data = ds; + return objJsonResult; + } + } + catch (Exception e) + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.Message.ToString(); + objJsonResult.data = null; + + } + return objJsonResult; + } + #endregion + + #region 鎶ュ伐骞冲彴鍒犻櫎璧勬簮鍒楄〃 + [Route("ReportPlatForm/DeleteGetLineBindBillList")] + [HttpGet] + public object DeleteGetLineBindBillList(string HSourceID,string user) + { + try + { + oCN.BeginTran(); + //鏇存柊鍒囨崲鐘舵�佸�� + string sql = string.Format(@"delete Gy_SourceRelationSet where HSourceID='" + HSourceID + "' and HUserName = '" + user + "'"); + oCN.RunProc(sql); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎璧勬簮鎴愬姛锛�"; + objJsonResult.data = ds; + return objJsonResult; + } + catch (Exception e) + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.Message.ToString(); + objJsonResult.data = null; + + } + return objJsonResult; + } + #endregion + + #region 閫氳繃绯荤粺鍙傛暟鎺у埗锛屽垽鏂敓浜ц鍗曟槸鍚﹀仛浜嗛浠舵楠屽崟鍜屽伐搴忔楠屽崟 + [Route("ReportPlatForm/IsCheck")] + [HttpGet] + public object IsCheck(Int64 HICMOInterID,Int64 HICMOEntryID,string HICMOBillNo) + { + try + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + string HBackRemark = ""; + if (oSystemParameter.ShowBill(ref sErrMsg) == true) + { + if (oSystemParameter.omodel.Sc_ICMOReportBill_FirstCheckOut == "Y") //绯荤粺鍙傛暟 鏄惁鍋氫簡棣栦欢妫�楠屽崟 绌虹櫧涓洪�氱敤 + { + ds = oCN.RunProcReturn("exec h_p_JIT_IsFirstCheckOut " + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "'", "h_p_Sc_IsFirstCheckOut"); + + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + HBackRemark += ds.Tables[0].Rows[0]["HBackRemark"] + " "; + } + } + if(oSystemParameter.omodel.Sc_ICMOReportBill_ProcessCheckOut == "Y") //绯荤粺鍙傛暟 鏄惁鍋氫簡杩囩▼妫�楠屽崟 绌虹櫧涓洪�氱敤 + { + ds = oCN.RunProcReturn("exec h_p_JIT_IsProcessCheckOut " + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "'", "h_p_Sc_IsProcessCheckOut"); + + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + HBackRemark += ds.Tables[0].Rows[0]["HBackRemark"]; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + + if (HBackRemark == "") + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "褰撳墠鐢熶骇璁㈠崟宸茬淮鎶ら浠舵楠屽崟鍜岃繃绋嬫楠屽崟"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = HBackRemark; + objJsonResult.data = null; + return objJsonResult; + } + + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = ex.Message; + objJsonResult.data = null; } return objJsonResult; } -- Gitblit v1.9.1