|
@@ -1,16 +1,23 @@
|
|
|
package com.xjrsoft.module.student.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.GenderDictionaryEnum;
|
|
|
import com.xjrsoft.common.enums.RoleEnum;
|
|
|
+import com.xjrsoft.common.enums.YesOrNoEnum;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
+import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
+import com.xjrsoft.module.base.entity.BaseMajorSet;
|
|
|
import com.xjrsoft.module.base.mapper.BaseClassMapper;
|
|
|
+import com.xjrsoft.module.base.mapper.BaseGradeMapper;
|
|
|
+import com.xjrsoft.module.base.mapper.BaseMajorSetMapper;
|
|
|
import com.xjrsoft.module.organization.entity.UserRoleRelation;
|
|
|
import com.xjrsoft.module.organization.mapper.UserRoleRelationMapper;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudent;
|
|
@@ -23,22 +30,27 @@ import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
import com.xjrsoft.module.student.mapper.BaseStudentContactMapper;
|
|
|
import com.xjrsoft.module.student.mapper.BaseStudentFamilyMapper;
|
|
|
import com.xjrsoft.module.student.mapper.BaseStudentFamilyMemberMapper;
|
|
|
-import com.xjrsoft.module.student.mapper.BaseStudentMapper;
|
|
|
-import com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper;
|
|
|
-import com.xjrsoft.module.student.mapper.BaseStudentSubsidizeMapper;
|
|
|
import com.xjrsoft.module.student.mapper.BaseStudentUserMapper;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentService;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentSubsidizeService;
|
|
|
import com.xjrsoft.module.student.service.IStudentManagerService;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentClassVo;
|
|
|
import com.xjrsoft.module.student.vo.PersonalPortraitPersonalInfoVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentPersonalInfoVo;
|
|
|
+import com.xjrsoft.module.system.entity.Area;
|
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
import com.xjrsoft.module.system.entity.DictionaryItem;
|
|
|
import com.xjrsoft.module.system.mapper.DictionarydetailMapper;
|
|
|
+import com.xjrsoft.module.system.service.IAreaService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -52,17 +64,21 @@ import java.util.stream.Collectors;
|
|
|
public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUserMapper, BaseStudentUser> implements IStudentManagerService {
|
|
|
private final com.xjrsoft.module.student.mapper.BaseStudentUserMapper studentbaseManagerBaseStudentUserMapper;
|
|
|
|
|
|
- private final BaseStudentMapper studentbaseManagerBaseStudentMapper;
|
|
|
+ private final IBaseStudentService baseStudentService;
|
|
|
private final BaseClassMapper baseClassMapper;
|
|
|
private final BaseStudentContactMapper studentbaseManagerBaseStudentContactMapper;
|
|
|
- private final BaseStudentFamilyMapper studentbaseManagerBaseStudentFamilyMapper;
|
|
|
- private final BaseStudentFamilyMemberMapper studentbaseManagerBaseStudentFamilyMemberMapper;
|
|
|
- private final BaseStudentSchoolRollMapper studentbaseManagerBaseStudentSchoolRollMapper;
|
|
|
- private final BaseStudentSubsidizeMapper studentbaseManagerBaseStudentSubsidizeMapper;
|
|
|
+ private final BaseStudentFamilyMapper familyMapper;
|
|
|
+ private final BaseStudentFamilyMemberMapper familyMemberMapper;
|
|
|
|
|
|
private final UserRoleRelationMapper userRoleRelationMapper;
|
|
|
- private final BaseStudentMapper baseStudentMapper;
|
|
|
private final DictionarydetailMapper dictionarydetailMapper;
|
|
|
+ private final IAreaService areaService;
|
|
|
+ private final BaseGradeMapper baseGradeMapper;
|
|
|
+ private final BaseMajorSetMapper baseMajorSetMapper;
|
|
|
+
|
|
|
+ private final IBaseStudentSchoolRollService schoolRollService;
|
|
|
+ private final IBaseStudentSubsidizeService subsidizeService;
|
|
|
+ private final IBaseStudentFamilyService familyService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -76,7 +92,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
studentbaseManagerBaseStudentUserMapper.insert(baseStudentUser);
|
|
|
for (BaseStudent baseStudent : baseStudentUser.getBaseStudentList()) {
|
|
|
baseStudent.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentMapper.insert(baseStudent);
|
|
|
+ baseStudentService.save(baseStudent);
|
|
|
}
|
|
|
for (BaseStudentContact baseStudentContact : baseStudentUser.getBaseStudentContactList()) {
|
|
|
baseStudentContact.setUserId(baseStudentUser.getId());
|
|
@@ -84,19 +100,19 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
}
|
|
|
for (BaseStudentFamily BaseStudentFamily : baseStudentUser.getBaseStudentFamilyList()) {
|
|
|
BaseStudentFamily.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentFamilyMapper.insert(BaseStudentFamily);
|
|
|
+ familyMapper.insert(BaseStudentFamily);
|
|
|
}
|
|
|
for (BaseStudentFamilyMember BaseStudentFamilyMember : baseStudentUser.getBaseStudentFamilyMemberList()) {
|
|
|
BaseStudentFamilyMember.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentFamilyMemberMapper.insert(BaseStudentFamilyMember);
|
|
|
+ familyMemberMapper.insert(BaseStudentFamilyMember);
|
|
|
}
|
|
|
for (BaseStudentSchoolRoll baseStudentSchoolRoll : baseStudentUser.getBaseStudentSchoolRollList()) {
|
|
|
baseStudentSchoolRoll.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentSchoolRollMapper.insert(baseStudentSchoolRoll);
|
|
|
+ schoolRollService.save(baseStudentSchoolRoll);
|
|
|
}
|
|
|
for (BaseStudentSubsidize baseStudentSubsidize : baseStudentUser.getBaseStudentSubsidizeList()) {
|
|
|
baseStudentSubsidize.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentSubsidizeMapper.insert(baseStudentSubsidize);
|
|
|
+ subsidizeService.save(baseStudentSubsidize);
|
|
|
}
|
|
|
|
|
|
// 添加角色
|
|
@@ -115,7 +131,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
//********************************* BaseStudent 增删改 开始 *******************************************/
|
|
|
{
|
|
|
// 查出所有子级的id
|
|
|
- List<BaseStudent> baseStudentList = studentbaseManagerBaseStudentMapper.selectList(Wrappers.lambdaQuery(BaseStudent.class).eq(BaseStudent::getUserId, baseStudentUser.getId()).select(BaseStudent::getId));
|
|
|
+ List<BaseStudent> baseStudentList = baseStudentService.list(Wrappers.lambdaQuery(BaseStudent.class).eq(BaseStudent::getUserId, baseStudentUser.getId()).select(BaseStudent::getId));
|
|
|
List<Long> baseStudentIds = baseStudentList.stream().map(BaseStudent::getId).collect(Collectors.toList());
|
|
|
//原有子表单 没有被删除的主键
|
|
|
List<Long> baseStudentOldIds = baseStudentUser.getBaseStudentList().stream().map(BaseStudent::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
@@ -125,18 +141,18 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
for (BaseStudent baseStudent : baseStudentUser.getBaseStudentList()) {
|
|
|
//如果不等于空则修改
|
|
|
if (baseStudent.getId() != null) {
|
|
|
- studentbaseManagerBaseStudentMapper.updateById(baseStudent);
|
|
|
+ baseStudentService.updateById(baseStudent);
|
|
|
}
|
|
|
//如果等于空 则新增
|
|
|
else {
|
|
|
//已经不存在的id 删除
|
|
|
baseStudent.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentMapper.insert(baseStudent);
|
|
|
+ baseStudentService.save(baseStudent);
|
|
|
}
|
|
|
}
|
|
|
//已经不存在的id 删除
|
|
|
if (baseStudentRemoveIds.size() > 0) {
|
|
|
- studentbaseManagerBaseStudentMapper.deleteBatchIds(baseStudentRemoveIds);
|
|
|
+ baseStudentService.removeBatchByIds(baseStudentRemoveIds);
|
|
|
}
|
|
|
}
|
|
|
//********************************* BaseStudent 增删改 结束 *******************************************/
|
|
@@ -173,7 +189,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
//********************************* BaseStudentFamily 增删改 开始 *******************************************/
|
|
|
{
|
|
|
// 查出所有子级的id
|
|
|
- List<BaseStudentFamily> BaseStudentFamilyList = studentbaseManagerBaseStudentFamilyMapper.selectList(Wrappers.lambdaQuery(BaseStudentFamily.class).eq(BaseStudentFamily::getUserId, baseStudentUser.getId()).select(BaseStudentFamily::getId));
|
|
|
+ List<BaseStudentFamily> BaseStudentFamilyList = familyMapper.selectList(Wrappers.lambdaQuery(BaseStudentFamily.class).eq(BaseStudentFamily::getUserId, baseStudentUser.getId()).select(BaseStudentFamily::getId));
|
|
|
List<Long> BaseStudentFamilyIds = BaseStudentFamilyList.stream().map(BaseStudentFamily::getId).collect(Collectors.toList());
|
|
|
//原有子表单 没有被删除的主键
|
|
|
List<Long> BaseStudentFamilyOldIds = baseStudentUser.getBaseStudentFamilyList().stream().map(BaseStudentFamily::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
@@ -183,18 +199,18 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
for (BaseStudentFamily BaseStudentFamily : baseStudentUser.getBaseStudentFamilyList()) {
|
|
|
//如果不等于空则修改
|
|
|
if (BaseStudentFamily.getId() != null) {
|
|
|
- studentbaseManagerBaseStudentFamilyMapper.updateById(BaseStudentFamily);
|
|
|
+ familyMapper.updateById(BaseStudentFamily);
|
|
|
}
|
|
|
//如果等于空 则新增
|
|
|
else {
|
|
|
//已经不存在的id 删除
|
|
|
BaseStudentFamily.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentFamilyMapper.insert(BaseStudentFamily);
|
|
|
+ familyMapper.insert(BaseStudentFamily);
|
|
|
}
|
|
|
}
|
|
|
//已经不存在的id 删除
|
|
|
if (BaseStudentFamilyRemoveIds.size() > 0) {
|
|
|
- studentbaseManagerBaseStudentFamilyMapper.deleteBatchIds(BaseStudentFamilyRemoveIds);
|
|
|
+ familyMapper.deleteBatchIds(BaseStudentFamilyRemoveIds);
|
|
|
}
|
|
|
}
|
|
|
//********************************* BaseStudentFamily 增删改 结束 *******************************************/
|
|
@@ -202,7 +218,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
//********************************* BaseStudentFamilyMember 增删改 开始 *******************************************/
|
|
|
{
|
|
|
// 查出所有子级的id
|
|
|
- List<BaseStudentFamilyMember> BaseStudentFamilyMemberList = studentbaseManagerBaseStudentFamilyMemberMapper.selectList(Wrappers.lambdaQuery(BaseStudentFamilyMember.class).eq(BaseStudentFamilyMember::getUserId, baseStudentUser.getId()).select(BaseStudentFamilyMember::getId));
|
|
|
+ List<BaseStudentFamilyMember> BaseStudentFamilyMemberList = familyMemberMapper.selectList(Wrappers.lambdaQuery(BaseStudentFamilyMember.class).eq(BaseStudentFamilyMember::getUserId, baseStudentUser.getId()).select(BaseStudentFamilyMember::getId));
|
|
|
List<Long> BaseStudentFamilyMemberIds = BaseStudentFamilyMemberList.stream().map(BaseStudentFamilyMember::getId).collect(Collectors.toList());
|
|
|
//原有子表单 没有被删除的主键
|
|
|
List<Long> BaseStudentFamilyMemberOldIds = baseStudentUser.getBaseStudentFamilyMemberList().stream().map(BaseStudentFamilyMember::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
@@ -212,18 +228,18 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
for (BaseStudentFamilyMember BaseStudentFamilyMember : baseStudentUser.getBaseStudentFamilyMemberList()) {
|
|
|
//如果不等于空则修改
|
|
|
if (BaseStudentFamilyMember.getId() != null) {
|
|
|
- studentbaseManagerBaseStudentFamilyMemberMapper.updateById(BaseStudentFamilyMember);
|
|
|
+ familyMemberMapper.updateById(BaseStudentFamilyMember);
|
|
|
}
|
|
|
//如果等于空 则新增
|
|
|
else {
|
|
|
//已经不存在的id 删除
|
|
|
BaseStudentFamilyMember.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentFamilyMemberMapper.insert(BaseStudentFamilyMember);
|
|
|
+ familyMemberMapper.insert(BaseStudentFamilyMember);
|
|
|
}
|
|
|
}
|
|
|
//已经不存在的id 删除
|
|
|
if (BaseStudentFamilyMemberRemoveIds.size() > 0) {
|
|
|
- studentbaseManagerBaseStudentFamilyMemberMapper.deleteBatchIds(BaseStudentFamilyMemberRemoveIds);
|
|
|
+ familyMemberMapper.deleteBatchIds(BaseStudentFamilyMemberRemoveIds);
|
|
|
}
|
|
|
}
|
|
|
//********************************* BaseStudentFamilyMember 增删改 结束 *******************************************/
|
|
@@ -231,7 +247,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
//********************************* StudentSchoolRoll 增删改 开始 *******************************************/
|
|
|
{
|
|
|
// 查出所有子级的id
|
|
|
- List<BaseStudentSchoolRoll> baseStudentSchoolRollList = studentbaseManagerBaseStudentSchoolRollMapper.selectList(Wrappers.lambdaQuery(BaseStudentSchoolRoll.class).eq(BaseStudentSchoolRoll::getUserId, baseStudentUser.getId()).select(BaseStudentSchoolRoll::getId));
|
|
|
+ List<BaseStudentSchoolRoll> baseStudentSchoolRollList = schoolRollService.list(Wrappers.lambdaQuery(BaseStudentSchoolRoll.class).eq(BaseStudentSchoolRoll::getUserId, baseStudentUser.getId()).select(BaseStudentSchoolRoll::getId));
|
|
|
List<Long> baseStudentSchoolRollIds = baseStudentSchoolRollList.stream().map(BaseStudentSchoolRoll::getId).collect(Collectors.toList());
|
|
|
//原有子表单 没有被删除的主键
|
|
|
List<Long> baseStudentSchoolRollOldIds = baseStudentUser.getBaseStudentSchoolRollList().stream().map(BaseStudentSchoolRoll::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
@@ -241,18 +257,18 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
for (BaseStudentSchoolRoll baseStudentSchoolRoll : baseStudentUser.getBaseStudentSchoolRollList()) {
|
|
|
//如果不等于空则修改
|
|
|
if (baseStudentSchoolRoll.getId() != null) {
|
|
|
- studentbaseManagerBaseStudentSchoolRollMapper.updateById(baseStudentSchoolRoll);
|
|
|
+ schoolRollService.updateById(baseStudentSchoolRoll);
|
|
|
}
|
|
|
//如果等于空 则新增
|
|
|
else {
|
|
|
//已经不存在的id 删除
|
|
|
baseStudentSchoolRoll.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentSchoolRollMapper.insert(baseStudentSchoolRoll);
|
|
|
+ schoolRollService.save(baseStudentSchoolRoll);
|
|
|
}
|
|
|
}
|
|
|
//已经不存在的id 删除
|
|
|
if (baseStudentSchoolRollRemoveIds.size() > 0) {
|
|
|
- studentbaseManagerBaseStudentSchoolRollMapper.deleteBatchIds(baseStudentSchoolRollRemoveIds);
|
|
|
+ schoolRollService.removeBatchByIds(baseStudentSchoolRollRemoveIds);
|
|
|
}
|
|
|
}
|
|
|
//********************************* StudentSchoolRoll 增删改 结束 *******************************************/
|
|
@@ -260,7 +276,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
//********************************* BaseStudentSubsidize 增删改 开始 *******************************************/
|
|
|
{
|
|
|
// 查出所有子级的id
|
|
|
- List<BaseStudentSubsidize> baseStudentSubsidizeList = studentbaseManagerBaseStudentSubsidizeMapper.selectList(Wrappers.lambdaQuery(BaseStudentSubsidize.class).eq(BaseStudentSubsidize::getUserId, baseStudentUser.getId()).select(BaseStudentSubsidize::getId));
|
|
|
+ List<BaseStudentSubsidize> baseStudentSubsidizeList = subsidizeService.list(Wrappers.lambdaQuery(BaseStudentSubsidize.class).eq(BaseStudentSubsidize::getUserId, baseStudentUser.getId()).select(BaseStudentSubsidize::getId));
|
|
|
List<Long> baseStudentSubsidizeIds = baseStudentSubsidizeList.stream().map(BaseStudentSubsidize::getId).collect(Collectors.toList());
|
|
|
//原有子表单 没有被删除的主键
|
|
|
List<Long> baseStudentSubsidizeOldIds = baseStudentUser.getBaseStudentSubsidizeList().stream().map(BaseStudentSubsidize::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
@@ -270,18 +286,18 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
for (BaseStudentSubsidize BaseStudentEducation : baseStudentUser.getBaseStudentSubsidizeList()) {
|
|
|
//如果不等于空则修改
|
|
|
if (BaseStudentEducation.getId() != null) {
|
|
|
- studentbaseManagerBaseStudentSubsidizeMapper.updateById(BaseStudentEducation);
|
|
|
+ subsidizeService.updateById(BaseStudentEducation);
|
|
|
}
|
|
|
//如果等于空 则新增
|
|
|
else {
|
|
|
//已经不存在的id 删除
|
|
|
BaseStudentEducation.setUserId(baseStudentUser.getId());
|
|
|
- studentbaseManagerBaseStudentSubsidizeMapper.insert(BaseStudentEducation);
|
|
|
+ subsidizeService.save(BaseStudentEducation);
|
|
|
}
|
|
|
}
|
|
|
//已经不存在的id 删除
|
|
|
if (baseStudentSubsidizeRemoveIds.size() > 0) {
|
|
|
- studentbaseManagerBaseStudentSubsidizeMapper.deleteBatchIds(baseStudentSubsidizeRemoveIds);
|
|
|
+ subsidizeService.removeBatchByIds(baseStudentSubsidizeRemoveIds);
|
|
|
}
|
|
|
}
|
|
|
//********************************* BaseStudentEducation 增删改 结束 *******************************************/
|
|
@@ -292,12 +308,12 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean delete(List<Long> ids) {
|
|
|
studentbaseManagerBaseStudentUserMapper.deleteBatchIds(ids);
|
|
|
- studentbaseManagerBaseStudentMapper.delete(Wrappers.lambdaQuery(BaseStudent.class).in(BaseStudent::getUserId, ids));
|
|
|
+ baseStudentService.remove(Wrappers.lambdaQuery(BaseStudent.class).in(BaseStudent::getUserId, ids));
|
|
|
studentbaseManagerBaseStudentContactMapper.delete(Wrappers.lambdaQuery(BaseStudentContact.class).in(BaseStudentContact::getUserId, ids));
|
|
|
- studentbaseManagerBaseStudentFamilyMapper.delete(Wrappers.lambdaQuery(BaseStudentFamily.class).in(BaseStudentFamily::getUserId, ids));
|
|
|
- studentbaseManagerBaseStudentFamilyMemberMapper.delete(Wrappers.lambdaQuery(BaseStudentFamilyMember.class).in(BaseStudentFamilyMember::getUserId, ids));
|
|
|
- studentbaseManagerBaseStudentSchoolRollMapper.delete(Wrappers.lambdaQuery(BaseStudentSchoolRoll.class).in(BaseStudentSchoolRoll::getUserId, ids));
|
|
|
- studentbaseManagerBaseStudentSubsidizeMapper.delete(Wrappers.lambdaQuery(BaseStudentSubsidize.class).in(BaseStudentSubsidize::getUserId, ids));
|
|
|
+ familyMapper.delete(Wrappers.lambdaQuery(BaseStudentFamily.class).in(BaseStudentFamily::getUserId, ids));
|
|
|
+ familyMemberMapper.delete(Wrappers.lambdaQuery(BaseStudentFamilyMember.class).in(BaseStudentFamilyMember::getUserId, ids));
|
|
|
+ schoolRollService.remove(Wrappers.lambdaQuery(BaseStudentSchoolRoll.class).in(BaseStudentSchoolRoll::getUserId, ids));
|
|
|
+ subsidizeService.remove(Wrappers.lambdaQuery(BaseStudentSubsidize.class).in(BaseStudentSubsidize::getUserId, ids));
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -322,10 +338,10 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
*/
|
|
|
@Override
|
|
|
public PersonalPortraitPersonalInfoVo getPersonalInfo(Long userId) {
|
|
|
- StudentPersonalInfoVo info = studentbaseManagerBaseStudentMapper.getPersonalInfo(userId);
|
|
|
+ StudentPersonalInfoVo info = baseStudentService.getPersonalInfo(userId);
|
|
|
PersonalPortraitPersonalInfoVo p = new PersonalPortraitPersonalInfoVo();
|
|
|
BeanUtils.copyProperties(info, p);
|
|
|
- List<BaseStudentFamilyMember> members = studentbaseManagerBaseStudentFamilyMemberMapper.selectList(
|
|
|
+ List<BaseStudentFamilyMember> members = familyMemberMapper.selectList(
|
|
|
new QueryWrapper<BaseStudentFamilyMember>().lambda()
|
|
|
.eq(BaseStudentFamilyMember::getUserId, userId)
|
|
|
.eq(BaseStudentFamilyMember::getIsGuardian, 1)
|
|
@@ -344,20 +360,26 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Boolean importStudentData(List<Map<Integer, Object>> excelDataList) {
|
|
|
+ public Boolean importStudentData(List<Map<Integer, Object>> excelDataList) throws ParseException {
|
|
|
+ List<String> idNumbers = new ArrayList<>();
|
|
|
+ for (Map<Integer, Object> integerObjectMap : excelDataList) {
|
|
|
+ idNumbers.add(integerObjectMap.get(0).toString());
|
|
|
+ }
|
|
|
//查询所有学生的用户信息,组装起来备用
|
|
|
List<BaseStudentUser> studentUsers = this.selectJoinList(BaseStudentUser.class,
|
|
|
new MPJLambdaWrapper<BaseStudentUser>()
|
|
|
.leftJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentUser::getId)
|
|
|
+ .in(BaseStudentUser::getCredentialNumber, idNumbers)
|
|
|
);
|
|
|
Map<String, BaseStudentUser> studentUserMap = new HashMap<>();
|
|
|
for (BaseStudentUser studentUser : studentUsers) {
|
|
|
studentUserMap.put(studentUser.getCredentialNumber(), studentUser);
|
|
|
}
|
|
|
//查询所有的学生信息,组装起来备用
|
|
|
- List<BaseStudent> baseStudents = baseStudentMapper.selectJoinList(BaseStudent.class,
|
|
|
+ List<BaseStudent> baseStudents = baseStudentService.selectJoinList(BaseStudent.class,
|
|
|
new MPJLambdaWrapper<BaseStudent>()
|
|
|
.leftJoin(BaseStudentUser.class, BaseStudentUser::getId, BaseStudent::getUserId)
|
|
|
+ .in(BaseStudentUser::getCredentialNumber, idNumbers)
|
|
|
);
|
|
|
Map<Long, BaseStudent> baseStudentMap = new HashMap<>();
|
|
|
for (BaseStudent studentUser : baseStudents) {
|
|
@@ -365,91 +387,420 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
}
|
|
|
//查询所用到的字典
|
|
|
Map<String, String> dictionary = initDictionary();
|
|
|
+ //查行政区划
|
|
|
+ List<Area> areaList = areaService.list();
|
|
|
+ Map<String, Long> areaMap = new HashMap<>();
|
|
|
+ for (Area area : areaList) {
|
|
|
+ areaMap.put(area.getName(), Long.parseLong(area.getCode()));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<BaseStudentSchoolRoll> baseStudentSchoolRolls = schoolRollService.selectJoinList(BaseStudentSchoolRoll.class,
|
|
|
+ new MPJLambdaWrapper<BaseStudentSchoolRoll>()
|
|
|
+ .leftJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentSchoolRoll::getId)
|
|
|
+ .in(BaseStudentUser::getCredentialNumber, idNumbers)
|
|
|
+ );
|
|
|
+ Map<Long, BaseStudentSchoolRoll> studentSchoolRollMap = new HashMap<>();
|
|
|
+ for (BaseStudentSchoolRoll schoolRoll : baseStudentSchoolRolls) {
|
|
|
+ studentSchoolRollMap.put(schoolRoll.getUserId(), schoolRoll);
|
|
|
+ }
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat();
|
|
|
+ String dateformat = "yyyy-MM-dd HH:mm:ss";
|
|
|
+
|
|
|
+ //查询年级
|
|
|
+ List<BaseGrade> gradeList = baseGradeMapper.selectList(new QueryWrapper<BaseGrade>().lambda().eq(BaseGrade::getDeleteMark, DeleteMark.NODELETE.getCode()));
|
|
|
+ Map<String, Long> gradeMap = new HashMap<>();
|
|
|
+ for (BaseGrade grade : gradeList) {
|
|
|
+ gradeMap.put(grade.getName(), grade.getId());
|
|
|
+ }
|
|
|
+ //查询班级
|
|
|
+ List<BaseClass> classList = baseClassMapper.selectList(new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getDeleteMark, DeleteMark.NODELETE.getCode()));
|
|
|
+ Map<String, Long> classMap = new HashMap<>();
|
|
|
+ for (BaseClass grade : classList) {
|
|
|
+ classMap.put(grade.getName(), grade.getId());
|
|
|
+ }
|
|
|
+ //查询专业
|
|
|
+ List<BaseMajorSet> majorSetList = baseMajorSetMapper.selectList(new QueryWrapper<BaseMajorSet>().lambda().eq(BaseMajorSet::getDeleteMark, DeleteMark.NODELETE.getCode()));
|
|
|
+ Map<String, Long> majorSetMap = new HashMap<>();
|
|
|
+ for (BaseMajorSet baseMajorSet : majorSetList) {
|
|
|
+ majorSetMap.put(baseMajorSet.getName(), baseMajorSet.getId());
|
|
|
+ }
|
|
|
+ //查询资助
|
|
|
+ List<BaseStudentSubsidize> baseStudentSubsidizes = subsidizeService.list(null);
|
|
|
+ Map<Long, BaseStudentSubsidize> subsidizesMap = new HashMap<>();
|
|
|
+ for (BaseStudentSubsidize el : baseStudentSubsidizes) {
|
|
|
+ subsidizesMap.put(el.getUserId(), el);
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询家庭
|
|
|
+ List<BaseStudentFamily> studentFamilies = familyMapper.selectList(null);
|
|
|
+ Map<Long, BaseStudentFamily> familyMap = new HashMap<>();
|
|
|
+ for (BaseStudentFamily el : studentFamilies) {
|
|
|
+ familyMap.put(el.getUserId(), el);
|
|
|
+ }
|
|
|
|
|
|
List<BaseStudentUser> updateStudentUserList = new ArrayList();
|
|
|
List<BaseStudent> updateBaseStudentList = new ArrayList();
|
|
|
+ List<BaseStudentSchoolRoll> updateSchoolRollList = new ArrayList();
|
|
|
+ List<BaseStudentSubsidize> updateSubsidizeList = new ArrayList();
|
|
|
+ List<BaseStudentFamily> updateFamilyList = new ArrayList();
|
|
|
+
|
|
|
+ List<BaseStudentUser> insertStudentUserList = new ArrayList();
|
|
|
+ List<BaseStudent> insertBaseStudentList = new ArrayList();
|
|
|
+ List<BaseStudentSchoolRoll> insertSchoolRollList = new ArrayList();
|
|
|
+ List<BaseStudentSubsidize> insertSubsidizeList = new ArrayList();
|
|
|
+ List<BaseStudentFamily> insertFamilyList = new ArrayList();
|
|
|
+
|
|
|
+ long createUserId = StpUtil.getLoginIdAsLong();
|
|
|
for (Map<Integer, Object> dataMaps : excelDataList) {
|
|
|
String credentialNumber = dataMaps.get(0).toString();//身份证号
|
|
|
//已存在,更新
|
|
|
- BaseStudentUser user;
|
|
|
+ BaseStudentUser user = studentUserMap.get(credentialNumber);
|
|
|
+ user.setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
BaseStudent baseStudent;
|
|
|
- if(studentUserMap.containsKey(credentialNumber)){
|
|
|
- //更新用户数据
|
|
|
- user = studentUserMap.get(credentialNumber);
|
|
|
+ BaseStudentSchoolRoll schoolRoll;
|
|
|
+ BaseStudentSubsidize subsidize;
|
|
|
+ BaseStudentFamily studentFamily;
|
|
|
+ if(user != null){
|
|
|
baseStudent = baseStudentMap.get(user.getId());
|
|
|
+ baseStudent.setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
|
|
|
- updateStudentUserList.add(user);
|
|
|
- updateBaseStudentList.add(baseStudent);
|
|
|
+ schoolRoll = studentSchoolRollMap.get(user.getId());
|
|
|
+ schoolRoll.setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
+
|
|
|
+ subsidize = subsidizesMap.get(user.getId());
|
|
|
+ subsidize.setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
+
|
|
|
+ studentFamily = familyMap.get(user.getId());
|
|
|
+ studentFamily.setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
}else{
|
|
|
user = new BaseStudentUser();
|
|
|
baseStudent = new BaseStudent();
|
|
|
+ baseStudent.setUserId(user.getId());
|
|
|
+ baseStudent.setCreateUserId(createUserId);
|
|
|
+ baseStudent.setCreateDate(LocalDateTime.now());
|
|
|
+
|
|
|
+ schoolRoll = new BaseStudentSchoolRoll();
|
|
|
+ schoolRoll.setUserId(user.getId());
|
|
|
+ schoolRoll.setCreateUserId(createUserId);
|
|
|
+ schoolRoll.setCreateDate(LocalDateTime.now());
|
|
|
+
|
|
|
+ subsidize = new BaseStudentSubsidize();
|
|
|
+ subsidize.setUserId(user.getId());
|
|
|
+ subsidize.setCreateUserId(createUserId);
|
|
|
+ subsidize.setCreateDate(LocalDateTime.now());
|
|
|
+
|
|
|
+ studentFamily = new BaseStudentFamily();
|
|
|
+ studentFamily.setUserId(user.getId());
|
|
|
+ studentFamily.setCreateUserId(createUserId);
|
|
|
+ studentFamily.setCreateDate(LocalDateTime.now());
|
|
|
}
|
|
|
//设置字段值
|
|
|
- if(dataMaps.get(1).toString() != null && "".equals(dataMaps.get(1).toString())){
|
|
|
+ if(dataMaps.get(1).toString() != null && !"".equals(dataMaps.get(1).toString())){
|
|
|
baseStudent.setStudentId(dataMaps.get(1).toString());//学号
|
|
|
}
|
|
|
- if(dataMaps.get(3).toString() != null && "".equals(dataMaps.get(3).toString())){
|
|
|
+ if(dataMaps.get(2).toString() != null && !"".equals(dataMaps.get(2).toString())){
|
|
|
+ schoolRoll.setCandidateNumber(dataMaps.get(2).toString());//考号
|
|
|
+ }
|
|
|
+ if(dataMaps.get(3).toString() != null && !"".equals(dataMaps.get(3).toString())){
|
|
|
user.setName(dataMaps.get(3).toString());//姓名
|
|
|
}
|
|
|
- if(dataMaps.get(4).toString() != null && "".equals(dataMaps.get(4).toString())){
|
|
|
+ if(dataMaps.get(4).toString() != null && !"".equals(dataMaps.get(4).toString())){
|
|
|
user.setGender(GenderDictionaryEnum.getCode(dataMaps.get(4).toString()));//性别
|
|
|
}
|
|
|
- if(dataMaps.get(5).toString() != null && "".equals(dataMaps.get(5).toString())){
|
|
|
+ if(dataMaps.get(5).toString() != null && !"".equals(dataMaps.get(5).toString())){
|
|
|
user.setMobile(dataMaps.get(5).toString());//手机号
|
|
|
}
|
|
|
- if(dataMaps.get(6).toString() != null && "".equals(dataMaps.get(6).toString())){
|
|
|
+ if(dataMaps.get(6).toString() != null && !"".equals(dataMaps.get(6).toString())){
|
|
|
user.setEmail(dataMaps.get(6).toString());//邮箱
|
|
|
}
|
|
|
- if(dataMaps.get(7).toString() != null && "".equals(dataMaps.get(7).toString())){
|
|
|
+ if(dataMaps.get(7).toString() != null && !"".equals(dataMaps.get(7).toString())){
|
|
|
baseStudent.setAsName(dataMaps.get(7).toString());//别名
|
|
|
}
|
|
|
- if(dataMaps.get(8).toString() != null && "".equals(dataMaps.get(8).toString())){
|
|
|
+ if(dataMaps.get(8).toString() != null && !"".equals(dataMaps.get(8).toString())){
|
|
|
baseStudent.setEnName(dataMaps.get(8).toString());//英文名
|
|
|
}
|
|
|
- if(dataMaps.get(9).toString() != null && "".equals(dataMaps.get(9).toString())){
|
|
|
+ if(dataMaps.get(9).toString() != null && !"".equals(dataMaps.get(9).toString())){
|
|
|
baseStudent.setPyName(dataMaps.get(9).toString());//姓名拼音
|
|
|
}
|
|
|
- if(dataMaps.get(10).toString() != null && "".equals(dataMaps.get(10).toString())){
|
|
|
+ if(dataMaps.get(10).toString() != null && !"".equals(dataMaps.get(10).toString())){
|
|
|
baseStudent.setPyName(dataMaps.get(10).toString());//曾用名
|
|
|
}
|
|
|
- if(dataMaps.get(11).toString() != null && "".equals(dataMaps.get(11).toString())){
|
|
|
+ if(dataMaps.get(11).toString() != null && !"".equals(dataMaps.get(11).toString())){
|
|
|
user.setCredentialType(dictionary.get(dataMaps.get(11).toString()));//证件类型
|
|
|
}
|
|
|
- if(dataMaps.get(12).toString() != null && "".equals(dataMaps.get(12).toString())){
|
|
|
+ if(dataMaps.get(12).toString() != null && !"".equals(dataMaps.get(12).toString())){
|
|
|
LocalDateTime birthday = LocalDateTime.parse(dataMaps.get(12).toString());
|
|
|
user.setBirthDate(birthday);//出生日期
|
|
|
baseStudent.setDayOfBirth(birthday);//出生日期
|
|
|
}
|
|
|
- if(dataMaps.get(13).toString() != null && "".equals(dataMaps.get(13).toString())){
|
|
|
+ if(dataMaps.get(13).toString() != null && !"".equals(dataMaps.get(13).toString())){
|
|
|
baseStudent.setBirthType(dictionary.get(dataMaps.get(13).toString()));//生日类型
|
|
|
}
|
|
|
- if(dataMaps.get(14).toString() != null && "".equals(dataMaps.get(14).toString())){
|
|
|
+ if(dataMaps.get(14).toString() != null && !"".equals(dataMaps.get(14).toString())){
|
|
|
baseStudent.setNation(dictionary.get(dataMaps.get(14).toString()));//民族
|
|
|
}
|
|
|
- if(dataMaps.get(15).toString() != null && "".equals(dataMaps.get(15).toString())){
|
|
|
+ if(dataMaps.get(15).toString() != null && !"".equals(dataMaps.get(15).toString())){
|
|
|
baseStudent.setBloodType(dictionary.get(dataMaps.get(15).toString()));//血型
|
|
|
}
|
|
|
- if(dataMaps.get(16).toString() != null && "".equals(dataMaps.get(16).toString())){
|
|
|
+ if(dataMaps.get(16).toString() != null && !"".equals(dataMaps.get(16).toString())){
|
|
|
baseStudent.setHealth(dictionary.get(dataMaps.get(16).toString()));//健康状况
|
|
|
}
|
|
|
- if(dataMaps.get(17).toString() != null && "".equals(dataMaps.get(17).toString())){
|
|
|
+ if(dataMaps.get(17).toString() != null && !"".equals(dataMaps.get(17).toString())){
|
|
|
baseStudent.setMaritalState(dictionary.get(dataMaps.get(17).toString()));//婚姻状况
|
|
|
}
|
|
|
- if(dataMaps.get(18).toString() != null && "".equals(dataMaps.get(18).toString())){
|
|
|
+ if(dataMaps.get(18).toString() != null && !"".equals(dataMaps.get(18).toString())){
|
|
|
baseStudent.setPoliticalState(dictionary.get(dataMaps.get(18).toString()));//政治面貌
|
|
|
}
|
|
|
- if(dataMaps.get(19).toString() != null && "".equals(dataMaps.get(19).toString())){
|
|
|
+ if(dataMaps.get(19).toString() != null && !"".equals(dataMaps.get(19).toString())){
|
|
|
baseStudent.setPoliticalState(dictionary.get(dataMaps.get(19).toString()));//国籍地区
|
|
|
}
|
|
|
+ if(dataMaps.get(20).toString() != null && !"".equals(dataMaps.get(20).toString())){
|
|
|
+ baseStudent.setChineseType(dictionary.get(dataMaps.get(20).toString()));//港澳台侨外
|
|
|
+ }
|
|
|
+ if(dataMaps.get(21).toString() != null && !"".equals(dataMaps.get(21).toString())){
|
|
|
+ baseStudent.setHouseHoldType(dictionary.get(dataMaps.get(21).toString()));//户口类别
|
|
|
+ }
|
|
|
+// if(dataMaps.get(22).toString() != null && !"".equals(dataMaps.get(22).toString())){
|
|
|
+// baseStudent.setHouseHoldType(dictionary.get(dataMaps.get(22).toString()));//籍贯类型
|
|
|
+// }
|
|
|
+ if(dataMaps.get(23).toString() != null && !"".equals(dataMaps.get(23).toString())){
|
|
|
+ baseStudent.setProvinces(areaMap.get(dataMaps.get(23).toString()));//省
|
|
|
+ }
|
|
|
+ if(dataMaps.get(24).toString() != null && !"".equals(dataMaps.get(24).toString())){
|
|
|
+ baseStudent.setCity(areaMap.get(dataMaps.get(23).toString()));//市
|
|
|
+ }
|
|
|
+ if(dataMaps.get(25).toString() != null && !"".equals(dataMaps.get(25).toString())){
|
|
|
+ baseStudent.setDistrict(areaMap.get(dataMaps.get(25).toString()));//区县
|
|
|
+ }
|
|
|
+ if(dataMaps.get(26).toString() != null && !"".equals(dataMaps.get(26).toString())){
|
|
|
+ baseStudent.setHouseProvinces(areaMap.get(dataMaps.get(26).toString()));//户口所在地省
|
|
|
+ }
|
|
|
+ if(dataMaps.get(27).toString() != null && !"".equals(dataMaps.get(27).toString())){
|
|
|
+ baseStudent.setHouseCity(areaMap.get(dataMaps.get(27).toString()));//户口所在地市
|
|
|
+ }
|
|
|
+ if(dataMaps.get(28).toString() != null && !"".equals(dataMaps.get(28).toString())){
|
|
|
+ baseStudent.setHouseDistrict(areaMap.get(dataMaps.get(28).toString()));//户口所在地区/县
|
|
|
+ }
|
|
|
+ if(dataMaps.get(29).toString() != null && !"".equals(dataMaps.get(29).toString())){
|
|
|
+ baseStudent.setBelongsPolice(dataMaps.get(29).toString());//户口所属派出所
|
|
|
+ }
|
|
|
+ if(dataMaps.get(30).toString() != null && !"".equals(dataMaps.get(30).toString())){
|
|
|
+ baseStudent.setBirthProvinces(areaMap.get(dataMaps.get(30).toString()));//出生所在地省
|
|
|
+ }
|
|
|
+ if(dataMaps.get(31).toString() != null && !"".equals(dataMaps.get(31).toString())){
|
|
|
+ baseStudent.setBirthCity(areaMap.get(dataMaps.get(31).toString()));//出生所在地市
|
|
|
+ }
|
|
|
+ if(dataMaps.get(32).toString() != null && !"".equals(dataMaps.get(32).toString())){
|
|
|
+ baseStudent.setBirthDistrict(areaMap.get(dataMaps.get(32).toString()));//出生所在地/区县
|
|
|
+ }
|
|
|
+ if(dataMaps.get(33).toString() != null && !"".equals(dataMaps.get(33).toString())){
|
|
|
+ baseStudent.setHouseHoldAddress(dataMaps.get(33).toString());//户籍地址
|
|
|
+ }
|
|
|
+ if(dataMaps.get(34).toString() != null && !"".equals(dataMaps.get(34).toString())){
|
|
|
+ baseStudent.setResidenceType(dictionary.get(dataMaps.get(34).toString()));//学生居住地类型
|
|
|
+ }
|
|
|
+ if(dataMaps.get(35).toString() != null && !"".equals(dataMaps.get(35).toString())){
|
|
|
+ baseStudent.setTrainInterval(dataMaps.get(35).toString());//乘火车区间
|
|
|
+ }
|
|
|
+ if(dataMaps.get(36).toString() != null && !"".equals(dataMaps.get(36).toString())){
|
|
|
+ baseStudent.setIsMigrateChildren(YesOrNoEnum.getCode(dataMaps.get(36).toString()));//是否随迁子女
|
|
|
+ }
|
|
|
+ if(dataMaps.get(37).toString() != null && !"".equals(dataMaps.get(37).toString())){
|
|
|
+ baseStudent.setIsFloatingPopulation(YesOrNoEnum.getCode(dataMaps.get(37).toString()));//是否流动人口
|
|
|
+ }
|
|
|
+ if(dataMaps.get(38).toString() != null && !"".equals(dataMaps.get(38).toString())){
|
|
|
+ baseStudent.setHeight(Double.parseDouble(dataMaps.get(38).toString()));//身高
|
|
|
+ }
|
|
|
+ if(dataMaps.get(39).toString() != null && !"".equals(dataMaps.get(39).toString())){
|
|
|
+ baseStudent.setWeight(Double.parseDouble(dataMaps.get(39).toString()));//体重
|
|
|
+ }
|
|
|
+ if(dataMaps.get(40).toString() != null && !"".equals(dataMaps.get(40).toString())){
|
|
|
+ baseStudent.setVision(Double.parseDouble(dataMaps.get(40).toString()));//视力
|
|
|
+ }
|
|
|
+ if(dataMaps.get(41).toString() != null && !"".equals(dataMaps.get(41).toString())){
|
|
|
+ baseStudent.setSpecialty(dataMaps.get(41).toString());//特长
|
|
|
+ }
|
|
|
+ if(dataMaps.get(42).toString() != null && !"".equals(dataMaps.get(42).toString())){
|
|
|
+ user.setQqNumber(dataMaps.get(42).toString());//QQ&MSN
|
|
|
+ }
|
|
|
+ if(dataMaps.get(43).toString() != null && !"".equals(dataMaps.get(43).toString())){
|
|
|
+ user.setWechatNumber(dataMaps.get(43).toString());//微信号码
|
|
|
+ }
|
|
|
+ if(dataMaps.get(43).toString() != null && !"".equals(dataMaps.get(43).toString())){
|
|
|
+ user.setWechatNumber(dataMaps.get(43).toString());//微信号码
|
|
|
+ }
|
|
|
+// if(dataMaps.get(44).toString() != null && !"".equals(dataMaps.get(44).toString())){
|
|
|
+// user.setWechatNumber(dataMaps.get(44).toString());//个人主页
|
|
|
+// }
|
|
|
+ if(dataMaps.get(45).toString() != null && !"".equals(dataMaps.get(45).toString())){
|
|
|
+ schoolRoll.setRollNumber(dataMaps.get(45).toString());//学籍号
|
|
|
+ }
|
|
|
+ if(dataMaps.get(46).toString() != null && !"".equals(dataMaps.get(46).toString())){
|
|
|
+ schoolRoll.setArchivesNumber(dataMaps.get(46).toString());//学生档案编号
|
|
|
+ }
|
|
|
+ if(dataMaps.get(47).toString() != null && !"".equals(dataMaps.get(47).toString())){
|
|
|
+ schoolRoll.setEnrollmentDate(sdf.parse(dataMaps.get(47).toString()));//入学年月
|
|
|
+ }
|
|
|
+ if(dataMaps.get(48).toString() != null && !"".equals(dataMaps.get(48).toString())){
|
|
|
+ schoolRoll.setEnrollmentType(dictionary.get(dataMaps.get(48).toString()));//入学方式
|
|
|
+ }
|
|
|
+ if(dataMaps.get(49).toString() != null && !"".equals(dataMaps.get(49).toString())){
|
|
|
+ schoolRoll.setGradeId(gradeMap.get(dataMaps.get(49).toString()));//入学年级
|
|
|
+ }
|
|
|
+ if(dataMaps.get(50).toString() != null && !"".equals(dataMaps.get(50).toString())){
|
|
|
+ schoolRoll.setEnrollType(dictionary.get(dataMaps.get(50).toString()));//入学招生类型
|
|
|
+ }
|
|
|
+ if(dataMaps.get(51).toString() != null && !"".equals(dataMaps.get(51).toString())){
|
|
|
+ schoolRoll.setMajorSetId(majorSetMap.get(dataMaps.get(51).toString()));//在读专业方向
|
|
|
+ }
|
|
|
+ if(dataMaps.get(52).toString() != null && !"".equals(dataMaps.get(52).toString())){
|
|
|
+ schoolRoll.setStudyYear(Double.parseDouble(dataMaps.get(52).toString()));//学制
|
|
|
+ }
|
|
|
+ if(dataMaps.get(53).toString() != null && !"".equals(dataMaps.get(53).toString())){
|
|
|
+ schoolRoll.setClassId(classMap.get(dataMaps.get(53).toString()));//班级
|
|
|
+ }
|
|
|
+ if(dataMaps.get(54).toString() != null && !"".equals(dataMaps.get(54).toString())){
|
|
|
+ schoolRoll.setStudentSource(dictionary.get(dataMaps.get(54).toString()));//学生来源
|
|
|
+ }
|
|
|
+ if(dataMaps.get(55).toString() != null && !"".equals(dataMaps.get(55).toString())){
|
|
|
+ schoolRoll.setStudentType(dictionary.get(dataMaps.get(55).toString()));//学生类别
|
|
|
+ }
|
|
|
+ if(dataMaps.get(56).toString() != null && !"".equals(dataMaps.get(56).toString())){
|
|
|
+ schoolRoll.setArchivesStatus(dictionary.get(dataMaps.get(56).toString()));//学籍状态
|
|
|
+ }
|
|
|
+ if(dataMaps.get(57).toString() != null && !"".equals(dataMaps.get(57).toString())){
|
|
|
+ schoolRoll.setLearnStatus(dictionary.get(dataMaps.get(57).toString()));//学习形式
|
|
|
+ }
|
|
|
+ if(dataMaps.get(58).toString() != null && !"".equals(dataMaps.get(58).toString())){
|
|
|
+ schoolRoll.setStduyStatus(dictionary.get(dataMaps.get(58).toString()));//就读方式
|
|
|
+ }
|
|
|
+ if(dataMaps.get(59).toString() != null && !"".equals(dataMaps.get(59).toString())){
|
|
|
+ schoolRoll.setChooseStatus(dictionary.get(dataMaps.get(59).toString()));//分流状态
|
|
|
+ }
|
|
|
+ if(dataMaps.get(60).toString() != null && !"".equals(dataMaps.get(60).toString())){
|
|
|
+ schoolRoll.setFosterType(dictionary.get(dataMaps.get(60).toString()));//分段培养方式
|
|
|
+ }
|
|
|
+ if(dataMaps.get(61).toString() != null && !"".equals(dataMaps.get(61).toString())){
|
|
|
+ schoolRoll.setRecruitType(dictionary.get(dataMaps.get(61).toString()));//招生类型
|
|
|
+ }
|
|
|
+ if(dataMaps.get(62).toString() != null && !"".equals(dataMaps.get(62).toString())){
|
|
|
+ schoolRoll.setRecruitTarget(dictionary.get(dataMaps.get(62).toString()));//招生对象
|
|
|
+ }
|
|
|
+ if(dataMaps.get(63).toString() != null && !"".equals(dataMaps.get(63).toString())){
|
|
|
+ schoolRoll.setHighestEducation(dictionary.get(dataMaps.get(63).toString()));//入学前最高学历
|
|
|
+ }
|
|
|
+ if(dataMaps.get(64).toString() != null && !"".equals(dataMaps.get(64).toString())){
|
|
|
+ schoolRoll.setGraduatedUniversity(dataMaps.get(64).toString());//入学前毕业院校
|
|
|
+ }
|
|
|
+ if(dataMaps.get(65).toString() != null && !"".equals(dataMaps.get(65).toString())){
|
|
|
+ schoolRoll.setGraduatedScore(Double.parseDouble(dataMaps.get(65).toString()));//入学前毕业成绩
|
|
|
+ }
|
|
|
+ if(dataMaps.get(66).toString() != null && !"".equals(dataMaps.get(66).toString())){
|
|
|
+ schoolRoll.setExamineeNumber(dataMaps.get(66).toString());//入学考试准考证号
|
|
|
+ }
|
|
|
+ if(dataMaps.get(67).toString() != null && !"".equals(dataMaps.get(67).toString())){
|
|
|
+ schoolRoll.setTicketNumber(dataMaps.get(67).toString());//入学考试准考证号
|
|
|
+ }
|
|
|
+ if(dataMaps.get(68).toString() != null && !"".equals(dataMaps.get(68).toString())){
|
|
|
+ schoolRoll.setAdmissionScores(Double.parseDouble(dataMaps.get(68).toString()));//入学考试成绩
|
|
|
+ }
|
|
|
+ if(dataMaps.get(69).toString() != null && !"".equals(dataMaps.get(69).toString())){
|
|
|
+ schoolRoll.setRemark(dataMaps.get(69).toString());//备注
|
|
|
+ }
|
|
|
+ if(dataMaps.get(69).toString() != null && !"".equals(dataMaps.get(69).toString())){
|
|
|
+ schoolRoll.setRemark(dataMaps.get(69).toString());//备注
|
|
|
+ }
|
|
|
|
|
|
+ if(dataMaps.get(70).toString() != null && !"".equals(dataMaps.get(70).toString())){
|
|
|
+ subsidize.setIsIndemnify(YesOrNoEnum.getCode(dataMaps.get(70).toString()));//是否低保户
|
|
|
+ }
|
|
|
+ if(dataMaps.get(71).toString() != null && !"".equals(dataMaps.get(71).toString())){
|
|
|
+ subsidize.setIsStipend(YesOrNoEnum.getCode(dataMaps.get(71).toString()));//是否享受国家助学金
|
|
|
+ }
|
|
|
+ if(dataMaps.get(72).toString() != null && !"".equals(dataMaps.get(72).toString())){
|
|
|
+ subsidize.setStipendStand(Double.parseDouble(dataMaps.get(72).toString()));//助学金发放标准(元)
|
|
|
+ }
|
|
|
+ if(dataMaps.get(73).toString() != null && !"".equals(dataMaps.get(73).toString())){
|
|
|
+ subsidize.setStipendNumber(dataMaps.get(73).toString());//学生资助卡号
|
|
|
+ }
|
|
|
+ if(dataMaps.get(74).toString() != null && !"".equals(dataMaps.get(74).toString())){
|
|
|
+ subsidize.setIsFree(YesOrNoEnum.getCode(dataMaps.get(74).toString()));//是否免学费
|
|
|
+ }
|
|
|
+ if(dataMaps.get(75).toString() != null && !"".equals(dataMaps.get(75).toString())){
|
|
|
+ subsidize.setIsFilingCard(YesOrNoEnum.getCode(dataMaps.get(75).toString()));//是否建档立卡
|
|
|
+ }
|
|
|
+ if(dataMaps.get(76).toString() != null && !"".equals(dataMaps.get(76).toString())){
|
|
|
+ studentFamily.setZipCode(dataMaps.get(76).toString());//家庭邮编
|
|
|
+ }
|
|
|
+ if(dataMaps.get(77).toString() != null && !"".equals(dataMaps.get(77).toString())){
|
|
|
+ studentFamily.setTelephone(dataMaps.get(77).toString());//家庭电话
|
|
|
+ }
|
|
|
+ if(dataMaps.get(78).toString() != null && !"".equals(dataMaps.get(78).toString())){
|
|
|
+ studentFamily.setContact(dataMaps.get(76).toString());//联系人姓名
|
|
|
+ }
|
|
|
+ if(dataMaps.get(79).toString() != null && !"".equals(dataMaps.get(79).toString())){
|
|
|
+ studentFamily.setPopulation(Integer.parseInt(dataMaps.get(76).toString()));//家庭人口
|
|
|
+ }
|
|
|
+ if(dataMaps.get(80).toString() != null && !"".equals(dataMaps.get(80).toString())){
|
|
|
+ studentFamily.setAddress(dataMaps.get(80).toString());//家庭地址
|
|
|
+ }
|
|
|
+ if(dataMaps.get(81).toString() != null && !"".equals(dataMaps.get(81).toString())){
|
|
|
+ studentFamily.setIncomeSource(dataMaps.get(81).toString());//家庭主要收入来源
|
|
|
+ }
|
|
|
+ if(dataMaps.get(82).toString() != null && !"".equals(dataMaps.get(82).toString())){
|
|
|
+ studentFamily.setIncomeNumber(Double.parseDouble(dataMaps.get(82).toString()));//家庭月收入(元)
|
|
|
+ }
|
|
|
+ if(dataMaps.get(83).toString() != null && !"".equals(dataMaps.get(83).toString())){
|
|
|
+ studentFamily.setRailwayStation(dataMaps.get(83).toString());//离家最近火车站
|
|
|
+ }
|
|
|
if(studentUserMap.containsKey(credentialNumber)){
|
|
|
updateStudentUserList.add(user);
|
|
|
updateBaseStudentList.add(baseStudent);
|
|
|
+ updateSchoolRollList.add(schoolRoll);
|
|
|
+ updateSubsidizeList.add(subsidize);
|
|
|
+ updateFamilyList.add(studentFamily);
|
|
|
}else{
|
|
|
-
|
|
|
+ insertStudentUserList.add(user);
|
|
|
+ insertBaseStudentList.add(baseStudent);
|
|
|
+ insertSchoolRollList.add(schoolRoll);
|
|
|
+ insertSubsidizeList.add(subsidize);
|
|
|
+ insertFamilyList.add(studentFamily);
|
|
|
}
|
|
|
}
|
|
|
- return null;
|
|
|
+ //批量修改
|
|
|
+ if(!updateStudentUserList.isEmpty()){
|
|
|
+ this.updateBatchById(updateStudentUserList);
|
|
|
+ }
|
|
|
+ if(!updateSchoolRollList.isEmpty()){
|
|
|
+ schoolRollService.updateBatchById(updateSchoolRollList);
|
|
|
+ }
|
|
|
+ if(!updateSubsidizeList.isEmpty()){
|
|
|
+ subsidizeService.updateBatchById(updateSubsidizeList);
|
|
|
+ }
|
|
|
+ if(!updateFamilyList.isEmpty()){
|
|
|
+ familyService.updateBatchById(updateFamilyList);
|
|
|
+ }
|
|
|
+ if(!updateBaseStudentList.isEmpty()){
|
|
|
+ baseStudentService.updateBatchById(updateBaseStudentList);
|
|
|
+ }
|
|
|
+ //批量新增
|
|
|
+ if(!insertStudentUserList.isEmpty()){
|
|
|
+ this.saveBatch(insertStudentUserList);
|
|
|
+ }
|
|
|
+ if(!insertBaseStudentList.isEmpty()){
|
|
|
+ baseStudentService.saveBatch(insertBaseStudentList);
|
|
|
+ }
|
|
|
+ if(!insertSubsidizeList.isEmpty()){
|
|
|
+ subsidizeService.saveBatch(insertSubsidizeList);
|
|
|
+ }
|
|
|
+ if(!insertFamilyList.isEmpty()){
|
|
|
+ familyService.saveBatch(insertFamilyList);
|
|
|
+ }
|
|
|
+ if(!insertSchoolRollList.isEmpty()){
|
|
|
+ schoolRollService.saveBatch(insertSchoolRollList);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -461,7 +812,14 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
|
|
|
codeList.add("credential_type");codeList.add("nation");
|
|
|
codeList.add("blood_type");codeList.add("health");
|
|
|
codeList.add("marital_state");codeList.add("political_state");
|
|
|
- codeList.add("nationality");
|
|
|
+ codeList.add("nationality");codeList.add("chinese_type");
|
|
|
+ codeList.add("house_hold_type");codeList.add("residence_type");
|
|
|
+ codeList.add("enrollment_type");codeList.add("enroll_type");
|
|
|
+ codeList.add("student_type");codeList.add("archives_status");
|
|
|
+ codeList.add("learn_status");codeList.add("stduy_status");
|
|
|
+ codeList.add("choose_status");codeList.add("foster_type");
|
|
|
+ codeList.add("recruit_type");codeList.add("recruit_target");
|
|
|
+ codeList.add("education");codeList.add("recruit_target");
|
|
|
List<DictionaryDetail> detailList = dictionarydetailMapper.selectJoinList(DictionaryDetail.class,
|
|
|
new MPJLambdaWrapper<DictionaryDetail>()
|
|
|
.leftJoin(DictionaryItem.class, DictionaryItem::getId, DictionaryDetail::getItemId)
|