| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto; |
| | | import com.ruoyi.warehouse.mapper.DocumentationMapper; |
| | | import com.ruoyi.warehouse.mapper.WarehouseGoodsShelvesRowcolMapper; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesRowcolService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description 针对表【warehouse_goods_shelves_rowcol(仓库货架层,列表)】的数据库操作Service实现 |
| | | * @createDate 2025-08-13 11:49:02 |
| | | */ |
| | | * @author 86151 |
| | | * @description 针对表【warehouse_goods_shelves_rowcol(仓库货架层,列表)】的数据库操作Service实现 |
| | | * @createDate 2025-08-13 11:49:02 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class WarehouseGoodsShelvesRowcolServiceImpl extends ServiceImpl<WarehouseGoodsShelvesRowcolMapper, WarehouseGoodsShelvesRowcol> |
| | | implements WarehouseGoodsShelvesRowcolService { |
| | | @Autowired |
| | | private WarehouseGoodsShelvesRowcolMapper warehouseGoodsShelvesRowcolMapper; |
| | | @Autowired |
| | | private DocumentationMapper documentationMapper; |
| | | @RequiredArgsConstructor |
| | | public class WarehouseGoodsShelvesRowcolServiceImpl extends ServiceImpl<WarehouseGoodsShelvesRowcolMapper, WarehouseGoodsShelvesRowcol> implements WarehouseGoodsShelvesRowcolService { |
| | | private final WarehouseGoodsShelvesRowcolMapper warehouseGoodsShelvesRowcolMapper; |
| | | private final DocumentationMapper documentationMapper; |
| | | |
| | | @Override |
| | | public IPage<WarehouseGoodsShelvesRowcol> listPage(Page page, WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) { |
| | | IPage<WarehouseGoodsShelvesRowcol> list = warehouseGoodsShelvesRowcolMapper.listPage(page, warehouseGoodsShelvesRowcol); |
| | | public List<WarehouseGoodsShelvesRowcolDto> getList(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) { |
| | | List<WarehouseGoodsShelvesRowcolDto> list = warehouseGoodsShelvesRowcolMapper.findList(warehouseGoodsShelvesRowcol); |
| | | for (WarehouseGoodsShelvesRowcolDto dto : list) { |
| | | //获取层ids |
| | | Long id = dto.getId(); |
| | | //获取文档 |
| | | dto.setDocumentationDtoList(documentationMapper.listBywarehouseGoodsShelvesRowcolId(id)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | |
| | | Wrapper<Documentation> queryWrapper = new LambdaQueryWrapper<Documentation>() |
| | | .in(Documentation::getWarehouseGoodsShelvesRowcolId, ids); |
| | | List<Documentation> documentations = documentationMapper.selectList(queryWrapper); |
| | | if (!documentations.isEmpty()) return false; |
| | | if (!documentations.isEmpty()) throw new RuntimeException("货架下有商品,不能删除"); |
| | | warehouseGoodsShelvesRowcolMapper.deleteBatchIds(ids); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |