Commit f4c56093f42f37e6fd59e5bb846fe01e8b4875f2
1 parent
0bb4ee5c03
Exists in
dev
开发回复接口和小程序视频未返回bug
Showing 9 changed files with 64 additions and 15 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ReviewDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/ReviewDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CourseEvalService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/CourseTypeModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/ReviewModel.java
- platform-dal/src/main/java/com/lyms/platform/query/CourseTypeQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/ReviewQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CourseController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ReviewDao.java
View file @
f4c5609
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/ReviewDaoImpl.java
View file @
f4c5609
... | ... | @@ -24,5 +24,10 @@ |
24 | 24 | public List<ReviewModel> reviewQuery1List(MongoQuery created) { |
25 | 25 | return find(created.convertToMongoQuery()); |
26 | 26 | } |
27 | + | |
28 | + @Override | |
29 | + public List<ReviewModel> reviewList(MongoQuery created) { | |
30 | + return find(created.convertToMongoQuery()); | |
31 | + } | |
27 | 32 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CourseEvalService.java
View file @
f4c5609
... | ... | @@ -99,7 +99,7 @@ |
99 | 99 | reviewQuery.mysqlBuild(msgDao.queryMsgListCount(reviewQuery.convertToQuery())); |
100 | 100 | query.start(reviewQuery.getOffset()).end(reviewQuery.getLimit()); |
101 | 101 | } |
102 | - return reviewDao.queryMsgList(query.addOrder(Sort.Direction.DESC, "created")); | |
102 | + return reviewDao.reviewList(query.addOrder(Sort.Direction.DESC, "created")); | |
103 | 103 | } |
104 | 104 | |
105 | 105 | public void reviewAdd(ReviewModel reviewModel) { |
platform-dal/src/main/java/com/lyms/platform/pojo/CourseTypeModel.java
View file @
f4c5609
... | ... | @@ -42,6 +42,16 @@ |
42 | 42 | //平均分数 |
43 | 43 | private Integer avg; |
44 | 44 | |
45 | + private String courseVideo; | |
46 | + | |
47 | + public String getCourseVideo() { | |
48 | + return courseVideo; | |
49 | + } | |
50 | + | |
51 | + public void setCourseVideo(String courseVideo) { | |
52 | + this.courseVideo = courseVideo; | |
53 | + } | |
54 | + | |
45 | 55 | public Integer getScore() { |
46 | 56 | return score; |
47 | 57 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/ReviewModel.java
View file @
f4c5609
platform-dal/src/main/java/com/lyms/platform/query/CourseTypeQuery.java
View file @
f4c5609
... | ... | @@ -34,6 +34,16 @@ |
34 | 34 | |
35 | 35 | private Integer yn; |
36 | 36 | |
37 | + private String courseVideo; | |
38 | + | |
39 | + public String getCourseVideo() { | |
40 | + return courseVideo; | |
41 | + } | |
42 | + | |
43 | + public void setCourseVideo(String courseVideo) { | |
44 | + this.courseVideo = courseVideo; | |
45 | + } | |
46 | + | |
37 | 47 | @Override |
38 | 48 | public MongoQuery convertToQuery() { |
39 | 49 | MongoCondition condition = MongoCondition.newInstance(); |
... | ... | @@ -64,7 +74,9 @@ |
64 | 74 | if (null != yn) { |
65 | 75 | condition = condition.and("yn", yn, MongoOper.IS); |
66 | 76 | } |
67 | - | |
77 | + if (null != courseVideo) { | |
78 | + condition = condition.and("courseVideo", courseVideo, MongoOper.IS); | |
79 | + } | |
68 | 80 | return condition.toMongoQuery(); |
69 | 81 | } |
70 | 82 |
platform-dal/src/main/java/com/lyms/platform/query/ReviewQuery.java
View file @
f4c5609
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CourseController.java
View file @
f4c5609
... | ... | @@ -431,9 +431,8 @@ |
431 | 431 | @TokenRequired |
432 | 432 | public BaseResponse reviewUserList( |
433 | 433 | @RequestParam(required = false) String couresId, |
434 | - @RequestParam(required = false) String id, | |
435 | 434 | HttpServletRequest request) { |
436 | - return courseFacade.reviewUserList(couresId,id,getUserId(request)); | |
435 | + return courseFacade.reviewUserList(couresId,getUserId(request)); | |
437 | 436 | } |
438 | 437 | |
439 | 438 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java
View file @
f4c5609
... | ... | @@ -1297,6 +1297,7 @@ |
1297 | 1297 | reviewQuery.setPage(page); |
1298 | 1298 | reviewQuery.setLimit(limit); |
1299 | 1299 | reviewQuery.setCouresId(couresId); |
1300 | + reviewQuery.setState(1); | |
1300 | 1301 | BaseListResponse objectResponse = new BaseListResponse(); |
1301 | 1302 | List<ReviewModel> models = courseEvalService.reviewList(reviewQuery); |
1302 | 1303 | |
... | ... | @@ -1314,6 +1315,7 @@ |
1314 | 1315 | String format = df.format(day); |
1315 | 1316 | reviewModel.setCreateDate(format); |
1316 | 1317 | reviewModel.setYn(YnEnums.YES.getId()); |
1318 | + reviewModel.setState(0); | |
1317 | 1319 | |
1318 | 1320 | courseEvalService.reviewAdd(reviewModel); |
1319 | 1321 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
... | ... | @@ -1328,6 +1330,7 @@ |
1328 | 1330 | String format = df.format(day); |
1329 | 1331 | reviewModel.setCreateDate(format); |
1330 | 1332 | reviewModel.setYn(YnEnums.YES.getId()); |
1333 | + reviewModel.setState(1); | |
1331 | 1334 | //操作人为当前用户id |
1332 | 1335 | reviewModel.setParentId(reviewModel.getParentId()); |
1333 | 1336 | |
1334 | 1337 | |
1335 | 1338 | |
1336 | 1339 | |
1337 | 1340 | |
... | ... | @@ -1338,34 +1341,33 @@ |
1338 | 1341 | return objectResponse; |
1339 | 1342 | } |
1340 | 1343 | |
1341 | - public BaseResponse reviewUserList(String couresId, String id, Integer userId) { | |
1344 | + public BaseResponse reviewUserList(String couresId,Integer userId) { | |
1342 | 1345 | ReviewQuery reviewQuery = new ReviewQuery(); |
1343 | 1346 | reviewQuery.setYn(YnEnums.YES.getId()); |
1344 | 1347 | reviewQuery.setNeed("true"); |
1345 | 1348 | reviewQuery.setCouresId(couresId); |
1346 | 1349 | reviewQuery.setReviewId(userId.toString()); |
1347 | 1350 | BaseListResponse objectResponse = new BaseListResponse(); |
1351 | + | |
1348 | 1352 | List<ReviewModel> models = courseEvalService.reviewList(reviewQuery); |
1349 | 1353 | |
1350 | 1354 | ReviewQuery reviewQuery1 = new ReviewQuery(); |
1351 | 1355 | List<ReviewModel> models1 = courseEvalService.reviewQuery1List(reviewQuery1); |
1352 | 1356 | |
1353 | - | |
1354 | - List<ReviewModel> matchingModels = new ArrayList<>(); // 创建用于存放匹配数据的新集合 | |
1355 | - | |
1357 | + ArrayList<ReviewModel> reviewModels = new ArrayList<>(); | |
1356 | 1358 | for (ReviewModel model : models) { |
1357 | - String ids = model.getId(); // 获取models中的ID | |
1358 | - for (ReviewModel model1 : models1) { | |
1359 | - if (model1.getParentId() == ids) { // 在models1中查找匹配的parentId | |
1360 | - matchingModels.add(model); // 将对应的models数据添加到匹配集合中 | |
1361 | - matchingModels.add(model1); // 将对应的models1数据添加到匹配集合中 | |
1362 | - break; // 找到匹配数据后跳出内层循环 | |
1359 | + String id = model.getId(); | |
1360 | + reviewModels.add(model); | |
1361 | + for (ReviewModel reviewModel : models1) { | |
1362 | + if (id.equals(reviewModel.getParentId())){ | |
1363 | + reviewModels.add(reviewModel); | |
1363 | 1364 | } |
1364 | 1365 | } |
1365 | 1366 | } |
1366 | 1367 | |
1367 | 1368 | |
1368 | - objectResponse.setData(matchingModels); | |
1369 | + // 将第一条数据也添加到列表中 | |
1370 | + objectResponse.setData(reviewModels); | |
1369 | 1371 | objectResponse.setPageInfo(reviewQuery.getPageInfo()); |
1370 | 1372 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
1371 | 1373 | objectResponse.setErrormsg("成功"); |