|
@@ -12,14 +12,12 @@ import cn.iocoder.byzs.module.web.controller.admin.blockly.vo.WebBlocklyVO;
|
|
|
import cn.iocoder.byzs.module.web.controller.admin.blocklyprogress.vo.WebBlocklyProgressDO;
|
|
import cn.iocoder.byzs.module.web.controller.admin.blocklyprogress.vo.WebBlocklyProgressDO;
|
|
|
import cn.iocoder.byzs.module.web.dal.mysql.blockly.WebBlocklyMapper;
|
|
import cn.iocoder.byzs.module.web.dal.mysql.blockly.WebBlocklyMapper;
|
|
|
import cn.iocoder.byzs.module.web.service.blocklyprogress.WebBlocklyProgressServiceImpl;
|
|
import cn.iocoder.byzs.module.web.service.blocklyprogress.WebBlocklyProgressServiceImpl;
|
|
|
|
|
+import cn.iocoder.byzs.module.web.service.role.WebAuthRoleServiceImpl;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.Comparator;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -39,6 +37,9 @@ public class WebBlocklyServiceImpl {
|
|
|
private WebBlocklyMapper webBlocklyMapper;
|
|
private WebBlocklyMapper webBlocklyMapper;
|
|
|
@Resource
|
|
@Resource
|
|
|
private WebBlocklyProgressServiceImpl webBlocklyProgressService;
|
|
private WebBlocklyProgressServiceImpl webBlocklyProgressService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private WebAuthRoleServiceImpl webAuthRoleService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -62,7 +63,6 @@ public class WebBlocklyServiceImpl {
|
|
|
Map<Long, WebBlocklyProgressDO> progressMap = progressList.stream().collect(Collectors.toMap(WebBlocklyProgressDO::getBrpCourseId, a -> a));
|
|
Map<Long, WebBlocklyProgressDO> progressMap = progressList.stream().collect(Collectors.toMap(WebBlocklyProgressDO::getBrpCourseId, a -> a));
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//重新组装
|
|
//重新组装
|
|
|
List<WebBlocklyVO> blocklyVoList = new ArrayList<>();
|
|
List<WebBlocklyVO> blocklyVoList = new ArrayList<>();
|
|
|
for (BlocklyPageReqVO blockly : blocklyList) {
|
|
for (BlocklyPageReqVO blockly : blocklyList) {
|
|
@@ -107,7 +107,17 @@ public class WebBlocklyServiceImpl {
|
|
|
List<WebBlocklyProgressDO> progressList = webBlocklyProgressService.getBlocklyProgressByThemeId(themeId);
|
|
List<WebBlocklyProgressDO> progressList = webBlocklyProgressService.getBlocklyProgressByThemeId(themeId);
|
|
|
Map<Long, WebBlocklyProgressDO> progressMap = progressList.stream().collect(Collectors.toMap(WebBlocklyProgressDO::getBrpCtId, a -> a));
|
|
Map<Long, WebBlocklyProgressDO> progressMap = progressList.stream().collect(Collectors.toMap(WebBlocklyProgressDO::getBrpCtId, a -> a));
|
|
|
|
|
|
|
|
|
|
+ //获得blockly数据权限
|
|
|
|
|
+ Set<Long> blocklyAuthRoleVO = webAuthRoleService.getBlocklyAuthRoleVO();
|
|
|
|
|
+
|
|
|
blocklyTypeVoList.forEach(blocklyType -> {
|
|
blocklyTypeVoList.forEach(blocklyType -> {
|
|
|
|
|
+
|
|
|
|
|
+ //判断是否有数据权限
|
|
|
|
|
+ if (blocklyAuthRoleVO.isEmpty()) {
|
|
|
|
|
+ blocklyType.setDataReadonly(false);
|
|
|
|
|
+ }else blocklyType.setDataReadonly(!blocklyAuthRoleVO.contains(blocklyType.getId()));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (progressMap.containsKey(blocklyType.getId())) {
|
|
if (progressMap.containsKey(blocklyType.getId())) {
|
|
|
WebBlocklyProgressDO progress = progressMap.get(blocklyType.getId());
|
|
WebBlocklyProgressDO progress = progressMap.get(blocklyType.getId());
|
|
|
Double brpProgress = progress.getBrpProgress();
|
|
Double brpProgress = progress.getBrpProgress();
|