Commit 3c7f8a2cfdc8d009b3537b18240e0c48868fa43a

Authored by 陈杰
1 parent be5d580a
Exists in master

bug 修复

src/main/java/com/sincere/student/controller/AdminController.java
... ... @@ -461,9 +461,11 @@ public class AdminController {
461 461 temp.setSort(1);
462 462 temp.setType(AdvertEnums.screen.getType());
463 463 temp.setImgUrl(dto.getUrl());
  464 + temp.setUrlLink(dto.getUrlLink());
464 465 advertService.create(temp);
465 466 }else {
466 467 advert.setImgUrl(dto.getUrl());
  468 + advert.setUrlLink(dto.getUrlLink());
467 469 advertService.update(advert);
468 470 }
469 471 return new BaseDto() ;
... ...
src/main/java/com/sincere/student/controller/AppController.java
... ... @@ -106,6 +106,37 @@ public class AppController {
106 106 return result ;
107 107 }
108 108  
  109 + @ApiOperation("首页 搜索 按钮 咨询列表")
  110 + @RequestMapping(value = "/consult/getConsultListSearch" , method = RequestMethod.POST)
  111 + public BaseDto<List<AppConsult>> getConsultListSearch(@RequestBody ConsultSearchDto consultSearchDto){
  112 + consultSearchDto.setStatus(1);
  113 + consultSearchDto.setPage(1);
  114 + consultSearchDto.setPageSize(3);
  115 + BaseDto<List<AppConsult>> result = new BaseDto<>();
  116 + List<AppConsult> data = new ArrayList<>();
  117 + ColumnDto columnDto = new ColumnDto();
  118 + columnDto.setType(ColumnEnums.university.getType());
  119 + List<ColumnType> columnTypes = columnService.getList(columnDto);
  120 + if(columnTypes != null && columnTypes.size() > 0){
  121 + for(ColumnType columnType : columnTypes){
  122 + consultSearchDto.setColumnType(columnType.getId());
  123 + Page<Consult> page = consultService.getList(consultSearchDto);
  124 + AppConsult appConsult = new AppConsult();
  125 + appConsult.setColumnTypeId(columnType.getId());
  126 + appConsult.setName(columnType.getName());
  127 + appConsult.setList(page.getList());
  128 + if(appConsult.getList() != null && appConsult.getList().size() > 0){
  129 + data.add(appConsult);
  130 + }
  131 + }
  132 + result.setData(data);
  133 + }else {
  134 + result.setSuccess(false);
  135 + result.setMessage("后台暂未分配招生咨询会栏目");
  136 + }
  137 + return result ;
  138 + }
  139 +
109 140 @ApiOperation("获取首页学校 咨询列表 more")
110 141 @RequestMapping(value = "/consult/getConsultPage" , method = RequestMethod.POST)
111 142 public BaseDto<Page<Consult>> getConsultTypeList(@RequestBody ConsultPageDto consultPageDto){
... ... @@ -172,7 +203,24 @@ public class AppController {
172 203 @RequestMapping(value = "/article/getDetail/{id}" , method = RequestMethod.POST)
173 204 public BaseDto<Article> getDetail(@PathVariable("id") int id){
174 205 BaseDto<Article> result = new BaseDto<>() ;
175   - result.setData(articleService.selectById(id));
  206 + Article article = articleService.selectById(id) ;
  207 + result.setData(article);
  208 + Article temp = new Article();
  209 + temp.setId(id);
  210 + temp.setLookNumber(article.getLookNumber()+1);
  211 + articleService.update(temp);
  212 + return result ;
  213 + }
  214 +
  215 + @ApiOperation(" 点赞 权威解读(文章广告)相关接口")
  216 + @RequestMapping(value = "/article/good/{id}" , method = RequestMethod.POST)
  217 + public BaseDto good(@PathVariable("id") int id){
  218 + BaseDto result = new BaseDto<>() ;
  219 + Article article = articleService.selectById(id) ;
  220 + Article temp = new Article();
  221 + temp.setId(id);
  222 + temp.setGoodNumber(article.getGoodNumber()+1);
  223 + articleService.update(temp);
176 224 return result ;
177 225 }
178 226  
... ...
src/main/java/com/sincere/student/controller/CommonController.java
... ... @@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
8 8 import org.springframework.web.bind.annotation.RequestMethod;
9 9 import org.springframework.web.bind.annotation.RestController;
10 10  
  11 +import java.util.ArrayList;
11 12 import java.util.Arrays;
12 13 import java.util.List;
13 14  
... ... @@ -18,11 +19,32 @@ public class CommonController {
18 19 @Autowired
19 20 CommonService commonService ;
20 21  
  22 + private static List<Area> list = new ArrayList<>();
21 23  
22 24 @ApiOperation("省份")
23 25 @RequestMapping(value = "getProvince",method = RequestMethod.GET)
24 26 public List<Area> getProvince(){
25   - return commonService.getProvince();
  27 + if(list.size() == 0){
  28 + List<Area> areas = commonService.getProvince();
  29 + for(Area area : areas){
  30 + List<Area> cityList = commonService.getCity(area.getCode());
  31 + if(area.getName().contains("市")){
  32 + //获取全部
  33 + area.setList(cityList);
  34 + }else {
  35 + //获取4位的市
  36 + List<Area> trueCityList = new ArrayList<>();
  37 + for(Area city : cityList){
  38 + if(city.getCode().length() < 6){
  39 + trueCityList.add(city);
  40 + }
  41 + }
  42 + area.setList(trueCityList);
  43 + }
  44 + }
  45 + list = areas ;
  46 + }
  47 + return list ;
26 48 }
27 49  
28 50 @ApiOperation("市")
... ...
src/main/java/com/sincere/student/controller/IndexController.java
... ... @@ -1,28 +0,0 @@
1   -package com.sincere.student.controller;
2   -
3   -import org.springframework.stereotype.Controller;
4   -import org.springframework.web.bind.annotation.RequestMapping;
5   -import org.springframework.web.bind.annotation.RequestMethod;
6   -import org.springframework.web.bind.annotation.RequestParam;
7   -import org.springframework.web.bind.annotation.ResponseBody;
8   -import org.springframework.web.multipart.MultipartFile;
9   -
10   -import java.io.File;
11   -import java.io.FileOutputStream;
12   -import java.io.InputStream;
13   -import java.io.OutputStream;
14   -
15   -@Controller
16   -public class IndexController {
17   -
18   - @RequestMapping("index")
19   - public String index(){
20   - return "index" ;
21   - }
22   -
23   - @ResponseBody
24   - @RequestMapping(value = "upload" ,method = RequestMethod.POST)
25   - public String upload(@RequestParam("file") MultipartFile file) throws Exception{
26   - return file.getOriginalFilename() ;
27   - }
28   -}
src/main/java/com/sincere/student/dto/LinkUsDto.java
... ... @@ -3,6 +3,15 @@ package com.sincere.student.dto;
3 3 public class LinkUsDto {
4 4  
5 5 private String url ;
  6 + private String urlLink ;
  7 +
  8 + public String getUrlLink() {
  9 + return urlLink;
  10 + }
  11 +
  12 + public void setUrlLink(String urlLink) {
  13 + this.urlLink = urlLink;
  14 + }
6 15  
7 16 public String getUrl() {
8 17 return url;
... ...
src/main/java/com/sincere/student/model/Advert.java
... ... @@ -12,11 +12,11 @@ public class Advert {
12 12 private int id ;
13 13 @ApiModelProperty(value = "广告类型 1:开屏 2:banner 所有接口不用传")
14 14 private int type ;
15   - @ApiModelProperty(value = "图片地址")
  15 + @ApiModelProperty(value = "必传 图片地址")
16 16 private String imgUrl ;
17 17 @ApiModelProperty(value = "外链")
18 18 private String urlLink ;
19   - @ApiModelProperty(value = "排序")
  19 + @ApiModelProperty(value = "必传 排序")
20 20 private int sort ;
21 21 @ApiModelProperty(value = "状态 预留字段 所有接口不用传")
22 22 private int status ;
... ...
src/main/java/com/sincere/student/model/Area.java
1 1 package com.sincere.student.model;
2 2  
  3 +import java.util.List;
  4 +
3 5 public class Area {
4 6  
5 7 private String code ;
6 8 private String name ;
7 9  
  10 + private List<Area> list ;
  11 +
  12 + public List<Area> getList() {
  13 + return list;
  14 + }
  15 +
  16 + public void setList(List<Area> list) {
  17 + this.list = list;
  18 + }
  19 +
8 20 public String getCode() {
9 21 return code;
10 22 }
... ...
src/main/java/com/sincere/student/model/Article.java
... ... @@ -10,17 +10,17 @@ public class Article {
10 10  
11 11 @ApiModelProperty(value = "主键 , 新增接口不用传")
12 12 private int id ;
13   - @ApiModelProperty(value = "标题")
  13 + @ApiModelProperty(value = "必传 标题")
14 14 private String title ;
15 15 @ApiModelProperty(value = "栏目 type=1 不用传")
16 16 private int columnType ;
17   - @ApiModelProperty(value = "大学id")
  17 + @ApiModelProperty(value = "必传 大学id")
18 18 private int universityId ;
19   - @ApiModelProperty(value = "排序")
  19 + @ApiModelProperty(value = "必传 排序")
20 20 private int sort ;
21 21 @ApiModelProperty(value = "内容")
22 22 private String context ;
23   - @ApiModelProperty(value = "作者")
  23 + @ApiModelProperty(value = "必传 作者")
24 24 private String author ;
25 25 @ApiModelProperty(value = "封面图片")
26 26 private String imageUrl ;
... ...
src/main/java/com/sincere/student/model/Major.java
... ... @@ -8,9 +8,9 @@ public class Major {
8 8  
9 9 @ApiModelProperty(value = "主键 , 新增接口不用传")
10 10 private int id ;
11   - @ApiModelProperty(value = "专业名")
  11 + @ApiModelProperty(value = "必传 专业名")
12 12 private String major ;
13   - @ApiModelProperty(value = "专业编码")
  13 + @ApiModelProperty(value = "必传 专业编码")
14 14 private String majorCode ;
15 15 @ApiModelProperty(value = "父级专业id") //-1 说明是一级专业
16 16 private int pId ;
... ...
src/main/java/com/sincere/student/model/Message.java
... ... @@ -10,9 +10,9 @@ import java.util.List;
10 10 public class Message {
11 11 @ApiModelProperty(value = "主键 , 新增接口不用传")
12 12 private Integer id;
13   - @ApiModelProperty(value = "标题")
  13 + @ApiModelProperty(value = "必传 标题")
14 14 private String title;
15   - @ApiModelProperty(value = "内容")
  15 + @ApiModelProperty(value = "必传 内容")
16 16 private String context;
17 17 @ApiModelProperty(value = "联系方式")
18 18 private String phone;
... ...
src/main/java/com/sincere/student/model/Reply.java
... ... @@ -11,7 +11,7 @@ public class Reply {
11 11 private Integer id;
12 12 @ApiModelProperty(value = "留言主键")
13 13 private Integer messageId;
14   - @ApiModelProperty(value = "内容")
  14 + @ApiModelProperty(value = "必传 内容")
15 15 private String context;
16 16 @ApiModelProperty(value = "不用传")
17 17 private Date createTime;
... ...
src/main/java/com/sincere/student/model/SubmitFile.java
... ... @@ -10,13 +10,13 @@ import java.util.List;
10 10 public class SubmitFile {
11 11 @ApiModelProperty(value = "主键 , 新增接口不用传")
12 12 private Integer id;
13   - @ApiModelProperty(value = "标题")
  13 + @ApiModelProperty(value = "必传 标题")
14 14 private String title;
15   - @ApiModelProperty(value = "年")
  15 + @ApiModelProperty(value = "必传 年")
16 16 private String year;
17   - @ApiModelProperty(value = "排序")
  17 + @ApiModelProperty(value = "必传 排序")
18 18 private Integer sort;
19   - @ApiModelProperty(value = "文件路径")
  19 + @ApiModelProperty(value = "必传 文件路径")
20 20 private String fileUrl ;
21 21 @ApiModelProperty(value = "不用传")
22 22 private Date createTime;
... ...
src/main/java/com/sincere/student/model/University.java
... ... @@ -11,19 +11,19 @@ public class University {
11 11  
12 12 @ApiModelProperty(value = "主键 , 新增接口不用传")
13 13 private int id ;
14   - @ApiModelProperty(value = "学校名称")
  14 + @ApiModelProperty(value = "必传 学校名称")
15 15 private String name ;
16   - @ApiModelProperty(value = "学校编码")
  16 + @ApiModelProperty(value = "必传 学校编码")
17 17 private String code ;
18   - @ApiModelProperty(value = "高校学科类型")
  18 + @ApiModelProperty(value = "必传 高校学科类型")
19 19 private String universityType ;
20   - @ApiModelProperty(value = "主管部门")
  20 + @ApiModelProperty(value = "必传 主管部门")
21 21 private String department;
22   - @ApiModelProperty(value = "所在省")
  22 + @ApiModelProperty(value = "必传 所在省")
23 23 private String province ;
24   - @ApiModelProperty(value = "所在市")
  24 + @ApiModelProperty(value = "必传 所在市")
25 25 private String city ;
26   - @ApiModelProperty(value = "办学层次")
  26 + @ApiModelProperty(value = "必传 办学层次")
27 27 private String level ;
28 28 @ApiModelProperty(value = "联系方式")
29 29 private String phone ;
... ...
src/main/resources/mapper/ArticleMapper.xml
... ... @@ -24,7 +24,7 @@
24 24 <select id="getListCount" parameterType="com.sincere.student.dto.ArticleSearchDto" resultType="java.lang.Integer">
25 25 select count(0) from university_article
26 26 <where>
27   - <if test="title != null">
  27 + <if test="title != null and title != ''">
28 28 and title like #{title}
29 29 </if>
30 30 <if test="columnType != 0">
... ... @@ -45,7 +45,7 @@
45 45 <select id="getList" parameterType="com.sincere.student.dto.ArticleSearchDto" resultMap="ArticleMap">
46 46 select * from university_article
47 47 <where>
48   - <if test="title != null">
  48 + <if test="title != null and title != ''">
49 49 and title like #{title}
50 50 </if>
51 51 <if test="columnType != 0">
... ... @@ -90,9 +90,6 @@
90 90 <if test="columnType!=0">
91 91 column_type=#{columnType},
92 92 </if>
93   - <if test="universityName!=null">
94   - university_name=#{universityName},
95   - </if>
96 93 <if test="universityId!=0">
97 94 university_id=#{universityId},
98 95 </if>
... ...
src/main/resources/mapper/MajorMapper.xml
... ... @@ -15,7 +15,7 @@
15 15 <if test="pId != 0">
16 16 and p_id = #{pId}
17 17 </if>
18   - <if test="major != null">
  18 + <if test="major != null and major != ''">
19 19 and major like #{major}
20 20 </if>
21 21 </where>
... ... @@ -27,7 +27,7 @@
27 27 <if test="pId >= 0">
28 28 and p_id = #{pId}
29 29 </if>
30   - <if test="major != null">
  30 + <if test="major != null and major != ''">
31 31 and major like #{major}
32 32 </if>
33 33 <if test="majorCode != null">
... ...
src/main/resources/mapper/UniversityConsultMapper.xml
... ... @@ -24,16 +24,16 @@
24 24 <if test="columnType == 0">
25 25 and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort)
26 26 </if>
27   - <if test="province != null">
  27 + <if test="province != null and province != '' ">
28 28 and info.province = #{province}
29 29 </if>
30   - <if test="city != null">
  30 + <if test="city != null and city != '' ">
31 31 and info.city = #{city}
32 32 </if>
33   - <if test="universityName != null">
  33 + <if test="universityName != null and universityName != ''">
34 34 and info.name like #{universityName}
35 35 </if>
36   - <if test="majorName != null">
  36 + <if test="majorName != null and majorName != ''">
37 37 and m.major like #{majorName}
38 38 </if>
39 39 <if test="status == 1">
... ... @@ -57,16 +57,16 @@
57 57 <if test="columnType == 0">
58 58 and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort)
59 59 </if>
60   - <if test="province != null">
  60 + <if test="province != null and province != '' ">
61 61 and info.province = #{province}
62 62 </if>
63   - <if test="city != null">
  63 + <if test="city != null and city != '' ">
64 64 and info.city = #{city}
65 65 </if>
66   - <if test="universityName != null">
  66 + <if test="universityName != null and universityName != ''">
67 67 and info.name like #{universityName}
68 68 </if>
69   - <if test="majorName != null">
  69 + <if test="majorName != null and majorName != ''">
70 70 and m.major like #{majorName}
71 71 </if>
72 72 <if test="status == 1">
... ...
src/main/resources/mapper/UniversityMapper.xml
... ... @@ -18,7 +18,7 @@
18 18 <select id="getListCount" parameterType="com.sincere.student.dto.UniversitySearchDto" resultType="java.lang.Integer">
19 19 select count(0) from university_info
20 20 <where>
21   - <if test="search != null">
  21 + <if test="search != null and search != ''">
22 22 and name like #{search}
23 23 </if>
24 24 </where>
... ... @@ -27,7 +27,7 @@
27 27 <select id="getList" parameterType="com.sincere.student.dto.UniversitySearchDto" resultMap="UniversityMap">
28 28 select * from university_info
29 29 <where>
30   - <if test="search != null">
  30 + <if test="search != null and search != ''">
31 31 and name like #{search}
32 32 </if>
33 33 </where>
... ...
src/main/resources/mapper/UniversityMessageMapper.xml
... ... @@ -12,7 +12,7 @@
12 12 <select id="getListCount" parameterType="com.sincere.student.dto.MessageSearchDto" resultType="java.lang.Integer">
13 13 select * from university_message
14 14 <where>
15   - <if test="search != null">
  15 + <if test="search != null and search != ''">
16 16 and title like #{search}
17 17 </if>
18 18 </where>
... ... @@ -21,7 +21,7 @@
21 21 <select id="getList" parameterType="com.sincere.student.dto.MessageSearchDto" resultMap="BaseResultMap">
22 22 select * from university_message
23 23 <where>
24   - <if test="search != null">
  24 + <if test="search != null and search != ''">
25 25 and title like #{search}
26 26 </if>
27 27 </where>
... ...
src/main/resources/mapper/UniversitySubmitFileMapper.xml
... ... @@ -26,16 +26,16 @@
26 26 <if test="submitId != 0">
27 27 and sf.id = #{submitId}
28 28 </if>
29   - <if test="universityName != null">
  29 + <if test="universityName != null and universityName != '' ">
30 30 and info.name like #{universityName}
31 31 </if>
32   - <if test="province != null">
  32 + <if test="province != null and province != '' ">
33 33 and info.province = #{province}
34 34 </if>
35   - <if test="city != null">
  35 + <if test="city != null and city != '' ">
36 36 and info.city = #{city}
37 37 </if>
38   - <if test="majorName != null">
  38 + <if test="majorName != null and majorName != '' ">
39 39 and m.major like #{majorName}
40 40 </if>
41 41 <if test="point != 0 ">
... ... @@ -56,16 +56,16 @@
56 56 <if test="submitId != 0">
57 57 and sf.id = #{submitId}
58 58 </if>
59   - <if test="universityName != null">
  59 + <if test="universityName != null and universityName != '' ">
60 60 and info.name like #{universityName}
61 61 </if>
62   - <if test="province != null">
  62 + <if test="province != null and province != '' ">
63 63 and info.province = #{province}
64 64 </if>
65   - <if test="city != null">
  65 + <if test="city != null and city != '' ">
66 66 and info.city = #{city}
67 67 </if>
68   - <if test="majorName != null">
  68 + <if test="majorName != null and majorName != '' ">
69 69 and m.major like #{majorName}
70 70 </if>
71 71 <if test="point != 0 ">
... ... @@ -89,7 +89,7 @@
89 89 <select id="getListCount" parameterType="com.sincere.student.dto.MessageSearchDto" resultType="java.lang.Integer">
90 90 select count(0) from university_submit_file
91 91 <where>
92   - <if test="search != null">
  92 + <if test="search != null and search != '' ">
93 93 title like #{search}
94 94 </if>
95 95 </where>
... ... @@ -98,7 +98,7 @@
98 98 <select id="getList" parameterType="com.sincere.student.dto.MessageSearchDto" resultMap="BaseResultMap">
99 99 select * from university_submit_file
100 100 <where>
101   - <if test="search != null">
  101 + <if test="search != null and search != '' ">
102 102 title like #{search}
103 103 </if>
104 104 </where>
... ...
src/main/resources/mapper/VideoMapper.xml
... ... @@ -27,7 +27,7 @@
27 27 <if test="universityName == 0">
28 28 and 1 = 1
29 29 </if>
30   - <if test="universityName != null">
  30 + <if test="universityName != null and universityName != ''">
31 31 and info.name like #{universityName}
32 32 </if>
33 33 <if test="status == 1">
... ... @@ -45,7 +45,7 @@
45 45 <if test="columnTypeId != 0">
46 46 and v.column_type = #{columnTypeId}
47 47 </if>
48   - <if test="universityName != null">
  48 + <if test="universityName != null and universityName != ''">
49 49 and info.name like #{universityName}
50 50 </if>
51 51 <if test="status == 1">
... ...