| | |
| | | |
| | | if (HReturn.Contains("\"IsSuccess\":false") == true) |
| | | { |
| | | sErrMsg = "生成生产汇报单失败!" + HReturn + sJson; |
| | | sErrMsg = "生成生产汇报单失败!" + HReturn; |
| | | //sErrMsg = "生成生产汇报单失败!" + HReturn + sJson; |
| | | LogService.Write("生成生产汇报单(源单:生产订单)失败!" + HReturn + sJson); //写入txt文本 |
| | | oCn.RollBack(); |
| | | return false; |
| | |
| | | //判断是否启用一键扫码模式,Y为启用,未启用时只扫描物料条码 |
| | | if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N") |
| | | { |
| | | //根据单个条码获取对应整托条码信息写入条码出入库临时表 |
| | | string sBarCode_New; |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','整托扫码'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | if (set_SavePonderationBillMain_Temp_BarCode_SenKai(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)) |
| | | { |
| | | sErrMsg = "获取整托条码信息发生错误!"; |
| | | return null; |
| | | oBar.HSourceBillType = sHSourceBillType; |
| | | oBar.HSourceBillNo = sHSourceBillNo; |
| | | oBar.HSupID = sHSupID; |
| | | oBar.HSupName = sHSupName; |
| | | oBar.HDeptID = sHDeptID; |
| | | oBar.HDeptName = sHDeptName; |
| | | } |
| | | 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 if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) |
| | | { |
| | | sErrMsg = "此模块不允许反向拆码!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (HBillType == "1203") |
| | | { |
| | | HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]); |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]); |
| | | |
| | | Int64 sMulSourceFlag = 0; //多源单标志(0为非多源单模式,1为多源单模式) |
| | | if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //系统参数 其他入库单-多源单模式 |
| | | { |
| | | sMulSourceFlag = 1; |
| | | } |
| | | |
| | | //将源单信息存入条码出入库临时表 |
| | | DataSet dsyd = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn"); |
| | | if (dsyd == null || dsyd.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";将条码对应源单信息存入条码出入库临时表失败!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsyd.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | SourceFlag = true; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";" + DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, 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 + ";扫描失败!" + sBarCode_New + sErrMsg; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return oBar; |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | //一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码) |
| | | else |
| | |
| | | //无返回数据则为物料条码 |
| | | if (Dss == null || Dss.Tables[0].Rows.Count == 0) |
| | | { |
| | | //根据单个条码获取对应整托条码信息写入条码出入库临时表 |
| | | string sBarCode_New; |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','整托扫码'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | if (set_SavePonderationBillMain_Temp_BarCode_SenKai(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)) |
| | | { |
| | | sErrMsg = "获取整托条码信息发生错误!"; |
| | | return null; |
| | | oBar.HSourceBillType = sHSourceBillType; |
| | | oBar.HSourceBillNo = sHSourceBillNo; |
| | | oBar.HSupID = sHSupID; |
| | | oBar.HSupName = sHSupName; |
| | | oBar.HDeptID = sHDeptID; |
| | | oBar.HDeptName = sHDeptName; |
| | | } |
| | | 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 if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) |
| | | { |
| | | sErrMsg = "此模块不允许反向拆码!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (HBillType == "1203") |
| | | { |
| | | HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]); |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]); |
| | | |
| | | Int64 sMulSourceFlag = 0; //多源单标志(0为非多源单模式,1为多源单模式) |
| | | if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //系统参数 其他入库单-多源单模式 |
| | | { |
| | | sMulSourceFlag = 1; |
| | | } |
| | | |
| | | //将源单信息存入条码出入库临时表 |
| | | DataSet dsyd = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn"); |
| | | if (dsyd == null || dsyd.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";将条码对应源单信息存入条码出入库临时表失败!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsyd.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | SourceFlag = true; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";" + DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, 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 + ";扫描失败!" + sBarCode_New + sErrMsg; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return oBar; |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | |
| | | //判断是否启用一键扫码模式,Y为启用,未启用时只扫描物料条码 |
| | | if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N") |
| | | { |
| | | //根据单个条码获取对应整托条码信息写入条码出入库临时表 |
| | | string sBarCode_New; |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','" + HScanStyle + "'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | if (set_SavePonderationBillMain_Temp_BarCode_SenKai(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, HScanStyle, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "获取整托条码信息发生错误!"; |
| | | return null; |
| | | oBar.HSourceBillType = sHSourceBillType; |
| | | oBar.HSourceBillNo = sHSourceBillNo; |
| | | oBar.HSupID = sHSupID; |
| | | oBar.HSupName = sHSupName; |
| | | oBar.HDeptID = sHDeptID; |
| | | oBar.HDeptName = sHDeptName; |
| | | } |
| | | 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 if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) |
| | | { |
| | | oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HBillID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, 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_New + sErrMsg; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return oBar; |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | //一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码) |
| | | else |
| | |
| | | //无返回数据则为物料条码 |
| | | if (Dss == null || Dss.Tables[0].Rows.Count == 0) |
| | | { |
| | | //根据单个条码获取对应整托条码信息写入条码出入库临时表 |
| | | string sBarCode_New; |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','" + HScanStyle + "'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | if (set_SavePonderationBillMain_Temp_BarCode_SenKai(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, HScanStyle, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg)) |
| | | { |
| | | sErrMsg = "获取整托条码信息发生错误!"; |
| | | return null; |
| | | oBar.HSourceBillType = sHSourceBillType; |
| | | oBar.HSourceBillNo = sHSourceBillNo; |
| | | oBar.HSupID = sHSupID; |
| | | oBar.HSupName = sHSupName; |
| | | oBar.HDeptID = sHDeptID; |
| | | oBar.HDeptName = sHDeptName; |
| | | } |
| | | 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 if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) |
| | | { |
| | | oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HBillID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | sBarCode_New = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | if (set_SavePonderationBillMain_Temp_BarCode(sBarCode_New, 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_New + sErrMsg; |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return oBar; |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sBarCode + sErrMsg; |
| | | return null; |
| | | } |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 扫描物料条码 存入出入库条码临时表 森楷专用 |
| | | |
| | | //扫描物料条码 保存到出入库条码临时表(物料) |
| | | [WebMethod] |
| | | public bool set_SavePonderationBillMain_Temp_BarCode_SenKai(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, string HScanStyle, 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 tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl(); |
| | | Model.ClsKF_PonderationBillMain_Temp model = new Model.ClsKF_PonderationBillMain_Temp(); |
| | | DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View(); |
| | | //double sRelQty = 0; |
| | | string sBarCode_New = ""; |
| | | |
| | | //判断条码是否含特殊符号 # ,如果含有则 拆分 |
| | | string[] NewBarCode; |
| | | if (sBarCode.Contains("#")) |
| | | { |
| | | NewBarCode = sBarCode.Split(Convert.ToChar("#")); |
| | | sBarCode = NewBarCode[0]; |
| | | HQty = DBUtility.ClsPub.isDoule(NewBarCode[1]); |
| | | } |
| | | |
| | | //获取系统参数 |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBill(ref sErrMsg) == false) |
| | | { |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | |
| | | if (dal.GetInfoByNumber_View(sBarCode)) |
| | | { |
| | | //根据单个条码获取对应整托条码信息 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToBarCode_ScanStyle '" + sBarCode + "'," + HBillID.ToString() + ",'" + HBillType + "','" + HScanStyle + "'", "h_p_WMS_BeforeCheckToBarCode_ScanStyle"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "获取整托条码信息发生错误!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0][0]) == 2) |
| | | { |
| | | if (HBillType == "1205" || HBillType == "1206") |
| | | { |
| | | oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HBillID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "此模块不允许反向拆码!"; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]); |
| | | dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0]["HSourceEntryID"]); |
| | | dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0]["HSourceInterID"]); |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]); |
| | | //获取仓库仓位信息 |
| | | if (HWhID == 0) |
| | | { |
| | | HWhID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0]["HWHID"]); |
| | | HSPID = DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0]["HSPID"]); |
| | | } |
| | | else |
| | | { |
| | | if (HBillType != "1203" && (HWhID != DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0]["HWHID"]) || HSPID != DBUtility.ClsPub.isLong(dsTBarCode.Tables[0].Rows[0]["HSPID"]))) |
| | | { |
| | | sErrMsg = "条码对应物料在界面所选仓库、仓位上无库存!"; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //将整托条码对应的条码编号拼成一串字符串 |
| | | for (int i = 0; i < dsTBarCode.Tables[0].Rows.Count; i++) |
| | | { |
| | | sBarCode_New = sBarCode_New + "," + DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[i]["HBarCode"]); |
| | | } |
| | | sBarCode_New = sBarCode_New.Remove(0, 1); //去掉字符串第一个字符 |
| | | |
| | | if (HBillType == "1203") |
| | | { |
| | | HSourceBillNo = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillNo"]); |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HSourceBillType"]); |
| | | |
| | | Int64 sMulSourceFlag = 0; //多源单标志(0为非多源单模式,1为多源单模式) |
| | | if (oSystemParameter.omodel.Kf_OtherInBill_MulSourceBill.ToUpper() == "Y") //系统参数 其他入库单-多源单模式 |
| | | { |
| | | sMulSourceFlag = 1; |
| | | } |
| | | |
| | | //将源单信息存入条码出入库临时表 |
| | | DataSet dsyd = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HBillID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HOWNERID.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn"); |
| | | if (dsyd == null || dsyd.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "将条码对应源单信息存入条码出入库临时表失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsyd.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | sHSourceBillType = DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HSourceBillType"]); |
| | | sHSourceBillNo = DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HSourceBillNo"]); |
| | | sHSupID = DBUtility.ClsPub.isLong(dsyd.Tables[0].Rows[0]["HSupID"]); |
| | | sHSupName = DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HSupName"]); |
| | | sHDeptID = DBUtility.ClsPub.isLong(dsyd.Tables[0].Rows[0]["HDeptID"]); |
| | | sHDeptName = DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HDeptName"]); |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HSourceBillType"]); |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(dsyd.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //无源单状态,设置源单类型为-1 |
| | | if (SourceFlag == false) |
| | | { |
| | | HSourceBillType = "-1"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (HExpressNumber == "工序汇报转移单") |
| | | { |
| | | model.HSubBillType = "1270"; |
| | | HExpressNumber = ""; |
| | | } |
| | | 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 = dal.omodel_View.HQty; |
| | | 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 = HOWNERID; |
| | | model.HOWNERID = HOWNERID; |
| | | model.HCusBarCode = HExpressNumber; |
| | | |
| | | //物料条码写入临时表时,判断仓库仓位是否正确 |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | string sOneScanCtl = "N"; //一次扫码控制('Y'为控制) |
| | | if (HBillType == "1203" && oSystemParameter.omodel.Kf_OtherInBill_BillTypeOneScan.ToUpper() == "Y") |
| | | { |
| | | sOneScanCtl = "Y"; |
| | | } |
| | | else if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBill_BillTypeOneScan.ToUpper() == "Y") |
| | | { |
| | | sOneScanCtl = "Y"; |
| | | } |
| | | else if (HBillType == "1206" && oSystemParameter.omodel.Kf_OtherOutBill_BillTypeOneScan.ToUpper() == "Y") |
| | | { |
| | | sOneScanCtl = "Y"; |
| | | } |
| | | |
| | | //一次扫码控制,同一条码、同一单据类型,在WMS表和TEMP表里,只允许进行一次扫码 |
| | | if (dal.omodel_View.HBarCodeType == "唯一条码" && sOneScanCtl == "Y") |
| | | { |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_WMS_CheckBarCodeOneScan " + model.HInterID.ToString() + ",'" + DBUtility.ClsPub.isStrNull(dsTBarCode.Tables[0].Rows[0]["HBarCode"]) + "','" + model.HBillType + "'," + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString() + "," + model.HSCWHID.ToString() + "," + model.HOutStockPlaceID.ToString() + ",'" + model.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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //将物料条码信息写入出入库条码临时表 |
| | | oCn.RunProc("Insert into KF_PonderationBillMain_Temp " + |
| | | "(HInterID,HBillNo,HBillType,HMaterID,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) " + |
| | | " select " + model.HInterID.ToString() + ",'" + model.HBillNo + "','" + model.HBillType + "',HMaterID,HAuxPropID," + model.HProcID.ToString() + |
| | | "," + model.HWhID.ToString() + "," + model.HSCWHID.ToString() + "," + model.HStockPlaceID.ToString() + "," + model.HOutStockPlaceID.ToString() + "," + model.HGroupID.ToString() + ",'" + model.HAddr + "'" + |
| | | "," + model.HQtyMust.ToString() + ",HQty," + model.HPieceQty.ToString() + ",HBatchNo,HBarCode,''" + |
| | | ",'" + model.HMaker + "',getdate()," + model.HSourceInterID.ToString() + "," + model.HSourceEntryID.ToString() + ",'" + model.HSourceBillType + "','" + model.HSourceBillNo + "'" + |
| | | "," + model.HRelationInterID.ToString() + "," + model.HRelationEntryID.ToString() + ",'" + model.HRelationBillNo + "'," + Convert.ToString(model.HRedBlueFlag ? 1 : 0) + ",'" + model.HMTONo + "',0" + |
| | | "," + model.HSTOCKORGID.ToString() + "," + model.HOWNERID.ToString() + "," + model.HSTOCKORGID.ToString() + ",'','','" + model.HSubBillType + "'" + |
| | | ",0,0,'" + model.HCusBarCode + "'," + model.HMulSourceBill.ToString() + |
| | | "from Gy_BarCodeBill with(nolock) where charindex(',' + HBarCode + ',',',' + '" + sBarCode_New + "' + ',')>0" |
| | | ); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "无效条码"; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 一键扫码 销售出库、销售退库模块 飞龙专用 |
| | | |
| | | [WebMethod] |
| | |
| | | #region 将源单信息存入条码出入库临时表 生产汇报、生产入库、采购入库、委外入库、其他入库 |
| | | |
| | | [WebMethod] |
| | | public Model.ClsKf_ICStockBill_WMS get_SourceBill_New(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID, Int64 HAccessFlag, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | public Model.ClsKf_ICStockBill_WMS get_SourceBill_MaterBarCode(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID, Int64 HAccessFlag, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Model.ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS(); |
| | |
| | | if (HBillType == "3711") |
| | | { |
| | | //生产汇报单 |
| | | oBar = get_SourceBarCode_OtherIn_New(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg); |
| | | oBar = get_SourceBill_ICMOReport(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | return null; |
| | |
| | | } |
| | | |
| | | //将源单信息存入条码出入库临时表 |
| | | DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OtherIn " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HStockOrgID.ToString() + "," + HAccessFlag.ToString(), "h_p_WMS_AddSourceBarCode_OtherIn"); |
| | | DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_ICMOReport " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + sMulSourceFlag.ToString() + ",'" + HMaker + "'," + HStockOrgID.ToString() + "," + HAccessFlag.ToString(), "h_p_WMS_AddSourceBarCode_ICMOReport"); |
| | | if (ds1 == null || ds1.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";将源单信息存入条码出入库临时表失败!"; |
| | |
| | | oBar.HSupName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HSupName"]); |
| | | oBar.HDeptID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HDeptID"]); |
| | | oBar.HDeptName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HDeptName"]); |
| | | oBar.HWhID = DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0]["HWhID"]); |
| | | oBar.HWhName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HWhName"]); |
| | | oBar.HSPFlag = DBUtility.ClsPub.isBool(ds1.Tables[0].Rows[0]["HSPFlag"]); |
| | | return oBar; |
| | | } |
| | | else |
| | |
| | | && (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1210" || HBillType == "3711")) |
| | | { |
| | | Int64 HAccessFlag = 1; //是否物料条码带出源单信息标志(0为直接扫源单条码,1为物料条码带出源单信息) |
| | | oBar = get_SourceBill_New(HInterID, HBillNo, HBillType, omodel_View.HSourceBillNo, omodel_View.HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg); |
| | | oBar = get_SourceBill_MaterBarCode(HInterID, HBillNo, HBillType, omodel_View.HSourceBillNo, omodel_View.HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | return null; |