|
@@ -0,0 +1,58 @@
|
|
|
+package com.sd.business.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.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.sd.business.entity.warehouse.dto.WarehouseDto;
|
|
|
+import com.sd.business.entity.warehouse.dto.WarehouseSelectDto;
|
|
|
+import com.sd.business.entity.warehouse.po.Warehouse;
|
|
|
+import com.sd.business.entity.warehouse.vo.WarehouseVo;
|
|
|
+import com.sd.business.mapper.warehouse.WarehouseMapper;
|
|
|
+import com.sd.business.service.warehouse.WarehouseService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 仓库 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author
|
|
|
+ * @since 2023-11-07
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse> implements WarehouseService {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<WarehouseVo> getPage(WarehouseSelectDto dto) {
|
|
|
+ IWrapper<Warehouse> wrapper = getWrapper();
|
|
|
+ wrapper.orderByDesc("w", Warehouse::getId);
|
|
|
+ wrapper.eq("w", Warehouse::getType, dto.getType());
|
|
|
+ wrapper.like("w", Warehouse::getName, dto.getName());
|
|
|
+ return this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public WarehouseVo detail(Long id) {
|
|
|
+ Warehouse warehouse = this.getById(id);
|
|
|
+ WarehouseVo result = BeanUtil.toBean(warehouse, WarehouseVo.class);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void add(WarehouseDto warehouseDto) {
|
|
|
+ this.save(warehouseDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void edit(WarehouseDto warehouseDto) {
|
|
|
+ this.updateById(warehouseDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void delete(Long id) {
|
|
|
+ this.removeById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|