Kaynağa Gözat

Merge branch 'system-zyj' of uskycloud/usky-cloud into system-165

James 11 ay önce
ebeveyn
işleme
2988419e8d
45 değiştirilmiş dosya ile 3609 ekleme ve 1203 silme
  1. 0 6
      base-modules/service-system/service-system-biz/pom.xml
  2. 33 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/constant/constant.java
  3. 21 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/MceContentController.java
  4. 117 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/MceReceiveController.java
  5. 64 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/MceSettingController.java
  6. 80 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/MceContent.java
  7. 95 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/MceReceive.java
  8. 80 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/MceSetting.java
  9. 16 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/MceContentMapper.java
  10. 16 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/MceReceiveMapper.java
  11. 16 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/MceSettingMapper.java
  12. 18 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceContentService.java
  13. 8 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceMbuserService.java
  14. 31 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceReceiveService.java
  15. 24 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceSettingService.java
  16. 137 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/config/websocket/HttpClientUtils.java
  17. 52 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceContentServiceImpl.java
  18. 116 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceMbuserServiceImpl.java
  19. 271 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceReceiveServiceImpl.java
  20. 97 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceSettingServiceImpl.java
  21. 3 3
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysNoticeServiceImpl.java
  22. 31 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/SendWeChatMessageRequestVO.java
  23. 11 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/TemplateData.java
  24. 48 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/TemplateMsgEntityVO.java
  25. 15 0
      base-modules/service-system/service-system-biz/src/main/resources/application-verify.properties
  26. 19 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/MceContentMapper.xml
  27. 22 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/MceReceiveMapper.xml
  28. 19 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/MceSettingMapper.xml
  29. 2 2
      docker/copy.sh
  30. 17 1
      docker/deploy.sh
  31. 28 31
      docker/docker-compose.yml
  32. 0 1
      docker/mysql/db/readme.txt
  33. 0 685
      docker/mysql/db/ry_20210908.sql
  34. 0 38
      docker/mysql/db/ry_config_20220114.sql
  35. 0 406
      docker/mysql/db/usky-cloud-20230428.sql
  36. 900 0
      docker/mysql/db/usky_cloud_20240222.sql
  37. 169 14
      docker/nacos/conf/application.properties
  38. 32 0
      docker/nacos/conf/application.properties.bak
  39. 1 1
      docker/nacos/dockerfile
  40. 17 10
      docker/nginx/conf/nginx.conf
  41. 0 1
      docker/nginx/html/dist/readme.txt
  42. 2 4
      sql/ry_config_20220114.sql
  43. 900 0
      sql/usky_cloud_20240222.sql
  44. 41 0
      sql/usky_config.sql
  45. 40 0
      sql/usky_config_20240222.sql

+ 0 - 6
base-modules/service-system/service-system-biz/pom.xml

@@ -48,12 +48,6 @@
             <artifactId>ruoyi-common-swagger</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>com.usky</groupId>
-            <artifactId>service-iot-api</artifactId>
-            <version>0.0.1</version>
-        </dependency>
-
     </dependencies>
 
     <build>

+ 33 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/constant/constant.java

@@ -0,0 +1,33 @@
+package com.usky.system.constant;
+
+public class constant {
+    // 微信公众号的 app_id
+    public static final String WE_CHAT_APP_ID = "wx24286e0c45f8da1c";
+    // 微信公众号的 secret
+    public static final String WE_CHAT_SECRET = "d605d3efaaad559a8e6a327870b48ce8";
+    // 微信公众号的 access_token
+    public static final String WE_CHAT_ACCESS_TOKEN = "**********";
+    // 微信公众号code获取地址
+    public static final String WE_CHAT_CODE_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=STATE#wechat_redirect";
+    // 回调地址,获取open_id
+    public static final String WE_CHAT_CALL_BACK_DOMAIN_URL = "http://localhost:9887/weChat/getWeChatOpenId";
+    // 回调域名
+    public static final String call_back_domain = "manager.usky.cn";
+    // 微信公众号的token获取地址
+    public static final String WE_CHAT_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
+    // 微信公众号消息推送地址
+    public static final String WE_CHAT_REQUEST_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=%s";
+    // 微信公众号推送消息模板id
+    public static final String WE_CHAT_TEMPLATE_ID = "FmrNuMzgh0E8bWg1j8a2R3zTmRarHYtZ72TSzPrF9Iw";
+    // 微信公众号的消息回调地址(这儿可根据业务需求自定义动作,可选)
+    public static final String WE_CHAT_CUSTOMER_CALL_URL = "http://manager.usky.cn/mobile/#/pages/common/textview/index?id=%s";
+    // 微信公众号的主题颜色
+    public static final String WE_CHAT_TOP_COLOR = "#A349A4";
+    // 微信公众号微信用户授权地址
+    public static final String WE_CHAT_AUTHORIZATION_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code";
+    // 微信公众号登录前端部署相对路径
+    public static final String WE_CHAT_LOGIN = "/mobile/#/pages/login";
+    // 微信公众号首页前端部署相对路径
+    public static final String WE_CHAT_INDEX = "/mobile/#/pages/index";
+
+}

+ 21 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/MceContentController.java

@@ -0,0 +1,21 @@
+package com.usky.system.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 消息内容表 前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+@Controller
+@RequestMapping("/mceContent")
+public class MceContentController {
+
+}
+

+ 117 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/MceReceiveController.java

