|
@@ -1,15 +1,19 @@
|
|
package com.ruoyi.system.service.impl;
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
+import com.ruoyi.common.core.domain.entity.FormalParentsStudent;
|
|
import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
|
|
import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
|
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.system.domain.SysConfig;
|
|
import com.ruoyi.system.domain.SysConfig;
|
|
import com.ruoyi.system.domain.XiakeConfig;
|
|
import com.ruoyi.system.domain.XiakeConfig;
|
|
import com.ruoyi.system.mapper.SysConfigMapper;
|
|
import com.ruoyi.system.mapper.SysConfigMapper;
|
|
import com.ruoyi.system.mapper.XiakeConfigMapper;
|
|
import com.ruoyi.system.mapper.XiakeConfigMapper;
|
|
|
|
+import com.ruoyi.system.domain.*;
|
|
|
|
+import com.ruoyi.system.mapper.*;
|
|
import com.ruoyi.system.service.IAppletService;
|
|
import com.ruoyi.system.service.IAppletService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -17,6 +21,7 @@ import org.springframework.stereotype.Service;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Author: tjf
|
|
* @Author: tjf
|
|
@@ -31,6 +36,23 @@ public class AppletServiceImpl implements IAppletService {
|
|
@Autowired
|
|
@Autowired
|
|
private XiakeConfigMapper xiakeConfigMapper;
|
|
private XiakeConfigMapper xiakeConfigMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysConfigMapper configMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RegisterParentsStudentMapper registerParentsStudentMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private CourseChangeMapper courseChangeMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private FormalTeacherClassMapper formalTeacherClassMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private RegisterTeacherMapper registerTeacherMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private XiaoyuanNoticeMapper xiaoyuanNoticeMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 老师准备下课按钮
|
|
* 老师准备下课按钮
|
|
*
|
|
*
|
|
@@ -141,6 +163,8 @@ public class AppletServiceImpl implements IAppletService {
|
|
@Override
|
|
@Override
|
|
public AjaxResult pcStatistics() {
|
|
public AjaxResult pcStatistics() {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
+ //获取当前月第一天
|
|
|
|
+ String monthFirst = DateUtils.timeMonthFirst();
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
List<SysRole> roles = user.getRoles();
|
|
List<SysRole> roles = user.getRoles();
|
|
boolean blt = false;
|
|
boolean blt = false;
|
|
@@ -153,20 +177,129 @@ public class AppletServiceImpl implements IAppletService {
|
|
bls = true;
|
|
bls = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //账号
|
|
|
|
+ int tzhysh = 0;
|
|
|
|
+ int tzhwsh = 0;
|
|
|
|
+ //调课
|
|
|
|
+ int ttkysh = 0;
|
|
|
|
+ int ttkwsh = 0;
|
|
|
|
+ Map<String,Object> map1 = new HashMap<>();
|
|
|
|
+ Map<String,Object> map2 = new HashMap<>();
|
|
|
|
+ Map<String,Object> map3 = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ //计算本人
|
|
|
|
+ XiaoyuanNotice xiaoyuanNotice = new XiaoyuanNotice();
|
|
|
|
+ xiaoyuanNotice.setSenderId(String.valueOf(user.getUserId()));
|
|
|
|
+ List<XiaoyuanNotice> xiaoyuanNoticeList = xiaoyuanNoticeMapper.selectXiaoyuanNoticeMyList(xiaoyuanNotice);
|
|
|
|
+ int xwsl = 0;
|
|
|
|
+ if(xiaoyuanNoticeList!=null && xiaoyuanNoticeList.size()>0){
|
|
|
|
+ xwsl = xiaoyuanNoticeList.size();
|
|
|
|
+ }
|
|
|
|
+ map.put("xwsl",xwsl);
|
|
|
|
+
|
|
|
|
+ map1.put("zhysh",tzhysh);
|
|
|
|
+ map1.put("zhwsh",tzhwsh);
|
|
|
|
+ map.put("byzhsh",map1);
|
|
|
|
+ map2.put("tkysh",ttkysh);
|
|
|
|
+ map2.put("tkwsh",ttkwsh);
|
|
|
|
+ map.put("bytksh",map2);
|
|
|
|
+
|
|
//老师
|
|
//老师
|
|
- if (blt) {
|
|
|
|
|
|
+ if(blt){
|
|
|
|
+ //获取老师所属班级
|
|
|
|
+ FormalTeacherClass formalTeacherClass = new FormalTeacherClass();
|
|
|
|
+ formalTeacherClass.setTeacherId(user.getUserId());
|
|
|
|
+ List<FormalTeacherClass> formalTeacherClasses = formalTeacherClassMapper.selectFormalTeacherClassList(formalTeacherClass);
|
|
|
|
+ List<Long> classIds = formalTeacherClasses.stream().map(FormalTeacherClass::getClassId).collect(Collectors.toList());
|
|
//查询本月家长的审核数据
|
|
//查询本月家长的审核数据
|
|
-
|
|
|
|
|
|
+ List<RegisterParentsStudent> registerParentsStudentList = registerParentsStudentMapper.selectRegisterParentsStudentListByTime(monthFirst,classIds);
|
|
|
|
+ if(registerParentsStudentList!=null && registerParentsStudentList.size()>0){
|
|
|
|
+ for (RegisterParentsStudent registerParentsStudent : registerParentsStudentList) {
|
|
|
|
+ if("1".equals(registerParentsStudent.getIsPass())){
|
|
|
|
+ tzhwsh++;
|
|
|
|
+ }else{
|
|
|
|
+ tzhysh++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //查询本月调课审核
|
|
|
|
+ List<CourseChange> courseChangeList = courseChangeMapper.selectCourseChangeListByTime(monthFirst,user.getUserId(),0L);
|
|
|
|
+ if(courseChangeList!=null && courseChangeList.size()>0){
|
|
|
|
+ for (CourseChange courseChange : courseChangeList) {
|
|
|
|
+ if("1".equals(courseChange.getIsPass())){
|
|
|
|
+ ttkwsh++;
|
|
|
|
+ }else{
|
|
|
|
+ ttkysh++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map1.put("zhysh",tzhysh);
|
|
|
|
+ map1.put("zhwsh",tzhwsh);
|
|
|
|
+ map.put("byzhsh",map1);
|
|
|
|
+ map2.put("tkysh",ttkysh);
|
|
|
|
+ map2.put("tkwsh",ttkwsh);
|
|
|
|
+ map.put("bytksh",map2);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
//学校
|
|
//学校
|
|
- if (bls) {
|
|
|
|
|
|
+ //账号
|
|
|
|
+ int szhysh = 0;
|
|
|
|
+ int szhwsh = 0;
|
|
|
|
+ //调课
|
|
|
|
+ int stkysh = 0;
|
|
|
|
+ int stkwsh = 0;
|
|
|
|
+ if(bls){
|
|
|
|
+ //查询本月老师的审核数据
|
|
|
|
+ List<RegisterTeacher> registerTeacherList = registerTeacherMapper.selectRegisterTeacherListByTime(monthFirst,user.getDeptId());
|
|
|
|
+ if(registerTeacherList!=null && registerTeacherList.size()>0){
|
|
|
|
+ for (RegisterTeacher registerTeacher : registerTeacherList) {
|
|
|
|
+ if("1".equals(registerTeacher.getIsPass())){
|
|
|
|
+ szhysh++;
|
|
|
|
+ }else{
|
|
|
|
+ szhwsh++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //查询本月学校的调课审核
|
|
|
|
+ List<CourseChange> courseChangeList = courseChangeMapper.selectCourseChangeListByTime(monthFirst,0L,user.getDeptId());
|
|
|
|
+ if(courseChangeList!=null && courseChangeList.size()>0){
|
|
|
|
+ for (CourseChange courseChange : courseChangeList) {
|
|
|
|
+ if("1".equals(courseChange.getIsPass())){
|
|
|
|
+ stkysh++;
|
|
|
|
+ }else{
|
|
|
|
+ stkwsh++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ map1.put("zhysh",szhysh);
|
|
|
|
+ map1.put("zhwsh",szhwsh);
|
|
|
|
+ map.put("byzhsh",map1);
|
|
|
|
+ map2.put("tkysh",stkysh);
|
|
|
|
+ map2.put("tkwsh",stkwsh);
|
|
|
|
+ map.put("bytksh",map2);
|
|
}
|
|
}
|
|
//两个都有
|
|
//两个都有
|
|
- if (blt && bls) {
|
|
|
|
|
|
+
|
|
|
|
+ if(blt && bls){
|
|
|
|
+
|
|
|
|
+ //账号
|
|
|
|
+ int zzhysh = tzhysh + szhysh;
|
|
|
|
+ int zzhwsh = tzhwsh + szhwsh;
|
|
|
|
+ //调课
|
|
|
|
+ int ztkysh = stkysh;
|
|
|
|
+ int ztkwsh = stkwsh;
|
|
|
|
+
|
|
|
|
+ map1.put("zhysh",zzhysh);
|
|
|
|
+ map1.put("zhwsh",zzhwsh);
|
|
|
|
+ map.put("byzhsh",map1);
|
|
|
|
+ map2.put("tkysh",ztkysh);
|
|
|
|
+ map2.put("tkwsh",ztkwsh);
|
|
|
|
+ map.put("bytksh",map2);
|
|
|
|
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return AjaxResult.success(map);
|
|
}
|
|
}
|
|
}
|
|
}
|