一键扫码方法、一键扫码多源单模式方法中新增托盘条码判断、扫码处理
1个文件已修改
190 ■■■■■ 已修改文件
CLOUDWEB/WebService1.asmx.cs 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CLOUDWEB/WebService1.asmx.cs
@@ -28741,6 +28741,43 @@
            //判断是否启用一键扫码模式,Y为启用,未启用时只扫描物料条码
            if (oSystemParameterMain.WMS_OneKeyMode.ToUpper() == "N")
            {
                DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
                if (dal.GetInfoByNumber_View(sBarCode))
                {
                    //如果是托盘条码分解并模拟扫码
                    if (dal.omodel_View.HBarCodeType == "托盘条码")
                    {
                        //分解托条码得到明细条码信息写入出入库条码临时表
                        DataSet dsTBarCode;
                        string sBarCode_MX;
                        dsTBarCode = oCn.RunProcReturn("select HBarCode HBarCodeMX from Sc_PackUnionBillSub_Sum " +
                        " Where HBarCode_Pack = '" + sBarCode + "'", "Sc_PackUnionBillSub_Sum");
                        if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                        {
                            sErrMsg = "没有找到托盘条码对应子条码记录!";
                            return null;
                        }
                        else
                        {
                            for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
                            {
                                sBarCode_MX = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeMX"]);
                                oBar = get_SavePonderationBillMain_Temp_MulSource(sBarCode_MX, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, oSystemParameterMain, ref sErrMsg);
                                if (oBar == null)
                                {
                                    sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode_MX + sErrMsg;
                                    return null;
                                }
                                else
                                {
                                    return oBar;
                                }
                            }
                            return oBar;
                        }
                    }
                    else
                    {
                oBar = get_SavePonderationBillMain_Temp_MulSource(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, oSystemParameterMain, ref sErrMsg);
                if (oBar == null)
                {
@@ -28750,6 +28787,13 @@
                else
                {
                    return oBar;
                        }
                    }
                }
                else
                {
                    sErrMsg = "没有找到该条码!";
                    return null;
                }
            }
            //一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码)
@@ -28762,7 +28806,43 @@
                //无返回数据则为物料条码
                if (Dss == null || Dss.Tables[0].Rows.Count == 0)
                {
                    //将物料条码信息写入出入库条码临时表
                    DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
                    if (dal.GetInfoByNumber_View(sBarCode))
                    {
                        //如果是托盘条码分解并模拟扫码
                        if (dal.omodel_View.HBarCodeType == "托盘条码")
                        {
                            //分解托条码得到明细条码信息写入出入库条码临时表
                            DataSet dsTBarCode;
                            string sBarCode_MX;
                            dsTBarCode = oCn.RunProcReturn("select HBarCode HBarCodeMX from Sc_PackUnionBillSub_Sum " +
                            " Where HBarCode_Pack = '" + sBarCode + "'", "Sc_PackUnionBillSub_Sum");
                            if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                            {
                                sErrMsg = "没有找到托盘条码对应子条码记录!";
                                return null;
                            }
                            else
                            {
                                for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
                                {
                                    sBarCode_MX = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeMX"]);
                                    oBar = get_SavePonderationBillMain_Temp_MulSource(sBarCode_MX, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, oSystemParameterMain, ref sErrMsg);
                                    if (oBar == null)
                                    {
                                        sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode_MX + sErrMsg;
                                        return null;
                                    }
                                    else
                                    {
                                        return oBar;
                                    }
                                }
                                return oBar;
                            }
                        }
                        else
                        {
                    oBar = get_SavePonderationBillMain_Temp_MulSource(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, oSystemParameterMain, ref sErrMsg);
                    if (oBar == null)
                    {
@@ -28772,6 +28852,13 @@
                    else
                    {
                        return oBar;
                            }
                        }
                    }
                    else
                    {
                        sErrMsg = "没有找到该条码!";
                        return null;
                    }
                }
                else
@@ -29638,6 +29725,49 @@
                //判断是否启用一键扫码模式,Y为启用,未启用时只扫描物料条码
                if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N")
                {
                    DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
                    if (dal.GetInfoByNumber_View(sBarCode))
                    {
                        //如果是托盘条码分解并模拟扫码
                        if (dal.omodel_View.HBarCodeType == "托盘条码")
                        {
                            //分解托条码得到明细条码信息写入出入库条码临时表
                            DataSet dsTBarCode;
                            string sBarCode_MX;
                            dsTBarCode = oCn.RunProcReturn("select HBarCode HBarCodeMX from Sc_PackUnionBillSub_Sum " +
                            " Where HBarCode_Pack = '" + sBarCode + "'", "Sc_PackUnionBillSub_Sum");
                            if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                            {
                                sErrMsg = "没有找到托盘条码对应子条码记录!";
                                return null;
                            }
                            else
                            {
                                for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
                                {
                                    sBarCode_MX = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeMX"]);
                                    if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_MX, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg))
                                    {
                                        oBar.HSourceBillType = sHSourceBillType;
                                        oBar.HSourceBillNo = sHSourceBillNo;
                                        oBar.HSupID = sHSupID;
                                        oBar.HSupName = sHSupName;
                                        oBar.HDeptID = sHDeptID;
                                        oBar.HDeptName = sHDeptName;
                                        SourceFlag = true;
                                    }
                                    else
                                    {
                                        sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode_MX + sErrMsg;
                                        //sErrMsg = "扫描失败!" + sErrMsg;
                                        return null;
                                    }
                                }
                                return oBar;
                            }
                        }
                        else
                        {
                    //将物料条码信息写入出入库条码临时表
                    if (set_SavePonderationBillMain_Temp_BarCode(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg))
                    {
@@ -29654,6 +29784,13 @@
                        return null;
                    }
                    return oBar;
                        }
                    }
                    else
                    {
                        sErrMsg = "没有找到该条码!";
                        return null;
                    }
                }
                //一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码)
                else
