he2802 2 tahun lalu
induk
melakukan
ef7f5ae3b4

+ 16 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseEducationTypeController.java

@@ -1,8 +1,11 @@
 package com.zhongzheng.controller.course;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Arrays;
 
+import com.zhongzheng.modules.top.goods.bo.TopCourseEducationTypeQueryBo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,7 +33,7 @@ import io.swagger.annotations.ApiOperation;
 
 /**
  * 教育类型Controller
- * 
+ *
  * @author ruoyi
  * @date 2021-10-08
  */
@@ -50,10 +53,22 @@ public class CourseEducationTypeController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseEducationTypeVo> list(CourseEducationTypeQueryBo bo) {
         startPage();
+        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
         List<CourseEducationTypeVo> list = iCourseEducationTypeService.queryList(bo);
         return getDataTable(list);
     }
 
+
+    /**
+     * 查询教育类型列表
+     */
+    @ApiOperation("查询所有业务层次列表")
+    @GetMapping("/allList")
+    public TableDataInfo<CourseEducationTypeVo> allList(CourseEducationTypeQueryBo bo) {
+        startPage();
+        List<CourseEducationTypeVo> list = iCourseEducationTypeService.queryAllList(bo);
+        return getDataTable(list);
+    }
     /**
      * 导出教育类型列表
      */

+ 1 - 1
zhongzheng-admin/src/main/resources/application.yml

@@ -117,7 +117,7 @@ token:
     # 令牌密钥
     secret: abcdefghijklmnopqrstuvwxyz
     # 令牌有效期(默认30分钟)
-    expireTime: 360
+    expireTime: 720
 
 # MyBatis配置
 # https://baomidou.com/config/

+ 1 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/TokenService.java

@@ -114,7 +114,7 @@ public class TokenService
             }
         }
         LoginUser loginUser = (LoginUser) authentication.getPrincipal();
-        loginUser.setExpireTime(System.currentTimeMillis()+200);
+        loginUser.setExpireTime(System.currentTimeMillis());
         return loginUser;
     }
 

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseBusinessQueryBo.java

