Ver código fonte

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 4 meses atrás
pai
commit
89dc139970
53 arquivos alterados com 1021 adições e 134 exclusões
  1. 31 0
      src/main/java/com/xjrsoft/common/utils/ImageUtil.java
  2. 3 0
      src/main/java/com/xjrsoft/module/banding/dto/AddBandingTaskClassDto.java
  3. 6 0
      src/main/java/com/xjrsoft/module/banding/dto/BandingTaskClassStudentPageDto.java
  4. 3 0
      src/main/java/com/xjrsoft/module/banding/entity/BandingTaskClass.java
  5. 17 4
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java
  6. 8 1
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java
  7. 49 16
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java
  8. 3 0
      src/main/java/com/xjrsoft/module/banding/vo/BandingTaskClassPageVo.java
  9. 24 0
      src/main/java/com/xjrsoft/module/banding/vo/IdManyCountVo.java
  10. 26 5
      src/main/java/com/xjrsoft/module/base/controller/WhitelistManagementController.java
  11. 1 1
      src/main/java/com/xjrsoft/module/base/dto/AddWhitelistManagementDto.java
  12. 57 0
      src/main/java/com/xjrsoft/module/base/entity/BaseUserStudent.java
  13. 1 1
      src/main/java/com/xjrsoft/module/base/entity/WhitelistManagement.java
  14. 13 0
      src/main/java/com/xjrsoft/module/base/mapper/BaseUserStudentMapper.java
  15. 1 1
      src/main/java/com/xjrsoft/module/base/mapper/WhitelistManagementMapper.java
  16. 7 0
      src/main/java/com/xjrsoft/module/base/service/IBaseUserStudentService.java
  17. 3 2
      src/main/java/com/xjrsoft/module/base/service/IWhitelistManagementService.java
  18. 10 1
      src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java
  19. 17 0
      src/main/java/com/xjrsoft/module/base/service/impl/IBaseUserStudentServiceImpl.java
  20. 29 26
      src/main/java/com/xjrsoft/module/base/service/impl/WhitelistManagementServiceImpl.java
  21. 1 1
      src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java
  22. 0 2
      src/main/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNode.java
  23. 20 5
      src/main/java/com/xjrsoft/module/organization/controller/UserController.java
  24. 9 0
      src/main/java/com/xjrsoft/module/organization/vo/UserInfoVo.java
  25. 4 0
      src/main/java/com/xjrsoft/module/organization/vo/UserStudentInfoVo.java
  26. 9 0
      src/main/java/com/xjrsoft/module/organization/vo/UserStudentVo.java
  27. 10 25
      src/main/java/com/xjrsoft/module/personnel/controller/FaceManagementController.java
  28. 14 5
      src/main/java/com/xjrsoft/module/personnel/controller/StundentFaceProcessController.java
  29. 1 1
      src/main/java/com/xjrsoft/module/personnel/controller/TeacherFaceProcessController.java
  30. 4 0
      src/main/java/com/xjrsoft/module/personnel/service/IStundentFaceProcessService.java
  31. 60 1
      src/main/java/com/xjrsoft/module/personnel/service/impl/StundentFaceProcessServiceImpl.java
  32. 116 5
      src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java
  33. 0 6
      src/main/java/com/xjrsoft/module/student/controller/BaseStudentInfoController.java
  34. 84 0
      src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java
  35. 32 0
      src/main/java/com/xjrsoft/module/student/dto/ActiveAccountDto.java
  36. 3 0
      src/main/java/com/xjrsoft/module/student/dto/BaseStudentSimpleInfoDto.java
  37. 11 2
      src/main/java/com/xjrsoft/module/student/dto/BaseStudentUserPageDto.java
  38. 151 0
      src/main/java/com/xjrsoft/module/student/entity/BaseMajor.java
  39. 2 2
      src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java
  40. 16 0
      src/main/java/com/xjrsoft/module/student/mapper/BaseMajorMapper.java
  41. 2 1
      src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java
  42. 14 0
      src/main/java/com/xjrsoft/module/student/service/IBaseMajorService.java
  43. 2 1
      src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java
  44. 19 0
      src/main/java/com/xjrsoft/module/student/service/impl/BaseMajorServiceImpl.java
  45. 7 7
      src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java
  46. 15 2
      src/main/java/com/xjrsoft/module/student/vo/BaseClassMajorSetVo.java
  47. 32 0
      src/main/java/com/xjrsoft/module/student/vo/BaseDepMajorGradeClassStudenTreeVo.java
  48. 14 0
      src/main/java/com/xjrsoft/module/student/vo/BaseStudentSompleInfoVo.java
  49. 9 3
      src/main/resources/mapper/banding/BandingTaskClassMapper.xml
  50. 1 1
      src/main/resources/mapper/base/WhitelistManagement.xml
  51. 12 2
      src/main/resources/mapper/organization/UserMapper.xml
  52. 24 2
      src/main/resources/mapper/student/BaseNewStudentMapper.xml
  53. 14 2
      src/main/resources/mapper/student/BaseStudentMapper.xml

+ 31 - 0
src/main/java/com/xjrsoft/common/utils/ImageUtil.java

@@ -1,5 +1,11 @@
 package com.xjrsoft.common.utils;
 
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.xjrsoft.common.exception.MyException;
+import org.apache.commons.lang3.StringUtils;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.web.multipart.MultipartFile;
+
 import javax.imageio.ImageIO;
 import javax.imageio.stream.FileImageOutputStream;
 import java.awt.*;
@@ -14,6 +20,8 @@ import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Base64;
+import java.util.HashMap;
+import java.util.Map;
 
 public class ImageUtil {
     public static byte[] getByteByPic(String imageUrl) throws IOException {
@@ -107,4 +115,27 @@ public class ImageUtil {
                 .replace("data:image/png;base64,", "");
     }
 
+    // 图片处理
+    public static String ImageHandler(@NotNull MultipartFile file) throws IOException {
+        String filename = file.getOriginalFilename();
+        String suffix = StringUtils.substringAfterLast(filename, StringPool.DOT);
+        String[] imgSuffix = new String[]{"png", "jpg", "jpeg"};
+
+        if (!Arrays.asList(imgSuffix).contains(suffix)) {
+            throw new MyException("图片格式不正确!");
+        }
+        Map<String, String> map = new HashMap<String, String>() {
+            {
+                put("jpg", "data:image/jpg;base64,");
+                put("jpeg", "data:image/jpeg;base64,");
+                put("png", "data:image/png;base64,");
+            }
+        };
+
+        Long maxSize = 1048576L; // 最大文件1M
+        byte[] resultImg = ImageUtil.compressUnderSize(file.getBytes(), maxSize);
+
+        return map.get(suffix) + ImageUtil.bytesEncode2Base64(resultImg);
+    }
+
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/banding/dto/AddBandingTaskClassDto.java

@@ -68,4 +68,7 @@ public class AddBandingTaskClassDto implements Serializable {
     @ApiModelProperty("分班任务id")
     private Long bandingTaskId;
 
+    @ApiModelProperty("班级类型")
+    private String classType;
+
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/banding/dto/BandingTaskClassStudentPageDto.java

@@ -45,4 +45,10 @@ public class BandingTaskClassStudentPageDto extends PageInput {
 
     @ApiModelProperty("年级id")
     private Long gradeId;
+
+    @ApiModelProperty("第二志愿")
+    private Long secondAmbition;
+
+    @ApiModelProperty("第一志愿")
+    private Long firstAmbition;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/banding/entity/BandingTaskClass.java

@@ -119,4 +119,7 @@ public class BandingTaskClass implements Serializable {
     @ApiModelProperty("分班任务(banding_task)")
     private Long bandingTaskId;
 
+    @ApiModelProperty("班级类型")
+    private String classType;
+
 }

+ 17 - 4
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -24,6 +24,9 @@ import com.xjrsoft.module.base.service.IBaseClassroomService;
 import com.xjrsoft.module.base.service.IBaseMajorSetService;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.service.IUserService;
+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.teacher.entity.BaseTeacher;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
@@ -51,6 +54,7 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
     private final IBaseClassroomService classroomService;
     private final IUserService userService;
     private final IBaseMajorSetService majorSetService;
+    private final DictionarydetailMapper detailMapper;
     @Override
     public Boolean add(BandingTaskClass bandingTaskClass) {
         bandingTaskClass.setCreateDate(new Date());
@@ -146,8 +150,14 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
         for (BaseMajorSet majorSet : majorSetList) {
             majorSetMap.put(majorSet.getName(), majorSet.getId());
         }
-
-
+        List<DictionaryDetail> classType = detailMapper.selectJoinList(DictionaryDetail.class,
+                new MPJLambdaWrapper<DictionaryDetail>()
+                        .select(DictionaryDetail::getId)
+                        .select(DictionaryDetail.class, x -> VoToColumnUtil.fieldsToColumns(DictionaryDetail.class).contains(x.getProperty()))
+                        .innerJoin(DictionaryItem.class, DictionaryItem::getId, DictionaryDetail::getItemId)
+                        .eq(DictionaryItem::getCode, "class_type")
+        );
+        Map<String, String> classTypeMap = classType.stream().collect(Collectors.toMap(DictionaryDetail::getName, DictionaryDetail::getCode));
         List<BandingTaskClass> classList = new ArrayList<>();
         Date createDate = new Date();
         for (Map<Integer, Object> taskClass : excelDataList) {
@@ -159,10 +169,13 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
                 setNumber(Integer.parseInt(taskClass.get(2).toString()));
                 setClassroomId(classroomMap.get(taskClass.get(4).toString()));
                 if(taskClass.get(5) != null){
-                    setIsOrderClass(YesOrNoEnum.getCode(taskClass.get(5).toString()));
+                    setClassType(classTypeMap.get(taskClass.get(5).toString()));
                 }
                 if(taskClass.get(6) != null){
-                    setSortCode(Integer.parseInt(taskClass.get(6).toString()));
+                    setIsOrderClass(YesOrNoEnum.getCode(taskClass.get(6).toString()));
+                }
+                if(taskClass.get(7) != null){
+                    setSortCode(Integer.parseInt(taskClass.get(7).toString()));
                 }
                 setTeacherId(userMap.get(taskClass.get(3).toString()));
             }});

+ 8 - 1
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java

@@ -8,6 +8,7 @@ import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.RoleEnum;
+import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto;
 import com.xjrsoft.module.banding.dto.ChangeClassDto;
@@ -110,6 +111,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
                         setNewStudentId(newStudentId);
                         setBandingTaskClassId(dto.getBandingTaskClassId());
                         setCreateUserId(createUserId);
+                        setStatus(0);
                         if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
                             setStatus(1);
                         }
@@ -268,7 +270,12 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
 
         // 将字符串解析为LocalDate对象
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-        return LocalDate.parse(birthdayString, formatter);
+        try {
+            LocalDate parse = LocalDate.parse(birthdayString, formatter);
+            return parse;
+        }catch (Exception e){
+            throw new MyException("身份证号填写错误,无法提取出生日期");
+        }
     }
 
     @Override

+ 49 - 16
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -42,6 +42,7 @@ import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import com.xjrsoft.module.organization.service.IUserRoleRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.outint.vo.IdCountVo;
+import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.student.entity.BaseClassMajorSet;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.entity.BaseStudent;
@@ -174,18 +175,38 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         );
         List<String> ruleCodes = ruleList.stream().map(BandingRule::getCode).collect(Collectors.toList());
 
