zhanglin
2023-07-23 257ce232897d0e4a232e827ba61516b747389078
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/PopServiceImpl.java
@@ -6,6 +6,7 @@
import com.ruoyi.system.api.domain.dto.MgtBaseGetDto;
import com.ruoyi.system.domain.dto.MgtPopEditDto;
import com.ruoyi.system.domain.pojo.config.Pop;
import com.ruoyi.system.domain.vo.AppPopVo;
import com.ruoyi.system.domain.vo.MgtPopGetVo;
import com.ruoyi.system.domain.vo.MgtPopPageVo;
import com.ruoyi.system.mapper.config.PopMapper;
@@ -64,6 +65,16 @@
        }
        // 将管理弹窗编辑DTO的属性复制到管理弹窗中
        BeanUtils.copyProperties(mgtPopEditDto, pop);
        if(pop.getTargetType()==1){
            pop.setJumpType(null);
            pop.setJumpId(null);
        }else if(pop.getTargetType()==2){
            pop.setLinkUrl(null);
        }else if(pop.getTargetType()==3){
            pop.setLinkUrl(null);
            pop.setJumpType(null);
            pop.setJumpId(null);
        }
        // 设置创建时间和创建者ID
        pop.setCreateTime(new Date());
        pop.setCreateUserId(mgtPopEditDto.getPopId());
@@ -87,6 +98,16 @@
    @Override
    public MgtPopGetVo getMgtPop(Long popId){
        Pop pop = this.getById(popId);
        if(pop.getTargetType()==1){
            pop.setJumpType(null);
            pop.setJumpId(null);
        }else if(pop.getTargetType()==2){
            pop.setLinkUrl(null);
        }else if(pop.getTargetType()==3){
            pop.setLinkUrl(null);
            pop.setJumpType(null);
            pop.setJumpId(null);
        }
        MgtPopGetVo mgtPopGetVo = new MgtPopGetVo();
        BeanUtils.copyProperties(pop, mgtPopGetVo);
        return mgtPopGetVo;
@@ -105,4 +126,16 @@
        pop.setDelFlag(1);
        this.saveOrUpdate(pop);
    }
    /**
     * @description  获取首页弹窗
     * @author  jqs
     * @date    2023/7/20 17:19
     * @param
     * @return  AppPopVo
     */
    @Override
    public AppPopVo getAppPop(){
        return popMapper.getAppPop();
    }
}