|
@@ -20,7 +20,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -62,7 +64,7 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Object> getPlatformMenu(Long platformId){
|
|
|
+ public Map<String, Object> getPlatformMenu(Long platformId){
|
|
|
//全部目录查询
|
|
|
List<SysMenu> sysMenuListTwo = menuMapper.getSysMenuList("M");
|
|
|
//全部菜单查询
|
|
@@ -74,6 +76,14 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
|
|
|
queryWrapper.eq(SysPlatformMenu::getPlatformId, platformId);
|
|
|
List<SysPlatformMenu> sysMenuListFour = sysPlatformMenuService.list(queryWrapper);
|
|
|
|
|
|
+ List<SysPlatformMenu> menuList = baseMapper.getMenuListOne(platformId, "F");
|
|
|
+ Long[] arr = new Long[menuList.size()];
|
|
|
+ for (int i = 0; i < menuList.size(); i++) {
|
|
|
+ arr[i] = menuList.get(i).getMenuId();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
List<SysMenuTwoVo> sysMenuVoListOne = new ArrayList<>();
|
|
|
List<SysMenuOneVo> SysMenuVoList = new ArrayList<>();
|
|
|
List<SysMenuVo> SysMenuVoListOne = new ArrayList<>();
|
|
@@ -167,7 +177,12 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return list;
|
|
|
+ Map<String,Object> ajax = new HashMap<>();
|
|
|
+ ajax.put("checkedKeys",arr);
|
|
|
+ ajax.put("menus", list);
|
|
|
+
|
|
|
+ return ajax;
|
|
|
+// return list;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -175,11 +190,15 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
|
|
|
@Transactional
|
|
|
public void updatePlatformMenu(PlatformMenuVo platformMenuVo){
|
|
|
SysPlatform sysPlatform = new SysPlatform();
|
|
|
- sysPlatform.setId(platformMenuVo.getPlatformId().intValue());
|
|
|
- sysPlatform.setPlatformName(platformMenuVo.getPlatformName());
|
|
|
- sysPlatform.setUpdateBy(SecurityUtils.getUser().getUserName());
|
|
|
- sysPlatform.setUpdateTime(LocalDateTime.now());
|
|
|
- this.updateById(sysPlatform);
|
|
|
+ if(platformMenuVo.getPlatformId().intValue()==0){
|
|
|
+ sysPlatform.setPlatformName(platformMenuVo.getPlatformName());
|
|
|
+ sysPlatform.setUpdateBy(SecurityUtils.getUser().getUserName());
|
|
|
+ sysPlatform.setUpdateTime(LocalDateTime.now());
|
|
|
+ this.save(sysPlatform);
|
|
|
+ Integer fid = sysPlatform.getId();
|
|
|
+ platformMenuVo.setPlatformId(fid.longValue());
|
|
|
+ }
|
|
|
+
|
|
|
Long[] arr = platformMenuVo.getMenuIds();
|
|
|
//菜单ID
|
|
|
List<SysMenu> menuIdList = baseMapper.getMenuIdListOne(arr, "F");
|