Browse Source

修改 项目模块名称 防止冲突

qxp192083 5 years ago
parent
commit
a1621f0bdf
100 changed files with 0 additions and 11464 deletions
  1. 0 126
      dgtly-admin/pom.xml
  2. 0 30
      dgtly-admin/src/main/java/com/dgtly/RuoYiApplication.java
  3. 0 18
      dgtly-admin/src/main/java/com/dgtly/RuoYiServletInitializer.java
  4. 0 89
      dgtly-admin/src/main/java/com/dgtly/web/controller/monitor/SysOperlogController.java
  5. 0 114
      dgtly-admin/src/main/java/com/dgtly/web/controller/monitor/SysUserOnlineController.java
  6. 0 92
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysCaptchaController.java
  7. 0 144
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysConfigController.java
  8. 0 198
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysMenuController.java
  9. 0 143
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysNoticeController.java
  10. 0 163
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysPostController.java
  11. 0 175
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysProfileController.java
  12. 0 312
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysRoleController.java
  13. 0 301
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysUserController.java
  14. 0 26
      dgtly-admin/src/main/java/com/dgtly/web/controller/tool/BuildController.java
  15. 0 24
      dgtly-admin/src/main/java/com/dgtly/web/controller/tool/SwaggerController.java
  16. 0 175
      dgtly-admin/src/main/java/com/dgtly/web/controller/tool/TestController.java
  17. 0 62
      dgtly-admin/src/main/java/com/dgtly/web/core/config/SwaggerConfig.java
  18. 0 130
      dgtly-admin/src/main/resources/application-dev.yml
  19. 0 52
      dgtly-api/pom.xml
  20. 0 81
      dgtly-api/src/main/java/com/dgtly/api/controller/CommonController.java
  21. 0 113
      dgtly-apiframework/pom.xml
  22. 0 81
      dgtly-apiframework/src/main/java/com/dgtly/apiframework/exception/ApiGlobalExceptionHandler.java
  23. 0 56
      dgtly-apiframework/src/main/java/com/dgtly/apiframework/interceptor/ApiRepeatSubmitInterceptor.java
  24. 0 85
      dgtly-apiframework/src/main/java/com/dgtly/apiframework/interceptor/AuthenticationInterceptor.java
  25. 0 95
      dgtly-apiframework/src/main/java/com/dgtly/apiframework/interceptor/impl/ApiSameUrlDataInterceptor.java
  26. 0 111
      dgtly-common/pom.xml
  27. 0 28
      dgtly-common/src/main/java/com/dgtly/common/annotation/DataScope.java
  28. 0 26
      dgtly-common/src/main/java/com/dgtly/common/annotation/DataSource.java
  29. 0 113
      dgtly-common/src/main/java/com/dgtly/common/annotation/Excel.java
  30. 0 18
      dgtly-common/src/main/java/com/dgtly/common/annotation/Excels.java
  31. 0 40
      dgtly-common/src/main/java/com/dgtly/common/annotation/Log.java
  32. 0 23
      dgtly-common/src/main/java/com/dgtly/common/annotation/RepeatSubmit.java
  33. 0 152
      dgtly-common/src/main/java/com/dgtly/common/config/Global.java
  34. 0 33
      dgtly-common/src/main/java/com/dgtly/common/config/ServerConfig.java
  35. 0 45
      dgtly-common/src/main/java/com/dgtly/common/config/datasource/DynamicDataSourceContextHolder.java
  36. 0 62
      dgtly-common/src/main/java/com/dgtly/common/config/thread/ThreadPoolConfig.java
  37. 0 69
      dgtly-common/src/main/java/com/dgtly/common/constant/Constants.java
  38. 0 94
      dgtly-common/src/main/java/com/dgtly/common/constant/GenConstants.java
  39. 0 27
      dgtly-common/src/main/java/com/dgtly/common/constant/PermissionConstants.java
  40. 0 50
      dgtly-common/src/main/java/com/dgtly/common/constant/ScheduleConstants.java
  41. 0 74
      dgtly-common/src/main/java/com/dgtly/common/constant/ShiroConstants.java
  42. 0 101
      dgtly-common/src/main/java/com/dgtly/common/constant/UserConstants.java
  43. 0 181
      dgtly-common/src/main/java/com/dgtly/common/core/controller/ApiBaseController.java
  44. 0 176
      dgtly-common/src/main/java/com/dgtly/common/core/controller/BaseController.java
  45. 0 226
      dgtly-common/src/main/java/com/dgtly/common/core/domain/AjaxResult.java
  46. 0 114
      dgtly-common/src/main/java/com/dgtly/common/core/domain/BaseEntity.java
  47. 0 63
      dgtly-common/src/main/java/com/dgtly/common/core/domain/TreeEntity.java
  48. 0 117
      dgtly-common/src/main/java/com/dgtly/common/core/domain/Ztree.java
  49. 0 69
      dgtly-common/src/main/java/com/dgtly/common/core/page/PageDomain.java
  50. 0 85
      dgtly-common/src/main/java/com/dgtly/common/core/page/TableDataInfo.java
  51. 0 30
      dgtly-common/src/main/java/com/dgtly/common/core/page/TableSupport.java
  52. 0 86
      dgtly-common/src/main/java/com/dgtly/common/core/text/CharsetKit.java
  53. 0 999
      dgtly-common/src/main/java/com/dgtly/common/core/text/Convert.java
  54. 0 92
      dgtly-common/src/main/java/com/dgtly/common/core/text/StrFormatter.java
  55. 0 19
      dgtly-common/src/main/java/com/dgtly/common/enums/BusinessStatus.java
  56. 0 59
      dgtly-common/src/main/java/com/dgtly/common/enums/BusinessType.java
  57. 0 19
      dgtly-common/src/main/java/com/dgtly/common/enums/DataSourceType.java
  58. 0 24
      dgtly-common/src/main/java/com/dgtly/common/enums/OnlineStatus.java
  59. 0 24
      dgtly-common/src/main/java/com/dgtly/common/enums/OperatorType.java
  60. 0 30
      dgtly-common/src/main/java/com/dgtly/common/enums/UserStatus.java
  61. 0 30
      dgtly-common/src/main/java/com/dgtly/common/exception/BusinessException.java
  62. 0 15
      dgtly-common/src/main/java/com/dgtly/common/exception/DemoModeException.java
  63. 0 97
      dgtly-common/src/main/java/com/dgtly/common/exception/base/BaseException.java
  64. 0 19
      dgtly-common/src/main/java/com/dgtly/common/exception/file/FileException.java
  65. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/file/FileNameLengthLimitExceededException.java
  66. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/file/FileSizeLimitExceededException.java
  67. 0 71
      dgtly-common/src/main/java/com/dgtly/common/exception/file/InvalidExtensionException.java
  68. 0 34
      dgtly-common/src/main/java/com/dgtly/common/exception/job/TaskException.java
  69. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/CaptchaException.java
  70. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/RoleBlockedException.java
  71. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/UserBlockedException.java
  72. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/UserDeleteException.java
  73. 0 18
      dgtly-common/src/main/java/com/dgtly/common/exception/user/UserException.java
  74. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/UserNotExistsException.java
  75. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/UserPasswordNotMatchException.java
  76. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/UserPasswordRetryLimitCountException.java
  77. 0 16
      dgtly-common/src/main/java/com/dgtly/common/exception/user/UserPasswordRetryLimitExceedException.java
  78. 0 187
      dgtly-common/src/main/java/com/dgtly/common/json/JSON.java
  79. 0 749
      dgtly-common/src/main/java/com/dgtly/common/json/JSONObject.java
  80. 0 54
      dgtly-common/src/main/java/com/dgtly/common/utils/AddressUtils.java
  81. 0 114
      dgtly-common/src/main/java/com/dgtly/common/utils/Arith.java
  82. 0 155
      dgtly-common/src/main/java/com/dgtly/common/utils/DateUtils.java
  83. 0 40
      dgtly-common/src/main/java/com/dgtly/common/utils/ExceptionUtil.java
  84. 0 188
      dgtly-common/src/main/java/com/dgtly/common/utils/IpUtils.java
  85. 0 50
      dgtly-common/src/main/java/com/dgtly/common/utils/MapDataUtil.java
  86. 0 26
      dgtly-common/src/main/java/com/dgtly/common/utils/MessageUtils.java
  87. 0 135
      dgtly-common/src/main/java/com/dgtly/common/utils/ServletUtils.java
  88. 0 398
      dgtly-common/src/main/java/com/dgtly/common/utils/StringUtils.java
  89. 0 99
      dgtly-common/src/main/java/com/dgtly/common/utils/Threads.java
  90. 0 110
      dgtly-common/src/main/java/com/dgtly/common/utils/bean/BeanUtils.java
  91. 0 291
      dgtly-common/src/main/java/com/dgtly/common/utils/file/FileUploadUtils.java
  92. 0 143
      dgtly-common/src/main/java/com/dgtly/common/utils/file/FileUtils.java
  93. 0 55
      dgtly-common/src/main/java/com/dgtly/common/utils/file/MimeTypeUtils.java
  94. 0 152
      dgtly-common/src/main/java/com/dgtly/common/utils/html/EscapeUtil.java
  95. 0 248
      dgtly-common/src/main/java/com/dgtly/common/utils/http/HttpUtils.java
  96. 0 872
      dgtly-common/src/main/java/com/dgtly/common/utils/poi/ExcelUtil.java
  97. 0 406
      dgtly-common/src/main/java/com/dgtly/common/utils/reflect/ReflectUtils.java
  98. 0 66
      dgtly-common/src/main/java/com/dgtly/common/utils/security/Md5Utils.java
  99. 0 118
      dgtly-common/src/main/java/com/dgtly/common/utils/security/PermissionUtils.java
  100. 0 0
      dgtly-common/src/main/java/com/dgtly/common/utils/spring/SpringUtils.java

+ 0 - 126
dgtly-admin/pom.xml

@@ -1,126 +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>dgtly</artifactId>
-        <groupId>com.dgtly</groupId>
-        <version>4.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-	<packaging>jar</packaging>
-    <artifactId>dgtly-admin</artifactId>
-	
-	<description>
-	    web服务入口
-	</description>
-
-    <dependencies>
-    
-        <!-- SpringBoot集成thymeleaf模板 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-thymeleaf</artifactId>
-        </dependency>
-
-        <!-- spring-boot-devtools -->
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-devtools</artifactId>
-			<optional>true</optional> <!-- 表示依赖不会传递 -->
-		</dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-		<!-- swagger2-->
-		<dependency>
-			<groupId>io.springfox</groupId>
-			<artifactId>springfox-swagger2</artifactId>
-		</dependency>
-		
-		<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
-        <dependency>
-            <groupId>io.swagger</groupId>
-            <artifactId>swagger-annotations</artifactId>
-            <version>1.5.21</version>
-        </dependency>
-        
-        <dependency>
-            <groupId>io.swagger</groupId>
-            <artifactId>swagger-models</artifactId>
-            <version>1.5.21</version>
-        </dependency>
-		
-		<!-- swagger2-UI-->
-		<dependency>
-			<groupId>io.springfox</groupId>
-			<artifactId>springfox-swagger-ui</artifactId>
-		</dependency>
-
-		<!-- 核心模块-->
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-framework</artifactId>
-        </dependency>
-        
-        <!-- 定时任务-->
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-quartz</artifactId>
-        </dependency>
-        
-        <!-- 代码生成-->
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-generator</artifactId>
-        </dependency>
-        <!-- 商品管理-->
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-goods-admin</artifactId>
-            <version>4.0.0</version>
-        </dependency>
-        <!-- 会员管理-->
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-member-admin</artifactId>
-            <version>4.0.0</version>
-        </dependency>
-
-
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <configuration>
-					<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
-				</configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>   
-                <groupId>org.apache.maven.plugins</groupId>   
-                <artifactId>maven-war-plugin</artifactId>   
-                <version>3.0.0</version>   
-                <configuration>
-                    <failOnMissingWebXml>false</failOnMissingWebXml>
-                    <warName>${artifactId}</warName>
-                </configuration>   
-		   </plugin>   
-        </plugins>
-        <finalName>${artifactId}</finalName>
-    </build>
-	
-</project>

+ 0 - 30
dgtly-admin/src/main/java/com/dgtly/RuoYiApplication.java

