From 23dbc5b616dfa1a2bcb1fa4302637b8df701f43c Mon Sep 17 00:00:00 2001 From: yxj <yxj@hz-kingdee.com> Date: 星期四, 24 四月 2025 13:27:12 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/项目管理/工作周计划/PM_WorkTaskWeekBillController.cs | 479 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 452 insertions(+), 27 deletions(-) diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" index 52ce606..12e0a01 100644 --- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" +++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillController.cs" @@ -9,7 +9,7 @@ using System.Net.Http; using System.Web.Http; using WebAPI.Models; - +using SyntacticSugar.constant; namespace WebAPI.Controllers { public class PM_WorkTaskWeekBillController : ApiController @@ -402,6 +402,62 @@ } #endregion + #region 宸ヤ綔鍛ㄨ鍒� 鍒嗛〉鍒楄〃 + [Route("PM_WorkTaskWeekBill/page")] + [HttpGet] + public object PM_WorkTaskWeekBillPage(string sWhere, string user, int page, int size) + { + 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; + //} + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCn.RunProcReturn("exec h_p_PM_WorkTaskWeekBillList " + page + "," + size + ",''", "h_p_PM_ProjectBillList"); + } + else + { + sWhere = sWhere.Replace("'", "''"); + ds = oCn.RunProcReturn("exec h_p_PM_WorkTaskWeekBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_ProjectBillList"); + } + + //娣诲姞鍒楀悕 + 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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + 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 宸ヤ綔鍛ㄨ鍒� 鍒犻櫎 /// <summary> ///鍙傛暟锛歴tring HInterID銆� @@ -550,8 +606,33 @@ //杩涜闇�瑕佽繘琛岀殑瀹℃牳/鍙嶅鏍告搷浣� if (IsAudit == 0) //瀹℃牳鎻愪氦 { + + //瀹℃牳鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_PM_WorkTaskWeekBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCn.RunProcReturn(sql1, "h_p_PM_WorkTaskWeekBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCn.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCn.RollBack(); + return objJsonResult; + } + //================================================================================== + //瀹℃牳鎻愪氦 - if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) + if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_PM_WorkTaskWeekBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -570,8 +651,32 @@ } if (IsAudit == 1) //鍙嶅鏍告彁浜� { + + //鍙嶅鏍稿墠鎺у埗========================================= + string sql1 = "exec h_p_PM_WorkTaskWeekBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCn.RunProcReturn(sql1, "h_p_PM_WorkTaskWeekBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //=========================================================== + + //鍙嶅鏍告彁浜bandonCheck - if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) + if (oBill.AbandonCheck(lngBillKey, oBill.omodel.HBillNo, "h_p_PM_WorkTaskWeekBill_AfterUnCheckCtrl", CurUserName , ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; @@ -883,6 +988,161 @@ } #endregion + #region 宸ヤ綔鍛ㄦ�荤粨 鑾峰彇鍒楄〃鏁版嵁 + [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillList")] + [HttpGet] + public object PM_WorkReportWeekBillList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList order by 鍗曟嵁鍙� desc", "h_v_PM_WorkReportWeekBillMainList"); + } + else + { + string sql1 = "select * from h_v_PM_WorkReportWeekBillMainList where 1 = 1 "; + string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc"; + ds = oCn.RunProcReturn(sql, "h_v_PM_WorkReportWeekBillMainList"); + } + + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈幏鍙栧埌鍛ㄦ�荤粨鐩稿叧鏁版嵁锛�"; + objJsonResult.data = null; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + + #region 宸ヤ綔鍛ㄦ�荤粨 鍒嗛〉鍒楄〃 + [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillpage")] + [HttpGet] + public object PM_WorkReportWeekBillPage(string sWhere, string user, int page, int size) + { + 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; + //} + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCn.RunProcReturn("exec h_p_PM_WorkReportWeekBillMainList " + page + "," + size + ",''", "h_p_PM_ProjectBillList"); + } + else + { + sWhere = sWhere.Replace("'", "''"); + ds = oCn.RunProcReturn("exec h_p_PM_WorkReportWeekBillMainList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_ProjectBillList"); + } + + //娣诲姞鍒楀悕 + 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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + 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_WorkTaskWeekBill/PM_WorkReportWeekBillMainEditList")] + [HttpGet] + public object PM_WorkReportWeekBillMainEditList(string HInterID) + { + try + { + List<object> columnNameList = new List<object>(); + ds = oCn.RunProcReturn("select * from h_v_PM_WorkReportWeekBillMainList where HInterID='" + HInterID + "'", "h_v_PM_WorkReportWeekBillMainList"); + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈幏鍙栧埌鍛ㄦ�荤粨鐩稿叧鏁版嵁锛�"; + objJsonResult.data = null; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + } + return objJsonResult; + } + #endregion + #region 宸ヤ綔鍛ㄦ�荤粨 閫夋嫨鎬荤粨浜哄甫鍑哄伐鏃� [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainList")] [HttpGet] @@ -944,7 +1204,7 @@ #region 宸ヤ綔鍛ㄦ�荤粨淇濆瓨/缂栬緫 /// <summary> - /// 淇濆瓨鐢熶骇棰嗘枡鍗� + /// 淇濆瓨宸ヤ綔鍛ㄦ�荤粨 /// </summary> /// <param name="msg"></param> /// <returns></returns> @@ -1033,7 +1293,7 @@ oItem.HBillType = "4757"; oItem.HBillSubType = "4757"; - //oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); @@ -1096,12 +1356,13 @@ #region 宸ヤ綔鍛ㄦ�荤粨 瀹℃牳/鍙嶅鏍稿姛鑳� [Route("PM_WorkTaskWeekBill/CheckPM_WorkReportWeekBillMain")] [HttpGet] - public object CheckPM_WorkReportWeekBillMain(string HInterID, int IsAudit, string user) + public object CheckPM_WorkReportWeekBillMain(int HInterID, int IsAudit, string CurUserName) { + DBUtility.ClsPub.CurUserName = CurUserName; try { //瀹℃牳鏉冮檺 - if (!DBUtility.ClsPub.Security_Log_second("PM_WorkReportWeekBillMain_Check", 1, false, user)) + if (!DBUtility.ClsPub.Security_Log_second("PM_WorkReportWeekBillMain_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1110,12 +1371,43 @@ return objJsonResult; } - var ds = oCn.RunProcReturn("select * from PM_WorkReportWeekBillMain where HInterID=" + HInterID, "PM_WorkReportWeekBillMain"); - if (ds.Tables[0].Rows.Count > 0) + //HInterID鏁版嵁鍒ゆ柇 + if (HInterID <= 0) { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID灏忎簬0锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + Int64 lngBillKey = 0; + lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹� + DAL.ClsPM_WorkReportWeekBillMain oBill = new DAL.ClsPM_WorkReportWeekBillMain(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣� + + //閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔 + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁 + { + if (oBill.omodel.HCloseMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HDeleteMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } if (IsAudit == 0) //瀹℃牳鍒ゆ柇 { - if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1126,7 +1418,7 @@ } if (IsAudit == 1) //鍙嶅鏍稿垽鏂� { - if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") + if (oBill.omodel.HChecker.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -1140,38 +1432,117 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } - oCn.BeginTran(); - if (IsAudit == 0) //瀹℃牳鍒ゆ柇 + //杩涜闇�瑕佽繘琛岀殑瀹℃牳/鍙嶅鏍告搷浣� + if (IsAudit == 0) //瀹℃牳鎻愪氦 { - oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); + oCn.BeginTran(); - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "瀹℃牳鎴愬姛"; - objJsonResult.data = null; + //璁板綍杩斿洖淇℃伅 + string msg = ""; + + + + //瀹℃牳鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_PM_WorkReportWeekBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCn.RunProcReturn(sql1, "h_p_PM_WorkReportWeekBill_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCn.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCn.RollBack(); + return objJsonResult; + } + //================================================================================== + + //瀹℃牳鎻愪氦 + if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_PM_WorkReportWeekBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + oCn.Commit(); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳鎴愬姛锛�" + msg; + objJsonResult.data = null; + return objJsonResult; + } + else + { + oCn.RollBack(); + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } } - if (IsAudit == 1) //鍙嶅鏍稿垽鏂� + if (IsAudit == 1) //鍙嶅鏍告彁浜� { - oCn.RunProc("update PM_WorkReportWeekBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅鏍告垚鍔�"; - objJsonResult.data = null; + //鍙嶅鏍稿墠鎺у埗========================================= + string sql1 = "exec h_p_PM_WorkReportWeekBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; + ds = oCn.RunProcReturn(sql1, "h_p_PM_WorkReportWeekBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //=========================================================== + + //鍙嶅鏍告彁浜bandonCheck + if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_PM_WorkReportWeekBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍告垚鍔�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } } - oCn.Commit(); - return objJsonResult; } catch (Exception e) { oCn.RollBack(); + objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString(); @@ -1270,5 +1641,59 @@ } } #endregion + + #region 宸ヤ綔鍛ㄦ�荤粨 鍒犻櫎 + /// <summary> + ///鍙傛暟锛歴tring HInterID銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("PM_WorkTaskWeekBill/PM_WorkReportWeekBillMainDelete")] + [HttpGet] + public object PM_WorkReportWeekBillMainDelete(string HInterID, string user) + { + try + { + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("PM_WorkReportWeekBillMain_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_WorkReportWeekBillMain where HInterID = " + HInterID); + //oCn.RunProc("delete from PM_WorkTaskWeekBillSub 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 } } -- Gitblit v1.9.1