|
@@ -46,6 +46,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
+import java.time.LocalDateTime;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
@@ -133,8 +134,21 @@ public class DataboardController {
|
|
@GetMapping(value = "/meeting-statistics")
|
|
@GetMapping(value = "/meeting-statistics")
|
|
@ApiOperation(value="会议统计")
|
|
@ApiOperation(value="会议统计")
|
|
@SaCheckPermission("databoard:detail")
|
|
@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);
|
|
List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
MeetingStatisticsVo result = new MeetingStatisticsVo();
|
|
MeetingStatisticsVo result = new MeetingStatisticsVo();
|
|
result.setAllCount(list.size());
|
|
result.setAllCount(list.size());
|