261993e4e0f135b01e15a7ddf3e1d2fd290044b0..2779947fe07c41250237437365f367b5a78a03b6
2025-06-10 wangxinhui
1
277994 对比 | 目录
2025-06-10 wangxinhui
2
4ba2eb 对比 | 目录
2025-06-10 wangxinhui
1
bb66bf 对比 | 目录
2025-06-10 wangxinhui
1
9f1199 对比 | 目录
2025-06-10 wangxinhui
1
37f4f0 对比 | 目录
2025-06-10 wangxinhui
1
3443d0 对比 | 目录
已删除4个文件
已修改27个文件
已重命名3个文件
已添加13个文件
1006 ■■■■■ 文件已修改
代码管理/LargeScreen/CP-Screen.zip 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/1c314e67-7b22-4b95-82d8-39953c4ffcb1.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3f7cc6f5-3187-454f-b270-cee6e70c2744.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4f9889c8-bc2e-456e-9b47-f0fa2eeb365c.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/73055691-0933-46e5-8aec-b97ad0bfe09e.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/ConveyorLineJob_PP.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/TSJConveyorLineJob_PP.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/AGV_ZHExtend.cs 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/02143a0b-3339-4244-b940-0fc56a40a2ae.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3c89de48-4a08-4fe0-8316-5c4d4bd0d410.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9d223ae2-4a90-4efd-ae67-f1131a379c2f.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bfe4e4fb-c551-4c7f-94ec-d7011d126854.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ecf85f9b-999c-489f-bcd0-f5a76920c64b.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ef8b54ea-95e6-4615-a7de-9b16de52a1b0.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/WareHouseEnum/WarehouseEnum.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpQmsHelper.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesLotModel.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/CheckResultDTO.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/ReceiveResultDto.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/IQMSService/IInvokeQMSService.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/QMSReceiveCheckModel.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/QMSService/InvokeQMSService.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/QMS/QmsController.cs 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/LargeScreen/CP-Screen.zip
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/1c314e67-7b22-4b95-82d8-39953c4ffcb1.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3f7cc6f5-3187-454f-b270-cee6e70c2744.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4f9889c8-bc2e-456e-9b47-f0fa2eeb365c.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/73055691-0933-46e5-8aec-b97ad0bfe09e.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs
@@ -107,5 +107,6 @@
        /// è®¾å¤‡ç¼–号
        /// </summary>
        public string EqpCode { get; set; }
        public string PodTyp { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -68,5 +68,9 @@
        public string AGVArea { get; set; }
        public int PalletType { get; set; }
        /// <summary>
        /// AGV任务号
        /// </summary>
        public string AGVTaskNum { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -65,6 +65,8 @@
        /// <param name="sourceAddress">起始地址</param>
        /// <returns></returns>
        WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "");
        WebResponseContent RequestWMSZHTask(string agvTaskCode, string palletCode, string palletType,string materialLot);
        /// <summary>
        /// å‘WMS申请任务
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs
@@ -311,6 +311,29 @@
                                    return agvResponseContent;
                                }
                            }
                            else //线体无任务
                            {
                                //调用AGV预调度接口
                                AgvScheduleTaskDTO agvScheduleTask = new AgvScheduleTaskDTO()
                                {
                                    PositionCode = "8001",
                                    NextTask = "15",
                                    UseableLayers = "1",
                                    CacheCount = "1",
                                    Update = "0",
                                    AgvTyp = "10",
                                    PreTaskQty = "1",
                                    ReqCode = Guid.NewGuid().ToString().Replace("-", ""),
                                    ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                };
                                WebResponseContent contentFL = _taskService.AgvPreScheduleTask(agvScheduleTask);
                                if (!contentFL.Status)
                                {
                                    agvResponseContent.Code = "1";
                                    agvResponseContent.Message = contentFL.Message;
                                    return agvResponseContent;
                                }
                            }
                            //获取调入参数
                            AGVBoxApplyPassDTO boxApplyPassDTO = new AGVBoxApplyPassDTO()
                            {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs
@@ -89,11 +89,14 @@
                if (agvUpdateModel == null) throw new Exception("未获取到请求参数");
                agvResponseContent.ReqCode = agvUpdateModel.ReqCode;
                var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum);
                if (task == null) throw new Exception($"未找到任务,任务号【{agvUpdateModel.TaskCode}】");
                if (task == null && agvUpdateModel.Method!= "begin") throw new Exception($"未找到任务,任务号【{agvUpdateModel.TaskCode}】");
                switch (agvUpdateModel.Method)
                {
                    case "start":
                        break;
                    case "begin":
                        WebResponseContent requestZH = _taskService.RequestWMSZHTask(agvUpdateModel.TaskCode, agvUpdateModel.PodCode,agvUpdateModel.PodTyp,agvUpdateModel.MaterialLot);
                        agvResponseContent.Code = requestZH.Status ? "0" : "1";
                        agvResponseContent.Message = requestZH.Status ? "成功" : "失败";
                        return agvResponseContent;
                    case "outbin"://出库根据这个信号判断取货完成
                        if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
                        {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -346,7 +346,10 @@
                        }
                        else
                        {
                            task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            if (task.Roadway!="SC01_ZH")
                            {
                                task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            }
                            List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
                            if (routers.FirstOrDefault() == null)
                            {
@@ -358,10 +361,9 @@
                            {
                                return WebResponseContent.Instance.Error($"未找到站台配置信息");
                            }
                            task.NextAddress = stationManger?.AGVStationCode ?? "";
                            task.DeviceCode = stationManger?.Remark ?? "";
                            task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
                            task.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
                        }
                    }
@@ -427,7 +429,50 @@
            }
            return content;
        }
        public WebResponseContent RequestWMSZHTask(string agvTaskCode, string palletCode, string palletType, string materialLot)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.AgvTaskNum == agvTaskCode);
                if (task != null)
                {
                    return WebResponseContent.Instance.Error($"任务号{task.TaskNum}对应任务已存在");
                }
                string address = AppSettings.Get("WMSApiAddress");
                if (string.IsNullOrEmpty(address))
                {
                    return WebResponseContent.Instance.Error($"未找到WMSApi地址");
                }
                string responseStr = "";
                if (string.IsNullOrEmpty(materialLot))
                {
                    return content.Error("物料批次为空");
                }
                responseStr = HttpHelper.Get($"{address}/api/Task/RequestZHInboundTask?agvTaskCode={agvTaskCode}&palletCode={palletCode}&palletType={palletType}&materialLot={materialLot}");
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
                if (responseContent != null && responseContent.Status && responseContent.Data != null)
                {
                    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
                    if (taskDTO != null)
                    {
                        taskDTO.AGVTaskNum = agvTaskCode;
                        content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
                    }
                }
                else
                {
                    content.Error(responseContent.Message);
                }
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// 
        /// </summary>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/ConveyorLineJob_PP.cs
@@ -77,20 +77,20 @@
                                if (!string.IsNullOrEmpty(boxcode))
                                {
                                    string sc = device.Communicator.Read<string>("DB900.598.0");
                                    string sc = device.Communicator.Read<string>("DB900.580.0");
                                    WriteError(device.DeviceName, $"读取值:{boxcode},对比{sc}");
                                    string boxEndCode = "";
                                    if (boxcode.LastIndexOf(",SC:") >= 0)
                                    if (boxcode.LastIndexOf(",PO:") >= 0)
                                    {
                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", "");
                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",PO:")) + sc.Substring(sc.IndexOf(",PO:")).Replace("\0", "");
                                    }
                                    else if (boxcode.LastIndexOf(",SC") > 0)
                                    else if (boxcode.LastIndexOf(",PO") > 0)
                                    {
                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", "");
                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",PO")) + sc.Substring(sc.IndexOf("PO:")).Replace("\0", "");
                                    }
                                    else if (boxcode.LastIndexOf(",S") > 0)
                                    else if (boxcode.LastIndexOf(",P") > 0)
                                    {
                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", "");
                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",P")) + sc.Substring(sc.IndexOf("PO:")).Replace("\0", "");
                                    }
                                    //入库申请任务
@@ -111,7 +111,8 @@
                            }
                            else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK)
                            {
                                Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt());
                                string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode);
                                Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && boxcode.Contains(x.PalletCode) && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt());
                                if (task != null)
                                {
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress);
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/TSJConveyorLineJob_PP.cs
@@ -112,7 +112,7 @@
                        {
                            if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK)
                            {
                                Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
                                Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
                                if (task != null)
                                {
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode);
@@ -121,7 +121,7 @@
                            if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)//入库
                            {
                                Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode);
                                Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode);
                                if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                                {
                                    Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode);
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸ÉĤ²Ö/StackerCraneJob_GM.cs
@@ -26,6 +26,8 @@
using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_DTO.TaskInfo;
using AutoMapper;
namespace WIDESEAWCS_Tasks
{
@@ -39,9 +41,10 @@
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IRouterRepository _routerRepository;
        private readonly IMapper _mapper;
        private List<Dt_ApiInfo> apiInfos;
        public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository)
        public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -50,6 +53,7 @@
            _stationMangerRepository = stationMangerRepository;
            _cacheService = cacheService;
            _routerRepository = routerRepository;
            _mapper = mapper;
            string? apiInfoStr = _cacheService.Get("apiInfos");
            if (!string.IsNullOrEmpty(apiInfoStr))
