mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
添加默认货架逻辑
This commit is contained in:
@@ -9,6 +9,8 @@ import cn.lihongjie.coal.warehouse.dto.WarehouseDto;
|
||||
import cn.lihongjie.coal.warehouse.entity.WarehouseEntity;
|
||||
import cn.lihongjie.coal.warehouse.mapper.WarehouseMapper;
|
||||
import cn.lihongjie.coal.warehouse.repository.WarehouseRepository;
|
||||
import cn.lihongjie.coal.warehouseShelve.dto.CreateWarehouseShelveDto;
|
||||
import cn.lihongjie.coal.warehouseShelve.service.WarehouseShelveService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -30,10 +32,22 @@ public class WarehouseService extends BaseService<WarehouseEntity, WarehouseRepo
|
||||
|
||||
@Autowired private ConversionService conversionService;
|
||||
|
||||
@Autowired WarehouseShelveService warehouseShelveService;
|
||||
|
||||
public WarehouseDto create(CreateWarehouseDto request) {
|
||||
WarehouseEntity entity = mapper.toEntity(request);
|
||||
|
||||
this.repository.save(entity);
|
||||
|
||||
CreateWarehouseShelveDto shelveDto = new CreateWarehouseShelveDto();
|
||||
shelveDto.setWarehouse(entity.getId());
|
||||
shelveDto.setName("默认货架");
|
||||
shelveDto.setCode("default");
|
||||
shelveDto.setRemarks("默认货架");
|
||||
|
||||
|
||||
warehouseShelveService.create(shelveDto);
|
||||
|
||||
return getById(entity.getId());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user