| | |
| | | package com.ruoyi.system.service.impl.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.dto.MgtAdvertEditDto; |
| | | import com.ruoyi.system.domain.pojo.config.Advert; |
| | | import com.ruoyi.system.domain.vo.AppAdvertVo; |
| | | import com.ruoyi.system.mapper.config.AdvertMapper; |
| | | import com.ruoyi.system.service.config.AdvertService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | Advert advert = this.getOne(new LambdaQueryWrapper<Advert>().eq(Advert::getDelFlag,0),false); |
| | | return advert; |
| | | } |
| | | |
| | | /** |
| | | * @description 修改广告配置 |
| | | * @author jqs |
| | | * @date \ 17:23 |
| | | * @param mgtAdvertEditDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editMgtAdvert(MgtAdvertEditDto mgtAdvertEditDto){ |
| | | //删除旧广告配置 |
| | | Advert advert = this.getOne(new LambdaQueryWrapper<Advert>() |
| | | .eq(Advert::getDelFlag, 0) |
| | | .orderByDesc(Advert::getAdId) |
| | | .last("LIMIT 1"), false); |
| | | if (advert != null) { |
| | | advert.setDelFlag(1); |
| | | this.updateById(advert); |
| | | } |
| | | //创建新广告配置 |
| | | advert = new Advert(); |
| | | advert.setDelFlag(0); |
| | | advert.setAdUrl(mgtAdvertEditDto.getAdUrl()); |
| | | advert.setAdContent(mgtAdvertEditDto.getHomeSlogan()); |
| | | advert.setTargetType(mgtAdvertEditDto.getTargetType()); |
| | | advert.setLinkUrl(mgtAdvertEditDto.getLinkUrl()); |
| | | advert.setJumpType(mgtAdvertEditDto.getJumpType()); |
| | | advert.setJumpId(mgtAdvertEditDto.getJumpId()); |
| | | advert.setLogoUrl(mgtAdvertEditDto.getHomeLogo()); |
| | | advert.setCreateTime(new Date()); |
| | | advert.setCreateUserId(mgtAdvertEditDto.getUserId()); |
| | | this.save(advert); |
| | | } |
| | | } |