Browse Source

初版代码合并

songyh 3 năm trước cách đây
mục cha
commit
7b9e1cf0de
100 tập tin đã thay đổi với 5053 bổ sung12043 xóa
  1. 15 5
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/entity/SysUser.java
  2. 1117 92
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java
  3. 0 86
      jeecg-boot-common/pom.xml
  4. 0 24
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/JeecgBootCommonApplication.java
  5. 0 106
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java
  6. 0 41
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/MaterialImageVideoInfo.java
  7. 0 78
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/Product.java
  8. 0 146
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysAnnouncement.java
  9. 0 48
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysAnnouncementSend.java
  10. 0 58
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysCategory.java
  11. 0 120
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDataSource.java
  12. 0 186
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepart.java
  13. 0 50
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepartPermission.java
  14. 0 70
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepartRole.java
  15. 0 54
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepartRolePermission.java
  16. 0 80
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDictItem.java
  17. 0 112
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysLog.java
  18. 0 183
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysPermission.java
  19. 0 223
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysUser.java
  20. 0 49
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysUserRole.java
  21. 0 57
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java
  22. 0 174
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java
  23. 0 21
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementMapper.java
  24. 0 28
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementSendMapper.java
  25. 0 31
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysCategoryMapper.java
  26. 0 62
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysDepartMapper.java
  27. 0 56
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysPermissionMapper.java
  28. 0 20
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserDepartMapper.java
  29. 0 189
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserMapper.java
  30. 0 50
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserRoleMapper.java
  31. 0 21
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysCategoryMapper.xml
  32. 0 64
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysDepartMapper.xml
  33. 0 124
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysPermissionMapper.xml
  34. 0 27
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserDepartMapper.xml
  35. 0 340
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml
  36. 0 83
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/material/service/impl/MaterialVideoFrameServiceImpl.java
  37. 0 60
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/message/entity/SysMessage.java
  38. 0 108
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/message/websocket/WebSocket.java
  39. 0 79
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/AnnouncementSendModel.java
  40. 0 66
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/DepartIdModel.java
  41. 0 394
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/SysDepartTreeModel.java
  42. 0 23
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/SysUserSysDepartModel.java
  43. 0 176
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/TreeModel.java
  44. 0 93
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/TreeSelectModel.java
  45. 0 41
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/IMaterialCutFrameService.java
  46. 0 335
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysBaseApi.java
  47. 0 24
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysDepartRoleService.java
  48. 0 107
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysDepartService.java
  49. 0 22
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysUserDepartService.java
  50. 0 277
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysUserService.java
  51. 0 24
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/IUserCompanyService.java
  52. 0 318
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java
  53. 0 74
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java
  54. 0 171
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  55. 0 874
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  56. 0 87
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/RefreshTokenServiceImpl.java
  57. 0 56
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/RuleDataAccountKuaishouServiceImpl.java
  58. 0 59
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/RuleDataAccountServiceImpl.java
  59. 0 702
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysBaseApiImpl.java
  60. 0 24
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysDepartRoleServiceImpl.java
  61. 0 488
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysDepartServiceImpl.java
  62. 0 178
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserDepartServiceImpl.java
  63. 0 548
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java
  64. 0 113
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/UserCompanyServiceImpl.java
  65. 0 309
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/CloudVideoProcessUtil.java
  66. 0 794
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/ConverterUtils.java
  67. 0 148
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/CosUtil.java
  68. 0 90
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java
  69. 0 133
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/FindsDepartsChildrenUtil.java
  70. 0 634
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java
  71. 0 547
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils2.java
  72. 0 146
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/JavacvUtil.java
  73. 0 217
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/ParseInstallPackageUtil.java
  74. 0 95
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/PermissionDataUtil.java
  75. 0 51
      jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/RandomUtil.java
  76. 0 122
      jeecg-boot-common/src/main/resources/application.yml
  77. 0 8
      jeecg-boot-common/src/main/resources/config.properties
  78. 0 57
      jeecg-boot-common/src/main/resources/logback-test.xml
  79. 0 13
      jeecg-boot-common/src/test/java/com/example/jeecgbootcommon/JeecgBootCommonApplicationTests.java
  80. 102 0
      jeecg-boot-module-system/pom.xml
  81. 354 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java
  82. 289 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventSendController.java
  83. 248 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmRuleRecordController.java
  84. 386 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountTemplateController.java
  85. 270 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountThresholdController.java
  86. 257 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleBaseController.java
  87. 246 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleConditionController.java
  88. 350 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleGroupController.java
  89. 256 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleIndicatorController.java
  90. 96 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleSwitchController.java
  91. 408 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleTemplateController.java
  92. 84 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventSend.java
  93. 119 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmRuleRecord.java
  94. 59 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleAccountTemplate.java
  95. 67 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleAccountThreshold.java
  96. 83 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleBase.java
  97. 63 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleCondition.java
  98. 89 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleGroup.java
  99. 95 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleIndicator.java
  100. 0 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleTemplate.java

+ 15 - 5
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/entity/SysUser.java

@@ -28,17 +28,14 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 public class SysUser implements Serializable {
-
     private static final long serialVersionUID = 1L;
 
     /**
      * id
      */
-    @TableId(type = IdType.UUID)
+    @TableId(type = IdType.ASSIGN_ID)
     private String id;
 
-    private String departId;
-
     /**
      * 登录账号
      */
@@ -80,7 +77,7 @@ public class SysUser implements Serializable {
     /**
      * 性别(1:男 2:女)
      */
-    @Excel(name = "性别", width = 15, dicCode = "sex")
+    @Excel(name = "性别", width = 15,dicCode="sex")
     @Dict(dicCode = "sex")
     private Integer sex;
 
@@ -101,6 +98,9 @@ public class SysUser implements Serializable {
      */
     private String orgCode;
 
+    /**部门名称*/
+    private transient String orgCodeTxt;
+
     /**
      * 状态(1:正常  2:冻结 )
      */
@@ -125,6 +125,7 @@ public class SysUser implements Serializable {
      * 职务,关联职务表
      */
     @Excel(name = "职务", width = 15)
+    @Dict(dictTable ="sys_position",dicText = "name",dicCode = "code")
     private String post;
 
     /**
@@ -170,6 +171,13 @@ public class SysUser implements Serializable {
     @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
     private String departIds;
 
+    /**
+     * 多租户id配置,编辑用户的时候设置
+     */
+    private String relTenantIds;
+
+    /**设备id uniapp推送用*/
+    private String clientId;
 
     /**
      * 第三方登录的唯一标识
@@ -220,4 +228,6 @@ public class SysUser implements Serializable {
      */
     private String leaderName;
 
+    private String departId;
+
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1117 - 92
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java


+ 0 - 86
jeecg-boot-common/pom.xml

@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>jeecg-boot-parent</artifactId>
-        <groupId>org.jeecgframework.boot</groupId>
-        <version>2.4.5</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>jeecg-boot-common</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>jeecg-boot-base-core</artifactId>
-        </dependency>
-        <!--引入微服务启动依赖 starter-->
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>jeecg-boot-starter-cloud</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>jeecg-system-local-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpmime</artifactId>
-            <version>4.5.10</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.qcloud</groupId>
-            <artifactId>cos_api</artifactId>
-            <version>5.6.25</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.tencentcloudapi</groupId>
-            <artifactId>tencentcloud-sdk-java</artifactId>
-            <version>3.1.62</version>
-
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>easyexcel</artifactId>
-            <version>1.1.2-beat1</version>
-        </dependency>
-        <dependency>
-            <groupId>com.github.tony19</groupId>
-            <artifactId>apktool-lib</artifactId>
-            <version>1.4.4-3</version>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>com.github.binarywang</groupId>
-            <artifactId>weixin-java-cp</artifactId>
-            <version>3.6.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.googlecode.plist</groupId>
-            <artifactId>dd-plist</artifactId>
-            <version>1.16</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>thirtpart</groupId>
-            <artifactId>jave</artifactId>
-            <version>1.0</version>
-            <scope>system</scope>
-            <systemPath>${project.basedir}/src/main/resources/lib/jave-1.0.jar</systemPath>
-        </dependency>
-
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 24
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/JeecgBootCommonApplication.java

@@ -1,24 +0,0 @@
-package cn.com.ctop.common.module;
-
-import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
-import org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration;
-import org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration;
-import org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.annotation.ComponentScan;
-
-@SpringBootApplication(exclude = {ShiroAnnotationProcessorAutoConfiguration.class, ShiroAutoConfiguration.class, ShiroBeanAutoConfiguration.class})
-@EnableDubbo
-@EnableFeignClients(basePackages ={"org.jeecg","cn.com.ctop.common.module"})
-@MapperScan(value={"cn.com.ctop.common.module.**.mapper*"})
-@ComponentScan(basePackages = {"cn.com.ctop.common.module","org.jeecg"})
-public class JeecgBootCommonApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(JeecgBootCommonApplication.class, args);
-    }
-
-}

+ 0 - 106
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java

@@ -1,106 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-import java.util.Date;
-
-/**
- * 账号绑定-登陆
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-07-31
- */
-@Data
-@TableName("ctop_bind_account_login")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_bind_account_login对象", description = "账号绑定-登陆")
-public class BindAccountLogin {
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "主键ID")
-    private Long id;
-    /**
-     * 广告id
-     */
-    @Excel(name = "广告id", width = 15)
-    @ApiModelProperty(value = "广告id")
-    private String advertiserId;
-
-    /**
-     * 广告名称
-     */
-    @Excel(name = "广告名称", width = 15)
-    @ApiModelProperty(value = "广告名称")
-    private String advertiserName;
-    /**
-     * 广告id
-     */
-    @Excel(name = "平台账户id", width = 15)
-    @ApiModelProperty(value = "平台账户id")
-    private String accountId;
-
-    @Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
-    private String userId;
-    /**
-     * 账号
-     */
-    @Excel(name = "账号", width = 15)
-    @ApiModelProperty(value = "账号")
-    private String accountName;
-    /**
-     * 密码
-     */
-    @Excel(name = "密码", width = 15)
-    @ApiModelProperty(value = "密码")
-    private String password;
-    /**
-     * 登录方式
-     */
-    @Excel(name = "登录方式", width = 15)
-    @ApiModelProperty(value = "登录方式")
-    private String loginType;
-    /**
-     * 1未登陆 2已登陆
-     */
-    @Excel(name = "1未登陆 2已登陆", width = 15)
-    @ApiModelProperty(value = "1未登陆 2已登陆")
-    private String status;
-    /**
-     * 创建时间
-     */
-    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-    /**
-     * 修改时间
-     */
-    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "修改时间")
-    private Date updateTime;
-
-    private String cookie;
-
-    public BindAccountLogin(Long id,String accountName) {
-        this.id = id;
-        this.accountName = accountName;
-    }
-
-    public BindAccountLogin() {
-    }
-
-    private Long projectId;
-}

+ 0 - 41
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/MaterialImageVideoInfo.java

@@ -1,41 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-/**
- * 视频封面关联表信息
- * @author jeecg-boot
- * @date   2020-12-17
- * @version V1.0
- */
-@Data
-@TableName("ctop_material_image_video_info")
-public class MaterialImageVideoInfo {
-    
-	/**id*/
-	@TableId(type = IdType.AUTO)
-	private java.lang.Long id;
-	/**视频md5码*/
-	@Excel(name = "视频md5码", width = 15)
-	private java.lang.String videoCode;
-	/**封面md5码*/
-	@Excel(name = "封面md5码", width = 15)
-	private java.lang.String coverCode;
-	/**createTime*/
-	private java.util.Date createTime;
-	/**updateTime*/
-	private java.util.Date updateTime;
-}

+ 0 - 78
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/Product.java

@@ -1,78 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-import java.util.Date;
-
-/**
- * 产品表
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-09-08
- */
-@Data
-@TableName("ctop_product")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_product对象", description = "产品表")
-public class Product {
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "id")
-    private Long id;
-    /**
-     * 产品名
-     */
-    @Excel(name = "产品名", width = 15)
-    @ApiModelProperty(value = "产品名")
-    private String productName;
-    /**
-     * advertiserId
-     */
-    @Excel(name = "advertiserId", width = 15)
-    @ApiModelProperty(value = "advertiserId")
-    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
-    private String advertiserId;
-    /**
-     * 创建人
-     */
-    @Excel(name = "创建人", width = 15)
-    @ApiModelProperty(value = "创建人")
-    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
-    private String userId;
-
-    @Dict(dicCode = "id", dictTable = "sys_category", dicText = "name")
-    private String industryId;
-    /**
-     * 1正常0删除
-     */
-    @Excel(name = "1正常0删除", width = 15)
-    @ApiModelProperty(value = "1正常0删除")
-    private Integer productStatus;
-    /**
-     * createTime
-     */
-    @ApiModelProperty(value = "createTime")
-    private Date createTime;
-    /**
-     * updateTime
-     */
-    @ApiModelProperty(value = "updateTime")
-    private Date updateTime;
-    @TableField(exist = false)
-    private String advertiserName;
-}

+ 0 - 146
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysAnnouncement.java

@@ -1,146 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-
-/**
- * @Description: 系统通告表
- * @Author: jeecg-boot
- * @Date:  2019-01-02
- * @Version: V1.0
- */
-@Data
-@TableName("sys_announcement")
-public class SysAnnouncement implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.ID_WORKER_STR)
-    private java.lang.String id;
-    /**
-     * 标题
-     */
-    @Excel(name = "标题", width = 15)
-    private java.lang.String titile;
-    /**
-     * 内容
-     */
-    @Excel(name = "内容", width = 30)
-    private java.lang.String msgContent;
-    /**
-     * 开始时间
-     */
-    @Excel(name = "开始时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private java.util.Date startTime;
-    /**
-     * 结束时间
-     */
-    @Excel(name = "结束时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private java.util.Date endTime;
-    /**
-     * 发布人
-     */
-    @Excel(name = "发布人", width = 15)
-    private java.lang.String sender;
-    /**
-     * 优先级(L低,M中,H高)
-     */
-    @Excel(name = "优先级", width = 15, dicCode = "priority")
-    @Dict(dicCode = "priority")
-    private java.lang.String priority;
-
-    /**
-     * 消息类型1:通知公告2:系统消息
-     */
-    @Excel(name = "消息类型", width = 15, dicCode = "msg_category")
-    @Dict(dicCode = "msg_category")
-    private java.lang.String msgCategory;
-    /**
-     * 通告对象类型(USER:指定用户,ALL:全体用户)
-     */
-    @Excel(name = "通告对象类型", width = 15, dicCode = "msg_type")
-    @Dict(dicCode = "msg_type")
-    private java.lang.String msgType;
-    /**
-     * 发布状态(0未发布,1已发布,2已撤销)
-     */
-    @Excel(name = "发布状态", width = 15, dicCode = "send_status")
-    @Dict(dicCode = "send_status")
-    private java.lang.String sendStatus;
-    /**
-     * 发布时间
-     */
-    @Excel(name = "发布时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private java.util.Date sendTime;
-    /**
-     * 撤销时间
-     */
-    @Excel(name = "撤销时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private java.util.Date cancelTime;
-    /**
-     * 删除状态(0,正常,1已删除)
-     */
-    private java.lang.String delFlag;
-    /**
-     * 创建人
-     */
-    private java.lang.String createBy;
-    /**
-     * 创建时间
-     */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private java.util.Date createTime;
-    /**
-     * 更新人
-     */
-    private java.lang.String updateBy;
-    /**
-     * 更新时间
-     */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private java.util.Date updateTime;
-    /**
-     * 指定用户
-     **/
-    private java.lang.String userIds;
-    /**
-     * 业务类型(email:邮件 bpm:流程)
-     */
-    private java.lang.String busType;
-    /**
-     * 业务id
-     */
-    private java.lang.String busId;
-    /**
-     * 打开方式 组件:component 路由:url
-     */
-    private java.lang.String openType;
-    /**
-     * 组件/路由 地址
-     */
-    private java.lang.String openPage;
-    /**
-     * 摘要
-     */
-    private java.lang.String msgAbstract;
-}

+ 0 - 48
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysAnnouncementSend.java

@@ -1,48 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
-
-/**
- * @Description: 用户通告阅读标记表
- * @Author: jeecg-boot
- * @Date:  2019-02-21
- * @Version: V1.0
- */
-@Data
-@TableName("sys_announcement_send")
-public class SysAnnouncementSend implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**id*/
-	@TableId(type = IdType.ID_WORKER_STR)
-	private java.lang.String id;
-	/**通告id*/
-	private java.lang.String anntId;
-	/**用户id*/
-	private java.lang.String userId;
-	/**阅读状态(0未读,1已读)*/
-	private java.lang.String readFlag;
-	/**阅读时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private java.util.Date readTime;
-	/**创建人*/
-	private java.lang.String createBy;
-	/**创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private java.util.Date createTime;
-	/**更新人*/
-	private java.lang.String updateBy;
-	/**更新时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private java.util.Date updateTime;
-}

+ 0 - 58
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysCategory.java

@@ -1,58 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-
-/**
- * @Description: 分类字典
- * @Author: jeecg-boot
- * @Date:   2019-05-29
- * @Version: V1.0
- */
-@Data
-@TableName("sys_category")
-public class SysCategory implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**主键*/
-	@TableId(type = IdType.ID_WORKER_STR)
-	private java.lang.String id;
-	/**父级节点*/
-	@Excel(name = "父级节点", width = 15)
-	private java.lang.String pid;
-	/**类型名称*/
-	@Excel(name = "类型名称", width = 15)
-	private java.lang.String name;
-	/**类型编码*/
-	@Excel(name = "类型编码", width = 15)
-	private java.lang.String code;
-	/**创建人*/
-	@Excel(name = "创建人", width = 15)
-	private java.lang.String createBy;
-	/**创建日期*/
-	@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private java.util.Date createTime;
-	/**更新人*/
-	@Excel(name = "更新人", width = 15)
-	private java.lang.String updateBy;
-	/**更新日期*/
-	@Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private java.util.Date updateTime;
-	/**所属部门*/
-	@Excel(name = "所属部门", width = 15)
-	private java.lang.String sysOrgCode;
-	/**是否有子节点*/
-	@Excel(name = "是否有子节点", width = 15)
-	private java.lang.String hasChild;
-}

+ 0 - 120
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDataSource.java

@@ -1,120 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-/**
- * @Description: 多数据源管理
- * @Author: jeecg-boot
- * @Date: 2019-12-25
- * @Version: V1.0
- */
-@Data
-@TableName("sys_data_source")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "sys_data_source对象", description = "多数据源管理")
-public class SysDataSource {
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.ID_WORKER_STR)
-    @ApiModelProperty(value = "id")
-    private java.lang.String id;
-    /**
-     * 数据源编码
-     */
-    @Excel(name = "数据源编码", width = 15)
-    @ApiModelProperty(value = "数据源编码")
-    private java.lang.String code;
-    /**
-     * 数据源名称
-     */
-    @Excel(name = "数据源名称", width = 15)
-    @ApiModelProperty(value = "数据源名称")
-    private java.lang.String name;
-    /**
-     * 描述
-     */
-    @Excel(name = "备注", width = 15)
-    @ApiModelProperty(value = "备注")
-    private java.lang.String remark;
-    /**
-     * 数据库类型
-     */
-    @Dict(dicCode = "database_type")
-    @Excel(name = "数据库类型", width = 15, dicCode = "database_type")
-    @ApiModelProperty(value = "数据库类型")
-    private java.lang.String dbType;
-    /**
-     * 驱动类
-     */
-    @Excel(name = "驱动类", width = 15)
-    @ApiModelProperty(value = "驱动类")
-    private java.lang.String dbDriver;
-    /**
-     * 数据源地址
-     */
-    @Excel(name = "数据源地址", width = 15)
-    @ApiModelProperty(value = "数据源地址")
-    private java.lang.String dbUrl;
-    /**
-     * 数据库名称
-     */
-    @Excel(name = "数据库名称", width = 15)
-    @ApiModelProperty(value = "数据库名称")
-    private java.lang.String dbName;
-    /**
-     * 用户名
-     */
-    @Excel(name = "用户名", width = 15)
-    @ApiModelProperty(value = "用户名")
-    private java.lang.String dbUsername;
-    /**
-     * 密码
-     */
-    @Excel(name = "密码", width = 15)
-    @ApiModelProperty(value = "密码")
-    private java.lang.String dbPassword;
-    /**
-     * 创建人
-     */
-    @ApiModelProperty(value = "创建人")
-    private java.lang.String createBy;
-    /**
-     * 创建日期
-     */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "创建日期")
-    private java.util.Date createTime;
-    /**
-     * 更新人
-     */
-    @ApiModelProperty(value = "更新人")
-    private java.lang.String updateBy;
-    /**
-     * 更新日期
-     */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "更新日期")
-    private java.util.Date updateTime;
-    /**
-     * 所属部门
-     */
-    @Excel(name = "所属部门", width = 15)
-    @ApiModelProperty(value = "所属部门")
-    private java.lang.String sysOrgCode;
-}

+ 0 - 186
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepart.java

@@ -1,186 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Objects;
-
-/**
- * <p>
- * 部门表
- * <p>
- *
- * @Author Steve
- * @Since 2019-01-22
- */
-@Data
-@TableName("sys_depart")
-public class SysDepart implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * ID
-     */
-    @TableId(type = IdType.ID_WORKER_STR)
-    private String id;
-    /**
-     * 父机构ID
-     */
-    private String parentId;
-    /**
-     * 机构/部门名称
-     */
-    @Excel(name = "机构/部门名称", width = 15)
-    private String departName;
-    /**
-     * 英文名
-     */
-    @Excel(name = "英文名", width = 15)
-    private String departNameEn;
-    /**
-     * 缩写
-     */
-    private String departNameAbbr;
-    /**
-     * 排序
-     */
-    @Excel(name = "排序", width = 15)
-    private Integer departOrder;
-    /**
-     * 描述
-     */
-    @Excel(name = "描述", width = 15)
-    private String description;
-    /**
-     * 机构类别 1组织机构,2岗位
-     */
-    @Excel(name = "机构类别", width = 15, dicCode = "org_category")
-    private String orgCategory;
-    /**
-     * 机构类型
-     */
-    private String orgType;
-    /**
-     * 机构编码
-     */
-    @Excel(name = "机构编码", width = 15)
-    private String orgCode;
-    /**
-     * 手机号
-     */
-    @Excel(name = "手机号", width = 15)
-    private String mobile;
-    /**
-     * 传真
-     */
-    @Excel(name = "传真", width = 15)
-    private String fax;
-    /**
-     * 地址
-     */
-    @Excel(name = "地址", width = 15)
-    private String address;
-    /**
-     * 备注
-     */
-    @Excel(name = "备注", width = 15)
-    private String memo;
-    /**
-     * 状态(1启用,0不启用)
-     */
-    @Dict(dicCode = "depart_status")
-    private String status;
-    /**
-     * 删除状态(0,正常,1已删除)
-     */
-    @Dict(dicCode = "del_flag")
-    private String delFlag;
-    /**
-     * 创建人
-     */
-    private String createBy;
-    /**
-     * 创建日期
-     */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date createTime;
-    /**
-     * 更新人
-     */
-    private String updateBy;
-    /**
-     * 更新日期
-     */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date updateTime;
-    /**
-     * 领导 ID
-     */
-    private String leaderId;
-
-    @TableField(exist = false)
-    private String title;
-
-    /**
-     * 领导姓名
-     */
-    private String leaderName;
-
-    /**
-     * 重写equals方法
-     */
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-        if (!super.equals(o)) {
-            return false;
-        }
-        SysDepart depart = (SysDepart) o;
-        return Objects.equals(id, depart.id) &&
-                Objects.equals(parentId, depart.parentId) &&
-                Objects.equals(departName, depart.departName) &&
-                Objects.equals(departNameEn, depart.departNameEn) &&
-                Objects.equals(departNameAbbr, depart.departNameAbbr) &&
-                Objects.equals(departOrder, depart.departOrder) &&
-                Objects.equals(description, depart.description) &&
-                Objects.equals(orgType, depart.orgType) &&
-                Objects.equals(orgCode, depart.orgCode) &&
-                Objects.equals(mobile, depart.mobile) &&
-                Objects.equals(fax, depart.fax) &&
-                Objects.equals(address, depart.address) &&
-                Objects.equals(memo, depart.memo) &&
-                Objects.equals(status, depart.status) &&
-                Objects.equals(delFlag, depart.delFlag) &&
-                Objects.equals(createBy, depart.createBy) &&
-                Objects.equals(createTime, depart.createTime) &&
-                Objects.equals(updateBy, depart.updateBy) &&
-                Objects.equals(updateTime, depart.updateTime);
-    }
-
-    /**
-     * 重写hashCode方法
-     */
-    @Override
-    public int hashCode() {
-        return Objects.hash(super.hashCode(), id, parentId, departName,
-                departNameEn, departNameAbbr, departOrder, description,
-                orgType, orgCode, mobile, fax, address, memo, status,
-                delFlag, createBy, createTime, updateBy, updateTime);
-    }
-}

+ 0 - 50
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepartPermission.java

@@ -1,50 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-/**
- * @Description: 部门权限表
- * @Author: jeecg-boot
- * @Date:   2020-02-11
- * @Version: V1.0
- */
-@Data
-@TableName("sys_depart_permission")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value="sys_depart_permission对象", description="部门权限表")
-public class SysDepartPermission {
-
-	/**id*/
-	@TableId(type = IdType.ID_WORKER_STR)
-    @ApiModelProperty(value = "id")
-	private java.lang.String id;
-	/**部门id*/
-	@Excel(name = "部门id", width = 15)
-    @ApiModelProperty(value = "部门id")
-	private java.lang.String departId;
-	/**权限id*/
-	@Excel(name = "权限id", width = 15)
-    @ApiModelProperty(value = "权限id")
-	private java.lang.String permissionId;
-	/**数据规则id*/
-	@ApiModelProperty(value = "数据规则id")
-	private java.lang.String dataRuleIds;
-
-	public SysDepartPermission() {
-
-	}
-
-	public SysDepartPermission(String departId, String permissionId) {
-		this.departId = departId;
-		this.permissionId = permissionId;
-	}
-}

+ 0 - 70
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepartRole.java

@@ -1,70 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-/**
- * @Description: 部门角色
- * @Author: jeecg-boot
- * @Date:   2020-02-12
- * @Version: V1.0
- */
-@Data
-@TableName("sys_depart_role")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value="sys_depart_role对象", description="部门角色")
-public class SysDepartRole {
-
-	/**id*/
-	@TableId(type = IdType.ID_WORKER_STR)
-    @ApiModelProperty(value = "id")
-	private String id;
-	/**部门id*/
-	@Excel(name = "部门id", width = 15)
-	@ApiModelProperty(value = "部门id")
-	@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
-	private String departId;
-	/**部门角色名称*/
-	@Excel(name = "部门角色名称", width = 15)
-    @ApiModelProperty(value = "部门角色名称")
-	private String roleName;
-	/**部门角色编码*/
-	@Excel(name = "部门角色编码", width = 15)
-    @ApiModelProperty(value = "部门角色编码")
-	private String roleCode;
-	/**描述*/
-	@Excel(name = "描述", width = 15)
-    @ApiModelProperty(value = "描述")
-	private String description;
-	/**创建人*/
-	@Excel(name = "创建人", width = 15)
-    @ApiModelProperty(value = "创建人")
-	private String createBy;
-	/**创建时间*/
-	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "创建时间")
-	private java.util.Date createTime;
-	/**更新人*/
-	@Excel(name = "更新人", width = 15)
-    @ApiModelProperty(value = "更新人")
-	private String updateBy;
-	/**更新时间*/
-	@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "更新时间")
-	private java.util.Date updateTime;
-}

+ 0 - 54
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDepartRolePermission.java

@@ -1,54 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-/**
- * @Description: 部门角色权限
- * @Author: jeecg-boot
- * @Date:   2020-02-12
- * @Version: V1.0
- */
-@Data
-@TableName("sys_depart_role_permission")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value="sys_depart_role_permission对象", description="部门角色权限")
-public class SysDepartRolePermission {
-
-	/**id*/
-	@TableId(type = IdType.ID_WORKER_STR)
-    @ApiModelProperty(value = "id")
-	private java.lang.String id;
-	/**部门id*/
-	@Excel(name = "部门id", width = 15)
-    @ApiModelProperty(value = "部门id")
-	private java.lang.String departId;
-	/**角色id*/
-	@Excel(name = "角色id", width = 15)
-    @ApiModelProperty(value = "角色id")
-	private java.lang.String roleId;
-	/**权限id*/
-	@Excel(name = "权限id", width = 15)
-    @ApiModelProperty(value = "权限id")
-	private java.lang.String permissionId;
-	/**dataRuleIds*/
-	@Excel(name = "dataRuleIds", width = 15)
-    @ApiModelProperty(value = "dataRuleIds")
-	private java.lang.String dataRuleIds;
-
-	public SysDepartRolePermission() {
-	}
-
-	public SysDepartRolePermission(String roleId, String permissionId) {
-		this.roleId = roleId;
-		this.permissionId = permissionId;
-	}
-}

+ 0 - 80
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysDictItem.java

@@ -1,80 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- *
- * </p>
- *
- * @Author zhangweijian
- * @since 2018-12-28
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SysDictItem implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.ID_WORKER_STR)
-    private String id;
-
-    /**
-     * 字典id
-     */
-    private String dictId;
-
-    /**
-     * 字典项文本
-     */
-    @Excel(name = "字典项文本", width = 20)
-    private String itemText;
-
-    /**
-     * 字典项值
-     */
-    @Excel(name = "字典项值", width = 30)
-    private String itemValue;
-
-    /**
-     * 描述
-     */
-    @Excel(name = "描述", width = 40)
-    private String description;
-
-    /**
-     * 排序
-     */
-    @Excel(name = "排序", width = 15,type=4)
-    private Integer sortOrder;
-
-
-    /**
-     * 状态(1启用 0不启用)
-     */
-    @Dict(dicCode = "dict_item_status")
-    private Integer status;
-
-    private String createBy;
-
-    private Date createTime;
-
-    private String updateBy;
-
-    private Date updateTime;
-
-
-}

+ 0 - 112
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysLog.java

@@ -1,112 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 系统日志表
- * </p>
- *
- * @Author zhangweijian
- * @since 2018-12-26
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SysLog implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * id
-	 */
-	@TableId(type = IdType.ID_WORKER_STR)
-	private String id;
-
-	/**
-	 * 创建人
-	 */
-	private String createBy;
-
-	/**
-	 * 创建时间
-	 */
-	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	private Date createTime;
-
-	/**
-	 * 更新人
-	 */
-	private String updateBy;
-
-	/**
-	 * 更新时间
-	 */
-	private Date updateTime;
-
-	/**
-	 * 耗时
-	 */
-	private Long costTime;
-
-	/**
-	 * IP
-	 */
-	private String ip;
-
-	/**
-	 * 请求参数
-	 */
-	private String requestParam;
-
-	/**
-	 * 请求类型
-	 */
-	private String requestType;
-
-	/**
-	 * 请求路径
-	 */
-	private String requestUrl;
-	/**
-	 * 请求方法
-	 */
-	private String method;
-
-	/**
-	 * 操作人用户名称
-	 */
-	private String username;
-	/**
-	 * 操作人用户账户
-	 */
-	private String userid;
-	/**
-	 * 操作详细日志
-	 */
-	private String logContent;
-
-	/**
-	 * 日志类型(1登录日志,2操作日志)
-	 */
-	@Dict(dicCode = "log_type")
-	private Integer logType;
-
-	/**
-	 * 操作类型(1查询,2添加,3修改,4删除,5导入,6导出)
-	 */
-	@Dict(dicCode = "operate_type")
-	private Integer operateType;
-
-}

+ 0 - 183
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysPermission.java

@@ -1,183 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 菜单权限表
- * </p>
- *
- * @Author scott
- * @since 2018-12-21
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SysPermission implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * id
-	 */
-	@TableId(type = IdType.ID_WORKER_STR)
-	private String id;
-
-	/**
-	 * 父id
-	 */
-	private String parentId;
-
-	/**
-	 * 菜单名称
-	 */
-	private String name;
-
-	/**
-	 * 菜单权限编码,例如:“sys:schedule:list,sys:schedule:info”,多个逗号隔开
-	 */
-	private String perms;
-	/**
-	 * 权限策略1显示2禁用
-	 */
-	private String permsType;
-
-	/**
-	 * 菜单图标
-	 */
-	private String icon;
-
-	/**
-	 * 组件
-	 */
-	private String component;
-
-	/**
-	 * 组件名字
-	 */
-	private String componentName;
-
-	/**
-	 * 路径
-	 */
-	private String url;
-	/**
-	 * 一级菜单跳转地址
-	 */
-	private String redirect;
-
-	/**
-	 * 菜单排序
-	 */
-	private Double sortNo;
-
-	/**
-	 * 类型(0:一级菜单;1:子菜单 ;2:按钮权限)
-	 */
-	@Dict(dicCode = "menu_type")
-	private Integer menuType;
-
-	/**
-	 * 是否叶子节点: 1:是  0:不是
-	 */
-	@TableField(value="is_leaf")
-	private boolean leaf;
-
-	/**
-	 * 是否路由菜单: 0:不是  1:是(默认值1)
-	 */
-	@TableField(value="is_route")
-	private boolean route;
-
-
-	/**
-	 * 是否缓存页面: 0:不是  1:是(默认值1)
-	 */
-	@TableField(value="keep_alive")
-	private boolean keepAlive;
-
-	/**
-	 * 描述
-	 */
-	private String description;
-
-	/**
-	 * 创建人
-	 */
-	private String createBy;
-
-	/**
-	 * 删除状态 0正常 1已删除
-	 */
-	private Integer delFlag;
-
-	/**
-	 * 是否配置菜单的数据权限 1是0否 默认0
-	 */
-	private Integer ruleFlag;
-
-	/**
-	 * 是否隐藏路由菜单: 0否,1是(默认值0)
-	 */
-	private boolean hidden;
-
-	/**
-	 * 创建时间
-	 */
-	private Date createTime;
-
-	/**
-	 * 更新人
-	 */
-	private String updateBy;
-
-	/**
-	 * 更新时间
-	 */
-	private Date updateTime;
-
-	/**按钮权限状态(0无效1有效)*/
-	private String status;
-
-	/**alwaysShow*/
-    private boolean alwaysShow;
-
-
-	/*update_begin author:wuxianquan date:20190908 for:实体增加字段 */
-    /** 外链菜单打开方式 0/内部打开 1/外部打开 */
-    private boolean internalOrExternal;
-	/*update_end author:wuxianquan date:20190908 for:实体增加字段 */
-
-    public SysPermission() {
-
-    }
-    public SysPermission(boolean index) {
-    	if(index) {
-    		this.id = "9502685863ab87f0ad1134142788a385";
-        	this.name="首页";
-        	this.component="dashboard/Analysis";
-        	this.componentName="dashboard-analysis";
-        	this.url="/dashboard/analysis";
-        	this.icon="home";
-        	this.menuType=0;
-        	this.sortNo=0.0;
-        	this.ruleFlag=0;
-        	this.delFlag=0;
-        	this.alwaysShow=false;
-        	this.route=true;
-        	this.keepAlive=true;
-        	this.leaf=true;
-        	this.hidden=false;
-    	}
-
-    }
-}

+ 0 - 223
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysUser.java

@@ -1,223 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 用户表
- * </p>
- *
- * @Author scott
- * @since 2018-12-20
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SysUser implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.UUID)
-    private String id;
-
-    private String departId;
-
-    /**
-     * 登录账号
-     */
-    @Excel(name = "登录账号", width = 15)
-    private String username;
-
-    /**
-     * 真实姓名
-     */
-    @Excel(name = "真实姓名", width = 15)
-    private String realname;
-
-    /**
-     * 密码
-     */
-    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
-    private String password;
-
-    /**
-     * md5密码盐
-     */
-    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
-    private String salt;
-
-    /**
-     * 头像
-     */
-    @Excel(name = "头像", width = 15,type = 2)
-    private String avatar;
-
-    /**
-     * 生日
-     */
-    @Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date birthday;
-
-    /**
-     * 性别(1:男 2:女)
-     */
-    @Excel(name = "性别", width = 15, dicCode = "sex")
-    @Dict(dicCode = "sex")
-    private Integer sex;
-
-    /**
-     * 电子邮件
-     */
-    @Excel(name = "电子邮件", width = 15)
-    private String email;
-
-    /**
-     * 电话
-     */
-    @Excel(name = "电话", width = 15)
-    private String phone;
-
-    /**
-     * 部门code(当前选择登录部门)
-     */
-    private String orgCode;
-
-    /**
-     * 状态(1:正常  2:冻结 )
-     */
-    @Excel(name = "状态", width = 15,dicCode="user_status")
-    @Dict(dicCode = "user_status")
-    private Integer status;
-
-    /**
-     * 删除状态(0,正常,1已删除)
-     */
-    @Excel(name = "删除状态", width = 15,dicCode="del_flag")
-    @TableLogic
-    private Integer delFlag;
-
-    /**
-     * 工号,唯一键
-     */
-    @Excel(name = "工号", width = 15)
-    private String workNo;
-
-    /**
-     * 职务,关联职务表
-     */
-    @Excel(name = "职务", width = 15)
-    private String post;
-
-    /**
-     * 座机号
-     */
-    @Excel(name = "座机号", width = 15)
-    private String telephone;
-
-    /**
-     * 创建人
-     */
-    private String createBy;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
-    /**
-     * 更新人
-     */
-    private String updateBy;
-
-    /**
-     * 更新时间
-     */
-    private Date updateTime;
-    /**
-     * 同步工作流引擎1同步0不同步
-     */
-    private Integer activitiSync;
-
-    /**
-     * 身份(0 普通成员 1 上级)
-     */
-    @Excel(name="(1普通成员 2上级)",width = 15)
-    private Integer userIdentity;
-
-    /**
-     * 负责部门
-     */
-    @Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
-    @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
-    private String departIds;
-
-
-    /**
-     * 第三方登录的唯一标识
-     */
-    private String thirdId;
-
-    /**
-     * 第三方类型 <br>
-     * (github/github,wechat_enterprise/企业微信,dingtalk/钉钉)
-     */
-    private String thirdType;
-
-    /**
-     * 职务
-     */
-    @TableField(exist = false)
-    private String position;
-    /**
-     * 区域
-     */
-    @TableField(exist = false)
-    private String area;
-    /**
-     * 部门
-     */
-    @TableField(exist = false)
-    private String depart;
-
-    /**
-     * 角色
-     */
-    @TableField(exist = false)
-    private String roleName;
-
-    /**
-     * 组织机构名称
-     */
-    @TableField(exist = false)
-    private String departName;
-
-    /**
-     * 领导 ID
-     */
-    private String leaderId;
-
-    /**
-     * 领导姓名
-     */
-    private String leaderName;
-
-}

+ 0 - 49
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/SysUserRole.java

@@ -1,49 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 用户角色表
- * </p>
- *
- * @Author scott
- * @since 2018-12-21
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SysUserRole implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @TableId(type = IdType.ID_WORKER_STR)
-    private String id;
-
-    /**
-     * 用户id
-     */
-    private String userId;
-
-    /**
-     * 角色id
-     */
-    private String roleId;
-
-	public SysUserRole() {
-	}
-
-	public SysUserRole(String userId, String roleId) {
-		this.userId = userId;
-		this.roleId = roleId;
-	}
-
-
-
-}

+ 0 - 57
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java

@@ -1,57 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * 标签信息
- * @author jeecg-boot
- * @date   2020-08-26
- * @version V1.0
- */
-@Data
-@TableName("ctop_tag_info")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value="ctop_tag_info对象", description="标签信息")
-public class TagInfo {
-	@TableId(type = IdType.AUTO)
-	private Long id;
-	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
-	private Long parentId;
-	private Long tagCategoryId;
-	private String tagCategoryName;
-	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
-	private Long firstTagId;
-	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
-	private Long secendTagId;
-	@Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
-	private String userId;
-	private String tagName;
-	private Integer tagOrder;
-	private String description;
-	private String model;
-	private String tagCode;
-	private Integer level;
-	private Integer status;
-	private Integer delFlag;
-	@TableField(value="is_leaf")
-	private boolean leaf;
-	private Date createTime;
-	private Date updateTime;
-
-	@TableField(exist = false)
-	List<TagInfo> children;
-
-
-}

+ 0 - 174
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java

@@ -1,174 +0,0 @@
-package cn.com.ctop.common.module.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * 用户分配
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-08-08
- */
-@Data
-@TableName("ctop_user_allocation")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_user_allocation对象", description = "用户分配")
-public class UserAllocation implements Serializable {
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "主键ID")
-    private Long id;
-    /**
-     * 登陆人id
-     */
-    @Excel(name = "登陆人id", width = 15)
-    @ApiModelProperty(value = "登陆人id")
-    private String userId;
-
-
-    @Excel(name = "登陆人名称", width = 15)
-    @ApiModelProperty(value = "登陆人名称")
-    private String userName;
-
-    /**
-     * 账户id --授权
-     */
-    @Excel(name = "账户id --授权", width = 15)
-    @ApiModelProperty(value = "账户id --授权")
-    private Long accountId;
-    /**
-     * 广告主ID
-     */
-    @Excel(name = "广告主ID", width = 15)
-    @ApiModelProperty(value = "广告主ID")
-    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
-    private String advertiserId;
-
-    private String systemType;
-
-    /**
-     * 项目id
-     */
-    @Dict(dicCode = "id", dictTable = "ctop_project", dicText = "project_name")
-    private Long projectId;
-
-    /**
-     * 输入账号  --登陆
-     */
-    @Excel(name = "输入账号  --登陆", width = 15)
-    @ApiModelProperty(value = "输入账号  --登陆")
-    private String accountName;
-
-    /**
-     * 预警 金额
-     */
-    private BigDecimal warningAmount;
-
-    /**
-     * 预警 比例
-     */
-    private BigDecimal warningProportion;
-
-    /**
-     * 创建时间
-     */
-    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-
-    /**
-     * 授权名称
-     */
-    @Excel(name = "授权名称", width = 15)
-    @ApiModelProperty(value = "授权名称")
-    private String authName;
-
-    /**
-     * 授权开始时间
-     */
-    @Excel(name = "授权开始时间", width = 15)
-    @ApiModelProperty(value = "授权开始时间")
-    private String authBeginTime;
-
-
-    /**
-     * 0 启动
-     * 1 禁用
-     */
-    private Integer accountStatus;
-
-    /**
-     * 检测链接预警
-     * 0 启动
-     * 1 禁用
-     */
-    private Integer monitoringLink;
-
-    /**
-     * 检测链接预警
-     * 0 启动
-     * 1 禁用
-     */
-    private Integer landingPage;
-
-    /**
-     * 是否开启删评论
-     * 0 启动
-     * 1 禁用
-     */
-    private Integer deleteComment;
-    /**
-     * 自动投放,0关闭,1开启
-     */
-    private Integer autoDelivery;
-    /**
-     * 物料类型 0-不同步,1应用包,(2人群包,3定向包)
-     */
-    private String materialType;
-
-    /**
-     * 修改时间
-     */
-    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "修改时间")
-    private Date updateTime;
-    /**
-     * 平台类型 1 头条 2快手
-     */
-    @Excel(name = "平台类型 1 头条 2快手", width = 15)
-    @ApiModelProperty(value = "平台类型 1 头条 2快手")
-    private String mediaId;
-
-
-
-
-   /* @TableField(exist = false)
-    private String advertiserName;
-
-    @TableField(exist = false)
-    private String projectName;*/
-
-}

+ 0 - 21
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementMapper.java

@@ -1,21 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysAnnouncement;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @Description: 系统通告表
- * @Author: jeecg-boot
- * @Date:  2019-01-02
- * @Version: V1.0
- */
-public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
-
-
-	List<SysAnnouncement> querySysCementListByUserId(Page<SysAnnouncement> page, @Param("userId")String userId, @Param("msgCategory")String msgCategory);
-
-}

+ 0 - 28
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementSendMapper.java

@@ -1,28 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysAnnouncementSend;
-import cn.com.ctop.common.module.model.AnnouncementSendModel;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @Description: 用户通告阅读标记表
- * @Author: jeecg-boot
- * @Date:  2019-02-21
- * @Version: V1.0
- */
-public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSend> {
-
-	public List<String> queryByUserId(@Param("userId") String userId);
-
-	/**
-	 * @功能:获取我的消息
-	 * @param announcementSendModel
-	 * @return
-	 */
-	public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page, @Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
-
-}

+ 0 - 31
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysCategoryMapper.java

@@ -1,31 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysCategory;
-import cn.com.ctop.common.module.model.TreeSelectModel;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Description: 分类字典
- * @Author: jeecg-boot
- * @Date:   2019-05-29
- * @Version: V1.0
- */
-public interface SysCategoryMapper extends BaseMapper<SysCategory> {
-
-	/**
-	  *  根据父级ID查询树节点数据
-	 * @param pid
-	 * @return
-	 */
-	public List<TreeSelectModel> queryListByPid(@Param("pid")  String pid, @Param("query") Map<String, String> query);
-
-	@Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
-	public String queryIdByCode(@Param("code")  String code);
-
-
-}

+ 0 - 62
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysDepartMapper.java

@@ -1,62 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-/**
- * <p>
- * 部门 Mapper 接口
- * <p>
- *
- * @Author: Steve
- * @Since: 2019-01-22
- */
-public interface SysDepartMapper extends BaseMapper<SysDepart> {
-
-    /**
-     * 根据用户ID查询部门集合
-     */
-    public List<SysDepart> queryUserDeparts(@Param("userId") String userId);
-
-    /**
-     * 根据用户名查询部门
-     *
-     * @param username
-     * @return
-     */
-    public List<SysDepart> queryDepartsByUsername(@Param("username") String username);
-
-    @Select("select id from sys_depart where org_code=#{orgCode}")
-    public String queryDepartIdByOrgCode(@Param("orgCode") String orgCode);
-
-    @Select("select id,parent_id from sys_depart where id=#{departId}")
-    public SysDepart getParentDepartId(@Param("departId") String departId);
-
-    /**
-     * 根据部门Id查询,当前和下级所有部门IDS
-     *
-     * @param departId
-     * @return
-     */
-    List<String> getSubDepIdsByDepId(@Param("departId") String departId);
-
-    /**
-     * 根据部门编码获取部门下所有IDS
-     *
-     * @param orgCodes
-     * @return
-     */
-    List<String> getSubDepIdsByOrgCodes(@org.apache.ibatis.annotations.Param("orgCodes") String[] orgCodes);
-
-    SysDepart queryUserDepartsByDepartId(@Param("departId") String departId);
-
-    List<JSONObject> getDepartmentIds(@Param("userId") String userId);
-
-    List<JSONObject> checkLowestLevelDepartment(@Param("departIds") List<JSONObject> departIds);
-
-}

+ 0 - 56
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysPermissionMapper.java

@@ -1,56 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysPermission;
-import cn.com.ctop.common.module.model.TreeModel;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.apache.ibatis.annotations.Update;
-
-import java.util.List;
-
-/**
- * <p>
- * 菜单权限表 Mapper 接口
- * </p>
- *
- * @Author scott
- * @since 2018-12-21
- */
-public interface SysPermissionMapper extends BaseMapper<SysPermission> {
-	/**
-	   * 通过父菜单ID查询子菜单
-	 * @param parentId
-	 * @return
-	 */
-	public List<TreeModel> queryListByParentId(@Param("parentId") String parentId);
-
-	/**
-	  *   根据用户查询用户权限
-	 */
-	public List<SysPermission> queryByUser(@Param("username") String username);
-
-	/**
-	 *   修改菜单状态字段: 是否子节点
-	 */
-	@Update("update sys_permission set is_leaf=#{leaf} where id = #{id}")
-	public int setMenuLeaf(@Param("id") String id, @Param("leaf") int leaf);
-
-	/**
-	  *   获取模糊匹配规则的数据权限URL
-	 */
-	@Select("SELECT url FROM sys_permission WHERE del_flag = 0 and menu_type = 2 and url like '%*%'")
-    public List<String> queryPermissionUrlWithStar();
-
-
-	/**
-	 * 根据用户账号查询菜单权限
-	 * @param sysPermission
-	 * @param username
-	 * @return
-	 */
-	public int queryCountByUsername(@Param("username") String username, @Param("permission") SysPermission sysPermission);
-
-
-	String queryRoleCode(@Param("username") String username);
-}

+ 0 - 20
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserDepartMapper.java

@@ -1,20 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysUserDepart;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @author jeecg-boot
- * 2019年12月5日19:57:58
- */
-public interface SysUserDepartMapper extends BaseMapper<SysUserDepart>{
-
-    List<SysUserDepart> getUserDepartByUid(@Param("userId") String userId);
-
-	SysUserDepart getUserDepartByUserId(@Param("userId") String userId);
-
-    List<String> getUserIds(@Param("ids") List<String> ids);
-}

+ 0 - 189
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserMapper.java

@@ -1,189 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.model.SysUserSysDepartModel;
-import cn.com.ctop.common.module.vo.SysUserDepVo;
-import cn.com.ctop.common.module.vo.SysUserVo;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Constants;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 用户表 Mapper 接口
- * </p>
- *
- * @Author scott
- * @since 2018-12-20
- */
-public interface SysUserMapper extends BaseMapper<SysUser> {
-    List<SysUser> selectAllUser();
-
-    List<SysUser> selectAllDesigner();
-
-    /**
-     * 通过用户账号查询用户信息
-     *
-     * @param username
-     * @return
-     */
-    SysUser getUserByName(@Param("username") String username);
-
-    SysUser getUserByRealName(@Param("realname") String realname);
-
-    /**
-     * 根据部门Id查询用户信息
-     *
-     * @param page
-     * @param departId
-     * @return
-     */
-    IPage<SysUser> getUserByDepId(Page page, @Param("departId") String departId, @Param("username") String username);
-
-    /**
-     * 根据用户Ids,查询用户所属部门名称信息
-     *
-     * @param userIds
-     * @return
-     */
-    List<SysUserDepVo> getDepNamesByUserIds(@Param("userIds") List<String> userIds);
-
-    /**
-     * 根据部门Ids,查询部门下用户信息
-     *
-     * @param page
-     * @param departIds
-     * @return
-     */
-    IPage<SysUser> getUserByDepIds(Page page, @Param("departIds") List<String> departIds, @Param("username") String username);
-
-    /**
-     * 根据角色Id查询用户信息
-     *
-     * @param page
-     * @param
-     * @return
-     */
-    IPage<SysUser> getUserByRoleId(Page page, @Param("roleId") String roleId, @Param("username") String username);
-
-    /**
-     * 根据用户名设置部门ID
-     *
-     * @param username
-     * @param orgCode
-     */
-    void updateUserDepart(@Param("username") String username, @Param("orgCode") String orgCode);
-
-    /**
-     * 根据手机号查询用户信息
-     *
-     * @param phone
-     * @return
-     */
-    SysUser getUserByPhone(@Param("phone") String phone);
-
-
-    /**
-     * 根据邮箱查询用户信息
-     *
-     * @param email
-     * @return
-     */
-    SysUser getUserByEmail(@Param("email") String email);
-
-    /**
-     * 根据 orgCode 查询用户,包括子部门下的用户
-     *
-     * @param page       分页对象, xml中可以从里面进行取值,传递参数 Page 即自动分页,必须放在第一位(你可以继承Page实现自己的分页对象)
-     * @param orgCode
-     * @param userParams 用户查询条件,可为空
-     * @return
-     */
-    List<SysUserSysDepartModel> getUserByOrgCode(IPage page, @Param("orgCode") String orgCode, @Param("userParams") SysUser userParams);
-
-
-    /**
-     * 查询 getUserByOrgCode 的Total
-     *
-     * @param orgCode
-     * @param userParams 用户查询条件,可为空
-     * @return
-     */
-    Integer getUserByOrgCodeTotal(@Param("orgCode") String orgCode, @Param("userParams") SysUser userParams);
-
-    /**
-     * @Author scott
-     * @Date 2019/12/13 16:10
-     * @Description: 批量删除角色与用户关系
-     */
-    void deleteBathRoleUserRelation(@Param("roleIdArray") String[] roleIdArray);
-
-    /**
-     * @Author scott
-     * @Date 2019/12/13 16:10
-     * @Description: 批量删除角色与权限关系
-     */
-    void deleteBathRolePermissionRelation(@Param("roleIdArray") String[] roleIdArray);
-
-    /**
-     * 查询被逻辑删除的用户
-     */
-    List<SysUser> selectLogicDeleted(@Param(Constants.WRAPPER) Wrapper<SysUser> wrapper);
-
-    /**
-     * 还原被逻辑删除的用户
-     */
-    int revertLogicDeleted(@Param("userIds") String userIds, @Param("entity") SysUser entity);
-
-    /**
-     * 彻底删除被逻辑删除的用户
-     */
-    int deleteLogicDeleted(@Param("userIds") String userIds);
-
-    /**
-     * 更新空字符串为null【此写法有sql注入风险,禁止随便用】
-     */
-    int updateNullByEmptyString(@Param("fieldName") String fieldName);
-
-
-    /**
-     * 根据部门Ids,查询部门下用户信息
-     *
-     * @param departIds
-     * @return
-     */
-    List<SysUser> queryByDepIds(@Param("departIds") List<String> departIds, @Param("username") String username);
-
-    Map<String, Object> queryRoleCode(@Param("userId") String userId);
-
-    List<SysUserVo> getAllUser(@Param("userName") String userName, @Param("status") String status);
-
-    List<SysUserVo> getUserListByCompany(@Param("companyId") String companyId, @Param("userName") String userName);
-
-    List<SysUserVo> getAllSale();
-
-    List<SysUserVo> getAllSalesByCompanyId(@Param("companyId") String companyId);
-
-    JSONObject selectUserByAccount(@Param("accountId") Long accountId);
-
-    SysUser getDesignerTeamLeaderBy(@Param("orgCode") String orgCode);
-
-    List<SysUser> queryPageList(SysUser user);
-
-    List<JSONObject> getUserMapByMap(@Param("ids") Map<String, String> userIdMap);
-
-    /**
-     *
-     * @param userId 用户id
-     * @param designTeamLeaderName 设计组长姓名
-     * @return
-     */
-    Integer updUserDesignLeaderById(@Param("userId") String userId,@Param("designTeamLeaderName") String designTeamLeaderName);
-}

+ 0 - 50
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserRoleMapper.java

@@ -1,50 +0,0 @@
-package cn.com.ctop.common.module.mapper;
-
-import cn.com.ctop.common.module.entity.SysUserRole;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-/**
- * <p>
- * 用户角色表 Mapper 接口
- * </p>
- *
- * @Author scott
- * @since 2018-12-21
- */
-public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
-
-	@Select("select role_code from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))")
-	List<String> getRoleByUserName(@Param("username") String username);
-
-	@Select("select id from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))")
-	List<String> getRoleIdByUserName(@Param("username") String username);
-	@Select("SELECT\n" +
-			"\tt3.user_id\n" +
-			"FROM\n" +
-			"\t(\n" +
-			"\t\tSELECT\n" +
-			"\t\t\tt2.user_id,\n" +
-			"\t\t\tt2.role_id\n" +
-			"\t\tFROM\n" +
-			"\t\t\tsys_user_depart t1\n" +
-			"\t\tLEFT JOIN sys_user_role t2 ON t1.user_id = t2.user_id\n" +
-			"\t\tWHERE\n" +
-			"\t\t\tt1.dep_id = (\n" +
-			"\t\t\t\tSELECT\n" +
-			"\t\t\t\t\tdep_id\n" +
-			"\t\t\t\tFROM\n" +
-			"\t\t\t\t\tsys_user_depart\n" +
-			"\t\t\t\tWHERE\n" +
-			"\t\t\t\t\tuser_id = #{userId}\n" +
-			"\t\t\t)\n" +
-			"\t) t3\n" +
-			"LEFT JOIN sys_role t4 ON t3.role_id = t4.id\n" +
-			"WHERE\n" +
-			"\tt4.role_code =  #{roleCode}\n")
-	String getLeaderIdByUser(@Param("userId") String userId, @Param("roleCode") String roleCode);
-
-}

+ 0 - 21
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysCategoryMapper.xml

@@ -1,21 +0,0 @@
-<?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="cn.com.ctop.common.module.mapper.SysCategoryMapper">
-
-	<select id="queryListByPid" parameterType="Object" resultType="cn.com.ctop.common.module.model.TreeSelectModel">
-		select code,
-			   name as "title",
-			   id as "key",
-			   (case when has_child = '1' then 0 else 1 end) as isLeaf,
-			   pid as parentId
-			   from sys_category
-			where pid = #{pid}
-			<if test="query!= null">
-				<foreach collection="query.entrySet()" item="value"  index="key" >
-					and ${key} = #{value}
-				</foreach>
-			</if>
-	</select>
-
-
-</mapper>

+ 0 - 64
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysDepartMapper.xml

@@ -1,64 +0,0 @@
-<?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="cn.com.ctop.common.module.mapper.SysDepartMapper">
-
-    <select id="queryUserDeparts" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysDepart">
-        select *
-        from sys_depart
-        where id IN (select dep_id from sys_user_depart where user_id = #{userId})
-    </select>
-
-    <!-- 根据username查询所拥有的部门 -->
-    <select id="queryDepartsByUsername" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysDepart">
-        SELECT *
-        FROM sys_depart
-        WHERE id IN (
-            SELECT dep_id
-            FROM sys_user_depart
-            WHERE user_id = (
-                SELECT id
-                FROM sys_user
-                WHERE username = #{username}
-            )
-        )
-    </select>
-
-    <!-- 根据部门Id查询,当前和下级所有部门IDS -->
-    <select id="getSubDepIdsByDepId" resultType="java.lang.String">
-        select id
-        from sys_depart
-        where del_flag = '0'
-          and org_code like concat((select org_code from sys_depart where id = #{departId}), '%')
-    </select>
-
-    <!--根据部门编码获取我的部门下所有部门ids -->
-    <select id="getSubDepIdsByOrgCodes" resultType="java.lang.String">
-        select id from sys_depart where del_flag = '0' and
-        <foreach collection="orgCodes" item="item" index="index" open="(" separator="or" close=")">
-            org_code LIKE CONCAT(#{item},'%')
-        </foreach>
-    </select>
-
-    <select id="queryUserDepartsByDepartId" parameterType="String"
-            resultType="cn.com.ctop.common.module.entity.SysDepart">
-        select *
-        from sys_depart
-        where id = #{departId} limit 1
-    </select>
-
-    <select id="getDepartmentIds" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT dep_id as 'id'
-        FROM sys_user_depart
-        WHERE user_id = #{userId}
-    </select>
-
-    <select id="checkLowestLevelDepartment" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT id,parent_id FROM sys_depart WHERE parent_id IN
-        <foreach item="item" index="index" collection="departIds"
-                 open="(" separator="," close=")">
-            #{item.id}
-        </foreach>
-    </select>
-
-
-</mapper>

+ 0 - 124
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysPermissionMapper.xml

@@ -1,124 +0,0 @@
-<?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="cn.com.ctop.common.module.mapper.SysPermissionMapper">
-
-
-	<resultMap id="TreeModel" type="cn.com.ctop.common.module.model.TreeModel" >
-		<result column="id" property="key" jdbcType="VARCHAR"/>
-		<result column="name" property="title" jdbcType="VARCHAR"/>
-		<result column="icon" property="icon" jdbcType="VARCHAR"/>
-		<result column="parent_id" property="parentId" jdbcType="VARCHAR"/>
-		<result column="leaf_flag" property="isLeaf" jdbcType="INTEGER"/>
-	</resultMap>
-
-	<!-- 通过<resultMap>映射实体类属性名和表的字段名对应关系 -->
-	<resultMap id="SysPermission" type="cn.com.ctop.common.module.entity.SysPermission">
-	   <!-- result属性映射非匹配字段 -->
-	    <result column="is_route" property="route"/>
-	    <result column="keep_alive" property="keepAlive"/>
-	    <result column="is_leaf" property="leaf"/>
-	</resultMap>
-
-
-	<select id="queryListByParentId" parameterType="Object"  resultMap="TreeModel">
-		   SELECT
-                   id
-                   ,parent_id
-                   ,name
-                   ,icon
-                   ,leaf_flag
-		   FROM   sys_permission
-		   WHERE 1=1
-		    <choose>
-		   		<when test="parentId != null and parentId != ''">
-		   			AND parent_id =  #{parentId,jdbcType=VARCHAR}
-		   		</when>
-		   		<otherwise>
-		   			AND parent_id is null
-		   		</otherwise>
-		    </choose>
-	</select>
-
-	<!-- 获取登录用户拥有的权限 -->
-	<select id="queryByUser" parameterType="Object"  resultMap="SysPermission">
-		   SELECT * FROM (
-			   SELECT p.*
-			   FROM  sys_permission p
-			   WHERE (exists(
-						select a.id from sys_role_permission a
-						join sys_role b on a.role_id = b.id
-						join sys_user_role c on c.role_id = b.id
-						join sys_user d on d.id = c.user_id
-						where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
-					)
-					or (p.url like '%:code' and p.url like '/online%' and p.hidden = 1)
-					or p.url = '/online')
-			   and p.del_flag = 0
-			<!--update begin Author:lvdandan  Date:20200213 for:加入部门权限 -->
-			   UNION
-			   SELECT p.*
-			   FROM  sys_permission p
-			   WHERE exists(
-					select a.id from sys_depart_role_permission a
-					join sys_depart_role b on a.role_id = b.id
-					join sys_depart_role_user c on c.drole_id = b.id
-					join sys_user d on d.id = c.user_id
-					where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
-			   )
-			   and p.del_flag = 0
-			<!--update end Author:lvdandan  Date:20200213 for:加入部门权限 -->
-		   ) h order by h.sort_no ASC
-	</select>
-
-
-	<!-- 根据用户账号查询菜单权限 -->
-	<select id="queryCountByUsername" parameterType="Object" resultType="int">
-		select sum(cnt) from (
-		  select count(*) as cnt
-			from sys_role_permission a
-			join sys_permission b on a.permission_id = b.id
-			join sys_role c on a.role_id = c.id
-			join sys_user_role d on d.role_id = c.id
-			join sys_user e on d.user_id = e.id
-			where e.username = #{username}
-			<if test="permission.id !=null and permission.id != ''">
-				and b.id =  #{permission.id}
-			</if>
-			<if test="permission.url !=null and permission.url != ''">
-				and b.url =  #{permission.url}
-			</if>
-		union all
-		  select count(*) as cnt
-			from sys_permission z
-		    join sys_depart_role_permission y on z.id = y.permission_id
-			join sys_depart_role x on y.role_id = x.id
-			join sys_depart_role_user w on w.drole_id = x.id
-			join sys_user v on w.user_id = v.id
-			where v.username = #{username}
-			<if test="permission.id !=null and permission.id != ''">
-				and z.id =  #{permission.id}
-			</if>
-			<if test="permission.url !=null and permission.url != ''">
-				and z.url =  #{permission.url}
-			</if>
-		) temp
-	</select>
-	<select id="queryRoleCode" parameterType="Object" resultType="java.lang.String">
-	SELECT
-    role_code
-    FROM
-    sys_role
-    WHERE
-    id = (
-    SELECT
-    t2.role_id
-    FROM
-    sys_user t1
-    LEFT JOIN sys_user_role t2 ON t1.id = t2.user_id
-    WHERE
-    t1.username = #{username,jdbcType=VARCHAR}
-    )
-	</select>
-
-
-</mapper>

+ 0 - 27
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserDepartMapper.xml

@@ -1,27 +0,0 @@
-<?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="cn.com.ctop.common.module.mapper.SysUserDepartMapper">
-    <select id="getUserDepartByUid" parameterType="String" resultType="cn.com.ctop.common.module.entity.SysUserDepart">
-        SELECT *
-        FROM sys_user_depart
-        WHERE user_id = #{userId, jdbcType=VARCHAR}
-    </select>
-
-    <select id="getUserDepartByUserId" parameterType="String"
-            resultType="cn.com.ctop.common.module.entity.SysUserDepart">
-        SELECT *
-        FROM sys_user_depart
-        WHERE user_id = #{userId, jdbcType=VARCHAR} limit 1
-    </select>
-
-    <select id="getUserIds" resultType="java.lang.String">
-        SELECT user_id
-        FROM sys_user_depart
-        WHERE dep_id IN
-        <foreach item="id" index="index" collection="ids"
-                 open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </select>
-
-</mapper>

+ 0 - 340
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml

@@ -1,340 +0,0 @@
-<?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="cn.com.ctop.common.module.mapper.SysUserMapper">
-
-    <select id="selectAllUser" resultType="cn.com.ctop.common.module.entity.SysUser">
-		select * from  sys_user
-	</select>
-
-    <!-- 根据用户名查询 -->
-    <select id="getUserByName" resultType="cn.com.ctop.common.module.entity.SysUser">
-		select * from  sys_user  where username = #{username} and del_flag = 0
-	</select>
-
-    <!-- 根据部门Id查询 -->
-    <select id="getUserByDepId" resultType="cn.com.ctop.common.module.entity.SysUser">
-        select * from sys_user where del_flag = 0 and id in (select user_id from sys_user_depart where
-        dep_id=#{departId})
-        <if test="username!=null and username!=''">
-            and username = #{username}
-        </if>
-    </select>
-
-    <!-- 查询用户的所属部门名称信息 -->
-    <select id="getDepNamesByUserIds" resultType="cn.com.ctop.common.module.vo.SysUserDepVo">
-        select d.depart_name,ud.user_id from sys_user_depart ud,sys_depart d where d.id = ud.dep_id and ud.user_id in
-        <foreach collection="userIds" index="index" item="id" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </select>
-
-    <!-- 通过多个部门IDS,查询部门下的用户信息 -->
-    <select id="getUserByDepIds" resultType="cn.com.ctop.common.module.entity.SysUser">
-        select * from sys_user where del_flag = 0
-        <if test="departIds!=null  and departIds.size()>0">
-            and id in (select user_id from sys_user_depart where dep_id in
-            <foreach collection="departIds" index="index" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-            )
-        </if>
-        <if test="username!=null and username!=''">
-            and username = #{username}
-        </if>
-    </select>
-
-    <!-- 根据角色Id查询 -->
-    <select id="getUserByRoleId" resultType="cn.com.ctop.common.module.entity.SysUser">
-        select * from sys_user where del_flag = 0 and id in (select user_id from sys_user_role where role_id=#{roleId})
-        <if test="username!=null and username!=''">
-            and username = #{username}
-        </if>
-    </select>
-
-    <!--  修改用户部门code -->
-    <update id="updateUserDepart">
-		UPDATE sys_user SET org_code = #{orgCode} where username = #{username}
-	</update>
-
-    <!-- 根据手机号查询 -->
-    <select id="getUserByPhone" resultType="cn.com.ctop.common.module.entity.SysUser">
-		select * from  sys_user  where phone = #{phone} and del_flag = 0
-	</select>
-
-    <!-- 根据realname查询 -->
-    <select id="getUserByRealName" resultType="cn.com.ctop.common.module.entity.SysUser">
-        select * from  sys_user  where realname = #{realname} and del_flag = 0 limit 1
-    </select>
-
-    <!-- 根据邮箱查询用户信息 -->
-    <select id="getUserByEmail" resultType="cn.com.ctop.common.module.entity.SysUser">
-	select * from  sys_user  where email = #{email} and del_flag = 0
-	</select>
-    <select id="queryRoleCode" parameterType="Object" resultType="java.util.Map">
-SELECT
-   role_code roleCode,
-   role_name roleName,
-   id roleId
-   FROM
-   sys_role
-   WHERE
-   id = (
-   SELECT
-   t2.role_id
-   FROM
-   sys_user t1
-   LEFT JOIN sys_user_role t2 ON t1.id = t2.user_id
-   WHERE
-   t1.id = #{userId,jdbcType=VARCHAR}
-   )
-</select>
-    <select id="getAllUser" resultType="cn.com.ctop.common.module.vo.SysUserVo">
-        SELECT
-        t1.id userId,
-        t1.leader_id,
-        t1.username userName,
-        t1.realname realName,
-        (SELECT role_name FROM sys_role WHERE id = t2.role_id ) roleName
-        FROM sys_user t1
-        LEFT JOIN sys_user_role t2 on t1.id = t2.user_id
-        where 1 = 1
-        <if test="userName != null and userName != ''">
-            and t1.realname like concat(concat('%',#{userName}),'%')
-        </if>
-        <if test="status != null and status != ''">
-            and t1.status =#{status}
-            AND t1.del_flag = 0
-        </if>
-    </select>
-    <!-- SQL片段:getUserByOrgCode 的 FROM 和 WHERE 部分 -->
-    <sql id="getUserByOrgCodeFromSql">
-        FROM
-        sys_depart
-        INNER JOIN sys_user_depart ON sys_user_depart.dep_id = sys_depart.id
-        INNER JOIN sys_user ON sys_user.id = sys_user_depart.user_id
-        WHERE
-        sys_user.del_flag = 0 AND sys_depart.org_code LIKE '${orgCode}%'
-
-        <if test="userParams != null">
-            <if test="userParams.realname != null and userParams.realname != ''">
-                AND sys_user.realname LIKE concat(concat('%',#{userParams.realname}),'%')
-            </if>
-            <if test="userParams.workNo != null and userParams.workNo != ''">
-                AND sys_user.work_no LIKE concat(concat('%',#{userParams.workNo}),'%')
-            </if>
-        </if>
-    </sql>
-    <select id="getUserListByCompany" resultType="cn.com.ctop.common.module.vo.SysUserVo">
-        SELECT
-        t2.id userId,
-        t2.username userName,
-        t2.realname realName,
-        (SELECT role_name FROM sys_role WHERE id = t3.role_id ) roleName
-        FROM user_company t1 LEFT JOIN
-        sys_user t2 ON
-        t1.user_id = t2.id
-        LEFT JOIN sys_user_role t3 on t1.user_id = t3.user_id
-        WHERE t1.company_id = #{companyId}
-        <if test="userName != null and userName != ''">
-            and t2.realname like concat(concat('%',#{userName}),'%')
-        </if>
-
-    </select>
-    <select id="getAllSale" resultType="cn.com.ctop.common.module.vo.SysUserVo">
-       SELECT
-	t2.id userId,
-	t2.username userName,
-	t2.realname realName,
-   t4.role_name AS roleName
-    FROM
-	user_company t1
-    LEFT JOIN sys_user t2 ON t1.user_id = t2.id
-    LEFT JOIN sys_user_role t3 ON t2.id = t3.user_id
-    LEFT JOIN sys_role t4 ON t3.role_id = t4.id
-    WHERE
-	t4.role_name LIKE '%销售%';
-    </select>
-
-
-    <select id="getAllSalesByCompanyId" resultType="cn.com.ctop.common.module.vo.SysUserVo">
-       SELECT
-	t2.id userId,
-	t2.username userName,
-	t2.realname realName,
-    t4.role_name AS roleName
-  FROM
-	user_company t1
-    LEFT JOIN sys_user t2 ON t1.user_id = t2.id
-    LEFT JOIN sys_user_role t3 ON t2.id = t3.user_id
-    LEFT JOIN sys_role t4 ON t3.role_id = t4.id
-    WHERE t1.company_id = #{companyId}
-	and t4.role_name LIKE '%销售%';
-    </select>
-    <!-- 根据 orgCode 查询用户,包括子部门下的用户 -->
-    <select id="getUserByOrgCode" resultType="cn.com.ctop.common.module.model.SysUserSysDepartModel">
-        SELECT
-        sys_user.id AS id,
-        sys_user.realname AS realname,
-        sys_user.work_no AS workNo,
-        sys_user.post AS post,
-        sys_user.telephone AS telephone,
-        sys_user.email AS email,
-        sys_user.phone AS phone,
-        sys_depart.id AS departId,
-        sys_depart.depart_name AS departName
-        <include refid="getUserByOrgCodeFromSql"/>
-        ORDER BY
-        sys_depart.org_code ASC
-    </select>
-
-    <!-- 查询 getUserByOrgCode 的总数-->
-    <select id="getUserByOrgCodeTotal" resultType="java.lang.Integer">
-        SELECT COUNT(1)
-        <include refid="getUserByOrgCodeFromSql"/>
-    </select>
-
-    <!-- 批量删除角色的与用户关系-->
-    <update id="deleteBathRoleUserRelation">
-        delete from sys_user_role
-        where role_id in
-        <foreach item="id" collection="roleIdArray" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </update>
-    <!-- 批量删除角色的与权限关系-->
-    <update id="deleteBathRolePermissionRelation">
-        delete from sys_role_permission
-        where role_id in
-        <foreach item="id" collection="roleIdArray" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </update>
-
-    <!-- 查询被逻辑删除的用户 -->
-    <select id="selectLogicDeleted" resultType="cn.com.ctop.common.module.entity.SysUser">
-		SELECT * FROM sys_user ${ew.customSqlSegment}
-	</select>
-
-    <!-- 更新被逻辑删除的用户 -->
-    <update id="revertLogicDeleted">
-		UPDATE
-			sys_user
-		SET
-			del_flag = 0,
-			update_by = #{entity.updateBy},
-			update_time = #{entity.updateTime}
-		WHERE
-			del_flag = 1
-			AND id IN (${userIds})
-	</update>
-
-    <!-- 彻底删除被逻辑删除的用户 -->
-    <delete id="deleteLogicDeleted">
-		DELETE FROM sys_user WHERE del_flag = 1 AND id IN (${userIds})
-	</delete>
-
-    <!-- 更新空字符串为null -->
-    <update id="updateNullByEmptyString">
-        UPDATE sys_user SET ${fieldName} = NULL WHERE ${fieldName} = ''
-    </update>
-
-    <!-- 通过多个部门IDS,查询部门下的用户信息 -->
-    <select id="queryByDepIds" resultType="cn.com.ctop.common.module.entity.SysUser">
-        select * from sys_user where del_flag = 0
-        <if test="departIds!=null  and departIds.size()>0">
-            and id in (select user_id from sys_user_depart where dep_id in
-            <foreach collection="departIds" index="index" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-            )
-        </if>
-        <if test="username!=null and username!=''">
-            and username != #{username}
-        </if>
-    </select>
-
-    <select id="selectUserByAccount" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT *
-        FROM  sys_user t1
-        INNER JOIN  ctop_user_allocation t2 ON t1.id = t2.user_id
-        WHERE t2.account_id = #{accountId}
-    </select>
-    <select id="selectAllDesigner" resultType="cn.com.ctop.common.module.entity.SysUser">
-        select user.realname,user.id,role.role_name from sys_user_role userRole left join sys_user user on userRole.user_id = user.id
-        left join sys_role role on userRole.role_id = role.id
-            where role.role_code in ('plane','plan','shot','clip','designTeamLeader')
-            and user.status = 1
-    </select>
-    <select id="getDesignerTeamLeaderBy" resultType="cn.com.ctop.common.module.entity.SysUser">
-        SELECT
-            user2.realname,user2.id
-        FROM sys_user user2
-        LEFT JOIN sys_user_role userRole ON user2.id = userRole.user_id
-        LEFT JOIN sys_role role ON userRole.role_id = role.id
-        WHERE
-            user2.org_code = #{orgCode}
-        AND
-            role.role_code = 'designTeamLeader'
-    </select>
-
-    <!-- 查询用户列表-->
-    <select id="queryPageList" resultType="cn.com.ctop.common.module.entity.SysUser">
-        SELECT t4.* from (
-        SELECT t1.*,t3.depart_name ,role.role_name,t2.create_time AS updTime
-        FROM sys_user t1
-        LEFT JOIN sys_user_depart t2 ON t1.id = t2.user_id
-        LEFT JOIN sys_depart t3 ON t2.dep_id = t3.id
-        LEFT JOIN sys_user_role userRole ON t1.id = userRole.user_id
-        LEFT JOIN sys_role role ON userRole.role_id = role.id
-        where t1.del_flag = 0
-        <if test="realname != null and realname != ''">
-            AND t1.realname LIKE CONCAT(CONCAT('%',#{realname}),'%')
-        </if>
-        <if test="username != null and username != ''">
-            AND t1.username LIKE CONCAT(CONCAT('%',#{username}),'%')
-        </if>
-        <if test="email != null and email != ''">
-            AND t1.email LIKE CONCAT(CONCAT('%',#{email}),'%')
-        </if>
-        <if test="phone != null and phone != ''">
-            AND t1.phone LIKE CONCAT(CONCAT('%',#{phone}),'%')
-        </if>
-        <if test="status != null and status != ''">
-            AND t1.`status` = #{status}
-        </if>
-        <if test="leaderName != null and leaderName != ''">
-            AND t1.leader_name LIKE CONCAT(CONCAT('%',#{leaderName}),'%')
-        </if>
-        <if test="departId != null and departId != ''">
-            AND t3.id =#{departId}
-        </if>
-        <if test="roleName != null and roleName != ''">
-            AND role.role_name LIKE CONCAT(CONCAT('%',#{roleName}),'%')
-        </if>
-        <if test="sex != null and sex != ''">
-            AND t1.sex =#{sex}
-        </if>
-        <if test="id != null and id != ''">
-            AND t1.id =#{id}
-        </if>
-
-        ) t4
-        GROUP BY t4.id
-    </select>
-    <select id="getUserMapByMap" resultType="com.alibaba.fastjson.JSONObject">
-        select id,realname from sys_user
-        where id in
-        <foreach collection="ids" item="ids" separator="," open="(" close=")">
-            #{ids}
-        </foreach>
-    </select>
-
-
-
-
-    <!-- 修改用户 设计组长姓名 -->
-    <update id="updUserDesignLeaderById">
-        UPDATE sys_user SET design_team_leader_name = #{designTeamLeaderName} WHERE id = #{userId}
-    </update>
-
-</mapper>

+ 0 - 83
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/material/service/impl/MaterialVideoFrameServiceImpl.java

@@ -1,83 +0,0 @@
-package cn.com.ctop.common.module.material.service.impl;
-
-import cn.com.ctop.common.module.material.entity.MaterialVideoFrame;
-import cn.com.ctop.common.module.material.mapper.MaterialVideoFrameMapper;
-import cn.com.ctop.common.module.material.service.IMaterialVideoFrameService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
-import cn.com.ctop.common.module.utils.LoadFileUtil;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 视频素材截帧信息
- */
-@Slf4j
-@Service
-public class MaterialVideoFrameServiceImpl extends ServiceImpl<MaterialVideoFrameMapper, MaterialVideoFrame> implements IMaterialVideoFrameService {
-
-    @Resource
-    MaterialVideoFrameMapper  materialVideoFrameMapper;
-
-    @Value("${jeecg.path.image-upload}")
-    private String imageUpLoadPath;
-
-    @Override
-    public int getFrameCountByCode(String videoMd5) {
-        return materialVideoFrameMapper.queryFrameCountByCode(videoMd5);
-    }
-
-    @Override
-    public void getTencentCutFrame(String videoUrl, String videoMd5, String coverUrl) {
-        try {
-            String loadImage = "cutFrame/" + videoMd5 + "/${Number}.jpg";
-            Map<String, Object> coverMap = CloudVideoProcessUtil.videoCutFrameHandle(videoUrl, loadImage);
-            List<MaterialVideoFrame> batch = new ArrayList<>();
-            for (int i = 0; i <= 13; i++) {
-                String url = (String) coverMap.get(String.valueOf(i));
-                if (!Check.isNull(url)) {
-                    String cutFramePath = LoadFileUtil.downLoadFromUrl(url, imageUpLoadPath);
-                    String cutFrameMd5 = LoadFileUtil.getMD5(cutFramePath);
-                    MaterialVideoFrame materialVideoFrame = new MaterialVideoFrame();
-                    materialVideoFrame.setMd5(cutFrameMd5);
-                    materialVideoFrame.setUrl(url);
-                    materialVideoFrame.setVideoMd5(videoMd5);
-                    materialVideoFrame.setFrameIndex(i+1);
-                    batch.add(materialVideoFrame);
-                    this.save(materialVideoFrame);
-                    LoadFileUtil.delFile(cutFramePath);
-                }
-            }
-            insertFrames(batch,videoMd5,coverUrl);
-        } catch (Exception e) {
-            log.info("抽帧异常,code:{}", videoMd5);
-            log.error("获取截帧图片MD5错误");
-        }
-    }
-
-    private void insertFrames(List<MaterialVideoFrame> batch,  String videoMd5, String coverUrl){
-        String cutFramePath = LoadFileUtil.downLoadFromUrl(coverUrl, imageUpLoadPath);
-        String cutFrameMd5 = null;
-        try {
-            cutFrameMd5 = LoadFileUtil.getMD5(cutFramePath);
-        } catch (IOException e) {
-            log.error("获取截帧图片MD5错误");
-        }
-        MaterialVideoFrame materialVideoFrame = new MaterialVideoFrame();
-        materialVideoFrame.setMd5(cutFrameMd5);
-        materialVideoFrame.setUrl(coverUrl);
-        materialVideoFrame.setVideoMd5(videoMd5);
-        materialVideoFrame.setFrameIndex(0);
-        batch.add(materialVideoFrame);
-        this.saveBatch(batch);
-    }
-}

+ 0 - 60
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/message/entity/SysMessage.java

@@ -1,60 +0,0 @@
-package cn.com.ctop.common.module.message.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecg.common.aspect.annotation.Dict;
-import org.jeecg.common.system.base.entity.JeecgEntity;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-/**
- * @Description: 消息
- * @Author: jeecg-boot
- * @Date:  2019-04-09
- * @Version: V1.0
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@TableName("sys_sms")
-public class SysMessage extends JeecgEntity {
-	/**推送内容*/
-	@Excel(name = "推送内容", width = 15)
-	private String esContent;
-	/**推送所需参数Json格式*/
-	@Excel(name = "推送所需参数Json格式", width = 15)
-	private String esParam;
-	/**接收人*/
-	@Excel(name = "接收人", width = 15)
-	private String esReceiver;
-	/**推送失败原因*/
-	@Excel(name = "推送失败原因", width = 15)
-	private String esResult;
-	/**发送次数*/
-	@Excel(name = "发送次数", width = 15)
-	private Integer esSendNum;
-	/**推送状态 0未推送 1推送成功 2推送失败*/
-	@Excel(name = "推送状态 0未推送 1推送成功 2推送失败", width = 15)
-	@Dict(dicCode = "msgSendStatus")
-    private String esSendStatus;
-	/**推送时间*/
-	@Excel(name = "推送时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private Date esSendTime;
-	/**消息标题*/
-	@Excel(name = "消息标题", width = 15)
-	private String esTitle;
-	/**推送方式:1短信 2邮件 3微信*/
-	@Excel(name = "推送方式:1短信 2邮件 3微信", width = 15)
-	@Dict(dicCode = "msgType")
-    private String esType;
-	/**备注*/
-	@Excel(name = "备注", width = 15)
-	private String remark;
-}

+ 0 - 108
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/message/websocket/WebSocket.java

@@ -1,108 +0,0 @@
-package cn.com.ctop.common.module.message.websocket;
-
-import com.alibaba.fastjson.JSONObject;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.constant.WebsocketConst;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.OnClose;
-import javax.websocket.OnMessage;
-import javax.websocket.OnOpen;
-import javax.websocket.Session;
-import javax.websocket.server.PathParam;
-import javax.websocket.server.ServerEndpoint;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-/**
- * @Author scott
- * @Date 2019/11/29 9:41
- * @Description: 此注解相当于设置访问URL
- */
-@Component
-@Slf4j
-@ServerEndpoint("/websocket/{userId}") //此注解相当于设置访问URL
-public class WebSocket {
-
-    private Session session;
-
-    private static CopyOnWriteArraySet<WebSocket> webSockets =new CopyOnWriteArraySet<>();
-    private static Map<String,Session> sessionPool = new HashMap<String,Session>();
-
-    @OnOpen
-    public void onOpen(Session session, @PathParam(value="userId")String userId) {
-        try {
-			this.session = session;
-			webSockets.add(this);
-			sessionPool.put(userId, session);
-			log.info("【websocket消息】有新的连接,总数为:"+webSockets.size());
-		} catch (Exception e) {
-		}
-    }
-
-    @OnClose
-    public void onClose() {
-        try {
-			webSockets.remove(this);
-			log.info("【websocket消息】连接断开,总数为:"+webSockets.size());
-		} catch (Exception e) {
-		}
-    }
-
-    @OnMessage
-    public void onMessage(String message) {
-        //todo 现在有个定时任务刷,应该去掉
-    	log.debug("【websocket消息】收到客户端消息:"+message);
-    	JSONObject obj = new JSONObject();
-        //业务类型
-        obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_CHECK);
-        //消息内容
-        obj.put(WebsocketConst.MSG_TXT, "心跳响应");
-    	session.getAsyncRemote().sendText(obj.toJSONString());
-    }
-
-    // 此为广播消息
-    public void sendAllMessage(String message) {
-    	log.info("【websocket消息】广播消息:"+message);
-        for(WebSocket webSocket : webSockets) {
-            try {
-            	if(webSocket.session.isOpen()) {
-            		webSocket.session.getAsyncRemote().sendText(message);
-            	}
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    // 此为单点消息
-    public void sendOneMessage(String userId, String message) {
-        Session session = sessionPool.get(userId);
-        if (session != null&&session.isOpen()) {
-            try {
-            	log.info("【websocket消息】 单点消息:"+message);
-                session.getAsyncRemote().sendText(message);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    // 此为单点消息(多人)
-    public void sendMoreMessage(String[] userIds, String message) {
-    	for(String userId:userIds) {
-    		Session session = sessionPool.get(userId);
-            if (session != null&&session.isOpen()) {
-                try {
-                	log.info("【websocket消息】 单点消息:"+message);
-                    session.getAsyncRemote().sendText(message);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-    	}
-
-    }
-
-}

+ 0 - 79
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/AnnouncementSendModel.java

@@ -1,79 +0,0 @@
-package cn.com.ctop.common.module.model;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-
-/**
- * @Description: 用户通告阅读标记表
- * @Author: jeecg-boot
- * @Date:  2019-02-21
- * @Version: V1.0
- */
-@Data
-@TableName("sys_announcement_send")
-public class AnnouncementSendModel implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**id*/
-	@TableId(type = IdType.UUID)
-	private java.lang.String id;
-	/**通告id*/
-	private java.lang.String anntId;
-	/**用户id*/
-	private java.lang.String userId;
-	/**标题*/
-	private java.lang.String titile;
-	/**内容*/
-	private java.lang.String msgContent;
-	/**发布人*/
-	private java.lang.String sender;
-	/**优先级(L低,M中,H高)*/
-	private java.lang.String priority;
-	/**阅读状态*/
-	private java.lang.String readFlag;
-	/**发布时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private java.util.Date sendTime;
-	/**页数*/
-	private java.lang.Integer pageNo;
-	/**大小*/
-	private java.lang.Integer pageSize;
-    /**
-     * 消息类型1:通知公告2:系统消息
-     */
-    private java.lang.String msgCategory;
-
-	/**
-	 * 业务id
-	 */
-	private java.lang.String busId;
-	/**
-	 * 业务类型
-	 */
-	private java.lang.String busType;
-	/**
-	 * 打开方式 组件:component 路由:url
-	 */
-	private java.lang.String openType;
-	/**
-	 * 组件/路由 地址
-	 */
-	private java.lang.String openPage;
-
-	/**
-	 * 业务类型查询(0.非bpm业务)
-	 */
-	private java.lang.String bizSource;
-
-	/**
-	 * 摘要
-	 */
-	private java.lang.String msgAbstract;
-}

+ 0 - 66
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/DepartIdModel.java

@@ -1,66 +0,0 @@
-package cn.com.ctop.common.module.model;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * <p>
- * 部门表 封装树结构的部门的名称的实体类
- * <p>
- *
- * @author Steve
- * @since 2019-01-22
- *
- */
-@Data
-public class DepartIdModel implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键ID
-     */
-    private String key;
-
-    /**
-     * 主键ID
-     */
-    private String value;
-
-    /**
-     * 部门名称
-     */
-    private String title;
-    private String orgCode;
-
-    List<DepartIdModel> children = new ArrayList<>();
-
-    /**
-     * 将SysDepartTreeModel的部分数据放在该对象当中
-     * @param treeModel 树状结构
-     * @return 部门信息
-     */
-    public DepartIdModel convert(SysDepartTreeModel treeModel) {
-        this.key = treeModel.getId();
-        this.value = treeModel.getId();
-        this.title = treeModel.getTitle();
-        this.orgCode = treeModel.getOrgCode();
-        return this;
-    }
-
-    /**
-     * 该方法为用户部门的实现类所使用
-     * @param sysDepart 系统部门信息
-     * @return 部门信息
-     */
-    public DepartIdModel convertByUserDepart(SysDepart sysDepart) {
-        this.key = sysDepart.getId();
-        this.value = sysDepart.getId();
-        this.title = sysDepart.getDepartName();
-        return this;
-    }
-}

+ 0 - 394
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/SysDepartTreeModel.java

@@ -1,394 +0,0 @@
-package cn.com.ctop.common.module.model;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * <p>
- * 部门表 存储树结构数据的实体类
- * <p>
- *
- * @Author Steve
- * @Since 2019-01-22
- */
-public class SysDepartTreeModel implements Serializable{
-
-    private static final long serialVersionUID = 1L;
-
-    /** 对应SysDepart中的id字段,前端数据树中的key*/
-    private String key;
-
-    /** 对应SysDepart中的id字段,前端数据树中的value*/
-    private String value;
-
-    /** 对应depart_name字段,前端数据树中的title*/
-    private String title;
-
-
-    private boolean isLeaf;
-    // 以下所有字段均与SysDepart相同
-
-    private String id;
-
-    private String parentId;
-
-    private String departName;
-
-    private String departNameEn;
-
-    private String departNameAbbr;
-
-    private Integer departOrder;
-
-    private String description;
-
-    private String orgCategory;
-
-    private String orgType;
-
-    private String orgCode;
-
-    private String mobile;
-
-    private String fax;
-
-    private String address;
-
-    private String memo;
-
-    private String status;
-
-    private String delFlag;
-
-    private String createBy;
-
-    private Date createTime;
-
-    private String updateBy;
-
-    private Date updateTime;
-
-    private String leaderId;
-    /**
-     * 领导姓名
-     */
-    private String leaderName;
-    private List<SysDepartTreeModel> children = new ArrayList<>();
-
-
-    /**
-     * 将SysDepart对象转换成SysDepartTreeModel对象
-     * @param sysDepart
-     */
-	public SysDepartTreeModel(SysDepart sysDepart) {
-		this.key = sysDepart.getId();
-        this.value = sysDepart.getId();
-        this.title = sysDepart.getTitle();
-        this.id = sysDepart.getId();
-        this.parentId = sysDepart.getParentId();
-        this.departName = sysDepart.getDepartName();
-        this.departNameEn = sysDepart.getDepartNameEn();
-        this.departNameAbbr = sysDepart.getDepartNameAbbr();
-        this.departOrder = sysDepart.getDepartOrder();
-        this.description = sysDepart.getDescription();
-        this.orgCategory = sysDepart.getOrgCategory();
-        this.orgType = sysDepart.getOrgType();
-        this.orgCode = sysDepart.getOrgCode();
-        this.mobile = sysDepart.getMobile();
-        this.fax = sysDepart.getFax();
-        this.address = sysDepart.getAddress();
-        this.memo = sysDepart.getMemo();
-        this.status = sysDepart.getStatus();
-        this.delFlag = sysDepart.getDelFlag();
-        this.createBy = sysDepart.getCreateBy();
-        this.createTime = sysDepart.getCreateTime();
-        this.updateBy = sysDepart.getUpdateBy();
-        this.updateTime = sysDepart.getUpdateTime();
-        this.leaderName = sysDepart.getLeaderName();
-        this.leaderId = sysDepart.getLeaderId();
-    }
-
-    public boolean getIsLeaf() {
-        return isLeaf;
-    }
-
-    public String getLeaderId() {
-        return leaderId;
-    }
-
-    public void setLeaderId(String leaderId) {
-        this.leaderId = leaderId;
-    }
-
-    public String getLeaderName() {
-        return leaderName;
-    }
-
-    public void setLeaderName(String leaderName) {
-        this.leaderName = leaderName;
-    }
-
-    public void setIsLeaf(boolean isleaf) {
-         this.isLeaf = isleaf;
-    }
-
-    public String getKey() {
-		return key;
-	}
-
-
-	public void setKey(String key) {
-		this.key = key;
-	}
-
-
-	public String getValue() {
-		return value;
-	}
-
-
-	public void setValue(String value) {
-		this.value = value;
-	}
-
-
-	public String getTitle() {
-		return title;
-	}
-
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-
-	public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public List<SysDepartTreeModel> getChildren() {
-        return children;
-    }
-
-    public void setChildren(List<SysDepartTreeModel> children) {
-        if (children==null){
-            this.isLeaf=true;
-        }
-        this.children = children;
-    }
-
-    public String getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(String parentId) {
-        this.parentId = parentId;
-    }
-
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public String getDepartName() {
-        return departName;
-    }
-
-    public void setDepartName(String departName) {
-        this.departName = departName;
-    }
-
-    public String getOrgCategory() {
-		return orgCategory;
-	}
-
-	public void setOrgCategory(String orgCategory) {
-		this.orgCategory = orgCategory;
-	}
-
-    public String getOrgType() {
-        return orgType;
-    }
-
-    public void setOrgType(String orgType) {
-        this.orgType = orgType;
-    }
-
-    public String getOrgCode() {
-        return orgCode;
-    }
-
-    public void setOrgCode(String orgCode) {
-        this.orgCode = orgCode;
-    }
-
-    public String getMobile() {
-        return mobile;
-    }
-
-    public void setMobile(String mobile) {
-        this.mobile = mobile;
-    }
-
-    public String getFax() {
-        return fax;
-    }
-
-    public void setFax(String fax) {
-        this.fax = fax;
-    }
-
-    public String getAddress() {
-        return address;
-    }
-
-    public void setAddress(String address) {
-        this.address = address;
-    }
-
-    public String getMemo() {
-        return memo;
-    }
-
-    public void setMemo(String memo) {
-        this.memo = memo;
-    }
-
-    public String getDepartNameEn() {
-        return departNameEn;
-    }
-
-    public void setDepartNameEn(String departNameEn) {
-        this.departNameEn = departNameEn;
-    }
-
-    public String getDepartNameAbbr() {
-        return departNameAbbr;
-    }
-
-    public void setDepartNameAbbr(String departNameAbbr) {
-        this.departNameAbbr = departNameAbbr;
-    }
-
-    public Integer getDepartOrder() {
-        return departOrder;
-    }
-
-    public void setDepartOrder(Integer departOrder) {
-        this.departOrder = departOrder;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(String delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    public String getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(String createBy) {
-        this.createBy = createBy;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getUpdateBy() {
-        return updateBy;
-    }
-
-    public void setUpdateBy(String updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public SysDepartTreeModel() { }
-
-    /**
-     * 重写equals方法
-     */
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-			return true;
-		}
-        if (o == null || getClass() != o.getClass()) {
-			return false;
-		}
-        SysDepartTreeModel model = (SysDepartTreeModel) o;
-        return Objects.equals(id, model.id) &&
-                Objects.equals(parentId, model.parentId) &&
-                Objects.equals(departName, model.departName) &&
-                Objects.equals(departNameEn, model.departNameEn) &&
-                Objects.equals(departNameAbbr, model.departNameAbbr) &&
-                Objects.equals(departOrder, model.departOrder) &&
-                Objects.equals(description, model.description) &&
-                Objects.equals(orgCategory, model.orgCategory) &&
-                Objects.equals(orgType, model.orgType) &&
-                Objects.equals(orgCode, model.orgCode) &&
-                Objects.equals(mobile, model.mobile) &&
-                Objects.equals(fax, model.fax) &&
-                Objects.equals(address, model.address) &&
-                Objects.equals(memo, model.memo) &&
-                Objects.equals(status, model.status) &&
-                Objects.equals(delFlag, model.delFlag) &&
-                Objects.equals(createBy, model.createBy) &&
-                Objects.equals(createTime, model.createTime) &&
-                Objects.equals(updateBy, model.updateBy) &&
-                Objects.equals(updateTime, model.updateTime) &&
-                Objects.equals(children, model.children);
-    }
-
-    /**
-     * 重写hashCode方法
-     */
-    @Override
-    public int hashCode() {
-
-        return Objects.hash(id, parentId, departName, departNameEn, departNameAbbr,
-        		departOrder, description, orgCategory, orgType, orgCode, mobile, fax, address,
-        		memo, status, delFlag, createBy, createTime, updateBy, updateTime,
-        		children);
-    }
-
-}

+ 0 - 23
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/SysUserSysDepartModel.java

@@ -1,23 +0,0 @@
-package cn.com.ctop.common.module.model;
-
-import lombok.Data;
-
-/**
- * 包含 SysUser 和 SysDepart 的 Model
- *
- * @author sunjianlei
- */
-@Data
-public class SysUserSysDepartModel {
-
-    private String id;
-    private String realname;
-    private String workNo;
-    private String post;
-    private String telephone;
-    private String email;
-    private String phone;
-    private String departId;
-    private String departName;
-
-}

+ 0 - 176
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/TreeModel.java

@@ -1,176 +0,0 @@
-package cn.com.ctop.common.module.model;
-
-import cn.com.ctop.common.module.entity.SysPermission;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author jeecg-boot
- * 2019年11月12日11:09:37
- */
-
-public class TreeModel implements Serializable {
-
-	private static final long serialVersionUID = 4013193970046502756L;
-
-	private String key;
-
-	private String title;
-
-	private String slotTitle;
-
-	private boolean isLeaf;
-
-	private String icon;
-
-	private Integer ruleFlag;
-
-	private Map<String,String> scopedSlots;
-
-	public Map<String, String> getScopedSlots() {
-		return scopedSlots;
-	}
-
-	public void setScopedSlots(Map<String, String> scopedSlots) {
-		this.scopedSlots = scopedSlots;
-	}
-
-	public String getKey() {
-		return key;
-	}
-
-	public void setKey(String key) {
-		this.key = key;
-	}
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public boolean getIsLeaf() {
-		return isLeaf;
-	}
-
-	public void setIsLeaf(boolean isLeaf) {
-		this.isLeaf = isLeaf;
-	}
-
-	public String getIcon() {
-		return icon;
-	}
-
-	public void setIcon(String icon) {
-		this.icon = icon;
-	}
-
-	private List<TreeModel> children;
-
-	public List<TreeModel> getChildren() {
-		return children;
-	}
-
-	public void setChildren(List<TreeModel> children) {
-		this.children = children;
-	}
-
-	public TreeModel() {
-
-	}
-
-	public TreeModel(SysPermission permission) {
-		this.key = permission.getId();
-		this.icon = permission.getIcon();
-		this.parentId = permission.getParentId();
-		this.title = permission.getName();
-		this.slotTitle =  permission.getName();
-		this.value = permission.getId();
-		this.isLeaf = permission.isLeaf();
-		this.label = permission.getName();
-		if(!permission.isLeaf()) {
-			this.children = new ArrayList<TreeModel>();
-		}
-	}
-
-	 public TreeModel(String key, String parentId, String slotTitle, Integer ruleFlag, boolean isLeaf) {
-    	this.key = key;
-    	this.parentId = parentId;
-    	this.ruleFlag=ruleFlag;
-    	this.slotTitle =  slotTitle;
-    	Map<String,String> map = new HashMap<String,String>();
-    	map.put("title", "hasDatarule");
-    	this.scopedSlots = map;
-    	this.isLeaf = isLeaf;
-    	this.value = key;
-    	if(!isLeaf) {
-    		this.children = new ArrayList<TreeModel>();
-    	}
-    }
-
-    private String parentId;
-
-    private String label;
-
-    private String value;
-
-
-    public String getParentId() {
-		return parentId;
-	}
-
-	public void setParentId(String parentId) {
-		this.parentId = parentId;
-	}
-
-	/**
-	 * @return the label
-	 */
-	public String getLabel() {
-		return label;
-	}
-
-	/**
-	 * @param label the label to set
-	 */
-	public void setLabel(String label) {
-		this.label = label;
-	}
-
-	/**
-	 * @return the value
-	 */
-	public String getValue() {
-		return value;
-	}
-
-	/**
-	 * @param value the value to set
-	 */
-	public void setValue(String value) {
-		this.value = value;
-	}
-
-	public String getSlotTitle() {
-		return slotTitle;
-	}
-
-	public void setSlotTitle(String slotTitle) {
-		this.slotTitle = slotTitle;
-	}
-
-	public Integer getRuleFlag() {
-		return ruleFlag;
-	}
-
-	public void setRuleFlag(Integer ruleFlag) {
-		this.ruleFlag = ruleFlag;
-	}
-
-}

+ 0 - 93
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/model/TreeSelectModel.java

@@ -1,93 +0,0 @@
-package cn.com.ctop.common.module.model;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
-  * 树形下拉框
- */
-public class TreeSelectModel implements Serializable {
-
-	private static final long serialVersionUID = 9016390975325574747L;
-
-	private String key;
-
-	private String title;
-
-	private boolean isLeaf;
-
-	private String icon;
-
-	private String parentId;
-
-	private String value;
-
-	private String code;
-
-	public String getValue() {
-		return value;
-	}
-
-	public void setValue(String value) {
-		this.value = value;
-	}
-
-	public String getParentId() {
-		return parentId;
-	}
-
-	public void setParentId(String parentId) {
-		this.parentId = parentId;
-	}
-
-	public String getKey() {
-		return key;
-	}
-
-	public void setKey(String key) {
-		this.key = key;
-	}
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public boolean isLeaf() {
-		return isLeaf;
-	}
-
-	public void setLeaf(boolean isLeaf) {
-		this.isLeaf = isLeaf;
-	}
-
-	public String getIcon() {
-		return icon;
-	}
-
-	public void setIcon(String icon) {
-		this.icon = icon;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	private List<TreeSelectModel> children;
-
-	public List<TreeSelectModel> getChildren() {
-		return children;
-	}
-
-	public void setChildren(List<TreeSelectModel> children) {
-		this.children = children;
-	}
-
-}

+ 0 - 41
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/IMaterialCutFrameService.java

@@ -1,41 +0,0 @@
-package cn.com.ctop.common.module.service;
-
-
-import cn.com.ctop.common.module.entity.MaterialCutFrame;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.io.IOException;
-import java.util.List;
-
-/**
- * 截屏
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-12-25
- */
-public interface IMaterialCutFrameService extends IService<MaterialCutFrame> {
-    void getCutFrame(String url, String materialId, Long secondDuration, String height, String width) throws IOException;
-
-    List<MaterialCutFrame> getListByVideoSignature(String signature);
-
-    void getTencentCutFrame(String videoUrl, String materialId, String coveUrl);
-
-    boolean updateTencentCutFrame(String videoMD5);
-
-    MaterialCutFrame getCutFrameByCode(String code);
-
-    List<JSONObject> getProgramCreativeCover(String signature);
-
-    MaterialCutFrame selectByMd5(String md5);
-
-    /**
-     * 根基photoId imageToken 获取单张封面
-     *
-     * @param photoId
-     * @param imageToken
-     * @return
-     */
-    JSONObject getCutFrameByVideoMd5(String photoId, String imageToken);
-}

+ 0 - 335
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysBaseApi.java

@@ -1,335 +0,0 @@
-package cn.com.ctop.common.module.service;
-
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import org.jeecg.common.system.vo.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.sql.SQLException;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Description: 底层共通业务API,提供其他独立模块调用
- * @Author: scott
- * @Date:2019-4-20
- * @Version:V1.0
- */
-public interface ISysBaseApi {
-
-	/**
-	 * 日志添加
-	 * @param LogContent 内容
-	 * @param logType 日志类型(0:定时任务;1:登录日志;2:操作日志)
-	 * @param operatetype 操作类型(1:添加;2:修改;3:删除;)
-	 */
-	void addLog(String LogContent, Integer logType, Integer operatetype);
-
-	/**
-	  * 根据用户账号查询用户信息
-	 * @param username
-	 * @return
-	 */
-	public LoginUser getUserByName(String username);
-
-	/**
-	  * 根据用户id查询用户信息
-	 * @param id
-	 * @return
-	 */
-	public LoginUser getUserById(String id);
-
-	/**
-	 * 通过用户账号查询角色集合
-	 * @param username
-	 * @return
-	 */
-	public List<String> getRolesByUsername(String username);
-
-	/**
-	 * 通过用户账号查询部门集合
-	 * @param username
-	 * @return 部门 id
-	 */
-	List<String> getDepartIdsByUsername(String username);
-
-	/**
-	 * 通过用户账号查询部门 name
-	 * @param username
-	 * @return 部门 name
-	 */
-	List<String> getDepartNamesByUsername(String username);
-
-	/**
-	 * 获取当前数据库类型
-	 * @return
-	 * @throws Exception
-	 */
-	public String getDatabaseType() throws SQLException;
-
-	/**
-	  * 获取数据字典
-	 * @param code
-	 * @return
-	 */
-	public List<DictModel> queryDictItemsByCode(String code);
-
-	/** 查询所有的父级字典,按照create_time排序 */
-	public List<DictModel> queryAllDict();
-
-    /**
-     * 查询所有分类字典
-     * @return
-     */
-	public List<SysCategoryModel> queryAllDSysCategory();
-
-	/**
-	  * 获取表数据字典
-	 * @param table
-	 * @param text
-	 * @param code
-	 * @return
-	 */
-    List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
-
-    /**
-   	 * 查询所有部门 作为字典信息 id -->value,departName -->text
-   	 * @return
-   	 */
-   	public List<DictModel> queryAllDepartBackDictModel();
-
-    /**
-   	 * 查询所有部门,拼接查询条件
-   	 * @return
-   	 */
-   	List<JSONObject> queryAllDepart(Wrapper wrapper);
-
-	/**
-	 * 发送系统消息
-	 * @param fromUser 发送人(用户登录账户)
-	 * @param toUser  发送给(用户登录账户)
-	 * @param title  消息主题
-	 * @param msgContent  消息内容
-	 */
-	public void sendSysAnnouncement(String fromUser,String toUser,String title, String msgContent);
-
-	/**
-	 * 发送系统消息
-	 * @param fromUser 发送人(用户登录账户)
-	 * @param toUser   发送给(用户登录账户)
-	 * @param title    通知标题
-	 * @param map  	   模板参数
-	 * @param templateCode  模板编码
-	 */
-	public void sendSysAnnouncement(String fromUser, String toUser,String title, Map<String, String> map, String templateCode);
-
-	/**
-	 *
-	 * @param fromUser 发送人(用户登录账户)
-	 * @param toUser 发送给(用户登录账户)
-	 * @param title 通知标题
-	 * @param map 模板参数
-	 * @param templateCode 模板编码
-	 * @param busType 业务类型
-	 * @param busId 业务id
-	 */
-	public void sendSysAnnouncement(String fromUser, String toUser,String title, Map<String, String> map, String templateCode,String busType,String busId);
-
-	/**
-	 * 通过消息中心模板,生成推送内容
-	 *
-	 * @param templateCode 模板编码
-	 * @param map          模板参数
-	 * @return
-	 */
-	public String parseTemplateByCode(String templateCode, Map<String, String> map);
-
-
-	/**
-	 * 发送系统消息
-	 * @param fromUser 发送人(用户登录账户)
-	 * @param toUser  发送给(用户登录账户)
-	 * @param title  消息主题
-	 * @param msgContent  消息内容
-	 * @param setMsgCategory  消息类型 1:消息2:系统消息
-	 */
-	public void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent, String setMsgCategory);
-
-	/**queryTableDictByKeys
-	 * 发送系统消息
-	 * @param fromUser 发送人(用户登录账户)
-	 * @param toUser  发送给(用户登录账户)
-	 * @param title  消息主题
-	 * @param msgContent  消息内容
-	 * @param setMsgCategory  消息类型 1:消息2:系统消息
-	 * @param busType  业务类型
-	 * @param busId  业务id
-	 */
-	public void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent, String setMsgCategory,String busType,String busId);
-
-	/**
-	 * 根据业务类型及业务id修改消息已读
-	 * @param busType
-	 * @param busId
-	 */
-	public void updateSysAnnounReadFlag(String busType,String busId);
-	/**
-	 * 查询表字典 支持过滤数据
-	 * @param table
-	 * @param text
-	 * @param code
-	 * @param filterSql
-	 * @return
-	 */
-	public List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql);
-
-	/**
-	 * 查询指定table的 text code 获取字典,包含text和value
-	 * @param table
-	 * @param text
-	 * @param code
-	 * @param keyArray
-	 * @return
-	 */
-	@Deprecated
-	public List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray);
-
-	/**
-	 * 获取所有有效用户
-	 * @return
-	 */
-	public List<ComboModel> queryAllUser();
-
-    /**
-     * 获取所有有效用户 带参
-     * userIds 默认选中用户
-     * @return
-     */
-    public JSONObject queryAllUser(String[] userIds, int pageNo, int pageSize);
-
-    /**
-     * 获取所有有效用户 拼接查询条件
-     *
-     * @return
-     */
-    List<JSONObject> queryAllUser(Wrapper wrapper);
-
-	/**
-	 * 获取所有角色
-	 * @return
-	 */
-	public List<ComboModel> queryAllRole();
-
-	/**
-	 * 获取所有角色 带参
-     * roleIds 默认选中角色
-	 * @return
-	 */
-	public List<ComboModel> queryAllRole(String[] roleIds );
-
-	/**
-	 * 通过用户账号查询角色Id集合
-	 * @param username
-	 * @return
-	 */
-	public List<String> getRoleIdsByUsername(String username);
-
-	/**
-	 * 通过部门编号查询部门id
-	 * @param orgCode
-	 * @return
-	 */
-	public String getDepartIdsByOrgCode(String orgCode);
-
-	/**
-	 * 查询上一级部门
-	 * @param departId
-	 * @return
-	 */
-	public DictModel getParentDepartId(String departId);
-
-	/**
-	 * 查询所有部门
-	 * @return
-	 */
-	public List<SysDepartModel> getAllSysDepart();
-
-	/**
-	 * 根据 id 查询数据库中存储的 DynamicDataSourceModel
-	 *
-	 * @param dbSourceId
-	 * @return
-	 */
-	DynamicDataSourceModel getDynamicDbSourceById(String dbSourceId);
-
-	/**
-	 * 根据 code 查询数据库中存储的 DynamicDataSourceModel
-	 *
-	 * @param dbSourceCode
-	 * @return
-	 */
-	DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode);
-
-	/**
-	 * 根据部门Id获取部门负责人
-	 * @param deptId
-	 * @return
-	 */
-	public List<String> getDeptHeadByDepId(String deptId);
-
-	/**
-	 * 文件上传
-	 * @param file 文件
-	 * @param bizPath 自定义路径
-	 * @param uploadType 上传方式
-	 * @return
-	 */
-	public String upload(MultipartFile file,String bizPath,String uploadType);
-
-	/**
-	 * 文件上传 自定义桶
-	 * @param file
-	 * @param bizPath
-	 * @param uploadType
-	 * @param customBucket
-	 * @return
-	 */
-	public String upload(MultipartFile file,String bizPath,String uploadType,String customBucket);
-
-	/**
-	 * 文档管理文件下载预览
-	 * @param filePath
-	 * @param uploadpath
-	 * @param response
-	 */
-	public void viewAndDownload(String filePath, String uploadpath, String uploadType,HttpServletResponse response);
-
-
-	/**
-	 * 给指定用户发消息
-	 * @param userIds
-	 * @param cmd
-	 */
-	public void sendWebSocketMsg(String[] userIds, String cmd);
-
-	/**
-	 * 根据id获取所有参与用户
-	 * userIds
-	 * @return
-	 */
-	public List<LoginUser> queryAllUserByIds(String[] userIds);
-	/**
-	 * 将会议签到信息推动到预览
-	 * userIds
-	 * @return
-	 * @param userId
-	 */
-    void meetingSignWebsocket(String userId);
-	/**
-	 * 根据name获取所有参与用户
-	 * userNames
-	 * @return
-	 */
-	List<LoginUser> queryUserByNames(String[] userNames);
-}

+ 0 - 24
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysDepartRoleService.java

@@ -1,24 +0,0 @@
-package cn.com.ctop.common.module.service;
-
-import cn.com.ctop.common.module.entity.SysDepartRole;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
-
-/**
- * @Description: 部门角色
- * @Author: jeecg-boot
- * @Date:   2020-02-12
- * @Version: V1.0
- */
-public interface ISysDepartRoleService extends IService<SysDepartRole> {
-
-    /**
-     * 根据用户id,部门id查询可授权所有部门角色
-     * @param orgCode
-     * @param userId
-     * @return
-     */
-    List<SysDepartRole> queryDeptRoleByDeptAndUser(String orgCode, String userId);
-
-}

+ 0 - 107
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysDepartService.java

@@ -1,107 +0,0 @@
-package cn.com.ctop.common.module.service;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-import cn.com.ctop.common.module.model.DepartIdModel;
-import cn.com.ctop.common.module.model.SysDepartTreeModel;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
-
-/**
- * <p>
- * 部门表 服务实现类
- * <p>
- *
- * @Author:Steve
- * @Since:   2019-01-22
- */
-public interface ISysDepartService extends IService<SysDepart>{
-    public String selectIdByOrdCode(String orgCode);
-    /**
-     * 查询我的部门信息,并分节点进行显示
-     * @return
-     */
-    List<SysDepartTreeModel> queryMyDeptTreeList(String departIds);
-
-    /**
-     * 查询所有部门信息,并分节点进行显示
-     * @return
-     */
-    List<SysDepartTreeModel> queryTreeList();
-
-    /**
-     * 查询所有部门DepartId信息,并分节点进行显示
-     * @return
-     */
-    public List<DepartIdModel> queryDepartIdTreeList();
-
-    /**
-     * 保存部门数据
-     * @param sysDepart
-     */
-    void saveDepartData(SysDepart sysDepart, String username);
-
-    /**
-     * 更新depart数据
-     * @param sysDepart
-     * @return
-     */
-    Boolean updateDepartDataById(SysDepart sysDepart, String username);
-
-    /**
-     * 删除depart数据
-     * @param id
-     * @return
-     */
-	/* boolean removeDepartDataById(String id); */
-
-    /**
-     * 根据关键字搜索相关的部门数据
-     * @param keyWord
-     * @return
-     */
-    List<SysDepartTreeModel> searhBy(String keyWord, String myDeptSearch, String departIds);
-
-    /**
-     * 根据部门id删除并删除其可能存在的子级部门
-     * @param id
-     * @return
-     */
-    boolean delete(String id);
-
-    /**
-     * 查询SysDepart集合
-     * @param userId
-     * @return
-     */
-	public List<SysDepart> queryUserDeparts(String userId);
-
-    /**
-     * 根据用户名查询部门
-     *
-     * @param username
-     * @return
-     */
-    List<SysDepart> queryDepartsByUsername(String username);
-
-	 /**
-     * 根据部门id批量删除并删除其可能存在的子级部门
-     * @param id
-     * @return
-     */
-	void deleteBatchWithChildren(List<String> ids);
-
-    /**
-     *  根据部门Id查询,当前和下级所有部门IDS
-     * @param departId
-     * @return
-     */
-    List<String> getSubDepIdsByDepId(String departId);
-
-    /**
-     * 获取我的部门下级所有部门IDS
-     * @return
-     */
-    List<String> getMySubDepIdsByDepId(String departIds);
-
-}

+ 0 - 22
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysUserDepartService.java

@@ -1,22 +0,0 @@
-package cn.com.ctop.common.module.service;
-
-import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.entity.SysUserDepart;
-import cn.com.ctop.common.module.entity.SysUserRole;
-import cn.com.ctop.common.module.model.DepartIdModel;
-import cn.com.ctop.common.module.model.SysUserDepartsVO;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
-
-public interface ISysUserDepartService extends IService<SysUserDepart> {
-    boolean addSysUseWithrDepart(SysUserDepartsVO sysUserDepartsVO);
-
-    List<DepartIdModel> queryDepartIdsOfUser(String userId);
-
-    boolean editSysUserWithDepart(SysUserDepartsVO sysUserDepartsVO);
-
-    List<SysUser> queryUserByDepId(String depId);
-
-    List<SysUser> queryUserByDepCode(String depCode, String realname);
-}

+ 0 - 277
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/ISysUserService.java

@@ -1,277 +0,0 @@
-package cn.com.ctop.common.module.service;
-
-import cn.com.ctop.common.module.entity.SysRole;
-import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.model.SysUserSysDepartModel;
-import cn.com.ctop.common.module.vo.SysUserVo;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.vo.SysUserCacheInfo;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * <p>
- * 用户表 服务类
- * </p>
- *
- * @Author scott
- * @since 2018-12-20
- */
-public interface ISysUserService extends IService<SysUser> {
-    List<SysUserVo> getUserListByCompany(String companyId, String userName);
-
-    List<SysUser> getUserListByRoleId(String roleId);
-
-    List<SysUserVo> getAllSales();
-
-    List<SysUserVo> getAllSalesByCompanyId(String companyId);
-
-    /**
-     * 重置密码
-     *
-     * @param username
-     * @param oldpassword
-     * @param newpassword
-     * @param confirmpassword
-     * @return
-     */
-    public Result<?> resetPassword(String username, String oldpassword, String newpassword, String confirmpassword);
-
-    /**
-     * 修改密码
-     *
-     * @param sysUser
-     * @return
-     */
-    public Result<?> changePassword(SysUser sysUser);
-
-    /**
-     * 删除用户
-     *
-     * @param userId
-     * @return
-     */
-    public boolean deleteUser(String userId);
-
-    /**
-     * 批量删除用户
-     *
-     * @param userIds
-     * @return
-     */
-    public boolean deleteBatchUsers(String userIds);
-
-    public SysUser getUserByName(String username);
-
-    SysUser getUserByRealName(String realname);
-
-    /**
-     * 添加用户和用户角色关系
-     *
-     * @param user
-     * @param roles
-     */
-    public void addUserWithRole(SysUser user, String roles);
-
-
-    /**
-     * 修改用户和用户角色关系
-     *
-     * @param user
-     * @param roles
-     */
-    public void editUserWithRole(SysUser user, String roles);
-
-    /**
-     * 获取用户的授权角色
-     *
-     * @param username
-     * @return
-     */
-    public List<String> getRole(String username);
-
-    /**
-     * 查询用户信息包括 部门信息
-     *
-     * @param username
-     * @return
-     */
-    public SysUserCacheInfo getCacheUser(String username);
-
-    /**
-     * 根据部门Id查询
-     *
-     * @param
-     * @return
-     */
-    public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username);
-
-    /**
-     * 根据部门Ids查询
-     *
-     * @param
-     * @return
-     */
-    public IPage<SysUser> getUserByDepIds(Page<SysUser> page, List<String> departIds, String username);
-
-    /**
-     * 根据 userIds查询,查询用户所属部门的名称(多个部门名逗号隔开)
-     *
-     * @param
-     * @return
-     */
-    public Map<String, String> getDepNamesByUserIds(List<String> userIds);
-
-    /**
-     * 根据部门 Id 和 QueryWrapper 查询
-     *
-     * @param page
-     * @param departId
-     * @param queryWrapper
-     * @return
-     */
-    public IPage<SysUser> getUserByDepartIdAndQueryWrapper(Page<SysUser> page, String departId, QueryWrapper<SysUser> queryWrapper);
-
-    /**
-     * 根据 orgCode 查询用户,包括子部门下的用户
-     *
-     * @param orgCode
-     * @param userParams 用户查询条件,可为空
-     * @param page       分页参数
-     * @return
-     */
-    IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page);
-
-    Map<String, Object> queryRoleCode(String userId);
-
-    /**
-     * 根据角色Id查询
-     *
-     * @param
-     * @return
-     */
-    public IPage<SysUser> getUserByRoleId(Page<SysUser> page, String roleId, String username);
-
-    /**
-     * 通过用户名获取用户角色集合
-     *
-     * @param username 用户名
-     * @return 角色集合
-     */
-    Set<String> getUserRolesSet(String username);
-
-    /**
-     * 通过用户名获取用户权限集合
-     *
-     * @param username 用户名
-     * @return 权限集合
-     */
-    Set<String> getUserPermissionsSet(String username);
-
-    /**
-     * 根据用户名设置部门ID
-     *
-     * @param username
-     * @param orgCode
-     */
-    void updateUserDepart(String username, String orgCode);
-
-    /**
-     * 根据手机号获取用户名和密码
-     */
-    public SysUser getUserByPhone(String phone);
-
-
-    /**
-     * 根据邮箱获取用户
-     */
-    public SysUser getUserByEmail(String email);
-
-
-    /**
-     * 添加用户和用户部门关系
-     *
-     * @param user
-     * @param selectedParts
-     */
-    void addUserWithDepart(SysUser user, String selectedParts);
-
-    /**
-     * 编辑用户和用户部门关系
-     *
-     * @param user
-     * @param departs
-     */
-    void editUserWithDepart(SysUser user, String departs);
-
-    /**
-     * 校验用户是否有效
-     *
-     * @param sysUser
-     * @return
-     */
-    Result checkUserIsEffective(SysUser sysUser);
-
-    /**
-     * 查询被逻辑删除的用户
-     */
-    List<SysUser> queryLogicDeleted();
-
-    /**
-     * 查询被逻辑删除的用户(可拼装查询条件)
-     */
-    List<SysUser> queryLogicDeleted(LambdaQueryWrapper<SysUser> wrapper);
-
-    /**
-     * 还原被逻辑删除的用户
-     */
-    boolean revertLogicDeleted(List<String> userIds, SysUser updateEntity);
-
-    /**
-     * 彻底删除被逻辑删除的用户
-     */
-    boolean removeLogicDeleted(List<String> userIds);
-
-    /**
-     * 更新手机号、邮箱空字符串为 null
-     */
-    @Transactional(rollbackFor = Exception.class)
-    boolean updateNullPhoneEmail();
-
-    /**
-     * 保存第三方用户信息
-     *
-     * @param sysUser
-     */
-    void saveThirdUser(SysUser sysUser);
-
-    /**
-     * 根据部门Ids查询
-     *
-     * @param
-     * @return
-     */
-    List<SysUser> queryByDepIds(List<String> departIds, String username);
-
-    List<SysUserVo> getAllUser(String userName, String status);
-
-    List<SysUser> getAllDesigner();
-
-    SysUser getDesignerTeamLeaderBy(String orgCode);
-
-    List<SysUser> queryPageList(SysUser user);
-
-    Map<String, String> getUserMapByMap(Map<String, String> userIdMap);
-
-    String getRoleCodeByUserId(String userId);
-
-    Integer updUserDesignLeaderById(String userId,String userName,String roleId);
-}

+ 0 - 24
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/IUserCompanyService.java

@@ -1,24 +0,0 @@
-package cn.com.ctop.common.module.service;
-
-import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.entity.UserCompany;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.common.api.vo.Result;
-
-/**
- * 用户够公司
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-11-14
- */
-public interface IUserCompanyService extends IService<UserCompany> {
-
-    void addOrUpdateUserWithCompany(SysUser user);
-
-    void removeByUserId(String id);
-
-    UserCompany getByUserId(String userId);
-
-    Result<Object> allCompany();
-}

+ 0 - 318
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -1,318 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.OauthAgentToken;
-import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
-import cn.com.ctop.common.module.mapper.OauthAgentTokenMapper;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.HttpUtils;
-import cn.com.ctop.common.module.utils.PropertiesUtils;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-
-/**
- * @Description: oauth授权码
- * @Author: jeecg-boot
- * @Date: 2019-07-09
- * @Version: V1.0
- */
-@Slf4j
-@Service
-public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper, CtopOauthToken> implements ICtopOauthTokenService {
-    @Value("${bytedance.appId}")
-    private String bytedanceAppId;
-    @Value("${bytedance.secret}")
-    private String bytedanceSecret;
-    @Value("${bytedance.url.api-prefix}")
-    private String bytedanceUrlApiPrefix;
-    @Value("${bytedance.url.refresh-token}")
-    private String bytedanceUrlRefreshToken;
-    @Value("${kuaishou.api-url}")
-    private String kuaishouApiUrl;
-
-    @Resource
-    private CtopOauthTokenMapper ctopOauthTokenMapper;
-    @Resource
-    private OauthAgentTokenMapper agentTokenMapper;
-
-    @Override
-    public CtopOauthToken getOauthTokenByAccountId(String accountId) {
-        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("account_id", accountId).orderByDesc("create_time");
-        queryWrapper.last("limit 1");
-        return this.getOne(queryWrapper);
-    }
-
-
-    @Override
-    public CtopOauthToken getTokenByAccountId(Long accountId) {
-        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("account_id", accountId).orderByDesc("create_time");
-        queryWrapper.last("limit 1");
-        return this.getOne(queryWrapper);
-    }
-
-    /**
-     * 刷新token
-     *
-     * @return
-     */
-    @Override
-    public Map<String, Object> getByteDanceAccessToken(CtopOauthToken token) {
-        Map<String, Object> resultMap = new HashMap<>();
-        String url = bytedanceUrlApiPrefix + bytedanceUrlRefreshToken;
-        Map<String, Object> param = new HashMap<>();
-        param.put("app_id", bytedanceAppId);
-        param.put("secret", bytedanceSecret);
-        param.put("grant_type", "refresh_token");
-        param.put("refresh_token", token.getRefreshToken());
-        String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
-        System.err.println(JSONObject.parseObject(result));
-        log.info("头条刷新token;accountId:{},返回信息:{}", token.getAccountId(), result);
-        if (null == result || "".equals(result.trim()) || "null".equalsIgnoreCase(result)) {
-            log.info("头条刷新token失败;accountId:{},返回信息:{}", token.getAccountId(), result);
-            resultMap.put("message", "token刷新失败");
-            resultMap.put("token", token);
-            resultMap.put("code", 0);
-            return resultMap;
-        }
-        JSONObject resultObject = JSONObject.parseObject(result);
-        Integer code = resultObject.getInteger("code");
-        String message = resultObject.getString("message");
-        if (code == 0) {
-            JSONObject data = resultObject.getJSONObject("data");
-            CtopOauthToken updateRefreshToken = new CtopOauthToken();
-            updateRefreshToken.setAccessToken(data.getString("access_token"));
-            updateRefreshToken.setRefreshToken(data.getString("refresh_token"));
-            Date now = new Date();
-            Integer refreshTokenExpiresIn = data.getInteger("refresh_token_expires_in");
-            Integer expiresIn = data.getInteger("expires_in");
-            updateRefreshToken.setRefreshTokenExpiresIn(addSecond(now, refreshTokenExpiresIn));
-            updateRefreshToken.setAccessTokenExpiresIn(addSecond(now, expiresIn));
-            QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("access_token", token.getAccessToken());
-            queryWrapper.eq("media_id", 1);
-            int i = ctopOauthTokenMapper.update(updateRefreshToken, queryWrapper);
-            if (i > 0) {
-                log.info("头条刷新token成功:accountId:{}", token.getAccountId());
-            }
-            resultMap.put("message", "token刷新成功");
-            resultMap.put("code", 0);
-        } else {
-            log.info("头条刷新token失败;accountId:{},返回信息:{}", token.getAccountId(), message);
-            resultMap.put("message", message);
-            resultMap.put("token", token);
-            resultMap.put("code", 0);
-        }
-        return resultMap;
-    }
-
-    /**
-     * 快手 刷新token
-     *
-     * @param accountId
-     * @param refreshToken
-     * @return
-     */
-    @Override
-    public void getKuaiShouRefreshToken(Long accountId, String token, String refreshToken, Long appId, String secret) {
-        log.info("快手刷新token入参,accountId:{},token:{},refreshToken:{}", accountId, token, refreshToken);
-        String url = kuaishouApiUrl + "/rest/openapi/oauth2/authorize/refresh_token";
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Content-Type", " application/json");
-        Map<String, Object> param = new HashMap<>();
-        param.put("app_id", appId);
-        param.put("secret", secret);
-        param.put("refresh_token", refreshToken);
-        try {
-            CtopOauthToken oauthToken = ctopOauthTokenMapper.selectByAccountId(accountId);
-            if (null == oauthToken) {
-                log.error("查询token信息返回结果为空,accountId:{}", accountId);
-                return;
-            }
-            log.info("刷新token,入參:{},token:{}", param, headers);
-            String result = HttpUtils.httpPostRequest(url, param, headers);
-            JSONObject resultJson = JSONObject.parseObject(result);
-            log.info("快手刷新token返回结果:{}", refreshToken);
-            if (Check.isNull(resultJson)) {
-                log.error("快手刷新token返回结果为空,accountId:{}", accountId);
-                return;
-            }
-            Integer code = resultJson.getInteger("code");
-            if (null == code || code != 0) {
-                log.error("快手刷新token失败,accountId:{},result:{}", accountId, resultJson);
-                return;
-            }
-            JSONObject dataJson = resultJson.getJSONObject("data");
-            if (null == dataJson) {
-                log.error("快手刷新token失败,accountId:{},result:{}", accountId, resultJson);
-                return;
-            }
-            oauthToken.setAccessToken(dataJson.getString("access_token"));
-            long accessTokenExpireIn = dataJson.getLong("access_token_expires_in") * 1000L;
-            long now = System.currentTimeMillis();
-            Date accessTokenExpireInDate = new Date(now + accessTokenExpireIn);
-            oauthToken.setAccessTokenExpiresIn(accessTokenExpireInDate);
-            oauthToken.setRefreshToken(dataJson.getString("refresh_token"));
-            long refreshTokenExpireIn = dataJson.getLong("refresh_token_expires_in") * 1000L;
-            Date refreshTokenExpireInDate = new Date(now + refreshTokenExpireIn);
-            oauthToken.setRefreshTokenExpiresIn(refreshTokenExpireInDate);
-            oauthToken.setUpdateTime(new Date());
-            QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("account_id", accountId);
-            queryWrapper.eq("media_id", 2);
-            int i = ctopOauthTokenMapper.update(oauthToken, queryWrapper);
-            if (i > 0) {
-                log.info("快手刷新token成功,accountId:{}", accountId);
-            }
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            log.error("快手刷新token失败,accountId{}", accountId);
-        }
-    }
-
-    @Override
-    public List<CtopOauthToken> getTokenListByType(String platformType) {
-        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-        if (null != platformType && !"".equals(platformType.trim())) {
-            queryWrapper.eq("media_id", platformType);
-        }
-        queryWrapper.orderByDesc("account_id");
-        return this.list(queryWrapper);
-    }
-
-    /**
-     * 获取快手有效账户列表
-     *
-     * @return
-     */
-
-    @Override
-    public List<CtopOauthToken> selectKuaiShouToken() {
-        return ctopOauthTokenMapper.selectKuaiShouToken();
-    }
-
-    @Override
-    public List<CtopOauthToken> selectKuaiShouTokenBefore() {
-        return ctopOauthTokenMapper.selectKuaiShouTokenBefore();
-    }
-
-
-    /**
-     * 获取toutiao有效账户列表
-     *
-     * @return
-     */
-
-    @Override
-    public List<CtopOauthToken> selectToutiaoToken() {
-        return ctopOauthTokenMapper.selectToutiaoToken();
-    }
-
-
-    @Override
-    public CtopOauthToken getAccessTokenByAccountIdAndMediaId(Integer mediaId, Long accountId) {
-        return ctopOauthTokenMapper.getAccessTokenByAccountIdAndMediaId(mediaId, accountId);
-    }
-
-    @Override
-    public List<CtopOauthToken> getToutiaoTokenByCreateTime(String createTime) {
-        return ctopOauthTokenMapper.getToutiaoTokenByCreateTime(createTime);
-    }
-
-    @Override
-    public List<CtopOauthToken> getByProjectId(Long projectId) {
-        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("project_id", projectId).eq("account_status", 0);
-        return this.list(queryWrapper);
-    }
-
-    @Override
-    public CtopOauthToken selectOneByMediaId(String platformTypeKuaishou) {
-        QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
-        tokenQueryWrapper.eq("media_id", platformTypeKuaishou);
-        tokenQueryWrapper.orderByDesc("create_time");
-        tokenQueryWrapper.last("limit 1");
-        return this.getOne(tokenQueryWrapper);
-    }
-
-    @Override
-    public void getKuaiShouAgentRefreshToken(Long agentId, String accessToken, String refreshToken) {
-        log.info("快手刷新token入参,token:{},refreshToken:{}", accessToken, refreshToken);
-        String url = kuaishouApiUrl + "/rest/openapi/oauth2/authorize/refresh_token";
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Content-Type", " application/json");
-        Map<String, Object> param = new HashMap<>();
-
-        param.put("app_id", PropertiesUtils.getConfig("kuaishou_appid"));
-        param.put("secret", PropertiesUtils.getConfig("kuaishou_secret"));
-        param.put("refresh_token", refreshToken);
-        try {
-            String result = HttpUtils.httpPostRequest(url, param, headers);
-            JSONObject resultJson = JSONObject.parseObject(result);
-            log.info("快手刷新代理商token返回结果:{}", refreshToken);
-            if (Check.isNull(resultJson)) {
-                log.error("快手刷新代理商token返回结果为空,token:{}", accessToken);
-                return;
-            }
-            Integer code = resultJson.getInteger("code");
-            if (null == code || code != 0) {
-                log.error("快手刷新代理商token失败,token:{},result:{}", accessToken, resultJson);
-                return;
-            }
-            JSONObject dataJson = resultJson.getJSONObject("data");
-            if (null == dataJson) {
-                log.error("快手刷新代理商token失败,token:{},result:{}", accessToken, resultJson);
-                return;
-            }
-
-            QueryWrapper<OauthAgentToken> agentTokenQueryWrapper = new QueryWrapper<>();
-            agentTokenQueryWrapper.eq("agent_id", agentId);
-            OauthAgentToken updateAgentToken = new OauthAgentToken();
-            updateAgentToken.setAccessToken(dataJson.getString("access_token"));
-            updateAgentToken.setRefreshToken(dataJson.getString("refresh_token"));
-            long accessTokenExpireIn = dataJson.getLong("access_token_expires_in") * 1000L;
-            long now = System.currentTimeMillis();
-            Date accessTokenExpireInDate = new Date(now + accessTokenExpireIn);
-            updateAgentToken.setAccessTokenExpiresIn(accessTokenExpireInDate);
-            long refreshTokenExpireIn = dataJson.getLong("refresh_token_expires_in") * 1000L;
-            Date refreshTokenExpireInDate = new Date(now + refreshTokenExpireIn);
-            updateAgentToken.setRefreshTokenExpiresIn(refreshTokenExpireInDate);
-            updateAgentToken.setUpdateTime(new Date());
-            int update = agentTokenMapper.update(updateAgentToken, agentTokenQueryWrapper);
-            if (update > 0) {
-                log.info("刷新代理商token完成");
-            }
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            log.error("快手刷新代理商token失败,token{}", accessToken);
-        }
-
-
-    }
-
-    @Override
-    public List<CtopOauthToken> queryKsValidRuleAccountsToken() {
-        return ctopOauthTokenMapper.queryKsValidRuleAccountsToken();
-    }
-
-    @Override
-    public List<CtopOauthToken> queryTtValidRuleAccountsToken() {
-        return ctopOauthTokenMapper.queryTtValidRuleAccountsToken();
-    }
-
-    private Date addSecond(Date date, int seconds) {
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(date);
-        calendar.add(Calendar.SECOND, seconds);
-        return calendar.getTime();
-    }
-}

+ 0 - 74
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java

@@ -1,74 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.MailLog;
-import cn.com.ctop.common.module.mapper.MailLogMapper;
-import cn.com.ctop.common.module.service.IMailLogService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.CorpWexinUtils;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * 邮箱记录表
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-12-08
- */
-@Service
-public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> implements IMailLogService {
-    @Autowired
-    private MailLogMapper mailLogMapper;
-    @Autowired
-    private CorpWexinUtils corpWexinUtils;
-
-
-    @Override
-    public void sendWeChat(String responsibleId, Long accountId, String projectName, String transferor, String assignee) {
-        JSONObject weChatId = mailLogMapper.getWChatIdByUserId(responsibleId);
-        if (!Check.isNull(weChatId)) {
-            String transferorName = mailLogMapper.getUserNameByUserId(transferor); // 转让人姓名
-            String assigneeName = mailLogMapper.getUserNameByUserId(assignee); // 转让人姓名
-            StringBuilder text = new StringBuilder();
-            text.append("转户申请").append("<br/>").
-                    append("您的项目:").append(projectName + ",").append("<br/>")
-                    .append("账号:" + accountId).append(",申请由:" + transferorName + "转户于:" + assigneeName).append("<br/>")
-                    .append("等待您的审核,请您及时处理!");
-
-            corpWexinUtils.sendMessageByWeChatId(weChatId, text.toString());
-        }
-    }
-
-    /**
-     * 转户通过或失败发送通知
-     *
-     * @param projectName
-     * @param status
-     * @param userId
-     */
-    @Override
-    public void sendWeChatByStatus(String projectName, Integer status, String userId, Long accountId) {
-
-        JSONObject weChatId = mailLogMapper.getWChatIdByUserId(userId);
-        if (!Check.isNull(weChatId)) {
-            String statusName = "";
-
-            if (status == 1) {
-                statusName = "通过";
-            } else if (status == 2) {
-                statusName = "拒绝";
-            }
-
-            StringBuilder text = new StringBuilder();
-            text.append("转户申请审核通知").append("<br/>").
-                    append("您的项目:").append(projectName + ",").append("<br/>")
-                    .append("账号:" + accountId).append("<br/>")
-                    .append("申请的转户操作已:" + statusName).append("<br/>")
-                    .append("请您前往验证,谢谢!");
-
-            corpWexinUtils.sendMessageByWeChatId(weChatId, text.toString());
-        }
-    }
-}

+ 0 - 171
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -1,171 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.MaterialCutFrame;
-import cn.com.ctop.common.module.mapper.MaterialCutFrameMapper;
-import cn.com.ctop.common.module.service.IMaterialCutFrameService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
-import cn.com.ctop.common.module.utils.LoadFileUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * 截屏
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-12-25
- */
-@Slf4j
-@Service
-public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMapper, MaterialCutFrame> implements IMaterialCutFrameService {
-    @Value("${jeecg.path.image-upload}")
-    private String imageUpLoadPath;
-    @Autowired
-    private MaterialCutFrameMapper materialCutFrameMapper;
-
-    /**
-     * 获取素材关键帧
-     *
-     * @param url
-     */
-    @Override
-    public void getCutFrame(String url, String materialId, Long secondDuration, String height, String width) throws IOException {
-    }
-
-    @Override
-    public List<MaterialCutFrame> getListByVideoSignature(String videoSignature) {
-        return materialCutFrameMapper.getListByVideoSignature(videoSignature);
-    }
-
-    @Override
-    public void getTencentCutFrame(String videoUrl, String materialId, String coveUrl) {
-        try {
-
-            if (Check.isNull(materialId)) {
-                return;
-            }
-            String loadImage = "cutFrame/" + materialId + "/${Number}.jpg";
-            QueryWrapper<MaterialCutFrame> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("video_signature", materialId);
-            queryWrapper.last("limit 1");
-            MaterialCutFrame checkMaterialCutFrame = this.getOne(queryWrapper);
-            if (!Check.isNull(checkMaterialCutFrame)) {
-                log.info("已存推荐封面");
-                return;
-            }
-            // 添加首帧
-            String coverCutFramePath = LoadFileUtil.downLoadFromUrl(coveUrl, imageUpLoadPath);
-            String CutFrameMd5 = LoadFileUtil.getMD5(coverCutFramePath);
-            MaterialCutFrame coveCutFrame = new MaterialCutFrame();
-            coveCutFrame.setSignature(CutFrameMd5);
-            coveCutFrame.setUrl(coveUrl);
-            coveCutFrame.setVideoSignature(materialId);
-            coveCutFrame.setImageIndex(0);
-            this.save(coveCutFrame);
-            LoadFileUtil.delFile(coverCutFramePath);
-            // 请求从数据接口 获取其余14张截图
-            getCut(materialId, videoUrl, loadImage, 1);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    private void getCut(String materialId, String videoUrl, String loadImage, Integer count) {
-        try {
-            Map<String, Object> coverMap = CloudVideoProcessUtil.videoCutFrameHandle(videoUrl, loadImage);
-            for (int i = 0; i <= 13; i++) {
-                String url = (String) coverMap.get(String.valueOf(i));
-                if (!Check.isNull(url)) {
-                    String cutFramePath = LoadFileUtil.downLoadFromUrl(url, imageUpLoadPath);
-                    String cutFrameMd5 = LoadFileUtil.getMD5(cutFramePath);
-                    Map<String, Object> deleteMap = new HashMap<>();
-                    deleteMap.put("video_signature", materialId);
-                    deleteMap.put("signature", cutFrameMd5);
-                    this.removeByMap(deleteMap);
-                    MaterialCutFrame cutFrame = new MaterialCutFrame();
-                    cutFrame.setSignature(cutFrameMd5);
-                    cutFrame.setUrl(url);
-                    cutFrame.setVideoSignature(materialId);
-                    cutFrame.setImageIndex(i + 1);
-                    this.save(cutFrame);
-                    LoadFileUtil.delFile(cutFramePath);
-                }
-            }
-
-        } catch (Exception e) {
-            log.info("抽帧异常,code:{}", materialId);
-            e.printStackTrace();
-            if (count >= 4) {
-                return;
-            }
-            getCut(materialId, videoUrl, loadImage, count + 1);
-        }
-
-    }
-
-    @Override
-    public boolean updateTencentCutFrame(String videoMD5) {
-        boolean result = true;
-        Map<String, Object> coverMap = CloudVideoProcessUtil.supplementFrameUrl(videoMD5);
-        for (int i = 0; i <= 13; i++) {
-            String url = (String) coverMap.get(String.valueOf(i));
-            if (!Check.isNull(url)) {
-                String cutFramePath = LoadFileUtil.downLoadFromUrl(url, imageUpLoadPath);
-                String cutFrameMd5 = null;
-                try {
-                    cutFrameMd5 = LoadFileUtil.getMD5(cutFramePath);
-                } catch (IOException e) {
-                    log.error(e.getMessage());
-                }
-                QueryWrapper<MaterialCutFrame> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("video_signature", videoMD5);
-                queryWrapper.eq("image_index", i + 1);
-                MaterialCutFrame cutFrame = new MaterialCutFrame();
-                cutFrame.setSignature(cutFrameMd5);
-                cutFrame.setUrl(url);
-                result = this.update(cutFrame, queryWrapper);
-                LoadFileUtil.delFile(cutFramePath);
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public MaterialCutFrame getCutFrameByCode(String code) {
-        QueryWrapper<MaterialCutFrame> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("video_signature", code);
-        queryWrapper.last("limit 1");
-        return this.getOne(queryWrapper);
-    }
-
-    @Override
-    public List<JSONObject> getProgramCreativeCover(String signature) {
-        return materialCutFrameMapper.getProgramCreativeCover(signature);
-    }
-
-    @Override
-    public MaterialCutFrame selectByMd5(String md5) {
-        QueryWrapper<MaterialCutFrame> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("signature", md5);
-        queryWrapper.last("limit 1");
-        return this.getOne(queryWrapper);
-
-    }
-
-    @Override
-    public JSONObject getCutFrameByVideoMd5(String photoId, String imageToken) {
-        return materialCutFrameMapper.getCutFrameByVideoMd5(photoId, imageToken);
-    }
-}

+ 0 - 874
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -1,874 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.constant.CosConstant;
-import cn.com.ctop.common.module.entity.*;
-import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
-import cn.com.ctop.common.module.mapper.MaterialAscriptionMapper;
-import cn.com.ctop.common.module.mapper.MaterialInfoMapper;
-import cn.com.ctop.common.module.mapper.MaterialParameterMapper;
-import cn.com.ctop.common.module.mapper.MaterialTagMapper;
-import cn.com.ctop.common.module.service.*;
-import cn.com.ctop.common.module.utils.*;
-import cn.com.ctop.common.module.vo.ResFileDTO;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.tencentcloudapi.mps.v20190612.models.DescribeTaskDetailResponse;
-import it.sauronsoftware.jave.Encoder;
-import it.sauronsoftware.jave.EncoderException;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
-import org.jeecg.common.system.vo.LoginUser;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.io.*;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.net.URLDecoder;
-import java.nio.channels.FileChannel;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import static cn.com.ctop.common.module.utils.CloudVideoProcessUtil.getTaskDetailResponse;
-import static cn.com.ctop.common.module.utils.CloudVideoProcessUtil.videoWatermarkHandle;
-
-/**
- * 素材信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-10-11
- */
-@Slf4j
-@Service
-public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, MaterialInfo> implements IMaterialInfoService {
-
-    private static ExecutorService uploadExecutorService = Executors.newFixedThreadPool(5);
-
-    @Resource
-    private ITencentWatermarkTemplateService tencentWatermarkTemplateService;
-    @Resource
-    private IVideoWatermarkTaskService videoWatermarkTaskService;
-    @Resource
-    private MaterialInfoMapper materialInfoMapper;
-    @Resource
-    private MaterialParameterMapper materialParameterMapper;
-    @Resource
-    private MaterialAscriptionMapper materialAscriptionMapper;
-    @Resource
-    private MaterialTagMapper materialTagMapper;
-    @Resource
-    private IMaterialCutFrameService materialCutFrameService;
-    @Autowired
-    private ISupplierWatermarkService supplierWatermarkService;
-    @Resource
-    private IProductService productService;
-    @Value("${oss.replace.download}")
-    private String downloadUrl;
-
-    @Override
-    public void watermarkVideo(String materialId, Long videoWatermarkTemplateId, String userId) {
-        TencentWatermarkTemplate tentcentWatermarkTemplate = tencentWatermarkTemplateService.getById(videoWatermarkTemplateId);
-        MaterialInfo materialInfo = this.getById(materialId);
-        if (Check.isNull(materialInfo)) {
-            return;
-        }
-        if (Check.isNull(materialInfo.getUrl())) {
-            return;
-        }
-        String fileUrl = "";
-        InputStream imageStream = LoadFileUtil.getFileStream(materialInfo.getUrl());
-        if (!Check.isNull(imageStream)) {
-            long time = System.currentTimeMillis();
-            ResFileDTO file = CosUtils.uploadDetailInputStreamV2(imageStream, time + ".mp4", "mp4", 0L, "temp/");
-            fileUrl = file.getFileUrl();
-        }
-        if (Check.isNull(fileUrl)) {
-            return;
-        }
-        String path = URLDecoder.decode(fileUrl.substring(fileUrl.indexOf("/", 10) + 1, fileUrl.length()));
-        String taskId = videoWatermarkHandle(path, tentcentWatermarkTemplate.getTemplateId());
-        DescribeTaskDetailResponse taskDetailResponse = null;
-        for (int i = 0; i < 30; i++) {
-            try {
-                Thread.sleep(4000);
-            } catch (InterruptedException e) {
-                log.error(e.getMessage());
-            }
-            taskDetailResponse = getTaskDetailResponse(taskId);
-            if ("FINISH".equals(taskDetailResponse.getStatus())) {
-                break;
-            }
-        }
-        if ("FINISH".equals(taskDetailResponse.getStatus())) {
-            String videoUrl = taskDetailResponse.getWorkflowTask().getMediaProcessResultSet()[0].getTranscodeTask().getOutput().getPath();
-            VideoWatermarkTask videoWatermarkTask = new VideoWatermarkTask();
-            videoWatermarkTask.setVideoUrl(CosConstant.COS_MEDIA_URL_PREFIX + videoUrl);
-            videoWatermarkTask.setVideoId(materialId);
-            videoWatermarkTask.setJobId(taskId);
-            videoWatermarkTask.setUserId(userId);
-            videoWatermarkTask.setStatus(taskDetailResponse.getStatus());
-            videoWatermarkTaskService.save(videoWatermarkTask);
-            materialInfo.setWatermarkUrl(CosConstant.COS_MEDIA_URL_PREFIX + videoUrl);
-            materialInfo.setWatermarkCode(taskId);
-            this.updateById(materialInfo);
-        }
-
-    }
-
-
-    @Override
-    public String watermarkVideoBySupplierCode(String videoSignature, String videoUrl, Long templateId) {
-        try {
-            QueryWrapper<SupplierWatermark> supplierWatermarkQueryWrapper = new QueryWrapper<>();
-            supplierWatermarkQueryWrapper.eq("video_signature", videoSignature);
-            supplierWatermarkQueryWrapper.last("limit 1");
-            SupplierWatermark one = supplierWatermarkService.getOne(supplierWatermarkQueryWrapper);
-            if (!Check.isNull(one)) {
-                log.info("供应商水印已存在,videoCode:{}", videoSignature);
-                return one.getWatermarkUrl();
-            }
-            String path = URLDecoder.decode(videoUrl).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
-            String taskId = videoWatermarkHandle(path, templateId);
-            DescribeTaskDetailResponse taskDetailResponse = null;
-            for (int i = 0; i < 30; i++) {
-                try {
-                    Thread.sleep(2000);
-                } catch (InterruptedException e) {
-                    log.error(e.getMessage());
-                }
-                taskDetailResponse = getTaskDetailResponse(taskId);
-                if ("FINISH".equals(taskDetailResponse.getStatus())) {
-                    break;
-                }
-            }
-            if ("FINISH".equals(taskDetailResponse.getStatus())) {
-                String url = taskDetailResponse.getWorkflowTask().getMediaProcessResultSet()[0].getTranscodeTask().getOutput().getPath();
-                SupplierWatermark supplierWatermark = new SupplierWatermark();
-                supplierWatermark.setVideoSignature(videoSignature);
-                String watermarkUrl = "https://media-1301855440.cos.ap-chongqing.myqcloud.com" + url;
-                supplierWatermark.setWatermarkUrl(watermarkUrl);
-                boolean save = supplierWatermarkService.save(supplierWatermark);
-                if (save) {
-                    log.info("供应商水印生成完毕,videoCode:{}", videoSignature);
-
-                }
-                return watermarkUrl;
-            }
-        } catch (Exception e) {
-            log.info("供应商水印生成异常,videoCode:{}", videoSignature);
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-
-    @Override
-    public MaterialInfo getMaterialInfoByCodeAndProductId(String code, Long projectId) {
-        QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("code", code);
-        queryWrapper.eq("project_id", projectId);
-        queryWrapper.orderByDesc("id").last("limit 1");
-        return this.getOne(queryWrapper);
-    }
-
-
-    @Override
-    public MaterialInfo getMaterialInfoByCode(String code) {
-        QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("code", code);
-        queryWrapper.orderByDesc("id").last("limit 1");
-        return this.getOne(queryWrapper);
-    }
-
-    @Override
-    public Map<String, Object> checkMaterialInfo(String code, Long projectId) {
-        Map<String, Object> result = new HashMap<>();
-        MaterialInfo info = this.getMaterialInfoByCodeAndProductId(code, projectId);
-        if (null != info) {
-            //文件已存在
-            ResultMapUtils.setResultMap(result, StatusCode.FILE_HAS_UPLOAD.getCode());
-            result.put("url", info.getUrl());
-            return result;
-        } else {
-            //文件尚未上传
-            ResultMapUtils.setResultMap(result, StatusCode.FILE_HAS_NOT_UPLOAD.getCode());
-            return result;
-        }
-    }
-
-    @Override
-    public Map<String, Object> insert(JSONObject jsonObject) {
-        Map<String, Object> resultMap = new HashMap<>();
-        try {
-            String type = jsonObject.getString("type");
-            if ("IMAGE".equals(type)) {
-                JSONArray imageArr = jsonObject.getJSONArray("imageArr");
-                if (!Check.isNull(imageArr)) {
-                    jsonObject.remove("imageArr");
-                    for (int i = 0; i < imageArr.size(); i++) {
-                        String url = imageArr.getString(i);
-                        if (!Check.isNull(url)) {
-                            jsonObject.remove("code");
-                            jsonObject.remove("materialName");
-                            url = "https:" + url;
-                            String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
-                            String md5 = LoadFileUtil.getMD5(localPath);
-                            jsonObject.put("code", md5);
-                            LoadFileUtil.delFile(localPath);
-                            String fileName = url.substring(url.lastIndexOf("/") + 1);
-                            String fileNameStr = null;
-                            if (!Check.isNull(fileName)) {
-                                String[] split = fileName.split("-");
-                                fileNameStr = split[0];
-                            }
-                            jsonObject.put("materialName", AesEncryptUtil.getUrlDecoderString(fileNameStr));
-                            insertMaterialInfo(url, type, jsonObject);
-                        }
-
-                    }
-                }
-
-            } else {
-                String url = "";
-                if (!Check.isNull(jsonObject.getString("url"))) {
-                    url = "https:" + jsonObject.getString("url");
-                }
-                insertMaterialInfo(url, type, jsonObject);
-            }
-
-            ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
-        } catch (Exception e) {
-            ResultMapUtils.setResultMap(resultMap, StatusCode.MATERIAL_UPLOAD_FAIL.getCode());
-            e.printStackTrace();
-
-        }
-
-
-        return resultMap;
-    }
-
-    private void insertMaterialInfo(String url, String type, JSONObject jsonObject) {
-        MaterialInfo info = new MaterialInfo();
-//        Long projectId = jsonObject.getLong("projectId");
-        Long productId = jsonObject.getLong("productId");
-        String code = jsonObject.getString("code");
-        info.setId(code + productId);
-        info.setCode(code);
-        if (!Check.isNull(jsonObject.getString("watermarkUrl"))) {
-            info.setWatermarkUrl(jsonObject.getString("watermarkUrl"));
-        }
-        info.setUrl(url);
-        info.setUserId(jsonObject.getString("userId"));
-//        info.setProjectId(projectId);
-        info.setProductId(productId);
-        info.setWatermarkCode(jsonObject.getString("watermarkCode"));
-        info.setStatus(0);
-        info.setMaterialName(jsonObject.getString("materialName"));
-        info.setWatermarkMaterialName(jsonObject.getString("watermarkMaterialName"));
-        info.setMaterialDescribe(jsonObject.getString("materialDescribe"));
-        info.setCreateTime(new Date());
-        info.setUpdateTime(new Date());
-        info.setType(type);
-        this.save(info);
-        Map<String, Object> deleteMap = new HashMap<>();
-        deleteMap.put("material_id", info.getCode());
-        JSONObject ascription = jsonObject.getJSONObject("ascription");
-        if (!Check.isNull(ascription)) {
-            MaterialAscription materialAscription = new MaterialAscription();
-            materialAscription.setMaterialId(info.getId());
-            // 剪辑人
-            materialAscription.setClipId(ascription.getString("clipId"));
-            // 拍摄人id
-            materialAscription.setShotId(ascription.getString("shotId"));
-            // 策划id
-            materialAscription.setPlanId(ascription.getString("planId"));
-            //平面id
-            materialAscription.setPlaneId(ascription.getString("planeId"));
-            materialAscriptionMapper.deleteByMap(deleteMap);
-            int i = materialAscriptionMapper.insert(materialAscription);
-            if (i > 0) {
-                log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
-            }
-
-        }
-
-        JSONArray tag = jsonObject.getJSONArray("tag");
-        if (!Check.isNull(tag)) {
-            materialTagMapper.deleteByMap(deleteMap);
-            for (int i = 0; i < tag.size(); i++) {
-                String tagStr = tag.getString(i);
-                if (!Check.isNull(tagStr)) {
-                    MaterialTag materialTag = new MaterialTag();
-                    materialTag.setMaterialId(info.getId());
-                    materialTag.setTag(tagStr);
-                    materialTagMapper.insert(materialTag);
-                }
-            }
-        }
-
-        getFile(info);
-
-    }
-
-
-    /**
-     * 获取素材详细信息
-     *
-     * @param materialId
-     * @return
-     */
-    @Override
-    public JSONObject getDetail(String materialId) {
-        JSONObject json = new JSONObject();
-        MaterialInfo materialInfo = this.getById(materialId);
-        if (!Check.isNull(materialInfo.getAuditorId())) {
-            String auditorName = materialInfoMapper.selectUserNameById(materialInfo.getAuditorId());
-            json.put("auditorName", auditorName);
-        } else {
-            json.put("auditorName", "");
-        }
-
-        List<String> tagList = materialTagMapper.selectByMaterialId(materialInfo.getCode());
-        if (!Check.isNull(tagList)) {
-            json.put("tag", tagList);
-        }
-        QueryWrapper<MaterialParameter> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("material_id", materialInfo.getCode());
-        queryWrapper.orderByDesc("create_time");
-        queryWrapper.last("limit 1");
-        MaterialParameter materialParameter = materialParameterMapper.selectOne(queryWrapper);
-
-        if (!Check.isNull(materialParameter)) {
-            json.put("parameter", materialParameter);
-        }
-
-        JSONObject ascriptionJson = materialAscriptionMapper.selectByMaterialId(materialInfo.getCode());
-        if (!Check.isNull(ascriptionJson)) {
-            json.put("ascription", ascriptionJson);
-        }
-        return json;
-    }
-
-    /**
-     * 工作台报表
-     *
-     * @param userId
-     * @return
-     */
-    @Override
-    public JSONObject report(String userId) {
-
-        JSONObject json = new JSONObject();
-        try {
-            Map<String, Object> requestMap = new HashMap<>();
-            requestMap.put("userId", userId);
-            Integer totalCount = materialInfoMapper.selectCountByMap(requestMap);
-            json.put("total", totalCount);
-            requestMap.put("status", 0);
-            Integer waitAudit = materialInfoMapper.selectCountByMap(requestMap);
-            json.put("waitAudit", waitAudit);
-            requestMap.put("status", 1);
-            Integer passAudit = materialInfoMapper.selectCountByMap(requestMap);
-            json.put("passAudit", passAudit);
-            requestMap.put("status", 2);
-            Integer refuseAudit = materialInfoMapper.selectCountByMap(requestMap);
-            json.put("refuseAudit", refuseAudit);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return json;
-    }
-
-    @Override
-    public void getFile(MaterialInfo materialInfo) {
-        uploadExecutorService.submit(new Runnable() {
-            @Override
-            public void run() {
-                log.info("获取素材基本信息,code:{}", materialInfo.getCode());
-                if (!Check.isNull(materialInfo)) {
-                    long l = System.currentTimeMillis();
-                    String url = materialInfo.getUrl();
-                    log.info("replaceUrl:{}", url);
-                    String localUrl = null;
-                    it.sauronsoftware.jave.MultimediaInfo m = null;
-                    FileInputStream fis = null;
-                    try {
-                        localUrl = LoadFileUtil.downLoadFromUrl(url, downloadUrl);
-                        File file = new File(localUrl);
-                        Encoder encoder = new Encoder();
-                        m = encoder.getInfo(file);
-                        long duration = m.getDuration();
-                        long secondDuration = duration / 1000;
-                        MaterialParameter materialParameter = new MaterialParameter();
-                        materialParameter.setMaterialId(materialInfo.getCode());
-                        // 视频秒数
-                        materialParameter.setSecond(secondDuration);
-                        // 视频格式
-                        materialParameter.setFormat(m.getFormat());
-                        // 视频宽
-                        String width = String.valueOf(m.getVideo().getSize().getWidth());
-                        materialParameter.setWidth(width);
-                        // 视频高
-                        String height = String.valueOf(m.getVideo().getSize().getHeight());
-                        materialParameter.setHeight(height);
-
-                        fis = new FileInputStream(file);
-                        FileChannel fc = fis.getChannel();
-                        BigDecimal fileSize = new BigDecimal(fc.size());
-                        String size = fileSize.divide(new BigDecimal(1048576), 2, RoundingMode.HALF_UP) + "MB";
-                        materialParameter.setSize(size);
-                        materialParameter.setUpdateTime(new Date());
-
-                        Map<String, Object> deleteMap = new HashMap<>();
-                        deleteMap.put("material_id", materialInfo.getId());
-                        materialParameterMapper.deleteByMap(deleteMap);
-                        int insert = materialParameterMapper.insert(materialParameter);
-                        if (insert > 0) {
-                            log.info("素材基本信息入库完成,用时:{} s", (System.currentTimeMillis() - l) / 1000);
-                        }
-                        // 默认抽帧 素造供应商
-                        Long templateId = MaterialSupplierEnum.getTemplateIdBySize(Integer.valueOf(width), Integer.valueOf(height));
-                        if (!Check.isNull(templateId)) {
-                            Thread thread = new Thread() {
-                                @Override
-                                public void run() {
-                                    watermarkVideoBySupplierCode(materialInfo.getCode(), materialInfo.getUrl(), templateId);
-                                }
-                            };
-                            thread.start();
-                        }
-                    } catch (FileNotFoundException e) {
-                        e.printStackTrace();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    } catch (EncoderException e) {
-                        e.printStackTrace();
-
-                    } finally {
-                        try {
-                            if (fis != null) {
-                                fis.close();
-                            }
-                        } catch (IOException e) {
-                            e.printStackTrace();
-                        }
-                    }
-                }
-            }
-
-
-        });
-    }
-
-    @Override
-    public void setExcellent(String code, Integer excellent) {
-        MaterialInfo info = this.getMaterialInfoByCode(code);
-        info.setExcellent(excellent);
-        this.updateById(info);
-    }
-
-    @Override
-    public Integer getKuaishouUpVideoCount(String code) {
-        return materialInfoMapper.getKuaishouUpVideoCount(code);
-    }
-
-    @Override
-    public Integer getToutiaoUpVideoCount(String code) {
-        return materialInfoMapper.getToutiaoUpVideoCount(code);
-    }
-
-
-    @Autowired
-    private IMaterialImageInfoService materialImageInfoService;
-    @Autowired
-    private IProjectService projectService;
-
-    /**
-     * 素材库关联上传素材 1
-     *
-     * @param json
-     * @return
-     */
-    @Override
-    public Map<String, Object> correlationUpload(JSONObject json) {
-        String userId = json.getString("userId");
-        Map<String, Object> resultMap = new HashMap<>();
-        try {
-            String type = json.getString("type");
-            String url = "";
-            if (!Check.isNull(json.getString("url"))) {
-                url = "https:" + json.getString("url");
-            }
-            MaterialInfo info = new MaterialInfo();
-            Long projectId = json.getLong("projectId");
-            Project project = projectService.getById(projectId);
-            Long productId = project.getProductId();
-            String code = json.getString("code");
-            info.setId(UUID.randomUUID().toString().replace("-", ""));
-            info.setCode(code);
-            if (!Check.isNull(json.getString("watermarkUrl"))) {
-                info.setWatermarkUrl(json.getString("watermarkUrl"));
-            }
-            info.setUrl(url);
-            info.setUserId(userId);
-            info.setProjectId(projectId);
-            info.setProductId(productId);
-            info.setWatermarkCode(json.getString("watermarkCode"));
-            info.setStatus(0);
-            info.setMaterialName(StringUtils.getFileNameNoEx(json.getString("materialName")));
-            info.setWatermarkMaterialName(json.getString("watermarkMaterialName"));
-            info.setMaterialDescribe(json.getString("materialDescribe"));
-            info.setCreateTime(new Date());
-            info.setUpdateTime(new Date());
-            info.setType(type);
-            //TODO 此处逻辑待调整
-            //      Project project = projectService.getById(projectId);
-            if (!Check.isNull(project)) {
-                if (!Check.isNull(project.getSupplierCode())) {
-                    info.setSupplierCode(project.getSupplierCode());
-                }
-            }
-            MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(code);
-            if (Check.isNull(cutFrame)) {
-                String videoUrl = URLDecoder.decode(info.getUrl()).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
-                String loadImage = "cutFrame/" + code + "/zero.jpg";
-                String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
-                info.setCoverUrl(coverUrl);
-                Thread thread = new Thread() {
-                    @Override
-                    public void run() {
-                        try {
-                            log.info("开始抽帧,code:{}", code);
-                            materialCutFrameService.getTencentCutFrame(videoUrl, code, coverUrl);
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                    }
-                };
-                thread.start();
-            } else {
-                info.setCoverUrl(cutFrame.getUrl());
-            }
-            this.save(info);
-            JSONArray imageArr = json.getJSONArray("imageArr");
-            if (!Check.isNull(imageArr)) {
-                JSONObject imageJson = new JSONObject();
-                imageJson.put("videoId", info.getCode());
-                imageJson.put("userId", userId);
-                imageJson.put("imageArr", imageArr);
-                materialImageInfoService.insertImage(imageJson);
-            }
-            Map<String, Object> deleteMap = new HashMap<>();
-            deleteMap.put("material_id", info.getCode());
-            JSONObject ascription = json.getJSONObject("ascription");
-            if (!Check.isNull(ascription)) {
-                MaterialAscription materialAscription = new MaterialAscription();
-                materialAscription.setMaterialId(info.getCode());
-                String clipId = ascription.getString("clipId");
-                if (null != clipId && !"".equals(clipId.trim())) {
-                    materialAscription.setClipId(clipId);
-                }
-                materialAscription.setShotId(ascription.getString("shotId"));
-                materialAscription.setPlanId(ascription.getString("planId"));
-                materialAscription.setPlaneId(ascription.getString("planeId"));
-                materialAscription.setCode(info.getCode());
-                materialAscriptionMapper.deleteByMap(deleteMap);
-                int result = materialAscriptionMapper.insert(materialAscription);
-                if (result > 0) {
-                    log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
-                }
-            }
-            materialTagInfoService.deleteByCode(code);
-            JSONArray modalityTagList = json.getJSONArray("modalityTagList");
-            insertTagList(code, userId, modalityTagList);
-            JSONArray contentTagList = json.getJSONArray("contentTagList");
-            insertTagList(code, userId, contentTagList);
-            JSONArray senceTagList = json.getJSONArray("senceTagList");
-            insertTagList(code, userId, senceTagList);
-            JSONArray modTagList = json.getJSONArray("modTagList");
-            insertTagList(code, userId, modTagList);
-            getFile(info);
-            ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
-        } catch (Exception e) {
-            ResultMapUtils.setResultMap(resultMap, StatusCode.MATERIAL_UPLOAD_FAIL.getCode());
-            e.printStackTrace();
-        }
-        return resultMap;
-    }
-
-    @Override
-    public String platformUploadVideo(JSONObject json) {
-        String userId = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
-        MaterialInfo info = new MaterialInfo();
-        String type = json.getString("type");
-        info.setType(type);
-        String url = "";
-        if (!Check.isNull(json.getString("url"))) {
-            url = "https:" + json.getString("url");
-
-        }
-//        Long projectId = json.getLong("projectId");
-        Long productId = json.getLong("productId");
-        String code = json.getString("code");
-        info.setCode(code);
-        String id = code + "_" + productId;
-        info.setId(id);
-        if (!Check.isNull(json.getString("watermarkUrl"))) {
-            info.setWatermarkUrl(json.getString("watermarkUrl"));
-        }
-        info.setUrl(url);
-        info.setUserId(userId);
-        info.setProductId(productId);
-        info.setWatermarkCode(json.getString("watermarkCode"));
-        info.setStatus(0);
-        info.setMaterialName(json.getString("materialName"));
-        info.setWatermarkMaterialName(json.getString("watermarkMaterialName"));
-        info.setMaterialDescribe(json.getString("materialDescribe"));
-        //TODO 此处逻辑待调整
-//        Project project = projectService.getById(projectId);
-//        if (!Check.isNull(project)) {
-//            if (!Check.isNull(project.getSupplierCode())) {
-//                info.setSupplierCode(project.getSupplierCode());
-//            }
-//        }
-        MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(code);
-        if (Check.isNull(cutFrame)) {
-            String videoUrl = URLDecoder.decode(info.getUrl()).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
-            String loadImage = "cutFrame/" + code + "/zero.jpg";
-            String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
-            info.setCoverUrl(coverUrl);
-            Thread thread = new Thread() {
-                @Override
-                public void run() {
-                    try {
-                        log.info("开始抽帧,code:{}", code);
-                        materialCutFrameService.getTencentCutFrame(videoUrl, code, coverUrl);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-            };
-            thread.start();
-        } else {
-            info.setCoverUrl(cutFrame.getUrl());
-        }
-        this.save(info);
-        JSONArray imageArr = json.getJSONArray("imageArr");
-        if (!Check.isNull(imageArr)) {
-            JSONObject imageJson = new JSONObject();
-            imageJson.put("videoId", info.getCode());
-            imageJson.put("userId", userId);
-            imageJson.put("imageArr", imageArr);
-            materialImageInfoService.insertImage(imageJson);
-        }
-        Map<String, Object> deleteMap = new HashMap<>();
-        deleteMap.put("material_id", info.getCode());
-        JSONObject ascription = json.getJSONObject("ascription");
-        if (!Check.isNull(ascription)) {
-            MaterialAscription materialAscription = new MaterialAscription();
-            materialAscription.setMaterialId(info.getCode());
-            materialAscription.setClipId(ascription.getString("clipId"));
-            materialAscription.setShotId(ascription.getString("shotId"));
-            materialAscription.setPlanId(ascription.getString("planId"));
-            materialAscription.setPlaneId(ascription.getString("planeId"));
-            materialAscriptionMapper.deleteByMap(deleteMap);
-            int result = materialAscriptionMapper.insert(materialAscription);
-            if (result > 0) {
-                log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
-            }
-        }
-        materialTagInfoService.deleteByCode(code);
-        JSONArray modalityTagList = json.getJSONArray("modalityTagList");
-        insertTagList(code, userId, modalityTagList);
-        JSONArray contentTagList = json.getJSONArray("contentTagList");
-        insertTagList(code, userId, contentTagList);
-        JSONArray senceTagList = json.getJSONArray("senceTagList");
-        insertTagList(code, userId, senceTagList);
-        JSONArray modTagList = json.getJSONArray("modTagList");
-        insertTagList(code, userId, modTagList);
-        getFile(info);
-
-        return id;
-    }
-
-
-    private void insertTagList(String code, String userId, JSONArray tagList) {
-        if (null != tagList && !tagList.isEmpty()) {
-            for (int m = 0; m < tagList.size(); m++) {
-                Long tagId = tagList.getLong(m);
-                TagInfo tagInfo = tagInfoService.getById(tagId);
-                MaterialTagInfo setTag = new MaterialTagInfo(code, tagInfo, userId);
-                setTag.setCategoryId(tagInfo.getTagCategoryId());
-                materialTagInfoService.save(setTag);
-            }
-        }
-    }
-
-    @Autowired
-    private ITagInfoService tagInfoService;
-    @Autowired
-    private IMaterialTagInfoService materialTagInfoService;
-
-    @Override
-    public Map<String, Object> insertImage(JSONObject imageJson) {
-        Map<String, Object> resultMap = new HashMap<>();
-        ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
-        try {
-            materialImageInfoService.insertImage(imageJson);
-        } catch (Exception e) {
-            ResultMapUtils.setResultMap(resultMap, StatusCode.MATERIAL_UPLOAD_FAIL.getCode());
-            e.printStackTrace();
-        }
-
-        return resultMap;
-    }
-
-    @Override
-    public List<String> getEffiCode() {
-        return materialInfoMapper.getEffiSignature();
-    }
-
-
-    @Override
-    public List<MaterialInfo> effiMaterialInfo() {
-        List<MaterialInfo> materialInfoList = new ArrayList<>();
-        List<String> effiSignatureList = materialInfoMapper.getEffiSignature();
-        for (String code : effiSignatureList) {
-            MaterialInfo materialInfo = materialInfoMapper.getMaterialInfoByCode(code);
-            if (materialInfo == null) {
-                continue;
-            }
-            //判断是否已经同步到快手平台
-            Integer kuaishouMaterialUpCount = materialInfoMapper.getKuaishouUpVideoCount(code);
-            if (kuaishouMaterialUpCount > 0) {
-                materialInfo.setKuaishouVideoIsUp(1);
-            } else {
-                materialInfo.setKuaishouVideoIsUp(0);
-            }
-            //判断是否已经同步到抖音平台
-            Integer toutiaoMaterialUpCount = materialInfoMapper.getToutiaoUpVideoCount(code);
-            if (toutiaoMaterialUpCount > 0) {
-                materialInfo.setToutiaoVideoIsUp(1);
-            } else {
-                materialInfo.setToutiaoVideoIsUp(0);
-            }
-            materialInfoList.add(materialInfo);
-        }
-
-        return materialInfoList;
-    }
-
-    @Override
-    public List<MaterialInfo> getListByDate(String startDate, String endDate) {
-        return materialInfoMapper.getListByDate(startDate, endDate);
-    }
-
-
-    @Override
-    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize) {
-        Map<String, Object> result = new HashMap<>();
-        PageHelper.startPage(pageNo, pageSize);
-
-        String ascription = null;
-        if (!Check.isNull(clipId) || !Check.isNull(shotId) || !Check.isNull(planId)) {
-            ascription = "true";
-        }
-
-        if (!Check.isNull(startDate)) {
-            startDate = startDate + " 00:00:01";
-        }
-
-        if (!Check.isNull(endDate)) {
-            endDate = endDate + " 23:59:59";
-        }
-
-        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, userId, projectIds, ascription, clipId, shotId, planId, offlineFlag);
-        List<MaterialInfo> setList = new ArrayList<>();
-        PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
-        if (null != dailyList && !dailyList.isEmpty()) {
-            for (MaterialInfo info : dailyList) {
-                MaterialInfo materialInfo = materialInfoMapper.selectById(info.getId());
-                materialInfo.setSlogansCount(info.getSlogansCount());
-                materialInfo.setOfflineFlag(info.getOfflineFlag());
-                materialInfo.setConfirmTime(info.getConfirmTime());
-                //素材名称为空 则使用素材id 同步失败
-                materialInfo.setMaterialName(Check.isNull(materialInfo.getMaterialName()) ? materialInfo.getId() : materialInfo.getMaterialName());
-                //判断是否已经同步到快手平台
-                Integer kuaishouMaterialUpCount = this.getKuaishouUpVideoCount(info.getCode());
-                if (kuaishouMaterialUpCount > 0) {
-                    materialInfo.setKuaishouVideoIsUp(1);
-                } else {
-                    materialInfo.setKuaishouVideoIsUp(0);
-                }
-                //判断是否已经同步到抖音平台
-                Integer toutiaoMaterialUpCount = this.getToutiaoUpVideoCount(info.getCode());
-                if (toutiaoMaterialUpCount > 0) {
-                    materialInfo.setToutiaoVideoIsUp(1);
-                } else {
-                    materialInfo.setToutiaoVideoIsUp(0);
-                }
-                //统计快手总消耗数据
-                JSONObject kuaishous = materialParameterMapper.getMaterialTotalCharge(info.getCode());
-                if (!Check.isNull(kuaishous)) {
-                    materialInfo.setCost(kuaishous.getBigDecimal("charges"));
-                } else {
-                    materialInfo.setCost(new BigDecimal(0));
-                }
-                //统计抖音总消耗数据
-                JSONObject bytedances = materialParameterMapper.getByteDanceMaterialTotalCharge(info.getCode());
-                if (!Check.isNull(bytedances)) {
-                    materialInfo.setBytedanceCost(bytedances.getBigDecimal("charges"));
-                } else {
-                    materialInfo.setBytedanceCost(new BigDecimal(0));
-                }
-                Project project = projectService.getById(info.getProjectId());
-                if (!Check.isNull(project)) {
-                    materialInfo.setMediaId(project.getMediaId());
-                    materialInfo.setProjectName(project.getProjectName());
-                }
-                QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
-                imageInfoQueryWrapper.eq("video_id", info.getCode());
-                imageInfoQueryWrapper.eq("status", 0);
-                List<MaterialImageInfo> imageInfoList = materialImageInfoService.list(imageInfoQueryWrapper);
-                if (Check.isNull(imageInfoList)) {
-                    materialInfo.setWhetherUnaudited(false);
-                } else {
-                    materialInfo.setWhetherUnaudited(true);
-                }
-                //统计广告语数量
-//                List<BytedanceVideoSlogenInfo> slogenInfos = slogenInfoService.listByParams(materialInfo.getCode(), 1);
-//                JSONArray slogenArray = new JSONArray();
-//                if (null != slogenInfos && !slogenInfos.isEmpty()) {
-//                    slogenArray.addAll(slogenInfos);
-//                }
-//                materialInfo.setSlogans(slogenArray);
-                setList.add(materialInfo);
-            }
-        }
-        pageInfo.setList(setList);
-        result.put("data", pageInfo);
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-
-
-    @Override
-    public JSONArray getIdListByProject(Long projectId) {
-        return materialInfoMapper.getIdListByProject(projectId);
-    }
-
-
-}
-
-
-
-
-

+ 0 - 87
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/RefreshTokenServiceImpl.java

@@ -1,87 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.OauthAgentToken;
-import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IOauthAgentTokenService;
-import cn.com.ctop.common.module.service.IOauthConfigService;
-import cn.com.ctop.common.module.service.IRefreshTokenService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Map;
-
-@Slf4j
-@Service
-public class RefreshTokenServiceImpl implements IRefreshTokenService {
-    @Autowired
-    private CtopOauthTokenMapper oauthTokenMapper;
-    @Autowired
-    private ICtopOauthTokenService oauthTokenService;
-    @Autowired
-    private IOauthAgentTokenService agentTokenService;
-    @Autowired
-    private IOauthConfigService configService;
-
-    /**
-     * 获取所有token
-     *
-     * @return
-     */
-    @Override
-    public void getKuaiShouRefresh() {
-
-
-        List<CtopOauthToken> oauthTokens = oauthTokenMapper.selectKuaiShouTokens(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
-        if (!Check.isNull(oauthTokens)) {
-            Map<Long, String> configMap = configService.getConfigMapByMediaId(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
-            for (CtopOauthToken oauthToken : oauthTokens) {
-                log.info("刷新token,accountId:{}", oauthToken.getAccountId());
-                //快手
-                if (CtopAdConstant.PLATFORM_TYPE_KUAISHOU.equals(oauthToken.getMediaId().trim())) {
-                    String secret = configMap.get(oauthToken.getAppId());
-                    oauthTokenService.getKuaiShouRefreshToken(oauthToken.getAccountId(), oauthToken.getAccessToken(), oauthToken.getRefreshToken(), oauthToken.getAppId(), secret);
-                }
-            }
-        } else {
-            log.info("----------------------刷新token获取数据返回结果为空----------------------------------");
-        }
-    }
-
-    @Override
-    public void byteDanceRefresh(String accountId) {
-        if (null == accountId || "".equals(accountId.trim()) || "null".equalsIgnoreCase(accountId)) {
-            List<CtopOauthToken> byteDanceOauthTokens = oauthTokenMapper.selectToutiaoToken();
-            if (!Check.isNull(byteDanceOauthTokens)) {
-                for (CtopOauthToken oauthToken : byteDanceOauthTokens) {
-                    oauthTokenService.getByteDanceAccessToken(oauthToken);
-                }
-            }
-        } else {
-            CtopOauthToken token = oauthTokenMapper.selectByAccountId(Long.parseLong(accountId));
-            if (token == null) {
-                log.info("未获取到账户数据,accountId:{}", accountId);
-                return;
-            }
-            oauthTokenService.getByteDanceAccessToken(token);
-        }
-    }
-
-    @Override
-    public void getKuaiShouAgentRefresh() {
-        QueryWrapper<OauthAgentToken> agentTokenQueryWrapper = new QueryWrapper<>();
-        agentTokenQueryWrapper.eq("media_id", 2);
-        List<OauthAgentToken> list = agentTokenService.list(agentTokenQueryWrapper);
-        if (!Check.isNull(list)) {
-            for (OauthAgentToken agentToken : list) {
-                oauthTokenService.getKuaiShouAgentRefreshToken(agentToken.getAgentId(), agentToken.getAccessToken(), agentToken.getRefreshToken());
-            }
-        }
-    }
-}

+ 0 - 56
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/RuleDataAccountKuaishouServiceImpl.java

@@ -1,56 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.RuleDataAccountKuaishou;
-import cn.com.ctop.common.module.entity.RuleDataTargetKuaishou;
-import cn.com.ctop.common.module.entity.RuleDatePlanKuaishou;
-import cn.com.ctop.common.module.entity.RuleDateUnitKuaishou;
-import cn.com.ctop.common.module.mapper.RuleDataAccountKuaishouMapper;
-import cn.com.ctop.common.module.mapper.RuleDataTargetKuaishouMapper;
-import cn.com.ctop.common.module.mapper.RuleDatePlanKuaishouMapper;
-import cn.com.ctop.common.module.mapper.RuleDateUnitKuaishouMapper;
-import cn.com.ctop.common.module.service.IRuleDataAccountKuaishouService;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 快手预警数据账户维度
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-12-03
- */
-@Service
-public class RuleDataAccountKuaishouServiceImpl extends ServiceImpl<RuleDataAccountKuaishouMapper, RuleDataAccountKuaishou> implements IRuleDataAccountKuaishouService {
-
-    @Autowired
-    private RuleDataAccountKuaishouMapper ruleDataAccountKuaishouMapper;
-    @Autowired
-    private RuleDataTargetKuaishouMapper ruleDataTargetKuaishouMapper;
-    @Autowired
-    private RuleDateUnitKuaishouMapper ruleDateUnitKuaishouMapper;
-    @Autowired
-    private RuleDatePlanKuaishouMapper ruleDatePlanKuaishouMapper;
-
-    @Override
-    public JSONObject getKuaiShouRuleDataByAccountId(Long accountId) {
-        JSONObject obj = new JSONObject();
-        Map<String, Object> map = new HashMap<>();
-        map.put("account_id", accountId);
-        map.put("status", 1);
-        List<RuleDataAccountKuaishou> accountList = ruleDataAccountKuaishouMapper.selectByMap(map);
-        obj.put("account", accountList);
-        List<RuleDateUnitKuaishou> unitKuaishous = ruleDateUnitKuaishouMapper.selectByMap(map);
-        obj.put("unit", unitKuaishous);
-        List<RuleDataTargetKuaishou> targetKuaishous = ruleDataTargetKuaishouMapper.selectByMap(map);
-        obj.put("target", targetKuaishous);
-        List<RuleDatePlanKuaishou> planKuaishous = ruleDatePlanKuaishouMapper.selectByMap(map);
-        obj.put("plan", planKuaishous);
-        return obj;
-    }
-}

+ 0 - 59
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/RuleDataAccountServiceImpl.java

@@ -1,59 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.RuleDataAccount;
-import cn.com.ctop.common.module.entity.RuleDataCreative;
-import cn.com.ctop.common.module.entity.RuleDataPlan;
-import cn.com.ctop.common.module.entity.RuleDataTarget;
-import cn.com.ctop.common.module.mapper.RuleDataAccountMapper;
-import cn.com.ctop.common.module.mapper.RuleDataCreativeMapper;
-import cn.com.ctop.common.module.mapper.RuleDataPlanMapper;
-import cn.com.ctop.common.module.mapper.RuleDataTargetMapper;
-import cn.com.ctop.common.module.service.IRuleDataAccountService;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 规则账户清洗数据
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-11-16
- */
-@Service
-public class RuleDataAccountServiceImpl extends ServiceImpl<RuleDataAccountMapper, RuleDataAccount> implements IRuleDataAccountService {
-
-    @Autowired
-    private RuleDataAccountMapper ruleDataAccountMapper;
-
-    @Autowired
-    private RuleDataPlanMapper ruleDataPlanMapper;
-
-    @Autowired
-    private RuleDataTargetMapper ruleDataTargetMapper;
-
-    @Autowired
-    private RuleDataCreativeMapper ruleDataCreativeMapper;
-
-    @Override
-    public JSONObject getRuleDataByAccountId(Long accountId) {
-        JSONObject obj = new JSONObject();
-        Map<String, Object> map = new HashMap<>();
-        map.put("account_id", accountId);
-        map.put("status", 1);
-        List<RuleDataAccount> ruleDataAccounts = ruleDataAccountMapper.selectByMap(map);
-        obj.put("account", ruleDataAccounts);
-        List<RuleDataPlan> ruleDataPlans = ruleDataPlanMapper.selectByMap(map);
-        obj.put("plan", ruleDataPlans);
-        List<RuleDataTarget> ruleDataTargets = ruleDataTargetMapper.selectByMap(map);
-        obj.put("target", ruleDataTargets);
-        List<RuleDataCreative> ruleDataCreatives = ruleDataCreativeMapper.selectByMap(map);
-        obj.put("creative", ruleDataCreatives);
-        return obj;
-    }
-}

+ 0 - 702
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysBaseApiImpl.java

@@ -1,702 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.*;
-import cn.com.ctop.common.module.mapper.*;
-import cn.com.ctop.common.module.message.entity.SysMessageTemplate;
-import cn.com.ctop.common.module.message.service.ISysMessageTemplateService;
-import cn.com.ctop.common.module.message.websocket.WebSocket;
-import cn.com.ctop.common.module.service.ISysDataSourceService;
-import cn.com.ctop.common.module.service.ISysDepartService;
-import cn.com.ctop.common.module.service.ISysDictService;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-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.extension.plugins.pagination.Page;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
-import org.jeecg.common.constant.CacheConstant;
-import org.jeecg.common.constant.CommonConstant;
-import org.jeecg.common.constant.DataBaseConstant;
-import org.jeecg.common.constant.WebsocketConst;
-import org.jeecg.common.exception.JeecgBootException;
-import cn.com.ctop.common.module.service.ISysBaseApi;
-import org.jeecg.common.system.vo.*;
-import org.jeecg.common.util.*;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.sql.DataSource;
-import java.io.*;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Description: 底层共通业务API,提供其他独立模块调用
- * @Author: scott
- * @Date:2019-4-20
- * @Version:V1.0
- */
-@Slf4j
-@Service
-public class SysBaseApiImpl implements ISysBaseApi {
-    /**
-     * 当前系统数据库类型
-     */
-    private static String DB_TYPE = "";
-    @Autowired
-    private ISysMessageTemplateService sysMessageTemplateService;
-    @Resource
-    private SysLogMapper sysLogMapper;
-    @Resource
-    private SysUserMapper userMapper;
-    @Resource
-    private SysUserRoleMapper sysUserRoleMapper;
-    @Autowired
-    private ISysDepartService sysDepartService;
-    @Autowired
-    private ISysDictService sysDictService;
-    @Resource
-    private SysAnnouncementMapper sysAnnouncementMapper;
-    @Resource
-    private SysAnnouncementSendMapper sysAnnouncementSendMapper;
-    @Resource
-    private WebSocket webSocket;
-    @Resource
-    private SysRoleMapper roleMapper;
-    @Resource
-    private SysDepartMapper departMapper;
-    @Resource
-    private SysCategoryMapper categoryMapper;
-
-    @Autowired
-    private ISysDataSourceService dataSourceService;
-
-    @Override
-    public void addLog(String LogContent, Integer logType, Integer operatetype) {
-        SysLog sysLog = new SysLog();
-        //注解上的描述,操作日志内容
-        sysLog.setLogContent(LogContent);
-        sysLog.setLogType(logType);
-        sysLog.setOperateType(operatetype);
-
-        //请求的方法名
-        //请求的参数
-
-        try {
-            //获取request
-            HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
-            //设置IP地址
-            sysLog.setIp(IPUtils.getIpAddr(request));
-        } catch (Exception e) {
-            sysLog.setIp("127.0.0.1");
-        }
-
-        //获取登录用户信息
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if (sysUser != null) {
-            sysLog.setUserid(sysUser.getUsername());
-            sysLog.setUsername(sysUser.getRealname());
-
-        }
-        sysLog.setCreateTime(new Date());
-        //保存系统日志
-        sysLogMapper.insert(sysLog);
-    }
-
-    @Override
-//    @Cacheable(cacheNames = CacheConstant.SYS_USERS_CACHE, key = "#username")
-    public LoginUser getUserByName(String username) {
-        if (oConvertUtils.isEmpty(username)) {
-            return null;
-        }
-        LoginUser loginUser = new LoginUser();
-        SysUser sysUser = userMapper.getUserByName(username);
-        if (sysUser == null) {
-            return null;
-        }
-        BeanUtils.copyProperties(sysUser, loginUser);
-        return loginUser;
-    }
-
-    @Override
-    public LoginUser getUserById(String id) {
-        if (oConvertUtils.isEmpty(id)) {
-            return null;
-        }
-        LoginUser loginUser = new LoginUser();
-        SysUser sysUser = userMapper.selectById(id);
-        if (sysUser == null) {
-            return null;
-        }
-        BeanUtils.copyProperties(sysUser, loginUser);
-        return loginUser;
-    }
-
-    @Override
-    public List<String> getRolesByUsername(String username) {
-        return sysUserRoleMapper.getRoleByUserName(username);
-    }
-
-    @Override
-    public List<String> getDepartIdsByUsername(String username) {
-        List<SysDepart> list = sysDepartService.queryDepartsByUsername(username);
-        List<String> result = new ArrayList<>(list.size());
-        for (SysDepart depart : list) {
-            result.add(depart.getId());
-        }
-        return result;
-    }
-
-    @Override
-    public List<String> getDepartNamesByUsername(String username) {
-        List<SysDepart> list = sysDepartService.queryDepartsByUsername(username);
-        List<String> result = new ArrayList<>(list.size());
-        for (SysDepart depart : list) {
-            result.add(depart.getDepartName());
-        }
-        return result;
-    }
-
-    @Override
-    public String getDatabaseType() throws SQLException {
-        if (oConvertUtils.isNotEmpty(DB_TYPE)) {
-            return DB_TYPE;
-        }
-        DataSource dataSource = SpringContextUtils.getApplicationContext().getBean(DataSource.class);
-        return getDatabaseTypeByDataSource(dataSource);
-    }
-
-    @Override
-    @Cacheable(value = CacheConstant.SYS_DICT_CACHE, key = "#code")
-    public List<DictModel> queryDictItemsByCode(String code) {
-        return sysDictService.queryDictItemsByCode(code);
-    }
-
-    @Override
-    public List<DictModel> queryTableDictItemsByCode(String table, String text, String code) {
-        return sysDictService.queryTableDictItemsByCode(table, text, code);
-    }
-
-    @Override
-    public List<DictModel> queryAllDepartBackDictModel() {
-        return sysDictService.queryAllDepartBackDictModel();
-    }
-
-    @Override
-    public List<JSONObject> queryAllDepart(Wrapper wrapper) {
-        //noinspection unchecked
-        return JSON.parseArray(JSON.toJSONString(sysDepartService.list(wrapper))).toJavaList(JSONObject.class);
-    }
-
-    @Override
-    public void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent) {
-        this.sendSysAnnouncement(fromUser, toUser, title, msgContent, CommonConstant.MSG_CATEGORY_2);
-    }
-
-    @Override
-    public void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent, String setMsgCategory) {
-        SysAnnouncement announcement = new SysAnnouncement();
-        announcement.setTitile(title);
-        announcement.setMsgContent(msgContent);
-        announcement.setSender(fromUser);
-        announcement.setPriority(CommonConstant.PRIORITY_M);
-        announcement.setMsgType(CommonConstant.MSG_TYPE_UESR);
-        announcement.setSendStatus(CommonConstant.HAS_SEND);
-        announcement.setSendTime(new Date());
-        announcement.setMsgCategory(setMsgCategory);
-        announcement.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
-        sysAnnouncementMapper.insert(announcement);
-        // 2.插入用户通告阅读标记表记录
-        String userId = toUser;
-        String[] userIds = userId.split(",");
-        String anntId = announcement.getId();
-        for (int i = 0; i < userIds.length; i++) {
-            if (oConvertUtils.isNotEmpty(userIds[i])) {
-                SysUser sysUser = userMapper.getUserByName(userIds[i]);
-                if (sysUser == null) {
-                    continue;
-                }
-                SysAnnouncementSend announcementSend = new SysAnnouncementSend();
-                announcementSend.setAnntId(anntId);
-                announcementSend.setUserId(sysUser.getId());
-                announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
-                sysAnnouncementSendMapper.insert(announcementSend);
-                JSONObject obj = new JSONObject();
-                obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
-                obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
-                obj.put(WebsocketConst.MSG_ID, announcement.getId());
-                obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
-                webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
-            }
-        }
-
-    }
-
-    @Override
-    public void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent, String setMsgCategory, String busType, String busId) {
-        SysAnnouncement announcement = new SysAnnouncement();
-        announcement.setTitile(title);
-        announcement.setMsgContent(msgContent);
-        announcement.setSender(fromUser);
-        announcement.setPriority(CommonConstant.PRIORITY_M);
-        announcement.setMsgType(CommonConstant.MSG_TYPE_UESR);
-        announcement.setSendStatus(CommonConstant.HAS_SEND);
-        announcement.setSendTime(new Date());
-        announcement.setMsgCategory(setMsgCategory);
-        announcement.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
-        announcement.setBusId(busId);
-        announcement.setBusType(busType);
-        announcement.setOpenType(SysAnnmentTypeEnum.getByType(busType).getOpenType());
-        announcement.setOpenPage(SysAnnmentTypeEnum.getByType(busType).getOpenPage());
-        sysAnnouncementMapper.insert(announcement);
-        // 2.插入用户通告阅读标记表记录
-        String userId = toUser;
-        String[] userIds = userId.split(",");
-        String anntId = announcement.getId();
-        for (int i = 0; i < userIds.length; i++) {
-            if (oConvertUtils.isNotEmpty(userIds[i])) {
-                SysUser sysUser = userMapper.getUserByName(userIds[i]);
-                if (sysUser == null) {
-                    continue;
-                }
-                SysAnnouncementSend announcementSend = new SysAnnouncementSend();
-                announcementSend.setAnntId(anntId);
-                announcementSend.setUserId(sysUser.getId());
-                announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
-                sysAnnouncementSendMapper.insert(announcementSend);
-                JSONObject obj = new JSONObject();
-                obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
-                obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
-                obj.put(WebsocketConst.MSG_ID, announcement.getId());
-                obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
-                webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
-            }
-        }
-    }
-
-    @Override
-    public void updateSysAnnounReadFlag(String busType, String busId) {
-        SysAnnouncement announcement = sysAnnouncementMapper.selectOne(new QueryWrapper<SysAnnouncement>().eq("bus_type", busType).eq("bus_id", busId));
-        if (announcement != null) {
-            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-            String userId = sysUser.getId();
-            LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda();
-            updateWrapper.set(SysAnnouncementSend::getReadFlag, CommonConstant.HAS_READ_FLAG);
-            updateWrapper.set(SysAnnouncementSend::getReadTime, new Date());
-            updateWrapper.last("where annt_id ='" + announcement.getId() + "' and user_id ='" + userId + "'");
-            SysAnnouncementSend announcementSend = new SysAnnouncementSend();
-            sysAnnouncementSendMapper.update(announcementSend, updateWrapper);
-        }
-    }
-
-    @Override
-    public String parseTemplateByCode(String templateCode, Map<String, String> map) {
-        List<SysMessageTemplate> sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode);
-        if (sysSmsTemplates == null || sysSmsTemplates.size() == 0) {
-            throw new JeecgBootException("消息模板不存在,模板编码:" + templateCode);
-        }
-        SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0);
-        //模板内容
-        String content = sysSmsTemplate.getTemplateContent();
-        if (map != null) {
-            for (Map.Entry<String, String> entry : map.entrySet()) {
-                String str = "${" + entry.getKey() + "}";
-                content = content.replace(str, entry.getValue());
-            }
-        }
-        return content;
-    }
-
-    @Override
-    public void sendSysAnnouncement(String fromUser, String toUser, String title, Map<String, String> map, String templateCode) {
-        List<SysMessageTemplate> sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode);
-        if (sysSmsTemplates == null || sysSmsTemplates.size() == 0) {
-            throw new JeecgBootException("消息模板不存在,模板编码:" + templateCode);
-        }
-        SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0);
-        //模板标题
-        title = title == null ? sysSmsTemplate.getTemplateName() : title;
-        //模板内容
-        String content = sysSmsTemplate.getTemplateContent();
-        if (map != null) {
-            for (Map.Entry<String, String> entry : map.entrySet()) {
-                String str = "${" + entry.getKey() + "}";
-                title = title.replace(str, entry.getValue());
-                content = content.replace(str, entry.getValue());
-            }
-        }
-
-        SysAnnouncement announcement = new SysAnnouncement();
-        announcement.setTitile(title);
-        announcement.setMsgContent(content);
-        announcement.setSender(fromUser);
-        announcement.setPriority(CommonConstant.PRIORITY_M);
-        announcement.setMsgType(CommonConstant.MSG_TYPE_UESR);
-        announcement.setSendStatus(CommonConstant.HAS_SEND);
-        announcement.setSendTime(new Date());
-        announcement.setMsgCategory(CommonConstant.MSG_CATEGORY_2);
-        announcement.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
-        sysAnnouncementMapper.insert(announcement);
-        // 2.插入用户通告阅读标记表记录
-        String userId = toUser;
-        String[] userIds = userId.split(",");
-        String anntId = announcement.getId();
-        for (int i = 0; i < userIds.length; i++) {
-            if (oConvertUtils.isNotEmpty(userIds[i])) {
-                SysUser sysUser = userMapper.getUserByName(userIds[i]);
-                if (sysUser == null) {
-                    continue;
-                }
-                SysAnnouncementSend announcementSend = new SysAnnouncementSend();
-                announcementSend.setAnntId(anntId);
-                announcementSend.setUserId(sysUser.getId());
-                announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
-                sysAnnouncementSendMapper.insert(announcementSend);
-                JSONObject obj = new JSONObject();
-                obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
-                obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
-                obj.put(WebsocketConst.MSG_ID, announcement.getId());
-                obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
-                webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
-            }
-        }
-    }
-
-    @Override
-    public void sendSysAnnouncement(String fromUser, String toUser, String title, Map<String, String> map, String templateCode, String busType, String busId) {
-        List<SysMessageTemplate> sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode);
-        if (sysSmsTemplates == null || sysSmsTemplates.size() == 0) {
-            throw new JeecgBootException("消息模板不存在,模板编码:" + templateCode);
-        }
-        SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0);
-        //模板标题
-        title = title == null ? sysSmsTemplate.getTemplateName() : title;
-        //模板内容
-        String content = sysSmsTemplate.getTemplateContent();
-        if (map != null) {
-            for (Map.Entry<String, String> entry : map.entrySet()) {
-                String str = "${" + entry.getKey() + "}";
-                title = title.replace(str, entry.getValue());
-                content = content.replace(str, entry.getValue());
-            }
-        }
-        SysAnnouncement announcement = new SysAnnouncement();
-        announcement.setTitile(title);
-        announcement.setMsgContent(content);
-        announcement.setSender(fromUser);
-        announcement.setPriority(CommonConstant.PRIORITY_M);
-        announcement.setMsgType(CommonConstant.MSG_TYPE_UESR);
-        announcement.setSendStatus(CommonConstant.HAS_SEND);
-        announcement.setSendTime(new Date());
-        announcement.setMsgCategory(CommonConstant.MSG_CATEGORY_2);
-        announcement.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
-        announcement.setBusId(busId);
-        announcement.setBusType(busType);
-        announcement.setOpenType(SysAnnmentTypeEnum.getByType(busType).getOpenType());
-        announcement.setOpenPage(SysAnnmentTypeEnum.getByType(busType).getOpenPage());
-        sysAnnouncementMapper.insert(announcement);
-        // 2.插入用户通告阅读标记表记录
-        String userId = toUser;
-        String[] userIds = userId.split(",");
-        String anntId = announcement.getId();
-        for (int i = 0; i < userIds.length; i++) {
-            if (oConvertUtils.isNotEmpty(userIds[i])) {
-                SysUser sysUser = userMapper.getUserByName(userIds[i]);
-                if (sysUser == null) {
-                    continue;
-                }
-                SysAnnouncementSend announcementSend = new SysAnnouncementSend();
-                announcementSend.setAnntId(anntId);
-                announcementSend.setUserId(sysUser.getId());
-                announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
-                sysAnnouncementSendMapper.insert(announcementSend);
-                JSONObject obj = new JSONObject();
-                obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
-                obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
-                obj.put(WebsocketConst.MSG_ID, announcement.getId());
-                obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
-                webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
-            }
-        }
-    }
-
-    /**
-     * 获取数据库类型
-     *
-     * @param dataSource
-     * @return
-     * @throws SQLException
-     */
-    private String getDatabaseTypeByDataSource(DataSource dataSource) throws SQLException {
-        if ("".equals(DB_TYPE)) {
-            Connection connection = dataSource.getConnection();
-            try {
-                DatabaseMetaData md = connection.getMetaData();
-                String dbType = md.getDatabaseProductName().toLowerCase();
-                if (dbType.indexOf("mysql") >= 0) {
-                    DB_TYPE = DataBaseConstant.DB_TYPE_MYSQL;
-                } else if (dbType.indexOf("oracle") >= 0) {
-                    DB_TYPE = DataBaseConstant.DB_TYPE_ORACLE;
-                } else if (dbType.indexOf("sqlserver") >= 0 || dbType.indexOf("sql server") >= 0) {
-                    DB_TYPE = DataBaseConstant.DB_TYPE_SQLSERVER;
-                } else if (dbType.indexOf("postgresql") >= 0) {
-                    DB_TYPE = DataBaseConstant.DB_TYPE_POSTGRESQL;
-                } else {
-                    throw new JeecgBootException("数据库类型:[" + dbType + "]不识别!");
-                }
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-            } finally {
-                connection.close();
-            }
-        }
-        return DB_TYPE;
-
-    }
-
-    @Override
-    public List<DictModel> queryAllDict() {
-        // 查询并排序
-        QueryWrapper<SysDict> queryWrapper = new QueryWrapper<SysDict>();
-        queryWrapper.orderByAsc("create_time");
-        List<SysDict> dicts = sysDictService.list(queryWrapper);
-        // 封装成 model
-        List<DictModel> list = new ArrayList<DictModel>();
-        for (SysDict dict : dicts) {
-            list.add(new DictModel(dict.getDictCode(), dict.getDictName()));
-        }
-
-        return list;
-    }
-
-    @Override
-    public List<SysCategoryModel> queryAllDSysCategory() {
-        List<SysCategory> ls = categoryMapper.selectList(null);
-        List<SysCategoryModel> res = oConvertUtils.entityListToModelList(ls, SysCategoryModel.class);
-        return res;
-    }
-
-    @Override
-    public List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql) {
-        return sysDictService.queryTableDictItemsByCodeAndFilter(table, text, code, filterSql);
-    }
-
-    @Override
-    public List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray) {
-        return sysDictService.queryTableDictByKeys(table, text, code, keyArray);
-    }
-
-    @Override
-    public List<ComboModel> queryAllUser() {
-        List<ComboModel> list = new ArrayList<ComboModel>();
-        List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0));
-        for (SysUser user : userList) {
-            ComboModel model = new ComboModel();
-            model.setTitle(user.getRealname());
-            model.setId(user.getId());
-            model.setUsername(user.getUsername());
-            list.add(model);
-        }
-        return list;
-    }
-
-    @Override
-    public JSONObject queryAllUser(String[] userIds, int pageNo, int pageSize) {
-        JSONObject json = new JSONObject();
-        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0);
-        List<ComboModel> list = new ArrayList<>();
-        Page<SysUser> page = new Page<>(pageNo, pageSize);
-        IPage<SysUser> pageList = userMapper.selectPage(page, queryWrapper);
-        for (SysUser user : pageList.getRecords()) {
-            ComboModel model = new ComboModel();
-            model.setUsername(user.getUsername());
-            model.setTitle(user.getRealname());
-            model.setId(user.getId());
-            model.setEmail(user.getEmail());
-            if (oConvertUtils.isNotEmpty(userIds)) {
-                for (int i = 0; i < userIds.length; i++) {
-                    if (userIds[i].equals(user.getId())) {
-                        model.setChecked(true);
-                    }
-                }
-            }
-            list.add(model);
-        }
-        json.put("list", list);
-        json.put("total", pageList.getTotal());
-        return json;
-    }
-
-    @Override
-    public List<JSONObject> queryAllUser(Wrapper wrapper) {
-        //noinspection unchecked
-        return JSON.parseArray(JSON.toJSONString(userMapper.selectList(wrapper))).toJavaList(JSONObject.class);
-    }
-
-    @Override
-    public List<ComboModel> queryAllRole() {
-        List<ComboModel> list = new ArrayList<ComboModel>();
-        List<SysRole> roleList = roleMapper.selectList(new QueryWrapper<SysRole>());
-        for (SysRole role : roleList) {
-            ComboModel model = new ComboModel();
-            model.setTitle(role.getRoleName());
-            model.setId(role.getId());
-            list.add(model);
-        }
-        return list;
-    }
-
-    @Override
-    public List<ComboModel> queryAllRole(String[] roleIds) {
-        List<ComboModel> list = new ArrayList<ComboModel>();
-        List<SysRole> roleList = roleMapper.selectList(new QueryWrapper<SysRole>());
-        for (SysRole role : roleList) {
-            ComboModel model = new ComboModel();
-            model.setTitle(role.getRoleName());
-            model.setId(role.getId());
-            model.setRoleCode(role.getRoleCode());
-            if (oConvertUtils.isNotEmpty(roleIds)) {
-                for (int i = 0; i < roleIds.length; i++) {
-                    if (roleIds[i].equals(role.getId())) {
-                        model.setChecked(true);
-                    }
-                }
-            }
-            list.add(model);
-        }
-        return list;
-    }
-
-    @Override
-    public List<String> getRoleIdsByUsername(String username) {
-        return sysUserRoleMapper.getRoleIdByUserName(username);
-    }
-
-    @Override
-    public String getDepartIdsByOrgCode(String orgCode) {
-        return departMapper.queryDepartIdByOrgCode(orgCode);
-    }
-
-    @Override
-    public DictModel getParentDepartId(String departId) {
-        SysDepart depart = departMapper.getParentDepartId(departId);
-        DictModel model = new DictModel(depart.getId(), depart.getParentId());
-        return model;
-    }
-
-    @Override
-    public List<SysDepartModel> getAllSysDepart() {
-        List<SysDepartModel> departModelList = new ArrayList<SysDepartModel>();
-        List<SysDepart> departList = departMapper.selectList(new QueryWrapper<SysDepart>().eq("del_flag", "0"));
-        for (SysDepart depart : departList) {
-            SysDepartModel model = new SysDepartModel();
-            BeanUtils.copyProperties(depart, model);
-            departModelList.add(model);
-        }
-        return departModelList;
-    }
-
-    @Override
-    public DynamicDataSourceModel getDynamicDbSourceById(String dbSourceId) {
-        SysDataSource dbSource = dataSourceService.getById(dbSourceId);
-        return new DynamicDataSourceModel(dbSource);
-    }
-
-    @Override
-    public DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode) {
-        SysDataSource dbSource = dataSourceService.getOne(new LambdaQueryWrapper<SysDataSource>().eq(SysDataSource::getCode, dbSourceCode));
-        return new DynamicDataSourceModel(dbSource);
-    }
-
-    @Override
-    public List<String> getDeptHeadByDepId(String deptId) {
-        List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().like("depart_ids", deptId).eq("status", 1).eq("del_flag", 0));
-        List<String> list = new ArrayList<>();
-        for (SysUser user : userList) {
-            list.add(user.getUsername());
-        }
-        return list;
-    }
-
-    @Override
-    public String upload(MultipartFile file, String bizPath, String uploadType) {
-        return null;
-    }
-
-    @Override
-    public String upload(MultipartFile file, String bizPath, String uploadType, String customBucket) {
-        return null;
-    }
-
-    @Override
-    public void viewAndDownload(String filePath, String uploadpath, String uploadType, HttpServletResponse response) {
-
-    }
-
-
-    @Override
-    public void sendWebSocketMsg(String[] userIds, String cmd) {
-        JSONObject obj = new JSONObject();
-        obj.put(WebsocketConst.MSG_CMD, cmd);
-        webSocket.sendMoreMessage(userIds, obj.toJSONString());
-    }
-
-    @Override
-    public List<LoginUser> queryAllUserByIds(String[] userIds) {
-        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0);
-        queryWrapper.in("id", userIds);
-        List<LoginUser> loginUsers = new ArrayList<>();
-        List<SysUser> sysUsers = userMapper.selectList(queryWrapper);
-        for (SysUser user : sysUsers) {
-            LoginUser loginUser = new LoginUser();
-            BeanUtils.copyProperties(user, loginUser);
-            loginUsers.add(loginUser);
-        }
-        return loginUsers;
-    }
-
-    /**
-
-     * 推送签到人员信息
-     *
-     * @param userId
-     */
-    @Override
-    public void meetingSignWebsocket(String userId) {
-        JSONObject obj = new JSONObject();
-        obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_SIGN);
-        obj.put(WebsocketConst.MSG_USER_ID, userId);
-        //TODO 目前全部推送,后面修改
-        webSocket.sendAllMessage(obj.toJSONString());
-    }
-
-    @Override
-    public List<LoginUser> queryUserByNames(String[] userNames) {
-        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0);
-        queryWrapper.in("username", userNames);
-        List<LoginUser> loginUsers = new ArrayList<>();
-        List<SysUser> sysUsers = userMapper.selectList(queryWrapper);
-        for (SysUser user : sysUsers) {
-            LoginUser loginUser = new LoginUser();
-            BeanUtils.copyProperties(user, loginUser);
-            loginUsers.add(loginUser);
-        }
-        return loginUsers;
-    }
-}

+ 0 - 24
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysDepartRoleServiceImpl.java

@@ -1,24 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.SysDepartRole;
-import cn.com.ctop.common.module.mapper.SysDepartRoleMapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import cn.com.ctop.common.module.service.ISysDepartRoleService;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @Description: 部门角色
- * @Author: jeecg-boot
- * @Date:   2020-02-12
- * @Version: V1.0
- */
-@Service
-public class SysDepartRoleServiceImpl extends ServiceImpl<SysDepartRoleMapper, SysDepartRole> implements ISysDepartRoleService {
-
-    @Override
-    public List<SysDepartRole> queryDeptRoleByDeptAndUser(String orgCode, String userId) {
-        return this.baseMapper.queryDeptRoleByDeptAndUser(orgCode,userId);
-    }
-}

+ 0 - 488
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysDepartServiceImpl.java

@@ -1,488 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-import cn.com.ctop.common.module.entity.SysDepartPermission;
-import cn.com.ctop.common.module.entity.SysDepartRole;
-import cn.com.ctop.common.module.entity.SysDepartRolePermission;
-import cn.com.ctop.common.module.entity.SysDepartRoleUser;
-import cn.com.ctop.common.module.entity.SysUserDepart;
-import cn.com.ctop.common.module.mapper.SysDepartMapper;
-import cn.com.ctop.common.module.mapper.SysDepartPermissionMapper;
-import cn.com.ctop.common.module.mapper.SysDepartRolePermissionMapper;
-import cn.com.ctop.common.module.mapper.SysDepartRoleUserMapper;
-import cn.com.ctop.common.module.mapper.SysUserDepartMapper;
-import cn.com.ctop.common.module.model.DepartIdModel;
-import cn.com.ctop.common.module.model.SysDepartTreeModel;
-import cn.com.ctop.common.module.service.ISysBaseApi;
-import cn.com.ctop.common.module.service.ISysDepartRoleService;
-import cn.com.ctop.common.module.service.ISysDepartService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.FindsDepartsChildrenUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import io.netty.util.internal.StringUtil;
-import org.jeecg.common.constant.CommonConstant;
-import org.jeecg.common.util.YouBianCodeUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * <p>
- * 部门表 服务实现类
- * <p>
- *
- * @Author Steve
- * @Since 2019-01-22
- */
-@Service
-public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart> implements ISysDepartService {
-    @Autowired
-    private ISysBaseApi sysBaseAPI;
-    @Resource
-    private SysUserDepartMapper userDepartMapper;
-    @Autowired
-    private ISysDepartRoleService sysDepartRoleService;
-    @Resource
-    private SysDepartPermissionMapper departPermissionMapper;
-    @Resource
-    private SysDepartRolePermissionMapper departRolePermissionMapper;
-    @Resource
-    private SysDepartRoleUserMapper departRoleUserMapper;
-    @Resource
-    private SysDepartMapper sysDepartMapper;
-
-    @Override
-    public List<SysDepartTreeModel> queryMyDeptTreeList(String departIds) {
-        //根据部门id获取所负责部门
-        LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
-        String[] codeArr = this.getMyDeptParentOrgCode(departIds);
-        for (int i = 0; i < codeArr.length; i++) {
-            query.or().likeRight(SysDepart::getOrgCode, codeArr[i]);
-        }
-        query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
-        query.orderByAsc(SysDepart::getDepartOrder);
-        //将父节点ParentId设为null
-        List<SysDepart> listDepts = this.list(query);
-        for (int i = 0; i < codeArr.length; i++) {
-            for (SysDepart dept : listDepts) {
-                if (!Check.isNull(dept.getLeaderName())) {
-                    dept.setTitle(dept.getDepartName().concat("(").concat(dept.getLeaderName()).concat(")"));
-                } else {
-                    dept.setTitle(dept.getDepartName());
-                }
-                if (dept.getOrgCode().equals(codeArr[i])) {
-                    dept.setParentId(null);
-                }
-            }
-        }
-        // 调用wrapTreeDataToTreeList方法生成树状数据
-        List<SysDepartTreeModel> listResult = FindsDepartsChildrenUtil.wrapTreeDataToTreeList(listDepts);
-        return listResult;
-    }
-
-    /**
-     * queryTreeList 对应 queryTreeList 查询所有的部门数据,以树结构形式响应给前端
-     */
-    // @Cacheable(value = CacheConstant.SYS_DEPARTS_CACHE)
-    @Override
-    public List<SysDepartTreeModel> queryTreeList() {
-        LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
-        query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
-        query.orderByAsc(SysDepart::getDepartOrder);
-        List<SysDepart> list = this.list(query);
-        for (SysDepart sysDepart : list) {
-            if (!Check.isNull(sysDepart.getLeaderName())) {
-                sysDepart.setTitle(sysDepart.getDepartName().concat("(").concat(sysDepart.getLeaderName()).concat(")"));
-            } else {
-                sysDepart.setTitle(sysDepart.getDepartName());
-            }
-        }
-
-        // 调用wrapTreeDataToTreeList方法生成树状数据
-        List<SysDepartTreeModel> listResult = FindsDepartsChildrenUtil.wrapTreeDataToTreeList(list);
-        return listResult;
-    }
-
-    //  @Cacheable(value = CacheConstant.SYS_DEPART_IDS_CACHE)
-    @Override
-    public List<DepartIdModel> queryDepartIdTreeList() {
-        LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
-        query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
-        query.orderByAsc(SysDepart::getDepartOrder);
-        List<SysDepart> list = this.list(query);
-        for (SysDepart sysDepart : list) {
-            if (!Check.isNull(sysDepart.getLeaderName())) {
-                sysDepart.setTitle(sysDepart.getDepartName().concat("(").concat(sysDepart.getLeaderName()).concat(")"));
-            } else {
-                sysDepart.setTitle(sysDepart.getDepartName());
-            }
-        }
-        // 调用wrapTreeDataToTreeList方法生成树状数据
-        List<DepartIdModel> listResult = FindsDepartsChildrenUtil.wrapTreeDataToDepartIdTreeList(list);
-        return listResult;
-    }
-
-    /**
-     * saveDepartData 对应 add 保存用户在页面添加的新的部门对象数据
-     */
-    @Override
-    @Transactional
-    public void saveDepartData(SysDepart sysDepart, String username) {
-        if (sysDepart != null && username != null) {
-            if (sysDepart.getParentId() == null) {
-                sysDepart.setParentId("");
-            }
-            String s = UUID.randomUUID().toString().replace("-", "");
-            sysDepart.setId(s);
-            if (!Check.isNull(sysDepart.getLeaderName())) {
-                sysDepart.setLeaderName(sysDepart.getLeaderName().trim());
-            }
-            // 先判断该对象有无父级ID,有则意味着不是最高级,否则意味着是最高级
-            // 获取父级ID
-            String parentId = sysDepart.getParentId();
-            //update-begin--Author:baihailong  Date:20191209 for:部门编码规则生成器做成公用配置
-
-
-            String[] codeArray = generateOrgCode(parentId);
-           /* JSONObject formData = new JSONObject();
-            formData.put("parentId", parentId);
-            String[] codeArray = (String[]) FillRuleUtil.executeRule(FillRuleConstant.DEPART, formData);*/
-            sysDepart.setOrgCode(codeArray[0]);
-            String orgType = codeArray[1];
-            sysDepart.setOrgType(String.valueOf(orgType));
-            //update-end--Author:baihailong  Date:20191209 for:部门编码规则生成器做成公用配置
-            sysDepart.setCreateTime(new Date());
-            sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
-            this.save(sysDepart);
-            sysBaseAPI.addLog("添加部门,id: " + sysDepart.getId(), CommonConstant.LOG_TYPE_2, 1);
-        }
-
-    }
-
-    /**
-     * saveDepartData 的调用方法,生成部门编码和部门类型(作废逻辑)
-     *
-     * @param parentId
-     * @return
-     * @deprecated
-     */
-    private String[] generateOrgCode(String parentId) {
-        //update-begin--Author:Steve  Date:20190201 for:组织机构添加数据代码调整
-        LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
-        LambdaQueryWrapper<SysDepart> query1 = new LambdaQueryWrapper<SysDepart>();
-        String[] strArray = new String[2];
-        // 创建一个List集合,存储查询返回的所有SysDepart对象
-        List<SysDepart> departList = new ArrayList<>();
-        // 定义新编码字符串
-        String newOrgCode = "";
-        // 定义旧编码字符串
-        String oldOrgCode = "";
-        // 定义部门类型
-        String orgType = "";
-        // 如果是最高级,则查询出同级的org_code, 调用工具类生成编码并返回
-        if (StringUtil.isNullOrEmpty(parentId)) {
-            // 线判断数据库中的表是否为空,空则直接返回初始编码
-            query1.eq(SysDepart::getParentId, "").or().isNull(SysDepart::getParentId);
-            query1.orderByDesc(SysDepart::getOrgCode);
-            departList = this.list(query1);
-            if (departList == null || departList.size() == 0) {
-                strArray[0] = YouBianCodeUtil.getNextYouBianCode(null);
-                strArray[1] = "1";
-                return strArray;
-            } else {
-                SysDepart depart = departList.get(0);
-                oldOrgCode = depart.getOrgCode();
-                orgType = depart.getOrgType();
-                newOrgCode = YouBianCodeUtil.getNextYouBianCode(oldOrgCode);
-            }
-        } else { // 反之则查询出所有同级的部门,获取结果后有两种情况,有同级和没有同级
-            // 封装查询同级的条件
-            query.eq(SysDepart::getParentId, parentId);
-            // 降序排序
-            query.orderByDesc(SysDepart::getOrgCode);
-            // 查询出同级部门的集合
-            List<SysDepart> parentList = this.list(query);
-            // 查询出父级部门
-            SysDepart depart = this.getById(parentId);
-            // 获取父级部门的Code
-            String parentCode = depart.getOrgCode();
-            // 根据父级部门类型算出当前部门的类型
-            orgType = String.valueOf(Integer.valueOf(depart.getOrgType()) + 1);
-            // 处理同级部门为null的情况
-            if (parentList == null || parentList.size() == 0) {
-                // 直接生成当前的部门编码并返回
-                newOrgCode = YouBianCodeUtil.getSubYouBianCode(parentCode, null);
-            } else { //处理有同级部门的情况
-                // 获取同级部门的编码,利用工具类
-                String subCode = parentList.get(0).getOrgCode();
-                // 返回生成的当前部门编码
-                newOrgCode = YouBianCodeUtil.getSubYouBianCode(parentCode, subCode);
-            }
-        }
-        // 返回最终封装了部门编码和部门类型的数组
-        strArray[0] = newOrgCode;
-        strArray[1] = orgType;
-        return strArray;
-        //update-end--Author:Steve  Date:20190201 for:组织机构添加数据代码调整
-    }
-
-    /**
-     * updateDepartDataById 对应 edit 根据部门主键来更新对应的部门数据
-     */
-    @Override
-    @Transactional
-    public Boolean updateDepartDataById(SysDepart sysDepart, String username) {
-        if (sysDepart != null && username != null) {
-            sysDepart.setUpdateTime(new Date());
-            sysDepart.setUpdateBy(username);
-            this.updateById(sysDepart);
-            return true;
-        } else {
-            return false;
-        }
-
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void deleteBatchWithChildren(List<String> ids) {
-        List<String> idList = new ArrayList<String>();
-        for (String id : ids) {
-            idList.add(id);
-            this.checkChildrenExists(id, idList);
-        }
-        this.removeByIds(idList);
-        //根据部门id获取部门角色id
-        List<String> roleIdList = new ArrayList<>();
-        LambdaQueryWrapper<SysDepartRole> query = new LambdaQueryWrapper<>();
-        query.select(SysDepartRole::getId).in(SysDepartRole::getDepartId, idList);
-        List<SysDepartRole> depRoleList = sysDepartRoleService.list(query);
-        for (SysDepartRole deptRole : depRoleList) {
-            roleIdList.add(deptRole.getId());
-        }
-        //根据部门id删除用户与部门关系
-        userDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getDepId, idList));
-        //根据部门id删除部门授权
-        departPermissionMapper.delete(new LambdaQueryWrapper<SysDepartPermission>().in(SysDepartPermission::getDepartId, idList));
-        //根据部门id删除部门角色
-        sysDepartRoleService.remove(new LambdaQueryWrapper<SysDepartRole>().in(SysDepartRole::getDepartId, idList));
-        if (roleIdList != null && roleIdList.size() > 0) {
-            //根据角色id删除部门角色授权
-            departRolePermissionMapper.delete(new LambdaQueryWrapper<SysDepartRolePermission>().in(SysDepartRolePermission::getRoleId, roleIdList));
-            //根据角色id删除部门角色用户信息
-            departRoleUserMapper.delete(new LambdaQueryWrapper<SysDepartRoleUser>().in(SysDepartRoleUser::getDroleId, roleIdList));
-        }
-    }
-
-    @Override
-    public List<String> getSubDepIdsByDepId(String departId) {
-        return this.baseMapper.getSubDepIdsByDepId(departId);
-    }
-
-    @Override
-    public List<String> getMySubDepIdsByDepId(String departIds) {
-        //根据部门id获取所负责部门
-        String[] codeArr = this.getMyDeptParentOrgCode(departIds);
-        return this.baseMapper.getSubDepIdsByOrgCodes(codeArr);
-    }
-
-    /**
-     * <p>
-     * 根据关键字搜索相关的部门数据
-     * </p>
-     */
-    @Override
-    public List<SysDepartTreeModel> searhBy(String keyWord, String myDeptSearch, String departIds) {
-        LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
-        List<SysDepartTreeModel> newList = new ArrayList<>();
-        //myDeptSearch不为空时为我的部门搜索,只搜索所负责部门
-        if (!StringUtil.isNullOrEmpty(myDeptSearch)) {
-            //departIds 为空普通用户或没有管理部门
-            if (StringUtil.isNullOrEmpty(departIds)) {
-                return newList;
-            }
-            //根据部门id获取所负责部门
-            String[] codeArr = this.getMyDeptParentOrgCode(departIds);
-            for (int i = 0; i < codeArr.length; i++) {
-                query.or().likeRight(SysDepart::getOrgCode, codeArr[i]);
-            }
-            query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
-        }
-        query.like(SysDepart::getDepartName, keyWord);
-        //update-begin--Author:huangzhilin  Date:20140417 for:[bugfree号]组织机构搜索回显优化--------------------
-        SysDepartTreeModel model = new SysDepartTreeModel();
-        List<SysDepart> departList = this.list(query);
-        for (SysDepart sysDepart : departList) {
-            if (!Check.isNull(sysDepart.getLeaderName())) {
-                sysDepart.setTitle(sysDepart.getDepartName().concat("(").concat(sysDepart.getLeaderName()).concat(")"));
-            } else {
-                sysDepart.setTitle(sysDepart.getDepartName());
-            }
-        }
-        if (departList.size() > 0) {
-            for (SysDepart depart : departList) {
-                model = new SysDepartTreeModel(depart);
-                model.setChildren(null);
-                //update-end--Author:huangzhilin  Date:20140417 for:[bugfree号]组织机构搜索功回显优化----------------------
-                newList.add(model);
-            }
-            return newList;
-        }
-        return null;
-    }
-
-    /**
-     * 根据部门id删除并且删除其可能存在的子级任何部门
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public boolean delete(String id) {
-        List<String> idList = new ArrayList<>();
-        idList.add(id);
-        this.checkChildrenExists(id, idList);
-        //清空部门树内存
-        //FindsDepartsChildrenUtil.clearDepartIdModel();
-        boolean ok = this.removeByIds(idList);
-        //根据部门id获取部门角色id
-        List<String> roleIdList = new ArrayList<>();
-        LambdaQueryWrapper<SysDepartRole> query = new LambdaQueryWrapper<>();
-        query.select(SysDepartRole::getId).in(SysDepartRole::getDepartId, idList);
-        List<SysDepartRole> depRoleList = sysDepartRoleService.list(query);
-        for (SysDepartRole deptRole : depRoleList) {
-            roleIdList.add(deptRole.getId());
-        }
-        //根据部门id删除用户与部门关系
-        userDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getDepId, idList));
-        //根据部门id删除部门授权
-        departPermissionMapper.delete(new LambdaQueryWrapper<SysDepartPermission>().in(SysDepartPermission::getDepartId, idList));
-        //根据部门id删除部门角色
-        sysDepartRoleService.remove(new LambdaQueryWrapper<SysDepartRole>().in(SysDepartRole::getDepartId, idList));
-        if (roleIdList != null && roleIdList.size() > 0) {
-            //根据角色id删除部门角色授权
-            departRolePermissionMapper.delete(new LambdaQueryWrapper<SysDepartRolePermission>().in(SysDepartRolePermission::getRoleId, roleIdList));
-            //根据角色id删除部门角色用户信息
-            departRoleUserMapper.delete(new LambdaQueryWrapper<SysDepartRoleUser>().in(SysDepartRoleUser::getDroleId, roleIdList));
-        }
-        return ok;
-    }
-
-    /**
-     * delete 方法调用
-     *
-     * @param id
-     * @param idList
-     */
-    private void checkChildrenExists(String id, List<String> idList) {
-        LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
-        query.eq(SysDepart::getParentId, id);
-        List<SysDepart> departList = this.list(query);
-        if (departList != null && departList.size() > 0) {
-            for (SysDepart depart : departList) {
-                idList.add(depart.getId());
-                this.checkChildrenExists(depart.getId(), idList);
-            }
-        }
-    }
-
-    @Override
-    public List<SysDepart> queryUserDeparts(String userId) {
-        return baseMapper.queryUserDeparts(userId);
-    }
-
-    @Override
-    public List<SysDepart> queryDepartsByUsername(String username) {
-        return baseMapper.queryDepartsByUsername(username);
-    }
-
-    /**
-     * 根据用户所负责部门ids获取父级部门编码
-     *
-     * @param departIds
-     * @return
-     */
-    private String[] getMyDeptParentOrgCode(String departIds) {
-        //根据部门id查询所负责部门
-        LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
-        query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
-        query.in(SysDepart::getId, Arrays.asList(departIds.split(",")));
-        query.orderByAsc(SysDepart::getOrgCode);
-        List<SysDepart> list = this.list(query);
-        //查找根部门
-        if (list == null || list.size() == 0) {
-            return null;
-        }
-        String orgCode = this.getMyDeptParentNode(list);
-        String[] codeArr = orgCode.split(",");
-        return codeArr;
-    }
-
-    /**
-     * 获取负责部门父节点
-     *
-     * @param list
-     * @return
-     */
-    private String getMyDeptParentNode(List<SysDepart> list) {
-        Map<String, String> map = new HashMap<>();
-        //1.先将同一公司归类
-        for (SysDepart dept : list) {
-            String code = dept.getOrgCode().substring(0, 3);
-            if (map.containsKey(code)) {
-                String mapCode = map.get(code) + "," + dept.getOrgCode();
-                map.put(code, mapCode);
-            } else {
-                map.put(code, dept.getOrgCode());
-            }
-        }
-        StringBuffer parentOrgCode = new StringBuffer();
-        //2.获取同一公司的根节点
-        for (String str : map.values()) {
-            String[] arrStr = str.split(",");
-            parentOrgCode.append(",").append(this.getMinLengthNode(arrStr));
-        }
-        return parentOrgCode.substring(1);
-    }
-
-    /**
-     * 获取同一公司中部门编码长度最小的部门
-     *
-     * @param str
-     * @return
-     */
-    private String getMinLengthNode(String[] str) {
-        int min = str[0].length();
-        String orgCode = str[0];
-        for (int i = 1; i < str.length; i++) {
-            if (str[i].length() <= min) {
-                min = str[i].length();
-                orgCode = orgCode + "," + str[i];
-            }
-        }
-        return orgCode;
-    }
-
-    @Override
-    public String selectIdByOrdCode(String orgCode) {
-        QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("org_code", orgCode).orderByDesc("create_time");
-        queryWrapper.last("limit 1");
-        SysDepart depart = sysDepartMapper.selectOne(queryWrapper);
-        if (!Check.isNull(depart)) {
-            return depart.getId();
-        }
-        return null;
-    }
-
-
-}

+ 0 - 178
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserDepartServiceImpl.java

@@ -1,178 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.entity.SysUserDepart;
-import cn.com.ctop.common.module.mapper.SysUserDepartMapper;
-import cn.com.ctop.common.module.model.DepartIdModel;
-import cn.com.ctop.common.module.model.SysUserDepartsVO;
-import cn.com.ctop.common.module.service.ISysDepartService;
-import cn.com.ctop.common.module.service.ISysUserDepartService;
-import cn.com.ctop.common.module.service.ISysUserService;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.common.util.oConvertUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * <P>
- * 用户部门表实现类
- * <p/>
- * @Author ZhiLin
- *@since 2019-02-22
- */
-@Service
-public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, SysUserDepart> implements ISysUserDepartService {
-	@Autowired
-	private ISysDepartService sysDepartService;
-	@Autowired
-	private ISysUserService sysUserService;
-
-	/**
-	 *根据用户id添加部门信息
-	 */
-	@Override
-	public boolean addSysUseWithrDepart(SysUserDepartsVO sysUserDepartsVO) {
-		LambdaQueryWrapper<SysUserDepart> query = new LambdaQueryWrapper<>();
-		if(sysUserDepartsVO != null) {
-			String userId = sysUserDepartsVO.getUserId();
-			List<String> departIdList = sysUserDepartsVO.getDepartIdList();
-			if(departIdList != null && departIdList.size() > 0) {
-				for(String depId : departIdList) {
-					query.eq(SysUserDepart::getDepId, depId);
-					query.eq(SysUserDepart::getUserId, userId);
-					List<SysUserDepart> uDepList = this.list(query);
-					if(uDepList == null || uDepList.size() == 0) {
-						this.save(new SysUserDepart("",userId,depId));
-					}
-				}
-			}
-			return true;
-		}else {
-			return false;
-		}
-
-	}
-
-
-	/**
-	 * 根据用户id查询部门信息
-	 */
-	@Override
-	public List<DepartIdModel> queryDepartIdsOfUser(String userId) {
-		LambdaQueryWrapper<SysUserDepart> queryUDep = new LambdaQueryWrapper<SysUserDepart>();
-		LambdaQueryWrapper<SysDepart> queryDep = new LambdaQueryWrapper<SysDepart>();
-		try {
-			queryUDep.eq(SysUserDepart::getUserId, userId);
-			List<String> depIdList = new ArrayList<>();
-			List<DepartIdModel> depIdModelList = new ArrayList<>();
-			List<SysUserDepart> userDepList = this.list(queryUDep);
-			if(userDepList != null && userDepList.size() > 0) {
-			for(SysUserDepart userDepart : userDepList) {
-					depIdList.add(userDepart.getDepId());
-				}
-			queryDep.in(SysDepart::getId, depIdList);
-			List<SysDepart> depList = sysDepartService.list(queryDep);
-			if(depList != null || depList.size() > 0) {
-				for(SysDepart depart : depList) {
-					depIdModelList.add(new DepartIdModel().convertByUserDepart(depart));
-				}
-			}
-			return depIdModelList;
-			}
-		}catch(Exception e) {
-			e.fillInStackTrace();
-		}
-		return null;
-
-
-	}
-
-	/**
-	 * 根据用户id修改部门信息
-	 */
-	@Override
-	public boolean editSysUserWithDepart(SysUserDepartsVO sysUserDepartsVO) {
-        LambdaQueryWrapper<SysUserDepart> queryUserDepart = new LambdaQueryWrapper<SysUserDepart>();
-		List<String> depIdList = sysUserDepartsVO.getDepartIdList();
-		if(depIdList != null && depIdList.size() > 0) {
-            queryUserDepart.eq(SysUserDepart::getUserId, sysUserDepartsVO.getUserId());
-            boolean ok = this.remove(queryUserDepart);
-			if(ok) {
-				for(String str : depIdList) {
-					this.save(new SysUserDepart("", sysUserDepartsVO.getUserId(), str));
-				}
-			return ok;
-			}
-		}
-        queryUserDepart.eq(SysUserDepart::getUserId, sysUserDepartsVO.getUserId());
-        boolean ok = this.remove(queryUserDepart);
-		return ok;
-	}
-
-	/**
-	 * 根据部门id查询用户信息
-	 */
-	@Override
-	public List<SysUser> queryUserByDepId(String depId) {
-        LambdaQueryWrapper<SysUserDepart> queryUserDepart = new LambdaQueryWrapper<>();
-        queryUserDepart.eq(SysUserDepart::getDepId, depId);
-		List<String> userIdList = new ArrayList<>();
-        List<SysUserDepart> uDepList = this.list(queryUserDepart);
-		if(uDepList != null && uDepList.size() > 0) {
-			for(SysUserDepart uDep : uDepList) {
-				userIdList.add(uDep.getUserId());
-			}
-			List<SysUser> userList = (List<SysUser>) sysUserService.listByIds(userIdList);
-			//update-begin-author:taoyan date:201905047 for:接口调用查询返回结果不能返回密码相关信息
-			for (SysUser sysUser : userList) {
-				sysUser.setSalt("");
-				sysUser.setPassword("");
-			}
-			//update-end-author:taoyan date:201905047 for:接口调用查询返回结果不能返回密码相关信息
-			return userList;
-		}
-		return new ArrayList<SysUser>();
-	}
-
-	/**
-	 * 根据部门code,查询当前部门和下级部门的 用户信息
-	 */
-	@Override
-	public List<SysUser> queryUserByDepCode(String depCode, String realname) {
-		LambdaQueryWrapper<SysDepart> queryByDepCode = new LambdaQueryWrapper<SysDepart>();
-		queryByDepCode.likeRight(SysDepart::getOrgCode,depCode);
-		List<SysDepart> sysDepartList = sysDepartService.list(queryByDepCode);
-		List<String> depIds = sysDepartList.stream().map(SysDepart::getId).collect(Collectors.toList());
-
-		LambdaQueryWrapper<SysUserDepart> queryUDep = new LambdaQueryWrapper<SysUserDepart>();
-		queryUDep.in(SysUserDepart::getDepId, depIds);
-		List<String> userIdList = new ArrayList<>();
-		List<SysUserDepart> uDepList = this.list(queryUDep);
-		if(uDepList != null && uDepList.size() > 0) {
-			for(SysUserDepart uDep : uDepList) {
-				userIdList.add(uDep.getUserId());
-			}
-			LambdaQueryWrapper<SysUser> queryUser = new LambdaQueryWrapper<SysUser>();
-			queryUser.in(SysUser::getId,userIdList);
-			if(oConvertUtils.isNotEmpty(realname)){
-				queryUser.like(SysUser::getRealname,realname.trim());
-			}
-			List<SysUser> userList = (List<SysUser>) sysUserService.list(queryUser);
-			//update-begin-author:taoyan date:201905047 for:接口调用查询返回结果不能返回密码相关信息
-			for (SysUser sysUser : userList) {
-				sysUser.setSalt("");
-				sysUser.setPassword("");
-			}
-			//update-end-author:taoyan date:201905047 for:接口调用查询返回结果不能返回密码相关信息
-			return userList;
-		}
-		return new ArrayList<SysUser>();
-	}
-
-}

+ 0 - 548
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java

@@ -1,548 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.*;
-import cn.com.ctop.common.module.mapper.*;
-import cn.com.ctop.common.module.model.SysUserSysDepartModel;
-import cn.com.ctop.common.module.service.ISysBaseApi;
-import cn.com.ctop.common.module.service.ISysUserService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.vo.SysUserDepVo;
-import cn.com.ctop.common.module.vo.SysUserVo;
-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.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.constant.CacheConstant;
-import org.jeecg.common.constant.CommonConstant;
-import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.common.system.vo.SysUserCacheInfo;
-import org.jeecg.common.util.PasswordUtil;
-import org.jeecg.common.util.UUIDGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 用户表 服务实现类
- * </p>
- *
- * @Author: scott
- * @Date: 2018-12-20
- */
-@Service
-@Slf4j
-public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
-
-    @Resource
-    private SysUserMapper userMapper;
-    @Resource
-    private SysPermissionMapper sysPermissionMapper;
-    @Resource
-    private SysUserRoleMapper sysUserRoleMapper;
-    @Resource
-    private SysUserDepartMapper sysUserDepartMapper;
-    @Autowired
-    private ISysBaseApi sysBaseApi;
-    @Resource
-    private SysDepartMapper sysDepartMapper;
-    @Resource
-    private SysRoleMapper sysRoleMapper;
-    @Resource
-    private SysDepartRoleUserMapper departRoleUserMapper;
-    @Resource
-    private SysDepartRoleMapper sysDepartRoleMapper;
-
-    @Override
-    public Map<String, Object> queryRoleCode(String userId) {
-        return userMapper.queryRoleCode(userId);
-    }
-
-    @Override
-    public List<SysUserVo> getUserListByCompany(String companyId, String userName) {
-        return userMapper.getUserListByCompany(companyId, userName);
-    }
-
-    @Override
-    public List<SysUser> getUserListByRoleId(String roleId) {
-        Page<SysUser> page = new Page<>();
-        page.setSize(10000);
-        IPage<SysUser> userPage = this.getUserByRoleId(page, roleId, null);
-        return userPage.getRecords();
-    }
-
-    @Override
-    public List<SysUserVo> getAllSales() {
-        return userMapper.getAllSale();
-    }
-
-    @Override
-    public List<SysUserVo> getAllSalesByCompanyId(String companyId) {
-        return userMapper.getAllSalesByCompanyId(companyId);
-
-    }
-
-    @Override
-    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
-    public Result<?> resetPassword(String username, String oldpassword, String newpassword, String confirmpassword) {
-        SysUser user = userMapper.getUserByName(username);
-        String passwordEncode = PasswordUtil.encrypt(username, oldpassword, user.getSalt());
-        if (!user.getPassword().equals(passwordEncode)) {
-            return Result.error("旧密码输入错误!");
-        }
-        if (oConvertUtils.isEmpty(newpassword)) {
-            return Result.error("新密码不允许为空!");
-        }
-        if (!newpassword.equals(confirmpassword)) {
-            return Result.error("两次输入密码不一致!");
-        }
-        String password = PasswordUtil.encrypt(username, newpassword, user.getSalt());
-        this.userMapper.update(new SysUser().setPassword(password), new LambdaQueryWrapper<SysUser>().eq(SysUser::getId, user.getId()));
-        return Result.ok("密码重置成功!");
-    }
-
-    @Override
-    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
-    public Result<?> changePassword(SysUser sysUser) {
-        String salt = oConvertUtils.randomGen(8);
-        sysUser.setSalt(salt);
-        String password = sysUser.getPassword();
-        String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt);
-        sysUser.setPassword(passwordEncode);
-        this.userMapper.updateById(sysUser);
-        return Result.ok("密码修改成功!");
-    }
-
-    @Override
-    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
-    @Transactional(rollbackFor = Exception.class)
-    public boolean deleteUser(String userId) {
-        //1.删除用户
-        this.removeById(userId);
-        return false;
-    }
-
-    @Override
-    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
-    @Transactional(rollbackFor = Exception.class)
-    public boolean deleteBatchUsers(String userIds) {
-        //1.删除用户
-        this.removeByIds(Arrays.asList(userIds.split(",")));
-        return false;
-    }
-
-    @Override
-    public SysUser getUserByName(String username) {
-        return userMapper.getUserByName(username);
-    }
-
-    @Override
-    public SysUser getUserByRealName(String username) {
-        return userMapper.getUserByRealName(username);
-    }
-
-    @Override
-    @Transactional
-    public void addUserWithRole(SysUser user, String roles) {
-        this.save(user);
-        if (oConvertUtils.isNotEmpty(roles)) {
-            String[] arr = roles.split(",");
-            for (String roleId : arr) {
-                SysUserRole userRole = new SysUserRole(user.getId(), roleId);
-                sysUserRoleMapper.insert(userRole);
-            }
-        }
-    }
-
-    @Override
-    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
-    @Transactional
-    public void editUserWithRole(SysUser user, String roles) {
-        this.updateById(user);
-        //先删后加
-        sysUserRoleMapper.delete(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, user.getId()));
-        if (oConvertUtils.isNotEmpty(roles)) {
-            String[] arr = roles.split(",");
-            for (String roleId : arr) {
-                SysUserRole userRole = new SysUserRole(user.getId(), roleId);
-                sysUserRoleMapper.insert(userRole);
-            }
-        }
-    }
-
-
-    @Override
-    public List<String> getRole(String username) {
-        return sysUserRoleMapper.getRoleByUserName(username);
-    }
-
-    /**
-     * 通过用户名获取用户角色集合
-     *
-     * @param username 用户名
-     * @return 角色集合
-     */
-    @Override
-    public Set<String> getUserRolesSet(String username) {
-        // 查询用户拥有的角色集合
-        List<String> roles = sysUserRoleMapper.getRoleByUserName(username);
-        log.info("-------通过数据库读取用户拥有的角色Rules------username: " + username + ",Roles size: " + (roles == null ? 0 : roles.size()));
-        return new HashSet<>(roles);
-    }
-
-    /**
-     * 通过用户名获取用户权限集合
-     *
-     * @param username 用户名
-     * @return 权限集合
-     */
-    @Override
-    public Set<String> getUserPermissionsSet(String username) {
-        Set<String> permissionSet = new HashSet<>();
-        List<SysPermission> permissionList = sysPermissionMapper.queryByUser(username);
-        for (SysPermission po : permissionList) {
-//			// TODO URL规则有问题?
-//			if (oConvertUtils.isNotEmpty(po.getUrl())) {
-//				permissionSet.add(po.getUrl());
-//			}
-            if (oConvertUtils.isNotEmpty(po.getPerms())) {
-                permissionSet.add(po.getPerms());
-            }
-        }
-        log.info("-------通过数据库读取用户拥有的权限Perms------username: " + username + ",Perms size: " + (permissionSet == null ? 0 : permissionSet.size()));
-        return permissionSet;
-    }
-
-    @Override
-    public SysUserCacheInfo getCacheUser(String username) {
-        SysUserCacheInfo info = new SysUserCacheInfo();
-        info.setOneDepart(true);
-//		SysUser user = userMapper.getUserByName(username);
-//		info.setSysUserCode(user.getUsername());
-//		info.setSysUserName(user.getRealname());
-
-
-        LoginUser user = sysBaseApi.getUserByName(username);
-        if (user != null) {
-            info.setSysUserCode(user.getUsername());
-            info.setSysUserName(user.getRealname());
-            info.setSysOrgCode(user.getOrgCode());
-        }
-
-        //多部门支持in查询
-        List<SysDepart> list = sysDepartMapper.queryUserDeparts(user.getId());
-        List<String> sysMultiOrgCode = new ArrayList<String>();
-        if (list == null || list.size() == 0) {
-            //当前用户无部门
-            //sysMultiOrgCode.add("0");
-        } else if (list.size() == 1) {
-            sysMultiOrgCode.add(list.get(0).getOrgCode());
-        } else {
-            info.setOneDepart(false);
-            for (SysDepart dpt : list) {
-                sysMultiOrgCode.add(dpt.getOrgCode());
-            }
-        }
-        info.setSysMultiOrgCode(sysMultiOrgCode);
-
-        return info;
-    }
-
-    // 根据部门Id查询
-    @Override
-    public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username) {
-        return userMapper.getUserByDepId(page, departId, username);
-    }
-
-    @Override
-    public IPage<SysUser> getUserByDepIds(Page<SysUser> page, List<String> departIds, String username) {
-        return userMapper.getUserByDepIds(page, departIds, username);
-    }
-
-    @Override
-    public List<SysUserVo> getAllUser(String userName, String status) {
-        return userMapper.getAllUser(userName, status);
-    }
-
-    @Override
-    public List<SysUser> getAllDesigner() {
-        return userMapper.selectAllDesigner();
-    }
-
-    @Override
-    public SysUser getDesignerTeamLeaderBy(String orgCode) {
-        return userMapper.getDesignerTeamLeaderBy(orgCode);
-    }
-
-    @Override
-    public List<SysUser> queryPageList(SysUser user) {
-        return userMapper.queryPageList(user);
-    }
-
-    @Override
-    public Map<String, String> getUserMapByMap(Map<String, String> userIdMap) {
-
-        Map<String, String> userMap = new HashMap<>();
-        if (!Check.isNullMap(userIdMap)) {
-            List<JSONObject> userList = userMapper.getUserMapByMap(userIdMap);
-            if (!Check.isNull(userList)) {
-                for (int i = 0; i < userList.size(); i++) {
-                    JSONObject userJson = userList.get(i);
-                    userMap.put(userJson.getString("id"), userJson.getString("realname"));
-                }
-            }
-        }
-
-        return userMap;
-    }
-
-    @Override
-    public String getRoleCodeByUserId(String userId) {
-        return sysRoleMapper.getRoleCodeByUserId(userId);
-    }
-
-
-    @Override
-    public Map<String, String> getDepNamesByUserIds(List<String> userIds) {
-        List<SysUserDepVo> list = this.baseMapper.getDepNamesByUserIds(userIds);
-        Map<String, String> res = new HashMap<String, String>();
-        list.forEach(item -> {
-                    if (res.get(item.getUserId()) == null) {
-                        res.put(item.getUserId(), item.getDepartName());
-                    } else {
-                        res.put(item.getUserId(), res.get(item.getUserId()) + "," + item.getDepartName());
-                    }
-                }
-        );
-        return res;
-    }
-
-    @Override
-    public IPage<SysUser> getUserByDepartIdAndQueryWrapper(Page<SysUser> page, String departId, QueryWrapper<SysUser> queryWrapper) {
-        LambdaQueryWrapper<SysUser> lambdaQueryWrapper = queryWrapper.lambda();
-
-        lambdaQueryWrapper.eq(SysUser::getDelFlag, "0");
-        lambdaQueryWrapper.inSql(SysUser::getId, "SELECT user_id FROM sys_user_depart WHERE dep_id = '" + departId + "'");
-
-        return userMapper.selectPage(page, lambdaQueryWrapper);
-    }
-
-    @Override
-    public IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page) {
-        List<SysUserSysDepartModel> list = baseMapper.getUserByOrgCode(page, orgCode, userParams);
-        Integer total = baseMapper.getUserByOrgCodeTotal(orgCode, userParams);
-
-        IPage<SysUserSysDepartModel> result = new Page<>(page.getCurrent(), page.getSize(), total);
-        result.setRecords(list);
-
-        return result;
-    }
-
-    // 根据角色Id查询
-    @Override
-    public IPage<SysUser> getUserByRoleId(Page<SysUser> page, String roleId, String username) {
-        return userMapper.getUserByRoleId(page, roleId, username);
-    }
-
-
-    @Override
-    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, key = "#username")
-    public void updateUserDepart(String username, String orgCode) {
-        baseMapper.updateUserDepart(username, orgCode);
-    }
-
-
-    @Override
-    public SysUser getUserByPhone(String phone) {
-        return userMapper.getUserByPhone(phone);
-    }
-
-
-    @Override
-    public SysUser getUserByEmail(String email) {
-        return userMapper.getUserByEmail(email);
-    }
-
-    @Override
-    @Transactional
-    public void addUserWithDepart(SysUser user, String selectedParts) {
-//		this.save(user);  //保存角色的时候已经添加过一次了
-        if (oConvertUtils.isNotEmpty(selectedParts)) {
-            LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-            String[] arr = selectedParts.split(",");
-            for (String deaprtId : arr) {
-                SysUserDepart userDeaprt = new SysUserDepart(user.getId(), deaprtId);
-                userDeaprt.setCreateUserId(loginUser.getId());
-                userDeaprt.setCreateTime(new Date());//添加创建时间 和 创建人id
-                sysUserDepartMapper.insert(userDeaprt);
-            }
-        }
-    }
-
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
-    public void editUserWithDepart(SysUser user, String departs) {
-        this.updateById(user);  //更新角色的时候已经更新了一次了,可以再跟新一次
-        String[] arr = {};
-        if (oConvertUtils.isNotEmpty(departs)) {
-            arr = departs.split(",");
-        }
-        //查询已关联部门
-        List<SysUserDepart> userDepartList = sysUserDepartMapper.selectList(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
-        if (userDepartList != null && userDepartList.size() > 0) {
-            for (SysUserDepart depart : userDepartList) {
-                //修改已关联部门删除部门用户角色关系
-                if (!Arrays.asList(arr).contains(depart.getDepId())) {
-                    List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(
-                            new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId, depart.getDepId()));
-                    List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
-                    if (roleIds != null && roleIds.size() > 0) {
-                        departRoleUserMapper.delete(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, user.getId())
-                                .in(SysDepartRoleUser::getDroleId, roleIds));
-                    }
-                }
-            }
-        }
-        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        //先删后加
-        sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
-        if (oConvertUtils.isNotEmpty(departs)) {
-            for (String departId : arr) {
-                SysUserDepart userDepart = new SysUserDepart(user.getId(), departId);
-                userDepart.setCreateUserId(loginUser.getId());
-                userDepart.setCreateTime(new Date());
-                sysUserDepartMapper.insert(userDepart);
-            }
-        }
-    }
-
-
-    /**
-     * 校验用户是否有效
-     *
-     * @param sysUser
-     * @return
-     */
-    @Override
-    public Result<?> checkUserIsEffective(SysUser sysUser) {
-        Result<?> result = new Result<Object>();
-        //情况1:根据用户信息查询,该用户不存在
-        if (sysUser == null) {
-            result.error500("该用户不存在,请注册");
-            sysBaseApi.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
-            return result;
-        }
-        //情况2:根据用户信息查询,该用户已注销
-        if (CommonConstant.DEL_FLAG_1.toString().equals(sysUser.getDelFlag())) {
-            sysBaseApi.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null);
-            result.error500("该用户已注销");
-            return result;
-        }
-        //情况3:根据用户信息查询,该用户已冻结
-        if (CommonConstant.USER_FREEZE.equals(sysUser.getStatus())) {
-            sysBaseApi.addLog("用户登录失败,用户名:" + sysUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null);
-            result.error500("该用户已冻结");
-            return result;
-        }
-        return result;
-    }
-
-    @Override
-    public List<SysUser> queryLogicDeleted() {
-        return this.queryLogicDeleted(null);
-    }
-
-    @Override
-    public List<SysUser> queryLogicDeleted(LambdaQueryWrapper<SysUser> wrapper) {
-        if (wrapper == null) {
-            wrapper = new LambdaQueryWrapper<>();
-        }
-        wrapper.eq(SysUser::getDelFlag, "1");
-        return userMapper.selectLogicDeleted(wrapper);
-    }
-
-    @Override
-    public boolean revertLogicDeleted(List<String> userIds, SysUser updateEntity) {
-        String ids = String.format("'%s'", String.join("','", userIds));
-        return userMapper.revertLogicDeleted(ids, updateEntity) > 0;
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public boolean removeLogicDeleted(List<String> userIds) {
-        String ids = String.format("'%s'", String.join("','", userIds));
-        // 1. 删除用户
-        int line = userMapper.deleteLogicDeleted(ids);
-        // 2. 删除用户部门关系
-        line += sysUserDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getUserId, userIds));
-        //3. 删除用户角色关系
-        line += sysUserRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getUserId, userIds));
-        return line != 0;
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public boolean updateNullPhoneEmail() {
-        userMapper.updateNullByEmptyString("email");
-        userMapper.updateNullByEmptyString("phone");
-        return true;
-    }
-
-    @Override
-    public void saveThirdUser(SysUser sysUser) {
-        //保存用户
-        String userid = UUIDGenerator.generate();
-        sysUser.setId(userid);
-        baseMapper.insert(sysUser);
-        //获取第三方角色
-        SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "third_role"));
-        //保存用户角色
-        SysUserRole userRole = new SysUserRole();
-        userRole.setRoleId(sysRole.getId());
-        userRole.setUserId(userid);
-        sysUserRoleMapper.insert(userRole);
-    }
-
-    @Override
-    public List<SysUser> queryByDepIds(List<String> departIds, String username) {
-        return userMapper.queryByDepIds(departIds, username);
-    }
-
-
-    /**
-     *
-     * @description: 修改用户 设计组长姓名
-     *用户 分配角色 为 设计组长  用户设计组长姓名 为自己真实姓名
-     * @param userId 用户id
-     * @param userName 设计组长姓名
-     * @param roleId 角色id
-     * @return: java.lang.Integer
-     * @author: zianY
-     */
-    @Override
-    public Integer updUserDesignLeaderById(String userId,String userName,String roleId) {
-        String designTeamLeaderName = "";
-        if (!Check.isNull(roleId)){
-            SysRole sysRole = sysRoleMapper.selectById(roleId);
-            if ("designTeamLeader".equals(sysRole.getRoleCode())){
-                designTeamLeaderName = userName;
-            }
-        }
-       return userMapper.updUserDesignLeaderById(userId,designTeamLeaderName);
-    }
-
-
-}

+ 0 - 113
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/service/impl/UserCompanyServiceImpl.java

@@ -1,113 +0,0 @@
-package cn.com.ctop.common.module.service.impl;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.entity.SysUserDepart;
-import cn.com.ctop.common.module.entity.UserCompany;
-import cn.com.ctop.common.module.mapper.SysDepartMapper;
-import cn.com.ctop.common.module.mapper.SysUserDepartMapper;
-import cn.com.ctop.common.module.mapper.UserCompanyMapper;
-import cn.com.ctop.common.module.service.IUserCompanyService;
-import cn.com.ctop.common.module.utils.Check;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.api.vo.Result;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 用户够公司
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-11-14
- */
-@Slf4j
-@Service
-public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserCompany> implements IUserCompanyService {
-    @Resource
-    private SysUserDepartMapper userDepartMapper;
-    @Resource
-    private SysDepartMapper departMapper;
-    @Resource
-    private UserCompanyMapper userCompanyMapper;
-
-    @Override
-    public void addOrUpdateUserWithCompany(SysUser user) {
-        SysUserDepart userDepart = userDepartMapper.getUserDepartByUserId(user.getId());
-        if (!Check.isNull(userDepart)) {
-            String depId = userDepart.getDepId();
-            for (int i = 0; i <= 10; i++) {
-                SysDepart depart = departMapper.queryUserDepartsByDepartId(depId);
-                if (Check.isNull(depart)) {
-                    break;
-                }
-                if (!"1".equals(depart.getOrgType())) {
-                    depId = depart.getParentId();
-                    continue;
-                } else {
-                    UserCompany userCompany = new UserCompany();
-                    userCompany.setUserId(user.getId());
-                    userCompany.setUserName(user.getRealname());
-                    userCompany.setCompanyId(depart.getId());
-                    userCompany.setCompanyName(depart.getDepartName());
-                    QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper();
-                    userCompanyQueryWrapper.eq("user_id", user.getId());
-                    userCompanyQueryWrapper.last("limit 1");
-                    UserCompany addUserCompany = userCompanyMapper.selectOne(userCompanyQueryWrapper);
-                    int j;
-                    if (Check.isNull(addUserCompany)) {
-                        userCompany.setCreateTime(new Date());
-                        userCompany.setUpdateTime(new Date());
-                        j = userCompanyMapper.insert(userCompany);
-                    } else {
-                        QueryWrapper<UserCompany> updateUserCompanyQueryWrapper = new QueryWrapper();
-                        updateUserCompanyQueryWrapper.eq("user_id", user.getId());
-                        userCompany.setUpdateTime(new Date());
-                        j = userCompanyMapper.update(userCompany, updateUserCompanyQueryWrapper);
-                    }
-
-                    if (j > 0) {
-                        log.info("同步用户公司信息完成,userId:{}", user.getId());
-                    }
-                    break;
-                }
-            }
-
-        }
-    }
-
-    /**
-     * 删除公司信息
-     *
-     * @param
-     */
-    @Override
-    public void removeByUserId(String userId) {
-        Map<String, Object> deleteMap = new HashMap<>();
-        deleteMap.put("user_id", userId);
-        userCompanyMapper.deleteByMap(deleteMap);
-
-    }
-
-    @Override
-    public UserCompany getByUserId(String userId) {
-        QueryWrapper<UserCompany> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("user_id", userId);
-        queryWrapper.last("limit 1");
-        return null;
-    }
-
-    @Override
-    public Result<Object> allCompany() {
-        List<JSONObject> data = userCompanyMapper.allCompany();
-        return Result.ok(data);
-    }
-}

+ 0 - 309
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/CloudVideoProcessUtil.java

@@ -1,309 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import cn.com.ctop.common.module.constant.CosConstant;
-import cn.hutool.core.map.MapUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.qcloud.cos.auth.BasicCOSCredentials;
-import com.qcloud.cos.auth.COSCredentials;
-import com.qcloud.cos.auth.COSSigner;
-import com.qcloud.cos.http.HttpMethodName;
-import com.tencentcloudapi.common.Credential;
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
-import com.tencentcloudapi.common.profile.ClientProfile;
-import com.tencentcloudapi.common.profile.HttpProfile;
-import com.tencentcloudapi.mps.v20190612.MpsClient;
-import com.tencentcloudapi.mps.v20190612.models.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.MediaType;
-import org.springframework.web.client.RestClientException;
-import org.springframework.web.client.RestTemplate;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * Created by JQ.bi on 2020.6.28
- */
-@Configuration
-@PropertySource("classpath:config.properties")
-public class CloudVideoProcessUtil {
-
-    private static RestTemplate restTemplate = new RestTemplate();
-
-    private static Logger logger = LoggerFactory.getLogger(CloudVideoProcessUtil.class);
-
-    private static final String SECRET_ID = "AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets";
-    private static final String SECRET_KEY = "tXzuwMfplTTK3c9GFUyETilasvQfePu9";
-    private static final String ENDPOINT = "mps.tencentcloudapi.com";
-    private static final String COS_LOCATION = "ap-chongqing";
-    private static final String COS_BUCKET_MEDIA = "media-1301855440";
-    private static final String COS_BUCKET_PART = "part-1301855440";
-
-
-    public static DescribeTaskDetailResponse getTaskDetailResponse(String taskId) {
-        MpsClient client = getClient();
-        DescribeTaskDetailRequest describeTaskDetailRequest = new DescribeTaskDetailRequest();
-        describeTaskDetailRequest.setTaskId(taskId);
-        DescribeTaskDetailResponse resp = null;
-        try {
-            resp = client.DescribeTaskDetail(describeTaskDetailRequest);
-        } catch (TencentCloudSDKException e) {
-            e.printStackTrace();
-        }
-        return resp;
-    }
-
-    /**
-     * 发起视频水印处理请求
-     */
-    public static String videoWatermarkHandle(String videoPath, Long watermarkTemplateId) {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        MpsClient client = getClient();
-        //发起视频处理请求
-        ProcessMediaRequest request = new ProcessMediaRequest();
-        TranscodeTaskInput transcodeTaskInput = new TranscodeTaskInput();
-        transcodeTaskInput.setOutputObjectPath("/watermark/" + sdf.format(new Date()) + "/" + UUID.randomUUID() + ".mp4");
-        //水印模板信息
-        WatermarkInput watermarkInput = new WatermarkInput();
-        watermarkInput.setDefinition(watermarkTemplateId);
-        //指定视频转码模板
-        transcodeTaskInput.setDefinition(30L);
-        transcodeTaskInput.setWatermarkSet(new WatermarkInput[]{watermarkInput});
-        MediaProcessTaskInput mediaProcessTaskInput = new MediaProcessTaskInput();
-        mediaProcessTaskInput.setTranscodeTaskSet(new TranscodeTaskInput[]{transcodeTaskInput});
-        request.setMediaProcessTask(mediaProcessTaskInput);
-        //视频输入
-        CosInputInfo cosInputInfo = new CosInputInfo();
-        cosInputInfo.setRegion(COS_LOCATION);
-        cosInputInfo.setBucket(COS_BUCKET_MEDIA);
-        cosInputInfo.setObject("/" + videoPath);
-        MediaInputInfo mediaInputInfo = new MediaInputInfo();
-        mediaInputInfo.setType("COS");
-        mediaInputInfo.setCosInputInfo(cosInputInfo);
-        request.setInputInfo(mediaInputInfo);
-        //加水印视频输出
-        CosOutputStorage cosOutputStorage = new CosOutputStorage();
-        cosOutputStorage.setBucket(COS_BUCKET_MEDIA);
-        cosOutputStorage.setRegion(COS_LOCATION);
-        TaskOutputStorage taskOutputStorage = new TaskOutputStorage();
-        taskOutputStorage.setType("COS");
-        taskOutputStorage.setCosOutputStorage(cosOutputStorage);
-        request.setOutputStorage(taskOutputStorage);
-        ProcessMediaResponse response = null;
-        String taskId = "";
-        try {
-            response = client.ProcessMedia(request);
-        } catch (TencentCloudSDKException e) {
-            logger.error(e.getMessage());
-        }
-        if (null != response) {
-            taskId = response.getTaskId();
-        }
-        return taskId;
-    }
-
-    /**
-     * 查询数据万象任务状态
-     *
-     * @return
-     */
-    public static Map getMediaJobsResponse(String jobId) {
-        String auth = generateAuth(SECRET_ID, SECRET_KEY, "/jobs/" + jobId, HttpMethodName.GET);
-        if (auth.isEmpty()) {
-            logger.error("腾讯云Authorization获取失败");
-        }
-        //请求media-1301855440.ci.ap-chongqing.myqcloud.com/jobs/jobId 接口
-        HttpHeaders headers = new HttpHeaders();
-        headers.set("Authorization", auth);
-        HttpEntity<String> requestEntity = new HttpEntity<>(headers);
-        String response = null;
-        try {
-            response = restTemplate.exchange(CosConstant.URL_JOBS + "/" + jobId, HttpMethod.GET, requestEntity, String.class).getBody();
-        } catch (RestClientException e) {
-            logger.error(e.getMessage());
-        }
-        Map<String, Object> mapResp = XmlToMapUtil.multilayerXmlToMap(response);
-        Map JobsDetail = (Map) ((Map) mapResp.get("Response")).get("JobsDetail");
-        if ("Success".equals(JobsDetail.get("Code"))) {
-            return JobsDetail;
-        } else {
-            return MapUtil.newHashMap();
-        }
-    }
-
-    public static void main(String[] args) {
-        String loadImage = "cutFrame/" + 12345 + "/${Number}.jpg";
-        Map<String, Object> stringObjectMap = videoCutFrameHandle("/video/2020-07-22/1595381635927-JX.美白丸混剪.mp4", loadImage);
-        System.err.println(stringObjectMap);
-    }
-
-    /**
-     * 数据万象发起视频抽帧处理请求
-     */
-    public static Map<String, Object> videoCutFrameHandle(String videoPath, String outputPath) {
-        Map<String, Object> result = new HashMap<>();
-        String auth = generateAuth(SECRET_ID, SECRET_KEY, "/jobs", HttpMethodName.POST);
-        if (auth.isEmpty()) {
-            logger.error("腾讯云Authorization获取失败");
-        }
-        //拼接请求数据万象jobs接口的参数
-        JSONObject input = new JSONObject();
-        input.put("Object", videoPath);
-        JSONObject output = new JSONObject();
-        output.put("Region", COS_LOCATION);
-        output.put("Bucket", COS_BUCKET_MEDIA);
-        output.put("Object", outputPath);
-        JSONObject operation = new JSONObject();
-        operation.put("TemplateId", CosConstant.TEMPLATE_ID);
-        operation.put("Output", output);
-        JSONObject request = new JSONObject();
-        request.put("Tag", "Snapshot");
-        request.put("Input", input);
-        request.put("Operation", operation);
-        request.put("QueueId", CosConstant.QUEUE_ID);
-
-        //请求media-1301855440.ci.ap-chongqing.myqcloud.com/jobs 接口
-        HttpHeaders headers = new HttpHeaders();
-        headers.set("Authorization", auth);
-        headers.setContentType(MediaType.APPLICATION_JSON);
-        HttpEntity<String> requestEntity = new HttpEntity<>(request.toJSONString(), headers);
-        String response = null;
-        try {
-            response = restTemplate.exchange(CosConstant.URL_JOBS, HttpMethod.POST, requestEntity, String.class).getBody();
-        } catch (RestClientException e) {
-            logger.error(e.getMessage());
-        }
-        Map<String, Object> mapResp = XmlToMapUtil.multilayerXmlToMap(response);
-        Map JobsDetail = (Map) ((Map) mapResp.get("Response")).get("JobsDetail");
-        if ("Success".equals(JobsDetail.get("Code"))) {
-            Map jobStatusMap = null;
-            for (int i = 0; i < 30; i++) {
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    logger.error(e.getMessage());
-                }
-                jobStatusMap = getMediaJobsResponse(JobsDetail.get("JobId").toString());
-                if ("Success".equals(jobStatusMap.get("State"))) {
-                    break;
-                }
-            }
-            if ("Success".equals(jobStatusMap.get("State"))) {
-                result = getFrameUrl(outputPath);
-            } else {
-                result = getErrorUrl();
-            }
-        }
-        return result;
-    }
-
-    /**
-     * 数据万象获取截图服务
-     */
-    public static String videoCutPictureHandle(String videoPath, String outputPath) {
-        String auth = generateAuth(SECRET_ID, SECRET_KEY, "/snapshot", HttpMethodName.POST);
-        if (auth.isEmpty()) {
-            logger.error("腾讯云Authorization获取失败");
-        }
-        //拼接请求数据万象jobs接口的参数
-        JSONObject input = new JSONObject();
-        input.put("Object", videoPath);
-        JSONObject output = new JSONObject();
-        output.put("Region", COS_LOCATION);
-        output.put("Bucket", COS_BUCKET_MEDIA);
-        output.put("Object", outputPath);
-        JSONObject request = new JSONObject();
-        request.put("Input", input);
-        request.put("Output", output);
-        request.put("Time", 0);
-
-        //请求media-1301855440.ci.ap-chongqing.myqcloud.com/snapshot 接口
-        HttpHeaders headers = new HttpHeaders();
-        headers.set("Authorization", auth);
-        headers.setContentType(MediaType.APPLICATION_JSON);
-        HttpEntity<String> requestEntity = new HttpEntity<>(request.toJSONString(), headers);
-        String response = null;
-        try {
-            response = restTemplate.exchange(CosConstant.URL_SNAPSHOT, HttpMethod.POST, requestEntity, String.class).getBody();
-        } catch (RestClientException e) {
-            logger.error(e.getMessage());
-        }
-        if (response.isEmpty()) {
-            return CosConstant.URL_COS_ADDRESS + "error.jpg";
-        } else {
-            return CosConstant.URL_COS_ADDRESS + outputPath;
-        }
-    }
-
-    /**
-     * 获取视频处理服务 MpsClient
-     */
-    private static MpsClient getClient() {
-        MpsClient mpsClient = null;
-        try {
-            Credential cred = new Credential(SECRET_ID, SECRET_KEY);
-            HttpProfile httpProfile = new HttpProfile();
-            httpProfile.setEndpoint(ENDPOINT);
-            ClientProfile clientProfile = new ClientProfile();
-            clientProfile.setHttpProfile(httpProfile);
-            mpsClient = new MpsClient(cred, COS_LOCATION, clientProfile);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage());
-        }
-        return mpsClient;
-    }
-
-    /**
-     * 获取数据万象认证Auth
-     *
-     * @param secretId
-     * @param secretKey
-     * @param path
-     * @param httpMethodName
-     * @return
-     */
-    public static String generateAuth(String secretId, String secretKey, String path, HttpMethodName httpMethodName) {
-        COSCredentials cred = new BasicCOSCredentials(secretId, secretKey);
-        COSSigner signer = new COSSigner();
-        //设置过期时间为1个小时
-        Date expiredTime = new Date(System.currentTimeMillis() + 3600L * 1000L);
-        //授权的签名
-        return signer.buildAuthorizationStr(
-                httpMethodName,
-                path,
-                cred,
-                expiredTime
-        );
-    }
-
-    public static Map<String,Object> supplementFrameUrl(String videoMD5){
-        Map<String, Object> result = new HashMap<>();
-        for (int i = 0; i <= 13; i++) {
-            result.put("" + i + "", CosConstant.URL_COS_ADDRESS+"cutFrame/"+videoMD5+"/"+i+".jpg");
-        }
-        return result;
-    }
-
-    private static Map<String, Object> getFrameUrl(String outputPath) {
-        Map<String, Object> result = new HashMap<>();
-        for (int i = 0; i <= 13; i++) {
-            result.put("" + i + "", CosConstant.URL_COS_ADDRESS + outputPath.replace("${Number}", "" + i + ""));
-        }
-        return result;
-    }
-
-    private static Map<String, Object> getErrorUrl() {
-        Map<String, Object> result = new HashMap<>();
-        result.put("0", CosConstant.URL_COS_ADDRESS + "error.jpg");
-        return result;
-    }
-}

+ 0 - 794
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/ConverterUtils.java

@@ -1,794 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.text.NumberFormat;
-import java.text.ParseException;
-
-/**
- * A simple object converter
- * <br>
- * 一个简单的数据类型转换工具类
- */
-public class ConverterUtils {
-
-    public static void main(String[] args) {
-        Long asLong = ConverterUtils.getAsLong("12121.3444");
-        System.err.println(asLong);
-    }
-
-
-    /**
-     * Gets a String from a Object in a null-safe manner.
-     * <p>
-     * The String is obtained via <code>toString</code>.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a String, <code>null</code> if null object input
-     */
-    public static String getAsString(final Object obj) {
-        if (obj != null) {
-            return obj.toString();
-        }
-        return null;
-    }
-
-    /**
-     * Gets a String from a Object in a null-safe manner.
-     * <p>
-     * The String is obtained via <code>toString</code>.
-     *
-     * @param obj          the object to use
-     * @param defaultValue what to return if the value is null or if the conversion fails
-     * @return the value of the Object as a String, <code>defaultValue</code> if null object input
-     */
-    public static String getAsString(final Object obj, final String defaultValue) {
-        String answer = getAsString(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a Number from a Object in a null-safe manner.
-     * <p>
-     * If the value is a <code>Number</code> it is returned directly.
-     * If the value is a <code>String</code> it is converted using
-     * {@link NumberFormat#parse(String)} on the system default formatter
-     * returning <code>null</code> if the conversion fails.
-     * Otherwise, <code>null</code> is returned.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Number, <code>null</code> if null object input
-     */
-    public static Number getAsNumber(final Object obj) {
-        if (obj != null) {
-            if (obj instanceof Number) {
-                return (Number) obj;
-            } else if (obj instanceof Boolean) {
-                return ((Boolean) obj) ? 1 : 0;
-            } else if (obj instanceof String) {
-                try {
-                    return NumberFormat.getInstance().parse((String) obj);
-                } catch (final ParseException e) {
-                    throw new NumberFormatException("For input string: \"" + obj + "\"");
-                }
-            } else {
-                throw new UnsupportedOperationException();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Converting the Object into a number,
-     * using the default value if the the conversion fails.
-     *
-     * @param obj          the object to use
-     * @param defaultValue what to return if the value is null or if the conversion fails
-     * @return the value of the object as a number, or defaultValue if the
-     * original value is null, the object is null or the number conversion
-     * fails
-     */
-    @SuppressWarnings("unchecked")
-    public static <R extends Number> R getAsNumber(final Object obj, R defaultValue) {
-        Number answer = getAsNumber(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return (R) answer;
-    }
-
-    /**
-     * Gets a Boolean from a Object in a null-safe manner.
-     * <p>
-     * If the value is a <code>Boolean</code> it is returned directly.
-     * If the value is a <code>String</code> and it equals 'true' ignoring case
-     * then <code>true</code> is returned, otherwise <code>false</code>.
-     * If the value is a <code>Number</code> an integer zero value returns
-     * <code>false</code> and non-zero returns <code>true</code>.
-     * Otherwise, <code>null</code> is returned.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Boolean, <code>null</code> if null object input
-     */
-    public static Boolean getAsBoolean(final Object obj) {
-        if (obj != null) {
-            if (obj instanceof Boolean) {
-                return (Boolean) obj;
-            } else if (obj instanceof String) {
-                return Boolean.valueOf((String) obj);
-            } else if (obj instanceof Number) {
-                final Number n = (Number) obj;
-                return (n.intValue() != 0) ? Boolean.TRUE : Boolean.FALSE;
-            } else {
-                throw new UnsupportedOperationException();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Gets a Boolean from a Object in a null-safe manner.
-     * <p>
-     * If the value is a <code>Boolean</code> it is returned directly.
-     * If the value is a <code>String</code> and it equals 'true' ignoring case
-     * then <code>true</code> is returned, otherwise <code>false</code>.
-     * If the value is a <code>Number</code> an integer zero value returns
-     * <code>false</code> and non-zero returns <code>true</code>.
-     * Otherwise, <code>null</code> is returned.
-     *
-     * @param obj          the object to use
-     * @param defaultValue what to return if the value is null or if the conversion fails
-     * @return the value of the Object as a Boolean, <code>defaultValue</code> if null object input
-     */
-    public static Boolean getAsBoolean(final Object obj, final Boolean defaultValue) {
-        Boolean answer = getAsBoolean(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a boolean from a Object in a null-safe manner.
-     * <p>
-     * If the value is a <code>Boolean</code> its value is returned.
-     * If the value is a <code>String</code> and it equals 'true' ignoring case
-     * then <code>true</code> is returned, otherwise <code>false</code>.
-     * If the value is a <code>Number</code> an integer zero value returns
-     * <code>false</code> and non-zero returns <code>true</code>.
-     * Otherwise, <code>false</code> is returned.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Boolean, <code>false</code> if null object input
-     */
-    public static boolean getAsBooleanValue(final Object obj) {
-        final Boolean booleanObject = getAsBoolean(obj);
-        if (booleanObject == null) {
-            return false;
-        }
-        return booleanObject.booleanValue();
-    }
-
-    /**
-     * Gets a boolean from a Object in a null-safe manner.
-     * <p>
-     * If the value is a <code>Boolean</code> its value is returned.
-     * If the value is a <code>String</code> and it equals 'true' ignoring case
-     * then <code>true</code> is returned, otherwise <code>false</code>.
-     * If the value is a <code>Number</code> an integer zero value returns
-     * <code>false</code> and non-zero returns <code>true</code>.
-     * Otherwise, <code>false</code> is returned.
-     *
-     * @param obj          the object to use
-     * @param defaultValue what to return if the value is null or if the conversion fails
-     * @return the value in the Map as a Boolean, <code>defaultValue</code> if null object input
-     */
-    public static boolean getAsBooleanValue(final Object obj, final boolean defaultValue) {
-        final Boolean booleanObject = getAsBoolean(obj);
-        if (booleanObject == null) {
-            return defaultValue;
-        }
-        return booleanObject.booleanValue();
-    }
-
-    /**
-     * Gets a Byte from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The Byte is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of Object as a Byte, <code>null</code> if null object input
-     */
-    public static Byte getAsByte(final Object obj) {
-        final Number answer = getAsNumber(obj);
-        if (answer == null) {
-            return null;
-        } else if (answer instanceof Byte) {
-            return (Byte) answer;
-        }
-        return Byte.valueOf(answer.byteValue());
-    }
-
-    /**
-     * Gets a Byte from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The Byte is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a Byte, <code>defaultValue</code> if null object input
-     */
-    public static Byte getAsByte(final Object obj, final Byte defaultValue) {
-        Byte answer = getAsByte(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a byte from a Object in a null-safe manner.
-     * <p>
-     * The byte is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a byte, <code>0</code> if null object input
-     */
-    public static byte getAsByteValue(final Object obj) {
-        final Byte byteObject = getAsByte(obj);
-        if (byteObject == null) {
-            return 0;
-        }
-        return byteObject.byteValue();
-    }
-
-    /**
-     * Gets a byte from a Object in a null-safe manner.
-     * <p>
-     * The byte is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of the Object as a byte, <code>defaultValue</code> if null object input
-     */
-    public static byte getAsByteValue(final Object obj, final byte defaultValue) {
-        final Byte byteObject = getAsByte(obj);
-        if (byteObject == null) {
-            return defaultValue;
-        }
-        return byteObject.byteValue();
-    }
-
-    /**
-     * Gets a Short from a Object in a null-safe manner.
-     * <p>
-     * The Short is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Short, <code>null</code> if null object input
-     */
-    public static Short getAsShort(final Object obj) {
-        final Number answer = getAsNumber(obj);
-        if (answer == null) {
-            return null;
-        } else if (answer instanceof Short) {
-            return (Short) answer;
-        }
-        return Short.valueOf(answer.shortValue());
-    }
-
-    /**
-     * Gets a Short from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The Short is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a Short, <code>defaultValue</code> if null object input
-     */
-    public static Short getAsShort(final Object obj, final Short defaultValue) {
-        Short answer = getAsShort(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a short from a Object in a null-safe manner.
-     * <p>
-     * The short is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a short, <code>0</code> if null object input
-     */
-    public static short getAsShortValue(final Object obj) {
-        final Short shortObject = getAsShort(obj);
-        if (shortObject == null) {
-            return 0;
-        }
-        return shortObject.shortValue();
-    }
-
-    /**
-     * Gets a short from a Object in a null-safe manner.
-     * <p>
-     * The short is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of the Object as a short, <code>defaultValue</code> if null object input
-     */
-    public static short getAsShortValue(final Object obj, final short defaultValue) {
-        final Short shortObject = getAsShort(obj);
-        if (shortObject == null) {
-            return defaultValue;
-        }
-        return shortObject.shortValue();
-    }
-
-    /**
-     * Gets a Integer from a Object in a null-safe manner.
-     * <p>
-     * The Integer is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Integer, <code>null</code> if null object input
-     */
-    public static Integer getAsInteger(final Object obj) {
-        final Number answer = getAsNumber(obj);
-        if (Check.isNull(answer)) {
-            return null;
-        } else if (answer instanceof Integer) {
-            return (Integer) answer;
-        }
-        return Integer.valueOf(answer.intValue());
-    }
-
-    /**
-     * Gets a Integer from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The Integer is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a Integer, <code>defaultValue</code> if null object input
-     */
-    public static Integer getAsInteger(final Object obj, final Integer defaultValue) {
-        Integer answer = getAsInteger(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a int from a Object in a null-safe manner.
-     * <p>
-     * The int is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a int, <code>0</code> if null object input
-     */
-    public static int getAsIntValue(final Object obj) {
-        final Integer integerObject = getAsInteger(obj);
-        if (integerObject == null) {
-            return 0;
-        }
-        return integerObject.intValue();
-    }
-
-    /**
-     * Gets a int from a Object in a null-safe manner.
-     * <p>
-     * The int is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of the Object as a int, <code>defaultValue</code> if null object input
-     */
-    public static int getAsIntValue(final Object obj, final int defaultValue) {
-        final Integer integerObject = getAsInteger(obj);
-        if (integerObject == null) {
-            return defaultValue;
-        }
-        return integerObject.intValue();
-    }
-
-    /**
-     * Gets a Long from a Object in a null-safe manner.
-     * <p>
-     * The Long is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Long, <code>null</code> if null object input
-     */
-    public static Long getAsLong(final Object obj) {
-        final Number answer = getAsNumber(obj);
-        if (Check.isNull(answer)) {
-            return null;
-        } else if (answer instanceof Long) {
-            return (Long) answer;
-        }
-        return Long.valueOf(answer.longValue());
-    }
-
-    /**
-     * Gets a Long from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The Long is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a Long, <code>defaultValue</code> if null object input
-     */
-    public static Long getAsLong(final Object obj, final Long defaultValue) {
-        Long answer = getAsLong(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a long from a Object in a null-safe manner.
-     * <p>
-     * The long is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a long, <code>0L</code> if null object input
-     */
-    public static long getAsLongValue(final Object obj) {
-        final Long longObject = getAsLong(obj);
-        if (longObject == null) {
-            return 0L;
-        }
-        return longObject.longValue();
-    }
-
-    /**
-     * Gets a long from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The long is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a long, <code>defaultValue</code> if null object input
-     */
-    public static long getAsLongValue(final Object obj, final long defaultValue) {
-        final Long longObject = getAsLong(obj);
-        if (longObject == null) {
-            return defaultValue;
-        }
-        return longObject.longValue();
-    }
-
-    /**
-     * Gets a Float from a Object in a null-safe manner.
-     * <p>
-     * The Float is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Float, <code>null</code> if null object input
-     */
-    public static Float getAsFloat(final Object obj) {
-        final Number answer = getAsNumber(obj);
-        if (answer == null) {
-            return null;
-        } else if (answer instanceof Float) {
-            return (Float) answer;
-        }
-        return Float.valueOf(answer.floatValue());
-    }
-
-    /**
-     * Gets a Float from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The Float is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a Float, <code>defaultValue</code> if null object input
-     */
-    public static Float getAsFloat(final Object obj, final Float defaultValue) {
-        Float answer = getAsFloat(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a float from a Object in a null-safe manner.
-     * <p>
-     * The float is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of Object as a float, <code>0.0F</code> if null object input
-     */
-    public static float getAsFloatValue(final Object obj) {
-        final Float floatObject = getAsFloat(obj);
-        if (floatObject == null) {
-            return 0f;
-        }
-        return floatObject.floatValue();
-    }
-
-    /**
-     * Gets a float from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The float is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a float, <code>defaultValue</code> if null object input
-     */
-    public static float getAsFloatValue(final Object obj, final float defaultValue) {
-        final Float floatObject = getAsFloat(obj);
-        if (floatObject == null) {
-            return defaultValue;
-        }
-        return floatObject.floatValue();
-    }
-
-    /**
-     * Gets a Double from a Object in a null-safe manner.
-     * <p>
-     * The Double is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of the Object as a Double, <code>null</code> if null object input
-     */
-    public static Double getAsDouble(final Object obj) {
-        final Number answer = getAsNumber(obj);
-        if (Check.isNull(answer)) {
-            return null;
-        } else if (answer instanceof Double) {
-            return (Double) answer;
-        }
-        return Double.valueOf(answer.doubleValue());
-    }
-
-    /**
-     * Gets a Double from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The Double is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a Double, <code>defaultValue</code> if null object input
-     */
-    public static Double getAsDouble(final Object obj, final Double defaultValue) {
-        Double answer = getAsDouble(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return answer;
-    }
-
-    /**
-     * Gets a double from a Object in a null-safe manner.
-     * <p>
-     * The double is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of Object as a double, <code>0.0</code> if null object input
-     */
-    public static double getAsDoubleValue(final Object obj) {
-        final Double doubleObject = getAsDouble(obj);
-        if (doubleObject == null) {
-            return 0d;
-        }
-        return doubleObject.doubleValue();
-    }
-
-    /**
-     * Gets a double from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The double is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a double, <code>defaultValue</code> if null object input
-     */
-    public static double getAsDoubleValue(final Object obj, final double defaultValue) {
-        final Double doubleObject = getAsDouble(obj);
-        if (doubleObject == null) {
-            return defaultValue;
-        }
-        return doubleObject.doubleValue();
-    }
-
-    /**
-     * Gets a BigInteger from a Object in a null-safe manner.
-     * <p>
-     * The BigInteger is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of Object as a BigInteger, <code>0</code> if null object input
-     */
-    public static BigInteger getAsBigInteger(final Object obj) {
-        if (obj != null) {
-            if (obj instanceof BigInteger) {
-                return (BigInteger) obj;
-            } else if (obj instanceof String) {
-                return new BigInteger((String) obj);
-            } else if (obj instanceof Number || obj instanceof Boolean) {
-                final Number answer = getAsNumber(obj);
-                if (answer != null) {
-                    return BigInteger.valueOf(answer.longValue());
-                }
-            } else {
-                throw new UnsupportedOperationException();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Gets a BigInteger from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The BigInteger is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a BigInteger, <code>defaultValue</code> if null object input
-     */
-    @SuppressWarnings("unchecked")
-    public static <R extends BigInteger> R getAsBigInteger(final Object obj, final R defaultValue) {
-        BigInteger answer = getAsBigInteger(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return (R) answer;
-    }
-
-    /**
-     * Gets a BigDecimal from a Object in a null-safe manner.
-     * <p>
-     * The BigDecimal is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj the object to use
-     * @return the value of Object as a BigDecimal, <code>0</code> if null object input
-     */
-    public static BigDecimal getAsBigDecimal(final Object obj) {
-        if (!Check.isNull(obj)) {
-            if (obj instanceof BigDecimal) {
-                return (BigDecimal) obj;
-            } else if (obj instanceof String) {
-                return new BigDecimal((String) obj);
-            } else if (obj instanceof Number || obj instanceof Boolean) {
-                final Number answer = getAsNumber(obj);
-                if (answer != null) {
-                    return BigDecimal.valueOf(answer.doubleValue());
-                }
-            } else {
-                throw new UnsupportedOperationException();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Gets a BigDecimal from a Object in a null-safe manner,
-     * using the default value if the the conversion fails.
-     * <p>
-     * The BigDecimal is obtained from the results of {@link #getAsNumber(Object)}.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return the value of Object as a BigDecimal, <code>defaultValue</code> if null object input
-     */
-    @SuppressWarnings("unchecked")
-    public static <R extends BigDecimal> R getAsBigDecimal(final Object obj, final R defaultValue) {
-        BigDecimal answer = getAsBigDecimal(obj);
-        if (answer == null) {
-            answer = defaultValue;
-        }
-        return (R) answer;
-    }
-
-    /**
-     * This method is mainly used to provide data type conversion services.
-     *
-     * @param obj the object to use
-     * @param clz the type for conversion
-     * @return
-     */
-    @SuppressWarnings("unchecked")
-    public static <R> R cast(final Object obj, final Class<R> clz) {
-        if (obj == null) {
-            throw new IllegalArgumentException("'obj' must not be null");
-        }
-        if (clz == null) {
-            throw new IllegalArgumentException("'clz' must not be null");
-        }
-        R result = null;
-        if (Boolean.class.equals(clz) || boolean.class.equals(clz)) {
-            result = (R) getAsBoolean(obj);
-        } else if (Byte.class.equals(clz) || byte.class.equals(clz)) {
-            result = (R) getAsByte(obj);
-        } else if (Short.class.equals(clz) || short.class.equals(clz)) {
-            result = (R) getAsShort(obj);
-        } else if (Integer.class.equals(clz) || int.class.equals(clz)) {
-            result = (R) getAsInteger(obj);
-        } else if (Long.class.equals(clz) || long.class.equals(clz)) {
-            result = (R) getAsLong(obj);
-        } else if (Float.class.equals(clz) || float.class.equals(clz)) {
-            result = (R) getAsFloat(obj);
-        } else if (Double.class.equals(clz) || double.class.equals(clz)) {
-            result = (R) getAsDouble(obj);
-        } else if (String.class.equals(clz)) {
-            result = (R) getAsString(obj);
-        } else if (BigInteger.class.isAssignableFrom(clz)) {
-            result = (R) getAsBigInteger(obj);
-        } else if (BigDecimal.class.isAssignableFrom(clz)) {
-            result = (R) getAsBigDecimal(obj);
-        } else if (Number.class.isAssignableFrom(clz)) {
-            result = (R) getAsNumber(obj);
-        } else {
-            throw new UnsupportedOperationException();
-        }
-        return result;
-    }
-
-    /**
-     * This method is mainly used to provide data type conversion services.
-     *
-     * @param obj          the object to use
-     * @param defaultValue return if the value is null or if the conversion fails
-     * @return
-     */
-    @SuppressWarnings("unchecked")
-    public static <R> R cast(final Object obj, final R defaultValue) {
-        if (obj == null) {
-            throw new IllegalArgumentException("'obj' must not be null");
-        }
-        if (defaultValue == null) {
-            throw new IllegalArgumentException("'defaultValue' must not be null");
-        }
-        R result = null;
-        final Class<?> clz = defaultValue.getClass();
-        if (Boolean.class.equals(clz) || boolean.class.equals(clz)) {
-            result = (R) getAsBoolean(obj, (Boolean) defaultValue);
-        } else if (Byte.class.equals(clz) || byte.class.equals(clz)) {
-            result = (R) getAsByte(obj, (Byte) defaultValue);
-        } else if (Short.class.equals(clz) || short.class.equals(clz)) {
-            result = (R) getAsShort(obj, (Short) defaultValue);
-        } else if (Integer.class.equals(clz) || int.class.equals(clz)) {
-            result = (R) getAsInteger(obj, (Integer) defaultValue);
-        } else if (Long.class.equals(clz) || long.class.equals(clz)) {
-            result = (R) getAsLong(obj, (Long) defaultValue);
-        } else if (Float.class.equals(clz) || float.class.equals(clz)) {
-            result = (R) getAsFloat(obj, (Float) defaultValue);
-        } else if (Double.class.equals(clz) || double.class.equals(clz)) {
-            result = (R) getAsDouble(obj, (Double) defaultValue);
-        } else if (String.class.equals(clz)) {
-            result = (R) getAsString(obj, (String) defaultValue);
-        } else if (BigInteger.class.isAssignableFrom(clz)) {
-            result = (R) getAsBigInteger(obj, (BigInteger) defaultValue);
-        } else if (BigDecimal.class.isAssignableFrom(clz)) {
-            result = (R) getAsBigDecimal(obj, (BigDecimal) defaultValue);
-        } else if (Number.class.isAssignableFrom(clz)) {
-            result = (R) getAsNumber(obj, (Number) defaultValue);
-        } else {
-            throw new UnsupportedOperationException();
-        }
-        return result;
-    }
-
-}

+ 0 - 148
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/CosUtil.java

@@ -1,148 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import com.tencentcloudapi.common.Credential;
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
-import com.tencentcloudapi.common.profile.ClientProfile;
-import com.tencentcloudapi.common.profile.HttpProfile;
-import com.tencentcloudapi.mps.v20190612.MpsClient;
-import com.tencentcloudapi.mps.v20190612.models.*;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.codec.Base64;
-
-import javax.crypto.Cipher;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Map;
-
-
-@Slf4j
-public class CosUtil {
-    public static final String secretId = "AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets";
-    public static final String secretKey = "tXzuwMfplTTK3c9GFUyETilasvQfePu9";
-    public static final String region = "ap-chongqing";
-    public static final String bucket = "media-1301855440";
-    public static final String host = "https://" + bucket +".cos.ap-chongqing.myqcloud.com";
-
-
-    //创建采样视频截图模板
-    public static void createSampleSnapshotTemplate(){
-        try{
-
-            Credential cred = new Credential(secretId, secretKey);
-
-            HttpProfile httpProfile = new HttpProfile();
-            httpProfile.setEndpoint("mps.tencentcloudapi.com");
-
-            ClientProfile clientProfile = new ClientProfile();
-            clientProfile.setHttpProfile(httpProfile);
-
-            MpsClient client = new MpsClient(cred, region, clientProfile);
-
-            String params = "{\"Name\":\"sampleSnapshotTemplate1\",\"SampleType\":\"Percent\",\"SampleInterval\":7}";
-
-            CreateSampleSnapshotTemplateRequest req = CreateSampleSnapshotTemplateRequest.fromJsonString(params, CreateSampleSnapshotTemplateRequest.class);
-
-            CreateSampleSnapshotTemplateResponse resp = client.CreateSampleSnapshotTemplate(req);
-
-            log.info(CreateSampleSnapshotTemplateRequest.toJsonString(resp));
-        } catch (TencentCloudSDKException e) {
-            log.error(e.toString());
-        }
-    }
-
-    /**
-     * 视频处理模块
-     * 查询已经创建的模板
-     */
-    public static void DescribeSampleSnapshotTemplates(){
-            try{
-                Credential cred = new Credential(secretId, secretKey);
-
-                HttpProfile httpProfile = new HttpProfile();
-                httpProfile.setEndpoint("mps.tencentcloudapi.com");
-
-                ClientProfile clientProfile = new ClientProfile();
-                clientProfile.setHttpProfile(httpProfile);
-
-                MpsClient client = new MpsClient(cred, region, clientProfile);
-
-                String params = "{}";
-                DescribeSampleSnapshotTemplatesRequest req = DescribeSampleSnapshotTemplatesRequest.fromJsonString(params, DescribeSampleSnapshotTemplatesRequest.class);
-
-                DescribeSampleSnapshotTemplatesResponse resp = client.DescribeSampleSnapshotTemplates(req);
-
-                log.info(DescribeSampleSnapshotTemplatesRequest.toJsonString(resp));
-            } catch (TencentCloudSDKException e) {
-                log.error(e.toString());
-            }
-    }
-
-    //查询抽帧任务状态
-    public static String describeTaskDetail(String taskId){
-            try{
-                Credential cred = new Credential(secretId, secretKey);
-
-                HttpProfile httpProfile = new HttpProfile();
-                httpProfile.setEndpoint("mps.tencentcloudapi.com");
-
-                ClientProfile clientProfile = new ClientProfile();
-                clientProfile.setHttpProfile(httpProfile);
-
-                MpsClient client = new MpsClient(cred, region, clientProfile);
-
-                String params = "{\"TaskId\":\"" + taskId + "\"}";
-                DescribeTaskDetailRequest req = DescribeTaskDetailRequest.fromJsonString(params, DescribeTaskDetailRequest.class);
-
-                DescribeTaskDetailResponse resp = client.DescribeTaskDetail(req);
-
-                log.info(DescribeTaskDetailRequest.toJsonString(resp));
-                return DescribeTaskDetailRequest.toJsonString(resp);
-            } catch (TencentCloudSDKException e) {
-                log.error(e.toString());
-                return null;
-            }
-    }
-
-    //抽帧      42095--已经创建好的采样截图模板,每7%抽一张,一共15张,第一张首帧
-    //videoPath视频路径,包括文件名 高清.mp4     snapshotPath 视频截图路径(包括名字) /高清
-    public static String processMedia(String videoPath, String snapshotPath){
-        try{
-            Credential cred = new Credential(secretId, secretKey);
-
-            HttpProfile httpProfile = new HttpProfile();
-            httpProfile.setEndpoint("mps.tencentcloudapi.com");
-
-            ClientProfile clientProfile = new ClientProfile();
-            clientProfile.setHttpProfile(httpProfile);
-
-            MpsClient client = new MpsClient(cred, region, clientProfile);
-
-            String params = "{\"InputInfo\":{\"Type\":\"COS\",\"CosInputInfo\":{\"Bucket\":\"" + bucket + "\",\"Region\":\"" + region + "\",\"Object\":\"" + videoPath + "\"}},\"MediaProcessTask\":{\"SampleSnapshotTaskSet\":[{\"Definition\":42095,\"OutputStorage\":{\"Type\":\"COS\",\"CosOutputStorage\":{\"Bucket\":\""+ bucket +"\",\"Region\":\"" + region + "\"}},\"OutputObjectPath\":\"" + snapshotPath + "\"}]}}";
-
-            ProcessMediaRequest req = ProcessMediaRequest.fromJsonString(params, ProcessMediaRequest.class);
-
-            ProcessMediaResponse resp = client.ProcessMedia(req);
-
-            log.info(ProcessMediaRequest.toJsonString(resp));
-            return ProcessMediaRequest.toJsonString(resp);
-        } catch (TencentCloudSDKException e) {
-            log.error(e.toString());
-            return null;
-        }
-    }
-
-
-    public static void main(String[] args) {
-        //创建采样截图模板
-        createSampleSnapshotTemplate();
-        //查询采样截图模板
-        //DescribeSampleSnapshotTemplates();
-        //查询抽帧任务状态
-        //describeTaskDetail();
-
-    }
-
-
-}

+ 0 - 90
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java

@@ -1,90 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import java.math.BigDecimal;
-
-/**
- * 广告相关常量数据
- */
-public class CtopAdConstant {
-    //头条
-    public static final String PLATFORM_TYPE_BYTEDANCE = "1";
-    public static final  int PLATFORM_TYPE_BYTEDANCE_INT = 1;
-    //快手
-    public static final String PLATFORM_TYPE_KUAISHOU = "2";
-    public static final  int   PLATFORM_TYPE_KUAISHOU_INT = 2;
-    //头条内广
-    public static final String PLATFORM_TYPE_BYTEDANCE_INSIDE = "3";
-    public static final  int PLATFORM_TYPE_BYTEDANCE_INSIDE_INT = 3;
-    //头条内广
-    public static final String PLATFORM_TYPE_KUAISHOU_INSIDE = "4";
-    public static final  int PLATFORM_TYPE_KUAISHOU_INSIDE_INT = 4;
-
-    public static final String PLATFORM_TYPE_PANGOLIN = "5";
-
-    public static final String PLATFORM_TYPE_BYTEDANCE_PY = "bytedance";
-    public static final String PLATFORM_TYPE_KUAISHOU_PY = "kuaishou";
-    public static final String PLATFORM_TYPE_PANGOLIN_PY = "pangolin";
-
-    public static final String BYTEDANCE_REPORT_TYPE_DAILY = "STAT_TIME_GRANULARITY_DAILY";
-    public static final String BYTEDANCE_REPORT_TYPE_HOURLY = "STAT_TIME_GRANULARITY_HOURLY";
-
-    public static final String UREPORT_PREVIEW_URL_PREFIX = "/jeecg-boot/ureport/designer?_u=mysql:";
-
-
-    public static final String CTOP_ORGCODE_NORTH_CHINA_PREFIX = "A01";
-    public static final String CTOP_ORGCODE_EAST_CHINA_PREFIX = "A02";
-
-    public static final String KUAISHOU_LOAD_JOB_TYPE_HISTORY = "history";
-    public static final String KUAISHOU_LOAD_JOB_TYPE_DAILY = "daily";
-
-    public static final String BYTEDANCE_LOAD_JOB_TYPE_ASYNC = "async";
-    public static final String BYTEDANCE_LOAD_JOB_TYPE_DAILY = "daily";
-
-    /**
-     * 销售角色Id
-     */
-    public static final String SYSTEM_SALE_CODE = "75ee837e6f3de29c0e3ed75d4629438e";
-
-    /**
-     * 销售AM角色Id
-     */
-    public static final String SYSTEM_SALE_AM_CODE = "f5a68aa2acf86e842100f0fa4b050d28";
-
-    /**
-     * 头条销售媒体季度任务
-     */
-    public static final BigDecimal BYTEDANCE_MEDIA_TASK_COST = new BigDecimal("150000000");
-    /**
-     * 快手销售媒体季度任务
-     */
-    public static final BigDecimal KUAISHOU_MEDIA_TASK_COST = new BigDecimal("147000000");
-    /**
-     * 头条销售季度个人任务
-     */
-    public static final BigDecimal BYTEDANCE_PERSONAL_TASK_COST = new BigDecimal("2400000");
-    /**
-     * 快手销售季度个人任务
-     */
-    public static final BigDecimal KUAISHOU_PERSONAL_TASK_COST = new BigDecimal("2400000");
-
-    /**
-     * 华北快手销售机构号
-     */
-    public static final String HB_KUAISHOU_SALE_ORG_CODE = "A01A11A01";
-    /**
-     * 华北头条销售机构号
-     */
-    public static final String HB_BYTEDANCE_SALE_ORG_CODE = "A01A11A02";
-
-    public static final String BYTEDANCE_GENDER_TYPE_NONE = "NONE";
-    public static final String BYTEDANCE_GENDER_TYPE_GENDER_MALE = "GENDER_MALE";
-    public static final String BYTEDANCE_GENDER_TYPE_GENDER_FEMALE = "GENDER_FEMALE";
-
-
-    public static final Integer COMMON_STATUS_ENABLED = 1;
-
-    public static final Integer COMMON_STATUS_NOT_ENABLED = 0;
-
-    public static final String COMMON_ORDER_TYPE_ASC = "asc";
-    public static final String COMMON_ORDER_TYPE_DESC = "desc";
-}

+ 0 - 133
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/FindsDepartsChildrenUtil.java

@@ -1,133 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import cn.com.ctop.common.module.entity.SysDepart;
-import cn.com.ctop.common.module.model.DepartIdModel;
-import cn.com.ctop.common.module.model.SysDepartTreeModel;
-import org.jeecg.common.util.oConvertUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * <p>
- * 对应部门的表,处理并查找树级数据
- * <p>
- *
- * @Author: Steve
- * @Date: 2019-01-22
- */
-public class FindsDepartsChildrenUtil {
-
-    //部门树信息-树结构
-    //private static List<SysDepartTreeModel> sysDepartTreeList = new ArrayList<SysDepartTreeModel>();
-
-    //部门树id-树结构
-    //private static List<DepartIdModel> idList = new ArrayList<>();
-
-
-    /**
-     * queryTreeList的子方法 ====1=====
-     * 该方法是s将SysDepart类型的list集合转换成SysDepartTreeModel类型的集合
-     */
-    public static List<SysDepartTreeModel> wrapTreeDataToTreeList(List<SysDepart> recordList) {
-        // 在该方法每请求一次,都要对全局list集合进行一次清理
-        //idList.clear();
-        List<DepartIdModel> idList = new ArrayList<DepartIdModel>();
-        List<SysDepartTreeModel> records = new ArrayList<>();
-        for (int i = 0; i < recordList.size(); i++) {
-            SysDepart depart = recordList.get(i);
-            records.add(new SysDepartTreeModel(depart));
-        }
-        List<SysDepartTreeModel> tree = findChildren(records, idList);
-        setEmptyChildrenAsNull(tree);
-        return tree;
-    }
-
-    /**
-     * 获取 DepartIdModel
-     *
-     * @param recordList
-     * @return
-     */
-    public static List<DepartIdModel> wrapTreeDataToDepartIdTreeList(List<SysDepart> recordList) {
-        // 在该方法每请求一次,都要对全局list集合进行一次清理
-        //idList.clear();
-        List<DepartIdModel> idList = new ArrayList<DepartIdModel>();
-        List<SysDepartTreeModel> records = new ArrayList<>();
-        for (int i = 0; i < recordList.size(); i++) {
-            SysDepart depart = recordList.get(i);
-            if (!Check.isNull(depart.getLeaderName())) {
-                depart.setTitle(depart.getDepartName().concat("(").concat(depart.getLeaderName()).concat(")"));
-            } else {
-                depart.setTitle(depart.getDepartName());
-            }
-            records.add(new SysDepartTreeModel(depart));
-        }
-        findChildren(records, idList);
-        return idList;
-    }
-
-    /**
-     * queryTreeList的子方法 ====2=====
-     * 该方法是找到并封装顶级父类的节点到TreeList集合
-     */
-    private static List<SysDepartTreeModel> findChildren(List<SysDepartTreeModel> recordList,
-                                                         List<DepartIdModel> departIdList) {
-
-        List<SysDepartTreeModel> treeList = new ArrayList<>();
-        for (int i = 0; i < recordList.size(); i++) {
-            SysDepartTreeModel branch = recordList.get(i);
-            if (oConvertUtils.isEmpty(branch.getParentId())) {
-                treeList.add(branch);
-                DepartIdModel departIdModel = new DepartIdModel().convert(branch);
-                departIdList.add(departIdModel);
-            }
-        }
-        getGrandChildren(treeList, recordList, departIdList);
-
-        //idList = departIdList;
-        return treeList;
-    }
-
-    /**
-     * queryTreeList的子方法====3====
-     * 该方法是找到顶级父类下的所有子节点集合并封装到TreeList集合
-     */
-    private static void getGrandChildren(List<SysDepartTreeModel> treeList, List<SysDepartTreeModel> recordList, List<DepartIdModel> idList) {
-
-        for (int i = 0; i < treeList.size(); i++) {
-            SysDepartTreeModel model = treeList.get(i);
-            DepartIdModel idModel = idList.get(i);
-            for (int i1 = 0; i1 < recordList.size(); i1++) {
-                SysDepartTreeModel m = recordList.get(i1);
-                if (m.getParentId() != null && m.getParentId().equals(model.getId())) {
-                    model.getChildren().add(m);
-                    DepartIdModel dim = new DepartIdModel().convert(m);
-                    idModel.getChildren().add(dim);
-                }
-            }
-            getGrandChildren(treeList.get(i).getChildren(), recordList, idList.get(i).getChildren());
-        }
-
-    }
-
-
-    /**
-     * queryTreeList的子方法 ====4====
-     * 该方法是将子节点为空的List集合设置为Null值
-     */
-    private static void setEmptyChildrenAsNull(List<SysDepartTreeModel> treeList) {
-
-        for (int i = 0; i < treeList.size(); i++) {
-            SysDepartTreeModel model = treeList.get(i);
-            if (model.getChildren().size() == 0) {
-                model.setChildren(null);
-                model.setIsLeaf(true);
-            } else {
-                setEmptyChildrenAsNull(model.getChildren());
-                model.setIsLeaf(false);
-            }
-        }
-        // sysDepartTreeList = treeList;
-    }
-}

+ 0 - 634
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java

@@ -1,634 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import com.alibaba.fastjson.JSONObject;
-import com.google.gson.Gson;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.*;
-import org.apache.http.client.CookieStore;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.config.CookieSpecs;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.conn.ssl.TrustStrategy;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.impl.cookie.BasicClientCookie;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.ssl.SSLContextBuilder;
-import org.apache.http.util.EntityUtils;
-
-import javax.net.ssl.SSLContext;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URI;
-import java.net.URLEncoder;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.*;
-
-/**
- * @author 宋英豪
- */
-@Slf4j
-public class HttpUtils {
-    public static JSONObject bytedanceGetRequest(String accessToken, String url, JSONObject params) {
-        // 构造请求
-        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
-            @Override
-            public String getMethod() {
-                return "GET";
-            }
-        };
-        httpEntity.setHeader("Access-Token", accessToken);
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setURI(URI.create(url));
-            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
-            httpEntity.setConfig(requestConfig);
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuilder result = new StringBuilder();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                return JSONObject.parseObject(result.toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                if (client != null) {
-                    client.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-
-    public static JSONObject bytedancePostRequest(String accessToken, String url, JSONObject params) {
-        // 构造请求
-        HttpPost httpEntity = new HttpPost(url);
-        httpEntity.setHeader("Access-Token", accessToken);
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
-            httpEntity.setConfig(requestConfig);
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuilder result = new StringBuilder();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                return JSONObject.parseObject(result.toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                if (client != null) {
-                    client.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-
-    public static CookieStore COOKIESTORE = new BasicCookieStore();
-
-    public static String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36";
-
-    public static CloseableHttpClient createSslClientDefault() {
-        try {
-            SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
-                //信任所有证书
-                @Override
-                public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
-                    return true;
-                }
-            }).build();
-            RequestConfig globalConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setCookieSpec(CookieSpecs.STANDARD).build();
-            SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
-            return HttpClients.custom().setDefaultCookieStore(COOKIESTORE).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
-        } catch (Exception e) {
-            log.error("处理Https证书异常", e);
-        }
-        return HttpClients.createDefault();
-    }
-
-    public static String httpPostFormRequest(String url, Map<String, Object> param, Map<String, String> headers) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            if (headers != null) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-            List<NameValuePair> paramList = new ArrayList<NameValuePair>();
-            if (param != null) {
-                for (String key : param.keySet()) {
-                    BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
-                    paramList.add(basicNameValuePair);
-                }
-                // 第二步:我们发现Entity是一个接口,所以只能找实现类,发现实现类又需要一个集合,集合的泛型是NameValuePair类型
-                UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
-                // 第一步:通过setEntity 将我们的entity对象传递过去
-                httppost.setEntity(formEntity);
-            }
-
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostFormRequest(newUrl, param, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpPostParamRequest(String url, Map<String, Object> param, Map<String, String> headers) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            if (headers != null) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-            List<NameValuePair> paramList = new ArrayList<NameValuePair>();
-            for (String key : param.keySet()) {
-                BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
-                paramList.add(basicNameValuePair);
-            }
-
-            // 第二步:我们发现Entity是一个接口,所以只能找实现类,发现实现类又需要一个集合,集合的泛型是NameValuePair类型
-            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
-            // 第一步:通过setEntity 将我们的entity对象传递过去
-            httppost.setEntity(formEntity);
-            httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostParamRequest(newUrl, param, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpPostRequest(String url, Map<String, Object> param, Map<String, String> headers) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            httppost.addHeader("Content-Type", "application/json");
-            if (headers != null && headers.size() > 0) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-            if (param != null && param.size() > 0) {
-                httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
-            }
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(300 * 1000).setConnectTimeout(300 * 1000).build();
-            httppost.setConfig(requestConfig);
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostRequest(newUrl, param, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpPostNoParamRequest(String url) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            httppost.addHeader("Content-Type", "application/json");
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostNoParamRequest(newUrl);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String kuaiShouhttpPostRequest(String url, String body, Map<String, String> headers) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(120000).setConnectTimeout(120000).build();
-            httppost.setConfig(requestConfig);
-            if (!Check.isNullMap(headers)) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-
-            httppost.setHeader("User-Agent", USER_AGENT);
-            if (!Check.isNull(body)) {
-                httppost.setEntity(new StringEntity(body, Charset.forName("UTF-8")));
-            }
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-
-    public static String httpPostRequest(String url, JSONObject params, Map<String, String> headers) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            httppost.addHeader("Content-Type", "application/json");
-            for (String key : headers.keySet()) {
-                httppost.setHeader(key, headers.get(key));
-            }
-            httppost.setEntity(new StringEntity(params.toJSONString(), Charset.forName("UTF-8")));
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostRequest(newUrl, params, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpGetRequest(String url) {
-        HttpClient httpClient = createSslClientDefault();
-        HttpResponse response ;
-        HttpGet httpGet = new HttpGet(url);
-        String result = null;
-        try {
-            httpGet.setHeader("User-Agent", USER_AGENT);
-            response = httpClient.execute(httpGet);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpGetRequest(newUrl);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                String line ;
-                StringBuilder builder = new StringBuilder();
-                while ((line = reader.readLine()) != null) {
-                    builder.append(line);
-                }
-                result = builder.toString();
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return result;
-    }
-
-    public static String httpRequest(String url, String strParams) throws Exception {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-
-            HttpPost httppost = new HttpPost(url);
-            httppost.addHeader("Content-Type", "application/json");
-            httppost.setEntity(new StringEntity(strParams, Charset.forName("UTF-8")));
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httppost);
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpRequest(String url, CookieStore cookies, Map<String, String> parameterMap) throws Exception {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("Content-Type", "application/json");
-            UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(
-                    getParam(parameterMap), "UTF-8");
-            httppost.setEntity(postEntity);
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httppost);
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static List<NameValuePair> getParam(Map parameterMap) {
-        List<NameValuePair> param = new ArrayList<>();
-        Iterator it = parameterMap.entrySet().iterator();
-        while (it.hasNext()) {
-            Map.Entry parmEntry = (Map.Entry) it.next();
-            param.add(new BasicNameValuePair((String) parmEntry.getKey(),
-                    (String) parmEntry.getValue()));
-        }
-        return param;
-    }
-
-    public static HttpClient getHttpclient() {
-        RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(180000).setConnectTimeout(30000)
-                .setConnectionRequestTimeout(30000).setStaleConnectionCheckEnabled(true).build();
-        CloseableHttpClient httpclient = HttpClients.custom().setDefaultRequestConfig(defaultRequestConfig).build();
-        return httpclient;
-    }
-
-    public static String callingGraph(String url, String json) {
-        HttpClient httpClient = createSslClientDefault();
-        HttpResponse response ;
-        HttpPost httpPost = new HttpPost(url);
-        httpPost.setHeader("Content-Type", "application/json");
-        String result = null;
-
-        try {
-            StringEntity entity = new StringEntity(json, "utf-8");
-            httpPost.setHeader("User-Agent", USER_AGENT);
-            httpPost.setEntity(entity);
-            response = httpClient.execute(httpPost);
-            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-            String line ;
-            StringBuilder builder = new StringBuilder();
-            while ((line = reader.readLine()) != null) {
-                builder.append(line);
-            }
-            result = builder.toString();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return result;
-    }
-
-    public static String mapParamsSortToStringBySeperator(TreeMap<String, Object> treeMap, String seperator) {
-        String result = "";
-        if (null != treeMap && !treeMap.isEmpty()) {
-            for (Map.Entry<String, Object> entry : treeMap.entrySet()) {
-                String key = entry.getKey();
-                String value = URLEncoder.encode(entry.getValue().toString());
-                result += (key + "=" + value + seperator);
-            }
-            result = result.substring(0, result.length() - seperator.length());
-
-        }
-        return result;
-    }
-
-    public static String httpGetRequest(String url, Map<String, String> headers, TreeMap<String, Object> params) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            String uri = url + "?" + mapParamsSortToStringBySeperator(params, "&");
-            System.err.println(uri);
-            HttpGet httpGet = new HttpGet(uri);
-            if (headers != null) {
-                Iterator<String> keyIter = headers.keySet().iterator();
-                while (keyIter.hasNext()) {
-                    String curKey = keyIter.next();
-                    if (curKey != null && headers.get(curKey) != null) {
-                        httpGet.addHeader(curKey, headers.get(curKey));
-                    }
-                }
-            }
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httpGet);
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpGetRequest(String url, Map<String, String> headers, JSONObject params) {
-        HttpClient httpClient = createSslClientDefault();
-        String strReturn = "";
-        try {
-            HttpGetWithBodyEntity httpGet = new HttpGetWithBodyEntity(url);
-            if (headers != null) {
-                Iterator<String> keyIter = headers.keySet().iterator();
-                while (keyIter.hasNext()) {
-                    String curKey = keyIter.next();
-                    if (curKey != null && headers.get(curKey) != null) {
-                        httpGet.addHeader(curKey, headers.get(curKey));
-                    }
-                }
-            }
-            httpGet.setEntity(new StringEntity(params.toJSONString(), StandardCharsets.UTF_8));
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httpGet);
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-
-    public static String httpGet(String url, Map<String, Object> paramsMap, Map<String, String> headers) {
-        String result = null;
-        try {
-            //创建参数列表
-            HttpClient httpclient = getHttpclient();
-            StringBuilder postBody = null;
-            if (!Check.isNull(paramsMap)) {
-                postBody = new StringBuilder();
-                for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {
-                    if (entry.getValue() == null) {
-                        continue;
-                    }
-                    postBody.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(),
-                            "utf-8")).append("&");
-                }
-                if (!paramsMap.isEmpty()) {
-                    postBody.deleteCharAt(postBody.length() - 1);
-                }
-            }
-            String urlStr;
-            if (!Check.isNull(postBody)) {
-                urlStr = url + "?" + postBody;
-            } else {
-                urlStr = url;
-            }
-            HttpGet httpget = new HttpGet(urlStr);
-//            httpget.setHeader("User-Agent", USER_AGENT);
-            if (!Check.isNullMap(headers)) {
-                for (String key : headers.keySet()) {
-                    httpget.setHeader(key, headers.get(key));
-                }
-            }
-            HttpEntity respEntity;
-            HttpResponse response = httpclient.execute(httpget);
-            respEntity = response.getEntity();
-            Header[] responseHeaders = response.getHeaders("Set-Cookie");
-            if (responseHeaders != null) {
-                for (Header header : responseHeaders) {
-                    String[] ckArray = header.getValue().split(";");
-                    BasicClientCookie ck = new BasicClientCookie(ckArray[0].split("=")[0], ckArray[0].split("=")[1]);
-                    ck.setPath(ckArray[1].split("=")[1]);
-                    ck.setDomain(ckArray[2].split("=")[1]);
-                    HttpUtils.COOKIESTORE.addCookie(ck);
-                }
-            }
-            result = EntityUtils.toString(respEntity);
-        } catch (Exception e) {
-            log.error("http get请求异常");
-            e.printStackTrace();
-        }
-        return result;
-    }
-
-
-    public static JSONObject kuaiShouHttpGetRequest(String accessToken, String url, JSONObject params) {
-        // 构造请求
-        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
-            @Override
-            public String getMethod() {
-                return "GET";
-            }
-        };
-        httpEntity.setHeader("Access-Token", accessToken);
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setURI(URI.create(url));
-            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
-            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
-            httpEntity.setConfig(requestConfig);
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuilder result = new StringBuilder();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                return JSONObject.parseObject(result.toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                if (client != null) {
-                    client.close();
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 547
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils2.java

@@ -1,547 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import com.alibaba.fastjson.JSONObject;
-import com.google.gson.Gson;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.CookieStore;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.config.CookieSpecs;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.conn.ssl.TrustStrategy;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.ssl.SSLContextBuilder;
-import org.apache.http.util.EntityUtils;
-
-import javax.net.ssl.SSLContext;
-import java.io.*;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.security.cert.X509Certificate;
-import java.util.*;
-
-@Slf4j
-public class HttpUtils2 {
-    public static CookieStore cookieStore = new BasicCookieStore();
-    public static String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36";
-
-    public static CloseableHttpClient createSSLClientDefault() {
-        try {
-            SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
-                //信任所有证书
-                @Override
-                public boolean isTrusted(X509Certificate[] chain, String authType) {
-                    return true;
-                }
-            }).build();
-            RequestConfig globalConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setCookieSpec(CookieSpecs.STANDARD).build();
-            SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
-            return HttpClients.custom().setDefaultCookieStore(cookieStore).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
-        } catch (Exception e) {
-            log.error("处理Https证书异常", e);
-        }
-        return HttpClients.createDefault();
-    }
-
-    public static CloseableHttpClient createSSLClientDefault(CookieStore setCookieStore) {
-        try {
-            SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
-                //信任所有证书
-                @Override
-                public boolean isTrusted(X509Certificate[] chain, String authType) {
-                    return true;
-                }
-            }).build();
-            RequestConfig globalConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setCookieSpec(CookieSpecs.STANDARD).build();
-            SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
-            return HttpClients.custom().setDefaultCookieStore(setCookieStore).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
-        } catch (Exception e) {
-            log.error("处理Https证书异常", e);
-        }
-        return HttpClients.createDefault();
-    }
-
-    public static String httpPostParamRequest(String url, Map<String, Object> param, Map<String, String> headers) {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-
-            for (String key : headers.keySet()) {
-                httppost.setHeader(key, headers.get(key));
-            }
-            List<NameValuePair> paramList = new ArrayList<NameValuePair>();
-            for (String key : param.keySet()) {
-                BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
-                paramList.add(basicNameValuePair);
-            }
-
-            // 第二步:我们发现Entity是一个接口,所以只能找实现类,发现实现类又需要一个集合,集合的泛型是NameValuePair类型
-            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
-            // 第一步:通过setEntity 将我们的entity对象传递过去
-            httppost.setEntity(formEntity);
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostParamRequest(newUrl, param, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static void getFile(String url,Map<String,String> headerMap,String filePath){
-        HttpClient httpClient = createSSLClientDefault();
-        HttpResponse response = null;
-        HttpGet httpGet = new HttpGet(url);
-        String result = null;
-        try {
-            httpGet.setHeader("User-Agent", USER_AGENT);
-            response = httpClient.execute(httpGet);
-            HttpEntity entity = response.getEntity();
-            try (InputStream in = entity.getContent()) {
-                File file = new File(filePath);
-                FileOutputStream fout = new FileOutputStream(file);
-                int l = -1;
-                byte[] tmp = new byte[1024];
-                while ((l = in.read(tmp)) != -1) {
-                    fout.write(tmp, 0, l);
-                }
-                fout.flush();
-                fout.close();
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            // 关闭低层流。
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-    }
-    public static String httpPostRequest(String url, Map<String, Object> param, Map<String, String> headers) {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            httppost.addHeader("Content-Type", "application/json");
-            if (headers != null) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-
-            httppost.setEntity(new StringEntity(new Gson().toJson(param), StandardCharsets.UTF_8));
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostRequest(newUrl, param, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-
-    public static String httpPostRequestTest(String url, String body, Map<String, String> headers) {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            httppost.addHeader("Content-Type", "application/json");
-            for (String key : headers.keySet()) {
-                httppost.setHeader(key, headers.get(key));
-            }
-            httppost.setEntity(new StringEntity(body, StandardCharsets.UTF_8));
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostRequestTest(newUrl, body, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-
-    public static String kuaiShouhttpPostRequest(String url, String body, Map<String, String> headers) {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            if (!Check.isNullMap(headers)) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-            httppost.setHeader("User-Agent", USER_AGENT);
-            if (!Check.isNull(body)) {
-                httppost.setEntity(new StringEntity(body, StandardCharsets.UTF_8));
-            }
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-
-    public static String httpPostRequest(String url, JSONObject params, Map<String, String> headers) {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            httppost.addHeader("Content-Type", "application/json");
-            if (headers != null) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-            if (params != null) {
-                httppost.setEntity(new StringEntity(params.toJSONString(), StandardCharsets.UTF_8));
-            }
-
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostRequest(newUrl, params, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String getRedirectUrl(String url){
-        HttpClient httpClient = createSSLClientDefault();
-        HttpResponse response = null;
-        HttpGet httpGet = new HttpGet(url);
-        String result ;
-        try {
-//            httpGet.setHeader("User-Agent", USER_AGENT);
-            response = httpClient.execute(httpGet);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                return response.getFirstHeader("Location").getValue();
-            }
-
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    public static String httpGetRequest(String url) {
-        HttpClient httpClient = createSSLClientDefault();
-        HttpResponse response ;
-        HttpGet httpGet = new HttpGet(url);
-        String result = null;
-        try {
-            httpGet.setHeader("User-Agent", USER_AGENT);
-            response = httpClient.execute(httpGet);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpGetRequest(newUrl);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                String line ;
-                StringBuilder builder = new StringBuilder();
-                while ((line = reader.readLine()) != null) {
-                    builder.append(line);
-                }
-                result = builder.toString();
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return result;
-    }
-
-    public static String httpRequest(String url, String strParams) throws Exception {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-
-            HttpPost httppost = new HttpPost(url);
-            httppost.addHeader("Content-Type", "application/json");
-            httppost.setEntity(new StringEntity(strParams, StandardCharsets.UTF_8));
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httppost);
-            response.getStatusLine().getStatusCode();
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpRequest(String url, CookieStore cookies, Map<String, String> parameterMap) throws Exception {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("Content-Type", "application/json");
-            UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(
-                    getParam(parameterMap), "UTF-8");
-            httppost.setEntity(postEntity);
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httppost);
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static List<NameValuePair> getParam(Map parameterMap) {
-        List<NameValuePair> param = new ArrayList<NameValuePair>();
-        Iterator it = parameterMap.entrySet().iterator();
-        while (it.hasNext()) {
-            Map.Entry parmEntry = (Map.Entry) it.next();
-            param.add(new BasicNameValuePair((String) parmEntry.getKey(),
-                    (String) parmEntry.getValue()));
-        }
-        return param;
-    }
-
-    public static HttpClient getHttpclient() {
-        RequestConfig defaultRequestConfig = RequestConfig.custom().setSocketTimeout(180000).setConnectTimeout(30000)
-                .setConnectionRequestTimeout(30000).setStaleConnectionCheckEnabled(true).build();
-        return HttpClients.custom().setDefaultRequestConfig(defaultRequestConfig).build();
-    }
-
-    public static String callingGraph(String url, String json) {
-        HttpClient httpClient = createSSLClientDefault();
-        HttpResponse response ;
-        HttpPost httpPost = new HttpPost(url);
-        httpPost.setHeader("Content-Type", "application/json");
-        String result = null;
-
-        try {
-            StringEntity entity = new StringEntity(json, "utf-8");
-            httpPost.setHeader("User-Agent", USER_AGENT);
-            httpPost.setEntity(entity);
-            response = httpClient.execute(httpPost);
-            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-            String line ;
-            StringBuilder builder = new StringBuilder();
-            while ((line = reader.readLine()) != null) {
-                builder.append(line);
-            }
-            result = builder.toString();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return result;
-    }
-
-
-
-    public static String mapParamsSortToStringBySeperator(TreeMap<String, Object> treeMap, String seperator) {
-        String result = "";
-        if (null != treeMap && !treeMap.isEmpty()) {
-            for (Map.Entry<String, Object> entry : treeMap.entrySet()) {
-                String key = entry.getKey();
-                String value = URLEncoder.encode((String) entry.getValue());
-                result += (key + "=" + value + seperator);
-            }
-            result = result.substring(0, result.length() - seperator.length());
-        }
-        return result;
-    }
-
-
-    public static String httpGetRequest(String url, Map<String, String> headers, TreeMap<String, Object> params) {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            String uri = url + "?" + mapParamsSortToStringBySeperator(params, "&");
-            HttpGet httpGet = new HttpGet(uri);
-            if (headers != null) {
-                Iterator<String> keyIter = headers.keySet().iterator();
-                while (keyIter.hasNext()) {
-                    String curKey = keyIter.next();
-                    if (curKey != null && headers.get(curKey) != null) {
-                        httpGet.addHeader(curKey, headers.get(curKey));
-                    }
-                }
-            }
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httpGet);
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-    public static String httpGetRequest(String url, Map<String, String> headers, JSONObject params) {
-        HttpClient httpClient = createSSLClientDefault();
-        String strReturn = "";
-        try {
-            HttpGetWithBodyEntity httpGet = new HttpGetWithBodyEntity(url);
-            if (headers != null) {
-                Iterator<String> keyIter = headers.keySet().iterator();
-                while (keyIter.hasNext()) {
-                    String curKey = keyIter.next();
-                    if (curKey != null && headers.get(curKey) != null) {
-                        httpGet.addHeader(curKey, headers.get(curKey));
-                    }
-                }
-            }
-            httpGet.setEntity(new StringEntity(params.toJSONString(), StandardCharsets.UTF_8));
-            HttpEntity respentity;
-            HttpResponse response = httpClient.execute(httpGet);
-            respentity = response.getEntity();
-            strReturn = EntityUtils.toString(respentity);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-
-
-    public static String httpGet(String url, Map<String, Object> paramsMap, Map<String, String> headers) {
-        String result = null;
-        try {
-            // CloseableHttpClient httpClient = HttpClients.createDefault();
-            //创建参数列表
-            HttpClient httpclient = getHttpclient();
-            StringBuilder postBody = null;
-            if (!Check.isNull(paramsMap)) {
-                postBody = new StringBuilder();
-                for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {
-                    if (entry.getValue() == null) {
-                        continue;
-                    }
-                    postBody.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(),
-                            "utf-8")).append("&");
-                }
-                if (!paramsMap.isEmpty()) {
-                    postBody.deleteCharAt(postBody.length() - 1);
-                }
-            }
-            String urlStr;
-            if (!Check.isNull(postBody)) {
-                urlStr = url + "?" + postBody;
-            } else {
-                urlStr = url;
-            }
-            HttpGet httpget = new HttpGet(urlStr);
-            httpget.setHeader("User-Agent", USER_AGENT);
-            if (!Check.isNullMap(headers)) {
-                for (String key : headers.keySet()) {
-                    httpget.setHeader(key, headers.get(key));
-                }
-            }
-            HttpEntity respEntity;
-            HttpResponse response = httpclient.execute(httpget);
-            respEntity = response.getEntity();
-            result = EntityUtils.toString(respEntity);
-        } catch (Exception e) {
-            log.error("http get请求异常");
-            e.printStackTrace();
-        }
-        return result;
-    }
-
-
-    public static String httpPostRequest(String url, Map<String, Object> param, Map<String, String> headers, CookieStore cookieStore) {
-        HttpClient httpClient = createSSLClientDefault(cookieStore);
-        String strReturn = "";
-        try {
-            HttpPost httppost = new HttpPost(url);
-            httppost.setHeader("User-Agent", USER_AGENT);
-            httppost.addHeader("Content-Type", "application/json");
-            if (headers != null) {
-                for (String key : headers.keySet()) {
-                    httppost.setHeader(key, headers.get(key));
-                }
-            }
-
-            httppost.setEntity(new StringEntity(new Gson().toJson(param), StandardCharsets.UTF_8));
-            HttpEntity respentity;
-
-            HttpResponse response = httpClient.execute(httppost);
-            int statusCode = response.getStatusLine().getStatusCode();
-            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
-                String newUrl = response.getFirstHeader("Location").getValue();
-                return httpPostRequest(newUrl, param, headers);
-            } else if (statusCode == HttpStatus.SC_OK) {
-                respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
-                return strReturn;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error(e.getMessage());
-        }
-        return strReturn;
-    }
-}

+ 0 - 146
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/JavacvUtil.java

@@ -1,146 +0,0 @@
-//package cn.com.ctop.common.module.utils;
-//
-//import com.google.common.collect.Lists;
-//import org.bytedeco.javacpp.opencv_core;
-//import org.bytedeco.javacv.FFmpegFrameGrabber;
-//import org.bytedeco.javacv.Frame;
-//import org.bytedeco.javacv.Java2DFrameConverter;
-//import org.opencv.core.CvType;
-//import org.opencv.core.Mat;
-//import org.opencv.core.MatOfByte;
-//import org.opencv.imgcodecs.Imgcodecs;
-//import org.opencv.imgproc.Imgproc;
-//
-//import javax.imageio.ImageIO;
-//import java.awt.*;
-//import java.awt.image.BufferedImage;
-//import java.awt.image.DataBufferByte;
-//import java.io.ByteArrayInputStream;
-//import java.io.File;
-//import java.io.IOException;
-//import java.io.InputStream;
-//import java.util.List;
-//
-//public class JavacvUtil {
-//    /**
-//     * 视频文件指定时间段的帧截取
-//     * @param file
-//     * @param start
-//     * @param end
-//     */
-//    public static List<File> videoIntercept(File file, Integer start, Integer end) {
-//        Frame frame = null;
-//        List<File> files = Lists.newArrayList();
-//        FFmpegFrameGrabber fFmpegFrameGrabber = new FFmpegFrameGrabber(file);
-//        String filePath = "D://video//images//";
-//        String fileTargetName = "movie";
-//        try {
-//            fFmpegFrameGrabber.start();
-//            int ftp = fFmpegFrameGrabber.getLengthInFrames();
-//            for (int i=0 ; i < ftp ; i++){
-//                if( i >= start && i <= end){
-//                    frame = fFmpegFrameGrabber.grabImage();
-//                    doExecuteFrame(frame, filePath, fileTargetName, i ,files);
-//                }
-//            }
-//            fFmpegFrameGrabber.stop();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        return files;
-//    }
-//
-//    public static void doExecuteFrame(Frame frame, String targetFilePath, String targetFileName, int index ,List<File> files) {
-//        if ( frame == null || frame.image == null) {
-//            return;
-//        }
-//        Java2DFrameConverter converter = new Java2DFrameConverter();
-//        String imageMat = "jpg";
-//        String fileName = targetFilePath + targetFileName + "_" + index + "." + imageMat;
-//        BufferedImage bi = converter.getBufferedImage(frame);
-//
-////        Mat img = Imgcodecs.imread("");
-////        Mat imgHSV = new Mat(img.rows(), img.cols(), CvType.CV_8UC3);
-////        Mat img2 = new Mat(img.rows(), img.cols(), CvType.CV_8UC3);
-//
-//        //转成HSV空间
-////        Imgproc.cvtColor(img, imgHSV, Imgproc.COLOR_BGR2HSV);
-////        //转回BGR空间
-////        Imgproc.cvtColor(imgHSV, img2, Imgproc.COLOR_HSV2BGR);
-//
-//        File output = new File(fileName);
-//        files.add(output);
-//        try{
-//            ImageIO.write(bi, imageMat, output);
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    public static void main(String[] args) {
-//        List<File> files = videoIntercept(new File("C:\\Users\\宋英豪\\Desktop\\nfpHmswW.mp4"), 10, 100);
-//    }
-//
-//    /**
-//     * Mat转换成BufferedImage
-//     *
-//     * @param matrix
-//     *            要转换的Mat
-//     * @param fileExtension
-//     *            格式为 ".jpg", ".png", etc
-//     * @return
-//     */
-//    public static BufferedImage Mat2BufImg (Mat matrix, String fileExtension) {
-//        // convert the matrix into a matrix of bytes appropriate for
-//        // this file extension
-//        MatOfByte mob = new MatOfByte();
-//        Imgcodecs.imencode(fileExtension, matrix, mob);
-//        // convert the "matrix of bytes" into a byte array
-//        byte[] byteArray = mob.toArray();
-//        BufferedImage bufImage = null;
-//        try {
-//            InputStream in = new ByteArrayInputStream(byteArray);
-//            bufImage = ImageIO.read(in);
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        return bufImage;
-//    }
-//
-//    /**
-//     * BufferedImage转换成Mat
-//     *
-//     * @param original
-//     *            要转换的BufferedImage
-//     * @param imgType
-//     *            bufferedImage的类型 如 BufferedImage.TYPE_3BYTE_BGR
-//     * @param matType
-//     *            转换成mat的type 如 CvType.CV_8UC3
-//     */
-//    public static Mat BufImg2Mat (BufferedImage original, int imgType, int matType) {
-//        if (original == null) {
-//            throw new IllegalArgumentException("original == null");
-//        }
-//
-//        // Don't convert if it already has correct type
-//        if (original.getType() != imgType) {
-//
-//            // Create a buffered image
-//            BufferedImage image = new BufferedImage(original.getWidth(), original.getHeight(), imgType);
-//
-//            // Draw the image onto the new buffer
-//            Graphics2D g = image.createGraphics();
-//            try {
-//                g.setComposite(AlphaComposite.Src);
-//                g.drawImage(original, 0, 0, null);
-//            } finally {
-//                g.dispose();
-//            }
-//        }
-//
-//        byte[] pixels = ((DataBufferByte) original.getRaster().getDataBuffer()).getData();
-//        Mat mat = Mat.eye(original.getHeight(), original.getWidth(), matType);
-//        mat.put(0, 0, pixels);
-//        return mat;
-//    }
-//}

+ 0 - 217
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/ParseInstallPackageUtil.java

@@ -1,217 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import brut.androlib.res.decoder.AXmlResourceParser;
-import com.dd.plist.NSDictionary;
-import com.dd.plist.NSString;
-import com.dd.plist.PropertyListParser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.XmlPullParser;
-
-import java.io.*;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipInputStream;
-
-import static android.util.TypedValue.*;
-
-/**
- *  Created by JQ.bi on 2020.9.9
- */
-public class ParseInstallPackageUtil {
-
-    private static final Logger log = LoggerFactory.getLogger(ParseInstallPackageUtil.class);
-
-    private static final float[] RADIX_MULTS = {0.00390625F, 3.051758E-005F, 1.192093E-007F, 4.656613E-010F};
-    private static final String[] DIMENSION_UNITS = {"px", "dip", "sp", "pt", "in", "mm", "", ""};
-    private static final String[] FRACTION_UNITS = {"%", "%p", "", "", "", "", "", ""};
-
-    /**
-     * 解析apk文件
-     *
-     * @param apkUrl apk的文件路径
-     * @return
-     */
-    public static Map<String, String> parseAPK(String apkUrl) {
-        Map<String, String> map = new HashMap();
-        ZipFile zipFile;
-        try {
-            zipFile = new ZipFile(apkUrl);
-            Enumeration<?> enumeration = zipFile.entries();
-            ZipEntry zipEntry = null;
-            while (enumeration.hasMoreElements()) {
-                zipEntry = (ZipEntry) enumeration.nextElement();
-                if (zipEntry.isDirectory()) {
-                } else {
-                    if ("androidmanifest.xml".equals(zipEntry.getName().toLowerCase())) {
-                        AXmlResourceParser parser = new AXmlResourceParser();
-                        parser.open(zipFile.getInputStream(zipEntry));
-                        while (true) {
-                            int type = parser.next();
-                            if (type == XmlPullParser.END_DOCUMENT) {
-                                break;
-                            }
-                            String name = parser.getName();
-                            if (null != name && "manifest".equals(name.toLowerCase())) {
-                                for (int i = 0; i != parser.getAttributeCount(); i++) {
-                                    if ("versionName".equals(parser.getAttributeName(i))) {
-                                        String versionName = getAttributeValue(parser, i);
-                                        if (null == versionName) {
-                                            versionName = "";
-                                        }
-                                        map.put("versionName", versionName);
-                                    } else if ("package".equals(parser.getAttributeName(i))) {
-                                        String packageName = getAttributeValue(parser, i);
-                                        if (null == packageName) {
-                                            packageName = "";
-                                        }
-                                        map.put("package", packageName);
-                                    } else if ("versionCode".equals(parser.getAttributeName(i))) {
-                                        String versionCode = getAttributeValue(parser, i);
-                                        if (null == versionCode) {
-                                            versionCode = "";
-                                        }
-                                        map.put("versionCode", versionCode);
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                    }
-
-                }
-            }
-            zipFile.close();
-        } catch (Exception e) {
-            log.info("APK解析异常!");
-        }
-        return map;
-    }
-
-    /**
-     * 解析ipa文件
-     *
-     * @param ipaUrl ipa的文件路径
-     * @return
-     */
-    public static Map<String, String> parseIpa(String ipaUrl) {
-        Map<String, String> map = new HashMap();
-        try {
-            File file = new File(ipaUrl);
-            InputStream is = new FileInputStream(file);
-            ZipInputStream zipIns = new ZipInputStream(is);
-            ZipEntry ze;
-            InputStream infoIs = null;
-            while ((ze = zipIns.getNextEntry()) != null) {
-                if (!ze.isDirectory()) {
-                    String name = ze.getName();
-                    if (null != name && name.toLowerCase().contains(".app/info.plist")) {
-                        ByteArrayOutputStream _copy = new ByteArrayOutputStream();
-                        int chunk = 0;
-                        byte[] data = new byte[1024];
-                        while (-1 != (chunk = zipIns.read(data))) {
-                            _copy.write(data, 0, chunk);
-                        }
-                        infoIs = new ByteArrayInputStream(_copy.toByteArray());
-                        break;
-                    }
-                }
-            }
-
-            NSDictionary rootDict = (NSDictionary) PropertyListParser.parse(infoIs);
-
-            // 如果想要查看有哪些key ,可以把下面注释放开
-//            for (String keyName : rootDict.allKeys()) {
-//                System.out.println(keyName + ":" + rootDict.get(keyName).toString());
-//            }
-
-            // 应用包名
-            NSString parameters = (NSString) rootDict.get("CFBundleIdentifier");
-            map.put("package", parameters.toString());
-            // 应用版本名
-            parameters = (NSString) rootDict.objectForKey("CFBundleShortVersionString");
-            map.put("versionName", parameters.toString());
-            // 应用版本号
-            parameters = (NSString) rootDict.get("CFBundleVersion");
-            map.put("versionCode", parameters.toString());
-
-            infoIs.close();
-            is.close();
-            zipIns.close();
-
-        } catch (Exception e) {
-            log.info("ipa包解析异常!");
-        }
-        return map;
-    }
-
-
-    private static String getAttributeValue(AXmlResourceParser parser, int index) {
-
-        int type = parser.getAttributeValueType(index);
-        int data = parser.getAttributeValueData(index);
-        if (type == TYPE_STRING) {
-            return parser.getAttributeValue(index);
-        }
-        if (type == TYPE_ATTRIBUTE) {
-            return String.format("?%s%08X", getPackage(data), data);
-        }
-        if (type == TYPE_REFERENCE) {
-            return String.format("@%s%08X", getPackage(data), data);
-        }
-        if (type == TYPE_FLOAT) {
-            return String.valueOf(Float.intBitsToFloat(data));
-        }
-        if (type == TYPE_INT_HEX) {
-            return String.format("0x%08X", data);
-        }
-        if (type == TYPE_INT_BOOLEAN) {
-            return data != 0 ? "true" : "false";
-        }
-        if (type == TYPE_DIMENSION) {
-            return Float.toString(complexToFloat(data)) + DIMENSION_UNITS[data & COMPLEX_UNIT_MASK];
-        }
-        if (type == TYPE_FRACTION) {
-            return Float.toString(complexToFloat(data)) + FRACTION_UNITS[data & COMPLEX_UNIT_MASK];
-        }
-        if (type >= TYPE_FIRST_COLOR_INT && type <= TYPE_LAST_COLOR_INT) {
-            return String.format("#%08X", data);
-        }
-        if (type >= TYPE_FIRST_INT && type <= TYPE_LAST_INT) {
-            return String.valueOf(data);
-        }
-        return String.format("<0x%X, type 0x%02X>", data, type);
-    }
-
-    private static String getPackage(int id) {
-        if (id >>> 24 == 1) {
-            return "android:";
-        }
-        return "";
-    }
-
-    private static float complexToFloat(int complex) {
-        return (float) (complex & 0xFFFFFF00) * RADIX_MULTS[(complex >> 4) & 3];
-    }
-
-    public static void printMap(Map<String, String> map) {
-        for (String key : map.keySet()) {
-            log.info(key + ":" + map.get(key));
-        }
-
-    }
-
-    public static void main(String[] args) {
-
-        System.out.println("************解析apk开始****************");
-        String apkUrl = "C:\\Users\\Arc\\Desktop\\YouYuan_1119929.apk";
-        Map<String, String> mapApk = parseAPK(apkUrl);
-        for (String key : mapApk.keySet()) {
-            System.out.println(key + ":" + mapApk.get(key));
-        }
-        System.out.println("************解析apk结束****************");
-    }
-}

+ 0 - 95
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/PermissionDataUtil.java

@@ -1,95 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import cn.com.ctop.common.module.entity.SysPermission;
-import org.jeecg.common.util.oConvertUtils;
-
-import java.util.List;
-
-/**
- * @Author: scott
- * @Date: 2019-04-03
- */
-public class PermissionDataUtil {
-
-	/**
-	 * 智能处理错误数据,简化用户失误操作
-	 *
-	 * @param permission
-	 */
-	public static SysPermission intelligentProcessData(SysPermission permission) {
-		if (permission == null) {
-			return null;
-		}
-
-		// 组件
-		if (oConvertUtils.isNotEmpty(permission.getComponent())) {
-			String component = permission.getComponent();
-			if (component.startsWith("/")) {
-				component = component.substring(1);
-			}
-			if (component.startsWith("views/")) {
-				component = component.replaceFirst("views/", "");
-			}
-			if (component.startsWith("src/views/")) {
-				component = component.replaceFirst("src/views/", "");
-			}
-			if (component.endsWith(".vue")) {
-				component = component.replace(".vue", "");
-			}
-			permission.setComponent(component);
-		}
-
-		// 请求URL
-		if (oConvertUtils.isNotEmpty(permission.getUrl())) {
-			String url = permission.getUrl();
-			if (url.endsWith(".vue")) {
-				url = url.replace(".vue", "");
-			}
-			if (!url.startsWith("http") && !url.startsWith("/")&&!url.trim().startsWith("{{")) {
-				url = "/" + url;
-			}
-			permission.setUrl(url);
-		}
-
-		// 一级菜单默认组件
-		if (0 == permission.getMenuType() && oConvertUtils.isEmpty(permission.getComponent())) {
-			// 一级菜单默认组件
-			permission.setComponent("layouts/RouteView");
-		}
-		return permission;
-	}
-
-	/**
-	 * 如果没有index页面 需要new 一个放到list中
-	 * @param metaList
-	 */
-	public static void addIndexPage(List<SysPermission> metaList) {
-		boolean hasIndexMenu = false;
-		for (SysPermission sysPermission : metaList) {
-			if("首页".equals(sysPermission.getName())) {
-				hasIndexMenu = true;
-				break;
-			}
-		}
-		if(!hasIndexMenu) {
-			metaList.add(0,new SysPermission(true));
-		}
-	}
-
-	/**
-	 * 判断是否授权首页
-	 * @param metaList
-	 * @return
-	 */
-	public static boolean hasIndexPage(List<SysPermission> metaList){
-		boolean hasIndexMenu = false;
-		for (SysPermission sysPermission : metaList) {
-			if("首页".equals(sysPermission.getName())) {
-				hasIndexMenu = true;
-				break;
-			}
-		}
-		return hasIndexMenu;
-	}
-
-}

+ 0 - 51
jeecg-boot-common/src/main/java/cn/com/ctop/common/module/utils/RandomUtil.java

@@ -1,51 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import java.util.Random;
-
-public class RandomUtil {
-
-    public static String verifyCode() {
-
-        char[] c = charArray();//获取包含26个字母大小写和数字的字符数组
-
-        Random rd = new Random();
-        String code = "#";
-        for (int k = 0; k < 4; k++) {
-            int index = rd.nextInt(c.length);//随机获取数组长度作为索引
-            code += c[index];//循环添加到字符串后面
-        }
-        return code;
-    }
-
-
-    public static String verifyCodeV2() {
-
-        char[] c = charArray();//获取包含26个字母大小写和数字的字符数组
-
-        Random rd = new Random();
-        String code = "";
-        for (int k = 0; k < 4; k++) {
-            int index = rd.nextInt(c.length);//随机获取数组长度作为索引
-            code += c[index];//循环添加到字符串后面
-        }
-        return code;
-    }
-
-    private static char[] charArray() {
-        int i = 1234567890;
-        String s = "qwertyuiopasdfghjklzxcvbnm";
-        String S = s.toUpperCase();
-        String word = s + S + i;
-        char[] c = word.toCharArray();
-
-        return c;
-    }
-
-    public static void main(String[] args) {
-        for (int i = 0; i < 1000; i++) {
-            System.err.println(verifyCodeV2());
-        }
-
-    }
-
-}

+ 0 - 122
jeecg-boot-common/src/main/resources/application.yml

@@ -1,122 +0,0 @@
-server:
-    port: 7003
-spring:
-    application:
-        name: jeecg-common
-    main:
-        allow-bean-definition-overriding: true
-
-
-#jeecg专用配置
-jeecg:
-    elasticsearch:
-        cluster-nodes:
-        check-enabled: false
-    uploadType:
-    oss:
-        endpoint:
-        accessKey:
-        secretKey:
-        bucketName:
-        staticDomain:
-    sms:
-        accessKeyId:
-        accessKeySecret:
-    minio:
-        minio_url:
-        minio_name:
-        minio_pass:
-        bucketName:
-    ffmpeg:
-        bin: D:\java\ffmpeg\bin\ffmpeg.exe
-    path:
-        #文件上传根目录 设置
-        #文件上传根目录 设置
-        upload: /data/upload
-        #webapp文件路径
-        webapp: /data/webapp
-        video-upload: /data/upload/video/
-        image-upload: /data/upload/image/
-        kuaishou-agent-image: D://temp.png
-        kuaishou-account-captcha-image: D://captcha.png
-        chrome-driver: D://chromedriver.exe
-        csv-upload: /data/upload/csv/
-        report-history: /data/report/history/
-        report-daily: /data/report/daily/
-kuaishou:
-    api-url: https://ad.e.kuaishou.com
-    auth-url: https://ad.e.kuaishou.com
-    appid: 27
-    third-appid: 328
-    oauth-type: agent
-    secret: QovprB1tNhXptgDc
-    third-secret: 1iFTBiMdohkyEQQs
-    callback-url: http://adsp.c-top.com.cn:8080/jeecg-boot/kuaishou
-    third-callback-url: http://callback.shyouteng.com.cn/kuaishou
-    apk-sava-path: /mnt/file/apk
-    image-sava-path: /mnt/file/image
-    video-sava-path: /mnt/file/video
-    model-video-src-path: /mnt/data/src/
-    model-video-fill-path: /mnt/data/fill/
-    model-video-final-path: /mnt/data/final/
-    group-control:
-        path: http://39.106.184.70
-        port: 4723
-logging:
-    level:
-        root: info
-    config: classpath:logback-test.xml
-chrome:
-    script:
-        clean: sh /mnt/webapp/cleanProcess.sh
-cas:
-    prefixUrl:
-oss:
-    replace:
-        replace-value: oss-cn-beijing
-        replace-old-value: oss-cn-beijing
-        download: /mnt/file/video/
-zip:
-    local:
-        download-path: /data/unzip/
-bytedance:
-    appId: 1635316529903624
-    secret: 0c51523e90d6166418fc8421a4896808e90e26f4
-    url:
-        auth-prefix: https://ad.oceanengine.com/openapi
-        api-prefix: https://ad.oceanengine.com/open_api
-        callback-url: http://adsp.c-top.com.cn:8080/jeecg-boot/bytedance
-        refresh-token: /oauth2/refresh_token
-        advertiser-info: /2/advertiser/public_info/
-        ad-get: /2/ad/get/
-        ad-create: /2/ad/create/
-        ad-update: /2/ad/update/
-        ad-update-status: /2/ad/update/status/
-        ad-update-bid: /2/ad/update/bid/
-        ad-update-budget: /2/ad/update/budget/
-        ad-update-reject-reason: 2/ad/reject_reason/
-        campaign-get: /2/campaign/get/
-        campaign-create: /2/campaign/create/
-        campaign-update-status: /2/campaign/update/status/
-        campaign-update: /2/campaign/update/
-        dmp-custom-audience-select: /2/dmp/custom_audience/select/
-        file-video-ad: /2/file/video/ad/
-        file-image-ad: /2/file/image/ad/
-        creative-update-status: /2/creative/update/status/
-        creative-material-get: /2/creative/material/read/
-        creative-create-v2: /2/creative/create_v2/
-        creative-get: /2/creative/get/
-        creative-read: /2/creative/read_v2/
-        creative-update: /2/creative/update_v2/
-        creative-reject-reason: /2/creative/reject_reason/
-        advertiser-report-get: /2/report/advertiser/get/
-        campaign-report-get: /2/report/campaign/get/
-        ad-report-get: /2/report/ad/get/
-        ad-creative-get: /2/report/creative/get/
-        advertiser-fund-daily-stat: /2/advertiser/fund/daily_stat/
-ai:
-    callback:
-        callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
-        callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
-xxl-job:
-    requestUrl: http://jiaoyangapi.shyouteng.com.cn

+ 0 - 8
jeecg-boot-common/src/main/resources/config.properties

@@ -1,8 +0,0 @@
-#Tencent config
-qcloud.accessKeyId=AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets
-qcloud.accessKeySecret=1rkPz7JNoXk8sJevPaeYHWqfkQXBGh
-
-#Tencent COS config
-qcloud.cos.endpoint=https://cos.ap-chongqing.myqcloud.com
-qcloud.cos.bucketName=media-1301855440
-qcloud.cos.folder=model/video/

+ 0 - 57
jeecg-boot-common/src/main/resources/logback-test.xml

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="10 seconds">
-
-    <contextName>logback</contextName>
-
-
-    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
-    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
-
-    <!-- 定义日志存储的路径,不要配置相对路径 -->
-    <property name="FILE_PATH" value="/data/webapp/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
-
-    <!-- 控制台输出日志 -->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <!-- 日志级别过滤INFO以下 -->
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>INFO</level>
-        </filter>
-        <encoder>
-            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
-    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
-            <fileNamePattern>${FILE_PATH}</fileNamePattern>
-
-            <!-- keep 15 days' worth of history -->
-            <maxHistory>30</maxHistory>
-
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <!-- 日志文件的最大大小 -->
-                <maxFileSize>2MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-
-            <!-- 超出删除老文件 -->
-            <totalSizeCap>1GB</totalSizeCap>
-        </rollingPolicy>
-
-        <encoder>
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- project default level -->
-    <logger name="net.sh.rgface.serive" level="ERROR"/>
-
-    <!-- 日志输出级别 -->
-    <root level="INFO">
-        <appender-ref ref="console"/>
-        <appender-ref ref="rollingFile"/>
-    </root>
-</configuration>

+ 0 - 13
jeecg-boot-common/src/test/java/com/example/jeecgbootcommon/JeecgBootCommonApplicationTests.java

@@ -1,13 +0,0 @@
-package com.example.jeecgbootcommon;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-class JeecgBootCommonApplicationTests {
-
-    @Test
-    void contextLoads() {
-    }
-
-}

+ 102 - 0
jeecg-boot-module-system/pom.xml

@@ -50,6 +50,107 @@
 				</exclusion>
 			</exclusions>
 		</dependency>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>easyexcel</artifactId>
+			<version>1.1.2-beat1</version>
+		</dependency>
+		<dependency>
+			<groupId>cn.com.ctop</groupId>
+			<artifactId>opencv</artifactId>
+			<version>4.2.0</version>
+			<scope>system</scope>
+			<systemPath>${project.basedir}/src/main/resources/lib/opencv-4.2.0.jar</systemPath>
+		</dependency>
+		<!-- commons -->
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>${commons.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+			<version>${commons.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.bstek.ureport</groupId>
+			<artifactId>ureport2-console</artifactId>
+			<version>2.2.9</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.codehaus.groovy</groupId>
+			<artifactId>groovy</artifactId>
+			<version>${groovy.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.github.binarywang</groupId>
+			<artifactId>weixin-java-cp</artifactId>
+			<version>3.6.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>thirtpart</groupId>
+			<artifactId>jave</artifactId>
+			<version>1.0</version>
+			<scope>system</scope>
+			<systemPath>${project.basedir}/src/main/resources/lib/jave-1.0.jar</systemPath>
+		</dependency>
+
+		<dependency>
+			<groupId>com.tencentcloudapi</groupId>
+			<artifactId>tencentcloud-sdk-java</artifactId>
+			<version>3.1.62</version><!-- 注:这里只是示例版本号,请获取并替换为 最新的版本号 -->
+		</dependency>
+
+		<dependency>
+			<groupId>com.qcloud</groupId>
+			<artifactId>cos_api</artifactId>
+			<version>5.6.25</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sourceforge.javacsv</groupId>
+			<artifactId>javacsv</artifactId>
+			<version>2.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.pdfbox</groupId>
+			<artifactId>fontbox</artifactId>
+			<version>2.0.15</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.github.tony19</groupId>
+			<artifactId>apktool-lib</artifactId>
+			<version>1.4.4-3</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.googlecode.plist</groupId>
+			<artifactId>dd-plist</artifactId>
+			<version>1.16</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>io.appium</groupId>
+			<artifactId>java-client</artifactId>
+			<version>7.2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.bytedeco</groupId>
+			<artifactId>javacv</artifactId>
+			<version>1.4.2</version>
+		</dependency>
+		<dependency>
+			<groupId>org.bytedeco</groupId>
+			<artifactId>javacv-platform</artifactId>
+			<version>1.4.2</version>
+		</dependency>
+
 	</dependencies>
 
 	<build>
@@ -60,6 +161,7 @@
 				<configuration>
 					<!--微服务模式下修改为true,跳过此打包插件,否则微服务模块无法引用-->
 					<skip>true</skip>
+					<includeSystemScope>true</includeSystemScope>
 				</configuration>
 			</plugin>
 		</plugins>

+ 354 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java

@@ -0,0 +1,354 @@
+package cn.com.ctop.alarm.modules.constant;
+
+import cn.com.ctop.alarm.modules.entity.RuleGroup;
+import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.xxl.job.core.enums.NoEn;
+import lombok.extern.slf4j.Slf4j;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * @ClassName MatchLogic
+ * @Author ZHAOXA
+ * @date 2020-11-17 10:54
+ */
+@Slf4j
+public class MatchLogic {
+    /**
+     * @param indicator      数据类型
+     * @param condition 条件
+     * @param threshold 阈值
+     * @param value     比对值
+     * @return boolean
+     * @throws
+     * @author ZHAOXA
+     */
+    public static boolean matchCondition(JSONObject indicator, String condition, String threshold, String value, JSONObject obj, String indicatorCode) {
+        //阈值数据类型类型
+        String type = indicator.getString("dataType");
+        try {
+            if (Check.isNull(threshold) || "[]".equals(threshold)) {
+                return false;
+            }
+            if (Check.isNull(value) || "[]".equals(value)) {
+                //洗出的数据为空的时候不报警,若想报警则改成true
+                obj.put("isNull", false);
+                return false;
+            }
+            obj.put("isNull", false);
+            if ("number".equals(type)) {
+                BigDecimal bigThr = new BigDecimal(threshold);
+                BigDecimal bigVal = new BigDecimal(value);
+                switch (condition) {
+                    case "equal":
+                        return bigVal.compareTo(bigThr) == 0;
+                    case "not_equal":
+                        return bigVal.compareTo(bigThr) != 0;
+                    case "greater":
+                        return bigVal.compareTo(bigThr) > 0;
+                    case "less":
+                        return bigVal.compareTo(bigThr) < 0;
+                    case "greater_equal":
+                        return bigVal.compareTo(bigThr) >= 0;
+                    case "less_equal":
+                        return bigVal.compareTo(bigThr) <= 0;
+                    default:
+                        log.warn("关系不匹配 type={},condition={},threshold={},value={},", type, condition, threshold, value);
+                        break;
+                }
+            } else if ("string".equals(type)) {
+                if (threshold.contains("[")) {
+                    List<String> thresholds = strToList(threshold);
+                    if ("equal".equals(condition)) {
+                        return value.equals(thresholds.get(0));
+                    } else if ("not_equal".equals(condition)) {
+                        return !value.equals(thresholds.get(0));
+                    } else if ("contain".equals(condition)) {
+                        if (thresholds.toString().contains(value)) {
+                            return true;
+                        }
+                    } else if ("no_contain".equals(condition)) {
+                        if (!thresholds.toString().contains(value)) {
+                            return true;
+                        }
+                    }
+                } else {
+                    switch (condition) {
+                        case "equal":
+                            return value.equals(threshold);
+                        case "not_equal":
+                            return !value.equals(threshold);
+                        case "contain":
+                            return value.contains(threshold);
+                        case "no_contain":
+                            return !value.contains(threshold);
+                        default:
+                            log.warn("关系不匹配 type={},condition={},threshold={},value={},", type, condition, threshold, value);
+                            return false;
+                    }
+                }
+            } else {
+                /**
+                 不包含逻辑根据指标分两种:
+                 1、大部分数组型指标阈值逻辑:所设的阈值中,存在任一目标则不报警,都不存在时则报警,出现阈值之外的亦报警
+                 2、排除人群包、排除流量包逻辑:所选必须都存在,否则报警
+
+                 包含逻辑通用: 任一存在则报警
+                 */
+                if (value.contains("[") && threshold.contains("[")) {
+                    String logicalType = indicator.getString("logicalType");
+                    List<String> values = strToList(value);
+                    List<String> thresholds = strToList(threshold);
+                    //包含 任一存在则报警
+                    if ("contain".equals(condition)) {
+                        //人群包、流量包判断的是对象
+                        if (NoEn.NO1.valueStr().equals(logicalType) || "retargetingTagsInclude".equals(indicatorCode) || "population".equals(indicatorCode) || "district".equals(indicatorCode) || "region".equals(indicatorCode)) {
+                            for (String thr : thresholds) {
+                                if (values.contains(thr)) {
+                                    return true;
+                                }
+                            }
+                        } else {
+                            for (String thr : thresholds) {
+                                if (values.toString().contains(thr)) {
+                                    return true;
+                                }
+                            }
+                        }
+                    } else {
+                        //排除人群包、流量排除包逻辑,不包含,所选必须都存在,否则报警
+                        if (NoEn.NO1.valueStr().equals(logicalType)) {
+                            if (values.size() != thresholds.size()) {
+                                return true;
+                            }
+                            values.sort(Comparator.comparing(String::hashCode));
+                            thresholds.sort(Comparator.comparing(String::hashCode));
+                            return !values.toString().equals(thresholds.toString());
+
+                        } else {
+                            //不包含,阈值中,存在任一目标则不报警,都不存在时则报警,出现阈值之外的亦报警
+                            boolean flag = true;
+                            //人群包判断是否存在该对象
+                            for (String v : values) {
+                                if (threshold.contains(v)) {
+                                    flag = false;
+                                } else {
+                                    return true;
+                                }
+                            }
+                            return flag;
+                        }
+                    }
+                } else if (threshold.contains("[")) {
+                    List<String> thresholds = strToList(threshold);
+                    if ("contain".equals(condition)) {
+                        for (String thr : thresholds) {
+                            if (value.toString().contains(thr)) {
+                                return true;
+                            }
+                        }
+                    } else {
+                        for (String thr : thresholds) {
+                            if (!value.contains(thr)) {
+                                return true;
+                            }
+                        }
+                    }
+                } else {
+                    if ("contain".equals(condition)) {
+                        return value.contains(threshold);
+                    } else {
+                        return !value.contains(threshold);
+                    }
+                }
+            }
+        } catch (
+                Exception e) {
+            log.error("条件匹配异常,入参为:type={},condition={},threshold={},value={},", type, condition, threshold, value, e);
+        }
+        return false;
+    }
+
+    /**
+     * 整理发送的消息
+     */
+    public static String getMsg(RuleGroup ruleGroup, JSONObject user, JSONObject obj, boolean isPause, String accountName) {
+        Long creativeId = obj.getLong("creativeId");
+        Long planId = obj.getLong("planId");
+        Long accountId = obj.getLong("accountId");
+        boolean isNull = obj.getBoolean("isNull");
+        StringBuffer header = new StringBuffer();
+        header.append(ruleGroup.getGroupName()).append("预警").append("<br/>").
+                append("预警账户:").append(accountId).append(",授权名称为:").append(accountName).append("<br/>");
+        if (!Check.isNull(planId) && !Check.isNull(creativeId)) {
+            header.append("预警计划:").append(planId).append("<br/>").append("预警创意:").append(creativeId).append("<br/>");
+        } else if (!Check.isNull(planId) && Check.isNull(creativeId)) {
+            header.append("预警计划:").append(planId).append("<br/>");
+        } else if (!Check.isNull(creativeId)) {
+            header.append("预警创意:").append(creativeId).append("<br/>");
+        }
+        if (isNull) {
+            header.append("该规则未匹配到投放数据").append("<br/>");
+        }
+        if (isPause) {
+            header.append("现已被关停,请您及时查看并调整!");
+        } else {
+            header.append("请您及时查看并调整!");
+        }
+        return header.toString();
+    }
+
+    /**
+     * 整理发送的消息
+     */
+    public static String getMessage(String ruleGroupName, Long accountId, String accountName, String type, String codes, boolean isNull) {
+        StringBuffer buf = new StringBuffer();
+        buf.append(ruleGroupName).append("预警").append("<br/>").
+                append("预警账户:").append(accountId).append(",授权名称:").append(accountName).append("<br/>");
+        if ("plan".equals(type)) {
+            buf.append("预警计划:").append(codes).append("<br/>");
+        } else if ("unit".equals(type)) {
+            buf.append("预警组:").append(codes).append("<br/>");
+        } else if ("creative".equals(type)) {
+            buf.append("预警创意:").append(codes).append("<br/>");
+        }
+        if (isNull) {
+            buf.append("该规则未匹配到投放数据").append("<br/>");
+        }
+        return buf.toString();
+    }
+
+    //拆分逗号拼接数据
+    public static List<String> strToList(String strings) {
+        List<String> ids = null;
+        try {
+            if (Check.isNull(strings)) {
+                return null;
+            }
+            JSONObject job = new JSONObject();
+            job.put("list", strings);
+            ids = new ArrayList<>();
+            JSONArray idList = job.getJSONArray("list");
+            for (Object id : idList) {
+                ids.add(String.valueOf(id));
+            }
+        } catch (Exception e) {
+            log.error("数据({})转list异常", strings, e);
+        }
+        return ids;
+    }
+
+    public static JSONArray getSendData(JSONArray accountDatas, JSONArray planDatas, JSONArray creativeDatas, JSONArray targetDatas) {
+        JSONArray sendData = new JSONArray();
+        if (!Check.isNull(accountDatas) && Check.isNull(planDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
+            sendData = accountDatas;
+        } else {
+            if (!Check.isNull(planDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
+                sendData = planDatas;
+            } else if (!Check.isNull(creativeDatas) && Check.isNull(planDatas) && Check.isNull(targetDatas)) {
+                sendData = creativeDatas;
+            } else if (!Check.isNull(targetDatas) && Check.isNull(planDatas) && Check.isNull(creativeDatas)) {
+                sendData = targetDatas;
+            } else if (!Check.isNull(planDatas) && !Check.isNull(creativeDatas) && !Check.isNull(targetDatas)) {
+                for (int i = 0; i < planDatas.size(); i++) {
+                    Long pplanId = planDatas.getJSONObject(i).getLong("planId");
+                    for (int k = 0; k < targetDatas.size(); k++) {
+                        Long tplanId = targetDatas.getJSONObject(k).getLong("planId");
+                        for (int j = 0; j < creativeDatas.size(); j++) {
+                            Long cplanId = creativeDatas.getJSONObject(j).getLong("planId");
+                            if (cplanId.equals(tplanId) && cplanId.equals(pplanId)) {
+                                sendData.add(creativeDatas.getJSONObject(j));
+                            }
+                        }
+                    }
+                }
+            } else if (!Check.isNull(planDatas) && !Check.isNull(targetDatas) && Check.isNull(creativeDatas)) {
+                for (int i = 0; i < planDatas.size(); i++) {
+                    Long pplanId = planDatas.getJSONObject(i).getLong("planId");
+                    for (int k = 0; k < targetDatas.size(); k++) {
+                        Long tplanId = targetDatas.getJSONObject(k).getLong("planId");
+                        if (tplanId.equals(pplanId)) {
+                            sendData.add(targetDatas.getJSONObject(k));
+                        }
+                    }
+                }
+            } else if (!Check.isNull(planDatas) && Check.isNull(targetDatas) && !Check.isNull(creativeDatas)) {
+                for (int i = 0; i < planDatas.size(); i++) {
+                    Long pplanId = planDatas.getJSONObject(i).getLong("planId");
+                    for (int k = 0; k < creativeDatas.size(); k++) {
+                        Long cplanId = creativeDatas.getJSONObject(k).getLong("planId");
+                        if (cplanId.equals(pplanId)) {
+                            sendData.add(creativeDatas.getJSONObject(k));
+                        }
+                    }
+                }
+            } else if (Check.isNull(planDatas) && !Check.isNull(targetDatas) && !Check.isNull(creativeDatas)) {
+                for (int i = 0; i < targetDatas.size(); i++) {
+                    Long tplanId = targetDatas.getJSONObject(i).getLong("planId");
+                    for (int k = 0; k < creativeDatas.size(); k++) {
+                        Long cplanId = creativeDatas.getJSONObject(k).getLong("planId");
+                        if (cplanId.equals(tplanId)) {
+                            sendData.add(creativeDatas.getJSONObject(k));
+                        }
+                    }
+                }
+            }
+        }
+        return sendData;
+    }
+
+    /**
+     * 快手匹配达标数据
+     *
+     * @param
+     * @return com.alibaba.fastjson.JSONArray
+     * @throws
+     * @author ZHAOXA
+     */
+    public static JSONArray getKuaiShouSendData(JSONArray accountDatas, JSONArray planDatas, JSONArray groupDatas, JSONArray creativeDatas, JSONArray targetDatas) {
+        JSONArray sendData = new JSONArray();
+        if (!Check.isNull(accountDatas) && Check.isNull(groupDatas) && Check.isNull(planDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
+            sendData = accountDatas;
+        } else {
+            if (Check.isNull(planDatas)) {
+                if (!Check.isNull(groupDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
+                    sendData = groupDatas;
+                } else if (Check.isNull(groupDatas) && !Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
+                    sendData = creativeDatas;
+                } else if (Check.isNull(groupDatas) && Check.isNull(creativeDatas) && !Check.isNull(targetDatas)) {
+                    sendData = targetDatas;
+                }
+            } else {
+                if (Check.isNull(groupDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
+                    sendData = planDatas;
+                } else {
+                    for (int i = 0; i < planDatas.size(); i++) {
+                        Long planId = planDatas.getJSONObject(i).getLong("planId");
+                        if (!Check.isNull(targetDatas) && Check.isNull(groupDatas)) {
+                            for (int k = 0; k < targetDatas.size(); k++) {
+                                Long tgPlanId = targetDatas.getJSONObject(k).getLong("planId");
+                                if (tgPlanId.equals(planId)) {
+                                    sendData.add(creativeDatas.getJSONObject(k));
+                                }
+                            }
+                        } else if (Check.isNull(targetDatas) && !Check.isNull(groupDatas)) {
+                            for (int k = 0; k < groupDatas.size(); k++) {
+                                Long tgPlanId = groupDatas.getJSONObject(k).getLong("planId");
+                                if (tgPlanId.equals(planId)) {
+                                    sendData.add(creativeDatas.getJSONObject(k));
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return sendData;
+    }
+
+}

+ 289 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventSendController.java

@@ -0,0 +1,289 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventSend;
+import cn.com.ctop.alarm.modules.service.IAlarmEventSendService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 预警事件发送表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-29
+ */
+@Slf4j
+@Api(tags = "预警事件发送表")
+@RestController
+@RequestMapping("/alarm/alarmEventSend")
+public class AlarmEventSendController {
+    @Autowired
+    private IAlarmEventSendService alarmEventSendService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param alarmEventSend
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "预警事件发送表-分页列表查询")
+    @ApiOperation(value = "预警事件发送表-分页列表查询", notes = "预警事件发送表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<AlarmEventSend>> queryPageList(AlarmEventSend alarmEventSend,
+                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                       HttpServletRequest req) {
+        Result<IPage<AlarmEventSend>> result = new Result<>();
+        QueryWrapper<AlarmEventSend> queryWrapper = QueryGenerator.initQueryWrapper(alarmEventSend, req.getParameterMap());
+        Page<AlarmEventSend> page = new Page<AlarmEventSend>(pageNo, pageSize);
+        IPage<AlarmEventSend> pageList = alarmEventSendService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @AutoLog(value = "预警事件发送表-分页列表查询")
+    @ApiOperation(value = "预警事件发送表-分页列表查询", notes = "预警事件发送表-分页列表查询")
+    @GetMapping(value = "/pageList")
+    public Result<Object> queryPageLists(AlarmEventSend alarmEventSend,
+                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                         HttpServletRequest req) {
+        try {
+            QueryWrapper<AlarmEventSend> queryWrapper = new QueryWrapper<>();
+            if (!Check.isNull(alarmEventSend.getGroupName())) {
+                queryWrapper.like("group_name", alarmEventSend.getGroupName());
+            }
+            if (!Check.isNull(alarmEventSend.getUserId())) {
+                queryWrapper.like("user_id", alarmEventSend.getUserId());
+            }
+            if (!Check.isNull(alarmEventSend.getAlarmDetail())) {
+                queryWrapper.like("alarm_detail", alarmEventSend.getAlarmDetail());
+            }
+            if (!Check.isNull(alarmEventSend.getMediaType())) {
+                queryWrapper.like("media_type", alarmEventSend.getMediaType());
+            }
+            if (!Check.isNull(alarmEventSend.getAccountId())) {
+                queryWrapper.eq("account_id", alarmEventSend.getAccountId());
+            }
+            if (!Check.isNull(alarmEventSend.getRuleDimension())) {
+                queryWrapper.eq("rule_dimension", alarmEventSend.getRuleDimension());
+            }
+            queryWrapper.orderByDesc("create_time");
+            PageHelper.startPage(pageNo, pageSize);
+            List<AlarmEventSend> list = alarmEventSendService.list(queryWrapper);
+            PageInfo<AlarmEventSend> pageInfo = new PageInfo<>(list);
+            return Result.ok(pageInfo);
+        } catch (Exception e) {
+            log.error("预警历史发送数据-分页列表查询异常", e);
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 添加
+     *
+     * @param alarmEventSend
+     * @return
+     */
+    @AutoLog(value = "预警事件发送表-添加")
+    @ApiOperation(value = "预警事件发送表-添加", notes = "预警事件发送表-添加")
+    @PostMapping(value = "/add")
+    public Result<AlarmEventSend> add(@RequestBody AlarmEventSend alarmEventSend) {
+        Result<AlarmEventSend> result = new Result<>();
+        try {
+            alarmEventSendService.save(alarmEventSend);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param alarmEventSend
+     * @return
+     */
+    @AutoLog(value = "预警事件发送表-编辑")
+    @ApiOperation(value = "预警事件发送表-编辑", notes = "预警事件发送表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<AlarmEventSend> edit(@RequestBody AlarmEventSend alarmEventSend) {
+        Result<AlarmEventSend> result = new Result<AlarmEventSend>();
+        AlarmEventSend alarmEventSendEntity = alarmEventSendService.getById(alarmEventSend.getAlarmSendId());
+        if (alarmEventSendEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = alarmEventSendService.updateById(alarmEventSend);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "预警事件发送表-通过id删除")
+    @ApiOperation(value = "预警事件发送表-通过id删除", notes = "预警事件发送表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            alarmEventSendService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "预警事件发送表-批量删除")
+    @ApiOperation(value = "预警事件发送表-批量删除", notes = "预警事件发送表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<AlarmEventSend> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<AlarmEventSend> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.alarmEventSendService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "预警事件发送表-通过id查询")
+    @ApiOperation(value = "预警事件发送表-通过id查询", notes = "预警事件发送表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<AlarmEventSend> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<AlarmEventSend> result = new Result<>();
+        AlarmEventSend alarmEventSend = alarmEventSendService.getById(id);
+        if (alarmEventSend == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(alarmEventSend);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<AlarmEventSend> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                AlarmEventSend alarmEventSend = JSON.parseObject(deString, AlarmEventSend.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(alarmEventSend, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<AlarmEventSend> pageList = alarmEventSendService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "预警事件发送表列表");
+        mv.addObject(NormalExcelConstants.CLASS, AlarmEventSend.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("预警事件发送表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<AlarmEventSend> listAlarmEventSends = ExcelImportUtil.importExcel(file.getInputStream(), AlarmEventSend.class, params);
+                alarmEventSendService.saveBatch(listAlarmEventSends);
+                return Result.ok("文件导入成功!数据行数:" + listAlarmEventSends.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 248 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmRuleRecordController.java

@@ -0,0 +1,248 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.AlarmRuleRecord;
+import cn.com.ctop.alarm.modules.service.IAlarmRuleRecordService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 预警规则记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-01-18
+ */
+@Slf4j
+@Api(tags = "预警规则记录表")
+@RestController
+@RequestMapping("/kuaishou/alarmRuleRecord")
+public class AlarmRuleRecordController {
+    @Autowired
+    private IAlarmRuleRecordService alarmRuleRecordService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param alarmRuleRecord
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "预警规则记录表-分页列表查询")
+    @ApiOperation(value = "预警规则记录表-分页列表查询", notes = "预警规则记录表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<AlarmRuleRecord>> queryPageList(AlarmRuleRecord alarmRuleRecord,
+                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                        HttpServletRequest req) {
+        Result<IPage<AlarmRuleRecord>> result = new Result<>();
+        QueryWrapper<AlarmRuleRecord> queryWrapper = QueryGenerator.initQueryWrapper(alarmRuleRecord, req.getParameterMap());
+        Page<AlarmRuleRecord> page = new Page<AlarmRuleRecord>(pageNo, pageSize);
+        IPage<AlarmRuleRecord> pageList = alarmRuleRecordService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param alarmRuleRecord
+     * @return
+     */
+    @AutoLog(value = "预警规则记录表-添加")
+    @ApiOperation(value = "预警规则记录表-添加", notes = "预警规则记录表-添加")
+    @PostMapping(value = "/add")
+    public Result<AlarmRuleRecord> add(@RequestBody AlarmRuleRecord alarmRuleRecord) {
+        Result<AlarmRuleRecord> result = new Result<>();
+        try {
+            alarmRuleRecordService.save(alarmRuleRecord);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param alarmRuleRecord
+     * @return
+     */
+    @AutoLog(value = "预警规则记录表-编辑")
+    @ApiOperation(value = "预警规则记录表-编辑", notes = "预警规则记录表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<AlarmRuleRecord> edit(@RequestBody AlarmRuleRecord alarmRuleRecord) {
+        Result<AlarmRuleRecord> result = new Result<AlarmRuleRecord>();
+        AlarmRuleRecord alarmRuleRecordEntity = alarmRuleRecordService.getById(alarmRuleRecord.getId());
+        if (alarmRuleRecordEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = alarmRuleRecordService.updateById(alarmRuleRecord);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "预警规则记录表-通过id删除")
+    @ApiOperation(value = "预警规则记录表-通过id删除", notes = "预警规则记录表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            alarmRuleRecordService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "预警规则记录表-批量删除")
+    @ApiOperation(value = "预警规则记录表-批量删除", notes = "预警规则记录表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<AlarmRuleRecord> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<AlarmRuleRecord> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.alarmRuleRecordService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "预警规则记录表-通过id查询")
+    @ApiOperation(value = "预警规则记录表-通过id查询", notes = "预警规则记录表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<AlarmRuleRecord> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<AlarmRuleRecord> result = new Result<>();
+        AlarmRuleRecord alarmRuleRecord = alarmRuleRecordService.getById(id);
+        if (alarmRuleRecord == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(alarmRuleRecord);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<AlarmRuleRecord> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                AlarmRuleRecord alarmRuleRecord = JSON.parseObject(deString, AlarmRuleRecord.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(alarmRuleRecord, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<AlarmRuleRecord> pageList = alarmRuleRecordService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "预警规则记录表列表");
+        mv.addObject(NormalExcelConstants.CLASS, AlarmRuleRecord.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("预警规则记录表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<AlarmRuleRecord> listAlarmRuleRecords = ExcelImportUtil.importExcel(file.getInputStream(), AlarmRuleRecord.class, params);
+                alarmRuleRecordService.saveBatch(listAlarmRuleRecords);
+                return Result.ok("文件导入成功!数据行数:" + listAlarmRuleRecords.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 386 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountTemplateController.java

@@ -0,0 +1,386 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
+import cn.com.ctop.alarm.modules.entity.RuleTemplate;
+import cn.com.ctop.alarm.modules.entity.vo.TemplateAppliedVo;
+import cn.com.ctop.alarm.modules.service.IRuleAccountTemplateService;
+import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
+import cn.com.ctop.alarm.modules.service.IRuleTemplateService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.service.ISysRoleExtService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则模板
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Slf4j
+@Api(tags = "规则模板")
+@RestController
+@RequestMapping("/ruleAccountTemplate")
+public class RuleAccountTemplateController {
+    @Autowired
+    private IRuleAccountTemplateService ruleAccountTemplateService;
+    @Autowired
+    private IRuleTemplateService templateService;
+    @Autowired
+    private IRuleAccountThresholdService accountThresholdService;
+
+    @Autowired
+    private ISysRoleExtService sysRoleService;
+
+    /**
+     * 查询账户下关联的模板
+     *
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/getTemplateApplied")
+    public Result<PageInfo<TemplateAppliedVo>> getTemplateApplied(int pageNo, int pageSize, Long accountId, String projectName, String userName) {
+        Result<PageInfo<TemplateAppliedVo>> result = new Result<>();
+        try {
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            String roleCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
+            Map<String, Object> requestMap = new JSONObject();
+            if (!"admin".equals(roleCode)) {
+                requestMap.put("userId", sysUser.getId());
+            }
+            if (!Check.isNull(accountId)) {
+                requestMap.put("accountId", accountId);
+            }
+
+            if (!Check.isNull(projectName)) {
+                requestMap.put("projectName", projectName);
+            }
+            if (!Check.isNull(userName)) {
+                requestMap.put("userName", userName);
+            }
+            PageHelper.startPage(pageNo, pageSize);
+            List<TemplateAppliedVo> list = ruleAccountTemplateService.getTemplateApplied(requestMap);
+
+            PageInfo<TemplateAppliedVo> pageInfo = new PageInfo<>(list);
+            result.setSuccess(true);
+            result.setResult(pageInfo);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    @GetMapping(value = "/checkAccountTemplate")
+    public Result<JSONObject> checkAccountTemplate(Long accountId) {
+        Result<JSONObject> result = new Result<>();
+        JSONObject returnJson = new JSONObject();
+        QueryWrapper<RuleAccountTemplate> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.orderByDesc("create_time");
+        queryWrapper.last("limit 1");
+        RuleAccountTemplate ruleAccountTemplate = ruleAccountTemplateService.getOne(queryWrapper);
+        if (!Check.isNull(ruleAccountTemplate)) {
+            RuleTemplate ruleTemplate = templateService.getById(ruleAccountTemplate.getTemplateId());
+            returnJson.put("isApplication", true);
+            if (!Check.isNull(ruleTemplate)) {
+                returnJson.put("templateName", ruleTemplate.getTemplateName());
+            }
+        } else {
+            returnJson.put("isApplication", false);
+        }
+
+        result.setSuccess(true);
+        result.setResult(returnJson);
+        return result;
+    }
+
+
+    /**
+     * 推送 模板应用到某个账户
+     *
+     * @param ruleAccountTemplate
+     * @return
+     */
+    @PostMapping(value = "/pushTemplateToAccount")
+    public Result pushTemplateToAccount(@RequestBody RuleAccountTemplate ruleAccountTemplate) {
+        Result result = new Result<>();
+        try {
+            if (Check.isNull(ruleAccountTemplate.getAccountId())) {
+                throw new Exception("请选择需要推送的账户");
+            }
+
+            if (Check.isNull(ruleAccountTemplate.getTemplateId())) {
+                throw new Exception("请选择需要推送的模板");
+            }
+
+            JSONObject returnJson = ruleAccountTemplateService.pushTemplateToAccount(ruleAccountTemplate.getAccountId(), ruleAccountTemplate.getTemplateId());
+            result.setSuccess(true);
+            result.setResult(returnJson);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则模板-通过id删除")
+    @ApiOperation(value = "规则模板-通过id删除", notes = "规则模板-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            RuleAccountTemplate accountTemplate = ruleAccountTemplateService.getById(id);
+            if (!Check.isNull(accountTemplate)) {
+                Map<String, Object> deleteMap = new HashMap<>();
+                deleteMap.put("account_id", accountTemplate.getAccountId());
+                accountThresholdService.removeByMap(deleteMap);
+                ruleAccountTemplateService.removeById(id);
+            }
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleAccountTemplate
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则模板-分页列表查询")
+    @ApiOperation(value = "规则模板-分页列表查询", notes = "规则模板-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleAccountTemplate>> queryPageList(RuleAccountTemplate ruleAccountTemplate,
+                                                            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                            HttpServletRequest req) {
+        Result<IPage<RuleAccountTemplate>> result = new Result<>();
+        QueryWrapper<RuleAccountTemplate> queryWrapper = QueryGenerator.initQueryWrapper(ruleAccountTemplate, req.getParameterMap());
+        Page<RuleAccountTemplate> page = new Page<RuleAccountTemplate>(pageNo, pageSize);
+        IPage<RuleAccountTemplate> pageList = ruleAccountTemplateService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    @GetMapping(value = "/getRelationAccountById")
+    public Result<JSONObject> getRelationAccountById(Long id) {
+        Result<JSONObject> result = new Result<>();
+        JSONObject returnJson = new JSONObject();
+        QueryWrapper<RuleAccountTemplate> accountTemplateQueryWrapper = new QueryWrapper<>();
+        accountTemplateQueryWrapper.eq("template_id", id);
+        List<RuleAccountTemplate> list = ruleAccountTemplateService.list(accountTemplateQueryWrapper);
+        returnJson.put("relationCount", list.size());
+        result.setSuccess(true);
+        result.setResult(returnJson);
+        return result;
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param ruleAccountTemplate
+     * @return
+     */
+    @AutoLog(value = "规则模板-添加")
+    @ApiOperation(value = "规则模板-添加", notes = "规则模板-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleAccountTemplate> add(@RequestBody RuleAccountTemplate ruleAccountTemplate) {
+        Result<RuleAccountTemplate> result = new Result<>();
+        try {
+            ruleAccountTemplateService.save(ruleAccountTemplate);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleAccountTemplate
+     * @return
+     */
+    @AutoLog(value = "规则模板-编辑")
+    @ApiOperation(value = "规则模板-编辑", notes = "规则模板-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleAccountTemplate> edit(@RequestBody RuleAccountTemplate ruleAccountTemplate) {
+        Result<RuleAccountTemplate> result = new Result<RuleAccountTemplate>();
+        RuleAccountTemplate ruleAccountTemplateEntity = ruleAccountTemplateService.getById(ruleAccountTemplate.getId());
+        if (ruleAccountTemplateEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleAccountTemplateService.updateById(ruleAccountTemplate);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则模板-批量删除")
+    @ApiOperation(value = "规则模板-批量删除", notes = "规则模板-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleAccountTemplate> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleAccountTemplate> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleAccountTemplateService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则模板-通过id查询")
+    @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleAccountTemplate> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleAccountTemplate> result = new Result<>();
+        RuleAccountTemplate ruleAccountTemplate = ruleAccountTemplateService.getById(id);
+        if (ruleAccountTemplate == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleAccountTemplate);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleAccountTemplate> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleAccountTemplate ruleAccountTemplate = JSON.parseObject(deString, RuleAccountTemplate.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleAccountTemplate, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleAccountTemplate> pageList = ruleAccountTemplateService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则模板列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleAccountTemplate.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则模板列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleAccountTemplate> listRuleAccountTemplates = ExcelImportUtil.importExcel(file.getInputStream(), RuleAccountTemplate.class, params);
+                ruleAccountTemplateService.saveBatch(listRuleAccountTemplates);
+                return Result.ok("文件导入成功!数据行数:" + listRuleAccountTemplates.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 270 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountThresholdController.java

@@ -0,0 +1,270 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleAccountThreshold;
+import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则关联账户 阈值
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Slf4j
+@Api(tags = "规则关联账户 阈值")
+@RestController
+@RequestMapping("/ruleAccountThreshold")
+public class RuleAccountThresholdController {
+    @Autowired
+    private IRuleAccountThresholdService ruleAccountThresholdService;
+
+
+    @PostMapping(value = "/fillThreshold")
+    public Result<JSONObject> fillThreshold(@RequestBody JSONObject requestJson) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("入参为空");
+            }
+            JSONObject returnJson = ruleAccountThresholdService.fillThreshold(requestJson);
+            result.setSuccess(true);
+            result.setResult(returnJson);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleAccountThreshold
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则关联账户 阈值-分页列表查询")
+    @ApiOperation(value = "规则关联账户 阈值-分页列表查询", notes = "规则关联账户 阈值-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleAccountThreshold>> queryPageList(RuleAccountThreshold ruleAccountThreshold,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             HttpServletRequest req) {
+        Result<IPage<RuleAccountThreshold>> result = new Result<>();
+        QueryWrapper<RuleAccountThreshold> queryWrapper = QueryGenerator.initQueryWrapper(ruleAccountThreshold, req.getParameterMap());
+        Page<RuleAccountThreshold> page = new Page<RuleAccountThreshold>(pageNo, pageSize);
+        IPage<RuleAccountThreshold> pageList = ruleAccountThresholdService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleAccountThreshold
+     * @return
+     */
+    @AutoLog(value = "规则关联账户 阈值-添加")
+    @ApiOperation(value = "规则关联账户 阈值-添加", notes = "规则关联账户 阈值-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleAccountThreshold> add(@RequestBody RuleAccountThreshold ruleAccountThreshold) {
+        Result<RuleAccountThreshold> result = new Result<>();
+        try {
+            ruleAccountThresholdService.save(ruleAccountThreshold);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleAccountThreshold
+     * @return
+     */
+    @AutoLog(value = "规则关联账户 阈值-编辑")
+    @ApiOperation(value = "规则关联账户 阈值-编辑", notes = "规则关联账户 阈值-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleAccountThreshold> edit(@RequestBody RuleAccountThreshold ruleAccountThreshold) {
+        Result<RuleAccountThreshold> result = new Result<RuleAccountThreshold>();
+        RuleAccountThreshold ruleAccountThresholdEntity = ruleAccountThresholdService.getById(ruleAccountThreshold.getId());
+        if (ruleAccountThresholdEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleAccountThresholdService.updateById(ruleAccountThreshold);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则关联账户 阈值-通过id删除")
+    @ApiOperation(value = "规则关联账户 阈值-通过id删除", notes = "规则关联账户 阈值-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleAccountThresholdService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则关联账户 阈值-批量删除")
+    @ApiOperation(value = "规则关联账户 阈值-批量删除", notes = "规则关联账户 阈值-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleAccountThreshold> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleAccountThreshold> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleAccountThresholdService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则关联账户 阈值-通过id查询")
+    @ApiOperation(value = "规则关联账户 阈值-通过id查询", notes = "规则关联账户 阈值-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleAccountThreshold> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleAccountThreshold> result = new Result<>();
+        RuleAccountThreshold ruleAccountThreshold = ruleAccountThresholdService.getById(id);
+        if (ruleAccountThreshold == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleAccountThreshold);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleAccountThreshold> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleAccountThreshold ruleAccountThreshold = JSON.parseObject(deString, RuleAccountThreshold.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleAccountThreshold, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleAccountThreshold> pageList = ruleAccountThresholdService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则关联账户 阈值列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleAccountThreshold.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则关联账户 阈值列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleAccountThreshold> listRuleAccountThresholds = ExcelImportUtil.importExcel(file.getInputStream(), RuleAccountThreshold.class, params);
+                ruleAccountThresholdService.saveBatch(listRuleAccountThresholds);
+                return Result.ok("文件导入成功!数据行数:" + listRuleAccountThresholds.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 257 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleBaseController.java

@@ -0,0 +1,257 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleBase;
+import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
+import cn.com.ctop.alarm.modules.service.IRuleBaseService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 基础规则
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Slf4j
+@Api(tags = "基础规则")
+@RestController
+@RequestMapping("/ruleBase")
+public class RuleBaseController {
+    @Autowired
+    private IRuleBaseService ruleBaseService;
+    @Autowired
+    private IRuleAccountThresholdService ruleAccountThresholdService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleBase
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "基础规则-分页列表查询")
+    @ApiOperation(value = "基础规则-分页列表查询", notes = "基础规则-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleBase>> queryPageList(RuleBase ruleBase,
+                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                 HttpServletRequest req) {
+        Result<IPage<RuleBase>> result = new Result<>();
+        QueryWrapper<RuleBase> queryWrapper = QueryGenerator.initQueryWrapper(ruleBase, req.getParameterMap());
+        Page<RuleBase> page = new Page<>(pageNo, pageSize);
+        IPage<RuleBase> pageList = ruleBaseService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleBase
+     * @return
+     */
+    @AutoLog(value = "基础规则-添加")
+    @ApiOperation(value = "基础规则-添加", notes = "基础规则-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleBase> add(@RequestBody RuleBase ruleBase) {
+        Result<RuleBase> result = new Result<>();
+        try {
+            ruleBaseService.save(ruleBase);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleBase
+     * @return
+     */
+    @AutoLog(value = "基础规则-编辑")
+    @ApiOperation(value = "基础规则-编辑", notes = "基础规则-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleBase> edit(@RequestBody RuleBase ruleBase) {
+        Result<RuleBase> result = new Result<RuleBase>();
+        RuleBase ruleBaseEntity = ruleBaseService.getById(ruleBase.getId());
+        if (ruleBaseEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleBaseService.updateById(ruleBase);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "基础规则-通过id删除")
+    @ApiOperation(value = "基础规则-通过id删除", notes = "基础规则-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleBaseService.removeById(id);
+            Map<String, Object> deleteMap = new HashMap<>();
+            deleteMap.put("rule_id", id);
+            ruleAccountThresholdService.removeByMap(deleteMap);
+
+
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "基础规则-批量删除")
+    @ApiOperation(value = "基础规则-批量删除", notes = "基础规则-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleBase> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleBase> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleBaseService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "基础规则-通过id查询")
+    @ApiOperation(value = "基础规则-通过id查询", notes = "基础规则-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleBase> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleBase> result = new Result<>();
+        RuleBase ruleBase = ruleBaseService.getById(id);
+        if (ruleBase == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleBase);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleBase> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleBase ruleBase = JSON.parseObject(deString, RuleBase.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleBase, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleBase> pageList = ruleBaseService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "基础规则列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleBase.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("基础规则列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleBase> listRuleBases = ExcelImportUtil.importExcel(file.getInputStream(), RuleBase.class, params);
+                ruleBaseService.saveBatch(listRuleBases);
+                return Result.ok("文件导入成功!数据行数:" + listRuleBases.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 246 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleConditionController.java

@@ -0,0 +1,246 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleCondition;
+import cn.com.ctop.alarm.modules.service.IRuleConditionService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则运算符配置表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-16
+ */
+@Slf4j
+@Api(tags = "规则运算符配置表")
+@RestController
+@RequestMapping("/rule/ruleCondition")
+public class RuleConditionController {
+    @Autowired
+    private IRuleConditionService ruleConditionService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleCondition
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则运算符配置表-分页列表查询")
+    @ApiOperation(value = "规则运算符配置表-分页列表查询", notes = "规则运算符配置表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<List<RuleCondition>> queryPageList(RuleCondition ruleCondition,
+                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                     HttpServletRequest req) {
+        Result<List<RuleCondition>> result = new Result<>();
+        QueryWrapper<RuleCondition> queryWrapper = QueryGenerator.initQueryWrapper(ruleCondition, req.getParameterMap());
+
+        List<RuleCondition> list = ruleConditionService.list(queryWrapper);
+        result.setSuccess(true);
+        result.setResult(list);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleCondition
+     * @return
+     */
+    @AutoLog(value = "规则运算符配置表-添加")
+    @ApiOperation(value = "规则运算符配置表-添加", notes = "规则运算符配置表-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleCondition> add(@RequestBody RuleCondition ruleCondition) {
+        Result<RuleCondition> result = new Result<>();
+        try {
+            ruleConditionService.save(ruleCondition);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleCondition
+     * @return
+     */
+    @AutoLog(value = "规则运算符配置表-编辑")
+    @ApiOperation(value = "规则运算符配置表-编辑", notes = "规则运算符配置表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleCondition> edit(@RequestBody RuleCondition ruleCondition) {
+        Result<RuleCondition> result = new Result<RuleCondition>();
+        RuleCondition ruleConditionEntity = ruleConditionService.getById(ruleCondition.getId());
+        if (ruleConditionEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleConditionService.updateById(ruleCondition);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则运算符配置表-通过id删除")
+    @ApiOperation(value = "规则运算符配置表-通过id删除", notes = "规则运算符配置表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleConditionService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则运算符配置表-批量删除")
+    @ApiOperation(value = "规则运算符配置表-批量删除", notes = "规则运算符配置表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleCondition> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleCondition> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleConditionService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则运算符配置表-通过id查询")
+    @ApiOperation(value = "规则运算符配置表-通过id查询", notes = "规则运算符配置表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleCondition> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleCondition> result = new Result<>();
+        RuleCondition ruleCondition = ruleConditionService.getById(id);
+        if (ruleCondition == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleCondition);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleCondition> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleCondition ruleCondition = JSON.parseObject(deString, RuleCondition.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleCondition, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleCondition> pageList = ruleConditionService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则运算符配置表列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleCondition.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则运算符配置表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleCondition> listRuleConditions = ExcelImportUtil.importExcel(file.getInputStream(), RuleCondition.class, params);
+                ruleConditionService.saveBatch(listRuleConditions);
+                return Result.ok("文件导入成功!数据行数:" + listRuleConditions.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 350 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleGroupController.java

@@ -0,0 +1,350 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleGroup;
+import cn.com.ctop.alarm.modules.entity.RuleTemplate;
+import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
+import cn.com.ctop.alarm.modules.service.IRuleBaseService;
+import cn.com.ctop.alarm.modules.service.IRuleGroupService;
+import cn.com.ctop.alarm.modules.service.IRuleTemplateService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 规则组
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Slf4j
+@Api(tags = "规则组")
+@RestController
+@RequestMapping("/ruleGroup")
+public class RuleGroupController {
+    @Autowired
+    private IRuleGroupService ruleGroupService;
+    @Autowired
+    private IRuleBaseService ruleBaseService;
+    @Autowired
+    private IRuleAccountThresholdService ruleAccountThresholdService;
+    @Autowired
+    private IRuleTemplateService ruleTemplateService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(10);
+
+    /**
+     * 创建规则组
+     *
+     * @param requestJson
+     * @return
+     */
+
+    @PostMapping(value = "/createRuleGroup")
+    public Result createRuleGroup(@RequestBody JSONObject requestJson) {
+        Result result = new Result<>();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("请输出需要创建的参数");
+            }
+            JSONObject returnJson = ruleGroupService.createRuleGroup(requestJson);
+            if (returnJson.getInteger("code") == 0) {
+                result.setSuccess(true);
+                result.setMessage(returnJson.getString("message"));
+            } else {
+                result.setSuccess(false);
+                result.setMessage(returnJson.getString("message"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则组-通过id删除")
+    @ApiOperation(value = "规则组-通过id删除", notes = "规则组-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            RuleGroup ruleGroup = ruleGroupService.getById(id);
+            if (!Check.isNull(ruleGroup)) {
+                JSONArray ruleIds = JSONArray.parseArray(ruleGroup.getRuleIds());
+                for (int i = 0; i < ruleIds.size(); i++) {
+                    Long ruleId = ruleIds.getLong(i);
+                    ruleBaseService.removeById(ruleId);
+                    Map<String, Object> deleteMap = new HashMap<>();
+                    deleteMap.put("rule_id", ruleId);
+                    ruleAccountThresholdService.removeByMap(deleteMap);
+                }
+                Long templateId = ruleGroup.getTemplateId();
+                RuleTemplate ruleTemplate = ruleTemplateService.getById(templateId);
+                if (!Check.isNull(ruleTemplate)) {
+                    JSONArray newGroupIds = new JSONArray();
+                    JSONArray groupIds = JSONArray.parseArray(ruleTemplate.getGroupIds());
+                    Iterator<Object> o = groupIds.iterator();
+                    while (o.hasNext()) {
+                        String groupId = String.valueOf(o.next());
+                        if (groupId.equals(id)) {
+                            continue;
+                        }
+                        newGroupIds.add(Long.valueOf(groupId));
+                    }
+                    ruleTemplate.setGroupIds(newGroupIds.toJSONString());
+                    ruleTemplateService.updateById(ruleTemplate);
+                }
+                ruleGroupService.removeById(id);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleGroup
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则组-分页列表查询")
+    @ApiOperation(value = "规则组-分页列表查询", notes = "规则组-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleGroup>> queryPageList(RuleGroup ruleGroup,
+                                                  @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                  HttpServletRequest req) {
+        Result<IPage<RuleGroup>> result = new Result<>();
+        QueryWrapper<RuleGroup> queryWrapper = QueryGenerator.initQueryWrapper(ruleGroup, req.getParameterMap());
+        Page<RuleGroup> page = new Page<RuleGroup>(pageNo, pageSize);
+        IPage<RuleGroup> pageList = ruleGroupService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleGroup
+     * @return
+     */
+    @AutoLog(value = "规则组-添加")
+    @ApiOperation(value = "规则组-添加", notes = "规则组-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleGroup> add(@RequestBody RuleGroup ruleGroup) {
+        Result<RuleGroup> result = new Result<>();
+        try {
+            ruleGroupService.save(ruleGroup);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @GetMapping(value = "/checkRules")
+    public Result<RuleGroup> checkRules() {
+        Result<RuleGroup> result = new Result<>();
+        try {
+            ruleGroupService.checkRules();
+            result.success("成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @GetMapping(value = "/checkRulesByAccountId")
+    public Result<RuleGroup> checkRulesByAccountId(Long accountId) {
+        Result<RuleGroup> result = new Result<>();
+        try {
+            executorService.submit(() -> ruleGroupService.checkRulesByAccountId(accountId));
+            result.success("成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleGroup
+     * @return
+     */
+    @AutoLog(value = "规则组-编辑")
+    @ApiOperation(value = "规则组-编辑", notes = "规则组-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleGroup> edit(@RequestBody RuleGroup ruleGroup) {
+        Result<RuleGroup> result = new Result<RuleGroup>();
+        RuleGroup ruleGroupEntity = ruleGroupService.getById(ruleGroup.getId());
+        if (ruleGroupEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleGroupService.updateById(ruleGroup);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则组-批量删除")
+    @ApiOperation(value = "规则组-批量删除", notes = "规则组-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleGroup> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleGroup> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleGroupService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则组-通过id查询")
+    @ApiOperation(value = "规则组-通过id查询", notes = "规则组-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleGroup> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleGroup> result = new Result<>();
+        RuleGroup ruleGroup = ruleGroupService.getById(id);
+        if (ruleGroup == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleGroup);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleGroup> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleGroup ruleGroup = JSON.parseObject(deString, RuleGroup.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleGroup, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleGroup> pageList = ruleGroupService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则组列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleGroup.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则组列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleGroup> listRuleGroups = ExcelImportUtil.importExcel(file.getInputStream(), RuleGroup.class, params);
+                ruleGroupService.saveBatch(listRuleGroups);
+                return Result.ok("文件导入成功!数据行数:" + listRuleGroups.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 256 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleIndicatorController.java

@@ -0,0 +1,256 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleIndicator;
+import cn.com.ctop.alarm.modules.service.IRuleIndicatorService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则指标信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Slf4j
+@Api(tags = "规则指标信息")
+@RestController
+@RequestMapping("/ruleIndicator")
+public class RuleIndicatorController {
+    @Autowired
+    private IRuleIndicatorService ruleIndicatorService;
+
+    @AutoLog(value = "规则指标信息-分页列表查询")
+    @ApiOperation(value = "规则指标信息-分页列表查询", notes = "规则指标信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<JSONArray> queryPageList(RuleIndicator ruleIndicator) {
+        Result<JSONArray> result = new Result<>();
+        Integer mediaType = ruleIndicator.getMediaType();
+        QueryWrapper<RuleIndicator> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("media_type", mediaType);
+        queryWrapper.groupBy("dimension");
+        List<RuleIndicator> list = ruleIndicatorService.list(queryWrapper);
+        JSONArray dataArr = new JSONArray();
+        for (RuleIndicator indicator : list) {
+            String dimension = indicator.getDimension();
+            JSONObject dimensionJson = new JSONObject();
+            QueryWrapper<RuleIndicator> queryWrapperData = new QueryWrapper();
+            queryWrapperData.eq("media_type", mediaType);
+            queryWrapperData.eq("dimension", dimension);
+            List<RuleIndicator> dataList = ruleIndicatorService.list(queryWrapperData);
+            if (!Check.isNull(dataList)) {
+                dimensionJson.put("dimension", dimension);
+                // 获取指标名称
+                String dimensionName = ruleIndicatorService.getRuleIndicatorNameByMediaTypeAndDimension(mediaType, dimension);
+                dimensionJson.put("dimensionName", dimensionName);
+                dimensionJson.put("dimensionList", dataList);
+                dataArr.add(dimensionJson);
+            }
+        }
+        result.setSuccess(true);
+        result.setResult(dataArr);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ruleIndicator
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-添加")
+    @ApiOperation(value = "规则指标信息-添加", notes = "规则指标信息-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleIndicator> add(@RequestBody RuleIndicator ruleIndicator) {
+        Result<RuleIndicator> result = new Result<>();
+        try {
+            ruleIndicatorService.save(ruleIndicator);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleIndicator
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-编辑")
+    @ApiOperation(value = "规则指标信息-编辑", notes = "规则指标信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleIndicator> edit(@RequestBody RuleIndicator ruleIndicator) {
+        Result<RuleIndicator> result = new Result<RuleIndicator>();
+        RuleIndicator ruleIndicatorEntity = ruleIndicatorService.getById(ruleIndicator.getId());
+        if (ruleIndicatorEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleIndicatorService.updateById(ruleIndicator);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-通过id删除")
+    @ApiOperation(value = "规则指标信息-通过id删除", notes = "规则指标信息-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            ruleIndicatorService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-批量删除")
+    @ApiOperation(value = "规则指标信息-批量删除", notes = "规则指标信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleIndicator> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleIndicator> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleIndicatorService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则指标信息-通过id查询")
+    @ApiOperation(value = "规则指标信息-通过id查询", notes = "规则指标信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleIndicator> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleIndicator> result = new Result<>();
+        RuleIndicator ruleIndicator = ruleIndicatorService.getById(id);
+        if (ruleIndicator == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleIndicator);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleIndicator> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleIndicator ruleIndicator = JSON.parseObject(deString, RuleIndicator.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleIndicator, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleIndicator> pageList = ruleIndicatorService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则指标信息列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleIndicator.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则指标信息列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleIndicator> listRuleIndicators = ExcelImportUtil.importExcel(file.getInputStream(), RuleIndicator.class, params);
+                ruleIndicatorService.saveBatch(listRuleIndicators);
+                return Result.ok("文件导入成功!数据行数:" + listRuleIndicators.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 96 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleSwitchController.java

@@ -0,0 +1,96 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/rule/switch/")
+public class RuleSwitchController {
+
+    @Autowired
+    IUserAllocationService userAllocationService;
+
+    /**
+     *  账户添加内广监测链接预警
+     */
+    @PostMapping(value = "/onOrOffMonitoringLink")
+    public Result<Object> onOrOffMonitoringLink(@RequestParam Long accountId, @RequestParam String switchType){
+        Result<Object> result=new Result<>();
+        UserAllocation userAllocation=new UserAllocation();
+        userAllocation.setAccountId(accountId);
+        UpdateWrapper<UserAllocation> wrapper=new UpdateWrapper<>();
+        //开启预警
+        if(switchType.equals("on")){
+            wrapper.set("monitoring_link",0);
+            wrapper.setEntity(userAllocation);
+            boolean update = userAllocationService.update(wrapper);
+            if(update){
+                result.success("监测链接预警开启成功");
+            }
+        }else if(switchType.equals("off")){
+            wrapper.set("monitoring_link",1);
+            wrapper.setEntity(userAllocation);
+            boolean update = userAllocationService.update(wrapper);
+            if(update){
+                result.success("监测链接预警关闭成功");
+            }
+        }else {
+            result.error500("未知操作");
+        }
+        return result;
+    }
+
+    /**
+     *  账户添加落地页链接预警
+     */
+    @PostMapping(value = "/onOrOffLandingPage")
+    public Result<Object> onOrOffLandingPage(@RequestParam Long accountId, @RequestParam String switchType){
+        Result<Object> result=new Result<>();
+        UserAllocation userAllocation=new UserAllocation();
+        userAllocation.setAccountId(accountId);
+        UpdateWrapper<UserAllocation> wrapper=new UpdateWrapper<>();
+        //开启预警
+        if(switchType.equals("on")){
+            wrapper.set("landing_page",0);
+            wrapper.setEntity(userAllocation);
+            boolean update = userAllocationService.update(wrapper);
+            if(update){
+                result.success("落地页链接预警开启成功");
+            }
+        }else if(switchType.equals("off")){
+            wrapper.set("landing_page",1);
+            wrapper.setEntity(userAllocation);
+            boolean update = userAllocationService.update(wrapper);
+            if(update){
+                result.success("落地页链接预警关闭成功");
+            }
+        }else {
+            result.error500("未知操作");
+        }
+        return result;
+    }
+
+    /**
+     *  开关预警配置回显
+     */
+    @PostMapping(value = "/echoSwitchStatus")
+    public Result<JSONObject> echoSwitchStatus(Long accountId){
+        Result<JSONObject> result =new Result<>();
+        JSONObject switchStatus= userAllocationService.getSwitchStatusByAccount(accountId);
+        if(switchStatus.isEmpty()){
+            result.error500("未找到该账户");
+        }else {
+            result.setResult(switchStatus);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

+ 408 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleTemplateController.java

@@ -0,0 +1,408 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.RuleGroup;
+import cn.com.ctop.alarm.modules.entity.RuleTemplate;
+import cn.com.ctop.alarm.modules.service.*;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 规则模板
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Slf4j
+@Api(tags = "规则模板")
+@RestController
+@RequestMapping("/ruleTemplate")
+public class RuleTemplateController {
+    @Autowired
+    private IRuleTemplateService ruleTemplateService;
+    @Autowired
+    private IRuleGroupService ruleGroupService;
+    @Autowired
+    private IRuleBaseService ruleBaseService;
+    @Autowired
+    private IRuleAccountThresholdService ruleAccountThresholdService;
+    @Autowired
+    private IRuleAccountTemplateService accountTemplateService;
+
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则模板-通过id查询")
+    @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
+    @GetMapping(value = "/queryDetailById")
+    public Result<JSONObject> queryDetailById(@RequestParam(name = "id", required = true) String id) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            JSONObject ruleTemplateJson = ruleTemplateService.queryDetailById(id);
+            result.setSuccess(true);
+            result.setResult(ruleTemplateJson);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setCode(-1);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
+    public static void main(String[] args) {
+        System.err.println(new JSONObject());
+    }
+
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则模板-通过id查询")
+    @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
+    @GetMapping(value = "/previewTemplate")
+    public Result<JSONObject> previewTemplate(@RequestParam(name = "id", required = true) String id) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            JSONObject ruleTemplateJson = ruleTemplateService.previewTemplate(id);
+            result.setSuccess(true);
+            result.setResult(ruleTemplateJson);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
+    /**
+     * 根据 模板id  账户id 查询详情
+     *
+     * @param
+     * @return
+     */
+
+    @GetMapping(value = "/queryDetailByAccountIdAndTemplateId")
+    public Result<JSONObject> queryDetailByAccountIdAndTemplateId(Long accountId, Long templateId) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            JSONObject ruleTemplateJson = ruleTemplateService.queryDetailByAccountIdAndTemplateId(accountId, templateId);
+            result.setSuccess(true);
+            result.setResult(ruleTemplateJson);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
+
+    /**
+     * 分页列表查询
+     *
+     * @param ruleTemplate
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "规则模板-分页列表查询")
+    @ApiOperation(value = "规则模板-分页列表查询", notes = "规则模板-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<RuleTemplate>> queryPageList(RuleTemplate ruleTemplate,
+                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                     HttpServletRequest req) {
+        Result<IPage<RuleTemplate>> result = new Result<>();
+        String templateName = ruleTemplate.getTemplateName();
+        ruleTemplate.setTemplateName(null);
+        QueryWrapper<RuleTemplate> queryWrapper = QueryGenerator.initQueryWrapper(ruleTemplate, req.getParameterMap());
+        if (!Check.isNull(templateName)) {
+            queryWrapper.like("template_name", templateName);
+        }
+        Page<RuleTemplate> page = new Page<RuleTemplate>(pageNo, pageSize);
+        IPage<RuleTemplate> pageList = ruleTemplateService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param requestJson
+     * @return
+     */
+    @AutoLog(value = "创建规则模板")
+
+    @PostMapping(value = "/createTemplate")
+    public Result createTemplate(@RequestBody JSONObject requestJson) {
+        Result result = new Result<>();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("请传入模板入参");
+            }
+            JSONObject returnJson = ruleTemplateService.createTemplate(requestJson);
+            if (returnJson.getInteger("code") == 0) {
+                result.setSuccess(true);
+                result.setMessage(returnJson.getString("message"));
+            } else {
+                result.setSuccess(false);
+                result.setMessage(returnJson.getString("message"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param ruleTemplate
+     * @return
+     */
+    @AutoLog(value = "规则模板-添加")
+    @ApiOperation(value = "规则模板-添加", notes = "规则模板-添加")
+    @PostMapping(value = "/add")
+    public Result<RuleTemplate> add(@RequestBody RuleTemplate ruleTemplate) {
+        Result<RuleTemplate> result = new Result<>();
+        try {
+            ruleTemplateService.save(ruleTemplate);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ruleTemplate
+     * @return
+     */
+    @AutoLog(value = "规则模板-编辑")
+    @ApiOperation(value = "规则模板-编辑", notes = "规则模板-编辑")
+    @PutMapping(value = "/edit")
+    public Result<RuleTemplate> edit(@RequestBody RuleTemplate ruleTemplate) {
+        Result<RuleTemplate> result = new Result<RuleTemplate>();
+        RuleTemplate ruleTemplateEntity = ruleTemplateService.getById(ruleTemplate.getId());
+        if (ruleTemplateEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ruleTemplateService.updateById(ruleTemplate);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+
+
+    @AutoLog(value = "规则模板-通过id删除")
+    @ApiOperation(value = "规则模板-通过id删除", notes = "规则模板-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            RuleTemplate ruleTemplate = ruleTemplateService.getById(id);
+            if (!Check.isNull(ruleTemplate)) {
+                QueryWrapper<RuleGroup> groupQueryWrapper = new QueryWrapper<>();
+                groupQueryWrapper.eq("template_id", id);
+                List<RuleGroup> groupList = ruleGroupService.list(groupQueryWrapper);
+                if (!Check.isNull(groupList)) {
+                    for (RuleGroup group : groupList) {
+                        JSONArray ruleIds = JSONArray.parseArray(group.getRuleIds());
+                        if (Check.isNull(ruleIds)) {
+                            continue;
+                        }
+                        for (int i = 0; i < ruleIds.size(); i++) {
+                            Long ruleId = ruleIds.getLong(i);
+                            ruleBaseService.removeById(ruleId);
+                            Map<String, Object> deleteMap = new HashMap<>();
+                            deleteMap.put("rule_id", ruleId);
+                            ruleAccountThresholdService.removeByMap(deleteMap);
+                        }
+                        ruleGroupService.removeById(group.getId());
+                    }
+                }
+
+                Map<String, Object> deleteMap = new HashMap<>();
+                deleteMap.put("template_id", id);
+                accountTemplateService.removeByMap(deleteMap);
+                ruleTemplateService.removeById(id);
+            }
+
+
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "规则模板-批量删除")
+    @ApiOperation(value = "规则模板-批量删除", notes = "规则模板-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<RuleTemplate> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<RuleTemplate> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ruleTemplateService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "规则模板-通过id查询")
+    @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<RuleTemplate> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<RuleTemplate> result = new Result<>();
+        RuleTemplate ruleTemplate = ruleTemplateService.getById(id);
+        if (ruleTemplate == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ruleTemplate);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<RuleTemplate> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                RuleTemplate ruleTemplate = JSON.parseObject(deString, RuleTemplate.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ruleTemplate, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<RuleTemplate> pageList = ruleTemplateService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "规则模板列表");
+        mv.addObject(NormalExcelConstants.CLASS, RuleTemplate.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("规则模板列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<RuleTemplate> listRuleTemplates = ExcelImportUtil.importExcel(file.getInputStream(), RuleTemplate.class, params);
+                ruleTemplateService.saveBatch(listRuleTemplates);
+                return Result.ok("文件导入成功!数据行数:" + listRuleTemplates.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 84 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventSend.java

@@ -0,0 +1,84 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 预警事件发送表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-29
+ */
+@Data
+@TableName("ctop_alarm_event_send")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_alarm_event_send对象", description = "预警事件发送表")
+public class AlarmEventSend {
+
+    /**
+     * 主键id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键id")
+    private Long alarmSendId;
+    private Long accountId;
+
+    private String userId;
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Long groupId;
+    /**
+     * 预警指标
+     */
+    @Excel(name = "预警指标", width = 15)
+    @ApiModelProperty(value = "预警指标")
+    private String groupName;
+    /**
+     * 预警发送内容
+     */
+    @Excel(name = "预警发送内容", width = 15)
+    @ApiModelProperty(value = "预警发送内容")
+    private String alarmDetail;
+    /**
+     * 预警发送状态 0未发送,1已发送
+     */
+    @Excel(name = "预警发送状态 0未发送,1已发送", width = 15)
+    @ApiModelProperty(value = "预警发送状态 0未发送,1已发送")
+    private String alarmStatus;
+
+    private String ruleDimension;
+
+    private String mediaType;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 119 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmRuleRecord.java

@@ -0,0 +1,119 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 预警规则记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-01-18
+ */
+@Data
+@TableName("ctop_alarm_rule_record")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_alarm_rule_record对象", description = "预警规则记录表")
+public class AlarmRuleRecord {
+
+    /**
+     * 主键id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键id")
+    private Long id;
+
+    private Long accountId;
+
+    private Long planId;
+
+    private Long unitId;
+
+    private Long creativeId;
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Long baseId;
+    /**
+     * 规则组id
+     */
+    @Excel(name = "规则组id", width = 15)
+    @ApiModelProperty(value = "规则组id")
+    private Long groupId;
+
+    private String groupName;
+    /**
+     * 指标code
+     */
+    @Excel(name = "指标code", width = 15)
+    @ApiModelProperty(value = "指标code")
+    private String indicatorCode;
+    /**
+     * 指标名称
+     */
+    @Excel(name = "指标名称", width = 15)
+    @ApiModelProperty(value = "指标名称")
+    private String indicatorName;
+    /**
+     * 阈值
+     */
+    @Excel(name = "阈值", width = 15)
+    @ApiModelProperty(value = "阈值")
+    private String threshold;
+    //判断条件 大于 等于 小于等
+    private String ruleCondition;
+    /**
+     * 实际值
+     */
+    @Excel(name = "实际值", width = 15)
+    @ApiModelProperty(value = "实际值")
+    private String dataValue;
+    /**
+     * 获取值时间
+     */
+    @Excel(name = "获取值时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "获取值时间")
+    private java.util.Date valueTime;
+    /**
+     * 操作内容:SEND发送,PAUSE关停并发送
+     */
+    @Excel(name = "操作内容:SEND发送,PAUSE关停并发送", width = 15)
+    @ApiModelProperty(value = "操作内容:SEND发送,PAUSE关停并发送")
+    private String operate;
+    /**
+     * 媒体类型
+     */
+    @Excel(name = "媒体类型", width = 15)
+    @ApiModelProperty(value = "媒体类型")
+    private String mediaType;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "createTime")
+    private java.util.Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "updateTime")
+    private java.util.Date updateTime;
+}

+ 59 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleAccountTemplate.java

@@ -0,0 +1,59 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 规则模板
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Data
+@TableName("ctop_rule_account_template")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_account_template对象", description = "规则模板")
+public class RuleAccountTemplate {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 模板id
+     */
+    @Excel(name = "模板id", width = 15)
+    @ApiModelProperty(value = "模板id")
+    private Long templateId;
+    private Integer templateStatus;
+
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 67 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleAccountThreshold.java

@@ -0,0 +1,67 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 规则关联账户 阈值
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Data
+@TableName("ctop_rule_account_threshold")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_account_threshold对象", description = "规则关联账户 阈值")
+public class RuleAccountThreshold {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+
+    private Long groupId; // 组id
+    private String batchNo; // 批次号
+
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Long ruleId;
+    /**
+     * 阈值
+     */
+    @Excel(name = "阈值", width = 15)
+    @ApiModelProperty(value = "阈值")
+    private String threshold;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 83 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleBase.java

@@ -0,0 +1,83 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 基础规则
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Data
+@TableName("ctop_rule_base")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_base对象", description = "基础规则")
+public class RuleBase {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    private Long groupId;
+
+    /**
+     * 规则名称
+     */
+    @Excel(name = "规则名称", width = 15)
+    @ApiModelProperty(value = "规则名称")
+    private String ruleName;
+    /**
+     * 指标code
+     */
+    @Excel(name = "指标code", width = 15)
+    @ApiModelProperty(value = "指标code")
+    private String indicatorCode;
+    /**
+     * 判断条件 大于 等于 小于等
+     */
+    @Excel(name = "判断条件 大于 等于 小于等", width = 15)
+    @ApiModelProperty(value = "判断条件 大于 等于 小于等")
+    private String ruleCondition;
+    /**
+     * 阈值 比较值
+     */
+    @Excel(name = "阈值 比较值", width = 15)
+    @ApiModelProperty(value = "阈值 比较值")
+    private String threshold;
+    /**
+     * 规则维度 账户、计划、组、创意等维度
+     */
+    @Excel(name = "规则维度 账户、计划、组、创意等维度", width = 15)
+    @ApiModelProperty(value = "规则维度 账户、计划、组、创意等维度")
+    private String ruleDimension;
+
+    private Integer variableType;// 变量类型
+    private Integer judgeFormat;// 判断类型
+    private Integer isUnlimited;//  是否支持不限  true 是 false 否
+
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 63 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleCondition.java

@@ -0,0 +1,63 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 规则运算符配置表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-16
+ */
+@Data
+@TableName("ctop_rule_condition")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_condition对象", description = "规则运算符配置表")
+public class RuleCondition {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 运算名称
+     */
+    @Excel(name = "运算名称", width = 15)
+    @ApiModelProperty(value = "运算名称")
+    private String conditionName;
+    /**
+     * 运算符
+     */
+    @Excel(name = "运算符", width = 15)
+    @ApiModelProperty(value = "运算符")
+    private String ruleCondition;
+    /**
+     * 数据类型
+     */
+    @Excel(name = "数据类型", width = 15)
+    @ApiModelProperty(value = "数据类型")
+    private String dataType;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 89 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleGroup.java

@@ -0,0 +1,89 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 规则组
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-15
+ */
+@Data
+@TableName("ctop_rule_group")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_group对象", description = "规则组")
+public class RuleGroup {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    private Long templateId;
+    /**
+     * 规则id列表
+     */
+    @Excel(name = "规则id列表", width = 15)
+    @ApiModelProperty(value = "规则id列表")
+    private String ruleIds;
+    private String groupName;
+    /**
+     * 规则类型 group为组合规则 base 为单条规则
+     */
+    @Excel(name = "规则类型 group为组合规则 base 为单条规则", width = 15)
+    @ApiModelProperty(value = "规则类型 group为组合规则 base 为单条规则")
+    private String ruleType;
+    /**
+     * 规则关系 当rule_type 为group时必填 and同时命中  or 命中一条
+     */
+    @Excel(name = "规则关系 当rule_type 为group时必填 and同时命中  or 命中一条", width = 15)
+    @ApiModelProperty(value = "规则关系 当rule_type 为group时必填 and同时命中  or 命中一条")
+    private String ruleRelationship;
+    /**
+     * 操作内容:SEND发送,PAUSE关停并发送
+     */
+    private String operate;
+    /**
+     * 预警发送方式: SMS:短信,WeChat:企业微信,EMAIL:电子邮件,TEL:电话
+     */
+    private String sendType;
+
+    /**
+     * 规则解释
+     */
+    private String remark;
+
+
+    private Integer isRequired;//  是否必填  true 是 false 否
+    private Integer isCopy;//  是否可复制  true 是 false 否
+
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private List<RuleBase> ruleBaseList;
+
+}

+ 95 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleIndicator.java

@@ -0,0 +1,95 @@
+package cn.com.ctop.alarm.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 规则指标信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-11-14
+ */
+@Data
+@TableName("ctop_rule_indicator")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_rule_indicator对象", description = "规则指标信息")
+public class RuleIndicator {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 1:头条2:快手
+     */
+    @Excel(name = "1:头条2:快手", width = 15)
+    @ApiModelProperty(value = "1:头条2:快手")
+    private Integer mediaType;
+    /**
+     * 指标名称
+     */
+    @Excel(name = "指标名称", width = 15)
+    @ApiModelProperty(value = "指标名称")
+    private String name;
+    /**
+     * 指标code(数据库字段名称)
+     */
+    @Excel(name = "指标code(数据库字段名称)", width = 15)
+    @ApiModelProperty(value = "指标code(数据库字段名称)")
+    private String code;
+    /**
+     * 数据类型
+     */
+    @Excel(name = "数据类型", width = 15)
+    @ApiModelProperty(value = "数据类型")
+    private String dataType;
+    private String modelType;
+    /**
+     * 数据单位
+     */
+    @Excel(name = "数据单位", width = 15)
+    @ApiModelProperty(value = "数据单位")
+    private String dataUnit;
+    /**
+     * 数据维度
+     */
+    @Excel(name = "数据维度", width = 15)
+    @ApiModelProperty(value = "数据维度")
+    private String dimension;
+    /**
+     * 对应数据字典id
+     */
+    @Excel(name = "对应数据字典id", width = 15)
+    @ApiModelProperty(value = "对应数据字典id")
+    private String dictId;
+
+    private String requestUrl;
+
+    /**
+     * 对应数据表名称
+     */
+    @Excel(name = "对应数据表名称", width = 15)
+    @ApiModelProperty(value = "对应数据表名称")
+    /**
+     * 逻辑类型,针对流量排除包、排除人群包标识
+     */
+    private Integer logicalType;
+    private String tableName;
+    private Integer status;
+    private Integer sort;
+    private Date createTime;
+    private Date updateTime;
+}

+ 0 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/entity/RuleTemplate.java


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