|
@@ -10,6 +10,7 @@ import com.qmth.teachcloud.common.bean.dto.TaskPrintClassDto;
|
|
import com.qmth.teachcloud.common.bean.dto.excel.BasicStudentImportDto;
|
|
import com.qmth.teachcloud.common.bean.dto.excel.BasicStudentImportDto;
|
|
import com.qmth.teachcloud.common.bean.dto.excel.DescribeImportDto;
|
|
import com.qmth.teachcloud.common.bean.dto.excel.DescribeImportDto;
|
|
import com.qmth.teachcloud.common.bean.params.BasicClazzParams;
|
|
import com.qmth.teachcloud.common.bean.params.BasicClazzParams;
|
|
|
|
+import com.qmth.teachcloud.common.bean.params.BasicCollegeParams;
|
|
import com.qmth.teachcloud.common.bean.params.BasicMajorParams;
|
|
import com.qmth.teachcloud.common.bean.params.BasicMajorParams;
|
|
import com.qmth.teachcloud.common.bean.params.BasicStudentParams;
|
|
import com.qmth.teachcloud.common.bean.params.BasicStudentParams;
|
|
import com.qmth.teachcloud.common.bean.result.BasicStudentResult;
|
|
import com.qmth.teachcloud.common.bean.result.BasicStudentResult;
|
|
@@ -46,17 +47,28 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
@Resource
|
|
@Resource
|
|
private BasicMajorService basicMajorService;
|
|
private BasicMajorService basicMajorService;
|
|
@Resource
|
|
@Resource
|
|
- private SysOrgService sysOrgService;
|
|
|
|
- @Resource
|
|
|
|
- private BasicCampusService basicCampusService;
|
|
|
|
|
|
+ private BasicCollegeService basicCollegeService;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public IPage<BasicStudentResult> basicStudentPage(String queryParams, Long campusId,Long collegeId,Long majorId, Set<Long> clazzIdList, int pageNumber, int pageSize) {
|
|
|
|
|
|
+ public IPage<BasicStudentResult> basicStudentPage(String queryParams, Long collegeId, Long majorId, Set<Long> clazzIdList, int pageNumber, int pageSize) {
|
|
Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
-// Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
|
|
|
|
- Set<Long> orgIds = null;
|
|
|
|
queryParams = SystemConstant.translateSpecificSign(queryParams);
|
|
queryParams = SystemConstant.translateSpecificSign(queryParams);
|
|
- return basicStudentMapper.findBasicStudentPage(new Page<>(pageNumber, pageSize), queryParams, schoolId, campusId,collegeId,majorId, clazzIdList, orgIds);
|
|
|
|
|
|
+ return basicStudentMapper.findBasicStudentPage(new Page<>(pageNumber, pageSize), queryParams, schoolId, collegeId, majorId, clazzIdList, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public BasicStudentResult findById(Long id) {
|
|
|
|
+ BasicStudentResult basicStudentResult = null;
|
|
|
|
+ if (SystemConstant.longNotNull(id)) {
|
|
|
|
+ basicStudentResult = this.baseMapper.findById(id);
|
|
|
|
+ }
|
|
|
|
+ return basicStudentResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<BasicStudentResult> basicStudentList(Long schoolId, Long collegeId, Long majorId, Long clazzId, List<String> studentCodeList) {
|
|
|
|
+ return this.baseMapper.findBasicStudentList(schoolId, collegeId, majorId, clazzId, studentCodeList);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -86,8 +98,8 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
- public void saveOrUpdateBasicStudentBatch(List<BasicStudentParams> basicStudentParamsList,SysUser requestUser) {
|
|
|
|
- this.saveOrUpdateBatch(this.editEntityHelp(basicStudentParamsList,requestUser));
|
|
|
|
|
|
+ public void saveOrUpdateBasicStudentBatch(List<BasicStudentParams> basicStudentParamsList, SysUser requestUser) {
|
|
|
|
+ this.saveOrUpdateBatch(this.editEntityHelp(basicStudentParamsList, requestUser));
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -106,22 +118,19 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
- public Boolean removeBasicStudentByCondition(String queryParams, Long campusId, Long collegeId, Long majorId, Set<Long> clazzIdList) {
|
|
|
|
|
|
+ public Boolean removeBasicStudentByCondition(String queryParams, Long collegeId, Long majorId, Set<Long> clazzIdList) {
|
|
LambdaQueryWrapper<BasicStudent> basicStudentQueryWrapper = new QueryWrapper<BasicStudent>().lambda();
|
|
LambdaQueryWrapper<BasicStudent> basicStudentQueryWrapper = new QueryWrapper<BasicStudent>().lambda();
|
|
- if (SystemConstant.strNotNull(queryParams)){
|
|
|
|
- basicStudentQueryWrapper.and(e -> e.like(BasicStudent::getStudentName,queryParams).or().like(BasicStudent::getStudentCode,queryParams));
|
|
|
|
|
|
+ if (SystemConstant.strNotNull(queryParams)) {
|
|
|
|
+ basicStudentQueryWrapper.and(e -> e.like(BasicStudent::getStudentName, queryParams).or().like(BasicStudent::getStudentCode, queryParams));
|
|
}
|
|
}
|
|
- if (SystemConstant.longNotNull(campusId)){
|
|
|
|
- basicStudentQueryWrapper.eq(BasicStudent::getCampusId,campusId);
|
|
|
|
|
|
+ if (SystemConstant.longNotNull(collegeId)) {
|
|
|
|
+ basicStudentQueryWrapper.eq(BasicStudent::getBelongOrgId, collegeId);
|
|
}
|
|
}
|
|
- if (SystemConstant.longNotNull(collegeId)){
|
|
|
|
- basicStudentQueryWrapper.eq(BasicStudent::getBelongOrgId,collegeId);
|
|
|
|
|
|
+ if (SystemConstant.longNotNull(majorId)) {
|
|
|
|
+ basicStudentQueryWrapper.eq(BasicStudent::getMajorId, majorId);
|
|
}
|
|
}
|
|
- if (SystemConstant.longNotNull(majorId)){
|
|
|
|
- basicStudentQueryWrapper.eq(BasicStudent::getMajorId,majorId);
|
|
|
|
- }
|
|
|
|
- if (clazzIdList != null && clazzIdList.size() > 0){
|
|
|
|
- basicStudentQueryWrapper.in(BasicStudent::getClazzId,clazzIdList);
|
|
|
|
|
|
+ if (clazzIdList != null && clazzIdList.size() > 0) {
|
|
|
|
+ basicStudentQueryWrapper.in(BasicStudent::getClazzId, clazzIdList);
|
|
}
|
|
}
|
|
List<BasicStudent> willDeleteStudent = this.list(basicStudentQueryWrapper);
|
|
List<BasicStudent> willDeleteStudent = this.list(basicStudentQueryWrapper);
|
|
|
|
|
|
@@ -141,10 +150,8 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
SysUser sysUser = (SysUser) map.get(SystemConstant.SYS_USER);
|
|
SysUser sysUser = (SysUser) map.get(SystemConstant.SYS_USER);
|
|
Long schoolId = sysUser.getSchoolId();
|
|
Long schoolId = sysUser.getSchoolId();
|
|
final String link = "-";
|
|
final String link = "-";
|
|
- // key = campusName
|
|
|
|
- Map<String, BasicCampus> campusMap = new HashMap<>();
|
|
|
|
// key = collegeName
|
|
// key = collegeName
|
|
- Map<String, SysOrg> collegeMap = new HashMap<>();
|
|
|
|
|
|
+ Map<String, Long> collegeMap = new HashMap<>();
|
|
// key = schoolId + "-" + majorName
|
|
// key = schoolId + "-" + majorName
|
|
Map<String, Long> majorMap = new HashMap<>();
|
|
Map<String, Long> majorMap = new HashMap<>();
|
|
// key = schoolId + "-" + clazzName
|
|
// key = schoolId + "-" + clazzName
|
|
@@ -173,45 +180,30 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
String studentName = basicStudentImportDto.getStudentName();
|
|
String studentName = basicStudentImportDto.getStudentName();
|
|
String studentCode = basicStudentImportDto.getStudentCode();
|
|
String studentCode = basicStudentImportDto.getStudentCode();
|
|
String phoneNumber = basicStudentImportDto.getPhoneNumber();
|
|
String phoneNumber = basicStudentImportDto.getPhoneNumber();
|
|
- String campusName = basicStudentImportDto.getCampusName();
|
|
|
|
String collegeName = basicStudentImportDto.getCollegeName();
|
|
String collegeName = basicStudentImportDto.getCollegeName();
|
|
String majorName = basicStudentImportDto.getMajorName();
|
|
String majorName = basicStudentImportDto.getMajorName();
|
|
String clazzName = basicStudentImportDto.getClazzName();
|
|
String clazzName = basicStudentImportDto.getClazzName();
|
|
|
|
|
|
- // 校区
|
|
|
|
- Long campusId = null;
|
|
|
|
- if (SystemConstant.strNotNull(campusName)) {
|
|
|
|
- BasicCampus basicCampus;
|
|
|
|
- if (campusMap.containsKey(campusName)) {
|
|
|
|
- basicCampus = campusMap.get(campusName);
|
|
|
|
- } else {
|
|
|
|
- basicCampus = basicCampusService.getOne(new QueryWrapper<BasicCampus>().lambda()
|
|
|
|
- .eq(BasicCampus::getSchoolId, schoolId)
|
|
|
|
- .eq(BasicCampus::getCampusName, campusName));
|
|
|
|
- if (Objects.isNull(basicCampus)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("系统中不存在【校区】:" + campusName);
|
|
|
|
- }
|
|
|
|
- campusMap.put(campusName, basicCampus);
|
|
|
|
- }
|
|
|
|
- campusId = basicCampus.getId();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// 学院
|
|
// 学院
|
|
Long collegeId = null;
|
|
Long collegeId = null;
|
|
if (SystemConstant.strNotNull(collegeName)) {
|
|
if (SystemConstant.strNotNull(collegeName)) {
|
|
- SysOrg sysOrg;
|
|
|
|
|
|
+ BasicCollege basicCollege;
|
|
if (collegeMap.containsKey(collegeName)) {
|
|
if (collegeMap.containsKey(collegeName)) {
|
|
- sysOrg = collegeMap.get(collegeName);
|
|
|
|
|
|
+ collegeId = collegeMap.get(collegeName);
|
|
} else {
|
|
} else {
|
|
- sysOrg = sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
|
|
|
|
- .eq(SysOrg::getSchoolId, schoolId)
|
|
|
|
- .eq(SysOrg::getName, collegeName));
|
|
|
|
- if (Objects.isNull(sysOrg)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("系统中不存在【学院】:" + collegeName);
|
|
|
|
|
|
+ basicCollege = basicCollegeService.getOne(new QueryWrapper<BasicCollege>().lambda()
|
|
|
|
+ .eq(BasicCollege::getSchoolId, schoolId)
|
|
|
|
+ .eq(BasicCollege::getCollegeName, collegeName));
|
|
|
|
+ if (Objects.isNull(basicCollege)) {
|
|
|
|
+ // 新增一个basicCollege
|
|
|
|
+ BasicCollegeParams basicCollegeParams = new BasicCollegeParams();
|
|
|
|
+ basicCollegeParams.setCollegeName(collegeName);
|
|
|
|
+ collegeId = basicCollegeService.saveBasicCollege(basicCollegeParams, sysUser);
|
|
|
|
+ } else {
|
|
|
|
+ collegeId = basicCollege.getId();
|
|
}
|
|
}
|
|
- collegeMap.put(collegeName, sysOrg);
|
|
|
|
|
|
+ collegeMap.put(collegeName, collegeId);
|
|
}
|
|
}
|
|
- collegeId = sysOrg.getId();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 专业
|
|
// 专业
|
|
@@ -243,9 +235,6 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
// 班级
|
|
// 班级
|
|
Long clazzId = null;
|
|
Long clazzId = null;
|
|
if (SystemConstant.strNotNull(clazzName)) {
|
|
if (SystemConstant.strNotNull(clazzName)) {
|
|
- if (!SystemConstant.longNotNull(campusId)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("学生班级信息缺失校区信息异常");
|
|
|
|
- }
|
|
|
|
if (!SystemConstant.longNotNull(collegeId)) {
|
|
if (!SystemConstant.longNotNull(collegeId)) {
|
|
throw ExceptionResultEnum.ERROR.exception("学生班级信息缺失学院信息异常");
|
|
throw ExceptionResultEnum.ERROR.exception("学生班级信息缺失学院信息异常");
|
|
}
|
|
}
|
|
@@ -264,7 +253,6 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
if (Objects.isNull(basicClazz)) {
|
|
if (Objects.isNull(basicClazz)) {
|
|
// 新增一个clazz
|
|
// 新增一个clazz
|
|
BasicClazzParams basicClazzParams = new BasicClazzParams();
|
|
BasicClazzParams basicClazzParams = new BasicClazzParams();
|
|
- basicClazzParams.setCampusId(campusId);
|
|
|
|
basicClazzParams.setMajorId(majorId);
|
|
basicClazzParams.setMajorId(majorId);
|
|
basicClazzParams.setClazzName(clazzName);
|
|
basicClazzParams.setClazzName(clazzName);
|
|
clazzId = basicClazzService.saveBasicClazz(basicClazzParams, sysUser);
|
|
clazzId = basicClazzService.saveBasicClazz(basicClazzParams, sysUser);
|
|
@@ -279,9 +267,6 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
basicStudentParams.setStudentName(studentName);
|
|
basicStudentParams.setStudentName(studentName);
|
|
basicStudentParams.setStudentCode(studentCode);
|
|
basicStudentParams.setStudentCode(studentCode);
|
|
basicStudentParams.setPhoneNumber(phoneNumber);
|
|
basicStudentParams.setPhoneNumber(phoneNumber);
|
|
- if (SystemConstant.longNotNull(campusId)) {
|
|
|
|
- basicStudentParams.setCampusId(campusId);
|
|
|
|
- }
|
|
|
|
if (SystemConstant.longNotNull(collegeId)) {
|
|
if (SystemConstant.longNotNull(collegeId)) {
|
|
basicStudentParams.setCollegeId(collegeId);
|
|
basicStudentParams.setCollegeId(collegeId);
|
|
}
|
|
}
|
|
@@ -324,7 +309,6 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
String studentCode = basicStudentParams.getStudentCode();
|
|
String studentCode = basicStudentParams.getStudentCode();
|
|
String phoneNumber = basicStudentParams.getPhoneNumber();
|
|
String phoneNumber = basicStudentParams.getPhoneNumber();
|
|
Long clazzId = basicStudentParams.getClazzId();
|
|
Long clazzId = basicStudentParams.getClazzId();
|
|
- Long campusId = basicStudentParams.getCampusId();
|
|
|
|
Long majorId = basicStudentParams.getMajorId();
|
|
Long majorId = basicStudentParams.getMajorId();
|
|
Long collegeId = basicStudentParams.getCollegeId();
|
|
Long collegeId = basicStudentParams.getCollegeId();
|
|
|
|
|
|
@@ -335,12 +319,6 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
if (Objects.isNull(basicClazz)) {
|
|
if (Objects.isNull(basicClazz)) {
|
|
throw ExceptionResultEnum.ERROR.exception("所选班级不存在");
|
|
throw ExceptionResultEnum.ERROR.exception("所选班级不存在");
|
|
}
|
|
}
|
|
- if (SystemConstant.longNotNull(campusId)) {
|
|
|
|
- if (!campusId.equals(basicClazz.getCampusId())) {
|
|
|
|
- String exception = "学生信息【" + studentName + "(" + studentCode + ")" + "-" + basicCampusService.getById(campusId).getCampusName() + "】中的校区和学生所属班级信息【" + basicClazz.getClazzName() + "-" + basicCampusService.getById(basicClazz.getCampusId()).getCampusName() + "】中的校区不对应";
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception(exception);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
if (SystemConstant.longNotNull(majorId)) {
|
|
if (SystemConstant.longNotNull(majorId)) {
|
|
if (!majorId.equals(basicClazz.getMajorId())) {
|
|
if (!majorId.equals(basicClazz.getMajorId())) {
|
|
String exception = "学生信息【" + studentName + "(" + studentCode + ")" + "-" + basicMajorService.getById(majorId).getName() + "】中的专业和学生所属班级信息【" + basicClazz.getClazzName() + "-" + basicMajorService.getById(basicClazz.getMajorId()).getName() + "】中的专业不对应";
|
|
String exception = "学生信息【" + studentName + "(" + studentCode + ")" + "-" + basicMajorService.getById(majorId).getName() + "】中的专业和学生所属班级信息【" + basicClazz.getClazzName() + "-" + basicMajorService.getById(basicClazz.getMajorId()).getName() + "】中的专业不对应";
|
|
@@ -358,7 +336,9 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
}
|
|
}
|
|
if (SystemConstant.longNotNull(collegeId)) {
|
|
if (SystemConstant.longNotNull(collegeId)) {
|
|
if (!collegeId.equals(basicMajor.getBelongOrgId())) {
|
|
if (!collegeId.equals(basicMajor.getBelongOrgId())) {
|
|
- String exception = "学生信息【" + studentName + "(" + studentCode + ")" + "-" + sysOrgService.getById(collegeId).getName() + "】中的学院和学生所属专业信息【" + basicMajor.getName() + "-" + sysOrgService.getById(basicMajor.getBelongOrgId()).getName() + "】中的学院不对应";
|
|
|
|
|
|
+ String exception = "学生信息【" + studentName + "(" + studentCode + ")" + "-" + basicCollegeService.getById(collegeId).getCollegeName() +
|
|
|
|
+ "】中的学院和学生所属专业信息【" +
|
|
|
|
+ basicMajor.getName() + "-" + basicCollegeService.getById(basicMajor.getBelongOrgId()).getCollegeName() + "】中的学院不对应";
|
|
throw ExceptionResultEnum.ERROR.exception(exception);
|
|
throw ExceptionResultEnum.ERROR.exception(exception);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -395,7 +375,6 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
basicStudent.setStudentCode(studentCode);
|
|
basicStudent.setStudentCode(studentCode);
|
|
basicStudent.setStudentName(studentName);
|
|
basicStudent.setStudentName(studentName);
|
|
basicStudent.setPhoneNumber(phoneNumber);
|
|
basicStudent.setPhoneNumber(phoneNumber);
|
|
- basicStudent.setCampusId(campusId);
|
|
|
|
basicStudent.setBelongOrgId(collegeId);
|
|
basicStudent.setBelongOrgId(collegeId);
|
|
basicStudent.setMajorId(majorId);
|
|
basicStudent.setMajorId(majorId);
|
|
basicStudent.setClazzId(clazzId);
|
|
basicStudent.setClazzId(clazzId);
|