wtt
2025-11-17 6ef126d9a9271afae02ee36469b1512e144bc555
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -2538,7 +2538,7 @@
                }
                //条码上道工序是否过站
                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_S '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_S");
                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_XW '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_XW");
                if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
                {
                    objJsonResult.code = "0";
@@ -2547,7 +2547,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2")
                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -2557,17 +2557,17 @@
                }
                //判断条码是否已经出站
                ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 产品条码='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
                //ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 产品条码='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "[0000-2-039]条码:" + barCode_SN + ",已出站!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //if (ds.Tables[0].Rows.Count > 0)
                //{
                //    oCN.RollBack();
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "[0000-2-039]条码:" + barCode_SN + ",已出站!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                long HMainInterID = 0;
                string BillType = "3791";
@@ -2639,7 +2639,7 @@
                int HTemporaryAreaID = 0;//暂放区
                int HShiftsID = 0;
                string HBatchNo = omodel.HBatchNo;
                string HWeight = omodel.HWeight;
                double HWeight = omodel.HWeight;
                //获取当前班次
                //DataSet set = oCN.RunProcReturn("exec h_p_Gy_GetWorkShiftInfo " + HDeptID + "," + HCenterID, "h_p_Gy_GetWorkShiftInfo");
                //if (set.Tables[0].Rows.Count > 0)
@@ -2856,8 +2856,8 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "";
                    objJsonResult.data = "没有查询到数据";
                    objJsonResult.Message = "没有查询到数据";
                    objJsonResult.data = "";
                    return objJsonResult;
                }
@@ -2997,8 +2997,8 @@
                    return objJsonResult;
                }
                //条码上道工序是否过站
                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_S '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_S");
                //条码上道工序是否过站以及本道条码是否已经出站
                ds = oCN.RunProcReturn("exec h_p_Sc_SNBarcodeProcCtrl_XW '" + barCode_SN + "'," + omodel.HProcID, "h_p_Sc_SNBarcodeProcCtrl_XW");
                if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
                {
                    objJsonResult.code = "0";
@@ -3007,7 +3007,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2")
                else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -3017,17 +3017,17 @@
                }
                //判断条码是否已经出站
                ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 产品条码='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
                //ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList WITH(NOLOCK) where 产品条码='" + barCode_SN + "' and HProcExchInterID=" + omodel.HProcExchInterID + " and HProcExchEntryID=" + omodel.HProcExchEntryID + " and HProcID=" + omodel.HProcID, "h_v_Gy_QualifiedRecordsList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "[0000-2-039]条码:" + barCode_SN + ",已出站!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //if (ds.Tables[0].Rows.Count > 0)
                //{
                //    oCN.RollBack();
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "[0000-2-039]条码:" + barCode_SN + ",已出站!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //增加产线组装追溯单
                DataSet ds1;
@@ -3301,6 +3301,152 @@
            }
        }
        #endregion
        #region 过站解绑列表 查询
        [Route("Cj_SingleStation/UnbindBarList")]
        [HttpGet]
        public object BarList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Cj_SingleStation_UnbindBarList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_UnbindStation_BarList order by 条码日期 desc", "h_v_Sc_UnbindStation_BarList");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_UnbindStation_BarList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 条码日期 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_UnbindStation_BarList");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region 重工条码信息 查询
        [Route("Cj_SingleStation/UnbindBarInfo")]
        [HttpGet]
        public object UnbindBarInfo(string HBarCodeIDs, string user)
        {
            try
            {
                if (HBarCodeIDs == null || HBarCodeIDs.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "重工条码信息未递入,请退出重试";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    string sql = "exec h_p_Sc_UnbindBarInfo '" + HBarCodeIDs + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sc_UnbindBarInfo");
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 解除包装关系、拆除物料(1:解除包装关系;2.拆除物料)
        [Route("Cj_SingleStation/DelRelation")]
        [HttpGet]
        public object DelRelation(string HBarCodeIDs, Int64 HICMOInterID, Int64 HICMOEntryID, Int64 HProcID, Int64 HType, string user)
        {
            try
            {
                if (HBarCodeIDs == null || HBarCodeIDs.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "拆除条码信息未递入,请退出重试";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    string sql = "exec h_p_Sc_DelbindBarRelation '" + HBarCodeIDs + "'," + HICMOInterID + "," + HICMOEntryID + "," + HProcID + "," + HType;
                    ds = oCN.RunProcReturn(sql, "h_p_Sc_DelbindBarRelation");
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() == "0")
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString();
                    objJsonResult.data = "";
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
    }