|
@@ -14,14 +14,15 @@ import com.xjrsoft.module.courseTable.entity.CourseTable;
|
|
import com.xjrsoft.module.courseTable.service.ICourseTableService;
|
|
import com.xjrsoft.module.courseTable.service.ICourseTableService;
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDetailDto;
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDetailDto;
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDto;
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDto;
|
|
|
|
+import com.xjrsoft.module.databoard.vo.AttendanceStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.CourseStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.CourseStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.HealthStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.HealthStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.ItemCountAmountVo;
|
|
import com.xjrsoft.module.databoard.vo.ItemCountAmountVo;
|
|
-import com.xjrsoft.module.databoard.vo.ItemCountVo;
|
|
|
|
import com.xjrsoft.module.databoard.vo.MeetingStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.MeetingStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.PersonStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.PersonStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.ProcessStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.ProcessStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.ReimbursementStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.ReimbursementStatisticsVo;
|
|
|
|
+import com.xjrsoft.module.databoard.vo.RepairStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.VisitorStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.VisitorStatisticsVo;
|
|
import com.xjrsoft.module.outint.entity.VisitorOutInRecord;
|
|
import com.xjrsoft.module.outint.entity.VisitorOutInRecord;
|
|
import com.xjrsoft.module.outint.service.IVisitorOutInRecordService;
|
|
import com.xjrsoft.module.outint.service.IVisitorOutInRecordService;
|
|
@@ -427,4 +428,116 @@ public class DataboardController {
|
|
return RT.ok(result);
|
|
return RT.ok(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/repair-statistics")
|
|
|
|
+ @ApiOperation(value="维修申报")
|
|
|
|
+ @SaCheckPermission("databoard:detail")
|
|
|
|
+ public RT<RepairStatisticsVo> repairStatistics(@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");
|
|
|
|
+ RepairStatisticsVo result = new RepairStatisticsVo();
|
|
|
|
+ String sql = "SELECT * FROM wf_repair_declaration where 1 = 1";
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
+ sql += " and application_time between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
+ result.setAllCount(list.size());
|
|
|
|
+ int completeCount = 0;
|
|
|
|
+ int uncompleteCount = 0;
|
|
|
|
+ int personCount = 0;
|
|
|
|
+
|
|
|
|
+ for (Map<String, Object> objectMap : list) {
|
|
|
|
+ Object statusObj = objectMap.get("status");
|
|
|
|
+ if(statusObj == null){
|
|
|
|
+ uncompleteCount ++;
|
|
|
|
+ }else{
|
|
|
|
+ completeCount ++;
|
|
|
|
+ }
|
|
|
|
+ if(objectMap.get("status") != null && "是".equals(objectMap.get("status").toString())){
|
|
|
|
+ personCount ++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ result.setCompleteCount(completeCount);
|
|
|
|
+ result.setUncompleteCount(uncompleteCount);
|
|
|
|
+ result.setPersonCount(personCount);
|
|
|
|
+
|
|
|
|
+ sql = "SELECT ifnull(SUM(indemnity), 0) as indemnity FROM wf_repair_declaration";
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
+ result.setTotalAmount(Double.parseDouble(list.get(0).get("indemnity").toString()));
|
|
|
|
+
|
|
|
|
+ return RT.ok(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/attendance-statistics")
|
|
|
|
+ @ApiOperation(value="个人考勤")
|
|
|
|
+ @SaCheckPermission("databoard:detail")
|
|
|
|
+ public RT<AttendanceStatisticsVo> attendanceStatistics(@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");
|
|
|
|
+ AttendanceStatisticsVo result = new AttendanceStatisticsVo();
|
|
|
|
+
|
|
|
|
+ String sql = " SELECT ifnull(sum(leave_days), 0) as leave_days FROM wf_teacherleave WHERE status = 1";
|
|
|
|
+
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
+ String startTimeStr = startTime.format(formatter);
|
|
|
|
+ String endTimeStr = endTime.format(formatter);
|
|
|
|
+ sql +=" AND (" +
|
|
|
|
+ " (leave_start_time BETWEEN '" + startTimeStr + "' and '" + endTimeStr + "')" +
|
|
|
|
+ " OR (leave_end_time BETWEEN '" + startTimeStr + "' and '" + endTimeStr + "')" +
|
|
|
|
+ " OR (leave_start_time > '" + startTimeStr + "' and '" + endTimeStr + "' > leave_end_time)" +
|
|
|
|
+ " OR ('" + startTimeStr + "' > leave_start_time and leave_end_time > '" + endTimeStr + "')" +
|
|
|
|
+ ")";
|
|
|
|
+ }
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
+ result.setLeaveDays(Double.parseDouble(list.get(0).get("leave_days").toString()));
|
|
|
|
+
|
|
|
|
+ sql = "SELECT COUNT(*) AS a_count FROM teacher_out_in_record WHERE delete_mark = 0 and attendance_status = '迟到'";
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
+ sql +=" AND record_time between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
+ }
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
+ }
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
+ result.setLateCount(Integer.parseInt(list.get(0).get("a_count").toString()));
|
|
|
|
+
|
|
|
|
+ sql = "select COUNT(*) AS a_count from wf_course_adjust where status = 1";
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
+ sql +=" AND adjust_date between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
+ }
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
+ }
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
+ result.setAdjustCount(Integer.parseInt(list.get(0).get("a_count").toString()));
|
|
|
|
+
|
|
|
|
+ sql = "select COUNT(*) AS a_count from wf_course_adjust where status = 1";
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
+ sql +=" AND exchange_date between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
+ }
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
+ }
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
+ result.setExchangeCount(Integer.parseInt(list.get(0).get("a_count").toString()));
|
|
|
|
+ return RT.ok(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|