yxj
2023-05-04 3a1193b927397baee7d8d2f2e967f5164616c982
新增扫描托条码调用方法
2个文件已修改
175 ■■■■■ 已修改文件
CLOUDWEB/WebService1.asmx.cs 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DLL/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
CLOUDWEB/WebService1.asmx.cs
@@ -47712,6 +47712,7 @@
                oMain.HBillType = HBillType;
                oMain.HMaker = HMaker;
                oMain.HMaterID = omodel_View.HMaterID;
                oMain.HUnitID = omodel_View.HUnitID;
                oMain.HAuxPropID = omodel_View.HAuxPropID;
                oMain.HQtyMust = 0;
                oMain.HBarCode = omodel_View.HBarCode;
@@ -47746,14 +47747,14 @@
                oMain.HCusBarCode = HCustom1;
                oCn.RunProc("Insert into KF_PonderationBillMain_Temp " +
                "(HInterID,HBillNo,HBillType,HMaterID,HAuxPropID,HProcID" +
                "(HInterID,HBillNo,HBillType,HMaterID,HUnitID,HAuxPropID,HProcID" +
                ",HWhID,HSCWHID,HStockPlaceID,HOutStockPlaceID,HGroupID,HAddr" +
                ",HQtyMust,HQty,HPieceQty,HBatchNo,HBarCode,HBarCode_Pack" +
                ",HMaker,HMakeDate,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo" +
                ",HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag,HMTONo,HPlanMode" +
                ",HSTOCKORGID,HOtherOrgID,HOWNERID,HOWNERTYPEID,HExpressNumber,HSubBillType" +
                ",HCusID,HDeptID,HCusBarCode,HMulSourceBill,HBeginDate,HEndDate) " +
                " Values(" + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'," + oMain.HMaterID.ToString() + "," + oMain.HAuxPropID.ToString() + "," + oMain.HProcID.ToString() +
                " Values(" + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'," + oMain.HMaterID.ToString() + "," + oMain.HUnitID.ToString() + "," + oMain.HAuxPropID.ToString() + "," + oMain.HProcID.ToString() +
                "," + oMain.HWhID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + "," + oMain.HGroupID.ToString() + ",'" + oMain.HAddr + "'" +
                "," + oMain.HQtyMust.ToString() + "," + oMain.HQty.ToString() + "," + oMain.HPieceQty.ToString() + ",'" + oMain.HBatchNo + "','" + oMain.HBarCode + "',''" +
                ",'" + oMain.HMaker + "',getdate()," + oMain.HSourceInterID.ToString() + "," + oMain.HSourceEntryID.ToString() + ",'" + oMain.HSourceBillType + "','" + oMain.HSourceBillNo + "'" +
@@ -47769,6 +47770,171 @@
            }
            oBar.HBarType = "物料条码";
            return oBar;
        }
        #endregion
        #region 一键扫码    扫描物料条码(条码类型 = "托盘条码")
        //扫描物料条码  存入条码出入库临时表
        [WebMethod]
        public Model.ClsKf_ICStockBill_WMS get_SavePonderationBillMain_Temp_PackBarCode(Model.ClsGy_BarCodeBill_WMS_Model_View omodel_View, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Int64 HSCWHID, Int64 HSCSPID, bool SourceFlag, string HSourceBillType, Int64 HStockOrgID, Int64 HStockOutOrgID, string HCusBarCode, string HCustom2, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
            string HMaterNumber;            //物料代码
            string sSourceBillCtl = "N";    //是否进行源单信息核对('Y'为核对源单信息)
            string sBatchNoCtl = "N";       //是否进行批号核对('Y'为核对批号)
            string sMultilineCtl = "N";     //是否存在多行相同物料时自动拆分换行('Y'为自动拆分)
            string sMustQtyCtl = "不控制";  //扫码数量能否可超单据数量控制(小于等于应收、完全等于应收、不控制)
            string sMaterWHSPCtl = "N";     //是否取物料默认仓库仓位('Y'为是)
            string sSourceWHSPCtl = "N";    //是否取源单中仓库仓位('Y'为是)
            string sOneScanCtl = "N";       //一次扫码控制('Y'为控制)
            string sFIFOCtl = "N";          //先进先出控制('Y'为控制)
            string sMulSourceCtl = "N";     //是否启用多源单扫码模式('Y'为启用)
            //根据单据类型,获取对应单据系统参数值
            if (get_SystemParameter_BarCode(HBillType, oSystemParameterMain, ref sSourceBillCtl, ref sBatchNoCtl, ref sMultilineCtl, ref sMustQtyCtl, ref sMaterWHSPCtl, ref sSourceWHSPCtl, ref sOneScanCtl, ref sFIFOCtl, ref sMulSourceCtl, ref sErrMsg))
            {
            }
            try
            {
                oCn.BeginTran();
                //蓝字入库、汇报模块,非无源单扫码、条码类型为 唯一条码 且为有源单生成的物料条码,扫描条码时自动带出源单信息,第一次扫码或启用多源单扫码模式
                //采购入库(1201)、生产入库(1202)、其他入库(1203)、委外入库(1210)、生产汇报(3711)
                if (HSourceBillType != "-1" && (SourceFlag == false || sMulSourceCtl == "Y")
                && (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1210" || HBillType == "3711"))
                {
                    Int64 HAccessFlag = 1;   //是否物料条码带出源单信息标志(0为直接扫源单条码,1为物料条码带出源单信息)
                    oBar = get_SourceBill_MaterBarCode(HInterID, HBillNo, HBillType, omodel_View.HSourceBillNo, omodel_View.HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg);
                    if (oBar == null)
                    {
                        oCn.RollBack();
                        return null;
                    }
                    else
                    {
                        SourceFlag = true;
                    }
                }
                else
                {
                    //无源单状态,设置源单类型为-1
                    if (SourceFlag == false)
                    {
                        //销售出库不允许无源单出库
                        if (HBillType == "1205")
                        {
                            sErrMsg = "不允许无源单出库,请先扫描源单!";
                            oCn.RollBack();
                            return null;
                        }
                        HSourceBillType = "-1";
                    }
                }
                //扫描托条码,将托条码信息写入条码出入库临时表
                DataSet ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + omodel_View.HBarCode + "','" + HSourceBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + HSCWHID.ToString() + "," + HSCSPID.ToString() + ",'" + HCusBarCode + "'," + HStockOrgID.ToString() + "," + HStockOutOrgID.ToString() + ",'" + HMaker + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + "," + sSourceBillCtl + ",'" + sBatchNoCtl + "','" + sMaterWHSPCtl + "','" + sSourceWHSPCtl + "','" + sMustQtyCtl + "','" + oSystemParameterMain.WMS_WMSStockCtl + "','" + sFIFOCtl + "','" + sMulSourceCtl + "'", "h_p_WMS_AddPackBarCode");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    sErrMsg = "扫描托条码写入条码出入库临时表发生错误!";
                    oCn.RollBack();
                    return null;
                }
                else
                {
                    if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0)
                    {
                        omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBarCodeType"]);
                    }
                    else
                    {
                        sErrMsg = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                        oCn.RollBack();
                        return null;
                    }
                }
                //生产领料(1204)、销售出库(1205)、其他出库蓝字(1206)、委外出库(1211)、生产补料(1254)
                //外购退料(1239)、产品退库(1245)、其他入库红字(1248)、委外退库(1246)
                //出库、红字入库,判断条码库存、ERP库存
                if (HBillType == "1204" || HBillType == "1205" || HBillType == "1206" || HBillType == "1211" || HBillType == "1254"
                    || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246")
                {
                    //库存控制-ERP负库存控制     私有云模式
                    if (oSystemParameterMain.WMS_ERPStockCtl == "Y" && oSystemParameterMain.WMS_CloudMode == "Y")
                    {
                        string HRemark = "";
                        double sERPQty = 0;
                        string sWhName = "";
                        string sSPName = "";
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            HMaterNumber = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HMaterNumber"]);
                            omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HAuxPropID"]);
                            omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HBatchNo"]);
                            HWhID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HWhID"]);
                            HSPID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HSPID"]);
                            omodel_View.HQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[i]["HQty"]);
                            //判断ERP库存   返回ERP库存数量
                            DataSet DsERP = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_GetERPICInventory " + HInterID.ToString() + ",'" + HBillType + "','" + HMaterNumber + "'," + omodel_View.HAuxPropID.ToString() + ",'" + omodel_View.HBatchNo + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + HStockOrgID.ToString(), "h_p_WMS_AddBarCode_GetERPICInventory");
                            if (DsERP == null || DsERP.Tables[0].Rows.Count == 0)
                            {
                                HRemark = HRemark+ "对应物料代码:" + HMaterNumber + "、批号:" + omodel_View.HBatchNo + " ,无金蝶库存!";
                            }
                            else
                            {
                                sERPQty = DBUtility.ClsPub.isDoule(DsERP.Tables[0].Rows[0]["HQty"]);
                                sWhName = DBUtility.ClsPub.isStrNull(DsERP.Tables[0].Rows[0]["HWhName"]);
                                sSPName = DBUtility.ClsPub.isStrNull(DsERP.Tables[0].Rows[0]["HSPName"]);
                                if (omodel_View.HQty > sERPQty)
                                {
                                    HRemark = HRemark + "对应物料代码:" + HMaterNumber + "、批号:" + omodel_View.HBatchNo + " ,在金蝶仓库[ " + sWhName + " ]、仓位[ " + sSPName + " ]中数量为:" + sERPQty + " ,小于所扫条码数量:" + omodel_View.HQty + " 金蝶库存不足!";
                                }
                            }
                        }
                        if(HRemark!="")
                        {
                            sErrMsg = "所扫描托条码:" + omodel_View.HBarCode + "," + HRemark;
                            oCn.RollBack();
                            return null;
                        }
                    }
                }
                //唯一条码,是否启用一次扫码控制('Y'为启用)
                if (omodel_View.HBarCodeType == "唯一条码" && sOneScanCtl == "Y")
                {
                    //一次扫码控制,同一条码、同一单据类型,在WMS表和TEMP表里,只允许进行一次扫码
                    DataSet dsOneScan = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_OneScan '" + omodel_View.HBarCode + "'," + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + HSCWHID.ToString() + "," + HSCSPID.ToString() + ",'" + HMaker + "'", "h_p_WMS_AddPackBarCode_OneScan");
                    if (dsOneScan == null || dsOneScan.Tables[0].Rows.Count == 0)
                    {
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(dsOneScan.Tables[0].Rows[0][0]) == 1)
                        {
                            sErrMsg = DBUtility.ClsPub.isStrNull(dsOneScan.Tables[0].Rows[0]["HRemark"]);
                            oCn.RollBack();
                            return null;
                        }
                    }
                }
                oBar.HBarType = "物料条码";
                oCn.Commit();
                return oBar;
            }
            catch (Exception e)
            {
                sErrMsg = e.Message;
                oCn.RollBack();
                return null;
            }
        }
        #endregion
