Parcourir la source

计划统计中,忽略天数计算及首次计划时间

mingfu il y a 1 mois
Parent
commit
ca7d40f808

+ 5 - 2
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontStudentController.java

@@ -269,14 +269,17 @@ public class FrontStudentController extends BaseController {
         }
 
         Integer preDay = 0; // 同月的排队计划开始之前的 历史月不好计算,待定 TODO MF
-        if(DateUtils.isSameDay(DateUtils.truncate(cond.getReportDate(), Calendar.MONTH), DateUtils.truncate(curr.getFirstTime(), Calendar.MONTH))) {
+        Date month = DateUtils.truncate(cond.getReportDate(), Calendar.MONTH);
+        if(DateUtils.isSameDay(month, DateUtils.truncate(curr.getFirstTime(), Calendar.MONTH))) {
             Calendar cal = Calendar.getInstance();
             cal.setTime(curr.getFirstTime());
             preDay = cal.get(Calendar.DAY_OF_MONTH) - 1;
         }
         JSONObject stats = new JSONObject();
+        stats.put("firstDay", DateUtil.format(curr.getFirstTime(), "yyyy-MM-dd"));
+        stats.put("preDay", preDay);
         stats.put("doneDay", doneDay);
-        stats.put("undoneDay", LocalDateTimeUtil.of(cond.getReportDate()).getDayOfMonth() - doneDay - preDay);
+        stats.put("undoneDay", LocalDateTimeUtil.of(DateUtils.addDays(DateUtils.addMonths(month, 1), -1)).getDayOfMonth() - doneDay - preDay);
         stats.put("videoTimes", videoTimes);
         stats.put("questionCnt", questionCnt);
         stats.put("studyList", monthStudyList);