|
@@ -0,0 +1,63 @@
|
|
|
+package com.sd.business.service.production.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.ruoyi.common.constant.StatusConstant;
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.sd.business.entity.bom.po.BomSpec;
|
|
|
+import com.sd.business.entity.department.po.Department;
|
|
|
+import com.sd.business.entity.order.enums.OrderStatusEnum;
|
|
|
+import com.sd.business.entity.order.po.OrderInfo;
|
|
|
+import com.sd.business.entity.order.po.OrderSku;
|
|
|
+import com.sd.business.entity.production.dto.StockPreparationDto;
|
|
|
+import com.sd.business.entity.production.vo.StockPreparationVo;
|
|
|
+import com.sd.business.entity.sku.po.SkuSpec;
|
|
|
+import com.sd.business.mapper.production.StockPreparationMapper;
|
|
|
+import com.sd.business.service.production.StockPreparationService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class StockPreparationServiceImpl implements StockPreparationService {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private StockPreparationMapper stockPreparationMapper;
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<StockPreparationVo> uncompletedList(StockPreparationDto dto) {
|
|
|
+ IWrapper<StockPreparationVo> wrapper = createWrapper(dto);
|
|
|
+ return stockPreparationMapper.uncompletedList(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<StockPreparationVo> completedPage(StockPreparationDto dto) {
|
|
|
+ IWrapper<StockPreparationVo> wrapper = createWrapper(dto);
|
|
|
+ wrapper.orderByDesc("os", OrderSku::getStockPreparationTime);
|
|
|
+ wrapper.orderByAsc("os", OrderSku::getId);
|
|
|
+ return stockPreparationMapper.completedPage(dto.getPage(), wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ private IWrapper<StockPreparationVo> createWrapper(StockPreparationDto dto) {
|
|
|
+ IWrapper<StockPreparationVo> wrapper = IWrapper.getWrapper();
|
|
|
+ wrapper.eq("oi", OrderInfo::getStatus, OrderStatusEnum.STOCK_PREPARATION.getKey());
|
|
|
+ wrapper.eq("os", OrderSku::getStockPreparationStatus, StatusConstant.NO);
|
|
|
+
|
|
|
+ wrapper.eq("oi", OrderInfo::getCode, dto.getOrderCode());
|
|
|
+ wrapper.eq("oi", OrderInfo::getWlnCode, dto.getOrderWlnCode());
|
|
|
+
|
|
|
+ wrapper.eq("bs", BomSpec::getCode, dto.getBomSpecCode());
|
|
|
+ wrapper.eq("bs", BomSpec::getName, dto.getBomSpecName());
|
|
|
+
|
|
|
+ wrapper.eq("d", Department::getId, dto.getDepartmentId());
|
|
|
+
|
|
|
+ wrapper.eq("ss", SkuSpec::getCode, dto.getSkuSpecCode());
|
|
|
+ wrapper.eq("ss", SkuSpec::getName, dto.getSkuSpecName());
|
|
|
+
|
|
|
+ wrapper.eq("bs", BomSpec::getWidth, dto.getWidth());
|
|
|
+
|
|
|
+ return wrapper;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|