From 61b5f9863f14ab4fc9da504ca2b553a778eb2e2c Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期三, 24 一月 2024 15:10:32 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/HongRuiTang

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/PopServiceImpl.java |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/PopServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/PopServiceImpl.java
index 4f497dc..b88451e 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/PopServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/PopServiceImpl.java
@@ -1,10 +1,12 @@
 package com.ruoyi.system.service.impl.config;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.bean.BeanUtils;
 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;
@@ -13,6 +15,7 @@
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 
@@ -65,6 +68,12 @@
         // 设置创建时间和创建者ID
         pop.setCreateTime(new Date());
         pop.setCreateUserId(mgtPopEditDto.getPopId());
+        try {
+            pop.setShowStartTime(DateUtils.parseDate(mgtPopEditDto.getShowStartTime(),"yyyy-MM-dd"));
+            pop.setShowEndTime(DateUtils.parseDate(mgtPopEditDto.getShowEndTime(),"yyyy-MM-dd"));
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
         // 保存或更新管理弹窗
         this.saveOrUpdate(pop);
     }
@@ -79,6 +88,23 @@
     @Override
     public MgtPopGetVo getMgtPop(Long popId){
         Pop pop = this.getById(popId);
+        if(pop.getTargetType()==1){
+            pop.setJumpType(null);
+            pop.setJumpId(null);
+            pop.setLinkType(null);
+        }else if(pop.getTargetType()==2){
+            if(pop.getLinkType()==1){
+                pop.setJumpType(null);
+                pop.setJumpId(null);
+            }else{
+                pop.setLinkUrl(null);
+            }
+        }else if(pop.getTargetType()==3){
+            pop.setLinkUrl(null);
+            pop.setLinkType(null);
+            pop.setJumpType(null);
+            pop.setJumpId(null);
+        }
         MgtPopGetVo mgtPopGetVo = new MgtPopGetVo();
         BeanUtils.copyProperties(pop, mgtPopGetVo);
         return mgtPopGetVo;
@@ -97,4 +123,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();
+    }
 }

--
Gitblit v1.7.1