dzx 1 год назад
Родитель
Сommit
15e7da7d59
49 измененных файлов с 969 добавлено и 140 удалено
  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. 1 0
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java
  7. 60 24
      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. 0 2
      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. 1 1
      src/main/java/com/xjrsoft/module/base/service/IWhitelistManagementService.java
  18. 17 0
      src/main/java/com/xjrsoft/module/base/service/impl/IBaseUserStudentServiceImpl.java
  19. 5 6
      src/main/java/com/xjrsoft/module/base/service/impl/WhitelistManagementServiceImpl.java
  20. 1 1
      src/main/java/com/xjrsoft/module/form/controller/FormExecuteController.java
  21. 0 1
      src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java
  22. 4 1
      src/main/java/com/xjrsoft/module/form/utils/FormDataTransUtil.java
  23. 0 2
      src/main/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNode.java
  24. 8 10
      src/main/java/com/xjrsoft/module/material/controller/MaterialTaskController.java
  25. 31 0
      src/main/java/com/xjrsoft/module/material/dto/FormDataExportQueryDto.java
  26. 4 0
      src/main/java/com/xjrsoft/module/material/service/IMaterialTaskService.java
  27. 54 10
      src/main/java/com/xjrsoft/module/material/service/impl/MaterialTaskServiceImpl.java
  28. 0 11
      src/main/java/com/xjrsoft/module/material/vo/MaterialTaskAssignListVo.java
  29. 9 0
      src/main/java/com/xjrsoft/module/organization/vo/UserStudentVo.java
  30. 10 25
      src/main/java/com/xjrsoft/module/personnel/controller/FaceManagementController.java
  31. 13 4
      src/main/java/com/xjrsoft/module/personnel/controller/StundentFaceProcessController.java
  32. 4 0
      src/main/java/com/xjrsoft/module/personnel/service/IStundentFaceProcessService.java
  33. 59 1
      src/main/java/com/xjrsoft/module/personnel/service/impl/StundentFaceProcessServiceImpl.java
  34. 116 5
      src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java
  35. 0 6
      src/main/java/com/xjrsoft/module/student/controller/BaseStudentInfoController.java
  36. 32 0
      src/main/java/com/xjrsoft/module/student/dto/ActiveAccountDto.java
  37. 3 0
      src/main/java/com/xjrsoft/module/student/dto/BaseStudentSimpleInfoDto.java
  38. 2 2
      src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java
  39. 2 1
      src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java
  40. 2 1
      src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java
  41. 7 7
      src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java
  42. 14 0
      src/main/java/com/xjrsoft/module/student/vo/BaseStudentSompleInfoVo.java
  43. 9 3
      src/main/resources/mapper/banding/BandingTaskClassMapper.xml
  44. 1 1
      src/main/resources/mapper/base/WhitelistManagement.xml
  45. 12 2
      src/main/resources/mapper/organization/UserMapper.xml
  46. 24 2
      src/main/resources/mapper/student/BaseNewStudentMapper.xml
  47. 179 0
      src/main/resources/sqlScript/20240708_sql.sql
  48. 118 0
      src/main/resources/sqlScript/20240711_sql.sql
  49. 0 4
      src/test/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImplTest.java

+ 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()));
             }});

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

@@ -110,6 +110,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);
                         }

+ 60 - 24
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;
@@ -142,7 +143,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         }
         //1、查询需要分班的学生信息
         List<String> orderColumn = new ArrayList();
-        orderColumn.add("height");orderColumn.add("score");
+        orderColumn.add("score");
         List<BaseNewStudent> baseNewStudents = newStudentService.selectJoinList(BaseNewStudent.class,
                 new MPJLambdaWrapper<BaseNewStudent>()
                         .select(BaseNewStudent::getId)
@@ -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;
@@ -420,6 +447,15 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                                                          List<BandingTaskClass> classList){
         Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
         for (Long majorSetId : classConditionMap.keySet()) {
+            //查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
+            List<List<BaseNewStudent>> result = new ArrayList<>();
+            for (int i = 0; i < classList.size(); i++) {
+                result.add(new ArrayList<>());
+            }
+            if(result.size() == 1){
+                continue;
+            }
+
             // 1、先把每个专业匹配的学生分组存一起,并按照分数高低排序
             List<BaseNewStudent> stuList = new ArrayList<>();
 
@@ -460,15 +496,9 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 Collections.sort(stuList, (s1, s2) -> (int) (s2.getScore().doubleValue() - s1.getScore().doubleValue())); //按照成绩降序排序
             }
 
-            //查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
-            List<List<BaseNewStudent>> result = new ArrayList<>();
-            for (int i = 0; i < classList.size(); i++) {
-                result.add(new ArrayList<>());
-            }
-
             for (int i = 0; i < stuList.size(); i++) {
                 BaseNewStudent currentStudent = stuList.get(i);
-                int classIndex = i % classList.size(); //分配班级
+                int classIndex = i % result.size(); //分配班级
                 result.get(classIndex).add(currentStudent);
             }
 
@@ -649,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;
+}

