| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author whj |
| | |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("count", list.size()); |
| | | map.put("sum", sum); |
| | | map.put("name", ""); |
| | | if (list.size() > 0) { |
| | | OrderTask orderTask = list.get(0); |
| | | String areaSectionId = orderTask.getAreaSectionId(); |
| | | AreaSection a = iAreaSectionService.getById(areaSectionId); |
| | | Area area2 = iAreaService.getById(orderTask.getAreaId()); |
| | | map.put("name", area2.getName() + a.getName()); |
| | | list.clear(); |
| | | String name = area.getName(); |
| | | Map<String, List<OrderTask>> collect = list.stream().collect(Collectors.groupingBy(OrderTask::getAreaSectionId)); |
| | | for (Map.Entry<String, List<OrderTask>> stringListEntry : collect.entrySet()) { |
| | | String key = stringListEntry.getKey(); |
| | | List<OrderTask> value = stringListEntry.getValue(); |
| | | if(value.size()>0){ |
| | | AreaSection a = iAreaSectionService.getById(key); |
| | | name+=a.getName(); |
| | | } |
| | | } |
| | | if(name.equals(area.getName())){ |
| | | map.put("name", ""); |
| | | }else { |
| | | map.put("name", name); |
| | | } |
| | | return new ResultUtil<Object>().setData(map); |
| | | } |