|
|
@@ -8,6 +8,7 @@ import com.izouma.wenlvju.dto.PageQuery;
|
|
|
import com.izouma.wenlvju.dto.ReportDTO;
|
|
|
import com.izouma.wenlvju.enums.UnitType;
|
|
|
import com.izouma.wenlvju.repo.GradingOrganizationRepo;
|
|
|
+import com.izouma.wenlvju.repo.OrganizationRepo;
|
|
|
import com.izouma.wenlvju.repo.RecordRepo;
|
|
|
import com.izouma.wenlvju.repo.regulation.ComplainRepo;
|
|
|
import com.izouma.wenlvju.repo.regulation.ReportRepo;
|
|
|
@@ -30,6 +31,7 @@ public class ReportService {
|
|
|
private RecordRepo recordRepo;
|
|
|
private ComplainRepo complainRepo;
|
|
|
private GradingOrganizationRepo gradingOrganizationRepo;
|
|
|
+ private OrganizationRepo organizationRepo;
|
|
|
|
|
|
public Page<Report> all(PageQuery pageQuery) {
|
|
|
return reportRepo.findAll(JpaUtils.toSpecification(pageQuery, Report.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
@@ -86,5 +88,25 @@ public class ReportService {
|
|
|
.examQuantity(examQuantity)
|
|
|
.build());
|
|
|
});
|
|
|
+
|
|
|
+ organizer.forEach((key, value) -> {
|
|
|
+ GradingOrganization go = gradingOrganizationMap.get(key);
|
|
|
+ // 投诉
|
|
|
+ List<Complain> complainList = complainsByName.get(go.getId());
|
|
|
+ String complainContent = complainList.stream().map(Complain::getTitle).collect(Collectors.joining(","));
|
|
|
+ // 备案
|
|
|
+ List<Record> recordList = examinationAgency.get(key);
|
|
|
+ int examCenterQuantity = recordList.stream().mapToInt(Record::getExamCenterQuantity).sum();
|
|
|
+ int examQuantity = recordList.stream().mapToInt(Record::getExamQuantity).sum();
|
|
|
+
|
|
|
+ reportDTOS.add(ReportDTO.builder()
|
|
|
+ .unitType(UnitType.ORGANIZATION)
|
|
|
+ .name(key)
|
|
|
+ .complain(complainList.size())
|
|
|
+ .complainContent(complainContent)
|
|
|
+ .examCenterQuantity(examCenterQuantity)
|
|
|
+ .examQuantity(examQuantity)
|
|
|
+ .build());
|
|
|
+ });
|
|
|
}
|
|
|
}
|