Commit a79c5a75ece6ee0288025d0dd5d27b0be2c3558e

Authored by 陈杰
1 parent 2f3069be
Exists in master

bug 修复

src/main/java/com/sincere/student/controller/AdminController.java
@@ -229,6 +229,7 @@ public class AdminController { @@ -229,6 +229,7 @@ public class AdminController {
229 public BaseDto<Page<Consult>> getConsultList(@RequestBody ConsultSearchDto consultSearchDto){ 229 public BaseDto<Page<Consult>> getConsultList(@RequestBody ConsultSearchDto consultSearchDto){
230 BaseDto<Page<Consult>> result = new BaseDto<>() ; 230 BaseDto<Page<Consult>> result = new BaseDto<>() ;
231 consultSearchDto.setStatus(0); 231 consultSearchDto.setStatus(0);
  232 + consultSearchDto.setColumnType(-1);
232 Page<Consult> page = consultService.getList(consultSearchDto); 233 Page<Consult> page = consultService.getList(consultSearchDto);
233 result.setData(page); 234 result.setData(page);
234 return result ; 235 return result ;
@@ -469,7 +470,12 @@ public class AdminController { @@ -469,7 +470,12 @@ public class AdminController {
469 @RequestMapping(value = "/article/createArticle" , method = RequestMethod.POST) 470 @RequestMapping(value = "/article/createArticle" , method = RequestMethod.POST)
470 public BaseDto createArticle(@RequestBody Article article){ 471 public BaseDto createArticle(@RequestBody Article article){
471 BaseDto result = new BaseDto() ; 472 BaseDto result = new BaseDto() ;
472 - articleService.create(article); 473 + if(StringUtils.isBlank(article.getImageUrl())){
  474 + result.setSuccess(false);
  475 + result.setMessage("请上传封面图片");
  476 + }else {
  477 + articleService.create(article);
  478 + }
473 return result ; 479 return result ;
474 } 480 }
475 481
src/main/java/com/sincere/student/controller/AppController.java
@@ -301,4 +301,27 @@ public class AppController { @@ -301,4 +301,27 @@ public class AppController {
301 result.setData(submitService.getAppList(pointSearchDto)); 301 result.setData(submitService.getAppList(pointSearchDto));
302 return result ; 302 return result ;
303 } 303 }
  304 +
  305 + @ApiOperation("投档线首页列表接口")
  306 + @RequestMapping(value = "/submit/getSubmitList" , method = RequestMethod.POST)
  307 + public BaseDto<Page<SubmitLine>> getSubmitList(@RequestBody PageDto pageDto){
  308 + BaseDto<Page<SubmitLine>> result = new BaseDto<>();
  309 + PointSearchDto pointSearchDto = new PointSearchDto();
  310 + pointSearchDto.setPage(pageDto.getPage());
  311 + pointSearchDto.setPageSize(pageDto.getPageSize());
  312 + result.setData(submitService.getAppList(pointSearchDto));
  313 + return result ;
  314 + }
  315 +
  316 + @ApiOperation("具体某个投档线详情接口")
  317 + @RequestMapping(value = "/submit/getDetail" , method = RequestMethod.POST)
  318 + public BaseDto<SubmitLine> getSubmitDetail(@RequestBody IdDto idDto){
  319 + BaseDto<SubmitLine> result = new BaseDto<>();
  320 + PointSearchDto pointSearchDto = new PointSearchDto();
  321 + pointSearchDto.setPage(1);
  322 + pointSearchDto.setPageSize(1);
  323 + pointSearchDto.setSubmitId(idDto.getId());
  324 + result.setData(submitService.getAppList(pointSearchDto).getList().get(0));
  325 + return result ;
  326 + }
304 } 327 }
src/main/java/com/sincere/student/dto/submit/SubmitMajor.java
@@ -1,49 +0,0 @@ @@ -1,49 +0,0 @@
1 -package com.sincere.student.dto.submit;  
2 -  
3 -import io.swagger.annotations.ApiModel;  
4 -import io.swagger.annotations.ApiModelProperty;  
5 -  
6 -@ApiModel  
7 -public class SubmitMajor {  
8 -  
9 - @ApiModelProperty(value = "专业")  
10 - private String major ;  
11 - @ApiModelProperty(value = "分数")  
12 - private int grade ;  
13 - @ApiModelProperty(value = "招收数量")  
14 - private int enrollNumber ;  
15 - @ApiModelProperty(value = "位次号")  
16 - private int rank ;  
17 -  
18 - public String getMajor() {  
19 - return major;  
20 - }  
21 -  
22 - public void setMajor(String major) {  
23 - this.major = major;  
24 - }  
25 -  
26 - public int getGrade() {  
27 - return grade;  
28 - }  
29 -  
30 - public void setGrade(int grade) {  
31 - this.grade = grade;  
32 - }  
33 -  
34 - public int getEnrollNumber() {  
35 - return enrollNumber;  
36 - }  
37 -  
38 - public void setEnrollNumber(int enrollNumber) {  
39 - this.enrollNumber = enrollNumber;  
40 - }  
41 -  
42 - public int getRank() {  
43 - return rank;  
44 - }  
45 -  
46 - public void setRank(int rank) {  
47 - this.rank = rank;  
48 - }  
49 -}  
src/main/java/com/sincere/student/dto/submit/SubmitUniv.java
@@ -12,8 +12,46 @@ public class SubmitUniv { @@ -12,8 +12,46 @@ public class SubmitUniv {
12 private int universityId ; 12 private int universityId ;
13 @ApiModelProperty(value = "学校名称") 13 @ApiModelProperty(value = "学校名称")
14 private String universityName ; 14 private String universityName ;
15 - @ApiModelProperty(value = "专业列表")  
16 - private List<SubmitMajor> majorList ; 15 + @ApiModelProperty(value = "专业")
  16 + private String major ;
  17 + @ApiModelProperty(value = "分数")
  18 + private int grade ;
  19 + @ApiModelProperty(value = "招收数量")
  20 + private int enrollNumber ;
  21 + @ApiModelProperty(value = "位次号")
  22 + private int rank ;
  23 +
  24 + public String getMajor() {
  25 + return major;
  26 + }
  27 +
  28 + public void setMajor(String major) {
  29 + this.major = major;
  30 + }
  31 +
  32 + public int getGrade() {
  33 + return grade;
  34 + }
  35 +
  36 + public void setGrade(int grade) {
  37 + this.grade = grade;
  38 + }
  39 +
  40 + public int getEnrollNumber() {
  41 + return enrollNumber;
  42 + }
  43 +
  44 + public void setEnrollNumber(int enrollNumber) {
  45 + this.enrollNumber = enrollNumber;
  46 + }
  47 +
  48 + public int getRank() {
  49 + return rank;
  50 + }
  51 +
  52 + public void setRank(int rank) {
  53 + this.rank = rank;
  54 + }
17 55
18 public int getUniversityId() { 56 public int getUniversityId() {
19 return universityId; 57 return universityId;
@@ -31,11 +69,4 @@ public class SubmitUniv { @@ -31,11 +69,4 @@ public class SubmitUniv {
31 this.universityName = universityName; 69 this.universityName = universityName;
32 } 70 }
33 71
34 - public List<SubmitMajor> getMajorList() {  
35 - return majorList;  
36 - }  
37 -  
38 - public void setMajorList(List<SubmitMajor> majorList) {  
39 - this.majorList = majorList;  
40 - }  
41 } 72 }
src/main/java/com/sincere/student/model/Article.java
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty; 4 import io.swagger.annotations.ApiModelProperty;
5 5
6 import java.util.Date; 6 import java.util.Date;
  7 +import java.util.List;
7 8
8 @ApiModel 9 @ApiModel
9 public class Article { 10 public class Article {
@@ -24,6 +25,10 @@ public class Article { @@ -24,6 +25,10 @@ public class Article {
24 private String author ; 25 private String author ;
25 @ApiModelProperty(value = "封面图片") 26 @ApiModelProperty(value = "封面图片")
26 private String imageUrl ; 27 private String imageUrl ;
  28 + @ApiModelProperty(value = "封面图片 展示用")
  29 + private List<String> imageUrlList ;
  30 + @ApiModelProperty(value = "封面图片数量 展示用")
  31 + private int imageCount ;
27 @ApiModelProperty(value = "视频链接") 32 @ApiModelProperty(value = "视频链接")
28 private String videoUrl ; 33 private String videoUrl ;
29 @ApiModelProperty(value = "外链") 34 @ApiModelProperty(value = "外链")
@@ -39,6 +44,22 @@ public class Article { @@ -39,6 +44,22 @@ public class Article {
39 @ApiModelProperty(value = "状态 0预览1发布") 44 @ApiModelProperty(value = "状态 0预览1发布")
40 private int status ; 45 private int status ;
41 46
  47 + public List<String> getImageUrlList() {
  48 + return imageUrlList;
  49 + }
  50 +
  51 + public void setImageUrlList(List<String> imageUrlList) {
  52 + this.imageUrlList = imageUrlList;
  53 + }
  54 +
  55 + public int getImageCount() {
  56 + return imageCount;
  57 + }
  58 +
  59 + public void setImageCount(int imageCount) {
  60 + this.imageCount = imageCount;
  61 + }
  62 +
42 public int getStatus() { 63 public int getStatus() {
43 return status; 64 return status;
44 } 65 }
src/main/java/com/sincere/student/service/impl/ArticleServiceImpl.java
@@ -10,6 +10,8 @@ import org.apache.commons.lang3.StringUtils; @@ -10,6 +10,8 @@ import org.apache.commons.lang3.StringUtils;
10 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
12 12
  13 +import java.util.ArrayList;
  14 +import java.util.Arrays;
13 import java.util.List; 15 import java.util.List;
14 16
15 @Service 17 @Service
@@ -21,11 +23,16 @@ public class ArticleServiceImpl implements ArticleService { @@ -21,11 +23,16 @@ public class ArticleServiceImpl implements ArticleService {
21 @Override 23 @Override
22 public Page<Article> getList(ArticleSearchDto articleSearchDto) { 24 public Page<Article> getList(ArticleSearchDto articleSearchDto) {
23 Page<Article> result = new Page<>(articleSearchDto.getPage(),articleSearchDto.getPageSize()); 25 Page<Article> result = new Page<>(articleSearchDto.getPage(),articleSearchDto.getPageSize());
24 - PageHelper.startPage(articleSearchDto.getPage(),articleSearchDto.getPageSize());  
25 if(StringUtils.isNotBlank(articleSearchDto.getTitle())){ 26 if(StringUtils.isNotBlank(articleSearchDto.getTitle())){
26 articleSearchDto.setTitle("%"+articleSearchDto.getTitle()+"%"); 27 articleSearchDto.setTitle("%"+articleSearchDto.getTitle()+"%");
27 } 28 }
  29 + PageHelper.startPage(articleSearchDto.getPage(),articleSearchDto.getPageSize());
28 List<Article> list = articleMapper.getList(articleSearchDto) ; 30 List<Article> list = articleMapper.getList(articleSearchDto) ;
  31 + for(Article article : list){
  32 + String[] urlList = article.getImageUrl().split(",");
  33 + article.setImageUrlList(Arrays.asList(urlList));
  34 + article.setImageCount(urlList.length);
  35 + }
29 result.setList(list); 36 result.setList(list);
30 result.setCount(articleMapper.getListCount(articleSearchDto)); 37 result.setCount(articleMapper.getListCount(articleSearchDto));
31 return result; 38 return result;
@@ -38,7 +45,11 @@ public class ArticleServiceImpl implements ArticleService { @@ -38,7 +45,11 @@ public class ArticleServiceImpl implements ArticleService {
38 45
39 @Override 46 @Override
40 public Article selectById(int id) { 47 public Article selectById(int id) {
41 - return articleMapper.selectById(id); 48 + Article article = articleMapper.selectById(id);
  49 + String[] urlList = article.getImageUrl().split(",");
  50 + article.setImageUrlList(Arrays.asList(urlList));
  51 + article.setImageCount(urlList.length);
  52 + return article ;
42 } 53 }
43 54
44 @Override 55 @Override
src/main/resources/logback.xml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <configuration debug="true"> 2 <configuration debug="true">
3     <!-- 项目名称 --> 3     <!-- 项目名称 -->
4     4    
5 - <property name="PROJECT_NAME" value="quartz"/> 5 + <property name="PROJECT_NAME" value="enrolled_student"/>
6 6
7     <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> 7     <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
8 <property name="LOG_HOME" value="C://log"/> 8 <property name="LOG_HOME" value="C://log"/>
src/main/resources/mapper/UniversityConsultMapper.xml
@@ -18,12 +18,15 @@ @@ -18,12 +18,15 @@
18 join university_relate_major r on info.id = r.university_id 18 join university_relate_major r on info.id = r.university_id
19 join university_major m on m.id = r.major_id 19 join university_major m on m.id = r.major_id
20 <where> 20 <where>
21 - <if test="columnType != 0"> 21 + <if test="columnType > 0">
22 and c.column_type = #{columnType} 22 and c.column_type = #{columnType}
23 </if> 23 </if>
24 <if test="columnType == 0"> 24 <if test="columnType == 0">
25 and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort) 25 and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort)
26 </if> 26 </if>
  27 + <if test="columnType == -1">
  28 + and 1=1
  29 + </if>
27 <if test="province != null and province != '' "> 30 <if test="province != null and province != '' ">
28 and info.province = #{province} 31 and info.province = #{province}
29 </if> 32 </if>
@@ -51,12 +54,15 @@ @@ -51,12 +54,15 @@
51 join university_relate_major r on info.id = r.university_id 54 join university_relate_major r on info.id = r.university_id
52 join university_major m on m.id = r.major_id 55 join university_major m on m.id = r.major_id
53 <where> 56 <where>
54 - <if test="columnType != 0"> 57 + <if test="columnType > 0">
55 and c.column_type = #{columnType} 58 and c.column_type = #{columnType}
56 </if> 59 </if>
57 <if test="columnType == 0"> 60 <if test="columnType == 0">
58 and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort) 61 and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort)
59 </if> 62 </if>
  63 + <if test="columnType == -1">
  64 + and 1=1
  65 + </if>
60 <if test="province != null and province != '' "> 66 <if test="province != null and province != '' ">
61 and info.province = #{province} 67 and info.province = #{province}
62 </if> 68 </if>
@@ -117,10 +123,10 @@ @@ -117,10 +123,10 @@
117 <insert id="insert" parameterType="com.sincere.student.model.UniversityConsult" useGeneratedKeys="true" keyProperty="id"> 123 <insert id="insert" parameterType="com.sincere.student.model.UniversityConsult" useGeneratedKeys="true" keyProperty="id">
118 insert into university_consult (university_id, column_type, 124 insert into university_consult (university_id, column_type,
119 video_url, context, img_url, 125 video_url, context, img_url,
120 - create_time, sort) 126 + create_time, sort,status)
121 values (#{universityId,jdbcType=INTEGER}, #{columnType,jdbcType=INTEGER}, 127 values (#{universityId,jdbcType=INTEGER}, #{columnType,jdbcType=INTEGER},
122 #{videoUrl,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, 128 #{videoUrl,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},
123 - GETDATE(), #{sort,jdbcType=INTEGER}) 129 + GETDATE(), #{sort,jdbcType=INTEGER},#{status})
124 </insert> 130 </insert>
125 131
126 <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsult"> 132 <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsult">
src/main/resources/mapper/UniversitySubmitFileMapper.xml
@@ -8,12 +8,10 @@ @@ -8,12 +8,10 @@
8 <collection property="universityList" ofType="com.sincere.student.dto.submit.SubmitUniv"> 8 <collection property="universityList" ofType="com.sincere.student.dto.submit.SubmitUniv">
9 <result column="universityId" property="universityId" /> 9 <result column="universityId" property="universityId" />
10 <result column="name" property="universityName" /> 10 <result column="name" property="universityName" />
11 - <collection property="majorList" ofType="com.sincere.student.dto.submit.SubmitMajor">  
12 - <result column="major" property="major" />  
13 - <result column="grade" property="grade" />  
14 - <result column="enroll_number" property="enrollNumber" />  
15 - <result column="rank" property="rank" />  
16 - </collection> 11 + <result column="major" property="major" />
  12 + <result column="grade" property="grade" />
  13 + <result column="enroll_number" property="enrollNumber" />
  14 + <result column="rank" property="rank" />
17 </collection> 15 </collection>
18 </resultMap> 16 </resultMap>
19 17