| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region 发货通知单 查询-分页 |
| | | [Route("Xs_SeOutStockBill/list_byPage")] |
| | | [HttpGet] |
| | | public object list_byPag(string sWhere, string user, string Organization, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); //定义声明变量 ,把通过 new List<object>()创建的 实例,赋值给变量 |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBillQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无权限查询!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_SeOutStockBillList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_IF_SeOutStockBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_SeOutStockBillList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_IF_SeOutStockBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 = "1"; |
| | | 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 = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | ///删除功能 |
| | | /// </summary> |
| | |
| | | string HLinkPhone = mainList[0].HLinkPhone; |
| | | string HSeOrderBillNo_M = mainList[0].HSeOrderBillNo_M; |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID + " and 单据号='" + HBillNo + "'", "h_v_IF_SeOutStockBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID, "h_v_IF_SeOutStockBillList"); |
| | | |
| | | //进行 会计期间 结账 的判断和控制 |
| | | string s = ""; |
| | |
| | | { //修改 |
| | | |
| | | DataSet dss; |
| | | dss = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID + " and 单据号='" + HBillNo + "'", "h_v_IF_SeOutStockBillList"); |
| | | dss = oCN.RunProcReturn("select * from h_v_IF_SeOutStockBillList where hmainid=" + HInterID, "h_v_IF_SeOutStockBillList"); |
| | | //判断是否可编辑 |
| | | if (dss.Tables[0].Rows[0]["审核人"].ToString() != "" && dss.Tables[0].Rows[0]["审核人"] != null) |
| | | { |
| | |
| | | } |
| | | |
| | | string sql = $@"update Xs_SeOutStockBillMain set " + |
| | | "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + |
| | | "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + ",HBillNo='" + HBillNo + "'" + |
| | | ",HCusID='" + HCusID + "', HCurID='" + HCurID + "', HWHID = '" + HWHID |
| | | + "',HExRate='" + HExRate + "',HEmpID='" + HEmpID + "',HSeOrderBillNo_M='" + HSeOrderBillNo_M + "',HManagerID='" + HManagerID + "',HDeptID='" + HDeptID + "',HOWNERID='" + HOWNERID |
| | | + "',HAddress='" + HAddress + "',HProjectID='"+ HProjectID + "' where HInterID=" + HInterID; |
| | |
| | | [HttpGet] |
| | | public object AuditXs_SeOutStockBill_Flow(int HInterID, int IsAudit, string CurUserName, string CurUserID) |
| | | { |
| | | //string ModRightNameCheck = "Cg_POOrderBill_Check"; |
| | | //string ModRightNameCheck = "Xs_SeOutStockBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | |
| | | #region 审核前的相关判断 |
| | | //审核前控制========================================= |
| | | string sql1 = "exec h_p_Xs_SeOutStockBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Cg_POOrderBill_BeforeCheckCtrl"); |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Xs_SeOutStockBill_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | { |
| | | #region 反审核前的相关判断 |
| | | //反审核前控制========================================= |
| | | DataSet ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + CurUserName + "'", "h_p_Cg_POOrderBill_BeforeUnCheckCtrl"); |
| | | DataSet ds = oCN.RunProcReturn("Exec h_p_Xs_SeOutStockBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + CurUserName + "'", "h_p_Xs_SeOutStockBill_BeforeUnCheckCtrl"); |
| | | if (ds == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 发货通知单查询列表 |
| | | [Route("Xs_SeOutStockBill/QueryList")] |
| | | [HttpGet] |
| | | public object QueryList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //判断是否有查询权限 |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBillQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "无权限查看!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql = "select * from h_v_Xs_SeOutStockBillQuery where 1 = 1 "; |
| | | |
| | | if (sWhere == "" || sWhere == null) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Xs_SeOutStockBillQuery order by hmainid desc", "h_v_Xs_SeOutStockBillQuery"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_Xs_SeOutStockBillQuery"); |
| | | } |
| | | |
| | | |
| | | |
| | | 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("Xs_SeOutStockBill/QuerySubList")] |
| | | [HttpGet] |
| | | public object QuerySubList(string hmainid, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //判断是否有查询权限 |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Xs_SeOutStockBillQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "无权限查看!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql = "select * from h_v_Xs_SeOutStockBillQuerySub where hmainid = " + hmainid; |
| | | |
| | | ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Xs_SeOutStockBillQuerySub"); |
| | | |
| | | |
| | | 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 |
| | | } |
| | | } |