+        //查询每个专业符合限制条件的人数
+        List<IdManyCountVo> majorStudentCountList = newStudentService.getMajorStudentCount(bandingTask.getId());
+        Map<Long, IdManyCountVo> majorStudentCountMap = majorStudentCountList.stream().collect(Collectors.toMap(IdManyCountVo::getId, x -> x));
+        //查询每个专业下面有多少个班级
+        List<IdCountVo> majorClassCountList = taskClassMapper.getMajorClassCount(bandingTask.getId());
+        Map<Long, Integer> majorClassCount = majorClassCountList.stream().collect(Collectors.toMap(IdCountVo::getId, IdCountVo::getCount));
+        //计算每个专业平均的男女人数
+        Map<Long, Integer> majorMaleCountMap = new HashMap<>();
+        Map<Long, Integer> majorFemaleCountMap = new HashMap<>();
+        if(ruleCodes.contains("BR0001")){
+            for (Long majorSetId : majorClassCount.keySet()) {
+                int classCount = majorClassCount.get(majorSetId);
+                Integer maleCount = majorStudentCountMap.get(majorSetId).getMaleCount();
+                Integer femaleCount = majorStudentCountMap.get(majorSetId).getFemaleCount();
+                if(classCount == 1 || classCount == 0){
+                    majorMaleCountMap.put(majorSetId, maleCount);
+                    majorFemaleCountMap.put(majorSetId, femaleCount);
+                    continue;
+                }
+                majorMaleCountMap.put(majorSetId, maleCount / classCount);
+                majorFemaleCountMap.put(majorSetId, femaleCount / classCount);
+            }
+        }
+
         //包含下面个条件,则需要计算每个班级应该分配的人数
         Map<Long, Integer> classLimitMap = new HashMap<>();
         if(ruleCodes.contains("BR0004")){
-            //查询每个专业下面有多少个班级
-            List<IdCountVo> majorClassCountList = taskClassMapper.getMajorClassCount(bandingTask.getId());
-            Map<Long, Integer> majorClassCount = majorClassCountList.stream().collect(Collectors.toMap(IdCountVo::getId, IdCountVo::getCount));
             //查询每个专业下面的班级人数
             Map<Long, Integer> majorClassStudentCount = taskClassMapper.getMajorClassStudentCount(bandingTask.getId())
                     .stream().collect(Collectors.toMap(IdCountVo::getId, IdCountVo::getCount));
-            //查询每个专业人数
-            Map<Long, Integer> majorStudentCount = newStudentService.getMajorStudentCount()
-                    .stream().collect(Collectors.toMap(IdCountVo::getId, IdCountVo::getCount));
+
+            Map<Long, Integer> majorStudentCount = majorStudentCountList.stream().collect(Collectors.toMap(IdManyCountVo::getId, IdManyCountVo::getCount));
 
             Map<Long, Integer> majorLimitMap = new HashMap<>();
             for (Long majorSetId : majorClassStudentCount.keySet()) {
@@ -193,6 +214,9 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 if(majorClassStudentCount.get(majorSetId) != null){
                     majorClassNumber = majorClassStudentCount.get(majorSetId);
                 }
+                if(majorClassCount.get(majorSetId) == 1 || majorClassCount.get(majorSetId) == 0){
+                    continue;
+                }
                 int majorStudentNumber = 0;
                 if(majorStudentCount.get(majorSetId) != null){
                     majorStudentNumber = majorStudentCount.get(majorSetId);
@@ -211,6 +235,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 classLimitMap.put(bandingTaskClass.getId(), majorLimitMap.get(bandingTaskClass.getMajorSetId()));
             }
         }
+
         //查询每个专业的限制条件
         List<BandingTaskMajorCondition> list = conditionService.list(
                 new QueryWrapper<BandingTaskMajorCondition>().lambda()
@@ -225,6 +250,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         if(ruleCodes.contains("BR0002")){
             classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList));
         }
+
         //存班级和学生的关系
         Map<Long, Long> studentClassMap = new HashMap<>();
         Map<Long, List<String>> classNameMap = new HashMap<>();
@@ -238,6 +264,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
             }
             Integer maleCount = 0, femaleCount = 0;
             if(ruleCodes.contains("BR0001")){
+                IdManyCountVo countVo = majorStudentCountMap.get(taskClass.getMajorSetId());
                 maleCount = number / 2;
                 femaleCount = number / 2;
                 //如果班级人数是奇数,随机分配一个名额
@@ -252,6 +279,13 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                         femaleCount ++ ;
                     }
                 }
+                if(majorMaleCountMap.get(taskClass.getMajorSetId()) < maleCount){
+                    maleCount = countVo.getMaleCount();
+                    femaleCount = number - maleCount;
+                }else if(majorFemaleCountMap.get(taskClass.getMajorSetId()) < femaleCount){
+                    femaleCount = countVo.getFemaleCount();
+                    maleCount = number - femaleCount;
+                }
             }
             List<String> nameList = new ArrayList<>();
             List<BaseNewStudent> maleList = new ArrayList();//男生
@@ -280,7 +314,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
                     continue;
                 }
-                //判断该班性别是否已满
+                //判断该班性别是否已满,如果设置了排序,即使性别满了班级人数没满继续分班
                 if(ruleCodes.contains("BR0001")){
                     if(GenderDictionaryEnum.MALE.getCode().equals(newStudent.getGender()) && maleList.size() == maleCount){
                         continue;
@@ -339,14 +373,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
             if(nameList.size() == number){
                 continue;
             }
-            List<BaseNewStudent> studentList = new ArrayList<>();
-            studentList.addAll(baseNewStudents);
-            if(ruleCodes.contains("BR0002") && classStudentMap.get(taskClass.getMajorSetId()) != null && !classStudentMap.get(taskClass.getMajorSetId()).isEmpty()){
-                studentList.clear();
-                studentList.addAll(classStudentMap.get(taskClass.getMajorSetId()));
-            }
-
-            for (BaseNewStudent newStudent : studentList) {
+            for (BaseNewStudent newStudent : baseNewStudents) {
                 //人数已满,进行下一个班级的的循环
                 if(nameList.size() == number){
                     break;
@@ -652,6 +679,12 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
 
         // 将字符串解析为LocalDate对象
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-        return LocalDate.parse(birthdayString, formatter);
+
+        try {
+            LocalDate parse = LocalDate.parse(birthdayString, formatter);
+            return parse;
+        }catch (Exception e){
+            throw new MyException("身份证号填写错误,无法提取出生日期");
+        }
     }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/banding/vo/BandingTaskClassPageVo.java

@@ -65,4 +65,7 @@ public class BandingTaskClassPageVo {
     @ApiModelProperty("教室名称")
     private String classroomName;
 
+    @ApiModelProperty("班级类型")
+    private String classType;
+
 }

+ 24 - 0
src/main/java/com/xjrsoft/module/banding/vo/IdManyCountVo.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.banding.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author dzx
+ * @date 2024/7/13
+ */
+@Data
+public class IdManyCountVo {
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+    @ApiModelProperty("数量")
+    private Integer count;
+
+    @ApiModelProperty("男生数量")
+    private Integer maleCount;
+
+    @ApiModelProperty("女生数量")
+    private Integer femaleCount;
+}

+ 26 - 5
src/main/java/com/xjrsoft/module/base/controller/WhitelistManagementController.java

@@ -34,8 +34,9 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Date;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 
 /**
@@ -124,10 +125,30 @@ public class WhitelistManagementController {
 
     @PostMapping("/import")
     @ApiOperation(value = "导入")
-    public RT<Boolean> importData(@RequestParam MultipartFile file) throws IOException {
-        List<WhitelistManagementPageVo> savedDataList = EasyExcel.read(file.getInputStream()).headRowNumber(3).head(WhitelistManagementPageVo.class).sheet().doReadSync();
-        Boolean b = whitelistManagementService.importData(savedDataList);
-        return RT.ok(b);
+    public RT<List<Map<String, String>>> importData(@RequestParam MultipartFile file) throws IOException {
+        List<Map<Integer, Object>> excelDataList = EasyExcel.read(file.getInputStream()).sheet().headRowNumber(3).doReadSync();
+        List<Map<Integer, Object>> errorList = whitelistManagementService.importData(excelDataList);
+        List<Map<String, String>> result = new ArrayList<>();
+
+        for (Map<Integer, Object> objectMap : errorList) {
+            Map<String, String> object = new LinkedHashMap<>();
+            List<String> errorMsg = new ArrayList<>();
+            if(objectMap.get(0) == null){
+                errorMsg.add("姓名未填写");
+            }
+            if(objectMap.get(1) == null){
+                errorMsg.add("身份证未填写");
+            }
+            if(objectMap.get(2) == null){
+                errorMsg.add("手机号未填写");
+            }
+            object.put("姓名", objectMap.get(0)==null?"":objectMap.get(0).toString());
+            object.put("身份证", objectMap.get(1)==null?"":objectMap.get(1).toString());
+            object.put("手机号", objectMap.get(13)==null?"":objectMap.get(13).toString());
+            object.put("错误信息", errorMsg.toString().replace("[","").replace("]", ""));
+            result.add(object);
+        }
+        return RT.ok(result);
     }
 
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/base/dto/AddWhitelistManagementDto.java

@@ -43,6 +43,6 @@ public class AddWhitelistManagementDto implements Serializable {
     * 手机号
     */
     @ApiModelProperty("手机号")
-    private Long phone;
+    private String phone;
 
 }

+ 57 - 0
src/main/java/com/xjrsoft/module/base/entity/BaseUserStudent.java

@@ -0,0 +1,57 @@
+package com.xjrsoft.module.base.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 学生和家庭成员关系表
+ * </p>
+ *
+ */
+@Data
+@TableName("base_user_student")
+@ApiModel(value = "BaseUserStudent", description = "学生和家庭成员关系表")
+public class BaseUserStudent implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+    @ApiModelProperty("家长ID(xjr_user)")
+    private Long userId;
+
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+
+    @ApiModelProperty("修改时间")
+    private Date modifyDate;
+
+    @ApiModelProperty("家长手机号")
+    private String userPhone;
+
+    @ApiModelProperty("学生ID(xjr_user)")
+    private Long studentId;
+
+    @ApiModelProperty("学生姓名")
+    private String studentNane;
+
+    @ApiModelProperty("学生身份证号")
+    private String studentIdentity;
+
+    @ApiModelProperty("学生班级id(base_class)")
+    private Long classId;
+
+    @ApiModelProperty("学生班主任id(xjr_user)")
+    private Long teacher_id;
+
+    @ApiModelProperty("流程状态(0:审核中,1:通过,2:拒绝)")
+    private Integer status;
+
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/base/entity/WhitelistManagement.java

@@ -80,7 +80,7 @@ public class WhitelistManagement implements Serializable {
     * 手机号
     */
     @ApiModelProperty("手机号")
-    private Long phone;
+    private String phone;
 
 
 }

+ 13 - 0
src/main/java/com/xjrsoft/module/base/mapper/BaseUserStudentMapper.java

@@ -0,0 +1,13 @@
+package com.xjrsoft.module.base.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.entity.BaseUserStudent;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ */
+@Mapper
+public interface BaseUserStudentMapper extends MPJBaseMapper<BaseUserStudent> {
+
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/base/mapper/WhitelistManagementMapper.java

@@ -30,7 +30,7 @@ public interface WhitelistManagementMapper extends MPJBaseMapper<WhitelistManage
 
     String getCredentialNumber(String credentialNumber);
 
-    Long getPhone(long phone);
+    String getPhone(String phone);
 
     Long getUserId(String credentialNumber);
 

+ 7 - 0
src/main/java/com/xjrsoft/module/base/service/IBaseUserStudentService.java

@@ -0,0 +1,7 @@
+package com.xjrsoft.module.base.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.base.entity.BaseUserStudent;
+
+public interface IBaseUserStudentService extends MPJBaseService<BaseUserStudent> {
+}

+ 3 - 2
src/main/java/com/xjrsoft/module/base/service/IWhitelistManagementService.java

@@ -8,6 +8,7 @@ import com.xjrsoft.module.base.entity.WhitelistManagement;
 import com.xjrsoft.module.base.vo.WhitelistManagementPageVo;
 
 import java.util.List;
+import java.util.Map;
 
 /**
 * @title: 白名单管理
@@ -23,7 +24,7 @@ public interface IWhitelistManagementService extends MPJBaseService<WhitelistMan
 
     String GetCredentialNumber(String credentialNumber);
 
-    Long GetPhone(long l);
+    String GetPhone(String l);
 
     Long getUserId(String credentialNumber);
 
@@ -36,5 +37,5 @@ public interface IWhitelistManagementService extends MPJBaseService<WhitelistMan
      */
     void loadCaches();
 
-    Boolean importData(List<WhitelistManagementPageVo> savedDataList);
+    List<Map<Integer, Object>> importData(List<Map<Integer, Object>> savedDataList);
 }

+ 10 - 1
src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java

@@ -18,6 +18,7 @@ import com.xjrsoft.module.organization.vo.UserStudentVo;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.entity.BaseStudentUser;
+import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -48,11 +49,15 @@ public class BaseClassServiceImpl extends MPJBaseServiceImpl<BaseClassMapper, Ba
                     .disableSubLogicDel()
                     .rightJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getClassId, BaseStudent::getId)
                     .innerJoin(BaseStudentUser.class, BaseStudentUser::getId, BaseStudentSchoolRoll::getUserId)
+                    .leftJoin(XjrUser.class, XjrUser::getId, BaseClass::getTeacherId)
                     .in(BaseStudentSchoolRoll::getUserId, studentIds)
                     .selectAs(BaseClass::getName, UserStudentVo::getClassName)
                     .selectAs(BaseStudentUser::getName, UserStudentVo::getStudentName)
                     .selectAs(BaseStudentUser::getId, UserStudentVo::getStudentId)
                     .selectAs(BaseStudentSchoolRoll::getClassId, UserStudentVo::getClassId)
+                    .selectAs(XjrUser::getName, UserStudentVo::getTeacherName)
+                    .selectAs(XjrUser::getMobile, UserStudentVo::getTeacherMobile)
+                    .selectAs(XjrUser::getId, UserStudentVo::getTeacherId)
                     .selectAs(BaseStudentUser::getAvatar, UserStudentVo::getAvatar);
 
             list = selectJoinList(UserStudentVo.class, queryWrapper);
@@ -69,10 +74,14 @@ public class BaseClassServiceImpl extends MPJBaseServiceImpl<BaseClassMapper, Ba
         MPJLambdaWrapper<BaseClass> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper
                 .disableSubLogicDel()
-                .rightJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getClassId, BaseStudent::getId)
+                .innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getClassId, BaseStudent::getId)
                 .innerJoin(BaseStudentUser.class, BaseStudentUser::getId, BaseStudentSchoolRoll::getUserId)
+                .leftJoin(XjrUser.class, XjrUser::getId, BaseClass::getTeacherId)
                 .eq(BaseStudentSchoolRoll::getUserId, id)
                 .selectAs(BaseClass::getName, UserStudentVo::getClassName)
+                .selectAs(XjrUser::getName, UserStudentVo::getTeacherName)
+                .selectAs(XjrUser::getMobile, UserStudentVo::getTeacherMobile)
+                .selectAs(XjrUser::getId, UserStudentVo::getTeacherId)
                 .selectAs(BaseStudentUser::getName, UserStudentVo::getStudentName)
                 .selectAs(BaseStudentUser::getId, UserStudentVo::getStudentId)
                 .selectAs(BaseStudentSchoolRoll::getClassId, UserStudentVo::getClassId)

+ 17 - 0
src/main/java/com/xjrsoft/module/base/service/impl/IBaseUserStudentServiceImpl.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.base.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.base.entity.BaseUserStudent;
+import com.xjrsoft.module.base.mapper.BaseUserStudentMapper;
+import com.xjrsoft.module.base.service.IBaseUserStudentService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author dzx
+ * @date 2024/7/15
+ */
+@Service
+@AllArgsConstructor
+public class IBaseUserStudentServiceImpl extends MPJBaseServiceImpl<BaseUserStudentMapper, BaseUserStudent> implements IBaseUserStudentService {
+}

+ 29 - 26
src/main/java/com/xjrsoft/module/base/service/impl/WhitelistManagementServiceImpl.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.exception.MyException;
-import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.module.base.dto.WhitelistManagementPageDto;
 import com.xjrsoft.module.base.entity.TreeNode;
@@ -57,7 +56,7 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
     }
 
     @Override
-    public Long GetPhone(long phone) {
+    public String GetPhone(String phone) {
         return whitelistManagementMapper.getPhone(phone);
     }
 
@@ -111,32 +110,36 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
     }
 
     @Override