@@ -60,7 +60,7 @@ public class CourseBusinessQueryBo extends BaseEntity {
 
 	/** 教育类型id */
 	@ApiModelProperty("教育类型id")
-	private Integer educationId;
+	private Long educationId;
 
 	@Excel(name = "模板选用")
 	@ApiModelProperty("模板选用")

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseBusinessMapper.java

@@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.vo.CourseBusinessVo;
+import com.zhongzheng.modules.top.goods.bo.TopCourseBusinessQueryBo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Collection;
+import java.util.List;
 
 /**
  * 业务层次Mapper接口
@@ -28,4 +31,6 @@ public interface CourseBusinessMapper extends BaseMapper<CourseBusiness> {
     CourseBusiness getBusinessByIdTenant(@Param("businessId") Long businessId,@Param("tenantId") Long tenantId);
 
     CourseBusinessVo queryFullId(CourseBusinessQueryBo bo);
+
+    List<CourseBusinessVo> queryAllList(CourseBusinessQueryBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseBusinessService.java

@@ -6,7 +6,9 @@ import com.zhongzheng.modules.course.bo.CourseBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.vo.CourseBusinessVo;
+import com.zhongzheng.modules.top.goods.bo.TopCourseBusinessQueryBo;
 import com.zhongzheng.modules.top.goods.domain.TopCourseBusiness;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -68,4 +70,6 @@ public interface ICourseBusinessService extends IService<CourseBusiness> {
 	CourseBusiness getBusinessByIdTenant(Long businessId, Long tenantId);
 
 	CourseBusinessVo queryFullId(CourseBusinessQueryBo bo);
+
+	List<CourseBusinessVo> queryAllList(CourseBusinessQueryBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseEducationTypeService.java

@@ -7,6 +7,8 @@ import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeAddBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.top.goods.bo.TopCourseEducationTypeQueryBo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -33,6 +35,8 @@ public interface ICourseEducationTypeService extends IService<CourseEducationTyp
 	 */
 	List<CourseEducationTypeVo> queryList(CourseEducationTypeQueryBo bo);
 
+	List<CourseEducationTypeVo> queryAllList(CourseEducationTypeQueryBo bo);
+
 	/**
 	 * 根据新增业务对象插入教育类型
 	 * @param bo 教育类型新增业务对象

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java

@@ -252,4 +252,9 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
         return baseMapper.queryFullId(bo);
     }
 
+    @Override
+    public List<CourseBusinessVo> queryAllList(CourseBusinessQueryBo bo) {
+        return baseMapper.queryAllList(bo);
+    }
+
 }

+ 31 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseEducationTypeServiceImpl.java

@@ -12,17 +12,20 @@ import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.base.vo.BaseFilterVo;
-import com.zhongzheng.modules.course.bo.CourseEducationTierAddBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeAddBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
+import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.CourseEducationTier;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
 import com.zhongzheng.modules.course.mapper.CourseEducationTypeMapper;
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
 import com.zhongzheng.modules.course.service.ICourseEducationTierService;
 import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 import com.zhongzheng.modules.course.vo.CourseEducationTierVo;
 import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+import com.zhongzheng.modules.top.goods.bo.TopCourseBusinessQueryBo;
+import com.zhongzheng.modules.top.goods.domain.TopCourseEducationType;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -44,6 +47,9 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
     @Autowired
     private ICourseEducationTierService courseEducationTierService;
 
+    @Autowired
+    private ICourseBusinessService iCourseBusinessService;
+
     @Override
     public CourseEducationTypeVo queryById(Long id){
         CourseEducationType db = this.baseMapper.selectById(id);
@@ -77,6 +83,27 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
         return entity2Vo(this.list(lqw));
     }
 
+    @Override
+    public List<CourseEducationTypeVo> queryAllList(CourseEducationTypeQueryBo bo) {
+        LambdaQueryWrapper<CourseEducationType> lqw = Wrappers.lambdaQuery();
+        lqw.like(StrUtil.isNotBlank(bo.getEducationName()), CourseEducationType::getEducationName, bo.getEducationName());
+        lqw.eq(StrUtil.isNotBlank(bo.getEncoder()), CourseEducationType::getEncoder, bo.getEncoder());
+        lqw.eq(bo.getStatus() != null, CourseEducationType::getStatus, bo.getStatus());
+        lqw.in(CourseEducationType::getStatus, 1);
+        lqw.eq(bo.getSort() != null, CourseEducationType::getSort, bo.getSort());
+        List<CourseEducationTypeVo> courseEducationTypeVos = entity2Vo(this.list(lqw));
+        if (CollectionUtils.isEmpty(courseEducationTypeVos)){
+            return new ArrayList<>();
+        }
+        courseEducationTypeVos.forEach(item -> {
+            CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+            queryBo.setEducationId(item.getId());
+            List<CourseBusinessVo> businessVoList = iCourseBusinessService.queryAllList(queryBo);
+            item.setBusinessList(businessVoList);
+        });
+        return courseEducationTypeVos;
+    }
+
     /**
     * 实体类转化成视图对象
     *

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseEducationTypeVo.java

@@ -2,11 +2,12 @@ package com.zhongzheng.modules.course.vo;
 
 import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -48,4 +49,7 @@ public class CourseEducationTypeVo {
 	@Excel(name = "排序")
 	@ApiModelProperty("排序")
 	private Integer sort;
+
+	@ApiModelProperty("业务层级列表")
+	private List<CourseBusinessVo> businessList;
 }

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

@@ -2744,7 +2744,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         List<StudyAccountStatusVo> list = new ArrayList<>();
         for (CourseProjectTypeVo courseProjectTypeVo : courseProjectTypeVoList) {
             CourseBusinessQueryBo bo2 = new CourseBusinessQueryBo();
-            bo2.setEducationId(bo.getEducationTypeId().intValue());
+            bo2.setEducationId(bo.getEducationTypeId());
             bo2.setProjectId(courseProjectTypeVo.getId().intValue());
             List<Integer> status2 = Arrays.asList(1);
             bo2.setStatus(status2);

+ 34 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseBusinessMapper.xml

@@ -126,4 +126,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN order_input_template t ON b.template_status = t.id
         WHERE b.id = #{businessId} and b.tenant_id = #{tenantId}
     </select>
+
+    <select id="queryAllList" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo"  resultMap="CourseBusinessVoResult">
+        SELECT
+        b.id as business_id,
+        b.business_name,
+        b.alias_name,
+        e.education_name,
+        e.id as education_id,
+        p.project_name,
+        p.id as project_id
+        FROM
+        course_business b
+        LEFT JOIN course_project_type p on b.project_id =p.id
+        LEFT JOIN course_education_type e ON p.education_id = e.id
+        where 1=1
+        and p.status = 1
+        and b.status = 1
+        <if test="businessName != null and businessName != ''">
+            AND b.business_name = #{businessName}
+        </if>
+        <if test="encoder != null and encoder != ''">
+            AND b.encoder = #{encoder}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND p.id = #{projectId}
+        </if>
+        <if test="educationId != null and educationId != ''">
+            AND e.id = #{educationId}
+        </if>
+        <if test="id != null and id != ''">
+            AND b.id = #{id}
+        </if>
+        order by b.sort
+    </select>
 </mapper>