|
@@ -0,0 +1,65 @@
|
|
|
+package com.sd.business.service.inventory.impl;
|
|
|
+
|
|
|
+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.bom.po.Bom;
|
|
|
+import com.sd.business.entity.bom.po.BomSpec;
|
|
|
+import com.sd.business.entity.inventory.dto.InventorySelectDto;
|
|
|
+import com.sd.business.entity.inventory.po.Inventory;
|
|
|
+import com.sd.business.entity.inventory.vo.InventoryVo;
|
|
|
+import com.sd.business.entity.inventory.vo.QuantityByDepartmentVo;
|
|
|
+import com.sd.business.entity.inventory.vo.QuantityByWarehouseVo;
|
|
|
+import com.sd.business.mapper.inventory.InventoryMapper;
|
|
|
+import com.sd.business.service.inventory.InventoryService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 库存 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author
|
|
|
+ * @since 2023-07-03
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory> implements InventoryService {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<InventoryVo> getPage(InventorySelectDto dto) {
|
|
|
+ IWrapper<Inventory> wrapper = getWrapper();
|
|
|
+
|
|
|
+ wrapper.orderByDesc("i", Inventory::getId);
|
|
|
+ wrapper.eq("b", Bom::getBomClassifyId, dto.getBomClassifyId());
|
|
|
+ wrapper.like("bs", BomSpec::getName, dto.getBomSpecName());
|
|
|
+ wrapper.like("bs", BomSpec::getCode, dto.getBomSpecCode());
|
|
|
+ wrapper.eq("b", Bom::getSpecies, dto.getBomSpecies());
|
|
|
+ wrapper.eq("b", Bom::getChromatophore, dto.getBomChromatophore());
|
|
|
+ wrapper.eq("b", Bom::getEmbossingProcess, dto.getBomEmbossingProcess());
|
|
|
+ wrapper.eq("b", Bom::getFrontGrain, dto.getBomFrontGrain());
|
|
|
+ wrapper.eq("b", Bom::getReverseGrain, dto.getBomReverseGrain());
|
|
|
+ wrapper.like("bs", BomSpec::getColour, dto.getBomSpecColour());
|
|
|
+ wrapper.like("bs", BomSpec::getLength, dto.getBomSpecLength());
|
|
|
+ wrapper.like("bs", BomSpec::getWidth, dto.getBomSpecWidth());
|
|
|
+ wrapper.eq("i", Inventory::getWarehouseId, dto.getWarehouseId());
|
|
|
+ wrapper.eq("i", Inventory::getDepartmentId, dto.getDepartmentId());
|
|
|
+
|
|
|
+ Page<InventoryVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<QuantityByWarehouseVo> getQuantityByWarehouse() {
|
|
|
+ return baseMapper.getQuantityByWarehouse();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<QuantityByDepartmentVo> getQuantityByDepartment() {
|
|
|
+ return baseMapper.getQuantityByDepartment();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|