@@ -0,0 +1,117 @@
+package com.usky.system.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.system.domain.MceReceive;
+import com.usky.system.service.MceReceiveService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import org.springframework.stereotype.Controller;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息接收表 前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2024-04-19
+ */
+@RestController
+@RequestMapping("/mceReceive")
+public class MceReceiveController {
+
+    @Autowired
+    private MceReceiveService mceReceiveService;
+
+    /**
+     * 消息列表分页
+     * @param infoTitle  消息标题
+     * @param infoType  消息标题
+     * @param startTime  开始时间
+     * @param endTime  开始时间
+     * @param current      当前页
+     * @param size     每页条数
+     * @return
+     */
+    @GetMapping("/mceList")
+    public ApiResult<CommonPage<Object>> mceList(@RequestParam(value = "infoTitle", required = false) String infoTitle,
+                                                 @RequestParam(value = "infoType", required = false) String infoType,
+                                                 @RequestParam(value = "startTime", required = false) String startTime,
+                                                 @RequestParam(value = "endTime", required = false) String endTime,
+                                                 @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                 @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
+    {
+        return ApiResult.success(mceReceiveService.mceList(infoTitle, infoType,startTime, endTime, current, size));
+    }
+
+    /**
+     * 消息管理
+     * @param infoTitle  消息标题
+     * @param infoType  消息标题
+     * @param startTime  开始时间
+     * @param endTime  开始时间
+     * @param current      当前页
+     * @param size     每页条数
+     * @return
+     */
+    @GetMapping("/mceManageList")
+    public ApiResult<CommonPage<Object>> mceManageList(@RequestParam(value = "infoTitle", required = false) String infoTitle,
+                                                       @RequestParam(value = "infoType", required = false) String infoType,
+                                                       @RequestParam(value = "startTime", required = false) String startTime,
+                                                       @RequestParam(value = "endTime", required = false) String endTime,
+                                                       @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                       @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
+    {
+        return ApiResult.success(mceReceiveService.mceManageList(infoTitle, infoType,startTime, endTime, current, size));
+    }
+
+    /**
+     * 消息管理通过ID查询接口
+     * @param id  消息内容主键ID
+     * @param current      当前页
+     * @param size     每页条数
+     * @return
+     */
+    @GetMapping("/mceManageById")
+    public ApiResult<CommonPage<MceReceive>> mceManageById(@RequestParam(value = "id") Integer id,
+                                                           @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                           @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
+    {
+        return ApiResult.success(mceReceiveService.mceManageById(id,current,size));
+    }
+
+    /**
+     * 消息接收分类统计接口
+     * @return
+     */
+    @GetMapping("/mceReceiveStatic")
+    public ApiResult<Map<String, Object>> mceReceiveStatic()
+    {
+        return ApiResult.success(mceReceiveService.mceReceiveStatic());
+    }
+
+    /**
+     * 已读
+     * @return
+     */
+    @PutMapping
+    ApiResult<Void> updateMceReceive(@RequestBody MceReceive mceReceive){
+        mceReceiveService.updateMceReceive(mceReceive);
+        return ApiResult.success();
+    }
+
+    /**
+     * 消息接收接口
+     * @return
+     */
+    @PostMapping("/mceAdd")
+    ApiResult<Void> add(@RequestBody String mceReceive){
+        mceReceiveService.add(mceReceive);
+        return ApiResult.success();
+    }
+}
+

+ 64 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/MceSettingController.java

@@ -0,0 +1,64 @@
+package com.usky.system.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.system.domain.MceSetting;
+import com.usky.system.service.MceSettingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import org.springframework.stereotype.Controller;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息设置表 前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2024-04-19
+ */
+@RestController
+@RequestMapping("/mceSetting")
+public class MceSettingController {
+
+    @Autowired
+    private MceSettingService mceSettingService;
+
+    /**
+     * 消息设置回显
+     * @return
+     */
+    @GetMapping("/mceSettingInfo")
+    public ApiResult<Map<String, Object>> mceSettingInfo(){
+        return ApiResult.success(mceSettingService.mceSettingInfo());
+    }
+
+    /**
+     * 消息设置列表
+     * @param createBy     创建人
+     * @param current      当前页
+     * @param size     每页条数
+     * @return
+     */
+    @GetMapping("/mceSettingList")
+    public ApiResult<CommonPage<Map<String, Object>>> mceSettingList(@RequestParam(value = "createBy", required = false) String createBy,
+                                                                     @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                                     @RequestParam(value = "size", required = false, defaultValue = "10") Integer size){
+        return ApiResult.success(mceSettingService.mceSettingList(createBy,current,size));
+    }
+
+    /**
+     * 新增、修改
+     * @param mceSetting
+     * @return
+     */
+    @PostMapping("/addMceSetting")
+    public ApiResult<Void> add(@RequestBody MceSetting mceSetting){
+        mceSettingService.add(mceSetting);
+        return ApiResult.success();
+    }
+}
+

+ 80 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/MceContent.java

@@ -0,0 +1,80 @@
+package com.usky.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消息内容表
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class MceContent implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 消息标题
+     */
+    private String infoTitle;
+
+    /**
+     * 消息内容
+     */
+    private String infoContent;
+
+    /**
+     * 消息类型
+     */
+    private String infoType;
+
+    /**
+     * 租户号
+     */
+    private Integer tenantId;
+
+    /**
+     * 组织机构ID
+     */
+    private Integer deptId;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+
+    /**
+     * 更新人
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime updateTime;
+
+
+}

+ 95 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/MceReceive.java

@@ -0,0 +1,95 @@
+package com.usky.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消息接收表
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class MceReceive implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 接收人ID
+     */
+    private Integer receiverId;
+
+    /**
+     * 接收人
+     */
+    private String receiverName;
+
+    /**
+     * 消息类型
+     */
+    private String infoType;
+
+    /**
+     * 是否已读;0、未读,1、已读
+     */
+    private Integer readFlag;
+
+    /**
+     * 消息内容ID
+     */
+    private Integer contentId;
+
+    /**
+     * 子模块记录ID
+     */
+    private Integer moduleId;
+
+    /**
+     * 租户号
+     */
+    private Integer tenantId;
+
+    /**
+     * 组织机构ID
+     */
+    private Integer deptId;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+
+    /**
+     * 更新人
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime updateTime;
+
+
+}

+ 80 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/MceSetting.java

@@ -0,0 +1,80 @@
+package com.usky.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消息设置表
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class MceSetting implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * APP通知方式
+     */
+    private String appMode;
+
+    /**
+     * PC端通知方式
+     */
+    private String pcMode;
+
+    /**
+     * 微信端通知方式
+     */
+    private String wcMode;
+
+    /**
+     * 租户号
+     */
+    private Integer tenantId;
+
+    /**
+     * 组织机构ID
+     */
+    private Integer deptId;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+
+    /**
+     * 更新人
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime updateTime;
+
+
+}

+ 16 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/MceContentMapper.java

@@ -0,0 +1,16 @@
+package com.usky.system.mapper;
+
+import com.usky.system.domain.MceContent;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 消息内容表 Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+public interface MceContentMapper extends CrudMapper<MceContent> {
+
+}

+ 16 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/MceReceiveMapper.java

@@ -0,0 +1,16 @@
+package com.usky.system.mapper;
+
+import com.usky.system.domain.MceReceive;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 消息接收表 Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+public interface MceReceiveMapper extends CrudMapper<MceReceive> {
+
+}

+ 16 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/MceSettingMapper.java

@@ -0,0 +1,16 @@
+package com.usky.system.mapper;
+
+import com.usky.system.domain.MceSetting;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 消息设置表 Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+public interface MceSettingMapper extends CrudMapper<MceSetting> {
+
+}

+ 18 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceContentService.java

@@ -0,0 +1,18 @@
+package com.usky.system.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.usky.system.domain.MceContent;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ * 消息内容表 服务类
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+public interface MceContentService extends CrudService<MceContent> {
+    void sendApp(JSONObject mceReceiveVO, String cids, Integer mceReceiveId, Integer sendType);
+
+}

+ 8 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceMbuserService.java

@@ -1,7 +1,9 @@
 package com.usky.system.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.usky.system.domain.MceMbuser;
 import com.usky.common.mybatis.core.CrudService;
+import com.usky.system.service.vo.SendWeChatMessageRequestVO;
 
 /**
  * <p>
@@ -13,4 +15,10 @@ import com.usky.common.mybatis.core.CrudService;
  */
 public interface MceMbuserService extends CrudService<MceMbuser> {
 
+    /**
+     * 微信消息提醒
+     * @return
+     */
+    JSONObject sendWeChatMessage(SendWeChatMessageRequestVO requestVO);
+
 }

+ 31 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceReceiveService.java

@@ -0,0 +1,31 @@
+package com.usky.system.service;
+
+import com.usky.common.core.bean.CommonPage;
+import com.usky.system.domain.MceReceive;
+import com.usky.common.mybatis.core.CrudService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息接收表 服务类
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+public interface MceReceiveService extends CrudService<MceReceive> {
+
+    CommonPage<Object> mceList(String infoTitle, String infoType, String startTime, String endTime, Integer current, Integer size);
+
+    CommonPage<Object> mceManageList(String infoTitle, String infoType, String startTime, String endTime, Integer current, Integer size);
+
+    CommonPage<MceReceive> mceManageById(Integer id, Integer current, Integer size);
+
+    Map<String, Object> mceReceiveStatic();
+
+    void updateMceReceive(MceReceive mceReceive);
+
+    void add(String mceReceive);
+
+}

+ 24 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/MceSettingService.java

@@ -0,0 +1,24 @@
+package com.usky.system.service;
+
+import com.usky.common.core.bean.CommonPage;
+import com.usky.system.domain.MceSetting;
+import com.usky.common.mybatis.core.CrudService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息设置表 服务类
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+public interface MceSettingService extends CrudService<MceSetting> {
+    void add(MceSetting mceSetting);
+
+    Map<String, Object> mceSettingInfo();
+
+    CommonPage<Map<String, Object>> mceSettingList(String createBy, Integer current, Integer size);
+
+}

+ 137 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/config/websocket/HttpClientUtils.java

@@ -0,0 +1,137 @@
+package com.usky.system.service.config.websocket;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ 1. 跨域请求工具类
+ */
+public class HttpClientUtils {
+
+    public static String doGet(String url, Map<String, String> param) {
+
+        // 创建Httpclient对象
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+
+        String resultString = "";
+        CloseableHttpResponse response = null;
+        try {
+            // 创建uri
+            URIBuilder builder = new URIBuilder(url);
+            if (param != null) {
+                for (String key : param.keySet()) {
+                    builder.addParameter(key, param.get(key));
+                }
+            }
+            URI uri = builder.build();
+
+            // 创建http GET请求
+            HttpGet httpGet = new HttpGet(uri);
+
+            // 执行请求
+            response = httpclient.execute(httpGet);
+            // 判断返回状态是否为200
+            if (response.getStatusLine().getStatusCode() == 200) {
+                resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return resultString;
+    }
+
+    public static String doGet(String url) {
+        return doGet(url, null);
+    }
+
+    public static String doPost(String url, Map<String, String> param) {
+        // 创建Httpclient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        CloseableHttpResponse response = null;
+        String resultString = "";
+        try {
+            // 创建Http Post请求
+            HttpPost httpPost = new HttpPost(url);
+            httpPost.setHeader("Content-Type", "application/json");
+            // 创建参数列表
+            if (param != null) {
+                List<NameValuePair> paramList = new ArrayList<>();
+                for (String key : param.keySet()) {
+                    paramList.add(new BasicNameValuePair(key, param.get(key)));
+                }
+                // 模拟表单
+                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
+                httpPost.setEntity(entity);
+            }
+            // 执行http请求
+            response = httpClient.execute(httpPost);
+            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                response.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return resultString;
+    }
+
+    public static String doPost(String url) {
+        return doPost(url, null);
+    }
+
+    public static String doPostJson(String url, String json) {
+        // 创建Httpclient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        CloseableHttpResponse response = null;
+        String resultString = "";
+        try {
+            // 创建Http Post请求
+            HttpPost httpPost = new HttpPost(url);
+            // 创建请求内容
+            StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
+            httpPost.setEntity(entity);
+            // 执行http请求
+            response = httpClient.execute(httpPost);
+            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                response.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return resultString;
+    }
+}

+ 52 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceContentServiceImpl.java

@@ -0,0 +1,52 @@
+package com.usky.system.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.JsonObject;
+import com.usky.system.domain.MceContent;
+import com.usky.system.mapper.MceContentMapper;
+import com.usky.system.service.MceContentService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.system.service.MceMbuserService;
+import com.usky.system.service.config.websocket.HttpClientUtils;
+import com.usky.system.service.vo.SendWeChatMessageRequestVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 消息内容表 服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+@Slf4j
+@Service
+public class MceContentServiceImpl extends AbstractCrudService<MceContentMapper, MceContent> implements MceContentService {
+
+    @Autowired
+    private MceMbuserService mceMbuserService;
+
+    //异步多线程调用
+    @Async("asyncServiceExecutor")
+    public void sendApp(JSONObject mceReceiveVO, String cids, Integer mceReceiveId, Integer sendType){
+        if (sendType.equals(0)){
+            String appUrl = "https://fc-mp-85a26092-1305-4bf1-998f-b609512c8f7b.next.bspapp.com/uniPushMessage";
+            JsonObject jsonObject = new JsonObject();
+            jsonObject.addProperty("cids", cids);
+            jsonObject.addProperty("title", mceReceiveVO.get("infoTitle").toString());
+            jsonObject.addProperty("content", mceReceiveVO.get("infoContent").toString());
+            String resultString = HttpClientUtils.doPostJson(appUrl,jsonObject.toString());
+        }else if (sendType.equals(1)){
+            SendWeChatMessageRequestVO sendWeChatMessageRequestVO = new SendWeChatMessageRequestVO();
+            sendWeChatMessageRequestVO.setInfoContent(mceReceiveVO.get("infoContent").toString());
+            sendWeChatMessageRequestVO.setInfoTitle(mceReceiveVO.get("infoTitle").toString());
+            sendWeChatMessageRequestVO.setInfoId(mceReceiveId);
+            sendWeChatMessageRequestVO.setOpenId(cids);
+            sendWeChatMessageRequestVO.setInfoType(mceReceiveVO.get("infoType").toString());
+            mceMbuserService.sendWeChatMessage(sendWeChatMessageRequestVO);
+        }
+    }
+}

+ 116 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceMbuserServiceImpl.java

@@ -1,10 +1,31 @@
 package com.usky.system.service.impl;
 
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.usky.common.core.exception.BusinessException;
+import com.usky.common.redis.core.RedisHelper;
 import com.usky.system.domain.MceMbuser;
 import com.usky.system.mapper.MceMbuserMapper;
 import com.usky.system.service.MceMbuserService;
+import com.usky.system.constant.constant;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.system.service.vo.SendWeChatMessageRequestVO;
+import com.usky.system.service.vo.TemplateData;
+import com.usky.system.service.vo.TemplateMsgEntityVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.client.RestTemplate;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * <p>
@@ -15,6 +36,101 @@ import org.springframework.stereotype.Service;
  * @since 2024-05-06
  */
 @Service
+@Slf4j
 public class MceMbuserServiceImpl extends AbstractCrudService<MceMbuserMapper, MceMbuser> implements MceMbuserService {
 
+    @Autowired
+    private RedisHelper redisHelper;
+
+    public String getWeChatAccessToken() {
+        try {
+            // 微信公众号官方获取AccessToken
+            RestTemplate restTemplate = new RestTemplate();
+            String requestParams = String.format(constant.WE_CHAT_ACCESS_TOKEN_URL, constant.WE_CHAT_APP_ID, constant.WE_CHAT_SECRET);
+            ResponseEntity<String> responseEntity = restTemplate.getForEntity(requestParams, String.class);
+
+            String accessToken = JSONObject.parseObject(responseEntity.getBody()).getString("access_token");
+            log.info("we_chat_access_token: " + accessToken);
+
+            return accessToken;
+        } catch (Exception e) {
+            log.info("异常信息:{}", e);
+        }
+        return null;
+    }
+
+    public static long getTimeDifference(String oldTime,String newTime) throws ParseException {
+
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        long NTime =df.parse(newTime).getTime();
+        //从对象中拿到时间
+        long OTime = df.parse(oldTime).getTime();
+        long diff=(NTime-OTime)/1000/60;
+        return diff;
+    }
+
+    @Override
+    public JSONObject sendWeChatMessage(@RequestBody SendWeChatMessageRequestVO requestVO) {
+
+        String infoType = requestVO.getInfoType();
+        String infoTitle = requestVO.getInfoTitle();
+        String infoContent = requestVO.getInfoContent();
+        Integer infoId = requestVO.getInfoId();
+        String openId = requestVO.getOpenId();
+
+        //access_token时效校验,判断获取access_token获取时间是否超过有效时间,超过就调用更新,保证一直有效
+        if(!redisHelper.hasKey("access_key")){
+            redisHelper.set("access_time", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+            redisHelper.set("access_key",this.getWeChatAccessToken());
+        }else{
+            try{
+                String access_time = redisHelper.get("access_time").toString();
+                String now_time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+                long i = getTimeDifference(access_time,now_time);
+                if(i > 115){ //大于115分钟
+                    redisHelper.set("access_time",LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                    redisHelper.set("access_key",this.getWeChatAccessToken());
+                }
+            }catch (Exception e){
+                throw new BusinessException(e.getMessage());
+            }
+
+        }
+
+        Object obj = redisHelper.get("access_key");
+        if(obj == null){
+            throw new BusinessException("token不能为空");
+        }
+
+        String token = obj.toString();
+
+        TemplateMsgEntityVO messageVo=new TemplateMsgEntityVO();
+        messageVo.setTTitle(infoTitle);
+        messageVo.setTKeyword1(infoContent);
+//        messageVo.setTKeyword2("测试2");
+//        messageVo.setTKeyword3("测试3");
+        messageVo.setTRemark(infoContent);
+        messageVo.setTUrl(String.format(constant.WE_CHAT_CUSTOMER_CALL_URL,infoId));
+        messageVo.setTemplateId(constant.WE_CHAT_TEMPLATE_ID);
+
+        String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="  + token;
+        Map<String,Object> content=new HashMap<>();
+        Map<String, TemplateData> data = new HashMap<>();
+        data.put("first",new TemplateData(messageVo.getTTitle(),"#44b549"));
+        data.put("keyword1",new TemplateData(messageVo.getTKeyword1(),"#173177"));
+//        data.put("keyword2",new TemplateData(messageVo.getTKeyword2(),"#173177"));
+//        data.put("keyword3",new TemplateData(messageVo.getTKeyword3(),"#173177"));
+        data.put("remark",new TemplateData(messageVo.getTRemark(),"#173177"));
+
+        content.put("touser",openId);
+        content.put("url",messageVo.getTUrl());
+        content.put("template_id",messageVo.getTemplateId());
+        content.put("data",data);
+        String resp = HttpUtil.post(requestUrl, JSONUtil.parseObj(content).toString());
+        System.out.println(content.toString());
+        System.out.println(JSONUtil.parseObj(content));
+        JSONObject result = JSONObject.parseObject(resp);
+        System.out.println("发送消息:" + resp);
+        return result;
+    }
 }

+ 271 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceReceiveServiceImpl.java

@@ -0,0 +1,271 @@
+package com.usky.system.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.system.RemoteUserService;
+import com.usky.system.domain.*;
+import com.usky.system.mapper.MceReceiveMapper;
+import com.usky.system.service.*;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * <p>
+ * 消息接收表 服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+@Service
+public class MceReceiveServiceImpl extends AbstractCrudService<MceReceiveMapper, MceReceive> implements MceReceiveService {
+    @Autowired
+    private MceContentService mceContentService;
+
+    @Autowired
+    private MceMbuserService mceMbuserService;
+
+    @Autowired
+    private MceSettingService mceSettingService;
+
+    @Autowired
+    private ISysUserService iSysUserService;
+
+    @Override
+    public CommonPage<Object> mceList(String infoTitle, String infoType, String startTime, String endTime, Integer current, Integer size) {
+        List<Object> list = new ArrayList<>();
+        LambdaQueryWrapper<MceContent> lambdaQuery1 = Wrappers.lambdaQuery();
+        lambdaQuery1.select(MceContent::getId, MceContent::getInfoTitle, MceContent::getInfoContent)
+                .like(StringUtils.isNotBlank(infoTitle),MceContent::getInfoTitle,infoTitle);
+        List<MceContent> list1 = mceContentService.list(lambdaQuery1);
+        IPage<MceReceive> page = new Page<>(current, size);
+        List<Integer> contentIds = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(list1)){
+            for(int i=0;i<list1.size();i++){
+                contentIds.add(list1.get(i).getId());
+            }
+            LambdaQueryWrapper<MceReceive> lambdaQuery = Wrappers.lambdaQuery();
+            lambdaQuery.select(MceReceive::getId, MceReceive::getInfoType,
+                    MceReceive::getContentId, MceReceive::getReadFlag, MceReceive::getCreateTime,
+                    MceReceive::getReceiverId,MceReceive::getModuleId)
+                    .between(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime),MceReceive::getCreateTime,
+                            startTime,endTime)
+                    .eq(StringUtils.isNotBlank(infoType),MceReceive::getInfoType, infoType)
+                    .eq(MceReceive::getReceiverId, SecurityUtils.getUserId())
+                    .in(CollectionUtils.isNotEmpty(contentIds),MceReceive::getContentId,contentIds)
+                    .orderByDesc(MceReceive::getId);
+//                .inSql(StringUtils.isNotBlank(infoTitle),MceReceive::getContentId,"SELECT id FROM mce_content WHERE " +
+//                        "info_title like '%" + infoTitle + "%' AND tenant_id = "+SecurityUtils.getTenantId()+"");
+            page = this.page(page,lambdaQuery);
+            if (CollectionUtils.isNotEmpty(page.getRecords())) {
+                for (int i = 0; i < page.getRecords().size(); i++) {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("id", page.getRecords().get(i).getId());
+                    map.put("infoType", page.getRecords().get(i).getInfoType());
+                    map.put("readFlag", page.getRecords().get(i).getReadFlag());
+                    map.put("moduleId", page.getRecords().get(i).getModuleId());
+                    map.put("createTime", page.getRecords().get(i).getCreateTime());
+                    if (CollectionUtils.isNotEmpty(list1)) {
+                        for (int j = 0; j < list1.size(); j++) {
+                            if (page.getRecords().get(i).getContentId().equals(list1.get(j).getId())) {
+                                map.put("infoTitle", list1.get(j).getInfoTitle());
+                                map.put("infoContent", list1.get(j).getInfoContent());
+                            }
+                        }
+                    }
+                    list.add(map);
+                }
+            }
+        }
+        return new CommonPage<>(list,page.getTotal(),page.getCurrent(),page.getSize());
+    }
+
+    @Override
+    public CommonPage<Object> mceManageList(String infoTitle, String infoType, String startTime, String endTime, Integer current, Integer size) {
+        List<Object> list = new ArrayList<>();
+        IPage<MceContent> page = new Page<>(current, size);
+        LambdaQueryWrapper<MceContent> lambdaQuery1 = Wrappers.lambdaQuery();
+        lambdaQuery1.select(MceContent::getId, MceContent::getInfoTitle, MceContent::getInfoContent,
+                MceContent::getCreateTime,MceContent::getInfoType)
+                .like(StringUtils.isNotBlank(infoTitle),MceContent::getInfoTitle,infoTitle)
+                .between(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime),MceContent::getCreateTime,
+                        startTime,endTime)
+                .eq(StringUtils.isNotBlank(infoType),MceContent::getInfoType, infoType)
+                .eq(MceContent::getCreateBy,SecurityUtils.getUsername())
+                .eq(MceContent::getTenantId,SecurityUtils.getTenantId());
+        page = mceContentService.page(page,lambdaQuery1);
+        if (CollectionUtils.isNotEmpty(page.getRecords())) {
+            List<Integer> contentIds = new ArrayList<>();
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                contentIds.add(page.getRecords().get(i).getId());
+            }
+            QueryWrapper<MceReceive> queryWrapper = Wrappers.query();
+            queryWrapper.select("content_id AS contentId","COUNT(read_flag=0 or null) as notReadCount","COUNT(read_flag=1 or null) as readCount")
+                    .in("content_id",contentIds)
+                    .groupBy("content_id");
+            List<Map<String,Object>> readStatisticList = this.listMaps(queryWrapper);
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("id", page.getRecords().get(i).getId());
+                map.put("infoTitle", page.getRecords().get(i).getInfoTitle());
+                map.put("infoContent", page.getRecords().get(i).getInfoContent());
+                map.put("infoType", page.getRecords().get(i).getInfoType());
+                map.put("createTime", page.getRecords().get(i).getCreateTime());
+                for (int j = 0; j < readStatisticList.size(); j++) {
+                    if (page.getRecords().get(i).getId().equals(readStatisticList.get(j).get("contentId"))){
+                        map.put("notReadCount", readStatisticList.get(j).get("notReadCount"));
+                        map.put("readCount", readStatisticList.get(j).get("readCount"));
+                    }
+                }
+                list.add(map);
+            }
+        }
+        return new CommonPage<>(list,page.getTotal(),page.getCurrent(),page.getSize());
+    }
+
+    @Override
+    public CommonPage<MceReceive> mceManageById(Integer id, Integer current, Integer size) {
+        IPage<MceReceive> page = new Page<>(current, size);
+        LambdaQueryWrapper<MceReceive> lambdaQuery = Wrappers.lambdaQuery();
+        lambdaQuery.eq(MceReceive::getContentId,id);
+        page = this.page(page,lambdaQuery);
+//        if (CollectionUtils.isNotEmpty(page.getRecords())) {
+//            List<Integer> userIds = new ArrayList<>();
+//            for (int i = 0; i < page.getRecords().size(); i++) {
+//                userIds.add(page.getRecords().get(i).getReceiverId());
+//            }
+//            List<Integer> distinctUserIds = userIds.stream()
+//                    .distinct()
+//                    .collect(Collectors.toList());
+//            ApiResult<List<SysUser>> userApi = remoteUserService.userByIdList(distinctUserIds);
+//            List<SysUser> list1 = userApi.getData();
+//            for (int j = 0; j < page.getRecords().size(); j++) {
+//                if (CollectionUtils.isNotEmpty(list1)){
+//                    for (int k = 0; k < list1.size(); k++) {
+//                        long longValue = list1.get(k).getUserId();
+//                        Integer intValue = (int) longValue;
+//                        if (page.getRecords().get(j).getReceiverId().equals(intValue)){
+//                            page.getRecords().get(j).setUpdateBy(list1.get(k).getUserName());
+//                        }
+//                    }
+//                }
+//            }
+//        }
+        return new CommonPage<>(page.getRecords(),page.getTotal(),page.getCurrent(),page.getSize());
+    }
+
+    @Override
+    public Map<String, Object> mceReceiveStatic() {
+        LocalDateTime currentDate = LocalDateTime.now();
+        LocalDateTime oneYearAgo = currentDate.minusYears(1);
+        LocalDateTime zeroTime = oneYearAgo.withHour(0).withMinute(0).withSecond(0);
+        QueryWrapper<MceReceive> queryWrapper = Wrappers.query();
+        queryWrapper.select("COUNT(read_flag=0 or null) as notReadCount","COUNT(read_flag=1 or null) as readCount"
+                ,"info_type AS infoType")
+                .eq("receiver_id",SecurityUtils.getUserId())
+                .between("create_time",zeroTime,currentDate)
+                .groupBy("info_type");
+        List<Map<String,Object>> readStatisticList = this.listMaps(queryWrapper);
+        LambdaQueryWrapper<MceReceive> lambdaQuery = Wrappers.lambdaQuery();
+        lambdaQuery.eq(MceReceive::getReceiverId,SecurityUtils.getUserId())
+                .eq(MceReceive::getReadFlag,0);
+        Integer notReadCount = this.count(lambdaQuery);
+        Map<String, Object> map = new HashMap<>();
+        map.put("notReadCount", notReadCount);
+        map.put("infoTypeStatic", readStatisticList);
+        return map;
+    }
+
+    @Override
+    public void updateMceReceive(MceReceive mceReceive){
+        LambdaUpdateWrapper<MceReceive> updateWrapper = new UpdateWrapper<MceReceive>().lambda();
+        if (Objects.nonNull(mceReceive.getId())&&!mceReceive.getId().equals(0)){
+            updateWrapper.eq(MceReceive::getId,mceReceive.getId())
+                    .set(MceReceive::getReadFlag,1)
+                    .set(MceReceive::getUpdateBy,SecurityUtils.getUsername())
+                    .set(MceReceive::getUpdateTime,LocalDateTime.now());
+        }else {
+            updateWrapper.eq(MceReceive::getReceiverId,SecurityUtils.getUserId())
+                    .eq(MceReceive::getReadFlag,0)
+                    .set(MceReceive::getReadFlag,1)
+                    .set(MceReceive::getUpdateBy,SecurityUtils.getUsername())
+                    .set(MceReceive::getUpdateTime,LocalDateTime.now());
+        }
+        this.update(updateWrapper);
+    }
+
+    @Override
+    public void add(String mceReceive){
+        JSONObject mceReceiveVO = JSONObject.parseObject(mceReceive);
+        MceContent mceContent = new MceContent();
+        mceContent.setInfoTitle(mceReceiveVO.get("infoTitle").toString());
+        mceContent.setInfoContent(mceReceiveVO.get("infoContent").toString());
+        mceContent.setInfoType(mceReceiveVO.get("infoType").toString());
+        mceContent.setCreateBy(SecurityUtils.getUsername());
+        mceContent.setCreateTime(LocalDateTime.now());
+//        mceContent.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId().intValue());
+
+        mceContent.setTenantId(SecurityUtils.getTenantId());
+        mceContentService.save(mceContent);
+        Integer contentId = mceContent.getId();
+        List<SysUser> list = iSysUserService.userAllList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            List<Integer> userIds = new ArrayList<>();
+            for (int g = 0; g < list.size(); g++) {
+                userIds.add(list.get(g).getUserId().intValue());
+            }
+            LambdaQueryWrapper<MceMbuser> lambdaQuery3 = Wrappers.lambdaQuery();
+            lambdaQuery3.in(MceMbuser::getUserId,userIds);
+            List<MceMbuser> list3 = mceMbuserService.list(lambdaQuery3);
+            for (int i = 0; i < list.size(); i++) {
+                MceReceive mceReceive1 = new MceReceive();
+                mceReceive1.setReceiverId(list.get(i).getUserId().intValue());
+                mceReceive1.setContentId(contentId);
+                mceReceive1.setReadFlag(0);
+                mceReceive1.setInfoType(mceReceiveVO.get("infoType").toString());
+                mceReceive1.setModuleId((int)mceReceiveVO.get("id"));
+                mceReceive1.setReceiverName(list.get(i).getUserName());
+                mceReceive1.setCreateBy(SecurityUtils.getUsername());
+                mceReceive1.setCreateTime(LocalDateTime.now());
+                mceReceive1.setTenantId(list.get(i).getTenantId());
+//                mceReceive1.setDeptId(list.get(i).getDeptId().intValue());
+                this.save(mceReceive1);
+                Integer mceReceiveId = mceReceive1.getId();
+                LambdaQueryWrapper<MceSetting> lambdaQuery = Wrappers.lambdaQuery();
+                lambdaQuery.eq(MceSetting::getCreateBy,list.get(i).getUserName());
+                List<MceSetting> list1 = mceSettingService.list(lambdaQuery);
+                if (CollectionUtils.isNotEmpty(list1)){
+                    JSONObject appMode = JSONObject.parseObject(list1.get(0).getAppMode());
+                    JSONObject wcMode = JSONObject.parseObject(list1.get(0).getWcMode());
+                    for (int j = 0; j < list3.size(); j++){
+                        if (appMode.get(mceReceiveVO.get("infoType").toString()).equals(true)){
+                            if (list.get(i).getUserId().equals(list3.get(j).getUserId()) && StringUtils.isNotBlank(list3.get(j).getCids())){
+                                mceContentService.sendApp(mceReceiveVO,list3.get(j).getCids(),0,0);
+                            }
+                        }
+                        if (wcMode.get(mceReceiveVO.get("infoType").toString()).equals(true)){
+                            if (list.get(i).getUserId().equals(list3.get(j).getUserId()) && StringUtils.isNotBlank(list3.get(j).getOpenid())){
+                                mceContentService.sendApp(mceReceiveVO,list3.get(j).getOpenid(),mceReceiveId,1);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 97 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceSettingServiceImpl.java

@@ -0,0 +1,97 @@
+package com.usky.system.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.system.domain.MceSetting;
+import com.usky.system.mapper.MceSettingMapper;
+import com.usky.system.service.MceSettingService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息设置表 服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2024-05-09
+ */
+@Service
+public class MceSettingServiceImpl extends AbstractCrudService<MceSettingMapper, MceSetting> implements MceSettingService {
+    @Override
+    public void add(MceSetting mceSetting){
+        if (mceSetting.getId().equals(0)){
+            mceSetting.setCreateBy(SecurityUtils.getUsername());
+            mceSetting.setCreateTime(LocalDateTime.now());
+            mceSetting.setTenantId(SecurityUtils.getTenantId());
+            long longValue = SecurityUtils.getLoginUser().getSysUser().getDeptId();
+            Integer intValue = (int) longValue;
+            mceSetting.setDeptId(intValue);
+            this.save(mceSetting);
+        }else {
+            mceSetting.setUpdateBy(SecurityUtils.getUsername());
+            mceSetting.setUpdateTime(LocalDateTime.now());
+            this.updateById(mceSetting);
+        }
+    }
+    @Override
+    public Map<String, Object> mceSettingInfo() {
+        LambdaQueryWrapper<MceSetting> lambdaQuery = Wrappers.lambdaQuery();
+        lambdaQuery.eq(MceSetting::getCreateBy, SecurityUtils.getUsername())
+                .eq(MceSetting::getTenantId,SecurityUtils.getTenantId());
+        List<MceSetting> list1 = this.list(lambdaQuery);
+        Map<String, Object> map = new HashMap<>();
+        if (CollectionUtils.isEmpty(list1)) {
+            Map<String, Object> map1 = new HashMap<>();
+            map1.put("1", true);
+            map1.put("2", true);
+            map1.put("3", true);
+            map1.put("4", true);
+            map.put("appMode",map1);
+            map.put("pcMode",map1);
+            map.put("wcMode",map1);
+            map.put("id",0);
+        }else {
+            map.put("appMode", JSONObject.parseObject(list1.get(0).getAppMode()));
+            map.put("pcMode",JSONObject.parseObject(list1.get(0).getPcMode()));
+            map.put("wcMode",JSONObject.parseObject(list1.get(0).getWcMode()));
+            map.put("id",list1.get(0).getId());
+        }
+        return map;
+    }
+
+    @Override
+    public CommonPage<Map<String, Object>> mceSettingList(String createBy, Integer current, Integer size) {
+        IPage<MceSetting> page = new Page<>(current, size);
+        List<Map<String, Object>> list = new ArrayList<>();
+        LambdaQueryWrapper<MceSetting> lambdaQuery = Wrappers.lambdaQuery();
+        lambdaQuery.eq(MceSetting::getTenantId,SecurityUtils.getTenantId())
+                .like(StringUtils.isNotBlank(createBy),MceSetting::getCreateBy,createBy);
+        page = this.page(page,lambdaQuery);
+        if (CollectionUtils.isNotEmpty(page.getRecords())) {
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("id",page.getRecords().get(i).getId());
+                map.put("createBy",page.getRecords().get(i).getCreateBy());
+                map.put("appMode",JSONObject.parseObject(page.getRecords().get(i).getAppMode()));
+                map.put("pcMode",JSONObject.parseObject(page.getRecords().get(i).getPcMode()));
+                map.put("wcMode",JSONObject.parseObject(page.getRecords().get(i).getWcMode()));
+                list.add(map);
+            }
+        }
+        return new CommonPage<>(list,page.getTotal(),page.getCurrent(),page.getSize());
+    }
+}

+ 3 - 3
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysNoticeServiceImpl.java

@@ -4,10 +4,10 @@ package com.usky.system.service.impl;
 import com.google.gson.JsonObject;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.mybatis.core.AbstractCrudService;
-import com.usky.iot.RemoteMceService;
 import com.usky.system.domain.SysNotice;
 import com.usky.system.mapper.SysNoticeMapper;
 import com.usky.system.service.ISysNoticeService;
+import com.usky.system.service.MceReceiveService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -27,7 +27,7 @@ public class SysNoticeServiceImpl extends AbstractCrudService<SysNoticeMapper, S
     private SysNoticeMapper noticeMapper;
 
     @Autowired
-    private RemoteMceService remoteMceService;
+    private MceReceiveService mceReceiveService;
 
     /**
      * 查询公告信息
@@ -68,7 +68,7 @@ public class SysNoticeServiceImpl extends AbstractCrudService<SysNoticeMapper, S
         jsonObject.addProperty("infoContent",notice.getNoticeContent());
         jsonObject.addProperty("infoType",1);
         jsonObject.addProperty("id",insertId);
-        ApiResult<Void> resultMce = remoteMceService.addMce(jsonObject.toString());
+        mceReceiveService.add(jsonObject.toString());
         return insertId;
     }
 

+ 31 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/SendWeChatMessageRequestVO.java

@@ -0,0 +1,31 @@
+package com.usky.system.service.vo;
+
+import lombok.Data;
+
+@Data
+public class SendWeChatMessageRequestVO {
+    /**
+     * 消息类型
+     */
+    String infoType;
+
+    /**
+     * 消息标题
+     */
+    String infoTitle;
+
+    /**
+     * 消息内容
+     */
+    String infoContent;
+
+    /**
+     * 消息Id
+     */
+    Integer infoId;
+
+    /**
+     * openId
+     */
+    String openId;
+}

+ 11 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/TemplateData.java

@@ -0,0 +1,11 @@
+package com.usky.system.service.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+@AllArgsConstructor
+@Data
+public class TemplateData {
+    private String value;
+    private String color;
+}

+ 48 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/TemplateMsgEntityVO.java

@@ -0,0 +1,48 @@
+package com.usky.system.service.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class TemplateMsgEntityVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 标题
+     */
+    private String tTitle;
+    /**
+     * 第一行
+     */
+    private String tKeyword1;
+    /**
+     * 第二行
+     */
+    private String tKeyword2;
+    /**
+     * 第三行
+     */
+    private String tKeyword3;
+    /**
+     * 第四行
+     */
+    private String tKeyword4;
+    /**
+     * 备注
+     */
+    private String tRemark;
+    /**
+     * 跳转连接
+     */
+    private String tUrl;
+    /**
+     * 模板Id
+     */
+    private String templateId;
+    /**
+     * 状态
+     */
+    private int tStatus;
+
+}

+ 15 - 0
base-modules/service-system/service-system-biz/src/main/resources/application-verify.properties

@@ -0,0 +1,15 @@
+
+#================License Verify 证书验证配置E===============#
+
+#证书主题
+springboot.license.verify.subject=landi
+#公钥库证书条目别名
+springboot.license.verify.publicAlias=publiccert
+#证书公钥库存储路径(公钥库可以公开出去,但是私有密钥库一定要自己保存好,即私有密钥库要保存在creator模块中)
+springboot.license.verify.publicKeysStorePath=/publicCerts.store
+#证书公钥库访问密码
+springboot.license.verify.storePass=123456a
+#证书存放路径
+springboot.license.verify.licensePath=classpath:license2.lic
+
+#================License Verify 证书验证配置E===============#

+ 19 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/MceContentMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.system.mapper.MceContentMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.system.domain.MceContent">
+        <id column="id" property="id" />
+        <result column="info_title" property="infoTitle" />
+        <result column="info_content" property="infoContent" />
+        <result column="info_type" property="infoType" />
+        <result column="tenant_id" property="tenantId" />
+        <result column="dept_id" property="deptId" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+</mapper>

+ 22 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/MceReceiveMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.system.mapper.MceReceiveMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.system.domain.MceReceive">
+        <id column="id" property="id" />
+        <result column="receiver_id" property="receiverId" />
+        <result column="receiver_name" property="receiverName" />
+        <result column="info_type" property="infoType" />
+        <result column="read_flag" property="readFlag" />
+        <result column="content_id" property="contentId" />
+        <result column="module_id" property="moduleId" />
+        <result column="tenant_id" property="tenantId" />
+        <result column="dept_id" property="deptId" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+</mapper>

+ 19 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/MceSettingMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.system.mapper.MceSettingMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.system.domain.MceSetting">
+        <id column="id" property="id" />
+        <result column="app_mode" property="appMode" />
+        <result column="pc_mode" property="pcMode" />
+        <result column="wc_mode" property="wcMode" />
+        <result column="tenant_id" property="tenantId" />
+        <result column="dept_id" property="deptId" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+</mapper>

+ 2 - 2
docker/copy.sh

@@ -9,8 +9,8 @@ usage() {
 
 # copy sql
 echo "begin copy sql "
-cp ../sql/ry_20210908.sql ./mysql/db
-cp ../sql/usky-cloud-20230428.sql ./mysql/db
+cp ../sql/usky_cloud_20240222.sql ./mysql/db
+cp ../sql/usky_config.sql ./mysql/db
 
 # copy html
 echo "begin copy html "

+ 17 - 1
docker/deploy.sh

@@ -31,7 +31,7 @@ base(){
 
 # 启动程序模块(必须)
 modules(){
-	docker-compose up -d ruoyi-nginx ruoyi-gateway  ruoyi-modules-system
+	docker-compose up -d ruoyi-ui ruoyi-gateway  ruoyi-system
 }
 
 # 关闭所有环境/模块
@@ -44,6 +44,19 @@ rm(){
 	docker-compose rm
 }
 
+rm_data(){
+ rm -rf  mysql/data
+ rm -rf  nacos/logs
+ rm -rf	redis/data
+ rm -rf nginx/logs	
+ rm -rf	ruoyi/gateway/jar/gateway.jar
+ rm -rf	ruoyi/modules/file/jar/service-file.jar
+ rm -rf	ruoyi/modules/gen/jar/service-gen.jar
+ rm -rf	ruoyi/modules/job/jar/service-job.jar
+ rm -rf	ruoyi/modules/system/jar/service-system-biz.jar
+ rm -rf	ruoyi/visual/monitor/jar/monitor.jar
+}
+
 # 根据输入参数,选择执行对应方法,不输入则执行使用说明
 case "$1" in
 "port")
@@ -61,6 +74,9 @@ case "$1" in
 "rm")
 	rm
 ;;
+"rm_data")
+	rm_data
+;;
 *)
 	usage
 ;;

+ 28 - 31
docker/docker-compose.yml

@@ -5,15 +5,16 @@ services:
     image: nacos/nacos-server
     build:
       context: ./nacos
-    environment:
-      - MODE=standalone
+    #environment:
+    #  - MODE=standalone
     volumes:
       - ./nacos/logs/:/home/nacos/logs
       - ./nacos/conf/application.properties:/home/nacos/conf/application.properties
+      - /etc/localtime:/etc/localtime:ro
+      - /etc/hosts:/etc/hosts
     ports:
       - "8848:8848"
       - "9848:9848"
-      - "9849:9849"
     depends_on:
       - ruoyi-mysql
   ruoyi-mysql:
@@ -49,57 +50,53 @@ services:
       - ./redis/conf/redis.conf:/home/ruoyi/redis/redis.conf
       - ./redis/data:/data
     command: redis-server /home/ruoyi/redis/redis.conf
-  ruoyi-nginx:
-    container_name: ruoyi-nginx
+  ruoyi-ui:
+    container_name: ruoyi-ui
     image: nginx
     build:
       context: ./nginx
     ports:
       - "80:80"
     volumes:
+      - /etc/hosts:/etc/hosts
       - ./nginx/html/dist:/home/ruoyi/projects/ruoyi-ui
       - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
       - ./nginx/logs:/var/log/nginx
       - ./nginx/conf.d:/etc/nginx/conf.d
-#    depends_on:
-#      - ruoyi-gateway
-#    links:
-#      - ruoyi-gateway
   ruoyi-gateway:
     container_name: ruoyi-gateway
     build:
       context: ./ruoyi/gateway
       dockerfile: dockerfile
-    ports:
-      - "8080:8080"
+    network_mode: host
+      # ports:
+      # - "9150:9150"
+    volumes:
+      - /etc/localtime:/etc/localtime:ro
+      - /etc/hosts:/etc/hosts
     depends_on:
       - ruoyi-redis
-    links:
-      - ruoyi-redis
-#  ruoyi-auth:
-#    container_name: ruoyi-auth
-#    build:
-#      context: ./ruoyi/auth
-#      dockerfile: dockerfile
-#    ports:
-#      - "9200:9200"
-#    depends_on:
-#      - ruoyi-redis
-#    links:
-#      - ruoyi-redis
-  ruoyi-modules-system:
-    container_name: ruoyi-modules-system
+      - ruoyi-nacos
+    #links:
+    #  - ruoyi-redis
+  ruoyi-system:
+    container_name: ruoyi-system
     build:
       context: ./ruoyi/modules/system
       dockerfile: dockerfile
-    ports:
-      - "9201:9201"
+    network_mode: host
+      #ports:
+      # - "9886:9886"
+    volumes:
+      - /etc/localtime:/etc/localtime:ro
+      - /etc/hosts:/etc/hosts
     depends_on:
       - ruoyi-redis
       - ruoyi-mysql
-    links:
-      - ruoyi-redis
-      - ruoyi-mysql
+      - ruoyi-nacos
+   # links:
+   #   - ruoyi-redis
+   #   - ruoyi-mysql
   ruoyi-modules-gen:
     container_name: ruoyi-modules-gen
     build:

+ 0 - 1
docker/mysql/db/readme.txt

@@ -1 +0,0 @@
-存放sql目录下的所有脚本,用于docker自动执行。

+ 0 - 685
docker/mysql/db/ry_20210908.sql

@@ -1,685 +0,0 @@
-SET NAMES utf8mb4;
-
--- ----------------------------
--- 1、部门表
--- ----------------------------
-drop table if exists sys_dept;
-create table sys_dept (
-  dept_id           bigint(20)      not null auto_increment    comment '部门id',
-  parent_id         bigint(20)      default 0                  comment '父部门id',
-  ancestors         varchar(50)     default ''                 comment '祖级列表',
-  dept_name         varchar(30)     default ''                 comment '部门名称',
-  order_num         int(4)          default 0                  comment '显示顺序',
-  leader            varchar(20)     default null               comment '负责人',
-  phone             varchar(11)     default null               comment '联系电话',
-  email             varchar(50)     default null               comment '邮箱',
-  status            char(1)         default '0'                comment '部门状态(0正常 1停用)',
-  del_flag          char(1)         default '0'                comment '删除标志(0代表存在 2代表删除)',
-  create_by         varchar(64)     default ''                 comment '创建者',
-  create_time 	    datetime                                   comment '创建时间',
-  update_by         varchar(64)     default ''                 comment '更新者',
-  update_time       datetime                                   comment '更新时间',
-  primary key (dept_id)
-) engine=innodb auto_increment=200 comment = '部门表';
-
--- ----------------------------
--- 初始化-部门表数据
--- ----------------------------
-insert into sys_dept values(100,  0,   '0',          '若依科技',   0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(101,  100, '0,100',      '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(102,  100, '0,100',      '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(103,  101, '0,100,101',  '研发部门',   1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(104,  101, '0,100,101',  '市场部门',   2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(105,  101, '0,100,101',  '测试部门',   3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(106,  101, '0,100,101',  '财务部门',   4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(107,  101, '0,100,101',  '运维部门',   5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(108,  102, '0,100,102',  '市场部门',   1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-insert into sys_dept values(109,  102, '0,100,102',  '财务部门',   2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
-
-
--- ----------------------------
--- 2、用户信息表
--- ----------------------------
-drop table if exists sys_user;
-create table sys_user (
-  user_id           bigint(20)      not null auto_increment    comment '用户ID',
-  dept_id           bigint(20)      default null               comment '部门ID',
-  user_name         varchar(30)     not null                   comment '用户账号',
-  nick_name         varchar(30)     not null                   comment '用户昵称',
-  user_type         varchar(2)      default '00'               comment '用户类型(00系统用户)',
-  email             varchar(50)     default ''                 comment '用户邮箱',
-  phonenumber       varchar(11)     default ''                 comment '手机号码',
-  sex               char(1)         default '0'                comment '用户性别(0男 1女 2未知)',
-  avatar            varchar(100)    default ''                 comment '头像地址',
-  password          varchar(100)    default ''                 comment '密码',
-  status            char(1)         default '0'                comment '帐号状态(0正常 1停用)',
-  del_flag          char(1)         default '0'                comment '删除标志(0代表存在 2代表删除)',
-  login_ip          varchar(128)    default ''                 comment '最后登录IP',
-  login_date        datetime                                   comment '最后登录时间',
-  create_by         varchar(64)     default ''                 comment '创建者',
-  create_time       datetime                                   comment '创建时间',
-  update_by         varchar(64)     default ''                 comment '更新者',
-  update_time       datetime                                   comment '更新时间',
-  remark            varchar(500)    default null               comment '备注',
-  primary key (user_id)
-) engine=innodb auto_increment=100 comment = '用户信息表';
-
--- ----------------------------
--- 初始化-用户信息表数据
--- ----------------------------
-insert into sys_user values(1,  103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管理员');
-insert into sys_user values(2,  105, 'ry',    '若依', '00', 'ry@qq.com',  '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '测试员');
-
-
--- ----------------------------
--- 3、岗位信息表
--- ----------------------------
-drop table if exists sys_post;
-create table sys_post
-(
-  post_id       bigint(20)      not null auto_increment    comment '岗位ID',
-  post_code     varchar(64)     not null                   comment '岗位编码',
-  post_name     varchar(50)     not null                   comment '岗位名称',
-  post_sort     int(4)          not null                   comment '显示顺序',
-  status        char(1)         not null                   comment '状态(0正常 1停用)',
-  create_by     varchar(64)     default ''                 comment '创建者',
-  create_time   datetime                                   comment '创建时间',
-  update_by     varchar(64)     default ''			       comment '更新者',
-  update_time   datetime                                   comment '更新时间',
-  remark        varchar(500)    default null               comment '备注',
-  primary key (post_id)
-) engine=innodb comment = '岗位信息表';
-
--- ----------------------------
--- 初始化-岗位信息表数据
--- ----------------------------
-insert into sys_post values(1, 'ceo',  '董事长',    1, '0', 'admin', sysdate(), '', null, '');
-insert into sys_post values(2, 'se',   '项目经理',  2, '0', 'admin', sysdate(), '', null, '');
-insert into sys_post values(3, 'hr',   '人力资源',  3, '0', 'admin', sysdate(), '', null, '');
-insert into sys_post values(4, 'user', '普通员工',  4, '0', 'admin', sysdate(), '', null, '');
-
-
--- ----------------------------
--- 4、角色信息表
--- ----------------------------
-drop table if exists sys_role;
-create table sys_role (
-  role_id              bigint(20)      not null auto_increment    comment '角色ID',
-  role_name            varchar(30)     not null                   comment '角色名称',
-  role_key             varchar(100)    not null                   comment '角色权限字符串',
-  role_sort            int(4)          not null                   comment '显示顺序',
-  data_scope           char(1)         default '1'                comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
-  menu_check_strictly  tinyint(1)      default 1                  comment '菜单树选择项是否关联显示',
-  dept_check_strictly  tinyint(1)      default 1                  comment '部门树选择项是否关联显示',
-  status               char(1)         not null                   comment '角色状态(0正常 1停用)',
-  del_flag             char(1)         default '0'                comment '删除标志(0代表存在 2代表删除)',
-  create_by            varchar(64)     default ''                 comment '创建者',
-  create_time          datetime                                   comment '创建时间',
-  update_by            varchar(64)     default ''                 comment '更新者',
-  update_time          datetime                                   comment '更新时间',
-  remark               varchar(500)    default null               comment '备注',
-  primary key (role_id)
-) engine=innodb auto_increment=100 comment = '角色信息表';
-
--- ----------------------------
--- 初始化-角色信息表数据
--- ----------------------------
-insert into sys_role values('1', '超级管理员',  'admin',  1, 1, 1, 1, '0', '0', 'admin', sysdate(), '', null, '超级管理员');
-insert into sys_role values('2', '普通角色',    'common', 2, 2, 1, 1, '0', '0', 'admin', sysdate(), '', null, '普通角色');
-
-
--- ----------------------------
--- 5、菜单权限表
--- ----------------------------
-drop table if exists sys_menu;
-create table sys_menu (
-  menu_id           bigint(20)      not null auto_increment    comment '菜单ID',
-  menu_name         varchar(50)     not null                   comment '菜单名称',
-  parent_id         bigint(20)      default 0                  comment '父菜单ID',
-  order_num         int(4)          default 0                  comment '显示顺序',
-  path              varchar(200)    default ''                 comment '路由地址',
-  component         varchar(255)    default null               comment '组件路径',
-  query             varchar(255)    default null               comment '路由参数',
-  is_frame          int(1)          default 1                  comment '是否为外链(0是 1否)',
-  is_cache          int(1)          default 0                  comment '是否缓存(0缓存 1不缓存)',
-  menu_type         char(1)         default ''                 comment '菜单类型(M目录 C菜单 F按钮)',
-  visible           char(1)         default 0                  comment '菜单状态(0显示 1隐藏)',
-  status            char(1)         default 0                  comment '菜单状态(0正常 1停用)',
-  perms             varchar(100)    default null               comment '权限标识',
-  icon              varchar(100)    default '#'                comment '菜单图标',
-  create_by         varchar(64)     default ''                 comment '创建者',
-  create_time       datetime                                   comment '创建时间',
-  update_by         varchar(64)     default ''                 comment '更新者',
-  update_time       datetime                                   comment '更新时间',
-  remark            varchar(500)    default ''                 comment '备注',
-  primary key (menu_id)
-) engine=innodb auto_increment=2000 comment = '菜单权限表';
-
--- ----------------------------
--- 初始化-菜单信息表数据
--- ----------------------------
--- 一级菜单
-insert into sys_menu values('1', '系统管理', '0', '1', 'system',           null, '', 1, 0, 'M', '0', '0', '', 'system',   'admin', sysdate(), '', null, '系统管理目录');
-insert into sys_menu values('2', '系统监控', '0', '2', 'monitor',          null, '', 1, 0, 'M', '0', '0', '', 'monitor',  'admin', sysdate(), '', null, '系统监控目录');
-insert into sys_menu values('3', '系统工具', '0', '3', 'tool',             null, '', 1, 0, 'M', '0', '0', '', 'tool',     'admin', sysdate(), '', null, '系统工具目录');
-insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', null, '', 0, 0, 'M', '0', '0', '', 'guide',    'admin', sysdate(), '', null, '若依官网地址');
--- 二级菜单
-insert into sys_menu values('100',  '用户管理',       '1',   '1', 'user',       'system/user/index',                 '', 1, 0, 'C', '0', '0', 'system:user:list',        'user',          'admin', sysdate(), '', null, '用户管理菜单');
-insert into sys_menu values('101',  '角色管理',       '1',   '2', 'role',       'system/role/index',                 '', 1, 0, 'C', '0', '0', 'system:role:list',        'peoples',       'admin', sysdate(), '', null, '角色管理菜单');
-insert into sys_menu values('102',  '菜单管理',       '1',   '3', 'menu',       'system/menu/index',                 '', 1, 0, 'C', '0', '0', 'system:menu:list',        'tree-table',    'admin', sysdate(), '', null, '菜单管理菜单');
-insert into sys_menu values('103',  '部门管理',       '1',   '4', 'dept',       'system/dept/index',                 '', 1, 0, 'C', '0', '0', 'system:dept:list',        'tree',          'admin', sysdate(), '', null, '部门管理菜单');
-insert into sys_menu values('104',  '岗位管理',       '1',   '5', 'post',       'system/post/index',                 '', 1, 0, 'C', '0', '0', 'system:post:list',        'post',          'admin', sysdate(), '', null, '岗位管理菜单');
-insert into sys_menu values('105',  '字典管理',       '1',   '6', 'dict',       'system/dict/index',                 '', 1, 0, 'C', '0', '0', 'system:dict:list',        'dict',          'admin', sysdate(), '', null, '字典管理菜单');
-insert into sys_menu values('106',  '参数设置',       '1',   '7', 'config',     'system/config/index',               '', 1, 0, 'C', '0', '0', 'system:config:list',      'edit',          'admin', sysdate(), '', null, '参数设置菜单');
-insert into sys_menu values('107',  '通知公告',       '1',   '8', 'notice',     'system/notice/index',               '', 1, 0, 'C', '0', '0', 'system:notice:list',      'message',       'admin', sysdate(), '', null, '通知公告菜单');
-insert into sys_menu values('108',  '日志管理',       '1',   '9', 'log',        '',                                  '', 1, 0, 'M', '0', '0', '',                        'log',           'admin', sysdate(), '', null, '日志管理菜单');
-insert into sys_menu values('109',  '在线用户',       '2',   '1', 'online',     'monitor/online/index',              '', 1, 0, 'C', '0', '0', 'monitor:online:list',     'online',        'admin', sysdate(), '', null, '在线用户菜单');
-insert into sys_menu values('110',  '定时任务',       '2',   '2', 'job',        'monitor/job/index',                 '', 1, 0, 'C', '0', '0', 'monitor:job:list',        'job',           'admin', sysdate(), '', null, '定时任务菜单');
-insert into sys_menu values('111',  'Sentinel控制台', '2',   '3', 'http://localhost:8718',        '',                '', 0, 0, 'C', '0', '0', 'monitor:sentinel:list',   'sentinel',      'admin', sysdate(), '', null, '流量控制菜单');
-insert into sys_menu values('112',  'Nacos控制台',    '2',   '4', 'http://localhost:8848/nacos',  '',                '', 0, 0, 'C', '0', '0', 'monitor:nacos:list',      'nacos',         'admin', sysdate(), '', null, '服务治理菜单');
-insert into sys_menu values('113',  'Admin控制台',    '2',   '5', 'http://localhost:9100/login',  '',                '', 0, 0, 'C', '0', '0', 'monitor:server:list',     'server',        'admin', sysdate(), '', null, '服务监控菜单');
-insert into sys_menu values('114',  '表单构建',       '3',   '1', 'build',      'tool/build/index',                  '', 1, 0, 'C', '0', '0', 'tool:build:list',         'build',         'admin', sysdate(), '', null, '表单构建菜单');
-insert into sys_menu values('115',  '代码生成',       '3',   '2', 'gen',        'tool/gen/index',                    '', 1, 0, 'C', '0', '0', 'tool:gen:list',           'code',          'admin', sysdate(), '', null, '代码生成菜单');
-insert into sys_menu values('116',  '系统接口',       '3',   '3', 'http://localhost:8080/swagger-ui/index.html', '', '', 0, 0, 'C', '0', '0', 'tool:swagger:list',       'swagger',       'admin', sysdate(), '', null, '系统接口菜单');
--- 三级菜单
-insert into sys_menu values('500',  '操作日志', '108', '1', 'operlog',    'system/operlog/index',    '', 1, 0, 'C', '0', '0', 'system:operlog:list',    'form',          'admin', sysdate(), '', null, '操作日志菜单');
-insert into sys_menu values('501',  '登录日志', '108', '2', 'logininfor', 'system/logininfor/index', '', 1, 0, 'C', '0', '0', 'system:logininfor:list', 'logininfor',    'admin', sysdate(), '', null, '登录日志菜单');
--- 用户管理按钮
-insert into sys_menu values('1001', '用户查询', '100', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1002', '用户新增', '100', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1003', '用户修改', '100', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1004', '用户删除', '100', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1005', '用户导出', '100', '5',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:export',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1006', '用户导入', '100', '6',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:import',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1007', '重置密码', '100', '7',  '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd',       '#', 'admin', sysdate(), '', null, '');
--- 角色管理按钮
-insert into sys_menu values('1008', '角色查询', '101', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1009', '角色新增', '101', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1010', '角色修改', '101', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1011', '角色删除', '101', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1012', '角色导出', '101', '5',  '', '', '', 1, 0, 'F', '0', '0', 'system:role:export',         '#', 'admin', sysdate(), '', null, '');
--- 菜单管理按钮
-insert into sys_menu values('1013', '菜单查询', '102', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1014', '菜单新增', '102', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1015', '菜单修改', '102', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1016', '菜单删除', '102', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove',         '#', 'admin', sysdate(), '', null, '');
--- 部门管理按钮
-insert into sys_menu values('1017', '部门查询', '103', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1018', '部门新增', '103', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1019', '部门修改', '103', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1020', '部门删除', '103', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove',         '#', 'admin', sysdate(), '', null, '');
--- 岗位管理按钮
-insert into sys_menu values('1021', '岗位查询', '104', '1',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1022', '岗位新增', '104', '2',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1023', '岗位修改', '104', '3',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1024', '岗位删除', '104', '4',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1025', '岗位导出', '104', '5',  '', '', '', 1, 0, 'F', '0', '0', 'system:post:export',         '#', 'admin', sysdate(), '', null, '');
--- 字典管理按钮
-insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export',         '#', 'admin', sysdate(), '', null, '');
--- 参数设置按钮
-insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query',        '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove',       '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export',       '#', 'admin', sysdate(), '', null, '');
--- 通知公告按钮
-insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query',        '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove',       '#', 'admin', sysdate(), '', null, '');
--- 操作日志按钮
-insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:query',       '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:remove',      '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:operlog:export',      '#', 'admin', sysdate(), '', null, '');
--- 登录日志按钮
-insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:query',    '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:remove',   '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:logininfor:export',   '#', 'admin', sysdate(), '', null, '');
--- 在线用户按钮
-insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query',       '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, '');
--- 定时任务按钮
-insert into sys_menu values('1049', '任务查询', '110', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query',          '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1050', '任务新增', '110', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1051', '任务修改', '110', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1052', '任务删除', '110', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove',         '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1053', '状态修改', '110', '5', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus',   '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1054', '任务导出', '110', '7', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export',         '#', 'admin', sysdate(), '', null, '');
--- 代码生成按钮
-insert into sys_menu values('1055', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query',             '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit',              '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1057', '生成删除', '115', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1058', '导入代码', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import',            '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1059', '预览代码', '115', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview',           '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values('1060', '生成代码', '115', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code',              '#', 'admin', sysdate(), '', null, '');
-
-
--- ----------------------------
--- 6、用户和角色关联表  用户N-1角色
--- ----------------------------
-drop table if exists sys_user_role;
-create table sys_user_role (
-  user_id   bigint(20) not null comment '用户ID',
-  role_id   bigint(20) not null comment '角色ID',
-  primary key(user_id, role_id)
-) engine=innodb comment = '用户和角色关联表';
-
--- ----------------------------
--- 初始化-用户和角色关联表数据
--- ----------------------------
-insert into sys_user_role values ('1', '1');
-insert into sys_user_role values ('2', '2');
-
-
--- ----------------------------
--- 7、角色和菜单关联表  角色1-N菜单
--- ----------------------------
-drop table if exists sys_role_menu;
-create table sys_role_menu (
-  role_id   bigint(20) not null comment '角色ID',
-  menu_id   bigint(20) not null comment '菜单ID',
-  primary key(role_id, menu_id)
-) engine=innodb comment = '角色和菜单关联表';
-
--- ----------------------------
--- 初始化-角色和菜单关联表数据
--- ----------------------------
-insert into sys_role_menu values ('2', '1');
-insert into sys_role_menu values ('2', '2');
-insert into sys_role_menu values ('2', '3');
-insert into sys_role_menu values ('2', '4');
-insert into sys_role_menu values ('2', '100');
-insert into sys_role_menu values ('2', '101');
-insert into sys_role_menu values ('2', '102');
-insert into sys_role_menu values ('2', '103');
-insert into sys_role_menu values ('2', '104');
-insert into sys_role_menu values ('2', '105');
-insert into sys_role_menu values ('2', '106');
-insert into sys_role_menu values ('2', '107');
-insert into sys_role_menu values ('2', '108');
-insert into sys_role_menu values ('2', '109');
-insert into sys_role_menu values ('2', '110');
-insert into sys_role_menu values ('2', '111');
-insert into sys_role_menu values ('2', '112');
-insert into sys_role_menu values ('2', '113');
-insert into sys_role_menu values ('2', '114');
-insert into sys_role_menu values ('2', '115');
-insert into sys_role_menu values ('2', '116');
-insert into sys_role_menu values ('2', '500');
-insert into sys_role_menu values ('2', '501');
-insert into sys_role_menu values ('2', '1000');
-insert into sys_role_menu values ('2', '1001');
-insert into sys_role_menu values ('2', '1002');
-insert into sys_role_menu values ('2', '1003');
-insert into sys_role_menu values ('2', '1004');
-insert into sys_role_menu values ('2', '1005');
-insert into sys_role_menu values ('2', '1006');
-insert into sys_role_menu values ('2', '1007');
-insert into sys_role_menu values ('2', '1008');
-insert into sys_role_menu values ('2', '1009');
-insert into sys_role_menu values ('2', '1010');
-insert into sys_role_menu values ('2', '1011');
-insert into sys_role_menu values ('2', '1012');
-insert into sys_role_menu values ('2', '1013');
-insert into sys_role_menu values ('2', '1014');
-insert into sys_role_menu values ('2', '1015');
-insert into sys_role_menu values ('2', '1016');
-insert into sys_role_menu values ('2', '1017');
-insert into sys_role_menu values ('2', '1018');
-insert into sys_role_menu values ('2', '1019');
-insert into sys_role_menu values ('2', '1020');
-insert into sys_role_menu values ('2', '1021');
-insert into sys_role_menu values ('2', '1022');
-insert into sys_role_menu values ('2', '1023');
-insert into sys_role_menu values ('2', '1024');
-insert into sys_role_menu values ('2', '1025');
-insert into sys_role_menu values ('2', '1026');
-insert into sys_role_menu values ('2', '1027');
-insert into sys_role_menu values ('2', '1028');
-insert into sys_role_menu values ('2', '1029');
-insert into sys_role_menu values ('2', '1030');
-insert into sys_role_menu values ('2', '1031');
-insert into sys_role_menu values ('2', '1032');
-insert into sys_role_menu values ('2', '1033');
-insert into sys_role_menu values ('2', '1034');
-insert into sys_role_menu values ('2', '1035');
-insert into sys_role_menu values ('2', '1036');
-insert into sys_role_menu values ('2', '1037');
-insert into sys_role_menu values ('2', '1038');
-insert into sys_role_menu values ('2', '1039');
-insert into sys_role_menu values ('2', '1040');
-insert into sys_role_menu values ('2', '1041');
-insert into sys_role_menu values ('2', '1042');
-insert into sys_role_menu values ('2', '1043');
-insert into sys_role_menu values ('2', '1044');
-insert into sys_role_menu values ('2', '1045');
-insert into sys_role_menu values ('2', '1046');
-insert into sys_role_menu values ('2', '1047');
-insert into sys_role_menu values ('2', '1048');
-insert into sys_role_menu values ('2', '1049');
-insert into sys_role_menu values ('2', '1050');
-insert into sys_role_menu values ('2', '1051');
-insert into sys_role_menu values ('2', '1052');
-insert into sys_role_menu values ('2', '1053');
-insert into sys_role_menu values ('2', '1054');
-insert into sys_role_menu values ('2', '1055');
-insert into sys_role_menu values ('2', '1056');
-insert into sys_role_menu values ('2', '1057');
-insert into sys_role_menu values ('2', '1058');
-insert into sys_role_menu values ('2', '1059');
-insert into sys_role_menu values ('2', '1060');
-
--- ----------------------------
--- 8、角色和部门关联表  角色1-N部门
--- ----------------------------
-drop table if exists sys_role_dept;
-create table sys_role_dept (
-  role_id   bigint(20) not null comment '角色ID',
-  dept_id   bigint(20) not null comment '部门ID',
-  primary key(role_id, dept_id)
-) engine=innodb comment = '角色和部门关联表';
-
--- ----------------------------
--- 初始化-角色和部门关联表数据
--- ----------------------------
-insert into sys_role_dept values ('2', '100');
-insert into sys_role_dept values ('2', '101');
-insert into sys_role_dept values ('2', '105');
-
-
--- ----------------------------
--- 9、用户与岗位关联表  用户1-N岗位
--- ----------------------------
-drop table if exists sys_user_post;
-create table sys_user_post
-(
-  user_id   bigint(20) not null comment '用户ID',
-  post_id   bigint(20) not null comment '岗位ID',
-  primary key (user_id, post_id)
-) engine=innodb comment = '用户与岗位关联表';
-
--- ----------------------------
--- 初始化-用户与岗位关联表数据
--- ----------------------------
-insert into sys_user_post values ('1', '1');
-insert into sys_user_post values ('2', '2');
-
-
--- ----------------------------
--- 10、操作日志记录
--- ----------------------------
-drop table if exists sys_oper_log;
-create table sys_oper_log (
-  oper_id           bigint(20)      not null auto_increment    comment '日志主键',
-  title             varchar(50)     default ''                 comment '模块标题',
-  business_type     int(2)          default 0                  comment '业务类型(0其它 1新增 2修改 3删除)',
-  method            varchar(100)    default ''                 comment '方法名称',
-  request_method    varchar(10)     default ''                 comment '请求方式',
-  operator_type     int(1)          default 0                  comment '操作类别(0其它 1后台用户 2手机端用户)',
-  oper_name         varchar(50)     default ''                 comment '操作人员',
-  dept_name         varchar(50)     default ''                 comment '部门名称',
-  oper_url          varchar(255)    default ''                 comment '请求URL',
-  oper_ip           varchar(128)    default ''                 comment '主机地址',
-  oper_location     varchar(255)    default ''                 comment '操作地点',
-  oper_param        varchar(2000)   default ''                 comment '请求参数',
-  json_result       varchar(2000)   default ''                 comment '返回参数',
-  status            int(1)          default 0                  comment '操作状态(0正常 1异常)',
-  error_msg         varchar(2000)   default ''                 comment '错误消息',
-  oper_time         datetime                                   comment '操作时间',
-  primary key (oper_id)
-) engine=innodb auto_increment=100 comment = '操作日志记录';
-
-
--- ----------------------------
--- 11、字典类型表
--- ----------------------------
-drop table if exists sys_dict_type;
-create table sys_dict_type
-(
-  dict_id          bigint(20)      not null auto_increment    comment '字典主键',
-  dict_name        varchar(100)    default ''                 comment '字典名称',
-  dict_type        varchar(100)    default ''                 comment '字典类型',
-  status           char(1)         default '0'                comment '状态(0正常 1停用)',
-  create_by        varchar(64)     default ''                 comment '创建者',
-  create_time      datetime                                   comment '创建时间',
-  update_by        varchar(64)     default ''                 comment '更新者',
-  update_time      datetime                                   comment '更新时间',
-  remark           varchar(500)    default null               comment '备注',
-  primary key (dict_id),
-  unique (dict_type)
-) engine=innodb auto_increment=100 comment = '字典类型表';
-
-insert into sys_dict_type values(1,  '用户性别', 'sys_user_sex',        '0', 'admin', sysdate(), '', null, '用户性别列表');
-insert into sys_dict_type values(2,  '菜单状态', 'sys_show_hide',       '0', 'admin', sysdate(), '', null, '菜单状态列表');
-insert into sys_dict_type values(3,  '系统开关', 'sys_normal_disable',  '0', 'admin', sysdate(), '', null, '系统开关列表');
-insert into sys_dict_type values(4,  '任务状态', 'sys_job_status',      '0', 'admin', sysdate(), '', null, '任务状态列表');
-insert into sys_dict_type values(5,  '任务分组', 'sys_job_group',       '0', 'admin', sysdate(), '', null, '任务分组列表');
-insert into sys_dict_type values(6,  '系统是否', 'sys_yes_no',          '0', 'admin', sysdate(), '', null, '系统是否列表');
-insert into sys_dict_type values(7,  '通知类型', 'sys_notice_type',     '0', 'admin', sysdate(), '', null, '通知类型列表');
-insert into sys_dict_type values(8,  '通知状态', 'sys_notice_status',   '0', 'admin', sysdate(), '', null, '通知状态列表');
-insert into sys_dict_type values(9,  '操作类型', 'sys_oper_type',       '0', 'admin', sysdate(), '', null, '操作类型列表');
-insert into sys_dict_type values(10, '系统状态', 'sys_common_status',   '0', 'admin', sysdate(), '', null, '登录状态列表');
-
--- ----------------------------
--- 12、字典数据表
--- ----------------------------
-drop table if exists sys_dict_data;
-create table sys_dict_data
-(
-  dict_code        bigint(20)      not null auto_increment    comment '字典编码',
-  dict_sort        int(4)          default 0                  comment '字典排序',
-  dict_label       varchar(100)    default ''                 comment '字典标签',
-  dict_value       varchar(100)    default ''                 comment '字典键值',
-  dict_type        varchar(100)    default ''                 comment '字典类型',
-  css_class        varchar(100)    default null               comment '样式属性(其他样式扩展)',
-  list_class       varchar(100)    default null               comment '表格回显样式',
-  is_default       char(1)         default 'N'                comment '是否默认(Y是 N否)',
-  status           char(1)         default '0'                comment '状态(0正常 1停用)',
-  create_by        varchar(64)     default ''                 comment '创建者',
-  create_time      datetime                                   comment '创建时间',
-  update_by        varchar(64)     default ''                 comment '更新者',
-  update_time      datetime                                   comment '更新时间',
-  remark           varchar(500)    default null               comment '备注',
-  primary key (dict_code)
-) engine=innodb auto_increment=100 comment = '字典数据表';
-
-insert into sys_dict_data values(1,  1,  '男',       '0',       'sys_user_sex',        '',   '',        'Y', '0', 'admin', sysdate(), '', null, '性别男');
-insert into sys_dict_data values(2,  2,  '女',       '1',       'sys_user_sex',        '',   '',        'N', '0', 'admin', sysdate(), '', null, '性别女');
-insert into sys_dict_data values(3,  3,  '未知',     '2',       'sys_user_sex',        '',   '',        'N', '0', 'admin', sysdate(), '', null, '性别未知');
-insert into sys_dict_data values(4,  1,  '显示',     '0',       'sys_show_hide',       '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '显示菜单');
-insert into sys_dict_data values(5,  2,  '隐藏',     '1',       'sys_show_hide',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '隐藏菜单');
-insert into sys_dict_data values(6,  1,  '正常',     '0',       'sys_normal_disable',  '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
-insert into sys_dict_data values(7,  2,  '停用',     '1',       'sys_normal_disable',  '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '停用状态');
-insert into sys_dict_data values(8,  1,  '正常',     '0',       'sys_job_status',      '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
-insert into sys_dict_data values(9,  2,  '暂停',     '1',       'sys_job_status',      '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '停用状态');
-insert into sys_dict_data values(10, 1,  '默认',     'DEFAULT', 'sys_job_group',       '',   '',        'Y', '0', 'admin', sysdate(), '', null, '默认分组');
-insert into sys_dict_data values(11, 2,  '系统',     'SYSTEM',  'sys_job_group',       '',   '',        'N', '0', 'admin', sysdate(), '', null, '系统分组');
-insert into sys_dict_data values(12, 1,  '是',       'Y',       'sys_yes_no',          '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '系统默认是');
-insert into sys_dict_data values(13, 2,  '否',       'N',       'sys_yes_no',          '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '系统默认否');
-insert into sys_dict_data values(14, 1,  '通知',     '1',       'sys_notice_type',     '',   'warning', 'Y', '0', 'admin', sysdate(), '', null, '通知');
-insert into sys_dict_data values(15, 2,  '公告',     '2',       'sys_notice_type',     '',   'success', 'N', '0', 'admin', sysdate(), '', null, '公告');
-insert into sys_dict_data values(16, 1,  '正常',     '0',       'sys_notice_status',   '',   'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
-insert into sys_dict_data values(17, 2,  '关闭',     '1',       'sys_notice_status',   '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '关闭状态');
-insert into sys_dict_data values(18, 1,  '新增',     '1',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', sysdate(), '', null, '新增操作');
-insert into sys_dict_data values(19, 2,  '修改',     '2',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', sysdate(), '', null, '修改操作');
-insert into sys_dict_data values(20, 3,  '删除',     '3',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '删除操作');
-insert into sys_dict_data values(21, 4,  '授权',     '4',       'sys_oper_type',       '',   'primary', 'N', '0', 'admin', sysdate(), '', null, '授权操作');
-insert into sys_dict_data values(22, 5,  '导出',     '5',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', sysdate(), '', null, '导出操作');
-insert into sys_dict_data values(23, 6,  '导入',     '6',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', sysdate(), '', null, '导入操作');
-insert into sys_dict_data values(24, 7,  '强退',     '7',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '强退操作');
-insert into sys_dict_data values(25, 8,  '生成代码', '8',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', sysdate(), '', null, '生成操作');
-insert into sys_dict_data values(26, 9,  '清空数据', '9',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '清空操作');
-insert into sys_dict_data values(27, 1,  '成功',     '0',       'sys_common_status',   '',   'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态');
-insert into sys_dict_data values(28, 2,  '失败',     '1',       'sys_common_status',   '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '停用状态');
-
-
--- ----------------------------
--- 13、参数配置表
--- ----------------------------
-drop table if exists sys_config;
-create table sys_config (
-  config_id         int(5)          not null auto_increment    comment '参数主键',
-  config_name       varchar(100)    default ''                 comment '参数名称',
-  config_key        varchar(100)    default ''                 comment '参数键名',
-  config_value      varchar(500)    default ''                 comment '参数键值',
-  config_type       char(1)         default 'N'                comment '系统内置(Y是 N否)',
-  create_by         varchar(64)     default ''                 comment '创建者',
-  create_time       datetime                                   comment '创建时间',
-  update_by         varchar(64)     default ''                 comment '更新者',
-  update_time       datetime                                   comment '更新时间',
-  remark            varchar(500)    default null               comment '备注',
-  primary key (config_id)
-) engine=innodb auto_increment=100 comment = '参数配置表';
-
-insert into sys_config values(1, '主框架页-默认皮肤样式名称',     'sys.index.skinName',       'skin-blue',     'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
-insert into sys_config values(2, '用户管理-账号初始密码',         'sys.user.initPassword',    '123456',        'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
-insert into sys_config values(3, '主框架页-侧边栏主题',           'sys.index.sideTheme',      'theme-dark',    'Y', 'admin', sysdate(), '', null, '深色主题theme-dark,浅色主题theme-light' );
-insert into sys_config values(4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false',         'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)');
-
-
--- ----------------------------
--- 14、系统访问记录
--- ----------------------------
-drop table if exists sys_logininfor;
-create table sys_logininfor (
-  info_id        bigint(20)     not null auto_increment   comment '访问ID',
-  user_name      varchar(50)    default ''                comment '用户账号',
-  ipaddr         varchar(128)   default ''                comment '登录IP地址',
-  status         char(1)        default '0'               comment '登录状态(0成功 1失败)',
-  msg            varchar(255)   default ''                comment '提示信息',
-  access_time    datetime                                 comment '访问时间',
-  primary key (info_id)
-) engine=innodb auto_increment=100 comment = '系统访问记录';
-
-
--- ----------------------------
--- 15、定时任务调度表
--- ----------------------------
-drop table if exists sys_job;
-create table sys_job (
-  job_id              bigint(20)    not null auto_increment    comment '任务ID',
-  job_name            varchar(64)   default ''                 comment '任务名称',
-  job_group           varchar(64)   default 'DEFAULT'          comment '任务组名',
-  invoke_target       varchar(500)  not null                   comment '调用目标字符串',
-  cron_expression     varchar(255)  default ''                 comment 'cron执行表达式',
-  misfire_policy      varchar(20)   default '3'                comment '计划执行错误策略(1立即执行 2执行一次 3放弃执行)',
-  concurrent          char(1)       default '1'                comment '是否并发执行(0允许 1禁止)',
-  status              char(1)       default '0'                comment '状态(0正常 1暂停)',
-  create_by           varchar(64)   default ''                 comment '创建者',
-  create_time         datetime                                 comment '创建时间',
-  update_by           varchar(64)   default ''                 comment '更新者',
-  update_time         datetime                                 comment '更新时间',
-  remark              varchar(500)  default ''                 comment '备注信息',
-  primary key (job_id, job_name, job_group)
-) engine=innodb auto_increment=100 comment = '定时任务调度表';
-
-insert into sys_job values(1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams',        '0/10 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
-insert into sys_job values(2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')',  '0/15 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
-insert into sys_job values(3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)',  '0/20 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
-
-
--- ----------------------------
--- 16、定时任务调度日志表
--- ----------------------------
-drop table if exists sys_job_log;
-create table sys_job_log (
-  job_log_id          bigint(20)     not null auto_increment    comment '任务日志ID',
-  job_name            varchar(64)    not null                   comment '任务名称',
-  job_group           varchar(64)    not null                   comment '任务组名',
-  invoke_target       varchar(500)   not null                   comment '调用目标字符串',
-  job_message         varchar(500)                              comment '日志信息',
-  status              char(1)        default '0'                comment '执行状态(0正常 1失败)',
-  exception_info      varchar(2000)  default ''                 comment '异常信息',
-  create_time         datetime                                  comment '创建时间',
-  primary key (job_log_id)
-) engine=innodb comment = '定时任务调度日志表';
-
-
--- ----------------------------
--- 17、通知公告表
--- ----------------------------
-drop table if exists sys_notice;
-create table sys_notice (
-  notice_id         int(4)          not null auto_increment    comment '公告ID',
-  notice_title      varchar(50)     not null                   comment '公告标题',
-  notice_type       char(1)         not null                   comment '公告类型(1通知 2公告)',
-  notice_content    longblob        default null               comment '公告内容',
-  status            char(1)         default '0'                comment '公告状态(0正常 1关闭)',
-  create_by         varchar(64)     default ''                 comment '创建者',
-  create_time       datetime                                   comment '创建时间',
-  update_by         varchar(64)     default ''                 comment '更新者',
-  update_time       datetime                                   comment '更新时间',
-  remark            varchar(255)    default null               comment '备注',
-  primary key (notice_id)
-) engine=innodb auto_increment=10 comment = '通知公告表';
-
--- ----------------------------
--- 初始化-公告信息表数据
--- ----------------------------
-insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员');
-insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容',   '0', 'admin', sysdate(), '', null, '管理员');
-
-
--- ----------------------------
--- 18、代码生成业务表
--- ----------------------------
-drop table if exists gen_table;
-create table gen_table (
-  table_id          bigint(20)      not null auto_increment    comment '编号',
-  table_name        varchar(200)    default ''                 comment '表名称',
-  table_comment     varchar(500)    default ''                 comment '表描述',
-  sub_table_name    varchar(64)     default null               comment '关联子表的表名',
-  sub_table_fk_name varchar(64)     default null               comment '子表关联的外键名',
-  class_name        varchar(100)    default ''                 comment '实体类名称',
-  tpl_category      varchar(200)    default 'crud'             comment '使用的模板(crud单表操作 tree树表操作)',
-  package_name      varchar(100)                               comment '生成包路径',
-  module_name       varchar(30)                                comment '生成模块名',
-  business_name     varchar(30)                                comment '生成业务名',
-  function_name     varchar(50)                                comment '生成功能名',
-  function_author   varchar(50)                                comment '生成功能作者',
-  gen_type          char(1)         default '0'                comment '生成代码方式(0zip压缩包 1自定义路径)',
-  gen_path          varchar(200)    default '/'                comment '生成路径(不填默认项目路径)',
-  options           varchar(1000)                              comment '其它生成选项',
-  create_by         varchar(64)     default ''                 comment '创建者',
-  create_time 	    datetime                                   comment '创建时间',
-  update_by         varchar(64)     default ''                 comment '更新者',
-  update_time       datetime                                   comment '更新时间',
-  remark            varchar(500)    default null               comment '备注',
-  primary key (table_id)
-) engine=innodb auto_increment=1 comment = '代码生成业务表';
-
-
--- ----------------------------
--- 19、代码生成业务表字段
--- ----------------------------
-drop table if exists gen_table_column;
-create table gen_table_column (
-  column_id         bigint(20)      not null auto_increment    comment '编号',
-  table_id          varchar(64)                                comment '归属表编号',
-  column_name       varchar(200)                               comment '列名称',
-  column_comment    varchar(500)                               comment '列描述',
-  column_type       varchar(100)                               comment '列类型',
-  java_type         varchar(500)                               comment 'JAVA类型',
-  java_field        varchar(200)                               comment 'JAVA字段名',
-  is_pk             char(1)                                    comment '是否主键(1是)',
-  is_increment      char(1)                                    comment '是否自增(1是)',
-  is_required       char(1)                                    comment '是否必填(1是)',
-  is_insert         char(1)                                    comment '是否为插入字段(1是)',
-  is_edit           char(1)                                    comment '是否编辑字段(1是)',
-  is_list           char(1)                                    comment '是否列表字段(1是)',
-  is_query          char(1)                                    comment '是否查询字段(1是)',
-  query_type        varchar(200)    default 'EQ'               comment '查询方式(等于、不等于、大于、小于、范围)',
-  html_type         varchar(200)                               comment '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)',
-  dict_type         varchar(200)    default ''                 comment '字典类型',
-  sort              int                                        comment '排序',
-  create_by         varchar(64)     default ''                 comment '创建者',
-  create_time 	    datetime                                   comment '创建时间',
-  update_by         varchar(64)     default ''                 comment '更新者',
-  update_time       datetime                                   comment '更新时间',
-  primary key (column_id)
-) engine=innodb auto_increment=1 comment = '代码生成业务表字段';

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 38
docker/mysql/db/ry_config_20220114.sql


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 406
docker/mysql/db/usky-cloud-20230428.sql


Dosya farkı çok büyük olduğundan ihmal edildi
+ 900 - 0
docker/mysql/db/usky_cloud_20240222.sql


+ 169 - 14
docker/nacos/conf/application.properties

@@ -1,32 +1,187 @@
+#
+# Copyright 1999-2021 Alibaba Group Holding Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#*************** Spring Boot Related Configurations ***************#
+### Default web context path:
+server.servlet.contextPath=/nacos
+### Include message field
+server.error.include-message=ALWAYS
+### Default web server port:
+server.port=8848
+#*************** Network Related Configurations ***************#
+### If prefer hostname over ip for Nacos server addresses in cluster.conf:
+# nacos.inetutils.prefer-hostname-over-ip=false
+### Specify local server's IP:
+# nacos.inetutils.ip-address=
+#*************** Config Module Related Configurations ***************#
+### Deprecated configuration property, it is recommended to use `spring.sql.init.platform` replaced.
+#spring.datasource.platform=${SPRING_DATASOURCE_PLATFORM:}
 spring.datasource.platform=mysql
+#spring.sql.init.platform=${SPRING_DATASOURCE_PLATFORM:}
+# nacos.plugin.datasource.log.=
+### Count of lB
 db.num=1
-db.url.0=jdbc:mysql://localhost:3306/usky-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
-db.user= usky 
-db.password= Yt#75Usky 
+### Connect URL of DB:
+db.url.0=jdbc:mysql://usky-cloud-nacos:3306/usky_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
+db.user.0=root
+db.password.0=password
 
+### Connection pool configuration: hikariCP
+db.pool.config.connectionTimeout=30000
+db.pool.config.validationTimeout=10000
+db.pool.config.maximumPoolSize=20
+db.pool.config.minimumIdle=2
+#*************** Naming Module Related Configurations ***************#
+### Data dispatch task execution period in milliseconds:
+### If enable data warmup. If set to false, the server would accept request without local data preparation:
+# nacos.naming.data.warmup=true
+### If enable the instance auto expiration, kind like of health check of instance:
+# nacos.naming.expireInstance=true
+### will be removed and replaced by `nacos.naming.clean` properties
 nacos.naming.empty-service.auto-clean=true
 nacos.naming.empty-service.clean.initial-delay-ms=50000
 nacos.naming.empty-service.clean.period-time-ms=30000
-
-management.endpoints.web.exposure.include=*
-
+### Add in 2.0.0
+### The interval to clean empty service, unit: milliseconds.
+# nacos.naming.clean.empty-service.interval=60000
+### The expired time to clean empty service, unit: milliseconds.
+# nacos.naming.clean.empty-service.expired-time=60000
+### The interval to clean expired metadata, unit: milliseconds.
+# nacos.naming.clean.expired-metadata.interval=5000
+### The expired time to clean metadata, unit: milliseconds.
+# nacos.naming.clean.expired-metadata.expired-time=60000
+### The delay time before push task to execute from service changed, unit: milliseconds.
+# nacos.naming.push.pushTaskDelay=500
+### The timeout for push task execute, unit: milliseconds.
+# nacos.naming.push.pushTaskTimeout=5000
+### The delay time for retrying failed push task, unit: milliseconds.
+# nacos.naming.push.pushTaskRetryDelay=1000
+### Since 2.0.3
+### The expired time for inactive client, unit: milliseconds.
+# nacos.naming.client.expired.time=180000
+#*************** CMDB Module Related Configurations ***************#
+### The interval to dump external CMDB in seconds:
+# nacos.cmdb.dumpTaskInterval=3600
+### The interval of polling data change event in seconds:
+# nacos.cmdb.eventTaskInterval=10
+### The interval of loading labels in seconds:
+# nacos.cmdb.labelTaskInterval=300
+### If turn on data loading task:
+# nacos.cmdb.loadDataAtStart=false
+#*************** Metrics Related Configurations ***************#
+### Metrics for prometheus
+#management.endpoints.web.exposure.include=*
+### Metrics for elastic search
 management.metrics.export.elastic.enabled=false
+#management.metrics.export.elastic.host=http://localhost:9200
+### Metrics for influx
 management.metrics.export.influx.enabled=false
-
+#management.metrics.export.influx.db=springboot
+#management.metrics.export.influx.uri=http://localhost:8086
+#management.metrics.export.influx.auto-create-db=true
+#management.metrics.export.influx.consistency=one
+#management.metrics.export.influx.compressed=true
+#*************** Access Log Related Configurations ***************#
+### If turn on the access log:
 server.tomcat.accesslog.enabled=true
+### accesslog automatic cleaning time
+server.tomcat.accesslog.max-days=30
+### The access log pattern:
 server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
-
-server.tomcat.basedir=
-
+### The directory of access log:
+server.tomcat.basedir=file:.
+#*************** Access Control Related Configurations ***************#
+### If enable spring security, this option is deprecated in 1.2.0:
+#spring.security.enabled=false
+### The ignore urls of auth, is deprecated in 1.2.0:
 nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
-
+### The auth system to use, currently only 'nacos' and 'ldap' is supported:
 nacos.core.auth.system.type=nacos
+### If turn on auth system:
 nacos.core.auth.enabled=false
-nacos.core.auth.default.token.expire.seconds=18000
-nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
+### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay.
 nacos.core.auth.caching.enabled=true
+### Since 1.4.1, Turn on/off white auth for user-agent: nacos-server, only for upgrade from old version.
 nacos.core.auth.enable.userAgentAuthWhite=false
+### Since 1.4.1, worked when nacos.core.auth.enabled=true and nacos.core.auth.enable.userAgentAuthWhite=false.
+### The two properties is the white list for auth and used by identity the request from other server.
 nacos.core.auth.server.identity.key=serverIdentity
 nacos.core.auth.server.identity.value=security
-
+### worked when nacos.core.auth.system.type=nacos
+### The token expiration in seconds:
+nacos.core.auth.plugin.nacos.token.expire.seconds=18000
+### The default token (Base64 string):
+nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
+### worked when nacos.core.auth.system.type=ldap?{0} is Placeholder,replace login username
+#nacos.core.auth.ldap.url=ldap://localhost:389
+#nacos.core.auth.ldap.basedc=dc=example,dc=org
+#nacos.core.auth.ldap.userDn=cn=admin,${nacos.core.auth.ldap.basedc}
+#nacos.core.auth.ldap.password=admin
+#nacos.core.auth.ldap.userdn=cn={0},dc=example,dc=org
+#nacos.core.auth.ldap.filter.prefix=uid
+#nacos.core.auth.ldap.case.sensitive=true
+#*************** Istio Related Configurations ***************#
+### If turn on the MCP server:
 nacos.istio.mcp.server.enabled=false
+###*************** Add from 1.3.0 ***************###
+#*************** Core Related Configurations ***************#
+### set the WorkerID manually
+# nacos.core.snowflake.worker-id=
+### Member-MetaData
+# nacos.core.member.meta.site=
+# nacos.core.member.meta.adweight=
+# nacos.core.member.meta.weight=
+### MemberLookup
+### Addressing pattern category, If set, the priority is highest
+# nacos.core.member.lookup.type=[file,address-server]
+## Set the cluster list with a configuration file or command-line argument
+# nacos.member.list=192.168.16.101:8847?raft_port=8807,192.168.16.101?raft_port=8808,192.168.16.101:8849?raft_port=8809
+## for AddressServerMemberLookup
+# Maximum number of retries to query the address server upon initialization
+# nacos.core.address-server.retry=5
+## Server domain name address of [address-server] mode
+# address.server.domain=jmenv.tbsite.net
+## Server port of [address-server] mode
+# address.server.port=8080
+## Request address of [address-server] mode
+# address.server.url=/nacos/serverlist
+#*************** JRaft Related Configurations ***************#
+### Sets the Raft cluster election timeout, default value is 5 second
+# nacos.core.protocol.raft.data.election_timeout_ms=5000
+### Sets the amount of time the Raft snapshot will execute periodically, default is 30 minute
+# nacos.core.protocol.raft.data.snapshot_interval_secs=30
+### raft internal worker threads
+# nacos.core.protocol.raft.data.core_thread_num=8
+### Number of threads required for raft business request processing
+# nacos.core.protocol.raft.data.cli_service_thread_num=4
+### raft linear read strategy. Safe linear reads are used by default, that is, the Leader tenure is confirmed by heartbeat
+# nacos.core.protocol.raft.data.read_index_type=ReadOnlySafe
+### rpc request timeout, default 5 seconds
+# nacos.core.protocol.raft.data.rpc_request_timeout_ms=5000
+#*************** Distro Related Configurations ***************#
+### Distro data sync delay time, when sync task delayed, task will be merged for same data key. Default 1 second.
+# nacos.core.protocol.distro.data.sync.delayMs=1000
+### Distro data sync timeout for one sync data, default 3 seconds.
+# nacos.core.protocol.distro.data.sync.timeoutMs=3000
+### Distro data sync retry delay time when sync data failed or timeout, same behavior with delayMs, default 3 seconds.
+# nacos.core.protocol.distro.data.sync.retryDelayMs=3000
+### Distro data verify interval time, verify synced data whether expired for a interval. Default 5 seconds.
+# nacos.core.protocol.distro.data.verify.intervalMs=5000
+### Distro data verify timeout for one verify, default 3 seconds.
+# nacos.core.protocol.distro.data.verify.timeoutMs=3000
+### Distro data load retry delay when load snapshot data failed, default 30 seconds.
+# nacos.core.protocol.distro.data.load.retryDelayMs=30000
+### enable to support prometheus service discovery
+#nacos.prometheus.metrics.enabled=true

+ 32 - 0
docker/nacos/conf/application.properties.bak

@@ -0,0 +1,32 @@
+spring.datasource.platform=mysql
+db.num=1
+db.url.0=jdbc:mysql://usky-cloud-nacos:3306/usky_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
+db.user= root 
+db.password= password 
+
+nacos.naming.empty-service.auto-clean=true
+nacos.naming.empty-service.clean.initial-delay-ms=50000
+nacos.naming.empty-service.clean.period-time-ms=30000
+
+management.endpoints.web.exposure.include=*
+
+management.metrics.export.elastic.enabled=false
+management.metrics.export.influx.enabled=false
+
+server.tomcat.accesslog.enabled=true
+server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
+
+server.tomcat.basedir=
+
+nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
+
+nacos.core.auth.system.type=nacos
+nacos.core.auth.enabled=false
+nacos.core.auth.default.token.expire.seconds=18000
+nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
+nacos.core.auth.caching.enabled=true
+nacos.core.auth.enable.userAgentAuthWhite=false
+nacos.core.auth.server.identity.key=serverIdentity
+nacos.core.auth.server.identity.value=security
+
+nacos.istio.mcp.server.enabled=false

+ 1 - 1
docker/nacos/dockerfile

@@ -1,5 +1,5 @@
 # 基础镜像
-FROM nacos/nacos-server
+FROM nacos/nacos-server:v2.3.0
 # author
 MAINTAINER ruoyi
 

+ 17 - 10
docker/nginx/conf/nginx.conf

@@ -14,23 +14,30 @@ http {
         listen       80;
         server_name  localhost;
 
-		location / {
+     location / {
             root   /home/ruoyi/projects/ruoyi-ui;
 			try_files $uri $uri/ /index.html;
             index  index.html index.htm;
-        }
+      }
 		
-		location /prod-api/{
-			proxy_set_header Host $http_host;
-			proxy_set_header X-Real-IP $remote_addr;
-			proxy_set_header REMOTE-HOST $remote_addr;
-			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-			proxy_pass http://localhost:8080/;
-		}
+      location /prod-api/{
+		proxy_set_header Host $http_host;
+		proxy_set_header X-Real-IP $remote_addr;
+		proxy_set_header REMOTE-HOST $remote_addr;
+		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+		proxy_pass http://usky-cloud-gateway:9150/;
+      }
+      location /dev-api/{
+		proxy_set_header Host $http_host;
+		proxy_set_header X-Real-IP $remote_addr;
+		proxy_set_header REMOTE-HOST $remote_addr;
+		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+		proxy_pass http://usky-cloud-gateway:9150/;
+      }
 
         error_page   500 502 503 504  /50x.html;
         location = /50x.html {
             root   html;
         }
     }
-}
+}

+ 0 - 1
docker/nginx/html/dist/readme.txt

@@ -1 +0,0 @@
-存放前端ruoyi-ui构建好的静态文件,用于nginx请求访问。

+ 2 - 4
sql/ry_config_20220114.sql

@@ -1,11 +1,9 @@
-DROP DATABASE IF EXISTS `ry-config`;
-
-CREATE DATABASE  `ry-config` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
+DROP DATABASE IF EXISTS `CREATE DATABASE  `usky-config` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
 
 SET NAMES utf8mb4;
 SET FOREIGN_KEY_CHECKS = 0;
 
-USE `ry-config`;
+USE `usky-config`;
 
 /******************************************/
 /*   表名称 = config_info   */

Dosya farkı çok büyük olduğundan ihmal edildi
+ 900 - 0
sql/usky_cloud_20240222.sql


Dosya farkı çok büyük olduğundan ihmal edildi
+ 41 - 0
sql/usky_config.sql


Dosya farkı çok büyük olduğundan ihmal edildi
+ 40 - 0
sql/usky_config_20240222.sql


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor