|
@@ -9,6 +9,8 @@ import com.ruoyi.common.core.domain.entity.SysMenu;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.system.entity.DragTableBtn;
|
|
|
+import com.ruoyi.system.entity.DragTableBtnRelevance;
|
|
|
+import com.ruoyi.system.mapper.DragTableBtnRelevanceMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.system.mapper.DragTableBtnMapper;
|
|
@@ -27,6 +29,9 @@ public class DragTableBtnServiceImpl implements IDragTableBtnService
|
|
|
@Autowired
|
|
|
private DragTableBtnMapper dragTableBtnMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DragTableBtnRelevanceMapper dragTableBtnRelevanceMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询格绑定的自定义按钮
|
|
|
*
|
|
@@ -50,6 +55,14 @@ public class DragTableBtnServiceImpl implements IDragTableBtnService
|
|
|
{
|
|
|
// 根据分页得到根节点数据
|
|
|
List<DragTableBtn> rootNodes = dragTableBtnMapper.selectDragTableBtnList(dragTableBtn);
|
|
|
+ //给已经绑定的按钮添加标识
|
|
|
+ List<DragTableBtnRelevance> dragTableBtnRelevanceList = dragTableBtnRelevanceMapper.selectDragTableBtnRelevanceList(new DragTableBtnRelevance());
|
|
|
+ List<String> btnKeys = dragTableBtnRelevanceList.stream().map(DragTableBtnRelevance::getBtnKey).collect(Collectors.toList());
|
|
|
+ for (DragTableBtn r: rootNodes){
|
|
|
+ if(btnKeys.contains(r.getBtnKey())){
|
|
|
+ r.setWhetherBind(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
//查询子节点
|
|
|
List<Long> ids = rootNodes.stream().map(m -> m.getId()).collect(Collectors.toList());
|
|
|
if (ids.isEmpty()){
|