yxj
2024-12-17 8e4a0d24086175c4b97480980fba0901a767f7b4
WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs
@@ -5,6 +5,8 @@
using System.Data;
using System.Web.Http;
using WebAPI.Models;
using SyntacticSugar.constant;
using Newtonsoft.Json;
namespace WebAPI.Controllers
{
    /**
@@ -134,6 +136,61 @@
        #endregion
        #region 器具直接调拨单分页列表
        [Route("Sc_MouldProdMoveBill/page")]
        [HttpGet]
        public object Sc_MouldProdMoveBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            try
            {
                List<object> columnNameList = new List<object>();
                //权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdMoveBillList", 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_Sc_MouldProdMoveBillList " + page + "," + size + ",''", "h_p_Sc_MouldProdMoveBillList");
                }
                else
                {
                    ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdMoveBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldProdMoveBillList");
                }
                //添加列名
                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 = 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("Sc_MouldProdMoveBill/Sc_MouldProdMoveBillListCheckDetai")]
        [HttpGet]