| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "删除模治具出入库临时表记录失败!" + e.Message; |
| | | sErrMsg = "删除临时表记录失败!" + e.Message; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 生产组托单模块调用方法 20230406新增 |
| | | |
| | | #region 生产组托单模块 扫描托条码 |
| | | |
| | | [WebMethod] |
| | | public Model.ClsGy_BarCodeBill_WMS_Model get_PackBarCode_PackUnionBill(Int64 HInterID, string HBillNo, string HBillType, string HBarCode_Pack, string HHMaker, Int64 HStockOrgID, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Model.ClsGy_BarCodeBill_WMS_Model oBar = new Model.ClsGy_BarCodeBill_WMS_Model(); |
| | | |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_PackUnionBill " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode_Pack + "','" + HHMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddPackBarCode_PackUnionBill"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";扫描托条码判断失败!"; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | oBar.HBarCode = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBarCode_Pack"]); |
| | | return oBar; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";扫描托条码失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 生产组托单模块 扫描托条码对应单个条码 |
| | | |
| | | [WebMethod] |
| | | public bool get_BarCode_PackUnionBill(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID, ref string sErrMsg) |
| | | { |
| | | //获取系统参数 |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == false) |
| | | { |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | |
| | | string sSourceBillTypeCtl = "Y"; //未入库条码进行组托时,进行同源单类型控制(Y为控制) |
| | | string sSourceBillNoCtl = "Y"; //未入库条码进行组托时,进行同源单控制(Y为控制) |
| | | sSourceBillTypeCtl = oSystemParameter.omodel.Sc_PackUnionBill_SourceBillTypeCtl; |
| | | sSourceBillNoCtl = oSystemParameter.omodel.Sc_PackUnionBill_SourceBillNoCtl; |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds = oCN.RunProcReturn("exec h_p_WMS_AddBarCode_PackUnionBill '" + HBarCode + "'," + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode_Pack + "','" + sSourceBillTypeCtl + "','" + sSourceBillNoCtl + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddBarCode_PackUnionBill"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";扫描条码判断失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 返回组托列表信息 |
| | | |
| | | [WebMethod] |
| | | public DataSet GetBillEntry_Tmp_Pack(Int64 HInterID, string HBillNo, string HBillType, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet DS = oCn.RunProcReturn("exec h_p_WMS_BillEntryTmp_Pack " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_WMS_BillEntryTmp_Pack"); |
| | | return DS; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 删除明细表体选中行记录 |
| | | |
| | | [WebMethod] |
| | | public bool set_DelPackUnionBill_Temp_Pack(Int64 HInterID, string HBarCode, string HBillType, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | oCn.RunProc("Delete from Sc_PackUnionBill_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + HBarCode + "' and HPieceQty=1", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "删除组托记录失败!" + e.Message; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 上传生成生产组托单 |
| | | |
| | | [WebMethod] |
| | | public bool set_SavePackUnionBill_Add(Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_Sc_PackUnionBill_Insert_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode_Pack + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_Sc_PackUnionBill_Insert_New"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";上传失败!"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "上传失败,单据号:" + HBillNo + ",单据ID:" + HInterID + ";" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "生成生产组托单成功!单据号为:" + HBillNo; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "生成生产组托单失败!" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |