Commit 96601d7c3629169bcbf1881c2008c23e92527594

Authored by 陈杰
1 parent b7ccb8ad
Exists in master and in 1 other branch cloud_copy

学情 排课 嵌入分布式

Showing 26 changed files with 1142 additions and 260 deletions   Show diff stats
cloud/common/pom.xml
... ... @@ -60,6 +60,27 @@
60 60 <artifactId>springfox-swagger-ui</artifactId>
61 61 <version>2.5.0</version>
62 62 </dependency>
  63 + <dependency>
  64 + <groupId>commons-net</groupId>
  65 + <artifactId>commons-net</artifactId>
  66 + <version>2.0</version>
  67 + </dependency>
  68 + <dependency>
  69 + <groupId>org.apache.poi</groupId>
  70 + <artifactId>poi</artifactId>
  71 + <version>4.1.0</version>
  72 + </dependency>
  73 +
  74 + <dependency>
  75 + <groupId>org.apache.poi</groupId>
  76 + <artifactId>poi-ooxml</artifactId>
  77 + <version>4.1.0</version>
  78 + </dependency>
  79 + <dependency>
  80 + <groupId>org.apache.commons</groupId>
  81 + <artifactId>commons-lang3</artifactId>
  82 + <version>3.3.2</version>
  83 + </dependency>
63 84 </dependencies>
64 85  
65 86 <build>
... ...
cloud/common/src/main/java/com/sincere/common/util/ExcelUtils.java 0 → 100644
... ... @@ -0,0 +1,147 @@
  1 +package com.sincere.common.util;
  2 +
  3 +import com.google.common.base.Strings;
  4 +import org.apache.commons.lang3.StringUtils;
  5 +import org.apache.poi.hssf.usermodel.HSSFCell;
  6 +import org.apache.poi.hssf.usermodel.HSSFRow;
  7 +import org.apache.poi.hssf.usermodel.HSSFSheet;
  8 +import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  9 +
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +import java.io.IOException;
  13 +import java.io.OutputStream;
  14 +import java.math.BigDecimal;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
  18 +/**
  19 + * @author chen
  20 + * @version 1.0
  21 + * @date 2019/10/16 0016 18:46
  22 + */
  23 +public class ExcelUtils {
  24 +
  25 + //各个列的表头
  26 + private List<String> heardList;
  27 + //各个列的元素key值
  28 + private List<String> heardKey;
  29 + //需要填充的数据信息
  30 + private List<Map<String,String>> data;
  31 + //工作表
  32 + private String sheetName = "模板";
  33 +
  34 +
  35 + public List<String> getHeardList() {
  36 + return heardList;
  37 + }
  38 +
  39 + public void setHeardList(List<String> heardList) {
  40 + this.heardList = heardList;
  41 + }
  42 +
  43 + public List<String> getHeardKey() {
  44 + return heardKey;
  45 + }
  46 +
  47 + public void setHeardKey(List<String> heardKey) {
  48 + this.heardKey = heardKey;
  49 + }
  50 +
  51 + public List<Map<String, String>> getData() {
  52 + return data;
  53 + }
  54 +
  55 + public void setData(List<Map<String, String>> data) {
  56 + this.data = data;
  57 + }
  58 +
  59 + public String getSheetName() {
  60 + return sheetName;
  61 + }
  62 +
  63 + public void setSheetName(String sheetName) {
  64 + this.sheetName = sheetName;
  65 + }
  66 +
  67 + /**
  68 + * 开始导出数据信息
  69 + *
  70 + */
  71 + public byte[] exportExport(HttpServletRequest request, HttpServletResponse response) throws IOException {
  72 + //检查参数配置信息
  73 + checkConfig();
  74 + //创建工作簿
  75 + HSSFWorkbook wb = new HSSFWorkbook();
  76 + //创建工作表
  77 + HSSFSheet wbSheet = wb.createSheet(this.sheetName);
  78 +
  79 + //在第0行创建rows
  80 + HSSFRow row = wbSheet.createRow((int)0);
  81 + //设置列头元素
  82 + HSSFCell cellHead = null;
  83 + for (int i = 0; i < heardList.size(); i++) {
  84 + cellHead = row.createCell(i);
  85 + cellHead.setCellValue(heardList.get(i));
  86 + }
  87 + //开始写入实体数据信息
  88 + int a = 1;
  89 + for (int i = 0; i < data.size(); i++) {
  90 + HSSFRow roww = wbSheet.createRow((int) a);
  91 + Map map = data.get(i);
  92 + HSSFCell cell = null;
  93 + for (int j = 0; j < heardKey.size(); j++) {
  94 + cell = roww.createCell(j);
  95 + Object valueObject = map.get(heardKey.get(j));
  96 + String value = null;
  97 + if (valueObject == null) {
  98 + valueObject = "";
  99 + }
  100 + if (valueObject instanceof String) {
  101 + //取出的数据是字符串直接赋值
  102 + value = (String) map.get(heardKey.get(j));
  103 + } else if (valueObject instanceof Integer) {
  104 + //取出的数据是Integer
  105 + value = String.valueOf(((Integer) (valueObject)).floatValue());
  106 + } else if (valueObject instanceof BigDecimal) {
  107 + //取出的数据是BigDecimal
  108 + value = String.valueOf(((BigDecimal) (valueObject)).floatValue());
  109 + } else {
  110 + value = valueObject.toString();
  111 + }
  112 + cell.setCellValue(Strings.isNullOrEmpty(value) ? "" : value);
  113 + }
  114 + a++;
  115 + }
  116 +
  117 + //导出数据
  118 + try {
  119 + //设置Http响应头告诉浏览器下载这个附件
  120 + response.setHeader("Content-Disposition", "attachment;Filename=" + System.currentTimeMillis() + ".xls");
  121 + OutputStream outputStream = response.getOutputStream();
  122 + wb.write(outputStream);
  123 + outputStream.flush();
  124 + outputStream.close();
  125 + return wb.getBytes();
  126 + } catch (Exception ex) {
  127 + ex.printStackTrace();
  128 + throw new IOException("导出Excel出现严重异常,异常信息:" + ex.getMessage());
  129 + }
  130 +
  131 + }
  132 +
  133 + /**
  134 + * 检查数据配置问题
  135 + *
  136 + * @throws IOException 抛出数据异常类
  137 + */
  138 + protected void checkConfig() throws IOException {
  139 + if (heardKey == null || heardList.size() == 0) {
  140 + throw new IOException("列名数组不能为空或者为NULL");
  141 + }
  142 + if (StringUtils.isBlank(sheetName)) {
  143 + throw new IOException("工作表表名不能为NULL");
  144 + }
  145 + }
  146 +
  147 +}
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/CourseClassReqVo.java 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +package com.sincere.common.vo.independence.paike;
  2 +
  3 +/**
  4 + * @author chen
  5 + * @version 1.0
  6 + * @date 2019/10/12 0012 9:18
  7 + */
  8 +public class CourseClassReqVo {
  9 +
  10 + private int scheduleId ;
  11 + private int courseId ;
  12 +
  13 + public int getScheduleId() {
  14 + return scheduleId;
  15 + }
  16 +
  17 + public void setScheduleId(int scheduleId) {
  18 + this.scheduleId = scheduleId;
  19 + }
  20 +
  21 + public int getCourseId() {
  22 + return courseId;
  23 + }
  24 +
  25 + public void setCourseId(int courseId) {
  26 + this.courseId = courseId;
  27 + }
  28 +}
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/CourseTypeListVO.java
1 1 package com.sincere.common.vo.independence.paike;
2 2  
3   -import com.jevon.model.Course;
4 3 import com.sincere.common.dto.independence.CourseDto;
5 4  
6 5 import java.util.List;
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/GetClassCourseReqVo.java 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +package com.sincere.common.vo.independence.paike;
  2 +
  3 +/**
  4 + * @author chen
  5 + * @version 1.0
  6 + * @date 2019/10/11 0011 10:21
  7 + */
  8 +public class GetClassCourseReqVo {
  9 +
  10 + private int scheduleId ;
  11 + private int classId ;
  12 +
  13 + public int getScheduleId() {
  14 + return scheduleId;
  15 + }
  16 +
  17 + public void setScheduleId(int scheduleId) {
  18 + this.scheduleId = scheduleId;
  19 + }
  20 +
  21 + public int getClassId() {
  22 + return classId;
  23 + }
  24 +
  25 + public void setClassId(int classId) {
  26 + this.classId = classId;
  27 + }
  28 +}
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/InitTeacherCourseReqVo.java 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +package com.sincere.common.vo.independence.paike;
  2 +
  3 +/**
  4 + * @author chen
  5 + * @version 1.0
  6 + * @date 2019/10/10 0010 9:04
  7 + */
  8 +public class InitTeacherCourseReqVo {
  9 + private int scheduleId ;
  10 + private String url ;
  11 +
  12 + public int getScheduleId() {
  13 + return scheduleId;
  14 + }
  15 +
  16 + public void setScheduleId(int scheduleId) {
  17 + this.scheduleId = scheduleId;
  18 + }
  19 +
  20 + public String getUrl() {
  21 + return url;
  22 + }
  23 +
  24 + public void setUrl(String url) {
  25 + this.url = url;
  26 + }
  27 +}
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/ScheduleIdReqVo.java 0 → 100644
... ... @@ -0,0 +1,19 @@
  1 +package com.sincere.common.vo.independence.paike;
  2 +
  3 +/**
  4 + * @author chen
  5 + * @version 1.0
  6 + * @date 2019/10/11 0011 14:41
  7 + */
  8 +public class ScheduleIdReqVo {
  9 +
  10 + private int scheduleId ;
  11 +
  12 + public int getScheduleId() {
  13 + return scheduleId;
  14 + }
  15 +
  16 + public void setScheduleId(int scheduleId) {
  17 + this.scheduleId = scheduleId;
  18 + }
  19 +}
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/ScheduleRepVo.java 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.common.vo.independence.paike;
  2 +
  3 +import com.sincere.common.vo.BaseVo;
  4 +
  5 +/**
  6 + * @author chen
  7 + * @version 1.0
  8 + * @date 2019/10/10 0010 11:32
  9 + */
  10 +public class ScheduleRepVo extends BaseVo {
  11 +
  12 + private int scheduleId ;
  13 +
  14 + public int getScheduleId() {
  15 + return scheduleId;
  16 + }
  17 +
  18 + public void setScheduleId(int scheduleId) {
  19 + this.scheduleId = scheduleId;
  20 + }
  21 +}
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/SchoolIdReqVo.java 0 → 100644
... ... @@ -0,0 +1,19 @@
  1 +package com.sincere.common.vo.independence.paike;
  2 +
  3 +/**
  4 + * @author chen
  5 + * @version 1.0
  6 + * @date 2019/10/11 0011 14:41
  7 + */
  8 +public class SchoolIdReqVo {
  9 +
  10 + private int schoolId ;
  11 +
  12 + public int getSchoolId() {
  13 + return schoolId;
  14 + }
  15 +
  16 + public void setSchoolId(int schoolId) {
  17 + this.schoolId = schoolId;
  18 + }
  19 +}
... ...
cloud/common/src/main/java/com/sincere/common/vo/independence/paike/UpdateScheduleReqVo.java 0 → 100644
... ... @@ -0,0 +1,36 @@
  1 +package com.sincere.common.vo.independence.paike;
  2 +
  3 +/**
  4 + * @author chen
  5 + * @version 1.0
  6 + * @date 2019/10/14 0014 16:52
  7 + */
  8 +public class UpdateScheduleReqVo {
  9 + private int scheduleId;
  10 + private String team ;
  11 + private String scheduleName ;
  12 +
  13 + public int getScheduleId() {
  14 + return scheduleId;
  15 + }
  16 +
  17 + public void setScheduleId(int scheduleId) {
  18 + this.scheduleId = scheduleId;
  19 + }
  20 +
  21 + public String getTeam() {
  22 + return team;
  23 + }
  24 +
  25 + public void setTeam(String team) {
  26 + this.team = team;
  27 + }
  28 +
  29 + public String getScheduleName() {
  30 + return scheduleName;
  31 + }
  32 +
  33 + public void setScheduleName(String scheduleName) {
  34 + this.scheduleName = scheduleName;
  35 + }
  36 +}
