From 7ec5a905c58299e35dfb602fdf10f56f330f3aac Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Wed, 23 Oct 2024 23:25:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=B8=9A=E5=8A=A1=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WarnMessageController.java | 9 ++++++++- .../inspection/mapper/WarnMessageMapper.java | 6 ++++++ .../inspection/service/IWarnMessageService.java | 3 +++ .../service/impl/WarnMessageServiceImpl.java | 11 +++++++++++ .../mapper/inspection/InspectionInfoMapper.xml | 4 ++-- .../mapper/inspection/WarnMessageMapper.xml | 11 ++++++++++- sql/增量DB.sql | 1 + .../controller/admin/auth/AuthController.java | 14 +++++++++++++- 8 files changed, 54 insertions(+), 5 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java index 00c2020c..5dd5a138 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/WarnMessageController.java @@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletResponse; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.util.ExcelUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -39,7 +41,12 @@ public class WarnMessageController extends BaseController return success(list); } - + @GetMapping("/pageList") + public CommonResult pageList(WarnMessage warnMessage,Integer pageNo,Integer pageSize) throws Exception { + Page page =new Page(pageNo,pageSize); + IPage list = warnMessageService.pageList(page,warnMessage); + return success(list); + } @PostMapping("/export") public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception { List list = warnMessageService.selectWarnMessageList(warnMessage); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/WarnMessageMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/WarnMessageMapper.java index b090289a..62c39d63 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/WarnMessageMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/WarnMessageMapper.java @@ -4,7 +4,11 @@ import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import cn.iocoder.yudao.module.inspection.entity.WarnMessage; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + /** * warnMsgMapper接口 @@ -31,4 +35,6 @@ public interface WarnMessageMapper extends BaseMapper */ public List selectWarnMessageList(WarnMessage warnMessage); + IPage pageList(Page page,@Param("warnMessage") WarnMessage warnMessage); + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IWarnMessageService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IWarnMessageService.java index 5e26e5a2..a4cecafe 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IWarnMessageService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IWarnMessageService.java @@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.inspection.service; import java.util.List; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import cn.iocoder.yudao.module.inspection.entity.WarnMessage; @@ -28,6 +30,7 @@ public interface IWarnMessageService extends IService * @return warnMsg集合 */ public List selectWarnMessageList(WarnMessage warnMessage) throws Exception; + IPage pageList(Page page,WarnMessage warnMessage) throws Exception; /** * 新增warnMsg diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/WarnMessageServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/WarnMessageServiceImpl.java index e3d1bd92..22884308 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/WarnMessageServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/WarnMessageServiceImpl.java @@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.inspection.service.impl; import java.util.Arrays; import java.util.List; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import cn.iocoder.yudao.util.DateUtils; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; @@ -53,6 +55,15 @@ public class WarnMessageServiceImpl extends ServiceImpl pageList(Page page, WarnMessage warnMessage) throws Exception { + ShopMallPartners partners = partnerService.shopInfo(); + warnMessage.setPartnerId(partners.getPartnerId()); + warnMessage.setIsRead("0"); + IPage warnMessages = baseMapper.pageList(page,warnMessage); + return warnMessages; + } + /** * 新增warnMsg * diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index 95b8d5de..85d4c0a5 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -209,8 +209,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + diff --git a/sql/增量DB.sql b/sql/增量DB.sql index 6c0fb9af..0d3cfeac 100644 --- a/sql/增量DB.sql +++ b/sql/增量DB.sql @@ -1,3 +1,4 @@ --增加封面图字段用来回显首页 ALTER TABLE `system_service_package` ADD COLUMN `cover_img` varchar(255) NULL COMMENT '服务icon' AFTER `menu_ids`; +INSERT INTO `sys_config`(`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `creator`, `create_time`, `updater`, `update_time`, `remark`) VALUES (10, '检测工单', 'inspection_work_order', '

\r\n
\r\n

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n                                              title\r\n
\r\n 地址\r\n \r\n buyAdress\r\n
\r\n 客户名称\r\n \r\n buyName\r\n \r\n 电话\r\n \r\n buyPhone\r\n
\r\n 上线日期\r\n \r\n 车牌\r\n \r\n 车架号\r\n \r\n 检测类型\r\n \r\n 检测项目\r\n \r\n 检测费用\r\n \r\n 优惠金额\r\n \r\n 实收金额\r\n
\r\n timeStr
\r\n
\r\n carNum\r\n \r\n carIdNo\r\n \r\n goodsTitle\r\n \r\n skuName\r\n \r\n goodsPrice
\r\n
\r\n reduceMoney\r\n \r\n realPayMoney\r\n
\r\n                                                   合计:\r\n \r\n goodsPrice\r\n \r\n reduceMoney\r\n \r\n realPayMoney\r\n
\r\n 支付方式\r\n \r\n payType\r\n
\r\n 备注:payRemark\r\n
\r\n 客户:buyName\r\n \r\n 服务顾问:workName\r\n \r\n 收银员:\r\n \r\n workName\r\n
', 'N', '', NULL, '', NULL, NULL); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index bdf9cc09..f9fcd2e9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -19,12 +19,14 @@ import cn.iocoder.yudao.module.system.controller.admin.user.LoginBody; import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; +import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; import cn.iocoder.yudao.module.system.service.permission.MenuService; import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.permission.RoleService; +import cn.iocoder.yudao.module.system.service.service.ServicePackageService; import cn.iocoder.yudao.module.system.service.social.SocialClientService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; import io.swagger.v3.oas.annotations.Operation; @@ -32,6 +34,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -39,6 +42,7 @@ import javax.annotation.Resource; import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; @@ -75,6 +79,8 @@ public class AuthController { private PermissionApi permissionApi; @Resource private RoleApi roleApi; + @Resource + private ServicePackageService servicePackageService; @PostMapping("/login") @@ -185,7 +191,7 @@ public class AuthController { @GetMapping("/get-permission-info") @Operation(summary = "获取登录用户的权限信息") - public CommonResult getPermissionInfo() { + public CommonResult getPermissionInfo(String routeCode) { // 1.1 获得用户信息 AdminUserDO user = userService.getUser(getLoginUserId()); if (user == null) { @@ -202,6 +208,12 @@ public class AuthController { // 1.3 获得菜单列表 Set menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); + //过滤出来当前服务的菜单 + if (StringUtils.isNotEmpty(routeCode)){ + ServicePackageDO servicePackage = servicePackageService.getServicePackage(routeCode); + Set servicePackageMenuIds = servicePackage.getMenuIds(); + menuIds= menuIds.stream().filter(servicePackageMenuIds::contains).collect(Collectors.toSet()); + } List menuList = menuService.getMenuList(menuIds); menuList = menuService.filterDisableMenus(menuList);