肖洋
2024-11-20 87e7e9995d59c847f6e568453eb4895a77d74e32
MOM设备编号与上位机名称加入区域配置项
已修改2个文件
73 ■■■■■ 文件已修改
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_AreaInfo.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_AreaInfo.cs
@@ -58,21 +58,21 @@
       
     
        /// <summary>
        /// 备  注:
        /// 备  注: 区域点位
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName="Spare1" ) ]
        public string? Spare1  { get; set;  } 
     
        /// <summary>
        /// 备  注:
        /// 备  注: 对应MOM区域编码
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName="Spare2" ) ]
        public string? Spare2  { get; set;  } 
     
        /// <summary>
        /// 备  注:
        /// 备  注: 上位软件名称
        /// 默认值:
        ///</summary>
        [SugarColumn(ColumnName="Spare3" ) ]
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -93,11 +93,11 @@
        {
            if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
            {
                var process = await SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                    .FirstAsync(x => x.EquipmentName == task.Roadway);
                var info = JsonConvert.DeserializeObject<ResponseEqptRunDto>(process.ProcessValue);
                //var process = await SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                //    .FirstAsync(x => x.EquipmentName == task.Roadway);
                //var info = JsonConvert.DeserializeObject<ResponseEqptRunDto>(process.ProcessValue);
                var agingOutputDto = MapToAgingOutputDto(stock, info);
                var agingOutputDto = MapToAgingOutputDto(stock);
                content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto);
                ValidateResponse(content);
            }
@@ -123,31 +123,37 @@
        }
    }
    private AgingOutputDto MapToAgingOutputDto(DtStockInfo stock, ResponseEqptRunDto info)
    private AgingOutputDto MapToAgingOutputDto(DtStockInfo stock, ResponseEqptRunDto info = null)
    {
        // TODO Value值根据MOM下发的静置时间到当前时间的分钟数
        var area = _areaInfoRepository.QueryFirst(x => x.AreaCode == stock.AreaCode);
        if (area == null)
        {
            throw new Exception("未找到对应的库区信息");
        }
        return new AgingOutputDto
        {
            OpFlag = 1,
            Software = "WMS",
            EquipmentCode = "24MEJQ08-1091",
            Software = area.Spare3,
            EquipmentCode = area.Spare2,
            TrayBarcode = stock.PalletCode,
            SerialNos = stock.StockInfoDetails.Select(x => new SerialNoOutDto
            {
                SlotNo = x.OrderNo.ToInt32(),
                SerialNo = x.SerialNumber,
                SerialNoResult = true,
                ParameterInfo = info.ParameterInfo.Select(y => new ParameterInfo()
                {
                    LowerLomit = y.LowerControlLimit,
                    UpperLimit = y.UpperControlLimit,
                    ParameterResult = y.EquipmentAvailabilityFlag,
                    ParameterCode = y.ParameterCode,
                    ParameterDesc = y.Description,
                    TargetValue = y.TargetValue,
                    Value = (DateTime.Parse(stock.LinedProcessFeedbackTime, null, System.Globalization.DateTimeStyles.RoundtripKind).ToLocalTime() - stock.CreateDate).TotalMinutes.ToString(),
                    DefectCode = y.UOMCode
                }).ToList()
                ParameterInfo = new List<ParameterInfo> { new ParameterInfo() { Value = (DateTime.Now - stock.CreateDate).TotalMinutes.ToString() } }
                //ParameterInfo = info.ParameterInfo.Select(y => new ParameterInfo()
                //{
                //    LowerLomit = y.LowerControlLimit,
                //    UpperLimit = y.UpperControlLimit,
                //    ParameterResult = y.EquipmentAvailabilityFlag,
                //    ParameterCode = y.ParameterCode,
                //    ParameterDesc = y.Description,
                //    TargetValue = y.TargetValue,
                //    Value = (DateTime.Parse(stock.LinedProcessFeedbackTime, null, System.Globalization.DateTimeStyles.RoundtripKind).ToLocalTime() - stock.CreateDate).TotalMinutes.ToString(),
                //    DefectCode = y.UOMCode
                //}).ToList()
            }).ToList()
        };
    }
@@ -289,6 +295,7 @@
            // 记录异常信息到控制台和日志
            Console.WriteLine(err.Message.ToString());
            LogFactory.GetLog("任务完成").Error(true, err);
            content.Error(err.Message);
        }
        return content;
    }
@@ -327,7 +334,11 @@
    private DtStockInfo CreateFullPalletStock(Dt_Task task, DtLocationInfo locationInf, DtBoxingInfo boxing)
    {
        var loation = _locationRepository.QueryFirst(x => x.RoadwayNo == task.Roadway && x.LocationCode == task.TargetAddress);
        if (loation == null)
            throw new Exception("未找到对应位置信息");
        var area = _areaInfoRepository.QueryFirst(x => x.AreaID == loation.AreaId);
        if (area == null)
            throw new Exception("未找到对应区域信息");
        var boxDetail = boxing.BoxingInfoDetails.Adapt<List<DtStockInfoDetail>>();
        boxDetail.ForEach(x => { x.Status = (int)StockStateEmun.已入库; });
        var stock = new DtStockInfo()
@@ -350,8 +361,8 @@
                .ToList(),
            TrayBarcode = task.PalletCode,
            OpFlag = 1,
            EquipmentCode = "24MEJQ08-1091",
            Software = "WMS"
            EquipmentCode = area.Spare2,
            Software = area.Spare3
        };
        var result = _agingInOrOutInputService.GetOCVInputAsync(agingInputDto).Result;
        var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString());
@@ -452,13 +463,17 @@
                }
            }
            var area = await _areaInfoRepository.QueryFirstAsync(x => x.Spare1.Contains(input.Position));
            if (area == null)
                return content.Error("改点位不在区域列表中存在");
            // 创建一个TrayCellsStatusDto对象,并赋值
            TrayCellsStatusDto trayCells = new TrayCellsStatusDto()
            {
                Software = "WMS",
                Software = area.Spare3,
                TrayBarcode = input.PalletCode,
                //EquipmentCode = "EQ_CWJZ01"
                EquipmentCode = "24MEJQ08-1091"
                EquipmentCode = area.Spare2
            };
            // 调用GetTrayCellStatusAsync方法,获取整盘电芯
@@ -487,6 +502,12 @@
            // 如果process为null,则返回content
            if (process == null) return content;
            // 并赋值上位软件名称和设备编码
            process.Software = area.Spare3;
            process.EquipmentCode = area.Spare2;
            // 调用GetProcessApplyAsync方法,获取工艺申请
            // 调用_processApplyService.GetProcessApplyAsync方法,获取工艺申请
            content = await _processApplyService.GetProcessApplyAsync(process);
@@ -615,8 +636,6 @@
        // 创建一个ProcessApplyDto对象,并赋值
        return new ProcessApplyDto()
        {
            EquipmentCode = "24MEJQ08-1091",
            Software = "WMS",
            //WipOrderNo = result.BindCode,
            SerialNos = content.SerialNos.Select(item => new SerialNos
            {