Commit a098dffd by 丁伟峰

单条容量查询,返回lengend;

1 parent 7f9f686a
...@@ -18,7 +18,7 @@ public class CapacityQueryOrderRespDTO { ...@@ -18,7 +18,7 @@ public class CapacityQueryOrderRespDTO {
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public static class LegendDTO { public static class LegendDTO {
private int type; private Integer type;
private String memo; private String memo;
} }
...@@ -36,6 +36,6 @@ public class CapacityQueryOrderRespDTO { ...@@ -36,6 +36,6 @@ public class CapacityQueryOrderRespDTO {
private String text; private String text;
private String begin; private String begin;
private String end; private String end;
private int type; private Integer type;
} }
} }
...@@ -83,10 +83,18 @@ public class CapacityQueryServiceImpl implements CapacityQueryService { ...@@ -83,10 +83,18 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
CapacityQueryOrderRespDTO capacityQueryRespDTO = new CapacityQueryOrderRespDTO(); CapacityQueryOrderRespDTO capacityQueryRespDTO = new CapacityQueryOrderRespDTO();
capacityQueryRespDTO.setBeginDate(reqDTO.getBeginDate()).setEndDate(reqDTO.getEndDate()); capacityQueryRespDTO.setBeginDate(reqDTO.getBeginDate()).setEndDate(reqDTO.getEndDate());
capacityQueryRespDTO.setCalendar(getTeamCaparityByLayerAndDays(teamId, layer, reqDTO.getBeginDate(), reqDTO.getEndDate())); capacityQueryRespDTO.setCalendar(getTeamCaparityByLayerAndDays(teamId, layer, reqDTO.getBeginDate(), reqDTO.getEndDate()));
capacityQueryRespDTO.setLegend(getLengends());
capacityQueryRespDTO.setRemark(String.format("%s-%s", teamId, layer)); capacityQueryRespDTO.setRemark(String.format("%s-%s", teamId, layer));
return Result.success(capacityQueryRespDTO); return Result.success(capacityQueryRespDTO);
} }
private List<CapacityQueryOrderRespDTO.LegendDTO> getLengends() {
List<CapacityQueryOrderRespDTO.LegendDTO> legends = new ArrayList<>();
legends.add(new CapacityQueryOrderRespDTO.LegendDTO().setType(1).setMemo("剩余30%以上"));
legends.add(new CapacityQueryOrderRespDTO.LegendDTO().setType(2).setMemo("剩余60%以上"));
legends.add(new CapacityQueryOrderRespDTO.LegendDTO().setType(3).setMemo("剩余30%以内"));
return legends;
}
@Override @Override
public Result<?> getTeamStatData(CapacityStatQueryReqDTO capacityStatQueryReqDTO) { public Result<?> getTeamStatData(CapacityStatQueryReqDTO capacityStatQueryReqDTO) {
Page<?> stats = null; Page<?> stats = null;
...@@ -250,7 +258,7 @@ public class CapacityQueryServiceImpl implements CapacityQueryService { ...@@ -250,7 +258,7 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate date = LocalDate.parse(day, dateFormatter); LocalDate date = LocalDate.parse(day, dateFormatter);
DayOfWeek weekday = date.getDayOfWeek(); DayOfWeek weekday = date.getDayOfWeek();
return String.format("周%s", weekday.getDisplayName(TextStyle.SHORT, Locale.CHINA)); return weekday.getDisplayName(TextStyle.SHORT, Locale.CHINA);
} }
@lombok.Data @lombok.Data
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!