Bläddra i källkod

新生数据同步调整,改为触发式

dzx 6 månader sedan
förälder
incheckning
5559c6a163

+ 36 - 27
src/main/java/com/xjrsoft/module/job/BaseNewStudentTask.java

@@ -2,7 +2,12 @@ package com.xjrsoft.module.job;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.xjrsoft.common.enums.*;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.EnrollTypeEnum;
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
+import com.xjrsoft.common.enums.StudentTypeEnum;
+import com.xjrsoft.common.enums.StudyStatusEnum;
 import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
 import com.xjrsoft.module.base.entity.BaseGrade;
 import com.xjrsoft.module.base.entity.BaseMajorSet;
@@ -16,13 +21,16 @@ import com.xjrsoft.module.student.service.IEnrollmentPlanService;
 import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -36,28 +44,29 @@ import java.util.stream.Collectors;
 public class BaseNewStudentTask {
 
 
-    @Autowired
-    private IBaseNewStudentService newStudentService;
-
-    @Autowired
-    private IPbCseFeeobjupdateService cseFeeobjupdateService;
-
-    @Autowired
-    private IEnrollmentPlanService planService;
-
-    @Autowired
-    private IBaseGradeService gradeService;
-
-    @Autowired
-    private IBaseMajorSetService majorSetService;
-
-    @Async
-    @Scheduled(cron = "0 */15 * * * ?")
-    public void execute() {
-        doExecute();
-    }
-
-    void doExecute() {
+//    @Autowired
+//    private IBaseNewStudentService newStudentService;
+//
+//    @Autowired
+//    private IPbCseFeeobjupdateService cseFeeobjupdateService;
+//
+//    @Autowired
+//    private IEnrollmentPlanService planService;
+//
+//    @Autowired
+//    private IBaseGradeService gradeService;
+//
+//    @Autowired
+//    private IBaseMajorSetService majorSetService;
+
+//    @Async
+//    @Scheduled(cron = "0 */15 * * * ?")
+//    public void execute() {
+//        doExecute();
+//    }
+
+    public void doExecute(IBaseNewStudentService newStudentService, IPbCseFeeobjupdateService cseFeeobjupdateService,
+                          IEnrollmentPlanService planService, IBaseGradeService gradeService, IBaseMajorSetService majorSetService) {
         List<PbCseFeeobjupdate> dataList = cseFeeobjupdateService.list();
 
         String sql = "select distinct enteryear, userdef6 from pb_cse_feeobjupdate";

+ 20 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -24,9 +24,13 @@ import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.entity.BaseUserStudent;
 import com.xjrsoft.module.base.entity.WhitelistManagement;
+import com.xjrsoft.module.base.service.IBaseGradeService;
+import com.xjrsoft.module.base.service.IBaseMajorSetService;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
 import com.xjrsoft.module.base.service.IBaseUserStudentService;
 import com.xjrsoft.module.base.service.IWhitelistManagementService;
+import com.xjrsoft.module.job.BaseNewStudentTask;
+import com.xjrsoft.module.job.EnrollmentStatisticsInfoTask;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import com.xjrsoft.module.organization.service.IUserRoleRelationService;
@@ -41,6 +45,8 @@ 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.service.IEnrollmentPlanService;
+import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
 import com.xjrsoft.module.student.vo.BaseNewStudentExportVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentListExcelVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
@@ -52,6 +58,7 @@ import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -96,6 +103,10 @@ public class BaseNewStudentController {
     private final IBaseUserStudentService userStudentService;
     private final CommonPropertiesConfig propertiesConfig;
     private final IBaseSemesterService semesterService;
+    private final IPbCseFeeobjupdateService cseFeeobjupdateService;
+    private final IEnrollmentPlanService planService;
+    private final IBaseGradeService gradeService;
+    private final IBaseMajorSetService majorSetService;
     @GetMapping(value = "/page")
     @ApiOperation(value="新生维护信息列表(分页)")
     @SaCheckPermission("basenewstudent:detail")
@@ -466,4 +477,13 @@ public class BaseNewStudentController {
         return RT.fileStream(bot.toByteArray(), fileName);
     }
 
+    @GetMapping("/basenewstudent-task-start")
+    @ApiOperation(value = "触发新生数据同步统计")
+    @XjrLog(value = "触发新生数据同步统计")
+    public RT<Boolean> exportData() {
+        BaseNewStudentTask basenewstudenttask = new BaseNewStudentTask();
+        basenewstudenttask.doExecute(baseNewStudentService, cseFeeobjupdateService, planService, gradeService, majorSetService);
+        return RT.ok(true);
+    }
+
 }

+ 1 - 0
src/main/java/com/xjrsoft/module/student/controller/PbCseFeeobjupdateController.java

@@ -198,4 +198,5 @@ public class PbCseFeeobjupdateController {
         statisticsInfoTask.doExecute(pbCseFeeobjupdateService, enrollmentStatisticsInfoService);
         return RT.ok(true);
     }
+
 }

+ 1 - 0
src/main/resources/application-pre.yml

@@ -99,6 +99,7 @@ xjrsoft:
       - /system/findUserByCode
       - /student/basestudentinfo/studentinfoByKeyWord
       - /student/pbCseFeeobjupdate/enrollment-statistics-start
+      - /student/baseNewStudent/basenewstudent-task-start
     approval-time: 300 # 审核超时时间 目前设为5分钟
   email:
     host:  #邮件服务器的SMTP地址,可选,默认为smtp.<发件人邮箱后缀>

+ 1 - 0
src/main/resources/application-prod.yml

@@ -96,6 +96,7 @@ xjrsoft:
       - /student/basestudentinfo/studentinfoByKeyWord
       - /system/xjrTipsMessage/infoByCode
       - /student/pbCseFeeobjupdate/enrollment-statistics-start
+      - /student/baseNewStudent/basenewstudent-task-start
     approval-time: 300 # 审核超时时间 目前设为5分钟
   email:
     host:  #邮件服务器的SMTP地址,可选,默认为smtp.<发件人邮箱后缀>