|
|
@ -0,0 +1,48 @@ |
|
|
|
|
|
package com.spring.modules.warehouse.service.Impl; |
|
|
|
|
|
|
|
|
|
|
|
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.spring.common.utils.PageUtils; |
|
|
|
|
|
import com.spring.modules.warehouse.dao.WarehouseMapper; |
|
|
|
|
|
import com.spring.modules.warehouse.entity.WareHouse; |
|
|
|
|
|
import com.spring.modules.warehouse.service.WarehouseService; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
|
|
@Slf4j |
|
|
|
|
|
public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,WareHouse> implements WarehouseService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private WarehouseMapper warehouseMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public PageUtils getInfo(WareHouse wareHouse) { |
|
|
|
|
|
LambdaQueryWrapper<WareHouse> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
//根据条件查询 |
|
|
|
|
|
//仓库编码 |
|
|
|
|
|
if (StringUtils.isNotEmpty(wareHouse.getWarehouseId())){ |
|
|
|
|
|
queryWrapper.eq(WareHouse::getWarehouseId,wareHouse.getWarehouseId()); |
|
|
|
|
|
} |
|
|
|
|
|
//工程编号 |
|
|
|
|
|
if (StringUtils.isNotEmpty(wareHouse.getSite())){ |
|
|
|
|
|
queryWrapper.eq(WareHouse::getSite,wareHouse.getSite()); |
|
|
|
|
|
} |
|
|
|
|
|
//仓库名称 |
|
|
|
|
|
if (StringUtils.isNotEmpty(wareHouse.getWarehouseName())){ |
|
|
|
|
|
queryWrapper.eq(WareHouse::getWarehouseName,wareHouse.getWarehouseName()); |
|
|
|
|
|
} |
|
|
|
|
|
//保管员 |
|
|
|
|
|
if (StringUtils.isNotEmpty(wareHouse.getKeeper())){ |
|
|
|
|
|
queryWrapper.eq(WareHouse::getKeeper,wareHouse.getKeeper()); |
|
|
|
|
|
} |
|
|
|
|
|
queryWrapper.orderByAsc(WareHouse::getId); |
|
|
|
|
|
IPage<WareHouse> page = this.page(new Page<>(wareHouse.getPage(),wareHouse.getLimit()), queryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
return new PageUtils(page); |
|
|
|
|
|
} |
|
|
|
|
|
} |