-    public Boolean importData(List<WhitelistManagementPageVo> savedDataList) {
+    public List<Map<Integer, Object>> importData(List<Map<Integer, Object>> savedDataList) {
+        List<Map<Integer, Object>> errorList = new ArrayList<>();
+
         List<WhitelistManagement> whitelistManagements = new ArrayList<>();
         List<String> errorLogs = new ArrayList<>();
 
-        for (WhitelistManagementPageVo vo : savedDataList) {
-            try {
-                if (this.checkExist(vo.getCredentialNumber())) continue;
-
-                String name = this.GetName(vo.getName()).toString();
-                String credentialNumber = this.GetCredentialNumber(vo.getCredentialNumber()).toString();
-                Long userId = this.getUserId(credentialNumber);
-                Long phone = this.GetPhone(Long.parseLong(vo.getPhone().toString()));
-
-                if (!name.isEmpty() && !credentialNumber.isEmpty() && !phone.toString().isEmpty()) {
-                    WhitelistManagement whitelistManagement = new WhitelistManagement();
-                    whitelistManagement.setCreateDate(new Date());
-                    whitelistManagement.setDeleteMark(0);
-                    whitelistManagement.setEnabledMark(0);
-                    whitelistManagement.setUserId(userId);
-                    whitelistManagement.setName(name);
-                    whitelistManagement.setCredentialNumber(credentialNumber);
-                    whitelistManagement.setPhone(phone);
-                    whitelistManagements.add(whitelistManagement);
-                }
-            } catch (Exception e) {
-                errorLogs.add(String.format("[意外错误(检查输入的是否正确且存在,输入错误可能返回 null)] 姓名: %s, 身份证: %s, 手机号: %s - 错误信息:%s", vo.getName(), vo.getCredentialNumber(), vo.getPhone(), e.getMessage()));
+        for (Map<Integer, Object> vo : savedDataList) {
+            if(vo.get(0) == null || vo.get(1) == null || vo.get(2) == null){
+                errorList.add(vo);
+                continue;
+            }
+            if (this.checkExist(vo.get(1).toString())) {
+                continue;
+            }
+
+            String name = this.GetName(vo.get(0).toString());
+            String credentialNumber = this.GetCredentialNumber(vo.get(1).toString());
+            Long userId = this.getUserId(credentialNumber);
+            String phone = this.GetPhone(vo.get(2).toString());
+
+            if (!name.isEmpty() && !credentialNumber.isEmpty() && !phone.isEmpty()) {
+                WhitelistManagement whitelistManagement = new WhitelistManagement();
+                whitelistManagement.setCreateDate(new Date());
+                whitelistManagement.setDeleteMark(0);
+                whitelistManagement.setEnabledMark(0);
+                whitelistManagement.setUserId(userId);
+                whitelistManagement.setName(name);
+                whitelistManagement.setCredentialNumber(credentialNumber);
+                whitelistManagement.setPhone(phone);
+                whitelistManagements.add(whitelistManagement);
             }
         }
 
@@ -151,6 +154,6 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
             throw new MyException(detailedMessage);
         }
 
-        return result;
+        return errorList;
     }
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java

@@ -655,7 +655,7 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
                             //删除子表单数据
                             Entity childDeleteWhere = Entity.create(tableConfig.getTableName()).
                                     set(childTableConfig.get().getRelationField(), keyValues);
-                            Boolean result = SqlRunnerAdapter.db().dynamicDelete(tableName, childDeleteWhere);
+                            Boolean result = SqlRunnerAdapter.db().dynamicDelete(childTableConfig.get().getTableName(), childDeleteWhere);
                             if (!result) {
                                 throw new MyException("删除数据失败");
                             }

+ 0 - 2
src/main/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNode.java

@@ -41,8 +41,6 @@ public class ImportStudentFaceNode extends NodeComponent {
             String result = FaceImportUtil.ImportStudentFace(hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId()), fileUrl);
             dataObj.setHikvisionResult(result);
             stundentFaceProcessService.updateById(dataObj);
-
-
         }
     }
 }

+ 20 - 5
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -29,13 +29,12 @@ import com.xjrsoft.common.sms.SmsCtcc;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.TreeUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.config.CommonPropertiesConfig;
-import com.xjrsoft.module.base.dto.BaseClassroomChangeStatusDto;
 import com.xjrsoft.module.base.entity.BaseClass;
-import com.xjrsoft.module.base.entity.BaseClassroom;
 import com.xjrsoft.module.base.entity.BaseGrade;
+import com.xjrsoft.module.base.entity.WhitelistManagement;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
+import com.xjrsoft.module.base.service.IWhitelistManagementService;
 import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.dto.AddUserDto;
 import com.xjrsoft.module.organization.dto.BindOpenidDto;
@@ -89,8 +88,8 @@ import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.system.entity.File;
 import com.xjrsoft.module.system.service.IFileService;
 import com.xjrsoft.module.teacher.entity.BaseTeacher;
