Commit 1ad1148e2cbc296ad7615c8b502f6c2bf1a67892
1 parent
4a51395c
Exists in
master
bug 修复
Showing
7 changed files
with
65 additions
and
27 deletions
Show diff stats
src/main/java/com/sincere/student/controller/AdminController.java
@@ -14,9 +14,10 @@ import com.sincere.student.utils.TokenUtils; | @@ -14,9 +14,10 @@ import com.sincere.student.utils.TokenUtils; | ||
14 | import io.swagger.annotations.ApiOperation; | 14 | import io.swagger.annotations.ApiOperation; |
15 | import org.apache.commons.lang3.StringUtils; | 15 | import org.apache.commons.lang3.StringUtils; |
16 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
17 | -import org.springframework.cache.annotation.CacheEvict; | ||
18 | -import org.springframework.cache.annotation.Cacheable; | ||
19 | -import org.springframework.web.bind.annotation.*; | 17 | +import org.springframework.web.bind.annotation.RequestBody; |
18 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
19 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
20 | +import org.springframework.web.bind.annotation.RestController; | ||
20 | 21 | ||
21 | import java.util.ArrayList; | 22 | import java.util.ArrayList; |
22 | import java.util.List; | 23 | import java.util.List; |
@@ -523,8 +524,12 @@ public class AdminController { | @@ -523,8 +524,12 @@ public class AdminController { | ||
523 | temp.setUrlLink(dto.getUrlLink()); | 524 | temp.setUrlLink(dto.getUrlLink()); |
524 | advertService.create(temp); | 525 | advertService.create(temp); |
525 | }else { | 526 | }else { |
526 | - advert.setImgUrl(dto.getUrl()); | ||
527 | - advert.setUrlLink(dto.getUrlLink()); | 527 | + if(StringUtils.isNotBlank(dto.getUrl())){ |
528 | + advert.setImgUrl(dto.getUrl()); | ||
529 | + } | ||
530 | + if(StringUtils.isNotBlank(dto.getUrlLink())){ | ||
531 | + advert.setUrlLink(dto.getUrlLink()); | ||
532 | + } | ||
528 | advertService.update(advert); | 533 | advertService.update(advert); |
529 | } | 534 | } |
530 | return new BaseDto() ; | 535 | return new BaseDto() ; |
src/main/java/com/sincere/student/controller/AppController.java
@@ -9,10 +9,12 @@ import com.sincere.student.enums.ParameterUtils; | @@ -9,10 +9,12 @@ import com.sincere.student.enums.ParameterUtils; | ||
9 | import com.sincere.student.model.*; | 9 | import com.sincere.student.model.*; |
10 | import com.sincere.student.service.*; | 10 | import com.sincere.student.service.*; |
11 | import com.sincere.student.utils.Page; | 11 | import com.sincere.student.utils.Page; |
12 | -import io.swagger.annotations.Api; | ||
13 | import io.swagger.annotations.ApiOperation; | 12 | import io.swagger.annotations.ApiOperation; |
14 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
15 | -import org.springframework.web.bind.annotation.*; | 14 | +import org.springframework.web.bind.annotation.RequestBody; |
15 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
16 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
17 | +import org.springframework.web.bind.annotation.RestController; | ||
16 | 18 | ||
17 | import java.util.ArrayList; | 19 | import java.util.ArrayList; |
18 | import java.util.List; | 20 | import java.util.List; |
@@ -214,6 +216,7 @@ public class AppController { | @@ -214,6 +216,7 @@ public class AppController { | ||
214 | return result ; | 216 | return result ; |
215 | } | 217 | } |
216 | 218 | ||
219 | + | ||
217 | @ApiOperation(" 点赞 权威解读(文章广告)相关接口") | 220 | @ApiOperation(" 点赞 权威解读(文章广告)相关接口") |
218 | @RequestMapping(value = "/article/good" , method = RequestMethod.POST) | 221 | @RequestMapping(value = "/article/good" , method = RequestMethod.POST) |
219 | public BaseDto good(@RequestBody IdDto idDto){ | 222 | public BaseDto good(@RequestBody IdDto idDto){ |
@@ -257,14 +260,6 @@ public class AppController { | @@ -257,14 +260,6 @@ public class AppController { | ||
257 | return result ; | 260 | return result ; |
258 | } | 261 | } |
259 | 262 | ||
260 | -// @ApiOperation("留言板详情,管理回复 接口") | ||
261 | -// @RequestMapping(value = "/message/getDetail" , method = RequestMethod.POST) | ||
262 | -// public BaseDto<Message> getMessageDetail(@RequestBody IdDto idDto){ | ||
263 | -// BaseDto<Message> result = new BaseDto<>(); | ||
264 | -// result.setData(messageService.getDetail(idDto.getId())); | ||
265 | -// return result ; | ||
266 | -// } | ||
267 | - | ||
268 | @ApiOperation("留言") | 263 | @ApiOperation("留言") |
269 | @RequestMapping(value = "/message/create" , method = RequestMethod.POST) | 264 | @RequestMapping(value = "/message/create" , method = RequestMethod.POST) |
270 | public BaseDto insertMessage(@RequestBody Message message){ | 265 | public BaseDto insertMessage(@RequestBody Message message){ |
@@ -272,6 +267,14 @@ public class AppController { | @@ -272,6 +267,14 @@ public class AppController { | ||
272 | return new BaseDto(); | 267 | return new BaseDto(); |
273 | } | 268 | } |
274 | 269 | ||
270 | + @ApiOperation("留言详情") | ||
271 | + @RequestMapping(value = "/message/detail" , method = RequestMethod.POST) | ||
272 | + public BaseDto<Message> insertMessage(@RequestBody IdDto idDto){ | ||
273 | + BaseDto<Message> result = new BaseDto<>(); | ||
274 | + result.setData(messageService.getDetail(idDto.getId())); | ||
275 | + return result; | ||
276 | + } | ||
277 | + | ||
275 | 278 | ||
276 | @ApiOperation("获取视频相关接口") | 279 | @ApiOperation("获取视频相关接口") |
277 | @RequestMapping(value = "/video/getList" , method = RequestMethod.POST) | 280 | @RequestMapping(value = "/video/getList" , method = RequestMethod.POST) |
@@ -306,12 +309,12 @@ public class AppController { | @@ -306,12 +309,12 @@ public class AppController { | ||
306 | 309 | ||
307 | @ApiOperation("投档线首页列表接口") | 310 | @ApiOperation("投档线首页列表接口") |
308 | @RequestMapping(value = "/submit/getSubmitList" , method = RequestMethod.POST) | 311 | @RequestMapping(value = "/submit/getSubmitList" , method = RequestMethod.POST) |
309 | - public BaseDto<Page<SubmitLine>> getSubmitList(@RequestBody PageDto pageDto){ | ||
310 | - BaseDto<Page<SubmitLine>> result = new BaseDto<>(); | ||
311 | - PointSearchDto pointSearchDto = new PointSearchDto(); | 312 | + public BaseDto<Page<SubmitFile>> getSubmitList(@RequestBody PageDto pageDto){ |
313 | + BaseDto<Page<SubmitFile>> result = new BaseDto<>(); | ||
314 | + MessageSearchDto pointSearchDto = new MessageSearchDto(); | ||
312 | pointSearchDto.setPage(pageDto.getPage()); | 315 | pointSearchDto.setPage(pageDto.getPage()); |
313 | pointSearchDto.setPageSize(pageDto.getPageSize()); | 316 | pointSearchDto.setPageSize(pageDto.getPageSize()); |
314 | - result.setData(submitService.getAppList(pointSearchDto)); | 317 | + result.setData(submitService.getAdminList(pointSearchDto)); |
315 | return result ; | 318 | return result ; |
316 | } | 319 | } |
317 | 320 | ||
@@ -321,7 +324,7 @@ public class AppController { | @@ -321,7 +324,7 @@ public class AppController { | ||
321 | BaseDto<SubmitLine> result = new BaseDto<>(); | 324 | BaseDto<SubmitLine> result = new BaseDto<>(); |
322 | PointSearchDto pointSearchDto = new PointSearchDto(); | 325 | PointSearchDto pointSearchDto = new PointSearchDto(); |
323 | pointSearchDto.setPage(1); | 326 | pointSearchDto.setPage(1); |
324 | - pointSearchDto.setPageSize(1); | 327 | + pointSearchDto.setPageSize(9999); |
325 | pointSearchDto.setSubmitId(idDto.getId()); | 328 | pointSearchDto.setSubmitId(idDto.getId()); |
326 | result.setData(submitService.getAppList(pointSearchDto).getList().get(0)); | 329 | result.setData(submitService.getAppList(pointSearchDto).getList().get(0)); |
327 | return result ; | 330 | return result ; |
src/main/java/com/sincere/student/model/Consult.java
@@ -23,6 +23,8 @@ public class Consult { | @@ -23,6 +23,8 @@ public class Consult { | ||
23 | private String code ; | 23 | private String code ; |
24 | @ApiModelProperty(value = "栏目分类") | 24 | @ApiModelProperty(value = "栏目分类") |
25 | private Integer columnType; | 25 | private Integer columnType; |
26 | + @ApiModelProperty(value = "栏目分类名称") | ||
27 | + private String columnTypeName; | ||
26 | @ApiModelProperty(value = "视频地址") | 28 | @ApiModelProperty(value = "视频地址") |
27 | private String videoUrl; | 29 | private String videoUrl; |
28 | @ApiModelProperty(value = "内容") | 30 | @ApiModelProperty(value = "内容") |
@@ -34,6 +36,14 @@ public class Consult { | @@ -34,6 +36,14 @@ public class Consult { | ||
34 | @ApiModelProperty(value = "4个栏目") | 36 | @ApiModelProperty(value = "4个栏目") |
35 | private List<UniversityConsultDetail> list ; | 37 | private List<UniversityConsultDetail> list ; |
36 | 38 | ||
39 | + public String getColumnTypeName() { | ||
40 | + return columnTypeName; | ||
41 | + } | ||
42 | + | ||
43 | + public void setColumnTypeName(String columnTypeName) { | ||
44 | + this.columnTypeName = columnTypeName; | ||
45 | + } | ||
46 | + | ||
37 | public Integer getStatus() { | 47 | public Integer getStatus() { |
38 | return status; | 48 | return status; |
39 | } | 49 | } |
src/main/java/com/sincere/student/service/impl/ConsultServiceImpl.java
1 | package com.sincere.student.service.impl; | 1 | package com.sincere.student.service.impl; |
2 | 2 | ||
3 | import com.github.pagehelper.PageHelper; | 3 | import com.github.pagehelper.PageHelper; |
4 | +import com.sincere.student.dto.ColumnDto; | ||
4 | import com.sincere.student.dto.ConsultSearchDto; | 5 | import com.sincere.student.dto.ConsultSearchDto; |
6 | +import com.sincere.student.enums.ColumnEnums; | ||
7 | +import com.sincere.student.mapper.ColumnMapper; | ||
5 | import com.sincere.student.mapper.UniversityConsultDetailMapper; | 8 | import com.sincere.student.mapper.UniversityConsultDetailMapper; |
6 | import com.sincere.student.mapper.UniversityConsultMapper; | 9 | import com.sincere.student.mapper.UniversityConsultMapper; |
10 | +import com.sincere.student.model.ColumnType; | ||
7 | import com.sincere.student.model.Consult; | 11 | import com.sincere.student.model.Consult; |
8 | import com.sincere.student.model.UniversityConsult; | 12 | import com.sincere.student.model.UniversityConsult; |
9 | import com.sincere.student.model.UniversityConsultDetail; | 13 | import com.sincere.student.model.UniversityConsultDetail; |
@@ -13,6 +17,8 @@ import org.apache.commons.lang3.StringUtils; | @@ -13,6 +17,8 @@ import org.apache.commons.lang3.StringUtils; | ||
13 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
14 | import org.springframework.stereotype.Service; | 18 | import org.springframework.stereotype.Service; |
15 | 19 | ||
20 | +import java.util.List; | ||
21 | + | ||
16 | @Service | 22 | @Service |
17 | public class ConsultServiceImpl implements ConsultService { | 23 | public class ConsultServiceImpl implements ConsultService { |
18 | 24 | ||
@@ -22,6 +28,8 @@ public class ConsultServiceImpl implements ConsultService { | @@ -22,6 +28,8 @@ public class ConsultServiceImpl implements ConsultService { | ||
22 | @Autowired | 28 | @Autowired |
23 | UniversityConsultDetailMapper universityConsultDetailMapper ; | 29 | UniversityConsultDetailMapper universityConsultDetailMapper ; |
24 | 30 | ||
31 | + @Autowired | ||
32 | + ColumnMapper columnMapper ; | ||
25 | 33 | ||
26 | @Override | 34 | @Override |
27 | public Page<Consult> getList(ConsultSearchDto consultSearchDto) { | 35 | public Page<Consult> getList(ConsultSearchDto consultSearchDto) { |
@@ -33,7 +41,18 @@ public class ConsultServiceImpl implements ConsultService { | @@ -33,7 +41,18 @@ public class ConsultServiceImpl implements ConsultService { | ||
33 | consultSearchDto.setMajorName("%"+consultSearchDto.getMajorName()+"%"); | 41 | consultSearchDto.setMajorName("%"+consultSearchDto.getMajorName()+"%"); |
34 | } | 42 | } |
35 | PageHelper.startPage(consultSearchDto.getPage(),consultSearchDto.getPageSize()); | 43 | PageHelper.startPage(consultSearchDto.getPage(),consultSearchDto.getPageSize()); |
36 | - page.setList(universityConsultMapper.getList(consultSearchDto)); | 44 | + List<Consult> list =universityConsultMapper.getList(consultSearchDto) ; |
45 | + ColumnDto columnDto = new ColumnDto(); | ||
46 | + columnDto.setType(ColumnEnums.university.getType()); | ||
47 | + List<ColumnType> columnTypes = columnMapper.getList(columnDto); | ||
48 | + for(Consult consult : list){ | ||
49 | + for(ColumnType columnType :columnTypes){ | ||
50 | + if(consult.getColumnType() == columnType.getId()){ | ||
51 | + consult.setColumnTypeName(columnType.getName()); | ||
52 | + } | ||
53 | + } | ||
54 | + } | ||
55 | + page.setList(list); | ||
37 | page.setCount(universityConsultMapper.getListCount(consultSearchDto)); | 56 | page.setCount(universityConsultMapper.getListCount(consultSearchDto)); |
38 | return page; | 57 | return page; |
39 | } | 58 | } |
src/main/java/com/sincere/student/service/impl/MessageServiceImpl.java
@@ -35,6 +35,7 @@ public class MessageServiceImpl implements MessageService { | @@ -35,6 +35,7 @@ public class MessageServiceImpl implements MessageService { | ||
35 | List<Message> list = messageMapper.getList(messageSearchDto) ; | 35 | List<Message> list = messageMapper.getList(messageSearchDto) ; |
36 | for(Message message : list){ | 36 | for(Message message : list){ |
37 | message.setDistanceTimes(DateUtils.getDistanceTimes(new Date(),message.getCreateTime())); | 37 | message.setDistanceTimes(DateUtils.getDistanceTimes(new Date(),message.getCreateTime())); |
38 | + message.setList(replyMapper.selectByMessageId(message.getId())); | ||
38 | } | 39 | } |
39 | page.setList(list); | 40 | page.setList(list); |
40 | page.setCount(messageMapper.getListCount(messageSearchDto)); | 41 | page.setCount(messageMapper.getListCount(messageSearchDto)); |
src/main/resources/mapper/MajorMapper.xml
@@ -72,7 +72,6 @@ | @@ -72,7 +72,6 @@ | ||
72 | select f.id as f_id , f.major as f_major , s.id as s_id , s.major as s_major from | 72 | select f.id as f_id , f.major as f_major , s.id as s_id , s.major as s_major from |
73 | university_major s | 73 | university_major s |
74 | join university_major f on f.id = s.p_id | 74 | join university_major f on f.id = s.p_id |
75 | - join university_relate_major r on s.id = r.major_id | ||
76 | 75 | ||
77 | </select> | 76 | </select> |
78 | </mapper> | 77 | </mapper> |
src/main/resources/mapper/UniversityConsultMapper.xml
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | 4 | ||
5 | <resultMap id="ListMap" type="com.sincere.student.model.Consult"> | 5 | <resultMap id="ListMap" type="com.sincere.student.model.Consult"> |
6 | <result column="id" property="id" /> | 6 | <result column="id" property="id" /> |
7 | + <result column="column_type" property="columnType" /> | ||
7 | <result column="universityId" property="universityId" /> | 8 | <result column="universityId" property="universityId" /> |
8 | <result column="name" property="name" /> | 9 | <result column="name" property="name" /> |
9 | <result column="code" property="code" /> | 10 | <result column="code" property="code" /> |
@@ -15,8 +16,8 @@ | @@ -15,8 +16,8 @@ | ||
15 | <select id="getListCount" parameterType="com.sincere.student.dto.ConsultSearchDto" resultType="java.lang.Integer"> | 16 | <select id="getListCount" parameterType="com.sincere.student.dto.ConsultSearchDto" resultType="java.lang.Integer"> |
16 | select count(DISTINCT c.id) from university_consult c | 17 | select count(DISTINCT c.id) from university_consult c |
17 | join university_info info on c.university_id = info.id | 18 | join university_info info on c.university_id = info.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 | + left join university_relate_major r on info.id = r.university_id |
20 | + left join university_major m on m.id = r.major_id | ||
20 | <where> | 21 | <where> |
21 | <if test="columnType > 0"> | 22 | <if test="columnType > 0"> |
22 | and c.column_type = #{columnType} | 23 | and c.column_type = #{columnType} |
@@ -49,10 +50,10 @@ | @@ -49,10 +50,10 @@ | ||
49 | </select> | 50 | </select> |
50 | 51 | ||
51 | <select id="getList" parameterType="com.sincere.student.dto.ConsultSearchDto" resultMap="ListMap"> | 52 | <select id="getList" parameterType="com.sincere.student.dto.ConsultSearchDto" resultMap="ListMap"> |
52 | - select DISTINCT c.id , info.id as universityId , c.img_url ,c.sort , info.name , info.code ,c.status from university_consult c | 53 | + select DISTINCT c.id , c.column_type , info.id as universityId , c.img_url ,c.sort , info.name , info.code ,c.status from university_consult c |
53 | join university_info info on c.university_id = info.id | 54 | join university_info info on c.university_id = info.id |
54 | - join university_relate_major r on info.id = r.university_id | ||
55 | - join university_major m on m.id = r.major_id | 55 | + left join university_relate_major r on info.id = r.university_id |
56 | + left join university_major m on m.id = r.major_id | ||
56 | <where> | 57 | <where> |
57 | <if test="columnType > 0"> | 58 | <if test="columnType > 0"> |
58 | and c.column_type = #{columnType} | 59 | and c.column_type = #{columnType} |