diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmAGVController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmAGVController.cs
new file mode 100644
index 00000000..f4ad3071
--- /dev/null
+++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmAGVController.cs
@@ -0,0 +1,130 @@
+using Microsoft.AspNetCore.Mvc;
+using ZR.Admin.WebApi.Extensions;
+using ZR.Admin.WebApi.Filters;
+using ZR.Model.MES.wms;
+using ZR.Model.MES.wms.Dto;
+using ZR.Service.Business;
+using ZR.Service.Business.IBusinessService;
+using ZR.Service.mes.wms;
+using ZR.Service.mes.wms.IService;
+using static System.Runtime.InteropServices.JavaScript.JSType;
+
+
+namespace ZR.Admin.WebApi.Controllers
+{
+ ///
+ /// agv 相关接口
+ ///
+
+ [Route("/mes/wm/agv")]
+ public class WmAGVController : BaseController
+ {
+ private readonly IWmAGVService _WmAGVService;
+ public WmAGVController(IWmAGVService wmAGVService)
+ {
+ _WmAGVService = wmAGVService;
+ }
+
+
+ ///
+ /// 1. 获取工单
+ ///
+ ///
+ ///
+
+ [HttpGet("get_workorder_list")]
+ public IActionResult QueryWmAGV_list([FromQuery] QueryAGVparam parm)
+ {
+ if(parm == null)
+ {
+ return SUCCESS(null);
+ }
+ var response = _WmAGVService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 2.获取当前工单下的所有AGV小车任务
+ ///
+ ///
+ ///
+ [HttpGet("GetTask")]
+ public IActionResult QueryAGVTask(string workorder_id)
+ {
+ if(string.IsNullOrEmpty(workorder_id))
+ {
+ return SUCCESS(null);
+ }
+
+ var response= _WmAGVService.QueryAGVTask(workorder_id);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 3.新增agv小车任务
+ ///
+ ///
+ ///
+ [HttpPost("add_task")]
+ public IActionResult AddAGVTask(AgvTask task)
+ {
+ string msg = null;
+ if(task == null)
+ {
+
+ return SUCCESS(null);
+ }
+ task.ToCreate();
+ int result= _WmAGVService.AddAGVTask(task);
+ if(result == 0)
+ {
+ msg = "插入失败";
+ }else if(result == 1)
+ {
+ msg = "新增成功";
+ }
+ else if (result == -1)
+ {
+ msg = "工单号为空";
+ }
+ return ToResponse(new ApiResult(200, msg, result));
+ }
+
+ ///
+ /// 4.删除AGV小车任务
+ ///
+ ///
+ ///
+ [HttpGet("deleteTask")]
+ public IActionResult DeleteTask(string taskId)
+ {
+
+ if(string.IsNullOrEmpty(taskId))
+ {
+ return SUCCESS(null);
+ }
+
+ int data = _WmAGVService.DeleteTask(taskId);
+ return SUCCESS(data);
+ }
+
+ ///
+ /// 5. 获取agv位置
+ ///
+ ///
+ ///
+ [HttpGet("get_agv_position")]
+ public IActionResult GetAGV_position_list(AgvLocation location)
+ {
+ if(location == null)
+ {
+ return SUCCESS(null);
+ }
+ var response= _WmAGVService.GetAGV_position_list(location);
+
+ return SUCCESS(response);
+ }
+
+ }
+}
diff --git a/ZR.Model/MES/wms/Dto/AGVtaskDto.cs b/ZR.Model/MES/wms/Dto/AGVtaskDto.cs
new file mode 100644
index 00000000..87e0fea8
--- /dev/null
+++ b/ZR.Model/MES/wms/Dto/AGVtaskDto.cs
@@ -0,0 +1,88 @@
+using MiniExcelLibs.Attributes;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ZR.Model.MES.wms.Dto
+{
+
+ public class QueryAGVPosition
+ {
+
+
+ }
+ public class AGVtaskDto
+ {
+
+
+ }
+ ///
+ /// 查询参数
+ ///
+ public class QueryAGVparam
+ {
+ public int year { get; set; }
+ public int week { get; set; }
+ public int day { get; set; }
+ public int status { get; set; }
+ }
+ ///
+ /// 工单
+ ///
+ public class AGVWorkorderDto
+ {
+ ///
+ /// 工单id(内部)
+ ///
+ public string Id { get; set; }
+
+ ///
+ /// 客户工单号
+ ///
+ public string ClientWorkorder { get; set; }
+
+ ///
+ /// 毛坯号
+ ///
+ public string BlankNumber { get; set; }
+
+ ///
+ /// 产品描述
+ ///
+ public string ProductDescription { get; set; }
+
+ ///
+ /// 颜色
+ ///
+ public string Colour { get; set; }
+
+ ///
+ /// 规格
+ ///
+ public string Specifications { get; set; }
+
+ ///
+ /// 编码号
+ ///
+ public int CodeNumber { get; set; }
+
+ ///
+ /// 上件总数
+ ///
+ public int PreviousNumber { get; set; }
+
+ ///
+ /// 未上件数
+ ///
+ public int NoPreviousNumber { get; set; }
+
+
+
+
+
+
+
+ }
+}
diff --git a/ZR.Service/mes/wms/IService/IWmAGVService.cs b/ZR.Service/mes/wms/IService/IWmAGVService.cs
new file mode 100644
index 00000000..bb7dbe89
--- /dev/null
+++ b/ZR.Service/mes/wms/IService/IWmAGVService.cs
@@ -0,0 +1,23 @@
+using System;
+using ZR.Model;
+
+using System.Collections.Generic;
+using ZR.Model.MES.wms;
+using ZR.Model.MES.wms.Dto;
+namespace ZR.Service.mes.wms.IService
+{
+ public interface IWmAGVService
+ {
+
+ List GetList(QueryAGVparam param);
+
+
+ List QueryAGVTask(string workorder_id);
+
+ int AddAGVTask(AgvTask task);
+
+ int DeleteTask(string taskId);
+
+ List GetAGV_position_list(AgvLocation location);
+ }
+}
diff --git a/ZR.Service/mes/wms/WmAGVService.cs b/ZR.Service/mes/wms/WmAGVService.cs
new file mode 100644
index 00000000..e6c8e558
--- /dev/null
+++ b/ZR.Service/mes/wms/WmAGVService.cs
@@ -0,0 +1,124 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using ZR.Model;
+
+using ZR.Repository;
+using ZR.Service.Business.IBusinessService;
+using System.Linq;
+using ZR.Model.MES.wms;
+using ZR.Model.MES.wms.Dto;
+using ZR.Service.mes.wms.IService;
+using ZR.Model.MES.pro;
+using Mapster;
+
+namespace ZR.Service.Business
+{
+ ///
+ /// 盘点记录Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IWmAGVService), ServiceLifetime = LifeTime.Transient)]
+ public class WmAGVService : BaseService, IWmAGVService
+ {
+
+
+ ///
+ /// 1.获取工单列表
+ ///
+ ///
+ ///
+ public List GetList(QueryAGVparam param)
+ {
+ List aGVWorkorderDtos = new List();
+ var predicate = Expressionable.Create()
+ .AndIF(param.year > 0, it => it.Year == param.year)
+ .AndIF(param.week > 0, it => it.Week == param.week)
+ .AndIF(param.day > 0, it => it.Date == param.day);
+
+ var response = Context.Queryable()
+ .Where(it=>it.Remark3=="是")
+ .Where(predicate.ToExpression()).ToList();
+ foreach (var item in response)
+ {
+ aGVWorkorderDtos.Add(item.Adapt());
+ }
+ return aGVWorkorderDtos;
+ }
+
+
+ ///
+ /// 2.获取当前工单下的所有AGV小车任务
+ ///
+ ///
+ ///
+ ///
+ public List QueryAGVTask(string workorder_id)
+ {
+ return Context.Queryable().Where(it => it.FkWorkorderId == workorder_id).OrderByDescending(it=>it.Sort).ToList();
+ }
+
+
+
+ ///
+ /// 3.新增AGV小车任务
+ ///
+ ///
+ ///
+ ///
+ public int AddAGVTask(AgvTask task)
+ {
+ int result = 0;
+ //TODO 1 判断agv小车task是否可以新增
+ if(string.IsNullOrEmpty(task.FkWorkorderId))
+ {
+ return -1;
+ }
+ ProWorkorder_v2 workorder = Context.Queryable()
+ .Where(it => it.Id == task.FkWorkorderId)
+ .First();
+
+ int require_num= workorder.PreviousNumber;
+ int all_require_num=Context.Queryable().Where(it => it.FkWorkorderId == workorder.Id).Sum(it => it.Number)??0;
+
+ if(require_num>all_require_num)
+ {
+ task.Id = SnowFlakeSingle.Instance.NextId().ToString();
+ result= Context.Insertable(task).ExecuteCommand();
+ }
+
+
+ return result;
+ }
+
+
+ ///
+ /// 4.删除AGV小车任务
+ ///
+ ///
+ ///
+ ///
+ public int DeleteTask(string taskId)
+ {
+ return Context.Deleteable().Where(it=>it.Id==taskId).ExecuteCommand();
+
+ }
+
+ ///
+ /// 6 获取agv 起点和终点
+ ///
+ ///
+ ///
+ ///
+ public List GetAGV_position_list(AgvLocation location)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(string.IsNullOrEmpty(location.Area), it => it.Area == location.Area)
+ .AndIF(location.Type > -1, it => it.Type == location.Type)
+ .AndIF(string.IsNullOrEmpty(location.Coordinate), it => it.Coordinate == location.Coordinate);
+
+
+ return Context.Queryable().Where(predicate.ToExpression()).ToList();
+ }
+ }
+}