From 6c66fff0a02b6860e63a1eb9791100130584084c Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期四, 23 十二月 2021 15:39:02 +0800 Subject: [PATCH] 代码上传 --- WebAPI/Controllers/QC_ManagementController.cs | 150 +++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 137 insertions(+), 13 deletions(-) diff --git a/WebAPI/Controllers/QC_ManagementController.cs b/WebAPI/Controllers/QC_ManagementController.cs index fdde39f..0e51805 100644 --- a/WebAPI/Controllers/QC_ManagementController.cs +++ b/WebAPI/Controllers/QC_ManagementController.cs @@ -104,20 +104,20 @@ /// <returns></returns> [Route("QC_Management/MES_QC_CheckProjectList_Json")] [HttpGet] - public object MES_QC_CheckProjectList_Json(string sqlWhere) + public object MES_QC_CheckProjectList_Json(string sWhere) { DataSet ds; try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - if (sqlWhere == null || sqlWhere.Equals("")) + if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("select top 500 * from h_v_Gy_QCCheckProjectList where HBillStatus>-1 ", "h_v_Gy_QCCheckProjectList"); + ds = oCN.RunProcReturn("select * from h_v_Gy_QCCheckProjectList", "h_v_Gy_QCCheckProjectList"); } else { - string sql1 = "select * from h_v_Gy_QCCheckProjectList where HBillStatus>-1 "; - string sql = sql1 + sqlWhere; + string sql1 = "select * from h_v_Gy_QCCheckProjectList where 1=1"; + string sql = sql1 + sWhere; ds = oCN.RunProcReturn(sql, "h_v_Gy_QCCheckProjectList"); } } @@ -435,13 +435,59 @@ #region 淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 - #region 妫�楠屾柟妗� + #region 妫�楠屾柟妗堢紪杈戞椂鑾峰彇琛ㄥご鏁版嵁 + [Route("QC_Management/MES_QC_CheckProjectListCheckDetai")] + [HttpGet] + public ApiResult<DataSet> MES_QC_CheckProjectListCheckDetai(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCCheckProjectList_NEW where hmainid= " + HID + " ", "h_v_Gy_QCCheckProjectList_NEW"); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ敓浜ф眹鎶ュ崟鍙�" }; + + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + #endregion + + #region 妫�楠屾柟妗堢紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁 + [Route("QC_Management/MES_QC_CheckProjectListProjectDetai")] + [HttpGet] + public object MES_QC_CheckProjectListProjectDetai(string HInterID) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ds = oCN.RunProcReturn(string.Format(@"select 娆″簭鍙� HPrjNo,妫�楠岄」鐩甀D HQCCheckItemID,妫�楠岄」鐩唬鐮� HQCCheckItemNumber,妫�楠岄」鐩� HQCCheckItemName, + 妫�楠屾爣鍑� HQCStd,鏈�澶ф楠屾爣鍑� HQCStdMax,妫�楠屽崟浣� HQCUnit,琛ㄤ綋澶囨敞 HRemark from h_v_Gy_QCCheckProjectList_NEW + where hinterid='"+HInterID+"'"), "h_v_Gy_QCCheckProjectList_NEW"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 妫�楠屾柟妗堜繚瀛� /// <summary> /// 淇濆瓨妫�楠屾柟妗� /// </summary> /// <param name="msg"></param> /// <returns></returns> - [Route("SaveQCCheckProjectList")] + [Route("QC_Management/SaveQCCheckProjectList")] [HttpPost] public object SaveQCCheckProjectList([FromBody] JObject msg) { @@ -465,17 +511,17 @@ { //oItem.HMaker = ""; UserName = oItem.HMaker; + DBUtility.ClsPub.CurUserName = UserName; oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); - oItem.HBillType = "3302"; - oItem.HBillSubType = "3302"; + oItem.HBillType = "3320"; + oItem.HBillSubType = "3320"; oItem.HBillStatus = 0; oItem.HPeriod = 0; oItem.HMaker = ""; oItem.HStandard = false; oItem.HMainSourceInterID = oItem.HInterID; - oItem.HMaterTypeID = 0; //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") { @@ -518,7 +564,6 @@ oItemSub.HRelationQty = 0; oItemSub.HRelationMoney = 0; oItemSub.HCloseMan = ""; - oItemSub.HRemark = ""; oBill.DetailColl.Add(oItemSub); } @@ -527,7 +572,6 @@ bool bResult; if (oBill.omodel.HInterID == 0) { - // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else @@ -562,14 +606,90 @@ } } + #endregion + + #region 妫�楠屾柟妗堥�昏緫鍒犻櫎鍔熻兘 /// <summary> /// 妫�楠屾柟妗堥�昏緫鍒犻櫎鍔熻兘 /// </summary> /// <returns></returns> [Route("DeltetQCCheckProject")] [HttpGet] - public object DeltetQCCheckProject(string HInterID) + public object DeltetQCCheckProject(string HInterID,string UserName) { + + DBUtility.ClsPub.CurUserName = UserName; + //缂栬緫鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_QCCheckProject_Delete", 1, true, DBUtility.ClsPub.CurUserName)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + Int64 lngBillKey = 0; + lngBillKey = DBUtility.ClsPub.isLong(HInterID); + if (lngBillKey == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + DAL.ClsGy_QCCheckProjectMain oBill = new DAL.ClsGy_QCCheckProjectMain(); + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + { + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + if (IsDete) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + else + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈壘鍒�"; + objJsonResult.data = null; + return objJsonResult; + } + + + DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try @@ -637,6 +757,10 @@ } #endregion + + + + #region 鏉ユ枡妫�楠� /// <summary> /// 淇濆瓨鏉ユ枡妫�楠屽崟 -- Gitblit v1.9.1