|
@@ -18,11 +18,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import javax.annotation.Resource;
|
|
|
-
|
|
|
import java.util.*;
|
|
|
-
|
|
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
|
|
|
|
|
/**
|
|
@@ -92,19 +89,20 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
// 学院ID
|
|
|
Long collegeId = deptApi.getCollegeId(user.getDeptId());
|
|
|
aDo.setCollegeId(collegeId);
|
|
|
- // 学院名称
|
|
|
- DeptRespDTO dept = deptApi.getDept(user.getDeptId());
|
|
|
- aDo.setCollegeName(dept.getName());
|
|
|
+
|
|
|
+ Map resultmap = aidingStudentsPersonManageMapper.getMajorById(map.get("SZZYM"));
|
|
|
+ log.info("resultMap = {}", resultmap);
|
|
|
// 专业名称
|
|
|
- Map szzym = aidingStudentsPersonManageMapper.getMajorById(map.get("SZZYM"));
|
|
|
- log.info("szzym = {}", szzym);
|
|
|
- aDo.setMajor((String) szzym.get("ZYMC"));
|
|
|
+ aDo.setMajor((String) resultmap.get("ZYMC"));
|
|
|
+ // 学院名称
|
|
|
+ aDo.setCollegeName((String) resultmap.get("DWMC"));
|
|
|
// 年级
|
|
|
aDo.setGrade((String) map.get("SZNJ"));
|
|
|
// 姓名
|
|
|
aDo.setNickname(user.getNickname());
|
|
|
// 状态
|
|
|
aDo.setStatus(0);
|
|
|
+ // 用户ID
|
|
|
aidingStudentsPersonManageMapper.insert(aDo);
|
|
|
}
|
|
|
|
|
@@ -113,9 +111,10 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
*/
|
|
|
@Override
|
|
|
public AidingStudentsPersonManageUploadRespVO checkAidingStudentsManage() {
|
|
|
- AdminUserRespDTO user = adminUserApi.getUser(getLoginUser().getId());
|
|
|
- AidingStudentsPersonManageDO me = this.getById(user.getStudentId());
|
|
|
- return BeanUtils.toBean(me, AidingStudentsPersonManageUploadRespVO.class);
|
|
|
+ AdminUserRespDTO Loginuser = adminUserApi.getUser(getLoginUser().getId());
|
|
|
+ AidingStudentsPersonManageDO user = aidingStudentsPersonManageMapper
|
|
|
+ .selectOne(AidingStudentsPersonManageDO::getStudentSno, Loginuser.getStudentId());
|
|
|
+ return BeanUtils.toBean(user, AidingStudentsPersonManageUploadRespVO.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -126,7 +125,6 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
public void editAidingStudentsManage(AidingStudentsPersonManageUploadRespVO uploadVO) {
|
|
|
AidingStudentsPersonManageDO aDo = new AidingStudentsPersonManageDO();
|
|
|
aDo = BeanUtils.toBean(uploadVO, AidingStudentsPersonManageDO.class);
|
|
|
- log.info("aDo 信息如下{}" , aDo);
|
|
|
aDo.setRejectNotes("");
|
|
|
aidingStudentsPersonManageMapper.updateById(aDo);
|
|
|
}
|
|
@@ -275,15 +273,16 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
*/
|
|
|
List<AidingStudentsPersonManageDO> allList = aidingStudentsPersonManageMapper
|
|
|
.selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
- .eq(pageReqVO.getCollegeManageId() != null, AidingStudentsPersonManageDO::getCollegeId, pageReqVO.getCollegeManageId())
|
|
|
+ .like(StringUtils.isNotBlank(pageReqVO.getCollegeName()), AidingStudentsPersonManageDO::getCollegeName, pageReqVO.getCollegeName())
|
|
|
.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.getNickname()), AidingStudentsPersonManageDO::getNickname, pageReqVO.getNickname())
|
|
|
.like(StringUtils.isNotBlank(pageReqVO.getStudentSno()), AidingStudentsPersonManageDO::getStudentSno, pageReqVO.getStudentSno())
|
|
|
);
|
|
|
+ log.info("allList = {}", allList);
|
|
|
return new PageResult<>(BeanUtils.toBean(allList, AidingStudentPersonManageSchoolRespVO.class), (long) allList.size());
|
|
|
}
|
|
|
|
|
@@ -299,6 +298,7 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
List<AidingStudentsPersonManageDO> manageList = aidingStudentsPersonManageMapper
|
|
|
.selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
.eq(AidingStudentsPersonManageDO::getCollegeManageId, manageId));
|
|
|
+ log.info("获取所有学院信息如下{}", manageList);
|
|
|
int pass = 0;
|
|
|
for (AidingStudentsPersonManageDO aDo : manageList) {
|
|
|
if(aDo.getStatus() == 1){
|
|
@@ -309,18 +309,22 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
|
|
|
resultvo.setAllsubmit(manageList.size());
|
|
|
// 2.获得各个学院的信息
|
|
|
QueryWrapper<AidingStudentsPersonManageDO> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.select("college_manage_id", "COUNT(*) as collgeNumber")
|
|
|
- .groupBy("college_manage_id");
|
|
|
+ queryWrapper.select("college_id", "COUNT(*) as collegeNumber")
|
|
|
+ .groupBy("college_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"));
|
|
|
+ Long collegeId = (Long) map.get("college_id");
|
|
|
+ DeptRespDTO dept = deptApi.getDept(collegeId);
|
|
|
+ log.info("collegeId = {}, dept {}", collegeId, dept);
|
|
|
+ // dept DeptRespDTO(id=18429, name=计算机科学与工程学院, parentId=0, leaderUserId=null, status=0)
|
|
|
+ temp.put("collegeName", dept.getName());
|
|
|
temp.put("all", map.get("collegeNumber"));
|
|
|
List<AidingStudentsPersonManageDO> passList = aidingStudentsPersonManageMapper
|
|
|
.selectList(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
|
|
|
- .eq(AidingStudentsPersonManageDO::getCollegeId, map.get("collge_manage_id"))
|
|
|
+ .eq(AidingStudentsPersonManageDO::getCollegeId, collegeId)
|
|
|
.eq(AidingStudentsPersonManageDO::getStatus, 1));
|
|
|
temp.put("pass", passList.size());
|
|
|
list.add(temp);
|