xiaoyang
2024-11-07 27428ddcd208e10c15adead9d6b48d6843b0a0b6
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -595,10 +595,20 @@
        try
        {
            // 调用BaseDal.QueryFirstAsync方法,查询任务
            var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode);
            if (task != null)
            {
                content =  await UpdateExistingTask(input, task);
                return content;
            }
            // 创建一个TrayCellsStatusDto对象,并赋值
            TrayCellsStatusDto trayCells = new TrayCellsStatusDto()
            {
                TrayBarcode = input.PalletCode
                Software = "WMS",
                TrayBarcode = input.PalletCode,
                 EquipmentCode = "ECH001-B"
            };
            // 调用GetTrayCellStatusAsync方法,获取整盘电芯
@@ -608,7 +618,7 @@
            // 添加组盘信息
            // 将content.Data转换为ResultTrayCellsStatus对象
            var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.ToString());
            var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString());
            var boxing = await CreateBoxingInfo(result, input.PalletCode);
            // 调用GetProcessApplyAsync方法,获取工艺路线
@@ -620,8 +630,6 @@
            // 调用GetProcessResponseAsync方法,获取工艺响应
            var processResponse = await GetProcessResponseAsync(process, input.Position);
            // 调用BaseDal.QueryFirstAsync方法,查询任务
            var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode);
            // 如果task不为null,则调用UpdateExistingTask方法,更新任务;否则调用CreateNewTask方法,创建新任务
            content = task != null ? await UpdateExistingTask(input, task) : await CreateNewTask(processResponse, input);
            if (content.Status)
@@ -659,7 +667,7 @@
                SerialNumber = serialNoObj.SerialNo,
                OrderNo = serialNoObj.PositionNo.ToString(),
                Status = serialNoObj.SerialNoStatus,
                MaterielCode = result.BindCode,
                MaterielCode = serialNoObj.BindCode,
                Remark = result.TrayBarcodePropertys.ToJsonString(),
            }).ToList()
        };
@@ -671,6 +679,8 @@
        // 创建一个ProcessApplyDto对象,并赋值
        return new ProcessApplyDto()
        {
             EquipmentCode = "ECH001-B",
             Software = "WMS",
            //WipOrderNo = result.BindCode,
            SerialNos = content.SerialNos.Select(item => new SerialNos
            {
@@ -697,13 +707,13 @@
        {
            case "1088":
                return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                    .Where(x => x.EquipmentType == "陈化" && x.WipOrderNo == apply.WipOrderNo && x.ProductDesc == apply.ProductNo)
                    .Where(x => x.EquipmentType == "陈化" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo)
                    .ToList();
            case "1339":
            case "1406":
                return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                    .Where(x => x.EquipmentType == "静置" && x.WipOrderNo == apply.WipOrderNo && x.ProductDesc == apply.ProductNo)
                    .Where(x => x.EquipmentType == "静置" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo)
                    .ToList();
            default:
@@ -1235,6 +1245,8 @@
                isUpdateStock = await _stockInfoRepository.AddDataNavAsync(stock);
            }
            // 添加历史任务
            var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0;
@@ -1387,15 +1399,15 @@
                // 创建WMS任务
                WMSTaskDTO taskDTO = new WMSTaskDTO()
                {
                    TaskNum = 0,
                    TaskNum = task.TaskNum.Value,
                    Grade = 1,
                    PalletCode = DateTime.Now.ToString("MMddHHmmss"),
                    PalletCode = task.PalletCode,
                    RoadWay = task.Roadway,
                    SourceAddress = input.Position,
                    SourceAddress = task.SourceAddress,
                    TargetAddress = task.Roadway,
                    TaskState = (int)TaskInStatusEnum.InNew,
                    TaskState = task.TaskState.Value,
                    Id = 0,
                    TaskType = (int)TaskInboundTypeEnum.Inbound,
                    TaskType = task.TaskType,
                };
                content.OK(data: taskDTO);
            }