From 5fe0467e751a5138536785212f25b1bd177a526d Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期日, 18 二月 2024 17:28:30 +0800
Subject: [PATCH] 月度阶段计划与工作周总结,编辑回显,审核反审核,关闭,反关闭,查询数据
---
WebAPI/Controllers/项目管理/工程项目/PM_ProjectBillController.cs | 165 +++++++++++++++++++++++++++++++++
DAL/ClsPM_WorkPlanMonthBillMain.cs | 129 ++++++++++++-------------
2 files changed, 227 insertions(+), 67 deletions(-)
diff --git a/DAL/ClsPM_WorkPlanMonthBillMain.cs b/DAL/ClsPM_WorkPlanMonthBillMain.cs
index bfdfee9..a853518 100644
--- a/DAL/ClsPM_WorkPlanMonthBillMain.cs
+++ b/DAL/ClsPM_WorkPlanMonthBillMain.cs
@@ -33,75 +33,70 @@
#endregion
//#region 淇敼鍗曟嵁
- //public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
- //{
- // try
- // {
- // oCn.BeginTran();
- // //鏇存柊涓昏〃
- // string mainSql = "update PM_WorkPlanMonthBillMain set " +
- // " HBillNo = '" + omodel.HBillNo +
- // "', HDate = '" + omodel.HDate +
- // "', HYear = " + omodel.HYear +
- // ", HPeriod = " + omodel.HPeriod +
- // ", HRemark = '" + omodel.HRemark +
- // "', HUpDater = '" + omodel.HUpDater +
- // "', HUpDateDate = getdate()" +
- // //===============================================================
- // ", HOrgID = " + omodel.HOrgID +
- // ", HYear = " + omodel.HYear +
- // ", HWeek = " + omodel.HWeek +
- // ", HBeginDate = '" + omodel.HBeginDate +
- // "', HEndDate = '" + omodel.HEndDate +
- // "', HPlanEmpID = " + omodel.HReportEmpID +
- // " where HInterID = " + omodel.HInterID;
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ oCn.BeginTran();
+ //鏇存柊涓昏〃
+ string mainSql = "update PM_WorkPlanMonthBillMain set " +
+ " HBillNo = '" + omodel.HBillNo +
+ "', HDate = '" + omodel.HDate +
+ "', HYear = " + omodel.HYear +
+ ", HMonth = " + omodel.HMonth +
+ ", HRemark = '" + omodel.HRemark +
+ "', HUpDater = '" + omodel.HUpDater +
+ "', HUpDateDate = getdate()" +
+ //===============================================================
+
+
+ ", HBeginDate = '" + omodel.HBeginDate +
+ "', HEndDate = '" + omodel.HEndDate +
+ "', HPlanEmpID = " + omodel.HPlanEmpID +
+ " where HInterID = " + omodel.HInterID;
- // //鍒犻櫎鍏宠仈
- // DeleteRelation(ref sReturn, lngBillKey);
- // //鍒犻櫎瀛愯〃
- // DeleteBillSub(lngBillKey);
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎瀛愯〃
+ DeleteBillSub(lngBillKey);
- // ////鎻掑叆瀛愯〃
- // //omodel.HInterID = lngBillKey;
- // //foreach (Model.ClsPM_WorkTaskWeekBillSub oSub in DetailColl)
- // //{
- // // string subSql = "insert into PM_WorkTaskWeekBillSub" +
- // // "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
- // // ",HWeekDay,HSno,HProjectID,HProjectStageID,HTaskNote,HPlanTimes) " +
- // // " values(" +
- // // "" + omodel.HInterID.ToString() +
- // // "," + oSub.HEntryID.ToString() +
- // // ",'" + oSub.HCloseMan +
- // // "','" + oSub.HEntryCloseDate +
- // // "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) +
- // // ",'" + oSub.HRemark +
- // // "'," + oSub.HSourceInterID +
- // // "," + oSub.HSourceEntryID +
- // // ",'" + oSub.HSourceBillNo +
- // // "','" + oSub.HSourceBillType +
- // // "'," + oSub.HRelationQty +
- // // "," + oSub.HRelationMoney +
- // // "," + oSub.HWeekDay +
- // // "," + oSub.HSno +
- // // "," + oSub.HProjectID +
- // // "," + oSub.HProjectStageID +
- // // ",'" + oSub.HTaskNote +
- // // "'," + oSub.HPlanTimes +
- // // ")";
- // // oCn.RunProc(subSql);
- // //}
-
- // sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
- // oCn.Commit();
- // return true;
- // }
- // catch (Exception e)
- // {
- // sReturn = e.Message;
- // oCn.RollBack();
- // throw (e);
- // }
- //}
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ foreach (Model.ClsPM_WorkPlanMonthBillSub oSub in DetailColl)
+ {
+ string subSql = "insert into PM_WorkPlanMonthBillSub" +
+ "" +
+ "" +
+ "" +
+ "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HProNumber,HProjectStageID,HRate,HAvgMoney,HCountMoney) " +
+ " values(" +
+ "" + omodel.HInterID.ToString() +
+ "," + oSub.HEntryID.ToString() +
+ "," + oSub.HSourceInterID +
+ "," + oSub.HSourceEntryID +
+ ",'" + oSub.HSourceBillNo +
+ "','" + oSub.HSourceBillType +
+ "','" + oSub.HProNumber +
+ "'," + oSub.HProjectStageID +
+ "," + oSub.HRate +
+ ",'" + oSub.HAvgMoney +
+ "','" + oSub.HCountMoney +
+ "')";
+ oCn.RunProc(subSql);
+ }
+
+ sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
//#endregion
#region 鏂板鍗曟嵁
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 ce57fc1..5dd1c04 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"
@@ -1610,5 +1610,170 @@
}
#endregion
+ #region 鏈堝害闃舵璁″垝鍒楄〃 鏌ヨ
+ /// <summary>
+ /// 杩斿洖椤圭洰闃舵鍒楄〃
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("PM_ProjectBill/getPM_WorkPlanMonthBillMainLists")]
+ [HttpGet]
+ public object getPM_WorkPlanMonthBillMainLists(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_PM_WorkPlanMonthBillMainList order by 鍗曟嵁鍙� desc", "h_v_PM_WorkPlanMonthBillMainList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_PM_WorkPlanMonthBillMainList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+ ds = oCN.RunProcReturn(sql, "h_v_PM_WorkPlanMonthBillMainList");
+ }
+
+ //娣诲姞鍒楀悕
+ 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 = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鏈堝害闃舵璁″垝鍒楄〃 鍒犻櫎
+ /// <summary>
+ ///鍙傛暟锛歴tring HInterID銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("PM_ProjectBill/PM_WorkPlanMonthBillMainDelete")]
+ [HttpGet]
+ public object PM_WorkReportWeekBillMainDelete(string HInterID, string user)
+ {
+ try
+ {
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Drop", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (HInterID == null || HInterID.Equals(""))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ oCN.RunProc("delete from PM_WorkPlanMonthBillMain where HInterID = " + HInterID);
+ oCN.RunProc("delete from PM_WorkPlanMonthBillSub where HInterID='" + HInterID + "'");
+
+ oCN.Commit();
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鏈堝害闃舵璁″垝鍒楄〃 鑾峰彇缂栬緫鍒楄〃鏁版嵁
+ [Route("PM_ProjectBill/PM_WorkPlanMonthBillMainEditList")]
+ [HttpGet]
+ public object PM_WorkPlanMonthBillMainEditList(string HInterID,string User)
+ {
+ try
+ {
+ List<DataTable> tableList = new List<DataTable>();
+
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("PM_WorkPlanMonthBillMain_Edit", 1, false, User))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (HInterID == null || HInterID.Equals(""))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = oCN.RunProcReturn("exec h_p_PM_WorkPlanMonthBillMain_EditInit " + HInterID, "h_p_PM_WorkPlanMonthBillMain_EditInit");
+ tableList.Add(ds.Tables[0]);
+ tableList.Add(ds.Tables[1]);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = tableList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1