|
@@ -11,6 +11,8 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -24,11 +26,17 @@ import java.util.List;
|
|
|
public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSchedulingMapper, ProductionScheduling> implements ProductionSchedulingService {
|
|
|
|
|
|
@Override
|
|
|
- public List<ProductionSchedulingVo> getList(ProductionSchedulingSelectDto dto) {
|
|
|
+ public Map<String, List<ProductionSchedulingVo>> listMap(ProductionSchedulingSelectDto dto) {
|
|
|
IWrapper<ProductionScheduling> wrapper = getWrapper();
|
|
|
- wrapper.orderByDesc("ps", ProductionScheduling::getId);
|
|
|
- List<ProductionSchedulingVo> list = this.baseMapper.getList(wrapper);
|
|
|
- return list;
|
|
|
+ //数据分组
|
|
|
+ wrapper.groupBy("ps.scheduling_date", "ps.processes_id");
|
|
|
+ //时间范围过滤
|
|
|
+ wrapper.ge("ps", ProductionScheduling::getSchedulingDate, dto.getBeginTime());
|
|
|
+ wrapper.le("ps", ProductionScheduling::getSchedulingDate, dto.getEndTime());
|
|
|
+ //排序
|
|
|
+ wrapper.orderByAsc("ps", ProductionScheduling::getSchedulingDate);
|
|
|
+ List<ProductionSchedulingVo> list = this.baseMapper.listSumQuantity(wrapper);
|
|
|
+ return list.stream().collect(Collectors.groupingBy(ProductionSchedulingVo::getSchedulingDateStr));
|
|
|
}
|
|
|
|
|
|
@Override
|