/// <summary> /// WMS分配库区 /// </summary> /// <returns></returns> public static bool AssignInArea(string area, string code) { try { bool res = false; WmsModel wms = null; if (!string.IsNullOrEmpty(area) && !string.IsNullOrEmpty(code)) { // 请求WMS任务 wms = mHttp.DoBarcodeScanTask(area, code); if (wms != null && !string.IsNullOrEmpty(wms.Task_UID)) { // 写入数据库 CommonSQL.InsertTaskInfo(wms.Task_UID, (int)wms.Task_type, wms.Barcode, wms.W_S_Loc, wms.W_D_Loc, ""); res = true; } } return(res); } catch (Exception ex) { throw ex; } }
private void TEST_Click(object sender, RoutedEventArgs e) { try { // 请求WMS入库任务 //WmsModel wms = ADS.mHttp.DoBarcodeScanTask("A01", ADS.GetGoodsCode(DateTime.Now.ToString("yyMMdd"))); WmsModel wms = ADS.mHttp.DoBarcodeScanTask("A01", "@20200906001|Afpz|B10*22|Dw|Ea1|F001|G2440*0600"); if (wms != null && !string.IsNullOrEmpty(wms.Task_UID)) { CommonSQL.InsertTaskInfo(wms.Task_UID, (int)wms.Task_type, wms.Barcode, wms.W_S_Loc, wms.W_D_Loc, ""); CommonSQL.UpdateWms(wms.Task_UID, (int)WmsTaskStatus.待分配); } Refresh_Click(sender, e); } catch (Exception ex) { Notice.Show(ex.Message, "错误", 3, MessageBoxIcon.Error); } }
/// <summary> /// 获取最新初始化入库任务目的区域 /// </summary> /// <returns></returns> public static string GetInAreaWMS(string from, string code, out string taskid) { try { string area = CommonSQL.GetToArea(code, out taskid); if (string.IsNullOrEmpty(area)) { // 请求WMS任务 WmsModel wms = mHttp.DoBarcodeScanTask(from, code); if (wms != null && !string.IsNullOrEmpty(wms.Task_UID)) { // 写入数据库 CommonSQL.InsertTaskInfo(wms.Task_UID, (int)wms.Task_type, wms.Barcode, wms.W_S_Loc, wms.W_D_Loc, ""); area = wms.W_D_Loc; } } return(area); } catch (Exception ex) { throw ex; } }
/// <summary> /// 插入数据 /// </summary> public void InsertDB() { CommonSQL.InsertTaskInfo(taskuid, (int)tasktype, barcode, takesite, givesite, dev ?? ""); }