春风项目四线(合箱线、总装线)
yyt
2024-05-28 1c703617885275090d69c697e82e61f4940c0bdc
jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/service/impl/BsOrderSchedulingServiceImpl.java
@@ -61,6 +61,20 @@
    }
    /**
     * 查询订单排产
     *
     * @param sncode 订单排产发动机号
     * @return 订单排产
     */
    @Override
    public BsOrderScheduling selectBsOrderSchedulingSNCode(String sncode)
    {
        return bsOrderSchedulingMapper.selectBsOrderSchedulingSNCode(sncode);
    }
    /**
     * 查询订单排产列表
     * 
     * @param bsOrderScheduling 订单排产
@@ -76,6 +90,18 @@
        }
        return bsOrderSchedulingMapper.selectBsOrderSchedulingList(bsOrderScheduling);
    }
    @Override
    public List<BsOrderScheduling> selectBsOrderSchedulingPage(BsOrderScheduling bsOrderScheduling)
    {
        if(bsOrderScheduling.getDateConditions()!=null){
            String[] conditions = bsOrderScheduling.getDateConditions();
            bsOrderScheduling.setStartTime(conditions[0]);
            bsOrderScheduling.setEndTime(conditions[1]);
        }
        return bsOrderSchedulingMapper.selectBsOrderSchedulingPage(bsOrderScheduling);
    }
    @Override
    public FollowReportVO getFollowReportList(BsOrderScheduling bsOrderScheduling)
@@ -120,13 +146,13 @@
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime startTime = LocalDateTime.of(now.getYear(),now.getMonthValue(),now.getDayOfMonth(),8,0,0);
        LocalDateTime endTime = LocalDateTime.of(now.getYear(),now.getMonthValue(),now.plusDays(1).getDayOfMonth(),22,0,0);
        LocalDateTime endTime = LocalDateTime.of(now.getYear(),now.getMonthValue(),now.plusDays(1).getDayOfMonth(),23,0,0);
        String s1 = startTime.format(formatter);
        String s2 = endTime.format(formatter);
        bsOrderScheduling.setStartTime(s1);
        bsOrderScheduling.setEndTime(s2);
        List<BsOrderScheduling> todayList = bsOrderSchedulingMapper.selectBsOrderSchedulingList(bsOrderScheduling);
        todayList = todayList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getCvtOfflineTime())).collect(Collectors.toList());
        todayList = todayList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getFinalAssemblyOfflineTime())).collect(Collectors.toList());
        if (CollUtil.isNotEmpty(todayList)){
            List<String> allModel = todayList.stream().map(BsOrderScheduling::getModel).distinct().collect(Collectors.toList());
            Map<String, List<BsOrderScheduling>> collect = new HashMap<>();
@@ -135,7 +161,7 @@
                List<Integer> arr = new ArrayList<>();
                vo.setName(s);
                collect = todayList.stream().filter(x -> s.equals(x.getModel())).collect(Collectors.groupingBy(item -> new SimpleDateFormat("yyyy-MM-dd HH").format(item
                        .getCvtOfflineTime())));
                        .getFinalAssemblyOfflineTime())));
                Map<Integer,Integer> temp = new HashMap<>();
                if (CollUtil.isNotEmpty(collect)){
                    for (String string : collect.keySet()) {
@@ -147,7 +173,7 @@
                        }
                    }
                }
                for (int i = 8; i < 23; i++) {
                for (int i = 8; i < 24; i++) {
                    if (i==8){
                        arr.add(0);
                    }else {