+ 0 - 2
src/main/java/com/xjrsoft/module/base/controller/WhitelistManagementController.java

@@ -33,8 +33,6 @@ 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.List;
 import java.util.concurrent.CompletableFuture;
 

+ 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> {
+}

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

@@ -23,7 +23,7 @@ public interface IWhitelistManagementService extends MPJBaseService<WhitelistMan
 
     String GetCredentialNumber(String credentialNumber);
 
-    Long GetPhone(long l);
+    String GetPhone(String l);
 
     Long getUserId(String credentialNumber);
 

+ 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 {
+}

+ 5 - 6
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);
     }
 
@@ -119,12 +118,12 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
             try {
                 if (this.checkExist(vo.getCredentialNumber())) continue;
 
-                String name = this.GetName(vo.getName()).toString();
-                String credentialNumber = this.GetCredentialNumber(vo.getCredentialNumber()).toString();
+                String name = this.GetName(vo.getName());
+                String credentialNumber = this.GetCredentialNumber(vo.getCredentialNumber());
                 Long userId = this.getUserId(credentialNumber);
-                Long phone = this.GetPhone(Long.parseLong(vo.getPhone().toString()));
+                String phone = this.GetPhone(vo.getPhone().toString());
 
-                if (!name.isEmpty() && !credentialNumber.isEmpty() && !phone.toString().isEmpty()) {
+                if (!name.isEmpty() && !credentialNumber.isEmpty() && !phone.isEmpty()) {
                     WhitelistManagement whitelistManagement = new WhitelistManagement();
                     whitelistManagement.setCreateDate(new Date());
                     whitelistManagement.setDeleteMark(0);

+ 1 - 1
src/main/java/com/xjrsoft/module/form/controller/FormExecuteController.java

@@ -251,7 +251,7 @@ public class FormExecuteController {
         List<Map<Integer, Object>> exportList = new ArrayList<>();
         if (!dto.getIsTemplate()) {
             // 构建导出数据格式
-            dto.setIsTrans(false);
+//            dto.setIsTrans(false);
 //            Boolean isPage = formReleaseConfig.getListConfig().getIsPage();
             List<Entity> dataList = formExecuteService.list(dto);
 //            if (isPage) {

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

@@ -1603,7 +1603,6 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
 
         List<QueryConfig> queryConfigs = formReleaseConfig.getListConfig().getQueryConfigs();
 
-
         //如果有左侧树 需要把所选项目 where 条件加上
         if (formReleaseConfig.getListConfig().getIsLeftMenu()) {
             //如果已经包含此字段  就不添加了

+ 4 - 1
src/main/java/com/xjrsoft/module/form/utils/FormDataTransUtil.java

@@ -142,7 +142,10 @@ public final class FormDataTransUtil {
                     || (StrUtil.equalsIgnoreCase(ComponentTypeConstant.INFO, type) && infoType.equals(0))) {
                 if (userMap == null) {
                     List<User> userList = redisUtil.get(GlobalConstant.USER_CACHE_KEY, new TypeReference<List<User>>() {});
-                    userMap = userList.stream().collect(Collectors.toMap(user -> user.getId().toString(), User::getName, (e1, e2) -> e1));
+                    userMap = userList.stream()
+                            .filter(user -> user.getId() != null)
+                            .filter(user -> user.getName() != null)
+                            .collect(Collectors.toMap(user -> user.getId().toString(), User::getName, (e1, e2) -> e1));
                 }
                 if (infoType == null) {
                     multiFieldMap.put(bindField, null);

+ 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);
-
-
         }
     }
 }

+ 8 - 10
src/main/java/com/xjrsoft/module/material/controller/MaterialTaskController.java

@@ -17,16 +17,7 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.app.dto.UpdateEnableMarkDto;
 import com.xjrsoft.module.form.dto.FormExecuteInfoDto;
 import com.xjrsoft.module.form.service.IFormExecuteService;
-import com.xjrsoft.module.material.dto.AddMaterialTaskAssignDto;
-import com.xjrsoft.module.material.dto.AddMaterialTaskDto;
-import com.xjrsoft.module.material.dto.MaterialTaskAssignAppendixDto;
-import com.xjrsoft.module.material.dto.MaterialTaskAssignApprovedDto;
-import com.xjrsoft.module.material.dto.MaterialTaskAssignListDto;
-import com.xjrsoft.module.material.dto.MaterialTaskAssignPageDto;
-import com.xjrsoft.module.material.dto.MaterialTaskPageDto;
-import com.xjrsoft.module.material.dto.MaterialTaskWaitPageDto;
-import com.xjrsoft.module.material.dto.UpdateMaterialTaskDto;
-import com.xjrsoft.module.material.dto.ViewContentDto;
+import com.xjrsoft.module.material.dto.*;
 import com.xjrsoft.module.material.entity.MaterialTask;
 import com.xjrsoft.module.material.entity.MaterialTaskAppendix;
 import com.xjrsoft.module.material.entity.MaterialTaskAssign;
@@ -275,4 +266,11 @@ public class MaterialTaskController {
             setId(dto.getId());
         }}));
     }
