Browse Source

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

# Conflicts:
#	src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java
#	src/main/java/com/xjrsoft/module/student/service/IStudentManagerService.java
#	src/main/java/com/xjrsoft/module/student/service/impl/StudentManagerServiceImpl.java
#	src/main/resources/sqlScript/20240718_sql.sql
大数据与最优化研究所 4 months ago
parent
commit
e2b50e6183
34 changed files with 1851 additions and 3 deletions
  1. 3 3
      src/main/java/com/xjrsoft/module/base/service/impl/WhitelistManagementServiceImpl.java
  2. 49 0
      src/main/java/com/xjrsoft/module/job/ExamScoreDataTask.java
  3. 154 0
      src/main/java/com/xjrsoft/module/xycxedu/controller/ExamPlanController.java
  4. 45 0
      src/main/java/com/xjrsoft/module/xycxedu/controller/ExamSubjectScoreController.java
  5. 43 0
      src/main/java/com/xjrsoft/module/xycxedu/dto/AddExamPlanDto.java
  6. 31 0
      src/main/java/com/xjrsoft/module/xycxedu/dto/ExamPlanPageDto.java
  7. 31 0
      src/main/java/com/xjrsoft/module/xycxedu/dto/ExamStatisticsPageDto.java
  8. 27 0
      src/main/java/com/xjrsoft/module/xycxedu/dto/ExamSubjectScoreDto.java
  9. 32 0
      src/main/java/com/xjrsoft/module/xycxedu/dto/UpdateExamPlanDto.java
  10. 93 0
      src/main/java/com/xjrsoft/module/xycxedu/entity/ExamPlan.java
  11. 97 0
      src/main/java/com/xjrsoft/module/xycxedu/entity/ExamSubjectScore.java
  12. 71 0
      src/main/java/com/xjrsoft/module/xycxedu/entity/XycxeduExamList.java
  13. 17 0
      src/main/java/com/xjrsoft/module/xycxedu/mapper/ExamPlanMapper.java
  14. 27 0
      src/main/java/com/xjrsoft/module/xycxedu/mapper/ExamSubjectScoreMappper.java
  15. 16 0
      src/main/java/com/xjrsoft/module/xycxedu/mapper/XycxeduExamListMappper.java
  16. 17 0
      src/main/java/com/xjrsoft/module/xycxedu/service/IExamPlanService.java
  17. 28 0
      src/main/java/com/xjrsoft/module/xycxedu/service/IExamSubjectScoreService.java
  18. 15 0
      src/main/java/com/xjrsoft/module/xycxedu/service/IXycxeduExamListService.java
  19. 25 0
      src/main/java/com/xjrsoft/module/xycxedu/service/impl/ExamPlanServiceImpl.java
  20. 38 0
      src/main/java/com/xjrsoft/module/xycxedu/service/impl/ExamSubjectScoreServiceImpl.java
  21. 19 0
      src/main/java/com/xjrsoft/module/xycxedu/service/impl/XycxeduExamListServiceImpl.java
  22. 66 0
      src/main/java/com/xjrsoft/module/xycxedu/util/ApiUtil.java
  23. 129 0
      src/main/java/com/xjrsoft/module/xycxedu/util/DataUtil.java
  24. 26 0
      src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanListVo.java
  25. 103 0
      src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanPageVo.java
  26. 44 0
      src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanVo.java
  27. 41 0
      src/main/java/com/xjrsoft/module/xycxedu/vo/ExamStatisticsPageVo.java
  28. 36 0
      src/main/java/com/xjrsoft/module/xycxedu/vo/ExamSubjectScorePageVo.java
  29. 27 0
      src/main/java/com/xjrsoft/module/xycxedu/vo/XycxeduExamListVo.java
  30. 42 0
      src/main/resources/mapper/xycxedu/ExamSubjectScoreMappper.xml
  31. 316 0
      src/main/resources/sqlScript/20240627_sql.sql
  32. 42 0
      src/test/java/com/xjrsoft/module/job/ExamScoreDataTaskTest.java
  33. 33 0
      src/test/java/com/xjrsoft/module/xycxedu/util/ApiUtilTest.java
  34. 68 0
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

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

@@ -125,10 +125,10 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
                 continue;
                 continue;
             }
             }
 
 
-            String name = this.GetName(vo.get(0).toString());
-            String credentialNumber = this.GetCredentialNumber(vo.get(1).toString());
+            String name = vo.get(0).toString();
+            String credentialNumber = vo.get(1).toString();
             Long userId = this.getUserId(credentialNumber);
             Long userId = this.getUserId(credentialNumber);
