Browse Source

Merge remote-tracking branch 'origin/master'

weifanli 3 years ago
parent
commit
6a37f265fa

+ 13 - 1
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -21,7 +21,7 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@NotBlank(message = "平台类型不能为空")
 	private String platformType;
 
-	@ApiModelProperty(value = "子类型  IMAGE:图片,VIDEO:视频", required = false)
+	@ApiModelProperty(value = "子类型  章节id", required = false)
 	private String subType;
 
 	@ApiModelProperty(value = "资讯状态(0:禁用,1:启用)", required = false)
@@ -42,8 +42,20 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@ApiModelProperty("版本号")
 	private String version;
 
+	@ApiModelProperty("广告类型  IMAGE:图片,VIDEO:视频")
+	private String attribute2;
+
 	private Date date;
 
+
+	public String getAttribute2() {
+		return attribute2;
+	}
+
+	public void setAttribute2(String attribute2) {
+		this.attribute2 = attribute2;
+	}
+
 	public Integer getType() {
 		return type;
 	}

+ 3 - 0
cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -77,6 +77,9 @@
 			<if test="version != null and version != ''">
 				and sni.attribute1_ = #{version}
 			</if>
+			<if test="attribute2 != null and attribute2 != ''">
+				and sni.attribute2_ = #{attribute2}
+			</if>
 		</where>
 	</sql>
 	

+ 9 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseRepliedServiceImpl.java

@@ -98,8 +98,16 @@ public class CourseRepliedServiceImpl extends ServiceImpl<CourseScheduleRepliedD
         }
         repliedDao.insert(replied);
 
+        try {
+            repliedSend(userId);
+        } catch (Exception e) {
+            log.error("视频课消息推送失败");
+        }
+    }
+
+    public void repliedSend(Long studentId){
         //消息推送
-        SysUser student = sysUserFeignService.queryUserById(userId);
+        SysUser student = sysUserFeignService.queryUserById(studentId);
         Map<Long, String> studentReceivers = new HashMap<>();
         studentReceivers.put(studentId, student.getPhone());
         String url = sysMessageService.selectConfigUrl(MessageTypeEnum.STUDENT_EVALUATE_TEACHER_PRACTICE.getCode());

+ 6 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -462,10 +462,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             //获取当前日期周几
             int weekNum = firstDay.getDayOfWeek().getValue();
             JSONArray jsonArray = teacherPracticeTime.get(weekNum);
-            List<CourseTimeEntity> timeEntities = jsonArray.stream()
-                    .map(t -> getCourseTimeEntity(entity, (JSONObject) t))
-                    .collect(Collectors.toList());
-            entity.setCourseTime(timeEntities);
+            if (Objects.nonNull(jsonArray)){
+                List<CourseTimeEntity> timeEntities = jsonArray.stream()
+                        .map(t -> getCourseTimeEntity(entity, (JSONObject) t))
+                        .collect(Collectors.toList());
+                entity.setCourseTime(timeEntities);
+            }
             list.add(entity);
             firstDay = firstDay.plusDays(1L);
         }

+ 8 - 9
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/LiveRoomServiceImpl.java

@@ -576,16 +576,15 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
         //result
         Map<String, Object> result = new HashMap<>();
         //{"day":"01","month":"05","year":"2022","singleCourseMinutes":60,"teacherId":4}
-//        Map<String, Object> param = new HashMap<>();
-//        param.put("day", "01");
-//        param.put("month", "04");
-//        param.put("year", "2022");
-//        param.put("singleCourseMinutes", 60);
-//        param.put("teacherId", "4");
-//        param.put("studentId", 143);
-//        List<CourseCalendarEntity> courseTimeEntities = courseScheduleService.createPracticeCourseCalender(param);
+        Map<String, Object> param = new HashMap<>();
+        param.put("day", "05");
+        param.put("month", "05");
+        param.put("year", "2022");
+        param.put("teacherId", "174");
+        param.put("studentId", 164);
+        List<CourseCalendarEntity> courseTimeEntities = courseScheduleService.createPracticeCourseCalender(param);
 //        List<CourseCalendarEntity> courseTimeEntities = courseScheduleService.createLiveCourseCalendar(param);
-//        result.put("自动生成课时", courseTimeEntities);
+        result.put("自动生成课时", courseTimeEntities);
 
         //获取房间信息
         RBucket<RoomInfoCache> speakerCache = redissonClient.getBucket(LIVE_ROOM_INFO.replace(ROOM_UID, roomUid));

+ 11 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VideoLessonPurchaseRecordServiceImpl.java

@@ -166,6 +166,14 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
         userAccountService.accountChange(userAccountRecord);
         log.info("buyVideoCourseSuccess ok");
 
+        try {
+            videoSend(teacherId, studentId, lessonGroup.getLessonName());
+        } catch (Exception e) {
+            log.error("视频课消息推送失败");
+        }
+    }
+
+    public void videoSend(Long teacherId, Long studentId, String lessonName) {
         //查询老师&学生信息
         SysUser teacher = sysUserFeignService.queryUserById(teacherId);
         SysUser student = sysUserFeignService.queryUserById(studentId);
@@ -173,19 +181,19 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
         //消息接收者(Key:用户编号 value:消息接收对象)
         Map<Long, String> teacherReceivers = new HashMap<>();
         teacherReceivers.put(teacherId, teacher.getPhone());
-        Map<Long,String> studentReceivers = new HashMap<>();
+        Map<Long, String> studentReceivers = new HashMap<>();
         studentReceivers.put(studentId, student.getPhone());
 
         //消息推送-老师端
         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_BUY_VIDEO,
                 teacherReceivers, null, 0, null, ClientEnum.TEACHER.getCode(),
-                student.getUsername(), lessonGroup.getLessonName());
+                student.getUsername(), lessonName);
 
         //消息推送-学生端
         String url = sysMessageService.selectConfigUrl(MessageTypeEnum.VIDEO_BUY.getCode());
         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.VIDEO_BUY,
                 studentReceivers, null, 0, null, ClientEnum.STUDENT.getCode(),
-                teacher.getUsername(), lessonGroup.getLessonName(),url);
+                teacher.getUsername(), lessonName, url);
     }
 
     /**