llj
2025-10-31 b8d7145eadce706aef50ef95be75cff9ef79b518
WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs
@@ -23,7 +23,7 @@
        DataSet ds1;
        public WebServer webserver = new WebServer();
        public DAL.ClsQC_LastPieceCheckBill BillOld = new DAL.ClsQC_LastPieceCheckBill();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
@@ -995,6 +995,79 @@
        }
        #endregion
        #region 生产入库检验单根据源单获取信息-源单为生产汇报单(3711)
        /// <summary>
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_LastPieceCheckBill/get_ICMOReportBill_Tmp")]
        [HttpGet]
        public object get_ICMOReportBill_Tmp(int HInterID, int HEntryID, string HBillType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (HInterID == 0 || HBillType.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "参数不全,获取源单信息失败!HInterID:" + HInterID + ";HEntryID:" + HEntryID + ";HBillType:" + HBillType + ";";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sReturn = "";
                string sql = "";
                if (oSystemParameter.ShowBill(ref sReturn))
                {
                    switch (oSystemParameter.omodel.QC_LastPieceCheckBill_QCSchemeSource)
                    {
                        case "物料":
                            sql = "exec h_p_QC_GetInfoByICMOReportBill " + "'物料'" + "," + HInterID + "," + HEntryID + "," + HBillType;
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_GetInfoByICMOReportBill");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没查询到数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    //添加列名
                    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 = "返回记录成功!";
                    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 [已废弃]