ce1f8c5b0e8cd5d4050e79c3e02433aafce81b24..b095c75267297527116cda105669015babc01972
4 天以前 chenyong
1
b095c7 对比 | 目录
4 天以前 huangxiaoqiang
Merge branch 'master' of http://115.159.85.185:8098/r/HuaYiZhongHeng/BaiBuLiKu
264067 对比 | 目录
4 天以前 huangxiaoqiang
1
ff34f2 对比 | 目录
5 天以前 chenyong
重写库存导出方法
8b3377 对比 | 目录
已删除2个文件
已添加5个文件
已修改16个文件
232 ■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/PalletWithDetailExportModel.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/staticwebassets/msbuild.buildMultiTargeting.WIDESEA_WMSServer.props 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/staticwebassets/msbuild.buildTransitive.WIDESEA_WMSServer.props 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -146,4 +146,4 @@
app.MapHubs();
app.MapControllers();
app.Run();
app.Run();
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -1,5 +1,5 @@
{
    "urls": "http://*:9291", //web服务端口,如果用IIS部署,把这个去掉
    "urls": "http://*:9290", //web服务端口,如果用IIS部署,把这个去掉
    "Logging": {
        "LogLevel": {
            "Default": "Information",
@@ -12,7 +12,7 @@
    "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
    //连接字符串
    //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WCSDBB2F;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    //跨域
    "Cors": {
        "PolicyName": "CorsIpAccess", //策略名称
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -448,7 +448,7 @@
                {
                    if (task.TaskType == (int)TaskOutboundTypeEnum.InToOut && taskDTO.RoadWay.Contains("CW"))
                    {
                        var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1017" && x.stationType == 10 && x.Roadway == taskDTO.RoadWay);
                        var stationinfo = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017" ||x.stationPLC=="1024")&& x.stationType == 10 && x.Roadway == taskDTO.RoadWay);
                        task.TaskState = (int)TaskOutStatusEnum.OutNew;
                        task.CurrentAddress = taskDTO.SourceAddress;
                        task.NextAddress = stationinfo.stationChildCode;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
@@ -117,6 +117,8 @@
                    #region è·¯ç”±æ–¹å¼
                    List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
                    childDeviceCodes.Add("4000");
                    
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
@@ -147,7 +149,6 @@
                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                                    if (method != null)
                                    {
                                        //var strings = platform.Location.Split(',').ToList();
                                        int count = 1;
                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                    }
@@ -161,7 +162,6 @@
                        var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
                        if (tokenInfos == null || !tokenInfos.Any())
                        {
                            //throw new Exception(conveyorLine.DeviceName + "缓存中未找到Token缓存");
                            continue;
                        }
                        var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
@@ -208,6 +208,13 @@
                //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                WriteInfo(conveyorLine.DeviceName, log);
                if (childDeviceCode == "4000")
                {
                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(1601), childDeviceCode);
                    Thread.Sleep(100);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 9999, childDeviceCode);
                }
                if (task == null)
                {
@@ -313,20 +320,36 @@
        /// <param name="command">读取的请求信息</param>
        /// <param name="childDeviceCode">子设备编号</param>
        /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param>
        /// <summary>
        /// è§¦å‘输送线出库请求处理
        /// </summary>
        /// <param name="conveyorLine">输送线实例(CommonConveyorLine_CW类型),包含输送线设备基础信息和操作方法</param>
        /// <param name="command">输送线任务指令对象(后续版本),暂未直接使用,预留指令上下文</param>
        /// <param name="childDeviceCode">子设备编码,用于定位输送线的具体子设备</param>
        public void RequestOutbound(CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            // æ ¹æ®ä¸»è¾“送线设备编码和子设备编码,查询对应的输送线任务
            var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
            // è‹¥æŸ¥è¯¢åˆ°æœ‰æ•ˆä»»åŠ¡ï¼Œåˆ™æ‰§è¡ŒåŽç»­æŒ‡ä»¤å‘é€å’ŒçŠ¶æ€æ›´æ–°é€»è¾‘
            if (task != null)
            {
                // å°†æ•°æ®åº“查询到的任务对象映射为指令对象(适配指令发送的数据结构)
                ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                // å‘送任务指令到指定输送线子设备,并获取发送结果(原注释掉的conveyorLine.SendCommand已替换为封装后的方法)
                bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                // è‹¥æŒ‡ä»¤å‘送成功,执行状态更新操作
                if (sendFlag)
                {
                    // æ›´æ–°è¾“送线子设备的响应状态为1(1代表指令已响应/处理成功,对应数据库字段ConveyorLineDBName_After.ResponState)
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                    // å°†ä»»åŠ¡çŠ¶æ€æ›´æ–°åˆ°ä¸‹ä¸€ä¸ªé˜¶æ®µï¼ˆé€šç”¨ä»»åŠ¡çŠ¶æ€æµè½¬ï¼‰
                    _taskService.UpdateTaskStatusToNext(task);
                    // ç‰¹æ®Šå¤„理:若任务类型为出托盘(OutTray),额外再执行一次任务状态更新(适配出托盘任务的特殊状态流转逻辑)
                    if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray)
                    {
                        _taskService.UpdateTaskStatusToNext(task);
@@ -341,63 +364,103 @@
        /// <param name="conveyorLine">输送线实例对象</param>
        /// <param name="command">读取的请求信息</param>
        /// <param name="childDeviceCode">子设备编号</param>
        /// <summary>
        /// å¤„理输送线下一地址请求(核心逻辑:查询执行中任务→获取MOM配置→调用MOM接口校验→根据校验结果/任务状态发送指令并更新任务)
        /// </summary>
        /// <param name="conveyorLine">输送线实例(CommonConveyorLine_CW类型),包含输送线设备基础信息和操作方法</param>
        /// <param name="command">输送线任务指令对象(后续版本),携带任务编号、条码、子设备编码等关键指令参数</param>
        /// <param name="childDeviceCode">子设备编码,用于定位输送线的具体子设备</param>
        public void RequestOutNextAddress(CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            // 1. æŸ¥è¯¢æŒ‡å®šæ¡ä»¶ä¸‹æ­£åœ¨æ‰§è¡Œçš„输送线任务(任务编号+子设备编码+输送线条码)
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
            // ä»…当查询到有效执行中任务时,执行后续逻辑
            if (task != null)
            {
                // 2. èŽ·å–ç³»ç»Ÿé…ç½®ä¸­ã€ŒIP地址」分类下的配置项(用于拼接MOM接口地址)
                var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
                // æå–MOM基础IP配置值
                var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.MOMIP_BASE)?.ConfigValue;
                // æå–托盘格口状态接口的IP路径配置值
                var ipAddress = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.TrayCellsStatus)?.ConfigValue;
                // æ ¡éªŒMOM IP配置完整性,缺失则抛出异常终止流程
                if (wmsBase == null || ipAddress == null)
                {
                    throw new InvalidOperationException("MOM IP æœªé…ç½®");
                }
                // 3. æŸ¥è¯¢å½“前输送线设备+子设备对应的工位配置信息(关联PLC编码、子编码与MOM设备编码)
                Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
                // 4. æž„建托盘格口状态校验的请求DTO(适配MOM接口入参格式)
                TrayCellsStatusDto trayCells = new TrayCellsStatusDto()
                {
                    Software = "WMS",
                    TrayBarcode = command.ConveyorLineBarcode,
                    EquipmentCode = stationManager.stationEquipMOM,
                    SessionId = Guid.NewGuid().ToString(),
                    EmployeeNo = "MITest",
                    SceneType = "1",
                    RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
                    Software = "WMS",                // è°ƒç”¨æ–¹ç³»ç»Ÿæ ‡è¯†ï¼ˆå›ºå®šä¸ºWMS)
                    TrayBarcode = command.ConveyorLineBarcode, // è¾“送线条码(托盘条码)
                    EquipmentCode = stationManager.stationEquipMOM, // MOM系统对应的设备编码
                    SessionId = Guid.NewGuid().ToString(), // å”¯ä¸€ä¼šè¯ID(防止重复请求)
                    EmployeeNo = "MITest",           // æ“ä½œå‘˜å·¥ç¼–号(测试固定值)
                    SceneType = "1",                 // åœºæ™¯ç±»åž‹ï¼ˆ1代表入站校验场景)
                    RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ") // UTC格式请求时间
                };
                // æ‹¼æŽ¥å®Œæ•´çš„MOM接口地址(基础IP + æŽ¥å£è·¯å¾„)
                var MOMIpAddress = wmsBase + ipAddress;
                // 5. è°ƒç”¨MOM接口(POST异步请求,同步等待结果)
                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
                // è®°å½•接口调用日志(请求参数、返回参数),便于问题排查
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验请求参数【{trayCells.Serialize()}】");
                WriteInfo("入站校验", "");
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验返回参数【{result}】");
                // 6. è§£æžMOM接口返回结果为实体对象
                ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result);
                // 7. åˆ†æ”¯1:接口校验成功 æˆ– ä»»åŠ¡å¤‡æ³¨éžNG(正常流程)
                if (result1.Success || task.Remark != "NG")
                {
                    // æ›´æ–°ä»»åŠ¡çš„ä½ç½®ä¿¡æ¯ï¼ˆä»»åŠ¡ç¼–å·+当前地址),返回更新后的任务对象
                    Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                    if (newTask != null)
                    {
                        // å°†æ›´æ–°åŽçš„任务对象映射为输送线指令对象(适配指令发送结构)
                        ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                        //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        // å‘送指令到输送线子设备,获取发送结果(封装后的SendCommand方法)
                        bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                        // æŒ‡ä»¤å‘送成功则更新设备响应状态和任务数据
                        if (sendFlag)
                        {
                            // æ›´æ–°è¾“送线子设备响应状态为1(代表指令处理成功)
                            conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                            // æŒä¹…化更新后的任务数据到数据库
                            _taskService.UpdateData(newTask);
                        }
                    }
                }
                // 8. åˆ†æ”¯2:接口校验失败 ä¸” ä»»åŠ¡å¤‡æ³¨ä¸ºNG(异常流程,发送NG地址指令)
                else
                {
                    // å°†åŽŸä»»åŠ¡å¯¹è±¡æ˜ å°„ä¸ºè¾“é€çº¿æŒ‡ä»¤å¯¹è±¡
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    // è®¾ç½®æŒ‡ä»¤çš„目标地址为工位配置中的NG子编码(导向异常处理工位)
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    // å‘送NG地址指令到输送线子设备,获取发送结果
                    bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    // æŒ‡ä»¤å‘送成功则更新设备响应状态和任务状态
                    if (sendFlag)
                    {
                        // æ›´æ–°è¾“送线子设备响应状态为1
                        conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                        // å°†ä»»åŠ¡çŠ¶æ€æµè½¬åˆ°ä¸‹ä¸€ä¸ªé˜¶æ®µï¼ˆé€‚é…NG任务的状态逻辑)
                        _taskService.UpdateTaskStatusToNext(task);
                    }
                }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -173,13 +173,13 @@
                    if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType==(int)TaskOutboundTypeEnum.InToOut)
                    {
                        var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1017" && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
                        var stationinfo = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017"||x.stationPLC=="1024") && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
                        if (device != null)
                        {
                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(1815), stationinfo.stationChildCode);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
                            Thread.Sleep(100);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
                        }
@@ -334,24 +334,11 @@
                else
                {
                    IDevice? device = null;
                    if (task.Roadway.Contains("GWSC3"))
                    if (task.Roadway.Contains("GW"))
                    {
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "2025");
                        if (device != null)
                        {
                            CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
                            if (conveyorLine.IsOccupied(task.TargetAddress))//出库站台未被占用
                            {
                                return task;
                            }
                        }
                        else
                        {
                            _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{task.TargetAddress}】对应的通讯对象,无法判断出库站台是否被占用");
                        }
                    } else if (task.Roadway.Contains("GW"))
                    {
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "1015");
                        string targetDeviceCode = task.Roadway == "GWSC3" ? "2025" : "1015";
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == targetDeviceCode);
                        if (device != null)
                        {
                            CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
@@ -173,13 +173,13 @@
                    if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType==(int)TaskOutboundTypeEnum.InToOut)
                    {
                        var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1017" && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
                        var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1024" && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
                        if (device != null)
                        {
                            CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(1815), stationinfo.stationChildCode);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
                            Thread.Sleep(100);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
                        }
Code Management/WMS/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/PalletWithDetailExportModel.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_Model.Models.BasicModel
{
    public class PalletWithDetailExportModel
    {
        // ä¸»è¡¨PalletInfo字段(按需选择)
        public int Id { get; set; }
        public string PalletCode { get; set; }
        public string LocationCode { get; set; }
        public bool IsFull { get; set; }
        public string Remark { get; set; }
        public string Creater { get; set; }
        public DateTime CreateDate { get; set; }
        public DateTime OutboundTime { get; set; }
        // å­è¡¨PalletDetail的MaterielCode字段
        public string MaterielCode { get; set; }
    }
}
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs
@@ -1,4 +1,6 @@
using AngleSharp.Dom;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Mapster;
using Masuit.Tools;
using SqlSugar;
@@ -10,6 +12,8 @@
using WIDESEA_Cache;
using WIDESEA_Common;
using WIDESEA_Core;
using WIDESEA_IStorageBasicService;
using WIDESEA_Model.Models.BasicModel;
namespace WIDESEA_StorageBasicService;
@@ -18,10 +22,12 @@
    private readonly ISimpleCacheService _simpleCacheService;
    private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository;
    public StockInfoService(IStockInfoRepository BaseDal, ISimpleCacheService simpleCacheService, ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository) : base(BaseDal)
    private readonly IStockInfoDetailRepository _IStockInfoDetailRepository;
    public StockInfoService(IStockInfoRepository BaseDal, ISimpleCacheService simpleCacheService, ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository, IStockInfoDetailRepository stockInfoDetailService) : base(BaseDal)
    {
        _simpleCacheService = simpleCacheService;
        _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository;
        _IStockInfoDetailRepository = stockInfoDetailService;
    }
    /// <summary>
@@ -151,6 +157,71 @@
            .ToDictionary(x => x.Key, x => x.Count());
        return result;
    }
    public override WebResponseContent Export(PageDataOptions options)
    {
        WebResponseContent content = new WebResponseContent();
        try
        {
            // 1. æž„建主表查询条件和排序
            string wheres = ValidatePageOptions(options);
            Dictionary<string, OrderByType> orderbyDic = GetPageDataSort(options, TProperties);
            // 2. æŸ¥è¯¢ä¸»è¡¨æ•°æ®
            List<DtStockInfo> mainList = BaseDal.QueryData(wheres, orderbyDic);
            if (!mainList.Any())
            {
                return WebResponseContent.Instance.OK("无数据可导出");
            }
            // 3. æ‰¹é‡æŸ¥è¯¢å­è¡¨æ•°æ®ï¼ˆé€šè¿‡ä¸»è¡¨Id关联)
            var mainIds = mainList.Select(m => m.Id).Distinct().ToList();
            List<DtStockInfoDetail> detailList = _IStockInfoDetailRepository.Db
                .Queryable<DtStockInfoDetail>()
                .Where(d => mainIds.Contains(d.StockId))
                .ToList();
            // 4. å…³è”主表和子表数据(只取子表第一条)
            var exportData = new List<PalletWithDetailExportModel>();
            foreach (var main in mainList)
            {
                // åªå–当前主表数据关联的子表第一条(可通过OrderBy指定排序,确保取到想要的第一条)
                var firstDetail = detailList
                    .Where(d => d.StockId == main.Id)
                    .OrderBy(d => d.Id) // å¯é€‰ï¼šæŒ‰å­è¡¨Id排序,确保结果稳定(可替换为其他字段)
                    .FirstOrDefault();
                var exportModel = new PalletWithDetailExportModel
                {
                    Id = main.Id,
                    PalletCode = main.PalletCode,
                    LocationCode = main.LocationCode,
                    IsFull = main.IsFull,
                    Remark = main.Remark,
                    Creater = main.Creater,
                    CreateDate = main.CreateDate,
                    OutboundTime = (DateTime)main.OutboundTime,
                    // æœ‰å­è¡¨æ•°æ®åˆ™å–第一条的物料编码,无则为空
                    MaterielCode = firstDetail?.MaterielCode ?? ""
                };
                exportData.Add(exportModel);
            }
            // 5. å¯¼å‡ºæ•°æ®ï¼ˆé€»è¾‘不变)
            string savePath = AppDomain.CurrentDomain.BaseDirectory + "ExcelExport";
            IExporter exporter = new ExcelExporter();
            byte[] data = exporter.ExportAsByteArray(exportData).Result;
            string fileName = "托盘及物料编码数据.xlsx";
            FileHelper.WriteFile(savePath, fileName, data);
            content = WebResponseContent.Instance.OK(data: Path.Combine(savePath, fileName));
        }
        catch (Exception ex)
        {
            content = WebResponseContent.Instance.Error(ex.Message);
        }
        return content;
    }
    //public override WebResponseContent UpdateData(DtStockInfo entity)
    //{
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -665,10 +665,14 @@
        {
            // æŸ¥è¯¢ä»»åŠ¡
            var task = await QueryTaskByPalletCode(input.PalletCode);
            if (task != null)
            if (task != null && (task.TaskState == (int)TaskInStatusEnum.InNew || task.TaskState == (int)TaskOutStatusEnum.OutNew))
            {
                return CreateAndReturnWMSTaskDTO(task);
            }
            if(task != null && (task.TaskState != (int)TaskInStatusEnum.InNew || task.TaskState != (int)TaskOutStatusEnum.OutNew))
            {
                return content.Error($"托盘{input.PalletCode}存在任务");
            }
            // æŸ¥è¯¢åº“存信息(这里后续要完善质检回库逻辑)
            var stock = await QueryStockInfo(input.PalletCode);
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/staticwebassets/msbuild.buildMultiTargeting.WIDESEA_WMSServer.props
ÎļþÒÑɾ³ý
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/staticwebassets/msbuild.buildTransitive.WIDESEA_WMSServer.props
ÎļþÒÑɾ³ý