| | |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using System.Windows.Forms; |
| | | |
| | | using SyntacticSugar.constant; |
| | | namespace WebAPI.Controllers |
| | | { |
| | | //çç»Controller |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å®é¢ç³è¯·åéè¦æå®¡æ¹æµå®¡æ¹ç |
| | | [Route("Pay_ProcPriceRequestBill/NeedChecklist")] |
| | | [HttpGet] |
| | | public object NeedChecklist(string user, string userid) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 1, false, user)) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "æ æéæ¥ç!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æç´¢éè¦å®¡æ ¸ç |
| | | string sql = " select a.*,c.HItemID as HCheckFlowStatusID,m.HName as å®¡æ¹æµ,c.HCheckFlowID,i.HName as 审æ¹é¡¹ç®åç§°,c.HCheckItemID,c.HChecker as 项ç®å®¡æ ¸äºº,c.HCheckNote as å®¡æ¹æµå®¡æ ¸å»ºè®®,c.HCheckDate å®¡æ¹æµå®¡æ ¸æ¥æ from h_v_Pay_ProcPriceRequestBillList AS a LEFT JOIN Xt_BillCheckFlowStatus AS c ON a.hmainid = c.HBillInterID and a.HBillType = c.HBillTypeID" + |
| | | " LEFT JOIN Xt_CheckFlowMain as m ON m.HInterID = c.HCheckFlowID" + |
| | | " LEFT JOIN Pay_ProcPriceRequestBillMain as po ON a.hmainid = po.HInterID" + |
| | | " LEFT JOIN Xt_CheckItem as i ON i.HItemID = c.HCheckItemID" + |
| | | " LEFT JOIN Xt_CheckUserRight as cr ON cr.HCheckItemID = i.HItemID and cr.HCheckFlowInterID = m.HInterID" + |
| | | " where po.HBillStatus = 6 and po.HCheckItemNowID = i.HItemID and cr.HUserID = '" + userid + "'"; |
| | | ds = oCn.RunProcReturn(sql, "h_v_Pay_ProcPriceRequestBillList"); |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | 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("Pay_ProcPriceRequestBill/Checkedlist")] |
| | | [HttpGet] |
| | | public object Checkedlist(string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 1, false, user)) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "æ æéæ¥ç!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æç´¢éè¦å®¡æ ¸ç |
| | | string sql = " select DISTINCT a.*,c.HItemID as HCheckFlowStatusID,m.HName as å®¡æ¹æµ,c.HCheckFlowID,i.HName as 审æ¹é¡¹ç®åç§°,c.HCheckItemID,c.HChecker as 项ç®å®¡æ ¸äºº,c.HCheckNote as å®¡æ¹æµå®¡æ ¸å»ºè®®,c.HCheckDate å®¡æ¹æµå®¡æ ¸æ¥æ from h_v_Pay_ProcPriceRequestBillList AS a LEFT JOIN Xt_BillCheckFlowStatus AS c ON a.hmainid = c.HBillInterID and a.HBillType = c.HBillTypeID" + |
| | | " LEFT JOIN Xt_CheckFlowMain as m ON m.HInterID = c.HCheckFlowID" + |
| | | " LEFT JOIN Xt_CheckItem as i ON i.HItemID = c.HCheckItemID" + |
| | | " where c.HCheckDate is not NUll and c.HChecker = '" + user + "'"; |
| | | ds = oCn.RunProcReturn(sql, "h_v_Pay_ProcPriceRequestBillList"); |
| | | 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | 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("Pay_ProcPriceRequestBill/RejectCheckFlow")] |
| | | [HttpGet] |
| | | public object RejectCheckFlow(string HInterID, string CurUserID) |
| | | { |
| | | try |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ |
| | | DAL.ClsPay_ProcPriceRequestBill oBill = new DAL.ClsPay_ProcPriceRequestBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HBillStatus != 6) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åæ®æªå¨å®¡æ ¸ä¸ä¸è½é©³å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å起驳å |
| | | if (oBill.RejectCheckFlowProgress(lngBillKey, oBill.omodel.HBillNo, CurUserID, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "驳åæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "驳å失败失败!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å®é¢ç³è¯·å åèµ·å®¡æ¹ |
| | | [Route("Pay_ProcPriceRequestBill/StartCheckFlow")] |
| | | [HttpGet] |
| | | public object StartCheckFlow(int HInterID, string CurUserName) |
| | | { |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | ////å®¡æ ¸æé |
| | | //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //HInterIDæ°æ®å¤æ |
| | | if (HInterID <= 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "HInterIDå°äº0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ |
| | | DAL.ClsPay_ProcPriceRequestBill oBill = new DAL.ClsPay_ProcPriceRequestBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //åèµ·å®¡æ¹ |
| | | if (oBill.startCheckFlow(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "åèµ·å®¡æ¹æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å起审æ¹å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å起审æ¹å¤±è´¥å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å®é¢ç³è¯·å å¤çº§ å®¡æ ¸/åå®¡æ ¸ |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("Pay_ProcPriceRequestBill/AuditFlow")] |
| | | [HttpGet] |
| | | public object AuditPay_ProcPriceRequestBill_Flow(int HInterID, int IsAudit, string CurUserName, string CurUserID) |
| | | { |
| | | //string ModRightNameCheck = "Pay_ProcPriceRequestBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | ////å®¡æ ¸æé |
| | | //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | |
| | | //HInterIDæ°æ®å¤æ |
| | | if (HInterID <= 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "HInterIDå°äº0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ |
| | | DAL.ClsPay_ProcPriceRequestBill oBill = new DAL.ClsPay_ProcPriceRequestBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å
³æä½ |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (IsAudit == TypeConstant.AUDIT) //å®¡æ ¸å¤æ |
| | | { |
| | | //夿æ¯å¦å·²ç»åèµ·å®¡æ¹ |
| | | string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + oBill.BillType + "'"; |
| | | DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus"); |
| | | if (ds0 != null && ds0.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :åæ®æªå起审æ¹ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //夿忮å½åç¶æ |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :åæ®å·²å®æå®¡æ ¸!ä¸è½ç»§ç»å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == TypeConstant.REVERSE_AUDIT) //åå®¡æ ¸å¤æ |
| | | { |
| | | //夿æ¯å¦åå¨å®¡æ ¸è¿çé¡¹ç® |
| | | string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + oBill.BillType + "' and ISNULL(HChecker,'') <> ''"; |
| | | DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus"); |
| | | if (ds0 != null && ds0.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :åæ®ä¸åå¨å·²ç»å®¡æ ¸ç项ç®ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | oCn.BeginTran(); |
| | | //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ |
| | | if (IsAudit == TypeConstant.AUDIT) //å®¡æ ¸æäº¤ |
| | | { |
| | | #region å®¡æ ¸åçç¸å
³å¤æ |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Pay_ProcPriceRequestBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_Pay_ProcPriceRequestBill_BeforeCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //================================================================================== |
| | | |
| | | //è¿è¡ ä¼è®¡æé´ ç»è´¦ çå¤æåæ§å¶ |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | DateTime HDate = DateTime.Now; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.Message = s; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | //è·åå½åå®¡æ ¸é¡¹ç® |
| | | string sql0 = "select * from " + oBill.MvarItemKey + " where HInterID = " + lngBillKey; |
| | | DataSet ds0 = oCn.RunProcReturn(sql0, oBill.MvarItemKey); |
| | | string HCheckFlowID = ds0.Tables[0].Rows[0]["HCheckFlowID"].ToString(); //å®¡æ¹æµå
ç |
| | | string HCheckItemNowID = ds0.Tables[0].Rows[0]["HCheckItemNowID"].ToString(); //å½å审æ¹é¡¹ç®å
ç |
| | | string HCheckItemNextID = ds0.Tables[0].Rows[0]["HCheckItemNextID"].ToString(); //å¾
审æ¹é¡¹ç®å
ç |
| | | |
| | | //å¤æç¨æ·æ¯å¦ææé å®¡æ¹ å½åå®¡æ¹æµç审æ¹é¡¹ç® |
| | | //string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + " and HValue = 1"; |
| | | string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + ""; |
| | | DataSet ds01 = oCn.RunProcReturn(sql01, "Xt_CheckUserRight"); |
| | | if (ds01.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :ç¨æ·æ å½åå®¡æ ¸é¡¹ç®çå®¡æ ¸æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ´æ° 忮审æ¹ç¶æè¡¨ ä¸å¯¹åºå®¡æ ¸é¡¹ç®çå®¡æ ¸ç¶æ |
| | | string sql02 = "update Xt_BillCheckFlowStatus set HChecker='" + CurUserName + "',HCheckDate=getdate() where HBillTypeID = '" + oBill.BillType + "' and HBillInterID=" + lngBillKey + " and HCheckFlowID=" + HCheckFlowID + " and HCheckItemID=" + HCheckItemNowID; |
| | | oCn.RunProc(sql02); |
| | | |
| | | //夿å½åå®¡æ ¸é¡¹ç®æ¯å¦æ¯æåä¸ä¸ªé¡¹ç®ï¼å¦ææ¯ï¼å®¡æ ¸ååååæ®çåæ®ç¶æã妿䏿¯ï¼è·åä¸ä¸ä¸ªå®¡æ ¸é¡¹ç®å¹¶æ´æ°å°éå®è®¢å主表 |
| | | if (HCheckItemNextID != "0") //ååå®¡æ ¸çå®¡æ ¸é¡¹ç®ä¸æ¯æåä¸ä¸ªå®¡æ ¸é¡¹ç® |
| | | { |
| | | string sql03 = "select b.HInterID,b.HCheckItemID from Xt_CheckFlowMain as a " + |
| | | "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " + |
| | | "where a.HBillTypeID = '" + oBill.BillType + "' " + |
| | | "and a.HInterID = " + HCheckFlowID + " " + |
| | | "order by b.HFlowNo asc"; |
| | | DataSet ds03 = oCn.RunProcReturn(sql03, "Xt_CheckFlowMain"); |
| | | |
| | | //è·åæ°çå½åå®¡æ ¸é¡¹ç®åå¾
å®¡æ ¸é¡¹ç® |
| | | for (int i = 0; i < ds03.Tables[0].Rows.Count; i++) |
| | | { |
| | | if (ds03.Tables[0].Rows[i]["HCheckItemID"].ToString() == HCheckItemNextID) |
| | | { |
| | | HCheckItemNowID = HCheckItemNextID; |
| | | } |
| | | else if (HCheckItemNowID == HCheckItemNextID) |
| | | { |
| | | HCheckItemNextID = ds03.Tables[0].Rows[i]["HCheckItemID"].ToString(); |
| | | break; |
| | | } |
| | | } |
| | | //æ°çå½åå®¡æ ¸é¡¹ç®ä¸ºæåä¸ä¸ªå®¡æ ¸é¡¹ç®ï¼å¾
å®¡æ ¸é¡¹ç®ä¸åå¨ï¼è®¾ä¸ºé»è®¤å¼"0" |
| | | if (HCheckItemNowID == HCheckItemNextID) |
| | | { |
| | | HCheckItemNextID = "0"; |
| | | } |
| | | |
| | | //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® |
| | | string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; |
| | | oCn.RunProc(sql04); |
| | | |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | else //ååå®¡æ ¸çå®¡æ ¸é¡¹ç®æ¯æåä¸ä¸ªå®¡æ ¸é¡¹ç® |
| | | { |
| | | //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® |
| | | HCheckItemNowID = "0"; |
| | | HCheckItemNextID = "0"; |
| | | |
| | | string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; |
| | | oCn.RunProc(sql04); |
| | | |
| | | //æ´æ°åæ®çåæ®ç¶æ |
| | | if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Pay_ProcPriceRequestBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | |
| | | oCn.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | if (IsAudit == TypeConstant.REVERSE_AUDIT) //åå®¡æ ¸æäº¤ |
| | | { |
| | | #region åå®¡æ ¸åçç¸å
³å¤æ |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | DataSet BeforeDs = oCn.RunProcReturn("Exec h_p_Pay_ProcPriceRequestBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_Pay_ProcPriceRequestBill_BeforeUnCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åå®¡æ ¸åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //========================================================= |
| | | |
| | | //è¿è¡ ä¼è®¡æé´ ç»è´¦ çå¤æåæ§å¶ |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | DateTime HDate = DateTime.Now; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.Message = s; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | //è·åéè¦åå®¡æ ¸çå®¡æ ¸é¡¹ç® |
| | | string sql0 = "select c.* from Xt_CheckFlowMain as a " + |
| | | "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " + |
| | | "inner join Xt_BillCheckFlowStatus as c on a.HBillTypeID = c.HBillTypeID and b.HCheckItemID = c.HCheckItemID " + |
| | | "where c.HBillTypeID = '" + oBill.BillType + "' and c.HBillInterID = " + lngBillKey + " " + |
| | | "order by b.HFlowNo asc"; |
| | | DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus"); |
| | | if (ds0 == null || ds0.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :æªå起审æ¹ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string HCheckFlowID = ds0.Tables[0].Rows[0]["HCheckFlowID"].ToString(); //å®¡æ¹æµå
ç |
| | | string HCheckItemNowID = "0"; //å½å审æ¹é¡¹ç®å
ç |
| | | string HCheckItemNextID = "0"; //å¾
审æ¹é¡¹ç®å
ç |
| | | if (oBill.omodel.HBillStatus == 6) |
| | | { |
| | | for (int i = 0; i < ds0.Tables[0].Rows.Count; i++) |
| | | { |
| | | if (ds0.Tables[0].Rows[i]["HChecker"].ToString() != "") |
| | | { |
| | | HCheckItemNowID = ds0.Tables[0].Rows[i]["HCheckItemID"].ToString(); |
| | | HCheckItemNextID = ds0.Tables[0].Rows[i]["HCheckItemID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | HCheckItemNextID = ds0.Tables[0].Rows[i]["HCheckItemID"].ToString(); |
| | | break; |
| | | } |
| | | } |
| | | if (HCheckItemNowID == HCheckItemNextID) |
| | | { |
| | | HCheckItemNextID = "0"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | HCheckItemNowID = ds0.Tables[0].Rows[ds0.Tables[0].Rows.Count - 1]["HCheckItemID"].ToString(); |
| | | HCheckItemNextID = "0"; |
| | | } |
| | | |
| | | //å¤æç¨æ·æ¯å¦ææé å®¡æ¹ å½åå®¡æ¹æµç审æ¹é¡¹ç® |
| | | //string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + " and HValue = 1"; |
| | | string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + ""; |
| | | DataSet ds01 = oCn.RunProcReturn(sql01, "Xt_CheckUserRight"); |
| | | if (ds01.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :ç¨æ·æ å½åå®¡æ ¸é¡¹ç®çå®¡æ ¸æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //æ´æ° 忮审æ¹ç¶æè¡¨ ä¸å¯¹åºå®¡æ ¸é¡¹ç®çå®¡æ ¸ç¶æ |
| | | string sql02 = "update Xt_BillCheckFlowStatus set HChecker='',HCheckDate='' where HBillTypeID = '" + oBill.BillType + "' and HBillInterID=" + lngBillKey + " and HCheckFlowID=" + HCheckFlowID + " and HCheckItemID=" + HCheckItemNowID; |
| | | oCn.RunProc(sql02); |
| | | |
| | | //夿åå®¡æ ¸çåæ®æ¯å¦å·²ç»å®¡æ ¸å®æï¼è¥å®¡æ ¸å®æï¼åå®¡æ ¸éè¦åæ´åæ®ç¶æã |
| | | if (oBill.omodel.HBillStatus == 6) |
| | | { |
| | | //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® |
| | | string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; |
| | | oCn.RunProc(sql04); |
| | | |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | else |
| | | { |
| | | |
| | | //åå®¡æ ¸æäº¤AbandonCheck |
| | | if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Pay_ProcPriceRequestBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® |
| | | string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + ",HBillStatus=6 " + " where HInterID = " + lngBillKey; |
| | | oCn.RunProc(sql04); |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | |
| | | oCn.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCn.Commit(); |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | |
| | | oCn.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |