yxj
2021-12-30 2c3c5f1d4532cd03f301d5ff6460023dc28f6765
扫描物料条码判断是否在源单中修改
2个文件已修改
214 ■■■■■ 已修改文件
CLOUDWEB/WebService1.asmx.cs 214 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DLL/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
CLOUDWEB/WebService1.asmx.cs
@@ -2630,8 +2630,78 @@
                }
            }
        }
        //保存到出入库条码临时表(一张单据,存在相同物料)
        [WebMethod]
        public bool set_SavePonderationBillMain_Temp_Select_Qty(Model.ClsKF_PonderationBillMain_Temp oMain, Double sQty, ref string sErrMsg)
        {
            DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
            DAL.ClsGy_BarCodeBill_View oBar = new DAL.ClsGy_BarCodeBill_View();
            dal.oModel = oMain;
            if (!oBar.GetInfoByNumber_View(oMain.HBarCode))
            {
                sErrMsg = "无效条码";
                return false;
            }
            else
            {
                if (oBar.omodel_View.HBarCodeType == "托盘条码")
                {
                    if (!dal.IsBarCode_Pack(oMain.HBarCode, oMain.HInterID, oMain.HBillType))
                    {
                        sErrMsg = "存在相同条码,请勿重复扫描!";
                        return false;
                    }
                    if (dal.AddNew_More_Select(ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                }
                else
                {
                    if (oBar.omodel_View.HBarCodeType == "唯一条码")
                    {
                        if (!dal.IsBarCode(oMain.HBarCode, oMain.HInterID, oMain.HErpClsID, oMain.HBillType))
                        {
                            sErrMsg = "存在相同条码,请勿重复扫描!";
                            return false;
                        }
                        //一次扫码控制,同一条码、同一单据类型,在WMS表和TEMP表里,只允许进行一次扫码
                        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                        DataSet ds = oCn.RunProcReturn("exec h_p_WMS_CheckBarCodeOneScan " + oMain.HInterID.ToString() + ",'" + oMain.HBarCode + "','" + oMain.HBillType + "'," + oMain.HWhID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + ",'" + oMain.HMaker + "'", "h_p_WMS_CheckBarCodeOneScan");
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1)
                            {
                                sErrMsg = "对不起,您扫描的条形码已被扫描过,不符合一次扫码系统参数的要求!";
                                return false;
                            }
                        }
                    }
                    if (dal.AddNew_Source(sQty, ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                }
            }
        }
        //保存到出入库条码临时表(一张单据,存在相同物料)  模具
        [WebMethod]
        public bool set_SavePonderationBillMain_Temp_Select_Qty_Mould(Model.ClsSc_MouldStockBillMain_Temp oMain, Double sQty, ref string sErrMsg)
        {
@@ -31568,42 +31638,64 @@
                }
                else //非多原单
                {
                    //获取TMP中的原单主内码和子内码 //判断该条码是否在原单列表中h_p_WMS_GetBarCodeSourceInterID
                    DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetBarCodeSourceInterID " + HBillID.ToString() + ",'" + sBarCode + "' ", "h_p_WMS_GetBarCodeSourceInterID");
                    //有源单,判断条码对应物料是否存在于此源单中,存在相同物料时自动获取一行源单信息
                    DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetBarCodeSourceInterID_New " + HBillID.ToString() + ",'" + HBillType + "','" + HSourceBillType + "','" + sBarCode + "'", "h_p_WMS_GetBarCodeSourceInterID_New");
                    if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
                    {
                        sErrMsg = "扫描物料条码后有源单自动获取一行源单信息,未知错误!";
                        sErrMsg = "扫描物料条码后有源单自动获取一行源单信息!";
                        return false;
                    }
                    else
                    {
                        if (HSourceBillNo != "" && SourceFlag == true)
                        if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) == 0)
                        {
                            if (HBillType == "1202" && oSystemParameter.omodel.WMS_CampanyName != "博日科技") //生产入库时 条码主内码、子内码和源单主内码、子内码必须一致
                            {
                                if (dal.omodel_View.HSourceInterID != DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"])
                                    && dal.omodel_View.HSourceEntryID != DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"])
                                    )
                                {
                                    sErrMsg = "该条码的源单与扫描的源单不一致,请确认无误后重新扫描!";
                                    return false;
                                }
                            }
                            dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillNo"]);
                            dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"]);
                            dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"]);
                            dal.omodel_View.HinitQty = DBUtility.ClsPub.isDoule(ds2.Tables[0].Rows[0]["HQtyMust"]);     //源单数量
                        }
                        dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillNo"]);
                        dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"]);
                        dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"]);
                        dal.omodel_View.HinitQty = DBUtility.ClsPub.isDoule(ds2.Tables[0].Rows[0]["HQtyMust"]);//原单数量
                        //所扫描物料条码的物料不属于该源单下
                        if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) != 0)
                        else
                        {
                            if (HSourceBillNo != "" && SourceFlag == true)
                            {
                                sErrMsg = "该物料并不存在于此明细信息中,请确认物料无误后重新扫描!";
                                return false;
                            }
                            sErrMsg = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]);
                            return false;
                        }
                    }
                    ////获取TMP中的原单主内码和子内码 //判断该条码是否在原单列表中h_p_WMS_GetBarCodeSourceInterID
                    //DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetBarCodeSourceInterID " + HBillID.ToString() + ",'" + sBarCode + "' ", "h_p_WMS_GetBarCodeSourceInterID");
                    //if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
                    //{
                    //    sErrMsg = "扫描物料条码后有源单自动获取一行源单信息,未知错误!";
                    //    return false;
                    //}
                    //else
                    //{
                    //    //if (HSourceBillNo != "" && SourceFlag == true)
                    //    //{
                    //    //    if (HBillType == "1202" && oSystemParameter.omodel.WMS_CampanyName != "博日科技") //生产入库时 条码主内码、子内码和源单主内码、子内码必须一致
                    //    //    {
                    //    //        if (dal.omodel_View.HSourceInterID != DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"])
                    //    //            && dal.omodel_View.HSourceEntryID != DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"])
                    //    //            )
                    //    //        {
                    //    //            sErrMsg = "该条码的源单与扫描的源单不一致,请确认无误后重新扫描!";
                    //    //            return false;
                    //    //        }
                    //    //    }
                    //    //}
                    //    dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HSourceBillNo"]);
                    //    dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceEntryID"]);
                    //    dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HSourceInterID"]);
                    //    dal.omodel_View.HinitQty = DBUtility.ClsPub.isDoule(ds2.Tables[0].Rows[0]["HQtyMust"]);//原单数量
                    //    //所扫描物料条码的物料不属于该源单下
                    //    if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) != 0)
                    //    {
                    //        if (HSourceBillNo != "" && SourceFlag == true)
                    //        {
                    //            sErrMsg = "该物料并不存在于此明细信息中,请确认物料无误后重新扫描!";
                    //            return false;
                    //        }
                    //    }
                    //}
                }
            }
            else
