重构目录功能 添加目录串
@ -110,6 +110,8 @@ public class SqMenuController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SqMenu sqMenu)
|
||||
{
|
||||
SysUser sysUser=getAuthUser();
|
||||
sqMenu.setUserId(sysUser.getUserId());
|
||||
return toAjax(sqMenuService.insertSqMenu(sqMenu));
|
||||
}
|
||||
|
||||
@ -121,33 +123,22 @@ public class SqMenuController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SqMenu sqMenu)
|
||||
{
|
||||
//查询当前目录的 所有下级目录ID
|
||||
Long[] downMenuid = sqMenuService.selectBymenuidsubordinateid(sqMenu.getMenuId());
|
||||
|
||||
//自身menuId >> 所有下级目录的书签数量
|
||||
int bookmarkCount =sqBookmarkService.selectByMenuIdCount(sqMenu.getMenuId());
|
||||
for (Long menuId:downMenuid){
|
||||
SqMenu menu=new SqMenu();
|
||||
menu.setMenuId(menuId);
|
||||
List<SqMenu> menulist= sqMenuService.selectSqMenuList(menu);
|
||||
bookmarkCount +=menulist.get(0).getBookmarkCount();
|
||||
SysUser sysUser=getAuthUser();
|
||||
sqMenu.setUserId(sysUser.getUserId());
|
||||
SqMenu menu = sqMenuService.selectSqMenuById(sqMenu.getMenuId());
|
||||
//移动目录 更新新的目录串
|
||||
Boolean parentFlag =false;
|
||||
if (!menu.getParentId().toString().equals(menu.getParentId())){
|
||||
parentFlag=true;
|
||||
}
|
||||
|
||||
// ================修改前,减少上级所有目录的书签统计数量===================
|
||||
//查询书签修改前的所有上级
|
||||
Long[] parentMenuidlist = sqMenuService.selectBymenuidParentid(sqMenu.getMenuId());
|
||||
if (parentMenuidlist!=null&&parentMenuidlist.length>0){
|
||||
sqMenuService.updateCountReduce(parentMenuidlist,bookmarkCount);
|
||||
}
|
||||
|
||||
//修改
|
||||
sqMenuService.updateSqMenu(sqMenu);
|
||||
// ================修改后,增加上级所有目录的书签统计数量===================
|
||||
//查询书签的所有上级
|
||||
Long[] parentMenuid = sqMenuService.selectBymenuidParentid(sqMenu.getMenuId());
|
||||
if (parentMenuid!=null&&parentMenuid.length>0){
|
||||
sqMenuService.updateCountAdd(parentMenuid,bookmarkCount);
|
||||
// ================修改后===================
|
||||
if (parentFlag){
|
||||
String menuus = sqMenuService.addMenuUplinkSeries(menu.getMenuId());
|
||||
sqMenuService.updateSqMenu(new SqMenu(sqMenu.getMenuId(),menuus));
|
||||
}
|
||||
//添加所有上级目录的书签数量
|
||||
sqMenuService.addMenuByCountAndMenuUplinkSeries(menu.getMenuId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ -175,11 +166,15 @@ public class SqMenuController extends BaseController
|
||||
SqMenu sqMenu=new SqMenu();
|
||||
sqMenu.setParentId(menuId);
|
||||
List<SqMenu> sqMenuList=sqMenuService.selectSqMenuList(sqMenu);
|
||||
sqMenu = sqMenuService.selectSqMenuById(menuId);
|
||||
if (sqMenuList==null||sqMenuList.isEmpty()){
|
||||
//删除
|
||||
sqMenuService.deleteSqMenuById(menuId,sysUser.getUserId());
|
||||
//批量减少上级所有目录的书签数量
|
||||
sqMenu.setMenuId(menuId);
|
||||
sqMenuService.reduceMenuByCountAndMenuUplinkSeries(sqMenu);
|
||||
//修改目录下的所有书签状态为 删除状态
|
||||
sqBookmarkService.updateSqBookmarkBymenuId(menuId);
|
||||
|
||||
return toAjax(1);
|
||||
}else{
|
||||
return AjaxResult.error("删除失败,该目录下级还有目录菜单");
|
||||
@ -190,23 +185,23 @@ public class SqMenuController extends BaseController
|
||||
* 批量更新书签的数量
|
||||
*/
|
||||
|
||||
@RequestMapping("/bookmarkcount/{menuId}")
|
||||
public AjaxResult bookmarkcount(@PathVariable Long menuId)
|
||||
{
|
||||
|
||||
// Long[] menuIds={1L,2L,3L};
|
||||
//所有的父级目录
|
||||
// Long[] menuIds= sqMenuService.selectBymenuidParentid(4L);
|
||||
// sqMenuService.updateCountAdd(menuIds,5);
|
||||
|
||||
Long[] menuIds= sqMenuService.selectBymenuidsubordinateid(menuId);
|
||||
for (int i=0;i<menuIds.length;i++){
|
||||
System.out.println("id:"+menuIds[i].toString());
|
||||
}
|
||||
logger.info("执行完毕");
|
||||
return AjaxResult.success(menuIds);
|
||||
|
||||
}
|
||||
// @RequestMapping("/bookmarkcount/{menuId}")
|
||||
// public AjaxResult bookmarkcount(@PathVariable Long menuId)
|
||||
// {
|
||||
//
|
||||
//// Long[] menuIds={1L,2L,3L};
|
||||
// //所有的父级目录
|
||||
//// Long[] menuIds= sqMenuService.selectBymenuidParentid(4L);
|
||||
//// sqMenuService.updateCountAdd(menuIds,5);
|
||||
//
|
||||
// Long[] menuIds= sqMenuService.selectBymenuidsubordinateid(menuId);
|
||||
// for (int i=0;i<menuIds.length;i++){
|
||||
// System.out.println("id:"+menuIds[i].toString());
|
||||
// }
|
||||
// logger.info("执行完毕");
|
||||
// return AjaxResult.success(menuIds);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
package com.ruoyi.web.test.controller;
|
||||
|
||||
import com.ruoyi.bookmark.mapper.SqMenuMapper;
|
||||
import org.apache.velocity.runtime.directive.Foreach;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Auther: Wang
|
||||
* @Date: 2021/02/14 20:41
|
||||
* 功能描述:
|
||||
*/
|
||||
public class SqMenu extends BaseSpringBootTest{
|
||||
|
||||
@Autowired
|
||||
SqMenuMapper sqMenuMapper;
|
||||
@Test
|
||||
public void addMenuUplinkSeries() {
|
||||
|
||||
|
||||
List<com.ruoyi.bookmark.domain.SqMenu> sqMenus = sqMenuMapper.selectbymenuUplinkSeries();
|
||||
if (null!=sqMenus&&!sqMenus.isEmpty()) {
|
||||
for (com.ruoyi.bookmark.domain.SqMenu s:sqMenus) {
|
||||
StringBuilder menuus = new StringBuilder();
|
||||
com.ruoyi.bookmark.domain.SqMenu sqMenu = sqMenuMapper.selectSqMenuById(s.getMenuId());
|
||||
Long parentId = sqMenu.getParentId();
|
||||
//所有的上级目录ID
|
||||
List<Long> list = new ArrayList<>();
|
||||
list.add(s.getMenuId());
|
||||
while (parentId.intValue() != 0) {
|
||||
sqMenu = sqMenuMapper.selectSqMenuById(parentId);
|
||||
list.add(sqMenu.getMenuId());
|
||||
parentId = sqMenu.getParentId();
|
||||
}
|
||||
//倒序
|
||||
for (int i = list.size(); i > 0; i--) {
|
||||
menuus.append(",").append(list.get(i - 1));
|
||||
}
|
||||
menuus.append(",");
|
||||
System.out.println(menuus.toString());
|
||||
sqMenuMapper.updateSqMenu(new com.ruoyi.bookmark.domain.SqMenu(s.getMenuId(),menuus.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
ruoyi-ui/src/assets/icons/svg/app.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M784 992H240v-16a48 48 0 0 1 48-48h448a48 48 0 0 1 48 48v16z" fill="#515F5F" /><path d="M688 928H288a48 48 0 0 0-48 48v16h496v-16a48 48 0 0 0-48-48z" fill="#6C7F7F" /><path d="M384 928V768h256v160" fill="#364040" /><path d="M384 768h208v160H384z" fill="#515F5F" /><path d="M992 640H32V208a64 64 0 0 1 64-64h832a64 64 0 0 1 64 64v432z" fill="#7FCDEE" /><path d="M880 144H96a64 64 0 0 0-64 64v432h912V208a64 64 0 0 0-64-64z" fill="#A9DDF3" /><path d="M832 464V80a48 48 0 0 0-48-48H240a48 48 0 0 0-48 48v384a48 48 0 0 0 48 48h336l64 64 64-64h80a48 48 0 0 0 48-48z" fill="#929999" /><path d="M784 464V80a48 48 0 0 0-48-48H240a48 48 0 0 0-48 48v384a48 48 0 0 0 48 48h336l40 40L656 512h80a48 48 0 0 0 48-48z" fill="#C2CCCC" /><path d="M704 448L592 96H432l-112 352h96l32-112h128l32 112z" fill="#FFF284" /><path d="M704 448L592 96H432l-112 352h96l32-112h128l32 112z" fill="#FFF284" /><path d="M464 272h96l-48-112z" fill="#C2CCCC" /><path d="M992 640v64a64 64 0 0 1-64 64H96a64 64 0 0 1-64-64v-64" fill="#515F5F" /><path d="M944 704v-64H32v64a64 64 0 0 0 64 64h784a64 64 0 0 0 64-64z" fill="#6C7F7F" /><path d="M448 688h128v32h-128zM880 688h32v32h-32zM816 688h32v32h-32zM112 688h32v32H112zM176 688h32v32h-32z" fill="#4D4D4D" /></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
ruoyi-ui/src/assets/icons/svg/bank.svg
Normal file
After Width: | Height: | Size: 5.5 KiB |
1
ruoyi-ui/src/assets/icons/svg/conversation.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M777.084 156.366H106.028a18.526 18.526 0 0 0-18.524 18.524v92.786L0 311.424l87.504 43.754v92.784c0 10.23 8.292 18.526 18.524 18.526h671.056a18.526 18.526 0 0 0 18.524-18.526V174.886c-0.004-10.228-8.296-18.52-18.524-18.52z" fill="#FFF1CD" /><path d="M1024 712.57l-87.504-43.752v-92.786a18.524 18.524 0 0 0-18.524-18.524H246.918a18.524 18.524 0 0 0-18.524 18.524v273.076c0 10.23 8.292 18.526 18.524 18.526h671.056c10.228 0 18.524-8.294 18.524-18.526v-92.784L1024 712.57z" fill="#B4E5EA" /><path d="M686.184 773.738H322.074a17.064 17.064 0 0 1-17.066-17.066 17.064 17.064 0 0 1 17.066-17.066h364.112a17.066 17.066 0 0 1-0.002 34.132zM845.474 685.538h-523.4c-9.428 0-17.066-7.64-17.066-17.066s7.64-17.066 17.066-17.066h523.4a17.066 17.066 0 0 1 0 34.132z" fill="#609399" /><path d="M545.296 372.594H178.038c-9.428 0-17.066-7.64-17.066-17.066s7.64-17.066 17.066-17.066h367.258c9.428 0 17.066 7.64 17.066 17.066s-7.64 17.066-17.066 17.066zM704.584 284.394H178.038c-9.428 0-17.066-7.64-17.066-17.066s7.64-17.066 17.066-17.066h526.548a17.066 17.066 0 0 1-0.002 34.132z" fill="#FFD24D" /></svg>
|
After Width: | Height: | Size: 1.3 KiB |
1
ruoyi-ui/src/assets/icons/svg/draw.svg
Normal file
After Width: | Height: | Size: 5.1 KiB |
1
ruoyi-ui/src/assets/icons/svg/file.svg
Normal file
After Width: | Height: | Size: 6.1 KiB |
1
ruoyi-ui/src/assets/icons/svg/files-and-folders.svg
Normal file
After Width: | Height: | Size: 5.1 KiB |
1
ruoyi-ui/src/assets/icons/svg/folder.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M954.828015 405.907998V136.57577a13.579776 13.579776 0 0 0-13.579776-13.579776H396.695676a13.509048 13.509048 0 0 1-11.634756-6.595386l-45.142147-75.236911a13.61514 13.61514 0 0 0-11.634756-6.595386H84.307777A13.61514 13.61514 0 0 0 70.728001 48.165769v357.742229h884.100014z" fill="#B5885B" /><path d="M123.774002 335.179997h778.008012v70.728001H123.774002z" fill="#FFFFFF" /><path d="M141.456002 282.133996h742.644012v53.046001H141.456002z" fill="#E7ECED" /><path d="M159.138002 229.087996h707.280012v53.046H159.138002z" fill="#C7CAC7" /><path d="M932.248101 989.414007H91.751899a4.791822 4.791822 0 0 1-4.738776-4.06686L0.053046 411.424782a4.791822 4.791822 0 0 1 4.738776-5.516784h1014.416356c2.935212 0 5.180826 2.616936 4.738776 5.516784l-86.960077 573.922365a4.791822 4.791822 0 0 1-4.738776 4.06686z" fill="#F7B563" /><path d="M476.635999 653.456002h335.958006v212.184004h-335.958006z" fill="#EDEADA" /><path d="M547.364001 741.866004h70.728001a17.682 17.682 0 1 0 0-35.364001h-70.728001a17.682 17.682 0 1 0 0 35.364001zM688.820003 741.866004h17.682a17.682 17.682 0 1 0 0-35.364001h-17.682a17.682 17.682 0 1 0 0 35.364001zM741.866004 777.230004h-194.502003a17.682 17.682 0 1 0 0 35.364001h194.502003a17.682 17.682 0 1 0 0-35.364001z" fill="#CEC9AE" /></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
ruoyi-ui/src/assets/icons/svg/mails.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M736.926897 600.275862l-152.187587 125.704828-103.282758 85.274482c-13.011862 10.769655-31.832276 10.769655-44.844138 0l-103.282759-85.274482L158.896552 581.914483 52.965517 494.344828l105.931035-87.569656h370.75862V582.62069a17.655172 17.655172 0 0 0 17.655173 17.655172h189.616552z" fill="#B19046" /><path d="M759.172414 971.034483V35.310345a35.416276 35.416276 0 0 0-35.310345-35.310345H194.206897a35.416276 35.416276 0 0 0-35.310345 35.310345v935.724138h600.275862z" fill="#F9EAB0" /><path d="M759.172414 581.914483l-174.433104 144.066207-103.282758 85.274482c-13.011862 10.769655-31.832276 10.769655-44.844138 0l-103.282759-85.274482L158.896552 581.914483 52.965517 494.344828v476.689655a52.965517 52.965517 0 0 0 52.965517 52.965517h706.206897a52.965517 52.965517 0 0 0 52.965517-52.965517V494.344828l-105.931034 87.569655z" fill="#E4C05C" /><path d="M282.482759 123.586207m-52.965518 0a52.965517 52.965517 0 1 0 105.931035 0 52.965517 52.965517 0 1 0-105.931035 0Z" fill="#FF5364" /><path d="M564.965517 88.275862h-17.655172a17.655172 17.655172 0 0 1 0-35.310345h17.655172a17.655172 17.655172 0 0 1 0 35.310345zM688.551724 88.275862h-52.965517a17.655172 17.655172 0 0 1 0-35.310345h52.965517a17.655172 17.655172 0 0 1 0 35.310345zM600.275862 141.241379h-105.931034a17.655172 17.655172 0 0 1 0-35.310345h105.931034a17.655172 17.655172 0 0 1 0 35.310345zM688.551724 141.241379h-17.655172a17.655172 17.655172 0 0 1 0-35.310345h17.655172a17.655172 17.655172 0 0 1 0 35.310345zM688.551724 194.206897h-105.931034a17.655172 17.655172 0 0 1 0-35.310345h105.931034a17.655172 17.655172 0 0 1 0 35.310345z" fill="#2C3E50" /><path d="M529.655172 317.793103m17.655173 0l406.068965 0q17.655172 0 17.655173 17.655173l0 247.172414q0 17.655172-17.655173 17.655172l-406.068965 0q-17.655172 0-17.655173-17.655172l0-247.172414q0-17.655172 17.655173-17.655173Z" fill="#2C3E50" /><path d="M635.586207 423.724138m-35.310345 0a35.310345 35.310345 0 1 0 70.62069 0 35.310345 35.310345 0 1 0-70.62069 0Z" fill="#FF5364" /><path d="M776.827586 406.068966h-17.655172a17.655172 17.655172 0 0 1 0-35.310345h17.655172a17.655172 17.655172 0 0 1 0 35.310345zM900.413793 406.068966h-70.62069a17.655172 17.655172 0 0 1 0-35.310345h70.62069a17.655172 17.655172 0 0 1 0 35.310345zM847.448276 476.460138h-123.586207a17.655172 17.655172 0 0 1 0-35.310345h123.586207a17.655172 17.655172 0 0 1 0 35.310345zM900.413793 476.477793a17.549241 17.549241 0 0 1-12.535172-5.12 20.48 20.48 0 0 1-3.707587-5.843862 14.777379 14.777379 0 0 1-1.412413-6.69131 17.655172 17.655172 0 0 1 30.190345-12.535173 16.331034 16.331034 0 0 1 3.707586 5.826207 16.595862 16.595862 0 0 1 0 13.400276 15.801379 15.801379 0 0 1-9.533793 9.533793 14.81269 14.81269 0 0 1-6.708966 1.430069z" fill="#E6E7E8" /><path d="M850.096552 1007.933793A52.788966 52.788966 0 0 1 812.137931 1024H105.931034a52.788966 52.788966 0 0 1-37.95862-16.066207l265.357241-281.953103 103.282759 85.274482c13.011862 10.769655 31.832276 10.769655 44.844138 0l103.282758-85.274482 265.357242 281.953103z" fill="#B19046" /></svg>
|
After Width: | Height: | Size: 3.2 KiB |
1
ruoyi-ui/src/assets/icons/svg/notebook.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#F1F3F7" /><path d="M169.757183 70.219946h659.941628v884.237697H169.757183z" fill="#0090FF" /><path d="M829.698811 134.987009v156.122964h55.222507V190.209516a54.993293 54.993293 0 0 0-55.222507-55.222507z" fill="#F0582F" /><path d="M829.698811 289.746752h55.222507v156.122964h-55.222507z" fill="#FBD303" /><path d="M829.698811 445.188106h55.222507v156.122964h-55.222507z" fill="#73D658" /><path d="M829.698811 601.309059v156.122964a54.993293 54.993293 0 0 0 55.222507-55.222507v-100.900457h-55.222507z" fill="#4B5AA7" /><path d="M220.208416 154.076122h34.770174v66.130284h-34.770174z" fill="#333842" /><path d="M139.078682 169.757183h98.172005v34.088562H139.078682z" fill="#FCFCFD" /><path d="M220.208416 316.33559h34.770174v66.130284h-34.770174z" fill="#333842" /><path d="M139.078682 332.698261h98.172005v34.088563H139.078682z" fill="#FCFCFD" /><path d="M220.208416 479.274658h34.770174v66.130284h-34.770174z" fill="#333842" /><path d="M139.078682 494.955719h98.172005v34.088562H139.078682z" fill="#FCFCFD" /><path d="M220.208416 641.534126h34.770174v66.130284h-34.770174z" fill="#333842" /><path d="M139.078682 657.213176h98.172005v34.088563H139.078682z" fill="#FCFCFD" /><path d="M220.208416 803.791584h34.770174v66.130283h-34.770174z" fill="#333842" /><path d="M139.078682 820.154255h98.172005v34.088562H139.078682zM357.921867 316.33559h350.422143v237.932298H357.921867z" fill="#FCFCFD" /><path d="M433.596708 379.739432h199.072462v27.270448H433.596708zM433.596708 463.595608h199.072462v27.270448H433.596708z" fill="#DEDEDF" /></svg>
|
After Width: | Height: | Size: 1.8 KiB |
1
ruoyi-ui/src/assets/icons/svg/notebook_1.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M0 241.003303v709.973013h443.733406c0 37.702481 30.565206 68.267687 68.267687 68.267687 37.702481 0 68.267687-30.565206 68.267687-68.267687h443.733407V241.003303H0z" fill="#64798A" /><path d="M62.776971 206.08226h898.443872v681.668819H62.776971z" fill="#EBF0F3" /><path d="M199.773731 80.012266l354.887013 242.000423v565.734017l-341.237849-135.004709z" fill="#E1E6E9" /><path d="M554.660744 214.168548L398.19173 4.755997v654.333317l156.469014 228.657392z" fill="#D5D6DB" /><path d="M789.318346 206.077887v171.008151l51.439111-27.307075 44.133464 27.307075V206.077887z" fill="#E56353" /></svg>
|
After Width: | Height: | Size: 859 B |
1
ruoyi-ui/src/assets/icons/svg/notebook_2.svg
Normal file
After Width: | Height: | Size: 22 KiB |
1
ruoyi-ui/src/assets/icons/svg/paper-plane.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M0 57.824l662.338 838.966 58.876-199.756z" fill="#C6CBCB" /><path d="M462.94 468.128l-45.466 118.498 244.864 310.164 58.876-199.756z" fill="#D672AD" /><path d="M662.338 896.79l-60.976-149.292L0 57.824l534.078 733.83z" fill="#D1D5D5" /><path d="M601.362 747.498L256.524 966.174 0 57.824zM721.214 697.034L0 57.824l1024 506.742z" fill="#E2E5E7" /><path d="M365.292 476.764l-117.786 457.484 9.018 31.926 345.166-218.938zM981.854 543.712L462.94 468.128 720.964 697.88 1024 564.566z" fill="#EA8EBC" /><path d="M365.292 476.764l-117.786 457.484 135.096-437.678zM462.94 468.128l23.012 20.492 495.902 55.092z" fill="#D672AD" /><path d="M601.69 747.236l-68.374 43.372 52.326 43.312z" fill="#C6CBCB" /><path d="M25.428 147.868l20.584-37.276L0 57.824zM55.82 107.296l46.462 1.144L0 57.824z" fill="#EA8EBC" /></svg>
|
After Width: | Height: | Size: 1.0 KiB |
1
ruoyi-ui/src/assets/icons/svg/print.svg
Normal file
After Width: | Height: | Size: 5.4 KiB |
1
ruoyi-ui/src/assets/icons/svg/setup.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M720.36316 371.018l-56.188-172.934c-4.654-14.322-20.036-22.16-34.358-17.506l-78.07 25.366c-7.25 2.356-15.224 0.726-20.912-4.346a256.276 256.276 0 0 0-41.218-29.96c-6.576-3.842-10.58-10.922-10.58-18.538V71.03c0-15.058-12.208-27.266-27.266-27.266h-181.834c-15.058 0-27.266 12.208-27.266 27.266v82.114c0 7.614-4.002 14.69-10.576 18.534a256.258 256.258 0 0 0-41.168 29.934c-5.69 5.074-13.664 6.704-20.916 4.348l-78.12-25.382c-14.322-4.654-29.704 3.184-34.356 17.506L1.34316 371.016c-4.654 14.322 3.184 29.704 17.506 34.356l78.05 25.36c7.252 2.356 12.754 8.364 14.366 15.816a253.468 253.468 0 0 0 15.718 48.46c3.072 6.984 2.162 15.076-2.322 21.248l-48.22 66.37c-8.852 12.182-6.15 29.234 6.032 38.084l147.108 106.882c12.182 8.852 29.234 6.15 38.086-6.032l48.188-66.326c4.484-6.17 11.894-9.538 19.484-8.776 8.404 0.844 16.926 1.284 25.552 1.284 8.604 0 17.104-0.44 25.486-1.28 7.588-0.76 14.998 2.606 19.48 8.776l48.184 66.32c8.852 12.182 25.902 14.884 38.086 6.032l147.108-106.882c12.182-8.852 14.882-25.902 6.032-38.084l-48.176-66.308c-4.486-6.174-5.394-14.268-2.32-21.252a253.424 253.424 0 0 0 15.75-48.544c1.612-7.454 7.114-13.46 14.368-15.816l77.968-25.334c14.322-4.65 22.16-20.032 17.506-34.352z m-359.472 120.706c-54.924 0-99.448-44.524-99.448-99.448s44.524-99.448 99.448-99.448 99.448 44.524 99.448 99.448-44.526 99.448-99.448 99.448z" fill="#5B6EA2" /><path d="M360.89116 516.228c-68.346 0-123.952-55.604-123.952-123.952s55.604-123.952 123.952-123.952 123.952 55.604 123.952 123.952-55.606 123.952-123.952 123.952z m0-198.894c-41.324 0-74.944 33.62-74.944 74.944s33.618 74.944 74.944 74.944 74.944-33.618 74.944-74.944-33.62-74.944-74.944-74.944z" fill="#86DBD5" /><path d="M335.33916 646.46c8.404 0.844 16.926 1.284 25.552 1.284 8.604 0 17.104-0.44 25.486-1.278 7.588-0.76 14.998 2.606 19.48 8.776l48.184 66.32c8.852 12.182 25.902 14.884 38.086 6.032l74.012-53.772c-121.448-49.224-191.894-126.576-231.428-211.328-28.45-10.642-48.762-38.098-48.762-70.216a74.514 74.514 0 0 1 13.154-42.348c-23.962-126.424-1.346-249.502 6.73-306.166h-35.896c-15.058 0-27.266 12.208-27.266 27.266v82.114c0 7.614-4.002 14.69-10.576 18.536a256.152 256.152 0 0 0-41.166 29.934c-5.69 5.074-13.664 6.704-20.916 4.348L91.89116 180.578c-14.322-4.654-29.704 3.184-34.356 17.506L1.34316 371.016c-4.654 14.322 3.184 29.704 17.506 34.356l78.05 25.36c7.252 2.356 12.754 8.364 14.366 15.816a253.468 253.468 0 0 0 15.718 48.46c3.072 6.984 2.162 15.076-2.322 21.248l-48.22 66.37c-8.852 12.182-6.15 29.234 6.032 38.084l147.108 106.882c12.182 8.852 29.234 6.15 38.086-6.032l48.188-66.326c4.484-6.168 11.894-9.536 19.484-8.774z" opacity=".1" /><path d="M1004.51916 274.936l-69.236-69.236c-25.976-25.976-68.09-25.976-94.066 0L576.30116 470.614a33.62 33.62 0 0 0-9.412 29.166l2.754 16.948a41.288 41.288 0 0 1-11.558 35.818l-25.652 25.652 99.586 99.586 25.652-25.652a41.286 41.286 0 0 1 35.818-11.558l16.948 2.754a33.62 33.62 0 0 0 29.166-9.412L1004.51916 369c25.976-25.976 25.976-68.09 0-94.064z" fill="#F7B96D" /><path d="M667.65916 542.558c-12.176-12.176-12.176-31.92 0-44.096l197.396-197.396c12.176-12.176 31.92-12.176 44.096 0 12.176 12.176 12.176 31.92 0 44.096l-197.396 197.396c-12.176 12.176-31.918 12.176-44.096 0z" fill="#FDE27C" /><path d="M657.67116 652.132a41.274 41.274 0 0 1 31.768-11.996c-59.072-47.372-67.294-184.166 2.842-285.502l-115.98 115.98a33.62 33.62 0 0 0-9.412 29.166l2.754 16.948a41.288 41.288 0 0 1-11.558 35.818l-25.652 25.652 99.586 99.586 25.652-25.652z" opacity=".1" /><path d="M402.00116 852.312l146.338-146.338-44.096-44.096-146.338 146.338a45.4 45.4 0 0 1-15.862 10.294l-68.064 26.086a37.556 37.556 0 0 0-22.032 22.738l-20.978 60.356a17.81 17.81 0 0 0 4.23 18.444l28.884 28.884a17.816 17.816 0 0 0 18.444 4.23l60.356-20.978a37.556 37.556 0 0 0 22.738-22.032l26.086-68.064a45.4 45.4 0 0 1 10.294-15.862z" fill="#495059" /><path d="M504.23916 661.878l44.094 44.094-29.092 29.094-44.094-44.096z" opacity=".1" /><path d="M590.08516 747.722l-127.59-127.59c-9.862-9.862-9.862-25.85 0-35.712l20.222-20.222c9.862-9.862 25.85-9.862 35.712 0l127.59 127.59c9.862 9.862 9.862 25.85 0 35.712l-20.222 20.222c-9.86 9.862-25.85 9.862-35.712 0z" fill="#FDE27C" /><path d="M518.43116 564.198c-9.862-9.862-25.85-9.862-35.712 0l-20.222 20.222c-9.862 9.862-9.862 25.85 0 35.712l100.512 100.512c-38.162-57.234-28.442-108.238-16.758-128.628l-27.82-27.818z" opacity=".1" /></svg>
|
After Width: | Height: | Size: 4.5 KiB |
1
ruoyi-ui/src/assets/icons/svg/telegram.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 156.514L0 153.822l188.52 187.374-49.272 338.52 210.626-80.504 170.57 270.966L1024 156.514zM264.49 419.822L139.248 679.716l103.034-324.986L1024 156.514 264.49 419.822z" fill="#85D3FD" /><path d="M1024 156.514L246 418.116l-106.752 261.6 210.626-80.504 170.57 270.966L1024 156.514z" fill="#22B8F9" /><path d="M246 418.116l-106.752 261.6L188.52 341.194 1024 156.514z" fill="#0082FF" /><path d="M349.874 599.212L246 418.116l-106.752 261.6z" fill="#00317E" /><path d="M520.666 331.01v538.854L1024 156.514z" fill="#85D3FD" /><path d="M520.666 284.142L1024 156.514l-503.334-1.324z" fill="#22B8F9" /><path d="M520.666 325.76l-0.222 544.418L1024 156.514z" fill="#0082FF" /><path d="M520.666 267.774v57.986L1024 156.514z" fill="#00317E" /><path d="M766.79 340.76c-119.596 0-216.894 97.298-216.894 216.896 0 119.596 97.298 216.894 216.894 216.894 119.598 0 216.896-97.298 216.896-216.894 0-119.598-97.3-216.896-216.896-216.896z" fill="#FFDA2D" /><path d="M766.79 340.76v433.79c119.598 0 216.896-97.298 216.896-216.894 0-119.598-97.3-216.896-216.896-216.896z" fill="#FDBF00" /><path d="M804.27 472.81v173.226h-58.402v-129.178h-29.696v-44.048h88.098z" fill="#FC1D5A" /><path d="M766.79 472.81h37.48v173.226h-37.48z" fill="#DD0057" /></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
ruoyi-ui/src/assets/icons/svg/test.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="120px" height="120.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M992 512c0 265.100625-214.899375 480-480 480S32 777.100625 32 512 246.899375 32 512 32s480 214.899375 480 480z m0 0" fill="#017296" /><path d="M541.685 330.125v-20.625c0-2.071875 1.678125-3.75 3.75-3.75H770.75c2.071875 0 3.75 1.678125 3.75 3.75v20.625c0 2.071875-1.678125 3.75-3.75 3.75H545.435c-2.06625 0-3.75-1.678125-3.75-3.75zM827 718.25H545.435c-2.071875 0-3.75 1.678125-3.75 3.75v20.625c0 2.071875 1.678125 3.75 3.75 3.75H827c2.071875 0 3.75-1.678125 3.75-3.75v-20.625c0-2.071875-1.678125-3.75-3.75-3.75z m-281.565-28.125H770.75c2.071875 0 3.75-1.678125 3.75-3.75v-20.625c0-2.071875-1.678125-3.75-3.75-3.75H545.435c-2.071875 0-3.75 1.678125-3.75 3.75v20.625c0 2.071875 1.68375 3.75 3.75 3.75zM827 605.75H545.435c-2.071875 0-3.75 1.678125-3.75 3.75v20.625c0 2.071875 1.678125 3.75 3.75 3.75H827c2.071875 0 3.75-1.678125 3.75-3.75v-20.625c0-2.071875-1.678125-3.75-3.75-3.75z m0-243.75H545.435c-2.071875 0-3.75 1.678125-3.75 3.75v20.625c0 2.071875 1.678125 3.75 3.75 3.75H827c2.071875 0 3.75-1.678125 3.75-3.75v-20.625c0-2.071875-1.678125-3.75-3.75-3.75z m0-112.5H545.435c-2.071875 0-3.75 1.678125-3.75 3.75v20.625c0 2.071875 1.678125 3.75 3.75 3.75H827c2.071875 0 3.75-1.678125 3.75-3.75v-20.625c0-2.071875-1.678125-3.75-3.75-3.75z m0 0" fill="#6CAAC9" /><path d="M315.125 554.1875c-74.956875 0-135.9375 60.980625-135.9375 135.9375s60.980625 135.9375 135.9375 135.9375 135.9375-60.980625 135.9375-135.9375-60.980625-135.9375-135.9375-135.9375z m0 243.75c-59.450625 0-107.8125-48.361875-107.8125-107.8125s48.361875-107.8125 107.8125-107.8125 107.8125 48.361875 107.8125 107.8125-48.361875 107.8125-107.8125 107.8125z m0-328.125c74.956875 0 135.9375-60.980625 135.9375-135.9375S390.081875 197.9375 315.125 197.9375 179.1875 258.918125 179.1875 333.875s60.980625 135.9375 135.9375 135.9375z m0-243.75c59.450625 0 107.8125 48.361875 107.8125 107.8125s-48.361875 107.8125-107.8125 107.8125-107.8125-48.361875-107.8125-107.8125 48.361875-107.8125 107.8125-107.8125z m0 0" fill="#88B9D3" /><path d="M947.13125 182.93l-53.034375 53.034375c-7.31625 7.32375-19.18875 7.32375-26.5125 0l-79.54875-79.54875c-7.32375-7.32375-7.32375-19.19625 0-26.5125l53.034375-53.034375c7.31625-7.325625 19.18875-7.325625 26.5125 0l79.54875 79.546875c7.325625 7.325625 7.325625 19.198125 0 26.514375z m0 0" fill="#024C67" /><path d="M514.240625 208.40375L324.575 398.06375a8.265 8.265 0 0 1-11.69625 0l-82.726875-82.704375a4.138125 4.138125 0 0 1 0-5.844375l23.3925-23.4a4.145625 4.145625 0 0 1 5.851875 0l56.39625 56.394375a4.125 4.125 0 0 0 5.84625 0l163.359375-163.35c1.610625-1.6125 4.231875-1.6125 5.844375 0L514.23125 202.55c1.62 1.618125 1.62 4.24125 0.0075 5.851875zM297.576875 673.39625a37.468125 37.468125 0 0 0-10.9875 26.5125v33.75c0 2.07375 1.678125 3.75 3.75 3.75h33.75c9.946875 0 19.48125-3.946875 26.5125-10.985625l42.050625-42.046875-53.02875-53.02875z m0 0" fill="#FDED32" /><path d="M933.875 196.18625L474.910625 655.1525A37.4775 37.4775 0 0 1 455.75 665.405l-53.64375 10.730625a28.0875 28.0875 0 0 1-25.378125-7.68375l-21.1875-21.1875a28.0875 28.0875 0 0 1-7.67625-25.3725L358.5875 568.25a37.50375 37.50375 0 0 1 10.2525-19.160625L827.80625 90.125z m0 0" fill="#FC9302" /><path d="M933.875 196.18625L474.910625 655.1525A37.4775 37.4775 0 0 1 455.75 665.405l-53.64375 10.730625a28.0875 28.0875 0 0 1-25.378125-7.68375l13.681875-68.3775a37.471875 37.471875 0 0 1 10.25625-19.168125l458.9625-458.964375z m0 0" fill="#FDBF43" /><path d="M474.910625 655.1525l-29.22375 29.22375c-14.641875 14.6475-38.386875 14.6475-53.034375 0l-26.514375 26.52-53.034375-53.034375 26.52-26.5125c-14.6475-14.649375-14.6475-38.394375 0-53.03625l29.22375-29.22375z m0 0" fill="#024C67" /></svg>
|
After Width: | Height: | Size: 3.8 KiB |
1
ruoyi-ui/src/assets/icons/svg/test_1.svg
Normal file
After Width: | Height: | Size: 5.3 KiB |
@ -9,6 +9,11 @@
|
||||
</div>
|
||||
<div class="mid">
|
||||
<!--右侧div内容-->
|
||||
<svg-icon icon-class="eye-open" />
|
||||
<br/>
|
||||
<svg-icon icon-class="notebook_1" />
|
||||
<br/>
|
||||
<svg-icon icon-class="notebook_2" />
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
<div class="aside-title" @click="gorecycle"><i class="el-icon-delete-solid" style="color: red"></i><span>垃圾桶</span></div>
|
||||
<div class="aside-title" @click="importHtml"><i class="el-icon-s-platform"></i><span>导入书签</span></div>
|
||||
<div class="aside-title"><i class="el-icon-s-comment"></i><span>意见反馈</span></div>
|
||||
<!-- <div class="aside-title" @click="ceshi"><i class="el-icon-s-comment"></i><span>测试页面</span></div>-->
|
||||
<div class="aside-title" @click="ceshi"><i class="el-icon-s-comment"></i><span>测试页面</span></div>
|
||||
<!-- <div class="aside-title" @click="NqEdit"><i class="el-icon-s-comment"></i><span>NqQuillEdit编辑器</span></div>-->
|
||||
<div class="aside-title " style="margin-bottom: 100px"><i class="el-icon-s-grid"></i><span>工具箱</span></div>
|
||||
|
||||
@ -120,26 +120,23 @@
|
||||
<div class="labelname">菜单名称</div>
|
||||
<el-input class="custom-input" v-model="form.menuName" placeholder="请输入菜单名称"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="menuIcon">
|
||||
<div class="labelname">菜单图标</div>
|
||||
<el-input class="custom-input" v-model="form.menuIcon" placeholder="请输入菜单图标"/>
|
||||
<br/>
|
||||
<el-avatar :src="form.menuIcon" style="float: left"></el-avatar>
|
||||
<el-input class="custom-input" style="float: left;margin-left:5px;width: 90%" v-model="form.menuIcon" placeholder="请输入远程图片地址(建议高:120宽:120)"/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="parentId">
|
||||
<div class="labelname">上级菜单</div>
|
||||
<treeselect class="menutreeselect" v-model="form.parentId" :options="menuOptions" :normalizer="normalizer"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- <el-form-item prop="menuOrder">-->
|
||||
<!-- <div class="labelname">排序</div>-->
|
||||
<!-- <el-input class="custom-input" v-model="form.menuOrder" placeholder="请输入菜单排序" />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item prop="menuOrder">
|
||||
<div class="labelname">排序(小到大)</div>
|
||||
<br/>
|
||||
<el-input-number v-model="form.menuOrder" placeholder="计数器"></el-input-number>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item prop="menuOrder">-->
|
||||
<!-- <div class="labelname">排序(小到大)</div>-->
|
||||
<!-- <br/>-->
|
||||
<!-- <el-input-number v-model="form.menuOrder" placeholder="计数器"></el-input-number>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
|
||||
</el-form>
|
||||
@ -391,6 +388,10 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**图片失败显示**/
|
||||
errorHandler() {
|
||||
return true
|
||||
},
|
||||
/**粒子球背景特效**/
|
||||
backgroundparticle: function () {
|
||||
!function () {
|
||||
@ -1037,7 +1038,11 @@
|
||||
this.msgError("不能将上级菜单设置为本身");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("this.form.parentId"+this.form.parentId)
|
||||
if (this.form.parentId!=0&&(this.form.parentId == null||this.form.parentId == ''||'undefined'==this.form.parentId)) {
|
||||
this.msgError("请选择上级菜单");
|
||||
return;
|
||||
}
|
||||
|
||||
updateMenu(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
|
@ -40,6 +40,11 @@ public class SqMenu
|
||||
@Column(name = "menu_url")
|
||||
private String menuUrl;
|
||||
|
||||
/** 目录串 */
|
||||
@Excel(name = "目录串")
|
||||
@Column(name = "menu_uplink_series")
|
||||
private String menuUplinkSeries;
|
||||
|
||||
/** 菜单图标 */
|
||||
@Excel(name = "菜单图标")
|
||||
@Column(name = "menu_order")
|
||||
@ -69,6 +74,14 @@ public class SqMenu
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public String getMenuUplinkSeries() {
|
||||
return menuUplinkSeries;
|
||||
}
|
||||
|
||||
public void setMenuUplinkSeries(String menuUplinkSeries) {
|
||||
this.menuUplinkSeries = menuUplinkSeries;
|
||||
}
|
||||
|
||||
public Integer getBookmarkCount() {
|
||||
return bookmarkCount;
|
||||
}
|
||||
@ -169,6 +182,7 @@ public class SqMenu
|
||||
.append("bookmarkCount", getBookmarkCount())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("menuUplinkSeries", getMenuUplinkSeries())
|
||||
.toString();
|
||||
}
|
||||
public SqMenu(){
|
||||
@ -181,4 +195,9 @@ public class SqMenu
|
||||
this.parentId = parentId;
|
||||
this.menuIcon = menuIcon;
|
||||
}
|
||||
|
||||
public SqMenu( Long menuId,String menuUplinkSeries) {
|
||||
this.menuId = menuId;
|
||||
this.menuUplinkSeries = menuUplinkSeries;
|
||||
}
|
||||
}
|
||||
|
@ -100,4 +100,30 @@ public interface SqMenuMapper extends MyMapper<SqMenu>
|
||||
* @return
|
||||
*/
|
||||
public void addMenu(@Param("userId")Long userID, @Param("title")String title, @Param("parentId")Long parentId);
|
||||
|
||||
/**
|
||||
* 查询空目录串的目录
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public List<SqMenu> selectbymenuUplinkSeries();
|
||||
|
||||
/**
|
||||
* 根据目录串查询下级的所有menuid
|
||||
*
|
||||
* @param menuUplinkSeries 目录串
|
||||
* @param menuId 为null表示不包含menuid
|
||||
* @return
|
||||
*/
|
||||
public List<SqMenu> listByMenuUplinkSeriesAndMenu(@Param("menuUplinkSeries")String menuUplinkSeries, @Param("menuId")Long menuId);
|
||||
|
||||
/**
|
||||
* 根据目录串查询下级的所有书签数量
|
||||
*
|
||||
* @param menuUplinkSeries 目录串
|
||||
* @param menuId 为null表示不包含menuid
|
||||
* @return
|
||||
*/
|
||||
public int countByMenuUplinkSeriesAndMenu(@Param("menuUplinkSeries")String menuUplinkSeries, @Param("menuId")Long menuId);
|
||||
}
|
||||
|
@ -125,4 +125,44 @@ public interface ISqMenuService
|
||||
* @return
|
||||
*/
|
||||
public Long noRepetition(String state, Long userID, Long time);
|
||||
|
||||
|
||||
/**
|
||||
* 根据menuId 生成向上目录串
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public String addMenuUplinkSeries(Long menuId);
|
||||
|
||||
/**
|
||||
* 根据目录串查询下级的所有menuid
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public List<SqMenu> listByMenuUplinkSeriesAndMenu(String menuUplinkSeries,Long menuId);
|
||||
/**
|
||||
* 根据目录串查询下级的所有书签数量
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public int countByMenuUplinkSeriesAndMenu(String menuUplinkSeries, Long menuId);
|
||||
|
||||
/**
|
||||
* 批量添加上级 目录的书签数量
|
||||
*
|
||||
* @param menuId
|
||||
* @return
|
||||
*/
|
||||
void addMenuByCountAndMenuUplinkSeries(Long menuId);
|
||||
|
||||
/**
|
||||
* 批量减少上级 目录的书签数量
|
||||
*
|
||||
* @param sqMenu
|
||||
* @return
|
||||
*/
|
||||
void reduceMenuByCountAndMenuUplinkSeries(SqMenu sqMenu);
|
||||
}
|
||||
|
@ -1,11 +1,16 @@
|
||||
package com.ruoyi.bookmark.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.redis.RedisUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
|
||||
import org.apache.commons.beanutils.ConvertUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bookmark.mapper.SqMenuMapper;
|
||||
@ -123,7 +128,19 @@ public class SqMenuServiceImpl implements ISqMenuService
|
||||
public int insertSqMenu(SqMenu sqMenu)
|
||||
{
|
||||
sqMenu.setCreateTime(DateUtils.getNowDate());
|
||||
return sqMenuMapper.insertSqMenu(sqMenu);
|
||||
String parentId=sqMenu.getParentId().toString();
|
||||
int i = sqMenuMapper.insertSqMenu(sqMenu);
|
||||
//更新新的目录串
|
||||
if (i!=0){
|
||||
String menuUplinkSeries ="";
|
||||
if("0".equals(parentId)){
|
||||
menuUplinkSeries = ","+sqMenu.getMenuId()+",";
|
||||
}else{
|
||||
menuUplinkSeries = addMenuUplinkSeries(sqMenu.getMenuId());
|
||||
}
|
||||
sqMenuMapper.updateSqMenu(new SqMenu(sqMenu.getMenuId(),menuUplinkSeries));
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,6 +205,34 @@ public class SqMenuServiceImpl implements ISqMenuService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*根据目录 生成向上目录串
|
||||
*
|
||||
* @param menuId
|
||||
* @return java.lang.String
|
||||
*/
|
||||
@Override
|
||||
public String addMenuUplinkSeries(Long menuId) {
|
||||
StringBuilder menuus=new StringBuilder();
|
||||
SqMenu sqMenu = sqMenuMapper.selectSqMenuById(menuId);
|
||||
Long parentId = sqMenu.getParentId();
|
||||
//所有的上级目录ID
|
||||
List<Long> list= new ArrayList<>();
|
||||
list.add(menuId);
|
||||
while (parentId.intValue()!=0){
|
||||
sqMenu = sqMenuMapper.selectSqMenuById(parentId);
|
||||
list.add(sqMenu.getMenuId());
|
||||
parentId=sqMenu.getParentId();
|
||||
}
|
||||
//倒序
|
||||
for (int i=list.size();i>0;i--){
|
||||
menuus.append(",").append(list.get(i-1));
|
||||
}
|
||||
menuus.append(",");
|
||||
return menuus.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量减少目录下书签数量
|
||||
@ -212,4 +257,42 @@ public class SqMenuServiceImpl implements ISqMenuService
|
||||
public int updateCountAdd(Long[] menuIds,int icount){
|
||||
return sqMenuMapper.updateCountAdd(menuIds,icount);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SqMenu> listByMenuUplinkSeriesAndMenu(String menuUplinkSeries, Long menuId) {
|
||||
return sqMenuMapper.listByMenuUplinkSeriesAndMenu(menuUplinkSeries,menuId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countByMenuUplinkSeriesAndMenu(String menuUplinkSeries, Long menuId) {
|
||||
return sqMenuMapper.countByMenuUplinkSeriesAndMenu(menuUplinkSeries,menuId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addMenuByCountAndMenuUplinkSeries(Long menuId) {
|
||||
//修改 需要查最新目录串
|
||||
SqMenu sqMenu = sqMenuMapper.selectSqMenuById(menuId);
|
||||
if (!sqMenu.getParentId().toString().equals("0")){
|
||||
//所有的上级ID
|
||||
String[] arrayMenuID = sqMenu.getMenuUplinkSeries().replace(menuId+",","").split(",");
|
||||
Long[] strArrNum = (Long[]) ConvertUtils.convert(arrayMenuID,Long.class);
|
||||
//所有上级 添加书签数量
|
||||
sqMenuMapper.updateCountAdd(strArrNum,sqMenu.getBookmarkCount());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reduceMenuByCountAndMenuUplinkSeries(SqMenu sqMenu) {
|
||||
if (!sqMenu.getParentId().toString().equals("0")){
|
||||
//所有的上级ID
|
||||
String[] arrayMenuID = sqMenu.getMenuUplinkSeries().replace(sqMenu.getMenuId()+",","").split(",");
|
||||
//转换
|
||||
Long[] strArrNum = (Long[]) ConvertUtils.convert(arrayMenuID,Long.class);
|
||||
//所有上级 减少书签数量
|
||||
sqMenuMapper.updateCountReduce(strArrNum,sqMenu.getBookmarkCount());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="bookmarkCount" column="bookmark_count" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="menuUplinkSeries" column="menu_uplink_series" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSqMenuVo">
|
||||
select menu_id, user_id, menu_name, menu_url, menu_icon, parent_id, menu_order,bookmark_count,create_time,update_time from sq_menu
|
||||
select menu_id, user_id, menu_name, menu_url, menu_icon, parent_id, menu_order,bookmark_count,create_time,update_time,menu_uplink_series from sq_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectSqMenuList" parameterType="SqMenu" resultMap="SqMenuResult">
|
||||
@ -34,6 +35,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order BY menu_order ASC
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectbymenuUplinkSeries" resultMap="SqMenuResult">
|
||||
select menu_id,user_id from sq_menu where menu_uplink_series is null
|
||||
</select>
|
||||
<select id="listByMenuUplinkSeriesAndMenu" resultMap="SqMenuResult">
|
||||
select menu_id from sq_menu where menu_uplink_series like '#{menuUplinkSeries}%'
|
||||
<if test="menuId != null "> and menu_id != #{menuId}</if>
|
||||
</select>
|
||||
<select id="countByMenuUplinkSeriesAndMenu" parameterType="java.lang.Integer">
|
||||
select sum(bookmark_count) from sq_menu where menu_uplink_series like '#{menuUplinkSeries}%'
|
||||
<if test="menuId != null "> and menu_id != #{menuId}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSqMenuById" parameterType="Long" resultMap="SqMenuResult">
|
||||
<include refid="selectSqMenuVo"/>
|
||||
@ -75,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="menuOrder != null">menu_order = #{menuOrder},</if>
|
||||
<if test="bookmarkCount != null">bookmark_count = #{bookmarkCount},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="menuUplinkSeries != null">menu_uplink_series = #{menuUplinkSeries},</if>
|
||||
</trim>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|