change hace 3 años
padre
commit
eb9a717bdd

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

@@ -57,7 +57,7 @@ public class ClassGradeController extends BaseController {
      * 查询班级列表
      */
     @ApiOperation("查询班级列表")
-    @PreAuthorize("@ss.hasPermi('modules.grade:grade:list')")
+    @PreAuthorize("@ss.hasPermi('grade:grade:list')")
     @GetMapping("/list")
     public TableDataInfo<ClassGradeVo> list(ClassGradeQueryBo bo) {
         startPage();
@@ -69,7 +69,7 @@ public class ClassGradeController extends BaseController {
      * 查询学员记录列表
      */
     @ApiOperation("查询学员记录列表")
-    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
     @GetMapping("/listUser")
     public TableDataInfo<ClassGradeUserVo> list(ClassGradeUserQueryBo bo) {
         startPage();
@@ -83,7 +83,7 @@ public class ClassGradeController extends BaseController {
      * 查询班主任记录列表
      */
     @ApiOperation("查询班主任记录列表")
-    @PreAuthorize("@ss.hasPermi('system:sys:list')")
+    @PreAuthorize("@ss.hasPermi('grade:sys:list')")
     @GetMapping("/listSys")
     public TableDataInfo<ClassGradeSysVo> list(ClassGradeSysQueryBo bo) {
         startPage();
@@ -95,7 +95,7 @@ public class ClassGradeController extends BaseController {
      * 查询班级列表
      */
     @ApiOperation("是否出现官方接口选择")
-    @PreAuthorize("@ss.hasPermi('modules.grade:grade:select')")
+    @PreAuthorize("@ss.hasPermi('grade:grade:select')")
     @GetMapping("/select")
     public AjaxResult<Integer> select(ClassGradeAddBo bo) {
         boolean tenantId = ServletUtils.getRequest().getHeader("TenantId").equals("867735392558919680");
@@ -106,7 +106,7 @@ public class ClassGradeController extends BaseController {
      * 查询官方接口
      */
     @ApiOperation("查询官方接口")
-    @PreAuthorize("@ss.hasPermi('modules.grade:grade:list')")
+    @PreAuthorize("@ss.hasPermi('grade:grade:list')")
     @GetMapping("/listInterfaceVo")
     public TableDataInfo<ClassGradeInterfaceVo> list(ClassGradeInterfaceQueryBo bo) {
         startPage();
@@ -131,7 +131,7 @@ public class ClassGradeController extends BaseController {
      * 获取班级详细信息
      */
     @ApiOperation("获取班级详细信息")
-    @PreAuthorize("@ss.hasPermi('modules.grade:grade:query')")
+    @PreAuthorize("@ss.hasPermi('grade:grade:query')")
     @GetMapping("/{classId}")
     public AjaxResult<ClassGradeVo> getInfo(@PathVariable("classId") Long classId) {
         return AjaxResult.success(iClassGradeService.queryById(classId));
@@ -141,7 +141,7 @@ public class ClassGradeController extends BaseController {
      * 新增班级
      */
     @ApiOperation("新增班级")
-    @PreAuthorize("@ss.hasPermi('modules.grade:grade:add')")
+    @PreAuthorize("@ss.hasPermi('grade:grade:add')")
     @Log(title = "班级", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody ClassGradeAddBo bo) {
@@ -152,7 +152,7 @@ public class ClassGradeController extends BaseController {
      * 修改班级
      */
     @ApiOperation("修改班级")
-    @PreAuthorize("@ss.hasPermi('modules.grade:grade:edit')")
+    @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
     @Log(title = "班级", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     public AjaxResult<Void> edit(@RequestBody ClassGradeEditBo bo) {

+ 63 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassStudentController.java

@@ -0,0 +1,63 @@
+package com.zhongzheng.controller.grade;
+
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.modules.grade.bo.*;
+import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
+import com.zhongzheng.modules.grade.service.IClassGradeService;
+import com.zhongzheng.modules.grade.service.IClassGradeSysService;
+import com.zhongzheng.modules.grade.service.IClassGradeUserService;
+import com.zhongzheng.modules.grade.vo.ClassGradeInterfaceVo;
+import com.zhongzheng.modules.grade.vo.ClassGradeSysVo;
+import com.zhongzheng.modules.grade.vo.ClassGradeUserVo;
+import com.zhongzheng.modules.grade.vo.ClassGradeVo;
+import com.zhongzheng.modules.user.bo.UserQueryBo;
+import com.zhongzheng.modules.user.service.IUserStudyRecordService;
+import com.zhongzheng.modules.user.vo.GoodsStudyRecordVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 班级Controller
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Api(value = "学员控制器", tags = {"学员控制器"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/grade/student")
+public class ClassStudentController extends BaseController {
+
+    private final IClassGradeService iClassGradeService;
+
+    private final IClassGradeInterfaceService iClassGradeInterfaceService;
+
+    private final IClassGradeSysService iClassGradeSysService;
+
+    private final IClassGradeUserService iClassGradeUserService;
+
+    private final IUserStudyRecordService iUserStudyRecordService;
+
+    /**
+     * 查询班级列表
+     */
+    @ApiOperation("查询学员商品学习记录")
+    @PreAuthorize("@ss.hasPermi('grade:student:list')")
+    @GetMapping("/list")
+    public TableDataInfo<GoodsStudyRecordVo> list(UserQueryBo bo) {
+        startPage();
+        List<GoodsStudyRecordVo> list = iUserStudyRecordService.queryGoods(bo);
+        return getDataTable(list);
+    }
+}

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java

@@ -1,8 +1,10 @@
 package com.zhongzheng.modules.user.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.user.bo.UserQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.UserStudyRecord;
+import com.zhongzheng.modules.user.vo.GoodsStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,4 +21,6 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
     List<UserStudyRecordVo> selectList(UserStudyRecordQueryBo bo);
 
     List<UserStudyRecord> selectUserStudy(@Param("userId") Long userId, @Param("courseId") Integer courseId);
+
+    List<GoodsStudyRecordVo> queryGoods(UserQueryBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java

@@ -1,10 +1,12 @@
 package com.zhongzheng.modules.user.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.user.bo.UserQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordAddBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordEditBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.UserStudyRecord;
+import com.zhongzheng.modules.user.vo.GoodsStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
 import org.apache.ibatis.annotations.Param;
 
@@ -54,4 +56,6 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
     List<UserStudyRecord> selectUserStudy(Long userId, Integer courseId);
+
+	List<GoodsStudyRecordVo> queryGoods(UserQueryBo bo);
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -4,12 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.user.bo.UserQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordAddBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordEditBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.UserStudyRecord;
 import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
+import com.zhongzheng.modules.user.vo.GoodsStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -127,4 +129,9 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     public List<UserStudyRecord> selectUserStudy(Long userId, Integer courseId) {
         return baseMapper.selectUserStudy(userId,courseId);
     }
+
+    @Override
+    public List<GoodsStudyRecordVo> queryGoods(UserQueryBo bo) {
+        return baseMapper.queryGoods(bo);
+    }
 }

+ 81 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/GoodsStudyRecordVo.java

@@ -0,0 +1,81 @@
+package com.zhongzheng.modules.user.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 【请填写功能名称】视图对象 mall_package
+ *
+ * @author change
+ * @date 2021-06-24
+ */
+@Data
+@ApiModel("【请填写功能名称】视图对象")
+public class GoodsStudyRecordVo {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    /** 班级ID */
+    @ApiModelProperty("班级ID")
+    private Long gradeId;
+
+    /** 学员Id */
+    @ApiModelProperty("学员Id")
+    private Long userId;
+
+    /** 商品名称 */
+    @ApiModelProperty("商品名称")
+    private String goodsName;
+
+
+    /** 商品编码 */
+    @ApiModelProperty("商品编码")
+    private String code;
+
+    /** 年份 */
+    @ApiModelProperty("年份")
+    private Long year;
+
+    /** 学时 */
+    @ApiModelProperty("学时")
+    private Long classHours;
+
+    /** 学习有效期开始 */
+    @ApiModelProperty("学习有效期开始")
+    private Long studyStartTime;
+
+    /** 学习有效期结束 */
+    @ApiModelProperty("学习有效期结束")
+    private Long studyEndTime;
+
+    /** 业务名称 */
+    @ApiModelProperty("业务名称")
+    private String businessName;
+
+    /** 项目名称 */
+    @ApiModelProperty("项目名称")
+    private String projectName;
+
+    /** 项目名称 */
+    @ApiModelProperty("学校名")
+    private String schoolName;
+
+    /** 项目名称 */
+    @ApiModelProperty("教育名")
+    private String educationName;
+
+    /** 项目名称 */
+    @ApiModelProperty("学习开始时间")
+    private Long startTime;
+
+
+    /** 项目名称 */
+    @ApiModelProperty("学习结束时间")
+    private Long endTime;
+
+}

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/pay/PayPayeeAisleMapper.xml

@@ -47,6 +47,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="accountId != null and accountId != ''">
             AND p.account_id = #{accountId}
         </if>
+        <if test="payeeId != null and payeeId != ''">
+            AND p.payee_id = #{payeeId}
+        </if>
         <if test="payeeName != null and payeeName != ''">
             AND y.payee_name  like concat('%', #{payeeName}, '%')
         </if>

+ 46 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -16,7 +16,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="endTime" column="end_time"/>
         <result property="coverUrl" column="cover_url"/>
         <result property="courseName" column="course_name"/>
+    </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.user.vo.GoodsStudyRecordVo" id="GoodsStudyRecordVoResult">
+        <result property="userId" column="user_id"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="goodsId" column="goods_id"/>
+        <result property="gradeId" column="grade_id"/>
+        <result property="goodsName" column="goods_name"/>
+        <result property="code" column="code"/>
+        <result property="year" column="year"/>
+        <result property="classHours" column="class_hours"/>
+        <result property="studyStartTime" column="study_start_time"/>
+        <result property="studyEndTime" column="study_end_time"/>
+        <result property="businessName" column="business_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="schoolName" column="school_name"/>
+        <result property="educationName" column="education_name"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo"  resultMap="UserStudyRecordResult">
@@ -45,4 +64,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         and study_duration > 360
     </select>
+
+    <select id="queryGoods" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo"  resultMap="GoodsStudyRecordVoResult">
+        SELECT
+            g.goods_name,
+            g.`code`,
+            g.`year`,
+            g.class_hours,
+            g.study_start_time,
+            g.study_end_time,
+            g.goods_id,
+            u.grade_id,
+            u.user_id,
+            (SELECT i.business_name FROM course_business i where i.id = g.business_id) as business_name,
+            (SELECT p.project_name FROM course_project_type p where p.id = g.business_id) as project_name,
+            (SELECT s.school_name FROM school s  where s.id = g.school_id) as school_name,
+            (SELECT e.education_name FROM course_education_type e  where e.id = g.education_type_id) as education_name,
+            (SELECT r.start_time FROM user_study_record r LEFT JOIN goods_course c on r.course_id= c.course_id where 1=1 AND g.goods_id=c.goods_id ORDER BY r.start_time ASC) as start_time,
+            (SELECT r.end_time FROM user_study_record r LEFT JOIN goods_course c on r.course_id= c.course_id where 1=1 AND g.goods_id=c.goods_id ORDER BY r.start_time ASC) as end_time
+        FROM
+            class_grade_user u
+                LEFT JOIN class_grade_goods d ON u.grade_id = d.grade_id
+                LEFT JOIN goods g on g.goods_id = d.goods_id
+        where 1=1
+        <if test="userId != null and userId !=''">
+            and u.user_id = #{userId}
+        </if>
+    </select>
 </mapper>