| | |
| | | return null; |
| | | } |
| | | |
| | | if (sBarCode.Trim() == "") |
| | | sBarCode = sBarCode.Trim(); |
| | | if (sBarCode == "") |
| | | { |
| | | sErrMsg = "条码不能为空,请扫描条码!"; |
| | | return null; |
| | |
| | | else |
| | | { |
| | | //根据递入的条码前三位,判断条码类型(仓库条码、仓位条码、部门条码、源单条码、物料条码) |
| | | DataSet Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType,HSourceBillType from Xt_BarCodeType with(nolock) where HSourceNumber= '" + sBarCodePrefix + "'", "Xt_BarCodeType"); |
| | | DataSet Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType,HSourceBillType from Xt_BarCodeType with(nolock) where HSourceNumber= '" + sBarCodePrefix + "' and (HBillType = '' or HBillType ='" + HBillType + "')", "Xt_BarCodeType"); |
| | | |
| | | //无返回数据则为物料条码 |
| | | if (Dss == null || Dss.Tables[0].Rows.Count == 0) |
| | |
| | | DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View(); |
| | | string sBarCodePrefix = sBarCode.Substring(0, Math.Min(3, sBarCode.Length));//截取条码前三位字符串 |
| | | |
| | | if (sBarCodePrefix == "PAK") |
| | | //根据系统参数,判断是否启用一键扫码模式,Y为启用 |
| | | //未启用,只扫描物料条码 |
| | | if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N") |
| | | { |
| | | bool HRedBlueFlag = false; |
| | | //将模治具信息写入模治具出入库临时表 |
| | | DataSet Mould = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode_New '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + HSCWHID.ToString() + "," + HSCSPID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HRedBlueFlag + "','" + HMaker + "'," + HStockOutOrgID.ToString(), "h_p_WMS_AddMouldBarCode_New"); |
| | | if (Mould == null || Mould.Tables[0].Rows.Count == 0) |
| | | if (sBarCodePrefix == "PAK") |
| | | { |
| | | sErrMsg = "将模治具信息写入模治具出入库临时表失败!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Mould.Tables[0].Rows[0][0]) == 0) |
| | | bool HRedBlueFlag = false; |
| | | //将模治具信息写入模治具出入库临时表 |
| | | DataSet Mould = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode_New '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + HSCWHID.ToString() + "," + HSCSPID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HRedBlueFlag + "','" + HMaker + "'," + HStockOutOrgID.ToString(), "h_p_WMS_AddMouldBarCode_New"); |
| | | if (Mould == null || Mould.Tables[0].Rows.Count == 0) |
| | | { |
| | | oBar.HBarType = "模治具条码"; |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(Mould.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (dal.GetInfoByBarCode_View(sBarCode)) |
| | | { |
| | | if (dal.omodel_View.HStopflag) |
| | | { |
| | | sErrMsg = "条码已被禁用,不允许扫描!"; |
| | | sErrMsg = "将模治具信息写入模治具出入库临时表失败!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | //森楷专用 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "森楷") //系统参数 客户定制化名称 空白为通用 |
| | | if (DBUtility.ClsPub.isLong(Mould.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock_SenKai(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, "整托扫码", oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | oBar.HBarType = "模治具条码"; |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | //托盘条码 卓力 |
| | | if (dal.omodel_View.HBarCodeType == "托盘条码" && oSystemParameter.omodel.WMS_CampanyName == "卓力") |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(Mould.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (dal.GetInfoByBarCode_View(sBarCode)) |
| | | { |
| | | if (dal.omodel_View.HStopflag) |
| | | { |
| | | sErrMsg = "条码已被禁用,不允许扫描!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | //森楷专用 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "森楷") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_Pack_MoveStock_ZhuoLi(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料托条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | //判断条码类型是否为托盘条码,如果是托盘条码则分解并模拟扫码 |
| | | else if (dal.omodel_View.HBarCodeType == "托盘条码") |
| | | { |
| | | //分解托盘条码得到明细条码信息写入条码出入库临时表 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "分解托盘条码发生错误!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]); |
| | | dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]); |
| | | dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]); |
| | | dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]); |
| | | dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]); |
| | | dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]); |
| | | dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]); |
| | | dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]); |
| | | dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]); |
| | | //无源单状态,设置源单类型为-1 |
| | | if (SourceFlag == false) |
| | | { |
| | | HSourceBillType = "-1"; |
| | | } |
| | | if (i != 0) |
| | | { |
| | | SourceFlag = true; |
| | | } |
| | | |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return oBar; |
| | | } |
| | | } |
| | | else |
| | | //条码类型不为托盘条码 |
| | | { |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg)) |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock_SenKai(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, "整托扫码", oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | //托盘条码 卓力 |
| | | if (dal.omodel_View.HBarCodeType == "托盘条码" && oSystemParameter.omodel.WMS_CampanyName == "卓力") |
| | | { |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_Pack_MoveStock_ZhuoLi(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料托条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | //判断条码类型是否为托盘条码,如果是托盘条码则分解并模拟扫码 |
| | | else if (dal.omodel_View.HBarCodeType == "托盘条码") |
| | | { |
| | | //分解托盘条码得到明细条码信息写入条码出入库临时表 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "分解托盘条码发生错误!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]); |
| | | dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]); |
| | | dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]); |
| | | dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]); |
| | | dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]); |
| | | dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]); |
| | | dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]); |
| | | dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]); |
| | | dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]); |
| | | //无源单状态,设置源单类型为-1 |
| | | if (SourceFlag == false) |
| | | { |
| | | HSourceBillType = "-1"; |
| | | } |
| | | if (i != 0) |
| | | { |
| | | SourceFlag = true; |
| | | } |
| | | |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return oBar; |
| | | } |
| | | } |
| | | else |
| | | //条码类型不为托盘条码 |
| | | { |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "条码档案中不存在该条码,请确认条码是否正确或是否已被删除!"; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | //启用,根据条码前缀走不同方法(仓库条码、仓位条码、部门条码、源单条码、物料条码) |
| | | else |
| | | { |
| | | //根据递入的条码前三位,判断条码类型(仓库条码、仓位条码、部门条码、源单条码、物料条码) |
| | | DataSet Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType,HSourceBillType from Xt_BarCodeType with(nolock) where HSourceNumber= '" + sBarCodePrefix + "' and (HBillType = '' or HBillType ='" + HBillType + "')", "Xt_BarCodeType"); |
| | | |
| | | //无返回数据则为物料条码 |
| | | if (Dss == null || Dss.Tables[0].Rows.Count == 0) |
| | | { |
| | | if (sBarCodePrefix == "PAK") |
| | | { |
| | | bool HRedBlueFlag = false; |
| | | //将模治具信息写入模治具出入库临时表 |
| | | DataSet Mould = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode_New '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + HSCWHID.ToString() + "," + HSCSPID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HRedBlueFlag + "','" + HMaker + "'," + HStockOutOrgID.ToString(), "h_p_WMS_AddMouldBarCode_New"); |
| | | if (Mould == null || Mould.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "将模治具信息写入模治具出入库临时表失败!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Mould.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | oBar.HBarType = "模治具条码"; |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(Mould.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (dal.GetInfoByBarCode_View(sBarCode)) |
| | | { |
| | | if (dal.omodel_View.HStopflag) |
| | | { |
| | | sErrMsg = "条码已被禁用,不允许扫描!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | //森楷专用 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "森楷") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock_SenKai(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, "整托扫码", oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | //托盘条码 卓力 |
| | | if (dal.omodel_View.HBarCodeType == "托盘条码" && oSystemParameter.omodel.WMS_CampanyName == "卓力") |
| | | { |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_Pack_MoveStock_ZhuoLi(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料托条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | //判断条码类型是否为托盘条码,如果是托盘条码则分解并模拟扫码 |
| | | else if (dal.omodel_View.HBarCodeType == "托盘条码") |
| | | { |
| | | //分解托盘条码得到明细条码信息写入条码出入库临时表 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "分解托盘条码发生错误!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | dal.omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | dal.omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCodeType"]); |
| | | dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HMaterID"]); |
| | | dal.omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HAuxPropID"]); |
| | | dal.omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBatchNo"]); |
| | | dal.omodel_View.HQty = DBUtility.ClsPub.isDoule(dsTBarCode.Tables[0].Rows[i]["HQty"]); |
| | | dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceInterID"]); |
| | | dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[i]["HSourceEntryID"]); |
| | | dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HSourceBillNo"]); |
| | | dal.omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HMTONo"]); |
| | | //无源单状态,设置源单类型为-1 |
| | | if (SourceFlag == false) |
| | | { |
| | | HSourceBillType = "-1"; |
| | | } |
| | | if (i != 0) |
| | | { |
| | | SourceFlag = true; |
| | | } |
| | | |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return oBar; |
| | | } |
| | | } |
| | | else |
| | | //条码类型不为托盘条码 |
| | | { |
| | | //将物料条码信息写入条码出入库临时表 |
| | | if (!set_SavePonderationBillMain_Temp_BarCode_MoveStock(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, HQty, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描物料条码失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "条码档案中不存在该条码,请确认条码是否正确或是否已被删除!"; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | //仓库条码、仓位条码、部门条码、源单条码 |
| | | else |
| | | { |
| | | sErrMsg = "条码档案中不存在该条码,请确认条码是否正确或是否已被删除!"; |
| | | return null; |
| | | string sBarBillName = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HSourceName"]); |
| | | string sBarBillType = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["BarCodeType"]); |
| | | string sSourceBillType = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HSourceBillType"]); |
| | | |
| | | //判断条码类型为 基础资料条码 或 源单条码 |
| | | if (sBarBillType == "基础资料条码") |
| | | { |
| | | oBar = get_BaseSet(sBarCode, HStockOutOrgID, sBarBillName, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | sErrMsg = "启用一键扫码模式," + sErrMsg; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return oBar; |
| | | } |
| | | } |
| | | //源单条码 |
| | | else if (sBarBillType == "源单条码") |
| | | { |
| | | oBar = get_BillBarCode(HBillID, HBillNo, HBillType, sBarCode, sSourceBillType, HMaker, 0, 0, 0, HStockOutOrgID, oSystemParameter.omodel, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | sErrMsg = "启用一键扫码模式," + sErrMsg; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | oBar.HBarType = "源单条码"; |
| | | return oBar; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "启用一键扫码模式,所扫条码前缀设置错误!"; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | } |