| | |
| | | |
| | | //保存到出入库条码临时表(一张单据,存在相同物料) |
| | | [WebMethod] |
| | | public bool set_SavePonderationBillMain_Temp_Select_Qty(Model.ClsKF_PonderationBillMain_Temp oMain, Double sQty, ref string sErrMsg) |
| | | public bool set_SavePonderationBillMain_Temp_Select_Qty_Mould(Model.ClsSc_MouldStockBillMain_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.ClsKF_PonderationBillMain_Temp_Ctl_Mould dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould(); |
| | | DAL.ClsGy_BarCodeBill_View_Mould oBar = new DAL.ClsGy_BarCodeBill_View_Mould(); |
| | | dal.oModel = oMain; |
| | | if (!oBar.GetInfoByNumber_View(oMain.HBarCode)) |
| | | if (!oBar.GetInfoByNumber(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 |
| | | { |
| | |
| | | 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)) |
| | | if (dal.AddNew_Mould(oMain.HInterID,oMain.HMouldID,oMain.HBillType,oMain.HWhID,oMain.HSCWHID,oMain.HStockPlaceID,oMain.HOutStockPlaceID,oMain.HBarCode,oMain.HMaker,oMain.HOWNERID,oMain.HStockOrgID,oMain.HBillNo,oMain.HOtherOrgID)) |
| | | { |
| | | //sErrMsg = "保存成功!"; |
| | | return true; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //缓存列表界面,返回缓存列表信息(工序汇报转移单) |
| | | [WebMethod] |
| | | public DataSet GetKf_PonderationBillMain_TempList_ProcReportMove(string sHBillType, string sHMaker, Int64 sHOWNERID, Int64 sHSubBillType) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_KF_GetPonderationBillMain_TempList_ProcReportMove '" + sHBillType + "','" + sHMaker + "'," + sHOWNERID.ToString() + "," + sHSubBillType.ToString(), "h_p_KF_GetPonderationBillMain_TempList_ProcReportMove"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return Ds; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //保存到出入库条码临时表(单条码,一张单据一条条码) |
| | | [WebMethod] |
| | |
| | | public DataSet GetKf_PonderationBillMain_Temp(long HInterID, string sBillType, string sWhere) |
| | | { |
| | | DAL.ClsKF_PonderationBillMain_Temp_View dal = new DAL.ClsKF_PonderationBillMain_Temp_View(); |
| | | return dal.GetInfoByID_View(HInterID, sBillType, sWhere); |
| | | } |
| | | |
| | | |
| | | //返回出入库条码临时表(器具条码) |
| | | /// <summary> |
| | | /// 返回出入库条码临时表 |
| | | /// </summary> |
| | | /// <param name="sWhere">过滤条件</param> |
| | | /// <returns></returns> |
| | | [WebMethod] |
| | | public DataSet GetKf_PonderationBillMain_Temp_Mould(long HInterID, string sBillType, string sWhere) |
| | | { |
| | | DAL.ClsKF_PonderationBillMain_Temp_View_Mould dal = new DAL.ClsKF_PonderationBillMain_Temp_View_Mould(); |
| | | return dal.GetInfoByID_View(HInterID, sBillType, sWhere); |
| | | } |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | //生成器具采购入库单 |
| | | [WebMethod] |
| | | public bool set_SaveMouldProdInBill_New(Model.ClsSc_MouldProdInBillMain oMain, string sHSourceType, ref string sErrMsg) |
| | | { |
| | | //获取系统参数 |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBill(ref sErrMsg) == false) |
| | | { |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | // |
| | | //if (oSystemParameter.omodel.Kf_OtherInBill_ERPMode.ToUpper() == "CLOUD") //判断同步模式是金蝶CLOUD |
| | | //{ |
| | | //上传前必填项判断 |
| | | //if (oMain.HDeptID == 0) |
| | | //{ |
| | | // sErrMsg = "部门没有选择!"; |
| | | // return false; |
| | | //} |
| | | if (set_SaveMouldProdInBill_New(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true) |
| | | { |
| | | //"保存成功!"; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | //"保存失败!"; |
| | | return false; |
| | | } |
| | | //} |
| | | |
| | | sErrMsg = "保存器具采购入库单失败!" + sErrMsg; |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 器具采购入库单 |
| | | /// </summary> |
| | | /// <param name="oMain"></param> |
| | | /// <param name="sErrMsg"></param> |
| | | /// <returns></returns> |
| | | public bool set_SaveMouldProdInBill_New(Model.ClsSc_MouldProdInBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | //判断会计期是否合理 |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | sErrMsg = s; |
| | | return false; |
| | | } |
| | | oMain.HYear = sYear; |
| | | oMain.HPeriod = sPeriod; |
| | | |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(oMain.HInterID) + DBUtility.ClsPub.isStrNull(oMain.HBillNo); |
| | | |
| | | oCn.BeginTran(); |
| | | |
| | | //生成出入库单据 |
| | | //插入子表 |
| | | //插入主表 |
| | | oCn.RunProc("EXEC h_p_Kf_MouldProdInBill_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'"); |
| | | |
| | | //插入主表 |
| | | oCn.RunProc("Insert Into Sc_MouldStockBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HDate,HBillNo" + |
| | | ",HBillStatus,HRemark,HMaker,HMakeDate,HSCWHID" + |
| | | ",HSupID,HEmpID,HManagerID,HWHID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + |
| | | ") " + |
| | | " values('3801','3801'," + oMain.HInterID.ToString() + ",convert(varchar(10),getdate(),120),'" + oMain.HBillNo + "'" + |
| | | ", '" + oMain.HBillStatus + "','" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)," + oMain.HSCWHID.ToString() + |
| | | ", " + oMain.HSupID.ToString() + "," + oMain.HEmpID.ToString() + "," + oMain.HManagerID.ToString() + "," + oMain.HWHID.ToString() + "," + oMain.HManagerID.ToString() + |
| | | ", " + oMain.HKeeperID.ToString() + "," + oMain.HDeptID.ToString() + ",'" + oMain.HExplanation + "','" + oMain.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(oMain.HRedBlueFlag) + |
| | | ") "); |
| | | oCn.Commit(); |
| | | //更新关联数量 |
| | | |
| | | //if (oSystemParameterMain.Kf_OtherInBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | //{ |
| | | // //审核单据 |
| | | // //oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + oMain.HInterID.ToString()); |
| | | //} |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "器具采购入库单失败!" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #region 其它入库CLOUD * |
| | | |
| | | //生成入库单 |
| | |
| | | |
| | | |
| | | |
| | | //器具一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码) |
| | | [WebMethod] |
| | | public Model.ClsKf_ICStockBill_Mould get_CheckTypeByBarCode_Mould(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, string HExpressNumber, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Model.ClsKf_ICStockBill_Mould oBar = new Model.ClsKf_ICStockBill_Mould(); |
| | | DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould(); |
| | | Model.ClsSc_MouldStockBillMain_Temp model = new Model.ClsSc_MouldStockBillMain_Temp(); |
| | | string sHSourceBillType = ""; |
| | | string sHSourceBillNo = ""; |
| | | Int64 sHSupID = 0; |
| | | string sHSupName = ""; |
| | | Int64 sHDeptID = 0; |
| | | string sHDeptName = ""; |
| | | string sHBarType = ""; |
| | | |
| | | //获取系统参数 |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBill(ref sErrMsg) == false) |
| | | { |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return null; |
| | | } |
| | | //判断是否启用一键扫码模式,Y为启用,未启用时只扫描物料条码 |
| | | if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N") |
| | | { |
| | | //将物料条码信息写入出入库条码临时表 |
| | | if (set_SavePonderationBillMain_Temp_BarCode_Mould(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)) |
| | | { |
| | | oBar.HSourceBillType = sHSourceBillType; |
| | | oBar.HSourceBillNo = sHSourceBillNo; |
| | | oBar.HSupID = sHSupID; |
| | | oBar.HSupName = sHSupName; |
| | | oBar.HDeptID = sHDeptID; |
| | | oBar.HDeptName = sHDeptName; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | //一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码) |
| | | else |
| | | { |
| | | string sRedBlue = "蓝字"; |
| | | if (HRedBlueFlag) |
| | | { |
| | | sRedBlue = "红字"; |
| | | } |
| | | else |
| | | { |
| | | sRedBlue = "蓝字"; |
| | | } |
| | | DataSet Dss; |
| | | //根据递入的条码前三位,判断条码类型(仓库、仓位、部门、源单、物料条码) |
| | | Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType from Xt_BarCodeType where HSourceNumber= '" + sBarCode.Substring(0, 3) + "'", "Xt_BarCodeType"); |
| | | |
| | | //无返回数据则为物料条码 |
| | | if (Dss == null || Dss.Tables[0].Rows.Count == 0) |
| | | { |
| | | //将物料条码信息写入出入库条码临时表 |
| | | if (set_SavePonderationBillMain_Temp_BarCode_Mould(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)) |
| | | { |
| | | oBar.HSourceBillType = sHSourceBillType; |
| | | oBar.HSourceBillNo = sHSourceBillNo; |
| | | oBar.HSupID = sHSupID; |
| | | oBar.HSupName = sHSupName; |
| | | oBar.HDeptID = sHDeptID; |
| | | oBar.HDeptName = sHDeptName; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | string sBarBillName = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HSourceName"]); |
| | | string sBarBillType = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["BarCodeType"]); |
| | | |
| | | //判断条码类型为 基础资料条码 或 源单条码 |
| | | if (sBarBillType == "基础资料条码") |
| | | { |
| | | //仓库条码 |
| | | if (sBarBillName == "仓库") |
| | | { |
| | | DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View(); |
| | | //将递入的条码去掉前三位后转化成整形,TryParse不能转换成整数时返回false,并返回ID=0 |
| | | int ID; |
| | | if (int.TryParse(sBarCode.Remove(0, 3), out ID)) |
| | | { |
| | | if (dal.GetInfoByID(ID, HOWNERID)) |
| | | { |
| | | oBar.HBarType = "仓库条码"; |
| | | oBar.HWhID = dal.omodel.HItemID; |
| | | oBar.HWhNumber = dal.omodel.HNumber; |
| | | oBar.HWhName = dal.omodel.HName; |
| | | oBar.HSPFlag = dal.omodel.HIsStockMgr; |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "无效仓库条码!"; |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "错误的仓库条码!"; |
| | | return null; |
| | | } |
| | | } |
| | | //仓位条码 |
| | | else if (sBarBillName == "仓位") |
| | | { |
| | | DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View(); |
| | | //将递入的条码去掉前三位后转化成整形 |
| | | int sHSPID; |
| | | int sHWHID; |
| | | string[] sArray = sBarCode.Remove(0, 3).Split(';'); |
| | | if (int.TryParse(sArray[1], out sHSPID) && int.TryParse(sArray[0], out sHWHID)) |
| | | { |
| | | if (dal.GetInfoByID(sHSPID, sHWHID, HOWNERID)) |
| | | { |
| | | oBar.HBarType = "仓位条码"; |
| | | oBar.HSPID = dal.omodel.HItemID; |
| | | oBar.HSPNumber = dal.omodel.HNumber; |
| | | oBar.HSPName = dal.omodel.HName; |
| | | oBar.HWhID = dal.omodel.HWHID; |
| | | oBar.HWhNumber = dal.omodel.HWhNumber; |
| | | oBar.HWhName = dal.omodel.HWhName; |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "无效仓位条码!"; |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "错误的仓位条码!"; |
| | | return null; |
| | | } |
| | | } |
| | | //部门条码 |
| | | else if (sBarBillName == "部门") |
| | | { |
| | | DAL.ClsIF_Department_View dal = new DAL.ClsIF_Department_View(); |
| | | //将递入的条码去掉前三位后转化成整形 |
| | | int ID; |
| | | if (int.TryParse(sBarCode.Remove(0, 3), out ID)) |
| | | { |
| | | if (dal.GetInfoByID(ID)) |
| | | { |
| | | oBar.HBarType = "部门条码"; |
| | | oBar.HDeptID = dal.omodel.HItemID; |
| | | oBar.HDeptNumber = dal.omodel.HNumber; |
| | | oBar.HDeptName = dal.omodel.HName; |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "无效部门条码!"; |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "错误的部门条码!"; |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "无效基础资料条码!"; |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "无效条码类型!"; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //保存到出入库条码临时表(一张单据,存在相同物料) |
| | | [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 DeleteMould(long HInterID,string HBillNo, ref string sErrMsg) |
| | | { |
| | | DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould(); |
| | | if (dal.DeleteMould(HInterID, HBillNo)) |
| | | { |
| | | sErrMsg = "删除成功!"; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "删除失败!"; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | //扫描物料条码 保存到出入库条码临时表(物料) |
| | | [WebMethod] |
| | | public bool set_SavePonderationBillMain_Temp_BarCode_Mould(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, string HExpressNumber, ref string sHSourceBillNo, ref string sHSourceBillType, ref long sHSupID, ref string sHSupName, ref long sHDeptID, ref string sHDeptName, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould(); |
| | | Model.ClsSc_MouldStockBillMain_Temp model = new Model.ClsSc_MouldStockBillMain_Temp(); |
| | | double sRelQty = 0; |
| | | string sRedBlue = "蓝字"; |
| | | if (HRedBlueFlag) |
| | | { |
| | | sRedBlue = "红字"; |
| | | } |
| | | else |
| | | { |
| | | sRedBlue = "蓝字"; |
| | | } |
| | | //判断条码是否含特殊符号 # ,如果含有则 拆分 |
| | | string[] NewBarCode; |
| | | if (sBarCode.CompareTo("#") > 0) |
| | | { |
| | | NewBarCode = sBarCode.Split(Convert.ToChar("#")); |
| | | sBarCode = NewBarCode[0]; |
| | | } |
| | | //获取系统参数 |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBill(ref sErrMsg) == false) |
| | | { |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //蓝字产品入库、外购入库、委外入库、生产汇报,根据物料条码得到对应源单信息,非多源单模式 |
| | | //未扫描源单的情况下,第一次扫描物料条码获取源单信息并存入临时表 |
| | | //采购入库(1201)、产品入库(1202)、委外入库(1210)、生产汇报(3711) |
| | | if (SourceFlag == false && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711")) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | //无源单状态,设置源单类型为-1 |
| | | if (SourceFlag == false) |
| | | { |
| | | //销售出库不允许无源单出库 |
| | | if (HBillType == "1205") |
| | | { |
| | | sErrMsg = "不允许无源单出库,请先扫描源单!"; |
| | | return false; |
| | | } |
| | | HSourceBillType = "-1"; |
| | | } |
| | | } |
| | | //根据条码获取条码信息,存在相同物料时自动获取一行源单信息 |
| | | DAL.ClsGy_BarCodeBill_View_Mould dal = new DAL.ClsGy_BarCodeBill_View_Mould(); |
| | | if (dal.GetInfoByNumber(sBarCode)) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "无效条码"; |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //判断并获取 仓库 仓位信息 |
| | | DataSet ds4 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID"); |
| | | if (ds4 == null || ds4.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "判断并获取仓库仓位信息,未知错误!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | HWhID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HWHID"]); |
| | | HSPID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HSPID"]); |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(ds4.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | //判断条码扫描数量 返回剩余未扫描数量 |
| | | //if (tem.IsBarCode_New(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.HMouldID = dal.omodel_View.HMaterID; |
| | | model.HAuxPropID = dal.omodel_View.HAuxPropID; |
| | | //model.HQty = sRelQty; |
| | | //model.HQtyMust = dal.omodel_View.HinitQty; |
| | | model.HQty = 1; |
| | | model.HQtyMust = 1; |
| | | model.HBarCode = sBarCode; |
| | | 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.HOtherOrgID = HOWNERID; |
| | | model.HOWNERID = HOWNERID; |
| | | |
| | | ////获取系统参数 |
| | | //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | //if (oSystemParameter.ShowBill(ref sErrMsg) == false) |
| | | //{ |
| | | // sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | // return false; |
| | | //} |
| | | |
| | | //物料条码写入临时表时,判断仓库仓位是否正确 |
| | | DataSet ds5 = oCn.RunProcReturn("exec h_p_WMS_CheckWHandSP " + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString(), "h_p_WMS_CheckWHandSP"); |
| | | if (ds5 == null || ds5.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "扫描物料条码存入临时表时判断仓库仓位是否正确,未知错误!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds5.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(ds5.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //将物料条码信息写入出入库条码临时表 |
| | | if (set_SavePonderationBillMain_Temp_Select_Qty_Mould(model, HQty, ref sErrMsg)) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "扫描失败!" + sErrMsg; |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |