| | |
| | | private readonly IRepository<SysDictType, MasterDbContextLocator> _sysDictTypeRep; |
| | | private readonly IRepository<SysDictData, MasterDbContextLocator> _sysDictDataRep; |
| | | private readonly ISysExcelTemplateService _sysExcelTemplateService; |
| | | private readonly IRepository<WmsContainerType, MasterDbContextLocator> _wmsContainerTypeRep; |
| | | private readonly static object _lock = new(); |
| | | |
| | | public WmsContainerService( |
| | |
| | | ,IRepository<SysDictType, MasterDbContextLocator> sysDictTypeRep |
| | | ,IRepository<SysDictData, MasterDbContextLocator> sysDictDataRep |
| | | ,ISysExcelTemplateService sysExcelTemplateService |
| | | , IRepository<WmsContainerType, MasterDbContextLocator> wmsContainerTypeRep |
| | | |
| | | ) |
| | | { |
| | | _wmsContainerRep = wmsContainerRep; |
| | | _sysDictTypeRep = sysDictTypeRep; |
| | | _sysDictDataRep = sysDictDataRep; |
| | | _sysExcelTemplateService = sysExcelTemplateService; |
| | | _wmsContainerTypeRep = wmsContainerTypeRep; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public async Task Add(AddWmsContainerInput input) |
| | | { |
| | | var wmsContainer = input.Adapt<WmsContainer>(); |
| | | |
| | | //验证 |
| | | await CheckExisit(wmsContainer); |
| | | |
| | | //容器类型id |
| | | var ContainerTypeInfo = _wmsContainerTypeRep.Where(x => x.Id == input.ContainerTypeId).FirstOrDefault(); |
| | | if (ContainerTypeInfo == null) |
| | | { |
| | | throw Oops.Oh(errorMessage: @$"类型不存在!"); |
| | | } |
| | | wmsContainer.ContainerTypeName = ContainerTypeInfo.TypeName; |
| | | |
| | | wmsContainer.CreatedUserId = wmsContainer.UpdatedUserId = SysHelper.GetUserId(); |
| | | wmsContainer.CreatedUserName = wmsContainer.UpdatedUserName = SysHelper.GetUserName(); |
| | | wmsContainer.CreatedTime = wmsContainer.UpdatedTime = SysHelper.GetNowTime(); |