| | |
| | | JSONObject result = new JSONObject(); |
| | | YearMonth yearMonth = YearMonth.parse(apsGasPipingRouteStat.getSearchEndDate()); |
| | | int daysInMonth = yearMonth.lengthOfMonth(); |
| | | HashSet<String> startPlanTimeSet = new HashSet<>(); |
| | | LinkedHashSet<String> startPlanTimeSet = new LinkedHashSet<>(); |
| | | //工序分组统计 |
| | | LinkedHashMap<String, List<ApsResourceDateStat>> processMap = new LinkedHashMap<>(); |
| | | List<HashMap<String, List<ApsResourceDateStat>>> processList = new ArrayList<>(); |
| | |
| | | } |
| | | }else if("month".equals(apsGasPipingRouteStat.getSearchType())){ |
| | | searchCapacityPlan.setYear(yearMonth.getYear()+""); |
| | | for(int i=1;i<=12;i++){ |
| | | startPlanTimeSet.add(yearMonth.getYear()+"-"+(i<10?"0"+i:i)); |
| | | YearMonth start = YearMonth.of(Integer.parseInt(apsGasPipingRouteStat.getSearchStartDate().split("-")[0]), Integer.parseInt(apsGasPipingRouteStat.getSearchStartDate().split("-")[1])); |
| | | YearMonth end = YearMonth.of(Integer.parseInt(apsGasPipingRouteStat.getSearchEndDate().split("-")[0]), Integer.parseInt(apsGasPipingRouteStat.getSearchEndDate().split("-")[1])); |
| | | List<String> yearMonths = getYearMonthsInRange(start, end); |
| | | for (String yearMonthStr : yearMonths) { |
| | | startPlanTimeSet.add(yearMonthStr); |
| | | } |
| | | } |
| | | List<ApsGasPipelineCapacityPlan> apsGasPipelineCapacityPlanList = apsGasPipelineCapacityPlanMapper.selectApsGasPipelineCapacityPlanList(searchCapacityPlan); |
| | |
| | | styles.put("title", style); |
| | | return styles; |
| | | } |
| | | |
| | | public static List<String> getYearMonthsInRange(YearMonth start, YearMonth end) { |
| | | List<String> yearMonths = new ArrayList<>(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); |
| | | |
| | | while (!start.isAfter(end)) { |
| | | yearMonths.add(start.format(formatter)); |
| | | start = start.plusMonths(1); |
| | | } |
| | | |
| | | return yearMonths; |
| | | } |
| | | } |