1
chenhaozhe
2025-11-07 f48f7421c9615779c6c8fbeca046ac45333159d2
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -202,7 +202,7 @@
                List<object> columnNameList = new List<object>();
                string sql1 = "select * from h_v_QC_FirstPieceCheckBill_Edit where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                string sql = sql1 + sWhere + " order by hmainid desc,hsubid asc";
                ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBill_Edit");
                //添加列名
@@ -326,6 +326,7 @@
                BillNew.omodel.HBatchNo = ClsPub.isStrNull(mainList[0].HBatchNo);
                BillNew.omodel.HTakeSampleCheckBillID = ClsPub.isLong(mainList[0].HTakeSampleCheckBillID);
                BillNew.omodel.HTakeSampleCheckBillNo = ClsPub.isStrNull(mainList[0].HTakeSampleCheckBillNo);
                BillNew.omodel.HRemarkSN = mainList[0].HRemarkSN;
                List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_FirstPieceCheckBillSub>();
                for (int i = 0; i < subList.ToArray().Length; i++)
@@ -372,6 +373,13 @@
                        oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect);
                        oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID);
                        oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult);
                        oSub.HQualityStdID = DBUtility.ClsPub.isLong(subList[i].HQualityStdID);//
                        oSub.HInspectMethodID = DBUtility.ClsPub.isLong(subList[i].HInspectMethodID);//
                        oSub.HInspectBasisID = DBUtility.ClsPub.isLong(subList[i].HInspectBasisID);//
                        oSub.HCompareSymbol = DBUtility.ClsPub.isStrNull(subList[i].HCompareSymbol);//
                        BillNew.DetailColl.Add(oSub);
                    }
                    else
@@ -1654,5 +1662,58 @@
        }
        #endregion
        #region å·¡æ£€æ£€éªŒå•根据源单类型获取信息-源单为生产订单
        [Route("QC_PatrolProcCheckBill/get_ICMOBill")]
        [HttpGet]
        public object get_ICMOBill_PatrolProcCheck(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_PatrolProcCheckBill_QCSchemeSource)
                    {
                        case "物料":
                            sql = "exec h_p_QC_PatrolProcCheck_GetICMOBillList " + "'物料','" + HICMOInterID + "','" + HICMOEntryID + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_PatrolProcCheck_GetICMOBillList " + "'工艺路线','" + HICMOInterID + "','" + HICMOEntryID + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_PatrolProcCheck_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
    }
}