@@ -48312,6 +48478,7 @@
            oMain.HBillType = HBillType;
            oMain.HMaker = HMaker;
            oMain.HMaterID = omodel_View.HMaterID;
            oMain.HUnitID = omodel_View.HUnitID;
            oMain.HAuxPropID = omodel_View.HAuxPropID;
            oMain.HQty = sRelQty;
            oMain.HQtyMust = 0;
@@ -48372,14 +48539,14 @@
            }
            oCn.RunProc("Insert into KF_PonderationBillMain_Temp " +
                "(HInterID,HBillNo,HBillType,HMaterID,HAuxPropID,HProcID" +
                "(HInterID,HBillNo,HBillType,HMaterID,HUnitID,HAuxPropID,HProcID" +
                ",HWhID,HSCWHID,HStockPlaceID,HOutStockPlaceID,HGroupID,HAddr" +
                ",HQtyMust,HQty,HPieceQty,HBatchNo,HBarCode,HBarCode_Pack" +
                ",HMaker,HMakeDate,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo" +
                ",HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag,HMTONo,HPlanMode" +
                ",HSTOCKORGID,HOtherOrgID,HOWNERID,HOWNERTYPEID,HExpressNumber,HSubBillType" +
                ",HCusID,HDeptID,HCusBarCode,HMulSourceBill,HBeginDate,HEndDate) " +
                " Values(" + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'," + oMain.HMaterID.ToString() + "," + oMain.HAuxPropID.ToString() + "," + oMain.HProcID.ToString() +
                " Values(" + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'," + oMain.HMaterID.ToString() + "," + oMain.HUnitID.ToString() + "," + oMain.HAuxPropID.ToString() + "," + oMain.HProcID.ToString() +
                "," + oMain.HWhID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + "," + oMain.HGroupID.ToString() + ",'" + oMain.HAddr + "'" +
                "," + oMain.HQtyMust.ToString() + "," + oMain.HQty.ToString() + "," + oMain.HPieceQty.ToString() + ",'" + oMain.HBatchNo + "','" + oMain.HBarCode + "',''" +
                ",'" + oMain.HMaker + "',getdate()," + oMain.HSourceInterID.ToString() + "," + oMain.HSourceEntryID.ToString() + ",'" + oMain.HSourceBillType + "','" + oMain.HSourceBillNo + "'" +
DLL/Model.dll
Binary files differ