+import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.workflow.constant.WorkflowConstant;
-import com.xjrsoft.module.workflow.mapper.WorkflowExtraMapper;
 import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -156,7 +155,7 @@ public class UserController {
     private final HistoryService historyService;
 
     private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
-
+    private final IWhitelistManagementService whitelistManagementService;
 
     @GetMapping(value = "/list")
     @ApiOperation(value = "用户列表(不分页)")
@@ -390,6 +389,9 @@ public class UserController {
         if (userStudentVo != null) {
             vo.setClassId(userStudentVo.getClassId());
             vo.setClassName(userStudentVo.getClassName());
+            vo.setTeacherId(userStudentVo.getTeacherId());
+            vo.setTeacherName(userStudentVo.getTeacherName());
+            vo.setTeacherMobile(userStudentVo.getTeacherMobile());
         }
 
         List<File> fileList = fileService.list(Wrappers.lambdaQuery(File.class).eq(File::getFolderId, user.getSignFolderId()));
@@ -744,6 +746,15 @@ public class UserController {
             return RT.error("学生不存在!");
         }
 
+        List<WhitelistManagement> managementList = whitelistManagementService.list(
+                new QueryWrapper<WhitelistManagement>().lambda()
+                        .eq(WhitelistManagement::getUserId, dto.getUserId())
+        );
+        userStudentInfoVo.setWhitelistStatus(0);
+        if(!managementList.isEmpty()){
+            userStudentInfoVo.setWhitelistStatus(1);
+        }
+
         return RT.ok(userStudentInfoVo);
     }
 
@@ -768,7 +779,11 @@ public class UserController {
                         .innerJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, UserStudent::getStudentId)
                         .innerJoin(BaseStudentUser.class, BaseStudentUser::getId, UserStudent::getStudentId)
                         .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
+                        .leftJoin(XjrUser.class, XjrUser::getId, BaseClass::getTeacherId)
                         .select(BaseStudentSchoolRoll::getClassId)
+                        .selectAs(XjrUser::getName, UserStudentVo::getTeacherName)
+                        .selectAs(XjrUser::getMobile, UserStudentVo::getTeacherMobile)
+                        .selectAs(XjrUser::getId, UserStudentVo::getTeacherId)
                         .select(UserStudent::getStudentId,UserStudent::getStatus)
                         .selectAs(BaseClass::getName, UserStudentVo::getClassName)
                         .selectAs(BaseStudentUser::getName, UserStudentVo::getStudentName)

+ 9 - 0
src/main/java/com/xjrsoft/module/organization/vo/UserInfoVo.java

@@ -129,4 +129,13 @@ public class UserInfoVo {
 
     @ApiModelProperty("身份证")
     private String credentialNumber;
+
+    @ApiModelProperty("班主任id")
+    private Long teacherId;
+
+    @ApiModelProperty("班主任姓名")
+    private String teacherName;
+
+    @ApiModelProperty("班主任电话")
+    private String teacherMobile;
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/organization/vo/UserStudentInfoVo.java

@@ -33,4 +33,8 @@ public class UserStudentInfoVo implements Serializable {
     @ApiModelProperty("班主任")
     public Long teacherId;
 
+
+    @ApiModelProperty("是否存在于白名单中(1:是 0:否)")
+    public Integer whitelistStatus;
+
 }

+ 9 - 0
src/main/java/com/xjrsoft/module/organization/vo/UserStudentVo.java

@@ -12,4 +12,13 @@ public class UserStudentVo extends UserStudentUpdateDto {
     private Long classId;
     @ApiModelProperty("流程状态(0:审核中,1:通过,2:拒绝)")
     private Integer status;
+
+    @ApiModelProperty("班主任id")
+    private Long teacherId;
+
+    @ApiModelProperty("班主任姓名")
+    private String teacherName;
+
+    @ApiModelProperty("班主任电话")
+    private String teacherMobile;
 }

+ 10 - 25
src/main/java/com/xjrsoft/module/personnel/controller/FaceManagementController.java

@@ -93,11 +93,15 @@ public class FaceManagementController {
     @GetMapping(value = "/detail")
     @ApiOperation(value = "根据当前用户查询人脸信息")
     @SaCheckPermission("facemanager:detail")
-    public RT<FaceManagementVo> detail() {
+    public RT<FaceManagementVo> detail(Long id) {
+        Long userId = StpUtil.getLoginIdAsLong();
+        if(id != null){
+            userId = id;
+        }
         FaceManagement faceManagement = faceManagementService.getOneDeep(
                 MPJWrappers.<FaceManagement>lambdaJoin()
                 .eq(FaceManagement::getDeleteMark, DeleteMark.NODELETE.getCode())
-                .eq(FaceManagement::getUserId, StpUtil.getLoginIdAsLong())
+                .eq(FaceManagement::getUserId, userId)
         );
         if (faceManagement == null) {
             return RT.error("找不到此数据!");
@@ -154,7 +158,7 @@ public class FaceManagementController {
     public RT<Boolean> add(AddFaceManagementDto dto, @RequestParam("file") MultipartFile file) {
         FaceManagement faceManagement = BeanUtil.toBean(dto, FaceManagement.class);
         try {
-            faceManagement.setRegisterBase64(ImageHandler(file));
+            faceManagement.setRegisterBase64(ImageUtil.ImageHandler(file));
         } catch (Exception e) {
             return RT.error(e.getMessage());
         }
@@ -164,6 +168,8 @@ public class FaceManagementController {
 
     }
 
+
+
     @PostMapping(value = "/update")
     @ApiOperation(value = "修改人脸")
     @SaCheckPermission("facemanager:edit")
@@ -171,7 +177,7 @@ public class FaceManagementController {
         FaceManagement faceManagement = BeanUtil.toBean(dto, FaceManagement.class);
         if (file != null) {
             try {
-                faceManagement.setRegisterBase64(ImageHandler(file));
+                faceManagement.setRegisterBase64(ImageUtil.ImageHandler(file));
             } catch (Exception e) {
                 return RT.error(e.getMessage());
             }
@@ -202,26 +208,5 @@ public class FaceManagementController {
         return RT.ok(faceManagementService.remove(Wrappers.<FaceManagement>query().lambda().eq(FaceManagement::getUserId,StpUtil.getLoginIdAsLong())));
     }
 
-    // 图片处理
-    public String ImageHandler(@NotNull MultipartFile file) throws IOException {
-        String filename = file.getOriginalFilename();
-        String suffix = StringUtils.substringAfterLast(filename, StringPool.DOT);
-        String[] imgSuffix = new String[]{"png", "jpg", "jpeg"};
-
-        if (!Arrays.asList(imgSuffix).contains(suffix)) {
-            throw new MyException("图片格式不正确!");
-        }
-        Map<String, String> map = new HashMap<String, String>() {
-            {
-                put("jpg", "data:image/jpg;base64,");
-                put("jpeg", "data:image/jpeg;base64,");
-                put("png", "data:image/png;base64,");
-            }
-        };
 
-        Long maxSize = 1048576L; // 最大文件1M
-        byte[] resultImg = ImageUtil.compressUnderSize(file.getBytes(), maxSize);
-
-        return map.get(suffix) + ImageUtil.bytesEncode2Base64(resultImg);
-    }
 }

+ 14 - 5
src/main/java/com/xjrsoft/module/personnel/controller/StundentFaceProcessController.java

@@ -28,12 +28,12 @@ import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.vo.StudentClassVo;
 import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.ApiUtil;
+import com.xjrsoft.module.personnel.dto.AddFaceManagementDto;
 import com.xjrsoft.module.personnel.dto.AddStundentFaceProcessDto;
 import com.xjrsoft.module.personnel.dto.StundentFaceProcessPageDto;
 import com.xjrsoft.module.personnel.dto.UpdateStundentFaceProcessDto;
 import com.xjrsoft.module.personnel.entity.FaceManagement;
 import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
-import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
 import com.xjrsoft.module.personnel.service.IFaceManagementService;
 import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
 import com.xjrsoft.module.personnel.vo.StundentFaceProcessPageVo;
@@ -94,6 +94,8 @@ public class StundentFaceProcessController {
     private final IFaceManagementService faceManagementService;
     private final IBaseClassService classService;
     private final HikvisionDataMapper hikvisionDataMapper;
+
+
     @GetMapping(value = "/page")
     @ApiOperation(value="学生人脸信息审核列表(分页)")
     @SaCheckPermission("stundentfaceprocess:detail")
@@ -189,9 +191,6 @@ public class StundentFaceProcessController {
     @ApiOperation(value = "批量新增学生人脸")
     @SaCheckPermission("stundentfaceprocess:batch-upload")
     public RT<Boolean> batchUpload(@RequestParam("file") MultipartFile file) throws Exception {
-
-
-
         List<BaseStudentUser> list = studentManagerService.list(
             new MPJLambdaWrapper<BaseStudentUser>().distinct()
             .select(BaseStudentUser::getId)
@@ -360,7 +359,7 @@ public class StundentFaceProcessController {
                 String faceId = null;
                 if(process.getHikvisionResult() != null && process.getHikvisionResult().startsWith("{") && process.getHikvisionResult().endsWith("}")){
                     JsonObject object = parser.parse(process.getHikvisionResult()).getAsJsonObject();
-                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString())){
+                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString()) && !object.get("data").isJsonNull()){
                         faceId = object.get("data").getAsJsonObject().get("faceId").getAsString();
                     }
                 }
@@ -420,4 +419,14 @@ public class StundentFaceProcessController {
         return RT.ok(true);
     }
 
+
+    @PostMapping(value = "/ns-upload-face")
+    @ApiOperation(value = "新生账号激活上传人脸信息")
+    @SaCheckPermission("stundentfaceprocess:add")
+    public RT<Boolean> nsUploadFace(AddFaceManagementDto dto, @RequestParam("file") MultipartFile file) {
+        Boolean isSuccess = stundentFaceProcessService.nsUploadFace(dto, file);
+        return RT.ok(isSuccess);
+
+    }
+
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/personnel/controller/TeacherFaceProcessController.java

@@ -317,7 +317,7 @@ public class TeacherFaceProcessController {
                 String faceId = null;
                 if(process.getHikvisionResult() != null && process.getHikvisionResult().startsWith("{") && process.getHikvisionResult().endsWith("}")){
                     JsonObject object = parser.parse(process.getHikvisionResult()).getAsJsonObject();
-                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString())){
+                    if("0".equals(object.get("code").getAsString()) && "success".equals(object.get("msg").getAsString()) && !object.get("data").isJsonNull()){
                         faceId = object.get("data").getAsJsonObject().get("faceId").getAsString();
                     }
                 }

+ 4 - 0
src/main/java/com/xjrsoft/module/personnel/service/IStundentFaceProcessService.java

@@ -1,7 +1,9 @@
 package com.xjrsoft.module.personnel.service;
 
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.personnel.dto.AddFaceManagementDto;
 import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -15,4 +17,6 @@ import java.util.List;
 public interface IStundentFaceProcessService extends MPJBaseService<StundentFaceProcess> {
 
     Boolean removeByIds(List<Long> ids);
+
+    Boolean nsUploadFace(AddFaceManagementDto dto, MultipartFile file);
 }

+ 60 - 1
src/main/java/com/xjrsoft/module/personnel/service/impl/StundentFaceProcessServiceImpl.java

@@ -1,21 +1,34 @@
 package com.xjrsoft.module.personnel.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.ImageUtil;
 import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.ApiUtil;
+import com.xjrsoft.module.hikvision.util.FaceImportUtil;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.personnel.dto.AddFaceManagementDto;
 import com.xjrsoft.module.personnel.entity.FaceManagement;
 import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
 import com.xjrsoft.module.personnel.mapper.StundentFaceProcessMapper;
 import com.xjrsoft.module.personnel.service.IFaceManagementService;
 import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
+import com.xjrsoft.module.system.entity.File;
+import com.xjrsoft.module.system.service.IFileService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.Date;
 import java.util.List;
@@ -33,7 +46,9 @@ public class StundentFaceProcessServiceImpl extends MPJBaseServiceImpl<StundentF
     private final HikvisionDataMapper hikvisionDataMapper;
 
     private final IFaceManagementService faceManagementService;
-
+    private final IUserService userService;
+    private final IBaseStudentSchoolRollService rollService;
+    private final IFileService fileService;
 
     //删除人脸后,移除海康那边的人脸
     @Override
@@ -88,4 +103,48 @@ public class StundentFaceProcessServiceImpl extends MPJBaseServiceImpl<StundentF
         }
         return true;
     }
+
+    @Override
+    public Boolean nsUploadFace(AddFaceManagementDto dto, MultipartFile file) {
+        //新增人脸管理数据
+        FaceManagement faceManagement = BeanUtil.toBean(dto, FaceManagement.class);
+        try {
+            faceManagement.setRegisterBase64(ImageUtil.ImageHandler(file));
+        } catch (Exception e) {
+            throw new MyException(e.getMessage());
+        }
+        boolean isSuccess = faceManagementService.add(faceManagement);
+
+        User user = userService.getById(dto.getUserId());
+
+        List<BaseStudentSompleInfoVo> infosByParam = rollService.getInfosByParam(new BaseStudentSimpleInfoDto() {{
+            setUserId(user.getId());
+        }});
+        BaseStudentSompleInfoVo infoVo = new BaseStudentSompleInfoVo();
+        if(!infosByParam.isEmpty()){
+            infoVo = infosByParam.get(0);
+        }
+        //新生学生人俩流程数据
+        StundentFaceProcess studentFace = new StundentFaceProcess();
+        studentFace.setFacePhoto(dto.getFileId());
+        studentFace.setName(dto.getName());
+        studentFace.setStatus(1);
+        studentFace.setExamStatus(1);
+        studentFace.setUserId(dto.getUserId());
+        studentFace.setIdentityCard(user.getCredentialNumber());
+        studentFace.setGender(user.getGender());
+        studentFace.setClassId(infoVo.getClassId());
+        studentFace.setTeacherId(infoVo.getTeahcerId());
+
+        File xjrFile = fileService.getOne(
+                new QueryWrapper<File>().lambda().eq(File::getFolderId, dto.getFileId())
+        );
+
+
+        String result = FaceImportUtil.ImportStudentFace(hikvisionDataMapper.getStudentHikvisionId(user.getId()), xjrFile.getFileUrl());
+        studentFace.setHikvisionResult(result);
+
+        this.save(studentFace);
+        return true;
+    }
 }

+ 116 - 5
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -1,18 +1,35 @@
 package com.xjrsoft.module.student.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.secure.BCrypt;
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
+import com.xjrsoft.common.constant.GlobalConstant;
+import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.RedisUtil;
+import com.xjrsoft.config.CommonPropertiesConfig;
+import com.xjrsoft.module.base.entity.BaseUserStudent;
+import com.xjrsoft.module.base.entity.WhitelistManagement;
+import com.xjrsoft.module.base.service.IBaseUserStudentService;
+import com.xjrsoft.module.base.service.IWhitelistManagementService;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.entity.UserRoleRelation;
+import com.xjrsoft.module.organization.service.IUserRoleRelationService;
+import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.student.dto.ActiveAccountDto;
 import com.xjrsoft.module.student.dto.AddBaseNewStudentDto;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseNewStudentDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.service.IBaseStudentFamilyMemberService;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentScoreExcelVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentTreeVo;
@@ -34,12 +51,13 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CompletableFuture;
 
 /**
 * @title: 新生维护信息
@@ -53,9 +71,14 @@ import java.util.Map;
 @AllArgsConstructor
 public class BaseNewStudentController {
 
-
+    private final IUserService userService;
     private final IBaseNewStudentService baseNewStudentService;
-
+    private final IBaseStudentFamilyMemberService familyMemberService;
+    private final IWhitelistManagementService whitelistManagementService;
+    private final IUserRoleRelationService userRoleRelationService;
+    private final RedisUtil redisUtil;
+    private final IBaseUserStudentService userStudentService;
+    private final CommonPropertiesConfig propertiesConfig;
     @GetMapping(value = "/page")
     @ApiOperation(value="新生维护信息列表(分页)")
     @SaCheckPermission("basenewstudent:detail")
@@ -188,4 +211,92 @@ public class BaseNewStudentController {
         return RT.ok(result);
     }
 
+    @PostMapping("/active-account")
+    @ApiOperation(value = "激活账号")
+    public RT<Boolean> activeAccount(@Valid @RequestBody ActiveAccountDto dto) {
+        User user = userService.getById(dto.getId());
+        user.setMobile(dto.getMobile());
+        user.setEnabledMark(EnabledMark.ENABLED.getCode());
+        user.setModifyDate(LocalDateTime.now());
+        userService.updateById(user);
+        // 新增家庭成员信息
+        List<BaseStudentFamilyMember> list = familyMemberService.list(
+                new QueryWrapper<BaseStudentFamilyMember>().lambda()
+                        .eq(BaseStudentFamilyMember::getName, dto.getParentName())
+                        .eq(BaseStudentFamilyMember::getUserId, dto.getId())
+                        .eq(BaseStudentFamilyMember::getMobile, dto.getParentMobile())
+        );
+        BaseStudentFamilyMember member;
+        if(list.isEmpty()){
+            member = new BaseStudentFamilyMember();
+            member.setUserId(user.getId());
+            member.setName(dto.getParentName());
+            member.setMobile(dto.getParentMobile());
+            member.setCreateDate(LocalDateTime.now());
+            member.setCreateUserId(StpUtil.getLoginIdAsLong());
+            familyMemberService.save(member);
+        }else{
+            member = list.get(0);
+        }
+        List<User> parents = userService.list(
+                new QueryWrapper<User>().lambda()
+                        .eq(User::getUserName, dto.getParentMobile())
+                        .eq(User::getName, dto.getParentName())
+        );
+        if(parents.isEmpty()){
+            User parentUser = new User() {{
+                setUserName(dto.getParentMobile());
+                setName(dto.getParentName());
+                setIsChangePassword(1);
+                setDeleteMark(0);
+                setEnabledMark(1);
+                setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
+                setMobile(dto.getParentMobile());
+            }};
+            userService.save(parentUser);
+
+            userRoleRelationService.save(new UserRoleRelation(){{
+                setUserId(parentUser.getId());
+                setRoleId(4L);
+            }});
+
+            BaseUserStudent userStudent = new BaseUserStudent();
+            userStudent.setStudentId(user.getId());
+            userStudent.setStudentNane(user.getName());
+            userStudent.setStudentIdentity(user.getCredentialNumber());
+            userStudent.setCreateDate(new Date());
+            userStudent.setUserId(parentUser.getId());
+            userStudent.setStatus(1);
+            userStudentService.save(userStudent);
+        }
+
+        //新增白名单信息
+        List<WhitelistManagement> managementList = whitelistManagementService.list(
+                new QueryWrapper<WhitelistManagement>().lambda()
+                        .eq(WhitelistManagement::getUserId, dto.getId())
+        );
+        if(managementList.isEmpty()){
+            WhitelistManagement whitelistManagement = new WhitelistManagement() {{
+                setName(user.getName());
+                setUserId(user.getId());
+                setCreateDate(new Date());
+                setCredentialNumber(user.getCredentialNumber());
+                setPhone(user.getMobile());
+            }};
+            whitelistManagementService.save(whitelistManagement);
+        }
+
+        CompletableFuture.runAsync(() -> {
+            List<User> userList = userService.list();
+            redisUtil.set(GlobalConstant.USER_CACHE_KEY, userList);
+
+            List<UserRoleRelation> userRoleRelationList = userRoleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
+            redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
+
+            whitelistManagementService.loadCaches();
+        });
+
+        return RT.ok(true);
+    }
+
 }

+ 0 - 6
src/main/java/com/xjrsoft/module/student/controller/BaseStudentInfoController.java

@@ -105,10 +105,4 @@ public class BaseStudentInfoController {
         return RT.ok(infos);
     }
 
-    @PostMapping("/change-class")
-    @ApiOperation(value = "调整班级")
-    @SaCheckPermission("bandingTaskClass:change-class")
-    public RT<Boolean> changeClass(@Valid @RequestBody ChangeClassDto dto){
-        return RT.ok(true);
-    }
 }

+ 84 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -23,19 +23,27 @@ import com.xjrsoft.common.utils.TreeUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 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.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
 import com.xjrsoft.module.concat.service.IXjrUserService;
 import com.xjrsoft.module.hikvision.util.DataUtil;
+import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
+import com.xjrsoft.module.organization.service.IDepartmentService;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
 import com.xjrsoft.module.room.service.IRoomBedService;
 import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
 import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentUserDto;
+import com.xjrsoft.module.student.entity.BaseClassMajorSet;
+import com.xjrsoft.module.student.entity.BaseMajor;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentUser;
+import com.xjrsoft.module.student.service.IBaseMajorService;
 import com.xjrsoft.module.student.service.IStudentManagerService;
+import com.xjrsoft.module.student.vo.BaseClassMajorSetVo;
+import com.xjrsoft.module.student.vo.BaseDepMajorGradeClassStudenTreeVo;
 import com.xjrsoft.module.student.vo.BaseStudentSchoolRollVo;
 import com.xjrsoft.module.student.vo.BaseStudentTreeVo;
 import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
@@ -81,6 +89,8 @@ public class StudentManagerController {
 
     private final IStudentManagerService studentManagerService;
     private final IBaseGradeService baseGradeService;
+    private final IDepartmentService baseDeparmentService;
+    private final IBaseMajorService baseMajorService;
     private final IBaseClassService baseClassService;
     private final IXjrUserService xjrUserService;
     private final IRoomBedService roomBedService;
@@ -89,6 +99,14 @@ public class StudentManagerController {
     @ApiOperation(value = "学生列表(分页)")
     @SaCheckPermission("studentmanager:detail")
     public R page(@Valid BaseStudentUserPageDto dto) {
+        if(dto.getTreeType() != null && dto.getTreeId() != null){
+            dto.setQueryId(dto.getTreeId());
+            if(dto.getTreeType() == 3){
+                String[] split = dto.getTreeId().split("_");
+                dto.setTreeId(split[0]);
+                dto.setQueryId(split[1]);
+            }
+        }
 
         IPage<BaseStudentUserPageVo> page = studentManagerService.getStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         for (BaseStudentUserPageVo record : page.getRecords()) {
@@ -192,6 +210,72 @@ public class StudentManagerController {
         return R.ok(userVo);
     }
 
+    @GetMapping(value = "/major-grade-class-tree")
+    @ApiOperation(value = "学生部门专业年级班级树")
+    @SaCheckPermission("studentmanager:detail")
+    public RT<List<BaseDepMajorGradeClassStudenTreeVo>> tree2() {
+        List<BaseDepMajorGradeClassStudenTreeVo> voList = new ArrayList<>();
+        MPJLambdaWrapper<BaseClass> baseClassMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        baseClassMPJLambdaWrapper
+                .selectAs(BaseClass::getId, BaseClassMajorSetVo::getClassId)
+                .selectAs(BaseMajorSet::getMajorId, BaseClassMajorSetVo::getMajorId)
+                .selectAs(BaseClass::getName, BaseClassMajorSetVo::getClassName)
+                .selectAs(BaseClass::getGradeId, BaseClassMajorSetVo::getGradeId)
+                .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, BaseClass::getId)
+                .leftJoin(BaseMajorSet.class, BaseMajorSet::getId, BaseClassMajorSet::getMajorSetId)
+        ;
+
+        List<BaseClassMajorSetVo> majorSetList = baseClassService.selectJoinList(BaseClassMajorSetVo.class, baseClassMPJLambdaWrapper);
+
+
+        List<BaseGrade> gradeList = baseGradeService.list(
+                new QueryWrapper<BaseGrade>().lambda().eq(BaseGrade::getDeleteMark, DeleteMark.NODELETE.getCode())
+        );
+        List<BaseMajor> majorList = baseMajorService.list(
+                new QueryWrapper<BaseMajor>().lambda().eq(BaseMajor::getDeleteMark, DeleteMark.NODELETE.getCode())
+        );
+        List<Department> departmentList =baseDeparmentService.list(
+                new QueryWrapper<Department>().lambda().eq(Department::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(Department::getParentId,"1684107782861680008")
+        );
+        departmentList.forEach((node) -> {
+            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                setId(node.getId().toString());
+                setTreeType(1);
+                setName(node.getName());
+                setParentId("0");
+            }});
+        });
+        majorList.forEach((node)->{
+            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                setId(node.getId().toString());
+                setName(node.getName());
+                setTreeType(2);
+                setParentId(node.getDepartmentId().toString());
+            }});
+            gradeList.forEach((DDD)->{
+                voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                    setId(node.getId().toString()+"_"+DDD.getId().toString());
+                    setName(DDD.getName());
+                    setTreeType(3);
+                    setParentId(node.getId().toString());
+                }});
+            });
+        });
+        majorSetList.forEach((node)->{
+            voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
+                setId(node.getClassId().toString());
+                setName(node.getClassName());
+                setTreeType(4);
+                setParentId(node.getMajorId().toString()+"_"+node.getGradeId());
+            }});
+        });
+
+        List<BaseDepMajorGradeClassStudenTreeVo> treeVoList = TreeUtil.build(voList);
+
+        return RT.ok(treeVoList);
+    }
+
 
     @PostMapping
     @ApiOperation(value = "新增学生")

+ 32 - 0
src/main/java/com/xjrsoft/module/student/dto/ActiveAccountDto.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+
+/**
+* @title: 新生账号激活
+* @Author dzx
+* @Date: 2024年7月13日
+* @Version 1.0
+*/
+@Data
+public class ActiveAccountDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ApiModelProperty("家长姓名")
+    private String parentName;
+
+    @ApiModelProperty("家长手机号")
+    private String parentMobile;
+}

+ 3 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseStudentSimpleInfoDto.java

@@ -12,4 +12,7 @@ public class BaseStudentSimpleInfoDto {
 
     @ApiModelProperty("关键字")
     private String keyword;
+
+    @ApiModelProperty("用户id")
+    private Long userId;
 }

+ 11 - 2
src/main/java/com/xjrsoft/module/student/dto/BaseStudentUserPageDto.java

@@ -38,7 +38,16 @@ public class BaseStudentUserPageDto extends PageInput {
     /**
      * 班级id
      */
-    @ApiModelProperty("班级id")
-    private Long classId;
+    @ApiModelProperty("树id")
+    private String treeId;
+
+    @ApiModelProperty("树类型(1:部门  2:专业  3:年级  4:班级)")
+    private Integer treeType;
+
+    /**
+     * 班级id
+     */
+    @ApiModelProperty("树-查询id")
+    private String queryId;
 
 }

+ 151 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseMajor.java

@@ -0,0 +1,151 @@
+package com.xjrsoft.module.student.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+* @title: 专业表
+* @Author wyf
+* @Date: 2024-07-01
+* @Version 1.0
+*/
+@Data
+@TableName("base_major")
+@ApiModel(value = "base_major", description = "专业表")
+public class BaseMajor implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键
+    */
+    @ApiModelProperty("主键")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ApiModelProperty("有效标志")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 专业名称
+    */
+    @ApiModelProperty("专业名称")
+    private String name;
+    /**
+    * 专业代码
+    */
+    @ApiModelProperty("专业代码")
+    private String code;
+    /**
+    * 修业年限(0.5的整数倍)
+    */
+    @ApiModelProperty("修业年限(0.5的整数倍)")
+    private BigDecimal studyYear;
+    /**
+    * 重点专业(xjr_dictionary_item[key_major])
+    */
+    @ApiModelProperty("重点专业(xjr_dictionary_item[key_major])")
+    private String keyMajor;
+    /**
+    * 特色专业(xjr_dictionary_item[feature_major])
+    */
+    @ApiModelProperty("特色专业(xjr_dictionary_item[feature_major])")
+    private String featureMajor;
+    /**
+    * 批准设置日期
+    */
+    @ApiModelProperty("批准设置日期")
+    private Date approveSetDate;
+    /**
+    * 首次招生日期(年月)
+    */
+    @ApiModelProperty("首次招生日期(年月)")
+    private Date firstRecruitStudentDate;
+    /**
+    * 专业状态(1:正常、2:停招、3:撤销)
+    */
+    @ApiModelProperty("专业状态(1:正常、2:停招、3:撤销)")
+    private Integer status;
+    /**
+    * 专业带头人
+    */
+    @ApiModelProperty("专业带头人")
+    private String leaderName;
+    /**
+    * 专业负责人
+    */
+    @ApiModelProperty("专业负责人")
+    private String directorName;
+    /**
+    * 任职日期开始
+    */
+    @ApiModelProperty("任职日期开始")
+    private Date officeStartDate;
+    /**
+    * 任职日期结束
+    */
+    @ApiModelProperty("任职日期结束")
+    private Date officeEndDate;
+    /**
+    * 是否全日制
+    */
+    @ApiModelProperty("是否全日制")
+    private Integer isFullTime;
+    /**
+    * 办学层次(base_major_gradation)
+    */
+    @ApiModelProperty("办学层次(base_major_gradation)")
+    private Long majorGradationId;
+    /**
+    * 专业分类(base_major_categor)
+    */
+    @ApiModelProperty("专业分类(base_major_categor)")
+    private Long majorCategorId;
+    /**
+    * 所属机构(xjr_department)
+    */
+    @ApiModelProperty("所属机构(xjr_department)")
+    private Long departmentId;
+
+
+}

+ 2 - 2
src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java

@@ -134,12 +134,12 @@ public class BaseNewStudent implements Serializable {
     * 第一志愿
     */
     @ApiModelProperty("第一志愿")
-    private String firstAmbition;
+    private Long firstAmbition;
     /**
     * 第二志愿
     */
     @ApiModelProperty("第二志愿")
-    private String secondAmbition;
+    private Long secondAmbition;
     /**
     * 班级状态(0:未分配, 1:已分配)
     */

+ 16 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseMajorMapper.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.student.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.entity.BaseMajor;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 专业表
+* @Author wyf
+* @Date: 2024-07-01
+* @Version 1.0
+*/
+@Mapper
+public interface BaseMajorMapper extends MPJBaseMapper<BaseMajor> {
+
+}

+ 2 - 1
src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.student.mapper;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
@@ -32,5 +33,5 @@ public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
 
     List<IdCountVo> getSecondAmbitionStudentCount(@Param("gradeId") Long gradeId, @Param("enrollType") String enrollType);
 
-    List<IdCountVo> getMajorStudentCount();
+    List<IdManyCountVo> getMajorStudentCount(@Param("id") Long bandingTaskId);
 }

+ 14 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseMajorService.java

@@ -0,0 +1,14 @@
+package com.xjrsoft.module.student.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.entity.BaseMajor;
+
+/**
+* @title: 专业表
+* @Author wyf
+* @Date: 2024-07-01
+* @Version 1.0
+*/
+
+public interface IBaseMajorService extends MPJBaseService<BaseMajor> {
+}

+ 2 - 1
src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.student.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
@@ -37,5 +38,5 @@ public interface IBaseNewStudentService extends MPJBaseService<BaseNewStudent> {
 
     List<IdCountVo> getMajorStudent(Long gradeId, String enrollType, Integer index);
 
-    List<IdCountVo> getMajorStudentCount();
+    List<IdManyCountVo> getMajorStudentCount(Long bandingTaskId);
 }

+ 19 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseMajorServiceImpl.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.student.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.entity.BaseMajor;
+import com.xjrsoft.module.student.mapper.BaseMajorMapper;
+import com.xjrsoft.module.student.service.IBaseMajorService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+* @title: 专业表
+* @Author wyf
+* @Date: 2024-07-01
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class BaseMajorServiceImpl extends MPJBaseServiceImpl<BaseMajorMapper, BaseMajor> implements IBaseMajorService {
+}

+ 7 - 7
src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java

@@ -9,9 +9,9 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.YesOrNoEnum;
 import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.base.entity.BaseMajorSet;
 import com.xjrsoft.module.base.service.IBaseMajorSetService;
-import com.xjrsoft.module.base.vo.BaseClassCoursePageVo;
 import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
@@ -142,9 +142,9 @@ public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudent
                 student.setSource(dictMap.get(objectMap.get(7).toString()));
                 student.setStduyStatus(dictMap.get(objectMap.get(8).toString()));
                 student.setMobile(objectMap.get(9).toString());
-                student.setFirstAmbition(majorSetMap.get(objectMap.get(10).toString()).toString());
+                student.setFirstAmbition(majorSetMap.get(objectMap.get(10).toString()));
                 student.setFirstAmbitionId(majorSetMap.get(objectMap.get(10).toString()));
-                student.setSecondAmbition(majorSetMap.get(objectMap.get(11).toString()).toString());
+                student.setSecondAmbition(majorSetMap.get(objectMap.get(11).toString()));
                 student.setSecondAmbitionId(majorSetMap.get(objectMap.get(11).toString()));
                 student.setIsAdjust(YesOrNoEnum.getCode(objectMap.get(12).toString()));
                 if(objectMap.get(13) != null){
@@ -174,9 +174,9 @@ public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudent
                     setSource(dictMap.get(objectMap.get(7).toString()));
                     setStduyStatus(dictMap.get(objectMap.get(8).toString()));
                     setMobile(objectMap.get(9).toString());
-                    setFirstAmbition(majorSetMap.get(objectMap.get(10).toString()).toString());
+                    setFirstAmbition(majorSetMap.get(objectMap.get(10).toString()));
                     setFirstAmbitionId(majorSetMap.get(objectMap.get(10).toString()));
-                    setSecondAmbition(majorSetMap.get(objectMap.get(11).toString()).toString());
+                    setSecondAmbition(majorSetMap.get(objectMap.get(11).toString()));
                     setSecondAmbitionId(majorSetMap.get(objectMap.get(11).toString()));
                     setIsAdjust(YesOrNoEnum.getCode(objectMap.get(12).toString()));
                     if(objectMap.get(13) != null){
@@ -248,8 +248,8 @@ public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudent
     }
 
     @Override
-    public List<IdCountVo> getMajorStudentCount() {
-        return this.baseMapper.getMajorStudentCount();
+    public List<IdManyCountVo> getMajorStudentCount(Long bandingTaskId) {
+        return this.baseMapper.getMajorStudentCount(bandingTaskId);
     }
 
     /**

+ 15 - 2
src/main/java/com/xjrsoft/module/student/vo/BaseClassMajorSetVo.java

@@ -5,8 +5,8 @@ import lombok.Data;
 
 /**
 * @title: 班级专业方向表表单出参
-* @Author szs
-* @Date: 2023-12-28
+* @Author wyf
+* @Date: 2024-07-09
 * @Version 1.0
 */
 @Data
@@ -22,11 +22,24 @@ public class BaseClassMajorSetVo {
     */
     @ApiModelProperty("班级(base_class_major_set)")
     private Long classId;
+    /**
+     * 班级(base_class_major_set)
+     */
+    @ApiModelProperty("班级(base_class_major_set)")
+    private String className;
     /**
     * 专业方向(base_major_set)
     */
     @ApiModelProperty("专业方向(base_major_set)")
     private Long majorSetId;
+
+    @ApiModelProperty("所属年级(base_grade)")
+    private Long gradeId;
+    /**
+     * 专业(base_major)
+     */
+    @ApiModelProperty("专业(base_major)")
+    private Long majorId;
     /**
     * 计划人数
     */

+ 32 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseDepMajorGradeClassStudenTreeVo.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.student.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public  class BaseDepMajorGradeClassStudenTreeVo implements ITreeNode<BaseDepMajorGradeClassStudenTreeVo,String>, Serializable {
+
+
+    @ApiModelProperty("id")
+    private String id;
+
+
+    @ApiModelProperty("name")
+    private String name;
+
+
+    @ApiModelProperty("disabled")
+    private String parentId;
+
+
+    @ApiModelProperty("children")
+    private List<BaseDepMajorGradeClassStudenTreeVo> children;
+
+    @ApiModelProperty("树类型(1:部门  2:专业  3:年级  4:班级)")
+    private Integer treeType;
+
+}

+ 14 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentSompleInfoVo.java

@@ -43,4 +43,18 @@ public class BaseStudentSompleInfoVo {
     @ApiModelProperty("班级名称")
     private String className;
 
+    @ApiModelProperty("家长名称")
+    private String parentName;
+
+    @ApiModelProperty("家长电话")
+    private String parentMobile;
+
+    @ApiModelProperty("性别")
+    private String gender;
+
+    @ApiModelProperty("班级id")
+    private Long classId;
+
+    @ApiModelProperty("班主任id")
+    private Long teahcerId;
 }

+ 9 - 3
src/main/resources/mapper/banding/BandingTaskClassMapper.xml

@@ -4,7 +4,7 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.banding.mapper.BandingTaskClassMapper">
     <select id="getList" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassPageVo">
-        SELECT t1.id, t1.major_set_id,t2.name AS major_set_name, t1.name, t1.number,t1.sort_code,t1.is_order_class,
+        SELECT t1.id, t1.major_set_id,t2.name AS major_set_name, t1.name, t1.number,t1.sort_code,t1.is_order_class,t1.class_type,
         (SELECT COUNT(*) FROM base_new_student a1
         INNER JOIN enrollment_plan a2 ON a1.enrollment_plan_id = a2.id
         WHERE a1.delete_mark = 0 AND a1.first_ambition_id = t1.major_set_id
@@ -68,8 +68,8 @@
         LEFT JOIN banding_task_class t3 ON t2.banding_task_class_id = t3.id
         AND t3.delete_mark = 0 AND t3.banding_task_id = #{dto.bandingTaskId}
         LEFT JOIN xjr_dictionary_detail t4 ON t1.gender = t4.code
-        LEFT JOIN base_major_set t5 ON t1.first_ambition_id = t5.id
-        LEFT JOIN base_major_set t6 ON t1.second_ambition_id = t6.id
+        LEFT JOIN base_major_set t5 ON t1.first_ambition = t5.id
+        LEFT JOIN base_major_set t6 ON t1.second_ambition = t6.id
         LEFT JOIN xjr_dictionary_detail t7 ON t1.stduy_status = t7.code
         LEFT JOIN xjr_user t8 ON t3.teacher_id = t8.id
         INNER JOIN enrollment_plan t9 ON t1.enrollment_plan_id = t9.id
@@ -90,6 +90,12 @@
         <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
             AND t1.stduy_status = #{dto.stduyStatus}
         </if>
+        <if test="dto.secondAmbition != null">
+            AND t1.second_ambition = #{dto.secondAmbition}
+        </if>
+        <if test="dto.firstAmbition != null">
+            AND t1.first_ambition = #{dto.firstAmbition}
+        </if>
         <if test="dto.status != null">
             <if test="dto.status == 1">
                 AND t3.name is not null

+ 1 - 1
src/main/resources/mapper/base/WhitelistManagement.xml

@@ -52,7 +52,7 @@
         </if>
     </select>
 
-    <select id="getPhone" resultType="java.lang.Long">
+    <select id="getPhone" resultType="java.lang.String">
         select mobile
         from xjr_user
         where delete_mark = 0

+ 12 - 2
src/main/resources/mapper/organization/UserMapper.xml

@@ -16,10 +16,20 @@
         </if>
     </select>
     <select id="getInfosByParam" parameterType="com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto" resultType="com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo">
-        SELECT t1.id, t1.name, t1.enabled_mark, t1.credential_number, t4.name AS class_name FROM xjr_user t1
+        SELECT t1.id, t1.name as student_name, t1.enabled_mark, t1.credential_number, t4.name AS class_name,t1.mobile,
+        (SELECT name FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t1.id ORDER BY create_date ASC LIMIT 0,1) as parent_name,
+        (SELECT mobile FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t1.id ORDER BY create_date ASC LIMIT 0,1) as parent_mobile,
+        t1.gender,t4.id as class_id, t4.teacher_id
+        FROM xjr_user t1
         INNER JOIN base_student t2 ON t1.id = t2.user_id
         INNER JOIN base_student_school_roll t3 ON t1.id = t3.user_id
         INNER JOIN base_class t4 ON t4.id = t3.class_id
-        WHERE t1.delete_mark = 0 AND (t1.name = #{dto.keyword} OR t1.credential_number = #{dto.keyword})
+        WHERE t1.delete_mark = 0
+        <if test="dto.keyword != null and dto.keyword != ''">
+            AND (t1.name = #{dto.keyword} OR t1.credential_number = #{dto.keyword})
+        </if>
+        <if test="dto.userId != null">
+            AND t1.id = #{dto.userId}
+        </if>
     </select>
 </mapper>

+ 24 - 2
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -61,6 +61,14 @@
                 AND t4.enroll_type = #{dto.treeId}
             </if>
         </if>
+        <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+            <if test="dto.order == 'descend'">
+                order by t1.score desc
+            </if>
+            <if test="dto.order == 'ascend'">
+                order by t1.score asc
+            </if>
+        </if>
     </select>
     <select id="getEnrollmentPlanList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo">
         SELECT t1.enroll_type, t2.name AS enroll_type_cn,t3.name AS grade_name, t3.id as grade_id,t1.id FROM enrollment_plan t1
@@ -89,11 +97,25 @@
         WHERE t1.delete_mark = 0 AND t2.grade_id = #{gradeId} AND t2.enroll_type = #{enrollType}
         GROUP BY t1.second_ambition_id
     </select>
-    <select id="getMajorStudentCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">
+    <select id="getMajorStudentCount" resultType="com.xjrsoft.module.banding.vo.IdManyCountVo">
         SELECT t1.id,(
         SELECT COUNT(id) FROM base_new_student WHERE delete_mark = 0
         AND (first_ambition_id = t1.id OR second_ambition_id = t1.id)
-        ) as count FROM base_major_set t1 WHERE delete_mark = 0
+        AND score >= IFNULL(t2.score,0) AND height >= IFNULL(t2.height,0)
+        ) AS count,(
+        SELECT COUNT(id) FROM base_new_student WHERE delete_mark = 0
+        AND (first_ambition_id = t1.id OR second_ambition_id = t1.id)
+        AND score >= IFNULL(t2.score,0) AND height >= IFNULL(t2.height,0)
+        AND gender = 'SB10001'
+        ) AS male_count,(
+        SELECT COUNT(id) FROM base_new_student WHERE delete_mark = 0
+        AND (first_ambition_id = t1.id OR second_ambition_id = t1.id)
+        AND score >= IFNULL(t2.score,0) AND height >= IFNULL(t2.height,0)
+        AND gender = 'SB10002'
+        ) AS female_count FROM base_major_set t1
+        LEFT JOIN banding_task_major_condition t2 ON t1.id = t2.major_set_id AND t2.banding_task_id = #{id}
+        AND t2.delete_mark = 0
+        WHERE t1.delete_mark = 0
     </select>
 
 </mapper>

+ 14 - 2
src/main/resources/mapper/student/BaseStudentMapper.xml

@@ -76,9 +76,21 @@
         <if test="dto.email != null and dto.email != ''">
             and t1.email like concat('%', #{dto.email},'%')
         </if>
-        <if test="dto.classId != null">
-            and t4.id = #{dto.classId}
+        <if test="dto.treeType != null and dto.queryId != null">
+            <if test="dto.treeType == 1">
+                and t4.org_id = #{dto.queryId}
+            </if>
+            <if test="dto.treeType == 2">
+                and t3.major_set_id = #{dto.queryId}
+            </if>
+            <if test="dto.treeType == 3">
+                and t4.grade_id = #{dto.queryId} and t3.major_set_id = #{dto.treeId}
+            </if>
+            <if test="dto.treeType == 4">
+                and t4.id = #{dto.queryId}
+            </if>
         </if>
+
         <if test="dto.order == null">
             order by t1.id
         </if>