From 221e2c1be8053f750805c1335fc32b1bafe1c76b Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期三, 02 四月 2025 09:27:13 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/项目管理/工程项目/PM_ProjectBillController.cs | 419 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 419 insertions(+), 0 deletions(-) diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs" index 5b28c04..cf4b219 100644 --- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs" +++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs" @@ -1504,6 +1504,44 @@ } #endregion + #region 宸ョ▼椤圭洰 浠诲姟瀹夎璐� 銆佷换鍔¤�冩牳璐广�佷换鍔¢檮灞炶垂銆佷换鍔″伐璐� 閫夋嫨椤圭洰璐圭敤鍒嗙被杩斿洖 瀵瑰簲鍒嗙被鐨勯」鐩垂鐢� + [Route("PM_ProjectBill/getGy_Project")] + [HttpGet] + public object getGy_Project(string HItemID) + { + try + { + + ds = oCN.RunProcReturn("select top 1 * from Gy_ProjectMoney where HProjectMoneyClassID='"+HItemID+ "' and isnull(HCheckEmp,'') !='' and HStopflag=0 order by HItemID desc", "Gy_ProjectMoney"); + + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璇ラ」鐩垂鐢ㄥ垎绫讳笅鐨勯」鐩垂鐢ㄦ棤鏁版嵁"; + objJsonResult.data = null; + return objJsonResult; + } + + + 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 鏈堝害闃舵璁″垝淇濆瓨/缂栬緫 /// <summary> /// 淇濆瓨鏈堝害闃舵璁″垝 @@ -5670,5 +5708,386 @@ } #endregion #endregion + + + #region 椤圭洰璐圭敤寰呭鏍稿垪琛� + #region 宸ョ▼椤圭洰璐圭敤寰呭鏍稿垪琛� + [Route("PM_ProjectBill/NeedCheckQuery")] + [HttpGet] + public object PM_ProjectBillNeedCheckQuery(string user) + { + DataSet ds; + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user)) + //{ + // objJsonResult.code = CodeConstant.FAIL; + // objJsonResult.count = CountConstant.FAIL; + // objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + //sWhere = sWhere.Replace("'", "''"); + ds = oCN.RunProcReturn("exec h_p_PM_ProjectBillNeedCheckQuery ", "h_p_PM_ProjectBillNeedCheckQuery"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = CodeConstant.SUCCEED; + objJsonResult.count = CountConstant.SUCCEED; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 宸ョ▼椤圭洰璐圭敤 瀹℃牳/鍙嶅鏍� + + [Route("PM_ProjectBill/AuditTaskMoney")] + [HttpGet] + public object AuditTaskMoney(string HInterID, string Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊鏍告潈闄� + if (!DBUtility.ClsPub.Security_Log("Pm_ProjectBill_Check", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愬鏍�!"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + BillOld.MvarItemKey = "PM_ProjectBillMain"; + oCN.BeginTran();//寮�濮嬩簨鍔� + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒"; + objJsonResult.data = null; + return objJsonResult; + } + //Type 浠诲姟瀹夎璐瑰鏍告爣璁� + if (Type == "SetupMoneyCheck") + { + if (ds.Tables[0].Rows[0]["HTaskSetupMoneyCheckFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskSetupMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸插鏍革紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //浠诲姟闄勫睘瀹℃牳 + else if (Type == "OtherMoneyCheck") + { + if (ds.Tables[0].Rows[0]["HTaskOtherMoneyCheckFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskOtherMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸插鏍革紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //浠诲姟鑰冩牳璐瑰鏍� + else if (Type == "ExamMoneyCheck") + { + if (ds.Tables[0].Rows[0]["HTaskExamMoneyCheckFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskExamMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸插鏍革紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //浠诲姟宸ヨ垂瀹℃牳鏍囪 + else if (Type == "WorkMoneyCheck") + { + if (ds.Tables[0].Rows[0]["HTaskWorkMoneyCheckFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸插鏍革紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //鍙嶅鏍歌垂鐢� + else if (Type == "UnCheck") + { + + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneyCheckFlag = 0,HTaskExamMoneyCheckFlag = 0,HTaskOtherMoneyCheckFlag = 0,HTaskSetupMoneyCheckFlag = 0 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳绫诲瀷涓嶅瓨鍦紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #endregion + + #region 椤圭洰璐圭敤寰呬繚瀛樺垪琛� + #region 宸ョ▼椤圭洰璐圭敤寰呬繚瀛樺垪琛� + [Route("PM_ProjectBill/NeedSaveQuery")] + [HttpGet] + public object PM_ProjectBillNeedSaveQuery(string user) + { + DataSet ds; + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user)) + //{ + // objJsonResult.code = CodeConstant.FAIL; + // objJsonResult.count = CountConstant.FAIL; + // objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + //sWhere = sWhere.Replace("'", "''"); + ds = oCN.RunProcReturn("exec h_p_PM_ProjectBillNeedSaveQuery ", "h_p_PM_ProjectBillNeedSaveQuery"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = CodeConstant.SUCCEED; + objJsonResult.count = CountConstant.SUCCEED; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 宸ョ▼椤圭洰璐圭敤 淇濆瓨鍙嶄繚瀛� + + [Route("PM_ProjectBill/SaveTaskMoney")] + [HttpGet] + public object SaveTaskMoney(string HInterID, string Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊鏍告潈闄� + if (!DBUtility.ClsPub.Security_Log("Pm_ProjectBill_edit", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愬鏍�!"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + BillOld.MvarItemKey = "PM_ProjectBillMain"; + oCN.BeginTran();//寮�濮嬩簨鍔� + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒"; + objJsonResult.data = null; + return objJsonResult; + } + //Type 浠诲姟瀹夎璐瑰鏍告爣璁� + if (Type == "SetupMoneySave") + { + if (ds.Tables[0].Rows[0]["HTaskSetupMoneySaveFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskSetupMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //浠诲姟闄勫睘瀹℃牳 + else if (Type == "OtherMoneySave") + { + if (ds.Tables[0].Rows[0]["HTaskOtherMoneySaveFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskOtherMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //浠诲姟鑰冩牳璐瑰鏍� + else if (Type == "ExamMoneySave") + { + if (ds.Tables[0].Rows[0]["HTaskExamMoneySaveFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskExamMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //浠诲姟宸ヨ垂瀹℃牳鏍囪 + else if (Type == "WorkMoneySave") + { + if (ds.Tables[0].Rows[0]["HTaskWorkMoneySaveFlag"].ToString() == "False") + { + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + } + //鍙嶅鏍歌垂鐢� + else if (Type == "UnSave") + { + + oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneySaveFlag = 0,HTaskExamMoneySaveFlag = 0,HTaskOtherMoneySaveFlag = 0,HTaskSetupMoneySaveFlag = 0 where HInterID = " + HInterID, "PM_ProjectBillMain"); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳绫诲瀷涓嶅瓨鍦紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #endregion } } \ No newline at end of file -- Gitblit v1.9.1