yangdamao 5 月之前
父节点
当前提交
0c9e707cbd

+ 16 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseEducationTypeController.java

@@ -5,11 +5,15 @@ 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.exception.CustomException;
+import com.zhongzheng.common.utils.ToolsUtils;
 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.service.ICourseEducationTypeService;
 import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+import com.zhongzheng.modules.order.bo.CommonOfficialBo;
+import com.zhongzheng.modules.order.bo.CommonOrderBo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -49,5 +53,17 @@ public class CourseEducationTypeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询教育类型列表
+     */
+    @ApiOperation("查询教育类型列表")
+    @PostMapping("/open/list")
+    public AjaxResult<List<CourseEducationTypeVo>> listEdu(@RequestBody CommonOfficialBo bo) {
+        if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
+            throw new CustomException("签名错误");
+        }
+        return AjaxResult.success(iCourseEducationTypeService.listEdu());
+    }
+
 
 }

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

@@ -62,4 +62,7 @@ public interface ICourseEducationTypeService extends IService<CourseEducationTyp
     CourseEducationType getEducationTypeBytenant(String encoder, Long newTenantId);
 
     CourseEducationType getEducationByIdtenant(Long educationTypeId, Long tenantId);
+
+    List<CourseEducationTypeVo> listEdu();
+
 }

+ 24 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseEducationTypeServiceImpl.java

@@ -12,6 +12,7 @@ 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.base.vo.Education;
 import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.CourseEducationTier;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
@@ -30,9 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -221,4 +220,26 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
     public CourseEducationType getEducationByIdtenant(Long educationTypeId, Long tenantId) {
         return baseMapper.getEducationTypeByIdtenant(educationTypeId, tenantId);
     }
+
+    @Override
+    public List<CourseEducationTypeVo> listEdu() {
+        List<CourseEducationType> list = list(new LambdaQueryWrapper<CourseEducationType>()
+                .eq(CourseEducationType::getStatus, 1).orderByAsc(CourseEducationType::getSort));
+        if (CollectionUtils.isEmpty(list)){
+            return new ArrayList<>();
+        }
+        //获取业务层次
+        List<CourseEducationTypeVo> collect = list.stream().map(item -> {
+            CourseEducationTypeVo vo = BeanUtil.toBean(item, CourseEducationTypeVo.class);
+            CourseBusinessQueryBo bo = new CourseBusinessQueryBo();
+            bo.setStatus(Arrays.asList(1));
+            bo.setEducationId(item.getId());
+            List<CourseBusinessVo> courseBusinessVos = iCourseBusinessService.queryList(bo);
+            if (CollectionUtils.isNotEmpty(courseBusinessVos)) {
+                vo.setBusinessList(courseBusinessVos);
+            }
+            return vo;
+        }).collect(Collectors.toList());
+        return collect;
+    }
 }

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/CommonOfficialBo.java

@@ -0,0 +1,25 @@
+package com.zhongzheng.modules.order.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2024年06月06日 15:23
+ */
+@Data
+public class CommonOfficialBo implements Serializable {
+
+    @ApiModelProperty("当前时间戳")
+    @NotBlank(message = "当前时间戳不能为空")
+    private Long stamp;
+
+    @ApiModelProperty("签名")
+    @NotBlank(message = "签名不能为空")
+    private String sign;
+
+}