首页业务处理

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.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<WarnMessage> list = warnMessageService.pageList(page,warnMessage);
return success(list);
}
@PostMapping("/export")
public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception {
List<WarnMessage> list = warnMessageService.selectWarnMessageList(warnMessage);

View File

@ -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<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 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<WarnMessage>
* @return warnMsg集合
*/
public List<WarnMessage> selectWarnMessageList(WarnMessage warnMessage) throws Exception;
IPage<WarnMessage> pageList(Page page,WarnMessage warnMessage) throws Exception;
/**
* 新增warnMsg

View File

@ -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<WarnMessageMapper,WarnMe
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
*

View File

@ -209,8 +209,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</select>
<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
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time
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
from inspection_info ins
left join order_info oi on oi.id = ins.inspection_order_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
where id = #{id}
</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>

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.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<AuthPermissionInfoRespVO> getPermissionInfo() {
public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo(String routeCode) {
// 1.1 获得用户信息
AdminUserDO user = userService.getUser(getLoginUserId());
if (user == null) {
@ -202,6 +208,12 @@ public class AuthController {
// 1.3 获得菜单列表
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);
menuList = menuService.filterDisableMenus(menuList);