소스 검색

学时审核

change 3 년 전
부모
커밋
0ef388e8fb

+ 14 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java

@@ -88,9 +88,9 @@ public class ClassGradeController extends BaseController {
     }
 
     /**
-     * 查询学时学员记录列表
+     * 查询学员学时信息列表
      */
-    @ApiOperation("查询学员信息列表")
+    @ApiOperation("查询学员学时信息列表")
     @PreAuthorize("@ss.hasPermi('grade:user:list')")
     @GetMapping("/listPeriod")
     public TableDataInfo<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo) {
@@ -99,6 +99,18 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 学时审核
+     */
+    @ApiOperation("学时审核")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/listPeriodAudit")
+    public TableDataInfo<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodVo> list = iClassGradeUserService.listPeriodAudit(bo);
+        return getDataTable(list);
+    }
+
     /**
      * 查询学员记录列表
      */

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java

@@ -40,6 +40,10 @@ public class ClassGradeUserQueryBo extends BaseEntity {
 	/** 学员ID */
 	@ApiModelProperty("学员ID")
 	private Long userId;
+
+	/** 商品id */
+	@ApiModelProperty("商品id")
+	private Long goodsId;
 	/** 班级id */
 	@ApiModelProperty("班级id")
 	private Long gradeId;

+ 8 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -3,10 +3,8 @@ package com.zhongzheng.modules.grade.mapper;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
-import com.zhongzheng.modules.grade.vo.ClassGradeUserVo;
-import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
-import com.zhongzheng.modules.grade.vo.ClassPeriodUserVo;
+import com.zhongzheng.modules.grade.vo.*;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Collection;
 import java.util.List;
@@ -26,4 +24,10 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     List<ClassPeriodStudentVo> listUserPeriod(ClassGradeUserQueryBo bo);
 
     List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo);
+
+    List<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo);
+
+    List<ClassPeriodChapterVo> listperiodChapter(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
+
+    List<ClassPeriodSectionVo> listPeriodSection(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
 }

+ 3 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java

@@ -1,14 +1,11 @@
 package com.zhongzheng.modules.grade.service;
 
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
-import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
-import com.zhongzheng.modules.grade.vo.ClassGradeUserVo;
+import com.zhongzheng.modules.grade.vo.*;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserAddBo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserEditBo;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
-import com.zhongzheng.modules.grade.vo.ClassPeriodUserVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -58,4 +55,6 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 	List<ClassPeriodStudentVo> listUserPeriod(ClassGradeUserQueryBo bo);
 
     List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo);
+
+	List<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo);
 }

+ 15 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -157,4 +157,19 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         }
         return classPeriodUserVos;
     }
+
+    @Override
+    public List<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo) {
+        List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
+        for (ClassPeriodVo classPeriodVo : classPeriodVos) {
+            if (classPeriodVo.getType() == 1){
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId());
+                for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
+                    classPeriodChapterVo.setClassPeriodSectionList(baseMapper.listPeriodSection(classPeriodChapterVo.getId(),bo.getGoodsId(),classPeriodVo.getCourseId(),bo.getUserId()));
+                }
+                classPeriodVo.setClassPeriods(classPeriodChapterVos);
+            }
+        }
+        return classPeriodVos;
+    }
 }

+ 86 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java

@@ -0,0 +1,86 @@
+package com.zhongzheng.modules.grade.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+@ApiModel("学员视图对象")
+public class ClassPeriodChapterVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 学员ID */
+	@Excel(name = "学员ID")
+	@ApiModelProperty("学员ID")
+	private Long userId;
+
+	/**  */
+	@Excel(name = "id")
+	@ApiModelProperty("id")
+	private Long id;
+
+	/** 学员编码 */
+	@Excel(name = "標題")
+	@ApiModelProperty("标题")
+	private String typeName;
+
+	/** 学员编码 */
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realName;
+
+	/** 学时 */
+	@Excel(name = "学时")
+	@ApiModelProperty("学时")
+	private Long classHours;
+
+
+	/** 学习开始时间 */
+	@Excel(name = "学习开始时间")
+	@ApiModelProperty("学习开始时间")
+	private Long studyStartTime;
+
+	/** 学习结束时间 */
+	@Excel(name = "学习结束时间")
+	@ApiModelProperty("学习结束时间")
+	private Long studyEndTime;
+
+	/** 审核状态 */
+	@Excel(name = "审核状态")
+	@ApiModelProperty("审核状态 1通过 0作弊")
+	private String status;
+
+	/** 分数 */
+	@Excel(name = "分数")
+	@ApiModelProperty("分数")
+	private BigDecimal performance;
+
+	/** 审核时间 */
+	@Excel(name = "审核时间")
+	@ApiModelProperty("审核时间")
+	private Long auditTime;
+
+
+	/** 1模块 2章 3节 4卷 */
+	@Excel(name = "1模块 2章 3节 4卷")
+	@ApiModelProperty("1模块 2章 3节 4卷")
+	private Long type;
+
+	/** 章下面得节 */
+	@Excel(name = "章下面得节")
+	@ApiModelProperty("章下面得节")
+	private List<ClassPeriodSectionVo> classPeriodSectionList;
+
+
+}

