diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/home/service/impl/HomeFunctionModuleEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/home/service/impl/HomeFunctionModuleEOServiceImpl.java index f5157cf51..5b74357c8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/home/service/impl/HomeFunctionModuleEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/home/service/impl/HomeFunctionModuleEOServiceImpl.java @@ -10,13 +10,19 @@ import com.jero.modules.home.mapper.HomeFunctionModuleEOMapper; import com.jero.modules.home.service.IHomeFunctionModuleEOService; import com.alibaba.fastjson.JSONObject; +import com.jero.modules.system.entity.SysPermission; +import com.jero.modules.system.service.ISysPermissionService; +import org.apache.commons.lang3.ObjectUtils; import org.apache.shiro.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.stream.Collectors; /** * @Description: 功能模块 @@ -27,6 +33,9 @@ import java.util.UUID; @Service public class HomeFunctionModuleEOServiceImpl extends ServiceImpl implements IHomeFunctionModuleEOService { + @Autowired + private ISysPermissionService sysPermissionService; + /** * 保存 * @@ -103,22 +112,35 @@ public class HomeFunctionModuleEOServiceImpl extends ServiceImpl queryList(String cut) { LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //用户拥有权限的菜单 + List metaList = sysPermissionService.queryByUser(loginUser.getUsername()); + //所有的图表(state=0) LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.in(HomeFunctionModuleEO::getState,"0").isNull(HomeFunctionModuleEO::getCreateBy); List homeFunctionModuleEOList = this.list(wrapper); + List homeFunctionModuleEOListTemp = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(homeFunctionModuleEOList)){ + for (SysPermission sysPermission : metaList) { + List collect = homeFunctionModuleEOList.stream().filter(e -> e.getIconName().equals(sysPermission.getName())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + homeFunctionModuleEOListTemp.addAll(collect); + } + } + } + homeFunctionModuleEOListTemp = homeFunctionModuleEOListTemp.stream().distinct().collect(Collectors.toList()); //当前用户配置的图表 LambdaQueryWrapper wrapperTemp = new LambdaQueryWrapper<>(); wrapperTemp.in(HomeFunctionModuleEO::getCreateBy,loginUser.getUsername()).orderByAsc(HomeFunctionModuleEO::getState).orderByAsc(HomeFunctionModuleEO::getSort); List homeFunctionModuleEOS = this.list(wrapperTemp); if(homeFunctionModuleEOS.size() == 0){ if(CutEnum.EN.getValue().equals(cut)){ - for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOList) { + for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOListTemp) { homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn()); } } - return homeFunctionModuleEOList; + return homeFunctionModuleEOListTemp; }else{ if(CutEnum.EN.getValue().equals(cut)){ for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOS) { diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/csdcmbgl.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/csdcmbgl.png new file mode 100644 index 000000000..4ff7efb25 Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/csdcmbgl.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/csmbgl.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/csmbgl.png new file mode 100644 index 000000000..a023127b9 Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/csmbgl.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/dwbggl.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/dwbggl.png new file mode 100644 index 000000000..989d5841c Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/dwbggl.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgfhxkb.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgfhxkb.png new file mode 100644 index 000000000..381669457 Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgfhxkb.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgjspg.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgjspg.png new file mode 100644 index 000000000..bfc4c9b6c Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgjspg.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyb.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyb.png new file mode 100644 index 000000000..ce8bdce6c Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyb.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyj.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyj.png new file mode 100644 index 000000000..81993e2a9 Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyj.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyjsj.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyjsj.png new file mode 100644 index 000000000..a5eaa68bc Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/fgyjsj.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/sbkgl.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/sbkgl.png new file mode 100644 index 000000000..16eaba591 Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/sbkgl.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wddb.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wddb.png index 5db1b6cba..ac6d8ba8a 100644 Binary files a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wddb.png and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wddb.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wdfy.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wdfy.png index 2348991fc..a040257d7 100644 Binary files a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wdfy.png and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wdfy.png differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wdsb.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wdsb.png deleted file mode 100644 index 5948fd0bd..000000000 Binary files a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wdsb.png and /dev/null differ diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wtzsk.png b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wtzsk.png new file mode 100644 index 000000000..1a3131a9d Binary files /dev/null and b/jero-boot/jero-boot-single-startup/src/main/resources/static/home/wtzsk.png differ