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 | 14 | import io.swagger.annotations.ApiOperation; |
15 | 15 | import org.apache.commons.lang3.StringUtils; |
16 | 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 | 22 | import java.util.ArrayList; |
22 | 23 | import java.util.List; |
... | ... | @@ -523,8 +524,12 @@ public class AdminController { |
523 | 524 | temp.setUrlLink(dto.getUrlLink()); |
524 | 525 | advertService.create(temp); |
525 | 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 | 533 | advertService.update(advert); |
529 | 534 | } |
530 | 535 | return new BaseDto() ; | ... | ... |
src/main/java/com/sincere/student/controller/AppController.java
... | ... | @@ -9,10 +9,12 @@ import com.sincere.student.enums.ParameterUtils; |
9 | 9 | import com.sincere.student.model.*; |
10 | 10 | import com.sincere.student.service.*; |
11 | 11 | import com.sincere.student.utils.Page; |
12 | -import io.swagger.annotations.Api; | |
13 | 12 | import io.swagger.annotations.ApiOperation; |
14 | 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 | 19 | import java.util.ArrayList; |
18 | 20 | import java.util.List; |
... | ... | @@ -214,6 +216,7 @@ public class AppController { |
214 | 216 | return result ; |
215 | 217 | } |
216 | 218 | |
219 | + | |
217 | 220 | @ApiOperation(" 点赞 权威解读(文章广告)相关接口") |
218 | 221 | @RequestMapping(value = "/article/good" , method = RequestMethod.POST) |
219 | 222 | public BaseDto good(@RequestBody IdDto idDto){ |
... | ... | @@ -257,14 +260,6 @@ public class AppController { |
257 | 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 | 263 | @ApiOperation("留言") |
269 | 264 | @RequestMapping(value = "/message/create" , method = RequestMethod.POST) |
270 | 265 | public BaseDto insertMessage(@RequestBody Message message){ |
... | ... | @@ -272,6 +267,14 @@ public class AppController { |
272 | 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 | 279 | @ApiOperation("获取视频相关接口") |
277 | 280 | @RequestMapping(value = "/video/getList" , method = RequestMethod.POST) |
... | ... | @@ -306,12 +309,12 @@ public class AppController { |
306 | 309 | |
307 | 310 | @ApiOperation("投档线首页列表接口") |
308 | 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 | 315 | pointSearchDto.setPage(pageDto.getPage()); |
313 | 316 | pointSearchDto.setPageSize(pageDto.getPageSize()); |
314 | - result.setData(submitService.getAppList(pointSearchDto)); | |
317 | + result.setData(submitService.getAdminList(pointSearchDto)); | |
315 | 318 | return result ; |
316 | 319 | } |
317 | 320 | |
... | ... | @@ -321,7 +324,7 @@ public class AppController { |
321 | 324 | BaseDto<SubmitLine> result = new BaseDto<>(); |
322 | 325 | PointSearchDto pointSearchDto = new PointSearchDto(); |
323 | 326 | pointSearchDto.setPage(1); |
324 | - pointSearchDto.setPageSize(1); | |
327 | + pointSearchDto.setPageSize(9999); | |
325 | 328 | pointSearchDto.setSubmitId(idDto.getId()); |
326 | 329 | result.setData(submitService.getAppList(pointSearchDto).getList().get(0)); |
327 | 330 | return result ; | ... | ... |
src/main/java/com/sincere/student/model/Consult.java
... | ... | @@ -23,6 +23,8 @@ public class Consult { |
23 | 23 | private String code ; |
24 | 24 | @ApiModelProperty(value = "栏目分类") |
25 | 25 | private Integer columnType; |
26 | + @ApiModelProperty(value = "栏目分类名称") | |
27 | + private String columnTypeName; | |
26 | 28 | @ApiModelProperty(value = "视频地址") |
27 | 29 | private String videoUrl; |
28 | 30 | @ApiModelProperty(value = "内容") |
... | ... | @@ -34,6 +36,14 @@ public class Consult { |
34 | 36 | @ApiModelProperty(value = "4个栏目") |
35 | 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 | 47 | public Integer getStatus() { |
38 | 48 | return status; |
39 | 49 | } | ... | ... |
src/main/java/com/sincere/student/service/impl/ConsultServiceImpl.java
1 | 1 | package com.sincere.student.service.impl; |
2 | 2 | |
3 | 3 | import com.github.pagehelper.PageHelper; |
4 | +import com.sincere.student.dto.ColumnDto; | |
4 | 5 | import com.sincere.student.dto.ConsultSearchDto; |
6 | +import com.sincere.student.enums.ColumnEnums; | |
7 | +import com.sincere.student.mapper.ColumnMapper; | |
5 | 8 | import com.sincere.student.mapper.UniversityConsultDetailMapper; |
6 | 9 | import com.sincere.student.mapper.UniversityConsultMapper; |
10 | +import com.sincere.student.model.ColumnType; | |
7 | 11 | import com.sincere.student.model.Consult; |
8 | 12 | import com.sincere.student.model.UniversityConsult; |
9 | 13 | import com.sincere.student.model.UniversityConsultDetail; |
... | ... | @@ -13,6 +17,8 @@ import org.apache.commons.lang3.StringUtils; |
13 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
14 | 18 | import org.springframework.stereotype.Service; |
15 | 19 | |
20 | +import java.util.List; | |
21 | + | |
16 | 22 | @Service |
17 | 23 | public class ConsultServiceImpl implements ConsultService { |
18 | 24 | |
... | ... | @@ -22,6 +28,8 @@ public class ConsultServiceImpl implements ConsultService { |
22 | 28 | @Autowired |
23 | 29 | UniversityConsultDetailMapper universityConsultDetailMapper ; |
24 | 30 | |
31 | + @Autowired | |
32 | + ColumnMapper columnMapper ; | |
25 | 33 | |
26 | 34 | @Override |
27 | 35 | public Page<Consult> getList(ConsultSearchDto consultSearchDto) { |
... | ... | @@ -33,7 +41,18 @@ public class ConsultServiceImpl implements ConsultService { |
33 | 41 | consultSearchDto.setMajorName("%"+consultSearchDto.getMajorName()+"%"); |
34 | 42 | } |
35 | 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 | 56 | page.setCount(universityConsultMapper.getListCount(consultSearchDto)); |
38 | 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 | 35 | List<Message> list = messageMapper.getList(messageSearchDto) ; |
36 | 36 | for(Message message : list){ |
37 | 37 | message.setDistanceTimes(DateUtils.getDistanceTimes(new Date(),message.getCreateTime())); |
38 | + message.setList(replyMapper.selectByMessageId(message.getId())); | |
38 | 39 | } |
39 | 40 | page.setList(list); |
40 | 41 | page.setCount(messageMapper.getListCount(messageSearchDto)); | ... | ... |
src/main/resources/mapper/MajorMapper.xml
src/main/resources/mapper/UniversityConsultMapper.xml
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | |
5 | 5 | <resultMap id="ListMap" type="com.sincere.student.model.Consult"> |
6 | 6 | <result column="id" property="id" /> |
7 | + <result column="column_type" property="columnType" /> | |
7 | 8 | <result column="universityId" property="universityId" /> |
8 | 9 | <result column="name" property="name" /> |
9 | 10 | <result column="code" property="code" /> |
... | ... | @@ -15,8 +16,8 @@ |
15 | 16 | <select id="getListCount" parameterType="com.sincere.student.dto.ConsultSearchDto" resultType="java.lang.Integer"> |
16 | 17 | select count(DISTINCT c.id) from university_consult c |
17 | 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 | 21 | <where> |
21 | 22 | <if test="columnType > 0"> |
22 | 23 | and c.column_type = #{columnType} |
... | ... | @@ -49,10 +50,10 @@ |
49 | 50 | </select> |
50 | 51 | |
51 | 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 | 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 | 57 | <where> |
57 | 58 | <if test="columnType > 0"> |
58 | 59 | and c.column_type = #{columnType} | ... | ... |