@@ -34319,76 +34411,6 @@
        //保存到出入库条码临时表(一张单据,存在相同物料)
        [WebMethod]
        public bool set_SavePonderationBillMain_Temp_Select_Qty(Model.ClsKF_PonderationBillMain_Temp oMain, Double sQty, ref string sErrMsg)
        {
            DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
            DAL.ClsGy_BarCodeBill_View oBar = new DAL.ClsGy_BarCodeBill_View();
            dal.oModel = oMain;
            if (!oBar.GetInfoByNumber_View(oMain.HBarCode))
            {
                sErrMsg = "无效条码";
                return false;
            }
            else
            {
                if (oBar.omodel_View.HBarCodeType == "托盘条码")
                {
                    if (!dal.IsBarCode_Pack(oMain.HBarCode, oMain.HInterID, oMain.HBillType))
                    {
                        sErrMsg = "存在相同条码,请勿重复扫描!";
                        return false;
                    }
                    if (dal.AddNew_More_Select(ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                }
                else
                {
                    if (oBar.omodel_View.HBarCodeType == "唯一条码")
                    {
                        if (!dal.IsBarCode(oMain.HBarCode, oMain.HInterID, oMain.HErpClsID, oMain.HBillType))
                        {
                            sErrMsg = "存在相同条码,请勿重复扫描!";
                            return false;
                        }
                        //一次扫码控制,同一条码、同一单据类型,在WMS表和TEMP表里,只允许进行一次扫码
                        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                        DataSet ds = oCn.RunProcReturn("exec h_p_WMS_CheckBarCodeOneScan " + oMain.HInterID.ToString() + ",'" + oMain.HBarCode + "','" + oMain.HBillType + "'," + oMain.HWhID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + ",'" + oMain.HMaker + "'", "h_p_WMS_CheckBarCodeOneScan");
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1)
                            {
                                sErrMsg = "对不起,您扫描的条形码已被扫描过,不符合一次扫码系统参数的要求!";
                                return false;
                            }
                        }
                    }
                    if (dal.AddNew_Source(sQty, ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                }
            }
        }
        //删除出入库条码临时表 扫描记录
DLL/DAL.dll
Binary files differ