1
llj
11 小时以前 e3f218a023f0625f415a1526b278636c3e39aa4f
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -658,6 +658,44 @@
            }
        }
        /// <summary>
        /// èŽ·å–éƒ¨é—¨åˆ—è¡¨ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetDepartmentList_Json")]
        [HttpGet]
        public object GetDepartmentList_Json(string Department, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Department with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Department + "%' or HName like '%" + Department + "%')", "Gy_Department");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何部门记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回部门信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä¾›åº”商资料
@@ -9749,6 +9787,69 @@
        }
        #endregion
        #region [根据单据号 ç‰©æ–™ç¼–码 ç‰©æ–™åç§° ç”Ÿäº§è®¢å• å·¥åº éƒ¨é—¨èŽ·å– å·¥åºæµè½¬å¡]
        /// <summary>
        /// èŽ·å–æ¡ç ä¿¡æ¯ æ·»åŠ å·¥åº éƒ¨é—¨æŸ¥è¯¢æ¡ä»¶
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetMES_ProcessExchangeBillList_APP_HaiCheng")]
        [HttpGet]
        public object GetMES_ProcessExchangeBillList_APP_HaiCheng(string HBillNo, string HNumber, string HName, string HICMOBillNo, string user, string HProcID, string HDeptID)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_MES_ProcessExchangeBillList_APP_HaiCheng " +
                    "@HBillNo = N'" + HBillNo + "', " +
                    "@HNumber = N'" + HNumber + "', " +
                    "@HName = N'" + HName + "', "  +
                    "@HICMOBillNo = N'" + HICMOBillNo + "'," +
                    "@HProcID = N'" + HProcID + "', " +
                    "@HDeptID = N'" + HDeptID + "'"
                    , "h_p_MES_ProcessExchangeBillList_PDA_QiaoYi");
                if((bool)ds.Tables[1].Rows[0]["returntype"] == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = ds.Tables[1].Rows[0]["mesg"].ToString();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当前所输入过滤条件,没有返回任何结果!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    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 = "0";
                    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 å­è¡¨æ˜Žç»†è°ƒç”¨æ–¹æ³•
        /// <summary>
        /// æŸ¥çœ‹æ˜Žç»†