wangqifan пре 4 година
родитељ
комит
92f2a28aae
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      src/main/java/com/izouma/zhumj/service/report/ReportService.java

+ 5 - 4
src/main/java/com/izouma/zhumj/service/report/ReportService.java

@@ -395,7 +395,8 @@ public class ReportService {
         List<TeamReportDTO> teamReportDTOList = new ArrayList<>();
         groupTeamNameMap.forEach((teamName, checkinInfos) -> {
             TeamReportDTO teamReportDTO = new TeamReportDTO();
-            Customer team = customerRepo.findFirstByCoSimpleName(teamName);
+            Customer team = customerRepo.findById(checkinInfos.get(0).getCustomerId())
+                    .orElseThrow(new BusinessException("暂无"));
             if (team != null) {
                 teamReportDTO.setTeamName(team.getCoFullName());
             } else {
@@ -3424,17 +3425,17 @@ public class ReportService {
             oneStoreInfo.put("storeName", storeInfo.getShortName());
             head.add(roomStatusReportDTO.getShortName());
             oneStoreInfo.put("occupancy", roomStatusReportDTO.getOccupancy());
-            thisResult.add(roomStatusReportDTO.getOccupancy()+"%");
+            thisResult.add(roomStatusReportDTO.getOccupancy() + "%");
             nowList.add(oneStoreInfo);
             Map<String, String> lastOneStore = new HashMap<>();
             lastOneStore.put("storeName", roomStatusReportDTO.getShortName());
             lastOneStore.put("occupancy", roomStatusReportDTO.getLastMonthLanLing());
-            lastResult.add(roomStatusReportDTO.getLastMonthLanLing()+"%");
+            lastResult.add(roomStatusReportDTO.getLastMonthLanLing() + "%");
             lastMonth.add(lastOneStore);
             Map<String, String> yesterOneStore = new HashMap<>();
             yesterOneStore.put("storeName", roomStatusReportDTO.getShortName());
             yesterOneStore.put("occupancy", roomStatusReportDTO.getLastYearLanLing());
-            yesterResult.add(roomStatusReportDTO.getLastYearLanLing()+"%");
+            yesterResult.add(roomStatusReportDTO.getLastYearLanLing() + "%");
             lastYear.add(yesterOneStore);
         });
         result.add(thisResult);