1
zrg
7 天以前 41717d1b7866e69692b2c338000932930e14765f
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -1496,7 +1496,7 @@
                sql = "delete from Sc_StationOutBillSub_SN where HInterID = " + HInterID + " and HEntryID = " + HEntryID;
                oCN.RunProc(sql);
                //反写工序出站单的合格数量
                oCN.RunProc("update Sc_StationOutBillMain WITH (TABLOCKX) set HQty-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HBillNo='"+ HBillNo_bak + "'");
                oCN.RunProc("update Sc_StationOutBillMain  set HQty-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HBillNo='"+ HBillNo_bak + "'");
                oCN.Commit();
@@ -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;
                }
@@ -2875,7 +2875,7 @@
        #endregion
        #region 工序单品过站 关键件绑定配件信息临时存储
        [Route("Cj_SingleStation/BarCodeBillBomMatch_XW")]
        [Route("Cj_SingleStation/BarCodeBillBomBind_XW")]
        [HttpGet]
        public object PartsBardCode_JX(string HBillNo,string HBarCode, string HBarCode_P, int HProcID, string user, int HOrgID)
        {
@@ -2937,6 +2937,130 @@
        }
        #endregion
        #region  工序单品过站 SN镭雕码查询关键件清单(根据流转卡号)
        [Route("Cj_SingleStation/HBardCodeBomListByHProcExch_XW")]
        [HttpGet]
        public object HBardCodeBomListByHProcExch_XW(string HBillNo, string HBarCode, int HProcID, int HOrgID, string user)
        {
            try
            {
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "[0000-1-068]无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //条码档案中已有本次扫描的条码,匹配用料清单(扫码数据写入临时表)
                ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomMatchByHProcExch_XW '" + HBillNo + "','" + HBarCode + "','" + HProcID + "'," + HOrgID, "h_p_Gy_BarCodeBillBomMatchByHProcExch_XW");
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    if (ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = "";
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "";
                        objJsonResult.data = ds.Tables[0];
                        return objJsonResult;
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查询到数据";
                    objJsonResult.data = "";
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "[0000-1-010]没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 工序单品过站 关键件绑定配件信息临时存储(根据流转卡号)
        [Route("Cj_SingleStation/BarCodeBillBomBindByHProcExch_XW")]
        [HttpGet]
        public object BarCodeBillBomBindByHProcExch_XW(string HBillNo, string HBarCode, string HBarCode_P, int HProcID, string user, int HOrgID)
        {
            try
            {
                //判断所扫条码是否存在条码档案当中
                ds = oCN.RunProcReturn(@"select 1 from Gy_BarCodeBill WITH(NOLOCK) where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    //条码档案中没有本次扫描的条码,则根据规则解析生成条码
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "该条码不存在:" + HBarCode;
                    objJsonResult.data = "";
                    return objJsonResult;
                }
                //条码档案中已有本次扫描的条码,查询配件信息(扫描条码信息写入临时表)
                ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomBindByHProcExch_XW '" + HBillNo + "','" + HBarCode + "','" + HBarCode_P + "','" + HProcID + "','" + HOrgID + "'", "h_p_Gy_BarCodeBillBomBindByHProcExch_XW");
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    if (ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = "";
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "";
                        objJsonResult.data = ds.Tables[0];
                        return objJsonResult;
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "";
                    objJsonResult.data = "没有查询到数据";
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "ERROR!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  工序单品过站 扫SN码出站保存(保存到出站汇报里(+关键件绑定))
        [Route("Cj_SingleStation/AddStationOutBillAndAssemblyBill")]
        [HttpPost]
@@ -2997,8 +3121,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 +3131,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 +3141,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;