+
+    @GetMapping("/form-data-export-query")
+    @ApiOperation(value = "表单缴交数据条件导出")
+    public ResponseEntity<byte[]> formDataExportQuery(@Valid @RequestBody FormDataExportQueryDto dto) {
+        ByteArrayOutputStream bot = materialTaskService.formDataExportQuery(dto);
+        return RT.fileStream(bot.toByteArray(), "MaterialFormData" + ExcelTypeEnum.XLSX.getValue());
+    }
 }

+ 31 - 0
src/main/java/com/xjrsoft/module/material/dto/FormDataExportQueryDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.material.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+* @title: 材料提交任务类型分配
+* @Author baicai
+* @Date: 2023-10-31
+* @Version 1.0
+*/
+@Data
+public class FormDataExportQueryDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 表单模板id
+     */
+    @ApiModelProperty("自定义表单 表单模板id")
+    private Long templateId;
+
+    /**
+     * 表单数据id
+     */
+    @ApiModelProperty("表单数据id")
+    private Long formDataId;
+}

+ 4 - 0
src/main/java/com/xjrsoft/module/material/service/IMaterialTaskService.java

@@ -2,12 +2,14 @@ package com.xjrsoft.module.material.service;
 
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.material.dto.AddMaterialTaskDto;
+import com.xjrsoft.module.material.dto.FormDataExportQueryDto;
 import com.xjrsoft.module.material.dto.MaterialTaskAssignAppendixDto;
 import com.xjrsoft.module.material.dto.MaterialTaskAssignListDto;
 import com.xjrsoft.module.material.entity.MaterialTask;
 import com.xjrsoft.module.material.vo.MaterialTaskAssignListVo;
 import com.xjrsoft.module.material.vo.MaterialTaskVo;
 
