|
@@ -1,17 +1,17 @@
|
|
|
package com.fjhx.wms.service.warehouse.impl;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.wms.entity.warehouse.dto.WarehouseDto;
|
|
|
+import com.fjhx.wms.entity.warehouse.dto.WarehouseSelectDto;
|
|
|
import com.fjhx.wms.entity.warehouse.po.Warehouse;
|
|
|
+import com.fjhx.wms.entity.warehouse.vo.WarehouseVo;
|
|
|
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.common.utils.wrapper.IWrapper;
|
|
|
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;
|
|
|
-import com.fjhx.wms.entity.warehouse.dto.WarehouseSelectDto;
|
|
|
-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;
|
|
@@ -22,7 +22,7 @@ import java.util.Map;
|
|
|
* 仓库 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
- * @author
|
|
|
+ * @author
|
|
|
* @since 2023-03-20
|
|
|
*/
|
|
|
@Service
|
|
@@ -32,11 +32,11 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse
|
|
|
public Page<WarehouseVo> getPage(WarehouseSelectDto dto) {
|
|
|
IWrapper<Warehouse> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("w", Warehouse::getId);
|
|
|
- wrapper.like("w",Warehouse::getName,dto.getKeyword());
|
|
|
- wrapper.eq("w",Warehouse::getType,dto.getType());
|
|
|
+ wrapper.like("w", Warehouse::getName, dto.getKeyword());
|
|
|
+ wrapper.eq("w", Warehouse::getType, dto.getType());
|
|
|
Page<WarehouseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
//赋值仓管员名称
|
|
|
- UserUtil.assignmentNickName(page.getRecords(),Warehouse::getKeeperId,WarehouseVo::setKeeperName);
|
|
|
+ UserUtil.assignmentNickName(page.getRecords(), Warehouse::getKeeperId, WarehouseVo::setKeeperName);
|
|
|
return page;
|
|
|
}
|
|
|
|
|
@@ -52,11 +52,13 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse
|
|
|
|
|
|
@Override
|
|
|
public void add(WarehouseDto warehouseDto) {
|
|
|
+ this.nameDuplication(Warehouse::getName, warehouseDto.getName(), "仓库名称重复");
|
|
|
this.save(warehouseDto);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void edit(WarehouseDto warehouseDto) {
|
|
|
+ this.nameDuplication(Warehouse::getName, warehouseDto.getName(), warehouseDto.getId(), "仓库名称重复");
|
|
|
this.updateById(warehouseDto);
|
|
|
}
|
|
|
|