@@ -29674,6 +29811,49 @@
                    //无返回数据则为物料条码
                    if (Dss == null || Dss.Tables[0].Rows.Count == 0)
                    {
                        DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
                        if (dal.GetInfoByNumber_View(sBarCode))
                        {
                            //如果是托盘条码分解并模拟扫码
                            if (dal.omodel_View.HBarCodeType == "托盘条码")
                            {
                                //分解托条码得到明细条码信息写入出入库条码临时表
                                DataSet dsTBarCode;
                                string sBarCode_MX;
                                dsTBarCode = oCn.RunProcReturn("select HBarCode HBarCodeMX from Sc_PackUnionBillSub_Sum " +
                                " Where HBarCode_Pack = '" + sBarCode + "'", "Sc_PackUnionBillSub_Sum");
                                if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0)
                                {
                                    sErrMsg = "没有找到托盘条码对应子条码记录!";
                                    return null;
                                }
                                else
                                {
                                    for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++)
                                    {
                                        sBarCode_MX = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeMX"]);
                                        if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_MX, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg))
                                        {
                                            oBar.HSourceBillType = sHSourceBillType;
                                            oBar.HSourceBillNo = sHSourceBillNo;
                                            oBar.HSupID = sHSupID;
                                            oBar.HSupName = sHSupName;
                                            oBar.HDeptID = sHDeptID;
                                            oBar.HDeptName = sHDeptName;
                                            SourceFlag = true;
                                        }
                                        else
                                        {
                                            sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode_MX + sErrMsg;
                                            //sErrMsg = "扫描失败!" + sErrMsg;
                                            return null;
                                        }
                                    }
                                    return oBar;
                                }
                            }
                            else
                            {
                        //将物料条码信息写入出入库条码临时表
                        if (set_SavePonderationBillMain_Temp_BarCode(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg))
                        {
@@ -29687,11 +29867,17 @@
                        else
                        {
                            sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sErrMsg;
                            //sErrMsg = "扫描失败!" + sErrMsg;
                            return null;
                        }
                        return oBar;
                    }
                        }
                        else
                        {
                            sErrMsg = "没有找到该条码!";
                            return null;
                        }
                    }
                    else
                    {
                        string sBarBillName = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HSourceName"]);