WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -57,7 +57,7 @@
        #region  工序单品不良采集 扫码查询
        [Route("Cj_SingleStation/HBardCodeList")]
        [HttpGet]
        public object HBardCodeList(string HBarCode, string user)
        public object HBardCodeList(string HBarCode,int HProcID, string user)
        {
            try
            {
@@ -71,36 +71,34 @@
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from gy_czygl WITH(NOLOCK) where czymc='" + user + "'", "gy_czygl");
                string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
                ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBillHICOMProcessExchange WITH(NOLOCK) where 条码='" + HBarCode + "' ", "h_v_Gy_BarCodeBillHICOMProcessExchange");
                ds = oCN.RunProcReturn(@"select * from h_v_Gy_BarCodeBillHICOMProcessExchange WITH(NOLOCK) where 条码='" + HBarCode + "' and HProcID='"+ HProcID + "' ", "h_v_Gy_BarCodeBillHICOMProcessExchange");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "条码查无数据!";
                    objJsonResult.Message = "条码跟当前工序查无数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                int num = 0;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (ds.Tables[0].Rows[i]["HProcID"].ToString() == HProcID)
                    {
                        num = 1;
                    }
                }
                if (num == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当前条码与当前工序不匹配!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //int num = 0;
                //for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                //{
                //    if (ds.Tables[0].Rows[i]["HProcID"].ToString() == HProcID)
                //    {
                //        num = 1;
                //    }
                //}
                //if (num == 0)
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "当前条码与当前工序不匹配!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "正常")
                {
@@ -308,7 +306,13 @@
            //修改条码表的状态
            oCN.RunProc("update Gy_BarCodeBill set HStatus='"+ HResult + "' where HBarCode='"+ oSub.HBarCode + "'");
            LogService.Write("类型:" + oSub.HBadTypeID + ",制单人:" + oSub.HMaker + ",制单日期:" + oSub.HMakeDate);
            //查询当前条码对应的出站单id
             ds= oCN.RunProcReturn("select * from Sc_StationOutBillSub_SN where HBarCode='" + oSub.HBarCode + "' and HSourceEntryID='" + oSub.HProcExchEntryID + "'", "Sc_StationOutBillSub_SN");
            if (ds.Tables[0].Rows.Count > 0)
            {
                linterid= ds.Tables[0].Rows[0]["HInterID"].ToString();
            }
            LogService.Write("类型:" + oSub.HBadTypeID + ",制单人:" + oSub.HMaker + ",制单日期:" + oSub.HMakeDate  + ",工序:" + oSub.HProcID  + ",流转卡:"+ oSub.HProcExchBillNo + ",出站单id:"+ linterid);
            //修改出站单的 不良 报废数量
            if (HResult == "不良")
            {
@@ -372,8 +376,9 @@
                    if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                    {
                       
                        //判断当前流转卡是否是开工
                        ds = oCN.RunProcReturn("select  * from Sc_ICMOBillStatus_Tmp where HSourceBillNo='" + HBarCode + "' and HICMOStatus<>'0'", "Sc_ICMOBillStatus_Tmp");
                        //判断当前流转卡 当前工序是否是开工
                        ds = oCN.RunProcReturn("select  * from Sc_ICMOBillStatus_Tmp where HSourceBillNo='" + HBarCode + "' and HICMOStatus<>'0' and HProcID='"+ HProcID + "'", "Sc_ICMOBillStatus_Tmp");
                        //查不到证明没有开工进入下一句查询
                        if (ds.Tables[0].Rows.Count == 0)
                        {
                            //判断当前流转卡是否墨西哥的
@@ -391,11 +396,15 @@
                }
                ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomList '" + HBarCode + "'," + HProcID, "h_p_Gy_BarCodeBillBomList");
                //2026 0228斯莫尔 两道工序要合并投料 自动分配 老的 h_p_Gy_BarCodeBillBomList 用于精准查询  新的 h_p_Gy_BarCodeBillBomList2 用于查询出要全部的上料
                //ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomList '" + HBarCode + "'," + HProcID, "h_p_Gy_BarCodeBillBomList");
                ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomList2 '" + HBarCode + "'," + HProcID, "h_p_Gy_BarCodeBillBomList2");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    DataSet dataSet = oCN.RunProcReturn(@"exec h_p_Sc_ProcessExchangeBillList '" + HBarCode + "'," + HProcID, "h_p_Sc_ProcessExchangeBillList");
                    //2026 0228斯莫尔 两道工序要合并投料 自动分配 老的 h_p_Sc_ProcessExchangeBillList 用于精准查询  新的 h_p_Sc_ProcessExchangeBillList2 用于查询出要全部的上料
                    //DataSet dataSet = oCN.RunProcReturn(@"exec h_p_Sc_ProcessExchangeBillList '" + HBarCode + "'," + HProcID, "h_p_Sc_ProcessExchangeBillList");
                    DataSet dataSet = oCN.RunProcReturn(@"exec h_p_Sc_ProcessExchangeBillList2 '" + HBarCode + "'," + HProcID, "h_p_Sc_ProcessExchangeBillList2");
                    if (dataSet.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "2";