+ 85 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java

@@ -0,0 +1,85 @@
+package com.zhongzheng.modules.grade.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+@ApiModel("学员视图对象")
+public class ClassPeriodSectionVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 学员ID */
+	@Excel(name = "学员ID")
+	@ApiModelProperty("学员ID")
+	private Long userId;
+	/** 学员ID */
+	@Excel(name = "课程id")
+	@ApiModelProperty("课程id")
+	private Long courseId;
+
+	/**  */
+	@Excel(name = "id")
+	@ApiModelProperty("id")
+	private Long id;
+
+	/** 学员编码 */
+	@Excel(name = "標題")
+	@ApiModelProperty("学员编码")
+	private String typeName;
+
+	/** 学员编码 */
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realName;
+
+	/** 学时 */
+	@Excel(name = "学时")
+	@ApiModelProperty("学时")
+	private Long classHours;
+
+
+	/** 学习开始时间 */
+	@Excel(name = "学习开始时间")
+	@ApiModelProperty("学习开始时间")
+	private Long studyStartTime;
+
+	/** 学习结束时间 */
+	@Excel(name = "学习结束时间")
+	@ApiModelProperty("学习结束时间")
+	private Long studyEndTime;
+
+	/** 审核状态 */
+	@Excel(name = "审核状态")
+	@ApiModelProperty("审核状态 1通过 0作弊")
+	private String status;
+
+	/** 审核时间 */
+	@Excel(name = "审核时间")
+	@ApiModelProperty("审核时间")
+	private Long auditTime;
+
+
+	/** 1模块 2章 3节 4卷 */
+	@Excel(name = "1模块 2章 3节 4卷")
+	@ApiModelProperty("1模块 2章 3节 4卷")
+	private Long type;
+
+
+	/** 审核数量*/
+	@Excel(name = "审核数量")
+	@ApiModelProperty("审核数量")
+	private Long auditNum;
+
+
+}

+ 84 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -0,0 +1,84 @@
+package com.zhongzheng.modules.grade.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+@ApiModel("学员视图对象")
+public class ClassPeriodVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 学员ID */
+	@Excel(name = "学员ID")
+	@ApiModelProperty("学员ID")
+	private Long userId;
+	/** 学员ID */
+	@Excel(name = "课程id")
+	@ApiModelProperty("课程id")
+	private Long courseId;
+
+	/**  */
+	@Excel(name = "id")
+	@ApiModelProperty("id")
+	private Long id;
+
+	/** 学员编码 */
+	@Excel(name = "標題")
+	@ApiModelProperty("学员编码")
+	private String typeName;
+
+	/** 学员编码 */
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realName;
+
+	/** 学时 */
+	@Excel(name = "学时")
+	@ApiModelProperty("学时")
+	private Long classHours;
+
+
+	/** 学习开始时间 */
+	@Excel(name = "学习开始时间")
+	@ApiModelProperty("学习开始时间")
+	private Long studyStartTime;
+
+	/** 学习结束时间 */
+	@Excel(name = "学习结束时间")
+	@ApiModelProperty("学习结束时间")
+	private Long studyEndTime;
+
+	/** 审核状态 */
+	@Excel(name = "审核状态")
+	@ApiModelProperty("审核状态 1通过 0作弊")
+	private String status;
+
+	/** 审核时间 */
+	@Excel(name = "审核时间")
+	@ApiModelProperty("审核时间")
+	private Long auditTime;
+
+
+	/** 1模块 2章 3节 4卷 */
+	@Excel(name = "1模块 2章 3节 4卷")
+	@ApiModelProperty("1模块 2章 3节 4卷")
+	private Long type;
+
+	/** type为1 模块下的章 */
+	@Excel(name = "type为1 模块下的章")
+	@ApiModelProperty("type为1 模块下的章")
+	private List<ClassPeriodChapterVo> classPeriods;
+
+
+}

