From ba10d81bf39a2e4bc3b1215841984210f96f92f6 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 9 Dec 2024 11:13:28 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B1=87=E8=81=94?= =?UTF-8?q?=E9=80=9AdistributorId=20=20=E5=8E=9F=E5=8F=82=E6=95=B0aNId4A3X?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAorjuOND7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/src/main/resources/prod/commonConfig.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/resources/prod/commonConfig.properties b/service/src/main/resources/prod/commonConfig.properties index a6f0573..bfd98f2 100644 --- a/service/src/main/resources/prod/commonConfig.properties +++ b/service/src/main/resources/prod/commonConfig.properties @@ -31,7 +31,7 @@ huiliantongUrl=http://hltgz.com:4010/api/v2/execute.json huiliantongAppNo=guizhouhuilt huiliantongAppkey=e0ja2Ex%2BmQ2hIPF6x%2BHA%3D huiliantongAppsecret=52662415DDCE55C7BA34223BCF53877A -huiliantongSinopecDistributorId=aNId4A3X +huiliantongSinopecDistributorId=orjuOND7 huiliantongDistributorId=1JnL8YMV huiliantongSinopecUrl=fuelCoupons From f0bf0dbdd052d206f8d5c984a64a5eb7f9c7b565 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Mon, 9 Dec 2024 14:46:14 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/SecMenuController.java | 51 ++++++++++++++++--- .../com/hfkj/schedule/JdGoodsSchedule.java | 4 +- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/SecMenuController.java b/bweb/src/main/java/com/bweb/controller/SecMenuController.java index 9f68e21..019a9d0 100644 --- a/bweb/src/main/java/com/bweb/controller/SecMenuController.java +++ b/bweb/src/main/java/com/bweb/controller/SecMenuController.java @@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -168,10 +169,39 @@ public class SecMenuController { try { // 查询角色菜单权限 - List roleMenuList = secRoleMenuRelService.getRelListByRole(roleId); + Map roleMenu = secMenuService.queryRoleMenu(roleId, SecMenuTypeEnum.type1).stream() + .collect(Collectors.toMap(SecMenu::getId, Function.identity())); - return ResponseMsgUtil.success(roleMenuList.stream().map(SecRoleMenuRel::getMenuId).collect(Collectors.toList()) - .stream().map(Object::toString).collect(Collectors.toList())); + // 系统菜单叶节点 + List menuLeafList = new ArrayList<>(); + + // 角色菜单叶节点 + List roleLeafList = new ArrayList<>(); + + // 获取全部菜单 + List menuList = secMenuService.getAllList(); + + // 获取最顶层菜单 + List topLevelMenuList = menuList.stream() + .filter(o -> o.getMenuPSid() == null) + .sorted(Comparator.comparing(SecMenu::getMenuSort)) + .collect(Collectors.toList()); + // 递归获取系统菜单叶子节点 + for (SecMenu topLevelMenu : topLevelMenuList) { + if (topLevelMenu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { + recursionMenu(menuList, topLevelMenu.getId(), menuLeafList); + } + } + + // 筛选角色菜单叶节点 + for (String leaf : menuLeafList) { + SecMenu menu = roleMenu.get(Long.parseLong(leaf)); + if (menu != null) { + roleLeafList.add(""+menu.getId()); + } + } + + return ResponseMsgUtil.success(roleLeafList); } catch (Exception e) { log.error("error!",e); @@ -216,7 +246,7 @@ public class SecMenuController { map.put("key", ""+topLevelMenu.getId()); map.put("title", topLevelMenu.getMenuName()); // 获取下级菜单 - map.put("children", recursionMenu(menuList, topLevelMenu.getId())); + map.put("children", recursionMenu(menuList, topLevelMenu.getId(), new ArrayList<>())); mapList.add(map); } } @@ -235,7 +265,13 @@ public class SecMenuController { * @param parentMenuId 父级菜单id * @return */ - public List> recursionMenu(List dataSource, Long parentMenuId) { + /** + * 递归获取菜单 + * @param dataSource 数据源 + * @param parentMenuId 父级菜单id + * @return + */ + public List> recursionMenu(List dataSource, Long parentMenuId, List leaf) { List> mapList = new ArrayList<>(); Map map; @@ -245,12 +281,13 @@ public class SecMenuController { .collect(Collectors.toList()); for (SecMenu menu : collect) { if (menu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { - map = new HashMap<>(); + map = new LinkedHashMap<>(); map.put("key", ""+menu.getId()); map.put("title", menu.getMenuName()); // 获取下级菜单 - List> recursioned = recursionMenu(dataSource, menu.getId()); + List> recursioned = recursionMenu(dataSource, menu.getId(), leaf); if (recursioned.isEmpty()) { + leaf.add(""+menu.getId()); map.put("isLeaf", true); } else { map.put("children", recursioned); diff --git a/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java b/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java index 25e744f..d05cc6a 100644 --- a/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java @@ -37,7 +37,7 @@ public class JdGoodsSchedule { @Resource private JdService jdService; - +/* //每10分钟执行一次 @Scheduled(cron = "0 0/10 * * * ?") public void etcCarMsg() { @@ -48,6 +48,6 @@ public class JdGoodsSchedule { } catch (Exception e) { log.error("HighUserController --> findByUserId() error!", e); } - } + }*/ } From 932a94da6692eedc6f89db67dc9b0460d29e6699 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 9 Dec 2024 14:48:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B1=87=E8=81=94?= =?UTF-8?q?=E9=80=9AdistributorId=20=20=E5=8E=9F=E5=8F=82=E6=95=B0aNId4A3X?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAorjuOND7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hfkj/schedule/JdGoodsSchedule.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java b/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java index d05cc6a..3a41221 100644 --- a/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java @@ -37,17 +37,17 @@ public class JdGoodsSchedule { @Resource private JdService jdService; -/* - //每10分钟执行一次 - @Scheduled(cron = "0 0/10 * * * ?") - public void etcCarMsg() { - try { - - jdService.deleteMsg(); - - } catch (Exception e) { - log.error("HighUserController --> findByUserId() error!", e); - } - }*/ + +// //每10分钟执行一次 +// @Scheduled(cron = "0 0/10 * * * ?") +// public void etcCarMsg() { +// try { +// +// jdService.deleteMsg(); +// +// } catch (Exception e) { +// log.error("HighUserController --> findByUserId() error!", e); +// } +// } } From e89ae0c89a24ab5cb3eac3ad1695e050a317eae5 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Fri, 27 Dec 2024 11:28:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B1=87=E8=81=94?= =?UTF-8?q?=E9=80=9AdistributorId=20=20=E5=8E=9F=E5=8F=82=E6=95=B0aNId4A3X?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAorjuOND7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java b/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java index 0663266..ffd2e66 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java @@ -47,7 +47,7 @@ public interface GoodsMsgMapperExt { " third_id as thirdId," + " sale_num as saleNum" + " FROM" + - " goods_msg where status = 1 " + + " goods_msg where status = 1 and third_id is null" + " and goods_type_parent = #{param.goodsTypeParent} " + " and title like concat('%',#{param.title},'%') " + " and goods_type = #{param.goodsType} " +