@@ -244,11 +248,61 @@
                if (string.IsNullOrEmpty(url))
                {
                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"未找到WMS移库判断接口");
                    WriteInfo(commonStackerCrane.DeviceCode, $"未找到WMS移库判断接口");
                    WriteError(commonStackerCrane.DeviceCode, $"未找到WMS移库判断接口");
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到WMS移库判断接口");
                    return null;
                }
                //HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.NextAddress}", "");//todo è°ƒç”¨WMS任务完成方法
                string response = HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.CurrentAddress}", "");//todo è°ƒç”¨WMS任务完成方法
                if (string.IsNullOrEmpty(response))
                {
                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"移库接口调用错误");
                    WriteError(commonStackerCrane.DeviceCode, $"移库接口调用错误");
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库接口调用错误");
                    return null;
                }
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(response);
                if (responseContent == null || !responseContent.Status)
                {
                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"移库接口调用错误");
                    WriteError(commonStackerCrane.DeviceCode, $"移库接口调用错误");
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库接口调用错误");
                    return null;
                }
                WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.Serialize());
                if (taskDTO == null)
                {
                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"移库接口调用错误");
                    WriteError(commonStackerCrane.DeviceCode, $"移库接口调用错误");
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库接口调用错误");
                    return null;
                }
                if (task.TaskNum == taskDTO.TaskNum)
                {
                    return task;
                }
                else
                {
                    Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO);
                    //判断移库货位任务是否已存在,如存在先执行
                    Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress);
                    if (existTask != null)
                    {
                        return existTask;
                    }
                    else
                    {
                        reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
                        reloTask.CurrentAddress = taskDTO.SourceAddress;
                        reloTask.NextAddress = taskDTO.TargetAddress;
                        reloTask.DeviceCode = task.DeviceCode;
                        reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
                        int taskId = _taskRepository.AddData(reloTask);
                        reloTask.TaskId = taskId;
                    }
                    return reloTask;
                }
            }
            return task;
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/×躸²Ö/AGV_ZHExtend.cs
@@ -9,6 +9,7 @@
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
namespace WIDESEAWCS_Tasks
@@ -19,7 +20,7 @@
        {
            try
            {
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && nameof(AGV_PPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && nameof(AGV_PPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var task in newTasks)
                {
                    try
@@ -61,5 +62,101 @@
                WriteError(nameof(AGV_FLJob), ex.Message, ex);
            }
        }
        /// <summary>
        /// ä¸‹å‘AGV继续执行任务
        /// </summary>
        public void SendAGVWaitToTask()
        {
            try
            {
                var WaitToTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var WaitToTask in WaitToTasks)
                {
                    if (WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        if (WaitToTasks.FirstOrDefault(x => x.TaskState == TaskStatusEnum.AGV_Puting.ObjToInt() || x.TaskState == TaskStatusEnum.Finish.ObjToInt()) != null)
                        {
                            continue;
                        }
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.NextAddress);
                        if (stationManger == null)
                        {
                            continue;
                        }
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                        if (device == null)
                        {
                            continue;
                        }
                        OtherDevice otherDevice = (OtherDevice)device;
                        bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                        bool requestPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, stationManger.StationCode);
                        if (!requestPut)
                        {
                            otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode);
                            continue;
                        }
                        else if (!canPut)
                        {
                            continue;
                        }
                    }
                    else
                    {
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.CurrentAddress);
                        if (stationManger == null)
                        {
                            continue;
                        }
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                        if (device == null)
                        {
                            continue;
                        }
                        OtherDevice otherDevice = (OtherDevice)device;
                        bool canTake = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode);
                        bool requestTake = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, stationManger.StationCode);
                        if (!requestTake)
                        {
                            otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode);
                            continue;
                        }
                        else if (!canTake)
                        {
                            continue;
                        }
                    }
                    AgvSecureReplyDTO replyDTO = new AgvSecureReplyDTO()
                    {
                        ReqCode = Guid.NewGuid().ToString().Replace("-", ""), //WaitToTask.TaskNum.ToString(),
                        taskCode = WaitToTask.AgvTaskNum,
                    };
                    WebResponseContent content = _taskService.AgvSecureReply(replyDTO);
                    if (content.Status && WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        WaitToTask.TaskState = TaskStatusEnum.AGV_Puting.ObjToInt();
                        _taskService.UpdateTask(WaitToTask, TaskStatusEnum.AGV_Puting);
                        break;
                    }
                    else if (content.Status && WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                    {
                        WaitToTask.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
                        _taskService.UpdateTask(WaitToTask, TaskStatusEnum.AGV_Executing);
                    }
                    else
                    {
                        WaitToTask.TaskState = TaskStatusEnum.Exception.ObjToInt();
                        WaitToTask.ExceptionMessage = content.Message;
                        _taskService.UpdateTask(WaitToTask, TaskStatusEnum.Exception);
                    }
                }
                _taskService.UpdateData(WaitToTasks);
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(AGV_CSJJob) + ":" + ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/02143a0b-3339-4244-b940-0fc56a40a2ae.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3c89de48-4a08-4fe0-8316-5c4d4bd0d410.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9d223ae2-4a90-4efd-ae67-f1131a379c2f.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bfe4e4fb-c551-4c7f-94ec-d7011d126854.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ecf85f9b-999c-489f-bcd0-f5a76920c64b.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ef8b54ea-95e6-4615-a7de-9b16de52a1b0.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs
@@ -43,6 +43,8 @@
                List<string> lockLocationCodes = locationCaches_GM.Select(x => x.LocationCode).ToList();
                List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo);
                //获取所有二深位货位数据
                List<Dt_LocationInfo> locationInfoDepth = Repository.QueryData(x => x.RoadwayNo == roadwayNo && x.Depth== locationInfos.Max(v=>v.Depth));
                if (locationInfos == null || locationInfos.Count == 0)
                {
                    throw new Exception($"未找到该巷道的货位信息,巷道号:{roadwayNo}");
@@ -83,6 +85,37 @@
                        Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo);
                        if (locationInfo != null)
                        {
                            if (locationInfo.Depth<locationInfoDepth.Max(x=>x.Depth) && palletTypeInfo.LocaitonCount<2)
                            {
                                Dt_LocationInfo? locationInfoExist = null;
                                int Column = locationInfo.Column;
                                if (Column % 2 == 0)
                                {
                                    Column -= 1;
                                }
                                if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth)
                                {
                                    locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row-1) && x.Column== Column && x.Layer==locationInfo.Layer && x.LocationStatus==LocationStatusEnum.InStock.ObjToInt());
                                }
                                else
                                {
                                    locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt());
                                }
                                //获取深位货位类型
                                if (locationInfoExist==null)
                                {
                                    continue;
                                }
                                Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType);
                                if (palletTypeInfoDepth == null)
                                {
                                    continue;
                                }
                                if (palletTypeInfoDepth.LocaitonCount==2 && palletTypeInfo.LocaitonCount==1)
                                {
                                    continue;
                                }
                            }
                            locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
@@ -103,6 +136,37 @@
                        Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo);
                        if (locationInfo != null)
                        {
                            if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth) && palletTypeInfo.LocaitonCount < 2)
                            {
                                Dt_LocationInfo? locationInfoExist = null;
                                int Column = locationInfo.Column;
                                if (Column % 2 == 0)
                                {
                                    Column -= 1;
                                }
                                if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth)
                                {
                                    locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt());
                                }
                                else
                                {
                                    locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt());
                                }
                                //获取深位货位类型
                                if (locationInfoExist == null)
                                {
                                    continue;
                                }
                                Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType);
                                if (palletTypeInfoDepth == null)
                                {
                                    continue;
                                }
                                if (palletTypeInfoDepth.LocaitonCount == 2)
                                {
                                    continue;
                                }
                            }
                            locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs
