Ver Fonte

fix 科目

he2802 há 3 anos atrás
pai
commit
4ed0791a5d

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseSectionMapper.java

@@ -24,4 +24,6 @@ public interface CourseSectionMapper extends BaseMapper<CourseSection> {
     List<CourseSectionVo> livingSectionList(@Param("nowTime") Long nowTime);
     List<CourseSectionVo> livingSectionList(@Param("nowTime") Long nowTime);
 
 
     Long checkUserHaveLiveGoods(@Param("userId") Long userId,@Param("goodsId") Long goodsId);
     Long checkUserHaveLiveGoods(@Param("userId") Long userId,@Param("goodsId") Long goodsId);
+
+    Long checkCrossLiveTime(@Param("startTime") Long startTime,@Param("endTime") Long endTime,@Param("sectionId") Long sectionId,@Param("liveUrl") String liveUrl);
 }
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -205,6 +205,18 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
                 throw new CustomException("该节已被绑定,不允许修改发布状态为未发布");
                 throw new CustomException("该节已被绑定,不允许修改发布状态为未发布");
             }
             }
         }
         }
+        //直播
+        if(entity.getSectionType()==2){
+            if(Validator.isNotEmpty(entity.getSectionId())){
+                if(this.baseMapper.checkCrossLiveTime(entity.getLiveStartTime(),entity.getLiveEndTime(),entity.getSectionId(),entity.getLiveUrl())>0){
+                    throw new CustomException("存在开播时间同房间号的直播节");
+                }
+            }else{
+                if(this.baseMapper.checkCrossLiveTime(entity.getLiveStartTime(),entity.getLiveEndTime(),null,entity.getLiveUrl())>0){
+                    throw new CustomException("存在开播时间同房间号的直播节");
+                }
+            }
+        }
     }
     }
 
 
     @Override
     @Override

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java

@@ -296,4 +296,6 @@ public class GoodsVo {
 	@Excel(name = "证书模板ID")
 	@Excel(name = "证书模板ID")
 	@ApiModelProperty("证书模板ID")
 	@ApiModelProperty("证书模板ID")
 	private Long certificateTpId;
 	private Long certificateTpId;
+	@ApiModelProperty("科目名称拼接")
+	private String subjectNames;
 }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeVo.java

@@ -180,4 +180,6 @@ public class ClassGradeVo {
 	/** 学时已推送人数 */
 	/** 学时已推送人数 */
 	@ApiModelProperty("学时已推送人数")
 	@ApiModelProperty("学时已推送人数")
 	private Integer periodPlushNum;
 	private Integer periodPlushNum;
+	@ApiModelProperty("科目名称拼接")
+	private String subjectNames;
 }
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvLiveServiceImpl.java

@@ -221,7 +221,7 @@ public class PolyvLiveServiceImpl implements IPolyvLiveService {
             liveChannelBasicInfoResponse = new LiveChannelOperateServiceImpl().getChannelBasicInfo(
             liveChannelBasicInfoResponse = new LiveChannelOperateServiceImpl().getChannelBasicInfo(
                     liveChannelBasicInfoRequest);
                     liveChannelBasicInfoRequest);
             if (liveChannelBasicInfoResponse != null) {
             if (liveChannelBasicInfoResponse != null) {
-               System.out.println(liveChannelBasicInfoResponse);
+               return liveChannelBasicInfoResponse;
             }
             }
         } catch (PloyvSdkException e) {
         } catch (PloyvSdkException e) {
 
 

+ 10 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -237,4 +237,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and og.pay_status in (2,3,4)
         and og.pay_status in (2,3,4)
         limit 1
         limit 1
     </select>
     </select>
+
+    <select id="checkCrossLiveTime" parameterType="map" resultType="long">
+        SELECT count(*) from course_section cs where  #{startTime} >= cs.live_start_time or cs.live_end_time >= #{startTime}
+                                                  or cs.live_end_time >= #{endTime} or #{endTime} >= cs.live_start_time or (cs.live_start_time >= #{startTime} and
+                                                                                                                            #{endTime} >= cs.live_end_time)
+        <if test="sectionId != null and sectionId != ''">
+            AND cs.section_id != #{sectionId}
+        </if>
+        AND cs.live_url = #{liveUrl}
+    </select>
 </mapper>
 </mapper>

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -122,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="certificateTypeId" column="certificate_type_id"/>
         <result property="certificateTypeId" column="certificate_type_id"/>
         <result property="certificateId" column="certificate_id"/>
         <result property="certificateId" column="certificate_id"/>
         <result property="certificateTpId" column="certificate_tp_id"/>
         <result property="certificateTpId" column="certificate_tp_id"/>
+        <result property="subjectNames" column="subject_names"/>
     </resultMap>
     </resultMap>
 
 
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
@@ -148,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cb.business_name,
         cb.business_name,
         s.school_name,
         s.school_name,
         m.category_name,
         m.category_name,
+        (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names,
         ot.type AS template_type,
         ot.type AS template_type,
         (SELECT gs.goods_name FROM goods gs where 1=1 and g.make_goods_id = gs.goods_id) as make_goods_name,
         (SELECT gs.goods_name FROM goods gs where 1=1 and g.make_goods_id = gs.goods_id) as make_goods_name,
         (SELECT gs.code FROM goods gs where 1=1 and g.make_goods_id = gs.goods_id) as make_goods_code
         (SELECT gs.code FROM goods gs where 1=1 and g.make_goods_id = gs.goods_id) as make_goods_code

+ 4 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -53,6 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="officialStatusNum" column="official_status_num"/>
         <result property="officialStatusNum" column="official_status_num"/>
         <result property="periodStatusNum" column="period_status_num"/>
         <result property="periodStatusNum" column="period_status_num"/>
         <result property="periodPlushNum" column="period_plush_num"/>
         <result property="periodPlushNum" column="period_plush_num"/>
+        <result property="periodPlushNum" column="period_plush_num"/>
+        <result property="subjectNames" column="subject_names"/>
     </resultMap>
     </resultMap>
 
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserListVo" id="ClassGradeUserListVo">
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserListVo" id="ClassGradeUserListVo">
@@ -201,7 +203,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) as student_num,
             (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) as student_num,
             (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1 and official_status =1) as official_status_num,
             (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1 and official_status =1) as official_status_num,
             (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1 and period_status =1) as period_status_num,
             (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1 and period_status =1) as period_status_num,
-            (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1 and period_plush =1) as period_plush_num
+            (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1 and period_plush =1) as period_plush_num,
+            (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,d.subject_ids)) subject_names
         FROM
         FROM
             class_grade g
             class_grade g
         LEFT JOIN class_grade_goods cgg ON cgg.grade_id = g.grade_id
         LEFT JOIN class_grade_goods cgg ON cgg.grade_id = g.grade_id