|  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 应付单需要我审批流审批的 | 
 |  |  |         [Route("Cg_PayableBill/NeedChecklist")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object NeedChecklist(string user, string userid) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |                 //判断是否有查询权限 | 
 |  |  |  | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user)) | 
 |  |  |                 //{ | 
 |  |  |                 //    objJsonResult.code = CodeConstant.FAIL; | 
 |  |  |                 //    objJsonResult.count = CountConstant.FAIL; | 
 |  |  |                 //    objJsonResult.Message = "无权限查看!"; | 
 |  |  |                 //    objJsonResult.data = null; | 
 |  |  |                 //    return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //搜索需要审核的 | 
 |  |  |                 string sql = "select * from h_v_Cg_PayableBillQuery_NeedCheck where HCheckUserID = '" + userid + "' ORDER BY hmainid DESC,hsubid ASC"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_v_Cg_PayableBillQuery_NeedCheck"); | 
 |  |  |                 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("Cg_PayableBill/Checkedlist")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Checkedlist(string user) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |                 //判断是否有查询权限 | 
 |  |  |  | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user)) | 
 |  |  |                 //{ | 
 |  |  |                 //    objJsonResult.code = CodeConstant.FAIL; | 
 |  |  |                 //    objJsonResult.count = CountConstant.FAIL; | 
 |  |  |                 //    objJsonResult.Message = "无权限查看!"; | 
 |  |  |                 //    objJsonResult.data = null; | 
 |  |  |                 //    return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //搜索需要审核的 | 
 |  |  |                 string sql = "select TOP 1000 * from h_v_Cg_PayableBillQuery_Checked where 项目审核人 = '" + user + "'" + | 
 |  |  |                     " ORDER BY hmainid DESC,hsubid ASC"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_v_Cg_PayableBillList_Query"); | 
 |  |  |                 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("Cg_PayableBill/CheckAllFlow")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object CheckAll(string HInterIDS, int IsAudit, string CurUserName, string CurUserID) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //处理字符串 | 
 |  |  |                 if (!string.IsNullOrEmpty(HInterIDS)) | 
 |  |  |                 { | 
 |  |  |                     int[] idArray = Array.ConvertAll(HInterIDS.Split(','), int.Parse); | 
 |  |  |                     // 处理idArray... | 
 |  |  |                     for (int i = 0; i < idArray.Length; i++) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult = (json)AuditCg_PayableBill_Flow(idArray[i], IsAudit, CurUserName, CurUserID);//审核执行 | 
 |  |  |                         if (objJsonResult.count == 0) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.Message += "第" + (i + 1) + "行出现问题无法继续完成"; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "请选择正确行"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = CodeConstant.SUCCEED; | 
 |  |  |                 objJsonResult.count = CountConstant.SUCCEED; | 
 |  |  |                 objJsonResult.Message = "执行成功!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 oCN.RollBack(); | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "审核或反审核应付单失败!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 应付单 批量驳回 | 
 |  |  |         [Route("Cg_PayableBill/RejectAllCheckFlow")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object RejectAllCheckFlow(string HInterIDS, string CurUserID) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //处理字符串 | 
 |  |  |                 if (!string.IsNullOrEmpty(HInterIDS)) | 
 |  |  |                 { | 
 |  |  |                     int[] idArray = Array.ConvertAll(HInterIDS.Split(','), int.Parse); | 
 |  |  |                     // 处理idArray... | 
 |  |  |                     for (int i = 0; i < idArray.Length; i++) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult = (json)RejectCheckFlow_POOrderBill(idArray[i].ToString(), CurUserID);//审核执行 | 
 |  |  |                         if (objJsonResult.count == 0) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.Message += "第" + (i + 1) + "行出现问题无法继续完成"; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "请选择正确行"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = CodeConstant.SUCCEED; | 
 |  |  |                 objJsonResult.count = CountConstant.SUCCEED; | 
 |  |  |                 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 | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | } |