1
zrg
2025-11-05 080398b3ec314095e2fd5cccd3590e42815cc6c8
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -522,7 +522,7 @@
        }
        #endregion
        #region è¿”回检验值列表
        /// <summary>
        ///返回检验值列表
        /// </summary>
@@ -577,6 +577,7 @@
                return objJsonResult;
            }
        }
        #endregion
        #region é¦–件检验单维护 å®¡æ ¸ åå®¡æ ¸ å…³é—­ åå…³é—­ ä½œåºŸ åä½œåºŸ
        /// <summary>
@@ -1087,9 +1088,7 @@
        }
        #endregion
        # region é¦–件检验逻辑删除功能
        /// <summary>
        /// é¦–件检验逻辑删除功能
        /// </summary>
@@ -1213,6 +1212,7 @@
                return objJsonResult;
            }
        }
        #endregion
        #region é¦–件检验单根据源单类型获取信息-源单为工序进站单
        [Route("QC_FirstPieceCheckBill/get_StationInBill")]
@@ -1270,6 +1270,62 @@
        }
        #endregion
        #region é¦–件检验单根据源单类型获取信息-源单为工序进站单 é€šè¿‡å•据号获取
        [Route("QC_FirstPieceCheckBill/get_StationInBill_ByHBillNo")]
        [HttpGet]
        public object get_StationInBill_ByHBillNo(string HBillNo, 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_GetStationInBillList_ByHBillNo " + "'工序','" + HBillNo + "'";
                            break;
                        case "物料":
                            sql = "exec h_p_QC_FirstPiece_GetStationInBillList_ByHBillNo " + "'物料','" + HBillNo + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_FirstPiece_GetStationInBillList_ByHBillNo " + "'工艺路线','" + HBillNo + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_FirstPiece_GetStationInBillList");
                //添加列名
                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
        #region é¦–ä»¶/工序 æ£€éªŒå•根据源单类型获取信息-源单为工序流转卡
        [Route("CheckBill/get_ProcessExchangeBill")]
        [HttpGet]
@@ -1293,6 +1349,62 @@
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'工艺路线','" + HInterID + "','" + HEntryID + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_FirstPiece_GetProcessExchangeBillList");
                //添加列名
                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
        #region é¦–ä»¶/工序 æ£€éªŒå•根据源单类型获取信息-源单为工序流转卡 æ ¹æ®å•据号查询
        [Route("CheckBill/get_ProcessExchangeBill_ByBillNo")]
        [HttpGet]
        public object get_ProcessExchangeBill_ByBillNo(string HBillNo, 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_GetProcessExchangeBillList_ByBillNo " + "'工序','" + HBillNo + "'";
                            break;
                        case "物料":
                            sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList_ByBillNo " + "'物料','" + HBillNo + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList_ByBillNo " + "'工艺路线','" + HBillNo + "'";
                            break;
                    }
@@ -1436,5 +1548,111 @@
        }
        #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
        #region é¦–件检验单根据源单类型获取信息-源单为生产订单 é€šè¿‡å•据号带出
        [Route("QC_FirstPieceCheckBill/get_ICMOBill_ByBillNo")]
        [HttpGet]
        public object get_ICMOBill_ByBillNo(string HBillNo, 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_ByBillNo " + "'物料','" + HBillNo + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_FirstPiece_GetICMOBillList_ByBillNo " + "'工艺路线','" + HBillNo + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_FirstPiece_GetICMOBillList_ByBillNo");
                //添加列名
                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
    }
}