新增流水线采集扫描物料条码调用方法,新增生产入库多源单缓存列表显示数据调用方法
1个文件已修改
199 ■■■■■ 已修改文件
CLOUDWEB/WebService1.asmx.cs 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CLOUDWEB/WebService1.asmx.cs
@@ -22214,6 +22214,22 @@
            return dal.GetKf_PonderationBillMain_TempList(sHBillType, sWhere);
        }
        //返回缓存列表信息  同步资料(生产入库多源单箱发专用)
        [WebMethod]
        public DataSet GetKf_PonderationBillMain_TempList_XF(string sHBillType,string HMaker,long HOWNERID,int sXFFlag)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            DataSet Ds = oCn.RunProcReturn("exec h_p_KF_GetPonderationBillMain_TempList_XFHanDian '" + sHBillType + "','" + HMaker + "'," + HOWNERID + "," + sXFFlag , "h_p_KF_GetPonderationBillMain_TempList_XFHanDian");
            if (Ds == null || Ds.Tables[0].Rows.Count == 0)
            {
                return null;
            }
            else
            {
                return Ds;
            }
        }
        //返回缓存列表信息  同步资料(倒箱单)
        [WebMethod]
        public DataSet GetKf_PonderationBillMain_TempList_ChangeBox(string sHBillType, string sWhere)
