|
@@ -3,6 +3,7 @@ package com.template.controller;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -5166,6 +5167,97 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @DESRespondSecret(validated = false)
|
|
|
|
|
+ public CommonResult statisticsStatementManag(String dateTime) {
|
|
|
|
|
+ DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ LocalDateTime startTime = LocalDateTime.parse(dateTime, dateTimeFormatter1);
|
|
|
|
|
+ LocalDateTime endTime = startTime.plusDays(1);
|
|
|
|
|
+
|
|
|
|
|
+ Integer totalAbnormal=0;
|
|
|
|
|
+ Integer totalNormal=0;
|
|
|
|
|
+ Integer totalAck=0;
|
|
|
|
|
+
|
|
|
|
|
+// 获取年级
|
|
|
|
|
+ List<SmartGrade> smartGrades = smartGradeService.list(new LambdaQueryWrapper<>());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// 获取每个班的请假人数
|
|
|
|
|
+ List<StatisticsStatement> ackList= smartUserService.getUserAckTotal(startTime,endTime);
|
|
|
|
|
+
|
|
|
|
|
+// 获取每个班级的人数
|
|
|
|
|
+ List<StatisticsStatement> totalList= smartUserService.getUserClassTotal();
|
|
|
|
|
+
|
|
|
|
|
+// 获取每个班级的正常人数
|
|
|
|
|
+ List<StatisticsStatement> normalList= smartUserService.getUserNormalTotal(startTime,endTime);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ ArrayList<StatisticsStatementVo> vos = new ArrayList<>();
|
|
|
|
|
+ for (StatisticsStatement statisticsStatement : totalList) {
|
|
|
|
|
+ StatisticsStatementVo vo = new StatisticsStatementVo();
|
|
|
|
|
+ Integer classId = statisticsStatement.getClassId();
|
|
|
|
|
+ Integer gradeId = statisticsStatement.getGradeId();
|
|
|
|
|
+ vo.setGradeId(gradeId);
|
|
|
|
|
+ vo.setClassId(classId);
|
|
|
|
|
+ vo.setGradeName(statisticsStatement.getGradeName());
|
|
|
|
|
+ vo.setClassName(statisticsStatement.getClassName());
|
|
|
|
|
+
|
|
|
|
|
+// 总数
|
|
|
|
|
+ Integer total = statisticsStatement.getCount();
|
|
|
|
|
+ Integer normal=0;
|
|
|
|
|
+ Integer ack=0;
|
|
|
|
|
+
|
|
|
|
|
+ for (StatisticsStatement statement : normalList) {
|
|
|
|
|
+ Integer classId1 = statement.getClassId();
|
|
|
|
|
+ Integer gradeId1 = statement.getGradeId();
|
|
|
|
|
+ if (classId.equals(classId1)&&gradeId.equals(gradeId1)) {
|
|
|
|
|
+ normal=statement.getCount();
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (StatisticsStatement statement : ackList) {
|
|
|
|
|
+ Integer classId1 = statement.getClassId();
|
|
|
|
|
+ Integer gradeId1 = statement.getGradeId();
|
|
|
|
|
+ if (classId.equals(classId1)&&gradeId.equals(gradeId1)) {
|
|
|
|
|
+// 请假数量
|
|
|
|
|
+ ack=statement.getCount();
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Integer abnormal=total-normal;
|
|
|
|
|
+ vo.setAck(ack);
|
|
|
|
|
+ vo.setNormal(normal);
|
|
|
|
|
+ vo.setAbnormal(abnormal);
|
|
|
|
|
+
|
|
|
|
|
+ totalAbnormal=totalAbnormal+abnormal;
|
|
|
|
|
+ totalNormal=totalNormal+normal;
|
|
|
|
|
+ totalAck=totalAck+ack;
|
|
|
|
|
+
|
|
|
|
|
+ vos.add(vo);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ ArrayList<StatisticsStatementManagVo> ssmVos = new ArrayList<>();
|
|
|
|
|
+ for (SmartGrade smartGrade : smartGrades) {
|
|
|
|
|
+ StatisticsStatementManagVo vo = new StatisticsStatementManagVo();
|
|
|
|
|
+ Integer id = smartGrade.getId();
|
|
|
|
|
+ vo.setGradeName(smartGrade.getName());
|
|
|
|
|
+ List<StatisticsStatementVo> ownerClasses = vos.stream().filter(e -> e.getGradeId().equals(id)).collect(Collectors.toList());
|
|
|
|
|
+ if (ownerClasses != null && ownerClasses.size() > 0) {
|
|
|
|
|
+ vo.setVos(ownerClasses);
|
|
|
|
|
+ }
|
|
|
|
|
+ ssmVos.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
+ jsonObject.put("list",ssmVos);
|
|
|
|
|
+ jsonObject.put("totalAbnormal",totalAbnormal);
|
|
|
|
|
+ jsonObject.put("totalNormal",totalNormal);
|
|
|
|
|
+ jsonObject.put("totalAck",totalAck);
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(jsonObject);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|