+ 7 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/pay/service/impl/PayAisleServiceImpl.java

@@ -70,9 +70,14 @@ public class PayAisleServiceImpl extends ServiceImpl<PayAisleMapper, PayAisle> i
     @Override
     public Boolean insertByAddBo(PayAisleAddBo bo) {
         PayAisle add = BeanUtil.toBean(bo, PayAisle.class);
+        LambdaQueryWrapper<PayAisle> lqw = Wrappers.lambdaQuery();
+        lqw.eq(StrUtil.isNotBlank(bo.getPayWay()), PayAisle::getPayWay, bo.getPayWay());
+        lqw.in(bo.getStatus() != null, PayAisle::getStatus, 1,0);
+        List<PayAisle> list = this.list(lqw);
+        if (list.size() > 0){
+            throw new RuntimeException("重复支付通道名字");
+        }
         validEntityBeforeSave(add);
-        add.setCreateTime(DateUtils.getNowTime());
-        add.setUpdateTime(DateUtils.getNowTime());
         return this.save(add);
     }
 

+ 194 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -78,6 +78,34 @@
         <result property="cheat" column="cheat"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodVo" id="ClassPeriodVo">
+        <result property="userId" column="user_id"/>
+        <result property="id" column="id"/>
+        <result property="typeName" column="type_name"/>
+        <result property="realName" column="realname"/>
+        <result property="classHours" column="class_hours"/>
+        <result property="studyStartTime" column="study_start_time"/>
+        <result property="status" column="status"/>
+        <result property="auditTime" column="audit_time"/>
+        <result property="type" column="type"/>
+        <result property="courseId" column="course_id"/>
+        <result property="studyEndTime" column="study_end_time"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodChapterVo" id="ClassPeriodChapterVo">
+        <result property="userId" column="user_id"/>
+        <result property="id" column="id"/>
+        <result property="typeName" column="type_name"/>
+        <result property="realName" column="realname"/>
+        <result property="classHours" column="class_hours"/>
+        <result property="studyStartTime" column="study_start_time"/>
+        <result property="status" column="status"/>
+        <result property="auditTime" column="audit_time"/>
+        <result property="type" column="type"/>
+        <result property="studyEndTime" column="study_end_time"/>
+        <result property="performance" column="performance"/>
+    </resultMap>
+
     <select id="select" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
             resultMap="ClassGradeUserVoResult">
         SELECT
@@ -199,4 +227,170 @@
         </if>
     </select>
 
