首页业务处理

This commit is contained in:
13405411873 2024-10-23 23:25:04 +08:00
parent 8201a54327
commit 7ec5a905c5
8 changed files with 54 additions and 5 deletions

View File

@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletResponse;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.util.ExcelUtil; 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -39,7 +41,12 @@ public class WarnMessageController extends BaseController
return success(list); return success(list);
} }
@GetMapping("/pageList")
public CommonResult pageList(WarnMessage warnMessage,Integer pageNo,Integer pageSize) throws Exception {
Page page =new Page(pageNo,pageSize);
IPage<WarnMessage> list = warnMessageService.pageList(page,warnMessage);
return success(list);
}
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception { public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception {
List<WarnMessage> list = warnMessageService.selectWarnMessageList(warnMessage); List<WarnMessage> list = warnMessageService.selectWarnMessageList(warnMessage);

View File

@ -4,7 +4,11 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.iocoder.yudao.module.inspection.entity.WarnMessage; 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.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* warnMsgMapper接口 * warnMsgMapper接口
@ -31,4 +35,6 @@ public interface WarnMessageMapper extends BaseMapper<WarnMessage>
*/ */
public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage); public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage);
IPage<WarnMessage> pageList(Page page,@Param("warnMessage") WarnMessage warnMessage);
} }

View File

@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.inspection.service;
import java.util.List; 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 com.baomidou.mybatisplus.extension.service.IService;
import cn.iocoder.yudao.module.inspection.entity.WarnMessage; import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
@ -28,6 +30,7 @@ public interface IWarnMessageService extends IService<WarnMessage>
* @return warnMsg集合 * @return warnMsg集合
*/ */
public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage) throws Exception; public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage) throws Exception;
IPage<WarnMessage> pageList(Page page,WarnMessage warnMessage) throws Exception;
/** /**
* 新增warnMsg * 新增warnMsg

View File

@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.inspection.service.impl;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.util.DateUtils; import cn.iocoder.yudao.util.DateUtils;
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
@ -53,6 +55,15 @@ public class WarnMessageServiceImpl extends ServiceImpl<WarnMessageMapper,WarnMe
return warnMessages; return warnMessages;
} }
@Override
public IPage<WarnMessage> pageList(Page page, WarnMessage warnMessage) throws Exception {
ShopMallPartners partners = partnerService.shopInfo();
warnMessage.setPartnerId(partners.getPartnerId());
warnMessage.setIsRead("0");
IPage<WarnMessage> warnMessages = baseMapper.pageList(page,warnMessage);
return warnMessages;
}
/** /**
* 新增warnMsg * 新增warnMsg
* *

View File

@ -209,8 +209,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</select> </select>
<select id="pageWorkOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo"> <select id="pageWorkOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
select ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney select distinct ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time ,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price
from inspection_info ins from inspection_info ins
left join order_info oi on oi.id = ins.inspection_order_id left join order_info oi on oi.id = ins.inspection_order_id
left join system_users su on su.id = ins.user_id left join system_users su on su.id = ins.user_id

View File

@ -20,7 +20,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from warn_message select * from warn_message
where id = #{id} where id = #{id}
</select> </select>
<select id="pageList" resultType="cn.iocoder.yudao.module.inspection.entity.WarnMessage">
select * from warn_message
<where>
and warn_time <![CDATA[<=]]> NOW()
<if test="warnMessage.title != null and warnMessage.title != ''"> and title = #{warnMessage.title}</if>
<if test="warnMessage.partnerId != null "> and partner_id = #{warnMessage.partnerId}</if>
<if test="warnMessage.isRead != null and warnMessage.isRead != ''"> and is_read = #{warnMessage.isRead}</if>
</where>
order by create_time desc
</select>
</mapper> </mapper>

File diff suppressed because one or more lines are too long

View File

@ -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.convert.auth.AuthConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; 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.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.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; 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.auth.AdminAuthService;
import cn.iocoder.yudao.module.system.service.permission.MenuService; 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.PermissionService;
import cn.iocoder.yudao.module.system.service.permission.RoleService; 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.social.SocialClientService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import io.swagger.v3.oas.annotations.Operation; 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.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -39,6 +42,7 @@ import javax.annotation.Resource;
import javax.annotation.security.PermitAll; import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -75,6 +79,8 @@ public class AuthController {
private PermissionApi permissionApi; private PermissionApi permissionApi;
@Resource @Resource
private RoleApi roleApi; private RoleApi roleApi;
@Resource
private ServicePackageService servicePackageService;
@PostMapping("/login") @PostMapping("/login")
@ -185,7 +191,7 @@ public class AuthController {
@GetMapping("/get-permission-info") @GetMapping("/get-permission-info")
@Operation(summary = "获取登录用户的权限信息") @Operation(summary = "获取登录用户的权限信息")
public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() { public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo(String routeCode) {
// 1.1 获得用户信息 // 1.1 获得用户信息
AdminUserDO user = userService.getUser(getLoginUserId()); AdminUserDO user = userService.getUser(getLoginUserId());
if (user == null) { if (user == null) {
@ -202,6 +208,12 @@ public class AuthController {
// 1.3 获得菜单列表 // 1.3 获得菜单列表
Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId));
//过滤出来当前服务的菜单
if (StringUtils.isNotEmpty(routeCode)){
ServicePackageDO servicePackage = servicePackageService.getServicePackage(routeCode);
Set<Long> servicePackageMenuIds = servicePackage.getMenuIds();
menuIds= menuIds.stream().filter(servicePackageMenuIds::contains).collect(Collectors.toSet());
}
List<MenuDO> menuList = menuService.getMenuList(menuIds); List<MenuDO> menuList = menuService.getMenuList(menuIds);
menuList = menuService.filterDisableMenus(menuList); menuList = menuService.filterDisableMenus(menuList);