@@ -27125,6 +27141,189 @@
        #endregion
        #region 扫描物料条码    流水线采集专用
        [WebMethod]
        public Model.ClsKf_ICStockBill_WMS get_CheckTypeByBarCode_Caiji(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, bool HRedBlueFlag, string HSourceBillType, Int64 HOWNERID, ref string sErrMsg)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
            //将物料条码信息写入出入库条码临时表
            if (set_SavePonderationBillMain_Temp_BarCode_Caiji(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HRedBlueFlag, HSourceBillType, HOWNERID, ref sErrMsg))
            {
                //从条码出入库临时表 中获取该单据下该条码的仓库仓位信息
                DataSet dsWS = oCn.RunProcReturn("exec h_p_Kf_GetOrgandWHSPByTemp_CLD " + HBillID.ToString() + ",'" + sBarCode + "'", "h_p_Kf_GetOrgandWHSPByTemp_CLD");
                if (dsWS == null || dsWS.Tables[0].Rows.Count == 0)
                {
                    sErrMsg = "获取所扫描条码入库仓库仓位信息失败!";
                    return null;
                }
                else
                {
                    oBar.HOWNERID = DBUtility.ClsPub.isLong(dsWS.Tables[0].Rows[0]["HOWNERID"]);
                    oBar.HOWNERNAME = DBUtility.ClsPub.isStrNull(dsWS.Tables[0].Rows[0]["HOWNERNAME"]);
                    oBar.HWhID = DBUtility.ClsPub.isLong(dsWS.Tables[0].Rows[0]["HWhID"]);
                    oBar.HWhName = DBUtility.ClsPub.isStrNull(dsWS.Tables[0].Rows[0]["HWhName"]);
                    oBar.HSPID = DBUtility.ClsPub.isLong(dsWS.Tables[0].Rows[0]["HSPID"]);
                    oBar.HSPName = DBUtility.ClsPub.isStrNull(dsWS.Tables[0].Rows[0]["HSPName"]);
                }
            }
            else
            {
                sErrMsg = "扫描失败!" + sErrMsg;
                return null;
            }
            return oBar;
        }
        #endregion
        #region 扫描物料条码    流水线采集专用
        //扫描物料条码    保存到出入库条码临时表(物料) 流水线采集模块
        [WebMethod]
        public bool set_SavePonderationBillMain_Temp_BarCode_Caiji(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, bool HRedBlueFlag, string HSourceBillType, Int64 HOWNERID, ref string sErrMsg)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            DAL.ClsKF_PonderationBillMain_Temp_Ctl tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
            Model.ClsKF_PonderationBillMain_Temp model = new Model.ClsKF_PonderationBillMain_Temp();
            double sRelQty = 0;
            //判断条码是否含特殊符号 # ,如果含有则 拆分
            string[] NewBarCode;
            if (sBarCode.CompareTo("#") > 0)
            {
                NewBarCode = sBarCode.Split(Convert.ToChar("#"));
                sBarCode = NewBarCode[0];
            }
            //根据条码获取条码信息
            DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
            if (dal.GetInfoByNumber_View(sBarCode))
            {
                //从条码表中获取条码源单类型信息
                DataSet ds2 = oCn.RunProcReturn(" select HSourceBillType from Gy_BarCodeBill where HBarCodeType='唯一条码' and HBarCode='" + sBarCode + "'", "Gy_BarCodeBill");
                if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
                {
                    sErrMsg = "条码类型不正确!";
                    return false;
                }
                else
                {
                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0][0]) != "3710")
                    {
                        sErrMsg = "条码源单信息错误,所扫条码源单类型必须为生产订单!";
                        return false;
                    }
                }
            }
            else
            {
                sErrMsg = "无效条码";
                return false;
            }
            //判断并获取 仓库 仓位信息
            DataSet ds3 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID");
            if (ds3 == null || ds3.Tables[0].Rows.Count == 0)
            {
                sErrMsg = "判断并获取仓库仓位信息,未知错误!";
                return false;
            }
            else
            {
                if (DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0][0]) == 0)
                {
                    HWhID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HWHID"]);
                    HSPID = DBUtility.ClsPub.isLong(ds3.Tables[0].Rows[0]["HSPID"]);
                }
                else
                {
                    sErrMsg = DBUtility.ClsPub.isStrNull(ds3.Tables[0].Rows[0]["HRemark"]);
                    return false;
                }
            }
            //获取条码数量
            if (dal.omodel_View.HBarCodeType != "托盘条码")
            {
                sRelQty = dal.omodel_View.HQty;
                if (HRedBlueFlag)
                {
                    //判断条码库存   返回库存数量 仓库 仓位
                    DAL.ClsKF_PonderationBillMain_Temp_View Tempdal = new DAL.ClsKF_PonderationBillMain_Temp_View();
                    if (Tempdal.CheckQtyByBarCode(HBillID, HBillType, sBarCode, ref HWhID, ref HSPID, sRelQty, ref sRelQty))
                    {
                    }
                    else
                    {
                        if (sRelQty == 0)
                        {
                            sErrMsg = "无库存!";
                            return false;
                        }
                        else
                        {
                            sErrMsg = "库存不足,已获取实际库存数量!";
                        }
                    }
                }
                else
                {
                    //判断条码扫描数量   返回剩余未扫描数量
                    if (tem.IsBarCode(sBarCode, HBillType, HRedBlueFlag, ref sRelQty, ref sErrMsg))
                    {
                    }
                    else
                    {
                        sErrMsg = sErrMsg;
                        return false;
                    }
                }
            }
            model.HInterID = HBillID;
            model.HBillNo = HBillNo;
            model.HBillType = HBillType;
            model.HMaker = HMaker;
            //
            model.HMaterID = dal.omodel_View.HMaterID;
            model.HAuxPropID = dal.omodel_View.HAuxPropID;
            model.HErpClsID = dal.omodel_View.HErpClsID;
            model.HQty = sRelQty;
            model.HQtyMust = 0;
            model.HBarCode = dal.omodel_View.HBarCode;
            model.HBatchNo = dal.omodel_View.HBatchNo;
            model.HMTONo = dal.omodel_View.HMTONo;
            model.HWhID = HWhID;
            model.HStockPlaceID = HSPID;
            model.HSourceInterID = dal.omodel_View.HSourceInterID;
            model.HSourceEntryID = dal.omodel_View.HSourceEntryID;
            model.HSourceBillNo = dal.omodel_View.HSourceBillNo;
            model.HSourceBillType = HSourceBillType;
            model.HRedBlueFlag = HRedBlueFlag;
            model.HPieceQty = 1;
            model.HSTOCKORGID = dal.omodel_View.HSTOCKORGID;
            model.HOWNERID = dal.omodel_View.HOWNERID;
            //将物料条码信息写入出入库条码临时表
            if (set_SavePonderationBillMain_Temp_Select_Qty(model, 0, ref sErrMsg))
            {
            }
            else
            {
                sErrMsg = "扫描失败!" + sErrMsg;
                return false;
            }
            return true;
        }
        #endregion
        #endregion