+    <select id="listPeriodAudit"  parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultMap="ClassPeriodVo">
+        SELECT
+        cm.menu_id as id,
+        cm.course_id,
+                (SELECT u.realname FROM `user` u where 1=1      <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as realname,
+
+                (SELECT u.user_id FROM `user` u where 1=1     <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as user_id,
+                (SELECT cm.module_name FROM course_module cm where cm.menu_id = cm.module_id) as type_name,
+                (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs LEFT JOIN course_module_chapter cmc on cmc.chapter_id=ccs.chapter_id where cmc.module_id=cm.menu_id) as class_hours,
+                1 as type,
+                NULL as study_start_time,
+                NULL as study_end_time
+        FROM
+            course_menu cm
+                LEFT JOIN goods_course gc on gc.course_id = cm.course_id
+        where 1=1
+          <if test="goodsId != null and goodsId !='' ">
+        and gc.goods_id=#{goodsId}
+        </if>
+        AND cm.type=1
+        UNION
+        SELECT
+        cm.menu_id as id,
+        cm.course_id,
+                (SELECT u.realname FROM `user` u where 1=1  <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as realname,
+                (SELECT u.user_id FROM `user` u where 1=1  <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as user_id,
+                (SELECT cc.`name` FROM course_chapter cc where cm.menu_id = cc.chapter_id) as type_name,
+                (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs  where ccs.chapter_id=cm.menu_id) as class_hours,
+                2 as type,
+                (SELECT usr.create_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id = ccs.section_id where ccs.chapter_id = cm.menu_id and usr.goods_id = gc.goods_id ORDER BY usr.create_time ASC limit 1) as study_start_time,
+	(SELECT usr.update_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id = ccs.section_id where ccs.chapter_id = cm.menu_id and usr.goods_id = gc.goods_id ORDER BY usr.create_time DESC limit 1) as study_end_time
+        FROM
+            course_menu cm
+            LEFT JOIN goods_course gc on gc.course_id = cm.course_id
+        where 1=1   <if test="goodsId != null and goodsId !='' ">
+        and gc.goods_id=#{goodsId}
+    </if>  AND cm.type=2
+        UNION
+        SELECT
+        cm.menu_id as id,
+        cm.course_id,
+                (SELECT u.realname FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as realname,
+                (SELECT u.user_id FROM `user` u where 1=1  <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as user_id,
+                (SELECT cs.`name` FROM course_section cs where cm.menu_id = cs.section_id) as type_name,
+                null as class_hours,
+                3 as type,
+                NULL as study_start_time,
+                NULL as study_end_time
+        FROM
+            course_menu cm
+                LEFT JOIN goods_course gc on gc.course_id = cm.course_id
+        where 1=1   <if test="goodsId != null and goodsId !='' ">
+        and gc.goods_id=#{goodsId}
+    </if>  AND cm.type=3
+        UNION
+        SELECT
+        cme.section_id as id,
+        cme.course_id,
+                (SELECT u.realname FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as realname,
+                (SELECT u.user_id FROM `user` u where 1=1<if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>) as user_id,
+                (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
+                null as class_hours,
+                4 as type,
+                NULL as study_start_time,
+                NULL as study_end_time
+        FROM
+            course_menu_exam cme
+                LEFT JOIN goods_course gc on gc.course_id = cme.course_id
+                LEFT JOIN course_menu cm on cme.section_id = cm.menu_id
+        where 1=1   <if test="goodsId != null and goodsId !='' ">
+        and gc.goods_id=#{goodsId}
+    </if>  AND cm.type=3 and cme.chapter_id=0 and cme.module_id=0 and cme.type=1 and cm.type=3
+
+    </select>
+
+    <select id="listperiodChapter"  parameterType="map" resultMap="ClassPeriodChapterVo">
+        SELECT
+            cc.chapter_id as id,
+            cm.course_id,
+            ( SELECT u.realname FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if> ) AS realname,
+            ( SELECT u.user_id FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
+        and u.user_id =  #{userId}
+    </if>)  AS user_id,
+            cc.`name` as type_name,
+            ( SELECT COUNT( ccs.section_id ) FROM course_chapter_section ccs WHERE ccs.chapter_id = cc.chapter_id ) AS class_hours,
+            2 AS type,
+            (
+                SELECT
+                    usr.create_time
+                FROM
+                    user_study_record usr
+                        LEFT JOIN course_chapter_section ccs ON usr.section_id = ccs.section_id
+                WHERE
+                    ccs.chapter_id = cc.chapter_id
+        <if test="goodsId != null and goodsId !='' ">
+            AND usr.goods_id=#{goodsId}
+        </if>
+                ORDER BY
+                    usr.create_time ASC
+                LIMIT 1
+            ) AS study_start_time,
+	(
+	SELECT
+		usr.update_time
+	FROM
+		user_study_record usr
+		LEFT JOIN course_chapter_section ccs ON usr.section_id = ccs.section_id
+	WHERE
+		ccs.chapter_id = cc.chapter_id
+        <if test="goodsId != null and goodsId !='' ">
+            AND usr.goods_id=#{goodsId}
+        </if>
+	ORDER BY
+		usr.create_time DESC
+		LIMIT 1
+	) AS study_end_time,
+	(
+	SELECT
+		ubr.performance
+	FROM
+		user_bank_record ubr
+		LEFT JOIN course_menu_exam cme ON cme.exam_id = ubr.exam_id
+	WHERE 1=1
+        <if test="goodsId != null and goodsId !='' ">
+            AND ubr.goods_id=#{goodsId}
+        </if>
+        <if test="moduleId != null and moduleId !='' ">
+            AND cme.module_id=#{moduleId}
+        </if>
+        <if test="courseId != null and courseId !='' ">
+            AND  cme.course_id =#{courseId}
+        </if>
+        AND cme.chapter_id = cmc.chapter_id
+        ) AS performance
+        FROM
+            course_menu cm
+            LEFT JOIN course_module_chapter cmc ON cm.menu_id = cmc.module_id
+            LEFT JOIN course_chapter cc ON cmc.chapter_id = cc.chapter_id
+        WHERE
+            1 = 1
+        <if test="moduleId != null and moduleId !='' ">
+            AND cmc.module_id=#{moduleId}
+        </if>
+        <if test="courseId != null and courseId !='' ">
+            AND  cm.course_id =#{courseId}
+        </if>
+    </select>
+
 </mapper>