|
@@ -4,6 +4,7 @@ import com.fjhx.wms.entity.warehouse.po.Warehouse;
|
|
|
import com.fjhx.wms.mapper.warehouse.WarehouseMapper;
|
|
|
import com.fjhx.wms.service.warehouse.WarehouseService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fjhx.wms.entity.warehouse.vo.WarehouseVo;
|
|
@@ -12,6 +13,9 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import com.fjhx.wms.entity.warehouse.dto.WarehouseDto;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -30,6 +34,8 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse
|
|
|
wrapper.orderByDesc("w", Warehouse::getId);
|
|
|
wrapper.like("w",Warehouse::getName,dto.getKeyword());
|
|
|
Page<WarehouseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ //赋值仓管员名称
|
|
|
+ UserUtil.assignmentNickName(page.getRecords(),Warehouse::getKeeperId,WarehouseVo::setKeeperName);
|
|
|
return page;
|
|
|
}
|
|
|
|
|
@@ -37,6 +43,9 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse
|
|
|
public WarehouseVo detail(Long id) {
|
|
|
Warehouse Warehouse = this.getById(id);
|
|
|
WarehouseVo result = BeanUtil.toBean(Warehouse, WarehouseVo.class);
|
|
|
+ //赋值仓管员名称
|
|
|
+ Map<Long, String> nickNameMapByIds = UserUtil.getNickNameMapByIds(Arrays.asList(result.getKeeperId()));
|
|
|
+ result.setKeeperName(nickNameMapByIds.get(result.getKeeperId()));
|
|
|
return result;
|
|
|
}
|
|
|
|