| | |
| | | package com.ruoyi.system.service.impl.config; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.domain.dto.MgtBannerEditDto; |
| | |
| | | import com.ruoyi.system.domain.vo.MgtBannerPageVo; |
| | | import com.ruoyi.system.mapper.config.BannerMapper; |
| | | import com.ruoyi.system.service.config.BannerService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | } |
| | | // 将DTO中的属性值复制到横幅对象中 |
| | | BeanUtils.copyProperties(mgtBannerEditDto, banner); |
| | | if(banner.getTargetType()==1){ |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | banner.setLinkType(null); |
| | | }else if(banner.getTargetType()==2){ |
| | | if(banner.getLinkType()==1){ |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | }else{ |
| | | banner.setLinkUrl(null); |
| | | } |
| | | }else if(banner.getTargetType()==3){ |
| | | banner.setLinkUrl(null); |
| | | banner.setLinkType(null); |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | } |
| | | // 设置创建用户ID和创建时间 |
| | | banner.setCreateUserId(mgtBannerEditDto.getUserId()); |
| | | banner.setCreateTime(new Date()); |
| | |
| | | @Override |
| | | public MgtBannerGetVo getMgtBanner(Long bannerId){ |
| | | Banner banner = this.getById(bannerId); |
| | | if(banner.getTargetType()==1){ |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | banner.setLinkType(null); |
| | | }else if(banner.getTargetType()==2){ |
| | | if(banner.getLinkType()==1){ |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | }else{ |
| | | banner.setLinkUrl(null); |
| | | } |
| | | }else if(banner.getTargetType()==3){ |
| | | banner.setLinkUrl(null); |
| | | banner.setLinkType(null); |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | } |
| | | MgtBannerGetVo mgtBannerGetVo = new MgtBannerGetVo(); |
| | | BeanUtils.copyProperties(banner, mgtBannerGetVo); |
| | | return mgtBannerGetVo; |