huanghongfeng
2025-04-24 aadc2a4fe5e62be74044acbb75549ef08a2d1c5d
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCZInfo.cs
@@ -9,7 +9,9 @@
using WIDESEA_Core.Helper;
using WIDESEA_DTO.WMS;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.GZ_ZC.DistributeWheels;
using WIDESEA_StorageBasicRepository;
using WIDESEA_StorageBasicService;
namespace WIDESEA_StoragIntegrationServices
{
@@ -149,7 +151,7 @@
                    if (string.IsNullOrEmpty(level)) throw new Exception("等级转换失败,请检查接口等级参数");
                    //level = leftLevel;
                }
                else if ("rihgt".Equals(wheelsPosition))
                else if ("right".Equals(wheelsPosition))
                {
                    level = LevelChangeHelper.LevelChangeType(rightLevel);
                    if (string.IsNullOrEmpty(level)) throw new Exception("等级转换失败,请检查接口等级参数");
@@ -363,10 +365,20 @@
                    _unitOfWorkManage.BeginTran(); //开启事务
                    _CZInfo_MesRepository.AddData(CZInfo_Mes);          //添加车轴信息
                    _WheelsStockRepository.UpdateData(wheelsStocks);    //更新库存数据
                    _locationRepository.UpdateData(locationInfos);      //更新库位数据  
                    _taskRepository.AddData(listTask);                  //添加任务数据
                    if(leftContainer != null)
                    {
                        _AxleshelfService.AddAxleshe(leftContainer, CZInfo_Mes,clxh, wheelsPosition, newOrOld);    //添加车轴上架记录
                    }
                    if (rightContainer != null)
                    {
                        _AxleshelfService.AddAxleshe(rightContainer, CZInfo_Mes,clxh,wheelsPosition,newOrOld);   //添加车轴上架记录
                    }
                    //下发出库任务给WCS
                    var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
@@ -398,6 +410,9 @@
                        _unitOfWorkManage.RollbackTran();  //回滚事务
                        throw new Exception("WCS处理失败");
                    }
                    _unitOfWorkManage.CommitTran();  //提交事务
                    content.OK($"车轮出库任务下发给WCS成功.");
                    return content;
                }
                else
@@ -413,6 +428,9 @@
            }
        }
        private Dt_Task CreateOutTask(Dt_WheelsStock wheelsStock, string CZTM)
        {
            CheckInfo checkInfo = new CheckInfo()
@@ -453,5 +471,7 @@
            };
            return task;
        }
    }
}