浏览代码

bug修复

dzx 2 月之前
父节点
当前提交
a32ba5b987

+ 16 - 2
src/main/java/com/xjrsoft/module/databoard/controller/DataboardController.java

@@ -46,6 +46,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Comparator;
@@ -133,8 +134,21 @@ public class DataboardController {
     @GetMapping(value = "/meeting-statistics")
     @ApiOperation(value="会议统计")
     @SaCheckPermission("databoard:detail")
-    public RT<MeetingStatisticsVo> meetingStatistics(@Valid StatisticsDto dto){
-        String sql = "SELECT id, (SELECT COUNT(*) FROM xjr_user WHERE FIND_IN_SET(id, meeting_apply_participants)) AS person_count FROM wf_meeting_apply";
+    public RT<MeetingStatisticsVo> meetingStatistics(@Valid StatisticsDetailDto dto){
+        LocalDateTime startTime = null;
+        LocalDateTime endTime = null;
+        if(dto.getStartDate() != null){
+            startTime = dto.getStartDate().atStartOfDay();
+        }
+        if(dto.getEndDate() != null){
+            endTime = dto.getEndDate().atStartOfDay().plusDays(1).plusNanos(-1);
+        }
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        String sql = "SELECT id, (SELECT COUNT(*) FROM xjr_user WHERE FIND_IN_SET(id, meeting_apply_participants)) AS person_count FROM wf_meeting_apply where 1 = 1";
+        if(startTime != null && endTime != null){
+            sql += " and meeting_apply_date between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
+        }
         List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
         MeetingStatisticsVo result = new MeetingStatisticsVo();
         result.setAllCount(list.size());

+ 1 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -352,7 +352,7 @@ public class BaseNewStudentController {
         return RT.ok(true);
     }
 
-    @PostMapping("/report-export")
+    @PostMapping("/report-export-query")
     @ApiOperation(value = "导出")
     public ResponseEntity<byte[]> exportData(@Valid BaseNewStudentPageDto dto) {
         List<BaseNewStudentPageVo> reportList = baseNewStudentService.getReportList(dto);