|
@@ -20,6 +20,7 @@ import com.xjrsoft.module.databoard.vo.DurationVo;
|
|
|
import com.xjrsoft.module.databoard.vo.HealthItemCountVo;
|
|
|
import com.xjrsoft.module.databoard.vo.HealthStatisticsDetailVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ItemCountAmountVo;
|
|
|
+import com.xjrsoft.module.databoard.vo.ItemCountRatioVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ItemCountVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ItemDoubleVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ProcessStatisticsDetailVo;
|
|
@@ -52,6 +53,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.Duration;
|
|
@@ -643,6 +646,35 @@ public class DatadetailController {
|
|
|
courseCountList.add(listVo);
|
|
|
}
|
|
|
result.setCourseCountList(courseCountList);
|
|
|
+
|
|
|
+ sql = "SELECT count(*) FROM course_table t1" +
|
|
|
+ " INNER JOIN base_teacher t2 ON t1.teacher_id = t2.user_id" +
|
|
|
+ " INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
|
|
|
+ " INNER JOIN xjr_department t4 ON t4.id = t3.dept_id" +
|
|
|
+ " WHERE t4.delete_mark = 0 AND t2.delete_mark = 0" +
|
|
|
+ " AND t4.is_major = 1";
|
|
|
+ long allCourseCount = SqlRunnerAdapter.db().selectCount(sql);
|
|
|
+ sql = "SELECT name,(" +
|
|
|
+ " SELECT COUNT(*) FROM course_table t1" +
|
|
|
+ " INNER JOIN base_teacher t2 ON t1.teacher_id = t2.user_id" +
|
|
|
+ " INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
|
|
|
+ " WHERE t3.dept_id = xjr_department.id" +
|
|
|
+ " ) AS course_count FROM xjr_department WHERE is_major = 1";
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
+ List<ItemCountRatioVo> deptCourseList = new ArrayList<>();
|
|
|
+ for (Map<String, Object> objectMap : list) {
|
|
|
+ int courseCount = Integer.parseInt(objectMap.get("course_count").toString());
|
|
|
+ //计算出勤率
|
|
|
+ BigDecimal divide = BigDecimal.valueOf(courseCount).divide(BigDecimal.valueOf(allCourseCount), 4, RoundingMode.HALF_UP);
|
|
|
+ deptCourseList.add(
|
|
|
+ new ItemCountRatioVo() {{
|
|
|
+ setItem(objectMap.get("name").toString());
|
|
|
+ setCount(courseCount);
|
|
|
+ setRatio(divide.doubleValue());
|
|
|
+ }}
|
|
|
+ );
|
|
|
+ }
|
|
|
+ result.setDeptCourseList(deptCourseList);
|
|
|
return RT.ok(result);
|
|
|
}
|
|
|
|