@@ -71,6 +71,11 @@
        /// å›žè°ƒWCS任务完成
        /// </summary>
        [Description("回调WCS任务完成")]
        FeedBackWCSTaskCompleted
        FeedBackWCSTaskCompleted,
        /// <summary>
        /// QMS来料检验接口
        /// </summary>
        [Description("QMS来料检验接口")]
        WMS_QMSReceiveCheckApi,
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
@@ -147,7 +147,16 @@
        /// </summary>
        [Description("成品空框回库")]
        EmptyProductBack = 630,
        /// <summary>
        /// é˜»ç„Šå…¥åº“小件
        /// </summary>
        [Description("阻焊入库小件")]
        InZHProductSmall = 640,
        /// <summary>
        /// é˜»ç„Šå…¥åº“大件
        /// </summary>
        [Description("阻焊入库大件")]
        InZHProductLarge = 645,
        /// <summary>
        /// å··é“内移库
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/WareHouseEnum/WarehouseEnum.cs
@@ -71,7 +71,12 @@
        /// æ²¹å¢¨ä»“
        /// </summary>
        [Description("油墨仓")]
        HA153
        HA153,
        /// <summary>
        /// é˜»ç„Šä»“
        /// </summary>
        [Description("阻焊仓")]
        HA154
    }
    public enum WarehouseTypEnum
    {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs
@@ -56,36 +56,5 @@
                Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate);
            }
        }
        public static string GetStr(string textToEncrypt)
        {
            string publicKey;
            string privateKey;
            GenerateRSAKeyPair(out publicKey, out privateKey);
            byte[] encryptedBytes = RSAEncrypt(textToEncrypt, publicKey);
            // å¯ä»¥å°†åŠ å¯†åŽçš„å­—èŠ‚æ•°ç»„è½¬æ¢ä¸ºBase64字符串方便后续处理,例如传输等
            string encryptedBase64 = Convert.ToBase64String(encryptedBytes);
            return encryptedBase64;
        }
        public static void GenerateRSAKeyPair(out string publicKey, out string privateKey)
        {
            using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(2048))
            {
                publicKey = rsa.ToXmlString(false);
                privateKey = rsa.ToXmlString(true);
            }
        }
        public static byte[] RSAEncrypt(string plainText, string publicKey)
        {
            byte[] encryptedData;
            using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
            {
                rsa.FromXmlString(publicKey);
                // å°†æ–‡æœ¬è½¬æ¢ä¸ºUTF8编码的字节数组
                byte[] plainBytes = Encoding.UTF8.GetBytes(plainText);
                // ä½¿ç”¨SHA1哈希算法以及Pkcs1填充规则进行加密
                encryptedData = rsa.Encrypt(plainBytes, true);
            }
            return encryptedData;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpQmsHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http.Headers;
using WIDESEA_Core.LogHelper;
using System.Security.Cryptography;
namespace WIDESEA_Core.Helper
{
    public class HttpQmsHelper
    {
        public static string Post(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null)
        {
            string result = string.Empty;
            DateTime beginDate = DateTime.Now;
            try
            {
                using (HttpContent httpContent = new StringContent(requestJson))
                {
                    httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 60);
                    //正式
                    //string authorization = "AppKey 1930944618148245504";
                    //测试
                    string authorization = "AppKey 1930944618148245504";
                    headers = new Dictionary<string, string>
                    {
                        { "Authorization", authorization },
                        //正式
                        //{ "Site_tenant_id", "6ec60d66-b08e-4ff3-90fa-57748053f79b" }
                        //测试
                        { "Site_tenant_id", "6ec60d66-b08e-4ff3-90fa-57748053f79b" }
                    };
                    if (headers != null)
                    {
                        foreach (var header in headers)
                            httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                    }
                    HttpResponseMessage responseMessage = httpClient.PostAsync(serviceAddress, httpContent).Result;
                    result = responseMessage.Content.ReadAsStringAsync().Result;
                }
                return result;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            finally
            {
                Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesLotModel.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_DTO.MES
{
    public class MesLotInfoModel
    {
        public string Product { get; set; }
        public string ProductVersion { get; set; }
        public decimal Qty { get; set; }
        public string DateCode { get; set; }
        public string LotNo { get; set; }
        public bool IsFullNumber { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/CheckResultDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_DTO.QMS
{
    /// <summary>
    /// Qms回传
    /// </summary>
    public class CheckResultDTO
    {
        /// <summary>
        /// æ”¶è´§å•号
        /// </summary>
        public string EntryNumber { get; set; }
        /// <summary>
        /// æ”¶è´§è¡Œå·
        /// </summary>
        public int RowNumber { get; set; }
        /// <summary>
        /// æ¥æ–™æ£€éªŒå•号
        /// </summary>
        public string InspectionNumber { get; set; }
        /// <summary>
        /// ç»“æžœ
        /// </summary>
        public string Result { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        public string Remark { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/ReceiveResultDto.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_DTO.QMS
{
    /// <summary>
    /// Qms回传
    /// </summary>
    public class ReceiveResultDTO
    {
        /// <summary>
        /// æ£€éªŒ
        /// </summary>
        public string InspectionNumber { get; set; }
        /// <summary>
        /// ID
        /// </summary>
        public string Id { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs
@@ -80,6 +80,9 @@
        /// 
        /// </summary>
        public int PalletType { get; set; }
        /// <summary>
        /// AGV任务号
        /// </summary>
        public string AGVTaskNum { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_External/IQMSService/IInvokeQMSService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_External.Model;
namespace WIDESEA_External.QMSService
{
    /// <summary>
    /// è°ƒç”¨QMS接口
    /// </summary>
    public interface IInvokeQMSService : IDependency
    {
        /// <summary>
        /// QMS收货来料检验接口调用
        /// </summary>
        /// <param name="receiveModel"></param>
        /// <returns></returns>
        string InvokeReceiveCheckApi(QMSReceiveCheckModel model);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/QMSReceiveCheckModel.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_External.Model
{
    public class QMSReceiveCheckModel
    {
        /// <summary>
        /// æ”¶è´§å•号
        /// </summary>
        public string EntryNumber { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// æ•°é‡
        /// </summary>
        public decimal Quantity { get; set; }
        /// <summary>
        /// ä¾›åº”商编码
        /// </summary>
        public string SupplierCode { get; set; }
        /// <summary>
        /// ä¾›åº”商名称
        /// </summary>
        public string SupplierName { get; set; }
        /// <summary>
        /// ä¾›åº”商批次号
        /// </summary>
        public string BatchNumber { get; set; }
        /// <summary>
        /// é€è´§å•号
        /// </summary>
        public string DeliveryNumber { get; set; }
        /// <summary>
        /// é‡‡è´­å•号
        /// </summary>
        public string PurchaseNumber { get; set; }
        /// <summary>
        /// æ”¶è´§å•行号
        /// </summary>
        public int RowNumber { get; set; }
        /// <summary>
        /// ä»“库
        /// </summary>
        public string WarehouseCode { get; set; }
        /// <summary>
        /// æ”¶æ–™æ—¶é—´
        /// </summary>
        public string ReceiptDate { get; set; }
        /// <summary>
        /// æ”¶æ–™å¤‡æ³¨
        /// </summary>
        public string Remark { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_External/QMSService/InvokeQMSService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.APIEnum;
using WIDESEA_Core.Helper;
using WIDESEA_DTO;
using WIDESEA_DTO.MES;
using WIDESEA_External.Model;
using WIDESEA_IBasicRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_External.QMSService
{
    public class InvokeQMSService: IInvokeQMSService
    {
        private readonly IApiInfoRepository _apiInfoRepository;
        public InvokeQMSService(IApiInfoRepository apiInfoRepository)
        {
            _apiInfoRepository = apiInfoRepository;
        }
        JsonSerializerSettings settings = new JsonSerializerSettings
        {
            ContractResolver = new CamelCasePropertyNamesContractResolver()
        };
        public string InvokeReceiveCheckApi(QMSReceiveCheckModel model)
        {
            Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_QMSReceiveCheckApi.ToString());
            MESRoot<QMSReceiveCheckModel> requestModel = new MESRoot<QMSReceiveCheckModel>()
            {
                From = "WMS",
                DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                Content = model
            };
            string request = JsonConvert.SerializeObject(requestModel, settings);
            string response = HttpQmsHelper.Post(apiInfo.ApiAddress, request);
            return response;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -47,7 +47,7 @@
        /// <param name="tasks"></param>
        /// <param name="agvDescription"></param>
        /// <returns></returns>
        WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "");
        WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "", string agvtaskNum = "");
        /// <summary>
        /// 
@@ -55,7 +55,7 @@
        /// <param name="taskNum"></param>
        /// <param name="agvDescription"></param>
        /// <returns></returns>
        WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "");
        WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "", string agvtaskNum = "");
        /// <summary>
        /// ç”³è¯·å…¥åº“任务(PDA使用,仅托盘绑定入库站台,不分配货位)
@@ -124,6 +124,8 @@
        /// <param name="heightType"></param>
        /// <returns></returns>
        WebResponseContent AssignInboundTaskLocationByHeight(int taskNum, string roadwayNo, int heightType);
        WebResponseContent RequestZHInboundTask(string agvTaskCode, string palletCode, string palletType, string materialLot);
        /// <summary>
        /// 
@@ -373,5 +375,6 @@
        /// äººå·¥é€‰æ‹©åº“å­˜
        /// </summary>
        WebResponseContent OutProductSelect(int orderDetailId, List<ProStockViewDTO> proStockViews);
        WebResponseContent GetZHMesMaterialLot(string materialLot);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -4,6 +4,7 @@
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using Org.BouncyCastle.Asn1.Ocsp;
using SqlSugar;
using System;
using System.Collections;
@@ -912,7 +913,15 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                string SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:")-1);
                string SerNum = "";
                if (materielBoxCode.LastIndexOf("SC:")<0)
                {
                    SerNum = materielBoxCode;
                }
                else
                {
                    SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:") - 1);
                }
                MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, SerNum);
                //验证判断时间格式
                WebResponseContent IsValidContent = IsValidMCDates(new List<MatSerNumAnalysisModel>() { model });
@@ -920,7 +929,11 @@
                {
                    return content.Error(IsValidContent.Message);
                }
                string result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3);
                string result = "";
                if (materielBoxCode.LastIndexOf("SC:") > 0)
                {
                    result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3);
                }
                //获取入库单明细
                Dt_InboundOrderDetail inboundOrderDetail = _inboundRepository.InboundOrderDetailRepository.QueryFirst(x=>x.BatchNo== model.LotNo && x.MaterielCode== model.MaterielCode);
                if (inboundOrderDetail == null)
@@ -968,8 +981,8 @@
                        PalletCode = model.LotNo,
                        StockStatus = StockStatusEmun.组盘暂存.ObjToInt(),
                        WarehouseId = inboundOrder.WarehouseId,
                        PalletType = GetPalletTypeGMOrPP(warehouse, result.Split("*")[0]),
                        StockLength = result.Split("*")[0].ObjToInt(),
                        PalletType = GetPalletTypeGMOrPP(warehouse, result.IsNullOrEmpty() ? "" : result.Split("*")[0]),
                        StockLength = result.IsNullOrEmpty() ? 0 : result.Split("*")[0].ObjToInt(),
                        Details = new List<Dt_StockInfoDetail>()
                    };
                }
@@ -1058,8 +1071,8 @@
                    PalletCode = model.LotNo,
                    StockStatus = StockStatusEmun.组盘暂存.ObjToInt(),
                    WarehouseId = warehouse.WarehouseId,
                    PalletType = GetPalletTypeGMOrPP(warehouse, request.Split("*")[0]),
                    StockLength = request.Split("*")[0].ObjToInt(),
                    PalletType = GetPalletTypeGMOrPP(warehouse, request.IsNullOrEmpty() ?"":request.Split("*")[0]),
                    StockLength = request.IsNullOrEmpty()?0:request.Split("*")[0].ObjToInt(),
                    Details = new List<Dt_StockInfoDetail>()
                };
            }
@@ -1104,7 +1117,7 @@
            if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString())
            {
                if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=515)
                if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=520)
                {
                    return 15;
                }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs
@@ -1,5 +1,6 @@

using AutoMapper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -15,6 +16,9 @@
using WIDESEA_Core.Helper;
using WIDESEA_DTO;
using WIDESEA_DTO.Basic;
using WIDESEA_DTO.QMS;
using WIDESEA_External.Model;
using WIDESEA_External.QMSService;
using WIDESEA_IBasicRepository;
using WIDESEA_ICheckRepository;
using WIDESEA_IInboundRepository;
@@ -32,8 +36,10 @@
        private readonly IBasicRepository _basicRepository;
        private readonly ICheckOrderRepository _checkOrderRepository;
        private readonly IStockRepository _stockRepository;
        private readonly ISupplierInfoRepository _supplierInfoRepository;
        private readonly IInvokeQMSService _invokeQMSService;
        public ReceiveOrderDetailService(IReceiveOrderDetailRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IInboundRepository inboundRepository, IBasicRepository basicRepository, ICheckOrderRepository checkOrderRepository, IStockRepository stockRepository) : base(BaseDal)
        public ReceiveOrderDetailService(IReceiveOrderDetailRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IInboundRepository inboundRepository, IBasicRepository basicRepository, ICheckOrderRepository checkOrderRepository, IStockRepository stockRepository,ISupplierInfoRepository supplierInfoRepository,IInvokeQMSService invokeQMSService) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
@@ -41,6 +47,8 @@
            _basicRepository = basicRepository;
            _checkOrderRepository = checkOrderRepository;
            _stockRepository = stockRepository;
            _supplierInfoRepository = supplierInfoRepository;
            _invokeQMSService = invokeQMSService;
        }
        private static object _rowNoLocker = new object();
@@ -64,8 +72,9 @@
                {
                    return WebResponseContent.Instance.Error($"该单据已收货完成");
                }
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == receiveOrder.WarehouseId);
                MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, serNum);
                Dt_SupplierInfo supplierInfo = _supplierInfoRepository.QueryFirst(x => x.SupplierCode == receiveOrder.SuppliersId);
                //收货增加批次卡控
                //查询收货明细是否有存在同一个批次
                Dt_ReceiveOrderDetail receiveOrderDetailOld = _inboundRepository.ReceiveOrderDetailRepository.QueryFirst(x => x.LotNo == model.LotNo && x.MaterielCode == model.MaterielCode);
@@ -320,10 +329,40 @@
                        }
                        _inboundRepository.ReceiveOrderRepository.UpdateData(receiveOrder);
                        _inboundRepository.PurchaseOrderDetailRepository.UpdateData(purchaseOrderDetail);
                        QMSReceiveCheckModel qMSReceiveCheck = new QMSReceiveCheckModel()
                        {
                            EntryNumber=receiveOrder.ReceiveOrderNo,
                            MaterialCode=receiveOrderDetail.MaterielCode,
                            MaterialName=receiveOrderDetail.MaterielName,
                            Quantity=(decimal)receiveOrderDetail.ReceivedQuantity,
                            SupplierCode=receiveOrder.SuppliersId,
                            SupplierName= supplierInfo.SupplierName,
                            BatchNumber=receiveOrderDetail.LotNo,
                            DeliveryNumber=receiveOrder.DeliveryCode,
                            PurchaseNumber=receiveOrderDetail.PurchaseOrderNo,
                            RowNumber= receiveOrderDetail.RowNo,
                            WarehouseCode= warehouse.WarehouseCode,
                            ReceiptDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                            Remark=" "
                        };
                        string response = _invokeQMSService.InvokeReceiveCheckApi(qMSReceiveCheck);
                        MesResponseContent mesResponseContent = response.DeserializeObject<MesResponseContent>();
                        if (!mesResponseContent.BSucc)
                        {
                            throw new Exception(mesResponseContent.StrMsg);
                        }
                        ReceiveResultDTO receiveResult = JsonConvert.DeserializeObject<ReceiveResultDTO>(mesResponseContent.Content.ToString());
                        if (receiveResult==null)
                        {
                            throw new Exception("接收QMS结果失败");
                        }
                        #region æ³¨é‡Š
                        if (materielInfo.IsCheck == WhetherEnum.True)
                        {
                            Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                            checkOrder.CheckOrderNo = receiveResult.InspectionNumber;
                            checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo;
                            checkOrder.Result = CheckAcceptEnum.NotCheckAccept.ToString();
                            checkOrder.QualifiedQuantity = 0;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs
@@ -134,7 +134,7 @@
                            && (isCanLot ? isCanLot : x.BagNo == outOrderDetail.PLot)
                            && (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode))
                        .Sum(x => x.StockPcsQty - x.OutboundQuantity);
                    if (useableStockQuantity < needQuantity)
                    if (useableStockQuantity < needQuantity && useableStockQuantity >0)
                    {
                        stockInfo.proStockInfoDetails.Where(x => x.ProductCode == outOrderDetail.PCode && x.ProductVersion.StartsWith(outOrderDetail.PVer.Substring(0, 1))
                            && (isCanLot ? isCanLot : x.BagNo == outOrderDetail.PLot)
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs
@@ -225,7 +225,7 @@
                string roadwayNo=string.Empty;
                foreach (var location in locationCounts.OrderBy(x => x.Count))
                {
                    if (location.Count == 1)
                    if (location.Count <= 2)
                        continue;
                    roadwayNo = location?.RoadwayNo ?? "";
                    break;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -77,7 +77,7 @@
                      (x.EnableStatus == (int)EnableStatusEnum.Normal || x.EnableStatus == (int)EnableStatusEnum.OnlyOut));
                    if (locationInfo == null)
                    {
                        return responseContent.Error($"测试架货位。。。。。。。。。:{stockInfo.LocationCode}出库条件不满足");
                        return responseContent.Error($"测试架货位:{stockInfo.LocationCode}出库条件不满足");
                    }
                    //生成测试架出库任务 é”å®šåº“å­˜ æ›´æ”¹è´§ä½çŠ¶æ€
                    Dt_Task taskOut = new()
@@ -1424,6 +1424,46 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// èŽ·å–MES阻焊批次信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public WebResponseContent GetZHMesMaterialLot(string materialLot)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_MES_GetProductByLot.ToString());
                object obj = new { LotNo = materialLot };
                MESRoot<object> root = new MESRoot<object>()
                {
                    From = "WMS",
                    DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    Content = obj
                };
                JsonSerializerSettings settings = new JsonSerializerSettings
                {
                    ContractResolver = new CamelCasePropertyNamesContractResolver()
                };
                string request = JsonConvert.SerializeObject(root, settings);
                string response = HttpMesHelper.Post(apiInfo.ApiAddress, request);
                MesResponseContent mesResponseContent = response.DeserializeObject<MesResponseContent>();
                //调用接口
                if (mesResponseContent.BSucc == true)
                {
                    content.OK(mesResponseContent.StrMsg, mesResponseContent.Content);
                }
                else
                {
                    content.Error(mesResponseContent.StrMsg);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -112,7 +112,7 @@
        /// ä»»åŠ¡ä¿¡æ¯æŽ¨é€è‡³WCS
        /// </summary>
        /// <returns></returns>
        public WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "")
        public WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "",string agvtaskNum="")
        {
            try
            {
@@ -120,6 +120,7 @@
                taskDTOs.ForEach(x =>
                {
                    x.AGVArea = agvDescription;
                    x.AGVTaskNum = agvtaskNum;
                });
                string url = AppSettings.Get("WCS");
                if (string.IsNullOrEmpty(url))
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -55,7 +55,7 @@
        /// ä»»åŠ¡ä¿¡æ¯æŽ¨é€è‡³WCS
        /// </summary>
        /// <returns></returns>
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "")
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "", string agvtaskNum = "")
        {
            try
            {
@@ -69,6 +69,7 @@
                taskDTOs.ForEach(x =>
                {
                    x.AGVArea = agvDescription;
                    x.AGVTaskNum = agvtaskNum;
                });
                string url = AppSettings.Get("WCS");
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -1,4 +1,6 @@
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -9,12 +11,14 @@
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.OtherEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.Helper;
using WIDESEA_DTO;
using WIDESEA_DTO.MES;
using WIDESEA_DTO.Task;
using WIDESEA_Model.Models;
@@ -736,6 +740,97 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent RequestZHInboundTask(string agvTaskCode, string palletCode, string palletType, string materialLot)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                //获取测试架原库存信息
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString());
                //获取库存记录
                List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
                  x.WarehouseId == warehouse.WarehouseId && x.PalletCode== palletCode).Includes(x => x.Details).ToList();
                if (stockInfos.Count > 0)
                {
                    return content.Error($"载具托盘已存在");
                }
                Dt_StockInfo? stockInfoOld = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.BatchNo == materialLot));
                if (stockInfoOld != null)
                {
                    return content.Error($"库存信息已存在");
                }
                Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x=>x.CodeStartStr== palletType);
                if (palletTypeInfo == null)
                {
                    return content.Error($"托盘类型信息不存在");
                }
                //获取阻焊批次
                WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot);
                if (!requestLotInfo.Status)
                {
                    return content.Error($"请求阻焊批次信息失败,{requestLotInfo.Message}");
                }
                MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString());
                Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail()
                {
                    MaterielSpec = mesLotInfo.ProductVersion,
                    BatchNo = materialLot,
                    EffectiveDate = mesLotInfo.DateCode ?? " ",
                    MaterielCode = mesLotInfo.Product,
                    InboundOrderRowNo =  0,
                    MaterielName = mesLotInfo.Product,
                    ProductionDate = mesLotInfo.DateCode ?? " ",
                    OrderNo = "",
                    OutboundQuantity = 0,
                    SerialNumber = materialLot,
                    StockQuantity = (float)mesLotInfo.Qty,
                    Status = StockStatusEmun.入库确认.ObjToInt(),
                    Unit = "Lot",
                    Remark= mesLotInfo.IsFullNumber?"满Lot":"不满Lot"
                };
                Dt_StockInfo stockInfo = new Dt_StockInfo()
                {
                    PalletCode = palletCode,
                    PalletType = palletTypeInfo.PalletType,
                    WarehouseId = warehouse.WarehouseId,
                    StockStatus = StockStatusEmun.入库确认.ObjToInt(),
                    Details = new List<Dt_StockInfoDetail> { stockInfoDetail }
                };
                //生成退库任务
                Dt_Task taskIn = new()
                {
                    CurrentAddress = "AGV_ZH",
                    Grade = 0,
                    PalletCode = palletCode,
                    NextAddress = "",
                    Roadway = "SC01_ZH",
                    SourceAddress = "AGV_ZH",
                    TargetAddress = "",
                    TaskStatus = (int)TaskStatusEnum.New,
                    TaskType = palletTypeInfo.LocaitonCount==2? (int)TaskTypeEnum.InZHProductLarge : (int)TaskTypeEnum.InZHProductSmall,
                    TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    PalletType = palletTypeInfo.PalletType,
                    WarehouseId = warehouse.WarehouseId
                };
                _unitOfWorkManage.BeginTran();
                Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand();
                BaseDal.AddData(taskIn);
                //BaseDal.AddData(task);
                _unitOfWorkManage.CommitTran();
                //将任务推送到WCS
                PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV_ZH"); ;
                content.OK(data: taskIn);
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content;
        }
        public readonly string[] OutStartPonits = { "5230", "5237", "5244" };
        /// <summary>
        /// æˆå“ä½™æ–™é€€åº“入仓
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -124,7 +124,7 @@
                }
                if (result.Item1 != null && result.Item1.Count > 0)
                {
                    Dt_Task? task = BaseDal.QueryData(x=>x.TaskType==TaskTypeEnum.OutProduct.ObjToInt()).OrderByDescending(x=>x.Grade).FirstOrDefault();
                    Dt_Task? task = BaseDal.QueryData(x=>x.TaskType==TaskTypeEnum.OutProduct.ObjToInt()).OrderBy(x=>x.Grade).FirstOrDefault();
                    //更新出库目的位置
                    result.Item1.ForEach(x =>
                    {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/QMS/QmsController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.MaterielEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Core;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.Helper;
using WIDESEA_DTO;
using WIDESEA_DTO.Basic;
using WIDESEA_DTO.ERP;
using WIDESEA_DTO.QMS;
using WIDESEA_External.ERPService;
using WIDESEA_External.Model;
using WIDESEA_External.QMSService;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IInboundRepository;
using WIDESEA_IInboundService;
using WIDESEA_InboundService;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
using static WIDESEA_DTO.ErpResponseContent;
namespace WIDESEA_WMSServer.Controllers.QMS
{
    /// <summary>
    /// ERP接口
    /// </summary>
    [Route("api/Qms")]
    [ApiController]
    public class QmsController : ControllerBase
    {
        private readonly IBasicService _basicService;
        private readonly IOutboundService _outboundService;
        private readonly IInboundService _inboundService;
        private readonly IInvokeERPService _invokeERPService;
        private readonly IReturnOrderService _returnOrderService;
        private readonly IInvokeQMSService _invokeQMSService;
        public QmsController(IBasicService basicService, IOutboundService outboundService, IInboundService inboundService,
            IInvokeERPService invokeERPService, IReturnOrderService returnOrderService, IInvokeQMSService invokeQMSService)
        {
            _basicService = basicService;
            _outboundService = outboundService;
            _inboundService = inboundService;
            _invokeERPService = invokeERPService;
            _returnOrderService = returnOrderService;
            _invokeQMSService = invokeQMSService;
        }
        ///// <summary>
        ///// æ£€éªŒå•回传更新
        ///// </summary>
        ///// <param name="model"></param>
        ///// <returns></returns>
        //[HttpPost, Route("CheckResultReturn"), AllowAnonymous, MethodParamsValidate]
        //public ErpResponseContent ReceivePurchaseOrder([FromBody] Root<CheckResultDTO> model)
        //{
        //    WebResponseContent content = _inboundService.PurchaseOrderService.ReceivePurchaseOrder(model.Content);
        //    if (content.Status) return Instance.OK();
        //    else return Instance.Error(content.Message);
        //}
        /// <summary>
        /// æ”¶è´§å•来料检验推送
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost, Route("ReceiveCheck"), AllowAnonymous, MethodParamsValidate]
        public string ReceivePurchaseOrder([FromBody] QMSReceiveCheckModel model)
        {
           string content = _invokeQMSService.InvokeReceiveCheckApi(model);
           return content;
        }
        /// <summary>
        /// æ£€éªŒå•回传更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost, Route("CheckResultReturn"), AllowAnonymous, MethodParamsValidate]
        public MesResponseContent CheckResultReturn([FromBody] ERPCheckModel model)
        {
            string content = _invokeERPService.InvokeCheckOrderApi(model);
            ErpRequestContent requestContent = content.DeserializeObject<ErpRequestContent>();
            if (requestContent.res != 1)
            {
                return MesResponseContent.Instance.Error(requestContent.Data);
            }
            return MesResponseContent.Instance.OK("成功");
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -130,7 +130,11 @@
        {
            return Service.AssignInboundTaskLocationByHeight(taskNum, roadwayNo, heightType);
        }
        [HttpPost, HttpGet, Route("RequestZHInboundTask"), AllowAnonymous]
        public WebResponseContent RequestZHInboundTask(string agvTaskCode, string palletCode, string palletType, string materialLot)
        {
            return Service.RequestZHInboundTask(agvTaskCode,palletCode,palletType,materialLot);
        }
        /// <summary>
        /// å…¥åº“任务完成
        /// </summary>
@@ -260,7 +264,6 @@
        {
            return await Service.TaskCompleted(taskNum);
        }
        /// <summary>
        /// å•个任务推送至WCS
        /// </summary>
@@ -268,9 +271,9 @@
        /// <param name="agvDescription"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("PushTasksToWCSSingle"), AllowAnonymous]
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "")
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "", string agvtaskNum = "")
        {
            return Service.PushTasksToWCSSingle(taskNum, agvDescription);
            return Service.PushTasksToWCSSingle(taskNum, agvDescription, agvtaskNum);
        }
        /// <summary>
        /// é€‰æ‹©åº“存生成出库任务
@@ -374,5 +377,13 @@
        {
            return Service.OutProductSelect(orderDetailId, proStockViews);
        }
        /// <summary>
        /// é˜»ç„Šæ‰¹æ¬¡ç‰©æ–™æŸ¥è¯¢
        /// </summary>
        [HttpPost, Route("GetZHMesMaterialLot"), AllowAnonymous]
        public WebResponseContent GetZHMesMaterialLot(string materialLot)
        {
            return Service.GetZHMesMaterialLot(materialLot);
        }
    }
}