+import java.io.ByteArrayOutputStream;
 import java.util.List;
 
 /**
@@ -54,4 +56,6 @@ public interface IMaterialTaskService extends MPJBaseService<MaterialTask> {
     void sendMessage(Long materialTaskId);
 
     List<MaterialTaskAssignListVo> assignList(MaterialTaskAssignListDto dto);
+
+    ByteArrayOutputStream formDataExportQuery(FormDataExportQueryDto dto);
 }

+ 54 - 10
src/main/java/com/xjrsoft/module/material/service/impl/MaterialTaskServiceImpl.java

@@ -1,7 +1,9 @@
 package com.xjrsoft.module.material.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -11,17 +13,20 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.MaterialCategoryEnum;
+import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.model.generator.ComponentConfig;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.concat.service.IXjrUserService;
 import com.xjrsoft.module.form.dto.FormExecuteAddOrUpdateDto;
+import com.xjrsoft.module.form.entity.FormDesignConfig;
+import com.xjrsoft.module.form.entity.FormTemplate;
+import com.xjrsoft.module.form.mapper.FormTemplateMapper;
 import com.xjrsoft.module.form.service.IFormExecuteService;
-import com.xjrsoft.module.material.dto.AddMaterialTaskAppendixDto;
-import com.xjrsoft.module.material.dto.AddMaterialTaskDto;
-import com.xjrsoft.module.material.dto.MaterialAssignUserDto;
-import com.xjrsoft.module.material.dto.MaterialTaskAssignAppendixDto;
-import com.xjrsoft.module.material.dto.MaterialTaskAssignListDto;
+import com.xjrsoft.module.generator.constant.ComponentTypeConstant;
+import com.xjrsoft.module.generator.entity.TableConfig;
+import com.xjrsoft.module.generator.utils.GeneratorUtil;
+import com.xjrsoft.module.material.dto.*;
 import com.xjrsoft.module.material.entity.MaterialTask;
 import com.xjrsoft.module.material.entity.MaterialTaskAppendix;
 import com.xjrsoft.module.material.entity.MaterialTaskAssign;
@@ -51,6 +56,7 @@ import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.ByteArrayOutputStream;
 import java.time.LocalDate;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
@@ -75,6 +81,8 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
     private final IXjrUserService xjrUserService;
     private final IFormExecuteService formExecuteService;
 
+    private final FormTemplateMapper formTemplateMapper;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Long add(AddMaterialTaskDto dto) {
@@ -433,7 +441,7 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
                 .distinct()
                 .select(MaterialTaskAssign::getId)
                 .selectAs(MaterialTaskAppendix::getFileId, MaterialTaskAssignListVo::getFolderId)
-                .selectAs(MaterialTaskAppendix::getFileId, MaterialTaskAssignListVo::getFormReleaseId)
+                .selectAs(MaterialTaskAppendix::getFileId, MaterialTaskAssignListVo::getFormDataId)
                 .selectAs(MaterialTask::getMaterialCategory, MaterialTaskAssignListVo::getMaterialCategory)
                 .select(XjrUser.class, x -> VoToColumnUtil.fieldsToColumns(MaterialTaskAssignListVo.class).contains(x.getProperty()))
                 .select(MaterialTaskAssign.class, x -> VoToColumnUtil.fieldsToColumns(MaterialTaskAssignListVo.class).contains(x.getProperty()))
@@ -449,6 +457,7 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
                 .eq(Department::getDeleteMark, DeleteMark.NODELETE.getCode())
                 .eq(MaterialTask::getDeleteMark, DeleteMark.NODELETE.getCode())
                 .eq(MaterialTaskAssign::getDeleteMark, DeleteMark.NODELETE.getCode())
+                .eq(MaterialTaskAppendix::getDeleteMark, DeleteMark.NODELETE.getCode())
 //                .select("(\n" +
 //                        "SELECT id FROM xjr_file WHERE id IN (\n" +
 //                        "SELECT file_id FROM material_task_appendix WHERE material_task_id = t.id\n" +
@@ -465,7 +474,43 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
         return pageOutput;
     }
 
-    private boolean sendMessageUtil(MaterialTask materialTask ) {
+    @Override
+    public ByteArrayOutputStream formDataExportQuery(FormDataExportQueryDto dto) {
+        //自定义表单数据
+        FormTemplate template = formTemplateMapper.selectById(dto.getTemplateId());
+
+        String formJson = template.getFormJson();
+        //自定义表单配置
+        FormDesignConfig formDesignConfig = JSONUtil.toBean(formJson, FormDesignConfig.class);
+        //表关系配置
+        List<TableConfig> tableConfigs = formDesignConfig.getTableConfigs();
+        //主表
+        Optional<TableConfig> mainTable = tableConfigs.stream().filter(TableConfig::getIsMain).findFirst();
+
+        if (mainTable.isPresent()) {
+            TableConfig tableConfig = mainTable.get();
+            String tableName = tableConfig.getTableName();
+
+            Map<String, List<ComponentConfig>> formComponentListMap = GeneratorUtil.buildFormComponentList(formDesignConfig.getFormJson().getList());
+            List<String> fieldsList = new ArrayList<>();
+            for (ComponentConfig config : formComponentListMap.get(tableName)) {
+                String type = config.getType();
+                if (StrUtil.equalsIgnoreCase(type, ComponentTypeConstant.TIME_RANGE) || StrUtil.equalsIgnoreCase(type, ComponentTypeConstant.DATE_RANGE)) {
+                    fieldsList.add(config.getBindStartTime());
+                    fieldsList.add(config.getBindEndTime());
+                } else {
+                    fieldsList.add(config.getBindField());
+                }
+            }
+
+            //return getFormData(tableName, fieldsList, formDesignConfig, dto.getId());
+        } else {
+            throw new MyException("主表不存在");
+        }
+        return null;
+    }
+
+    private void sendMessageUtil(MaterialTask materialTask ) {
         IUserService userService = SpringUtil.getBean(IUserService.class);
         RedisUtil redisUtil = SpringUtil.getBean(RedisUtil.class);
         List<User> userList = redisUtil.get(GlobalConstant.USER_CACHE_KEY, new TypeReference<List<User>>() {
@@ -477,7 +522,7 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
         }
 
         if(materialTask.getCreateUserId() == null){
-            return false;
+            return;
         }
 
         User createUser = userList.stream().filter(u -> materialTask.getCreateUserId().equals(u.getId())).findFirst().orElse(new User());
@@ -507,6 +552,5 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
             weChatSendMessageDto.setContent(data);
             weChatService.sendTemplateMessage(weChatSendMessageDto);
         };
-        return true;
     }
 }

+ 0 - 11
src/main/java/com/xjrsoft/module/material/vo/MaterialTaskAssignListVo.java

@@ -70,22 +70,11 @@ public class MaterialTaskAssignListVo {
      */
     @ApiModelProperty("文件模板")
     private List<File> files;