... ...
cloud/independence/src/main/java/com/sincere/independence/controller/LearnController.java
... ... @@ -5,7 +5,7 @@ import com.sincere.common.enums.DifficultEnums;
5 5 import com.sincere.common.enums.DimensionalEnums;
6 6 import com.sincere.common.util.RedisUtils;
7 7 import com.sincere.common.vo.BaseVo;
8   -import com.sincere.independence.feign.LearnFeign;
  8 +import com.sincere.independence.feign.IndependenceFeign;
9 9 import com.sincere.independence.vo.*;
10 10 import com.sincere.independence.vo.excel.ExamExcelVo;
11 11 import com.sincere.independence.vo.excel.ScoreExcelVo;
... ... @@ -17,7 +17,6 @@ import org.apache.poi.ss.usermodel.*;
17 17 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
18 18 import org.springframework.beans.factory.annotation.Autowired;
19 19 import org.springframework.web.bind.annotation.*;
20   -import org.springframework.web.multipart.MultipartFile;
21 20  
22 21 import java.io.File;
23 22 import java.io.FileInputStream;
... ... @@ -35,12 +34,12 @@ import java.util.*;
35 34 public class LearnController {
36 35  
37 36 @Autowired
38   - LearnFeign learnFeign ;
  37 + IndependenceFeign independenceFeign;
39 38  
40 39 @ApiOperation("获取列表")
41 40 @RequestMapping(value = "getList", method = RequestMethod.POST)
42 41 public List<AnalyseDto> getList(){
43   - return learnFeign.getList(new AnalyseDto());
  42 + return independenceFeign.getList(new AnalyseDto());
44 43 }
45 44  
46 45 @ApiOperation("获取详情,微信入口")
... ... @@ -51,10 +50,10 @@ public class LearnController {
51 50 String[] msg = grade.split(",");
52 51 for(String gradeMsg : msg){
53 52 search.setGrade(initGrade(gradeMsg,schoolName));
54   - List<AnalyseDto> analyseList = learnFeign.getList(search);
  53 + List<AnalyseDto> analyseList = independenceFeign.getList(search);
55 54 if(analyseList != null && analyseList.size() > 0){
56 55 for(AnalyseDto analyse :analyseList){
57   - List<LeagueDto> leagues = learnFeign.getLeagueByAnalyse(analyse.getId());
  56 + List<LeagueDto> leagues = independenceFeign.getLeagueByAnalyse(analyse.getId());
58 57 for(LeagueDto league : leagues){
59 58 if(league.getSchoolName() != null && league.getSchoolName().equals(schoolName)){
60 59 result.add(analyse);
... ... @@ -67,7 +66,7 @@ public class LearnController {
67 66 if(result.size() == 0){
68 67 AnalyseDto searchAnalyse = new AnalyseDto();
69 68 searchAnalyse.setExamName("顺治中学模拟考试");
70   - List<AnalyseDto> analyseList = learnFeign.getList(searchAnalyse);
  69 + List<AnalyseDto> analyseList = independenceFeign.getList(searchAnalyse);
71 70 if(analyseList != null && analyseList.size() > 0){
72 71 result.add(analyseList.get(0));
73 72 }
... ... @@ -132,14 +131,14 @@ public class LearnController {
132 131 analyse.setExamTime(createExamReqVo.getExamTime());
133 132 analyse.setCreateTime(new Date());
134 133 analyse.setGrade(createExamReqVo.getGrade());
135   - return learnFeign.insertAnalyse(analyse);
  134 + return independenceFeign.insertAnalyse(analyse);
136 135 }
137 136  
138 137 @ApiOperation("更新考试信息")
139 138 @RequestMapping(value = "updateExam", method = RequestMethod.POST)
140 139 public BaseVo updateExam(@RequestBody UpdateExamReqVo updateExamReqVo){
141 140 BaseVo baseVo = new BaseVo();
142   - AnalyseDto analyse = learnFeign.selectById(updateExamReqVo.getAnalyseId());
  141 + AnalyseDto analyse = independenceFeign.selectById(updateExamReqVo.getAnalyseId());
143 142 if(analyse == null){
144 143 baseVo.setMessage("考试不存在");
145 144 baseVo.setSuccess(false);
... ... @@ -149,15 +148,15 @@ public class LearnController {
149 148 analyse.setExamName(updateExamReqVo.getExamName());
150 149 analyse.setCourseName(updateExamReqVo.getCourseName());
151 150 analyse.setGrade(updateExamReqVo.getGrade());
152   - return learnFeign.updateAnalyse(analyse);
  151 + return independenceFeign.updateAnalyse(analyse);
153 152 }
154 153  
155 154 @ApiOperation("试卷信息导入")
156 155 @RequestMapping(value = "initAnalyse", method = RequestMethod.POST)
157 156 public BaseVo initAnalyse(@RequestBody InitAnalyseReqVo initAnalyseReqVo){
158 157 BaseVo baseVo = new BaseVo();
159   - AnalyseDto analyse = learnFeign.selectById(initAnalyseReqVo.getAnalyseId());
160   - List<AnalyseDetailDto> analyseDetails = learnFeign.isImportExam(analyse.getId());
  158 + AnalyseDto analyse = independenceFeign.selectById(initAnalyseReqVo.getAnalyseId());
  159 + List<AnalyseDetailDto> analyseDetails = independenceFeign.isImportExam(analyse.getId());
161 160 if(analyseDetails != null & analyseDetails.size() > 0){
162 161 baseVo.setMessage("已经导入");
163 162 baseVo.setSuccess(false);
... ... @@ -173,7 +172,7 @@ public class LearnController {
173 172 List<AnalyseDetailDto> analyseDetails = new ArrayList<>();
174 173 List<AnalyseDimensionalDto> analyseDimensionals = new ArrayList<>();
175 174 Float maxScore = 0f;
176   - AnalyseDto analyse = learnFeign.selectById(initAnalyseReqVo.getAnalyseId());
  175 + AnalyseDto analyse = independenceFeign.selectById(initAnalyseReqVo.getAnalyseId());
177 176 File excelFile = new File(initAnalyseReqVo.getUrl());
178 177 // 获得工作簿
179 178 String file = excelFile.getName();
... ... @@ -225,10 +224,10 @@ public class LearnController {
225 224 }
226 225 }
227 226 }
228   - learnFeign.insertBatchAnalyseDetail(analyseDetails);
229   - learnFeign.insertBatchAnalyseDimensional(analyseDimensionals);
  227 + independenceFeign.insertBatchAnalyseDetail(analyseDetails);
  228 + independenceFeign.insertBatchAnalyseDimensional(analyseDimensionals);
230 229 analyse.setMaxScore(new Double(maxScore));
231   - learnFeign.updateAnalyse(analyse);
  230 + independenceFeign.updateAnalyse(analyse);
232 231 }catch (Exception e){
233 232 e.printStackTrace();
234 233 }
... ... @@ -240,7 +239,7 @@ public class LearnController {
240 239 for (int j = 0; j < message.length ; j++) {
241 240 if(StringUtils.isNotBlank(message[j])){
242 241 //查数据库是否已存在该四维诊断 不存在则导入
243   - int dimensionalId = learnFeign.selectDimensional(dimensionalType,message[j]);
  242 + int dimensionalId = independenceFeign.selectDimensional(dimensionalType,message[j]);
244 243 AnalyseDimensionalDto analyseDimensional = new AnalyseDimensionalDto();
245 244 analyseDimensional.setAnalyseId(analyse.getId());
246 245 analyseDimensional.setDimensionalId(dimensionalId);
... ... @@ -267,8 +266,8 @@ public class LearnController {
267 266  
268 267 private boolean analysisScoreExcel(InitScoreReqVo initScoreReqVo){
269 268 try{
270   - AnalyseDto analyse = learnFeign.selectById(initScoreReqVo.getAnalyseId());
271   - List<AnalyseDetailDto> analyseDetails = learnFeign.isImportExam(analyse.getId());
  269 + AnalyseDto analyse = independenceFeign.selectById(initScoreReqVo.getAnalyseId());
  270 + List<AnalyseDetailDto> analyseDetails = independenceFeign.isImportExam(analyse.getId());
272 271 Map<String , Double> scoreMap = new HashMap<>();
273 272 for(AnalyseDetailDto analyseDetail : analyseDetails){
274 273 scoreMap.put(analyseDetail.getQuestionNumber(),analyseDetail.getScore());
... ... @@ -337,10 +336,10 @@ public class LearnController {
337 336 }
338 337 }
339 338 }
340   - boolean flag = learnFeign.initLeagueSchool(initScoreReqVo.getLeagueId(),students.get(0).getSchoolName());
  339 + boolean flag = independenceFeign.initLeagueSchool(initScoreReqVo.getLeagueId(),students.get(0).getSchoolName());
341 340 if(flag){
342   - learnFeign.insertBatchStudent(students);
343   - learnFeign.insertBatchStudentDetail(studentDetails);
  341 + independenceFeign.insertBatchStudent(students);
  342 + independenceFeign.insertBatchStudentDetail(studentDetails);
344 343 return true ;
345 344 }else {
346 345 return false ;
... ... @@ -376,7 +375,7 @@ public class LearnController {
376 375 @RequestMapping(value = "getLeague", method = RequestMethod.GET)
377 376 public GetLeagueRepVo getLeague(int analyseId){
378 377 GetLeagueRepVo getLeagueRepVo = new GetLeagueRepVo();
379   - List<LeagueDto> leagues = learnFeign.getLeagueByAnalyse(analyseId);
  378 + List<LeagueDto> leagues = independenceFeign.getLeagueByAnalyse(analyseId);
380 379 List<GetLeague> getLeagues = new ArrayList<>();
381 380 for(LeagueDto league : leagues){
382 381 boolean isExist = false ;
... ... @@ -406,10 +405,10 @@ public class LearnController {
406 405 public BaseVo createLeague(@RequestBody CreateLeagueReqVo createLeagueReqVo){
407 406 BaseVo baseVo = new BaseVo();
408 407 LeagueDto league = new LeagueDto();
409   - AnalyseDto analyse = learnFeign.selectById(createLeagueReqVo.getAnalyseId());
  408 + AnalyseDto analyse = independenceFeign.selectById(createLeagueReqVo.getAnalyseId());
410 409 league.setAnalyseId(analyse.getId());
411 410 league.setLeague(createLeagueReqVo.getLeague());
412   - int id = learnFeign.insertLeague(league);
  411 + int id = independenceFeign.insertLeague(league);
413 412 baseVo.setMessage(id +"");
414 413 return baseVo;
415 414 }
... ... @@ -422,7 +421,7 @@ public class LearnController {
422 421 analyseDto.setId(chapterReqVo.getAnalyseId());
423 422 analyseDto.setExamTime(chapterReqVo.getExamTime());
424 423 analyseDto.setExamScope(chapterReqVo.getExamScope());
425   - learnFeign.updateAnalyse(analyseDto);
  424 + independenceFeign.updateAnalyse(analyseDto);
426 425 List<ChapterDto> list = new ArrayList<>();
427 426 for(ChapterReq chapterReq :chapterReqVo.getList()){
428 427 ChapterDto chapter = new ChapterDto();
... ... @@ -432,13 +431,13 @@ public class LearnController {
432 431 chapter.setChapterScore(chapterReq.getScore());
433 432 list.add(chapter);
434 433 }
435   - learnFeign.initChapter(list);
  434 + independenceFeign.initChapter(list);
436 435 return baseVo;
437 436 }
438 437  
439 438 @ApiOperation("获取导入的学校列表")
440 439 @RequestMapping(value = "getSchoolName", method = RequestMethod.GET)
441 440 public List<String> getSchoolName(int analyseId){
442   - return learnFeign.getSchoolName(analyseId);
  441 + return independenceFeign.getSchoolName(analyseId);
443 442 }
444 443 }
... ...
cloud/independence/src/main/java/com/sincere/independence/controller/LearnStatController.java
... ... @@ -2,7 +2,7 @@ package com.sincere.independence.controller;
2 2  
3 3 import com.sincere.common.dto.independence.GetLearnDto;
4 4 import com.sincere.common.vo.independence.school.*;
5   -import com.sincere.independence.feign.LearnFeign;
  5 +import com.sincere.independence.feign.IndependenceFeign;
6 6 import io.swagger.annotations.Api;
7 7 import io.swagger.annotations.ApiOperation;
8 8 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -24,109 +24,109 @@ import java.util.Map;
24 24 @Api(value = "学情分析")
25 25 public class LearnStatController {
26 26 @Autowired
27   - LearnFeign learnFeign ;
  27 + IndependenceFeign independenceFeign;
28 28  
29 29  
30 30 @ApiOperation("getForm1_1")
31 31 @RequestMapping(value = "getForm1_1", method = RequestMethod.POST)
32 32 public Form7RepVO getForm1_1(@RequestBody GetLearnDto getLearnDto){
33   - return learnFeign.getForm1_1(getLearnDto);
  33 + return independenceFeign.getForm1_1(getLearnDto);
34 34 }
35 35  
36 36 @ApiOperation("getForm2_1_1")
37 37 @RequestMapping(value = "getForm2_1_1", method = RequestMethod.POST)
38 38 public Form1RepVO getForm2_1_1(@RequestBody GetLearnDto getLearnDto){
39   - return learnFeign.getForm2_1_1(getLearnDto);
  39 + return independenceFeign.getForm2_1_1(getLearnDto);
40 40 }
41 41  
42 42 @ApiOperation("getForm2_1_2")
43 43 @RequestMapping(value = "getForm2_1_2", method = RequestMethod.POST)
44 44 public Form2RepVO getForm2_1_2(@RequestBody GetLearnDto getLearnDto){
45   - return learnFeign.getForm2_1_2(getLearnDto);
  45 + return independenceFeign.getForm2_1_2(getLearnDto);
46 46 }
47 47  
48 48 @ApiOperation("getForm2_1_3_2")
49 49 @RequestMapping(value = "getForm2_1_3_2", method = RequestMethod.POST)
50 50 public Form2RepVO getForm2_1_3_2(@RequestBody GetLearnDto getLearnDto){
51   - return learnFeign.getForm2_1_3_2(getLearnDto);
  51 + return independenceFeign.getForm2_1_3_2(getLearnDto);
52 52 }
53 53  
54 54 @ApiOperation("getForm2_1_3")
55 55 @RequestMapping(value = "getForm2_1_3", method = RequestMethod.POST)
56 56 public List<Table1> getForm2_1_3(@RequestBody GetLearnDto getLearnDto){
57   - return learnFeign.getForm2_1_3(getLearnDto);
  57 + return independenceFeign.getForm2_1_3(getLearnDto);
58 58 }
59 59  
60 60 @ApiOperation("getForm2_2_1")
61 61 @RequestMapping(value = "getForm2_2_1", method = RequestMethod.POST)
62 62 public Form3RepVO getForm2_2_1(@RequestBody GetLearnDto getLearnDto){
63   - return learnFeign.getForm2_2_1(getLearnDto);
  63 + return independenceFeign.getForm2_2_1(getLearnDto);
64 64 }
65 65  
66 66 @ApiOperation("getForm2_2_2")
67 67 @RequestMapping(value = "getForm2_2_2", method = RequestMethod.POST)
68 68 public Form4RepVO getForm2_2_2(@RequestBody GetLearnDto getLearnDto){
69   - return learnFeign.getForm2_2_2(getLearnDto);
  69 + return independenceFeign.getForm2_2_2(getLearnDto);
70 70 }
71 71  
72 72 @ApiOperation("getForm2_2_3")
73 73 @RequestMapping(value = "getForm2_2_3", method = RequestMethod.POST)
74 74 public Form5RepVO getForm2_2_3(@RequestBody GetLearnDto getLearnDto){
75   - return learnFeign.getForm2_2_3(getLearnDto);
  75 + return independenceFeign.getForm2_2_3(getLearnDto);
76 76 }
77 77  
78 78 @ApiOperation("getForm2_2_4")
79 79 @RequestMapping(value = "getForm2_2_4", method = RequestMethod.POST)
80 80 public Form8RepVO getForm2_2_4(@RequestBody GetLearnDto getLearnDto){
81   - return learnFeign.getForm2_2_4(getLearnDto);
  81 + return independenceFeign.getForm2_2_4(getLearnDto);
82 82 }
83 83  
84 84 @ApiOperation("getForm2_2_5")
85 85 @RequestMapping(value = "getForm2_2_5", method = RequestMethod.POST)
86 86 public Map<String,Double> getForm2_2_5(@RequestBody GetLearnDto getLearnDto){
87   - return learnFeign.getForm2_2_5(getLearnDto);
  87 + return independenceFeign.getForm2_2_5(getLearnDto);
88 88 }
89 89  
90 90 @ApiOperation("getForm3_1")
91 91 @RequestMapping(value = "getForm3_1", method = RequestMethod.POST)
92 92 public Form6RepVO getForm3_1(@RequestBody GetLearnDto getLearnDto){
93   - return learnFeign.getForm3_1(getLearnDto);
  93 + return independenceFeign.getForm3_1(getLearnDto);
94 94 }
95 95  
96 96 @ApiOperation("getForm3_1_1")
97 97 @RequestMapping(value = "getForm3_1_1", method = RequestMethod.POST)
98 98 public Table2RepVO getForm3_1_1(@RequestBody GetLearnDto getLearnDto){
99   - return learnFeign.getForm3_1_1(getLearnDto);
  99 + return independenceFeign.getForm3_1_1(getLearnDto);
100 100 }
101 101  
102 102 @ApiOperation("getForm3_2")
103 103 @RequestMapping(value = "getForm3_2", method = RequestMethod.POST)
104 104 public Form6RepVO getForm3_2(@RequestBody GetLearnDto getLearnDto){
105   - return learnFeign.getForm3_2(getLearnDto);
  105 + return independenceFeign.getForm3_2(getLearnDto);
106 106 }
107 107  
108 108 @ApiOperation("getForm3_3")
109 109 @RequestMapping(value = "getForm3_3", method = RequestMethod.POST)
110 110 public Form6RepVO getForm3_3(@RequestBody GetLearnDto getLearnDto){
111   - return learnFeign.getForm3_3(getLearnDto);
  111 + return independenceFeign.getForm3_3(getLearnDto);
112 112 }
113 113  
114 114 @ApiOperation("getForm3_4")
115 115 @RequestMapping(value = "getForm3_4", method = RequestMethod.POST)
116 116 public Form6RepVO getForm3_4(@RequestBody GetLearnDto getLearnDto){
117   - return learnFeign.getForm3_4(getLearnDto);
  117 + return independenceFeign.getForm3_4(getLearnDto);
118 118 }
119 119  
120 120 @ApiOperation("获取教学改进建议")
121 121 @RequestMapping(value = "getSuggest", method = RequestMethod.POST)
122 122 public String getSuggest(@RequestBody GetLearnDto getLearnDto){
123   - return learnFeign.getSuggest(getLearnDto);
  123 + return independenceFeign.getSuggest(getLearnDto);
124 124 }
125 125  
126 126 @ApiOperation("获取教学改进建议")
127 127 @RequestMapping(value = "getSuggest2", method = RequestMethod.POST)
128 128 public String getSuggest2(@RequestBody GetLearnDto getLearnDto){
129   - return learnFeign.getSuggest2(getLearnDto);
  129 + return independenceFeign.getSuggest2(getLearnDto);
130 130 }
131 131  
132 132 }
... ...
cloud/independence/src/main/java/com/sincere/independence/controller/ScheduleController.java 0 → 100644
... ... @@ -0,0 +1,70 @@
  1 +package com.sincere.independence.controller;
  2 +
  3 +
  4 +import com.sincere.common.vo.BaseVo;
  5 +import com.sincere.common.vo.independence.paike.*;
  6 +import com.sincere.independence.feign.IndependenceFeign;
  7 +import io.swagger.annotations.Api;
  8 +import io.swagger.annotations.ApiOperation;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestBody;
  11 +import org.springframework.web.bind.annotation.RequestMapping;
  12 +import org.springframework.web.bind.annotation.RequestMethod;
  13 +import org.springframework.web.bind.annotation.RestController;
  14 +
  15 +@RestController
  16 +@RequestMapping(value = "/schedule")
  17 +@Api(value = "排课表")
  18 +public class ScheduleController {
  19 +
  20 + @Autowired
  21 + IndependenceFeign independenceFeign;
  22 +
  23 + @ApiOperation("作息安排")
  24 + @RequestMapping(value = "firstChoose", method = RequestMethod.POST)
  25 + public BaseVo firstChoose(@RequestBody FirstReqVo firstReqVo){
  26 + return independenceFeign.firstChoose(firstReqVo);
  27 + }
  28 +
  29 + @ApiOperation("设置公共资源课,主课,副课")
  30 + @RequestMapping(value = "setCourseType", method = RequestMethod.POST)
  31 + public BaseVo setCourseType(@RequestBody SetTypeReqVo setTypeReqVo){
  32 + return independenceFeign.setCourseType(setTypeReqVo);
  33 + }
  34 +
  35 + @ApiOperation("合班")
  36 + @RequestMapping(value = "joinClass", method = RequestMethod.POST)
  37 + public BaseVo joinClass(@RequestBody JoinClassReqVo joinClassReqVo){
  38 + return independenceFeign.joinClass(joinClassReqVo);
  39 + }
  40 +
  41 + @ApiOperation("删除某个合班信息")
  42 + @RequestMapping(value = "deleteJoinClass", method = RequestMethod.POST)
  43 + public BaseVo deleteJoinClass(@RequestBody CourseGroupReqVo courseGroupReqVo){
  44 + return independenceFeign.deleteJoinClass(courseGroupReqVo);
  45 + }
  46 +
  47 + @ApiOperation("不排课")
  48 + @RequestMapping(value = "noSchedule", method = RequestMethod.POST)
  49 + public BaseVo noSchedule(@RequestBody NoScheduleReqVo noScheduleReqVo){
  50 + return independenceFeign.noSchedule(noScheduleReqVo);
  51 + }
  52 +
  53 + @ApiOperation("选择拟排科目类型,设置优先区间 提示")
  54 + @RequestMapping(value = "secondChooseBefore", method = RequestMethod.POST)
  55 + public BaseVo secondChooseBefore(@RequestBody ParallelClassReqVo parallelClassReqVo){
  56 + return independenceFeign.secondChooseBefore(parallelClassReqVo);
  57 + }
  58 +
  59 + @ApiOperation("选择拟排科目类型,设置优先区间")
  60 + @RequestMapping(value = "secondChoose", method = RequestMethod.POST)
  61 + public BaseVo secondChoose(@RequestBody ParallelClassReqVo parallelClassReqVo) {
  62 + return independenceFeign.secondChoose(parallelClassReqVo);
  63 + }
  64 +
  65 + @ApiOperation("排课撤回")
  66 + @RequestMapping(value = "recall", method = RequestMethod.POST)
  67 + public BaseVo recall(@RequestBody RecallReqVo recallReqVo){
  68 + return independenceFeign.recall(recallReqVo);
  69 + }
  70 +}
... ...
cloud/independence/src/main/java/com/sincere/independence/controller/ScheduleInitController.java 0 → 100644
... ... @@ -0,0 +1,78 @@
  1 +package com.sincere.independence.controller;
  2 +
  3 +import com.sincere.common.vo.BaseVo;
  4 +import com.sincere.common.vo.independence.paike.*;
  5 +import com.sincere.independence.feign.IndependenceFeign;
  6 +import io.swagger.annotations.Api;
  7 +import io.swagger.annotations.ApiOperation;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestBody;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import javax.servlet.http.HttpServletRequest;
  15 +
  16 +@RestController
  17 +@RequestMapping(value = "/init")
  18 +@Api(value = "排课表")
  19 +public class ScheduleInitController {
  20 +
  21 + @Autowired
  22 + IndependenceFeign independenceFeign ;
  23 +
  24 +
  25 + @ApiOperation("创建排课计划 ")
  26 + @RequestMapping(value = "createSchedule", method = RequestMethod.POST)
  27 + public ScheduleRepVo createSchedule(HttpServletRequest request){
  28 + ScheduleRepVo baseVo = new ScheduleRepVo();
  29 + String team = request.getParameter("team");
  30 + String scheduleName = request.getParameter("scheduleName");
  31 + int schoolId = Integer.valueOf(request.getParameter("schoolId"));
  32 + int id = independenceFeign.createSchedule(team,scheduleName,schoolId);
  33 + if(id > 0){
  34 + baseVo.setScheduleId(id);
  35 + baseVo.setSuccess(true);
  36 + }else {
  37 + baseVo.setSuccess(false);
  38 + }
  39 + return baseVo;
  40 + }
  41 +
  42 + @ApiOperation("更新计划")
  43 + @RequestMapping(value = "updateSchedule", method = RequestMethod.POST)
  44 + public BaseVo updateSchedule(@RequestBody UpdateScheduleReqVo updateScheduleReqVo){
  45 + BaseVo baseVo = new BaseVo();
  46 + boolean success = independenceFeign.updateSchedule(updateScheduleReqVo.getScheduleId(),updateScheduleReqVo.getScheduleName(),updateScheduleReqVo.getTeam());
  47 + baseVo.setSuccess(success);
  48 + return baseVo;
  49 + }
  50 +
  51 + @ApiOperation("复制")
  52 + @RequestMapping(value = "copySchedule", method = RequestMethod.POST)
  53 + public BaseVo copySchedule(@RequestBody UpdateScheduleReqVo updateScheduleReqVo){
  54 + BaseVo baseVo = independenceFeign.copySchedule(updateScheduleReqVo.getScheduleId(),updateScheduleReqVo.getScheduleName(),updateScheduleReqVo.getTeam());
  55 + return baseVo;
  56 + }
  57 +
  58 + @ApiOperation("删除排课计划")
  59 + @RequestMapping(value = "deleteSchedule", method = RequestMethod.POST)
  60 + public BaseVo deleteSchedule(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  61 + BaseVo baseVo = new BaseVo();
  62 + baseVo.setSuccess(independenceFeign.deleteSchedule(scheduleIdReqVo.getScheduleId()));
  63 + return baseVo;
  64 + }
  65 +
  66 + @ApiOperation("获取基础信息")
  67 + @RequestMapping(value = "getInitMessage", method = RequestMethod.POST)
  68 + public InitRepVo getInitMessage(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  69 + InitRepVo initRepVo = independenceFeign.getInitMessage(scheduleIdReqVo.getScheduleId());
  70 + return initRepVo;
  71 + }
  72 +
  73 + @ApiOperation("教师授课信息")
  74 + @RequestMapping(value = "initTeacherCourse", method = RequestMethod.POST)
  75 + public BaseVo initTeacherCourse(@RequestBody InitTeacherCourseReqVo initTeacherCourseReqVo) {
  76 + return independenceFeign.initTeacherCourse(initTeacherCourseReqVo);
  77 + }
  78 +}
... ...
cloud/independence/src/main/java/com/sincere/independence/controller/ScheduleMessageController.java 0 → 100644
... ... @@ -0,0 +1,137 @@
  1 +package com.sincere.independence.controller;
  2 +
  3 +import com.sincere.common.dto.independence.ClassModelDto;
  4 +import com.sincere.common.dto.independence.CourseDto;
  5 +import com.sincere.common.dto.independence.ScheduleDto;
  6 +import com.sincere.common.util.ExcelUtils;
  7 +import com.sincere.common.vo.BaseVo;
  8 +import com.sincere.common.vo.independence.paike.*;
  9 +import com.sincere.independence.feign.IndependenceFeign;
  10 +import io.swagger.annotations.Api;
  11 +import io.swagger.annotations.ApiOperation;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.web.bind.annotation.RequestBody;
  14 +import org.springframework.web.bind.annotation.RequestMapping;
  15 +import org.springframework.web.bind.annotation.RequestMethod;
  16 +import org.springframework.web.bind.annotation.RestController;
  17 +
  18 +import javax.servlet.http.HttpServletRequest;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import java.util.ArrayList;
  21 +import java.util.HashMap;
  22 +import java.util.List;
  23 +import java.util.Map;
  24 +
  25 +/**
  26 + * @author chen
  27 + * @version 1.0
  28 + * @date 2019/10/11 0011 14:00
  29 + */
  30 +@RestController
  31 +@Api(value = "获取信息")
  32 +public class ScheduleMessageController {
  33 +
  34 + @Autowired
  35 + IndependenceFeign independenceFeign;
  36 +
  37 + @ApiOperation("获取学校排课计划")
  38 + @RequestMapping(value = "getScheduleList", method = RequestMethod.POST)
  39 + public ScheduleListRepVo getScheduleList(@RequestBody SchoolIdReqVo schoolIdReqVo){
  40 + return independenceFeign.getScheduleList(schoolIdReqVo.getSchoolId());
  41 + }
  42 +
  43 + @ApiOperation("获取学校下所有班级信息")
  44 + @RequestMapping(value = "getClassList", method = RequestMethod.POST)
  45 + public ClassRepVo getClassList(@RequestBody SchoolIdReqVo schoolIdReqVo){
  46 + return independenceFeign.getClassList(schoolIdReqVo.getSchoolId());
  47 + }
  48 +
  49 + @ApiOperation("获取学校课程")
  50 + @RequestMapping(value = "getCourseList", method = RequestMethod.POST)
  51 + public CourseRepVo getCourseList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  52 + return independenceFeign.getCourseList(scheduleIdReqVo.getScheduleId());
  53 + }
  54 +
  55 + @ApiOperation("获取要学习某个学科的班级集合")
  56 + @RequestMapping(value = "getCourseClassList", method = RequestMethod.POST)
  57 + public List<GetCourseClassListRepVo> getCourseClassList(@RequestBody CourseClassReqVo courseClassReqVo){
  58 + return independenceFeign.getCourseClassList(courseClassReqVo.getScheduleId(),courseClassReqVo.getCourseId());
  59 + }
  60 +
  61 + @ApiOperation("获取班级排课课程")
  62 + @RequestMapping(value = "getClassCourseList", method = RequestMethod.POST)
  63 + public ClassCourseRepVo getClassCourseList(@RequestBody GetClassCourseReqVo getClassCourseReqVo){
  64 + return independenceFeign.getClassCourseList(getClassCourseReqVo.getScheduleId(),getClassCourseReqVo.getClassId());
  65 + }
  66 +
  67 + @ApiOperation("获取合班信息")
  68 + @RequestMapping(value = "getJoinList", method = RequestMethod.POST)
  69 + public JoinRepVo getJoinList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  70 + return independenceFeign.getJoinList(scheduleIdReqVo.getScheduleId());
  71 + }
  72 +
  73 + @ApiOperation("获取导入任课信息")
  74 + @RequestMapping(value = "getTeacherClassList", method = RequestMethod.POST)
  75 + public TeacherCourseRepVo getTeacherClassList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  76 + return independenceFeign.getTeacherClassList(scheduleIdReqVo.getScheduleId());
  77 + }
  78 +
  79 + @ApiOperation("获取主课,副科,公共课列表")
  80 + @RequestMapping(value = "getCourseTypeList", method = RequestMethod.POST)
  81 + public GetCourseTypeListRepVo getCourseTypeList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  82 + return independenceFeign.getCourseTypeList(scheduleIdReqVo.getScheduleId());
  83 + }
  84 +
  85 + @ApiOperation("获取未设置学科类型的科目")
  86 + @RequestMapping(value = "getUnCourseList", method = RequestMethod.POST)
  87 + public CourseRepVo getUnCourseList(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  88 + return independenceFeign.getUnCourseList(scheduleIdReqVo.getScheduleId());
  89 + }
  90 +
  91 + @ApiOperation("删除设置的 主课 副科 公共课")
  92 + @RequestMapping(value = "deleteCourseType", method = RequestMethod.POST)
  93 + public BaseVo deleteCourseType(@RequestBody CourseClassReqVo courseClassReqVo){
  94 + return independenceFeign.deleteCourseType(courseClassReqVo.getScheduleId(),courseClassReqVo.getCourseId());
  95 + }
  96 +
  97 + @ApiOperation("获取设置的作息 获取排课计划详情")
  98 + @RequestMapping(value = "getSchedule", method = RequestMethod.POST)
  99 + public ScheduleDto getSchedule(@RequestBody ScheduleIdReqVo scheduleIdReqVo){
  100 + return independenceFeign.getSchedule(scheduleIdReqVo.getScheduleId());
  101 + }
  102 +
  103 + @ApiOperation("导出模板")
  104 + @RequestMapping(value = "export", method = RequestMethod.GET)
  105 + public void export(int scheduleId , HttpServletRequest request, HttpServletResponse response){
  106 + ExcelUtils excelUtils = new ExcelUtils();
  107 + ScheduleDto schedule = independenceFeign.getSchedule(scheduleId);
  108 + List<String> headList = new ArrayList<>();
  109 + headList.add("年级");
  110 + headList.add("班级");
  111 + List<CourseDto> courses = independenceFeign.getCourseBySchoolId(schedule.getSchoolId());
  112 + for(CourseDto course : courses){
  113 + headList.add(course.getCourseName());
  114 + headList.add("任课老师");
  115 +
  116 + }
  117 + List<String> heardKey = new ArrayList<>();
  118 + heardKey.add("grade");
  119 + heardKey.add("class");
  120 + List<Map<String , String >> data = new ArrayList<>();
  121 + List<ClassModelDto> list = independenceFeign.getClassModelBySchoolId(schedule.getSchoolId());
  122 + for(ClassModelDto classModel : list){
  123 + Map<String ,String> map = new HashMap<>();
  124 + map.put("grade",classModel.getGrade());
  125 + map.put("class",classModel.getClassName());
  126 + data.add(map);
  127 + }
  128 + excelUtils.setHeardList(headList);
  129 + excelUtils.setHeardKey(heardKey);
  130 + excelUtils.setData(data);
  131 + try{
  132 + excelUtils.exportExport(request,response);
  133 + }catch (Exception e){
  134 +
  135 + }
  136 + }
  137 +}
... ...
cloud/independence/src/main/java/com/sincere/independence/feign/IndependenceFeign.java 0 → 100644
... ... @@ -0,0 +1,218 @@
  1 +package com.sincere.independence.feign;
  2 +
  3 +import com.sincere.common.dto.independence.*;
  4 +import com.sincere.common.vo.BaseVo;
  5 +import com.sincere.common.vo.independence.paike.*;
  6 +import com.sincere.common.vo.independence.school.*;
  7 +import io.swagger.annotations.ApiOperation;
  8 +import org.springframework.cloud.openfeign.FeignClient;
  9 +import org.springframework.web.bind.annotation.RequestBody;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.RequestParam;
  13 +
  14 +import java.util.*;
  15 +
  16 +/**
  17 + * @author chen
  18 + * @version 1.0
  19 + * @date 2019/11/13 0013 11:32
  20 + */
  21 +@FeignClient("independenceSearch")
  22 +public interface IndependenceFeign {
  23 +
  24 + @RequestMapping(value = "/learn/init/getList", method = RequestMethod.POST)
  25 + List<AnalyseDto> getList(@RequestBody AnalyseDto analyseDto);
  26 +
  27 + @RequestMapping(value = "/learn/init/insertAnalyse", method = RequestMethod.POST)
  28 + BaseVo insertAnalyse(@RequestBody AnalyseDto analyseDto);
  29 +
  30 + @RequestMapping(value = "/learn/init/updateAnalyse", method = RequestMethod.POST)
  31 + BaseVo updateAnalyse(@RequestBody AnalyseDto analyseDto);
  32 +
  33 + @RequestMapping(value = "/learn/init/selectById", method = RequestMethod.GET)
  34 + AnalyseDto selectById(@RequestParam("analyseId") int analyseId) ;
  35 +
  36 + @RequestMapping(value = "/learn/init/getLeagueByAnalyse", method = RequestMethod.GET)
  37 + List<LeagueDto> getLeagueByAnalyse(@RequestParam("analyseId") int analyseId);
  38 +
  39 + @RequestMapping(value = "/learn/init/isImportExam", method = RequestMethod.GET)
  40 + List<AnalyseDetailDto> isImportExam(@RequestParam("analyseId") int analyseId);
  41 +
  42 + @RequestMapping(value = "/learn/init/insertBatchAnalyseDetail", method = RequestMethod.POST)
  43 + boolean insertBatchAnalyseDetail(@RequestBody List<AnalyseDetailDto> analyseDetailDtos);
  44 +
  45 + @RequestMapping(value = "/learn/init/insertBatchAnalyseDimensional", method = RequestMethod.POST)
  46 + boolean insertBatchAnalyseDimensional(@RequestBody List<AnalyseDimensionalDto> analyseDimensionalDtos);
  47 +
  48 + //查数据库是否已存在该四维诊断 不存在则导入 返回主键
  49 + @RequestMapping(value = "/learn/init/selectDimensional", method = RequestMethod.GET)
  50 + int selectDimensional(@RequestParam("type") int type, @RequestParam("name") String name);
  51 +
  52 + @RequestMapping(value = "/learn/init/insertBatchStudent", method = RequestMethod.POST)
  53 + boolean insertBatchStudent(@RequestBody List<StudentDto> studentDtos);
  54 +
  55 + @RequestMapping(value = "/learn/init/insertBatchStudentDetail", method = RequestMethod.POST)
  56 + boolean insertBatchStudentDetail(@RequestBody List<StudentDetailDto> studentDetailDtos);
  57 +
  58 + @RequestMapping(value = "/learn/init/initLeagueSchool", method = RequestMethod.GET)
  59 + boolean initLeagueSchool(@RequestParam("leagueId")int leagueId , @RequestParam("schoolName")String schoolName);
  60 +
  61 + @RequestMapping(value = "/learn/init/insertLeague", method = RequestMethod.POST)
  62 + int insertLeague(@RequestBody LeagueDto leagueDto);
  63 +
  64 + @RequestMapping(value = "/learn/init/getSchoolName", method = RequestMethod.GET)
  65 + List<String> getSchoolName(@RequestParam("analyseId")int analyseId);
  66 +
  67 + @RequestMapping(value = "/learn/init/initChapter", method = RequestMethod.POST)
  68 + boolean initChapter(@RequestBody List<ChapterDto> chapterDtos);
  69 +
  70 +
  71 +
  72 + @RequestMapping(value = "learn/getLearn/getForm1_1", method = RequestMethod.POST)
  73 + Form7RepVO getForm1_1(@RequestBody GetLearnDto getLearnDto);
  74 +
  75 + @RequestMapping(value = "learn/getLearn/getForm2_1_1", method = RequestMethod.POST)
  76 + Form1RepVO getForm2_1_1(@RequestBody GetLearnDto getLearnDto);
  77 +
  78 + @RequestMapping(value = "learn/getLearn/getForm2_1_2", method = RequestMethod.POST)
  79 + Form2RepVO getForm2_1_2(@RequestBody GetLearnDto GetLearnDto);
  80 +
  81 + @RequestMapping(value = "learn/getLearn/getForm2_1_3_2", method = RequestMethod.POST)
  82 + Form2RepVO getForm2_1_3_2(@RequestBody GetLearnDto GetLearnDto);
  83 +
  84 + @RequestMapping(value = "learn/getLearn/getForm2_1_3", method = RequestMethod.POST)
  85 + List<Table1> getForm2_1_3(@RequestBody GetLearnDto GetLearnDto);
  86 +
  87 + @RequestMapping(value = "learn/getLearn/getForm2_2_1", method = RequestMethod.POST)
  88 + Form3RepVO getForm2_2_1(@RequestBody GetLearnDto GetLearnDto);
  89 +
  90 + @RequestMapping(value = "learn/getLearn/getForm2_2_2", method = RequestMethod.POST)
  91 + Form4RepVO getForm2_2_2(@RequestBody GetLearnDto GetLearnDto);
  92 +
  93 + @RequestMapping(value = "learn/getLearn/getForm2_2_3", method = RequestMethod.POST)
  94 + Form5RepVO getForm2_2_3(@RequestBody GetLearnDto GetLearnDto);
  95 +
  96 + @RequestMapping(value = "learn/getLearn/getForm2_2_4", method = RequestMethod.POST)
  97 + Form8RepVO getForm2_2_4(@RequestBody GetLearnDto GetLearnDto);
  98 +
  99 + @RequestMapping(value = "learn/getLearn/getForm2_2_5", method = RequestMethod.POST)
  100 + Map<String,Double> getForm2_2_5(@RequestBody GetLearnDto GetLearnDto);
  101 +
  102 + @RequestMapping(value = "learn/getLearn/getForm3_1", method = RequestMethod.POST)
  103 + Form6RepVO getForm3_1(@RequestBody GetLearnDto GetLearnDto);
  104 +
  105 + @RequestMapping(value = "learn/getLearn/getForm3_1_1", method = RequestMethod.POST)
  106 + Table2RepVO getForm3_1_1(@RequestBody GetLearnDto GetLearnDto);
  107 +
  108 + @RequestMapping(value = "learn/getLearn/getForm3_2", method = RequestMethod.POST)
  109 + Form6RepVO getForm3_2(@RequestBody GetLearnDto GetLearnDto);
  110 +
  111 + @RequestMapping(value = "learn/getLearn/getForm3_3", method = RequestMethod.POST)
  112 + Form6RepVO getForm3_3(@RequestBody GetLearnDto GetLearnDto);
  113 +
  114 + @RequestMapping(value = "learn/getLearn/getForm3_4", method = RequestMethod.POST)
  115 + Form6RepVO getForm3_4(@RequestBody GetLearnDto GetLearnDto);
  116 +
  117 + @RequestMapping(value = "learn/getLearn/getSuggest", method = RequestMethod.POST)
  118 + String getSuggest(@RequestBody GetLearnDto GetLearnDto);
  119 +
  120 + @RequestMapping(value = "learn/getLearn/getSuggest2", method = RequestMethod.POST)
  121 + String getSuggest2(@RequestBody GetLearnDto GetLearnDto);
  122 +
  123 +
  124 +
  125 + //排课
  126 + @RequestMapping(value = "/message/getScheduleList", method = RequestMethod.GET)
  127 + ScheduleListRepVo getScheduleList(@RequestParam("schoolId") int schoolId);
  128 +
  129 + @RequestMapping(value = "/message/getClassList", method = RequestMethod.GET)
  130 + ClassRepVo getClassList(@RequestParam("schoolId") int schoolId);
  131 +
  132 + @RequestMapping(value = "/message/getCourseList", method = RequestMethod.GET)
  133 + CourseRepVo getCourseList(@RequestParam("scheduleId") int scheduleId);
  134 +
  135 + @RequestMapping(value = "/message/getCourseClassList", method = RequestMethod.GET)
  136 + List<GetCourseClassListRepVo> getCourseClassList(@RequestParam("scheduleId") int scheduleId , @RequestParam("courseId") int courseId);
  137 +
  138 + @ApiOperation("获取班级排课课程")
  139 + @RequestMapping(value = "/message/getClassCourseList", method = RequestMethod.GET)
  140 + ClassCourseRepVo getClassCourseList(@RequestParam("scheduleId") int scheduleId , @RequestParam("classId") int classId);
  141 +
  142 + @ApiOperation("获取合班信息")
  143 + @RequestMapping(value = "/message/getJoinList", method = RequestMethod.GET)
  144 + JoinRepVo getJoinList(@RequestParam("scheduleId") int scheduleId);
  145 +
  146 + @ApiOperation("获取导入任课信息")
  147 + @RequestMapping(value = "/message/getTeacherClassList", method = RequestMethod.GET)
  148 + TeacherCourseRepVo getTeacherClassList(@RequestParam("scheduleId") int scheduleId);
  149 +
  150 + @ApiOperation("获取主课,副科,公共课列表")
  151 + @RequestMapping(value = "/message/getCourseTypeList", method = RequestMethod.GET)
  152 + GetCourseTypeListRepVo getCourseTypeList(@RequestParam("scheduleId") int scheduleId);
  153 +
  154 + @ApiOperation("获取未设置学科类型的科目")
  155 + @RequestMapping(value = "/message/getUnCourseList", method = RequestMethod.GET)
  156 + CourseRepVo getUnCourseList(@RequestParam("scheduleId") int scheduleId);
  157 +
  158 + @ApiOperation("删除设置的 主课 副科 公共课")
  159 + @RequestMapping(value = "/message/deleteCourseType", method = RequestMethod.GET)
  160 + BaseVo deleteCourseType(@RequestParam("scheduleId") int scheduleId , @RequestParam("courseId") int courseId);
  161 +
  162 + @RequestMapping(value = "/message/getSchedule", method = RequestMethod.GET)
  163 + ScheduleDto getSchedule(@RequestParam("scheduleId") int scheduleId);
  164 +
  165 + @RequestMapping(value = "/message/getCourseBySchoolId", method = RequestMethod.GET)
  166 + List<CourseDto> getCourseBySchoolId(@RequestParam("schoolId") int schoolId);
  167 +
  168 + @RequestMapping(value = "/message/getClassModelBySchoolId", method = RequestMethod.GET)
  169 + List<ClassModelDto> getClassModelBySchoolId(@RequestParam("schoolId") int schoolId);
  170 +
  171 +
  172 + @RequestMapping(value = "/schedule/firstChoose", method = RequestMethod.POST)
  173 + BaseVo firstChoose(@RequestBody FirstReqVo firstReqVo);
  174 +
  175 + @RequestMapping(value = "/schedule/setCourseType", method = RequestMethod.POST)
  176 + BaseVo setCourseType(@RequestBody SetTypeReqVo setTypeReqVo);
  177 +
  178 + @RequestMapping(value = "/schedule/joinClass", method = RequestMethod.POST)
  179 + BaseVo joinClass(@RequestBody JoinClassReqVo joinClassReqVo);
  180 +
  181 + @RequestMapping(value = "/schedule/deleteJoinClass", method = RequestMethod.POST)
  182 + BaseVo deleteJoinClass(@RequestBody CourseGroupReqVo courseGroupReqVo);
  183 +
  184 + @RequestMapping(value = "/schedule/noSchedule", method = RequestMethod.POST)
  185 + BaseVo noSchedule(@RequestBody NoScheduleReqVo noScheduleReqVo);
  186 +
  187 + @RequestMapping(value = "/schedule/secondChooseBefore", method = RequestMethod.POST)
  188 + BaseVo secondChooseBefore(@RequestBody ParallelClassReqVo parallelClassReqVo);
  189 +
  190 + @RequestMapping(value = "/schedule/secondChoose", method = RequestMethod.POST)
  191 + BaseVo secondChoose(@RequestBody ParallelClassReqVo parallelClassReqVo);
  192 +
  193 + @RequestMapping(value = "/schedule/recall", method = RequestMethod.POST)
  194 + BaseVo recall(@RequestBody RecallReqVo recallReqVo);
  195 +
  196 +
  197 + @RequestMapping(value = "/init/createSchedule", method = RequestMethod.GET)
  198 + int createSchedule(@RequestParam("team")String team , @RequestParam("scheduleName") String scheduleName ,
  199 + @RequestParam("schoolId") int schoolId);
  200 +
  201 + @RequestMapping(value = "/init/updateSchedule", method = RequestMethod.GET)
  202 + boolean updateSchedule(@RequestParam("scheduleId") int scheduleId , @RequestParam("scheduleName")String scheduleName,
  203 + @RequestParam("team")String team);
  204 +
  205 + @RequestMapping(value = "/init/copySchedule", method = RequestMethod.GET)
  206 + BaseVo copySchedule(@RequestParam("scheduleId") int scheduleId , @RequestParam("scheduleName")String scheduleName,
  207 + @RequestParam("team")String team);
  208 +
  209 + @RequestMapping(value = "/init/deleteSchedule", method = RequestMethod.GET)
  210 + boolean deleteSchedule(@RequestParam("scheduleId") int scheduleId);
  211 +
  212 + @RequestMapping(value = "/init/getInitMessage", method = RequestMethod.GET)
  213 + InitRepVo getInitMessage(@RequestParam("scheduleId") int scheduleId);
  214 +
  215 +
  216 + @RequestMapping(value = "/init/initTeacherCourse", method = RequestMethod.POST)
  217 + BaseVo initTeacherCourse(@RequestBody InitTeacherCourseReqVo initTeacherCourseReqVo);
  218 +}
... ...
cloud/independence/src/main/java/com/sincere/independence/feign/LearnFeign.java
... ... @@ -1,121 +0,0 @@
1   -package com.sincere.independence.feign;
2   -
3   -import com.sincere.common.dto.independence.*;
4   -import com.sincere.common.vo.BaseVo;
5   -import com.sincere.common.vo.independence.school.*;
6   -import org.springframework.cloud.openfeign.FeignClient;
7   -import org.springframework.web.bind.annotation.RequestBody;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RequestMethod;
10   -import org.springframework.web.bind.annotation.RequestParam;
11   -
12   -import java.util.List;
13   -import java.util.Map;
14   -
15   -/**
16   - * @author chen
17   - * @version 1.0
18   - * @date 2019/11/13 0013 11:32
19   - */
20   -@FeignClient("independenceSearch")
21   -public interface LearnFeign {
22   -
23   - @RequestMapping(value = "/learn/init/getList", method = RequestMethod.POST)
24   - List<AnalyseDto> getList(@RequestBody AnalyseDto analyseDto);
25   -
26   - @RequestMapping(value = "/learn/init/insertAnalyse", method = RequestMethod.POST)
27   - BaseVo insertAnalyse(@RequestBody AnalyseDto analyseDto);
28   -
29   - @RequestMapping(value = "/learn/init/updateAnalyse", method = RequestMethod.POST)
30   - BaseVo updateAnalyse(@RequestBody AnalyseDto analyseDto);
31   -
32   - @RequestMapping(value = "/learn/init/selectById", method = RequestMethod.GET)
33   - AnalyseDto selectById(@RequestParam("analyseId") int analyseId) ;
34   -
35   - @RequestMapping(value = "/learn/init/getLeagueByAnalyse", method = RequestMethod.GET)
36   - List<LeagueDto> getLeagueByAnalyse(@RequestParam("analyseId") int analyseId);
37   -
38   - @RequestMapping(value = "/learn/init/isImportExam", method = RequestMethod.GET)
39   - List<AnalyseDetailDto> isImportExam(@RequestParam("analyseId") int analyseId);
40   -
41   - @RequestMapping(value = "/learn/init/insertBatchAnalyseDetail", method = RequestMethod.POST)
42   - boolean insertBatchAnalyseDetail(@RequestBody List<AnalyseDetailDto> analyseDetailDtos);
43   -
44   - @RequestMapping(value = "/learn/init/insertBatchAnalyseDimensional", method = RequestMethod.POST)
45   - boolean insertBatchAnalyseDimensional(@RequestBody List<AnalyseDimensionalDto> analyseDimensionalDtos);
46   -
47   - //查数据库是否已存在该四维诊断 不存在则导入 返回主键
48   - @RequestMapping(value = "/learn/init/selectDimensional", method = RequestMethod.GET)
49   - int selectDimensional(@RequestParam("type") int type, @RequestParam("name") String name);
50   -
51   - @RequestMapping(value = "/learn/init/insertBatchStudent", method = RequestMethod.POST)
52   - boolean insertBatchStudent(@RequestBody List<StudentDto> studentDtos);
53   -
54   - @RequestMapping(value = "/learn/init/insertBatchStudentDetail", method = RequestMethod.POST)
55   - boolean insertBatchStudentDetail(@RequestBody List<StudentDetailDto> studentDetailDtos);
56   -
57   - @RequestMapping(value = "/learn/init/initLeagueSchool", method = RequestMethod.GET)
58   - boolean initLeagueSchool(@RequestParam("leagueId")int leagueId , @RequestParam("schoolName")String schoolName);
59   -
60   - @RequestMapping(value = "/learn/init/insertLeague", method = RequestMethod.POST)
61   - int insertLeague(@RequestBody LeagueDto leagueDto);
62   -
63   - @RequestMapping(value = "/learn/init/getSchoolName", method = RequestMethod.GET)
64   - List<String> getSchoolName(@RequestParam("analyseId")int analyseId);
65   -
66   - @RequestMapping(value = "/learn/init/initChapter", method = RequestMethod.POST)
67   - boolean initChapter(@RequestBody List<ChapterDto> chapterDtos);
68   -
69   -
70   -
71   - @RequestMapping(value = "learn/getLearn/getForm1_1", method = RequestMethod.POST)
72   - Form7RepVO getForm1_1(@RequestBody GetLearnDto getLearnDto);
73   -
74   - @RequestMapping(value = "learn/getLearn/getForm2_1_1", method = RequestMethod.POST)
75   - Form1RepVO getForm2_1_1(@RequestBody GetLearnDto getLearnDto);
76   -
77   - @RequestMapping(value = "learn/getLearn/getForm2_1_2", method = RequestMethod.POST)
78   - Form2RepVO getForm2_1_2(@RequestBody GetLearnDto GetLearnDto);
79   -
80   - @RequestMapping(value = "learn/getLearn/getForm2_1_3_2", method = RequestMethod.POST)
81   - Form2RepVO getForm2_1_3_2(@RequestBody GetLearnDto GetLearnDto);
82   -
83   - @RequestMapping(value = "learn/getLearn/getForm2_1_3", method = RequestMethod.POST)
84   - List<Table1> getForm2_1_3(@RequestBody GetLearnDto GetLearnDto);
85   -
86   - @RequestMapping(value = "learn/getLearn/getForm2_2_1", method = RequestMethod.POST)
87   - Form3RepVO getForm2_2_1(@RequestBody GetLearnDto GetLearnDto);
88   -
89   - @RequestMapping(value = "learn/getLearn/getForm2_2_2", method = RequestMethod.POST)
90   - public Form4RepVO getForm2_2_2(@RequestBody GetLearnDto GetLearnDto);
91   -
92   - @RequestMapping(value = "learn/getLearn/getForm2_2_3", method = RequestMethod.POST)
93   - Form5RepVO getForm2_2_3(@RequestBody GetLearnDto GetLearnDto);
94   -
95   - @RequestMapping(value = "learn/getLearn/getForm2_2_4", method = RequestMethod.POST)
96   - Form8RepVO getForm2_2_4(@RequestBody GetLearnDto GetLearnDto);
97   -
98   - @RequestMapping(value = "learn/getLearn/getForm2_2_5", method = RequestMethod.POST)
99   - Map<String,Double> getForm2_2_5(@RequestBody GetLearnDto GetLearnDto);
100   -
101   - @RequestMapping(value = "learn/getLearn/getForm3_1", method = RequestMethod.POST)
102   - Form6RepVO getForm3_1(@RequestBody GetLearnDto GetLearnDto);
103   -
104   - @RequestMapping(value = "learn/getLearn/getForm3_1_1", method = RequestMethod.POST)
105   - Table2RepVO getForm3_1_1(@RequestBody GetLearnDto GetLearnDto);
106   -
107   - @RequestMapping(value = "learn/getLearn/getForm3_2", method = RequestMethod.POST)
108   - Form6RepVO getForm3_2(@RequestBody GetLearnDto GetLearnDto);
109   -
110   - @RequestMapping(value = "learn/getLearn/getForm3_3", method = RequestMethod.POST)
111   - Form6RepVO getForm3_3(@RequestBody GetLearnDto GetLearnDto);
112   -
113   - @RequestMapping(value = "learn/getLearn/getForm3_4", method = RequestMethod.POST)
114   - Form6RepVO getForm3_4(@RequestBody GetLearnDto GetLearnDto);
115   -
116   - @RequestMapping(value = "learn/getLearn/getSuggest", method = RequestMethod.POST)
117   - String getSuggest(@RequestBody GetLearnDto GetLearnDto);
118   -
119   - @RequestMapping(value = "learn/getLearn/getSuggest2", method = RequestMethod.POST)
120   - String getSuggest2(@RequestBody GetLearnDto GetLearnDto);
121   -}
cloud/independence/src/main/java/com/sincere/independence/filter/AllowOriginFilter.java
1   -package com.sincere.independence.filter;
2   -
3   -import org.springframework.stereotype.Component;
4   -
5   -import javax.servlet.*;
6   -import javax.servlet.annotation.WebFilter;
7   -import javax.servlet.http.HttpServletResponse;
8   -import java.io.IOException;
9   -
10   -/**
11   - * 用于解决跨域问题
12   - * @author chen
13   - * @version 1.0
14   - * @date 2019/10/11 0011 10:17
15   - */
16   -@Component
17   -@WebFilter(urlPatterns = "/*", filterName = "authFilter")
18   -public class AllowOriginFilter implements Filter {
19   -
20   - @Override
21   - public void init(FilterConfig filterConfig) throws ServletException {
22   - }
23   -
24   - public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
25   - HttpServletResponse response = (HttpServletResponse) res;
26   - response.setHeader("Access-Control-Allow-Origin", "*");
27   - response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
28   - response.setHeader("Access-Control-Allow-Credentials", "true");
29   - response.setHeader("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept");
30   - chain.doFilter(req, res);
31   - }
32   -
33   - @Override
34   - public void destroy() {
35   - }
36   -}
37   -
38   -
  1 +//package com.sincere.independence.filter;
  2 +//
  3 +//import org.springframework.stereotype.Component;
  4 +//
  5 +//import javax.servlet.*;
  6 +//import javax.servlet.annotation.WebFilter;
  7 +//import javax.servlet.http.HttpServletResponse;
  8 +//import java.io.IOException;
  9 +//
  10 +///**
  11 +// * 用于解决跨域问题
  12 +// * @author chen
  13 +// * @version 1.0
  14 +// * @date 2019/10/11 0011 10:17
  15 +// */
  16 +//@Component
  17 +//@WebFilter(urlPatterns = "/*", filterName = "authFilter")
  18 +//public class AllowOriginFilter implements Filter {
  19 +//
  20 +// @Override
  21 +// public void init(FilterConfig filterConfig) throws ServletException {
  22 +// }
  23 +//
  24 +// public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
  25 +// HttpServletResponse response = (HttpServletResponse) res;
  26 +// response.setHeader("Access-Control-Allow-Origin", "*");
  27 +// response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
  28 +// response.setHeader("Access-Control-Allow-Credentials", "true");
  29 +// response.setHeader("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept");
  30 +// chain.doFilter(req, res);
  31 +// }
  32 +//
  33 +// @Override
  34 +// public void destroy() {
  35 +// }
  36 +//}
  37 +//
  38 +//
... ...
cloud/independence/src/main/resources/application.yaml
... ... @@ -7,6 +7,9 @@ spring:
7 7 profiles:
8 8 active: dev
9 9  
  10 +ribbon:
  11 + ReadTimeout: 50000
  12 + ConnectTimeout: 5000
10 13  
11 14 eureka:
12 15 instance:
... ... @@ -17,4 +20,6 @@ eureka:
17 20 service-url:
18 21 # defaultZone: http://localhost:8761/eureka/
19 22 defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/
20   -
  23 + config:
  24 + connect-timeout: 5000
  25 + read-timeout: 60000
... ...
cloud/search_independence/pom.xml
... ... @@ -56,6 +56,23 @@
56 56 <artifactId>mybatis-spring-boot-starter</artifactId>
57 57 <version>1.3.0</version>
58 58 </dependency>
  59 + <dependency>
  60 + <groupId>commons-net</groupId>
  61 + <artifactId>commons-net</artifactId>
  62 + <version>2.0</version>
  63 + </dependency>
  64 + <dependency>
  65 + <groupId>org.apache.poi</groupId>
  66 + <artifactId>poi</artifactId>
  67 + <version>4.1.0</version>
  68 + </dependency>
  69 +
  70 + <dependency>
  71 + <groupId>org.apache.poi</groupId>
  72 + <artifactId>poi-ooxml</artifactId>
  73 + <version>4.1.0</version>
  74 + </dependency>
  75 +
59 76 </dependencies>
60 77  
61 78 <build>
... ...
cloud/search_independence/src/main/java/com/sincere/independence/IndependenceSearchApplication.java
... ... @@ -14,7 +14,7 @@ import org.springframework.context.annotation.ComponentScan;
14 14 @EnableEurekaClient
15 15 @SpringBootApplication
16 16 @MapperScan("com.sincere.independence.mapper")
17   -@ComponentScan("com.sincere.common")
  17 +@ComponentScan("com.sincere")
18 18 public class IndependenceSearchApplication {
19 19  
20 20 public static void main(String[] args) {
... ...
cloud/search_independence/src/main/java/com/sincere/independence/controller/ScheduleInitController.java
... ... @@ -4,23 +4,26 @@ import com.alibaba.fastjson.JSONObject;
4 4 import com.sincere.common.util.HttpClientUtils;
5 5 import com.sincere.common.vo.BaseVo;
6 6 import com.sincere.common.vo.independence.paike.InitRepVo;
  7 +import com.sincere.common.vo.independence.paike.InitTeacherCourseReqVo;
7 8 import com.sincere.independence.model.*;
8 9 import com.sincere.independence.service.*;
9   -import io.swagger.annotations.Api;
10 10 import io.swagger.annotations.ApiOperation;
11 11 import org.apache.commons.lang3.StringUtils;
  12 +import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  13 +import org.apache.poi.ss.usermodel.*;
  14 +import org.apache.poi.xssf.usermodel.XSSFWorkbook;
12 15 import org.springframework.beans.factory.annotation.Autowired;
13 16 import org.springframework.beans.factory.annotation.Value;
14 17 import org.springframework.transaction.annotation.Transactional;
15 18 import org.springframework.web.bind.annotation.*;
16 19  
17   -import java.util.ArrayList;
18   -import java.util.Date;
19   -import java.util.List;
  20 +import java.io.File;
  21 +import java.io.FileInputStream;
  22 +import java.io.InputStream;
  23 +import java.util.*;
20 24  
21 25 @RestController
22 26 @RequestMapping(value = "/init")
23   -@Api(value = "排课表")
24 27 public class ScheduleInitController {
25 28  
26 29 @Autowired
... ... @@ -61,24 +64,26 @@ public class ScheduleInitController {
61 64 Schedule temp = scheduleService.selectBySchoolAndTeam(schedule);
62 65 if(temp == null){
63 66 scheduleService.insert(schedule);
  67 + initMessage(schoolId);
  68 + return schedule.getId();
64 69 }else {
65 70 return 0 ;
66 71 }
67   - temp = scheduleService.selectBySchoolAndTeam(schedule);
68   - initMessage(schedule.getSchoolId());
69   - return temp.getId();
70 72 }
71 73  
72 74 @ApiOperation("更新计划")
73 75 @RequestMapping(value = "updateSchedule", method = RequestMethod.GET)
74   - public BaseVo updateSchedule(@RequestParam("scheduleId") int scheduleId , @RequestParam("scheduleName")String scheduleName,
  76 + public boolean updateSchedule(@RequestParam("scheduleId") int scheduleId , @RequestParam("scheduleName")String scheduleName,
75 77 @RequestParam("team")String team){
76   - BaseVo baseVo = new BaseVo();
77 78 Schedule schedule = scheduleService.selectById(scheduleId);
78   - schedule.setScheduleName(scheduleName);
79   - schedule.setTeam(team);
80   - scheduleService.update(schedule);
81   - return baseVo;
  79 + if(schedule != null){
  80 + schedule.setScheduleName(scheduleName);
  81 + schedule.setTeam(team);
  82 + scheduleService.update(schedule);
  83 + return true;
  84 + }else {
  85 + return false ;
  86 + }
82 87 }
83 88  
84 89 @ApiOperation("复制")
... ... @@ -135,13 +140,10 @@ public class ScheduleInitController {
135 140  
136 141 @ApiOperation("删除排课计划")
137 142 @RequestMapping(value = "deleteSchedule", method = RequestMethod.GET)
138   - public BaseVo deleteSchedule(@RequestParam("scheduleId") int scheduleId){
139   - BaseVo baseVo = new BaseVo();
  143 + public boolean deleteSchedule(@RequestParam("scheduleId") int scheduleId){
140 144 Schedule schedule = scheduleService.selectById(scheduleId);
141 145 if(schedule == null){
142   - baseVo.setSuccess(false);
143   - baseVo.setMessage("无排课计划");
144   - return baseVo;
  146 + return true;
145 147 }
146 148 teacherCourseService.deleteBySchoolIdAndTeam(schedule.getSchoolId(),schedule.getTeam());
147 149 joinClassService.deleteBySchoolIdAndTeam(schedule.getSchoolId(),schedule.getTeam());
... ... @@ -152,7 +154,7 @@ public class ScheduleInitController {
152 154 teacherClassService.deleteBySchoolAndTeam(teacherClass);
153 155 courseService.initSchoolId(schedule.getSchoolId());
154 156 scheduleService.deleteBySchedule(schedule.getId());
155   - return baseVo;
  157 + return true ;
156 158 }
157 159  
158 160 @ApiOperation("获取基础信息")
... ... @@ -177,16 +179,124 @@ public class ScheduleInitController {
177 179 @Transactional
178 180 @ApiOperation("教师授课信息")
179 181 @RequestMapping(value = "initTeacherCourse", method = RequestMethod.POST)
180   - public boolean initTeacherCourse(@RequestBody List<TeacherClass> teacherClasses){
  182 + public BaseVo initTeacherCourse(@RequestBody InitTeacherCourseReqVo initTeacherCourseReqVo){
181 183 BaseVo baseVo = new BaseVo();
182   - Schedule search = new Schedule();
183   - search.setSchoolId(teacherClasses.get(0).getSchoolId());
184   - search.setTeam(teacherClasses.get(0).getTeam());
185   - Schedule schedule = scheduleService.selectBySchoolAndTeam(search);
186   - teacherClassService.insertBatch(teacherClasses);
187   - schedule.setSpeed(3);
188   - scheduleService.updateSpeed(schedule);
189   - return true;
  184 + Date date = new Date();
  185 + try{
  186 + TeacherClass temp = new TeacherClass();
  187 + Schedule schedule = scheduleService.selectById(initTeacherCourseReqVo.getScheduleId());
  188 + if(schedule != null && schedule.getSpeed() == 2) {
  189 + temp.setSchoolId(schedule.getSchoolId());
  190 + temp.setTeam(schedule.getTeam());
  191 + List<TeacherClass> list = teacherClassService.selectBySchoolAndTeam(temp);
  192 + if (list != null && list.size() > 0) {
  193 + teacherClassService.deleteBySchoolAndTeam(temp);
  194 + }
  195 + String fileUrl = initTeacherCourseReqVo.getUrl();
  196 + File excelFile = new File(fileUrl);
  197 + // 获得工作簿
  198 + Workbook workbook = null;
  199 + String file = excelFile.getName();
  200 + InputStream inputStream = new FileInputStream(excelFile) ;
  201 + //InputStream inputStream = HttpClientUtils.GetFileInputStream(initTeacherCourseReqVo.getUrl());
  202 + if(inputStream == null){
  203 + baseVo.setMessage("路径不存在");
  204 + baseVo.setSuccess(false);
  205 + return baseVo;
  206 + }
  207 + if (file.endsWith("xls")) {
  208 + workbook = new HSSFWorkbook(inputStream);
  209 + } else {
  210 + workbook = new XSSFWorkbook(inputStream);
  211 + }
  212 + // 获得工作表
  213 + Sheet sheet = workbook.getSheetAt(0);
  214 + int rows = sheet.getPhysicalNumberOfRows();
  215 + Map<Integer, Course> courseTeacherMap = new HashMap<>();
  216 + int courseNumber = 0;
  217 + List<TeacherClass> teacherClasses = new ArrayList<>();
  218 + for (int i = 0; i < rows; i++) {
  219 + // 获取第i行数据
  220 + Row sheetRow = sheet.getRow(i);
  221 + if (i == 0) {
  222 + //获取表头
  223 + int j = 1;
  224 + while (sheetRow.getCell(2 * j) != null && StringUtils.isNotBlank(sheetRow.getCell(2 * j).getStringCellValue().trim())) {
  225 + Course course = courseService.selectBySchoolIdAndCourseName(schedule.getSchoolId(), sheetRow.getCell(2 * j).getStringCellValue().trim());
  226 + courseTeacherMap.put(j, course);
  227 + j++;
  228 + }
  229 + courseNumber = j - 1;
  230 + } else {
  231 + if(sheetRow.getCell(0) != null){
  232 + if (StringUtils.isBlank(sheetRow.getCell(0).getStringCellValue().trim())) {
  233 + continue;
  234 + }
  235 + String className = sheetRow.getCell(1).getStringCellValue().trim();
  236 + ClassModel classModel = new ClassModel();
  237 + classModel.setSchoolId(schedule.getSchoolId());
  238 + classModel.setClassName(className);
  239 + classModel.setGrade(sheetRow.getCell(0).getStringCellValue().trim());
  240 + ClassModel resultClass = classModelService.selectBySchoolIdAndClassNameAndGrade(classModel);
  241 + for (int j = 1; j <= courseNumber; j++) {
  242 + Cell cell = sheetRow.getCell(2 * j);
  243 + if (cell != null) {
  244 + cell.setCellType(CellType.STRING);
  245 + String times = sheetRow.getCell(2 * j).getStringCellValue().trim();
  246 + if (StringUtils.isNotBlank((times))) {
  247 + Course course = courseTeacherMap.get(j);
  248 + String teacherName = sheetRow.getCell(2 * j + 1).getStringCellValue().trim();
  249 + Teacher teacher = new Teacher();
  250 + teacher.setTeacherName(teacherName);
  251 + teacher.setSchoolId(schedule.getSchoolId());
  252 + Teacher resultTeacher = teacherService.selectByTeacher(teacher);
  253 + if (course != null && resultTeacher != null) {
  254 + TeacherClass teacherClass = new TeacherClass();
  255 + teacherClass.setTeam(schedule.getTeam());
  256 + teacherClass.setSchoolId(schedule.getSchoolId());
  257 + teacherClass.setCourseName(course.getCourseName());
  258 + teacherClass.setTeacherName(resultTeacher.getTeacherName());
  259 + teacherClass.setTeacherId(resultTeacher.getTeacherId());
  260 + teacherClass.setGrade(sheetRow.getCell(0).getStringCellValue().trim());
  261 + teacherClass.setClassId(resultClass.getClassId());
  262 + String[] msg = times.split("\\+");
  263 + if (msg.length > 1) {
  264 + //有联课
  265 + teacherClass.setJoinTimes(Integer.valueOf(msg[1]));
  266 + teacherClass.setTimes(Integer.valueOf(msg[1]) * 2 + Integer.valueOf(msg[0]));
  267 + } else {
  268 + teacherClass.setJoinTimes(0);
  269 + teacherClass.setTimes(Integer.valueOf(msg[0]));
  270 + }
  271 + teacherClass.setStatus(0);
  272 + teacherClass.setCreateTime(date);
  273 + teacherClasses.add(teacherClass);
  274 + } else {
  275 + baseVo.setMessage("课程或老师缺失");
  276 + baseVo.setSuccess(false);
  277 + return baseVo;
  278 + }
  279 + }
  280 +
  281 + }
  282 + }
  283 + }
  284 +
  285 + }
  286 + }
  287 + teacherClassService.insertBatch(teacherClasses);
  288 + schedule.setSpeed(3);
  289 + scheduleService.updateSpeed(schedule);
  290 + }else {
  291 + baseVo.setMessage("排课计划不存在或已导入");
  292 + baseVo.setSuccess(false);
  293 + }
  294 + }catch (Exception e){
  295 + e.printStackTrace();
  296 + baseVo.setMessage("导入的数据有误");
  297 + baseVo.setSuccess(false);
  298 + }
  299 + return baseVo;
190 300 }
191 301  
192 302 private void initMessage(int schoolId){
... ... @@ -227,7 +337,7 @@ public class ScheduleInitController {
227 337 initCourse(courses,schoolId);
228 338 }
229 339  
230   - public BaseVo initCourse(List<Course> courseList ,int schoolId){
  340 + private BaseVo initCourse(List<Course> courseList ,int schoolId){
231 341 BaseVo baseVo = new BaseVo();
232 342 courseService.deleteSchoolId(schoolId);
233 343 for(Course course : courseList){
... ... @@ -246,7 +356,7 @@ public class ScheduleInitController {
246 356 }
247 357 }
248 358  
249   - public BaseVo initClass(List<ClassModel> classList , int schoolId){
  359 + private BaseVo initClass(List<ClassModel> classList , int schoolId){
250 360 BaseVo baseVo = new BaseVo();
251 361 classModelService.deleteSchool(schoolId);
252 362 for(ClassModel classModel : classList){
... ... @@ -266,7 +376,7 @@ public class ScheduleInitController {
266 376 }
267 377 }
268 378  
269   - public BaseVo initTeacher(List<Teacher> teacherList , int schoolId){
  379 + private BaseVo initTeacher(List<Teacher> teacherList , int schoolId){
270 380 List<Teacher> result = new ArrayList<>();
271 381 for(Teacher teacher : teacherList){
272 382 boolean isExist = false;
... ...
cloud/search_independence/src/main/java/com/sincere/independence/controller/ScheduleMessageController.java
... ... @@ -5,7 +5,6 @@ import com.sincere.common.vo.BaseVo;
5 5 import com.sincere.common.vo.independence.paike.*;
6 6 import com.sincere.independence.model.*;
7 7 import com.sincere.independence.service.*;
8   -import io.swagger.annotations.ApiOperation;
9 8 import org.springframework.beans.factory.annotation.Autowired;
10 9 import org.springframework.web.bind.annotation.RequestMapping;
11 10 import org.springframework.web.bind.annotation.RequestMethod;
... ... @@ -21,6 +20,7 @@ import java.util.List;
21 20 * @date 2019/10/11 0011 14:00
22 21 */
23 22 @RestController
  23 +@RequestMapping(value = "/message")
24 24 public class ScheduleMessageController {
25 25  
26 26 @Autowired
... ... @@ -142,7 +142,6 @@ public class ScheduleMessageController {
142 142 return repVos;
143 143 }
144 144  
145   - @ApiOperation("获取班级排课课程")
146 145 @RequestMapping(value = "getClassCourseList", method = RequestMethod.GET)
147 146 public ClassCourseRepVo getClassCourseList(@RequestParam("scheduleId") int scheduleId , @RequestParam("classId") int classId){
148 147 ClassCourseRepVo classCourseRepVo = new ClassCourseRepVo();
... ... @@ -201,7 +200,6 @@ public class ScheduleMessageController {
201 200 }
202 201  
203 202  
204   - @ApiOperation("获取合班信息")
205 203 @RequestMapping(value = "getJoinList", method = RequestMethod.GET)
206 204 public JoinRepVo getJoinList(@RequestParam("scheduleId") int scheduleId){
207 205 JoinRepVo joinRepVo = new JoinRepVo();
... ... @@ -240,7 +238,6 @@ public class ScheduleMessageController {
240 238 return joinRepVo;
241 239 }
242 240  
243   - @ApiOperation("获取导入任课信息")
244 241 @RequestMapping(value = "getTeacherClassList", method = RequestMethod.GET)
245 242 public TeacherCourseRepVo getTeacherClassList(@RequestParam("scheduleId") int scheduleId){
246 243 TeacherCourseRepVo teacherCourseRepVo = new TeacherCourseRepVo();
... ... @@ -300,7 +297,6 @@ public class ScheduleMessageController {
300 297 return teacherClassDto;
301 298 }
302 299  
303   - @ApiOperation("获取主课,副科,公共课列表")
304 300 @RequestMapping(value = "getCourseTypeList", method = RequestMethod.GET)
305 301 public GetCourseTypeListRepVo getCourseTypeList(@RequestParam("scheduleId") int scheduleId){
306 302 GetCourseTypeListRepVo getCourseTypeListRepVo = new GetCourseTypeListRepVo();
... ... @@ -341,7 +337,6 @@ public class ScheduleMessageController {
341 337 return getCourseTypeListRepVo;
342 338 }
343 339  
344   - @ApiOperation("获取未设置学科类型的科目")
345 340 @RequestMapping(value = "getUnCourseList", method = RequestMethod.GET)
346 341 public CourseRepVo getUnCourseList(@RequestParam("scheduleId") int scheduleId){
347 342 CourseRepVo courseRepVo = new CourseRepVo();
... ... @@ -363,7 +358,6 @@ public class ScheduleMessageController {
363 358 return courseRepVo;
364 359 }
365 360  
366   - @ApiOperation("删除设置的 主课 副科 公共课")
367 361 @RequestMapping(value = "deleteCourseType", method = RequestMethod.GET)
368 362 public BaseVo deleteCourseType(@RequestParam("scheduleId") int scheduleId , @RequestParam("courseId") int courseId){
369 363 BaseVo baseVo = new BaseVo();
... ... @@ -388,4 +382,24 @@ public class ScheduleMessageController {
388 382 return initSchedule(schedule);
389 383 }
390 384  
  385 + @RequestMapping(value = "getCourseBySchoolId", method = RequestMethod.GET)
  386 + public List<CourseDto> getCourseBySchoolId(@RequestParam("schoolId") int schoolId){
  387 + List<Course> courses = courseService.selectBySchoolId2(schoolId);
  388 + List<CourseDto> courseDtoList = new ArrayList<>();
  389 + for(Course course : courses){
  390 + courseDtoList.add(initCourse(course));
  391 + }
  392 + return courseDtoList;
  393 + }
  394 +
  395 +
  396 + @RequestMapping(value = "getClassModelBySchoolId", method = RequestMethod.GET)
  397 + public List<ClassModelDto> getClassModelBySchoolId(@RequestParam("schoolId") int schoolId){
  398 + List<ClassModel> classModels = classModelService.selectBySchoolId(schoolId);
  399 + List<ClassModelDto> classModelDtoList = new ArrayList<>();
  400 + for(ClassModel classModel : classModels){
  401 + classModelDtoList.add(initClassModel(classModel));
  402 + }
  403 + return classModelDtoList;
  404 + }
391 405 }
... ...
cloud/search_independence/src/main/java/com/sincere/independence/model/TeacherClass.java
1 1 package com.sincere.independence.model;
2 2  
  3 +import com.sincere.common.dto.independence.TeacherClassDto;
  4 +
3 5 import java.io.Serializable;
4 6 import java.util.Date;
5 7  
6 8 public class TeacherClass implements Serializable {
7 9 private Integer tClassId;
8   -
9 10 private Integer teacherId;
10   -
11 11 private String teacherName;
12   -
13 12 private Integer schoolId;
14   -
15 13 private String grade;
16   -
17 14 private Integer classId;
18   -
19 15 private String courseName;
20   -
21 16 private Integer times;
22   -
23 17 private Integer joinTimes;
24   -
25 18 private Date createTime;
26   -
27 19 private String team ;
28   -
29 20 private int status ;
30 21  
  22 + public TeacherClass(TeacherClassDto teacherClassDto) {
  23 + this.tClassId = teacherClassDto.gettClassId();
  24 + this.teacherId = teacherClassDto.getTeacherId();
  25 + this.teacherName = teacherClassDto.getTeacherName();
  26 + this.schoolId = teacherClassDto.getSchoolId();
  27 + this.grade = teacherClassDto.getGrade();
  28 + this.classId = teacherClassDto.getClassId();
  29 + this.courseName = teacherClassDto.getCourseName();
  30 + this.times = teacherClassDto.getTimes();
  31 + this.joinTimes = teacherClassDto.getJoinTimes();
  32 + this.createTime = teacherClassDto.getCreateTime();
  33 + this.team = teacherClassDto.getTeam();
  34 + this.status = teacherClassDto.getStatus();
  35 + }
  36 +
  37 + public TeacherClass() {
  38 + }
  39 +
31 40 public Integer gettClassId() {
32 41 return tClassId;
33 42 }
... ...
cloud/search_independence/src/main/resources/application.yml
... ... @@ -23,6 +23,7 @@ eureka:
23 23 service-url:
24 24 defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/
25 25  
  26 +
26 27 remoting:
27 28 # url: http://60.190.202.57:1000
28 29 url: http://campus.myjxt.com
... ...
cloud/search_independence/src/main/resources/mapper/ScheduleMapper.xml
... ... @@ -14,7 +14,7 @@
14 14 <result column="night" property="night" jdbcType="INTEGER" />
15 15 </resultMap>
16 16  
17   - <insert id="insert" parameterType="com.sincere.independence.model.Schedule">
  17 + <insert id="insert" parameterType="com.sincere.independence.model.Schedule" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
18 18 insert into sz_schedule ( schedule_name , school_id, team,create_time,speed)
19 19 values (#{scheduleName},#{schoolId},#{team},#{createTime},#{speed})
20 20 </insert>
... ...