-            String phone = this.GetPhone(vo.get(2).toString());
+            String phone = vo.get(2).toString();
 
 
             if (!name.isEmpty() && !credentialNumber.isEmpty() && !phone.isEmpty()) {
             if (!name.isEmpty() && !credentialNumber.isEmpty() && !phone.isEmpty()) {
                 WhitelistManagement whitelistManagement = new WhitelistManagement();
                 WhitelistManagement whitelistManagement = new WhitelistManagement();

+ 49 - 0
src/main/java/com/xjrsoft/module/job/ExamScoreDataTask.java

@@ -0,0 +1,49 @@
+package com.xjrsoft.module.job;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.xjrsoft.module.base.service.IBaseCourseSubjectService;
+import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
+import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
+import com.xjrsoft.module.xycxedu.util.DataUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author dzx
+ * @date 2024/5/8
+ */
+@Component
+@Slf4j
+public class ExamScoreDataTask {
+
+    @Autowired
+    private IXycxeduExamListService examListService;
+
+    @Autowired
+    private IExamSubjectScoreService scoreService;
+
+    @Autowired
+    private IBaseCourseSubjectService courseService;
+    @Scheduled(cron = "0 */15 * * * ?")
+    public void RefreshConnectionPool() {
+        String active = SpringUtil.getActiveProfile();
+        if(!"prod".equals(active)){
+            log.info("非正式环境,无法执行数据推送");
+            return;
+        }
+        doExecute();
+    }
+
+    void doExecute(){
+        //同步考试计划数据
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.examListData(examListService);
+
+        //同步成绩
+        dataUtil.studentScoreData(examListService, scoreService, courseService);
+    }
+
+
+}

+ 154 - 0
src/main/java/com/xjrsoft/module/xycxedu/controller/ExamPlanController.java

@@ -0,0 +1,154 @@
+package com.xjrsoft.module.xycxedu.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.base.entity.BaseSemester;
+import com.xjrsoft.module.xycxedu.dto.AddExamPlanDto;
+import com.xjrsoft.module.xycxedu.dto.ExamPlanPageDto;
+import com.xjrsoft.module.xycxedu.dto.ExamStatisticsPageDto;
+import com.xjrsoft.module.xycxedu.dto.UpdateExamPlanDto;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import com.xjrsoft.module.xycxedu.entity.XycxeduExamList;
+import com.xjrsoft.module.xycxedu.service.IExamPlanService;
+import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
+import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
+import com.xjrsoft.module.xycxedu.vo.ExamPlanListVo;
+import com.xjrsoft.module.xycxedu.vo.ExamPlanPageVo;
+import com.xjrsoft.module.xycxedu.vo.ExamPlanVo;
+import com.xjrsoft.module.xycxedu.vo.ExamStatisticsPageVo;
+import com.xjrsoft.module.xycxedu.vo.XycxeduExamListVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/xycxedu" + "/examPlan")
+@Api(value = "/xycxedu"  + "/examPlan",tags = "考试计划维护代码")
+@AllArgsConstructor
+public class ExamPlanController {
+
+
+    private final IExamPlanService examPlanService;
+    private final IXycxeduExamListService examListService;
+    private final IExamSubjectScoreService scoreService;
+    @GetMapping(value = "/page")
+    @ApiOperation(value="考试计划维护列表(分页)")
+    @SaCheckPermission("examplan:detail")
+    public RT<PageOutput<ExamPlanPageVo>> page(@Valid ExamPlanPageDto dto){
+
+        MPJLambdaWrapper<ExamPlan> queryWrapper = new MPJLambdaWrapper<>();
+        queryWrapper.orderByDesc(ExamPlan::getId)
+                .eq(dto.getSemesterId() != null, ExamPlan::getSemesterId, dto.getSemesterId())
+                .like(StrUtil.isNotEmpty(dto.getName()), ExamPlan::getName, dto.getName())
+                .leftJoin(BaseSemester.class, BaseSemester::getId, ExamPlan::getSemesterId)
+                .select(ExamPlan::getId)
+                .selectAs(BaseSemester::getName, ExamPlanPageVo::getSemesterName)
+                .select(ExamPlan.class,x -> VoToColumnUtil.fieldsToColumns(ExamPlanPageVo.class).contains(x.getProperty()));
+        IPage<ExamPlan> page = examPlanService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<ExamPlanPageVo> pageOutput = ConventPage.getPageOutput(page, ExamPlanPageVo.class);
+        for (ExamPlanPageVo record : pageOutput.getList()) {
+            String[] split = record.getMilexamids().split(",");
+            List<Long> milexamids = Arrays.asList(split).stream()
+                    .map(Long::parseLong)
+                    .collect(Collectors.toList());
+            List<XycxeduExamList> list = examListService.list(new QueryWrapper<XycxeduExamList>().lambda().in(XycxeduExamList::getMilexamid, milexamids));
+            Set<String> collect = list.stream().map(XycxeduExamList::getMilexamname).collect(Collectors.toSet());
+            record.setMilexamnames(collect.toString().replace("[", "").replace("]", ""));
+        }
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询考试计划维护信息")
+    @SaCheckPermission("examplan:detail")
+    public RT<ExamPlanVo> info(@RequestParam Long id){
+        ExamPlan examPlan = examPlanService.getById(id);
+        if (examPlan == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(examPlan, ExamPlanVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增考试计划维护")
+    @SaCheckPermission("examplan:add")
+    public RT<Boolean> add(@Valid @RequestBody AddExamPlanDto dto){
+        ExamPlan examPlan = BeanUtil.toBean(dto, ExamPlan.class);
+        boolean isSuccess = examPlanService.save(examPlan);
+        return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改考试计划维护")
+    @SaCheckPermission("examplan:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateExamPlanDto dto){
+
+        ExamPlan examPlan = BeanUtil.toBean(dto, ExamPlan.class);
+        return RT.ok(examPlanService.updateById(examPlan));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除考试计划维护")
+    @SaCheckPermission("examplan:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(examPlanService.removeBatchByIds(ids));
+    }
+
+    @GetMapping(value = "/exam-list")
+    @ApiOperation(value="查询所有考试记录")
+    @SaCheckPermission("examplan:detail")
+    public RT<List<XycxeduExamListVo>> allExam(){
+        List<XycxeduExamList> list = examListService.list();
+        List<XycxeduExamListVo> listVos = BeanUtil.copyToList(list, XycxeduExamListVo.class);
+        return RT.ok(listVos);
+    }
+
+    @GetMapping(value = "/plan-list")
+    @ApiOperation(value="查询所有考试计划")
+    @SaCheckPermission("examplan:detail")
+    public RT<List<ExamPlanListVo>> allPlan(){
+        List<ExamPlan> list = examPlanService.list();
+        List<ExamPlanListVo> listVos = BeanUtil.copyToList(list, ExamPlanListVo.class);
+        return RT.ok(listVos);
+    }
+
+    @GetMapping(value = "/exam-statistics")
+    @ApiOperation(value="考试记录(分页)")
+    @SaCheckPermission("examplan:detail")
+    public RT<PageOutput<ExamStatisticsPageVo>> page(@Valid ExamStatisticsPageDto dto){
+        Page<ExamStatisticsPageVo> page = scoreService.getStatisticsPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<ExamStatisticsPageVo> pageOutput = ConventPage.getPageOutput(page, ExamStatisticsPageVo.class);
+        return RT.ok(pageOutput);
+    }
+}

+ 45 - 0
src/main/java/com/xjrsoft/module/xycxedu/controller/ExamSubjectScoreController.java

@@ -0,0 +1,45 @@
+package com.xjrsoft.module.xycxedu.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto;
+import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
+import com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/xycxedu" + "/ExamSubjectScore")
+@Api(value = "/xycxedu"  + "/ExamSubjectScore",tags = "成绩查询代码")
+@AllArgsConstructor
+public class ExamSubjectScoreController {
+
+
+    private final IExamSubjectScoreService scoreService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="考试成绩查询(分页)")
+    @SaCheckPermission("examplan:detail")
+    public RT<PageOutput<ExamSubjectScorePageVo>> page(@Valid ExamSubjectScoreDto dto){
+        Page<ExamSubjectScorePageVo> page = scoreService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<ExamSubjectScorePageVo> pageOutput = ConventPage.getPageOutput(page, ExamSubjectScorePageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+
+}

+ 43 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/AddExamPlanDto.java

@@ -0,0 +1,43 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class AddExamPlanDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+}

+ 31 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/ExamPlanPageDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+* @title: 考试计划维护分页查询入参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class ExamPlanPageDto extends PageInput {
+
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+
+    @ApiModelProperty("计划名称")
+    private String name;
+
+}

+ 31 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/ExamStatisticsPageDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class ExamStatisticsPageDto extends PageInput {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 用户ID(xjr_user)
+     */
+    @ApiModelProperty("考试名称")
+    private String milexamname;
+    /**
+     * 学号
+     */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("开始时间")
+    private String startDate;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("结束时间")
+    private String endDate;
+}

+ 27 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/ExamSubjectScoreDto.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class ExamSubjectScoreDto extends PageInput {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 用户ID(xjr_user)
+     */
+    @ApiModelProperty("用户id")
+    private Long userId;
+    /**
+     * 学号
+     */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+
+    @ApiModelProperty("考试计划id")
+    private Long examPlanId;
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/UpdateExamPlanDto.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class UpdateExamPlanDto extends AddExamPlanDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 93 - 0
src/main/java/com/xjrsoft/module/xycxedu/entity/ExamPlan.java

@@ -0,0 +1,93 @@
+package com.xjrsoft.module.xycxedu.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+@TableName("exam_plan")
+@ApiModel(value = "exam_plan", description = "考试计划维护")
+public class ExamPlan 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;
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+
+}

+ 97 - 0
src/main/java/com/xjrsoft/module/xycxedu/entity/ExamSubjectScore.java

@@ -0,0 +1,97 @@
+package com.xjrsoft.module.xycxedu.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+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;
+
+
+/**
+* @title: 考试科目成绩表
+* @Author dzx
+* @Date: 2024年7月18日
+* @Version 1.0
+*/
+@Data
+@TableName("exam_subject_score")
+@ApiModel(value = "考试科目成绩表", description = "考试科目成绩表")
+public class ExamSubjectScore 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;
+
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String milexamname;
+    /**
+    * 考试计划id
+    */
+    @ApiModelProperty("考试计划id")
+    private Long milexamid;
+
+    @ApiModelProperty("课程科目id(base_course_subject)")
+    private Long courseSubjectId;
+
+    @ApiModelProperty("课程名称")
+    private String coursename;
+
+    @ApiModelProperty("学生id(xjr_user)")
+    private Long userId;
+
+    @ApiModelProperty("分数")
+    private Integer score;
+
+    @ApiModelProperty("班级排名")
+    private Integer classRanking;
+
+    @ApiModelProperty("年级排名")
+    private Integer gradeRanking;
+
+}

+ 71 - 0
src/main/java/com/xjrsoft/module/xycxedu/entity/XycxeduExamList.java

@@ -0,0 +1,71 @@
+package com.xjrsoft.module.xycxedu.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+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.time.LocalDate;
+import java.util.Date;
+
+
+/**
+* @title: 晓羊策学考试计划表
+* @Author dzx
+* @Date: 2024年7月18日
+* @Version 1.0
+*/
+@Data
+@TableName("xycxedu_exam_list")
+@ApiModel(value = "晓羊策学考试计划表", description = "晓羊策学考试计划表")
+public class XycxeduExamList implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    @ApiModelProperty("主键")
+    @TableId
+    private Long id;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("首次推送时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 表名
+    */
+    @ApiModelProperty("考试计划id")
+    private Long milexamid;
+    /**
+    * 英文姓名
+    */
+    @ApiModelProperty("考试计划名称")
+    private String milexamname;
+    /**
+    * 姓名拼音
+    */
+    @ApiModelProperty("学年")
+    private Integer regyear;
+
+    @ApiModelProperty("年级名称")
+    private String grade;
+
+    @ApiModelProperty("考试时间")
+    private LocalDate sdate;
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/xycxedu/mapper/ExamPlanMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.xycxedu.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Mapper
+public interface ExamPlanMapper extends MPJBaseMapper<ExamPlan> {
+
+}

+ 27 - 0
src/main/java/com/xjrsoft/module/xycxedu/mapper/ExamSubjectScoreMappper.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.xycxedu.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.xycxedu.dto.ExamStatisticsPageDto;
+import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto;
+import com.xjrsoft.module.xycxedu.entity.ExamSubjectScore;
+import com.xjrsoft.module.xycxedu.vo.ExamStatisticsPageVo;
+import com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+* @title: 晓羊策学考试计划表
+* @Author dzx
+* @Date: 2024年7月18日
+* @Version 1.0
+*/
+@Mapper
+public interface ExamSubjectScoreMappper extends MPJBaseMapper<ExamSubjectScore> {
+
+    Long getUserIdByIdNumber(@Param("idNumber") String idNumber);
+
+    Page<ExamSubjectScorePageVo> getPage(Page<ExamSubjectScorePageVo> page, @Param("dto") ExamSubjectScoreDto dto);
+
+    Page<ExamStatisticsPageVo> getStatisticsPage(Page<ExamStatisticsPageVo> page, @Param("dto") ExamStatisticsPageDto dto);
+}

+ 16 - 0
src/main/java/com/xjrsoft/module/xycxedu/mapper/XycxeduExamListMappper.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.xycxedu.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.xycxedu.entity.XycxeduExamList;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 晓羊策学考试计划表
+* @Author dzx
+* @Date: 2024年7月18日
+* @Version 1.0
+*/
+@Mapper
+public interface XycxeduExamListMappper extends MPJBaseMapper<XycxeduExamList> {
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/IExamPlanService.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.xycxedu.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import lombok.Data;
+import java.util.List;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+
+public interface IExamPlanService extends MPJBaseService<ExamPlan> {
+}

+ 28 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/IExamSubjectScoreService.java

@@ -0,0 +1,28 @@
+package com.xjrsoft.module.xycxedu.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.room.dto.RoomPageDto;
+import com.xjrsoft.module.room.vo.RoomPageVo;
+import com.xjrsoft.module.xycxedu.dto.ExamStatisticsPageDto;
+import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto;
+import com.xjrsoft.module.xycxedu.entity.ExamSubjectScore;
+import com.xjrsoft.module.xycxedu.vo.ExamStatisticsPageVo;
+import com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @title: 晓羊策学考试计划表
+ * @Author dzx
+ * @Date: 2024年7月18日
+ * @Version 1.0
+*/
+
+public interface IExamSubjectScoreService extends MPJBaseService<ExamSubjectScore> {
+
+    Long getUserIdByIdNumber(String idNumber);
+
+    Page<ExamSubjectScorePageVo> getPage(Page<ExamSubjectScorePageVo> page, ExamSubjectScoreDto dto);
+
+    Page<ExamStatisticsPageVo> getStatisticsPage(Page<ExamStatisticsPageVo> page, ExamStatisticsPageDto dto);
+}

+ 15 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/IXycxeduExamListService.java

@@ -0,0 +1,15 @@
+package com.xjrsoft.module.xycxedu.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.xycxedu.entity.XycxeduExamList;
+
+/**
+ * @title: 晓羊策学考试计划表
+ * @Author dzx
+ * @Date: 2024年7月18日
+ * @Version 1.0
+*/
+
+public interface IXycxeduExamListService extends MPJBaseService<XycxeduExamList> {
+
+}

+ 25 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/impl/ExamPlanServiceImpl.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.xycxedu.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import com.xjrsoft.module.xycxedu.mapper.ExamPlanMapper;
+import com.xjrsoft.module.xycxedu.service.IExamPlanService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class ExamPlanServiceImpl extends MPJBaseServiceImpl<ExamPlanMapper, ExamPlan> implements IExamPlanService {
+}

+ 38 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/impl/ExamSubjectScoreServiceImpl.java

@@ -0,0 +1,38 @@
+package com.xjrsoft.module.xycxedu.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.xycxedu.dto.ExamStatisticsPageDto;
+import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto;
+import com.xjrsoft.module.xycxedu.entity.ExamSubjectScore;
+import com.xjrsoft.module.xycxedu.mapper.ExamSubjectScoreMappper;
+import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
+import com.xjrsoft.module.xycxedu.vo.ExamStatisticsPageVo;
+import com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * @title: 晓羊策学考试计划表
+ * @Author dzx
+ * @Date: 2024年7月18日
+ * @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectScoreMappper, ExamSubjectScore> implements IExamSubjectScoreService {
+    @Override
+    public Long getUserIdByIdNumber(String idNumber) {
+        return this.baseMapper.getUserIdByIdNumber(idNumber);
+    }
+
+    @Override
+    public Page<ExamSubjectScorePageVo> getPage(Page<ExamSubjectScorePageVo> page, ExamSubjectScoreDto dto) {
+        return this.baseMapper.getPage(page, dto);
+    }
+
+    @Override
+    public Page<ExamStatisticsPageVo> getStatisticsPage(Page<ExamStatisticsPageVo> page, ExamStatisticsPageDto dto) {
+        return this.baseMapper.getStatisticsPage(page, dto);
+    }
+}

+ 19 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/impl/XycxeduExamListServiceImpl.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.xycxedu.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.xycxedu.entity.XycxeduExamList;
+import com.xjrsoft.module.xycxedu.mapper.XycxeduExamListMappper;
+import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * @title: 晓羊策学考试计划表
+ * @Author dzx
+ * @Date: 2024年7月18日
+ * @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class XycxeduExamListServiceImpl extends MPJBaseServiceImpl<XycxeduExamListMappper, XycxeduExamList> implements IXycxeduExamListService {
+}

+ 66 - 0
src/main/java/com/xjrsoft/module/xycxedu/util/ApiUtil.java

@@ -0,0 +1,66 @@
+package com.xjrsoft.module.xycxedu.util;
+
+import cn.hutool.http.HttpUtil;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @author dzx
+ * @date 2024/7/17
+ */
+@Slf4j
+public class ApiUtil {
+
+    private final static int schoolid = 189;
+    private final static String sign = "888";
+    private final static String accessid = "86a5d02ae9f78470";
+
+    private final static String host = "https://openapi.xycxedu.com";
+
+
+    public static JsonArray getExamList() {
+        String url = host + "/exam/list?schoolid=" + schoolid + "&accessid=" + accessid + "&sign=" + sign;
+        String result = HttpUtil.get(url);
+        JsonParser parser = new JsonParser();
+        JsonObject asJsonObject = parser.parse(result).getAsJsonObject();
+        if(asJsonObject.get("data").isJsonNull()){
+            return new JsonArray();
+        }
+        JsonArray jsonArray = asJsonObject.get("data").getAsJsonArray();
+        return jsonArray;
+    }
+
+    public static JsonArray getStudentScoreByCourse(Integer examid) {
+        long timeMillis = System.currentTimeMillis();
+        String url = host + "/exam/totalscore?schoolid=" + schoolid + "&accessid=" + accessid + "&sign=" + sign + "&examid=" + examid + "&timestamp=" + timeMillis;
+        String result = HttpUtil.get(url);
+        JsonParser parser = new JsonParser();
+        JsonObject asJsonObject = parser.parse(result).getAsJsonObject();
+        if(asJsonObject.get("data").isJsonNull()){
+            return new JsonArray();
+        }
+        JsonArray jsonArray = asJsonObject.get("data").getAsJsonArray();
+        return jsonArray;
+    }
+
+    /**
+     * 根据考试id获取考试下的科目信息
+     * @param milexamid
+     * @return
+     */
+    public static JsonArray getCourseByExam(Long milexamid) {
+        long timeMillis = System.currentTimeMillis();
+        String url = host + "/exam/course?schoolid=" + schoolid + "&accessid=" + accessid + "&sign=" + sign + "&milexamid=" + milexamid + "&timestamp=" + timeMillis;
+        String result = HttpUtil.get(url);
+        JsonParser parser = new JsonParser();
+        JsonObject asJsonObject = parser.parse(result).getAsJsonObject();
+        if(asJsonObject.get("data").isJsonNull()){
+            return new JsonArray();
+        }
+        JsonArray jsonArray = asJsonObject.get("data").getAsJsonArray();
+        return jsonArray;
+    }
+
+}

+ 129 - 0
src/main/java/com/xjrsoft/module/xycxedu/util/DataUtil.java

@@ -0,0 +1,129 @@
+package com.xjrsoft.module.xycxedu.util;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.module.base.entity.BaseCourseSubject;
+import com.xjrsoft.module.base.service.IBaseCourseSubjectService;
+import com.xjrsoft.module.xycxedu.entity.ExamSubjectScore;
+import com.xjrsoft.module.xycxedu.entity.XycxeduExamList;
+import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
+import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
+import com.yomahub.liteflow.util.JsonUtil;
+
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author dzx
+ * @date 2024/7/17
+ */
+public class DataUtil {
+
+    /**
+     * 同步考试计划信息
+     * @param examListService
+     */
+    public void examListData(IXycxeduExamListService examListService){
+        JsonArray examList = ApiUtil.getExamList();
+        List<XycxeduExamList> updateList = new ArrayList<>();
+        List<XycxeduExamList> insertList = new ArrayList<>();
+        Date date = new Date();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        for (JsonElement jsonElement : examList) {
+            XycxeduExamList parseObject = new XycxeduExamList();
+            JsonObject object = jsonElement.getAsJsonObject();
+            parseObject.setMilexamname(object.get("milexamname").getAsString());
+            parseObject.setMilexamid(object.get("milexamid").getAsLong());
+            parseObject.setRegyear(object.get("regyear").getAsInt());
+            parseObject.setGrade(object.get("grade").getAsString());
+            parseObject.setSdate(LocalDate.parse(object.get("sdate").getAsString(), formatter));
+            XycxeduExamList oldData = examListService.getOne(
+                    new QueryWrapper<XycxeduExamList>().lambda()
+                            .eq(XycxeduExamList::getMilexamid, parseObject.getMilexamid())
+            );
+            if(oldData != null){
+                BeanUtil.copyProperties(parseObject, oldData);
+                oldData.setModifyDate(date);
+                updateList.add(oldData);
+                continue;
+            }
+
+            parseObject.setCreateDate(date);
+            insertList.add(parseObject);
+        }
+        if(!updateList.isEmpty()){
+            examListService.updateBatchById(updateList);
+        }
+        if(!insertList.isEmpty()){
+            examListService.saveBatch(insertList);
+        }
+    }
+
+    public void studentScoreData(IXycxeduExamListService examListService, IExamSubjectScoreService scoreService, IBaseCourseSubjectService courseService){
+        //  查询出所有的考试计划
+        List<XycxeduExamList> list = examListService.list(
+                new QueryWrapper<XycxeduExamList>().lambda()
+        );
+        Map<Integer, Integer> examidXMilexamidMap = new HashMap<>();//存考试下的科目id和考试id关系
+        Map<Integer, String> examidXCoursenameMap = new HashMap<>();
+        for (XycxeduExamList el : list) {
+            // 根据考试计划,查询出所有科目信息
+            JsonArray courseByExam = ApiUtil.getCourseByExam(el.getMilexamid());
+            for (JsonElement jsonElement : courseByExam) {
+                JsonObject courseObj = jsonElement.getAsJsonObject();
+                examidXMilexamidMap.put(courseObj.get("examid").getAsInt(), courseObj.get("milexamid").getAsInt());
+                examidXCoursenameMap.put(courseObj.get("examid").getAsInt(), courseObj.get("coursename").getAsString());
+            }
+        }
+        Map<String, Long> courseMap = courseService.list(
+                new QueryWrapper<BaseCourseSubject>().lambda().eq(BaseCourseSubject::getDeleteMark, DeleteMark.NODELETE.getCode())
+        ).stream().collect(
+                Collectors.toMap(BaseCourseSubject::getName, BaseCourseSubject::getId)
+        );
+
+        Date date = new Date();
+        // 查询每次考试每个科目的学生的成绩
+        for (Integer examid : examidXMilexamidMap.keySet()) {
+            List<ExamSubjectScore> insertList = new ArrayList<>();
+            JsonArray jsonArray = ApiUtil.getStudentScoreByCourse(examid);
+            for (JsonElement jsonElement : jsonArray) {
+                JsonObject scoreObj = jsonElement.getAsJsonObject();
+                Long userId = scoreService.getUserIdByIdNumber(scoreObj.get("stunum").getAsString());
+
+                long count = scoreService.count(
+                        new QueryWrapper<ExamSubjectScore>().lambda()
+                                .eq(ExamSubjectScore::getUserId, userId)
+                                .eq(ExamSubjectScore::getCourseSubjectId, courseMap.get(examidXCoursenameMap.get(examid)))
+                                .eq(ExamSubjectScore::getMilexamid, examidXMilexamidMap.get(examid).longValue())
+                );
+                if(count > 0){
+                    continue;
+                }
+                ExamSubjectScore score = new ExamSubjectScore() {{
+                    setUserId(userId);
+                    setScore(scoreObj.get("score").getAsInt());
+                    setMilexamid(examidXMilexamidMap.get(examid).longValue());
+                    setGradeRanking(scoreObj.get("gradeorder").getAsInt());
+                    setClassRanking(scoreObj.get("classorder").getAsInt());
+                    setCoursename(examidXCoursenameMap.get(examid));
+                    setCourseSubjectId(courseMap.get(examidXCoursenameMap.get(examid)));
+                    setCreateDate(date);
+                }};
+                insertList.add(score);
+            }
+            if(!insertList.isEmpty()){
+                scoreService.saveBatch(insertList);
+            }
+        }
+    }
+}

+ 26 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanListVo.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 考试计划维护表单出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class ExamPlanListVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("考试计划名称")
+    private String name;
+
+}

+ 103 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanPageVo.java

@@ -0,0 +1,103 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import com.xjrsoft.common.annotation.Trans;
+import com.xjrsoft.common.enums.TransType;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+* @title: 考试计划维护分页列表出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class ExamPlanPageVo {
+
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private String id;
+    /**
+    * 创建人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建人")
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建时间")
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改人")
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+    /**
+    * 修改日期
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改日期")
+    @ApiModelProperty("修改日期")
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("删除标记")
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+    /**
+    * 有效标记
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("有效标记")
+    @ApiModelProperty("有效标记")
+    private Integer enabledMark;
+    /**
+    * 学期id
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学期id")
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+
+    @ApiModelProperty("学期名称")
+    private String semesterName;
+    /**
+    * 考试计划名称
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("考试计划名称")
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("晓羊策学考试计划id")
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+    @ApiModelProperty("晓羊策学考试计划名称")
+    private String milexamnames;
+
+}

+ 44 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanVo.java

@@ -0,0 +1,44 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+/**
+* @title: 考试计划维护表单出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class ExamPlanVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+
+
+}

+ 41 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/ExamStatisticsPageVo.java

@@ -0,0 +1,41 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDate;
+
+/**
+* @title: 考试计划维护表单出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class ExamStatisticsPageVo {
+
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("学期名称")
+    private String semesterName;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("考试名称")
+    private String milexamname;
+
+    @ApiModelProperty("考试时间")
+    private LocalDate sdate;
+
+    @ApiModelProperty("学生数量")
+    private Integer studentCount;
+
+    @ApiModelProperty("班级数量")
+    private Integer classCount;
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+
+}

+ 36 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/ExamSubjectScorePageVo.java

@@ -0,0 +1,36 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 考试计划维护表单出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class ExamSubjectScorePageVo {
+
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("学期名称")
+    private String semesterName;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("考试名称")
+    private String milexamname;
+
+    @ApiModelProperty("科目")
+    private String coursename;
+
+    @ApiModelProperty("成绩")
+    private Integer score;
+
+    @ApiModelProperty("年级排名")
+    private Integer gradeRanking;
+
+
+}

+ 27 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/XycxeduExamListVo.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 考试计划维护表单出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class XycxeduExamListVo {
+
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String milexamname;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("晓羊策学考试计划id")
+    private Long milexamid;
+
+
+}

+ 42 - 0
src/main/resources/mapper/xycxedu/ExamSubjectScoreMappper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.xycxedu.mapper.ExamSubjectScoreMappper">
+    <select id="getUserIdByIdNumber" parameterType="java.lang.String" resultType="java.lang.Long">
+        SELECT t1.id FROM xjr_user t1
+        INNER JOIN base_student t2 ON t1.id = t2.user_id
+        WHERE t1.credential_number = #{idNumber}
+    </select>
+
+    <select id="getPage" parameterType="com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto" resultType="com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo">
+        SELECT t4.name AS semester_name,t2.milexamname,t1.coursename,t1.score,t1.grade_ranking FROM exam_subject_score t1
+        INNER JOIN xycxedu_exam_list t2 ON t1.milexamid = t2.milexamid
+        LEFT JOIN exam_plan t3 ON t3.milexamids LIKE CONCAT('%', t1.milexamid, '%')
+        LEFT JOIN base_semester t4 ON t3.semester_id = t4.id
+        WHERE t1.delete_mark = 0 AND t1.user_id = #{dto.userId}
+        <if test="dto.semesterId != null">
+            and t4.id = #{dto.semesterId}
+        </if>
+        <if test="dto.semesterId != null">
+            and t3.id = #{dto.examPlanId}
+        </if>
+    </select>
+
+    <select id="getStatisticsPage" parameterType="com.xjrsoft.module.xycxedu.dto.ExamStatisticsPageDto" resultType="com.xjrsoft.module.xycxedu.vo.ExamStatisticsPageVo">
+        SELECT t1.id, t1.milexamname,t3.name AS semester_name,t1.sdate,
+        (SELECT COUNT(DISTINCT(user_id)) FROM exam_subject_score WHERE delete_mark = 0 AND milexamid = t1.milexamid) AS student_count,
+        (SELECT COUNT(DISTINCT(a2.class_id)) FROM exam_subject_score a1
+        INNER JOIN base_student_school_roll a2 ON a1.user_id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a1.milexamid = t1.milexamid) AS class_count FROM xycxedu_exam_list t1
+        LEFT JOIN exam_plan t2 ON t2.milexamids LIKE CONCAT('%', t1.milexamid ,'%')
+        LEFT JOIN base_semester t3 ON t2.semester_id = t3.id
+        WHERE t1.delete_mark = 0
+        <if test="dto.semesterId != null">
+            and t3.id = #{dto.semesterId}
+        </if>
+        <if test="dto.startDate != null and dto.endDate != null">
+            and t1.sdate between #{dto.startDate} and #{dto.endDate}
+        </if>
+    </select>
+</mapper>

+ 316 - 0
src/main/resources/sqlScript/20240627_sql.sql

@@ -0,0 +1,316 @@
+-- ----------------------------------------------------------------------------------------
+-- 白名单管理
+-- ----------------------------------------------------------------------------------------   
+DROP TABLE IF EXISTS whitelist_management;
+CREATE TABLE whitelist_management
+(
+    id                BIGINT        NOT NULL COMMENT '主键编号'
+        PRIMARY KEY,
+    create_date       DATETIME      NULL COMMENT '创建时间',
+    modify_date       DATETIME      NULL COMMENT '修改时间',
+    delete_mark       INT           NOT NULL COMMENT '删除标记',
+    enabled_mark      INT           NOT NULL COMMENT '有效标志',
+    user_id             BIGINT      NOT NULL COMMENT '用户id',
+    NAME              VARCHAR(10)   NOT NULL COMMENT '姓名',
+    credential_number        VARCHAR(30)   NOT NULL COMMENT '身份证',
+    phone               BIGINT  NOT NULL  COMMENT '手机号'
+)
+    COMMENT '白名单管理';
+-- ----------------------------------------------------------------------------------------
+-- 新生维护信息
+-- ----------------------------------------------------------------------------------------   
+DROP TABLE IF EXISTS base_new_student;   
+CREATE TABLE `base_new_student` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `graduate_school` VARCHAR(50) DEFAULT NULL COMMENT '毕业学校',
+  `name` VARCHAR(50) DEFAULT NULL COMMENT '学生姓名',
+  `gender` VARCHAR(20) DEFAULT NULL COMMENT '性别(xjr_dictionary_item[gender])',
+  `credential_number` VARCHAR(30) DEFAULT NULL COMMENT '身份证号',
+  `height` DECIMAL(6,1) DEFAULT NULL COMMENT '身高',
+  `weight` DECIMAL(6,1) DEFAULT NULL COMMENT '体重',
+  `score` DECIMAL(6,1) DEFAULT NULL COMMENT '成绩',
+  `graduate_class` VARCHAR(50) DEFAULT NULL COMMENT '毕业班级',
+  `source` VARCHAR(50) DEFAULT NULL COMMENT '学生来源(xjr_dictionary_item[student_type])',
+  `stduy_status` VARCHAR(20) DEFAULT NULL COMMENT '住宿类型(xjr_dictionary_item[stduy_status])',
+  `mobile` VARCHAR(20) DEFAULT NULL COMMENT '手机号',
+  `first_ambition` VARCHAR(50) DEFAULT NULL COMMENT '第一志愿',
+  `second_ambition` VARCHAR(50) DEFAULT NULL COMMENT '第二志愿',
+  `is_adjust` INT DEFAULT NULL COMMENT '是否可调配(0:否,1:是)',
+  `status` INT DEFAULT NULL COMMENT '班级状态(0:未分配, 1:已分配)',
+  `enrollment_plan_id` BIGINT DEFAULT NULL COMMENT '招生计划id(enrollment_plan)',
+  `family_mobile` VARCHAR(20) DEFAULT NULL COMMENT '家庭电话',
+  `family_address` VARCHAR(50) DEFAULT NULL COMMENT '家庭地址',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生维护信息';
+
+
+ALTER TABLE `tl`.`base_new_student`   
+  ADD COLUMN `first_ambition_id` BIGINT NULL   COMMENT '第一志愿专业id(base_class_major_set)' AFTER `enrollment_plan_id`,
+  ADD COLUMN `second_ambition_id` BIGINT NULL   COMMENT '第二志愿专业id(base_class_major_set)' AFTER `first_ambition_id`;
+
+-- ----------------------------------------------------------------------------------------
+-- 新生分班任务
+-- ----------------------------------------------------------------------------------------
+DROP TABLE IF EXISTS banding_task;   
+CREATE TABLE `banding_task` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `grade_id` BIGINT DEFAULT NULL COMMENT '年级id',
+  `enroll_type` VARCHAR(50) DEFAULT NULL COMMENT '招生类型',
+  `name` VARCHAR(30) DEFAULT NULL COMMENT '分班任务名称',
+  `status` INT DEFAULT 0 COMMENT '任务状态(0:未确认 1:已确认)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生分班任务';
+
+-- ----------------------------------------------------------------------------------------
+-- 新生分班规则
+-- ----------------------------------------------------------------------------------------
+DROP TABLE IF EXISTS banding_rule;   
+CREATE TABLE `banding_rule` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(200) DEFAULT NULL COMMENT '规则名称',
+  `code` VARCHAR(50) DEFAULT NULL COMMENT '规则代码',
+  `choose_type` VARCHAR(50) DEFAULT NULL COMMENT '选择方式(radtio:单选, multi:多选)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生分班规则';
+
+DELETE FROM banding_rule;
+INSERT INTO banding_rule(id,create_user_id,create_date,NAME,CODE,choose_type)
+VALUE(1807614834171953155, 1000000000000000000, NOW(), '使每班的男女生性别比例比较均衡(男女比例“1:1”,数量为奇数是多的随机分配)','BR0001','multi');
+INSERT INTO banding_rule(id,create_user_id,create_date,NAME,CODE,choose_type)
+VALUE(1807614834171953156, 1000000000000000000, NOW(), '使每班的学生成绩比例比较均衡(根据成绩均衡分班方法进行均衡分班)','BR0002','multi');
+INSERT INTO banding_rule(id,create_user_id,create_date,NAME,CODE,choose_type)
+VALUE(1807614834171953157, 1000000000000000000, NOW(), '使姓名相同的学生分到不同的班级','BR0003','multi');
+INSERT INTO banding_rule(id,create_user_id,create_date,NAME,CODE,choose_type)
+VALUE(1807614834171953159, 1000000000000000000, NOW(), '使同专业方向班级人数比例比较均衡(同一个专业方向分多个班级时,使每个班级人数比较均衡,数量为奇数是多的随机分配)','BR0004','radio');
+INSERT INTO banding_rule(id,create_user_id,create_date,NAME,CODE,choose_type)
+VALUE(1807614834171953160, 1000000000000000000, NOW(), '使同专业班级一个班级排满在排下一个班级(同一个专业方向分多个班级时,先将第一个班级人数分满,在分第二个班级,以此类推)','BR0005','radio');
+
+UPDATE banding_rule SET delete_mark = 0, enabled_mark = 1;
+
+-- ----------------------------------------------------------------------------------------
+-- 新生分班任务规则
+-- ----------------------------------------------------------------------------------------
+DROP TABLE IF EXISTS banding_task_rule;   
+CREATE TABLE `banding_task_rule` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `banding_rule_id` BIGINT DEFAULT NULL COMMENT '新生分班规则(banding_rule)',
+  `banding_task_id` BIGINT DEFAULT NULL COMMENT '分班任务(banding_task)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生分班任务规则';
+
+-- ----------------------------------------------------------------------------------------
+-- 新生分班任务专业限制条件
+-- ----------------------------------------------------------------------------------------
+DROP TABLE IF EXISTS banding_task_major_condition;   
+CREATE TABLE `banding_task_major_condition` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `major_set_id` BIGINT DEFAULT NULL COMMENT '	',
+  `height` DECIMAL(6,1) DEFAULT NULL COMMENT '身高',
+  `score` DECIMAL(6,1) DEFAULT NULL COMMENT '分数',
+  `banding_task_id` BIGINT DEFAULT NULL COMMENT '分班任务(banding_task)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生分班任务专业限制条件';
+
+-- ----------------------------------------------------------------------------------------
+-- 新生分班任务班级配置
+-- ----------------------------------------------------------------------------------------
+DROP TABLE IF EXISTS banding_task_class;   
+CREATE TABLE `banding_task_class` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(50) DEFAULT NULL COMMENT '规则名称',
+  `major_set_id` BIGINT DEFAULT NULL COMMENT '专业方向id',
+  `number` INT DEFAULT NULL COMMENT '班级人数',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '班主任id',
+  `classroom_id` BIGINT DEFAULT NULL COMMENT '教室id',
+  `is_order_class` INT DEFAULT NULL COMMENT '是否订单班(0:否 1:是)',
+  `height` DECIMAL(6,1) DEFAULT NULL COMMENT '身高',
+  `score` DECIMAL(6,1) DEFAULT NULL COMMENT '分数',
+  `banding_task_id` BIGINT DEFAULT NULL COMMENT '分班任务(banding_task)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生分班任务班级配置';
+
+
+-- ----------------------------------------------------------------------------------------
+-- 新生分班任务班级学生关系表
+-- ----------------------------------------------------------------------------------------
+DROP TABLE IF EXISTS banding_task_class_student;   
+CREATE TABLE `banding_task_class_student` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `banding_task_class_id` BIGINT DEFAULT NULL COMMENT '分班表的id',
+  `new_student_id` BIGINT DEFAULT NULL COMMENT '新生id',
+  `status` INT DEFAULT NULL COMMENT '状态(0:未确认 1:已确认)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生分班任务班级学生关系表';
+
+DROP TABLE IF EXISTS ods_zzxxgkjcsj;   
+CREATE TABLE `ods_zzxxgkjcsj` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATE DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATE DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `school_name` VARCHAR(500) DEFAULT NULL COMMENT '学校名称',
+  `school_code` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学校代码',
+  `school_institution_code` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学校机构代码',
+  `school_type` VARCHAR(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学校类别',
+  `organizer_name` VARCHAR(255) DEFAULT NULL COMMENT '学校举办者名称',
+  `school_organizer_nature` VARCHAR(500) DEFAULT NULL COMMENT '学校举办者性质',
+  `superintendent` VARCHAR(255) DEFAULT NULL COMMENT '学校负责人姓名',
+  `establish_date` DATE DEFAULT NULL COMMENT '建校年月',
+  PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学校基本数据子类表';
+
+
+ALTER TABLE ods_zzxxgkjcsj
+ADD  location VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学校所在地行政区域', 
+ADD  supervisory_department VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学校主管部门',
+ADD  exit_bandwidth VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学校园出口带宽',
+ADD  backbone_bandwidth VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '校园主干网带宽',
+ADD  wired_access INT DEFAULT NULL COMMENT '有线网络接入数',
+ADD  wireless_access INT DEFAULT NULL COMMENT '无线网络接入数',
+ADD  multimedia_classrooms INT DEFAULT NULL COMMENT '多媒体教室数',
+ADD  is_double_excellence VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否双优学校';
+
+DROP TABLE IF EXISTS ods_zzxqjcsj;   
+CREATE TABLE `ods_zzxqjcsj` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATE DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATE DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `school_id` BIGINT DEFAULT NULL COMMENT '所属学校(ods_zzxxgkjcsj_id)',
+  `school_number` VARCHAR(20) DEFAULT NULL COMMENT '校区编号',
+  `name` VARCHAR(255) DEFAULT NULL COMMENT '校区名称',
+  `name_s` VARCHAR(255) DEFAULT NULL COMMENT '校区简称',
+  `administrative_location` VARCHAR(500) DEFAULT NULL COMMENT '校区所在地行政区域',
+  `address` VARCHAR(500) DEFAULT NULL COMMENT '地址',
+  `phone` BIGINT DEFAULT NULL COMMENT '校区联系电话',
+  `postal_code` VARCHAR(100) DEFAULT NULL COMMENT '校区邮政编码',
+  `build_date` DATE DEFAULT NULL COMMENT '校区成立日期',
+  `director` VARCHAR(255) DEFAULT NULL COMMENT '校区负责人',
+  PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='校区基本数据子类表';
+
+DROP TABLE IF EXISTS student_psychological;  
+CREATE TABLE `student_psychological` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATE DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATE DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `class_id` BIGINT DEFAULT NULL COMMENT '学生班级id',
+  `student_id` BIGINT DEFAULT NULL COMMENT '学生',
+  `gender` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学生性别',
+  `identity_card` VARCHAR(255) DEFAULT NULL COMMENT '身份证号',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '班主任id',
+  `appoint_time` DATETIME DEFAULT NULL,
+  `remark` VARCHAR(1000) DEFAULT NULL COMMENT '备注',
+  `confirm_time` DATETIME DEFAULT NULL COMMENT '确认时间',
+  `location` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '咨询地点',
+  `student_conclusion` VARCHAR(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '心理咨询结论(学生寄语)',
+  `teacher_conclusion` VARCHAR(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '心理咨询结论(班主任寄语)',
+  `parent_conclusion` VARCHAR(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '心理咨询结论(家长寄语)',
+  `status` INT DEFAULT NULL COMMENT '流程状态(1:结束,0:未结束)',
+  PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学生心理咨询表';
+
+DROP TABLE IF EXISTS student_infection; 
+CREATE TABLE `student_infection` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATE DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATE DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `class_id` BIGINT DEFAULT NULL COMMENT '学生班级id',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '班主任id',
+  `student_id` BIGINT DEFAULT NULL COMMENT '学生',
+  `gender` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学生性别',
+  `identity_card` VARCHAR(255) DEFAULT NULL COMMENT '身份证号',
+  `infect_time` DATE DEFAULT NULL COMMENT '感染时间',
+  `infect_name` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '传染病名称',
+  `disposal_method` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '处理方式',
+  `status` INT DEFAULT NULL COMMENT '流程状态(1:结束,0:未结束)',
+  PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学生传染病登记表';
+
+ALTER TABLE `base_class`   
+  CHANGE `delete_mark` `delete_mark` INT DEFAULT 0  NOT NULL   COMMENT '删除标记',
+  CHANGE `enabled_mark` `enabled_mark` INT DEFAULT 1  NOT NULL   COMMENT '有效标志';
+  
+ALTER TABLE `banding_task_class`   
+  ADD INDEX (`banding_task_id`),
+  ADD INDEX (`major_set_id`),
+  ADD INDEX (`teacher_id`),
+  ADD INDEX (`classroom_id`);
+
+ALTER TABLE `banding_task_class_student`   
+  ADD INDEX (`banding_task_class_id`),
+  ADD INDEX (`new_student_id`);
+
+ALTER TABLE `banding_task_major_condition`   
+  ADD INDEX (`banding_task_id`),
+  ADD INDEX (`major_set_id`);
+
+ALTER TABLE `banding_task_rule`   
+  ADD INDEX (`banding_rule_id`),
+  ADD INDEX (`banding_task_id`);
+  
+ALTER TABLE `banding_task_class`   
+  ADD COLUMN `class_type` VARCHAR(50) NULL   COMMENT '班级类型(xjr_dictionary_item[class_type])' AFTER `banding_task_id`;

+ 42 - 0
src/test/java/com/xjrsoft/module/job/ExamScoreDataTaskTest.java

@@ -0,0 +1,42 @@
+package com.xjrsoft.module.job;
+
+import cn.hutool.extra.spring.SpringUtil;
+import com.xjrsoft.module.base.service.IBaseCourseSubjectService;
+import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
+import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
+import com.xjrsoft.module.xycxedu.util.DataUtil;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.scheduling.annotation.Scheduled;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author dzx
+ * @date 2024/7/18
+ */
+@SpringBootTest
+class ExamScoreDataTaskTest {
+    @Autowired
+    private IXycxeduExamListService examListService;
+
+    @Autowired
+    private IExamSubjectScoreService scoreService;
+
+    @Autowired
+    private IBaseCourseSubjectService courseService;
+    @Test
+    public void RefreshConnectionPool() {
+        doExecute();
+    }
+
+    void doExecute(){
+        //同步考试计划数据
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.examListData(examListService);
+
+        //同步成绩
+        dataUtil.studentScoreData(examListService, scoreService, courseService);
+    }
+}

+ 33 - 0
src/test/java/com/xjrsoft/module/xycxedu/util/ApiUtilTest.java

@@ -0,0 +1,33 @@
+package com.xjrsoft.module.xycxedu.util;
+
+import cn.hutool.http.HttpUtil;
+import org.junit.jupiter.api.Test;
+
+import java.io.IOException;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author dzx
+ * @date 2024/7/18
+ */
+class ApiUtilTest {
+    private final static int schoolid = 189;
+    private final static String sign = "888";
+    private final static String accessid = "86a5d02ae9f78470";
+
+    private final static String host = "https://openapi.xycxedu.com";
+    @Test
+    void test() throws IOException {
+        String url = host + "/exam/list?schoolid=" + schoolid + "&accessid=" + accessid + "&sign=" + sign;
+        String s = HttpUtil.get(url);
+    }
+
+    @Test
+    void test1() throws IOException {
+        String url = host + "/exam/list?schoolid=" + schoolid + "&accessid=" + accessid + "&sign=" + sign;
+        String s = HttpUtil.get(url);
+
+        System.out.println(s);
+    }
+}

+ 68 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -3430,4 +3430,72 @@ public class FreeMarkerGeneratorTest {
 
 
         apiGeneratorService.generateCodes(params);
         apiGeneratorService.generateCodes(params);
     }
     }
+
+    @Test
+    public void gcExamPlan() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("exam_plan");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("xycxedu");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(true);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+    }
+
+    @Test
+    public void gcMatchActivity() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("activity_info");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        mainTable = new TableConfig();
+        mainTable.setTableName("activity_enroll_range");//init_sql中的表名
+        mainTable.setIsMain(false);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        mainTable.setRelationField("activity_info_id");//设置外键
+        mainTable.setRelationTableField(GlobalConstant.DEFAULT_PK);//设置外键
+        tableConfigs.add(mainTable);
+
+        mainTable = new TableConfig();
+        mainTable.setTableName("activity_enroll");//init_sql中的表名
+        mainTable.setIsMain(false);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        mainTable.setRelationField("activity_info_id");//设置外键
+        mainTable.setRelationTableField(GlobalConstant.DEFAULT_PK);//设置外键
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("activity");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(false);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+    }
 }
 }