1
cwjbxqmz
2023-09-27 e92159ced07a57501e0f801a6d657c5979002ca4
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_SOPBillController.cs
@@ -31,15 +31,6 @@
        {
            try
            {
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                string sql1 = string.Format(@"select * from h_v_Sc_WorkOrderList where å¼€å·¥æ ‡è®° = 1 and HMainID='" + sWhere + "'");
               
                ds = oCN.RunProcReturn(sql1, "h_v_Sc_WorkOrderList");
@@ -102,5 +93,91 @@
            }
        }
        /// <summary>
        /// è¿”回当前生产资源生产状态下的工单列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_ICMOBill/list2")]
        [HttpGet]
        public object list2(string HSourceID, string user,string HMainID)
        {
            try
            {
                var sWhere = "";
                if (Convert.ToInt32(HMainID) != 0 && HMainID.ToString() != "")
                {
                    sWhere += " and HMainID = " + HMainID;
                }
                string sql1 = string.Format(@"select * from h_v_Sc_ICMOBillList_ToSop where çŠ¶æ€ = '开工' and HSourceID='" + HSourceID + "'" + sWhere);
                ds = oCN.RunProcReturn(sql1, "h_v_Sc_ICMOBillList_ToSop");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                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;
            }
        }
        /// <summary>
        /// è¿”回生产工位列表信息
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_SourceWorkStationSet_ToSop/Soplist")]
        [HttpGet]
        public object Soplist(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql1 = string.Format(@"select * from h_v_Gy_SourceWorkStationSetList where 1 = 1");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "h_v_Gy_SourceWorkStationSetList");
                }
                else
                {
                    string sql = sql1 + sWhere + " order by HItemID ";
                    ds = oCN.RunProcReturn(sql, "h_v_Gy_SourceWorkStationSetList");
                }
                //添加列名
                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 = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
    }
}