|
@@ -1,25 +1,21 @@
|
|
|
package cn.iocoder.yudao.module.as.service.aidingstudentspersonmanage;
|
|
|
-
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
-import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
|
|
-import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
|
import cn.iocoder.yudao.module.as.controller.admin.aidingstudentspersonmanage.vo.*;
|
|
|
-import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsmanage.AidingStudentsManageDO;
|
|
|
import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentspersonmanage.AidingStudentPersonManageEvaluationResultDO;
|
|
|
import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentspersonmanage.AidingStudentsPersonManageDO;
|
|
|
import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentspersonmanage.AidingStudentPersonManageEvaluationResultMapper;
|
|
|
import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentspersonmanage.AidingStudentsPersonManageMapper;
|
|
|
-import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|
|
-import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
-import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
|
|
|
-import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
|
|
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
|
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -45,34 +41,32 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
private AidingStudentPersonManageEvaluationResultMapper aidingStudentPersonManageEvaluationResultMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private AdminUserMapper admiUSerMapper;
|
|
|
+ private DeptApi deptApi;
|
|
|
|
|
|
@Autowired
|
|
|
- private DeptMapper deptMapper;
|
|
|
+ private AdminUserApi adminUserApi;
|
|
|
|
|
|
/**
|
|
|
* 学生上传材料之前的信息回显
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public AidingStudentsPersonManageUploadVO beforeuploadAidingStudentsManage() {
|
|
|
+ public AidingStudentsPersonManageUploadRespVO beforeuploadAidingStudentsManage() {
|
|
|
try {
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
- AidingStudentsPersonManageUploadVO result = new AidingStudentsPersonManageUploadVO();
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(getLoginUser().getId());
|
|
|
+ AidingStudentsPersonManageUploadRespVO result = new AidingStudentsPersonManageUploadRespVO();
|
|
|
// 获取当前登录的用户表
|
|
|
- AdminUserDO one = admiUSerMapper.selectOne(new QueryWrapper<AdminUserDO>()
|
|
|
- .eq("id", loginUser.getId()));
|
|
|
- Map map = aidingStudentsPersonManageMapper.getByStudentId(one.getStudentId());
|
|
|
+ Map map = aidingStudentsPersonManageMapper.getByStudentId(user.getStudentId());
|
|
|
log.info("map = {}" , map);
|
|
|
- // 部门名称
|
|
|
+ // *班级名称
|
|
|
result.setClassName((String) map.get("SZBJMC"));
|
|
|
- // 学号
|
|
|
- result.setStudentSno(one.getStudentId());
|
|
|
- // 入学年份
|
|
|
+ // *学号
|
|
|
+ result.setStudentSno(user.getStudentId());
|
|
|
+ // *入学年份
|
|
|
result.setEnrollmentYear((String) map.get("RXNY"));
|
|
|
- // 身份证
|
|
|
+ // *身份证
|
|
|
result.setIdCard((String) map.get("SFZJH"));
|
|
|
- // 户籍
|
|
|
+ // *户籍
|
|
|
result.setRegisteredResidence((String) map.get("JG"));
|
|
|
return result;
|
|
|
} catch (Exception exception) {
|
|
@@ -87,15 +81,29 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public void uploadAidingStudentsManage(AidingStudentsPersonManageUploadVO uploadVO) {
|
|
|
+ public void uploadAidingStudentsManage(AidingStudentsPersonManageUploadRespVO uploadVO) {
|
|
|
+ // 1.获取当前登录的用户表
|
|
|
AidingStudentsPersonManageDO aDo = BeanUtils.toBean(uploadVO, AidingStudentsPersonManageDO.class);
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
- // 获取当前登录的用户表
|
|
|
- AdminUserDO one = admiUSerMapper.selectOne(new QueryWrapper<AdminUserDO>()
|
|
|
- .eq("id", loginUser.getId()));
|
|
|
- Map map = aidingStudentsPersonManageMapper.getByStudentId(one.getStudentId());
|
|
|
- log.info("map = {}" , map);
|
|
|
- aDo.setNickname(String.valueOf(map.get("XM")));
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(getLoginUser().getId());
|
|
|
+ Map map = aidingStudentsPersonManageMapper.getByStudentId(user.getStudentId());
|
|
|
+ // 2.补充字段
|
|
|
+ // 项目ID跟学院项目ID前端传
|
|
|
+
|
|
|
+ // 学院ID
|
|
|
+ Long collegeId = deptApi.getCollegeId(user.getDeptId());
|
|
|
+ aDo.setCollegeId(Math.toIntExact(collegeId));
|
|
|
+ // 学院名称
|
|
|
+ DeptRespDTO dept = deptApi.getDept(user.getDeptId());
|
|
|
+ aDo.setCollegeName(dept.getName());
|
|
|
+ // 专业名称
|
|
|
+ Map szzym = aidingStudentsPersonManageMapper.getMajorById(map.get("SZZYM"));
|
|
|
+ log.info("szzym = {}", szzym);
|
|
|
+ aDo.setMajor((String) szzym.get("ZYMC"));
|
|
|
+ // 年级
|
|
|
+ aDo.setGrade((String) map.get("SZNJ"));
|
|
|
+ // 姓名
|
|
|
+ aDo.setNickname(user.getNickname());
|
|
|
+ // 状态
|
|
|
aDo.setStatus(0);
|
|
|
aidingStudentsPersonManageMapper.insert(aDo);
|
|
|
}
|
|
@@ -104,16 +112,10 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
* 学生查看自己的申请信息
|
|
|
*/
|
|
|
@Override
|
|
|
- public AidingStudentsPersonManageUploadVO checkAidingStudentsManage() {
|
|
|
- LoginUser loginUser = getLoginUser();
|
|
|
- // 获取当前登录的用户表
|
|
|
- AdminUserDO one = admiUSerMapper.selectOne(new QueryWrapper<AdminUserDO>()
|
|
|
- .eq("id", loginUser.getId()));
|
|
|
- String studentId = one.getStudentId();
|
|
|
- AidingStudentsPersonManageDO me = this.getById(studentId);
|
|
|
- AidingStudentsPersonManageUploadVO result = BeanUtils
|
|
|
- .toBean(me, AidingStudentsPersonManageUploadVO.class);
|
|
|
- return result;
|
|
|
+ public AidingStudentsPersonManageUploadRespVO checkAidingStudentsManage() {
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(getLoginUser().getId());
|
|
|
+ AidingStudentsPersonManageDO me = this.getById(user.getStudentId());
|
|
|
+ return BeanUtils.toBean(me, AidingStudentsPersonManageUploadRespVO.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -121,7 +123,7 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
* @param uploadVO
|
|
|
*/
|
|
|
@Override
|
|
|
- public void editAidingStudentsManage(AidingStudentsPersonManageUploadVO uploadVO) {
|
|
|
+ public void editAidingStudentsManage(AidingStudentsPersonManageUploadRespVO uploadVO) {
|
|
|
AidingStudentsPersonManageDO aDo = new AidingStudentsPersonManageDO();
|
|
|
aDo = BeanUtils.toBean(uploadVO, AidingStudentsPersonManageDO.class);
|
|
|
log.info("aDo 信息如下{}" , aDo);
|
|
@@ -140,12 +142,12 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
AidingStudentPersonManageCollegeRespVO vo = new AidingStudentPersonManageCollegeRespVO();
|
|
|
List<AidingStudentPersonManageClassVO> list = new ArrayList<>();
|
|
|
List<AidingStudentsPersonManageDO> allList = aidingStudentsPersonManageMapper
|
|
|
- .selectList(new QueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
- .eq("college_id", pageReqVO.getCollegeId())
|
|
|
- .eq("manage_id", pageReqVO.getManageId())
|
|
|
- .like(StringUtils.isNotBlank(pageReqVO.getMajor()), "class_name", pageReqVO.getMajor())
|
|
|
- .like(StringUtils.isNotBlank(pageReqVO.getGrade()), "class_name", pageReqVO.getGrade())
|
|
|
- .like(StringUtils.isNotBlank(pageReqVO.getClName()), "class_name", pageReqVO.getClName()));
|
|
|
+ .selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
+ .eq(AidingStudentsPersonManageDO::getCollegeManageId, pageReqVO.getCollegeManageId())
|
|
|
+ .eq(AidingStudentsPersonManageDO::getManageId, pageReqVO.getManageId())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getMajor()), AidingStudentsPersonManageDO::getMajor, pageReqVO.getMajor())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getGrade()), AidingStudentsPersonManageDO::getGrade, pageReqVO.getGrade())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getClName()), AidingStudentsPersonManageDO::getClassName, pageReqVO.getClName()));
|
|
|
int wait = 0, edit = 0, pass = 0;
|
|
|
for (int i = 0; i < allList.size(); i++) {
|
|
|
AidingStudentsPersonManageDO aDo = allList.get(i);
|
|
@@ -172,10 +174,10 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
log.info("遍历Map{}", map);
|
|
|
AidingStudentPersonManageClassVO classVo = new AidingStudentPersonManageClassVO();
|
|
|
List<AidingStudentsPersonManageDO> classList = aidingStudentsPersonManageMapper
|
|
|
- .selectList(new QueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
- .eq("college_id", pageReqVO.getCollegeId())
|
|
|
- .eq("manage_id", pageReqVO.getManageId())
|
|
|
- .eq("class_name", map.get("class_name")));
|
|
|
+ .selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
+ .eq(AidingStudentsPersonManageDO::getCollegeManageId, pageReqVO.getCollegeManageId())
|
|
|
+ .eq(AidingStudentsPersonManageDO::getManageId, pageReqVO.getManageId())
|
|
|
+ .eq(AidingStudentsPersonManageDO::getClassName, map.get("class_name")));
|
|
|
log.info("classList = {}", classList);
|
|
|
wait = 0;
|
|
|
edit = 0;
|
|
@@ -211,29 +213,29 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取学生申请信息分页 (班级)
|
|
|
+ * 班级获取学生申请信息分页
|
|
|
* @param pageReqVO
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public PageResult<AidingStudentsPersonManageDO> getAidingStudentsPersonManagePage(
|
|
|
- AidingStudentsPersonManagePageReqVO pageReqVO) {
|
|
|
+ public PageResult<AidingStudentsPersonManageDO> getAidingStudentsPersonManageClassPage(
|
|
|
+ AidingStudentsPersonManageClassPageReqVO pageReqVO) {
|
|
|
return aidingStudentsPersonManageMapper.selectPage(pageReqVO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 班级定序,集体
|
|
|
+ * 班级定序 - 集体
|
|
|
* @param ids
|
|
|
*/
|
|
|
@Override
|
|
|
- public void allsortAidingStudentsManage(List<AidingStudentPersonManageSortVO> ids) {
|
|
|
- for (AidingStudentPersonManageSortVO id : ids) {
|
|
|
+ public void allsortAidingStudentsManage(List<AidingStudentPersonManageSortReqVO> ids) {
|
|
|
+ for (AidingStudentPersonManageSortReqVO id : ids) {
|
|
|
sortAidingStudentsManage(Long.valueOf(id.getId()), id.getSort(), id.getDifficultType());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 班级定序 - 一个人
|
|
|
+ * 班级定序 - 个人
|
|
|
* @param id
|
|
|
* @param sort
|
|
|
*/
|
|
@@ -253,75 +255,76 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
* @param classuploadVO
|
|
|
*/
|
|
|
@Override
|
|
|
- public void uploadResultAidingStudentsManage(AidingStudentPersonManageClassResultVO classuploadVO) {
|
|
|
+ public void uploadResultAidingStudentsManage(AidingStudentPersonManageClassResultReqVO classuploadVO) {
|
|
|
AidingStudentPersonManageEvaluationResultDO ado = new AidingStudentPersonManageEvaluationResultDO();
|
|
|
org.springframework.beans.BeanUtils.copyProperties(classuploadVO,ado);
|
|
|
ado.setStatus(1);
|
|
|
aidingStudentPersonManageEvaluationResultMapper.insert(ado);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 学院资助助理驳回
|
|
|
- * @param id
|
|
|
- * @param rejectNotes
|
|
|
- */
|
|
|
- @Override
|
|
|
- public void passOrrejectAidingStudentsManage(Long id, Integer status,String rejectNotes) {
|
|
|
- AidingStudentsPersonManageDO aDo = aidingStudentsPersonManageMapper.selectOne(
|
|
|
- new QueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
- .eq("id", id));
|
|
|
- aDo.setStatus(status);
|
|
|
- if(rejectNotes != ""){
|
|
|
- aDo.setNotes(rejectNotes);
|
|
|
- }
|
|
|
- aidingStudentsPersonManageMapper.updateById(aDo);
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
- * 办公室老师获取学生分页信息
|
|
|
+ * (学校)办公室老师获取学生分页信息
|
|
|
* @param pageReqVO
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public PageResult<AidingStudentPersonManageTeacherRespVO> teachergetAidingStudentsPersonManagePage(AidingStudentPersonManageTeacherPageReqVO pageReqVO) {
|
|
|
- /**
|
|
|
- * 数据
|
|
|
- */
|
|
|
- // TODO 不知道不是不是两个独立开的,因为如果不独立,搜索的时候,提交人数啥的可能会变
|
|
|
+ public PageResult<AidingStudentPersonManageSchoolRespVO> schoolgetAidingStudentsPersonManagePage(AidingStudentPersonManageSchoolPageReqVO pageReqVO) {
|
|
|
/**
|
|
|
* 表格信息
|
|
|
*/
|
|
|
List<AidingStudentsPersonManageDO> allList = aidingStudentsPersonManageMapper
|
|
|
- .selectList(new QueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
- .eq("college_id", pageReqVO.getCollegeId())
|
|
|
- .eq("manage_id", pageReqVO.getManageId())
|
|
|
- .eq(pageReqVO.getDifficultType() != null,"difficult_type", pageReqVO.getDifficultType())
|
|
|
- .like(StringUtils.isNotBlank(pageReqVO.getGrade()), "class_name", pageReqVO.getGrade())
|
|
|
- .like(StringUtils.isNotBlank(pageReqVO.getClName()), "class_name", pageReqVO.getClName())
|
|
|
- .like(StringUtils.isNotBlank(pageReqVO.getName()), "nickname", pageReqVO.getName())
|
|
|
- .like(StringUtils.isNotBlank(pageReqVO.getStudentSno()), "student_sno", pageReqVO.getStudentSno())
|
|
|
+ .selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
+ .eq(pageReqVO.getCollegeManageId() != null, AidingStudentsPersonManageDO::getCollegeId, pageReqVO.getCollegeManageId())
|
|
|
+ .eq(pageReqVO.getManageId() != null ,AidingStudentsPersonManageDO::getManageId, pageReqVO.getManageId())
|
|
|
+ .eq(pageReqVO.getDifficultType() != null,AidingStudentsPersonManageDO::getDifficultType, pageReqVO.getDifficultType())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getMajor()), AidingStudentsPersonManageDO::getMajor, pageReqVO.getMajor())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getGrade()), AidingStudentsPersonManageDO::getGrade, pageReqVO.getGrade())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getClName()), AidingStudentsPersonManageDO::getClassName, pageReqVO.getClName())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getName()), AidingStudentsPersonManageDO::getNickname, pageReqVO.getName())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getStudentSno()), AidingStudentsPersonManageDO::getStudentSno, pageReqVO.getStudentSno())
|
|
|
);
|
|
|
- List<AidingStudentPersonManageTeacherRespVO> resultList = new ArrayList<>();
|
|
|
- for (AidingStudentsPersonManageDO aDo : allList) {
|
|
|
- AidingStudentPersonManageTeacherRespVO vo = new AidingStudentPersonManageTeacherRespVO();
|
|
|
- vo = BeanUtils.toBean(aDo, AidingStudentPersonManageTeacherRespVO.class);
|
|
|
- String str = "";
|
|
|
- //计算机类2023-1班 应该都是这个格式,但是不确定
|
|
|
- String className = aDo.getClassName();
|
|
|
- for(int i = 0; i < className.length(); i++){
|
|
|
- if(className.charAt(i) == '2'){
|
|
|
- vo.setMajor(str);
|
|
|
- str = String.valueOf(className.charAt(i));
|
|
|
- }else if (className.charAt(i) == '-'){
|
|
|
- vo.setGrade(str);
|
|
|
- vo.setClName(className.substring(i + 1,className.length()));
|
|
|
- break;
|
|
|
- }else {
|
|
|
- str += className.charAt(i);
|
|
|
- }
|
|
|
+ return new PageResult<>(BeanUtils.toBean(allList, AidingStudentPersonManageSchoolRespVO.class), (long) allList.size());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取各个学院的部分信息
|
|
|
+ * @param manageId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AidingStudentPersonManageDataPartRespVO schoolgetAidingStudentsPersonManageData(Integer manageId) {
|
|
|
+ AidingStudentPersonManageDataPartRespVO resultvo = new AidingStudentPersonManageDataPartRespVO();
|
|
|
+ // 1.获得这个项目的所有信息(不分学院)
|
|
|
+ List<AidingStudentsPersonManageDO> manageList = aidingStudentsPersonManageMapper
|
|
|
+ .selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
+ .eq(AidingStudentsPersonManageDO::getCollegeManageId, manageId));
|
|
|
+ int pass = 0;
|
|
|
+ for (AidingStudentsPersonManageDO aDo : manageList) {
|
|
|
+ if(aDo.getStatus() == 1){
|
|
|
+ pass++;
|
|
|
}
|
|
|
- resultList.add(vo);
|
|
|
}
|
|
|
- return new PageResult<>(resultList, (long) resultList.size());
|
|
|
+ resultvo.setCompletedNumber(pass);
|
|
|
+ resultvo.setAllsubmit(manageList.size());
|
|
|
+ // 2.获得各个学院的信息
|
|
|
+ QueryWrapper<AidingStudentsPersonManageDO> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.select("college_manage_id", "COUNT(*) as collgeNumber")
|
|
|
+ .groupBy("college_manage_id");
|
|
|
+ List<Map<String, Object>> maps = aidingStudentsPersonManageMapper.selectMaps(queryWrapper);
|
|
|
+ log.info("学院人数如下:maps {}", maps);
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ for (Map<String, Object> map : maps) {
|
|
|
+ Map<String, Object> temp = new HashMap<>();
|
|
|
+ temp.put("collegeManageId", map.get("college_manage_id"));
|
|
|
+ temp.put("all", map.get("collegeNumber"));
|
|
|
+ List<AidingStudentsPersonManageDO> passList = aidingStudentsPersonManageMapper
|
|
|
+ .selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
+ .eq(AidingStudentsPersonManageDO::getCollegeId, map.get("collge_manage_id"))
|
|
|
+ .eq(AidingStudentsPersonManageDO::getStatus, 1));
|
|
|
+ temp.put("pass", passList.size());
|
|
|
+ list.add(temp);
|
|
|
+ }
|
|
|
+ return resultvo.setCollegeNumber(list);
|
|
|
}
|
|
|
}
|