change 3 жил өмнө
parent
commit
bb347ac78f

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

@@ -49,6 +49,8 @@ public class ClassGradeController extends BaseController {
 
     private final IUserPeriodService iUserPeriodService;
 
+    private final IUserPeriodStatusService userPeriodStatusService;
+
     /**
      * 查询班级列表
      */
@@ -122,6 +124,17 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询查询以往审核记录列表
+     */
+    @ApiOperation("查询以往审核记录")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/listPeriodStatus")
+    public TableDataInfo<UserPeriodStatusVo> list(UserPeriodQueryBo bo) {
+        startPage();
+        List<UserPeriodStatusVo> list = userPeriodStatusService.selectPeriodStatus(bo);
+        return getDataTable(list);
+    }
 
 
 
@@ -208,10 +221,10 @@ public class ClassGradeController extends BaseController {
     /**
      * 修改【请填写功能名称】
      */
-    @ApiOperation("")
+    @ApiOperation("更改审核状态")
     @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
     @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
-    @PutMapping()
+    @PostMapping("/editPeriod")
     public AjaxResult<Void> edit(@RequestBody UserPeriodEditBo bo) {
         return toAjax(iUserPeriodService.updateByEditBo(bo) ? 1 : 0);
     }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/UserPeriodStatusMapper.java

@@ -1,7 +1,12 @@
 package com.zhongzheng.modules.grade.mapper;
 
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
+import com.zhongzheng.modules.grade.bo.UserPeriodStatusQueryBo;
 import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
+
+import java.util.List;
 
 /**
  * 【请填写功能名称】Mapper接口
@@ -11,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface UserPeriodStatusMapper extends BaseMapper<UserPeriodStatus> {
 
+    List<UserPeriodStatusVo> selectPeriodStatus(UserPeriodQueryBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IUserPeriodStatusService.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.grade.service;
 
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
 import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
 import com.zhongzheng.modules.grade.bo.UserPeriodStatusQueryBo;
@@ -49,4 +50,6 @@ public interface IUserPeriodStatusService extends IService<UserPeriodStatus> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<UserPeriodStatusVo> selectPeriodStatus(UserPeriodQueryBo bo);
 }

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.grade.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
 import com.zhongzheng.modules.grade.vo.*;
 import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
@@ -38,6 +39,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private IUserStudyRecordService iUserStudyRecordService;
 
+    @Autowired
+    private IUserPeriodStatusService userPeriodStatusService;
+
     @Override
     public ClassGradeUserVo queryById(Long id){
         ClassGradeUser db = this.baseMapper.selectById(id);
@@ -168,8 +172,10 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId());
                 classPeriodChapterVos.addAll(baseMapper.listperiodExam(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId()));
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
-                    classPeriodChapterVo.setClassPeriodSectionList(baseMapper.listPeriodSection(classPeriodChapterVo.getId(),bo.getGoodsId(),classPeriodVo.getCourseId(),bo.getUserId()));
+                    List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
+                    classPeriodChapterVo.setClassPeriodSectionList(classPeriodSectionVos);
                 }
+
                 classPeriodVo.setClassPeriods(classPeriodChapterVos);
             }
             if (classPeriodVo.getType() == 2){

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodStatusServiceImpl.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.grade.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -100,4 +101,9 @@ public class UserPeriodStatusServiceImpl extends ServiceImpl<UserPeriodStatusMap
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<UserPeriodStatusVo> selectPeriodStatus(UserPeriodQueryBo bo) {
+        return baseMapper.selectPeriodStatus(bo);
+    }
 }

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

@@ -82,4 +82,10 @@ public class ClassPeriodSectionVo {
 	private Long auditNum;
 
 
+	/** 审核数量*/
+	@Excel(name = "以往审核记录")
+	@ApiModelProperty("以往审核记录")
+	private List<UserPeriodStatusVo> userPeriodStatusVos;
+
+
 }

+ 26 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml

@@ -15,5 +15,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <select id="selectPeriodStatus" parameterType="com.zhongzheng.modules.grade.bo.UserPeriodQueryBo" resultMap="UserPeriodStatusResult">
+        SELECT
+            ups.*
+        FROM
+            user_period_status ups
+                LEFT JOIN user_period up ON up.id = ups.period_id
+        WHERE
+        <if test="goodsId != null and goodsId != ''">
+            up.goods_id = #{goods_id}
+        </if>
+        <if test="userId != null and userId != ''">
+            up.user_id = #{userId}
+        </if>
+        <if test="sectionId != null and sectionId != ''">
+            up.section_id = #{sectionId}
+        </if>
+        <if test="moduleId != null and moduleId != ''">
+            up.module_id = #{moduleId}
+        </if>
 
+        <if test="chapterId != null and chapterId != ''">
+            up.chapter_id = #{chapterId}
+        </if>
+          AND ups.period_status = 2
+        ORDER BY
+            ups.create_time DESC
+    </select>
 </mapper>