|
@@ -223,40 +223,47 @@ public class TAuditController extends BaseController
|
|
|
*/
|
|
|
@GetMapping("/pie")
|
|
|
public AjaxResult getPie() {
|
|
|
- int count = 0;
|
|
|
- int completeCount = 0;
|
|
|
- BigDecimal progress = new BigDecimal(BigInteger.ZERO);
|
|
|
+// int count = 0;
|
|
|
+// int completeCount = 0;
|
|
|
+// BigDecimal progress = new BigDecimal(BigInteger.ZERO);
|
|
|
+// TAudit audit = new TAudit();
|
|
|
+// audit.setDeptId(getLoginUser().getDeptId().toString());
|
|
|
+// TAudit latest = tAuditService.selectTAuditLatest(audit);
|
|
|
+// if (latest != null) {
|
|
|
+// Long auditId = latest.getId();
|
|
|
+// TChapter chapter = new TChapter();
|
|
|
+// chapter.setAuditId(auditId);
|
|
|
+// List<TChapter> tChapters = tChapterService.selectTChapterList(chapter);
|
|
|
+// for (TChapter tChapter : tChapters) {
|
|
|
+// TQuestionnaire questionnaire = new TQuestionnaire();
|
|
|
+// questionnaire.setChapterId(tChapter.getId());
|
|
|
+// List<TQuestionnaire> tQuestionnaires = tQuestionnaireService.selectTQuestionnaireList(questionnaire);
|
|
|
+// for (TQuestionnaire tQuestionnaire : tQuestionnaires) {
|
|
|
+// TOpenItem openItem = new TOpenItem();
|
|
|
+// openItem.setQuestionnaireId(tQuestionnaire.getId());
|
|
|
+// List<TOpenItem> tOpenItems = itOpenItemService.selectTOpenItemList(openItem);
|
|
|
+// for (TOpenItem tOpenItem : tOpenItems) {
|
|
|
+// count++;
|
|
|
+// String status = tOpenItem.getStatus();
|
|
|
+// if ("4".equals(status)) {
|
|
|
+// completeCount++;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (count != 0) {
|
|
|
+// progress = new BigDecimal(completeCount).divide(new BigDecimal(count), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
TAudit audit = new TAudit();
|
|
|
audit.setDeptId(getLoginUser().getDeptId().toString());
|
|
|
TAudit latest = tAuditService.selectTAuditLatest(audit);
|
|
|
+ Double result = new Double("0");
|
|
|
if (latest != null) {
|
|
|
- Long auditId = latest.getId();
|
|
|
- TChapter chapter = new TChapter();
|
|
|
- chapter.setAuditId(auditId);
|
|
|
- List<TChapter> tChapters = tChapterService.selectTChapterList(chapter);
|
|
|
- for (TChapter tChapter : tChapters) {
|
|
|
- TQuestionnaire questionnaire = new TQuestionnaire();
|
|
|
- questionnaire.setChapterId(tChapter.getId());
|
|
|
- List<TQuestionnaire> tQuestionnaires = tQuestionnaireService.selectTQuestionnaireList(questionnaire);
|
|
|
- for (TQuestionnaire tQuestionnaire : tQuestionnaires) {
|
|
|
- TOpenItem openItem = new TOpenItem();
|
|
|
- openItem.setQuestionnaireId(tQuestionnaire.getId());
|
|
|
- List<TOpenItem> tOpenItems = itOpenItemService.selectTOpenItemList(openItem);
|
|
|
- for (TOpenItem tOpenItem : tOpenItems) {
|
|
|
- count++;
|
|
|
- String status = tOpenItem.getStatus();
|
|
|
- if ("4".equals(status)) {
|
|
|
- completeCount++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (count != 0) {
|
|
|
- progress = new BigDecimal(completeCount).divide(new BigDecimal(count), 4, BigDecimal.ROUND_HALF_UP);
|
|
|
- }
|
|
|
-
|
|
|
+ result = tAuditMapper.selectHomeDataPie(latest.getId());
|
|
|
}
|
|
|
- return success(progress);
|
|
|
+ return success(result);
|
|
|
}
|
|
|
|
|
|
/**
|