-    /**
-     * 表单发布
-     */
-    @ApiModelProperty("表单发布")
-    private Long formReleaseId;
-    /**
-     * 表单发布
-     */
-    @ApiModelProperty("表单发布")
-    private String formReleaseIdCn;
     /**
      * 表单数据id
      */
     @ApiModelProperty("表单数据id")
     private Long formDataId;
-
     /**
      * 用户名字
      */

+ 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(@RequestParam 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);
-    }
 }

+ 13 - 4
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)
@@ -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);
+
+    }
+
 }

+ 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);
 }

+ 59 - 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,47 @@ 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.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)
+        );
+        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);
-    }
 }

+ 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;
 }

+ 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:已分配)
     */

+ 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);
 }

+ 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);
 }

+ 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);
     }
 
     /**

+ 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>

+ 179 - 0
src/main/resources/sqlScript/20240708_sql.sql

@@ -0,0 +1,179 @@
+-- 教研培训
+DROP TABLE IF EXISTS `wf_teacher_training`;
+CREATE TABLE `wf_teacher_training`
+(
+    id               bigint       not null comment '主键编号'
+        primary key,
+    create_user_id   bigint       null comment '创建人',
+    create_date      datetime     null comment '创建时间',
+    modify_user_id   bigint       null comment '修改人',
+    modify_date      datetime     null comment '修改时间',
+    delete_mark      int          not null comment '删除标记',
+    enabled_mark     int          not null comment '有效标志',
+    sort_code        int          null comment '序号',
+    training_name    varchar(256) null comment '培训活动名称',
+    training_topic   text         null comment '培训活动主题',
+    person_in_charge varchar(256) null comment '培训负责人',
+    start_time       datetime     null comment '培训开始时间',
+    end_time         datetime     null comment '培训结束时间',
+    training_address varchar(512) null comment '培训地点',
+    `remark`         VARCHAR(1000)         DEFAULT NULL COMMENT '备注',
+    `status`         INT          NOT NULL DEFAULT '0' COMMENT '状态(1:结束 0:未结束)'
+)
+    comment 'wf_teacher_training';
+
+-- 教研培训参与培训人员
+DROP TABLE IF EXISTS `wf_teacher_training_participant`;
+CREATE TABLE `wf_teacher_training_participant`
+(
+    id                     bigint       not null comment '主键编号'
+        primary key,
+    create_user_id         bigint       null comment '创建人',
+    create_date            datetime     null comment '创建时间',
+    modify_user_id         bigint       null comment '修改人',
+    modify_date            datetime     null comment '修改时间',
+    delete_mark            int          not null comment '删除标记',
+    enabled_mark           int          not null comment '有效标志',
+    sort_code              int          null comment '序号',
+    wf_teacher_training_id bigint       null comment '教研培训主键id(wf_teacher_training)',
+    participant_id         bigint       null comment '参与培训人id',
+    participant_username   varchar(256) null comment '参与培训人oa',
+    participant_name       varchar(256) null comment '参与培训人姓名'
+)
+    comment '教研培训参与培训人员';
+
+-- 校内实训基地数据项
+DROP TABLE IF EXISTS `school_training_base`;
+CREATE TABLE school_training_base
+(
+    id                     bigint        not null comment '主键编号'
+        primary key,
+    create_user_id         bigint        null comment '创建人',
+    create_date            datetime      null comment '创建时间',
+    modify_user_id         bigint        null comment '修改人',
+    modify_date            datetime      null comment '修改时间',
+    delete_mark            int           not null comment '删除标记',
+    enabled_mark           int           not null comment '有效标志',
+    sort_code              int           null comment '序号',
+    training_base_name     VARCHAR(255)  NOT NULL COMMENT '实训基地名称',
+    training_base_number   VARCHAR(255)  null DEFAULT '0' COMMENT '实训基地编号',
+    training_rooms_number  INT           NOT NULL COMMENT '实训室数,数字标识,例:22',
+    training_project_total INT           NOT NULL COMMENT '实训项目总数,数字标识,例:33',
+    base_category          VARCHAR(255)  NOT NULL COMMENT '基地类别代码(SXJDLBDM)',
+    approve_date           date          NOT NULL COMMENT '批准日期,格式:YYYYMMDD,如:2006-04-12',
+    setup_year             VARCHAR(10)   NOT NULL COMMENT '成立年度,格式:YYYY,如:2006',
+    base_major_id          bigint        null DEFAULT null COMMENT '面向专业',
+    base_major_name        VARCHAR(256)  null DEFAULT '' COMMENT '专业名字',
+    support_department     VARCHAR(255)  null DEFAULT '' COMMENT '被列为实训基地项目支持部门',
+    build_area             DOUBLE(10, 2) null DEFAULT 0 COMMENT '建筑面积',
+    instrument_total       INT           null DEFAULT 0 COMMENT '仪器设备总数,数字标识,例:33',
+    station_number         INT           null DEFAULT 0 COMMENT '实践教学工位数,数字标识,例:33',
+    manager_number_allied  INT           null DEFAULT 0 COMMENT '管理人员数(专职)',
+    manager_number_part    INT           null DEFAULT 0 COMMENT '管理人员数(兼职)'
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4
+    COMMENT ='校内实训基地数据表';
+
+-- 学生证书表
+DROP TABLE IF EXISTS `student_cert_table`;
+CREATE TABLE student_cert_table
+(
+    id                 bigint       not null comment '主键编号'
+        primary key,
+    create_user_id     bigint       null comment '创建人',
+    create_date        datetime     null comment '创建时间',
+    modify_user_id     bigint       null comment '修改人',
+    modify_date        datetime     null comment '修改时间',
+    delete_mark        int          not null comment '删除标记',
+    enabled_mark       int          not null comment '有效标志',
+    sort_code          int          null comment '序号',
+    student_id         varchar(64)  NOT NULL COMMENT '学号',
+    student_name       varchar(64)  not null comment '学生姓名',
+    student_gender     varchar(32)  NOT NULL COMMENT '性别',
+    class_name         varchar(64)  not null comment '学生班级',
+    teacher_id         bigint       NOT NULL COMMENT '教师id',
+    teacher_name       varchar(64)  NOT NULL COMMENT '教师姓名',
+    cert_name          varchar(255) NOT NULL COMMENT '证书名称',
+    cert_id            varchar(128) NOT NULL COMMENT '证书编号',
+    cert_grade         varchar(64)  NOT NULL COMMENT '证书等级',
+    cert_organizations varchar(255) NOT NULL COMMENT '证书发放机构',
+    cert_date          date         NOT NULL COMMENT '证书发放日期',
+    cert_electronic    varchar(64)  NOT NULL COMMENT '是否支持电子证书(0:否,1:是)',
+    remark             varchar(255) DEFAULT NULL COMMENT '备注',
+    file_id            longtext     NOT NULL COMMENT '附件',
+    status             int          NOT NULL COMMENT '状态(1:结束 0:未结束)'
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='学生证书表';
+
+-- 合作企业表
+DROP TABLE IF EXISTS `company_coop`;
+CREATE TABLE `company_coop`
+(
+    id                 bigint       not null comment '主键编号'
+        primary key,
+    create_user_id     bigint       null comment '创建人',
+    create_date        datetime     null comment '创建时间',
+    modify_user_id     bigint       null comment '修改人',
+    modify_date        datetime     null comment '修改时间',
+    delete_mark        int          not null comment '删除标记',
+    enabled_mark       int          not null comment '有效标志',
+    sort_code          int          null comment '序号',
+    `company_name`     varchar(255) NOT NULL COMMENT '企业名称',
+    `company_type`     varchar(64)  NOT NULL COMMENT '企业性质(企业性质字典编号)',
+    `company_size`     varchar(64)  NOT NULL COMMENT '企业规模(企业规模字典标号)',
+    `company_person`   varchar(255) NOT NULL COMMENT '法人代表',
+    `company_position` varchar(255) NOT NULL COMMENT '企业地址',
+    `contact`          varchar(255) NOT NULL COMMENT '联系人',
+    `phone`            varchar(32)  NOT NULL COMMENT '联系电话',
+    `partner_type`     varchar(64)  NOT NULL COMMENT '合作状态(状态类型字典编号)',
+    `sector`           varchar(64)  NOT NULL COMMENT '所属行业(行业类型字典编号)',
+    `industry`         varchar(64)  NOT NULL COMMENT '所属产业(产业类型字典编号)',
+    `company_email`    varchar(255) NULL DEFAULT NULL COMMENT '企业邮箱',
+    `contact_email`    varchar(255) NULL DEFAULT NULL COMMENT '联系人邮箱',
+    `company_fax`      varchar(255) NULL DEFAULT NULL COMMENT '企业传真',
+    `company_register` varchar(255) NULL DEFAULT NULL COMMENT '企业注册号',
+    `company_website`  varchar(512) NULL DEFAULT NULL COMMENT '企业网址'
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='合作企业表';
+
+-- 奖助学金申请表
+DROP TABLE IF EXISTS `scholarship_bursary_applications`;
+CREATE TABLE `scholarship_bursary_applications`
+(
+    `id`                                   bigint       NOT NULL COMMENT '主键编号',
+    `create_user_id`                       bigint       NULL DEFAULT NULL COMMENT '创建人',
+    `create_date`                          datetime     NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id`                       bigint       NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date`                          datetime     NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark`                          int          NOT NULL COMMENT '删除标记',
+    `enabled_mark`                         int          NOT NULL COMMENT '有效标志',
+    `sort_code`                            int          NULL DEFAULT NULL COMMENT '序号',
+    `class_name`                           varchar(256) NOT NULL COMMENT '班级',
+    `student_name`                         varchar(64)  not null comment '学生姓名',
+    `student_gender`                       varchar(32)  NOT NULL COMMENT '学生性别',
+    `identification_number`                varchar(64)  NOT NULL COMMENT '身份证号',
+    `base_semester`                        varchar(256) NOT NULL COMMENT '学期',
+    `base_student_scholarship_category_id` varchar(256) NOT NULL COMMENT '申请奖助学金名称',
+    `base_student_scholarship_category`    varchar(256) NOT NULL COMMENT '申请奖助学金名称',
+    `personal_circumstances`               longtext     NOT NULL COMMENT '描述个人情况',
+    `application_reason`                   longtext     NOT NULL COMMENT '阐述申请理由',
+    `bank_name`                            varchar(256) NOT NULL COMMENT '收款银行名称',
+    `bank_card_number`                     varchar(256) NOT NULL COMMENT '银行卡号',
+    `bank_account_name`                    varchar(256) NOT NULL COMMENT '账户名称',
+    `file_id`                              longtext     NULL COMMENT '佐证材料',
+    `status`                               int          NULL DEFAULT 0 COMMENT '状态(1:结束 0:未结束)',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='奖助学金申请表';
+
+
+
+
+
+
+
+
+
+
+
+

+ 118 - 0
src/main/resources/sqlScript/20240711_sql.sql

@@ -0,0 +1,118 @@
+-- 校外实训基地数据项
+DROP TABLE IF EXISTS `outside_training_base`;
+CREATE TABLE outside_training_base
+(
+    id                   bigint       not null comment '主键编号' primary key,
+    create_user_id       bigint       null comment '创建人',
+    create_date          datetime     null comment '创建时间',
+    modify_user_id       bigint       null comment '修改人',
+    modify_date          datetime     null comment '修改时间',
+    delete_mark          int          not null comment '删除标记',
+    enabled_mark         int          not null comment '有效标志',
+    sort_code            int          null comment '序号',
+    training_base_name   VARCHAR(255) NOT NULL comment '实训基地名称',
+    training_base_number VARCHAR(255) null comment '实训基地编号',
+    company_coop_id      bigint       NOT NULL comment '所属合作企业(company_coop)',
+    company_coop_name    varchar(300) NOT NULL comment '所属合作企业',
+    establish_date       date         NOT NULL comment '基地成立年月,格式:YYYYMMDD,如:2006-04-12',
+    team_status          VARCHAR(255) NOT NULL comment '合作状态',
+    protocol_state       varchar(128) null comment '合作协议签署状态',
+    team_began_date      date         null comment '合作开始时间',
+    team_end_date        date         null comment '合作结束时间'
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4
+    COMMENT ='校外实训基地数据表';
+
+-- 实训室维护数据表
+DROP TABLE IF EXISTS `training_protuct`;
+CREATE TABLE `training_protuct`
+(
+    id                          bigint       not null comment '主键编号' primary key,
+    create_user_id              bigint       null comment '创建人',
+    create_date                 datetime     null comment '创建时间',
+    modify_user_id              bigint       null comment '修改人',
+    modify_date                 datetime     null comment '修改时间',
+    delete_mark                 int          not null comment '删除标记',
+    enabled_mark                int          not null comment '有效标志',
+    sort_code                   int          null comment '序号',
+    `training_room_name`        varchar(255) NOT NULL COMMENT '实训室名称',
+    `training_number`           varchar(32)  NOT NULL COMMENT '实训室号',
+    `department_id`             bigint       NOT NULL COMMENT '所属机构(xjr_department)',
+    `department_name`           varchar(255) NOT NULL COMMENT '所属机构',
+    `school_training_base_id`   bigint       NOT NULL COMMENT '所属实训基地id(school_training_base)',
+    `school_training_base_name` varchar(255) NOT NULL COMMENT '所属实训基地',
+    `training_createdate`       date         NOT NULL COMMENT '实验室建立日期',
+    `contact_id`                bigint       NOT NULL COMMENT '负责人(xjr_user)',
+    `contact_name`              varchar(255) NOT NULL COMMENT '负责人',
+    `works_number`              int          NOT NULL COMMENT '工位数',
+    `room_number`               varchar(255) NOT NULL COMMENT '房间号',
+    `room_name`                 varchar(255) NOT NULL COMMENT '房间名称',
+    `company_coop_id`           bigint       NULL COMMENT '实训室合作企业id(company_coop)',
+    `company_coop_name`         varchar(255) NULL COMMENT '实验室合作企业'
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4
+    COMMENT ='实训室维护数据表';
+
+-- 实训项目维护
+DROP TABLE IF EXISTS `training_project_safe`;
+create table training_project_safe
+(
+    id                     bigint       not null comment '主键编号'
+        primary key,
+    create_user_id         bigint       null comment '创建人',
+    create_date            datetime     null comment '创建时间',
+    modify_user_id         bigint       null comment '修改人',
+    modify_date            datetime     null comment '修改时间',
+    delete_mark            int          not null comment '删除标记',
+    enabled_mark           int          not null comment '有效标志',
+    sort_code              int          null comment '序号',
+    training_name          varchar(255) not null comment '实训项目名称',
+    training_code          varchar(255) not null comment '实训项目编号',
+    base_major_id          bigint       not null comment '归口专业id(base_major)',
+    base_major_name        varchar(255) not null comment '归口专业名称',
+    dummy_pro              varchar(25)  not null comment '是否虚拟仿真实训项目',
+    skill_request          varchar(255) comment '技能要求',
+    assorted_resource_name varchar(512) comment '配套实训资源名称',
+    model_count            int comment '模块数量',
+    assess_manner          varchar(255) comment '考核方式',
+    out_service            varchar(25)  not null comment '是否对外服务',
+    student_class_count    int comment '学生实训课时数',
+    study_year             varchar(255) not null comment '学年(度)',
+    base_semester_id       bigint not null comment '学期id(base_semester)',
+    base_semester_name     varchar(255) not null comment '学期名称',
+    training_address       varchar(255) comment '实训地点',
+    training_protuct_id    bigint comment '校内实训室id',
+    training_protuct_name  varchar(255) comment '校内实训室'
+) comment '实训项目维护';
+
+DROP TABLE IF EXISTS `practical_tt_records`;
+CREATE TABLE `practical_tt_records`
+(
+    `id`                                bigint       NOT NULL COMMENT '主键编号',
+    `create_user_id`                    bigint       NULL DEFAULT NULL COMMENT '创建人',
+    `create_date`                       datetime     NULL DEFAULT NULL COMMENT '创建时间',
+    `modify_user_id`                    bigint       NULL DEFAULT NULL COMMENT '修改人',
+    `modify_date`                       datetime     NULL DEFAULT NULL COMMENT '修改时间',
+    `delete_mark`                       int          NOT NULL COMMENT '删除标记',
+    `enabled_mark`                      int          NOT NULL COMMENT '有效标志',
+    `sort_code`                         int          NULL DEFAULT NULL COMMENT '序号',
+    `student_name`                      varchar(255) NOT NULL COMMENT '学生姓名',
+    `student_id`                        bigint       NULL DEFAULT NULL COMMENT '学号',
+    `name_project`                      varchar(255) NOT NULL COMMENT '实训项目名称',
+    base_major_id                       bigint       not null comment '所属专业id(base_major)',
+    base_major_name                     varchar(255) not null comment '所属专业名称',
+    `supporting_training_software_name` varchar(255) NOT NULL COMMENT '配套实训软件名称',
+    `use_date`                          date         NOT NULL COMMENT '使用日期',
+    `duration_training`                 double       NOT NULL COMMENT '学生实训时长',
+    `evaluation_results`                varchar(255) NOT NULL COMMENT '实训结果综合评价',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='实训教学过程';
+
+
+
+
+
+
+
+

+ 0 - 4
src/test/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImplTest.java

@@ -1,13 +1,9 @@
 package com.xjrsoft.module.student.service.impl;
 
-import com.aliyun.dingtalkchengfeng_1_0.models.CfOrgResp;
-import com.xjrsoft.module.room.service.IWfRoomApplicantService;
 import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
-
-import static org.junit.jupiter.api.Assertions.*;
 @SpringBootTest
 class BaseStudentAssessmentInspectionServiceImplTest {
     @Autowired