@@ -1,30 +0,0 @@
-package com.dgtly;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-
-/**
- * 启动程序
- * 
- * @author ruoyi
- */
-@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
-public class RuoYiApplication
-{
-    public static void main(String[] args)
-    {
-        // System.setProperty("spring.devtools.restart.enabled", "false");
-        SpringApplication.run(RuoYiApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  系统启动成功   ლ(´ڡ`ლ)゙  \n" +
-        " _____    _____  _______  _   __     __        ____   _   _  ______  _____    ____   _____  _______         _      \n" +
-                "|  __ \\  / ____||__   __|| |  \\ \\   / /       / __ \\ | \\ | ||  ____||  __ \\  / __ \\ |  __ \\|__   __| /\\    | |     \n" +
-                "| |  | || |  __    | |   | |   \\ \\_/ /______ | |  | ||  \\| || |__   | |__) || |  | || |__) |  | |   /  \\   | |     \n" +
-                "| |  | || | |_ |   | |   | |    \\   /|______|| |  | || . ` ||  __|  |  ___/ | |  | ||  _  /   | |  / /\\ \\  | |     \n" +
-                "| |__| || |__| |   | |   | |____ | |         | |__| || |\\  || |____ | |     | |__| || | \\ \\   | | / ____ \\ | |____ \n" +
-                "|_____/  \\_____|   |_|   |______||_|          \\____/ |_| \\_||______||_|      \\____/ |_|  \\_\\  |_|/_/    \\_\\|______|\n "+
-                "\n"+
-                "(♥◠‿◠)ノ゙ 通誉企业云平台  ლ(´ڡ`ლ)゙"
-        );
-    }
-}

+ 0 - 18
dgtly-admin/src/main/java/com/dgtly/RuoYiServletInitializer.java

@@ -1,18 +0,0 @@
-package com.dgtly;
-
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
-
-/**
- * web容器中进行部署
- * 
- * @author ruoyi
- */
-public class RuoYiServletInitializer extends SpringBootServletInitializer
-{
-    @Override
-    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
-    {
-        return application.sources(RuoYiApplication.class);
-    }
-}

+ 0 - 89
dgtly-admin/src/main/java/com/dgtly/web/controller/monitor/SysOperlogController.java

@@ -1,89 +0,0 @@
-package com.dgtly.web.controller.monitor;
-
-import java.util.List;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.utils.poi.ExcelUtil;
-import com.dgtly.system.domain.SysOperLog;
-import com.dgtly.system.service.ISysOperLogService;
-
-/**
- * 操作日志记录
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/monitor/operlog")
-public class SysOperlogController extends BaseController
-{
-    private String prefix = "monitor/operlog";
-
-    @Autowired
-    private ISysOperLogService operLogService;
-
-    @RequiresPermissions("monitor:operlog:view")
-    @GetMapping()
-    public String operlog()
-    {
-        return prefix + "/operlog";
-    }
-
-    @RequiresPermissions("monitor:operlog:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public TableDataInfo list(SysOperLog operLog)
-    {
-        startPage();
-        List<SysOperLog> list = operLogService.selectOperLogList(operLog);
-        return getDataTable(list);
-    }
-
-    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
-    @RequiresPermissions("monitor:operlog:export")
-    @PostMapping("/export")
-    @ResponseBody
-    public AjaxResult export(SysOperLog operLog)
-    {
-        List<SysOperLog> list = operLogService.selectOperLogList(operLog);
-        ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
-        return util.exportExcel(list, "操作日志");
-    }
-
-    @RequiresPermissions("monitor:operlog:remove")
-    @PostMapping("/remove")
-    @ResponseBody
-    public AjaxResult remove(String ids)
-    {
-        return toAjax(operLogService.deleteOperLogByIds(ids));
-    }
-
-    @RequiresPermissions("monitor:operlog:detail")
-    @GetMapping("/detail/{operId}")
-    public String detail(@PathVariable("operId") Long operId, ModelMap mmap)
-    {
-        mmap.put("operLog", operLogService.selectOperLogById(operId));
-        return prefix + "/detail";
-    }
-    
-    @Log(title = "操作日志", businessType = BusinessType.CLEAN)
-    @RequiresPermissions("monitor:operlog:remove")
-    @PostMapping("/clean")
-    @ResponseBody
-    public AjaxResult clean()
-    {
-        operLogService.cleanOperLog();
-        return success();
-    }
-}

+ 0 - 114
dgtly-admin/src/main/java/com/dgtly/web/controller/monitor/SysUserOnlineController.java

@@ -1,114 +0,0 @@
-package com.dgtly.web.controller.monitor;
-
-import java.util.List;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-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.ResponseBody;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.enums.OnlineStatus;
-import com.dgtly.framework.shiro.session.OnlineSession;
-import com.dgtly.framework.shiro.session.OnlineSessionDAO;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysUserOnline;
-import com.dgtly.system.service.ISysUserOnlineService;
-
-/**
- * 在线用户监控
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/monitor/online")
-public class SysUserOnlineController extends BaseController
-{
-    private String prefix = "monitor/online";
-
-    @Autowired
-    private ISysUserOnlineService userOnlineService;
-
-    @Autowired
-    private OnlineSessionDAO onlineSessionDAO;
-
-    @RequiresPermissions("monitor:online:view")
-    @GetMapping()
-    public String online()
-    {
-        return prefix + "/online";
-    }
-
-    @RequiresPermissions("monitor:online:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public TableDataInfo list(SysUserOnline userOnline)
-    {
-        startPage();
-        List<SysUserOnline> list = userOnlineService.selectUserOnlineList(userOnline);
-        return getDataTable(list);
-    }
-
-    @RequiresPermissions("monitor:online:batchForceLogout")
-    @Log(title = "在线用户", businessType = BusinessType.FORCE)
-    @PostMapping("/batchForceLogout")
-    @ResponseBody
-    public AjaxResult batchForceLogout(@RequestParam("ids[]") String[] ids)
-    {
-        for (String sessionId : ids)
-        {
-            SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
-            if (online == null)
-            {
-                return error("用户已下线");
-            }
-            OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
-            if (onlineSession == null)
-            {
-                return error("用户已下线");
-            }
-            if (sessionId.equals(ShiroUtils.getSessionId()))
-            {
-                return error("当前登陆用户无法强退");
-            }
-            onlineSession.setStatus(OnlineStatus.off_line);
-            onlineSessionDAO.update(onlineSession);
-            online.setStatus(OnlineStatus.off_line);
-            userOnlineService.saveOnline(online);
-        }
-        return success();
-    }
-
-    @RequiresPermissions("monitor:online:forceLogout")
-    @Log(title = "在线用户", businessType = BusinessType.FORCE)
-    @PostMapping("/forceLogout")
-    @ResponseBody
-    public AjaxResult forceLogout(String sessionId)
-    {
-        SysUserOnline online = userOnlineService.selectOnlineById(sessionId);
-        if (sessionId.equals(ShiroUtils.getSessionId()))
-        {
-            return error("当前登陆用户无法强退");
-        }
-        if (online == null)
-        {
-            return error("用户已下线");
-        }
-        OnlineSession onlineSession = (OnlineSession) onlineSessionDAO.readSession(online.getSessionId());
-        if (onlineSession == null)
-        {
-            return error("用户已下线");
-        }
-        onlineSession.setStatus(OnlineStatus.off_line);
-        onlineSessionDAO.update(onlineSession);
-        online.setStatus(OnlineStatus.off_line);
-        userOnlineService.saveOnline(online);
-        return success();
-    }
-}

+ 0 - 92
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysCaptchaController.java

@@ -1,92 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import javax.annotation.Resource;
-import javax.imageio.ImageIO;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.servlet.ModelAndView;
-import com.google.code.kaptcha.Constants;
-import com.google.code.kaptcha.Producer;
-import com.dgtly.common.core.controller.BaseController;
-
-/**
- * 图片验证码(支持算术形式)
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/captcha")
-public class SysCaptchaController extends BaseController
-{
-    @Resource(name = "captchaProducer")
-    private Producer captchaProducer;
-
-    @Resource(name = "captchaProducerMath")
-    private Producer captchaProducerMath;
-
-    /**
-     * 验证码生成
-     */
-    @GetMapping(value = "/captchaImage")
-    public ModelAndView getKaptchaImage(HttpServletRequest request, HttpServletResponse response)
-    {
-        ServletOutputStream out = null;
-        try
-        {
-            HttpSession session = request.getSession();
-            response.setDateHeader("Expires", 0);
-            response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
-            response.addHeader("Cache-Control", "post-check=0, pre-check=0");
-            response.setHeader("Pragma", "no-cache");
-            response.setContentType("image/jpeg");
-
-            String type = request.getParameter("type");
-            String capStr = null;
-            String code = null;
-            BufferedImage bi = null;
-            if ("math".equals(type))
-            {
-                String capText = captchaProducerMath.createText();
-                capStr = capText.substring(0, capText.lastIndexOf("@"));
-                code = capText.substring(capText.lastIndexOf("@") + 1);
-                bi = captchaProducerMath.createImage(capStr);
-            }
-            else if ("char".equals(type))
-            {
-                capStr = code = captchaProducer.createText();
-                bi = captchaProducer.createImage(capStr);
-            }
-            session.setAttribute(Constants.KAPTCHA_SESSION_KEY, code);
-            out = response.getOutputStream();
-            ImageIO.write(bi, "jpg", out);
-            out.flush();
-
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-        finally
-        {
-            try
-            {
-                if (out != null)
-                {
-                    out.close();
-                }
-            }
-            catch (IOException e)
-            {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 144
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysConfigController.java

@@ -1,144 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import java.util.List;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.constant.UserConstants;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.utils.poi.ExcelUtil;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysConfig;
-import com.dgtly.system.service.ISysConfigService;
-
-/**
- * 参数配置 信息操作处理
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/system/config")
-public class SysConfigController extends BaseController
-{
-    private String prefix = "system/config";
-
-    @Autowired
-    private ISysConfigService configService;
-
-    @RequiresPermissions("system:config:view")
-    @GetMapping()
-    public String config()
-    {
-        return prefix + "/config";
-    }
-
-    /**
-     * 查询参数配置列表
-     */
-    @RequiresPermissions("system:config:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public TableDataInfo list(SysConfig config)
-    {
-        startPage();
-        List<SysConfig> list = configService.selectConfigList(config);
-        return getDataTable(list);
-    }
-
-    @Log(title = "参数管理", businessType = BusinessType.EXPORT)
-    @RequiresPermissions("system:config:export")
-    @PostMapping("/export")
-    @ResponseBody
-    public AjaxResult export(SysConfig config)
-    {
-        List<SysConfig> list = configService.selectConfigList(config);
-        ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
-        return util.exportExcel(list, "参数数据");
-    }
-
-    /**
-     * 新增参数配置
-     */
-    @GetMapping("/add")
-    public String add()
-    {
-        return prefix + "/add";
-    }
-
-    /**
-     * 新增保存参数配置
-     */
-    @RequiresPermissions("system:config:add")
-    @Log(title = "参数管理", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    @ResponseBody
-    public AjaxResult addSave(@Validated SysConfig config)
-    {
-        if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
-        {
-            return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
-        }
-        config.setCreateBy(ShiroUtils.getLoginName());
-        return toAjax(configService.insertConfig(config));
-    }
-
-    /**
-     * 修改参数配置
-     */
-    @GetMapping("/edit/{configId}")
-    public String edit(@PathVariable("configId") Long configId, ModelMap mmap)
-    {
-        mmap.put("config", configService.selectConfigById(configId));
-        return prefix + "/edit";
-    }
-
-    /**
-     * 修改保存参数配置
-     */
-    @RequiresPermissions("system:config:edit")
-    @Log(title = "参数管理", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    @ResponseBody
-    public AjaxResult editSave(@Validated SysConfig config)
-    {
-        if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
-        {
-            return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
-        }
-        config.setUpdateBy(ShiroUtils.getLoginName());
-        return toAjax(configService.updateConfig(config));
-    }
-
-    /**
-     * 删除参数配置
-     */
-    @RequiresPermissions("system:config:remove")
-    @Log(title = "参数管理", businessType = BusinessType.DELETE)
-    @PostMapping("/remove")
-    @ResponseBody
-    public AjaxResult remove(String ids)
-    {
-        return toAjax(configService.deleteConfigByIds(ids));
-    }
-
-    /**
-     * 校验参数键名
-     */
-    @PostMapping("/checkConfigKeyUnique")
-    @ResponseBody
-    public String checkConfigKeyUnique(SysConfig config)
-    {
-        return configService.checkConfigKeyUnique(config);
-    }
-}

+ 0 - 198
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysMenuController.java

@@ -1,198 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import java.util.List;
-
-import com.dgtly.common.exception.BusinessException;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.constant.UserConstants;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.domain.Ztree;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysMenu;
-import com.dgtly.system.domain.SysRole;
-import com.dgtly.system.service.ISysMenuService;
-
-/**
- * 菜单信息
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/system/menu")
-public class SysMenuController extends BaseController
-{
-    private String prefix = "system/menu";
-
-    @Autowired
-    private ISysMenuService menuService;
-
-    @RequiresPermissions("system:menu:view")
-    @GetMapping()
-    public String menu()
-    {
-        return prefix + "/menu";
-    }
-
-    @RequiresPermissions("system:menu:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public List<SysMenu> list(SysMenu menu)
-    {
-        Long userId = ShiroUtils.getUserId();
-        List<SysMenu> menuList = menuService.selectMenuList(menu, userId);
-        return menuList;
-    }
-
-    /**
-     * 删除菜单
-     */
-    @Log(title = "菜单管理", businessType = BusinessType.DELETE)
-    @RequiresPermissions("system:menu:remove")
-    @GetMapping("/remove/{menuId}")
-    @ResponseBody
-    public AjaxResult remove(@PathVariable("menuId") Long menuId)
-    {
-        if (menuService.selectCountMenuByParentId(menuId) > 0)
-        {
-            throw new BusinessException("存在子菜单,不允许删除");
-        }
-        if (menuService.selectCountRoleMenuByMenuId(menuId) > 0)
-        {
-            throw new BusinessException("菜单已分配,不允许删除");
-        }
-        ShiroUtils.clearCachedAuthorizationInfo();
-        return toAjax(menuService.deleteMenuById(menuId));
-    }
-
-    /**
-     * 新增
-     */
-    @GetMapping("/add/{parentId}")
-    public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
-    {
-        SysMenu menu = null;
-        if (0L != parentId)
-        {
-            menu = menuService.selectMenuById(parentId);
-        }
-        else
-        {
-            menu = new SysMenu();
-            menu.setMenuId(0L);
-            menu.setMenuName("主目录");
-        }
-        mmap.put("menu", menu);
-        return prefix + "/add";
-    }
-
-    /**
-     * 新增保存菜单
-     */
-    @Log(title = "菜单管理", businessType = BusinessType.INSERT)
-    @RequiresPermissions("system:menu:add")
-    @PostMapping("/add")
-    @ResponseBody
-    public AjaxResult addSave(@Validated SysMenu menu)
-    {
-        if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
-        {
-            return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
-        }
-        menu.setCreateBy(ShiroUtils.getLoginName());
-        ShiroUtils.clearCachedAuthorizationInfo();
-        return toAjax(menuService.insertMenu(menu));
-    }
-
-    /**
-     * 修改菜单
-     */
-    @GetMapping("/edit/{menuId}")
-    public String edit(@PathVariable("menuId") Long menuId, ModelMap mmap)
-    {
-        mmap.put("menu", menuService.selectMenuById(menuId));
-        return prefix + "/edit";
-    }
-
-    /**
-     * 修改保存菜单
-     */
-    @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
-    @RequiresPermissions("system:menu:edit")
-    @PostMapping("/edit")
-    @ResponseBody
-    public AjaxResult editSave(@Validated SysMenu menu)
-    {
-        if (UserConstants.MENU_NAME_NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
-        {
-            return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
-        }
-        menu.setUpdateBy(ShiroUtils.getLoginName());
-        ShiroUtils.clearCachedAuthorizationInfo();
-        return toAjax(menuService.updateMenu(menu));
-    }
-
-    /**
-     * 选择菜单图标
-     */
-    @GetMapping("/icon")
-    public String icon()
-    {
-        return prefix + "/icon";
-    }
-
-    /**
-     * 校验菜单名称
-     */
-    @PostMapping("/checkMenuNameUnique")
-    @ResponseBody
-    public String checkMenuNameUnique(SysMenu menu)
-    {
-        return menuService.checkMenuNameUnique(menu);
-    }
-
-    /**
-     * 加载角色菜单列表树
-     */
-    @GetMapping("/roleMenuTreeData")
-    @ResponseBody
-    public List<Ztree> roleMenuTreeData(SysRole role)
-    {
-        Long userId = ShiroUtils.getUserId();
-        List<Ztree> ztrees = menuService.roleMenuTreeData(role, userId);
-        return ztrees;
-    }
-
-    /**
-     * 加载所有菜单列表树
-     */
-    @GetMapping("/menuTreeData")
-    @ResponseBody
-    public List<Ztree> menuTreeData()
-    {
-        Long userId = ShiroUtils.getUserId();
-        List<Ztree> ztrees = menuService.menuTreeData(userId);
-        return ztrees;
-    }
-
-    /**
-     * 选择菜单树
-     */
-    @GetMapping("/selectMenuTree/{menuId}")
-    public String selectMenuTree(@PathVariable("menuId") Long menuId, ModelMap mmap)
-    {
-        mmap.put("menu", menuService.selectMenuById(menuId));
-        return prefix + "/tree";
-    }
-}

+ 0 - 143
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysNoticeController.java

@@ -1,143 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import java.util.List;
-
-import com.dgtly.common.config.Global;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.file.FileUploadUtils;
-import com.dgtly.common.utils.file.FileUtils;
-import com.dgtly.system.domain.SysUser;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.*;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysNotice;
-import com.dgtly.system.service.ISysNoticeService;
-import org.springframework.web.multipart.MultipartFile;
-
-/**
- * 公告 信息操作处理
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/system/notice")
-public class SysNoticeController extends BaseController
-{
-    private String prefix = "system/notice";
-
-    @Autowired
-    private ISysNoticeService noticeService;
-
-    @RequiresPermissions("system:notice:view")
-    @GetMapping()
-    public String notice()
-    {
-        return prefix + "/notice";
-    }
-
-    /**
-     * 查询公告列表
-     */
-    @RequiresPermissions("system:notice:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public TableDataInfo list(SysNotice notice)
-    {
-        startPage();
-        notice.setCompanyId(ShiroUtils.getCompanyId());
-        List<SysNotice> list = noticeService.selectNoticeListByRole(notice);
-        return getDataTable(list);
-    }
-
-    /**
-     * 新增公告
-     */
-    @GetMapping("/add")
-    public String add()
-    {
-        return prefix + "/add";
-    }
-
-    /**
-     * 新增保存公告
-     */
-    @RequiresPermissions("system:notice:add")
-    @Log(title = "通知公告", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    @ResponseBody
-    public AjaxResult addSave(SysNotice notice,MultipartFile file)
-    {
-
-
-            if(StringUtils.isNotEmpty(notice.getFmzFile())){
-                //获取base64文件后缀
-                String houzhui = notice.getFmzFile().split(";")[0].split("\\/")[1];
-                //获取base64值
-                String base64 = notice.getFmzFile().substring( notice.getFmzFile().indexOf(",") + 1);
-
-                //base64转文件 并返回展示url
-                String fileUrl = FileUploadUtils.base64ToFile(base64,FileUploadUtils.getDefaultBaseDir()+"/content",System.currentTimeMillis()+"."+houzhui);
-                notice.setFmzFileUrl(fileUrl);
-            }
-            notice.setCompanyId(ShiroUtils.getCompanyId());
-            notice.setCreateBy(ShiroUtils.getLoginName());
-            return toAjax(noticeService.insertNotice(notice));
-
-
-
-
-    }
-
-    /**
-     * 修改公告
-     */
-    @GetMapping("/edit/{noticeId}")
-    public String edit(@PathVariable("noticeId") Long noticeId, ModelMap mmap)
-    {
-        mmap.put("notice", noticeService.selectNoticeById(noticeId));
-        return prefix + "/edit";
-    }
-
-    /**
-     * 修改保存公告
-     */
-    @RequiresPermissions("system:notice:edit")
-    @Log(title = "通知公告", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    @ResponseBody
-    public AjaxResult editSave(SysNotice notice)
-    {
-        if(StringUtils.isNotEmpty(notice.getFmzFileUrl())){
-            //获取base64文件后缀
-            String houzhui = notice.getFmzFileUrl().split(";")[0].split("\\/")[1];
-            //获取base64值
-            String base64 = notice.getFmzFileUrl().substring( notice.getFmzFileUrl().indexOf(",") + 1);
-
-            //base64转文件 并返回展示url
-            String fileUrl = FileUploadUtils.base64ToFile(base64,FileUploadUtils.getDefaultBaseDir()+"/content",System.currentTimeMillis()+"."+houzhui);
-            notice.setFmzFileUrl(fileUrl);
-        }
-        notice.setUpdateBy(ShiroUtils.getLoginName());
-        return toAjax(noticeService.updateNotice(notice));
-    }
-
-    /**
-     * 删除公告
-     */
-    @RequiresPermissions("system:notice:remove")
-    @Log(title = "通知公告", businessType = BusinessType.DELETE)
-    @PostMapping("/remove")
-    @ResponseBody
-    public AjaxResult remove(String ids)
-    {
-        return toAjax(noticeService.deleteNoticeByIds(ids));
-    }
-}

+ 0 - 163
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysPostController.java

@@ -1,163 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import java.util.List;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.constant.UserConstants;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.utils.poi.ExcelUtil;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysPost;
-import com.dgtly.system.service.ISysPostService;
-
-/**
- * 岗位信息操作处理
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/system/post")
-public class SysPostController extends BaseController
-{
-    private String prefix = "system/post";
-
-    @Autowired
-    private ISysPostService postService;
-
-    @RequiresPermissions("system:post:view")
-    @GetMapping()
-    public String operlog()
-    {
-        return prefix + "/post";
-    }
-
-    @RequiresPermissions("system:post:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public TableDataInfo list(SysPost post)
-    {
-        startPage();
-        List<SysPost> list = postService.selectPostList(post);
-        return getDataTable(list);
-    }
-
-    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
-    @RequiresPermissions("system:post:export")
-    @PostMapping("/export")
-    @ResponseBody
-    public AjaxResult export(SysPost post)
-    {
-        List<SysPost> list = postService.selectPostList(post);
-        ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
-        return util.exportExcel(list, "岗位数据");
-    }
-
-    @RequiresPermissions("system:post:remove")
-    @Log(title = "岗位管理", businessType = BusinessType.DELETE)
-    @PostMapping("/remove")
-    @ResponseBody
-    public AjaxResult remove(String ids)
-    {
-        try
-        {
-            return toAjax(postService.deletePostByIds(ids));
-        }
-        catch (Exception e)
-        {
-            return error(e.getMessage());
-        }
-    }
-
-    /**
-     * 新增岗位
-     */
-    @GetMapping("/add")
-    public String add()
-    {
-        return prefix + "/add";
-    }
-
-    /**
-     * 新增保存岗位
-     */
-    @RequiresPermissions("system:post:add")
-    @Log(title = "岗位管理", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    @ResponseBody
-    public AjaxResult addSave(@Validated SysPost post)
-    {
-        if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
-        {
-            return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
-        }
-        else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
-        {
-            return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
-        }
-        post.setCreateBy(ShiroUtils.getLoginName());
-        return toAjax(postService.insertPost(post));
-    }
-
-    /**
-     * 修改岗位
-     */
-    @GetMapping("/edit/{postId}")
-    public String edit(@PathVariable("postId") Long postId, ModelMap mmap)
-    {
-        mmap.put("post", postService.selectPostById(postId));
-        return prefix + "/edit";
-    }
-
-    /**
-     * 修改保存岗位
-     */
-    @RequiresPermissions("system:post:edit")
-    @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    @ResponseBody
-    public AjaxResult editSave(@Validated SysPost post)
-    {
-        if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
-        {
-            return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
-        }
-        else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
-        {
-            return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
-        }
-        post.setUpdateBy(ShiroUtils.getLoginName());
-        return toAjax(postService.updatePost(post));
-    }
-
-    /**
-     * 校验岗位名称
-     */
-    @PostMapping("/checkPostNameUnique")
-    @ResponseBody
-    public String checkPostNameUnique(SysPost post)
-    {
-        return postService.checkPostNameUnique(post);
-    }
-
-    /**
-     * 校验岗位编码
-     */
-    @PostMapping("/checkPostCodeUnique")
-    @ResponseBody
-    public String checkPostCodeUnique(SysPost post)
-    {
-        return postService.checkPostCodeUnique(post);
-    }
-}

+ 0 - 175
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysProfileController.java

@@ -1,175 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import com.dgtly.common.utils.ShiroSaltUtil;
-import com.dgtly.common.utils.security.EncryptPassWordClass;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.GetMapping;
-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.ResponseBody;
-import org.springframework.web.multipart.MultipartFile;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.config.Global;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.file.FileUploadUtils;
-import com.dgtly.framework.shiro.service.SysPasswordService;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.service.ISysUserService;
-
-/**
- * 个人信息 业务处理
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/system/user/profile")
-public class SysProfileController extends BaseController
-{
-    private static final Logger log = LoggerFactory.getLogger(SysProfileController.class);
-
-    private String prefix = "system/user/profile";
-
-    @Autowired
-    private ISysUserService userService;
-    
-    @Autowired
-    private SysPasswordService passwordService;
-
-    /**
-     * 个人信息
-     */
-    @GetMapping()
-    public String profile(ModelMap mmap)
-    {
-        SysUser user = ShiroUtils.getSysUser();
-        mmap.put("user", user);
-        mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId()));
-        mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
-        return prefix + "/profile";
-    }
-
-    @GetMapping("/checkPassword")
-    @ResponseBody
-    public boolean checkPassword(String password)
-    {
-        SysUser user = ShiroUtils.getSysUser();
-        if (passwordService.matches(user, password))
-        {
-            return true;
-        }
-        return false;
-    }
-
-    @GetMapping("/resetPwd")
-    public String resetPwd(ModelMap mmap)
-    {
-        SysUser user = ShiroUtils.getSysUser();
-        mmap.put("user", userService.selectUserById(user.getUserId()));
-        return prefix + "/resetPwd";
-    }
-
-    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
-    @PostMapping("/resetPwd")
-    @ResponseBody
-    public AjaxResult resetPwd(String oldPassword, String newPassword)
-    {
-        SysUser user = ShiroUtils.getSysUser();
-        if (StringUtils.isNotEmpty(newPassword) && passwordService.matches(user, oldPassword))
-        {
-            user.setSalt(ShiroSaltUtil.randomSalt());
-            user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
-            if (userService.resetUserPwd(user) > 0)
-            {
-                ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
-                return success();
-            }
-            return error();
-        }
-        else
-        {
-            return error("修改密码失败,旧密码错误");
-        }
-    }
-
-    /**
-     * 修改用户
-     */
-    @GetMapping("/edit")
-    public String edit(ModelMap mmap)
-    {
-        SysUser user = ShiroUtils.getSysUser();
-        mmap.put("user", userService.selectUserById(user.getUserId()));
-        return prefix + "/edit";
-    }
-
-    /**
-     * 修改头像
-     */
-    @GetMapping("/avatar")
-    public String avatar(ModelMap mmap)
-    {
-        SysUser user = ShiroUtils.getSysUser();
-        mmap.put("user", userService.selectUserById(user.getUserId()));
-        return prefix + "/avatar";
-    }
-
-    /**
-     * 修改用户
-     */
-    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
-    @PostMapping("/update")
-    @ResponseBody
-    public AjaxResult update(SysUser user)
-    {
-        SysUser currentUser = ShiroUtils.getSysUser();
-        currentUser.setUserName(user.getUserName());
-        currentUser.setEmail(user.getEmail());
-        currentUser.setPhonenumber(user.getPhonenumber());
-        currentUser.setSex(user.getSex());
-        if (userService.updateUserInfo(currentUser) > 0)
-        {
-            ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
-            return success();
-        }
-        return error();
-    }
-
-    /**
-     * 保存头像
-     */
-    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
-    @PostMapping("/updateAvatar")
-    @ResponseBody
-    public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
-    {
-        SysUser currentUser = ShiroUtils.getSysUser();
-        try
-        {
-            if (!file.isEmpty())
-            {
-                String avatar = FileUploadUtils.upload(Global.getAvatarPath(), file);
-                currentUser.setAvatar(avatar);
-                if (userService.updateUserInfo(currentUser) > 0)
-                {
-                    ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
-                    return success();
-                }
-            }
-            return error();
-        }
-        catch (Exception e)
-        {
-            log.error("修改头像失败!", e);
-            return error(e.getMessage());
-        }
-    }
-}

+ 0 - 312
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysRoleController.java

@@ -1,312 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import java.util.List;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.constant.UserConstants;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.utils.poi.ExcelUtil;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysRole;
-import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.domain.SysUserRole;
-import com.dgtly.system.service.ISysRoleService;
-import com.dgtly.system.service.ISysUserService;
-
-/**
- * 角色信息
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/system/role")
-public class SysRoleController extends BaseController
-{
-    private String prefix = "system/role";
-
-    @Autowired
-    private ISysRoleService roleService;
-
-    @Autowired
-    private ISysUserService userService;
-
-    @RequiresPermissions("system:role:view")
-    @GetMapping()
-    public String role()
-    {
-        return prefix + "/role";
-    }
-
-    @RequiresPermissions("system:role:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public TableDataInfo list(SysRole role)
-    {
-        startPage();
-        List<SysRole> list = roleService.selectRoleList(role);
-        return getDataTable(list);
-    }
-
-    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
-    @RequiresPermissions("system:role:export")
-    @PostMapping("/export")
-    @ResponseBody
-    public AjaxResult export(SysRole role)
-    {
-        List<SysRole> list = roleService.selectRoleList(role);
-        ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
-        return util.exportExcel(list, "角色数据");
-    }
-
-    /**
-     * 新增角色
-     */
-    @GetMapping("/add")
-    public String add()
-    {
-        return prefix + "/add";
-    }
-
-    /**
-     * 新增保存角色
-     */
-    @RequiresPermissions("system:role:add")
-    @Log(title = "角色管理", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    @ResponseBody
-    public AjaxResult addSave(@Validated SysRole role)
-    {
-        if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
-        {
-            return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
-        }
-        else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
-        {
-            return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
-        }
-        role.setCreateBy(ShiroUtils.getLoginName());
-        ShiroUtils.clearCachedAuthorizationInfo();
-        return toAjax(roleService.insertRole(role));
-
-    }
-
-    /**
-     * 修改角色
-     */
-    @GetMapping("/edit/{roleId}")
-    public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap)
-    {
-        mmap.put("role", roleService.selectRoleById(roleId));
-        return prefix + "/edit";
-    }
-
-    /**
-     * 修改保存角色
-     */
-    @RequiresPermissions("system:role:edit")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    @ResponseBody
-    public AjaxResult editSave(@Validated SysRole role)
-    {
-        roleService.checkRoleAllowed(role);
-        if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
-        {
-            return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
-        }
-        else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
-        {
-            return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
-        }
-        role.setUpdateBy(ShiroUtils.getLoginName());
-        ShiroUtils.clearCachedAuthorizationInfo();
-        return toAjax(roleService.updateRole(role));
-    }
-
-    /**
-     * 角色分配数据权限
-     */
-    @GetMapping("/authDataScope/{roleId}")
-    public String authDataScope(@PathVariable("roleId") Long roleId, ModelMap mmap)
-    {
-        SysUser user = ShiroUtils.getSysUser();
-        Boolean isAdmin =false;
-        mmap.put("role", roleService.selectRoleById(roleId));
-        for(SysRole sysRole:user.getRoles()){
-            if(sysRole.isAdmin()){
-                isAdmin = true;
-            }
-        }
-        mmap.put("isAdmin", isAdmin);
-        return prefix + "/dataScope";
-    }
-
-    /**
-     * 保存角色分配数据权限
-     */
-    @RequiresPermissions("system:role:edit")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PostMapping("/authDataScope")
-    @ResponseBody
-    public AjaxResult authDataScopeSave(SysRole role)
-    {
-        roleService.checkRoleAllowed(role);
-        role.setUpdateBy(ShiroUtils.getLoginName());
-        if (roleService.authDataScope(role) > 0)
-        {
-            ShiroUtils.setSysUser(userService.selectUserById(ShiroUtils.getSysUser().getUserId()));
-            return success();
-        }
-        return error();
-    }
-
-    @RequiresPermissions("system:role:remove")
-    @Log(title = "角色管理", businessType = BusinessType.DELETE)
-    @PostMapping("/remove")
-    @ResponseBody
-    public AjaxResult remove(String ids)
-    {
-        try
-        {
-            return toAjax(roleService.deleteRoleByIds(ids));
-        }
-        catch (Exception e)
-        {
-            return error(e.getMessage());
-        }
-    }
-
-    /**
-     * 校验角色名称
-     */
-    @PostMapping("/checkRoleNameUnique")
-    @ResponseBody
-    public String checkRoleNameUnique(SysRole role)
-    {
-        return roleService.checkRoleNameUnique(role);
-    }
-
-    /**
-     * 校验角色权限
-     */
-    @PostMapping("/checkRoleKeyUnique")
-    @ResponseBody
-    public String checkRoleKeyUnique(SysRole role)
-    {
-        return roleService.checkRoleKeyUnique(role);
-    }
-
-    /**
-     * 选择菜单树
-     */
-    @GetMapping("/selectMenuTree")
-    public String selectMenuTree()
-    {
-        return prefix + "/tree";
-    }
-
-    /**
-     * 角色状态修改
-     */
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @RequiresPermissions("system:role:edit")
-    @PostMapping("/changeStatus")
-    @ResponseBody
-    public AjaxResult changeStatus(SysRole role)
-    {
-        roleService.checkRoleAllowed(role);
-        return toAjax(roleService.changeStatus(role));
-    }
-
-    /**
-     * 分配用户
-     */
-    @RequiresPermissions("system:role:edit")
-    @GetMapping("/authUser/{roleId}")
-    public String authUser(@PathVariable("roleId") Long roleId, ModelMap mmap)
-    {
-        mmap.put("role", roleService.selectRoleById(roleId));
-        return prefix + "/authUser";
-    }
-
-    /**
-     * 查询已分配用户角色列表
-     */
-    @RequiresPermissions("system:role:list")
-    @PostMapping("/authUser/allocatedList")
-    @ResponseBody
-    public TableDataInfo allocatedList(SysUser user)
-    {
-        startPage();
-        List<SysUser> list = userService.selectAllocatedList(user);
-        return getDataTable(list);
-    }
-
-    /**
-     * 取消授权
-     */
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PostMapping("/authUser/cancel")
-    @ResponseBody
-    public AjaxResult cancelAuthUser(SysUserRole userRole)
-    {
-        return toAjax(roleService.deleteAuthUser(userRole));
-    }
-
-    /**
-     * 批量取消授权
-     */
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PostMapping("/authUser/cancelAll")
-    @ResponseBody
-    public AjaxResult cancelAuthUserAll(Long roleId, String userIds)
-    {
-        return toAjax(roleService.deleteAuthUsers(roleId, userIds));
-    }
-
-    /**
-     * 选择用户
-     */
-    @GetMapping("/authUser/selectUser/{roleId}")
-    public String selectUser(@PathVariable("roleId") Long roleId, ModelMap mmap)
-    {
-        mmap.put("role", roleService.selectRoleById(roleId));
-        return prefix + "/selectUser";
-    }
-
-    /**
-     * 查询未分配用户角色列表
-     */
-    @RequiresPermissions("system:role:list")
-    @PostMapping("/authUser/unallocatedList")
-    @ResponseBody
-    public TableDataInfo unallocatedList(SysUser user)
-    {
-        startPage();
-        List<SysUser> list = userService.selectUnallocatedList(user);
-        return getDataTable(list);
-    }
-
-    /**
-     * 批量选择用户授权
-     */
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PostMapping("/authUser/selectAll")
-    @ResponseBody
-    public AjaxResult selectAuthUserAll(Long roleId, String userIds)
-    {
-        return toAjax(roleService.insertAuthUsers(roleId, userIds));
-    }
-}

+ 0 - 301
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysUserController.java

@@ -1,301 +0,0 @@
-package com.dgtly.web.controller.system;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.dgtly.common.exception.BusinessException;
-import com.dgtly.common.utils.ShiroSaltUtil;
-import com.dgtly.common.utils.security.EncryptPassWordClass;
-import com.dgtly.system.domain.SysCompany;
-import com.dgtly.system.domain.SysDept;
-import com.dgtly.system.service.*;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.ui.ModelMap;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.multipart.MultipartFile;
-import com.dgtly.common.annotation.Log;
-import com.dgtly.common.constant.UserConstants;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.utils.poi.ExcelUtil;
-import com.dgtly.framework.shiro.service.SysPasswordService;
-import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysUser;
-
-/**
- * 用户信息
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/system/user")
-public class SysUserController extends BaseController
-{
-    private String prefix = "system/user";
-
-    @Autowired
-    private ISysUserService userService;
-
-    @Autowired
-    private ISysRoleService roleService;
-
-    @Autowired
-    private ISysPostService postService;
-    @Autowired
-    private ISysDeptService deptService;
-    @Autowired
-    private ISysCompanyService companyService;
-    @Autowired
-    private SysPasswordService passwordService;
-
-    @RequiresPermissions("system:user:view")
-    @GetMapping()
-    public String user()
-    {
-        return prefix + "/user";
-    }
-
-    @RequiresPermissions("system:user:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public TableDataInfo list(SysUser user)
-    {
-        SysUser localUser = ShiroUtils.getSysUser();
-
-        startPage();
-        List<SysUser> list = userService.selectUserList(user);
-        return getDataTable(list);
-    }
-
-    @Log(title = "用户管理", businessType = BusinessType.EXPORT)
-    @RequiresPermissions("system:user:export")
-    @PostMapping("/export")
-    @ResponseBody
-    public AjaxResult export(SysUser user)
-    {
-        List<SysUser> list = userService.selectUserList(user);
-        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
-        return util.exportExcel(list, "用户数据");
-    }
-
-    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
-    @RequiresPermissions("system:user:import")
-    @PostMapping("/importData")
-    @ResponseBody
-    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
-    {
-        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
-        List<SysUser> userList = util.importExcel(file.getInputStream());
-        String operName = ShiroUtils.getSysUser().getLoginName();
-        Long companyId = ShiroUtils.getCompanyId();
-        String message = userService.importUser(userList, updateSupport, operName,companyId);
-        return AjaxResult.success(message);
-    }
-
-    @RequiresPermissions("system:user:view")
-    @GetMapping("/importTemplate")
-    @ResponseBody
-    public AjaxResult importTemplate()
-    {
-        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
-        return util.importTemplateExcel("用户数据");
-    }
-
-    /**
-     * 新增用户
-     */
-    @GetMapping("/add")
-    public String add(ModelMap mmap)
-    {
-        mmap.put("roles", roleService.selectRoleAll());
-        mmap.put("posts", postService.selectPostAll());
-        return prefix + "/add";
-    }
-
-    /**
-     * 新增保存用户
-     */
-    @RequiresPermissions("system:user:add")
-    @Log(title = "用户管理", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    @ResponseBody
-    @Transactional
-    public AjaxResult addSave(@Validated SysUser user)
-    {
-        SysUser localUser = ShiroUtils.getSysUser();
-        user.setCompanyId(localUser.getCompanyId());
-        if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
-        {
-            return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
-        }
-        else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
-        {
-            return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在");
-        }
-        else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
-        {
-            return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
-        }
-        else if (user.getPassword().length() < UserConstants.PASSWORD_MIN_LENGTH
-                || user.getPassword().length() > UserConstants.PASSWORD_MAX_LENGTH)
-        {
-            return error("密码长度为6-19,请重新设置!!");
-        }
-        user.setSalt(ShiroSaltUtil.randomSalt());
-        user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
-        user.setCreateBy(ShiroUtils.getLoginName());
-        int userId = userService.insertUser(user);
-
-
-        return toAjax(userId);
-    }
-
-    /**
-     * 修改用户
-     */
-    @GetMapping("/edit/{userId}")
-    public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
-    {
-        mmap.put("user", userService.selectUserById(userId));
-        mmap.put("roles", roleService.selectRolesByUserId(userId));
-        mmap.put("posts", postService.selectPostsByUserId(userId));
-        return prefix + "/edit";
-    }
-
-    /**
-     * 修改保存用户
-     */
-    @RequiresPermissions("system:user:edit")
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    @ResponseBody
-    @Transactional
-    public AjaxResult editSave(@Validated SysUser user)
-    {
-        SysUser localUser = ShiroUtils.getSysUser();
-        user.setCompanyId(localUser.getCompanyId());
-        userService.checkUserAllowed(user);
-        if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
-        {
-            return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
-        }
-        else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
-        {
-            return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
-        }
-        user.setUpdateBy(ShiroUtils.getLoginName());
-        int rows = userService.updateUser(user);
-
-        return toAjax(rows);
-    }
-
-    @RequiresPermissions("system:user:resetPwd")
-    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
-    @GetMapping("/resetPwd/{userId}")
-    public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
-    {
-        mmap.put("user", userService.selectUserById(userId));
-        return prefix + "/resetPwd";
-    }
-
-    @RequiresPermissions("system:user:resetPwd")
-    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
-    @PostMapping("/resetPwd")
-    @ResponseBody
-    public AjaxResult resetPwdSave(SysUser user)
-    {
-        userService.checkUserAllowed(user);
-        user.setSalt(ShiroSaltUtil.randomSalt());
-        user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
-        if (userService.resetUserPwd(user) > 0)
-        {
-            if (ShiroUtils.getUserId() == user.getUserId())
-            {
-                ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
-            }
-            return success();
-        }
-        return error();
-    }
-
-    @RequiresPermissions("system:user:remove")
-    @Log(title = "用户管理", businessType = BusinessType.DELETE)
-    @PostMapping("/remove")
-    @ResponseBody
-    @Transactional
-    public AjaxResult remove(String ids)
-    {
-        try
-        {
-            int rows = userService.deleteUserByIds(ids);
-            return toAjax(rows);
-        }
-        catch (BusinessException e)
-        {
-            return error(e.getMessage());
-        }
-    }
-
-    /**
-     * 校验用户名
-     */
-    @PostMapping("/checkLoginNameUnique")
-    @ResponseBody
-    public String checkLoginNameUnique(SysUser user)
-    {
-
-        return userService.checkLoginNameUnique(user.getLoginName());
-    }
-
-    /**
-     * 校验手机号码
-     */
-    @PostMapping("/checkPhoneUnique")
-    @ResponseBody
-    public String checkPhoneUnique(SysUser user)
-    {
-        SysUser localUser = ShiroUtils.getSysUser();
-        user.setCompanyId(localUser.getCompanyId());
-        return userService.checkPhoneUnique(user);
-    }
-
-    /**
-     * 校验email邮箱
-     */
-    @PostMapping("/checkEmailUnique")
-    @ResponseBody
-    public String checkEmailUnique(SysUser user)
-    {
-        SysUser localUser = ShiroUtils.getSysUser();
-        user.setCompanyId(localUser.getCompanyId());
-        return userService.checkEmailUnique(user);
-    }
-
-    /**
-     * 用户状态修改
-     */
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @RequiresPermissions("system:user:edit")
-    @PostMapping("/changeStatus")
-    @ResponseBody
-    @Transactional
-    public AjaxResult changeStatus(SysUser user)
-    {
-        userService.checkUserAllowed(user);
-
-
-        return toAjax(userService.changeStatus(user));
-    }
-}

+ 0 - 26
dgtly-admin/src/main/java/com/dgtly/web/controller/tool/BuildController.java

@@ -1,26 +0,0 @@
-package com.dgtly.web.controller.tool;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import com.dgtly.common.core.controller.BaseController;
-
-/**
- * build 表单构建
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/tool/build")
-public class BuildController extends BaseController
-{
-    private String prefix = "tool/build";
-
-    @RequiresPermissions("tool:build:view")
-    @GetMapping()
-    public String build()
-    {
-        return prefix + "/build";
-    }
-}

+ 0 - 24
dgtly-admin/src/main/java/com/dgtly/web/controller/tool/SwaggerController.java

@@ -1,24 +0,0 @@
-package com.dgtly.web.controller.tool;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import com.dgtly.common.core.controller.BaseController;
-
-/**
- * swagger 接口
- * 
- * @author ruoyi
- */
-@Controller
-@RequestMapping("/tool/swagger")
-public class SwaggerController extends BaseController
-{
-    @RequiresPermissions("tool:swagger:view")
-    @GetMapping()
-    public String index()
-    {
-        return redirect("/swagger-ui.html");
-    }
-}

+ 0 - 175
dgtly-admin/src/main/java/com/dgtly/web/controller/tool/TestController.java

@@ -1,175 +0,0 @@
-package com.dgtly.web.controller.tool;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.utils.StringUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * swagger 用户测试方法
- * 
- * @author ruoyi
- */
-@Api("用户信息管理")
-@RestController
-@RequestMapping("/test/user")
-public class TestController extends BaseController
-{
-    private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
-    {
-        users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
-        users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
-    }
-
-    @ApiOperation("获取用户列表")
-    @GetMapping("/list")
-    public AjaxResult userList()
-    {
-        List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
-        return AjaxResult.success(userList);
-    }
-
-    @ApiOperation("获取用户详细")
-    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
-    @GetMapping("/{userId}")
-    public AjaxResult getUser(@PathVariable Integer userId)
-    {
-        if (!users.isEmpty() && users.containsKey(userId))
-        {
-            return AjaxResult.success(users.get(userId));
-        }
-        else
-        {
-            return error("用户不存在");
-        }
-    }
-
-    @ApiOperation("新增用户")
-    @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
-    @PostMapping("/save")
-    public AjaxResult save(UserEntity user)
-    {
-        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
-        {
-            return error("用户ID不能为空");
-        }
-        return AjaxResult.success(users.put(user.getUserId(), user));
-    }
-
-    @ApiOperation("更新用户")
-    @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
-    @PutMapping("/update")
-    public AjaxResult update(UserEntity user)
-    {
-        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
-        {
-            return error("用户ID不能为空");
-        }
-        if (users.isEmpty() || !users.containsKey(user.getUserId()))
-        {
-            return error("用户不存在");
-        }
-        users.remove(user.getUserId());
-        return AjaxResult.success(users.put(user.getUserId(), user));
-    }
-
-    @ApiOperation("删除用户信息")
-    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
-    @DeleteMapping("/{userId}")
-    public AjaxResult delete(@PathVariable Integer userId)
-    {
-        if (!users.isEmpty() && users.containsKey(userId))
-        {
-            users.remove(userId);
-            return success();
-        }
-        else
-        {
-            return error("用户不存在");
-        }
-    }
-}
-
-@ApiModel("用户实体")
-class UserEntity
-{
-    @ApiModelProperty("用户ID")
-    private Integer userId;
-
-    @ApiModelProperty("用户名称")
-    private String username;
-
-    @ApiModelProperty("用户密码")
-    private String password;
-
-    @ApiModelProperty("用户手机")
-    private String mobile;
-
-    public UserEntity()
-    {
-
-    }
-
-    public UserEntity(Integer userId, String username, String password, String mobile)
-    {
-        this.userId = userId;
-        this.username = username;
-        this.password = password;
-        this.mobile = mobile;
-    }
-
-    public Integer getUserId()
-    {
-        return userId;
-    }
-
-    public void setUserId(Integer userId)
-    {
-        this.userId = userId;
-    }
-
-    public String getUsername()
-    {
-        return username;
-    }
-
-    public void setUsername(String username)
-    {
-        this.username = username;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-
-    public void setPassword(String password)
-    {
-        this.password = password;
-    }
-
-    public String getMobile()
-    {
-        return mobile;
-    }
-
-    public void setMobile(String mobile)
-    {
-        this.mobile = mobile;
-    }
-}

+ 0 - 62
dgtly-admin/src/main/java/com/dgtly/web/core/config/SwaggerConfig.java

@@ -1,62 +0,0 @@
-package com.dgtly.web.core.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import com.dgtly.common.config.Global;
-import io.swagger.annotations.ApiOperation;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.Contact;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-/**
- * Swagger2的接口配置
- * 
- * @author ruoyi
- */
-@Configuration
-@EnableSwagger2
-public class SwaggerConfig
-{
-    /**
-     * 创建API
-     */
-    @Bean
-    public Docket createRestApi()
-    {
-        return new Docket(DocumentationType.SWAGGER_2)
-                // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
-                .apiInfo(apiInfo())
-                // 设置哪些接口暴露给Swagger展示
-                .select()
-                // 扫描所有有注解的api,用这种方式更灵活
-                .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
-                // 扫描指定包中的swagger注解
-                //.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
-                // 扫描所有 .apis(RequestHandlerSelectors.any())
-                .paths(PathSelectors.any())
-                .build();
-    }
-
-    /**
-     * 添加摘要信息
-     */
-    private ApiInfo apiInfo()
-    {
-        // 用ApiInfoBuilder进行定制
-        return new ApiInfoBuilder()
-                // 设置标题
-                .title("标题:管理系统_接口文档")
-                // 描述
-                .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
-                // 作者信息
-                .contact(new Contact("dgtly", null, null))
-                // 版本
-                .version("版本号4.0.0")
-                .build();
-    }
-}

+ 0 - 130
dgtly-admin/src/main/resources/application-dev.yml

@@ -1,130 +0,0 @@
-# 项目相关配置
-ruoyi:
-  # 名称
-  name: SteelfurnitureManager
-  # 版本
-  version: 4.0.0
-  # 版权年份
-  copyrightYear: 2019
-  # 实例演示开关
-  demoEnabled: true
-  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-  profile: F:/testfile/dgtly/uploadPath
-  # 获取ip地址开关
-  addressEnabled: true
-
-# 开发环境配置
-server:
-  # 服务器的HTTP端口,默认为80
-  port: 80
-  servlet:
-    # 应用的访问路径
-    context-path: /
-  tomcat:
-    # tomcat的URI编码
-    uri-encoding: UTF-8
-    # tomcat最大线程数,默认为200
-    max-threads: 800
-    # Tomcat启动初始化的线程数,默认值25
-    min-spare-threads: 30
- 
-# 日志配置
-logging:
-  level:
-    com.dgtly: debug
-    org.springframework: warn
-
-# 用户配置
-user:
-  password:
-    # 密码错误{maxRetryCount}次锁定10分钟
-    maxRetryCount: 5
-
-# Spring配置
-spring:
-  # 模板引擎
-  thymeleaf:
-    mode: HTML
-    encoding: utf-8
-    # 禁用缓存
-    cache: false
-  # 资源信息
-  messages:
-    # 国际化资源文件路径
-    basename: static/i18n/messages
-  jackson:
-    time-zone: GMT+8
-    date-format: yyyy-MM-dd HH:mm:ss
-  profiles:
-    include: dev-druid
-  # 文件上传
-  servlet:
-     multipart:
-       # 单个文件大小
-       max-file-size:  10MB
-       # 设置总上传的文件大小
-       max-request-size:  20MB
-  # 服务模块
-  devtools:
-    restart:
-      # 热部署开关
-      enabled: true
-
-# MyBatis
-mybatis:
-    # 搜索指定包别名
-    typeAliasesPackage: com.dgtly.**.domain
-    # 配置mapper的扫描,找到所有的mapper.xml映射文件
-    mapperLocations: classpath*:mapper/**/*Mapper.xml
-    # 加载全局的配置文件
-    configLocation: classpath:mybatis/mybatis-config.xml
-
-# PageHelper分页插件
-pagehelper: 
-  helperDialect: mysql
-  reasonable: true
-  supportMethodsArguments: true
-  params: count=countSql 
-
-# Shiro
-shiro:
-  user:
-    # 登录地址
-    loginUrl: /login
-    # 权限认证失败地址
-    unauthorizedUrl: /unauth
-    # 首页地址
-    indexUrl: /index
-    # 验证码开关
-    captchaEnabled: true
-    # 验证码类型 math 数组计算 char 字符
-    captchaType: math
-  cookie:
-    # 设置Cookie的域名 默认空,即当前访问的域名
-    domain: 
-    # 设置cookie的有效访问路径
-    path: /
-    # 设置HttpOnly属性
-    httpOnly: true
-    # 设置Cookie的过期时间,天为单位
-    maxAge: 30
-  session:
-    # Session超时时间,-1代表永不过期(默认30分钟)
-    expireTime: 30
-    # 同步session到数据库的周期(默认1分钟)
-    dbSyncPeriod: 1
-    # 相隔多久检查一次session的有效性,默认就是10分钟
-    validationInterval: 10
-    # 同一个用户最大会话数,比如2的意思是同一个账号允许最多同时两个人登录(默认-1不限制)
-    maxSession: -1
-    # 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
-    kickoutAfter: false
-
-# 防止XSS攻击
-xss: 
-  # 过滤开关
-  enabled: true
-  # 排除链接(多个用逗号分隔)
-  excludes: /system/notice/*
-  # 匹配链接
-  urlPatterns: /system/*,/monitor/*,/tool/*

+ 0 - 52
dgtly-api/pom.xml

@@ -1,52 +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>dgtly</artifactId>
-        <groupId>com.dgtly</groupId>
-        <version>4.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>jar</packaging>
-    <artifactId>dgtly-api</artifactId>
-
-    <description>
-        前端页面API接口
-    </description>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-apiframework</artifactId>
-            <version>4.0.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-system</artifactId>
-            <version>4.0.0</version>
-        </dependency>
-
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <configuration>
-                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-        <finalName>${artifactId}</finalName>
-    </build>
-</project>

+ 0 - 81
dgtly-api/src/main/java/com/dgtly/api/controller/CommonController.java

@@ -1,81 +0,0 @@
-package com.dgtly.api.controller;
-
-import com.dgtly.common.annotation.ApiNoCheckSign;
-import com.dgtly.common.annotation.ApiPassToken;
-import com.dgtly.common.config.Global;
-import com.dgtly.common.config.ServerConfig;
-import com.dgtly.common.core.controller.ApiBaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.domain.ParameterObject;
-import com.dgtly.common.utils.file.FileUploadUtils;
-import com.dgtly.system.service.ISysDictDataService;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-
-/**
- * 通用请求处理
- * 
- * @author ruoyi
- */
-@ApiNoCheckSign
-@ApiPassToken
-@RestController()
-@RequestMapping("/common")
-public class CommonController extends ApiBaseController
-{
-    private static final Logger log = LoggerFactory.getLogger(CommonController.class);
-
-    @Autowired
-    private ServerConfig serverConfig;
-
-    @Autowired
-    private ISysDictDataService dictDataService;
-
-
-    @ApiOperation(value = "获取字典")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "params" , paramType = "body"),
-            @ApiImplicitParam(name = "language" , paramType = "header")
-    })
-    @PostMapping("/dict")
-    public Object getDict(){
-        ParameterObject obj = getParameterObject();
-        obj.checkParameterNotNull("dictType");
-        String dictType = obj.getString("dictType");
-        return AjaxResult.success().putKV("list", dictDataService.selectSimpleDictDataByType(dictType));
-    }
-
-
-    /**
-     * 通用上传请求
-     */
-    @PostMapping("/upload")
-    public AjaxResult uploadFile(MultipartFile file) throws Exception{
-        try
-        {
-            // 上传文件路径
-            String filePath = Global.getUploadPath();
-            // 上传并返回新文件名称
-            String fileName = FileUploadUtils.upload(filePath, file);
-            String url = serverConfig.getUrl() + fileName;
-            AjaxResult ajax = AjaxResult.success();
-            ajax.putKV("fileName", fileName);
-            ajax.putKV("url", url);
-            return ajax;
-        }
-        catch (Exception e)
-        {
-            return AjaxResult.error(e.getMessage());
-        }
-    }
-
-
-
-}

+ 0 - 113
dgtly-apiframework/pom.xml

@@ -1,113 +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>dgtly</artifactId>
-        <groupId>com.dgtly</groupId>
-        <version>4.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>dgtly-apiframework</artifactId>
-
-    <dependencies>
-        <!-- SpringBoot Web容器 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <!-- SpringBoot 拦截器 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
-        </dependency>
-
-        <!--阿里数据库连接池 -->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-        </dependency>
-        <!-- 解析客户端操作系统、浏览器等 -->
-        <dependency>
-            <groupId>eu.bitwalker</groupId>
-            <artifactId>UserAgentUtils</artifactId>
-        </dependency>
-        <!-- 获取系统信息 -->
-        <dependency>
-            <groupId>com.github.oshi</groupId>
-            <artifactId>oshi-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>net.java.dev.jna</groupId>
-            <artifactId>jna</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>net.java.dev.jna</groupId>
-            <artifactId>jna-platform</artifactId>
-        </dependency>
-
-        <!-- spring-boot-devtools -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-            <optional>true</optional> <!-- 表示依赖不会传递 -->
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <!--Swagger2引用-->
-
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger2</artifactId>
-        </dependency>
-
-        <!-- swagger2-UI-->
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger-ui</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.swagger</groupId>
-            <artifactId>swagger-models</artifactId>
-            <version>1.5.21</version>
-        </dependency>
-        <!--验证码 -->
-        <dependency>
-            <groupId>com.github.penggle</groupId>
-            <artifactId>kaptcha</artifactId>
-            <exclusions>
-                <exclusion>
-                    <artifactId>javax.servlet-api</artifactId>
-                    <groupId>javax.servlet</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <!--jwt-->
-        <dependency>
-            <groupId>com.auth0</groupId>
-            <artifactId>java-jwt</artifactId>
-            <version>3.4.0</version>
-        </dependency>
-        <!-- 系统模块-->
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-common</artifactId>
-        </dependency>
-        <!-- 系统模块-->
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-system</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.dgtly</groupId>
-            <artifactId>dgtly-member-common</artifactId>
-            <version>4.0.0</version>
-        </dependency>
-    </dependencies>
-
-</project>

+ 0 - 81
dgtly-apiframework/src/main/java/com/dgtly/apiframework/exception/ApiGlobalExceptionHandler.java

@@ -1,81 +0,0 @@
-package com.dgtly.apiframework.exception;
-
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.domain.ResultType;
-import com.dgtly.common.exception.api.ApiTokenTimeoutException;
-import com.dgtly.common.exception.api.LessParamException;
-import com.dgtly.common.exception.api.NoLoginException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.HttpRequestMethodNotSupportedException;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RestControllerAdvice;
-
-/**
- * 全局异常处理器
- * 
- * @author ruoyi
- */
-@RestControllerAdvice
-public class ApiGlobalExceptionHandler
-{
-    private static final Logger log = LoggerFactory.getLogger(ApiGlobalExceptionHandler.class);
-
-
-    /**
-     * 请求方式不支持
-     */
-    @ExceptionHandler({ HttpRequestMethodNotSupportedException.class })
-    public AjaxResult handleException(HttpRequestMethodNotSupportedException e)
-    {
-        log.error(e.getMessage(), e);
-        return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
-    }
-    /**
-     * 缺少参数
-     */
-    @ExceptionHandler(LessParamException.class)
-    public AjaxResult handleException(LessParamException e)
-    {
-        log.error(e.getMessage(), e);
-        return AjaxResult.error(ResultType.LESSPARAM,e.getMessage());
-    }
-    /**
-     * 未登录
-     */
-    @ExceptionHandler(NoLoginException.class)
-    public AjaxResult handleException(NoLoginException e)
-    {
-        return AjaxResult.error(ResultType.NOLOGIN);
-    }
-    /**
-     * token超时
-     */
-    @ExceptionHandler(ApiTokenTimeoutException.class)
-    public AjaxResult handleException(ApiTokenTimeoutException e)
-    {
-        return AjaxResult.error(ResultType.TOKENTIMEOUT);
-    }
-
-
-    /**
-     * 拦截未知的运行时异常
-     */
-    @ExceptionHandler(RuntimeException.class)
-    public AjaxResult notFount(RuntimeException e)
-    {
-        log.error("运行时异常:", e);
-        return AjaxResult.error("运行时异常:" + e.getMessage());
-    }
-
-    /**
-     * 系统异常
-     */
-    @ExceptionHandler(Exception.class)
-    public AjaxResult handleException(Exception e)
-    {
-        log.error(e.getMessage(), e);
-        return AjaxResult.error("服务器错误,请联系管理员");
-    }
-
-}

+ 0 - 56
dgtly-apiframework/src/main/java/com/dgtly/apiframework/interceptor/ApiRepeatSubmitInterceptor.java

@@ -1,56 +0,0 @@
-package com.dgtly.apiframework.interceptor;
-
-import com.dgtly.common.annotation.RepeatSubmit;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.json.JSON;
-import com.dgtly.common.utils.ServletUtils;
-import org.springframework.stereotype.Component;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.Method;
-
-/**
- * 防止重复提交拦截器
- * 
- * @author ruoyi
- */
-@Component
-public abstract class ApiRepeatSubmitInterceptor extends HandlerInterceptorAdapter
-{
-    @Override
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
-    {
-        if (handler instanceof HandlerMethod)
-        {
-            HandlerMethod handlerMethod = (HandlerMethod) handler;
-            Method method = handlerMethod.getMethod();
-            RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
-            if (annotation != null)
-            {
-                if (this.isRepeatSubmit(request))
-                {
-                    AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试");
-                    ServletUtils.renderString(response, JSON.marshal(ajaxResult));
-                    return false;
-                }
-            }
-            return true;
-        }
-        else
-        {
-            return super.preHandle(request, response, handler);
-        }
-    }
-
-    /**
-     * 验证是否重复提交由子类实现具体的防重复提交的规则
-     * 
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    public abstract boolean isRepeatSubmit(HttpServletRequest request) throws Exception;
-}

+ 0 - 85
dgtly-apiframework/src/main/java/com/dgtly/apiframework/interceptor/AuthenticationInterceptor.java

@@ -1,85 +0,0 @@
-package com.dgtly.apiframework.interceptor;
-
-import com.auth0.jwt.JWT;
-import com.auth0.jwt.JWTVerifier;
-import com.auth0.jwt.algorithms.Algorithm;
-import com.auth0.jwt.exceptions.JWTDecodeException;
-import com.auth0.jwt.exceptions.JWTVerificationException;
-import com.dgtly.common.exception.api.ApiTokenTimeoutException;
-import com.dgtly.common.exception.api.NoLoginException;
-import com.dgtly.common.annotation.ApiPassToken;
-import com.dgtly.member.domain.MemberInfo;
-import com.dgtly.member.service.IMemberInfoService;
-import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.service.ISysUserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.HandlerInterceptor;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-@Component
-public class AuthenticationInterceptor implements HandlerInterceptor {
-    @Autowired
-    private IMemberInfoService memberInfoService;
-    @Override
-    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception {
-        String token = httpServletRequest.getHeader("token");// 从 http 请求头中取出 token
-        // 如果不是映射到方法直接通过
-        if(!(object instanceof HandlerMethod)){
-            return true;
-        }
-        HandlerMethod handlerMethod=(HandlerMethod)object;
-        String handlerPackage = handlerMethod.getBeanType().getPackage().getName();
-        String thisPackage = this.getClass().getPackage().getName();
-        String verifPackage =thisPackage.substring(0,thisPackage.indexOf(".",thisPackage.indexOf(".")+1));
-        /*只对代码中的请求进行验证*/
-        if(handlerPackage.indexOf(verifPackage)==-1){
-            return true;
-        }
-
-        ApiPassToken a1=handlerMethod.getBeanType().getAnnotation(ApiPassToken.class);
-        ApiPassToken a2 = handlerMethod.getMethodAnnotation(ApiPassToken.class);
-        //检查是否有passtoken注释,有则跳过认证
-        if (a1!=null||a2!=null) {
-             return true;
-        }
-        //检查有没有需要用户权限的注解
-
-        if (token == null) {
-            throw new NoLoginException();
-        }
-        // 获取 token 中的 user id
-        Long userId;
-        try {
-            userId = Long.parseLong(JWT.decode(token).getAudience().get(0));
-        } catch (JWTDecodeException j) {
-            /*密码错误*/
-            throw new NoLoginException();
-        }
-        MemberInfo user = memberInfoService.selectMemberInfoById(userId);
-        if (user == null) {
-            throw new NoLoginException();
-        }
-        // 验证 token
-        JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(user.getLoginPassword())).build();
-        try {
-            jwtVerifier.verify(token);
-        } catch (JWTVerificationException e) {
-            throw new ApiTokenTimeoutException();
-        }
-        return true;
-    }
-
-    @Override
-    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
-
-    }
-    @Override
-    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
-
-    }
-}

+ 0 - 95
dgtly-apiframework/src/main/java/com/dgtly/apiframework/interceptor/impl/ApiSameUrlDataInterceptor.java

@@ -1,95 +0,0 @@
-package com.dgtly.apiframework.interceptor.impl;
-
-import com.dgtly.common.json.JSON;
-import com.dgtly.apiframework.interceptor.ApiRepeatSubmitInterceptor;
-import org.springframework.stereotype.Component;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 判断请求url和数据是否和上一次相同, 
- * 如果和上次相同,则是重复提交表单。 有效时间为10秒内。
- * 
- * @author ruoyi
- */
-@Component
-public class ApiSameUrlDataInterceptor extends ApiRepeatSubmitInterceptor
-{
-    public final String REPEAT_PARAMS = "repeatParams";
-
-    public final String REPEAT_TIME = "repeatTime";
-
-    public final String SESSION_REPEAT_KEY = "repeatData";
-
-    /**
-     * 间隔时间,单位:秒 默认10秒
-     * 
-     * 两次相同参数的请求,如果间隔时间大于该参数,系统不会认定为重复提交的数据
-     */
-    private int intervalTime = 10;
-
-    public void setIntervalTime(int intervalTime)
-    {
-        this.intervalTime = intervalTime;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public boolean isRepeatSubmit(HttpServletRequest request) throws Exception
-    {
-        // 本次参数及系统时间
-        String nowParams = JSON.marshal(request.getParameterMap());
-        Map<String, Object> nowDataMap = new HashMap<String, Object>();
-        nowDataMap.put(REPEAT_PARAMS, nowParams);
-        nowDataMap.put(REPEAT_TIME, System.currentTimeMillis());
-
-        // 请求地址(作为存放session的key值)
-        String url = request.getRequestURI();
-
-        HttpSession session = request.getSession();
-        Object sessionObj = session.getAttribute(SESSION_REPEAT_KEY);
-        if (sessionObj != null)
-        {
-            Map<String, Object> sessionMap = (Map<String, Object>) sessionObj;
-            if (sessionMap.containsKey(url))
-            {
-                Map<String, Object> preDataMap = (Map<String, Object>) sessionMap.get(url);
-                if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap))
-                {
-                    return true;
-                }
-            }
-        }
-        Map<String, Object> sessionMap = new HashMap<String, Object>();
-        sessionMap.put(url, nowDataMap);
-        session.setAttribute(SESSION_REPEAT_KEY, sessionMap);
-        return false;
-    }
-
-    /**
-     * 判断参数是否相同
-     */
-    private boolean compareParams(Map<String, Object> nowMap, Map<String, Object> preMap)
-    {
-        String nowParams = (String) nowMap.get(REPEAT_PARAMS);
-        String preParams = (String) preMap.get(REPEAT_PARAMS);
-        return nowParams.equals(preParams);
-    }
-
-    /**
-     * 判断两次间隔时间
-     */
-    private boolean compareTime(Map<String, Object> nowMap, Map<String, Object> preMap)
-    {
-        long time1 = (Long) nowMap.get(REPEAT_TIME);
-        long time2 = (Long) preMap.get(REPEAT_TIME);
-        if ((time1 - time2) < (this.intervalTime * 1000))
-        {
-            return true;
-        }
-        return false;
-    }
-}

+ 0 - 111
dgtly-common/pom.xml

@@ -1,111 +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>dgtly</artifactId>
-        <groupId>com.dgtly</groupId>
-        <version>4.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-	
-    <artifactId>dgtly-common</artifactId>
-	
-	<description>
-	    common通用工具
-	</description>
-
-    <dependencies>
-		
-		<!-- Spring框架基本的核心工具 -->
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-context-support</artifactId>
-		</dependency>
-		
-		<!-- SpringWeb模块 -->
-		<dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-web</artifactId>
-        </dependency>
-        
-        <!--Shiro核心框架 -->
-		<dependency>
-			<groupId>org.apache.shiro</groupId>
-			<artifactId>shiro-core</artifactId>
-		</dependency>
-        
-		<!-- pagehelper 分页插件 -->
-		<dependency>
-			<groupId>com.github.pagehelper</groupId>
-			<artifactId>pagehelper-spring-boot-starter</artifactId>
-		</dependency>
-		
-		<!-- 自定义验证注解 -->
-        <dependency>
-			<groupId>javax.validation</groupId>
-			<artifactId>validation-api</artifactId>
-        </dependency>
-    
-        <!--常用工具类 -->
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-lang3</artifactId>
-		</dependency>
-		
-		<!-- JSON工具类 -->
-		<dependency>
-		    <groupId>com.fasterxml.jackson.core</groupId>
-		    <artifactId>jackson-databind</artifactId>
-		</dependency>
-
-		<!-- 阿里JSON解析器 -->
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>fastjson</artifactId>
-		</dependency>
-
-		<!-- io常用工具类 -->
-		<dependency>
-			<groupId>commons-io</groupId>
-			<artifactId>commons-io</artifactId>
-		</dependency>
-
-		<!-- 文件上传工具类 -->
-		<dependency>
-			<groupId>commons-fileupload</groupId>
-			<artifactId>commons-fileupload</artifactId>
-		</dependency>
-		
-		<!-- excel工具 -->
-		<dependency>
-			<groupId>org.apache.poi</groupId>
-			<artifactId>poi-ooxml</artifactId>
-		</dependency>
-		
-		<!-- yml解析器 -->
-		<dependency>
-		    <groupId>org.yaml</groupId>
-		    <artifactId>snakeyaml</artifactId>
-		</dependency>
-		
-		<!-- servlet包 -->
-        <dependency>
-		    <groupId>javax.servlet</groupId>
-		    <artifactId>javax.servlet-api</artifactId>
-		</dependency>
-		<!--引入JSONObject-->
-		<dependency>
-			<groupId>net.sf.json-lib</groupId>
-			<artifactId>json-lib</artifactId>
-			<version>2.3</version>
-			<classifier>jdk15</classifier>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-lang3</artifactId>
-			<version>3.4</version>
-		</dependency>
-    </dependencies>
-  
-</project>

+ 0 - 28
dgtly-common/src/main/java/com/dgtly/common/annotation/DataScope.java

@@ -1,28 +0,0 @@
-package com.dgtly.common.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * 数据权限过滤注解
- * 
- * @author ruoyi
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface DataScope
-{
-    /**
-     * 部门表的别名
-     */
-    public String deptAlias() default "";
-
-    /**
-     * 用户表的别名
-     */
-    public String userAlias() default "";
-}

+ 0 - 26
dgtly-common/src/main/java/com/dgtly/common/annotation/DataSource.java

@@ -1,26 +0,0 @@
-package com.dgtly.common.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import com.dgtly.common.enums.DataSourceType;
-
-/**
- * 自定义多数据源切换注解
- * 
- * @author ruoyi
- */
-@Target({ ElementType.METHOD, ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Inherited
-public @interface DataSource
-{
-    /**
-     * 切换数据源名称
-     */
-    public DataSourceType value() default DataSourceType.MASTER;
-}

+ 0 - 113
dgtly-common/src/main/java/com/dgtly/common/annotation/Excel.java

@@ -1,113 +0,0 @@
-package com.dgtly.common.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * 自定义导出Excel数据注解
- * 
- * @author ruoyi
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface Excel
-{
-    /**
-     * 导出到Excel中的名字.
-     */
-    public String name() default "";
-
-    /**
-     * 日期格式, 如: yyyy-MM-dd
-     */
-    public String dateFormat() default "";
-
-    /**
-     * 读取内容转表达式 (如: 0=男,1=女,2=未知)
-     */
-    public String readConverterExp() default "";
-
-    /**
-     * 导出类型(0数字 1字符串)
-     */
-    public ColumnType cellType() default ColumnType.STRING;
-
-    /**
-     * 导出时在excel中每个列的高度 单位为字符
-     */
-    public double height() default 14;
-
-    /**
-     * 导出时在excel中每个列的宽 单位为字符
-     */
-    public double width() default 16;
-
-    /**
-     * 文字后缀,如% 90 变成90%
-     */
-    public String suffix() default "";
-
-    /**
-     * 当值为空时,字段的默认值
-     */
-    public String defaultValue() default "";
-
-    /**
-     * 提示信息
-     */
-    public String prompt() default "";
-
-    /**
-     * 设置只能选择不能输入的列内容.
-     */
-    public String[] combo() default {};
-
-    /**
-     * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
-     */
-    public boolean isExport() default true;
-
-    /**
-     * 另一个类中的属性名称,支持多级获取,以小数点隔开
-     */
-    public String targetAttr() default "";
-
-    /**
-     * 字段类型(0:导出导入;1:仅导出;2:仅导入)
-     */
-    Type type() default Type.ALL;
-
-    public enum Type
-    {
-        ALL(0), EXPORT(1), IMPORT(2);
-        private final int value;
-
-        Type(int value)
-        {
-            this.value = value;
-        }
-
-        public int value()
-        {
-            return this.value;
-        }
-    }
-
-    public enum ColumnType
-    {
-        NUMERIC(0), STRING(1);
-        private final int value;
-
-        ColumnType(int value)
-        {
-            this.value = value;
-        }
-
-        public int value()
-        {
-            return this.value;
-        }
-    }
-}

+ 0 - 18
dgtly-common/src/main/java/com/dgtly/common/annotation/Excels.java

@@ -1,18 +0,0 @@
-package com.dgtly.common.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Excel注解集
- * 
- * @author ruoyi
- */
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Excels
-{
-    Excel[] value();
-}

+ 0 - 40
dgtly-common/src/main/java/com/dgtly/common/annotation/Log.java

@@ -1,40 +0,0 @@
-package com.dgtly.common.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import com.dgtly.common.enums.BusinessType;
-import com.dgtly.common.enums.OperatorType;
-
-/**
- * 自定义操作日志记录注解
- * 
- * @author ruoyi
- */
-@Target({ ElementType.PARAMETER, ElementType.METHOD })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log
-{
-    /**
-     * 模块 
-     */
-    public String title() default "";
-
-    /**
-     * 功能
-     */
-    public BusinessType businessType() default BusinessType.OTHER;
-
-    /**
-     * 操作人类别
-     */
-    public OperatorType operatorType() default OperatorType.MANAGE;
-
-    /**
-     * 是否保存请求的参数
-     */
-    public boolean isSaveRequestData() default true;
-}

+ 0 - 23
dgtly-common/src/main/java/com/dgtly/common/annotation/RepeatSubmit.java

@@ -1,23 +0,0 @@
-package com.dgtly.common.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * 自定义注解防止表单重复提交
- * 
- * @author ruoyi
- *
- */
-@Inherited
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface RepeatSubmit
-{
-
-}

+ 0 - 152
dgtly-common/src/main/java/com/dgtly/common/config/Global.java

@@ -1,152 +0,0 @@
-package com.dgtly.common.config;
-
-import java.io.FileNotFoundException;
-import java.util.HashMap;
-import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.YamlUtil;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-/**
- * 全局配置类
- * 
- * @author ruoyi
- */
-@Component
-public class Global
-{
-
-    private static final Logger log = LoggerFactory.getLogger(Global.class);
-
-
-    private static String active ;
-
-
-    @Value("${spring.profiles.active}")
-    public void setActive(String active) {
-        Global.active = active;
-    }
-    /**
-     * 当前对象实例
-     */
-    private static Global global;
-
-    /**
-     * 保存全局属性值
-     */
-    private static Map<String, String> map = new HashMap<String, String>();
-
-    private Global()
-    {
-    }
-
-    /**
-     * 静态工厂方法
-     */
-    public static synchronized Global getInstance()
-    {
-        if (global == null)
-        {
-            global = new Global();
-        }
-        return global;
-    }
-
-    /**
-     * 获取配置
-     */
-    public static String getConfig(String key)
-    {
-        String value = map.get(key);
-        if (value == null)
-        {
-            Map<?, ?> yamlMap = null;
-            try
-            {
-                yamlMap = YamlUtil.loadYaml("application-"+active+".yml");
-                value = String.valueOf(YamlUtil.getProperty(yamlMap, key));
-                map.put(key, value != null ? value : StringUtils.EMPTY);
-            }
-            catch (FileNotFoundException e)
-            {
-                log.error("获取全局配置异常 {}", key);
-            }
-        }
-        return value;
-    }
-
-    /**
-     * 获取项目名称
-     */
-    public static String getName()
-    {
-        return StringUtils.nvl(getConfig("ruoyi.name"), "RuoYi");
-    }
-
-    /**
-     * 获取项目版本
-     */
-    public static String getVersion()
-    {
-        return StringUtils.nvl(getConfig("ruoyi.version"), "4.0.0");
-    }
-
-    /**
-     * 获取版权年份
-     */
-    public static String getCopyrightYear()
-    {
-        return StringUtils.nvl(getConfig("ruoyi.copyrightYear"), "2019");
-    }
-
-    /**
-     * 实例演示开关
-     */
-    public static String isDemoEnabled()
-    {
-        return StringUtils.nvl(getConfig("ruoyi.demoEnabled"), "true");
-    }
-
-    /**
-     * 获取ip地址开关
-     */
-    public static Boolean isAddressEnabled()
-    {
-        return Boolean.valueOf(getConfig("ruoyi.addressEnabled"));
-    }
-
-    /**
-     * 获取文件上传路径
-     */
-    public static String getProfile()
-    {
-        return getConfig("ruoyi.profile");
-    }
-
-    /**
-     * 获取头像上传路径
-     */
-    public static String getAvatarPath()
-    {
-        return getProfile() + "/avatar";
-    }
-
-    /**
-     * 获取下载路径
-     */
-    public static String getDownloadPath()
-    {
-        return getProfile() + "/download/";
-    }
-
-    /**
-     * 获取上传路径
-     */
-    public static String getUploadPath()
-    {
-        return getProfile() + "/upload";
-    }
-}

+ 0 - 33
dgtly-common/src/main/java/com/dgtly/common/config/ServerConfig.java

@@ -1,33 +0,0 @@
-package com.dgtly.common.config;
-
-import javax.servlet.http.HttpServletRequest;
-import org.springframework.stereotype.Component;
-import com.dgtly.common.utils.ServletUtils;
-
-/**
- * 服务相关配置
- * 
- * @author ruoyi
- *
- */
-@Component
-public class ServerConfig
-{
-    /**
-     * 获取完整的请求路径,包括:域名,端口,上下文访问路径
-     * 
-     * @return 服务地址
-     */
-    public String getUrl()
-    {
-        HttpServletRequest request = ServletUtils.getRequest();
-        return getDomain(request);
-    }
-
-    public static String getDomain(HttpServletRequest request)
-    {
-        StringBuffer url = request.getRequestURL();
-        String contextPath = request.getServletContext().getContextPath();
-        return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
-    }
-}

+ 0 - 45
dgtly-common/src/main/java/com/dgtly/common/config/datasource/DynamicDataSourceContextHolder.java

@@ -1,45 +0,0 @@
-package com.dgtly.common.config.datasource;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 数据源切换处理
- * 
- * @author ruoyi
- */
-public class DynamicDataSourceContextHolder
-{
-    public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class);
-
-    /**
-     * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本,
-     *  所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。
-     */
-    private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
-
-    /**
-     * 设置数据源的变量
-     */
-    public static void setDataSourceType(String dsType)
-    {
-        log.info("切换到{}数据源", dsType);
-        CONTEXT_HOLDER.set(dsType);
-    }
-
-    /**
-     * 获得数据源的变量
-     */
-    public static String getDataSourceType()
-    {
-        return CONTEXT_HOLDER.get();
-    }
-
-    /**
-     * 清空数据源变量
-     */
-    public static void clearDataSourceType()
-    {
-        CONTEXT_HOLDER.remove();
-    }
-}

+ 0 - 62
dgtly-common/src/main/java/com/dgtly/common/config/thread/ThreadPoolConfig.java

@@ -1,62 +0,0 @@
-package com.dgtly.common.config.thread;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
-import org.apache.commons.lang3.concurrent.BasicThreadFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import com.dgtly.common.utils.Threads;
-
-/**
- * 线程池配置
- *
- * @author ruoyi
- **/
-@Configuration
-public class ThreadPoolConfig
-{
-    // 核心线程池大小
-    private int corePoolSize = 50;
-
-    // 最大可创建的线程数
-    private int maxPoolSize = 200;
-
-    // 队列最大长度
-    private int queueCapacity = 1000;
-
-    // 线程池维护线程所允许的空闲时间
-    private int keepAliveSeconds = 300;
-
-    @Bean(name = "threadPoolTaskExecutor")
-    public ThreadPoolTaskExecutor threadPoolTaskExecutor()
-    {
-        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
-        executor.setMaxPoolSize(maxPoolSize);
-        executor.setCorePoolSize(corePoolSize);
-        executor.setQueueCapacity(queueCapacity);
-        executor.setKeepAliveSeconds(keepAliveSeconds);
-        // 线程池对拒绝任务(无线程可用)的处理策略
-        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
-        return executor;
-    }
-
-    /**
-     * 执行周期性或定时任务
-     */
-    @Bean(name = "scheduledExecutorService")
-    protected ScheduledExecutorService scheduledExecutorService()
-    {
-        return new ScheduledThreadPoolExecutor(corePoolSize,
-                new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
-        {
-            @Override
-            protected void afterExecute(Runnable r, Throwable t)
-            {
-                super.afterExecute(r, t);
-                Threads.printException(r, t);
-            }
-        };
-    }
-}

+ 0 - 69
dgtly-common/src/main/java/com/dgtly/common/constant/Constants.java

@@ -1,69 +0,0 @@
-package com.dgtly.common.constant;
-
-/**
- * 通用常量信息
- * 
- * @author ruoyi
- */
-public class Constants
-{
-    /**
-     * UTF-8 字符集
-     */
-    public static final String UTF8 = "UTF-8";
-
-    /**
-     * 通用成功标识
-     */
-    public static final String SUCCESS = "0";
-
-    /**
-     * 通用失败标识
-     */
-    public static final String FAIL = "1";
-
-    /**
-     * 登录成功
-     */
-    public static final String LOGIN_SUCCESS = "Success";
-
-    /**
-     * 注销
-     */
-    public static final String LOGOUT = "Logout";
-
-    /**
-     * 登录失败
-     */
-    public static final String LOGIN_FAIL = "Error";
-
-    /**
-     * 自动去除表前缀
-     */
-    public static final String AUTO_REOMVE_PRE = "true";
-
-    /**
-     * 当前记录起始索引
-     */
-    public static final String PAGE_NUM = "pageNum";
-
-    /**
-     * 每页显示记录数
-     */
-    public static final String PAGE_SIZE = "pageSize";
-
-    /**
-     * 排序列
-     */
-    public static final String ORDER_BY_COLUMN = "orderByColumn";
-
-    /**
-     * 排序的方向 "desc" 或者 "asc".
-     */
-    public static final String IS_ASC = "isAsc";
-
-    /**
-     * 资源映射路径 前缀
-     */
-    public static final String RESOURCE_PREFIX = "/profile";
-}

+ 0 - 94
dgtly-common/src/main/java/com/dgtly/common/constant/GenConstants.java

@@ -1,94 +0,0 @@
-package com.dgtly.common.constant;
-
-/**
- * 代码生成通用常量
- * 
- * @author ruoyi
- */
-public class GenConstants
-{
-    /** 单表(增删改查) */
-    public static final String TPL_CRUD = "crud";
-
-    /** 树表(增删改查) */
-    public static final String TPL_TREE = "tree";
-
-    /** 树编码字段 */
-    public static final String TREE_CODE = "treeCode";
-
-    /** 树父编码字段 */
-    public static final String TREE_PARENT_CODE = "treeParentCode";
-
-    /** 树名称字段 */
-    public static final String TREE_NAME = "treeName";
-
-    /** 数据库字符串类型 */
-    public static final String[] COLUMNTYPE_STR = { "char", "varchar", "narchar", "varchar2", "tinytext", "text",
-            "mediumtext", "longtext" };
-
-    /** 数据库时间类型 */
-    public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
-
-    /** 数据库数字类型 */
-    public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
-            "bigint", "float", "float", "double", "decimal" };
-
-    /** 页面不需要编辑字段 */
-    public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
-
-    /** 页面不需要显示的列表字段 */
-    public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
-            "update_time" };
-
-    /** 页面不需要查询字段 */
-    public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
-            "update_time", "remark" };
-
-    /** Entity基类字段 */
-    public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
-
-    /** Tree基类字段 */
-    public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors" };
-
-    /** 文本框 */
-    public static final String HTML_INPUT = "input";
-
-    /** 文本域 */
-    public static final String HTML_TEXTAREA = "textarea";
-
-    /** 下拉框 */
-    public static final String HTML_SELECT = "select";
-
-    /** 单选框 */
-    public static final String HTML_RADIO = "radio";
-
-    /** 复选框 */
-    public static final String HTML_CHECKBOX = "checkbox";
-
-    /** 日期控件 */
-    public static final String HTML_DATETIME = "datetime";
-
-    /** 字符串类型 */
-    public static final String TYPE_STRING = "String";
-
-    /** 整型 */
-    public static final String TYPE_INTEGER = "Integer";
-
-    /** 长整型 */
-    public static final String TYPE_LONG = "Long";
-
-    /** 浮点型 */
-    public static final String TYPE_DOUBLE = "Double";
-
-    /** 高精度计算类型 */
-    public static final String TYPE_BIGDECIMAL = "BigDecimal";
-
-    /** 时间类型 */
-    public static final String TYPE_DATE = "Date";
-
-    /** 模糊查询 */
-    public static final String QUERY_LIKE = "LIKE";
-
-    /** 需要 */
-    public static final String REQUIRE = "1";
-}

+ 0 - 27
dgtly-common/src/main/java/com/dgtly/common/constant/PermissionConstants.java

@@ -1,27 +0,0 @@
-package com.dgtly.common.constant;
-
-/**
- * 权限通用常量
- * 
- * @author ruoyi
- */
-public class PermissionConstants
-{
-    /** 新增权限 */
-    public static final String ADD_PERMISSION = "add";
-
-    /** 修改权限 */
-    public static final String EDIT_PERMISSION = "edit";
-
-    /** 删除权限 */
-    public static final String REMOVE_PERMISSION = "remove";
-    
-    /** 导出权限 */
-    public static final String EXPORT_PERMISSION = "export";
-
-    /** 显示权限 */
-    public static final String VIEW_PERMISSION = "view";
-
-    /** 查询权限 */
-    public static final String LIST_PERMISSION = "list";
-}

+ 0 - 50
dgtly-common/src/main/java/com/dgtly/common/constant/ScheduleConstants.java

@@ -1,50 +0,0 @@
-package com.dgtly.common.constant;
-
-/**
- * 任务调度通用常量
- * 
- * @author ruoyi
- */
-public interface ScheduleConstants
-{
-    public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
-
-    /** 执行目标key */
-    public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
-
-    /** 默认 */
-    public static final String MISFIRE_DEFAULT = "0";
-
-    /** 立即触发执行 */
-    public static final String MISFIRE_IGNORE_MISFIRES = "1";
-
-    /** 触发一次执行 */
-    public static final String MISFIRE_FIRE_AND_PROCEED = "2";
-
-    /** 不触发立即执行 */
-    public static final String MISFIRE_DO_NOTHING = "3";
-
-    public enum Status
-    {
-        /**
-         * 正常
-         */
-        NORMAL("0"),
-        /**
-         * 暂停
-         */
-        PAUSE("1");
-
-        private String value;
-
-        private Status(String value)
-        {
-            this.value = value;
-        }
-
-        public String getValue()
-        {
-            return value;
-        }
-    }
-}

+ 0 - 74
dgtly-common/src/main/java/com/dgtly/common/constant/ShiroConstants.java

@@ -1,74 +0,0 @@
-package com.dgtly.common.constant;
-
-/**
- * Shiro通用常量
- * 
- * @author ruoyi
- */
-public interface ShiroConstants
-{
-    /**
-     * 当前登录的用户
-     */
-    public static final String CURRENT_USER = "currentUser";
-
-    /**
-     * 用户名
-     */
-    public static final String CURRENT_USERNAME = "username";
-
-    /**
-     * 消息key
-     */
-    public static String MESSAGE = "message";
-
-    /**
-     * 错误key
-     */
-    public static String ERROR = "errorMsg";
-
-    /**
-     * 编码格式
-     */
-    public static String ENCODING = "UTF-8";
-
-    /**
-     * 当前在线会话
-     */
-    public String ONLINE_SESSION = "online_session";
-
-    /**
-     * 验证码key
-     */
-    public static final String CURRENT_CAPTCHA = "captcha";
-
-    /**
-     * 验证码开关
-     */
-    public static final String CURRENT_ENABLED = "captchaEnabled";
-
-    /**
-     * 验证码类型
-     */
-    public static final String CURRENT_TYPE = "captchaType";
-
-    /**
-     * 验证码
-     */
-    public static final String CURRENT_VALIDATECODE = "validateCode";
-
-    /**
-     * 验证码错误
-     */
-    public static final String CAPTCHA_ERROR = "captchaError";
-
-    /**
-     * 登录记录缓存
-     */
-    public static final String LOGINRECORDCACHE = "loginRecordCache";
-
-    /**
-     * 系统活跃用户缓存
-     */
-    public static final String SYS_USERCACHE = "sys-userCache";
-}

File diff suppressed because it is too large
+ 0 - 101
dgtly-common/src/main/java/com/dgtly/common/constant/UserConstants.java


+ 0 - 181
dgtly-common/src/main/java/com/dgtly/common/core/controller/ApiBaseController.java

@@ -1,181 +0,0 @@
-package com.dgtly.common.core.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.dgtly.common.config.BodyReaderHttpServletRequestWrapper;
-import com.dgtly.common.constant.Constants;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.domain.ParameterObject;
-import com.dgtly.common.core.page.PageDomain;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.core.page.TableSupport;
-import com.dgtly.common.exception.api.LessParamException;
-import com.dgtly.common.utils.DateUtils;
-import com.dgtly.common.utils.ServletUtils;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.sql.SqlUtil;
-import com.github.pagehelper.Page;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import org.apache.poi.ss.formula.functions.T;
-import org.apache.poi.util.StringUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.beans.PropertyEditorSupport;
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * API通用数据处理
- * 
- * @author ruoyi
- */
-public class ApiBaseController
-{
-    protected final Logger logger = LoggerFactory.getLogger(ApiBaseController.class);
-
-    /**
-     * 将前台传递过来的日期格式的字符串,自动转化为Date类型
-     */
-    @InitBinder
-    public void initBinder(WebDataBinder binder)
-    {
-        // Date 类型转换
-        binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
-        {
-            @Override
-            public void setAsText(String text)
-            {
-                setValue(DateUtils.parseDate(text));
-            }
-        });
-    }
-
-    /**
-     * 响应返回结果
-     *
-     * @param rows 影响行数
-     * @return 操作结果
-     */
-    protected AjaxResult toAjax(int rows)
-    {
-        return rows > 0 ? AjaxResult.success() : AjaxResult.error();
-    }
-
-    /**
-     * 响应返回结果
-     *
-     * @param result 结果
-     * @return 操作结果
-     */
-    protected AjaxResult toAjax(boolean result)
-    {
-        return result ? AjaxResult.success() : AjaxResult.error();
-    }
-    /**
-     * 设置请求分页数据
-     */
-    protected void startPage(ParameterObject obj)
-    {
-        Integer pageNum = null;
-        Integer pageSize =null;
-        String orderBy =null;
-        PageDomain pageDomain = obj.parseBean(PageDomain.class);
-        if(pageDomain!=null){
-            pageNum = pageDomain.getPageNum();
-            pageSize= pageDomain.getPageSize();
-            orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
-        }
-        if (!StringUtils.isNotNull(pageNum)) {
-            pageNum = 1;
-         }
-         if(! StringUtils.isNotNull(pageSize))
-        {
-            pageSize = 10;
-
-        }
-
-        PageHelper.startPage(pageNum, pageSize, orderBy);
-
-    }
-    /**
-     * 设置请求分页数据
-     */
-    protected void startPage(PageDomain pageDomain)
-    {
-        Integer pageNum = null;
-        Integer pageSize =null;
-        String orderBy =null;
-        if(pageDomain!=null){
-            pageNum = pageDomain.getPageNum();
-            pageSize= pageDomain.getPageSize();
-            orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
-        }
-        if (!StringUtils.isNotNull(pageNum)) {
-            pageNum = 1;
-        }
-        if(! StringUtils.isNotNull(pageSize))
-        {
-            pageSize = 10;
-
-        }
-
-        PageHelper.startPage(pageNum, pageSize, orderBy);
-
-    }
-
-    /**
-     * 获取request
-     */
-    public HttpServletRequest getRequest()
-    {
-        return ServletUtils.getRequest();
-    }
-
-    /**
-     * 获取response
-     */
-    public HttpServletResponse getResponse()
-    {
-        return ServletUtils.getResponse();
-    }
-
-    /**
-     * 获取session
-     */
-    public HttpSession getSession()
-    {
-        return getRequest().getSession();
-    }
-
-    /**
-     * 响应请求分页数据
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    protected TableDataInfo getDataTable(List<?> list)
-    {
-        TableDataInfo rspData = new TableDataInfo();
-        rspData.setCode(0);
-        rspData.setRows(list);
-        rspData.setTotal(new PageInfo(list).getTotal());
-        return rspData;
-    }
-
-
-    /**
-     * 获取请求提交的json参数并封装为JSONObject
-     * @return
-     */
-    public ParameterObject getParameterObject(){
-        return new ParameterObject(getRequest());
-    }
-
-}

+ 0 - 176
dgtly-common/src/main/java/com/dgtly/common/core/controller/BaseController.java

@@ -1,176 +0,0 @@
-package com.dgtly.common.core.controller;
-
-import java.beans.PropertyEditorSupport;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import com.alibaba.fastjson.JSONObject;
-import com.dgtly.common.config.BodyReaderHttpServletRequestWrapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.page.PageDomain;
-import com.dgtly.common.core.page.TableDataInfo;
-import com.dgtly.common.core.page.TableSupport;
-import com.dgtly.common.utils.DateUtils;
-import com.dgtly.common.utils.ServletUtils;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.sql.SqlUtil;
-
-/**
- * web层通用数据处理
- * 
- * @author ruoyi
- */
-public class BaseController
-{
-    protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
-
-    /**
-     * 将前台传递过来的日期格式的字符串,自动转化为Date类型
-     */
-    @InitBinder
-    public void initBinder(WebDataBinder binder)
-    {
-        // Date 类型转换
-        binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
-        {
-            @Override
-            public void setAsText(String text)
-            {
-                setValue(DateUtils.parseDate(text));
-            }
-        });
-    }
-
-    /**
-     * 设置请求分页数据
-     */
-    protected void startPage()
-    {
-        PageDomain pageDomain = TableSupport.buildPageRequest();
-        Integer pageNum = pageDomain.getPageNum();
-        Integer pageSize = pageDomain.getPageSize();
-        if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
-        {
-            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
-            PageHelper.startPage(pageNum, pageSize, orderBy);
-        }
-    }
-
-    /**
-     * 获取request
-     */
-    public HttpServletRequest getRequest()
-    {
-        return ServletUtils.getRequest();
-    }
-
-    /**
-     * 获取response
-     */
-    public HttpServletResponse getResponse()
-    {
-        return ServletUtils.getResponse();
-    }
-
-    /**
-     * 获取session
-     */
-    public HttpSession getSession()
-    {
-        return getRequest().getSession();
-    }
-
-    /**
-     * 响应请求分页数据
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    protected TableDataInfo getDataTable(List<?> list)
-    {
-        TableDataInfo rspData = new TableDataInfo();
-        rspData.setCode(0);
-        rspData.setRows(list);
-        rspData.setTotal(new PageInfo(list).getTotal());
-        return rspData;
-    }
-
-    /**
-     * 响应返回结果
-     * 
-     * @param rows 影响行数
-     * @return 操作结果
-     */
-    protected AjaxResult toAjax(int rows)
-    {
-        return rows > 0 ? success() : error();
-    }
-
-    /**
-     * 响应返回结果
-     * 
-     * @param result 结果
-     * @return 操作结果
-     */
-    protected AjaxResult toAjax(boolean result)
-    {
-        return result ? success() : error();
-    }
-
-    /**
-     * 返回成功
-     */
-    public AjaxResult success()
-    {
-        return AjaxResult.success();
-    }
-
-    /**
-     * 返回失败消息
-     */
-    public AjaxResult error()
-    {
-        return AjaxResult.error();
-    }
-
-    /**
-     * 返回成功消息
-     */
-    public AjaxResult success(String message)
-    {
-        return AjaxResult.success(message);
-    }
-
-    /**
-     * 返回失败消息
-     */
-    public AjaxResult error(String message)
-    {
-        return AjaxResult.error(message);
-    }
-
-    /**
-     * 返回错误码消息
-     */
-    public AjaxResult error(int code, String message)
-    {
-        return new AjaxResult(code, message);
-    }
-
-    /**
-     * 页面跳转
-     */
-    public String redirect(String url)
-    {
-        return StringUtils.format("redirect:{}", url);
-    }
-
-}

+ 0 - 226
dgtly-common/src/main/java/com/dgtly/common/core/domain/AjaxResult.java

@@ -1,226 +0,0 @@
-package com.dgtly.common.core.domain;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.*;
-
-import com.dgtly.common.utils.MapBeanUtil;
-
-/**
- * 操作消息提醒
- * 
- * @author ruoyi
- */
-public class AjaxResult
-{
-
-
-
-
-    private static final long serialVersionUID = 1L;
-
-
-
-    private Integer code;
-    private String msg;
-    private Map<String,Object> data = new HashMap<>();
-    public Integer getCode() {
-        return code;
-    }
-    public void setCode(Integer code) {
-        this.code = code;
-    }
-    public String getMsg() {
-        return msg;
-    }
-    public void setMsg(String msg) {
-        this.msg = msg;
-    }
-    public Map<String, Object> getData() {
-        return data;
-    }
-    public void setData(Map<String, Object> data) {
-        this.data = data;
-    }
-
-    public AjaxResult()
-    {
-    }
-    /**
-     * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
-     */
-    public AjaxResult(int code,String msg)
-    {
-        this.code = code;
-        this.msg = msg;
-    }
-
-    /**
-     * 初始化一个新创建的 AjaxResult 对象
-     * 
-     * @param type 状态类型
-     */
-    public AjaxResult(ResultType type)
-    {
-        this.code =type.value();
-        this.msg = type.msg();
-    }
-    /**
-     * 将数据按照键值对的形式放入data中
-     * @return
-             */
-    public AjaxResult set(ResultType t) {
-        this.code = t.value();
-        this.msg = t.msg();
-        return this;
-    }
-    /**
-     * 将实体中的属性放入data中
-     * @param data
-     * @return
-     * @throws IllegalAccessException
-     * @throws NoSuchMethodException
-     * @throws InvocationTargetException
-     */
-    public AjaxResult parseBean(Object data) {
-        if(data!=null){
-            if(Collection.class.isAssignableFrom(data.getClass())){
-                throw new RuntimeException("parseBean不能导入list类型实体");
-            }else{
-                if(Map.class.isAssignableFrom(data.getClass())){
-                    this.data.putAll((Map)data);
-                }else{
-                    //将实体转换为map对象,并将其全部字段放入data中。
-                    this.data.putAll(MapBeanUtil.object2Map(data));
-                }
-
-            }
-        }
-
-        return this;
-    }
-
-    /**
-     * 将数据按照键值对的形式放入data中
-     * @param key
-     * @param value
-     * @return
-     */
-    public AjaxResult putKV(String key,Object value) {
-        this.data.put(key,value);
-        return this;
-    }
-
-    /**
-     * 返回成功消息
-     * 
-     * @return 成功消息
-     */
-    public static AjaxResult success()
-    {
-        return  new AjaxResult(ResultType.SUCCESS);
-    }
-    /**
-     * 返回成功消息
-     *
-     * @return 成功消息
-     */
-    public static AjaxResult success(String msg)
-    {
-        AjaxResult  a = new AjaxResult(ResultType.SUCCESS);
-        a.msg=msg;
-        return a;
-    }
-    /**
-     * 返回成功消息
-     *
-     * @return 成功消息
-     */
-    public static AjaxResult success(Object data)  {
-        AjaxResult  a = new AjaxResult(ResultType.SUCCESS);
-        a.parseBean(data);
-        return a;
-    }
-    /**
-     * 返回成功消息
-     *
-     * @return 成功消息
-     */
-    public static AjaxResult success(String msg,Object data) {
-        AjaxResult  a = new AjaxResult(ResultType.SUCCESS);
-        a.msg=msg;
-        a.parseBean(data);
-        return a;
-    }
-
-    /**
-     * 返回错误消息
-     * 
-     * @return
-     */
-    public static AjaxResult error()
-    {
-        return new AjaxResult(ResultType.ERROR);
-    }
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-    public static AjaxResult error(ResultType t)
-    {
-        return new AjaxResult(t);
-    }
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-    public static AjaxResult error(String msg)
-    {
-        AjaxResult a =new AjaxResult(ResultType.ERROR);
-        a.msg = msg;
-        return a;
-    }
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-    public static AjaxResult error(ResultType t,Object data) {
-        return new AjaxResult(t).parseBean(data);
-    }
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-    public static AjaxResult error(ResultType t,String msg) {
-        AjaxResult  a = new AjaxResult(ResultType.SUCCESS);
-        a.msg = msg;
-        return a;
-    }
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-   /* public static AjaxResult error(int code,String msg)
-    {
-        return new AjaxResult(code,msg);
-    }*/
-
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-    /*public static AjaxResult error(int code,String msg,Object data){
-        return new AjaxResult(code,msg).parseBean(data);
-    }*/
-
-
-
-
-
-
-}

+ 0 - 114
dgtly-common/src/main/java/com/dgtly/common/core/domain/BaseEntity.java

@@ -1,114 +0,0 @@
-package com.dgtly.common.core.domain;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonFormat;
-
-/**
- * Entity基类
- * 
- * @author ruoyi
- */
-public class BaseEntity implements Serializable
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 搜索值 */
-    private String searchValue;
-
-    /** 创建者 */
-    private String createBy;
-
-    /** 创建时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date createTime;
-
-    /** 更新者 */
-    private String updateBy;
-
-    /** 更新时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date updateTime;
-
-    /** 备注 */
-    private String remark;
-
-    /** 请求参数 */
-    private Map<String, Object> params;
-
-    public String getSearchValue()
-    {
-        return searchValue;
-    }
-
-    public void setSearchValue(String searchValue)
-    {
-        this.searchValue = searchValue;
-    }
-
-    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 String getRemark()
-    {
-        return remark;
-    }
-
-    public void setRemark(String remark)
-    {
-        this.remark = remark;
-    }
-
-    public Map<String, Object> getParams()
-    {
-        if (params == null)
-        {
-            params = new HashMap<>();
-        }
-        return params;
-    }
-
-    public void setParams(Map<String, Object> params)
-    {
-        this.params = params;
-    }
-}

+ 0 - 63
dgtly-common/src/main/java/com/dgtly/common/core/domain/TreeEntity.java

@@ -1,63 +0,0 @@
-package com.dgtly.common.core.domain;
-
-/**
- * Tree基类
- * 
- * @author ruoyi
- */
-public class TreeEntity extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 父菜单名称 */
-    private String parentName;
-
-    /** 父菜单ID */
-    private Long parentId;
-
-    /** 显示顺序 */
-    private Integer orderNum;
-
-    /** 祖级列表 */
-    private String ancestors;
-
-    public String getParentName()
-    {
-        return parentName;
-    }
-
-    public void setParentName(String parentName)
-    {
-        this.parentName = parentName;
-    }
-
-    public Long getParentId()
-    {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId)
-    {
-        this.parentId = parentId;
-    }
-
-    public Integer getOrderNum()
-    {
-        return orderNum;
-    }
-
-    public void setOrderNum(Integer orderNum)
-    {
-        this.orderNum = orderNum;
-    }
-
-    public String getAncestors()
-    {
-        return ancestors;
-    }
-
-    public void setAncestors(String ancestors)
-    {
-        this.ancestors = ancestors;
-    }
-}

+ 0 - 117
dgtly-common/src/main/java/com/dgtly/common/core/domain/Ztree.java

@@ -1,117 +0,0 @@
-package com.dgtly.common.core.domain;
-
-import java.io.Serializable;
-
-/**
- * Ztree树结构实体类
- * 
- * @author ruoyi
- */
-public class Ztree implements Serializable
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 节点ID */
-    private Long id;
-
-    /** 节点父ID */
-    private Long pId;
-
-    /** 节点名称 */
-    private String name;
-
-    /** 节点标题 */
-    private String title;
-
-    /** 节点备用字段 */
-    private String remake;
-
-    /** 是否勾选 */
-    private boolean checked = false;
-
-    /** 是否展开 */
-    private boolean open = false;
-
-    /** 是否能勾选 */
-    private boolean nocheck = false;
-
-    public Long getId()
-    {
-        return id;
-    }
-
-    public void setId(Long id)
-    {
-        this.id = id;
-    }
-
-    public Long getpId()
-    {
-        return pId;
-    }
-
-    public void setpId(Long pId)
-    {
-        this.pId = pId;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String name)
-    {
-        this.name = name;
-    }
-
-    public String getTitle()
-    {
-        return title;
-    }
-
-    public void setTitle(String title)
-    {
-        this.title = title;
-    }
-
-    public boolean isChecked()
-    {
-        return checked;
-    }
-
-    public void setChecked(boolean checked)
-    {
-        this.checked = checked;
-    }
-
-    public boolean isOpen()
-    {
-        return open;
-    }
-
-    public void setOpen(boolean open)
-    {
-        this.open = open;
-    }
-
-    public boolean isNocheck()
-    {
-        return nocheck;
-    }
-
-    public void setNocheck(boolean nocheck)
-    {
-        this.nocheck = nocheck;
-    }
-
-
-    public String getRemake() {
-        return remake;
-    }
-
-    public void setRemake(String remake) {
-        this.remake = remake;
-    }
-
-}

+ 0 - 69
dgtly-common/src/main/java/com/dgtly/common/core/page/PageDomain.java

@@ -1,69 +0,0 @@
-package com.dgtly.common.core.page;
-
-import com.dgtly.common.utils.StringUtils;
-
-/**
- * 分页数据
- * 
- * @author ruoyi
- */
-public class PageDomain
-{
-    /** 当前记录起始索引 */
-    private Integer pageNum;
-    /** 每页显示记录数 */
-    private Integer pageSize;
-    /** 排序列 */
-    private String orderByColumn;
-    /** 排序的方向 "desc" 或者 "asc". */
-    private String isAsc;
-
-    public String getOrderBy()
-    {
-        if (StringUtils.isEmpty(orderByColumn))
-        {
-            return "";
-        }
-        return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
-    }
-
-    public Integer getPageNum()
-    {
-        return pageNum;
-    }
-
-    public void setPageNum(Integer pageNum)
-    {
-        this.pageNum = pageNum;
-    }
-
-    public Integer getPageSize()
-    {
-        return pageSize;
-    }
-
-    public void setPageSize(Integer pageSize)
-    {
-        this.pageSize = pageSize;
-    }
-
-    public String getOrderByColumn()
-    {
-        return orderByColumn;
-    }
-
-    public void setOrderByColumn(String orderByColumn)
-    {
-        this.orderByColumn = orderByColumn;
-    }
-
-    public String getIsAsc()
-    {
-        return isAsc;
-    }
-
-    public void setIsAsc(String isAsc)
-    {
-        this.isAsc = isAsc;
-    }
-}

+ 0 - 85
dgtly-common/src/main/java/com/dgtly/common/core/page/TableDataInfo.java

@@ -1,85 +0,0 @@
-package com.dgtly.common.core.page;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 表格分页数据对象
- * 
- * @author ruoyi
- */
-public class TableDataInfo implements Serializable
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 总记录数 */
-    private long total;
-
-    /** 列表数据 */
-    private List<?> rows;
-
-    /** 消息状态码 */
-    private int code;
-
-    /** 消息内容 */
-    private int msg;
-
-    /**
-     * 表格数据对象
-     */
-    public TableDataInfo()
-    {
-    }
-
-    /**
-     * 分页
-     * 
-     * @param list 列表数据
-     * @param total 总记录数
-     */
-    public TableDataInfo(List<?> list, int total)
-    {
-        this.rows = list;
-        this.total = total;
-    }
-
-    public long getTotal()
-    {
-        return total;
-    }
-
-    public void setTotal(long total)
-    {
-        this.total = total;
-    }
-
-    public List<?> getRows()
-    {
-        return rows;
-    }
-
-    public void setRows(List<?> rows)
-    {
-        this.rows = rows;
-    }
-
-    public int getCode()
-    {
-        return code;
-    }
-
-    public void setCode(int code)
-    {
-        this.code = code;
-    }
-
-    public int getMsg()
-    {
-        return msg;
-    }
-
-    public void setMsg(int msg)
-    {
-        this.msg = msg;
-    }
-}

+ 0 - 30
dgtly-common/src/main/java/com/dgtly/common/core/page/TableSupport.java

@@ -1,30 +0,0 @@
-package com.dgtly.common.core.page;
-
-import com.dgtly.common.constant.Constants;
-import com.dgtly.common.utils.ServletUtils;
-
-/**
- * 表格数据处理
- * 
- * @author ruoyi
- */
-public class TableSupport
-{
-    /**
-     * 封装分页对象
-     */
-    public static PageDomain getPageDomain()
-    {
-        PageDomain pageDomain = new PageDomain();
-        pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
-        pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
-        pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
-        pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
-        return pageDomain;
-    }
-
-    public static PageDomain buildPageRequest()
-    {
-        return getPageDomain();
-    }
-}

+ 0 - 86
dgtly-common/src/main/java/com/dgtly/common/core/text/CharsetKit.java

@@ -1,86 +0,0 @@
-package com.dgtly.common.core.text;
-
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import com.dgtly.common.utils.StringUtils;
-
-/**
- * 字符集工具类
- * 
- * @author ruoyi
- */
-public class CharsetKit
-{
-    /** ISO-8859-1 */
-    public static final String ISO_8859_1 = "ISO-8859-1";
-    /** UTF-8 */
-    public static final String UTF_8 = "UTF-8";
-    /** GBK */
-    public static final String GBK = "GBK";
-
-    /** ISO-8859-1 */
-    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
-    /** UTF-8 */
-    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
-    /** GBK */
-    public static final Charset CHARSET_GBK = Charset.forName(GBK);
-
-    /**
-     * 转换为Charset对象
-     * 
-     * @param charset 字符集,为空则返回默认字符集
-     * @return Charset
-     */
-    public static Charset charset(String charset)
-    {
-        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
-    }
-
-    /**
-     * 转换字符串的字符集编码
-     * 
-     * @param source 字符串
-     * @param srcCharset 源字符集,默认ISO-8859-1
-     * @param destCharset 目标字符集,默认UTF-8
-     * @return 转换后的字符集
-     */
-    public static String convert(String source, String srcCharset, String destCharset)
-    {
-        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
-    }
-
-    /**
-     * 转换字符串的字符集编码
-     * 
-     * @param source 字符串
-     * @param srcCharset 源字符集,默认ISO-8859-1
-     * @param destCharset 目标字符集,默认UTF-8
-     * @return 转换后的字符集
-     */
-    public static String convert(String source, Charset srcCharset, Charset destCharset)
-    {
-        if (null == srcCharset)
-        {
-            srcCharset = StandardCharsets.ISO_8859_1;
-        }
-
-        if (null == destCharset)
-        {
-            srcCharset = StandardCharsets.UTF_8;
-        }
-
-        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
-        {
-            return source;
-        }
-        return new String(source.getBytes(srcCharset), destCharset);
-    }
-
-    /**
-     * @return 系统字符集编码
-     */
-    public static String systemCharset()
-    {
-        return Charset.defaultCharset().name();
-    }
-}

File diff suppressed because it is too large
+ 0 - 999
dgtly-common/src/main/java/com/dgtly/common/core/text/Convert.java


+ 0 - 92
dgtly-common/src/main/java/com/dgtly/common/core/text/StrFormatter.java

@@ -1,92 +0,0 @@
-package com.dgtly.common.core.text;
-
-import com.dgtly.common.utils.StringUtils;
-
-/**
- * 字符串格式化
- * 
- * @author ruoyi
- */
-public class StrFormatter
-{
-    public static final String EMPTY_JSON = "{}";
-    public static final char C_BACKSLASH = '\\';
-    public static final char C_DELIM_START = '{';
-    public static final char C_DELIM_END = '}';
-
-    /**
-     * 格式化字符串<br>
-     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
-     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
-     * 例:<br>
-     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
-     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
-     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
-     * 
-     * @param strPattern 字符串模板
-     * @param argArray 参数列表
-     * @return 结果
-     */
-    public static String format(final String strPattern, final Object... argArray)
-    {
-        if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
-        {
-            return strPattern;
-        }
-        final int strPatternLength = strPattern.length();
-
-        // 初始化定义好的长度以获得更好的性能
-        StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
-
-        int handledPosition = 0;
-        int delimIndex;// 占位符所在位置
-        for (int argIndex = 0; argIndex < argArray.length; argIndex++)
-        {
-            delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
-            if (delimIndex == -1)
-            {
-                if (handledPosition == 0)
-                {
-                    return strPattern;
-                }
-                else
-                { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
-                    sbuf.append(strPattern, handledPosition, strPatternLength);
-                    return sbuf.toString();
-                }
-            }
-            else
-            {
-                if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
-                {
-                    if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
-                    {
-                        // 转义符之前还有一个转义符,占位符依旧有效
-                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
-                        sbuf.append(Convert.utf8Str(argArray[argIndex]));
-                        handledPosition = delimIndex + 2;
-                    }
-                    else
-                    {
-                        // 占位符被转义
-                        argIndex--;
-                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
-                        sbuf.append(C_DELIM_START);
-                        handledPosition = delimIndex + 1;
-                    }
-                }
-                else
-                {
-                    // 正常占位符
-                    sbuf.append(strPattern, handledPosition, delimIndex);
-                    sbuf.append(Convert.utf8Str(argArray[argIndex]));
-                    handledPosition = delimIndex + 2;
-                }
-            }
-        }
-        // 加入最后一个占位符后所有的字符
-        sbuf.append(strPattern, handledPosition, strPattern.length());
-
-        return sbuf.toString();
-    }
-}

+ 0 - 19
dgtly-common/src/main/java/com/dgtly/common/enums/BusinessStatus.java

@@ -1,19 +0,0 @@
-package com.dgtly.common.enums;
-
-/**
- * 操作状态
- * 
- * @author ruoyi
- */
-public enum BusinessStatus
-{
-    /**
-     * 成功
-     */
-    SUCCESS,
-
-    /**
-     * 失败
-     */
-    FAIL,
-}

+ 0 - 59
dgtly-common/src/main/java/com/dgtly/common/enums/BusinessType.java

@@ -1,59 +0,0 @@
-package com.dgtly.common.enums;
-
-/**
- * 业务操作类型
- * 
- * @author ruoyi
- */
-public enum BusinessType
-{
-    /**
-     * 其它
-     */
-    OTHER,
-
-    /**
-     * 新增
-     */
-    INSERT,
-
-    /**
-     * 修改
-     */
-    UPDATE,
-
-    /**
-     * 删除
-     */
-    DELETE,
-
-    /**
-     * 授权
-     */
-    GRANT,
-
-    /**
-     * 导出
-     */
-    EXPORT,
-
-    /**
-     * 导入
-     */
-    IMPORT,
-
-    /**
-     * 强退
-     */
-    FORCE,
-
-    /**
-     * 生成代码
-     */
-    GENCODE,
-    
-    /**
-     * 清空
-     */
-    CLEAN,
-}

+ 0 - 19
dgtly-common/src/main/java/com/dgtly/common/enums/DataSourceType.java

@@ -1,19 +0,0 @@
-package com.dgtly.common.enums;
-
-/**
- * 数据源
- * 
- * @author ruoyi
- */
-public enum DataSourceType
-{
-    /**
-     * 主库
-     */
-    MASTER,
-
-    /**
-     * 从库
-     */
-    SLAVE
-}

+ 0 - 24
dgtly-common/src/main/java/com/dgtly/common/enums/OnlineStatus.java

@@ -1,24 +0,0 @@
-package com.dgtly.common.enums;
-
-/**
- * 用户会话
- * 
- * @author ruoyi
- */
-public enum OnlineStatus
-{
-    /** 用户状态 */
-    on_line("在线"), off_line("离线");
-
-    private final String info;
-
-    private OnlineStatus(String info)
-    {
-        this.info = info;
-    }
-
-    public String getInfo()
-    {
-        return info;
-    }
-}

+ 0 - 24
dgtly-common/src/main/java/com/dgtly/common/enums/OperatorType.java

@@ -1,24 +0,0 @@
-package com.dgtly.common.enums;
-
-/**
- * 操作人类别
- * 
- * @author ruoyi
- */
-public enum OperatorType
-{
-    /**
-     * 其它
-     */
-    OTHER,
-
-    /**
-     * 后台用户
-     */
-    MANAGE,
-
-    /**
-     * 手机端用户
-     */
-    MOBILE
-}

+ 0 - 30
dgtly-common/src/main/java/com/dgtly/common/enums/UserStatus.java

@@ -1,30 +0,0 @@
-package com.dgtly.common.enums;
-
-/**
- * 用户状态
- * 
- * @author ruoyi
- */
-public enum UserStatus
-{
-    OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"),DELETEDBYCOMPANY("3","以公司为基准删除");
-
-    private final String code;
-    private final String info;
-
-    UserStatus(String code, String info)
-    {
-        this.code = code;
-        this.info = info;
-    }
-
-    public String getCode()
-    {
-        return code;
-    }
-
-    public String getInfo()
-    {
-        return info;
-    }
-}

+ 0 - 30
dgtly-common/src/main/java/com/dgtly/common/exception/BusinessException.java

@@ -1,30 +0,0 @@
-package com.dgtly.common.exception;
-
-/**
- * 业务异常
- * 
- * @author ruoyi
- */
-public class BusinessException extends RuntimeException
-{
-    private static final long serialVersionUID = 1L;
-
-    protected final String message;
-
-    public BusinessException(String message)
-    {
-        this.message = message;
-    }
-
-    public BusinessException(String message, Throwable e)
-    {
-        super(message, e);
-        this.message = message;
-    }
-
-    @Override
-    public String getMessage()
-    {
-        return message;
-    }
-}

+ 0 - 15
dgtly-common/src/main/java/com/dgtly/common/exception/DemoModeException.java

@@ -1,15 +0,0 @@
-package com.dgtly.common.exception;
-
-/**
- * 演示模式异常
- * 
- * @author ruoyi
- */
-public class DemoModeException extends RuntimeException
-{
-    private static final long serialVersionUID = 1L;
-
-    public DemoModeException()
-    {
-    }
-}

+ 0 - 97
dgtly-common/src/main/java/com/dgtly/common/exception/base/BaseException.java

@@ -1,97 +0,0 @@
-package com.dgtly.common.exception.base;
-
-import com.dgtly.common.utils.MessageUtils;
-import com.dgtly.common.utils.StringUtils;
-
-/**
- * 基础异常
- * 
- * @author ruoyi
- */
-public class BaseException extends RuntimeException
-{
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 所属模块
-     */
-    private String module;
-
-    /**
-     * 错误码
-     */
-    private String code;
-
-    /**
-     * 错误码对应的参数
-     */
-    private Object[] args;
-
-    /**
-     * 错误消息
-     */
-    private String defaultMessage;
-
-    public BaseException(String module, String code, Object[] args, String defaultMessage)
-    {
-        this.module = module;
-        this.code = code;
-        this.args = args;
-        this.defaultMessage = defaultMessage;
-    }
-
-    public BaseException(String module, String code, Object[] args)
-    {
-        this(module, code, args, null);
-    }
-
-    public BaseException(String module, String defaultMessage)
-    {
-        this(module, null, null, defaultMessage);
-    }
-
-    public BaseException(String code, Object[] args)
-    {
-        this(null, code, args, null);
-    }
-
-    public BaseException(String defaultMessage)
-    {
-        this(null, null, null, defaultMessage);
-    }
-
-    @Override
-    public String getMessage()
-    {
-        String message = null;
-        if (!StringUtils.isEmpty(code))
-        {
-            message = MessageUtils.message(code, args);
-        }
-        if (message == null)
-        {
-            message = defaultMessage;
-        }
-        return message;
-    }
-
-    public String getModule()
-    {
-        return module;
-    }
-
-    public String getCode()
-    {
-        return code;
-    }
-
-    public Object[] getArgs()
-    {
-        return args;
-    }
-
-    public String getDefaultMessage()
-    {
-        return defaultMessage;
-    }
-}

+ 0 - 19
dgtly-common/src/main/java/com/dgtly/common/exception/file/FileException.java

@@ -1,19 +0,0 @@
-package com.dgtly.common.exception.file;
-
-import com.dgtly.common.exception.base.BaseException;
-
-/**
- * 文件信息异常类
- * 
- * @author ruoyi
- */
-public class FileException extends BaseException
-{
-    private static final long serialVersionUID = 1L;
-
-    public FileException(String code, Object[] args)
-    {
-        super("file", code, args, null);
-    }
-
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/file/FileNameLengthLimitExceededException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.file;
-
-/**
- * 文件名称超长限制异常类
- * 
- * @author ruoyi
- */
-public class FileNameLengthLimitExceededException extends FileException
-{
-    private static final long serialVersionUID = 1L;
-
-    public FileNameLengthLimitExceededException(int defaultFileNameLength)
-    {
-        super("upload.filename.exceed.length", new Object[] { defaultFileNameLength });
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/file/FileSizeLimitExceededException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.file;
-
-/**
- * 文件名大小限制异常类
- * 
- * @author ruoyi
- */
-public class FileSizeLimitExceededException extends FileException
-{
-    private static final long serialVersionUID = 1L;
-
-    public FileSizeLimitExceededException(long defaultMaxSize)
-    {
-        super("upload.exceed.maxSize", new Object[] { defaultMaxSize });
-    }
-}

+ 0 - 71
dgtly-common/src/main/java/com/dgtly/common/exception/file/InvalidExtensionException.java

@@ -1,71 +0,0 @@
-package com.dgtly.common.exception.file;
-
-import java.util.Arrays;
-import org.apache.commons.fileupload.FileUploadException;
-
-/**
- * 文件上传 误异常类
- * 
- * @author ruoyi
- */
-public class InvalidExtensionException extends FileUploadException
-{
-    private static final long serialVersionUID = 1L;
-
-    private String[] allowedExtension;
-    private String extension;
-    private String filename;
-
-    public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
-    {
-        super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
-        this.allowedExtension = allowedExtension;
-        this.extension = extension;
-        this.filename = filename;
-    }
-
-    public String[] getAllowedExtension()
-    {
-        return allowedExtension;
-    }
-
-    public String getExtension()
-    {
-        return extension;
-    }
-
-    public String getFilename()
-    {
-        return filename;
-    }
-
-    public static class InvalidImageExtensionException extends InvalidExtensionException
-    {
-        private static final long serialVersionUID = 1L;
-
-        public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename)
-        {
-            super(allowedExtension, extension, filename);
-        }
-    }
-
-    public static class InvalidFlashExtensionException extends InvalidExtensionException
-    {
-        private static final long serialVersionUID = 1L;
-
-        public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename)
-        {
-            super(allowedExtension, extension, filename);
-        }
-    }
-
-    public static class InvalidMediaExtensionException extends InvalidExtensionException
-    {
-        private static final long serialVersionUID = 1L;
-
-        public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename)
-        {
-            super(allowedExtension, extension, filename);
-        }
-    }
-}

+ 0 - 34
dgtly-common/src/main/java/com/dgtly/common/exception/job/TaskException.java

@@ -1,34 +0,0 @@
-package com.dgtly.common.exception.job;
-
-/**
- * 计划策略异常
- * 
- * @author ruoyi
- */
-public class TaskException extends Exception
-{
-    private static final long serialVersionUID = 1L;
-
-    private Code code;
-
-    public TaskException(String msg, Code code)
-    {
-        this(msg, code, null);
-    }
-
-    public TaskException(String msg, Code code, Exception nestedEx)
-    {
-        super(msg, nestedEx);
-        this.code = code;
-    }
-
-    public Code getCode()
-    {
-        return code;
-    }
-
-    public enum Code
-    {
-        TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/CaptchaException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 验证码错误异常类
- * 
- * @author ruoyi
- */
-public class CaptchaException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public CaptchaException()
-    {
-        super("user.jcaptcha.error", null);
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/RoleBlockedException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 角色锁定异常类
- * 
- * @author ruoyi
- */
-public class RoleBlockedException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public RoleBlockedException()
-    {
-        super("role.blocked", null);
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/UserBlockedException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 用户锁定异常类
- * 
- * @author ruoyi
- */
-public class UserBlockedException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public UserBlockedException()
-    {
-        super("user.blocked", null);
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/UserDeleteException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 用户账号已被删除
- * 
- * @author ruoyi
- */
-public class UserDeleteException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public UserDeleteException()
-    {
-        super("user.password.delete", null);
-    }
-}

+ 0 - 18
dgtly-common/src/main/java/com/dgtly/common/exception/user/UserException.java

@@ -1,18 +0,0 @@
-package com.dgtly.common.exception.user;
-
-import com.dgtly.common.exception.base.BaseException;
-
-/**
- * 用户信息异常类
- * 
- * @author ruoyi
- */
-public class UserException extends BaseException
-{
-    private static final long serialVersionUID = 1L;
-
-    public UserException(String code, Object[] args)
-    {
-        super("user", code, args, null);
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/UserNotExistsException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 用户不存在异常类
- * 
- * @author ruoyi
- */
-public class UserNotExistsException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public UserNotExistsException()
-    {
-        super("user.not.exists", null);
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/UserPasswordNotMatchException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 用户密码不正确或不符合规范异常类
- * 
- * @author ruoyi
- */
-public class UserPasswordNotMatchException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public UserPasswordNotMatchException()
-    {
-        super("user.password.not.match", null);
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/UserPasswordRetryLimitCountException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 用户错误记数异常类
- * 
- * @author ruoyi
- */
-public class UserPasswordRetryLimitCountException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public UserPasswordRetryLimitCountException(int retryLimitCount)
-    {
-        super("user.password.retry.limit.count", new Object[] { retryLimitCount });
-    }
-}

+ 0 - 16
dgtly-common/src/main/java/com/dgtly/common/exception/user/UserPasswordRetryLimitExceedException.java

@@ -1,16 +0,0 @@
-package com.dgtly.common.exception.user;
-
-/**
- * 用户错误最大次数异常类
- * 
- * @author ruoyi
- */
-public class UserPasswordRetryLimitExceedException extends UserException
-{
-    private static final long serialVersionUID = 1L;
-
-    public UserPasswordRetryLimitExceedException(int retryLimitCount)
-    {
-        super("user.password.retry.limit.exceed", new Object[] { retryLimitCount });
-    }
-}

+ 0 - 187
dgtly-common/src/main/java/com/dgtly/common/json/JSON.java

@@ -1,187 +0,0 @@
-package com.dgtly.common.json;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectWriter;
-
-/**
- * JSON解析处理
- * 
- * @author ruoyi
- */
-public class JSON
-{
-    public static final String DEFAULT_FAIL = "\"Parse failed\"";
-    private static final ObjectMapper objectMapper = new ObjectMapper();
-    private static final ObjectWriter objectWriter = objectMapper.writerWithDefaultPrettyPrinter();
-
-    public static void marshal(File file, Object value) throws Exception
-    {
-        try
-        {
-            objectWriter.writeValue(file, value);
-        }
-        catch (JsonGenerationException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-
-    public static void marshal(OutputStream os, Object value) throws Exception
-    {
-        try
-        {
-            objectWriter.writeValue(os, value);
-        }
-        catch (JsonGenerationException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-
-    public static String marshal(Object value) throws Exception
-    {
-        try
-        {
-            return objectWriter.writeValueAsString(value);
-        }
-        catch (JsonGenerationException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-
-    public static byte[] marshalBytes(Object value) throws Exception
-    {
-        try
-        {
-            return objectWriter.writeValueAsBytes(value);
-        }
-        catch (JsonGenerationException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-
-    public static <T> T unmarshal(File file, Class<T> valueType) throws Exception
-    {
-        try
-        {
-            return objectMapper.readValue(file, valueType);
-        }
-        catch (JsonParseException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-
-    public static <T> T unmarshal(InputStream is, Class<T> valueType) throws Exception
-    {
-        try
-        {
-            return objectMapper.readValue(is, valueType);
-        }
-        catch (JsonParseException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-
-    public static <T> T unmarshal(String str, Class<T> valueType) throws Exception
-    {
-        try
-        {
-            return objectMapper.readValue(str, valueType);
-        }
-        catch (JsonParseException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-
-    public static <T> T unmarshal(byte[] bytes, Class<T> valueType) throws Exception
-    {
-        try
-        {
-            if (bytes == null)
-            {
-                bytes = new byte[0];
-            }
-            return objectMapper.readValue(bytes, 0, bytes.length, valueType);
-        }
-        catch (JsonParseException e)
-        {
-            throw new Exception(e);
-        }
-        catch (JsonMappingException e)
-        {
-            throw new Exception(e);
-        }
-        catch (IOException e)
-        {
-            throw new Exception(e);
-        }
-    }
-}

+ 0 - 749
dgtly-common/src/main/java/com/dgtly/common/json/JSONObject.java

@@ -1,749 +0,0 @@
-package com.dgtly.common.json;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.dgtly.common.utils.StringUtils;
-
-/**
- * 通用消息对象,基于Map实现的可嵌套数据结构。 支持JSON数据结构。
- * 
- * @author ruoyi
- */
-public class JSONObject extends LinkedHashMap<String, Object>
-{
-    private static final long serialVersionUID = 1L;
-    private static final Pattern arrayNamePattern = Pattern.compile("(\\w+)((\\[\\d+\\])+)");
-    private static final ObjectMapper objectMapper = new ObjectMapper();
-
-    /**
-     * 数组结构。
-     */
-    public static class JSONArray extends ArrayList<Object>
-    {
-        private static final long serialVersionUID = 1L;
-
-        public JSONArray()
-        {
-            super();
-        }
-
-        public JSONArray(int size)
-        {
-            super(size);
-        }
-
-        @Override
-        public String toString()
-        {
-            try
-            {
-                return JSON.marshal(this);
-            }
-            catch (Exception e)
-            {
-                throw new RuntimeException(e);
-            }
-        }
-
-        @Override
-        public Object set(int index, Object element)
-        {
-            return super.set(index, transfer(element));
-        }
-
-        @Override
-        public boolean add(Object element)
-        {
-            return super.add(transfer(element));
-        }
-
-        @Override
-        public void add(int index, Object element)
-        {
-            super.add(index, transfer(element));
-        }
-    }
-
-    public JSONObject()
-    {
-        super();
-    }
-
-    public JSONObject(final JSONObject other)
-    {
-        super(other);
-    }
-
-    @Override
-    public String toString()
-    {
-        try
-        {
-            return JSON.marshal(this);
-        }
-        catch (Exception e)
-        {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 转换为紧凑格式的字符串。
-     * 
-     * @return 返回本对象紧凑格式字符串。
-     */
-    public String toCompactString()
-    {
-        try
-        {
-            return objectMapper.writeValueAsString(this);
-        }
-        catch (Exception e)
-        {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 获取指定字段的整数值。如果字段不存在,或者无法转换为整数,返回null。
-     * 
-     * @param name 字段名,支持多级。
-     * @return 返回指定的整数值,或者null。
-     */
-    public Integer intValue(final String name)
-    {
-        return valueAsInt(value(name));
-    }
-
-    /**
-     * 获取指定字段的整数值。如果字段不存在,或者无法转换为整数,返回defaultValue。
-     * 
-     * @param name 字段名,支持多级。
-     * @param defaultValue 查询失败时,返回的值。
-     * @return 返回指定的整数值,或者defaultValue。
-     */
-    public Integer intValue(final String name, final Integer defaultValue)
-    {
-        return StringUtils.nvl(intValue(name), defaultValue);
-    }
-
-    /**
-     * 获取指定字段的长整数值。如果字段不存在,或者无法转换为长整数,返回null。
-     * 
-     * @param name 字段名,支持多级。
-     * @return 返回指定的长整数值,或者null。
-     */
-    public Long longValue(final String name)
-    {
-        return valueAsLong(value(name));
-    }
-
-    /**
-     * 获取指定字段的长整数值。如果字段不存在,或者无法转换为长整数,返回defaultValue。
-     * 
-     * @param name 字段名,支持多级。
-     * @param defaultValue 查询失败时,返回的值。
-     * @return 返回指定的长整数值,或者defaultValue。
-     */
-    public Long longValue(final String name, final Long defaultValue)
-    {
-        return StringUtils.nvl(longValue(name), defaultValue);
-    }
-
-    /**
-     * 获取指定字段的布尔值。如果字段不存在,或者无法转换为布尔型,返回null。
-     * 
-     * @param name 字段名,支持多级。
-     * @return 返回指定的布尔值,或者null。
-     */
-    public Boolean boolValue(final String name)
-    {
-        return valueAsBool(value(name));
-    }
-
-    /**
-     * 获取指定字段的布尔值。如果字段不存在,或者无法转换为布尔型,返回defaultValue。
-     * 
-     * @param name 字段名,支持多级。
-     * @param defaultValue 查询失败时,返回的值。
-     * @return 返回指定的布尔值,或者defaultValue。
-     */
-    public Boolean boolValue(final String name, final Boolean defaultValue)
-    {
-        return StringUtils.nvl(boolValue(name), defaultValue);
-    }
-
-    /**
-     * 获取指定字段的字符串值。如果字段不存在,返回null。
-     * 
-     * @param name 字段名,支持多级。
-     * @return 返回指定的字符串值,或者null。
-     */
-    public String strValue(final String name)
-    {
-        return valueAsStr(value(name));
-    }
-
-    /**
-     * 获取指定字段的字符串值。如果字段不存在,返回defaultValue。
-     * 
-     * @param name 字段名,支持多级。
-     * @param defaultValue 查询失败时,返回的值。
-     * @return 返回指定的字符串值,或者defaultValue。
-     */
-    public String strValue(final String name, final String defaultValue)
-    {
-        return StringUtils.nvl(strValue(name), defaultValue);
-    }
-
-    /**
-     * 获取指定字段的值。
-     * 
-     * @param name 字段名,支持多级,支持数组下标。
-     * @return 返回指定字段的值。
-     */
-    public Object value(final String name)
-    {
-        final int indexDot = name.indexOf('.');
-        if (indexDot >= 0)
-        {
-            return obj(name.substring(0, indexDot)).value(name.substring(indexDot + 1));
-        }
-        else
-        {
-            final Matcher matcher = arrayNamePattern.matcher(name);
-            if (matcher.find())
-            {
-                return endArray(matcher.group(1), matcher.group(2), new EndArrayCallback<Object>()
-                {
-                    @Override
-                    public Object callback(JSONArray arr, int index)
-                    {
-                        return elementAt(arr, index);
-                    }
-                });
-            }
-            else
-            {
-                return get(name);
-            }
-        }
-    }
-
-    /**
-     * 设置指定字段的值。
-     * 
-     * @param name 字段名,支持多级,支持数组下标。
-     * @param value 字段值。
-     * @return 返回本对象。
-     */
-    public JSONObject value(final String name, final Object value)
-    {
-        final int indexDot = name.indexOf('.');
-        if (indexDot >= 0)
-        {
-            obj(name.substring(0, indexDot)).value(name.substring(indexDot + 1), value);
-        }
-        else
-        {
-            final Matcher matcher = arrayNamePattern.matcher(name);
-            if (matcher.find())
-            {
-                endArray(matcher.group(1), matcher.group(2), new EndArrayCallback<Void>()
-                {
-                    @Override
-                    public Void callback(JSONArray arr, int index)
-                    {
-                        elementAt(arr, index, value);
-                        return null;
-                    }
-                });
-            }
-            else
-            {
-                set(name, value);
-            }
-        }
-        return this;
-    }
-
-    /**
-     * 获取对象(非标量类型)字段。返回的数据是一个结构体。当不存在指定对象时,则为指定的名字创建一个空的MessageObject对象。
-     * 
-     * @param name 字段名。不支持多级名字,支持数组下标。
-     * @return 返回指定的对象。如果对象不存在,则为指定的名字创建一个空的MessageObject对象。
-     */
-    public JSONObject obj(final String name)
-    {
-        final Matcher matcher = arrayNamePattern.matcher(name);
-        if (matcher.find())
-        {
-            return endArray(matcher.group(1), matcher.group(2), new EndArrayCallback<JSONObject>()
-            {
-                @Override
-                public JSONObject callback(JSONArray arr, int index)
-                {
-                    return objAt(arr, index);
-                }
-            });
-        }
-        else
-        {
-            JSONObject obj = getObj(name);
-            if (obj == null)
-            {
-                obj = new JSONObject();
-                put(name, obj);
-            }
-            return obj;
-        }
-    }
-
-    /**
-     * 获取数组字段。将名字对应的对象以数组对象返回,当指定的字段不存在时,创建一个空的数组。
-     * 
-     * @param name 字段名。不支持多级名字,不支持下标。
-     * @return 返回一个数组(List)。
-     */
-    public JSONArray arr(final String name)
-    {
-        JSONArray arr = getArr(name);
-        if (arr == null)
-        {
-            arr = new JSONArray();
-            put(name, arr);
-        }
-        return arr;
-    }
-
-    /**
-     * 获取对象(非标量类型)字段。返回的数据是一个结构体。
-     * 
-     * @param name 字段名。
-     * @return 返回指定的对象字段。
-     */
-    public JSONObject getObj(final String name)
-    {
-        return (JSONObject) get(name);
-    }
-
-    /**
-     * 获取数组类型字段。
-     * 
-     * @param name 字段名。
-     * @return 返回数组类型字段。
-     */
-    public JSONArray getArr(final String name)
-    {
-        return (JSONArray) get(name);
-    }
-
-    /**
-     * 返回字段整数值。如果不存在,返回null。
-     * 
-     * @param name 字段名。
-     * @return 返回指定字段整数值。
-     */
-    public Integer getInt(final String name)
-    {
-        return valueAsInt(get(name));
-    }
-
-    /**
-     * 返回字段整数值。如果不存在,返回defaultValue。
-     * 
-     * @param name 字段名。
-     * @param defaultValue 字段不存在时,返回的值。
-     * @return 返回指定字段整数值。
-     */
-    public Integer getInt(final String name, Integer defaultValue)
-    {
-        return StringUtils.nvl(getInt(name), defaultValue);
-    }
-
-    /**
-     * 返回字段长整数值。如果不存在,返回null。
-     * 
-     * @param name 字段名。
-     * @return 返回指定字段长整数值。
-     */
-    public Long getLong(final String name)
-    {
-        return valueAsLong(get(name));
-    }
-
-    /**
-     * 返回字段长整数值。如果不存在,返回defaultValue。
-     * 
-     * @param name 字段名。
-     * @param defaultValue 字段不存在时,返回的值。
-     * @return 返回指定字段长整数值。
-     */
-    public Long getLong(final String name, Long defaultValue)
-    {
-        return StringUtils.nvl(getLong(name), defaultValue);
-    }
-
-    /**
-     * 返回字段字符串值。如果不存在,返回null。
-     * 
-     * @param name 字段名。
-     * @return 返回指定字段字符串值。
-     */
-    public String getStr(final String name)
-    {
-        return valueAsStr(get(name));
-    }
-
-    /**
-     * 返回字段字符串值。如果不存在,返回defaultValue。
-     * 
-     * @param name 字段名。
-     * @param defaultValue 字段不存在时,返回的值。
-     * @return 返回指定字段字符串值。
-     */
-    public String getStr(final String name, final String defaultValue)
-    {
-        return StringUtils.nvl(getStr(name), defaultValue);
-    }
-
-    /**
-     * 字段值按照布尔类型返回。如果不存在,返回null。
-     * 
-     * @param name 字段名。
-     * @return 字段值。
-     */
-    public Boolean getBool(final String name)
-    {
-        return valueAsBool(get(name));
-    }
-
-    /**
-     * 字段值按照布尔类型返回。如果不存在,返回defaultValue。
-     * 
-     * @param name 字段名。
-     * @param defaultValue 字段不存在时,返回的值。
-     * @return 字段值。
-     */
-    public Boolean getBool(final String name, final Boolean defaultValue)
-    {
-        return StringUtils.nvl(getBool(name), defaultValue);
-    }
-
-    /**
-     * 设置字段值
-     * 
-     * @param name 字段名
-     * @param value 字段值(标量:数字、字符串、布尔型;结构体:MessageObject)。 如果是Map类型同时非MessageObject类型,则自动转换为MessageObject类型再存入
-     *            (此时,再修改Map中的数据,将不会体现到本对象中)。
-     * @return 返回本对象
-     */
-    public JSONObject set(final String name, final Object value)
-    {
-        put(name, value);
-        return this;
-    }
-
-    /**
-     * 将本对象转换为Java Bean。
-     * 
-     * @param beanClass Java Bean的类对象。
-     * @return 返回转换后的Java Bean。
-     */
-    public <T> T asBean(Class<T> beanClass)
-    {
-        try
-        {
-            return JSON.unmarshal(JSON.marshal(this), beanClass);
-        }
-        catch (Exception e)
-        {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 重载基类的方法。如果 value 是 Map 类型,但不是 MessageObject 类型,则创建一个包含内容等同于原 Map 的 MessageObject 作为 value(注意:此后再更改 Map 的内容,将不会反映到
-     * MessageObject 中)。 重载此方法的目的是为了使JSON能够正确地解析为MessageObject对象。不建议直接调用此方法,请使用 set(name, value)方法设置字段值。
-     */
-    @Override
-    public Object put(String key, Object value)
-    {
-        return super.put(key, transfer(value));
-    }
-
-    public static Integer valueAsInt(Object value)
-    {
-        if (value instanceof Integer)
-        {
-            return (Integer) value;
-        }
-        else if (value instanceof Number)
-        {
-            return ((Number) value).intValue();
-        }
-        else if (value instanceof String)
-        {
-            return Integer.valueOf((String) value);
-        }
-        else if (value instanceof Boolean)
-        {
-            return ((Boolean) value) ? 1 : 0;
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    public static Long valueAsLong(Object value)
-    {
-        if (value instanceof Long)
-        {
-            return (Long) value;
-        }
-        else if (value instanceof Number)
-        {
-            return ((Number) value).longValue();
-        }
-        else if (value instanceof String)
-        {
-            return Long.valueOf((String) value);
-        }
-        else if (value instanceof Boolean)
-        {
-            return ((Boolean) value) ? 1L : 0L;
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    public static String valueAsStr(Object value)
-    {
-        if (value instanceof String)
-        {
-            return (String) value;
-        }
-        else if (value != null)
-        {
-            return value.toString();
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    public static Boolean valueAsBool(Object value)
-    {
-        if (value instanceof Boolean)
-        {
-            return (Boolean) value;
-        }
-        else if (value instanceof Number)
-        {
-            return ((Number) value).doubleValue() != 0.0;
-        }
-        else if (value instanceof String)
-        {
-            return Boolean.valueOf((String) value);
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    /**
-     * 将所有层次中凡是Map类型同时又不是MessageObject的类型,转换为MessageObject类型。
-     * 
-     * @param value 值。
-     * @return 返回转换后的值。
-     */
-    @SuppressWarnings("unchecked")
-    private static Object transfer(final Object value)
-    {
-        if (!(value instanceof JSONObject) && value instanceof Map)
-        {
-            return toObj((Map<String, Object>) value);
-        }
-        else if (!(value instanceof JSONArray) && value instanceof Collection)
-        {
-            return toArr((Collection<Object>) value);
-        }
-        else
-        {
-            return value;
-        }
-    }
-
-    private static JSONArray toArr(final Collection<Object> list)
-    {
-        final JSONArray arr = new JSONArray(list.size());
-        for (final Object element : list)
-        {
-            arr.add(element);
-        }
-        return arr;
-    }
-
-    private static JSONObject toObj(final Map<String, Object> map)
-    {
-        final JSONObject obj = new JSONObject();
-        for (final Map.Entry<String, Object> ent : map.entrySet())
-        {
-            obj.put(ent.getKey(), transfer(ent.getValue()));
-        }
-        return obj;
-    }
-
-    /**
-     * 将指定下标元素作为数组返回,如果不存在,则在该位置创建一个空的数组。
-     * 
-     * @param arr 当前数组。
-     * @param index 下标。
-     * @return 返回当前数组指定下标的元素,该元素应该是一个数组。
-     */
-    private static JSONArray arrayAt(JSONArray arr, int index)
-    {
-        expand(arr, index);
-        if (arr.get(index) == null)
-        {
-            arr.set(index, new JSONArray());
-        }
-        return (JSONArray) arr.get(index);
-    }
-
-    /**
-     * 将指定下标元素作为结构体返回,如果不存在,则在该位置创建一个空的结构体。
-     * 
-     * @param arr 当前数组。
-     * @param index 下标。
-     * @return 返回当前数组指定下标元素,该元素是一个结构体。
-     */
-    private static JSONObject objAt(final JSONArray arr, int index)
-    {
-        expand(arr, index);
-        if (arr.get(index) == null)
-        {
-            arr.set(index, new JSONObject());
-        }
-        return (JSONObject) arr.get(index);
-    }
-
-    /**
-     * 设置数组指定下标位置的值。
-     * 
-     * @param arr 数组。
-     * @param index 下标。
-     * @param value 值。
-     */
-    private static void elementAt(final JSONArray arr, final int index, final Object value)
-    {
-        expand(arr, index).set(index, value);
-    }
-
-    /**
-     * 获取数组指定下标元素的值。
-     * 
-     * @param arr 数组。
-     * @param index 下标。
-     * @return 值。
-     */
-    private static Object elementAt(final JSONArray arr, final int index)
-    {
-        return expand(arr, index).get(index);
-    }
-
-    /**
-     * 扩展数组到指定下标,以防止访问时下标越界。
-     * 
-     * @param arr 数组
-     * @param index 下标
-     * @return 返回传入的数组
-     */
-    private static JSONArray expand(final JSONArray arr, final int index)
-    {
-        while (arr.size() <= index)
-        {
-            arr.add(null);
-        }
-        return arr;
-    }
-
-    /**
-     * 最后数组回调。
-     * 
-     * @author Mike
-     *
-     * @param <T> 回调返回数据类型。
-     */
-    private interface EndArrayCallback<T>
-    {
-        /**
-         * 当定位到最后一级数组,将调用本方法。
-         * 
-         * @param arr 最后一级数组对象。
-         * @param index 最后一级索引。
-         * @return 返回回调的返回值。
-         */
-        T callback(JSONArray arr, int index);
-    }
-
-    /**
-     * 处理多维数组的工具函数(包括一维数组)。多维数组的名字如:arrary[1][2][3], 则name=array,indexStr=[1][2][3],在callback中,endArr将是
-     * array[1][2]指定的对象,indexe=3。
-     * 
-     * @param name 不带下标的名字,不支持多级名字。
-     * @param indexesStr 索引部分的字符串,如:[1][2][3]
-     * @param callback 回调函数。
-     * @return 返回回调函数的返回值。
-     */
-    private <T> T endArray(final String name, final String indexesStr, final EndArrayCallback<T> callback)
-    {
-        JSONArray endArr = arr(name);
-        final int[] indexes = parseIndexes(indexesStr);
-        int i = 0;
-        while (i < indexes.length - 1)
-        {
-            endArr = arrayAt(endArr, indexes[i++]);
-        }
-        return callback.callback(endArr, indexes[i]);
-    }
-
-    private static int[] parseIndexes(final String s)
-    {
-        int[] indexes = null;
-        List<Integer> list = new ArrayList<Integer>();
-
-        final StringTokenizer st = new StringTokenizer(s, "[]");
-        while (st.hasMoreTokens())
-        {
-            final int index = Integer.valueOf(st.nextToken());
-            if (index < 0)
-            {
-                throw new RuntimeException(String.format("Illegal index %1$d in \"%2$s\"", index, s));
-            }
-
-            list.add(index);
-        }
-
-        indexes = new int[list.size()];
-        int i = 0;
-        for (Integer tmp : list.toArray(new Integer[list.size()]))
-        {
-            indexes[i++] = tmp;
-        }
-
-        return indexes;
-    }
-}

+ 0 - 54
dgtly-common/src/main/java/com/dgtly/common/utils/AddressUtils.java

@@ -1,54 +0,0 @@
-package com.dgtly.common.utils;
-
-import com.dgtly.common.utils.http.HttpUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.dgtly.common.config.Global;
-import com.dgtly.common.json.JSON;
-import com.dgtly.common.json.JSONObject;
-
-/**
- * 获取地址类
- * 
- * @author ruoyi
- */
-public class AddressUtils
-{
-    private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
-
-    public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php";
-
-    public static String getRealAddressByIP(String ip)
-    {
-        String address = "XX XX";
-
-        // 内网不查询
-        if (IpUtils.internalIp(ip))
-        {
-            return "内网IP";
-        }
-        if (Global.isAddressEnabled())
-        {
-            String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip);
-            if (StringUtils.isEmpty(rspStr))
-            {
-                log.error("获取地理位置异常 {}", ip);
-                return address;
-            }
-            JSONObject obj;
-            try
-            {
-                obj = JSON.unmarshal(rspStr, JSONObject.class);
-                JSONObject data = obj.getObj("data");
-                String region = data.getStr("region");
-                String city = data.getStr("city");
-                address = region + " " + city;
-            }
-            catch (Exception e)
-            {
-                log.error("获取地理位置异常 {}", ip);
-            }
-        }
-        return address;
-    }
-}

+ 0 - 114
dgtly-common/src/main/java/com/dgtly/common/utils/Arith.java

@@ -1,114 +0,0 @@
-package com.dgtly.common.utils;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-
-/**
- * 精确的浮点数运算
- * 
- * @author ruoyi
- */
-public class Arith
-{
-
-    /** 默认除法运算精度 */
-    private static final int DEF_DIV_SCALE = 10;
-
-    /** 这个类不能实例化 */
-    private Arith()
-    {
-    }
-
-    /**
-     * 提供精确的加法运算。
-     * @param v1 被加数
-     * @param v2 加数
-     * @return 两个参数的和
-     */
-    public static double add(double v1, double v2)
-    {
-        BigDecimal b1 = new BigDecimal(Double.toString(v1));
-        BigDecimal b2 = new BigDecimal(Double.toString(v2));
-        return b1.add(b2).doubleValue();
-    }
-
-    /**
-     * 提供精确的减法运算。
-     * @param v1 被减数
-     * @param v2 减数
-     * @return 两个参数的差
-     */
-    public static double sub(double v1, double v2)
-    {
-        BigDecimal b1 = new BigDecimal(Double.toString(v1));
-        BigDecimal b2 = new BigDecimal(Double.toString(v2));
-        return b1.subtract(b2).doubleValue();
-    }
-
-    /**
-     * 提供精确的乘法运算。
-     * @param v1 被乘数
-     * @param v2 乘数
-     * @return 两个参数的积
-     */
-    public static double mul(double v1, double v2)
-    {
-        BigDecimal b1 = new BigDecimal(Double.toString(v1));
-        BigDecimal b2 = new BigDecimal(Double.toString(v2));
-        return b1.multiply(b2).doubleValue();
-    }
-
-    /**
-     * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到
-     * 小数点以后10位,以后的数字四舍五入。
-     * @param v1 被除数
-     * @param v2 除数
-     * @return 两个参数的商
-     */
-    public static double div(double v1, double v2)
-    {
-        return div(v1, v2, DEF_DIV_SCALE);
-    }
-
-    /**
-     * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指
-     * 定精度,以后的数字四舍五入。
-     * @param v1 被除数
-     * @param v2 除数
-     * @param scale 表示表示需要精确到小数点以后几位。
-     * @return 两个参数的商
-     */
-    public static double div(double v1, double v2, int scale)
-    {
-        if (scale < 0)
-        {
-            throw new IllegalArgumentException(
-                    "The scale must be a positive integer or zero");
-        }
-        BigDecimal b1 = new BigDecimal(Double.toString(v1));
-        BigDecimal b2 = new BigDecimal(Double.toString(v2));
-        if (b1.compareTo(BigDecimal.ZERO) == 0)
-        {
-            return BigDecimal.ZERO.doubleValue();
-        }
-        return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue();
-    }
-
-    /**
-     * 提供精确的小数位四舍五入处理。
-     * @param v 需要四舍五入的数字
-     * @param scale 小数点后保留几位
-     * @return 四舍五入后的结果
-     */
-    public static double round(double v, int scale)
-    {
-        if (scale < 0)
-        {
-            throw new IllegalArgumentException(
-                    "The scale must be a positive integer or zero");
-        }
-        BigDecimal b = new BigDecimal(Double.toString(v));
-        BigDecimal one = new BigDecimal("1");
-        return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue();
-    }
-}

+ 0 - 155
dgtly-common/src/main/java/com/dgtly/common/utils/DateUtils.java

@@ -1,155 +0,0 @@
-package com.dgtly.common.utils;
-
-import java.lang.management.ManagementFactory;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.apache.commons.lang3.time.DateFormatUtils;
-
-/**
- * 时间工具类
- * 
- * @author ruoyi
- */
-public class DateUtils extends org.apache.commons.lang3.time.DateUtils
-{
-    public static String YYYY = "yyyy";
-
-    public static String YYYY_MM = "yyyy-MM";
-
-    public static String YYYY_MM_DD = "yyyy-MM-dd";
-
-    public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
-
-    public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
-    
-    private static String[] parsePatterns = {
-            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", 
-            "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
-            "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
-
-    /**
-     * 获取当前Date型日期
-     * 
-     * @return Date() 当前日期
-     */
-    public static Date getNowDate()
-    {
-        return new Date();
-    }
-
-    /**
-     * 获取当前日期, 默认格式为yyyy-MM-dd
-     * 
-     * @return String
-     */
-    public static String getDate()
-    {
-        return dateTimeNow(YYYY_MM_DD);
-    }
-
-    public static final String getTime()
-    {
-        return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
-    }
-
-    public static final String dateTimeNow()
-    {
-        return dateTimeNow(YYYYMMDDHHMMSS);
-    }
-
-    public static final String dateTimeNow(final String format)
-    {
-        return parseDateToStr(format, new Date());
-    }
-
-    public static final String dateTime(final Date date)
-    {
-        return parseDateToStr(YYYY_MM_DD, date);
-    }
-
-    public static final String parseDateToStr(final String format, final Date date)
-    {
-        return new SimpleDateFormat(format).format(date);
-    }
-
-    public static final Date dateTime(final String format, final String ts)
-    {
-        try
-        {
-            return new SimpleDateFormat(format).parse(ts);
-        }
-        catch (ParseException e)
-        {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 日期路径 即年/月/日 如2018/08/08
-     */
-    public static final String datePath()
-    {
-        Date now = new Date();
-        return DateFormatUtils.format(now, "yyyy/MM/dd");
-    }
-
-    /**
-     * 日期路径 即年/月/日 如20180808
-     */
-    public static final String dateTime()
-    {
-        Date now = new Date();
-        return DateFormatUtils.format(now, "yyyyMMdd");
-    }
-
-    /**
-     * 日期型字符串转化为日期 格式
-     */
-    public static Date parseDate(Object str)
-    {
-        if (str == null)
-        {
-            return null;
-        }
-        try
-        {
-            return parseDate(str.toString(), parsePatterns);
-        }
-        catch (ParseException e)
-        {
-            return null;
-        }
-    }
-    
-    /**
-     * 获取服务器启动时间
-     */
-    public static Date getServerStartDate()
-    {
-        long time = ManagementFactory.getRuntimeMXBean().getStartTime();
-        return new Date(time);
-    }
-
-    /**
-     * 计算两个时间差
-     */
-    public static String getDatePoor(Date endDate, Date nowDate)
-    {
-        long nd = 1000 * 24 * 60 * 60;
-        long nh = 1000 * 60 * 60;
-        long nm = 1000 * 60;
-        // long ns = 1000;
-        // 获得两个时间的毫秒时间差异
-        long diff = endDate.getTime() - nowDate.getTime();
-        // 计算差多少天
-        long day = diff / nd;
-        // 计算差多少小时
-        long hour = diff % nd / nh;
-        // 计算差多少分钟
-        long min = diff % nd % nh / nm;
-        // 计算差多少秒//输出结果
-        // long sec = diff % nd % nh % nm / ns;
-        return day + "天" + hour + "小时" + min + "分钟";
-    }
-}

+ 0 - 40
dgtly-common/src/main/java/com/dgtly/common/utils/ExceptionUtil.java

@@ -1,40 +0,0 @@
-package com.dgtly.common.utils;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import org.apache.commons.lang3.exception.ExceptionUtils;
-
-/**
- * 错误信息处理类。
- *
- * @author ruoyi
- */
-public class ExceptionUtil
-{
-    /**
-     * 获取exception的详细错误信息。
-     */
-    public static String getExceptionMessage(Throwable e)
-    {
-        StringWriter sw = new StringWriter();
-        e.printStackTrace(new PrintWriter(sw, true));
-        String str = sw.toString();
-        return str;
-    }
-
-    public static String getRootErrorMseeage(Exception e)
-    {
-        Throwable root = ExceptionUtils.getRootCause(e);
-        root = (root == null ? e : root);
-        if (root == null)
-        {
-            return "";
-        }
-        String msg = root.getMessage();
-        if (msg == null)
-        {
-            return "null";
-        }
-        return StringUtils.defaultString(msg);
-    }
-}

+ 0 - 188
dgtly-common/src/main/java/com/dgtly/common/utils/IpUtils.java

@@ -1,188 +0,0 @@
-package com.dgtly.common.utils;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 获取IP方法
- * 
- * @author ruoyi
- */
-public class IpUtils
-{
-    public static String getIpAddr(HttpServletRequest request)
-    {
-        if (request == null)
-        {
-            return "unknown";
-        }
-        String ip = request.getHeader("x-forwarded-for");
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("Proxy-Client-IP");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("X-Forwarded-For");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("WL-Proxy-Client-IP");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getHeader("X-Real-IP");
-        }
-
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
-            ip = request.getRemoteAddr();
-        }
-
-        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
-    }
-
-    public static boolean internalIp(String ip)
-    {
-        byte[] addr = textToNumericFormatV4(ip);
-        return internalIp(addr) || "127.0.0.1".equals(ip);
-    }
-
-    private static boolean internalIp(byte[] addr)
-    {
-        if (StringUtils.isNull(addr) || addr.length < 2)
-        {
-            return true;
-        }
-        final byte b0 = addr[0];
-        final byte b1 = addr[1];
-        // 10.x.x.x/8
-        final byte SECTION_1 = 0x0A;
-        // 172.16.x.x/12
-        final byte SECTION_2 = (byte) 0xAC;
-        final byte SECTION_3 = (byte) 0x10;
-        final byte SECTION_4 = (byte) 0x1F;
-        // 192.168.x.x/16
-        final byte SECTION_5 = (byte) 0xC0;
-        final byte SECTION_6 = (byte) 0xA8;
-        switch (b0)
-        {
-            case SECTION_1:
-                return true;
-            case SECTION_2:
-                if (b1 >= SECTION_3 && b1 <= SECTION_4)
-                {
-                    return true;
-                }
-            case SECTION_5:
-                switch (b1)
-                {
-                    case SECTION_6:
-                        return true;
-                }
-            default:
-                return false;
-        }
-    }
-
-    /**
-     * 将IPv4地址转换成字节
-     * 
-     * @param text IPv4地址
-     * @return byte 字节
-     */
-    public static byte[] textToNumericFormatV4(String text)
-    {
-        if (text.length() == 0)
-        {
-            return null;
-        }
-
-        byte[] bytes = new byte[4];
-        String[] elements = text.split("\\.", -1);
-        try
-        {
-            long l;
-            int i;
-            switch (elements.length)
-            {
-                case 1:
-                    l = Long.parseLong(elements[0]);
-                    if ((l < 0L) || (l > 4294967295L))
-                        return null;
-                    bytes[0] = (byte) (int) (l >> 24 & 0xFF);
-                    bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF);
-                    bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
-                    bytes[3] = (byte) (int) (l & 0xFF);
-                    break;
-                case 2:
-                    l = Integer.parseInt(elements[0]);
-                    if ((l < 0L) || (l > 255L))
-                        return null;
-                    bytes[0] = (byte) (int) (l & 0xFF);
-                    l = Integer.parseInt(elements[1]);
-                    if ((l < 0L) || (l > 16777215L))
-                        return null;
-                    bytes[1] = (byte) (int) (l >> 16 & 0xFF);
-                    bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
-                    bytes[3] = (byte) (int) (l & 0xFF);
-                    break;
-                case 3:
-                    for (i = 0; i < 2; ++i)
-                    {
-                        l = Integer.parseInt(elements[i]);
-                        if ((l < 0L) || (l > 255L))
-                            return null;
-                        bytes[i] = (byte) (int) (l & 0xFF);
-                    }
-                    l = Integer.parseInt(elements[2]);
-                    if ((l < 0L) || (l > 65535L))
-                        return null;
-                    bytes[2] = (byte) (int) (l >> 8 & 0xFF);
-                    bytes[3] = (byte) (int) (l & 0xFF);
-                    break;
-                case 4:
-                    for (i = 0; i < 4; ++i)
-                    {
-                        l = Integer.parseInt(elements[i]);
-                        if ((l < 0L) || (l > 255L))
-                            return null;
-                        bytes[i] = (byte) (int) (l & 0xFF);
-                    }
-                    break;
-                default:
-                    return null;
-            }
-        }
-        catch (NumberFormatException e)
-        {
-            return null;
-        }
-        return bytes;
-    }
-
-    public static String getHostIp()
-    {
-        try
-        {
-            return InetAddress.getLocalHost().getHostAddress();
-        }
-        catch (UnknownHostException e)
-        {
-        }
-        return "127.0.0.1";
-    }
-
-    public static String getHostName()
-    {
-        try
-        {
-            return InetAddress.getLocalHost().getHostName();
-        }
-        catch (UnknownHostException e)
-        {
-        }
-        return "未知";
-    }
-}

+ 0 - 50
dgtly-common/src/main/java/com/dgtly/common/utils/MapDataUtil.java

@@ -1,50 +0,0 @@
-package com.ruoyi.common.utils;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Map通用处理方法
- * 
- * @author ruoyi
- */
-public class MapDataUtil
-{
-    public static Map<String, Object> convertDataMap(HttpServletRequest request)
-    {
-        Map<String, String[]> properties = request.getParameterMap();
-        Map<String, Object> returnMap = new HashMap<String, Object>();
-        Iterator<?> entries = properties.entrySet().iterator();
-        Map.Entry<?, ?> entry;
-        String name = "";
-        String value = "";
-        while (entries.hasNext())
-        {
-            entry = (Entry<?, ?>) entries.next();
-            name = (String) entry.getKey();
-            Object valueObj = entry.getValue();
-            if (null == valueObj)
-            {
-                value = "";
-            }
-            else if (valueObj instanceof String[])
-            {
-                String[] values = (String[]) valueObj;
-                for (int i = 0; i < values.length; i++)
-                {
-                    value = values[i] + ",";
-                }
-                value = value.substring(0, value.length() - 1);
-            }
-            else
-            {
-                value = valueObj.toString();
-            }
-            returnMap.put(name, value);
-        }
-        return returnMap;
-    }
-}

+ 0 - 26
dgtly-common/src/main/java/com/dgtly/common/utils/MessageUtils.java

@@ -1,26 +0,0 @@
-package com.dgtly.common.utils;
-
-import org.springframework.context.MessageSource;
-import org.springframework.context.i18n.LocaleContextHolder;
-import com.dgtly.common.utils.spring.SpringUtils;
-
-/**
- * 获取i18n资源文件
- * 
- * @author ruoyi
- */
-public class MessageUtils
-{
-    /**
-     * 根据消息键和参数 获取消息 委托给spring messageSource
-     *
-     * @param code 消息键
-     * @param args 参数
-     * @return 获取国际化翻译值
-     */
-    public static String message(String code, Object... args)
-    {
-        MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
-        return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
-    }
-}

+ 0 - 135
dgtly-common/src/main/java/com/dgtly/common/utils/ServletUtils.java

@@ -1,135 +0,0 @@
-package com.dgtly.common.utils;
-
-import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-import com.dgtly.common.core.text.Convert;
-
-/**
- * 客户端工具类
- * 
- * @author ruoyi
- */
-public class ServletUtils
-{
-    /**
-     * 获取String参数
-     */
-    public static String getParameter(String name)
-    {
-        return getRequest().getParameter(name);
-    }
-
-    /**
-     * 获取String参数
-     */
-    public static String getParameter(String name, String defaultValue)
-    {
-        return Convert.toStr(getRequest().getParameter(name), defaultValue);
-    }
-
-    /**
-     * 获取Integer参数
-     */
-    public static Integer getParameterToInt(String name)
-    {
-        return Convert.toInt(getRequest().getParameter(name));
-    }
-
-    /**
-     * 获取Integer参数
-     */
-    public static Integer getParameterToInt(String name, Integer defaultValue)
-    {
-        return Convert.toInt(getRequest().getParameter(name), defaultValue);
-    }
-
-    /**
-     * 获取request
-     */
-    public static HttpServletRequest getRequest()
-    {
-        return getRequestAttributes().getRequest();
-    }
-
-    /**
-     * 获取response
-     */
-    public static HttpServletResponse getResponse()
-    {
-        return getRequestAttributes().getResponse();
-    }
-
-    /**
-     * 获取session
-     */
-    public static HttpSession getSession()
-    {
-        return getRequest().getSession();
-    }
-
-    public static ServletRequestAttributes getRequestAttributes()
-    {
-        RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
-        return (ServletRequestAttributes) attributes;
-    }
-
-    /**
-     * 将字符串渲染到客户端
-     * 
-     * @param response 渲染对象
-     * @param string 待渲染的字符串
-     * @return null
-     */
-    public static String renderString(HttpServletResponse response, String string)
-    {
-        try
-        {
-            response.setContentType("application/json");
-            response.setCharacterEncoding("utf-8");
-            response.getWriter().print(string);
-        }
-        catch (IOException e)
-        {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    /**
-     * 是否是Ajax异步请求
-     * 
-     * @param request
-     */
-    public static boolean isAjaxRequest(HttpServletRequest request)
-    {
-        String accept = request.getHeader("accept");
-        if (accept != null && accept.indexOf("application/json") != -1)
-        {
-            return true;
-        }
-
-        String xRequestedWith = request.getHeader("X-Requested-With");
-        if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1)
-        {
-            return true;
-        }
-
-        String uri = request.getRequestURI();
-        if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml"))
-        {
-            return true;
-        }
-
-        String ajax = request.getParameter("__ajax");
-        if (StringUtils.inStringIgnoreCase(ajax, "json", "xml"))
-        {
-            return true;
-        }
-        return false;
-    }
-}

+ 0 - 398
dgtly-common/src/main/java/com/dgtly/common/utils/StringUtils.java

@@ -1,398 +0,0 @@
-package com.dgtly.common.utils;
-
-import java.util.Collection;
-import java.util.Map;
-import com.dgtly.common.core.text.StrFormatter;
-
-/**
- * 字符串工具类
- * 
- * @author ruoyi
- */
-public class StringUtils extends org.apache.commons.lang3.StringUtils
-{
-    /** 空字符串 */
-    private static final String NULLSTR = "";
-
-    /** 下划线 */
-    private static final char SEPARATOR = '_';
-
-    /**
-     * 获取参数不为空值
-     * 
-     * @param value defaultValue 要判断的value
-     * @return value 返回值
-     */
-    public static <T> T nvl(T value, T defaultValue)
-    {
-        return value != null ? value : defaultValue;
-    }
-
-    /**
-     * * 判断一个Collection是否为空, 包含List,Set,Queue
-     * 
-     * @param coll 要判断的Collection
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Collection<?> coll)
-    {
-        return isNull(coll) || coll.isEmpty();
-    }
-
-    /**
-     * * 判断一个Collection是否非空,包含List,Set,Queue
-     * 
-     * @param coll 要判断的Collection
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Collection<?> coll)
-    {
-        return !isEmpty(coll);
-    }
-
-    /**
-     * * 判断一个对象数组是否为空
-     * 
-     * @param objects 要判断的对象数组
-     ** @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Object[] objects)
-    {
-        return isNull(objects) || (objects.length == 0);
-    }
-
-    /**
-     * * 判断一个对象数组是否非空
-     * 
-     * @param objects 要判断的对象数组
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Object[] objects)
-    {
-        return !isEmpty(objects);
-    }
-
-    /**
-     * * 判断一个Map是否为空
-     * 
-     * @param map 要判断的Map
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Map<?, ?> map)
-    {
-        return isNull(map) || map.isEmpty();
-    }
-
-    /**
-     * * 判断一个Map是否为空
-     * 
-     * @param map 要判断的Map
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Map<?, ?> map)
-    {
-        return !isEmpty(map);
-    }
-
-    /**
-     * * 判断一个字符串是否为空串
-     * 
-     * @param str String
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(String str)
-    {
-        return isNull(str) || NULLSTR.equals(str.trim());
-    }
-
-    /**
-     * * 判断一个字符串是否为非空串
-     * 
-     * @param str String
-     * @return true:非空串 false:空串
-     */
-    public static boolean isNotEmpty(String str)
-    {
-        return !isEmpty(str);
-    }
-
-    /**
-     * * 判断一个对象是否为空
-     * 
-     * @param object Object
-     * @return true:为空 false:非空
-     */
-    public static boolean isNull(Object object)
-    {
-        return object == null;
-    }
-
-    /**
-     * * 判断一个对象是否非空
-     * 
-     * @param object Object
-     * @return true:非空 false:空
-     */
-    public static boolean isNotNull(Object object)
-    {
-        return !isNull(object);
-    }
-
-    /**
-     * * 判断一个对象是否是数组类型(Java基本型别的数组)
-     * 
-     * @param object 对象
-     * @return true:是数组 false:不是数组
-     */
-    public static boolean isArray(Object object)
-    {
-        return isNotNull(object) && object.getClass().isArray();
-    }
-
-    /**
-     * 去空格
-     */
-    public static String trim(String str)
-    {
-        return (str == null ? "" : str.trim());
-    }
-
-    /**
-     * 截取字符串
-     * 
-     * @param str 字符串
-     * @param start 开始
-     * @return 结果
-     */
-    public static String substring(final String str, int start)
-    {
-        if (str == null)
-        {
-            return NULLSTR;
-        }
-
-        if (start < 0)
-        {
-            start = str.length() + start;
-        }
-
-        if (start < 0)
-        {
-            start = 0;
-        }
-        if (start > str.length())
-        {
-            return NULLSTR;
-        }
-
-        return str.substring(start);
-    }
-
-    /**
-     * 截取字符串
-     * 
-     * @param str 字符串
-     * @param start 开始
-     * @param end 结束
-     * @return 结果
-     */
-    public static String substring(final String str, int start, int end)
-    {
-        if (str == null)
-        {
-            return NULLSTR;
-        }
-
-        if (end < 0)
-        {
-            end = str.length() + end;
-        }
-        if (start < 0)
-        {
-            start = str.length() + start;
-        }
-
-        if (end > str.length())
-        {
-            end = str.length();
-        }
-
-        if (start > end)
-        {
-            return NULLSTR;
-        }
-
-        if (start < 0)
-        {
-            start = 0;
-        }
-        if (end < 0)
-        {
-            end = 0;
-        }
-
-        return str.substring(start, end);
-    }
-
-    /**
-     * 格式化文本, {} 表示占位符<br>
-     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
-     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
-     * 例:<br>
-     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
-     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
-     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
-     * 
-     * @param template 文本模板,被替换的部分用 {} 表示
-     * @param params 参数值
-     * @return 格式化后的文本
-     */
-    public static String format(String template, Object... params)
-    {
-        if (isEmpty(params) || isEmpty(template))
-        {
-            return template;
-        }
-        return StrFormatter.format(template, params);
-    }
-
-    /**
-     * 下划线转驼峰命名
-     */
-    public static String toUnderScoreCase(String str)
-    {
-        if (str == null)
-        {
-            return null;
-        }
-        StringBuilder sb = new StringBuilder();
-        // 前置字符是否大写
-        boolean preCharIsUpperCase = true;
-        // 当前字符是否大写
-        boolean curreCharIsUpperCase = true;
-        // 下一字符是否大写
-        boolean nexteCharIsUpperCase = true;
-        for (int i = 0; i < str.length(); i++)
-        {
-            char c = str.charAt(i);
-            if (i > 0)
-            {
-                preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
-            }
-            else
-            {
-                preCharIsUpperCase = false;
-            }
-
-            curreCharIsUpperCase = Character.isUpperCase(c);
-
-            if (i < (str.length() - 1))
-            {
-                nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
-            }
-
-            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
-            {
-                sb.append(SEPARATOR);
-            }
-            else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
-            {
-                sb.append(SEPARATOR);
-            }
-            sb.append(Character.toLowerCase(c));
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * 是否包含字符串
-     * 
-     * @param str 验证字符串
-     * @param strs 字符串组
-     * @return 包含返回true
-     */
-    public static boolean inStringIgnoreCase(String str, String... strs)
-    {
-        if (str != null && strs != null)
-        {
-            for (String s : strs)
-            {
-                if (str.equalsIgnoreCase(trim(s)))
-                {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
-     * 
-     * @param name 转换前的下划线大写方式命名的字符串
-     * @return 转换后的驼峰式命名的字符串
-     */
-    public static String convertToCamelCase(String name)
-    {
-        StringBuilder result = new StringBuilder();
-        // 快速检查
-        if (name == null || name.isEmpty())
-        {
-            // 没必要转换
-            return "";
-        }
-        else if (!name.contains("_"))
-        {
-            // 不含下划线,仅将首字母大写
-            return name.substring(0, 1).toUpperCase() + name.substring(1);
-        }
-        // 用下划线将原始字符串分割
-        String[] camels = name.split("_");
-        for (String camel : camels)
-        {
-            // 跳过原始字符串中开头、结尾的下换线或双重下划线
-            if (camel.isEmpty())
-            {
-                continue;
-            }
-            // 首字母大写
-            result.append(camel.substring(0, 1).toUpperCase());
-            result.append(camel.substring(1).toLowerCase());
-        }
-        return result.toString();
-    }
-
-    /**
-     * 驼峰式命名法 例如:user_name->userName
-     */
-    public static String toCamelCase(String s)
-    {
-        if (s == null)
-        {
-            return null;
-        }
-        s = s.toLowerCase();
-        StringBuilder sb = new StringBuilder(s.length());
-        boolean upperCase = false;
-        for (int i = 0; i < s.length(); i++)
-        {
-            char c = s.charAt(i);
-
-            if (c == SEPARATOR)
-            {
-                upperCase = true;
-            }
-            else if (upperCase)
-            {
-                sb.append(Character.toUpperCase(c));
-                upperCase = false;
-            }
-            else
-            {
-                sb.append(c);
-            }
-        }
-        return sb.toString();
-    }
-}

+ 0 - 99
dgtly-common/src/main/java/com/dgtly/common/utils/Threads.java

@@ -1,99 +0,0 @@
-package com.dgtly.common.utils;
-
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 线程相关工具类.
- * 
- * @author ruoyi
- */
-public class Threads
-{
-    private static final Logger logger = LoggerFactory.getLogger(Threads.class);
-
-    /**
-     * sleep等待,单位为毫秒
-     */
-    public static void sleep(long milliseconds)
-    {
-        try
-        {
-            Thread.sleep(milliseconds);
-        }
-        catch (InterruptedException e)
-        {
-            return;
-        }
-    }
-
-    /**
-     * 停止线程池
-     * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
-     * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
-     * 如果仍人超時,則強制退出.
-     * 另对在shutdown时线程本身被调用中断做了处理.
-     */
-    public static void shutdownAndAwaitTermination(ExecutorService pool)
-    {
-        if (pool != null && !pool.isShutdown())
-        {
-            pool.shutdown();
-            try
-            {
-                if (!pool.awaitTermination(120, TimeUnit.SECONDS))
-                {
-                    pool.shutdownNow();
-                    if (!pool.awaitTermination(120, TimeUnit.SECONDS))
-                    {
-                        logger.info("Pool did not terminate");
-                    }
-                }
-            }
-            catch (InterruptedException ie)
-            {
-                pool.shutdownNow();
-                Thread.currentThread().interrupt();
-            }
-        }
-    }
-
-    /**
-     * 打印线程异常信息
-     */
-    public static void printException(Runnable r, Throwable t)
-    {
-        if (t == null && r instanceof Future<?>)
-        {
-            try
-            {
-                Future<?> future = (Future<?>) r;
-                if (future.isDone())
-                {
-                    future.get();
-                }
-            }
-            catch (CancellationException ce)
-            {
-                t = ce;
-            }
-            catch (ExecutionException ee)
-            {
-                t = ee.getCause();
-            }
-            catch (InterruptedException ie)
-            {
-                Thread.currentThread().interrupt();
-            }
-        }
-        if (t != null)
-        {
-            logger.error(t.getMessage(), t);
-        }
-    }
-}

+ 0 - 110
dgtly-common/src/main/java/com/dgtly/common/utils/bean/BeanUtils.java

@@ -1,110 +0,0 @@
-package com.dgtly.common.utils.bean;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Bean 工具类
- * 
- * @author ruoyi
- */
-public class BeanUtils extends org.springframework.beans.BeanUtils
-{
-    /** Bean方法名中属性名开始的下标 */
-    private static final int BEAN_METHOD_PROP_INDEX = 3;
-
-    /** * 匹配getter方法的正则表达式 */
-    private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
-
-    /** * 匹配setter方法的正则表达式 */
-    private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
-
-    /**
-     * Bean属性复制工具方法。
-     * 
-     * @param dest 目标对象
-     * @param src 源对象
-     */
-    public static void copyBeanProp(Object dest, Object src)
-    {
-        try
-        {
-            copyProperties(src, dest);
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * 获取对象的setter方法。
-     * 
-     * @param obj 对象
-     * @return 对象的setter方法列表
-     */
-    public static List<Method> getSetterMethods(Object obj)
-    {
-        // setter方法列表
-        List<Method> setterMethods = new ArrayList<Method>();
-
-        // 获取所有方法
-        Method[] methods = obj.getClass().getMethods();
-
-        // 查找setter方法
-
-        for (Method method : methods)
-        {
-            Matcher m = SET_PATTERN.matcher(method.getName());
-            if (m.matches() && (method.getParameterTypes().length == 1))
-            {
-                setterMethods.add(method);
-            }
-        }
-        // 返回setter方法列表
-        return setterMethods;
-    }
-
-    /**
-     * 获取对象的getter方法。
-     * 
-     * @param obj 对象
-     * @return 对象的getter方法列表
-     */
-
-    public static List<Method> getGetterMethods(Object obj)
-    {
-        // getter方法列表
-        List<Method> getterMethods = new ArrayList<Method>();
-        // 获取所有方法
-        Method[] methods = obj.getClass().getMethods();
-        // 查找getter方法
-        for (Method method : methods)
-        {
-            Matcher m = GET_PATTERN.matcher(method.getName());
-            if (m.matches() && (method.getParameterTypes().length == 0))
-            {
-                getterMethods.add(method);
-            }
-        }
-        // 返回getter方法列表
-        return getterMethods;
-    }
-
-    /**
-     * 检查Bean方法名中的属性名是否相等。<br>
-     * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
-     * 
-     * @param m1 方法名1
-     * @param m2 方法名2
-     * @return 属性名一样返回true,否则返回false
-     */
-
-    public static boolean isMethodPropEquals(String m1, String m2)
-    {
-        return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
-    }
-}

+ 0 - 291
dgtly-common/src/main/java/com/dgtly/common/utils/file/FileUploadUtils.java

@@ -1,291 +0,0 @@
-package com.dgtly.common.utils.file;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.util.Base64;
-
-import org.apache.commons.io.FilenameUtils;
-import org.springframework.web.multipart.MultipartFile;
-import com.dgtly.common.config.Global;
-import com.dgtly.common.constant.Constants;
-import com.dgtly.common.exception.file.FileNameLengthLimitExceededException;
-import com.dgtly.common.exception.file.FileSizeLimitExceededException;
-import com.dgtly.common.exception.file.InvalidExtensionException;
-import com.dgtly.common.utils.DateUtils;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.security.Md5Utils;
-
-/**
- * 文件上传工具类
- * 
- * @author ruoyi
- */
-public class FileUploadUtils
-{
-    /**
-     * 默认大小 50M
-     */
-    public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
-
-    /**
-     * 默认的文件名最大长度 100
-     */
-    public static final int DEFAULT_FILE_NAME_LENGTH = 100;
-
-    /**
-     * 默认上传的地址
-     */
-    private static String defaultBaseDir = Global.getProfile();
-
-    private static int counter = 0;
-
-    public static void setDefaultBaseDir(String defaultBaseDir)
-    {
-        FileUploadUtils.defaultBaseDir = defaultBaseDir;
-    }
-
-    public static String getDefaultBaseDir()
-    {
-        return defaultBaseDir;
-    }
-
-    /**
-     * 以默认配置进行文件上传
-     *
-     * @param file 上传的文件
-     * @return 文件名称
-     * @throws Exception
-     */
-    public static final String upload(MultipartFile file) throws IOException
-    {
-        try
-        {
-            return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
-        }
-        catch (Exception e)
-        {
-            throw new IOException(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * 根据文件路径上传
-     *
-     * @param baseDir 相对应用的基目录
-     * @param file 上传的文件
-     * @return 文件名称
-     * @throws IOException
-     */
-    public static final String upload(String baseDir, MultipartFile file) throws IOException
-    {
-        try
-        {
-            return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
-        }
-        catch (Exception e)
-        {
-            throw new IOException(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * 文件上传
-     *
-     * @param baseDir 相对应用的基目录
-     * @param file 上传的文件
-     * @return 返回上传成功的文件名
-     * @throws FileSizeLimitExceededException 如果超出最大大小
-     * @throws FileNameLengthLimitExceededException 文件名太长
-     * @throws IOException 比如读写文件出错时
-     * @throws InvalidExtensionException 文件校验异常
-     */
-    public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
-            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
-            InvalidExtensionException
-    {
-        int fileNamelength = file.getOriginalFilename().length();
-        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
-        {
-            throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
-        }
-
-        assertAllowed(file, allowedExtension);
-
-        String fileName = extractFilename(file);
-
-        File desc = getAbsoluteFile(baseDir, fileName);
-        file.transferTo(desc);
-        String pathFileName = getPathFileName(baseDir, fileName);
-        return pathFileName;
-    }
-
-    /**
-     * 编码文件名
-     */
-    public static final String extractFilename(MultipartFile file)
-    {
-        String fileName = file.getOriginalFilename();
-        String extension = getExtension(file);
-        fileName = DateUtils.datePath() + "/" + encodingFilename(fileName) + "." + extension;
-        return fileName;
-    }
-
-    private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
-    {
-        File desc = new File(uploadDir + File.separator + fileName);
-
-        if (!desc.getParentFile().exists())
-        {
-            desc.getParentFile().mkdirs();
-        }
-        if (!desc.exists())
-        {
-            desc.createNewFile();
-        }
-        return desc;
-    }
-
-    private static final String getPathFileName(String uploadDir, String fileName) throws IOException
-    {
-        int dirLastIndex = uploadDir.lastIndexOf("/") + 1;
-        String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
-        String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
-        return pathFileName;
-    }
-
-    /**
-     * 编码文件名
-     */
-    private static final String encodingFilename(String fileName)
-    {
-        fileName = fileName.replace("_", " ");
-        fileName = Md5Utils.hash(fileName + System.nanoTime() + counter++);
-        return fileName;
-    }
-
-    /**
-     * 文件大小校验
-     *
-     * @param file 上传的文件
-     * @return
-     * @throws FileSizeLimitExceededException 如果超出最大大小
-     * @throws InvalidExtensionException
-     */
-    public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
-            throws FileSizeLimitExceededException, InvalidExtensionException
-    {
-        long size = file.getSize();
-        if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
-        {
-            throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
-        }
-
-        String fileName = file.getOriginalFilename();
-        String extension = getExtension(file);
-        if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
-        {
-            if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
-            {
-                throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
-                        fileName);
-            }
-            else
-            {
-                throw new InvalidExtensionException(allowedExtension, extension, fileName);
-            }
-        }
-
-    }
-
-    /**
-     * 判断MIME类型是否是允许的MIME类型
-     *
-     * @param extension
-     * @param allowedExtension
-     * @return
-     */
-    public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
-    {
-        for (String str : allowedExtension)
-        {
-            if (str.equalsIgnoreCase(extension))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 获取文件名的后缀
-     * 
-     * @param file 表单文件
-     * @return 后缀名
-     */
-    public static final String getExtension(MultipartFile file)
-    {
-        String extension = FilenameUtils.getExtension(file.getOriginalFilename());
-        if (StringUtils.isEmpty(extension))
-        {
-            extension = MimeTypeUtils.getExtension(file.getContentType());
-        }
-        return extension;
-    }
-
-    public static String base64ToFile(String base64,String uploadPath,String fileName)//D:/dgtly/uploadPath/content  111.png
-    {
-
-        File file = null;
-        System.out.println("文件名称:"+fileName);
-        //创建文件目录
-        String filePath=uploadPath + "/" + DateUtils.datePath() + "/";
-        File  dir=new File(filePath);
-        if (!dir.exists() && !dir.isDirectory()) {
-            dir.mkdirs();
-        }
-        BufferedOutputStream bos = null;
-        java.io.FileOutputStream fos = null;
-        try {
-            byte[] bytes = Base64.getDecoder().decode(base64);
-            file=new File(filePath+fileName);
-            fos = new java.io.FileOutputStream(file);
-            bos = new BufferedOutputStream(fos);
-            bos.write(bytes);
-            //   //D:/dgtly/uploadPath/content/2019/10/31/
-            int dirLastIndex = uploadPath.lastIndexOf("/") + 1;
-            String currentDir = StringUtils.substring(uploadPath, dirLastIndex);
-            currentDir = currentDir +"/"+ DateUtils.datePath();
-            String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
-            return pathFileName;
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            if (bos != null) {
-                try {
-                    bos.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return null;
-    }
-}

+ 0 - 143
dgtly-common/src/main/java/com/dgtly/common/utils/file/FileUtils.java

@@ -1,143 +0,0 @@
-package com.dgtly.common.utils.file;
-
-import java.io.*;
-import java.net.URLEncoder;
-import java.util.Base64;
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 文件处理工具类
- * 
- * @author ruoyi
- */
-public class FileUtils
-{
-    public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
-
-    /**
-     * 输出指定文件的byte数组
-     * 
-     * @param filePath 文件路径
-     * @param os 输出流
-     * @return
-     */
-    public static void writeBytes(String filePath, OutputStream os) throws IOException
-    {
-        FileInputStream fis = null;
-        try
-        {
-            File file = new File(filePath);
-            if (!file.exists())
-            {
-                throw new FileNotFoundException(filePath);
-            }
-            fis = new FileInputStream(file);
-            byte[] b = new byte[1024];
-            int length;
-            while ((length = fis.read(b)) > 0)
-            {
-                os.write(b, 0, length);
-            }
-        }
-        catch (IOException e)
-        {
-            throw e;
-        }
-        finally
-        {
-            if (os != null)
-            {
-                try
-                {
-                    os.close();
-                }
-                catch (IOException e1)
-                {
-                    e1.printStackTrace();
-                }
-            }
-            if (fis != null)
-            {
-                try
-                {
-                    fis.close();
-                }
-                catch (IOException e1)
-                {
-                    e1.printStackTrace();
-                }
-            }
-        }
-    }
-
-    /**
-     * 删除文件
-     * 
-     * @param filePath 文件
-     * @return
-     */
-    public static boolean deleteFile(String filePath)
-    {
-        boolean flag = false;
-        File file = new File(filePath);
-        // 路径为文件且不为空则进行删除
-        if (file.isFile() && file.exists())
-        {
-            file.delete();
-            flag = true;
-        }
-        return flag;
-    }
-
-    /**
-     * 文件名称验证
-     * 
-     * @param filename 文件名称
-     * @return true 正常 false 非法
-     */
-    public static boolean isValidFilename(String filename)
-    {
-        return filename.matches(FILENAME_PATTERN);
-    }
-
-    /**
-     * 下载文件名重新编码
-     * 
-     * @param request 请求对象
-     * @param fileName 文件名
-     * @return 编码后的文件名
-     */
-    public static String setFileDownloadHeader(HttpServletRequest request, String fileName)
-            throws UnsupportedEncodingException
-    {
-        final String agent = request.getHeader("USER-AGENT");
-        String filename = fileName;
-        if (agent.contains("MSIE"))
-        {
-            // IE浏览器
-            filename = URLEncoder.encode(filename, "utf-8");
-            filename = filename.replace("+", " ");
-        }
-        else if (agent.contains("Firefox"))
-        {
-            // 火狐浏览器
-            filename = new String(fileName.getBytes(), "ISO8859-1");
-        }
-        else if (agent.contains("Chrome"))
-        {
-            // google浏览器
-            filename = URLEncoder.encode(filename, "utf-8");
-        }
-        else
-        {
-            // 其它浏览器
-            filename = URLEncoder.encode(filename, "utf-8");
-        }
-        return filename;
-    }
-
-
-
-
-
-}

+ 0 - 55
dgtly-common/src/main/java/com/dgtly/common/utils/file/MimeTypeUtils.java

@@ -1,55 +0,0 @@
-package com.dgtly.common.utils.file;
-
-/**
- * 媒体类型工具类
- * 
- * @author ruoyi
- */
-public class MimeTypeUtils
-{
-    public static final String IMAGE_PNG = "image/png";
-
-    public static final String IMAGE_JPG = "image/jpg";
-
-    public static final String IMAGE_JPEG = "image/jpeg";
-
-    public static final String IMAGE_BMP = "image/bmp";
-
-    public static final String IMAGE_GIF = "image/gif";
-    
-    public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };
-
-    public static final String[] FLASH_EXTENSION = { "swf", "flv" };
-
-    public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
-            "asf", "rm", "rmvb" };
-
-    public static final String[] DEFAULT_ALLOWED_EXTENSION = {
-            // 图片
-            "bmp", "gif", "jpg", "jpeg", "png",
-            // word excel powerpoint
-            "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
-            // 压缩文件
-            "rar", "zip", "gz", "bz2",
-            // pdf
-            "pdf" };
-
-    public static String getExtension(String prefix)
-    {
-        switch (prefix)
-        {
-            case IMAGE_PNG:
-                return "png";
-            case IMAGE_JPG:
-                return "jpg";
-            case IMAGE_JPEG:
-                return "jpeg";
-            case IMAGE_BMP:
-                return "bmp";
-            case IMAGE_GIF:
-                return "gif";
-            default:
-                return "";
-        }
-    }
-}

+ 0 - 152
dgtly-common/src/main/java/com/dgtly/common/utils/html/EscapeUtil.java

@@ -1,152 +0,0 @@
-package com.dgtly.common.utils.html;
-
-import com.dgtly.common.utils.StringUtils;
-
-/**
- * 转义和反转义工具类
- * 
- * @author ruoyi
- */
-public class EscapeUtil
-{
-    public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
-
-    private static final char[][] TEXT = new char[64][];
-
-    static
-    {
-        for (int i = 0; i < 64; i++)
-        {
-            TEXT[i] = new char[] { (char) i };
-        }
-
-        // special HTML characters
-        TEXT['\''] = "&#039;".toCharArray(); // 单引号
-        TEXT['"'] = "&#34;".toCharArray(); // 单引号
-        TEXT['&'] = "&#38;".toCharArray(); // &符
-        TEXT['<'] = "&#60;".toCharArray(); // 小于号
-        TEXT['>'] = "&#62;".toCharArray(); // 大于号
-    }
-
-    /**
-     * 转义文本中的HTML字符为安全的字符
-     * 
-     * @param text 被转义的文本
-     * @return 转义后的文本
-     */
-    public static String escape(String text)
-    {
-        return encode(text);
-    }
-
-    /**
-     * 还原被转义的HTML特殊字符
-     * 
-     * @param content 包含转义符的HTML内容
-     * @return 转换后的字符串
-     */
-    public static String unescape(String content)
-    {
-        return decode(content);
-    }
-
-    /**
-     * 清除所有HTML标签,但是不删除标签内的内容
-     * 
-     * @param content 文本
-     * @return 清除标签后的文本
-     */
-    public static String clean(String content)
-    {
-        return content.replaceAll(RE_HTML_MARK, "");
-    }
-
-    /**
-     * Escape编码
-     * 
-     * @param text 被编码的文本
-     * @return 编码后的字符
-     */
-    private static String encode(String text)
-    {
-        int len;
-        if ((text == null) || ((len = text.length()) == 0))
-        {
-            return StringUtils.EMPTY;
-        }
-        StringBuilder buffer = new StringBuilder(len + (len >> 2));
-        char c;
-        for (int i = 0; i < len; i++)
-        {
-            c = text.charAt(i);
-            if (c < 64)
-            {
-                buffer.append(TEXT[c]);
-            }
-            else
-            {
-                buffer.append(c);
-            }
-        }
-        return buffer.toString();
-    }
-
-    /**
-     * Escape解码
-     * 
-     * @param content 被转义的内容
-     * @return 解码后的字符串
-     */
-    public static String decode(String content)
-    {
-        if (StringUtils.isEmpty(content))
-        {
-            return content;
-        }
-
-        StringBuilder tmp = new StringBuilder(content.length());
-        int lastPos = 0, pos = 0;
-        char ch;
-        while (lastPos < content.length())
-        {
-            pos = content.indexOf("%", lastPos);
-            if (pos == lastPos)
-            {
-                if (content.charAt(pos + 1) == 'u')
-                {
-                    ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16);
-                    tmp.append(ch);
-                    lastPos = pos + 6;
-                }
-                else
-                {
-                    ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16);
-                    tmp.append(ch);
-                    lastPos = pos + 3;
-                }
-            }
-            else
-            {
-                if (pos == -1)
-                {
-                    tmp.append(content.substring(lastPos));
-                    lastPos = content.length();
-                }
-                else
-                {
-                    tmp.append(content.substring(lastPos, pos));
-                    lastPos = pos;
-                }
-            }
-        }
-        return tmp.toString();
-    }
-
-    public static void main(String[] args)
-    {
-        String html = "<script>alert(1);</script>";
-        System.out.println(EscapeUtil.clean(html));
-        System.out.println(EscapeUtil.escape(html));
-        System.out.println(EscapeUtil.unescape(html));
-    }
-}

+ 0 - 248
dgtly-common/src/main/java/com/dgtly/common/utils/http/HttpUtils.java

@@ -1,248 +0,0 @@
-package com.dgtly.common.utils.http;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.ConnectException;
-import java.net.SocketTimeoutException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.cert.X509Certificate;
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 通用http发送方法
- * 
- * @author ruoyi
- */
-public class HttpUtils
-{
-    private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
-
-    /**
-     * 向指定 URL 发送GET方法的请求
-     *
-     * @param url 发送请求的 URL
-     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
-     * @return 所代表远程资源的响应结果
-     */
-    public static String sendGet(String url, String param)
-    {
-        StringBuilder result = new StringBuilder();
-        BufferedReader in = null;
-        try
-        {
-            String urlNameString = url + "?" + param;
-            log.info("sendGet - {}", urlNameString);
-            URL realUrl = new URL(urlNameString);
-            URLConnection connection = realUrl.openConnection();
-            connection.setRequestProperty("accept", "*/*");
-            connection.setRequestProperty("connection", "Keep-Alive");
-            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
-            connection.connect();
-            in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-            String line;
-            while ((line = in.readLine()) != null)
-            {
-                result.append(line);
-            }
-            log.info("recv - {}", result);
-        }
-        catch (ConnectException e)
-        {
-            log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
-        }
-        catch (SocketTimeoutException e)
-        {
-            log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
-        }
-        catch (IOException e)
-        {
-            log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
-        }
-        catch (Exception e)
-        {
-            log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
-        }
-        finally
-        {
-            try
-            {
-                if (in != null)
-                {
-                    in.close();
-                }
-            }
-            catch (Exception ex)
-            {
-                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
-            }
-        }
-        return result.toString();
-    }
-
-    /**
-     * 向指定 URL 发送POST方法的请求
-     *
-     * @param url 发送请求的 URL
-     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
-     * @return 所代表远程资源的响应结果
-     */
-    public static String sendPost(String url, String param)
-    {
-        PrintWriter out = null;
-        BufferedReader in = null;
-        StringBuilder result = new StringBuilder();
-        try
-        {
-            String urlNameString = url + "?" + param;
-            log.info("sendPost - {}", urlNameString);
-            URL realUrl = new URL(urlNameString);
-            URLConnection conn = realUrl.openConnection();
-            conn.setRequestProperty("accept", "*/*");
-            conn.setRequestProperty("connection", "Keep-Alive");
-            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
-            conn.setRequestProperty("Accept-Charset", "utf-8");
-            conn.setRequestProperty("contentType", "utf-8");
-            conn.setDoOutput(true);
-            conn.setDoInput(true);
-            out = new PrintWriter(conn.getOutputStream());
-            out.print(param);
-            out.flush();
-            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
-            String line;
-            while ((line = in.readLine()) != null)
-            {
-                result.append(line);
-            }
-            log.info("recv - {}", result);
-        }
-        catch (ConnectException e)
-        {
-            log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
-        }
-        catch (SocketTimeoutException e)
-        {
-            log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
-        }
-        catch (IOException e)
-        {
-            log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
-        }
-        catch (Exception e)
-        {
-            log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
-        }
-        finally
-        {
-            try
-            {
-                if (out != null)
-                {
-                    out.close();
-                }
-                if (in != null)
-                {
-                    in.close();
-                }
-            }
-            catch (IOException ex)
-            {
-                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
-            }
-        }
-        return result.toString();
-    }
-
-    public static String sendSSLPost(String url, String param)
-    {
-        StringBuilder result = new StringBuilder();
-        String urlNameString = url + "?" + param;
-        try
-        {
-            log.info("sendSSLPost - {}", urlNameString);
-            SSLContext sc = SSLContext.getInstance("SSL");
-            sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
-            URL console = new URL(urlNameString);
-            HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
-            conn.setRequestProperty("accept", "*/*");
-            conn.setRequestProperty("connection", "Keep-Alive");
-            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
-            conn.setRequestProperty("Accept-Charset", "utf-8");
-            conn.setRequestProperty("contentType", "utf-8");
-            conn.setDoOutput(true);
-            conn.setDoInput(true);
-
-            conn.setSSLSocketFactory(sc.getSocketFactory());
-            conn.setHostnameVerifier(new TrustAnyHostnameVerifier());
-            conn.connect();
-            InputStream is = conn.getInputStream();
-            BufferedReader br = new BufferedReader(new InputStreamReader(is));
-            String ret = "";
-            while ((ret = br.readLine()) != null)
-            {
-                if (ret != null && !ret.trim().equals(""))
-                {
-                    result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8"));
-                }
-            }
-            log.info("recv - {}", result);
-            conn.disconnect();
-            br.close();
-        }
-        catch (ConnectException e)
-        {
-            log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
-        }
-        catch (SocketTimeoutException e)
-        {
-            log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
-        }
-        catch (IOException e)
-        {
-            log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
-        }
-        catch (Exception e)
-        {
-            log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
-        }
-        return result.toString();
-    }
-
-    private static class TrustAnyTrustManager implements X509TrustManager
-    {
-        @Override
-        public void checkClientTrusted(X509Certificate[] chain, String authType)
-        {
-        }
-
-        @Override
-        public void checkServerTrusted(X509Certificate[] chain, String authType)
-        {
-        }
-
-        @Override
-        public X509Certificate[] getAcceptedIssuers()
-        {
-            return new X509Certificate[] {};
-        }
-    }
-
-    private static class TrustAnyHostnameVerifier implements HostnameVerifier
-    {
-        @Override
-        public boolean verify(String hostname, SSLSession session)
-        {
-            return true;
-        }
-    }
-}

+ 0 - 872
dgtly-common/src/main/java/com/dgtly/common/utils/poi/ExcelUtil.java

@@ -1,872 +0,0 @@
-package com.dgtly.common.utils.poi;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-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;
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
-import org.apache.poi.ss.usermodel.BorderStyle;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.DataValidation;
-import org.apache.poi.ss.usermodel.DataValidationConstraint;
-import org.apache.poi.ss.usermodel.DataValidationHelper;
-import org.apache.poi.ss.usermodel.DateUtil;
-import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.VerticalAlignment;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.usermodel.WorkbookFactory;
-import org.apache.poi.ss.util.CellRangeAddressList;
-import org.apache.poi.xssf.streaming.SXSSFWorkbook;
-import org.apache.poi.xssf.usermodel.XSSFDataValidation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.dgtly.common.annotation.Excel;
-import com.dgtly.common.annotation.Excel.ColumnType;
-import com.dgtly.common.annotation.Excel.Type;
-import com.dgtly.common.annotation.Excels;
-import com.dgtly.common.config.Global;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.text.Convert;
-import com.dgtly.common.exception.BusinessException;
-import com.dgtly.common.utils.DateUtils;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.reflect.ReflectUtils;
-
-/**
- * Excel相关处理
- * 
- * @author ruoyi
- */
-public class ExcelUtil<T>
-{
-    private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);
-
-    /**
-     * Excel sheet最大行数,默认65536
-     */
-    public static final int sheetSize = 65536;
-
-    /**
-     * 工作表名称
-     */
-    private String sheetName;
-
-    /**
-     * 导出类型(EXPORT:导出数据;IMPORT:导入模板)
-     */
-    private Type type;
-
-    /**
-     * 工作薄对象
-     */
-    private Workbook wb;
-
-    /**
-     * 工作表对象
-     */
-    private Sheet sheet;
-
-    /**
-     * 样式列表
-     */
-    private Map<String, CellStyle> styles;
-
-    /**
-     * 导入导出数据列表
-     */
-    private List<T> list;
-
-    /**
-     * 注解列表
-     */
-    private List<Object[]> fields;
-
-    /**
-     * 实体对象
-     */
-    public Class<T> clazz;
-
-    public ExcelUtil(Class<T> clazz)
-    {
-        this.clazz = clazz;
-    }
-
-    public void init(List<T> list, String sheetName, Type type)
-    {
-        if (list == null)
-        {
-            list = new ArrayList<T>();
-        }
-        this.list = list;
-        this.sheetName = sheetName;
-        this.type = type;
-        createExcelField();
-        createWorkbook();
-    }
-
-    /**
-     * 对excel表单默认第一个索引名转换成list
-     * 
-     * @param is 输入流
-     * @return 转换后集合
-     */
-    public List<T> importExcel(InputStream is) throws Exception
-    {
-        return importExcel(StringUtils.EMPTY, is);
-    }
-
-    /**
-     * 对excel表单指定表格索引名转换成list
-     * 
-     * @param sheetName 表格索引名
-     * @param is 输入流
-     * @return 转换后集合
-     */
-    public List<T> importExcel(String sheetName, InputStream is) throws Exception
-    {
-        this.type = Type.IMPORT;
-        this.wb = WorkbookFactory.create(is);
-        List<T> list = new ArrayList<T>();
-        Sheet sheet = null;
-        if (StringUtils.isNotEmpty(sheetName))
-        {
-            // 如果指定sheet名,则取指定sheet中的内容.
-            sheet = wb.getSheet(sheetName);
-        }
-        else
-        {
-            // 如果传入的sheet名不存在则默认指向第1个sheet.
-            sheet = wb.getSheetAt(0);
-        }
-
-        if (sheet == null)
-        {
-            throw new IOException("文件sheet不存在");
-        }
-
-        int rows = sheet.getPhysicalNumberOfRows();
-
-        if (rows > 0)
-        {
-            // 定义一个map用于存放excel列的序号和field.
-            Map<String, Integer> cellMap = new HashMap<String, Integer>();
-            // 获取表头
-            Row heard = sheet.getRow(0);
-            for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++)
-            {
-                Cell cell = heard.getCell(i);
-                if (StringUtils.isNotNull(cell != null))
-                {
-                    String value = this.getCellValue(heard, i).toString();
-                    cellMap.put(value, i);
-                }
-                else
-                {
-                    cellMap.put(null, i);
-                }
-            }
-            // 有数据时才处理 得到类的所有field.
-            Field[] allFields = clazz.getDeclaredFields();
-            // 定义一个map用于存放列的序号和field.
-            Map<Integer, Field> fieldsMap = new HashMap<Integer, Field>();
-            for (int col = 0; col < allFields.length; col++)
-            {
-                Field field = allFields[col];
-                Excel attr = field.getAnnotation(Excel.class);
-                if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
-                {
-                    // 设置类的私有字段属性可访问.
-                    field.setAccessible(true);
-                    Integer column = cellMap.get(attr.name());
-                    fieldsMap.put(column, field);
-                }
-            }
-            for (int i = 1; i < rows; i++)
-            {
-                // 从第2行开始取数据,默认第一行是表头.
-                Row row = sheet.getRow(i);
-                T entity = null;
-                for (Map.Entry<Integer, Field> entry : fieldsMap.entrySet())
-                {
-                    Object val = this.getCellValue(row, entry.getKey());
-
-                    // 如果不存在实例则新建.
-                    entity = (entity == null ? clazz.newInstance() : entity);
-                    // 从map中得到对应列的field.
-                    Field field = fieldsMap.get(entry.getKey());
-                    // 取得类型,并根据对象类型设置值.
-                    Class<?> fieldType = field.getType();
-                    if (String.class == fieldType)
-                    {
-                        String s = Convert.toStr(val);
-                        if (StringUtils.endsWith(s, ".0"))
-                        {
-                            val = StringUtils.substringBefore(s, ".0");
-                        }
-                        else
-                        {
-                            val = Convert.toStr(val);
-                        }
-                    }
-                    else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType))
-                    {
-                        val = Convert.toInt(val);
-                    }
-                    else if ((Long.TYPE == fieldType) || (Long.class == fieldType))
-                    {
-                        val = Convert.toLong(val);
-                    }
-                    else if ((Double.TYPE == fieldType) || (Double.class == fieldType))
-                    {
-                        val = Convert.toDouble(val);
-                    }
-                    else if ((Float.TYPE == fieldType) || (Float.class == fieldType))
-                    {
-                        val = Convert.toFloat(val);
-                    }
-                    else if (BigDecimal.class == fieldType)
-                    {
-                        val = Convert.toBigDecimal(val);
-                    }
-                    else if (Date.class == fieldType)
-                    {
-                        if (val instanceof String)
-                        {
-                            val = DateUtils.parseDate(val);
-                        }
-                        else if (val instanceof Double)
-                        {
-                            val = DateUtil.getJavaDate((Double) val);
-                        }
-                    }
-                    if (StringUtils.isNotNull(fieldType))
-                    {
-                        Excel attr = field.getAnnotation(Excel.class);
-                        String propertyName = field.getName();
-                        if (StringUtils.isNotEmpty(attr.targetAttr()))
-                        {
-                            propertyName = field.getName() + "." + attr.targetAttr();
-                        }
-                        else if (StringUtils.isNotEmpty(attr.readConverterExp()))
-                        {
-                            val = reverseByExp(String.valueOf(val), attr.readConverterExp());
-                        }
-                        ReflectUtils.invokeSetter(entity, propertyName, val);
-                    }
-                }
-                list.add(entity);
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 对list数据源将其里面的数据导入到excel表单
-     * 
-     * @param list 导出数据集合
-     * @param sheetName 工作表的名称
-     * @return 结果
-     */
-    public AjaxResult exportExcel(List<T> list, String sheetName)
-    {
-        this.init(list, sheetName, Type.EXPORT);
-        return exportExcel();
-    }
-
-    /**
-     * 对list数据源将其里面的数据导入到excel表单
-     * 
-     * @param sheetName 工作表的名称
-     * @return 结果
-     */
-    public AjaxResult importTemplateExcel(String sheetName)
-    {
-        this.init(null, sheetName, Type.IMPORT);
-        return exportExcel();
-    }
-
-    /**
-     * 对list数据源将其里面的数据导入到excel表单
-     * 
-     * @return 结果
-     */
-    public AjaxResult exportExcel()
-    {
-        OutputStream out = null;
-        try
-        {
-            // 取出一共有多少个sheet.
-            double sheetNo = Math.ceil(list.size() / sheetSize);
-            for (int index = 0; index <= sheetNo; index++)
-            {
-                createSheet(sheetNo, index);
-
-                // 产生一行
-                Row row = sheet.createRow(0);
-                int column = 0;
-                // 写入各个字段的列头名称
-                for (Object[] os : fields)
-                {
-                    Excel excel = (Excel) os[1];
-                    this.createCell(excel, row, column++);
-                }
-                if (Type.EXPORT.equals(type))
-                {
-                    fillExcelData(index, row);
-                }
-            }
-            String filename = encodingFilename(sheetName);
-            out = new FileOutputStream(getAbsoluteFile(filename));
-            wb.write(out);
-            return AjaxResult.success(filename);
-        }
-        catch (Exception e)
-        {
-            log.error("导出Excel异常{}", e.getMessage());
-            throw new BusinessException("导出Excel失败,请联系网站管理员!");
-        }
-        finally
-        {
-            if (wb != null)
-            {
-                try
-                {
-                    wb.close();
-                }
-                catch (IOException e1)
-                {
-                    e1.printStackTrace();
-                }
-            }
-            if (out != null)
-            {
-                try
-                {
-                    out.close();
-                }
-                catch (IOException e1)
-                {
-                    e1.printStackTrace();
-                }
-            }
-        }
-    }
-
-    /**
-     * 填充excel数据
-     * 
-     * @param index 序号
-     * @param row 单元格行
-     */
-    public void fillExcelData(int index, Row row)
-    {
-        int startNo = index * sheetSize;
-        int endNo = Math.min(startNo + sheetSize, list.size());
-        for (int i = startNo; i < endNo; i++)
-        {
-            row = sheet.createRow(i + 1 - startNo);
-            // 得到导出对象.
-            T vo = (T) list.get(i);
-            int column = 0;
-            for (Object[] os : fields)
-            {
-                Field field = (Field) os[0];
-                Excel excel = (Excel) os[1];
-                // 设置实体类私有属性可访问
-                field.setAccessible(true);
-                this.addCell(excel, row, vo, field, column++);
-            }
-        }
-    }
-
-    /**
-     * 创建表格样式
-     * 
-     * @param wb 工作薄对象
-     * @return 样式列表
-     */
-    private Map<String, CellStyle> createStyles(Workbook wb)
-    {
-        // 写入各条记录,每条记录对应excel表中的一行
-        Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
-        CellStyle style = wb.createCellStyle();
-        style.setAlignment(HorizontalAlignment.CENTER);
-        style.setVerticalAlignment(VerticalAlignment.CENTER);
-        style.setBorderRight(BorderStyle.THIN);
-        style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderLeft(BorderStyle.THIN);
-        style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderTop(BorderStyle.THIN);
-        style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderBottom(BorderStyle.THIN);
-        style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        Font dataFont = wb.createFont();
-        dataFont.setFontName("Arial");
-        dataFont.setFontHeightInPoints((short) 10);
-        style.setFont(dataFont);
-        styles.put("data", style);
-
-        style = wb.createCellStyle();
-        style.cloneStyleFrom(styles.get("data"));
-        style.setAlignment(HorizontalAlignment.CENTER);
-        style.setVerticalAlignment(VerticalAlignment.CENTER);
-        style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-        Font headerFont = wb.createFont();
-        headerFont.setFontName("Arial");
-        headerFont.setFontHeightInPoints((short) 10);
-        headerFont.setBold(true);
-        headerFont.setColor(IndexedColors.WHITE.getIndex());
-        style.setFont(headerFont);
-        styles.put("header", style);
-
-        return styles;
-    }
-
-    /**
-     * 创建单元格
-     */
-    public Cell createCell(Excel attr, Row row, int column)
-    {
-        // 创建列
-        Cell cell = row.createCell(column);
-        // 写入列信息
-        cell.setCellValue(attr.name());
-        setDataValidation(attr, row, column);
-        cell.setCellStyle(styles.get("header"));
-        return cell;
-    }
-
-    /**
-     * 设置单元格信息
-     * 
-     * @param value 单元格值
-     * @param attr 注解相关
-     * @param cell 单元格信息
-     */
-    public void setCellVo(Object value, Excel attr, Cell cell)
-    {
-        if (ColumnType.STRING == attr.cellType())
-        {
-            cell.setCellType(CellType.NUMERIC);
-            cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix());
-        }
-        else if (ColumnType.NUMERIC == attr.cellType())
-        {
-            cell.setCellType(CellType.NUMERIC);
-            cell.setCellValue(Integer.parseInt(value + ""));
-        }
-    }
-
-    /**
-     * 创建表格样式
-     */
-    public void setDataValidation(Excel attr, Row row, int column)
-    {
-        if (attr.name().indexOf("注:") >= 0)
-        {
-            sheet.setColumnWidth(column, 6000);
-        }
-        else
-        {
-            // 设置列宽
-            sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256));
-            row.setHeight((short) (attr.height() * 20));
-        }
-        // 如果设置了提示信息则鼠标放上去提示.
-        if (StringUtils.isNotEmpty(attr.prompt()))
-        {
-            // 这里默认设了2-101列提示.
-            setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column);
-        }
-        // 如果设置了combo属性则本列只能选择不能输入
-        if (attr.combo().length > 0)
-        {
-            // 这里默认设了2-101列只能选择不能输入.
-            setXSSFValidation(sheet, attr.combo(), 1, 100, column, column);
-        }
-    }
-
-    /**
-     * 添加单元格
-     */
-    public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
-    {
-        Cell cell = null;
-        try
-        {
-            // 设置行高
-            row.setHeight((short) (attr.height() * 20));
-            // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列.
-            if (attr.isExport())
-            {
-                // 创建cell
-                cell = row.createCell(column);
-                cell.setCellStyle(styles.get("data"));
-
-                // 用于读取对象中的属性
-                Object value = getTargetValue(vo, field, attr);
-                String dateFormat = attr.dateFormat();
-                String readConverterExp = attr.readConverterExp();
-                if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
-                {
-                    cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value));
-                }
-                else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
-                {
-                    cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp));
-                }
-                else
-                {
-                    // 设置列类型
-                    setCellVo(value, attr, cell);
-                }
-            }
-        }
-        catch (Exception e)
-        {
-            log.error("导出Excel失败{}", e);
-        }
-        return cell;
-    }
-
-    /**
-     * 设置 POI XSSFSheet 单元格提示
-     * 
-     * @param sheet 表单
-     * @param promptTitle 提示标题
-     * @param promptContent 提示内容
-     * @param firstRow 开始行
-     * @param endRow 结束行
-     * @param firstCol 开始列
-     * @param endCol 结束列
-     */
-    public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow,
-            int firstCol, int endCol)
-    {
-        DataValidationHelper helper = sheet.getDataValidationHelper();
-        DataValidationConstraint constraint = helper.createCustomConstraint("DD1");
-        CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol);
-        DataValidation dataValidation = helper.createValidation(constraint, regions);
-        dataValidation.createPromptBox(promptTitle, promptContent);
-        dataValidation.setShowPromptBox(true);
-        sheet.addValidationData(dataValidation);
-    }
-
-    /**
-     * 设置某些列的值只能输入预制的数据,显示下拉框.
-     * 
-     * @param sheet 要设置的sheet.
-     * @param textlist 下拉框显示的内容
-     * @param firstRow 开始行
-     * @param endRow 结束行
-     * @param firstCol 开始列
-     * @param endCol 结束列
-     * @return 设置好的sheet.
-     */
-    public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol)
-    {
-        DataValidationHelper helper = sheet.getDataValidationHelper();
-        // 加载下拉列表内容
-        DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist);
-        // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列
-        CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol);
-        // 数据有效性对象
-        DataValidation dataValidation = helper.createValidation(constraint, regions);
-        // 处理Excel兼容性问题
-        if (dataValidation instanceof XSSFDataValidation)
-        {
-            dataValidation.setSuppressDropDownArrow(true);
-            dataValidation.setShowErrorBox(true);
-        }
-        else
-        {
-            dataValidation.setSuppressDropDownArrow(false);
-        }
-
-        sheet.addValidationData(dataValidation);
-    }
-
-    /**
-     * 解析导出值 0=男,1=女,2=未知
-     * 
-     * @param propertyValue 参数值
-     * @param converterExp 翻译注解
-     * @return 解析后值
-     * @throws Exception
-     */
-    public static String convertByExp(String propertyValue, String converterExp) throws Exception
-    {
-        try
-        {
-            String[] convertSource = converterExp.split(",");
-            for (String item : convertSource)
-            {
-                String[] itemArray = item.split("=");
-                if (itemArray[0].equals(propertyValue))
-                {
-                    return itemArray[1];
-                }
-            }
-        }
-        catch (Exception e)
-        {
-            throw e;
-        }
-        return propertyValue;
-    }
-
-    /**
-     * 反向解析值 男=0,女=1,未知=2
-     * 
-     * @param propertyValue 参数值
-     * @param converterExp 翻译注解
-     * @return 解析后值
-     * @throws Exception
-     */
-    public static String reverseByExp(String propertyValue, String converterExp) throws Exception
-    {
-        try
-        {
-            String[] convertSource = converterExp.split(",");
-            for (String item : convertSource)
-            {
-                String[] itemArray = item.split("=");
-                if (itemArray[1].equals(propertyValue))
-                {
-                    return itemArray[0];
-                }
-            }
-        }
-        catch (Exception e)
-        {
-            throw e;
-        }
-        return propertyValue;
-    }
-
-    /**
-     * 编码文件名
-     */
-    public String encodingFilename(String filename)
-    {
-        filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx";
-        return filename;
-    }
-
-    /**
-     * 获取下载路径
-     * 
-     * @param filename 文件名称
-     */
-    public String getAbsoluteFile(String filename)
-    {
-        String downloadPath = Global.getDownloadPath() + filename;
-        File desc = new File(downloadPath);
-        if (!desc.getParentFile().exists())
-        {
-            desc.getParentFile().mkdirs();
-        }
-        return downloadPath;
-    }
-
-    /**
-     * 获取bean中的属性值
-     * 
-     * @param vo 实体对象
-     * @param field 字段
-     * @param excel 注解
-     * @return 最终的属性值
-     * @throws Exception
-     */
-    private Object getTargetValue(T vo, Field field, Excel excel) throws Exception
-    {
-        Object o = field.get(vo);
-        if (StringUtils.isNotEmpty(excel.targetAttr()))
-        {
-            String target = excel.targetAttr();
-            if (target.indexOf(".") > -1)
-            {
-                String[] targets = target.split("[.]");
-                for (String name : targets)
-                {
-                    o = getValue(o, name);
-                }
-            }
-            else
-            {
-                o = getValue(o, target);
-            }
-        }
-        return o;
-    }
-
-    /**
-     * 以类的属性的get方法方法形式获取值
-     * 
-     * @param o
-     * @param name
-     * @return value
-     * @throws Exception
-     */
-    private Object getValue(Object o, String name) throws Exception
-    {
-        if (StringUtils.isNotEmpty(name))
-        {
-            Class<?> clazz = o.getClass();
-            String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
-            Method method = clazz.getMethod(methodName);
-            o = method.invoke(o);
-        }
-        return o;
-    }
-
-    /**
-     * 得到所有定义字段
-     */
-    private void createExcelField()
-    {
-        this.fields = new ArrayList<Object[]>();
-        List<Field> tempFields = new ArrayList<>();
-        tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields()));
-        tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
-        for (Field field : tempFields)
-        {
-            // 单注解
-            if (field.isAnnotationPresent(Excel.class))
-            {
-                putToField(field, field.getAnnotation(Excel.class));
-            }
-
-            // 多注解
-            if (field.isAnnotationPresent(Excels.class))
-            {
-                Excels attrs = field.getAnnotation(Excels.class);
-                Excel[] excels = attrs.value();
-                for (Excel excel : excels)
-                {
-                    putToField(field, excel);
-                }
-            }
-        }
-    }
-
-    /**
-     * 放到字段集合中
-     */
-    private void putToField(Field field, Excel attr)
-    {
-        if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
-        {
-            this.fields.add(new Object[] { field, attr });
-        }
-    }
-
-    /**
-     * 创建一个工作簿
-     */
-    public void createWorkbook()
-    {
-        this.wb = new SXSSFWorkbook(500);
-    }
-
-    /**
-     * 创建工作表
-     * 
-     * @param sheetNo sheet数量
-     * @param index 序号
-     */
-    public void createSheet(double sheetNo, int index)
-    {
-        this.sheet = wb.createSheet();
-        this.styles = createStyles(wb);
-        // 设置工作表的名称.
-        if (sheetNo == 0)
-        {
-            wb.setSheetName(index, sheetName);
-        }
-        else
-        {
-            wb.setSheetName(index, sheetName + index);
-        }
-    }
-
-    /**
-     * 获取单元格值
-     * 
-     * @param row 获取的行
-     * @param column 获取单元格列号
-     * @return 单元格值
-     */
-    public Object getCellValue(Row row, int column)
-    {
-        if (row == null)
-        {
-            return row;
-        }
-        Object val = "";
-        try
-        {
-            Cell cell = row.getCell(column);
-            if (cell != null)
-            {
-                if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA)
-                {
-                    val = cell.getNumericCellValue();
-                    if (HSSFDateUtil.isCellDateFormatted(cell))
-                    {
-                        val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
-                    }
-                    else
-                    {
-                        if ((Double) val % 1 > 0)
-                        {
-                            val = new DecimalFormat("0.00").format(val);
-                        }
-                        else
-                        {
-                            val = new DecimalFormat("0").format(val);
-                        }
-                    }
-                }
-                else if (cell.getCellTypeEnum() == CellType.STRING)
-                {
-                    val = cell.getStringCellValue();
-                }
-                else if (cell.getCellTypeEnum() == CellType.BOOLEAN)
-                {
-                    val = cell.getBooleanCellValue();
-                }
-                else if (cell.getCellTypeEnum() == CellType.ERROR)
-                {
-                    val = cell.getErrorCellValue();
-                }
-
-            }
-        }
-        catch (Exception e)
-        {
-            return val;
-        }
-        return val;
-    }
-}

+ 0 - 406
dgtly-common/src/main/java/com/dgtly/common/utils/reflect/ReflectUtils.java

@@ -1,406 +0,0 @@
-package com.dgtly.common.utils.reflect;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Date;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.Validate;
-import org.apache.poi.ss.usermodel.DateUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.dgtly.common.core.text.Convert;
-import com.dgtly.common.utils.DateUtils;
-
-/**
- * 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数.
- * 
- * @author ruoyi
- */
-@SuppressWarnings("rawtypes")
-public class ReflectUtils
-{
-    private static final String SETTER_PREFIX = "set";
-
-    private static final String GETTER_PREFIX = "get";
-
-    private static final String CGLIB_CLASS_SEPARATOR = "$$";
-
-    private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class);
-
-    /**
-     * 调用Getter方法.
-     * 支持多级,如:对象名.对象名.方法
-     */
-    @SuppressWarnings("unchecked")
-    public static <E> E invokeGetter(Object obj, String propertyName)
-    {
-        Object object = obj;
-        for (String name : StringUtils.split(propertyName, "."))
-        {
-            String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name);
-            object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {});
-        }
-        return (E) object;
-    }
-
-    /**
-     * 调用Setter方法, 仅匹配方法名。
-     * 支持多级,如:对象名.对象名.方法
-     */
-    public static <E> void invokeSetter(Object obj, String propertyName, E value)
-    {
-        Object object = obj;
-        String[] names = StringUtils.split(propertyName, ".");
-        for (int i = 0; i < names.length; i++)
-        {
-            if (i < names.length - 1)
-            {
-                String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]);
-                object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {});
-            }
-            else
-            {
-                String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]);
-                invokeMethodByName(object, setterMethodName, new Object[] { value });
-            }
-        }
-    }
-
-    /**
-     * 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数.
-     */
-    @SuppressWarnings("unchecked")
-    public static <E> E getFieldValue(final Object obj, final String fieldName)
-    {
-        Field field = getAccessibleField(obj, fieldName);
-        if (field == null)
-        {
-            logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
-            return null;
-        }
-        E result = null;
-        try
-        {
-            result = (E) field.get(obj);
-        }
-        catch (IllegalAccessException e)
-        {
-            logger.error("不可能抛出的异常{}", e.getMessage());
-        }
-        return result;
-    }
-
-    /**
-     * 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数.
-     */
-    public static <E> void setFieldValue(final Object obj, final String fieldName, final E value)
-    {
-        Field field = getAccessibleField(obj, fieldName);
-        if (field == null)
-        {
-            // throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
-            logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
-            return;
-        }
-        try
-        {
-            field.set(obj, value);
-        }
-        catch (IllegalAccessException e)
-        {
-            logger.error("不可能抛出的异常: {}", e.getMessage());
-        }
-    }
-
-    /**
-     * 直接调用对象方法, 无视private/protected修饰符.
-     * 用于一次性调用的情况,否则应使用getAccessibleMethod()函数获得Method后反复调用.
-     * 同时匹配方法名+参数类型,
-     */
-    @SuppressWarnings("unchecked")
-    public static <E> E invokeMethod(final Object obj, final String methodName, final Class<?>[] parameterTypes,
-            final Object[] args)
-    {
-        if (obj == null || methodName == null)
-        {
-            return null;
-        }
-        Method method = getAccessibleMethod(obj, methodName, parameterTypes);
-        if (method == null)
-        {
-            logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
-            return null;
-        }
-        try
-        {
-            return (E) method.invoke(obj, args);
-        }
-        catch (Exception e)
-        {
-            String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
-            throw convertReflectionExceptionToUnchecked(msg, e);
-        }
-    }
-
-    /**
-     * 直接调用对象方法, 无视private/protected修饰符,
-     * 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用.
-     * 只匹配函数名,如果有多个同名函数调用第一个。
-     */
-    @SuppressWarnings("unchecked")
-    public static <E> E invokeMethodByName(final Object obj, final String methodName, final Object[] args)
-    {
-        Method method = getAccessibleMethodByName(obj, methodName, args.length);
-        if (method == null)
-        {
-            // 如果为空不报错,直接返回空。
-            logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
-            return null;
-        }
-        try
-        {
-            // 类型转换(将参数数据类型转换为目标方法参数类型)
-            Class<?>[] cs = method.getParameterTypes();
-            for (int i = 0; i < cs.length; i++)
-            {
-                if (args[i] != null && !args[i].getClass().equals(cs[i]))
-                {
-                    if (cs[i] == String.class)
-                    {
-                        args[i] = Convert.toStr(args[i]);
-                        if (StringUtils.endsWith((String) args[i], ".0"))
-                        {
-                            args[i] = StringUtils.substringBefore((String) args[i], ".0");
-                        }
-                    }
-                    else if (cs[i] == Integer.class)
-                    {
-                        args[i] = Convert.toInt(args[i]);
-                    }
-                    else if (cs[i] == Long.class)
-                    {
-                        args[i] = Convert.toLong(args[i]);
-                    }
-                    else if (cs[i] == Double.class)
-                    {
-                        args[i] = Convert.toDouble(args[i]);
-                    }
-                    else if (cs[i] == Float.class)
-                    {
-                        args[i] = Convert.toFloat(args[i]);
-                    }
-                    else if (cs[i] == Date.class)
-                    {
-                        if (args[i] instanceof String)
-                        {
-                            args[i] = DateUtils.parseDate(args[i]);
-                        }
-                        else
-                        {
-                            args[i] = DateUtil.getJavaDate((Double) args[i]);
-                        }
-                    }
-                }
-            }
-            return (E) method.invoke(obj, args);
-        }
-        catch (Exception e)
-        {
-            String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
-            throw convertReflectionExceptionToUnchecked(msg, e);
-        }
-    }
-
-    /**
-     * 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问.
-     * 如向上转型到Object仍无法找到, 返回null.
-     */
-    public static Field getAccessibleField(final Object obj, final String fieldName)
-    {
-        // 为空不报错。直接返回 null
-        if (obj == null)
-        {
-            return null;
-        }
-        Validate.notBlank(fieldName, "fieldName can't be blank");
-        for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass())
-        {
-            try
-            {
-                Field field = superClass.getDeclaredField(fieldName);
-                makeAccessible(field);
-                return field;
-            }
-            catch (NoSuchFieldException e)
-            {
-                continue;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
-     * 如向上转型到Object仍无法找到, 返回null.
-     * 匹配函数名+参数类型。
-     * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
-     */
-    public static Method getAccessibleMethod(final Object obj, final String methodName,
-            final Class<?>... parameterTypes)
-    {
-        // 为空不报错。直接返回 null
-        if (obj == null)
-        {
-            return null;
-        }
-        Validate.notBlank(methodName, "methodName can't be blank");
-        for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass())
-        {
-            try
-            {
-                Method method = searchType.getDeclaredMethod(methodName, parameterTypes);
-                makeAccessible(method);
-                return method;
-            }
-            catch (NoSuchMethodException e)
-            {
-                continue;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
-     * 如向上转型到Object仍无法找到, 返回null.
-     * 只匹配函数名。
-     * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
-     */
-    public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum)
-    {
-        // 为空不报错。直接返回 null
-        if (obj == null)
-        {
-            return null;
-        }
-        Validate.notBlank(methodName, "methodName can't be blank");
-        for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass())
-        {
-            Method[] methods = searchType.getDeclaredMethods();
-            for (Method method : methods)
-            {
-                if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum)
-                {
-                    makeAccessible(method);
-                    return method;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
-     */
-    public static void makeAccessible(Method method)
-    {
-        if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
-                && !method.isAccessible())
-        {
-            method.setAccessible(true);
-        }
-    }
-
-    /**
-     * 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
-     */
-    public static void makeAccessible(Field field)
-    {
-        if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
-                || Modifier.isFinal(field.getModifiers())) && !field.isAccessible())
-        {
-            field.setAccessible(true);
-        }
-    }
-
-    /**
-     * 通过反射, 获得Class定义中声明的泛型参数的类型, 注意泛型必须定义在父类处
-     * 如无法找到, 返回Object.class.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> Class<T> getClassGenricType(final Class clazz)
-    {
-        return getClassGenricType(clazz, 0);
-    }
-
-    /**
-     * 通过反射, 获得Class定义中声明的父类的泛型参数的类型.
-     * 如无法找到, 返回Object.class.
-     */
-    public static Class getClassGenricType(final Class clazz, final int index)
-    {
-        Type genType = clazz.getGenericSuperclass();
-
-        if (!(genType instanceof ParameterizedType))
-        {
-            logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType");
-            return Object.class;
-        }
-
-        Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
-
-        if (index >= params.length || index < 0)
-        {
-            logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: "
-                    + params.length);
-            return Object.class;
-        }
-        if (!(params[index] instanceof Class))
-        {
-            logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
-            return Object.class;
-        }
-
-        return (Class) params[index];
-    }
-
-    public static Class<?> getUserClass(Object instance)
-    {
-        if (instance == null)
-        {
-            throw new RuntimeException("Instance must not be null");
-        }
-        Class clazz = instance.getClass();
-        if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR))
-        {
-            Class<?> superClass = clazz.getSuperclass();
-            if (superClass != null && !Object.class.equals(superClass))
-            {
-                return superClass;
-            }
-        }
-        return clazz;
-
-    }
-
-    /**
-     * 将反射时的checked exception转换为unchecked exception.
-     */
-    public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e)
-    {
-        if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException
-                || e instanceof NoSuchMethodException)
-        {
-            return new IllegalArgumentException(msg, e);
-        }
-        else if (e instanceof InvocationTargetException)
-        {
-            return new RuntimeException(msg, ((InvocationTargetException) e).getTargetException());
-        }
-        return new RuntimeException(msg, e);
-    }
-}

+ 0 - 66
dgtly-common/src/main/java/com/dgtly/common/utils/security/Md5Utils.java

@@ -1,66 +0,0 @@
-package com.dgtly.common.utils.security;
-
-import java.security.MessageDigest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Md5加密方法
- * 
- * @author ruoyi
- */
-public class Md5Utils
-{
-    private static final Logger log = LoggerFactory.getLogger(Md5Utils.class);
-
-    private static byte[] md5(String s)
-    {
-        MessageDigest algorithm;
-        try
-        {
-            algorithm = MessageDigest.getInstance("MD5");
-            algorithm.reset();
-            algorithm.update(s.getBytes("UTF-8"));
-            byte[] messageDigest = algorithm.digest();
-            return messageDigest;
-        }
-        catch (Exception e)
-        {
-            log.error("MD5 Error...", e);
-        }
-        return null;
-    }
-
-    private static final String toHex(byte hash[])
-    {
-        if (hash == null)
-        {
-            return null;
-        }
-        StringBuffer buf = new StringBuffer(hash.length * 2);
-        int i;
-
-        for (i = 0; i < hash.length; i++)
-        {
-            if ((hash[i] & 0xff) < 0x10)
-            {
-                buf.append("0");
-            }
-            buf.append(Long.toString(hash[i] & 0xff, 16));
-        }
-        return buf.toString();
-    }
-
-    public static String hash(String s)
-    {
-        try
-        {
-            return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8");
-        }
-        catch (Exception e)
-        {
-            log.error("not supported charset...{}", e);
-            return s;
-        }
-    }
-}

+ 0 - 118
dgtly-common/src/main/java/com/dgtly/common/utils/security/PermissionUtils.java

@@ -1,118 +0,0 @@
-package com.dgtly.common.utils.security;
-
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.subject.Subject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.dgtly.common.constant.PermissionConstants;
-import com.dgtly.common.utils.MessageUtils;
-
-/**
- * permission 工具类
- * 
- * @author ruoyi
- */
-public class PermissionUtils
-{
-    private static final Logger log = LoggerFactory.getLogger(PermissionUtils.class);
-
-    /**
-     * 查看数据的权限
-     */
-    public static final String VIEW_PERMISSION = "no.view.permission";
-
-    /**
-     * 创建数据的权限
-     */
-    public static final String CREATE_PERMISSION = "no.create.permission";
-
-    /**
-     * 修改数据的权限
-     */
-    public static final String UPDATE_PERMISSION = "no.update.permission";
-
-    /**
-     * 删除数据的权限
-     */
-    public static final String DELETE_PERMISSION = "no.delete.permission";
-
-    /**
-     * 导出数据的权限
-     */
-    public static final String EXPORT_PERMISSION = "no.export.permission";
-
-    /**
-     * 其他数据的权限
-     */
-    public static final String PERMISSION = "no.permission";
-
-    /**
-     * 权限错误消息提醒
-     * 
-     * @param permissionsStr 错误信息
-     * @return 提示信息
-     */
-    public static String getMsg(String permissionsStr)
-    {
-        String permission = StringUtils.substringBetween(permissionsStr, "[", "]");
-        String msg = MessageUtils.message(PERMISSION, permission);
-        if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.ADD_PERMISSION))
-        {
-            msg = MessageUtils.message(CREATE_PERMISSION, permission);
-        }
-        else if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.EDIT_PERMISSION))
-        {
-            msg = MessageUtils.message(UPDATE_PERMISSION, permission);
-        }
-        else if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.REMOVE_PERMISSION))
-        {
-            msg = MessageUtils.message(DELETE_PERMISSION, permission);
-        }
-        else if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.EXPORT_PERMISSION))
-        {
-            msg = MessageUtils.message(EXPORT_PERMISSION, permission);
-        }
-        else if (StringUtils.endsWithAny(permission,
-                new String[] { PermissionConstants.VIEW_PERMISSION, PermissionConstants.LIST_PERMISSION }))
-        {
-            msg = MessageUtils.message(VIEW_PERMISSION, permission);
-        }
-        return msg;
-    }
-
-    /**
-     * 返回用户属性值
-     *
-     * @param property 属性名称
-     * @return 用户属性值
-     */
-    public static Object getPrincipalProperty(String property)
-    {
-        Subject subject = SecurityUtils.getSubject();
-        if (subject != null)
-        {
-            Object principal = subject.getPrincipal();
-            try
-            {
-                BeanInfo bi = Introspector.getBeanInfo(principal.getClass());
-                for (PropertyDescriptor pd : bi.getPropertyDescriptors())
-                {
-                    if (pd.getName().equals(property) == true)
-                    {
-                        return pd.getReadMethod().invoke(principal, (Object[]) null);
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-                log.error("Error reading property [{}] from principal of type [{}]", property,
-                        principal.getClass().getName());
-            }
-        }
-        return null;
-    }
-}

+ 0 - 0
dgtly-common/src/main/java/com/dgtly/common/utils/spring/SpringUtils.java


Some files were not shown because too many files changed in this diff