1
chenhaozhe
2025-10-29 84a9c19dcd41c03c25698ae2e3dd910864e78aeb
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -1436,5 +1436,58 @@
        }
        #endregion
        #region é¦–件检验单根据源单类型获取信息-源单为生产订单
        [Route("QC_FirstPieceCheckBill/get_ICMOBill")]
        [HttpGet]
        public object get_ICMOBill(string HICMOInterID, string HICMOEntryID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sReturn = "";
                string sql = "";
                if (oSystemParameter.ShowBill(ref sReturn))
                {
                    switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource)
                    {
                        case "物料":
                            sql = "exec h_p_QC_FirstPiece_GetICMOBillList " + "'物料','" + HICMOInterID + "','" + HICMOEntryID + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_FirstPiece_GetICMOBillList " + "'工艺路线','" + HICMOInterID + "','" + HICMOEntryID + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_FirstPiece_GetICMOBillList");
                //添加列名
                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 = "查询数据异常,请与管理员联系!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}