diff --git a/PDA/PDA/pages/bind/bind.vue b/PDA/PDA/pages/bind/bind.vue
index 65f495c..6f9e1c4 100644
--- a/PDA/PDA/pages/bind/bind.vue
+++ b/PDA/PDA/pages/bind/bind.vue
@@ -36,10 +36,10 @@
工位编码:
- {{locationCode}}
+ {{locationCode}}
-
-
+
+
@@ -370,6 +370,66 @@
this.$refs.proup.show();
}
},
+
+ //物料绑定
+ callEmptyShelf: function() {
+ this.userName = getConfig('userName', '');
+ var serverIPAndPort = getServerIPAndPort();
+ uni.request({
+ url: 'http://' + serverIPAndPort + '/pdaMatBind/callEmptyShelf', // 请求的接口地址
+ method: 'POST', // 设置请求方式为 POST
+ data: {
+ "locationId": this.locationId,
+ "locationCode": this.locationCode,
+ "userName": this.userName,
+ "deviceType": "PDA"
+ },
+ header: {
+ 'Content-Type': 'application/json', // 如果需要以JSON格式发送数据
+ },
+ success: (res) => {
+ // 请求成功的回调函数
+ if (res.statusCode === 200) {
+ //接口返回数据为200 表示获取成功!
+ if (res.data.code == 200) {
+ uni.showToast({
+ title: '呼叫成功,请等待!',
+ icon: 'none',
+ duration: 1500
+ });
+
+ } else {
+ uni.showToast({
+ title: '呼叫失败:' + res.data.message,
+ icon: 'none',
+ duration: 1500
+ });
+ }
+
+ } else {
+ uni.showToast({
+ title: '呼叫失败:服务器返回错误状态码' + res.statusCode,
+ icon: 'none',
+ duration: 1500
+ });
+ }
+ },
+ fail: (err) => {
+ // 请求失败的回调函数
+ uni.showToast({
+ title: '呼叫失败:http请求失败' + err,
+ icon: 'none',
+ duration: 1500
+ });
+ },
+ complete: (event) => {
+ // 请求完成的回调函数(无论成功或失败都会调用)
+ console.log('请求完成', event);
+ }
+ });
+
+ },
+
//清空当前界面所有内容
clear: function() {
diff --git a/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js b/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js
index 4f360e7..534b639 100644
--- a/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js
+++ b/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js
@@ -889,6 +889,60 @@ if (uni.restoreGlobal) {
this.$refs.proup.show();
}
},
+ //物料绑定
+ callEmptyShelf: function() {
+ this.userName = getConfig("userName", "");
+ var serverIPAndPort = getServerIPAndPort();
+ uni.request({
+ url: "http://" + serverIPAndPort + "/pdaMatBind/callEmptyShelf",
+ // 请求的接口地址
+ method: "POST",
+ // 设置请求方式为 POST
+ data: {
+ "locationId": this.locationId,
+ "locationCode": this.locationCode,
+ "userName": this.userName,
+ "deviceType": "PDA"
+ },
+ header: {
+ "Content-Type": "application/json"
+ // 如果需要以JSON格式发送数据
+ },
+ success: (res) => {
+ if (res.statusCode === 200) {
+ if (res.data.code == 200) {
+ uni.showToast({
+ title: "呼叫成功,请等待!",
+ icon: "none",
+ duration: 1500
+ });
+ } else {
+ uni.showToast({
+ title: "呼叫失败:" + res.data.message,
+ icon: "none",
+ duration: 1500
+ });
+ }
+ } else {
+ uni.showToast({
+ title: "呼叫失败:服务器返回错误状态码" + res.statusCode,
+ icon: "none",
+ duration: 1500
+ });
+ }
+ },
+ fail: (err) => {
+ uni.showToast({
+ title: "呼叫失败:http请求失败" + err,
+ icon: "none",
+ duration: 1500
+ });
+ },
+ complete: (event) => {
+ formatAppLog("log", "at pages/bind/bind.vue:427", "请求完成", event);
+ }
+ });
+ },
//清空当前界面所有内容
clear: function() {
this.locationId = null;
@@ -905,7 +959,7 @@ if (uni.restoreGlobal) {
this.matSpec = "";
},
handlePopupClose() {
- formatAppLog("log", "at pages/bind/bind.vue:391", "弹出层已关闭");
+ formatAppLog("log", "at pages/bind/bind.vue:451", "弹出层已关闭");
}
}
};
@@ -971,16 +1025,17 @@ if (uni.restoreGlobal) {
vue.createElementVNode("view", { style: { "flex": "35" } }, "工位编码:"),
vue.createElementVNode(
"view",
- { style: { "flex": "50", "overflow": "hidden" } },
+ { style: { "flex": "60", "overflow": "hidden" } },
vue.toDisplayString($data.locationCode),
1
/* TEXT */
),
- vue.createElementVNode("view", { style: { "flex": "40" } }, [
+ vue.createElementVNode("view", { style: { "flex": "30" } }, [
vue.createElementVNode("button", {
class: "mini-btn",
type: "warn",
- size: "mini"
+ size: "mini",
+ onClick: _cache[3] || (_cache[3] = (...args) => $options.callEmptyShelf && $options.callEmptyShelf(...args))
}, "呼叫货架")
])
]),
@@ -1056,7 +1111,7 @@ if (uni.restoreGlobal) {
class: "uni-input",
style: { "font-size": "40rpx" },
placeholder: "请输入物料数量",
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.matQty = $event)
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.matQty = $event)
},
null,
512
@@ -1067,7 +1122,7 @@ if (uni.restoreGlobal) {
]),
vue.createElementVNode("view", { style: { "flex": "40" } }, [
vue.createElementVNode("button", {
- onClick: _cache[4] || (_cache[4] = (...args) => $options.bind && $options.bind(...args)),
+ onClick: _cache[5] || (_cache[5] = (...args) => $options.bind && $options.bind(...args)),
class: "mini-btn",
style: { "margin-left": "10rpx" },
type: "warn",
diff --git a/WCS.BLL/DbModels/STZL/AgvTask.cs b/WCS.BLL/DbModels/STZL/AgvTask.cs
index 74c59f6..4906a64 100644
--- a/WCS.BLL/DbModels/STZL/AgvTask.cs
+++ b/WCS.BLL/DbModels/STZL/AgvTask.cs
@@ -21,11 +21,12 @@ namespace WCS.BLL.DbModels
public int Id { get; set; }
#region 任务属性
- ///
- /// 请求任务时的任务号 需要保证唯一性
- ///
- [SugarColumn(ColumnName = "request_code", Length = 64, IsNullable = false, ColumnDescription = "请求任务时的任务号 需要保证唯一性")]
- public string RequestCode { get; set; } = Guid.NewGuid().ToString();
+
+ [SugarColumn(ColumnName = "request_code", Length = 64, IsNullable = false, ColumnDescription = "请求任务时的请求号 需要保证唯一性")]
+ public string RequestCode { get; set; }
+
+ [SugarColumn(ColumnName = "task_code", Length = 64, IsNullable = false, ColumnDescription = "请求任务时的任务号 需要保证唯一性")]
+ public string TaskCode { get; set; }
///
/// 任务类型
@@ -55,6 +56,13 @@ namespace WCS.BLL.DbModels
[SugarColumn(ColumnName = "end_location_code", Length = 64, IsNullable = true, ColumnDescription = "终点位置编码")]
public string EndLocationCode { get; set; } = string.Empty;
+
+ ///
+ /// 货架码
+ ///
+ [SugarColumn(ColumnName = "shelf_Code", Length = 64, IsNullable = true, ColumnDescription = "AGV编号")]
+ public string ShlefCode { get; set; } = string.Empty;
+
///
/// AGV编号
///
diff --git a/WCS.BLL/Manager/AGVManager.cs b/WCS.BLL/Manager/AGVManager.cs
index cd419be..ce0b371 100644
--- a/WCS.BLL/Manager/AGVManager.cs
+++ b/WCS.BLL/Manager/AGVManager.cs
@@ -3,6 +3,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using WCS.BLL.DbModels;
+using WCS.BLL.Tool;
+using WCS.DAL.Db;
+using WCS.DAL.DbModels;
namespace WCS.BLL.Manager
{
@@ -10,11 +14,49 @@ namespace WCS.BLL.Manager
public static class AGVManager
{
///
- /// 产生AGV任务
+ /// 产生AGV点到点搬运任务
///
- public static AGVResult GenAgvSchedulingTask(int startLocationId,int endLocationId)
+ public static AGVResponseModel GenAgvSchedulingTask(LocationInfo startLocation,LocationInfo endLocation,string shelfCode,string createUser)
{
- return null;
+ var url = @"http://192.168.18.150:8181/rcms/services/rest/hikRpcService/genAgvSchedulingTask";
+ var startPositionCodePathItem = new PositionCodePathItem()
+ {
+ positionCode = startLocation.RcsStoreCode,
+ };
+ var endPositionCodePathItem = new PositionCodePathItem()
+ {
+ positionCode = endLocation.RcsStoreCode,
+ };
+ List positionCodePathItems = new List();
+
+ positionCodePathItems.Add(startPositionCodePathItem);
+ positionCodePathItems.Add((endPositionCodePathItem));
+
+ var body = new AGVRequestModel()
+ {
+ positionCodePath = positionCodePathItems,
+ };
+
+ var response = ApiHelp.GetDataFromHttp(url,body,"POST",true);
+ if (response.code == "0" && response.message == "成功")
+ {
+ //生成任务数据
+ var task = new AgvTask()
+ {
+ ShlefCode = shelfCode,
+ RequestCode = body.reqCode,
+ TaskCode = body.taskCode,
+ TaskType = "GenAgvSchedulingTask",
+ StratLocationId = startLocation.Id,
+ StartLocationCode = startLocation.LocationCode,
+ EndLocationId = endLocation.Id,
+ EndLocationCode = endLocation.LocationCode,
+ CreateUser = createUser
+ };
+ DbHelp.db.Insertable(task).ExecuteCommand();
+ }
+
+ return response;
}
}
diff --git a/WCS.BLL/Manager/AGVRequestModel.cs b/WCS.BLL/Manager/AGVRequestModel.cs
new file mode 100644
index 0000000..642ac4e
--- /dev/null
+++ b/WCS.BLL/Manager/AGVRequestModel.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WCS.BLL.Manager
+{
+ //如果好用,请收藏地址,帮忙分享。
+ public class PositionCodePathItem
+ {
+ ///
+ ///
+ ///
+ public string positionCode { get; set; } = string.Empty;
+ ///
+ ///
+ ///
+ public string type { get; set; } = "00";
+ }
+
+ public class AGVRequestModel
+ {
+ ///
+ /// 请求码 每一次请求唯一
+ ///
+ public string reqCode { get; set; } = Guid.NewGuid().ToString().Replace("-", "");
+
+ ///
+ /// 请求时间
+ ///
+ public string reqTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+
+ ///
+ /// 客户端编号
+ ///
+ public string clientCode { get; set; } = "PDA";
+
+ public string tokenCode { get; set; } = string.Empty;
+
+ ///
+ /// 任务类型
+ ///
+ public string taskTyp { get; set; } = "F01";
+
+ ///
+ ///
+ ///
+ public string interfaceName { get; set; } = "genAgvSchedulingTask";
+ ///
+ /// 旋转角度
+ ///
+ public string podDir { get; set; } = string.Empty;
+ ///
+ /// 两个点位 开始点和结束点
+ ///
+ public List positionCodePath { get; set; }
+ ///
+ /// 货架编码
+ ///
+ public string podCode { get; set; } = string.Empty;
+ ///
+ /// 优先级
+ ///
+ public string priority { get; set; } = "1";
+ ///
+ ///
+ ///
+ public string agvCode { get; set; } = string.Empty;
+ ///
+ /// 任务单号(是我自定义的!)
+ ///
+ public string taskCode { get; set; } = DateTime.Now.ToString("yyyyMMddHHmmfff");
+
+ public string data { get; set; } = string.Empty;
+ }
+
+}
diff --git a/WCS.BLL/Manager/AGVResponseModel.cs b/WCS.BLL/Manager/AGVResponseModel.cs
new file mode 100644
index 0000000..cceed0d
--- /dev/null
+++ b/WCS.BLL/Manager/AGVResponseModel.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WCS.BLL.Manager
+{
+ public class AGVResponseModel
+ {
+ ///
+ ///
+ ///
+ public string code { get; set; }
+ ///
+ ///
+ ///
+ public string data { get; set; }
+ ///
+ ///
+ ///
+ public string interrupt { get; set; }
+ ///
+ /// 成功
+ ///
+ public string message { get; set; }
+ ///
+ ///
+ ///
+ public string reqCode { get; set; }
+ }
+}
diff --git a/WCS.BLL/Manager/DbInit.cs b/WCS.BLL/Manager/DbInit.cs
index 951050f..0d0ebc0 100644
--- a/WCS.BLL/Manager/DbInit.cs
+++ b/WCS.BLL/Manager/DbInit.cs
@@ -72,7 +72,7 @@ namespace WCS.BLL.Manager
DbHelp.db.CodeFirst.InitTables(typeof(ShelfInfo), typeof(MatBaseInfo), typeof(ShelfTypeInfo)
, typeof(LocationInfo), typeof(LocationAreaInfo), typeof(MatDetailCurrentInfo), typeof(OrderTypeInfo)
- , typeof(MatDetailStocktakingInfo)
+ , typeof(MatDetailStocktakingInfo), typeof(AgvTask)
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
, typeof(MatInfo), typeof(StoreInfo)
, typeof(StockTakingOrder), typeof(StockTakingOrderMatDetail), typeof(InOutRecord)
diff --git a/WCS.BLL/Services/Service/InstoreService.cs b/WCS.BLL/Services/Service/InstoreService.cs
index 52914bb..7d15f5f 100644
--- a/WCS.BLL/Services/Service/InstoreService.cs
+++ b/WCS.BLL/Services/Service/InstoreService.cs
@@ -180,7 +180,7 @@ namespace WCS.BLL.Services.Service
{
materialBar = request.MatSn
};
- var Result = ApiHelp.GetDataFromHttp>>("http://192.168.2.23:9213/integrate/instock/queryBybar", body, "POST", true);
+ var Result = Tool.ApiHelp.GetDataFromHttp>>("http://192.168.2.23:9213/integrate/instock/queryBybar", body, "POST", true);
//查询到物料信息
if (Result != null && Result.Code == 200 && Result.Data != null && Result.Data.Count > 0)
diff --git a/WCS.Model/ApiModel/AGV/AGVCallBackRequest.cs b/WCS.Model/ApiModel/AGV/AGVCallBackRequest.cs
new file mode 100644
index 0000000..ae34748
--- /dev/null
+++ b/WCS.Model/ApiModel/AGV/AGVCallBackRequest.cs
@@ -0,0 +1,178 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WCS.Model.ApiModel.AGV
+{
+ public class AGVCallBackRequest
+ {
+ ///
+ ///
+ ///
+ public string action { get; set; }
+ ///
+ ///
+ ///
+ public string areaCode { get; set; }
+ ///
+ ///
+ ///
+ public string berthCode { get; set; }
+ ///
+ ///
+ ///
+ public string callCode { get; set; }
+ ///
+ ///
+ ///
+ public string callTyp { get; set; }
+ ///
+ ///
+ ///
+ public string clientCode { get; set; }
+ ///
+ ///
+ ///
+ public decimal cooX { get; set; }
+ ///
+ ///
+ ///
+ public decimal cooY { get; set; }
+ ///
+ ///
+ ///
+ public string ctnrCode { get; set; }
+ ///
+ ///
+ ///
+ public string ctnrTyp { get; set; }
+ ///
+ ///
+ ///
+ public string currentCallCode { get; set; }
+ ///
+ ///
+ ///
+ public string currentPositionCode { get; set; }
+ ///
+ ///
+ ///
+ public string data { get; set; }
+ ///
+ ///
+ ///
+ public string dstBinCode { get; set; }
+ ///
+ ///
+ ///
+ public string eqpCode { get; set; }
+ ///
+ ///
+ ///
+ public string indBind { get; set; }
+ ///
+ ///
+ ///
+ public string layer { get; set; }
+ ///
+ ///
+ ///
+ public string mapCode { get; set; }
+ ///
+ ///
+ ///
+ public string mapDataCode { get; set; }
+ ///
+ ///
+ ///
+ public string mapShortName { get; set; }
+ ///
+ ///
+ ///
+ public string materialLot { get; set; }
+ ///
+ ///
+ ///
+ public string materialType { get; set; }
+ ///
+ ///
+ ///
+ public string method { get; set; }
+ ///
+ ///
+ ///
+ public string orgCode { get; set; }
+ ///
+ ///
+ ///
+ public string podCode { get; set; }
+ ///
+ ///
+ ///
+ public string podDir { get; set; }
+ ///
+ ///
+ ///
+ public string podNum { get; set; }
+ ///
+ ///
+ ///
+ public string podTyp { get; set; }
+ ///
+ ///
+ ///
+ public string relatedArea { get; set; }
+ ///
+ ///
+ ///
+ public string reqCode { get; set; }
+ ///
+ ///
+ ///
+ public string reqTime { get; set; }
+ ///
+ ///
+ ///
+ public string roadWayCode { get; set; }
+ ///
+ ///
+ ///
+ public string robotCode { get; set; }
+ ///
+ ///
+ ///
+ public string seq { get; set; }
+ ///
+ ///
+ ///
+ public string stgBinCode { get; set; }
+ ///
+ ///
+ ///
+ public string subTaskNum { get; set; }
+ ///
+ ///
+ ///
+ public string taskCode { get; set; }
+ ///
+ ///
+ ///
+ public string taskTyp { get; set; }
+ ///
+ ///
+ ///
+ public string tokenCode { get; set; }
+ ///
+ ///
+ ///
+ public string username { get; set; }
+ ///
+ ///
+ ///
+ public string wbCode { get; set; }
+ ///
+ ///
+ ///
+ public string whCode { get; set; }
+ }
+}
diff --git a/WCS.Model/ApiModel/LocationInfo/LocationInfoModel.cs b/WCS.Model/ApiModel/LocationInfo/LocationInfoModel.cs
index e707c23..4ff6afc 100644
--- a/WCS.Model/ApiModel/LocationInfo/LocationInfoModel.cs
+++ b/WCS.Model/ApiModel/LocationInfo/LocationInfoModel.cs
@@ -38,6 +38,8 @@ namespace WCS.Model.ApiModel.StoreInfo
/// 更新人
///
public string ModifyUser { get; set; } = string.Empty;
+
+ public List AllowDestinationLocationArea { get; set; } = new List();
///
/// 更新时间
///
diff --git a/WCS.WebApi/Controllers/AgvCallbackServiceController.cs b/WCS.WebApi/Controllers/AgvCallbackServiceController.cs
new file mode 100644
index 0000000..9f09877
--- /dev/null
+++ b/WCS.WebApi/Controllers/AgvCallbackServiceController.cs
@@ -0,0 +1,95 @@
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using NPOI.SS.Formula.Functions;
+using SqlSugar;
+using WCS.BLL;
+using WCS.BLL.DbModels;
+using WCS.BLL.HardWare;
+using WCS.BLL.Manager;
+using WCS.BLL.Services.IService;
+using WCS.BLL.Services.Service;
+using WCS.DAL.Db;
+using WCS.DAL.DbModels;
+using WCS.Model;
+using WCS.Model.ApiModel.AGV;
+using WCS.Model.ApiModel.Home;
+using Mode = WCS.BLL.HardWare.Mode;
+
+namespace WCS.WebApi.Controllers
+{
+ ///
+ /// 主页面的接口
+ ///
+ [ApiController]
+ [Route("[controller]")]
+ public class AgvCallbackServiceController : ControllerBase
+ {
+
+ public AgvCallbackServiceController(IHomerService homerService, ISelfCheckService selfCheckService)
+ {
+
+ }
+
+ ///
+ /// agv任务回调
+ ///
+ ///
+ ///
+ [Route("agvCallback")]
+ [HttpPost(Name = "agvCallback")]
+ public async Task