Browse Source

后端站点进度api

chenlei1231 4 tháng trước cách đây
mục cha
commit
9cd23d5194
18 tập tin đã thay đổi với 1118 bổ sung841 xóa
  1. 54 47
      jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/DictModel.java
  2. 91 35
      jeecg-module-system/jeecg-system-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java
  3. 21 18
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/util/AdwebRedisUtil.java
  4. 16 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/SeoPlanSubscriptionMapper.java
  5. 6 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/constant/SiteConstants.java
  6. 56 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/AdwebSiteController.java
  7. 19 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/param/SiteStepDTO.java
  8. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/result/SiteBasicInfo.java
  9. 17 15
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/entity/AdwebSite.java
  10. 6 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/IAdwebSiteService.java
  11. 8 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SelfWebSiteService.java
  12. 20 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SiteManageService.java
  13. 26 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebSiteServiceImpl.java
  14. 73 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/controller/SystemAdwebController.java
  15. 3 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/SysAdwebApi.java
  16. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml
  17. 698 710
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java
  18. 1 1
      jeecg-module-system/jeecg-system-start/src/main/resources/logback-spring.xml

+ 54 - 47
jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/DictModel.java

@@ -1,14 +1,13 @@
 package org.jeecg.common.system.vo;
 
-import java.io.Serializable;
-
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
+
 /**
  * @Description: 字典类
  * @author: jeecg-boot
@@ -17,55 +16,63 @@ import lombok.experimental.Accessors;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @JsonIgnoreProperties(ignoreUnknown = true)
-public class DictModel implements Serializable{
-	private static final long serialVersionUID = 1L;
+public class DictModel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    public DictModel() {
+    }
+
+    public DictModel(String value, String text) {
+        this.value = value;
+        this.text = text;
+    }
+
+    public DictModel(String value, String text, String color) {
+        this.value = value;
+        this.text = text;
+        this.color = color;
+    }
+
+    /**
+     * 字典value
+     */
+    private String value;
+    /**
+     * 字典文本
+     */
+    private String text;
 
-	public DictModel() {
-	}
-	
-	public DictModel(String value, String text) {
-		this.value = value;
-		this.text = text;
-	}
+    /**
+     * 字典项描述
+     */
+    private String description;
 
-	public DictModel(String value, String text, String color) {
-		this.value = value;
-		this.text = text;
-		this.color = color;
-	}
+    /**
+     * 字典颜色
+     */
+    private String color;
 
-	/**
-	 * 字典value
-	 */
-	private String value;
-	/**
-	 * 字典文本
-	 */
-	private String text;
-	/**
-	 * 字典颜色
-	 */
-	private String color;
+    /**
+     * 特殊用途: JgEditableTable
+     *
+     * @return
+     */
+    public String getTitle() {
+        return this.text;
+    }
 
-	/**
-	 * 特殊用途: JgEditableTable
-	 * @return
-	 */
-	public String getTitle() {
-		return this.text;
-	}
-	/**
-	 * 特殊用途: vue3 Select组件
-	 */
-	public String getLabel() {
-		return this.text;
-	}
+    /**
+     * 特殊用途: vue3 Select组件
+     */
+    public String getLabel() {
+        return this.text;
+    }
 
 
-	/**
-	 * 用于表单设计器 关联记录表数据存储
-	 * QQYUN-5595【表单设计器】他表字段 导入没有翻译
-	 */
-	private JSONObject jsonObject;
+    /**
+     * 用于表单设计器 关联记录表数据存储
+     * QQYUN-5595【表单设计器】他表字段 导入没有翻译
+     */
+    private JSONObject jsonObject;
 
 }

+ 91 - 35
jeecg-module-system/jeecg-system-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java

@@ -13,40 +13,46 @@ import java.util.Map;
 import java.util.Set;
 
 /**
- * @Description  底层共通业务API,提供其他独立模块调用
- * @Author  scott
+ * @Description 底层共通业务API,提供其他独立模块调用
+ * @Author scott
  * @Date 2019-4-20
  * @Version V1.0
  */
 public interface ISysBaseAPI extends CommonAPI {
 
     //=======OLD 系统消息推送接口============================
+
     /**
      * 1发送系统消息
+     *
      * @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
      */
     void sendSysAnnouncement(MessageDTO message);
 
     /**
      * 2发送消息 附带业务参数
+     *
      * @param message 使用构造器赋值参数
      */
     void sendBusAnnouncement(BusMessageDTO message);
 
     /**
      * 3通过模板发送消息
+     *
      * @param message 使用构造器赋值参数
      */
     void sendTemplateAnnouncement(TemplateMessageDTO message);
 
     /**
      * 4通过模板发送消息 附带业务参数
+     *
      * @param message 使用构造器赋值参数
      */
     void sendBusTemplateAnnouncement(BusTemplateMessageDTO message);
-    
+
     /**
      * 5通过消息中心模板,生成推送内容
+     *
      * @param templateDTO 使用构造器赋值参数
      * @return
      */
@@ -54,22 +60,26 @@ public interface ISysBaseAPI extends CommonAPI {
     //=======OLD 系统消息推送接口============================
 
     //=======TY NEW 自定义消息推送接口,邮件、钉钉、企业微信、系统消息============================
+
     /**
      * NEW发送模板消息【新,支持自定义推送类型: 邮件、钉钉、企业微信、系统消息】
+     *
      * @param message
      */
     void sendTemplateMessage(MessageDTO message);
 
     /**
      * NEW根据模板编码获取模板内容【新,支持自定义推送类型】
+     *
      * @param templateCode
      * @return
      */
     String getTemplateContent(String templateCode);
     //=======TY NEW 自定义消息推送接口,邮件、钉钉、企业微信、系统消息============================
-    
+
     /**
      * 6根据用户id查询用户信息
+     *
      * @param id
      * @return
      */
@@ -77,13 +87,15 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 7通过用户账号查询角色集合
+     *
      * @param username
      * @return
      */
     List<String> getRolesByUsername(String username);
-    
+
     /**
      * 7通过用户账号查询角色集合
+     *
      * @param userId
      * @return
      */
@@ -91,12 +103,15 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 8通过用户账号查询部门集合
+     *
      * @param username
      * @return 部门 id
      */
     List<String> getDepartIdsByUsername(String username);
+
     /**
      * 8通过用户账号查询部门集合
+     *
      * @param userId
      * @return 部门 id
      */
@@ -104,6 +119,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 8.2 通过用户账号查询部门父ID集合
+     *
      * @param username
      * @return 部门 parentIds
      */
@@ -111,6 +127,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 8.2 查询部门父ID集合
+     *
      * @param depIds
      * @return 部门 parentIds
      */
@@ -118,20 +135,23 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 9通过用户账号查询部门 name
+     *
      * @param username
      * @return 部门 name
      */
     List<String> getDepartNamesByUsername(String username);
 
 
-
-    /** 11查询所有的父级字典,按照create_time排序
+    /**
+     * 11查询所有的父级字典,按照create_time排序
+     *
      * @return List<DictModel> 字典集合
      */
     public List<DictModel> queryAllDict();
 
     /**
      * 12查询所有分类字典
+     *
      * @return
      */
     public List<SysCategoryModel> queryAllSysCategory();
@@ -139,12 +159,14 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 14查询所有部门 作为字典信息 id -->value,departName -->text
+     *
      * @return
      */
     public List<DictModel> queryAllDepartBackDictModel();
 
     /**
      * 15根据业务类型及业务id修改消息已读
+     *
      * @param busType
      * @param busId
      */
@@ -152,6 +174,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 16查询表字典 支持过滤数据
+     *
      * @param table
      * @param text
      * @param code
@@ -162,6 +185,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 17查询指定table的 text code 获取字典,包含text和value
+     *
      * @param table
      * @param text
      * @param code
@@ -173,14 +197,16 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 18查询所有用户 返回ComboModel
+     *
      * @return
      */
     public List<ComboModel> queryAllUserBackCombo();
 
     /**
      * 19分页查询用户 返回JSONObject
-     * @param userIds 多个用户id
-     * @param pageNo 当前页数
+     *
+     * @param userIds  多个用户id
+     * @param pageNo   当前页数
      * @param pageSize 每页显示条数
      * @return
      */
@@ -188,19 +214,22 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 20获取所有角色
+     *
      * @return
      */
     public List<ComboModel> queryAllRole();
 
     /**
      * 21获取所有角色 带参
+     *
      * @param roleIds 默认选中角色
      * @return
      */
-    public List<ComboModel> queryAllRole(String[] roleIds );
+    public List<ComboModel> queryAllRole(String[] roleIds);
 
     /**
      * 22通过用户账号查询角色Id集合
+     *
      * @param username
      * @return
      */
@@ -208,6 +237,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 23通过部门编号查询部门id
+     *
      * @param orgCode
      * @return
      */
@@ -215,12 +245,14 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 24查询所有部门
+     *
      * @return
      */
     public List<SysDepartModel> getAllSysDepart();
 
     /**
      * 25查找父级部门
+     *
      * @param departId
      * @return
      */
@@ -228,6 +260,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 26根据部门Id获取部门负责人
+     *
      * @param deptId
      * @return
      */
@@ -235,6 +268,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 27给指定用户发消息
+     *
      * @param userIds
      * @param cmd
      */
@@ -242,6 +276,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 28根据id获取所有参与用户
+     *
      * @param userIds 多个用户id
      * @return
      */
@@ -250,13 +285,15 @@ public interface ISysBaseAPI extends CommonAPI {
     /**
      * 29将会议签到信息推动到预览
      * userIds
-     * @return
+     *
      * @param userId
+     * @return
      */
     void meetingSignWebsocket(String userId);
 
     /**
      * 30根据name获取所有参与用户
+     *
      * @param userNames 多个用户账户
      * @return
      */
@@ -265,15 +302,17 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 根据高级查询条件查询用户
+     *
      * @param superQuery
      * @param matchType
      * @return
      */
-    List<JSONObject> queryUserBySuperQuery(String superQuery,String matchType);
+    List<JSONObject> queryUserBySuperQuery(String superQuery, String matchType);
 
 
     /**
      * 根据ID查询用户
+     *
      * @param id
      * @return
      */
@@ -282,45 +321,51 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 根据高级查询条件查询部门
+     *
      * @param superQuery
      * @param matchType
      * @return
      */
-    List<JSONObject> queryDeptBySuperQuery(String superQuery,String matchType);
+    List<JSONObject> queryDeptBySuperQuery(String superQuery, String matchType);
 
     /**
      * 根据高级查询条件查询角色
+     *
      * @param superQuery
      * @param matchType
      * @return
      */
-    List<JSONObject> queryRoleBySuperQuery(String superQuery,String matchType);
+    List<JSONObject> queryRoleBySuperQuery(String superQuery, String matchType);
 
 
     /**
      * 根据租户ID查询用户ID
+     *
      * @param tenantId 租户ID
      * @return List<String>
      */
     List<String> selectUserIdByTenantId(String tenantId);
 
 
-
     /**
      * 31获取用户的角色集合
+     *
      * @param username
      * @return
      */
     Set<String> getUserRoleSet(String username);
+
     /**
      * 31获取用户的角色集合
+     *
      * @param useId
      * @return
      */
     Set<String> getUserRoleSetById(String useId);
-    
+
     /**
      * 32获取用户的权限集合
+     *
      * @param userId
      * @return
      */
@@ -328,6 +373,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 33判断是否有online访问的权限
+     *
      * @param onlineAuthDTO
      * @return
      */
@@ -335,6 +381,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 34通过部门id获取部门全部信息
+     *
      * @param id 部门id
      * @return SysDepartModel对象
      */
@@ -342,6 +389,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 35根据用户id查询用户所属公司下所有用户ids
+     *
      * @param userId
      * @return
      */
@@ -349,6 +397,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 36根据多个用户账号(逗号分隔),查询返回多个用户信息
+     *
      * @param usernames
      * @return
      */
@@ -356,6 +405,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 37根据多个用户ID(逗号分隔),查询返回多个用户信息
+     *
      * @param ids
      * @return
      */
@@ -363,6 +413,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 38根据多个部门编码(逗号分隔),查询返回多个部门信息
+     *
      * @param orgCodes
      * @return
      */
@@ -370,6 +421,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 39根据多个部门id(逗号分隔),查询返回多个部门信息
+     *
      * @param ids
      * @return
      */
@@ -377,11 +429,12 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 40发送邮件消息
+     *
      * @param email
      * @param title
      * @param content
      */
-    void sendEmailMsg(String email,String title,String content);
+    void sendEmailMsg(String email, String title, String content);
 
     /**
      * 40发送模版邮件消息
@@ -392,8 +445,10 @@ public interface ISysBaseAPI extends CommonAPI {
      * @param params            模版参数
      */
     void sendHtmlTemplateEmail(String email, String title, EmailTemplateEnum emailTemplateEnum, JSONObject params);
+
     /**
      * 41 获取公司下级部门和公司下所有用户信息
+     *
      * @param orgCode
      * @return List<Map>
      */
@@ -401,6 +456,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 查询分类字典翻译
+     *
      * @param ids 多个分类字典id
      * @return List<String>
      */
@@ -424,11 +480,11 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 复制应用下的所有字典配置到新的租户下
-     * 
-     * @param originalAppId  原始低代码应用ID
-     * @param appId   新的低代码应用ID
-     * @param tenantId  新的租户ID
-     * @return  Map<String, String>  Map<原字典编码, 新字典编码> 
+     *
+     * @param originalAppId 原始低代码应用ID
+     * @param appId         新的低代码应用ID
+     * @param tenantId      新的租户ID
+     * @return Map<String, String>  Map<原字典编码, 新字典编码>
      */
     Map<String, String> copyLowAppDict(String originalAppId, String appId, String tenantId);
 
@@ -442,7 +498,8 @@ public interface ISysBaseAPI extends CommonAPI {
     List<DictModel> getDictItems(String dictCode);
 
     /**
-     *  根据多个字典code查询多个字典项
+     * 根据多个字典code查询多个字典项
+     *
      * @param dictCodeList
      * @return key = dictCode ; value=对应的字典项
      */
@@ -453,7 +510,7 @@ public interface ISysBaseAPI extends CommonAPI {
      * 大数据量的字典表 走异步加载  即前端输入内容过滤数据
      *
      * @param dictCode 字典code格式:table,text,code
-     * @param keyword 过滤关键字
+     * @param keyword  过滤关键字
      * @param pageSize 分页条数
      * @return
      */
@@ -461,23 +518,28 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 新增数据日志
+     *
      * @param dataLogDto
      */
     void saveDataLog(DataLogDTO dataLogDto);
+
     /**
      * 更新头像
+     *
      * @param loginUser
      */
     void updateAvatar(LoginUser loginUser);
 
     /**
      * 向app端 websocket推送聊天刷新消息
+     *
      * @param userId
      */
     void sendAppChatSocket(String userId);
 
     /**
      * 根据角色id查询角色code
+     *
      * @param id
      * @return
      */
@@ -493,13 +555,15 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 根据部门ID查询用户ID
+     *
      * @param deptIds
      * @return
      */
     List<String> queryUserIdsByDeptIds(List<String> deptIds);
-    
+
     /**
      * 根据部门ID查询用户账号
+     *
      * @param deptIds
      * @return
      */
@@ -507,6 +571,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 根据角色编码 查询用户ID
+     *
      * @param roleCodes
      * @return
      */
@@ -514,6 +579,7 @@ public interface ISysBaseAPI extends CommonAPI {
 
     /**
      * 根据职务ID查询用户ID
+     *
      * @param positionIds
      * @return
      */
@@ -550,14 +616,4 @@ public interface ISysBaseAPI extends CommonAPI {
 
     List<String> getOemGroupUids();
 
-    boolean isNotOwnSite(Integer siteId);
-
-    boolean isNotOwnSite(String siteCode);
-
-    /**
-     *
-     * @param siteId
-     * @return
-     */
-    public JSONObject getSiteInfoById(String siteId);
 }

+ 21 - 18
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/common/util/AdwebRedisUtil.java

@@ -6,9 +6,11 @@ import com.fasterxml.jackson.databind.MapperFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.json.JsonMapper;
 import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
+import jakarta.annotation.PostConstruct;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.base.BaseMap;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
 import org.springframework.data.redis.core.RedisCallback;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
@@ -30,21 +32,14 @@ import java.util.concurrent.TimeUnit;
 public class AdwebRedisUtil {
 
     @Autowired
-    private RedisTemplate<String, Object> redisTemplate;
-
+    private RedisConnectionFactory connectionFactory;
 
-    @Autowired(required = false)
-    public void setRedisTemplate(RedisTemplate<String, Object> redisTemplate) {
-        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = jacksonSerializer();
-        RedisSerializer<String> stringSerializer = new StringRedisSerializer();
-        redisTemplate.setKeySerializer(stringSerializer);
-        redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
-        redisTemplate.setHashKeySerializer(stringSerializer);
-        redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
-        this.redisTemplate = redisTemplate;
-    }
+    // 自定义serializer
+    // 不使用org.jeecg.common.modules.redis.config.RedisConfig
+    private RedisTemplate<String, Object> redisTemplate;
 
-    private Jackson2JsonRedisSerializer<Object> jacksonSerializer() {
+    @PostConstruct
+    public void initRedisTemplate() {
         JsonMapper jsonMapper =
                 JsonMapper.builder()
                         .visibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY)
@@ -53,14 +48,22 @@ public class AdwebRedisUtil {
                                 ObjectMapper.DefaultTyping.NON_FINAL)
                         .configure(MapperFeature.USE_ANNOTATIONS, false) // 忽略@JsonIgnore注解,缓存所有字段
                         .build();
+        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer =
+                new Jackson2JsonRedisSerializer<>(jsonMapper, Object.class);
+        RedisSerializer<String> stringSerializer = new StringRedisSerializer();
 
-
-        return new Jackson2JsonRedisSerializer<>(jsonMapper, Object.class);
+        this.redisTemplate = new RedisTemplate();
+        this.redisTemplate.setConnectionFactory(connectionFactory);
+        this.redisTemplate.setKeySerializer(stringSerializer);
+        this.redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
+        this.redisTemplate.setHashKeySerializer(stringSerializer);
+        this.redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
+        this.redisTemplate.afterPropertiesSet();
     }
 
     public void sendMessage(String handlerName, BaseMap params) {
         params.put("handlerName", handlerName);
-        this.setRedisTemplate(this.redisTemplate);
+        //        this.setRedisTemplate(this.redisTemplate);
         this.redisTemplate.convertAndSend("jeecg_redis_topic", params);
     }
 
@@ -143,7 +146,7 @@ public class AdwebRedisUtil {
      * @return 值
      */
     public Object get(String key) {
-        this.setRedisTemplate(this.redisTemplate);
+        //        this.setRedisTemplate(this.redisTemplate);
         return key == null ? null : redisTemplate.opsForValue().get(key);
     }
 
@@ -154,7 +157,7 @@ public class AdwebRedisUtil {
      * @return 值
      */
     public String getString(String key) {
-        this.setRedisTemplate(this.redisTemplate);
+        //        this.setRedisTemplate(this.redisTemplate);
         Object valueObj = get(key);
         return valueObj == null ? "" : valueObj.toString();
     }

+ 16 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/SeoPlanSubscriptionMapper.java

@@ -2,13 +2,15 @@ package org.jeecg.modules.adweb.seo.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
+import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.adweb.seo.entity.SeoPlanSubscription;
 
+import java.util.Map;
+
 /**
  * @Description: seo套餐订购
  * @Author: jeecg-boot
- * @Date:   2024-10-15
+ * @Date: 2024-10-15
  * @Version: V1.0
  */
 public interface SeoPlanSubscriptionMapper extends BaseMapper<SeoPlanSubscription> {
@@ -19,4 +21,16 @@ public interface SeoPlanSubscriptionMapper extends BaseMapper<SeoPlanSubscriptio
      * @return 达标标准
      */
     int getKeywordStandard(String siteCode);
+
+    /**
+     * 根据站点id,查询站点的营销方案
+     *
+     * @return:
+     * @Author: luxiaoxiao
+     * @Date: 2021/4/6
+     */
+    @Select("select t1.plan_name planName, t1.keyword_count keywordCount, t1.service_time serviceTime, t1.price price,t2.plan_id planId " +
+            "from subscribe_plan t1 ,seo_plan_subscription t2 " +
+            "where t1.id = t2.plan_id AND t2.site_id = #{siteId} AND t2.status = 1")
+    Map<String, String> getSubscribePlanBySiteId(Integer siteId);
 }

+ 6 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/constant/SiteConstants.java

@@ -0,0 +1,6 @@
+package org.jeecg.modules.adweb.site.constant;
+
+public class SiteConstants {
+
+    // TODO  定义网站状态常量
+}

+ 56 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/AdwebSiteController.java

@@ -1,22 +1,29 @@
 package org.jeecg.modules.adweb.site.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.netty.util.internal.StringUtil;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.modules.adweb.common.constant.AdwebConstant;
+import org.jeecg.modules.adweb.seo.mapper.SeoPlanSubscriptionMapper;
+import org.jeecg.modules.adweb.site.dto.param.SiteStepDTO;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
 import org.jeecg.modules.adweb.site.service.ISiteUserPermissionService;
@@ -28,6 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
 
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: adweb站点配置表单
@@ -50,6 +58,9 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
     @Autowired
     private ISiteUserPermissionService siteUserPermissionService;
 
+    @Resource
+    private SeoPlanSubscriptionMapper seoPlanSubscriptionMapper;
+
 
     /**
      * 分页列表查询
@@ -71,6 +82,28 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
         queryWrapper.eq("site_type", AdwebConstant.SITE);
         Page<AdwebSite> page = new Page<AdwebSite>(pageNo, pageSize);
         IPage<AdwebSite> pageList = adwebSiteService.page(page, queryWrapper);
+
+        // 给站点增加营销计划信息
+        List<AdwebSite> siteList = pageList.getRecords();
+        for (AdwebSite site : siteList) {
+            Map<String, String> marketPlan = seoPlanSubscriptionMapper.getSubscribePlanBySiteId(site.getId());
+            JSONObject object = FastJsonUtil.parseObject(FastJsonUtil.toJSONString(marketPlan), JSONObject.class);
+            site.setSubscribePlan(object);
+
+            // 设置建站进度
+            if (site.getSiteFlowStatus() == null) {
+                site.setCompleteProcess(0);
+            } else {
+                site.setCompleteProcess(site.getSiteFlowStatus() * 100 / 6);
+            }
+
+            // 处理域名,全部改为绝对路径
+            String domain = site.getDomain();
+            if (StringUtils.isNotBlank(domain) && !domain.startsWith("http")) {
+                site.setDomain("https://" + domain);
+            }
+        }
+
         return Result.OK(pageList);
     }
 
@@ -215,4 +248,27 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
         return Result.ok(siteList);
     }
 
+    /**
+     * 更新site表现阶段
+     *
+     * @param siteStepDTO
+     * @Author: 陈培庆
+     * @Date: 2024/11/26
+     */
+    @RequestMapping(value = "/finishOrRollbackStep")
+    public Result<?> finishOrRollbackStep(SiteStepDTO siteStepDTO) {
+
+
+        // 更新流程步骤和状态
+        UpdateWrapper<AdwebSite> siteUpdateWrapper = new UpdateWrapper<>();
+        siteUpdateWrapper.eq("code", siteStepDTO.getSiteCode());
+
+        //建站流程
+
+        siteUpdateWrapper.set("site_current_step", siteStepDTO.getCurrentStep()).set("site_flow_status", siteStepDTO.getStepFlowId());
+
+        adwebSiteService.update(siteUpdateWrapper);
+        return Result.OK();
+    }
+
 }

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/param/SiteStepDTO.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.adweb.site.dto.param;
+
+import lombok.Data;
+
+/**
+ * @author wfansh
+ */
+@Data
+public class SiteStepDTO {
+    //站点code,关联站点表
+    private String siteCode;
+
+    // 当前进度ID
+    private String stepFlowId;
+
+    // 当前进度名称
+    private String currentStep;
+
+}

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/result/SiteBasicInfo.java

@@ -48,4 +48,6 @@ public class SiteBasicInfo {
      * 补偿天数
      */
     private Integer compensateDay;
+
+    private int percentage;
 }

+ 17 - 15
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/entity/AdwebSite.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.adweb.site.entity;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -108,7 +109,8 @@ public class AdwebSite implements Serializable {
      * 当前状态:0:已删除;1:正常;2:未发布  3:拉取测试站点中 ;4:发布正式站点中 ;5:拉取异常
      */
     @Excel(name = "当前状态:0:已删除;1:正常;2:未发布  3:拉取测试站点中 ;4:发布正式站点中 ;5:拉取异常", width = 15)
-    @Schema(description = "当前状态:0:已删除;1:正常;2:未发布  3:拉取测试站点中 ;4:发布正式站点中 ;5:拉取异常")
+    @Schema(description = "当前状态:0:已删除;1:正常;2:未发布  3:临时站点正在创建 ;4:临时站点创建失败 ;5:正式站点正在创建;6:正式站点创建失败")
+    @Dict(dicCode = "site_status")
     private java.lang.Integer status;
     /**
      * 创建时间
@@ -337,8 +339,8 @@ public class AdwebSite implements Serializable {
     /**
      * 建站流程的状态,0未完成,1已完成,2不存在流程
      */
-    @Excel(name = "建站流程的状态,0未完成,1已完成,2不存在流程", width = 15)
-    @Schema(description = "建站流程的状态,0未完成,1已完成,2不存在流程")
+    @Excel(name = "建站流程的状态,查看数据字典 build_website_status", width = 15)
+    @Schema(description = "建站流程的状态,查看数据字典 build_website_status")
     private java.lang.Integer siteFlowStatus;
     /**
      * 建站流程当前所在的步骤
@@ -346,18 +348,7 @@ public class AdwebSite implements Serializable {
     @Excel(name = "建站流程当前所在的步骤", width = 15)
     @Schema(description = "建站流程当前所在的步骤")
     private java.lang.String siteCurrentStep;
-    /**
-     * seo流程的状态,0未完成,1已完成,2不存在流程
-     */
-    @Excel(name = "seo流程的状态,0未完成,1已完成,2不存在流程", width = 15)
-    @Schema(description = "seo流程的状态,0未完成,1已完成,2不存在流程")
-    private java.lang.Integer seoFlowStatus;
-    /**
-     * seo流程当前所在的步骤
-     */
-    @Excel(name = "seo流程当前所在的步骤", width = 15)
-    @Schema(description = "seo流程当前所在的步骤")
-    private java.lang.String seoCurrentStep;
+
     /**
      * 内部模板编号(人工录入)
      */
@@ -471,8 +462,19 @@ public class AdwebSite implements Serializable {
     private String planType;
 
     /**
+     * 建站进度
+     */
+    @TableField(exist = false)
+    private Integer completeProcess;
+    /**
      * 订阅ID
      */
     @TableField(exist = false)
     private String subscriptionId;
+
+    /**
+     * 营销方案
+     */
+    @TableField(exist = false)
+    private JSONObject subscribePlan;
 }

+ 6 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/IAdwebSiteService.java

@@ -1,15 +1,15 @@
 package org.jeecg.modules.adweb.site.service;
 
-import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.adweb.site.dto.WordPressConfig;
+import org.jeecg.modules.adweb.site.entity.AdwebSite;
 
 import java.util.List;
 
 /**
  * @Description: adweb站点配置表单
  * @Author: jeecg-boot
- * @Date:   2024-09-29
+ * @Date: 2024-09-29
  * @Version: V1.0
  */
 public interface IAdwebSiteService extends IService<AdwebSite> {
@@ -17,6 +17,7 @@ public interface IAdwebSiteService extends IService<AdwebSite> {
 
     /**
      * 查询wordpress站点配置
+     *
      * @param siteCode
      */
     WordPressConfig queryWordPressConfig(String siteCode);
@@ -47,6 +48,7 @@ public interface IAdwebSiteService extends IService<AdwebSite> {
 
     /**
      * 根据siteCode返回站点信息
+     *
      * @param siteCode
      * @return
      */
@@ -64,4 +66,6 @@ public interface IAdwebSiteService extends IService<AdwebSite> {
      * 查询全部有效的站点code
      */
     List<String> getAllActiveSiteCodes();
+
+    boolean updateSiteFlow(String siteCode);
 }

+ 8 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SelfWebSiteService.java

@@ -107,6 +107,8 @@ public class SelfWebSiteService {
 
             // 执行临时服务器shell脚本,生成临时站点
             String cmd = "sh /opt/adweb3/shell/auto-wpsite " + adwebSite.getCode() + " " + adwebSite.getParentCode();
+
+            AdwebSite finalAdwebSite = adwebSite;
             shellService.createShareSiteByPwd(cmd, host, port, username, password, new ShellSSH2Util.StdoutListener() {
                 @Override
                 public void stdout(String line) {
@@ -115,6 +117,9 @@ public class SelfWebSiteService {
                     if (line.startsWith("执行命令成功")) {
                         log.info("站点创建成功!更新站点状态");
 
+                        // 更新站点流程状态
+                        siteService.updateSiteFlow(finalAdwebSite.getCode());
+
                         String[] userIds = {user.getId()};
                         // 给该站点所属的用户发送消息
                         log.info("发送创建站点通知");
@@ -140,7 +145,7 @@ public class SelfWebSiteService {
     }
 
     private void createSiteFailed(AdwebSite adwebSite, String errorMsg) {
-        adwebSite.setStatus(5);
+        adwebSite.setStatus(4);
         siteService.updateById(adwebSite);
 
         SysException sysException = new SysException();
@@ -458,7 +463,7 @@ public class SelfWebSiteService {
                 sendAdWebV2FeiShuMsg(title, message);
 
                 // 站点发布失败
-                adwebSite.setStatus(5);
+                adwebSite.setStatus(6);
                 siteService.updateById(adwebSite);
                 return Result.error("网站发布上线失败!");
             } else {
@@ -489,7 +494,7 @@ public class SelfWebSiteService {
         } catch (Exception e) {
             log.error("站点发布失败,退出执行;" + e.getMessage(), e);
             // 站点发布失败
-            adwebSite.setStatus(5);
+            adwebSite.setStatus(6);
             siteService.updateById(adwebSite);
             return Result.error("网站发布上线失败!");
         }

+ 20 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SiteManageService.java

@@ -81,16 +81,30 @@ public class SiteManageService {
         // 运行状态
         siteBasicInfo.setRunStatus(adwebSite.getRunStatus());
 
-        // 交付状态
-        if (StringUtils.isNotEmpty(adwebSite.getSeoCurrentStep()) && adwebSite.getStatus() != null && adwebSite.getStatus() == 1) {
-            siteBasicInfo.setDeliveryProgress(adwebSite.getSeoCurrentStep());
-        } else {
-            siteBasicInfo.setDeliveryProgress(adwebSite.getSiteCurrentStep());
-        }
+        siteBasicInfo.setDeliveryProgress(adwebSite.getSiteCurrentStep());
         if (StringUtils.isEmpty(siteBasicInfo.getDeliveryProgress())) {
             siteBasicInfo.setDeliveryProgress("已发布");
         }
 
+        // 百分比, 老站状态只有为0, 相当于新状态1
+        int siteStatus = adwebSite.getSiteFlowStatus() == null ? 0 : adwebSite.getSiteFlowStatus();
+
+        // 老站点为1,切已发布,相当于已经完成
+        if (adwebSite.getStatus() == 1) {
+            siteStatus = 5;
+        }
+
+        if (adwebSite.getStatus() == 1 && siteStatus == 1) {
+            siteStatus = 6;
+        }
+
+        if (siteStatus == 0) {
+            siteStatus++;
+        }
+
+
+        siteBasicInfo.setPercentage(siteStatus * 100 / 6);
+
         // 获取绑定的套餐信息
         SeoPlanSubscription history = seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(adwebSite.getId());
         String defaultPlanName = sysDictMapper.getDefaultPlanName();

+ 26 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebSiteServiceImpl.java

@@ -2,12 +2,15 @@ package org.jeecg.modules.adweb.site.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xkcoding.http.util.StringUtil;
 import jakarta.annotation.Resource;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.common.util.RedisUtil;
@@ -48,6 +51,9 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
     @Autowired
     private ISiteUserPermissionService siteUserPermissionService;
 
+    @Resource
+    private ISysBaseAPI sysBaseAPI;
+
     private final RedisUtil redisUtil;
 
     public AdwebSiteServiceImpl(RedisUtil redisUtil) {
@@ -244,4 +250,24 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
                 .map(AdwebSite::getCode)
                 .toList();
     }
+
+    /**
+     * 给站点创建建站流程
+     *
+     * @Author: chenpeiqing
+     * @Date: 2024/11/25
+     */
+    @Override
+    public boolean updateSiteFlow(String siteCode) {
+        List<DictModel> dictModels = sysBaseAPI.getDictItems("build_website_status");
+
+        DictModel currentDictModel = dictModels.stream().filter(dictModel -> dictModel.getValue().equals("1")).toList().get(0);
+
+
+        UpdateWrapper<AdwebSite> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("code", siteCode);
+        updateWrapper.set("site_flow_status", 1);
+        updateWrapper.set("site_current_step", currentDictModel.getText());
+        return this.update(updateWrapper);
+    }
 }

+ 73 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/controller/SystemAdwebController.java

@@ -0,0 +1,73 @@
+package org.jeecg.modules.adweb.system.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.adweb.system.service.SysAdwebApi;
+import org.jeecg.modules.system.entity.SysRole;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.entity.SysUserRole;
+import org.jeecg.modules.system.service.ISysRoleService;
+import org.jeecg.modules.system.service.ISysUserRoleService;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 网站营销方案套餐表
+ * @Author: jeecg-boot
+ * @Date: 2024-09-27
+ * @Version: V1.0
+ */
+@Tag(name = "网站营销方案套餐表")
+@RestController
+@RequestMapping("/adweb/system")
+@Slf4j
+public class SystemAdwebController {
+
+    @Resource
+    private SysAdwebApi sysAdwebApi;
+
+    @Resource
+    private ISysUserService iSysUserService;
+
+    @Resource
+    private ISysRoleService iSysRoleService;
+
+    @Resource
+    private ISysUserRoleService iSysUserRoleService;
+
+    /**
+     * 获取渠道商列表
+     *
+     * @return
+     */
+    @GetMapping("/getChannelProvider")
+    public Result<?> getChannelProvider() {
+        List<SysUser> userList = null;
+        if (sysAdwebApi.isAdmin()) {
+            //获取role表里角色编码为adweb_oem的角色的id
+            List<SysRole> sysRoleList = iSysRoleService.list(new QueryWrapper<SysRole>().eq("role_code", "adweb_oem"));
+            if (sysRoleList.isEmpty()) {
+                return Result.error("获取渠道商列表失败");
+            }
+            SysRole role = sysRoleList.get(0);
+            //根据adweb_oem的角色的id去查user_role中间表中所有为此角色id的user_id
+            List<SysUserRole> sysUserRoleList = iSysUserRoleService.list(new QueryWrapper<SysUserRole>().eq("role_id", role.getId()));
+            if (sysUserRoleList.isEmpty()) {
+                return Result.error("获取渠道商列表失败");
+            }
+            List<String> userIdList = sysUserRoleList.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
+            //查询user表中所有上面查询出的user_id的数据
+            userList = iSysUserService.list(new QueryWrapper<SysUser>().in("id", userIdList));
+        }
+        return Result.OK(userList);
+    }
+
+}

+ 3 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/SysAdwebApi.java

@@ -15,6 +15,7 @@ public interface SysAdwebApi {
 
     /**
      * 判断输入站点是否属于当前用户
+     *
      * @param siteId
      * @return
      */
@@ -22,6 +23,7 @@ public interface SysAdwebApi {
 
     /**
      * 判断输入站点是否属于当前用户
+     *
      * @param siteCode
      * @return
      */
@@ -43,7 +45,7 @@ public interface SysAdwebApi {
      *
      * @return
      */
-    public List<DictPropertyModel> queryDictInfoByDictCode(String dictCode);
+    List<DictPropertyModel> queryDictInfoByDictCode(String dictCode);
 
     List<SysDictItem> selectItemsByDictCode(String mainId);
 }

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml

@@ -4,7 +4,7 @@
 
     <!-- 通过字典code获取字典数据 -->
     <select id="queryDictItemsByCode" parameterType="String" resultType="org.jeecg.common.system.vo.DictModel">
-        select s.item_value as "value", s.item_text as "text", s.item_color as color
+        select s.item_value as "value", s.item_text as "text", s.item_color as color, s.description
         from sys_dict_item s
         where dict_id = (select id from sys_dict where dict_code = #{code})
         order by s.sort_order asc, s.create_time DESC;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 698 - 710
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java


+ 1 - 1
jeecg-module-system/jeecg-system-start/src/main/resources/logback-spring.xml

@@ -11,7 +11,7 @@
 
     <springProperty scope="context" name="maxHistory"
 
-                    source="logging.file.max-history" defaultValue="30"/>
+                    source="logging.file.max-history" defaultValue="15"/>
 
 
     <!--定义日志文件的存储地址 -->

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác