New file |
| | |
| | | .DS_Store |
| | | |
| | | HELP.md |
| | | target/ |
| | | !.mvn/wrapper/maven-wrapper.jar |
| | | !**/src/main/**/target/ |
| | | !**/src/test/**/target/ |
| | | |
| | | ### STS ### |
| | | .apt_generated |
| | | .classpath |
| | | .factorypath |
| | | .project |
| | | .settings |
| | | .springBeans |
| | | .sts4-cache |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | |
| | | ### NetBeans ### |
| | | /nbproject/private/ |
| | | /nbbuild/ |
| | | /dist/ |
| | | /nbdist/ |
| | | /.nb-gradle/ |
| | | build/ |
| | | !**/src/main/**/build/ |
| | | !**/src/test/**/build/ |
| | | |
| | | ### VS Code ### |
| | | .vscode/ |
New file |
| | |
| | | <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-parent</artifactId> |
| | | <version>2.3.6.RELEASE</version> |
| | | |
| | | <relativePath/> <!-- lookup parent from repository --> |
| | | </parent> |
| | | <groupId>com.dg</groupId> |
| | | <artifactId>flower_city_automessage</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <name>flower_city_automessage</name> |
| | | <description>flower_city_automessage-backend</description> |
| | | <properties> |
| | | <java.version>8</java.version> |
| | | </properties> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <scope>runtime</scope> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-configuration-processor</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>8.0.13</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.5.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>2.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.freemarker</groupId> |
| | | <artifactId>freemarker</artifactId> |
| | | <version>2.3.30</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-annotation</artifactId> |
| | | <version>4.1.0</version> |
| | | </dependency> |
| | | |
| | | <!-- hutool工具类 --> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-core</artifactId> |
| | | <version>5.6.7</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.python</groupId> |
| | | <artifactId>jython-standalone</artifactId> |
| | | <version>2.7.0</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | <version>2.9.2</version> |
| | | </dependency> |
| | | <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui --> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>2.9.2</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- 文件上传工具类 --> |
| | | <dependency> |
| | | <groupId>commons-fileupload</groupId> |
| | | <artifactId>commons-fileupload</artifactId> |
| | | <version>1.4</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- io常用工具类 --> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>2.11.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.httpcomponents</groupId> |
| | | <artifactId>httpclient</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | Manifest-Version: 1.0 |
| | | Main-Class: com.dg.core |
| | | |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | public class Constant { |
| | | |
| | | /** |
| | | * 存储当前登录用户id的字段名 |
| | | */ |
| | | public static final String CURRENT_USER_ID = "CURRENT_USER_ID"; |
| | | |
| | | /** |
| | | * 存储当前登录用户id的字段名 |
| | | */ |
| | | public static final String CURRENT_USER_NAME = "CURRENT_USER_NAME"; |
| | | |
| | | /** |
| | | * 存储当前登录用户的角色 |
| | | */ |
| | | public static final String CURRENT_USER_ROLE = "CURRENT_USER_ROLE"; |
| | | |
| | | /** |
| | | * 存储当前登录用户的deptId |
| | | */ |
| | | public static final String CURRENT_USER_DEPT_ID = "CURRENT_USER_DEPT_Id"; |
| | | public static final String CURRENT_USER_ORG_ID = "CURRENT_USER_ORG_Id"; |
| | | public static final String CURRENT_USER_PHONE = "CURRENT_USER_PHONE"; |
| | | /** |
| | | * 存放OpLogContent的header字段 |
| | | */ |
| | | public static final String OP_LOG_CONTENT = "OP_LOG_CONTENT"; |
| | | |
| | | /** |
| | | * token有效期(小时) |
| | | */ |
| | | public static final int TOKEN_EXPIRES_HOUR = 1; |
| | | |
| | | /** |
| | | * redis存储手机验证码过期时间(10分钟) |
| | | */ |
| | | public static final long AUTH_CODE_EXPIRED_SECONDS = 60 * 10; |
| | | |
| | | /** |
| | | * 验证码长度 |
| | | */ |
| | | public static final int AUTH_CODE_LENGTH = 6; |
| | | |
| | | |
| | | /** |
| | | * 登录用户 redis key |
| | | */ |
| | | public static final String LOGIN_TOKEN_KEY = "login_tokens:"; |
| | | /** |
| | | * 令牌 |
| | | */ |
| | | public static final String TOKEN = "token"; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String TOKEN_PREFIX = "admin:"; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String LOGIN_USER_KEY = "login_user_key"; |
| | | |
| | | /** |
| | | * 存放Authorization的header字段 |
| | | */ |
| | | public static final String AUTHORIZATION = "Authorization"; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | import com.dg.core.util.ServletUtils; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | @Configuration |
| | | public class CorsConfig implements WebMvcConfigurer { |
| | | @Override |
| | | public void addCorsMappings(CorsRegistry registry) { |
| | | registry.addMapping("/**") |
| | | // 设置允许跨域请求的域名 |
| | | // .allowedOriginPatterns("*") |
| | | .allowedOrigins("*") |
| | | // 是否允许证书(cookies) |
| | | .allowCredentials(true) |
| | | // 设置允许的方法 |
| | | .allowedMethods("*") |
| | | // 跨域允许时间 |
| | | .maxAge(3600); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取完整的请求路径,包括:域名,端口,上下文访问路径 |
| | | * |
| | | * @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(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | /** |
| | | * 返回状态码 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class HttpStatus |
| | | { |
| | | /** |
| | | * 操作成功 |
| | | */ |
| | | public static final int SUCCESS = 200; |
| | | |
| | | /** |
| | | * 对象创建成功 |
| | | */ |
| | | public static final int CREATED = 201; |
| | | |
| | | /** |
| | | * 请求已经被接受 |
| | | */ |
| | | public static final int ACCEPTED = 202; |
| | | |
| | | /** |
| | | * 操作已经执行成功,但是没有返回数据 |
| | | */ |
| | | public static final int NO_CONTENT = 204; |
| | | |
| | | /** |
| | | * 资源已被移除 |
| | | */ |
| | | public static final int MOVED_PERM = 301; |
| | | |
| | | /** |
| | | * 重定向 |
| | | */ |
| | | public static final int SEE_OTHER = 303; |
| | | |
| | | /** |
| | | * 资源没有被修改 |
| | | */ |
| | | public static final int NOT_MODIFIED = 304; |
| | | |
| | | /** |
| | | * 参数列表错误(缺少,格式不匹配) |
| | | */ |
| | | public static final int BAD_REQUEST = 400; |
| | | |
| | | /** |
| | | * 未授权 |
| | | */ |
| | | public static final int UNAUTHORIZED = 401; |
| | | |
| | | /** |
| | | * 访问受限,授权过期 |
| | | */ |
| | | public static final int FORBIDDEN = 403; |
| | | |
| | | /** |
| | | * 资源,服务未找到 |
| | | */ |
| | | public static final int NOT_FOUND = 404; |
| | | |
| | | /** |
| | | * 不允许的http方法 |
| | | */ |
| | | public static final int BAD_METHOD = 405; |
| | | |
| | | /** |
| | | * 资源冲突,或者资源被锁 |
| | | */ |
| | | public static final int CONFLICT = 409; |
| | | |
| | | /** |
| | | * 不支持的数据,媒体类型 |
| | | */ |
| | | public static final int UNSUPPORTED_TYPE = 415; |
| | | |
| | | /** |
| | | * 系统内部错误 |
| | | */ |
| | | public static final int ERROR = 500; |
| | | |
| | | /** |
| | | * 接口未实现 |
| | | */ |
| | | public static final int NOT_IMPLEMENTED = 501; |
| | | } |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | import com.dg.core.interceptor.AuthorizationInterceptor; |
| | | import com.dg.core.resolvers.CurrentUserMethodArgumentResolver; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.method.support.HandlerMethodArgumentResolver; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 配置类,增加自定义拦截器和解析器 |
| | | */ |
| | | @Configuration |
| | | public class MvcConfig implements WebMvcConfigurer { |
| | | |
| | | @Autowired |
| | | private AuthorizationInterceptor authorizationInterceptor; |
| | | @Autowired |
| | | private CurrentUserMethodArgumentResolver currentUserMethodArgumentResolver; |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(authorizationInterceptor); |
| | | } |
| | | |
| | | @Override |
| | | public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { |
| | | argumentResolvers.add(currentUserMethodArgumentResolver); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | public class ResultData<T> { |
| | | //返回状态码 |
| | | private Integer result; |
| | | //返回消息 |
| | | private String message; |
| | | //返回数据 |
| | | private T data; |
| | | |
| | | public Integer getResult() { |
| | | return result; |
| | | } |
| | | |
| | | public void setResult(Integer result) { |
| | | this.result = result; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public T getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(T data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | //Success结果 |
| | | public static <T> ResultData<T> success(T data) { |
| | | ResultData<T> resultData = new ResultData<>(); |
| | | resultData.setResult(HttpStatus.SUCCESS); |
| | | resultData.setMessage("操作成功"); |
| | | resultData.setData(data); |
| | | return resultData; |
| | | } |
| | | |
| | | //Success结果 |
| | | public static <T> ResultData<T> success(T data,String msg) { |
| | | ResultData<T> resultData = new ResultData<>(); |
| | | resultData.setResult(HttpStatus.SUCCESS); |
| | | resultData.setMessage(msg); |
| | | resultData.setData(data); |
| | | return resultData; |
| | | } |
| | | |
| | | //Success结果 |
| | | public static <T> ResultData<T> success() { |
| | | ResultData<T> resultData = new ResultData<>(); |
| | | resultData.setResult(HttpStatus.SUCCESS); |
| | | resultData.setMessage("操作成功"); |
| | | return resultData; |
| | | } |
| | | |
| | | |
| | | //Fail结果 |
| | | public static <T> ResultData<T> fail(int code, String message) { |
| | | ResultData<T> resultData = new ResultData<>(); |
| | | resultData.setResult(code); |
| | | resultData.setMessage(message); |
| | | return resultData; |
| | | } |
| | | |
| | | //Fail结果 |
| | | public static <T> ResultData<T> error(String message) { |
| | | ResultData<T> resultData = new ResultData<>(); |
| | | resultData.setResult(HttpStatus.ERROR); |
| | | resultData.setMessage(message); |
| | | return resultData; |
| | | } |
| | | |
| | | //Fail结果 |
| | | public static <T> ResultData<T> error() { |
| | | ResultData<T> resultData = new ResultData<>(); |
| | | resultData.setResult(HttpStatus.ERROR); |
| | | resultData.setMessage("操作失败"); |
| | | return resultData; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.web.servlet.ServletComponentScan; |
| | | |
| | | //@ServletComponentScan("com.dg.core.task") //定时任务启动开关 |
| | | @SpringBootApplication |
| | | @MapperScan("com.dg.core.db") |
| | | public class WMApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(WMApplication.class, args); |
| | | System.out.println(" swagger地址= http://localhost:8181/swagger-ui.html"); |
| | | System.out.println(" 启动完成"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 在Controller的方法上使用此注解,该方法在映射时会检查用户是否登录,未登录返回401错误 |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface Authorization { |
| | | } |
New file |
| | |
| | | package com.dg.core.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 在Controller的方法参数中使用此注解,该方法在映射时会注入当前登录的User对象 |
| | | */ |
| | | @Target(ElementType.PARAMETER) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface CurrentUser { |
| | | } |
New file |
| | |
| | | package com.dg.core.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface RoleAdmin { |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.Agreement; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IAgreementService; |
| | | import com.dg.core.service.IAreaCodeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"相关协议接口"}) |
| | | @RestController |
| | | @RequestMapping("/agreement") |
| | | public class AgreementController { |
| | | |
| | | @Resource |
| | | private IAgreementService agreementService; |
| | | |
| | | /** |
| | | * 通过协议名获取相关协议 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "通过协议名获取相关协议",response = Agreement.class) |
| | | @GetMapping(value = "/queryByAgreement") |
| | | public ResultData queryByAgreement(@RequestParam("agreement") String agreement) { |
| | | return ResultData.success(agreementService.queryByAgreement(agreement)); |
| | | } |
| | | |
| | | /** |
| | | * 获取相关附件列表(不分页) |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取相关附件列表(不分页)",response = Agreement.class) |
| | | @GetMapping(value = "/getList") |
| | | public ResultData selectConfigList(){ |
| | | return ResultData.success(agreementService.selectConfigList()); |
| | | } |
| | | |
| | | /** |
| | | * 修改相关附件 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改相关附件",response = Agreement.class) |
| | | @PostMapping(value = "/update") |
| | | @Authorization |
| | | public ResultData update(@RequestBody Agreement agreement,@CurrentUser SysUser sysUse){ |
| | | agreement.setUpdateUserId(sysUse.getUserId().toString()); |
| | | return agreementService.update(agreement); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.service.IAreaCodeService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Api(tags = {"所属地区接口"}) |
| | | @RestController |
| | | @RequestMapping("/areaCode") |
| | | public class AreaCodeController extends BaseController{ |
| | | |
| | | @Resource |
| | | private IAreaCodeService iAreaCodeService; |
| | | |
| | | /** |
| | | * 根据指南id获取所属地区 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据指南id获取所属地区",response = AreaCode2022.class) |
| | | @GetMapping("/getAreaCodeByTransactionId") |
| | | public TableDataInfo getAreaCodeByTransactionId(@RequestParam("transactionId") Integer transactionId){ |
| | | return getDataTable(iAreaCodeService.getAreaCodeByTransactionId(transactionId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.HttpStatus; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * web层通用数据处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseController |
| | | { |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | /** |
| | | * 响应请求分页数据 |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(List<?> list) |
| | | { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setResult(HttpStatus.SUCCESS); |
| | | rspData.setMsg("查询成功"); |
| | | if(list!=null) |
| | | { |
| | | rspData.setRows(list); |
| | | // rspData.setTotal(new PageInfo(list).getTotal()); |
| | | } |
| | | else |
| | | { |
| | | rspData.setRows(new ArrayList<>()); |
| | | rspData.setTotal(0); |
| | | } |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * 响应请求分页数据 |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(List<?> list,long num) |
| | | { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setResult(HttpStatus.SUCCESS); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRows(list); |
| | | rspData.setTotal(num); |
| | | return rspData; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 响应请求分页数据 报错内容 |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(String msg) |
| | | { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setResult(HttpStatus.ERROR); |
| | | rspData.setMsg(msg); |
| | | rspData.setRows(new ArrayList<>()); |
| | | rspData.setTotal(0); |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * <T> ResultData<T> success(T data) { |
| | | */ |
| | | public ResultData success() |
| | | { |
| | | return ResultData.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 返回失败消息 |
| | | */ |
| | | public ResultData error() |
| | | { |
| | | return ResultData.error(); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | */ |
| | | public ResultData success(String message) |
| | | { |
| | | return ResultData.success(message); |
| | | } |
| | | |
| | | /** |
| | | * 返回失败消息 |
| | | */ |
| | | public ResultData error(String message) |
| | | { |
| | | return ResultData.error(message); |
| | | } |
| | | |
| | | /** |
| | | * 响应返回结果 |
| | | * |
| | | * @param rows 影响行数 |
| | | * @return 操作结果 |
| | | */ |
| | | protected ResultData toAjax(int rows) |
| | | { |
| | | return rows > 0 ? ResultData.success() : ResultData.error(); |
| | | } |
| | | |
| | | /** |
| | | * 响应返回结果 |
| | | * |
| | | * @param result 结果 |
| | | * @return 操作结果 |
| | | */ |
| | | protected ResultData toAjax(boolean result) |
| | | { |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 分类管理 |
| | | */ |
| | | @Api(tags = {"分类管理接口"}) |
| | | @RestController |
| | | @RequestMapping("/classify") |
| | | public class ClassifyAdministrationController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | IClassifyAdministrationService iClassifyAdministrationService; |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取管理菜单列表(无分页)",response = ClassifyAdministration.class) |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "classifyGrade",required = false) String classifyGrade) |
| | | { |
| | | int num=iClassifyAdministrationService.countNum("",classifyGrade); |
| | | return getDataTable(iClassifyAdministrationService.selectConfigList("",classifyGrade),num); |
| | | } |
| | | |
| | | /** |
| | | * 获取管理菜单列表(已分级) |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 获取管理菜单列表(已分级)",response = ClassifyAdministration.class) |
| | | @GetMapping("/getListByParentId") |
| | | public TableDataInfo selectConfigListByParentId(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "parentId",required = false) String parentId, |
| | | @RequestParam(value = "departmentId",required = false) Integer departmentId){ |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | int num=iClassifyAdministrationService.countNum("",null); |
| | | Page<ClassifyAdministration> pageParam = new Page<>(pageNum,pageSize); |
| | | return getDataTable(iClassifyAdministrationService.selectRootList(pageParam,pageSize,parentId,departmentId),num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取管理菜单列表",response = ClassifyAdministration.class) |
| | | @GetMapping("/getListPage") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String name) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<ClassifyAdministration> pageParam = new Page<>(pageNum,pageSize); |
| | | List<ClassifyAdministration> list = iClassifyAdministrationService.selectConfigList(pageParam,pageSize,name,""); |
| | | int num=iClassifyAdministrationService.countNum(name,""); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增分类 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增分类",response = ClassifyAdministration.class) |
| | | @PostMapping("/add") |
| | | public ResultData insertConfig(@RequestBody ClassifyAdministration entity) { |
| | | Assert.notNull(entity, "参数不能为空"); |
| | | Assert.notNull(entity.getClassifyName(), "分类名称不能为空"); |
| | | Assert.notNull(entity.getClassifyGrade(), "分类等级不能为空"); |
| | | if(StringUtils.equals(entity.getClassifyGrade(),"2")) |
| | | { |
| | | Assert.notNull(entity.getParentId(), "上级分类不能为空"); |
| | | } |
| | | return toAjax(iClassifyAdministrationService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 更新分类 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("编辑分类") |
| | | @PostMapping("/update") |
| | | public ResultData updateConfig(@RequestBody ClassifyAdministration entity) |
| | | { |
| | | return toAjax(iClassifyAdministrationService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除分类 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除分类") |
| | | @DeleteMapping("/delete/{Id}") |
| | | public ResultData deleteConfigById(@PathVariable("Id") String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("id 不能为空"); |
| | | } |
| | | return toAjax(iClassifyAdministrationService.deleteConfigById(Id)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.CorsConfig; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.AjaxResult; |
| | | import com.dg.core.file.FileUploadUtils; |
| | | import com.dg.core.file.FileUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | |
| | | @Api(tags = {"通用接口"}) |
| | | @RestController |
| | | @RequestMapping("/common") |
| | | public class CommonController extends BaseController |
| | | { |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | @Autowired |
| | | private CorsConfig corsConfig; |
| | | |
| | | |
| | | @RequestMapping("/hello") |
| | | // @Authorization |
| | | public ResponseEntity<String> hello() { |
| | | return ResponseEntity.ok("hello world"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @ApiOperation("文件上传接口(通用)") |
| | | @PostMapping("/uploads") |
| | | public ResultData uploadFiles(List<MultipartFile> files) throws Exception { |
| | | try { |
| | | // 上传文件路径 |
| | | String filePath = FileUploadUtils.defaultBaseDir; |
| | | // String filePath = "D:/tupianshuju"; |
| | | |
| | | System.out.println("上传文件路径"+filePath); |
| | | |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> newFileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | for (MultipartFile file : files) { |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = corsConfig.getUrl() + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | } |
| | | AjaxResult ajax = new AjaxResult(); |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | return ResultData.success(ajax); |
| | | } catch (Exception e) { |
| | | return ResultData.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import com.dg.core.service.IElseAccessoryService; |
| | | import com.dg.core.util.StringUtils; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"其他附件接口"}) |
| | | @RestController |
| | | @RequestMapping("/else") |
| | | public class ElseAccessoryController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | IElseAccessoryService iElseAccessoryService; |
| | | |
| | | |
| | | /** |
| | | * 获取附件列表 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取附件列表接口") |
| | | @GetMapping(path = "/getList") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "Name",required = false) String Name) |
| | | { |
| | | Page<ElseAccessoryEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<ElseAccessoryEntity> list = iElseAccessoryService.selectConfigList(pageParam,pageSize,Name); |
| | | int num=iElseAccessoryService.countNum(Name); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 获取附件列表 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取附件列表接口(全部)") |
| | | @GetMapping(path = "/getAllList") |
| | | public TableDataInfo selectConfigListAll(@RequestParam(value = "Name",required = false) String Name) |
| | | { |
| | | List<ElseAccessoryEntity> list = iElseAccessoryService.selectConfigList(Name); |
| | | int num=iElseAccessoryService.countNum(Name); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增列表 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增附件") |
| | | @PostMapping(path = "/add") |
| | | public ResultData insertConfig(@RequestBody ElseAccessoryEntity entity) |
| | | { |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getName())) |
| | | { |
| | | return ResultData.error("事项名称不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getUrl())) |
| | | { |
| | | return ResultData.error("文件url不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getDepartmentId())) |
| | | { |
| | | return ResultData.error("部门不能为空"); |
| | | } |
| | | |
| | | return toAjax(iElseAccessoryService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 更新附件 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("更新附件") |
| | | @PostMapping(path = "/update") |
| | | public ResultData updateConfig(@RequestBody ElseAccessoryEntity entity) |
| | | { |
| | | return toAjax(iElseAccessoryService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除附件") |
| | | @DeleteMapping(path = "/delete") |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | return toAjax(iElseAccessoryService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Api(tags = {"导办用户接口"}) |
| | | @RestController |
| | | @RequestMapping("/guidedo") |
| | | public class GuideDoController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | ISysUserService IUserService; |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation("用户列表接口") |
| | | @GetMapping("/getlist") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<SysUser> pageParam = new Page<>(pageNum,pageSize); |
| | | List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"2"); |
| | | |
| | | int num=IUserService.selectNum("2"); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增用户 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("新增导办用户接口") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody SysUser config) |
| | | { |
| | | Assert.notNull(config, "parameter can not be empty"); |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | | { |
| | | return error("账户不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getPassword())) |
| | | { |
| | | return error("密码不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getUserName())) |
| | | { |
| | | return error("昵称不能为空"); |
| | | } |
| | | |
| | | SysUser user = IUserService.getUserByAccount(config.getLoginName()); |
| | | if (user != null) { |
| | | //提示用户名或密码错误 |
| | | return error("该账户已存在!"); |
| | | } |
| | | |
| | | config.setUserType("2"); |
| | | |
| | | config.setCreateTime(LocalDateTime.now()); |
| | | config.setUpdateTime(LocalDateTime.now()); |
| | | |
| | | return toAjax(IUserService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 更新导办用户 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("修改导办用户接口") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody SysUser config) |
| | | { |
| | | if(config.getUserId()==null) |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | | { |
| | | return error("账户不能为空"); |
| | | } |
| | | |
| | | config.setUserType("2"); |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 删除聊天记录 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("删除导办用户接口") |
| | | @DeleteMapping("/delete/{userId}") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@PathVariable("userId") String userId) |
| | | { |
| | | if(StringUtils.isEmpty(userId)) |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | return toAjax(IUserService.deleteConfigById(userId)); |
| | | } |
| | | |
| | | /** |
| | | * 修改空闲状态 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("修改导办用户空闲状态接口") |
| | | @PostMapping("/idlestate") |
| | | @Authorization |
| | | public ResultData idleState(@RequestBody SysUser config) |
| | | { |
| | | if(config.getUserId()==null) |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getLeisureState())) |
| | | { |
| | | return error("空闲状态不能为空"); |
| | | } |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.util.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * 工单管理 |
| | | */ |
| | | @Api(tags = {"工单管理接口"}) |
| | | @RestController |
| | | @RequestMapping("/guideRepairOrder") |
| | | public class GuideRepairOrderController extends BaseController { |
| | | |
| | | @Resource |
| | | private IGuideRepairOrderService iGuideRepairOrderService; |
| | | |
| | | @Autowired |
| | | private IGuideEvolveService iGuideEvolveService; |
| | | |
| | | /** |
| | | * 提交导办订单 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "提交导办订单",response = GuideRepairOrder.class) |
| | | @PostMapping("/addOrder") |
| | | @Authorization |
| | | public ResultData addOrder(@RequestBody GuideRepairOrder guideRepairOrder,@CurrentUser SysUser sysUser) { |
| | | guideRepairOrder.setSubmitUserId(sysUser.getUserId().toString()); |
| | | guideRepairOrder.setSubmitUserPhone(sysUser.getPhonenumber()); |
| | | return toAjax(iGuideRepairOrderService.addOrder(guideRepairOrder)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @param orderNum |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取订单详情") |
| | | @GetMapping("/orderdata") |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam(value = "Id",required = false) String Id, |
| | | @RequestParam(value = "orderNum",required = false) String orderNum) |
| | | { |
| | | if(StringUtils.isEmpty(Id) && StringUtils.isEmpty(orderNum)) |
| | | { |
| | | return ResultData.error("id或者订单号不能都为空"); |
| | | } |
| | | |
| | | GuideRepairOrder order=iGuideRepairOrderService.selectConfigData(Id,orderNum); |
| | | order.setGuideEvolveEntities(iGuideEvolveService.selectConfigList(Id)); |
| | | |
| | | return ResultData.success(order); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分配人员 |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @ApiOperation("分配人员") |
| | | @PostMapping("/allocation") |
| | | @Authorization |
| | | public ResultData allocation(@RequestBody GuideRepairOrder order, @CurrentUser SysUser sysUser) |
| | | { |
| | | if(order==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideDepartmentId())) |
| | | { |
| | | return ResultData.error("导办部门id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserId())) |
| | | { |
| | | return ResultData.error("导办人员id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserPhone())) |
| | | { |
| | | return ResultData.error("导办人员电话不能为空"); |
| | | } |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | | |
| | | //新增分配记录 |
| | | GuideEvolveEntity entity=new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("13"); |
| | | entity.setDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setToUserId(sysUser.getUserId()+""); |
| | | entity.setFromUserId(order.getGuideUserId()); |
| | | entity.setFromDepartmentalId(order.getGuideDepartmentId()); |
| | | |
| | | iGuideEvolveService.insertConfig(entity); |
| | | |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转派人员 |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @ApiOperation("转派人员") |
| | | @PostMapping("/redeploy") |
| | | @Authorization |
| | | public ResultData redeploy(@RequestBody GuideRepairOrder order, @CurrentUser SysUser sysUser) |
| | | { |
| | | if(order==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideDepartmentId())) |
| | | { |
| | | return ResultData.error("导办部门id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserId())) |
| | | { |
| | | return ResultData.error("导办人员id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserPhone())) |
| | | { |
| | | return ResultData.error("导办人员电话不能为空"); |
| | | } |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | | |
| | | //新增转派记录 |
| | | GuideEvolveEntity entity=new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("12"); |
| | | entity.setDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setToUserId(sysUser.getUserId()+""); |
| | | entity.setFromUserId(order.getGuideUserId()); |
| | | entity.setFromDepartmentalId(order.getGuideDepartmentId()); |
| | | |
| | | iGuideEvolveService.insertConfig(entity); |
| | | |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 去处理 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("去处理") |
| | | @PostMapping("/dispose") |
| | | @Authorization |
| | | public ResultData dispose(@RequestBody GuideEvolveEntity entity, @CurrentUser SysUser sysUser) |
| | | { |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getGuideId())) |
| | | { |
| | | return ResultData.error("工单id不能为空"); |
| | | } |
| | | |
| | | GuideRepairOrder order=iGuideRepairOrderService.selectConfigData(entity.getGuideId(),""); |
| | | if(order==null) |
| | | { |
| | | return ResultData.error("该工单不存在!"); |
| | | } |
| | | |
| | | if(StringUtils.equals(order.getState(),"3")) |
| | | { |
| | | return ResultData.error("该工单已办结!"); |
| | | } |
| | | |
| | | if(!StringUtils.equals(order.getState(),"2")) |
| | | { |
| | | return ResultData.error("该工单非是待办状态!"); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | | //新增已办结记录 |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("4"); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消导办工单 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("取消导办工单") |
| | | @PostMapping("/cancel") |
| | | @Authorization |
| | | public ResultData cancel(@RequestBody GuideEvolveEntity entity, @CurrentUser SysUser sysUser) |
| | | { |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getGuideId())) |
| | | { |
| | | return ResultData.error("工单id不能为空"); |
| | | } |
| | | |
| | | GuideRepairOrder order=iGuideRepairOrderService.selectConfigData(entity.getGuideId(),""); |
| | | if(order==null) |
| | | { |
| | | return ResultData.error("该工单不存在!"); |
| | | } |
| | | |
| | | if(!StringUtils.equals(order.getState(),"1")) |
| | | { |
| | | return ResultData.error("该工单不能取消!"); |
| | | } |
| | | //取消状态 |
| | | order.setState("5"); |
| | | |
| | | //新增已取消记录 |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("5"); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 工单评价 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("工单评价") |
| | | @PostMapping("/evaluate") |
| | | @Authorization |
| | | public ResultData evaluate(@RequestBody GuideRepairOrder entity, @CurrentUser SysUser sysUser) |
| | | { |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(entity.getId()<=0) |
| | | { |
| | | return ResultData.error("工单id不能为空"); |
| | | } |
| | | |
| | | if(!StringUtils.equals(entity.getState(),"4")) |
| | | { |
| | | return ResultData.error("该工单不能评价!"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getEvaluateState())) |
| | | { |
| | | return ResultData.error("满意程度不能为空!"); |
| | | } |
| | | //已办结 |
| | | entity.setState("3"); |
| | | //新增已办结记录 |
| | | GuideEvolveEntity guideEvolveEntity=new GuideEvolveEntity(); |
| | | guideEvolveEntity.setCreateTime(LocalDateTime.now()); |
| | | guideEvolveEntity.setUpdateTime(LocalDateTime.now()); |
| | | guideEvolveEntity.setState("3"); |
| | | guideEvolveEntity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | guideEvolveEntity.setFromUserId(sysUser.getUserId()+""); |
| | | iGuideEvolveService.insertConfig(guideEvolveEntity); |
| | | |
| | | return toAjax(iGuideRepairOrderService.updateConfig(entity)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | import com.dg.core.service.IKeywordService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"关键词接口"}) |
| | | @RestController |
| | | @RequestMapping("/keyword") |
| | | public class KeywordController extends BaseController |
| | | { |
| | | @Autowired(required = true) |
| | | IKeywordService iKeywordService; |
| | | |
| | | /** |
| | | * 查询关键词列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation("关键词列表接口") |
| | | @GetMapping("/getlist") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<KeywordEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<KeywordEntity> list = iKeywordService.selectConfigList(pageParam,pageSize); |
| | | |
| | | int num=iKeywordService.countNum(); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 查询详情 |
| | | * @return |
| | | */ |
| | | @ApiOperation("关键词详情接口") |
| | | @GetMapping("/getData") |
| | | public ResultData selectConfigData(@RequestParam(value = "id",required = false) String id, |
| | | @RequestParam(value = "name",required = false) String name) |
| | | { |
| | | return ResultData.success(iKeywordService.selectConfigData(id,name)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加关键词 |
| | | * @return |
| | | */ |
| | | @ApiOperation("关键词添加接口") |
| | | @PostMapping("/add") |
| | | public ResultData insertConfig(@RequestBody KeywordEntity entity) |
| | | { |
| | | KeywordEntity enti=iKeywordService.selectConfigData("",entity.getName()); |
| | | if(enti==null) |
| | | { |
| | | if(iKeywordService.insertConfig(entity)>0) |
| | | { |
| | | enti=iKeywordService.selectConfigData("",entity.getName()); |
| | | return ResultData.success(enti); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return ResultData.success(enti); |
| | | } |
| | | return ResultData.error("创建数据失败"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑关键词 |
| | | * @return |
| | | */ |
| | | @ApiOperation("关键词编辑接口") |
| | | @PostMapping("/update") |
| | | public ResultData updateConfig(@RequestBody KeywordEntity entity) |
| | | { |
| | | return toAjax(iKeywordService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除关键词 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("关键词删除接口") |
| | | @DeleteMapping("/delete") |
| | | public ResultData deleteConfigById(String Id) |
| | | { |
| | | return toAjax(iKeywordService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.MenuEntity; |
| | | import com.dg.core.service.IMenuService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 菜单接口 |
| | | */ |
| | | @Api(tags = {"菜单接口"}) |
| | | @RestController |
| | | @RequestMapping("/menu") |
| | | public class MenuController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | IMenuService iMenuService; |
| | | |
| | | |
| | | /** |
| | | * 获取菜单列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取菜单列表") |
| | | @GetMapping("/getMenuList") |
| | | public TableDataInfo selectConfigList() |
| | | { |
| | | int num=iMenuService.countNum(); |
| | | return getDataTable(iMenuService.selectConfigList(),num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加新菜单 |
| | | * @return |
| | | */ |
| | | @ApiOperation("添加新菜单") |
| | | @PostMapping("/addMenu") |
| | | public ResultData insertConfig(@RequestBody MenuEntity entity) |
| | | { |
| | | return toAjax(iMenuService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 更新菜单 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("更新菜单") |
| | | @PostMapping("/updateMenu") |
| | | public ResultData updateConfig(@RequestBody MenuEntity entity) |
| | | { |
| | | return toAjax(iMenuService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除菜单 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除菜单") |
| | | @DeleteMapping("/deleteMenu") |
| | | public ResultData deleteConfigById(@RequestParam("id") Long id) |
| | | { |
| | | return toAjax(iMenuService.deleteConfigById(id)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.StringUtils; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Api(tags = {"组织架构接口"}) |
| | | @RestController |
| | | @RequestMapping("/organization") |
| | | public class OrganizationController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | @ApiOperation("查询机构列表") |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList() |
| | | { |
| | | return getDataTable(iOrganizationChartService.selectConfigList("","")); |
| | | } |
| | | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | @ApiOperation("新增机构") |
| | | @PostMapping("/add") |
| | | public ResultData insertConfig(@RequestBody OrganizationChartEntity entity) |
| | | { |
| | | Assert.notNull(entity.getGrade(), "等级 grade 不能为空"); |
| | | |
| | | if (StringUtils.equals("1",entity.getGrade())) |
| | | { |
| | | if(!StringUtils.isEmpty(entity.getParentId())) |
| | | { |
| | | return ResultData.error("一级部门不能有父级部门"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if(StringUtils.isEmpty(entity.getParentId())) |
| | | { |
| | | return ResultData.error("非一级部门父级部门不能为空"); |
| | | } |
| | | } |
| | | return toAjax(iOrganizationChartService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 更新机构 |
| | | */ |
| | | @ApiOperation("更新机构") |
| | | @PostMapping("/update") |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity) |
| | | { |
| | | return toAjax(iOrganizationChartService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除机构 |
| | | */ |
| | | @ApiOperation("删除机构") |
| | | @DeleteMapping("/delete") |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | return toAjax(iOrganizationChartService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | /** |
| | | * 查询机构列表(不分级不分页按等级排序) |
| | | */ |
| | | @ApiOperation(value = "查询机构列表(不分级不分页按等级排序)",response = OrganizationChartEntity.class) |
| | | @GetMapping("/selectList") |
| | | public TableDataInfo selectList(){ |
| | | return getDataTable(iOrganizationChartService.selectList()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查取消组织机构 |
| | | */ |
| | | @ApiOperation(value = "根据id查取消组织机构",response = OrganizationChartEntity.class) |
| | | @GetMapping("/selectById") |
| | | ResultData selectConfigById(@RequestParam("id") String id){ |
| | | return ResultData.success(iOrganizationChartService.selectConfigById(id)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.ReplyTemplateEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IReplyTemplateService; |
| | | import com.dg.core.util.StringUtils; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"回复模板接口"}) |
| | | @RestController |
| | | @RequestMapping("/reply") |
| | | public class ReplyTemplateController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | IReplyTemplateService iReplyTemplateService; |
| | | |
| | | /** |
| | | * 获取模板列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取模板列表") |
| | | @GetMapping("/getlist") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "Name",required = false) String Name) |
| | | { |
| | | Page<ReplyTemplateEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<ReplyTemplateEntity> list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name); |
| | | int num=iReplyTemplateService.countNum(Name); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取详情") |
| | | @GetMapping("/getdata") |
| | | public ResultData selectConfigData(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("Id不能为空"); |
| | | } |
| | | return ResultData.success(iReplyTemplateService.selectConfigData(Id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增模板 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增模板") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody ReplyTemplateEntity entity,@CurrentUser SysUser sysUser) |
| | | { |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getName())) |
| | | { |
| | | return ResultData.error("模板名称不能为空"); |
| | | } |
| | | |
| | | entity.setId(null); |
| | | entity.setDepartmentId(sysUser.getDepartmentId()); |
| | | entity.setCreateUserId(sysUser.getUserId()+""); |
| | | |
| | | return toAjax(iReplyTemplateService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 更新模板 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("更新模板") |
| | | @PostMapping("/update") |
| | | public ResultData updateConfig(@RequestBody ReplyTemplateEntity entity) |
| | | { |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getName())) |
| | | { |
| | | return ResultData.error("模板名称不能为空"); |
| | | } |
| | | return toAjax(iReplyTemplateService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除模板 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除模板") |
| | | @DeleteMapping("/delete") |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | return toAjax(iReplyTemplateService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 复制模板 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("复制模板") |
| | | @PostMapping("/copy") |
| | | public ResultData copy(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("Id不能为空"); |
| | | } |
| | | |
| | | ReplyTemplateEntity entity=iReplyTemplateService.selectConfigData(Id); |
| | | |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("模板不存在!"); |
| | | } |
| | | entity.setId(null); |
| | | return toAjax(iReplyTemplateService.insertConfig(entity)); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.RoleManagementEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IRoleManagementService; |
| | | import com.dg.core.util.StringUtils; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"角色管理接口"}) |
| | | @RestController |
| | | @RequestMapping("/role") |
| | | public class RoleManagementController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | IRoleManagementService iRoleManagementService; |
| | | |
| | | /** |
| | | * 查询角色列表 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @ApiOperation("查询角色列表") |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
| | | if(pageNum==null) |
| | | { |
| | | return getDataTable("分页不能为空"); |
| | | } |
| | | |
| | | if(pageSize==null) |
| | | { |
| | | return getDataTable("分页条数不能为空"); |
| | | } |
| | | |
| | | Page<RoleManagementEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<RoleManagementEntity> list = iRoleManagementService.selectConfigList(pageParam,pageSize); |
| | | |
| | | int num=iRoleManagementService.countNum(); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 新增角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增角色") |
| | | @PostMapping("/add") |
| | | public ResultData insertConfig(@RequestBody RoleManagementEntity entity) |
| | | { |
| | | // entity.setCreateUserId(sysUser.getUserId()+""); |
| | | return toAjax(iRoleManagementService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("编辑角色") |
| | | @PostMapping("/update") |
| | | public ResultData updateConfig(@RequestBody RoleManagementEntity entity) |
| | | { |
| | | // entity.setUpdateUserId(sysUser.getUserId()+""); |
| | | return toAjax(iRoleManagementService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除角色 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("Id 不能为空"); |
| | | } |
| | | return toAjax(iRoleManagementService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.Agreement; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.dg.core.service.ISlideshowService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"轮播图接口"}) |
| | | @RestController |
| | | @RequestMapping("/slideshow") |
| | | public class SlideshowController extends BaseController{ |
| | | |
| | | @Autowired(required = true) |
| | | ISlideshowService iSlideshowService; |
| | | |
| | | /** |
| | | * 查询轮播图列表(不分页) |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询轮播图列表(不分页)",response = Slideshow.class) |
| | | @GetMapping("/selectList") |
| | | public ResultData selectList(){ |
| | | return ResultData.success(iSlideshowService.selectList()); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据id 查询轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation(value = "根据id 查询轮播图数据",response = Slideshow.class) |
| | | @GetMapping("/selectById") |
| | | public ResultData queryById(Integer id){ |
| | | return ResultData.success(iSlideshowService.queryById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id 新增轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation(value = "新增轮播图数据",response = Slideshow.class) |
| | | @PostMapping("/add") |
| | | public ResultData add(@RequestBody Slideshow slideshow){ |
| | | return iSlideshowService.add(slideshow); |
| | | } |
| | | |
| | | /** |
| | | * 修改轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation(value = "修改轮播图数据",response = Slideshow.class) |
| | | @PostMapping("/update") |
| | | public ResultData update(@RequestBody Slideshow slideshow){ |
| | | return iSlideshowService.update(slideshow); |
| | | } |
| | | |
| | | /** |
| | | * 删除轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation(value = "删除轮播图数据",response = Slideshow.class) |
| | | @GetMapping("/delete") |
| | | public ResultData delete(@RequestParam("id") Integer id){ |
| | | return iSlideshowService.delete(id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.manual.pojo.QueryResults; |
| | | import com.dg.core.db.manual.pojo.RecommendResult; |
| | | import com.dg.core.db.manual.pojo.Search; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"导办事项管理接口"}) |
| | | @RestController |
| | | @RequestMapping("/transaction") |
| | | public class TransactionEventController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | /** |
| | | * 查询导办事务详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("查询导办事务详情") |
| | | @GetMapping("/getData") |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | return ResultData.success(iTransactionEventService.selectConfigData(Id)); |
| | | } |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation("导办事物列表") |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "matterAndUser",required = false) String matterAndUser, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Page<TransactionEvent> pageParam = new Page<>(pageNum,pageSize); |
| | | List<TransactionEvent> list = iTransactionEventService.selectConfigList(pageParam,pageSize,matterAndUser,classifyGrade); |
| | | int num=iTransactionEventService.countNum(matterAndUser,classifyGrade); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 导办事物列表(不分页) |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导办事物列表(不分页)",response = TransactionEvent.class) |
| | | @GetMapping("/selectList") |
| | | public TableDataInfo selectList() |
| | | { |
| | | return getDataTable(iTransactionEventService.selectList()); |
| | | } |
| | | |
| | | /** |
| | | * 新增导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增导办事务") |
| | | @PostMapping("/add") |
| | | public ResultData insertConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | return toAjax(iTransactionEventService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 修改导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("修改导办事务") |
| | | @PostMapping("/update") |
| | | public ResultData updateConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | return toAjax(iTransactionEventService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除接口 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除导办事务") |
| | | @DeleteMapping("/delete") |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | return toAjax(iTransactionEventService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | /** |
| | | * 导办事务搜索 |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导办事务搜索",response = QueryResults.class) |
| | | @GetMapping("/queryKeyWordList") |
| | | public QueryResults queryMatterNameList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "recommendSize",required = false) Integer recommendSize, |
| | | @RequestParam(value = "keyWord",required = false) String keyWord) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Assert.notNull(keyWord, "keyWord 不能为空"); |
| | | Assert.notNull(keyWord, "recommendSize 不能为空"); |
| | | Page<Search> pageParam = new Page<>(pageNum,pageSize); |
| | | QueryResults queryResults = iTransactionEventService.queryMatterNameList(pageParam, pageSize,recommendSize, keyWord); |
| | | return queryResults; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据分离查询导办事务 |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据分类查询导办事务",response = TransactionEvent.class) |
| | | @GetMapping("/queryByClassifyIdList") |
| | | public TableDataInfo queryByClassifyIdList(@RequestParam("classifyId") String classifyId,@RequestParam(required = false,name="departmentId") Integer departmentId){ |
| | | return getDataTable(iTransactionEventService.queryByClassifyIdList(classifyId,departmentId),iTransactionEventService.countNumByClassifyIdList(classifyId,departmentId)); |
| | | } |
| | | |
| | | /** |
| | | * 根据查询时间查询导办事务 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据查询时间查询导办事务",response = TransactionEvent.class) |
| | | @GetMapping("/queryByQueryTime") |
| | | public TableDataInfo queryByQueryTime() { |
| | | List<TransactionEvent> transactionEvents = iTransactionEventService.queryByQueryTime( ); |
| | | return getDataTable(transactionEvents); |
| | | } |
| | | |
| | | /** |
| | | * 根据浏览次数查询导办事务 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据浏览次数查询导办事务",response = TransactionEvent.class) |
| | | @GetMapping("/queryByBrowseNum") |
| | | public TableDataInfo queryByBrowseNum() { |
| | | List<TransactionEvent> transactionEvents = iTransactionEventService.queryByBrowseNum( ); |
| | | return getDataTable(transactionEvents); |
| | | } |
| | | |
| | | /** |
| | | * 查询导办事务求和 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询导办事务求和",response = TransactionEvent.class) |
| | | @GetMapping("/sumTransactionNum") |
| | | public ResultData sumTransactionNum(){ |
| | | return ResultData.success(iTransactionEventService.sumTransactionNum()); |
| | | } |
| | | |
| | | /** |
| | | * 智能咨询 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "智能咨询",response = RecommendResult.class) |
| | | @GetMapping("/smartConsulting") |
| | | public RecommendResult smartConsulting(@RequestParam("keyWord") String keyWord){ |
| | | return iTransactionEventService.smartConsulting(keyWord); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.HttpStatus; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags = {"用户接口"}) |
| | | @RestController |
| | | @RequestMapping("/user") |
| | | public class UserController extends BaseController{ |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | @ApiOperation("登录接口") |
| | | @PostMapping(path = "/login") |
| | | public ResultData login(@RequestParam String account, @RequestParam String password, HttpServletRequest request) { |
| | | Assert.notNull(account, "username can not be empty"); |
| | | Assert.notNull(password, "password can not be empty"); |
| | | |
| | | SysUser user = IUserService.getUserByAccount(account); |
| | | if (user == null || !password.equals(user.getPassword())) { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "用户名或密码错误"); |
| | | } |
| | | |
| | | String token = tokenManager.getTokenByUserId(user.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | | System.out.println("token "+token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(user.getUserId(), user.getUserId()); |
| | | } |
| | | |
| | | user.setLoginDate(LocalDateTime.now()); |
| | | //更新登录时间 |
| | | IUserService.updateConfig(user); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", user.getUserId()); |
| | | map.put("userName", user.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation("用户列表接口") |
| | | @GetMapping("/getlist") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<SysUser> pageParam = new Page<>(pageNum,pageSize); |
| | | List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"1"); |
| | | |
| | | int num=IUserService.selectNum("1"); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增用户 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("新增用户接口") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody SysUser config) |
| | | { |
| | | Assert.notNull(config, "parameter can not be empty"); |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | | { |
| | | return error("账户不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getPassword())) |
| | | { |
| | | return error("密码不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getUserName())) |
| | | { |
| | | return error("昵称不能为空"); |
| | | } |
| | | |
| | | SysUser user = IUserService.getUserByAccount(config.getLoginName()); |
| | | if (user != null) { |
| | | //提示用户名或密码错误 |
| | | return error("该账户已存在!"); |
| | | } |
| | | |
| | | config.setUserType("1"); |
| | | |
| | | config.setCreateTime(LocalDateTime.now()); |
| | | config.setUpdateTime(LocalDateTime.now()); |
| | | |
| | | return toAjax(IUserService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 更新聊天记录 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("修改用户接口") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody SysUser config) |
| | | { |
| | | if(config.getUserId()==null) |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | | { |
| | | return error("账户不能为空"); |
| | | } |
| | | |
| | | config.setUserType("1"); |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户记录 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("删除用户接口(真删除)") |
| | | @DeleteMapping("/delete/{userId}") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@PathVariable("userId") String userId) |
| | | { |
| | | if(StringUtils.isEmpty(userId)) |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | return toAjax(IUserService.deleteConfigById(userId)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除用户记录 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("删除用户接口(修改状态 设置成已删除)") |
| | | @DeleteMapping("/deleteflag/{userId}") |
| | | @Authorization |
| | | public ResultData delete(@PathVariable("userId") String userId) |
| | | { |
| | | if(StringUtils.isEmpty(userId)) |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | SysUser sysUser=IUserService.getUserById(Long.valueOf(userId)); |
| | | //删除标志(0代表存在 2代表删除) |
| | | sysUser.setDelFlag("2"); |
| | | return toAjax(IUserService.updateConfig(sysUser)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改用户密码接口 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("修改用户密码接口") |
| | | @PostMapping("/updatepws") |
| | | @Authorization |
| | | public ResultData updatePws(@RequestBody SysUser config) |
| | | { |
| | | if(config.getUserId()==null) |
| | | { |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getPassword())) |
| | | { |
| | | return error("密码不能为空"); |
| | | } |
| | | |
| | | SysUser sysUser=IUserService.getUserById(config.getUserId()); |
| | | if(sysUser==null) |
| | | { |
| | | return error("用户不存在"); |
| | | } |
| | | |
| | | if(StringUtils.equals(sysUser.getPassword(),config.getPassword())) |
| | | { |
| | | return error("输入密码与原密码不能相同!"); |
| | | } |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.manual.mapper.util.ConstantPropertiesUtil; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Controller |
| | | @RequestMapping("/ucenter/wx") |
| | | public class WeixinApiController { |
| | | |
| | | // @Resource |
| | | // private UserInfoService userInfoService; |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * 获取微信登录参数 |
| | | */ |
| | | @GetMapping("/getLoginParam") |
| | | @ResponseBody |
| | | public ResultData genQrConnect(HttpSession session) throws UnsupportedEncodingException { |
| | | String redirectUri = URLEncoder.encode(ConstantPropertiesUtil.WX_OPEN_REDIRECT_URL, "UTF-8"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appid", ConstantPropertiesUtil.WX_OPEN_APP_ID); |
| | | map.put("redirectUri", redirectUri); |
| | | map.put("scope", "snsapi_login"); |
| | | map.put("state", System.currentTimeMillis()+"");//System.currentTimeMillis()+"" |
| | | return ResultData.success(map); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen; |
| | | |
| | | import com.dg.core.HttpStatus; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * 操作消息提醒 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @ApiModel(value = "返回对象") |
| | | public class AjaxResult<T> extends HashMap<String, Object> |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 状态码 */ |
| | | public static final String CODE_TAG = "code"; |
| | | |
| | | /** 返回内容 */ |
| | | public static final String MSG_TAG = "msg"; |
| | | |
| | | /** 数据对象 */ |
| | | public static final String DATA_TAG = "data"; |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 |
| | | */ |
| | | public AjaxResult() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | */ |
| | | public AjaxResult(int code, String msg) |
| | | { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | } |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | */ |
| | | public AjaxResult(int code, String msg, Object data) |
| | | { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | super.put(DATA_TAG, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success() |
| | | { |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功数据 |
| | | * |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(Object data) |
| | | { |
| | | |
| | | |
| | | return AjaxResult.success("操作成功", data); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(String msg) |
| | | { |
| | | return AjaxResult.success(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.SUCCESS, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static AjaxResult error() |
| | | { |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 警告消息 |
| | | */ |
| | | public static AjaxResult error(String msg) |
| | | { |
| | | return AjaxResult.error(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 警告消息 |
| | | */ |
| | | public static AjaxResult error(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.ERROR, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | * @return 警告消息 |
| | | */ |
| | | public static AjaxResult error(int code, String msg) |
| | | { |
| | | return new AjaxResult(code, msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 方便链式调用 |
| | | * |
| | | * @param key 键 |
| | | * @param value 值 |
| | | * @return 数据对象 |
| | | */ |
| | | @Override |
| | | public AjaxResult put(String key, Object value) |
| | | { |
| | | super.put(key, value); |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 相关协议 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-22 |
| | | */ |
| | | @TableName("agreement") |
| | | @Data |
| | | @ApiModel("相关协议实体类") |
| | | public class Agreement implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 协议名称 |
| | | */ |
| | | @ApiModelProperty("协议名称") |
| | | private String agreement; |
| | | |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty("修改人id") |
| | | private String updateUserId; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty("修改时间") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty("创建人id") |
| | | private String createUserId; |
| | | |
| | | /** |
| | | * 协议内容 |
| | | */ |
| | | @ApiModelProperty("协议内容") |
| | | private String agreementContent; |
| | | |
| | | /** |
| | | * 上次修改人名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("上次修改人名称") |
| | | private String updateUserName; |
| | | |
| | | /** |
| | | * 创建人名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("创建人名称") |
| | | private String createUserName; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-20 |
| | | */ |
| | | @TableName("area_code_2022") |
| | | @Data |
| | | @ApiModel("所属地区实体类") |
| | | public class AreaCode2022 implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 区划代码 |
| | | */ |
| | | @ApiModelProperty("区划代码") |
| | | private Long code; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty("name") |
| | | private String name; |
| | | |
| | | /** |
| | | * 级别1-5,省市县镇村 |
| | | */ |
| | | @ApiModelProperty("级别1-5,省市县镇村") |
| | | private Boolean level; |
| | | |
| | | /** |
| | | * 父级区划代码 |
| | | */ |
| | | @ApiModelProperty("父级区划代码") |
| | | private Long pcode; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @ApiModel("分类管理实体类") |
| | | @Data |
| | | public class ClassifyAdministration implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(name = "id", value = "主键") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 分类级别 1 一级 2 二级 |
| | | */ |
| | | @ApiModelProperty(name = "classifyGrade", value = "分类级别 1 一级 2 二级 ") |
| | | private String classifyGrade; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(name = "createTime", value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(name = "updateTime", value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 分类图片地址 |
| | | */ |
| | | @ApiModelProperty(name = "classifyIcon", value = "分类图片地址") |
| | | private String classifyIcon; |
| | | |
| | | /** |
| | | * 上级分类 |
| | | */ |
| | | @ApiModelProperty(name = "parentId", value = "上级分类") |
| | | private String parentId; |
| | | |
| | | /** |
| | | * 分类名字 |
| | | */ |
| | | @ApiModelProperty(name = "classifyName", value = "分类名字") |
| | | private String classifyName; |
| | | |
| | | /** |
| | | * 父级分类名字 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "parentName", value = "父级分类名字") |
| | | private String parentName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "ClassifyAdministrationEntityList", value = "父级分类名字") |
| | | private List<ClassifyAdministration> ClassifyAdministrationEntityList; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("其他附件管理实体类") |
| | | public class ElseAccessoryEntity implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(name = "id", value = "主键") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 部门id |
| | | */ |
| | | @ApiModelProperty(name = "departmentId", value = "部门id") |
| | | private String departmentId; |
| | | |
| | | /** |
| | | * 部门id |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "departmentName", value = "部门名称") |
| | | private String departmentName; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(name = "createTime", value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(name = "updateTime", value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 事项名称 |
| | | */ |
| | | @ApiModelProperty(name = "name", value = "事项名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 文件地址 |
| | | */ |
| | | @ApiModelProperty(name = "url", value = "文件地址") |
| | | private String url; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("导办工单进展记录表") |
| | | public class GuideEvolveEntity implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(name = "id", value = "主键") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * 发起人部门id |
| | | */ |
| | | @ApiModelProperty(name = "departmentalId", value = "发起人部门id") |
| | | private String departmentalId; |
| | | |
| | | /** |
| | | * 接收人部门id |
| | | */ |
| | | @ApiModelProperty(name = "fromDepartmentalId", value = "接收人部门id") |
| | | private String fromDepartmentalId; |
| | | |
| | | /** |
| | | * 发起人 |
| | | */ |
| | | @ApiModelProperty(name = "toUserId", value = "发起人") |
| | | private String toUserId; |
| | | |
| | | /** |
| | | * 接收人 |
| | | */ |
| | | @ApiModelProperty(name = "fromUserId", value = "接收人") |
| | | private String fromUserId; |
| | | |
| | | /** |
| | | * 状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消6 已超时 7超时未办结 8未解决 9已解决 10 系统自动分配 11 回复 12转派 13手动分配) |
| | | */ |
| | | @ApiModelProperty(name = "state", value = "状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消6 已超时 7超时未办结 8未解决 9已解决 10 系统自动分配 11 回复 12转派 13手动分配)") |
| | | private String state; |
| | | |
| | | /** |
| | | * 备注内容 |
| | | */ |
| | | @ApiModelProperty(name = "remark", value = "备注内容") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 工单id |
| | | */ |
| | | @ApiModelProperty(name = "guideId", value = "工单id") |
| | | private String guideId; |
| | | |
| | | /** |
| | | * 办事指南id |
| | | */ |
| | | @ApiModelProperty(name = "transactionId", value = "办事指南id") |
| | | private String transactionId; |
| | | |
| | | /** |
| | | * 附件id(系统列表选择) |
| | | */ |
| | | @ApiModelProperty(name = "accessoryId", value = "附件id(系统列表选择)") |
| | | private String accessoryId; |
| | | |
| | | /** |
| | | * 用户手动上传附件名称 |
| | | */ |
| | | @ApiModelProperty(name = "accessoryName", value = "用户手动上传附件名称") |
| | | private String accessoryName; |
| | | |
| | | /** |
| | | * 用户手动上传附件url |
| | | */ |
| | | @ApiModelProperty(name = "accessoryUrl", value = "用户手动上传附件url") |
| | | private String accessoryUrl; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(name = "updateTime", value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(name = "updateTime", value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 导办工单管理 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-19 |
| | | */ |
| | | @TableName("guide_repair_order") |
| | | @Data |
| | | @ApiModel("导办工单管理实体类") |
| | | public class GuideRepairOrder implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @ApiModelProperty("工单号") |
| | | private String orderNum; |
| | | |
| | | /** |
| | | * 事项id |
| | | */ |
| | | @ApiModelProperty("事项id") |
| | | private Integer matterId; |
| | | |
| | | /** |
| | | * 事项名称 |
| | | */ |
| | | @ApiModelProperty("事项名称") |
| | | private String matterName; |
| | | |
| | | /** |
| | | * 创建部门id |
| | | */ |
| | | @ApiModelProperty("创建部门id") |
| | | private String departmentId; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty("分类id") |
| | | private String classifyId; |
| | | |
| | | /** |
| | | * 咨询内容 |
| | | */ |
| | | @ApiModelProperty("咨询内容") |
| | | private String consultContent; |
| | | |
| | | /** |
| | | * 咨询人姓名 |
| | | */ |
| | | @ApiModelProperty("咨询人姓名") |
| | | private String consultUserName; |
| | | |
| | | /** |
| | | * 提交用户 |
| | | */ |
| | | @ApiModelProperty("提交用户") |
| | | private String submitUserId; |
| | | |
| | | /** |
| | | * 导办人员 |
| | | */ |
| | | @ApiModelProperty("导办人员") |
| | | private String guideUserId; |
| | | |
| | | /** |
| | | * 导办部门 |
| | | */ |
| | | @ApiModelProperty("导办部门") |
| | | private String guideDepartmentId; |
| | | |
| | | /** |
| | | * 状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6 已超时 7超时未办结 8未解决 9已解决) |
| | | */ |
| | | @ApiModelProperty("状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6 已超时 7超时未办结 8未解决 9已解决)") |
| | | private String state; |
| | | |
| | | /** |
| | | * 咨询人电话 |
| | | */ |
| | | @ApiModelProperty("咨询人电话") |
| | | private String consultUserPhone; |
| | | |
| | | /** |
| | | * 提交用户电话 |
| | | */ |
| | | @ApiModelProperty("提交用户电话") |
| | | private String submitUserPhone; |
| | | |
| | | /** |
| | | * 导办人员电话 |
| | | */ |
| | | @ApiModelProperty("导办人员电话") |
| | | private String guideUserPhone; |
| | | |
| | | /** |
| | | * 所属地区 |
| | | */ |
| | | @ApiModelProperty("所属地区") |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 详情地址 |
| | | */ |
| | | @ApiModelProperty("详情地址") |
| | | private String detailedAddress; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "images", value = "图片地址(用逗号分隔)") |
| | | private String images; |
| | | |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "guideRepairOrderList", value = "工单处理进度") |
| | | List<GuideEvolveEntity> guideEvolveEntities; |
| | | |
| | | |
| | | @ApiModelProperty(name = "evaluateContent", value = "评价内容") |
| | | private String evaluateContent; |
| | | |
| | | @ApiModelProperty(name = "suggest", value = "建议") |
| | | private String suggest; |
| | | |
| | | @ApiModelProperty(name = "evaluateState", value = "评价状态") |
| | | private String evaluateState; |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "GuideRepairOrder{" + |
| | | "id=" + id + |
| | | ", orderNum=" + orderNum + |
| | | ", matterId=" + matterId + |
| | | ", matterName=" + matterName + |
| | | ", departmentId=" + departmentId + |
| | | ", classifyId=" + classifyId + |
| | | ", consultContent=" + consultContent + |
| | | ", consultUserId=" + consultUserName + |
| | | ", submitUserId=" + submitUserId + |
| | | ", guideUserId=" + guideUserId + |
| | | ", guideDepartmentId=" + guideDepartmentId + |
| | | ", state=" + state + |
| | | ", consultUserPhone=" + consultUserPhone + |
| | | ", submitUserPhone=" + submitUserPhone + |
| | | ", guideUserPhone=" + guideUserPhone + |
| | | "}"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 导办功能图片表 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-19 |
| | | */ |
| | | @TableName("guide_repair_order_image") |
| | | @ApiModel("导办工单图片管理实体类") |
| | | @Data |
| | | public class GuideRepairOrderImage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 导办工单id |
| | | */ |
| | | @ApiModelProperty("导办工单id") |
| | | private String guideRepairOrderId; |
| | | |
| | | /** |
| | | * 路径 |
| | | */ |
| | | @ApiModelProperty("路径") |
| | | private String url; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "GuideRepairOrderImg{" + |
| | | "id=" + id + |
| | | ", guideRepairOrderId=" + guideRepairOrderId + |
| | | ", url=" + url + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @ApiModel("关键词实体类") |
| | | @Data |
| | | @TableName("keyword") |
| | | public class KeywordEntity implements Serializable |
| | | { |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | @ApiModelProperty("关键词关联ids") |
| | | private String transactionId; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @ApiModel("菜单实体类") |
| | | @Data |
| | | public class MenuEntity implements Serializable |
| | | { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | /** |
| | | * 父节点id |
| | | */ |
| | | @ApiModelProperty("父节点id") |
| | | private Long parentId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @ApiModel("组织架构实体类") |
| | | @Data |
| | | @TableName("organization_chart") |
| | | public class OrganizationChartEntity implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty("单位名称") |
| | | private String organizationName; |
| | | |
| | | /** |
| | | * 办理区域(市) |
| | | */ |
| | | @ApiModelProperty("办理区域(市)") |
| | | private String city; |
| | | |
| | | |
| | | /** |
| | | * 办理区域(区) |
| | | */ |
| | | @ApiModelProperty("办理区域(区)") |
| | | private String district; |
| | | |
| | | /** |
| | | * 办理区域(乡) |
| | | */ |
| | | @ApiModelProperty("办理区域(乡)") |
| | | private String village; |
| | | |
| | | /** |
| | | * 详细地址 |
| | | */ |
| | | @ApiModelProperty("详细地址") |
| | | private String detailedAddress; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | /** |
| | | * 父级单位id |
| | | */ |
| | | @ApiModelProperty("父级单位id") |
| | | private String parentId; |
| | | |
| | | /** |
| | | * 机构等级 |
| | | */ |
| | | @ApiModelProperty("机构等级") |
| | | private String grade; |
| | | |
| | | /** |
| | | * 机构等级 |
| | | */ |
| | | @ApiModelProperty("部门简历") |
| | | private String resume; |
| | | |
| | | /** |
| | | * 机构等级 |
| | | */ |
| | | @ApiModelProperty("联系电话") |
| | | private String contactNumber; |
| | | |
| | | /** |
| | | * 机构等级 |
| | | */ |
| | | @ApiModelProperty("部门应用") |
| | | private String departmentalApplication; |
| | | |
| | | /** |
| | | * 下属机构 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("下属机构") |
| | | private List<OrganizationChartEntity> child; |
| | | |
| | | /** |
| | | * 父级部门名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("下属机构") |
| | | private String parentName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @ApiModel("回复模板实体类") |
| | | @Data |
| | | public class ReplyTemplateEntity implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 模板名称 |
| | | */ |
| | | @ApiModelProperty("模板名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 办结状态(1已办结 0未办结) |
| | | */ |
| | | @ApiModelProperty("办结状态(1已办结 0未办结)") |
| | | private String handleState; |
| | | |
| | | /** |
| | | * 回复内容 |
| | | */ |
| | | @ApiModelProperty("回复内容") |
| | | private String response; |
| | | |
| | | /** |
| | | * 办事指南 |
| | | */ |
| | | @ApiModelProperty("办事指南 ") |
| | | private String guidance; |
| | | |
| | | /** |
| | | * 上传附件url |
| | | */ |
| | | @ApiModelProperty("上传附件url") |
| | | private String accessoryUrl; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty("上传附件名字") |
| | | private String accessoryName; |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty("视频url") |
| | | private String videoUrl; |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty("视频名字") |
| | | private String videoName; |
| | | |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty("图片url") |
| | | private String pictureUrl; |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @ApiModelProperty("图片名字") |
| | | private String pictureName; |
| | | |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty("创建人id") |
| | | private String createUserId; |
| | | |
| | | |
| | | /** |
| | | * 创建人姓名 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("创建人姓名") |
| | | private String createUser; |
| | | |
| | | /** |
| | | * 创建人部门id |
| | | */ |
| | | @ApiModelProperty("创建人部门id") |
| | | private String departmentId; |
| | | |
| | | /** |
| | | * 创建人部门名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("创建人部门名称") |
| | | private String departmentName; |
| | | |
| | | /** |
| | | * 附件id |
| | | */ |
| | | @ApiModelProperty("附件id") |
| | | private String accessoryId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | @ApiModel("角色管理实体类") |
| | | @Data |
| | | @TableName("role_management") |
| | | public class RoleManagementEntity implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("角色名称") |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 创建者id |
| | | */ |
| | | @ApiModelProperty("创建者id") |
| | | private String createUserId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 修改人员id |
| | | */ |
| | | @ApiModelProperty("修改人员id") |
| | | private String updateUserId; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty("修改时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | /** |
| | | * 权限 |
| | | */ |
| | | @ApiModelProperty("权限") |
| | | private String permission; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-19 |
| | | */ |
| | | @ApiModel("轮播图实体类") |
| | | @Data |
| | | @TableName("slideshow") |
| | | public class Slideshow implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 图片地址 |
| | | */ |
| | | @ApiModelProperty("图片地址") |
| | | private String url; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 链接类型(1.暂不设置2.富文本3.微信文章) |
| | | */ |
| | | @ApiModelProperty("链接类型(1.暂不设置2.富文本3.微信文章)") |
| | | private Integer linkType; |
| | | |
| | | /** |
| | | * 文章链接 |
| | | */ |
| | | @ApiModelProperty("文章链接") |
| | | private String link; |
| | | |
| | | /** |
| | | * 文章标题 |
| | | */ |
| | | @ApiModelProperty("文章标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 文章内容 |
| | | */ |
| | | @ApiModelProperty("文章内容") |
| | | private String content; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户信息表 |
| | | * </p> |
| | | * |
| | | * @author xiang |
| | | * @since 2022-07-05 |
| | | */ |
| | | @ApiModel("用户信息实体类") |
| | | @Data |
| | | @TableName("sys_user") |
| | | public class SysUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | | * 登录账号 |
| | | */ |
| | | @ApiModelProperty("登录账号") |
| | | private String loginName; |
| | | |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | @ApiModelProperty("用户昵称") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 用户类型(1系统后台用户 2导办人员用户) |
| | | */ |
| | | @ApiModelProperty("用户类型(1系统后台用户 2导办人员用户)") |
| | | private String userType; |
| | | |
| | | |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | @ApiModelProperty("手机号码") |
| | | private String phonenumber; |
| | | |
| | | /** |
| | | * 用户性别(0男 1女 2未知) |
| | | */ |
| | | @ApiModelProperty("用户性别(0男 1女 2未知)") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 头像路径 |
| | | */ |
| | | @ApiModelProperty("头像路径") |
| | | private String avatar; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @ApiModelProperty("密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 盐加密 |
| | | */ |
| | | @ApiModelProperty("加密") |
| | | private String salt; |
| | | |
| | | /** |
| | | * 帐号状态(0正常 1停用) |
| | | */ |
| | | @ApiModelProperty("帐号状态(0正常 1停用)") |
| | | private String status; |
| | | |
| | | /** |
| | | * 删除标志(0代表存在 2代表删除) |
| | | */ |
| | | @ApiModelProperty("删除标志(0代表存在 2代表删除)") |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * 最后登录IP |
| | | */ |
| | | @ApiModelProperty("最后登录IP") |
| | | private String loginIp; |
| | | |
| | | /** |
| | | * 最后登录时间 |
| | | */ |
| | | @ApiModelProperty("最后登录时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime loginDate; |
| | | |
| | | /** |
| | | * 密码最后更新时间 |
| | | */ |
| | | @ApiModelProperty("密码最后更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime pwdUpdateDate; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty("创建者") |
| | | private String createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新者 |
| | | */ |
| | | @ApiModelProperty("更新者") |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 角色ids |
| | | */ |
| | | @ApiModelProperty("角色id") |
| | | private String roleIds; |
| | | |
| | | /** |
| | | * 数据权限 |
| | | */ |
| | | @ApiModelProperty("数据权限") |
| | | private String dataPermission; |
| | | |
| | | /** |
| | | * 部门id |
| | | */ |
| | | @ApiModelProperty("部门id") |
| | | private String departmentId; |
| | | |
| | | |
| | | /** |
| | | * 一级id |
| | | */ |
| | | @ApiModelProperty("一级id") |
| | | private String stairId; |
| | | |
| | | /** |
| | | * 二级id |
| | | */ |
| | | @ApiModelProperty("二级id") |
| | | private String secondLevelId; |
| | | |
| | | /** |
| | | * 所属部门名称 |
| | | */ |
| | | @ApiModelProperty("所属部门名称") |
| | | private String departmentName; |
| | | |
| | | /** |
| | | * 部门所属区域 |
| | | */ |
| | | @ApiModelProperty("部门所属区域") |
| | | private String departmentArea; |
| | | |
| | | /** |
| | | * 空闲状态(0 空闲 1 忙碌) |
| | | */ |
| | | @ApiModelProperty("空闲状态(0 空闲 1 忙碌)") |
| | | private String leisureState; |
| | | |
| | | /** |
| | | * 擅长办理事务ids |
| | | */ |
| | | @ApiModelProperty("擅长办理事务ids") |
| | | private String masterIds; |
| | | |
| | | /** |
| | | * 擅长事务名称 |
| | | */ |
| | | @ApiModelProperty("擅长事务名称") |
| | | private String masterNames; |
| | | |
| | | /** |
| | | * 办结事项ids |
| | | */ |
| | | @ApiModelProperty("办结事项ids") |
| | | private String transactionIds; |
| | | |
| | | /** |
| | | * 办结事项名称 |
| | | */ |
| | | @ApiModelProperty("办结事项名称") |
| | | private String transactionNames; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @ApiModel("导办事项管理实体类") |
| | | @Data |
| | | public class TransactionEvent implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 所属部门id |
| | | */ |
| | | @ApiModelProperty("所属部门id") |
| | | private String departmentId; |
| | | |
| | | /** |
| | | * 部门所属区域 |
| | | */ |
| | | @ApiModelProperty("部门所属区域") |
| | | private String departmentArea; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty("分类id") |
| | | private String classifyId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("所属分类等级") |
| | | private String classifyName; |
| | | /** |
| | | * 事项名称 |
| | | */ |
| | | @ApiModelProperty("事项名称") |
| | | private String matterName; |
| | | |
| | | /** |
| | | * 联想词ids |
| | | */ |
| | | @ApiModelProperty("联想词ids") |
| | | private String associateIds; |
| | | |
| | | /** |
| | | * 导办数量 |
| | | */ |
| | | @ApiModelProperty("导办数量") |
| | | private Integer transactionNum=0; |
| | | |
| | | /** |
| | | * 浏览数量 |
| | | */ |
| | | @ApiModelProperty("浏览数量") |
| | | private Integer browseNum=0; |
| | | |
| | | /** |
| | | * 基础信息 |
| | | */ |
| | | @ApiModelProperty("基础信息") |
| | | private String basicInformation; |
| | | |
| | | /** |
| | | * 受理条件 |
| | | */ |
| | | @ApiModelProperty("受理条件") |
| | | private String acceptConditions; |
| | | |
| | | /** |
| | | * 申请材料 |
| | | */ |
| | | @ApiModelProperty("申请材料") |
| | | private String applicationMaterial; |
| | | |
| | | /** |
| | | * 办理流程 |
| | | */ |
| | | @ApiModelProperty("办理流程") |
| | | private String handlingProcedures; |
| | | |
| | | /** |
| | | * 收费标准 |
| | | */ |
| | | @ApiModelProperty("收费标准") |
| | | private String rates; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty("更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | /** |
| | | * 联想词内容 , 连接 |
| | | */ |
| | | @ApiModelProperty("联想词内容 , 连接") |
| | | private String associateNames; |
| | | /** |
| | | * 查找时间 |
| | | */ |
| | | @ApiModelProperty("查找时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime queryTime; |
| | | /** |
| | | * 基础信息附件url |
| | | */ |
| | | @ApiModelProperty("基础信息附件url") |
| | | private String basicInformationUrl; |
| | | /** |
| | | * 受理条件附件url |
| | | */ |
| | | @ApiModelProperty("受理条件附件url") |
| | | private String acceptConditionsUrl; |
| | | /** |
| | | * 申请材料附件url |
| | | */ |
| | | @ApiModelProperty("申请材料附件url") |
| | | private String applicationMaterialUrl; |
| | | /** |
| | | * 办理流程附件url |
| | | */ |
| | | @ApiModelProperty("办理流程附件url") |
| | | private String handlingProceduresUrl; |
| | | /** |
| | | * 收费标准附件url |
| | | */ |
| | | @ApiModelProperty("收费标准附件url") |
| | | private String ratesUrl; |
| | | /** |
| | | * 基础信息附件url |
| | | */ |
| | | @ApiModelProperty("基础信息附件url") |
| | | private String basicInformationFileName; |
| | | /** |
| | | * 附件url |
| | | */ |
| | | @ApiModelProperty("附件url") |
| | | private String acceptConditionsFileName; |
| | | /** |
| | | * 申请材料文件名称 |
| | | */ |
| | | @ApiModelProperty("申请材料文件名称") |
| | | private String applicationMaterialFileName; |
| | | /** |
| | | * 办理流程文件名称 |
| | | */ |
| | | @ApiModelProperty("办理流程文件名称") |
| | | private String handlingProceduresFileName; |
| | | /** |
| | | * 收费标准文件名称 |
| | | */ |
| | | @ApiModelProperty("收费标准文件名称") |
| | | private String ratesFileName; |
| | | |
| | | |
| | | /** |
| | | * 操作指引附件url |
| | | */ |
| | | @ApiModelProperty("操作指引附件url") |
| | | private String operationalGuidelineUrl; |
| | | |
| | | |
| | | /** |
| | | * 操作指引视频url |
| | | */ |
| | | @ApiModelProperty("操作指引视频url") |
| | | private String operationalGuidelineVideoUrl; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设定依据 |
| | | */ |
| | | @ApiModelProperty("设定依据") |
| | | private String setGist; |
| | | /** |
| | | * 设定依据url |
| | | */ |
| | | @ApiModelProperty("设定依据url") |
| | | private String setGistUrl; |
| | | /** |
| | | * 设定依据文件名称 |
| | | */ |
| | | @ApiModelProperty("设定依据文件名称") |
| | | private String setGistName; |
| | | |
| | | /** |
| | | * 常见问题 |
| | | */ |
| | | @ApiModelProperty("常见问题") |
| | | private String commonProblem; |
| | | |
| | | /** |
| | | * 常见问题附件url |
| | | */ |
| | | @ApiModelProperty("常见问题附件url") |
| | | private String commonProblemUrl; |
| | | |
| | | /** |
| | | * 常见问题文件名称 |
| | | */ |
| | | @ApiModelProperty("常见问题文件名称") |
| | | private String commonProblemName; |
| | | |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "sumTransactionNum", value = "导办服务数量") |
| | | private Integer sumTransactionNum; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "countTransaction", value = "导办服务指南数量") |
| | | private Integer countTransaction; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "sumClassifyName", value = "分类总名称") |
| | | String sumClassifyName; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.Agreement; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 相关协议 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-22 |
| | | */ |
| | | public interface AgreementMapper extends BaseMapper<Agreement> { |
| | | |
| | | |
| | | /** |
| | | * 获取相关附件列表(不分页) |
| | | * @return |
| | | */ |
| | | List<Agreement> selectConfigList(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-20 |
| | | */ |
| | | public interface AreaCode2022Mapper extends BaseMapper<AreaCode2022> { |
| | | |
| | | /** |
| | | * 根据指南id获取所属地区 |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> selectByIdSet( List<String> areaCodes); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ClassifyAdministrationMapper extends BaseMapper<ClassifyAdministration> |
| | | { |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | | */ |
| | | public List<ClassifyAdministration> selectConfigList(@Param("classifyName") String classifyName, |
| | | @Param("classifyGrade") String classifyGrade); |
| | | |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | | */ |
| | | public List<ClassifyAdministration> selectConfigList(IPage<ClassifyAdministration> page, |
| | | Integer state, |
| | | @Param("classifyName") String classifyName, |
| | | @Param("classifyGrade") String classifyGrade); |
| | | |
| | | /** |
| | | * 新增分类 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(ClassifyAdministration entity); |
| | | |
| | | /** |
| | | * 更新分类 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(ClassifyAdministration entity); |
| | | |
| | | /** |
| | | * 删除分类 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @return |
| | | */ |
| | | public int countNum(@Param("classifyName") String classifyName, |
| | | @Param("classifyGrade") String classifyGrade); |
| | | |
| | | |
| | | /** |
| | | * 获取管理菜单列表(根目录分页) |
| | | * @return |
| | | */ |
| | | List<ClassifyAdministration> selectRootList (IPage<ClassifyAdministration> page, Integer state,@Param("parentId")String parentId,@Param("departmentId")Integer departmentId); |
| | | |
| | | /** |
| | | * 获取管理菜单列表(根目录不分页) |
| | | * @return |
| | | */ |
| | | List<ClassifyAdministration> selectRootList (@Param("parentId")String parentId,@Param("departmentId")Integer departmentId); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ElseAccessoryMapper extends BaseMapper<ElseAccessoryEntity> |
| | | { |
| | | |
| | | /** |
| | | * 获取附件列表 |
| | | * @param page |
| | | * @param state |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public List<ElseAccessoryEntity> selectConfigList(IPage<ElseAccessoryEntity> page, Integer state, @Param("Name") String Name); |
| | | |
| | | /** |
| | | * 获取附件列表全部 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public List<ElseAccessoryEntity> selectConfigList(@Param("Name") String Name); |
| | | |
| | | |
| | | /** |
| | | * 新增列表 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(ElseAccessoryEntity entity); |
| | | |
| | | /** |
| | | * 更新列表 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(ElseAccessoryEntity entity); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public int countNum(String Name); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface GuideEvolveMapper extends BaseMapper<GuideEvolveEntity> |
| | | { |
| | | |
| | | /** |
| | | * 查询记录列表 |
| | | * @return |
| | | */ |
| | | public List<GuideEvolveEntity> selectConfigList(String guideId); |
| | | |
| | | /** |
| | | * 新增记录 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(GuideEvolveEntity entity); |
| | | |
| | | /** |
| | | * 更新记录 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(GuideEvolveEntity entity); |
| | | |
| | | /** |
| | | * 删除记录 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.GuideRepairOrderImage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 导办功能图片表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-19 |
| | | */ |
| | | public interface GuideRepairOrderImageMapper extends BaseMapper<GuideRepairOrderImage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * 导办工单管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-19 |
| | | */ |
| | | public interface GuideRepairOrderMapper extends BaseMapper<GuideRepairOrder> |
| | | { |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @param orderNum |
| | | * @return |
| | | */ |
| | | public GuideRepairOrder selectConfigData(@Param("Id") String Id, |
| | | @Param("orderNum") String orderNum); |
| | | |
| | | |
| | | /** |
| | | * 分配人员 |
| | | * @param order |
| | | * @return |
| | | */ |
| | | public int updateConfig(GuideRepairOrder order); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface KeywordMapper extends BaseMapper<KeywordEntity> |
| | | { |
| | | /** |
| | | * 查询关键词列表 |
| | | * @return |
| | | */ |
| | | public List<KeywordEntity> selectConfigList(IPage<KeywordEntity> page, Integer state); |
| | | |
| | | /** |
| | | * 查询详情 |
| | | * @return |
| | | */ |
| | | public KeywordEntity selectConfigData(@Param("Id") String Id, |
| | | @Param("name") String name); |
| | | |
| | | |
| | | /** |
| | | * 添加关键词 |
| | | * @return |
| | | */ |
| | | public int insertConfig(KeywordEntity entity); |
| | | |
| | | /** |
| | | * 编辑关键词 |
| | | * @return |
| | | */ |
| | | public int updateConfig(KeywordEntity entity); |
| | | |
| | | /** |
| | | * 删除关键词 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @param |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | |
| | | /** |
| | | * 更具名字查询关键词列表(不分页) |
| | | * @return |
| | | */ |
| | | List<KeywordEntity> selectByName(@Param("keyWord") String keyWord); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.MenuEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MenuMapper extends BaseMapper<MenuEntity> |
| | | { |
| | | |
| | | |
| | | /** |
| | | * 获取菜单列表 |
| | | * @return |
| | | */ |
| | | public List<MenuEntity> selectConfigList(); |
| | | |
| | | |
| | | /** |
| | | * 添加新菜单 |
| | | * @return |
| | | */ |
| | | public int insertConfig(MenuEntity entity); |
| | | |
| | | /** |
| | | * 更新菜单 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(MenuEntity entity); |
| | | |
| | | /** |
| | | * 删除菜单 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(Long Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface OrganizationChartMapper extends BaseMapper<OrganizationChartEntity> |
| | | { |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | public List<OrganizationChartEntity> selectConfigList(@Param("parentId") String parentId, |
| | | @Param("grade") String grade); |
| | | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | public int insertConfig(OrganizationChartEntity entity); |
| | | |
| | | /** |
| | | * 更新机构 |
| | | */ |
| | | public int updateConfig(OrganizationChartEntity entity); |
| | | |
| | | /** |
| | | * 删除机构 |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | */ |
| | | public int countNum(); |
| | | |
| | | /** |
| | | * 根据关键词查取消组织机构 |
| | | */ |
| | | List<OrganizationChartEntity> selectByKeyWord(String keyWord); |
| | | |
| | | /** |
| | | * 根据id查取消组织机构 |
| | | */ |
| | | OrganizationChartEntity selectConfigById(@Param("id") String id); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.ReplyTemplateEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ReplyTemplateMapper extends BaseMapper<ReplyTemplateEntity> |
| | | { |
| | | |
| | | /** |
| | | * 获取模板列表 |
| | | * @return |
| | | */ |
| | | public List<ReplyTemplateEntity> selectConfigList(IPage<ReplyTemplateEntity> page, Integer state, @Param("Name") String Name); |
| | | |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public ReplyTemplateEntity selectConfigData(String Id); |
| | | |
| | | /** |
| | | * 新增模板 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(ReplyTemplateEntity entity); |
| | | |
| | | /** |
| | | * 更新模板 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(ReplyTemplateEntity entity); |
| | | |
| | | /** |
| | | * 删除模板 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 获取数量 |
| | | * @return |
| | | */ |
| | | public int countNum(String Name); |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.RoleManagementEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface RoleManagementMapper extends BaseMapper<RoleManagementEntity> |
| | | { |
| | | |
| | | |
| | | /** |
| | | * 查询角色列表 |
| | | * @param page |
| | | * @param state |
| | | * @return |
| | | */ |
| | | public List<RoleManagementEntity> selectConfigList(IPage<RoleManagementEntity> page, Integer state); |
| | | |
| | | /** |
| | | * 新增角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(RoleManagementEntity entity); |
| | | |
| | | /** |
| | | * 编辑角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(RoleManagementEntity entity); |
| | | |
| | | /** |
| | | * 删除角色 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计条数 |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 轮播图 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-19 |
| | | */ |
| | | public interface SlideshowMapper extends BaseMapper<Slideshow> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户信息表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiang |
| | | * @since 2022-07-11 |
| | | */ |
| | | public interface SysUserMapper extends BaseMapper<SysUser> { |
| | | |
| | | SysUser getUserById(Long id); |
| | | SysUser getUserByAccount(String account); |
| | | |
| | | /** |
| | | * 查询聊天列表 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,@Param("userType") String userType); |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertConfig(SysUser config); |
| | | |
| | | /** |
| | | * 更新聊天记录 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateConfig(SysUser config); |
| | | |
| | | /** |
| | | * 删除聊天记录 |
| | | * |
| | | * @param id 聊天记录主键id |
| | | * @return 结果 |
| | | */ |
| | | public int deleteConfigById(String id); |
| | | |
| | | |
| | | /** |
| | | * 获取数据库总条数(批量) |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public int selectNum(String userType); |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.manual.pojo.Search; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface TransactionEventMapper extends BaseMapper<TransactionEvent> |
| | | { |
| | | |
| | | /** |
| | | * 查询导办事务详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public TransactionEvent selectConfigData(String Id); |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | public List<TransactionEvent> selectConfigList(IPage<TransactionEvent> page, Integer state, |
| | | @Param("matterAndUser") String matterAndUser, |
| | | @Param("classifyGrade") String classifyGrade); |
| | | |
| | | /** |
| | | * 新增导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(TransactionEvent entity); |
| | | |
| | | /** |
| | | * 修改导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(TransactionEvent entity); |
| | | |
| | | /** |
| | | * 删除接口 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @param |
| | | * @return |
| | | */ |
| | | public int countNum(@Param("matterAndUser") String matterAndUser, |
| | | @Param("classifyGrade") String classifyGrade); |
| | | |
| | | /** |
| | | * 导办事务搜索 |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryMatterNameList(IPage<TransactionEvent> page, Integer state, String matterName); |
| | | |
| | | /** |
| | | * 导办事务搜索(不带分页) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryMatterNameList(String matterName); |
| | | |
| | | /** |
| | | * 导办事务搜索统计数量 |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | int countNumByMatterName(String matterName); |
| | | |
| | | /** |
| | | * 根据分类ID事务搜索统计数量 |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | int countNumByClassifyIdList(@Param("classifyId") String classifyId,@Param("departmentId") Integer departmentId); |
| | | |
| | | /** |
| | | * 搜索后更新导办事务 |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | int updateConfigByMatterName(String matterName); |
| | | |
| | | /** |
| | | * 根据分离查询导办事务 |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryByClassifyIdList(@Param("classifyId") String classifyId,@Param("departmentId") Integer departmentId); |
| | | |
| | | /** |
| | | * 查询导办事务求和 |
| | | * @return |
| | | */ |
| | | TransactionEvent sumTransactionNum(); |
| | | |
| | | /** |
| | | * 根据关键词导办事务(部门也会统计进去)搜索(分页) |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | List<Search> selectSearch(IPage<Search> page, Integer state, String keyWord); |
| | | |
| | | /** |
| | | * 根据关键词导办事务(部门也会统计进去)搜索(不分页) |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | List<Search> selectSearch( String keyWord); |
| | | |
| | | |
| | | /** |
| | | * 根据关联词导办事务搜索搜索(分页) |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | List<Search> selectSearchAssociate(IPage<Search> page, Integer state, String keyWord); |
| | | |
| | | /** |
| | | * 根据关联词导办事务搜索搜索(不分页) |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | List<Search> selectSearchAssociate( String keyWord); |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.manual.pojo.MUser; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public interface MUserMapper extends BaseMapper<MUser> { |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.mapper.util; |
| | | |
| | | import org.springframework.beans.factory.InitializingBean; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | @Component |
| | | public class ConstantPropertiesUtil implements InitializingBean { |
| | | |
| | | @Value("${wx.open.app_id}") |
| | | private String appId; |
| | | |
| | | @Value("${wx.open.app_secret}") |
| | | private String appSecret; |
| | | |
| | | @Value("${wx.open.redirect_url}") |
| | | private String redirectUrl; |
| | | |
| | | @Value("${yygh.baseUrl}") |
| | | private String yyghBaseUrl; |
| | | |
| | | public static String WX_OPEN_APP_ID; |
| | | public static String WX_OPEN_APP_SECRET; |
| | | public static String WX_OPEN_REDIRECT_URL; |
| | | |
| | | public static String YYGH_BASE_URL; |
| | | |
| | | @Override |
| | | public void afterPropertiesSet() throws Exception { |
| | | WX_OPEN_APP_ID = appId; |
| | | WX_OPEN_APP_SECRET = appSecret; |
| | | WX_OPEN_REDIRECT_URL = redirectUrl; |
| | | YYGH_BASE_URL = yyghBaseUrl; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.mapper.util; |
| | | |
| | | /** |
| | | * Excel数据格式处理适配器 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ExcelHandlerAdapter |
| | | { |
| | | /** |
| | | * 格式化 |
| | | * |
| | | * @param value 单元格数据值 |
| | | * @param args excel注解args参数组 |
| | | * |
| | | * @return 处理后的值 |
| | | */ |
| | | Object format(Object value, String[] args); |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.mapper.util; |
| | | |
| | | import com.dg.core.util.StringUtils; |
| | | import io.netty.channel.ConnectTimeoutException; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.http.Consts; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.entity.UrlEncodedFormEntity; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
| | | import org.apache.http.conn.ssl.TrustStrategy; |
| | | import org.apache.http.conn.ssl.X509HostnameVerifier; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import java.util.Map.Entry; |
| | | import org.apache.http.ssl.SSLContextBuilder; |
| | | import javax.net.ssl.SSLContext; |
| | | import javax.net.ssl.SSLException; |
| | | import javax.net.ssl.SSLSession; |
| | | import javax.net.ssl.SSLSocket; |
| | | import java.io.IOException; |
| | | import java.net.SocketTimeoutException; |
| | | import java.security.GeneralSecurityException; |
| | | import java.security.cert.CertificateException; |
| | | import java.security.cert.X509Certificate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | public class HttpClientUtils { |
| | | |
| | | public static final int connTimeout=10000; |
| | | public static final int readTimeout=10000; |
| | | public static final String charset="UTF-8"; |
| | | private static CloseableHttpClient client = null; |
| | | |
| | | static { |
| | | PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); |
| | | cm.setMaxTotal(128); |
| | | cm.setDefaultMaxPerRoute(128); |
| | | client = HttpClients.custom().setConnectionManager(cm).build(); |
| | | } |
| | | |
| | | public static String postParameters(String url, String parameterStr) throws ConnectTimeoutException, SocketTimeoutException, Exception{ |
| | | return post(url,parameterStr,"application/x-www-form-urlencoded",charset,connTimeout,readTimeout); |
| | | } |
| | | |
| | | public static String postParameters(String url, String parameterStr,String charset, Integer connTimeout, Integer readTimeout) throws ConnectTimeoutException, SocketTimeoutException, Exception{ |
| | | return post(url,parameterStr,"application/x-www-form-urlencoded",charset,connTimeout,readTimeout); |
| | | } |
| | | |
| | | public static String postParameters(String url, Map<String, String> params) throws ConnectTimeoutException, |
| | | SocketTimeoutException, Exception { |
| | | return postForm(url, params, null, connTimeout, readTimeout); |
| | | } |
| | | |
| | | public static String postParameters(String url, Map<String, String> params, Integer connTimeout,Integer readTimeout) throws ConnectTimeoutException, |
| | | SocketTimeoutException, Exception { |
| | | return postForm(url, params, null, connTimeout, readTimeout); |
| | | } |
| | | |
| | | public static String get(String url) throws Exception { |
| | | return get(url, charset, null, null); |
| | | } |
| | | |
| | | public static String get(String url, String charset) throws Exception { |
| | | return get(url, charset, connTimeout, readTimeout); |
| | | } |
| | | |
| | | /** |
| | | * 发送一个 Post 请求, 使用指定的字符集编码. |
| | | * |
| | | * @param url |
| | | * @param body RequestBody |
| | | * @param mimeType 例如 application/xml "application/x-www-form-urlencoded" a=1&b=2&c=3 |
| | | * @param charset 编码 |
| | | * @param connTimeout 建立链接超时时间,毫秒. |
| | | * @param readTimeout 响应超时时间,毫秒. |
| | | * @return ResponseBody, 使用指定的字符集编码. |
| | | * @throws ConnectTimeoutException 建立链接超时异常 |
| | | * @throws SocketTimeoutException 响应超时 |
| | | * @throws Exception |
| | | */ |
| | | public static String post(String url, String body, String mimeType,String charset, Integer connTimeout, Integer readTimeout) |
| | | throws ConnectTimeoutException, SocketTimeoutException, Exception { |
| | | CloseableHttpClient client = null; |
| | | HttpPost post = new HttpPost(url); |
| | | String result = ""; |
| | | try { |
| | | if (StringUtils.isNotBlank(body)) { |
| | | HttpEntity entity = new StringEntity(body, ContentType.create(mimeType, charset)); |
| | | post.setEntity(entity); |
| | | } |
| | | // 设置参数 |
| | | RequestConfig.Builder customReqConf = RequestConfig.custom(); |
| | | if (connTimeout != null) { |
| | | customReqConf.setConnectTimeout(connTimeout); |
| | | } |
| | | if (readTimeout != null) { |
| | | customReqConf.setSocketTimeout(readTimeout); |
| | | } |
| | | post.setConfig(customReqConf.build()); |
| | | |
| | | HttpResponse res; |
| | | if (url.startsWith("https")) { |
| | | // 执行 Https 请求. |
| | | client = createSSLInsecureClient(); |
| | | res = client.execute(post); |
| | | } else { |
| | | // 执行 Http 请求. |
| | | client = HttpClientUtils.client; |
| | | res = client.execute(post); |
| | | } |
| | | result = IOUtils.toString(res.getEntity().getContent(), charset); |
| | | } finally { |
| | | post.releaseConnection(); |
| | | if (url.startsWith("https") && client != null&& client instanceof CloseableHttpClient) { |
| | | ((CloseableHttpClient) client).close(); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 提交form表单 |
| | | * |
| | | * @param url |
| | | * @param params |
| | | * @param connTimeout |
| | | * @param readTimeout |
| | | * @return |
| | | * @throws ConnectTimeoutException |
| | | * @throws SocketTimeoutException |
| | | * @throws Exception |
| | | */ |
| | | public static String postForm(String url, Map<String, String> params, Map<String, String> headers, Integer connTimeout,Integer readTimeout) throws ConnectTimeoutException, |
| | | SocketTimeoutException, Exception { |
| | | |
| | | CloseableHttpClient client = null; |
| | | HttpPost post = new HttpPost(url); |
| | | try { |
| | | if (params != null && !params.isEmpty()) { |
| | | List<NameValuePair> formParams = new ArrayList<NameValuePair>(); |
| | | Set<Map.Entry<String, String>> entrySet = params.entrySet(); |
| | | for (Entry<String, String> entry : entrySet) { |
| | | formParams.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); |
| | | } |
| | | UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formParams, Consts.UTF_8); |
| | | post.setEntity(entity); |
| | | } |
| | | |
| | | if (headers != null && !headers.isEmpty()) { |
| | | for (Entry<String, String> entry : headers.entrySet()) { |
| | | post.addHeader(entry.getKey(), entry.getValue()); |
| | | } |
| | | } |
| | | // 设置参数 |
| | | RequestConfig.Builder customReqConf = RequestConfig.custom(); |
| | | if (connTimeout != null) { |
| | | customReqConf.setConnectTimeout(connTimeout); |
| | | } |
| | | if (readTimeout != null) { |
| | | customReqConf.setSocketTimeout(readTimeout); |
| | | } |
| | | post.setConfig(customReqConf.build()); |
| | | HttpResponse res = null; |
| | | if (url.startsWith("https")) { |
| | | // 执行 Https 请求. |
| | | client = createSSLInsecureClient(); |
| | | res = client.execute(post); |
| | | } else { |
| | | // 执行 Http 请求. |
| | | client = HttpClientUtils.client; |
| | | res = client.execute(post); |
| | | } |
| | | return IOUtils.toString(res.getEntity().getContent(), "UTF-8"); |
| | | } finally { |
| | | post.releaseConnection(); |
| | | if (url.startsWith("https") && client != null |
| | | && client instanceof CloseableHttpClient) { |
| | | ((CloseableHttpClient) client).close(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 发送一个 GET 请求 |
| | | */ |
| | | public static String get(String url, String charset, Integer connTimeout,Integer readTimeout) |
| | | throws ConnectTimeoutException,SocketTimeoutException, Exception { |
| | | |
| | | CloseableHttpClient client = null; |
| | | HttpGet get = new HttpGet(url); |
| | | String result = ""; |
| | | try { |
| | | // 设置参数 |
| | | RequestConfig.Builder customReqConf = RequestConfig.custom(); |
| | | if (connTimeout != null) { |
| | | customReqConf.setConnectTimeout(connTimeout); |
| | | } |
| | | if (readTimeout != null) { |
| | | customReqConf.setSocketTimeout(readTimeout); |
| | | } |
| | | get.setConfig(customReqConf.build()); |
| | | |
| | | HttpResponse res = null; |
| | | |
| | | if (url.startsWith("https")) { |
| | | // 执行 Https 请求. |
| | | client = createSSLInsecureClient(); |
| | | res = client.execute(get); |
| | | } else { |
| | | // 执行 Http 请求. |
| | | client = HttpClientUtils.client; |
| | | res = client.execute(get); |
| | | } |
| | | |
| | | result = IOUtils.toString(res.getEntity().getContent(), charset); |
| | | } finally { |
| | | get.releaseConnection(); |
| | | if (url.startsWith("https") && client != null && client instanceof CloseableHttpClient) { |
| | | ((CloseableHttpClient) client).close(); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 从 response 里获取 charset |
| | | */ |
| | | @SuppressWarnings("unused") |
| | | private static String getCharsetFromResponse(HttpResponse ressponse) { |
| | | // Content-Type:text/html; charset=GBK |
| | | if (ressponse.getEntity() != null && ressponse.getEntity().getContentType() != null && ressponse.getEntity().getContentType().getValue() != null) { |
| | | String contentType = ressponse.getEntity().getContentType().getValue(); |
| | | if (contentType.contains("charset=")) { |
| | | return contentType.substring(contentType.indexOf("charset=") + 8); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 创建 SSL连接 |
| | | * @return |
| | | * @throws GeneralSecurityException |
| | | */ |
| | | private static CloseableHttpClient createSSLInsecureClient() throws GeneralSecurityException { |
| | | try { |
| | | SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() { |
| | | public boolean isTrusted(X509Certificate[] chain,String authType) throws CertificateException { |
| | | return true; |
| | | } |
| | | }).build(); |
| | | |
| | | SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new X509HostnameVerifier() { |
| | | |
| | | @Override |
| | | public boolean verify(String arg0, SSLSession arg1) { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void verify(String host, SSLSocket ssl) |
| | | throws IOException { |
| | | } |
| | | |
| | | @Override |
| | | public void verify(String host, X509Certificate cert) |
| | | throws SSLException { |
| | | } |
| | | |
| | | @Override |
| | | public void verify(String host, String[] cns, |
| | | String[] subjectAlts) throws SSLException { |
| | | } |
| | | }); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | |
| | | } catch (GeneralSecurityException e) { |
| | | throw e; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.mapper.util; |
| | | |
| | | import com.baomidou.mybatisplus.generator.FastAutoGenerator; |
| | | import com.baomidou.mybatisplus.generator.config.OutputFile; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | |
| | | import java.io.File; |
| | | import java.util.Collections; |
| | | |
| | | public class MapperGenerator { |
| | | @Value("spring.datasource.url") |
| | | String url = "jdbc:mysql://10.8.0.74:3306/flower_city_automessage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8"; |
| | | @Value("spring.datasource.username") |
| | | String username = "root"; |
| | | @Value("spring.datasource.password") |
| | | String password = "nahanMysqlPwd&&RemoteRemote2019nahan"; |
| | | |
| | | public void gen() { |
| | | String userdir = System.getProperty("user.dir");//获取当前工作目录 |
| | | String outputDir = userdir + File.separator + "src" + File.separator + "main"; |
| | | |
| | | FastAutoGenerator.create(url, username, password) |
| | | .globalConfig(builder -> { |
| | | builder.author("fengjin") // 设置作者 |
| | | // .enableSwagger() // 开启 swagger 模式 |
| | | .fileOverride() // 覆盖已生成文件 |
| | | .outputDir(outputDir + File.separator + "java"); // 指定输出目录 |
| | | }) |
| | | .packageConfig(builder -> { |
| | | builder.parent("com.dg.core.db.gen") // 设置父包名 |
| | | // .moduleName("system") // 设置父包模块名 |
| | | .pathInfo(Collections.singletonMap(OutputFile.mapperXml, outputDir + |
| | | File.separator + "resources" + File.separator + "mapper")); // 设置mapperXml生成路径 |
| | | }) |
| | | .strategyConfig(builder -> { |
| | | // builder.addInclude(""); |
| | | builder.addInclude("agreement") // 设置需要生成的表名 |
| | | .addTablePrefix("t_", "c_"); // 设置过滤表前缀 |
| | | }) |
| | | .templateConfig(builder -> { |
| | | builder.controller(""); |
| | | builder.service(""); |
| | | builder.serviceImpl(""); |
| | | }) |
| | | .execute(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | MapperGenerator m = new MapperGenerator(); |
| | | m.gen(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.mapper.util; |
| | | |
| | | |
| | | /** |
| | | * 分页工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class PageUtils {} |
| | | // extends PageHelper |
| | | //{ |
| | | // /** |
| | | // * 设置请求分页数据 |
| | | // */ |
| | | // public static 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()); |
| | | // Boolean reasonable = pageDomain.getReasonable(); |
| | | // PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(false); |
| | | // } |
| | | // } |
| | | //} |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class LargeScreen implements Serializable |
| | | { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信群数 |
| | | */ |
| | | private int groupNum=0; |
| | | |
| | | /** |
| | | * 关键词数 |
| | | */ |
| | | private int wordNum=0; |
| | | |
| | | /** |
| | | * 覆盖家庭 |
| | | */ |
| | | private int homeNum=0; |
| | | /** |
| | | * 参与人员 |
| | | */ |
| | | private int staffNum=0; |
| | | |
| | | //敏感词数量 |
| | | private int mNum; |
| | | //抓取信息 |
| | | private int zNum; |
| | | //匹配数量 |
| | | private int pNum=0; |
| | | |
| | | |
| | | /** |
| | | * 检测信息 |
| | | */ |
| | | private int testingInformation=0; |
| | | |
| | | |
| | | /** |
| | | * 热门舆情 |
| | | */ |
| | | private int hotPublicOpinion=0; |
| | | |
| | | /** |
| | | * 关注数量 |
| | | */ |
| | | private int attention=0; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | public class MUser { |
| | | private Long id; |
| | | private String name; |
| | | private Integer age; |
| | | private String email; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getAge() { |
| | | return age; |
| | | } |
| | | |
| | | public void setAge(Integer age) { |
| | | this.age = age; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class MsgLocal implements Serializable |
| | | { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | private String msgTitle; |
| | | private String msgContent; |
| | | private String groups; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime creationTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sendTime; |
| | | private Long userId; |
| | | private String userName; |
| | | private int msgType; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @ApiModel("自公告门户网搜索结果") |
| | | @Data |
| | | public class QueryResults { |
| | | |
| | | |
| | | @ApiModelProperty("数量") |
| | | private long total; |
| | | |
| | | @ApiModelProperty("办事指南列表或者部门") |
| | | private List<Search> searchList; |
| | | |
| | | @ApiModelProperty("推荐办事指南列表") |
| | | private List<Search> transactionEventList; |
| | | |
| | | @ApiModelProperty("联想词列表") |
| | | private List<KeywordEntity> keywordEntityList; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @ApiModel("自公告门户网智能推荐结果") |
| | | @Data |
| | | public class RecommendResult { |
| | | |
| | | @ApiModelProperty("办事指南列表") |
| | | private List<TransactionEvent> transactionEventList; |
| | | |
| | | @ApiModelProperty("联想词列表") |
| | | private List<KeywordEntity> keywordEntityList; |
| | | |
| | | @ApiModelProperty("办事部门列表") |
| | | private List<OrganizationChartEntity> organizationChartEntityList; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @ApiModel("自公告门户网搜索数据") |
| | | @Data |
| | | public class Search { |
| | | |
| | | @ApiModelProperty("搜索结果标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("搜索结果内容(部门是简历,指南则是改指南的分级)") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("浏览次数") |
| | | private Integer views; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 群管理 |
| | | * </p> |
| | | * |
| | | * @author xiang |
| | | * @since 2022-07-05 |
| | | */ |
| | | @Data |
| | | @TableName("word_user") |
| | | public class WordUser implements Serializable |
| | | { |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | private Long wordId; |
| | | private Long userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.exception; |
| | | |
| | | /** |
| | | * 演示模式异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DemoModeException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public DemoModeException() |
| | | { |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.exception; |
| | | |
| | | /** |
| | | * 全局异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class GlobalException extends RuntimeException |
| | | { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 错误提示 |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * 错误明细,内部调试错误 |
| | | * |
| | | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
| | | */ |
| | | private String detailMessage; |
| | | |
| | | /** |
| | | * 空构造方法,避免反序列化问题 |
| | | */ |
| | | public GlobalException() |
| | | { |
| | | } |
| | | |
| | | public GlobalException(String message) |
| | | { |
| | | this.message = message; |
| | | } |
| | | |
| | | public String getDetailMessage() |
| | | { |
| | | return detailMessage; |
| | | } |
| | | |
| | | public GlobalException setDetailMessage(String detailMessage) |
| | | { |
| | | this.detailMessage = detailMessage; |
| | | return this; |
| | | } |
| | | |
| | | public String getMessage() |
| | | { |
| | | return message; |
| | | } |
| | | |
| | | public GlobalException setMessage(String message) |
| | | { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.exception; |
| | | |
| | | /** |
| | | * 业务异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public final class ServiceException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 错误码 |
| | | */ |
| | | private Integer code; |
| | | |
| | | /** |
| | | * 错误提示 |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * 错误明细,内部调试错误 |
| | | * |
| | | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
| | | */ |
| | | private String detailMessage; |
| | | |
| | | /** |
| | | * 空构造方法,避免反序列化问题 |
| | | */ |
| | | public ServiceException() |
| | | { |
| | | } |
| | | |
| | | public ServiceException(String message) |
| | | { |
| | | this.message = message; |
| | | } |
| | | |
| | | public ServiceException(String message, Integer code) |
| | | { |
| | | this.message = message; |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getDetailMessage() |
| | | { |
| | | return detailMessage; |
| | | } |
| | | |
| | | public String getMessage() |
| | | { |
| | | return message; |
| | | } |
| | | |
| | | public Integer getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public ServiceException setMessage(String message) |
| | | { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | |
| | | public ServiceException setDetailMessage(String detailMessage) |
| | | { |
| | | this.detailMessage = detailMessage; |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.exception; |
| | | |
| | | /** |
| | | * 工具类异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UtilException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 8247610319171014183L; |
| | | |
| | | public UtilException(Throwable e) |
| | | { |
| | | super(e.getMessage(), e); |
| | | } |
| | | |
| | | public UtilException(String message) |
| | | { |
| | | super(message); |
| | | } |
| | | |
| | | public UtilException(String message, Throwable throwable) |
| | | { |
| | | super(message, throwable); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.exception.base; |
| | | |
| | | |
| | | import com.dg.core.util.MessageUtils; |
| | | import org.apache.commons.lang3.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; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.exception.file; |
| | | |
| | | |
| | | import com.dg.core.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); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.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 }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.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 }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.exception.file; |
| | | |
| | | import org.apache.commons.fileupload.FileUploadException; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 文件上传 误异常类 |
| | | * |
| | | * @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); |
| | | } |
| | | } |
| | | |
| | | public static class InvalidVideoExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.file; |
| | | |
| | | |
| | | /** |
| | | * 通用常量信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Constants |
| | | { |
| | | /** |
| | | * UTF-8 字符集 |
| | | */ |
| | | public static final String UTF8 = "UTF-8"; |
| | | |
| | | /** |
| | | * GBK 字符集 |
| | | */ |
| | | public static final String GBK = "GBK"; |
| | | |
| | | /** |
| | | * http请求 |
| | | */ |
| | | public static final String HTTP = "http://"; |
| | | |
| | | /** |
| | | * https请求 |
| | | */ |
| | | public static final String HTTPS = "https://"; |
| | | |
| | | /** |
| | | * 通用成功标识 |
| | | */ |
| | | 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 REGISTER = "Register"; |
| | | |
| | | /** |
| | | * 登录失败 |
| | | */ |
| | | public static final String LOGIN_FAIL = "Error"; |
| | | |
| | | /** |
| | | * 验证码 redis key |
| | | */ |
| | | public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; |
| | | |
| | | /** |
| | | * 登录用户 redis key |
| | | */ |
| | | public static final String LOGIN_TOKEN_KEY = "login_tokens:"; |
| | | |
| | | /** |
| | | * 防重提交 redis key |
| | | */ |
| | | public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; |
| | | |
| | | /** |
| | | * 限流 redis key |
| | | */ |
| | | public static final String RATE_LIMIT_KEY = "rate_limit:"; |
| | | |
| | | /** |
| | | * 验证码有效期(分钟) |
| | | */ |
| | | public static final Integer CAPTCHA_EXPIRATION = 2; |
| | | |
| | | /** |
| | | * 令牌 |
| | | */ |
| | | public static final String TOKEN = "token"; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String TOKEN_PREFIX = "Bearer "; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String LOGIN_USER_KEY = "login_user_key"; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | public static final String JWT_USERID = "userid"; |
| | | |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | public static final String JWT_USERNAME = "新用户"; |
| | | |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | public static final String JWT_AVATAR = "avatar"; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | public static final String JWT_CREATED = "created"; |
| | | |
| | | /** |
| | | * 用户权限 |
| | | */ |
| | | public static final String JWT_AUTHORITIES = "authorities"; |
| | | |
| | | /** |
| | | * 参数管理 cache key |
| | | */ |
| | | public static final String SYS_CONFIG_KEY = "sys_config:"; |
| | | |
| | | /** |
| | | * 字典管理 cache key |
| | | */ |
| | | public static final String SYS_DICT_KEY = "sys_dict:"; |
| | | |
| | | /** |
| | | * 资源映射路径 前缀 |
| | | */ |
| | | public static final String RESOURCE_PREFIX = "/profile"; |
| | | |
| | | /** |
| | | * RMI 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_RMI = "rmi:"; |
| | | |
| | | /** |
| | | * LDAP 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_LDAP = "ldap:"; |
| | | |
| | | /** |
| | | * LDAPS 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_LDAPS = "ldaps:"; |
| | | |
| | | /** |
| | | * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) |
| | | */ |
| | | public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" }; |
| | | |
| | | /** |
| | | * 定时任务违规的字符 |
| | | */ |
| | | public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", |
| | | "org.springframework", "org.apache", "com.ruoyi.common.utils.file" }; |
| | | |
| | | /** |
| | | * 客户编号最大值Key |
| | | */ |
| | | public static final String SYS_CUSTOMER_MAX_SN = "sys.customer.max.sn"; |
| | | } |
New file |
| | |
| | | package com.dg.core.file; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.io.File; |
| | | |
| | | /** |
| | | * 文件类型工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileTypeUtils |
| | | { |
| | | /** |
| | | * 获取文件类型 |
| | | * <p> |
| | | * 例如: ruoyi.txt, 返回: txt |
| | | * |
| | | * @param file 文件名 |
| | | * @return 后缀(不含".") |
| | | */ |
| | | public static String getFileType(File file) |
| | | { |
| | | if (null == file) |
| | | { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return getFileType(file.getName()); |
| | | } |
| | | |
| | | /** |
| | | * 获取文件类型 |
| | | * <p> |
| | | * 例如: ruoyi.txt, 返回: txt |
| | | * |
| | | * @param fileName 文件名 |
| | | * @return 后缀(不含".") |
| | | */ |
| | | public static String getFileType(String fileName) |
| | | { |
| | | int separatorIndex = fileName.lastIndexOf("."); |
| | | if (separatorIndex < 0) |
| | | { |
| | | return ""; |
| | | } |
| | | return fileName.substring(separatorIndex + 1).toLowerCase(); |
| | | } |
| | | |
| | | /** |
| | | * 获取文件类型 |
| | | * |
| | | * @param photoByte 文件字节码 |
| | | * @return 后缀(不含".") |
| | | */ |
| | | public static String getFileExtendName(byte[] photoByte) |
| | | { |
| | | String strFileExtendName = "JPG"; |
| | | if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) |
| | | && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) |
| | | { |
| | | strFileExtendName = "GIF"; |
| | | } |
| | | else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) |
| | | { |
| | | strFileExtendName = "JPG"; |
| | | } |
| | | else if ((photoByte[0] == 66) && (photoByte[1] == 77)) |
| | | { |
| | | strFileExtendName = "BMP"; |
| | | } |
| | | else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) |
| | | { |
| | | strFileExtendName = "PNG"; |
| | | } |
| | | return strFileExtendName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.file; |
| | | |
| | | import com.dg.core.exception.file.FileNameLengthLimitExceededException; |
| | | import com.dg.core.exception.file.FileSizeLimitExceededException; |
| | | import com.dg.core.exception.file.InvalidExtensionException; |
| | | import com.dg.core.util.DateUtils; |
| | | import com.dg.core.util.Seq; |
| | | import com.dg.core.util.StringUtils; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.util.Objects; |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * 文件上传工具类 |
| | | * |
| | | * @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; |
| | | |
| | | /** |
| | | * 默认上传的地址 |
| | | */ |
| | | public static String defaultBaseDir="D:/tupianshuju"; |
| | | |
| | | |
| | | // static Properties pro=new Properties(); |
| | | |
| | | // static { |
| | | // try { |
| | | // pro.load(new FileInputStream("src/main/resources/application.properties")); |
| | | // defaultBaseDir =pro.getProperty("profile", "D:/tupianshuju"); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // public static String defaultBaseDir ="E:/java/flower_city_automessage/flower_citys/files"; |
| | | |
| | | |
| | | |
| | | |
| | | 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 上传的文件 |
| | | * @param allowedExtension 上传文件类型 |
| | | * @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 = Objects.requireNonNull(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); |
| | | return getPathFileName(baseDir, fileName); |
| | | } |
| | | |
| | | /** |
| | | * 编码文件名 |
| | | */ |
| | | public static final String extractFilename(MultipartFile file) |
| | | { |
| | | return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(), |
| | | FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file)); |
| | | } |
| | | |
| | | public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException |
| | | { |
| | | File desc = new File(uploadDir + File.separator + fileName); |
| | | |
| | | if (!desc.exists()) |
| | | { |
| | | if (!desc.getParentFile().exists()) |
| | | { |
| | | desc.getParentFile().mkdirs(); |
| | | } |
| | | } |
| | | return desc; |
| | | } |
| | | |
| | | public static final String getPathFileName(String uploadDir, String fileName) throws IOException |
| | | { |
| | | int dirLastIndex = defaultBaseDir.length() + 1; |
| | | String currentDir = StringUtils.substring(uploadDir, dirLastIndex); |
| | | return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + 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 (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 if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) |
| | | { |
| | | throw new InvalidExtensionException.InvalidVideoExtensionException(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(Objects.requireNonNull(file.getContentType())); |
| | | } |
| | | return extension; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.file; |
| | | |
| | | import com.dg.core.util.DateUtils; |
| | | import com.dg.core.util.IdUtils; |
| | | import com.dg.core.util.StringUtils; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * 文件处理工具类 |
| | | * |
| | | * @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 |
| | | { |
| | | IOUtils.close(os); |
| | | IOUtils.close(fis); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 写数据到文件中 |
| | | * |
| | | * @param data 数据 |
| | | * @return 目标文件 |
| | | * @throws IOException IO异常 |
| | | */ |
| | | public static String writeImportBytes(byte[] data) throws IOException |
| | | { |
| | | return writeBytes(data, FileUploadUtils.defaultBaseDir); |
| | | } |
| | | |
| | | /** |
| | | * 写数据到文件中 |
| | | * |
| | | * @param data 数据 |
| | | * @param uploadDir 目标文件 |
| | | * @return 目标文件 |
| | | * @throws IOException IO异常 |
| | | */ |
| | | public static String writeBytes(byte[] data, String uploadDir) throws IOException |
| | | { |
| | | FileOutputStream fos = null; |
| | | String pathName = ""; |
| | | try |
| | | { |
| | | String extension = getFileExtendName(data); |
| | | pathName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension; |
| | | File file = FileUploadUtils.getAbsoluteFile(uploadDir, pathName); |
| | | fos = new FileOutputStream(file); |
| | | fos.write(data); |
| | | } |
| | | finally |
| | | { |
| | | IOUtils.close(fos); |
| | | } |
| | | return FileUploadUtils.getPathFileName(uploadDir, pathName); |
| | | } |
| | | |
| | | /** |
| | | * 删除文件 |
| | | * |
| | | * @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 resource 需要下载的文件 |
| | | * @return true 正常 false 非法 |
| | | */ |
| | | public static boolean checkAllowDownload(String resource) |
| | | { |
| | | // 禁止目录上跳级别 |
| | | if (StringUtils.contains(resource, "..")) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // 检查允许下载的文件规则 |
| | | if (ArrayUtils.contains(MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getFileType(resource))) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | // 不在允许下载的文件规则 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 下载文件名重新编码 |
| | | * |
| | | * @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; |
| | | } |
| | | |
| | | /** |
| | | * 下载文件名重新编码 |
| | | * |
| | | * @param response 响应对象 |
| | | * @param realFileName 真实文件名 |
| | | */ |
| | | public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException |
| | | { |
| | | String percentEncodedFileName = percentEncode(realFileName); |
| | | |
| | | StringBuilder contentDispositionValue = new StringBuilder(); |
| | | contentDispositionValue.append("attachment; filename=") |
| | | .append(percentEncodedFileName) |
| | | .append(";") |
| | | .append("filename*=") |
| | | .append("utf-8''") |
| | | .append(percentEncodedFileName); |
| | | |
| | | response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); |
| | | response.setHeader("Content-disposition", contentDispositionValue.toString()); |
| | | response.setHeader("download-filename", percentEncodedFileName); |
| | | } |
| | | |
| | | /** |
| | | * 百分号编码工具方法 |
| | | * |
| | | * @param s 需要百分号编码的字符串 |
| | | * @return 百分号编码后的字符串 |
| | | */ |
| | | public static String percentEncode(String s) throws UnsupportedEncodingException |
| | | { |
| | | String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString()); |
| | | return encode.replaceAll("\\+", "%20"); |
| | | } |
| | | |
| | | /** |
| | | * 获取图像后缀 |
| | | * |
| | | * @param photoByte 图像数据 |
| | | * @return 后缀名 |
| | | */ |
| | | public static String getFileExtendName(byte[] photoByte) |
| | | { |
| | | String strFileExtendName = "jpg"; |
| | | if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) |
| | | && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) |
| | | { |
| | | strFileExtendName = "gif"; |
| | | } |
| | | else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) |
| | | { |
| | | strFileExtendName = "jpg"; |
| | | } |
| | | else if ((photoByte[0] == 66) && (photoByte[1] == 77)) |
| | | { |
| | | strFileExtendName = "bmp"; |
| | | } |
| | | else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) |
| | | { |
| | | strFileExtendName = "png"; |
| | | } |
| | | return strFileExtendName; |
| | | } |
| | | |
| | | /** |
| | | * 获取名称 |
| | | * |
| | | * @param fileName 路径名称 |
| | | * @return 没有文件路径的名称 |
| | | */ |
| | | public static String getName(String fileName) |
| | | { |
| | | if (fileName == null) |
| | | { |
| | | return null; |
| | | } |
| | | int lastUnixPos = fileName.lastIndexOf('/'); |
| | | int lastWindowsPos = fileName.lastIndexOf('\\'); |
| | | int index = Math.max(lastUnixPos, lastWindowsPos); |
| | | return fileName.substring(index + 1); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.file; |
| | | |
| | | import com.dg.core.util.StringUtils; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 图片处理工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class ImageUtils |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(ImageUtils.class); |
| | | |
| | | public static byte[] getImage(String imagePath) |
| | | { |
| | | InputStream is = getFile(imagePath); |
| | | try |
| | | { |
| | | return IOUtils.toByteArray(is); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("图片加载异常 {}", e); |
| | | return null; |
| | | } |
| | | finally |
| | | { |
| | | IOUtils.closeQuietly(is); |
| | | } |
| | | } |
| | | |
| | | public static InputStream getFile(String imagePath) |
| | | { |
| | | try |
| | | { |
| | | byte[] result = readFile(imagePath); |
| | | result = Arrays.copyOf(result, result.length); |
| | | return new ByteArrayInputStream(result); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("获取图片异常 {}", e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 读取文件为字节数据 |
| | | * |
| | | * @param url 地址 |
| | | * @return 字节数据 |
| | | */ |
| | | public static byte[] readFile(String url) |
| | | { |
| | | InputStream in = null; |
| | | try |
| | | { |
| | | if (url.startsWith("http")) |
| | | { |
| | | // 网络地址 |
| | | URL urlObj = new URL(url); |
| | | URLConnection urlConnection = urlObj.openConnection(); |
| | | urlConnection.setConnectTimeout(30 * 1000); |
| | | urlConnection.setReadTimeout(60 * 1000); |
| | | urlConnection.setDoInput(true); |
| | | in = urlConnection.getInputStream(); |
| | | } |
| | | else |
| | | { |
| | | // 本机地址 |
| | | String localPath = FileUploadUtils.defaultBaseDir; |
| | | String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX); |
| | | in = new FileInputStream(downloadPath); |
| | | } |
| | | return IOUtils.toByteArray(in); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("获取文件路径异常 {}", e); |
| | | return null; |
| | | } |
| | | finally |
| | | { |
| | | IOUtils.closeQuietly(in); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.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[] VIDEO_EXTENSION = { "mp4", "avi", "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", |
| | | // 视频格式 |
| | | "mp4", "avi", "rmvb", |
| | | // 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 ""; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.interceptor; |
| | | |
| | | import com.dg.core.Constant; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | import org.apache.catalina.connector.ResponseFacade; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.ZoneId; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 自定义拦截器,判断此次请求是否有权限 |
| | | */ |
| | | /** |
| | | * 自定义拦截器,判断此次请求是否有权限 |
| | | */ |
| | | @Component |
| | | public class AuthorizationInterceptor extends HandlerInterceptorAdapter { |
| | | @Autowired |
| | | private TokenManager manager; |
| | | |
| | | |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | //如果不是映射到方法直接通过 |
| | | if (!(handler instanceof HandlerMethod)) { |
| | | return true; |
| | | } |
| | | |
| | | HandlerMethod handlerMethod = (HandlerMethod) handler; |
| | | Method method = handlerMethod.getMethod(); |
| | | Object bean = handlerMethod.getBean(); |
| | | |
| | | //从header中得到token |
| | | String token = request.getHeader(Constant.AUTHORIZATION); |
| | | if (manager.checkToken(token)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getUserId(token)); |
| | | SysUser ss = IUserService.getUserById(manager.getUserId(token)); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | //如果验证token失败,并且方法或类注明了Authorization,返回401错误 |
| | | if (method.getAnnotation(Authorization.class) != null || bean.getClass().getAnnotation(Authorization.class) != null) { |
| | | String reponse = "{\"result\": 449, \"message\": \"Overdue token\"}"; |
| | | response.setStatus(200); |
| | | response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); |
| | | ResponseFacade facade = (ResponseFacade) response; |
| | | facade.setContentLength(reponse.getBytes(StandardCharsets.UTF_8).length); |
| | | facade.getWriter().write(reponse); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | import com.dg.core.Constant; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.script.DigestUtils; |
| | | import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.UUID; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 通过Redis存储和验证token的实现类 |
| | | */ |
| | | @Component |
| | | public class RedisTokenManager implements TokenManager { |
| | | |
| | | private RedisTemplate<String, String> redis; |
| | | |
| | | @Qualifier("redisTemplate") |
| | | @Autowired |
| | | public void setRedis(RedisTemplate redis) { |
| | | this.redis = redis; |
| | | //泛型设置成Long后必须更改对应的序列化方案 |
| | | redis.setKeySerializer(new JdkSerializationRedisSerializer()); |
| | | } |
| | | |
| | | @Override |
| | | public String createToken(long userId, long userRole) { |
| | | //使用uuid作为源token |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | String token = DigestUtils.sha1DigestAsHex(uuid + userId + "e23ktjsdf") + "-" + userRole; |
| | | //存储到redis并设置过期时间 |
| | | redis.boundValueOps(token).set(String.valueOf(userId), Constant.TOKEN_EXPIRES_HOUR, TimeUnit.HOURS); |
| | | redis.boundValueOps(String.valueOf(userId)).set(token, Constant.TOKEN_EXPIRES_HOUR, TimeUnit.HOURS); |
| | | return token; |
| | | } |
| | | |
| | | |
| | | public boolean checkToken(String token) { |
| | | if (token == null) { |
| | | return false; |
| | | } |
| | | String userId = redis.boundValueOps(token).get(); |
| | | if (userId == null) { |
| | | return false; |
| | | } |
| | | //如果验证成功,说明此用户进行了一次有效操作,延长token的过期时间 |
| | | redis.boundValueOps(token).expire(Constant.TOKEN_EXPIRES_HOUR, TimeUnit.HOURS); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public long getUserId(String token) { |
| | | if (token == null) { |
| | | return -1; |
| | | } |
| | | String userId = redis.boundValueOps(token).get(); |
| | | return Long.parseLong(userId); |
| | | } |
| | | |
| | | public void deleteToken(String token) { |
| | | redis.delete(token); |
| | | } |
| | | |
| | | @Override |
| | | public String getTokenByUserId(long userId) { |
| | | return redis.boundValueOps(String.valueOf(userId)).get(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | public interface TokenManager { |
| | | /** |
| | | * 创建一个token关联上指定用户 |
| | | * |
| | | * @param userId 指定用户的id |
| | | * @return 生成的token |
| | | */ |
| | | public String createToken(long userId, long role); |
| | | |
| | | /** |
| | | * 检查token是否有效 |
| | | * |
| | | * @param token |
| | | * @return 是否有效 |
| | | */ |
| | | public boolean checkToken(String token); |
| | | |
| | | public long getUserId(String token); |
| | | |
| | | public void deleteToken(String token); |
| | | |
| | | public String getTokenByUserId(long userId); |
| | | } |
New file |
| | |
| | | package com.dg.core.resolvers; |
| | | |
| | | import com.dg.core.Constant; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.MethodParameter; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.support.WebDataBinderFactory; |
| | | import org.springframework.web.context.request.NativeWebRequest; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.method.support.HandlerMethodArgumentResolver; |
| | | import org.springframework.web.method.support.ModelAndViewContainer; |
| | | import org.springframework.web.multipart.support.MissingServletRequestPartException; |
| | | |
| | | /** |
| | | * 增加方法注入,将含有CurrentUser注解的方法参数注入当前登录用户 |
| | | */ |
| | | @Component |
| | | public class CurrentUserMethodArgumentResolver implements HandlerMethodArgumentResolver { |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Override |
| | | public boolean supportsParameter(MethodParameter parameter) { |
| | | //如果参数类型是User并且有CurrentUser注解则支持 |
| | | if (parameter.getParameterType().isAssignableFrom(SysUser.class) && |
| | | parameter.hasParameterAnnotation(CurrentUser.class)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { |
| | | //取出鉴权时存入的登录用户Id |
| | | Long currentUserId = (Long) webRequest.getAttribute(Constant.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST); |
| | | if (currentUserId != null) { |
| | | //从数据库中查询并返回 |
| | | return userService.getUserById(currentUserId); |
| | | } |
| | | throw new MissingServletRequestPartException(Constant.CURRENT_USER_ID); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.Agreement; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAgreementService { |
| | | |
| | | Agreement queryByAgreement(String agreement); |
| | | |
| | | /** |
| | | * 获取相关附件列表(不分页) |
| | | * @return |
| | | */ |
| | | List<Agreement> selectConfigList(); |
| | | |
| | | /** |
| | | * 修改相关附件 |
| | | * @return |
| | | */ |
| | | ResultData update(Agreement agreement); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAreaCodeService { |
| | | |
| | | /** |
| | | * 根据指南id获取所属地区 |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> getAreaCodeByTransactionId(Integer transactionId); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IClassifyAdministrationService { |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | | */ |
| | | public List<ClassifyAdministration> selectConfigList(String classifyName, String classifyGrade); |
| | | |
| | | |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | | */ |
| | | public List<ClassifyAdministration> selectConfigList(IPage<ClassifyAdministration> page, |
| | | Integer state, |
| | | String classifyName, String classifyGrade); |
| | | |
| | | /** |
| | | * 新增分类 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(ClassifyAdministration entity); |
| | | |
| | | /** |
| | | * 更新分类 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(ClassifyAdministration entity); |
| | | |
| | | /** |
| | | * 删除分类 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @return |
| | | */ |
| | | public int countNum(String classifyName,String classifyGrade); |
| | | |
| | | |
| | | /** |
| | | * 获取管理菜单列表(已分级) |
| | | * @return |
| | | */ |
| | | List<ClassifyAdministration> selectConfigListByParentId(String parentId,Integer departmentId); |
| | | |
| | | /** |
| | | * 获取管理菜单列表(根目录分页) |
| | | * @return |
| | | */ |
| | | List<ClassifyAdministration> selectRootList (IPage<ClassifyAdministration> page, Integer stat,String parentId,Integer departmentId); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IElseAccessoryService { |
| | | |
| | | /** |
| | | * 获取附件列表 |
| | | * @param page |
| | | * @param state |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public List<ElseAccessoryEntity> selectConfigList(IPage<ElseAccessoryEntity> page, Integer state, @Param("Name") String Name); |
| | | |
| | | /** |
| | | * 获取附件列表全部 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public List<ElseAccessoryEntity> selectConfigList(String Name); |
| | | |
| | | |
| | | /** |
| | | * 新增列表 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(ElseAccessoryEntity entity); |
| | | |
| | | /** |
| | | * 更新列表 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(ElseAccessoryEntity entity); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public int countNum(String Name); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IGuideEvolveService |
| | | { |
| | | /** |
| | | * 查询记录列表 |
| | | * @return |
| | | */ |
| | | public List<GuideEvolveEntity> selectConfigList(String guideId); |
| | | |
| | | /** |
| | | * 新增记录 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(GuideEvolveEntity entity); |
| | | |
| | | /** |
| | | * 更新记录 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(GuideEvolveEntity entity); |
| | | |
| | | /** |
| | | * 删除记录 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | public interface IGuideRepairOrderService { |
| | | |
| | | int addOrder(GuideRepairOrder guideRepairOrder); |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @param orderNum |
| | | * @return |
| | | */ |
| | | public GuideRepairOrder selectConfigData(String Id, |
| | | String orderNum); |
| | | |
| | | |
| | | /** |
| | | * 分配人员 |
| | | * @param order |
| | | * @return |
| | | */ |
| | | public int updateConfig(GuideRepairOrder order); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IKeywordService { |
| | | /** |
| | | * 查询关键词列表 |
| | | * @return |
| | | */ |
| | | public List<KeywordEntity> selectConfigList(IPage<KeywordEntity> page, Integer state); |
| | | |
| | | /** |
| | | * 查询详情 |
| | | * @return |
| | | */ |
| | | public KeywordEntity selectConfigData(String Id, |
| | | String name); |
| | | |
| | | |
| | | /** |
| | | * 添加关键词 |
| | | * @return |
| | | */ |
| | | public int insertConfig(KeywordEntity entity); |
| | | |
| | | /** |
| | | * 编辑关键词 |
| | | * @return |
| | | */ |
| | | public int updateConfig(KeywordEntity entity); |
| | | |
| | | /** |
| | | * 删除关键词 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.MenuEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IMenuService |
| | | { |
| | | /** |
| | | * 获取菜单列表 |
| | | * @return |
| | | */ |
| | | public List<MenuEntity> selectConfigList(); |
| | | |
| | | |
| | | /** |
| | | * 添加新菜单 |
| | | * @return |
| | | */ |
| | | public int insertConfig(MenuEntity entity); |
| | | |
| | | /** |
| | | * 更新菜单 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(MenuEntity entity); |
| | | |
| | | /** |
| | | * 删除菜单 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(Long Id); |
| | | |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IOrganizationChartService |
| | | { |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | public List<OrganizationChartEntity> selectConfigList(String parentId,String grade); |
| | | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | public int insertConfig(OrganizationChartEntity entity); |
| | | |
| | | /** |
| | | * 更新机构 |
| | | */ |
| | | public int updateConfig(OrganizationChartEntity entity); |
| | | |
| | | /** |
| | | * 删除机构 |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | */ |
| | | public int countNum(); |
| | | |
| | | /** |
| | | * 查询机构列表(不分级不分页按等级排序) |
| | | */ |
| | | List<OrganizationChartEntity> selectList(); |
| | | |
| | | |
| | | /** |
| | | * 根据id查取消组织机构 |
| | | */ |
| | | OrganizationChartEntity selectConfigById(String id); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.ReplyTemplateEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IReplyTemplateService |
| | | { |
| | | /** |
| | | * 获取模板列表 |
| | | * @return |
| | | */ |
| | | public List<ReplyTemplateEntity> selectConfigList(IPage<ReplyTemplateEntity> page, Integer state,String Name); |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public ReplyTemplateEntity selectConfigData(String Id); |
| | | |
| | | /** |
| | | * 新增模板 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(ReplyTemplateEntity entity); |
| | | |
| | | /** |
| | | * 更新模板 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(ReplyTemplateEntity entity); |
| | | |
| | | /** |
| | | * 删除模板 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 获取数量 |
| | | * @return |
| | | */ |
| | | public int countNum(String Name); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.RoleManagementEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IRoleManagementService |
| | | { |
| | | /** |
| | | * 查询角色列表 |
| | | * @param page |
| | | * @param state |
| | | * @return |
| | | */ |
| | | public List<RoleManagementEntity> selectConfigList(IPage<RoleManagementEntity> page, Integer state); |
| | | |
| | | /** |
| | | * 新增角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(RoleManagementEntity entity); |
| | | |
| | | /** |
| | | * 编辑角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(RoleManagementEntity entity); |
| | | |
| | | /** |
| | | * 删除角色 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计条数 |
| | | * @return |
| | | */ |
| | | public int countNum(); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ISlideshowService { |
| | | |
| | | /** |
| | | * 查询轮播图列表(分页) |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | List<Slideshow> selectConfigList(IPage<SysUser> page, Integer state); |
| | | |
| | | /** |
| | | * 查询轮播图列表(不分页) |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | List<Slideshow> selectList(); |
| | | |
| | | /** |
| | | * 根据id 查询轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | Slideshow queryById(Integer id); |
| | | |
| | | /** |
| | | * 新增轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData add(Slideshow slideshow); |
| | | |
| | | /** |
| | | * 修改轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData update(Slideshow slideshow); |
| | | |
| | | |
| | | /** |
| | | * 删除轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData delete(Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ISysUserService { |
| | | SysUser getUserById(Long id); |
| | | SysUser getUserByAccount(String account); |
| | | /** |
| | | * 查询聊天列表 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType); |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertConfig(SysUser config); |
| | | |
| | | /** |
| | | * 更新聊天记录 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateConfig(SysUser config); |
| | | |
| | | /** |
| | | * 删除聊天记录 |
| | | * |
| | | * @param id 聊天记录主键id |
| | | * @return 结果 |
| | | */ |
| | | public int deleteConfigById(String id); |
| | | |
| | | |
| | | /** |
| | | * 获取数据库总条数(批量) |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public int selectNum(String userType); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.manual.pojo.QueryResults; |
| | | import com.dg.core.db.manual.pojo.RecommendResult; |
| | | import com.dg.core.db.manual.pojo.Search; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ITransactionEventService |
| | | { |
| | | /** |
| | | * 查询导办事务详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public TransactionEvent selectConfigData(String Id); |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @return |
| | | */ |
| | | public List<TransactionEvent> selectConfigList(IPage<TransactionEvent> page, Integer state, |
| | | String matterAndUser, String classifyGrade); |
| | | |
| | | /** |
| | | * 新增导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(TransactionEvent entity); |
| | | |
| | | /** |
| | | * 修改导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(TransactionEvent entity); |
| | | |
| | | /** |
| | | * 删除接口 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计数量 |
| | | * @return |
| | | */ |
| | | public int countNum(String matterAndUser,String classifyGrade); |
| | | |
| | | /** |
| | | * 导办事务搜索 |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | QueryResults queryMatterNameList(IPage<Search> page, Integer state,Integer recommendSize, String keyWord); |
| | | |
| | | /** |
| | | * 导办事务搜索统计数量 |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | int countNumByMatterName(String matterName); |
| | | |
| | | /** |
| | | * 根据分离查询导办事务 |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryByClassifyIdList(String classifyId,Integer departmentId); |
| | | |
| | | /** |
| | | * 根据查询时间查询导办事务 |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryByQueryTime(); |
| | | |
| | | /** |
| | | * 根据浏览次数查询导办事务 |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryByBrowseNum(); |
| | | |
| | | /** |
| | | * 查询导办事务求和 |
| | | * @return |
| | | */ |
| | | TransactionEvent sumTransactionNum(); |
| | | |
| | | int countNumByClassifyIdList(String classifyId, Integer departmentId); |
| | | |
| | | /** |
| | | * 导办事物列表(不分页) |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> selectList(); |
| | | |
| | | /** |
| | | * 智能咨询 |
| | | * @return |
| | | */ |
| | | RecommendResult smartConsulting(String keyWord); |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.Agreement; |
| | | import com.dg.core.db.gen.mapper.AgreementMapper; |
| | | import com.dg.core.service.IAgreementService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AgreementServiceImpl extends ServiceImpl<AgreementMapper, Agreement> implements IAgreementService { |
| | | |
| | | @Override |
| | | public Agreement queryByAgreement(String agreement) { |
| | | return baseMapper.selectOne(new QueryWrapper<Agreement>().lambda().eq(Agreement::getAgreement, agreement)); |
| | | } |
| | | |
| | | @Override |
| | | public List<Agreement> selectConfigList() { |
| | | return baseMapper.selectConfigList(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData update(Agreement agreement){ |
| | | agreement.setUpdateTime(LocalDateTime.now()); |
| | | int i = baseMapper.updateById(agreement); |
| | | if(i>0) |
| | | return ResultData.success(); |
| | | else |
| | | return ResultData.error(); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.gen.mapper.AreaCode2022Mapper; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.service.IAreaCodeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AreaCodeServiceImpl extends ServiceImpl<AreaCode2022Mapper, AreaCode2022> implements IAreaCodeService { |
| | | |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | @Resource |
| | | private TransactionEventMapper transactionEventMapper; |
| | | |
| | | @Override |
| | | public List<AreaCode2022> getAreaCodeByTransactionId(Integer transactionId){ |
| | | TransactionEvent transactionEvent = transactionEventMapper.selectOne(new QueryWrapper<TransactionEvent>().lambda(). |
| | | eq(TransactionEvent::getId, transactionId)); |
| | | OrganizationChartEntity organizationChartEntity = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getId, transactionEvent.getDepartmentId())); |
| | | List<String> areaCodes=new ArrayList<>(); |
| | | if (organizationChartEntity!=null){ |
| | | if (organizationChartEntity.getCity()!=null) |
| | | areaCodes.add(organizationChartEntity.getCity()); |
| | | if (organizationChartEntity.getDistrict()!=null) |
| | | areaCodes.add(organizationChartEntity.getDistrict()); |
| | | if (organizationChartEntity.getVillage()!=null) |
| | | areaCodes.add(organizationChartEntity.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChartEntity); |
| | | } |
| | | return baseMapper.selectByIdSet(areaCodes); |
| | | } |
| | | |
| | | public List<String> getAreaCodeIds(List<String> areaCodes, OrganizationChartEntity organizationChartEntity){ |
| | | organizationChartEntity = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChartEntity.getId())); |
| | | if (organizationChartEntity!=null){ |
| | | if (organizationChartEntity.getCity()!=null) |
| | | areaCodes.add(organizationChartEntity.getCity()); |
| | | if (organizationChartEntity.getDistrict()!=null) |
| | | areaCodes.add(organizationChartEntity.getDistrict()); |
| | | if (organizationChartEntity.getVillage()!=null) |
| | | areaCodes.add(organizationChartEntity.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChartEntity); |
| | | } |
| | | return areaCodes; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.gen.mapper.ClassifyAdministrationMapper; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ClassifyAdministrationImpl extends ServiceImpl<ClassifyAdministrationMapper, ClassifyAdministration> |
| | | implements IClassifyAdministrationService |
| | | { |
| | | |
| | | @Override |
| | | public List<ClassifyAdministration> selectConfigList(String classifyName, String classifyGrade) { |
| | | return baseMapper.selectConfigList( classifyName, classifyGrade); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClassifyAdministration> selectConfigList(IPage<ClassifyAdministration> page, |
| | | Integer state, String classifyName, String classifyGrade) { |
| | | return baseMapper.selectConfigList(page,state, classifyName, classifyGrade); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClassifyAdministration> selectConfigListByParentId(String parentId,Integer departmentId){ |
| | | List<ClassifyAdministration> classifyAdministrationEntities = baseMapper.selectRootList(parentId ,departmentId); |
| | | for (ClassifyAdministration classifyAdministrationEntitie: classifyAdministrationEntities) { |
| | | classifyAdministrationEntitie.setClassifyAdministrationEntityList(selectConfigListByParentId(classifyAdministrationEntitie.getId().toString(),departmentId)); |
| | | } |
| | | return classifyAdministrationEntities; |
| | | } |
| | | |
| | | @Override |
| | | public List<ClassifyAdministration> selectRootList(IPage<ClassifyAdministration> page, Integer stat,String parentId,Integer departmentId) { |
| | | List<ClassifyAdministration> classifyAdministrations = baseMapper.selectRootList(page, stat,"0" ,departmentId); |
| | | for (ClassifyAdministration classifyAdministrationEntitie: classifyAdministrations) { |
| | | classifyAdministrationEntitie.setClassifyAdministrationEntityList(selectConfigListByParentId(classifyAdministrationEntitie.getId().toString(),departmentId)); |
| | | } |
| | | return classifyAdministrations; |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(ClassifyAdministration entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(ClassifyAdministration entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum(String classifyName,String classifyGrade) { |
| | | return baseMapper.countNum(classifyName,classifyGrade); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import com.dg.core.db.gen.mapper.ElseAccessoryMapper; |
| | | import com.dg.core.service.IElseAccessoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ElseAccessoryImpl extends ServiceImpl<ElseAccessoryMapper, ElseAccessoryEntity> |
| | | implements IElseAccessoryService |
| | | { |
| | | |
| | | @Override |
| | | public List<ElseAccessoryEntity> selectConfigList(IPage<ElseAccessoryEntity> page, Integer state, String Name) { |
| | | return baseMapper.selectConfigList(page,state,Name); |
| | | } |
| | | |
| | | @Override |
| | | public List<ElseAccessoryEntity> selectConfigList(String Name) { |
| | | return baseMapper.selectConfigList(Name); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(ElseAccessoryEntity entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(ElseAccessoryEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum(String Name) { |
| | | return baseMapper.countNum(Name); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.mapper.GuideEvolveMapper; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class GuideEvolveImpl extends ServiceImpl<GuideEvolveMapper, GuideEvolveEntity> implements IGuideEvolveService |
| | | { |
| | | |
| | | @Override |
| | | public List<GuideEvolveEntity> selectConfigList(String guideId) { |
| | | return baseMapper.selectConfigList(guideId); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(GuideEvolveEntity entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(GuideEvolveEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum() { |
| | | return baseMapper.countNum(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrderImage; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.gen.mapper.GuideRepairOrderImageMapper; |
| | | import com.dg.core.db.gen.mapper.GuideRepairOrderMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.util.Snowflake; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Service |
| | | public class GuideRepairOrderServiceImpl extends ServiceImpl<GuideRepairOrderMapper, GuideRepairOrder> implements IGuideRepairOrderService { |
| | | |
| | | @Resource |
| | | private TransactionEventMapper transactionEventMapper; |
| | | |
| | | @Resource |
| | | private GuideRepairOrderImageMapper guideRepairOrderImageMapper; |
| | | |
| | | @Override |
| | | public int addOrder(GuideRepairOrder guideRepairOrder){ |
| | | |
| | | TransactionEvent transactionEvent = transactionEventMapper.selectOne(new QueryWrapper<TransactionEvent>().lambda(). |
| | | eq(TransactionEvent::getId, guideRepairOrder.getMatterId())); |
| | | guideRepairOrder.setOrderNum(Long.toString(Snowflake.getId())); |
| | | guideRepairOrder.setMatterName(transactionEvent.getMatterName()); |
| | | guideRepairOrder.setDepartmentId(transactionEvent.getDepartmentId()); |
| | | guideRepairOrder.setClassifyId(transactionEvent.getClassifyId()); |
| | | guideRepairOrder.setState("1"); |
| | | transactionEvent.setTransactionNum(transactionEvent.getTransactionNum()+1); |
| | | String[] images = guideRepairOrder.getImages().split(","); |
| | | for (String image: images) { |
| | | GuideRepairOrderImage guideRepairOrderImage = new GuideRepairOrderImage(); |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | | guideRepairOrderImage.setUrl(image); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | | int ans= baseMapper.insert(guideRepairOrder); |
| | | int i = transactionEventMapper.updateById(transactionEvent); |
| | | if (ans>0&&i>0) |
| | | return 1; |
| | | else |
| | | return 0; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public GuideRepairOrder selectConfigData(String Id, String orderNum) { |
| | | return baseMapper.selectConfigData(Id,orderNum); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(GuideRepairOrder order) { |
| | | return baseMapper.updateConfig(order); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | import com.dg.core.db.gen.mapper.KeywordMapper; |
| | | import com.dg.core.service.IKeywordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class KeywordImpl extends ServiceImpl<KeywordMapper, KeywordEntity> implements IKeywordService { |
| | | |
| | | |
| | | @Override |
| | | public List<KeywordEntity> selectConfigList(IPage<KeywordEntity> page, Integer state) { |
| | | return baseMapper.selectConfigList(page,state); |
| | | } |
| | | |
| | | @Override |
| | | public KeywordEntity selectConfigData(String Id, String name) { |
| | | return baseMapper.selectConfigData(Id,name); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(KeywordEntity entity) |
| | | { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(KeywordEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum() { |
| | | return baseMapper.countNum(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.MenuEntity; |
| | | import com.dg.core.db.gen.mapper.MenuMapper; |
| | | import com.dg.core.service.IMenuService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class MenuImpl extends ServiceImpl<MenuMapper, MenuEntity> implements IMenuService |
| | | { |
| | | @Override |
| | | public List<MenuEntity> selectConfigList() { |
| | | return baseMapper.selectConfigList(); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(MenuEntity entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(MenuEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(Long Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum() { |
| | | return baseMapper.countNum(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class OrganizationChartImpl extends ServiceImpl<OrganizationChartMapper, OrganizationChartEntity> |
| | | implements IOrganizationChartService |
| | | { |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectConfigList(String parentId,String grade) |
| | | { |
| | | List<OrganizationChartEntity> ocList=baseMapper.selectConfigList("","1"); |
| | | |
| | | for (OrganizationChartEntity entity:ocList) |
| | | { |
| | | entity.setChild(baseMapper.selectConfigList(entity.getId()+"","")); |
| | | |
| | | if (entity.getChild()!=null) |
| | | { |
| | | entity.setChild(this.selectConfigList(entity.getId().toString())); |
| | | } |
| | | } |
| | | return ocList; |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(OrganizationChartEntity entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(OrganizationChartEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum() { |
| | | return baseMapper.countNum(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public List<OrganizationChartEntity> selectConfigList(String parentsId) { |
| | | List<OrganizationChartEntity> list =baseMapper.selectConfigList(parentsId,""); |
| | | for (OrganizationChartEntity sysStreet:list) { |
| | | sysStreet.setChild(baseMapper.selectConfigList(sysStreet.getId().toString(),"")); |
| | | if (sysStreet.getChild()!=null) |
| | | { |
| | | sysStreet.setChild(this.selectConfigList(sysStreet.getId().toString())); |
| | | } |
| | | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectList(){ |
| | | return baseMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda().orderByAsc(OrganizationChartEntity::getGrade)); |
| | | } |
| | | |
| | | @Override |
| | | public OrganizationChartEntity selectConfigById(String id) { |
| | | return baseMapper.selectConfigById(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.ReplyTemplateEntity; |
| | | import com.dg.core.db.gen.mapper.ReplyTemplateMapper; |
| | | import com.dg.core.service.IReplyTemplateService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ReplyTemplateImpl extends ServiceImpl<ReplyTemplateMapper, ReplyTemplateEntity> implements IReplyTemplateService |
| | | { |
| | | |
| | | @Override |
| | | public List<ReplyTemplateEntity> selectConfigList(IPage<ReplyTemplateEntity> page, Integer state,String Name) { |
| | | return baseMapper.selectConfigList(page,state,Name); |
| | | } |
| | | |
| | | @Override |
| | | public ReplyTemplateEntity selectConfigData(String Id) { |
| | | return baseMapper.selectConfigData(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(ReplyTemplateEntity entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(ReplyTemplateEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum(String Name) { |
| | | return baseMapper.countNum(Name); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.RoleManagementEntity; |
| | | import com.dg.core.db.gen.mapper.RoleManagementMapper; |
| | | import com.dg.core.service.IRoleManagementService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class RoleManagementImpl extends ServiceImpl<RoleManagementMapper, RoleManagementEntity> implements IRoleManagementService { |
| | | @Override |
| | | public List<RoleManagementEntity> selectConfigList(IPage<RoleManagementEntity> page, Integer state) { |
| | | return baseMapper.selectConfigList(page,state); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(RoleManagementEntity entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(RoleManagementEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum() { |
| | | return baseMapper.countNum(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.SlideshowMapper; |
| | | import com.dg.core.service.ISlideshowService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SlideshowServiceImpl extends ServiceImpl<SlideshowMapper, Slideshow> implements ISlideshowService { |
| | | |
| | | |
| | | @Override |
| | | public List<Slideshow> selectConfigList(IPage<SysUser> page, Integer state) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<Slideshow> selectList() { |
| | | return baseMapper.selectList(new QueryWrapper<Slideshow>().lambda()); |
| | | } |
| | | |
| | | @Override |
| | | public Slideshow queryById(Integer id) { |
| | | return baseMapper.selectOne(new QueryWrapper<Slideshow>().lambda().eq(Slideshow::getId,id)); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData add(Slideshow slideshow){ |
| | | if (slideshow.getUrl()==null||slideshow.getUrl()=="") |
| | | return ResultData.error("图片地址不能为空"); |
| | | if (slideshow.getLinkType()==null) |
| | | return ResultData.error("跳转链接类型不能为空"); |
| | | if (slideshow.getTitle()==null||slideshow.getTitle()=="") |
| | | return ResultData.error("标题不能为空"); |
| | | if (slideshow.getLinkType().equals(2)&&(slideshow.getContent()==null||slideshow.getContent()=="")) |
| | | return ResultData.error("类型为富文本时,富文本内容不能为空"); |
| | | if (slideshow.getLinkType().equals(4)&&(slideshow.getLink()==null||slideshow.getLink()=="")) |
| | | return ResultData.error("类型为微信文章时,文章链接容不能为空"); |
| | | slideshow.setCreateTime(LocalDateTime.now()); |
| | | return ResultData.success( baseMapper.insert(slideshow)) ; |
| | | } |
| | | |
| | | @Override |
| | | public ResultData update(Slideshow slideshow){ |
| | | if (slideshow.getUrl()==null||slideshow.getUrl()=="") |
| | | return ResultData.error("图片地址不能为空"); |
| | | if (slideshow.getLinkType()==null) |
| | | return ResultData.error("跳转链接类型不能为空"); |
| | | if (slideshow.getTitle()==null||slideshow.getTitle()=="") |
| | | return ResultData.error("标题不能为空"); |
| | | if (slideshow.getLinkType().equals(2)&&(slideshow.getContent()==null||slideshow.getContent()=="")) |
| | | return ResultData.error("类型为富文本时,富文本内容不能为空"); |
| | | if (slideshow.getLinkType().equals(4)&&(slideshow.getLink()==null||slideshow.getLink()=="")) |
| | | return ResultData.error("类型为微信文章时,文章链接容不能为空"); |
| | | return ResultData.success(baseMapper.updateById(slideshow)); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ResultData delete(Integer id){ |
| | | int i = baseMapper.deleteById(id); |
| | | if(i>0) |
| | | return ResultData.success(); |
| | | else |
| | | return ResultData.error(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.service.ISysUserService; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | @Service |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService |
| | | { |
| | | |
| | | @Override |
| | | public SysUser getUserById(Long id) { |
| | | return baseMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public SysUser getUserByAccount(String account) { |
| | | HashMap<String, Object> map = new HashMap(); |
| | | map.put("login_name", account); |
| | | List<SysUser> sysUsers = baseMapper.selectByMap(map); |
| | | if (sysUsers.size() > 0) { |
| | | return sysUsers.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType) { |
| | | return baseMapper.selectConfigList(page, state,userType); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertConfig(SysUser config) |
| | | { |
| | | return baseMapper.insertConfig(config); |
| | | } |
| | | |
| | | /** |
| | | * 更新聊天记录 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateConfig(SysUser config) |
| | | { |
| | | return baseMapper.updateConfig(config); |
| | | } |
| | | |
| | | /** |
| | | * 删除聊天记录 |
| | | * |
| | | * @param id 聊天记录主键id |
| | | * @return 结果 |
| | | */ |
| | | public int deleteConfigById(String id) |
| | | { |
| | | return baseMapper.deleteConfigById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int selectNum(String userType) { |
| | | return baseMapper.selectNum(userType); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.gen.mapper.KeywordMapper; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.db.manual.pojo.QueryResults; |
| | | import com.dg.core.db.manual.pojo.RecommendResult; |
| | | import com.dg.core.db.manual.pojo.Search; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class TransactionEventImpl extends ServiceImpl<TransactionEventMapper, TransactionEvent> implements ITransactionEventService { |
| | | |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | @Resource |
| | | private KeywordMapper keywordMapper; |
| | | |
| | | @Override |
| | | public TransactionEvent selectConfigData(String Id) { |
| | | return baseMapper.selectConfigData(Id); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> selectConfigList(IPage<TransactionEvent> page, Integer state, |
| | | String matterAndUser, String classifyGrade) { |
| | | return baseMapper.selectConfigList(page, state, matterAndUser, classifyGrade); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(TransactionEvent entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(TransactionEvent entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public int countNum(String matterAndUser,String classifyGrade) { |
| | | return baseMapper.countNum( matterAndUser, classifyGrade); |
| | | } |
| | | |
| | | @Override |
| | | public QueryResults queryMatterNameList(IPage<Search> page,Integer state, Integer recommendSize,String keyWord) { |
| | | QueryResults queryResults = new QueryResults(); |
| | | List<Search> searches = baseMapper.selectSearch(page, state, keyWord); |
| | | queryResults.setSearchList(searches); |
| | | List<Search> searchesAssociate = baseMapper.selectSearchAssociate(page, recommendSize, keyWord); |
| | | queryResults.setTransactionEventList(searchesAssociate); |
| | | queryResults.setKeywordEntityList( keywordMapper.selectByName(keyWord)); |
| | | queryResults.setTotal((baseMapper.selectSearch(keyWord).size())+(baseMapper.selectSearchAssociate(keyWord).size())); |
| | | return queryResults; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public RecommendResult smartConsulting(String keyWord){ |
| | | RecommendResult recommendResult=new RecommendResult(); |
| | | List<KeywordEntity> keywordEntityList=new ArrayList<>(); |
| | | List<TransactionEvent> transactionEventEntities = baseMapper.queryMatterNameList(keyWord); |
| | | recommendResult.setTransactionEventList(transactionEventEntities); |
| | | for (TransactionEvent transactionEvent: transactionEventEntities) { |
| | | String[] associateNames = transactionEvent.getAssociateNames().split(","); |
| | | for (String associateName: associateNames) { |
| | | KeywordEntity keywordEntity = new KeywordEntity(); |
| | | keywordEntity.setName(associateName); |
| | | keywordEntityList.add(keywordEntity); |
| | | } |
| | | |
| | | } |
| | | recommendResult.setKeywordEntityList(keywordEntityList); |
| | | List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectByKeyWord(keyWord); |
| | | recommendResult.setOrganizationChartEntityList(organizationChartEntities); |
| | | return recommendResult; |
| | | } |
| | | |
| | | @Override |
| | | public int countNumByMatterName(String matterName) { |
| | | return baseMapper.countNumByMatterName(matterName); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> queryByClassifyIdList(String classifyId,Integer departmentId) { |
| | | return baseMapper.queryByClassifyIdList(classifyId,departmentId); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> queryByQueryTime() { |
| | | List<TransactionEvent> transactionEvents = baseMapper.selectList(new QueryWrapper<TransactionEvent>().lambda().orderByDesc(TransactionEvent::getQueryTime)); |
| | | return transactionEvents; |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> queryByBrowseNum() { |
| | | List<TransactionEvent> transactionEvents = baseMapper.selectList(new QueryWrapper<TransactionEvent>().lambda().orderByDesc(TransactionEvent::getBrowseNum)); |
| | | return transactionEvents; |
| | | } |
| | | |
| | | @Override |
| | | public TransactionEvent sumTransactionNum() { |
| | | return baseMapper.sumTransactionNum(); |
| | | } |
| | | |
| | | @Override |
| | | public int countNumByClassifyIdList(String classifyId, Integer departmentId) { |
| | | return baseMapper.countNumByClassifyIdList(classifyId,departmentId); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> selectList(){ |
| | | return baseMapper.selectList(new QueryWrapper<TransactionEvent>().lambda()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.spring; |
| | | |
| | | import com.dg.core.util.StringUtils; |
| | | import org.springframework.aop.framework.AopContext; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.beans.factory.NoSuchBeanDefinitionException; |
| | | import org.springframework.beans.factory.config.BeanFactoryPostProcessor; |
| | | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * spring工具类 方便在非spring管理环境中获取bean |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware |
| | | { |
| | | /** Spring应用上下文环境 */ |
| | | private static ConfigurableListableBeanFactory beanFactory; |
| | | |
| | | private static ApplicationContext applicationContext; |
| | | |
| | | @Override |
| | | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException |
| | | { |
| | | SpringUtils.beanFactory = beanFactory; |
| | | } |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException |
| | | { |
| | | SpringUtils.applicationContext = applicationContext; |
| | | } |
| | | |
| | | /** |
| | | * 获取对象 |
| | | * |
| | | * @param name |
| | | * @return Object 一个以所给名字注册的bean的实例 |
| | | * @throws BeansException |
| | | * |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <T> T getBean(String name) throws BeansException |
| | | { |
| | | return (T) beanFactory.getBean(name); |
| | | } |
| | | |
| | | /** |
| | | * 获取类型为requiredType的对象 |
| | | * |
| | | * @param clz |
| | | * @return |
| | | * @throws BeansException |
| | | * |
| | | */ |
| | | public static <T> T getBean(Class<T> clz) throws BeansException |
| | | { |
| | | T result = (T) beanFactory.getBean(clz); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true |
| | | * |
| | | * @param name |
| | | * @return boolean |
| | | */ |
| | | public static boolean containsBean(String name) |
| | | { |
| | | return beanFactory.containsBean(name); |
| | | } |
| | | |
| | | /** |
| | | * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) |
| | | * |
| | | * @param name |
| | | * @return boolean |
| | | * @throws NoSuchBeanDefinitionException |
| | | * |
| | | */ |
| | | public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException |
| | | { |
| | | return beanFactory.isSingleton(name); |
| | | } |
| | | |
| | | /** |
| | | * @param name |
| | | * @return Class 注册对象的类型 |
| | | * @throws NoSuchBeanDefinitionException |
| | | * |
| | | */ |
| | | public static Class<?> getType(String name) throws NoSuchBeanDefinitionException |
| | | { |
| | | return beanFactory.getType(name); |
| | | } |
| | | |
| | | /** |
| | | * 如果给定的bean名字在bean定义中有别名,则返回这些别名 |
| | | * |
| | | * @param name |
| | | * @return |
| | | * @throws NoSuchBeanDefinitionException |
| | | * |
| | | */ |
| | | public static String[] getAliases(String name) throws NoSuchBeanDefinitionException |
| | | { |
| | | return beanFactory.getAliases(name); |
| | | } |
| | | |
| | | /** |
| | | * 获取aop代理对象 |
| | | * |
| | | * @param invoker |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <T> T getAopProxy(T invoker) |
| | | { |
| | | return (T) AopContext.currentProxy(); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前的环境配置,无配置返回null |
| | | * |
| | | * @return 当前的环境配置 |
| | | */ |
| | | public static String[] getActiveProfiles() |
| | | { |
| | | return applicationContext.getEnvironment().getActiveProfiles(); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前的环境配置,当有多个环境配置时,只获取第一个 |
| | | * |
| | | * @return 当前的环境配置 |
| | | */ |
| | | public static String getActiveProfile() |
| | | { |
| | | final String[] activeProfiles = getActiveProfiles(); |
| | | return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.task; |
| | | |
| | | import javax.servlet.ServletContextEvent; |
| | | import javax.servlet.ServletContextListener; |
| | | import javax.servlet.annotation.WebListener; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | |
| | | @WebListener |
| | | public class SendWsListener implements ServletContextListener { |
| | | @Override |
| | | public void contextDestroyed(ServletContextEvent arg0) { |
| | | System.out.println("定时发送Xml信息监听--已关闭!"); |
| | | } |
| | | |
| | | @Override |
| | | public void contextInitialized(ServletContextEvent arg0) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); |
| | | //设置24小时制度,Calendar.HOUR是12小时制度 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | calendar.set(year, month, day, 8, 00, 00); |
| | | // 当天8点(默认执行时间) |
| | | Date defaultdate = calendar.getTime(); |
| | | Date sendDate = null; |
| | | if (defaultdate.before(new Date())) { |
| | | // 若当前时间超过了defaultdate时间,当天不再执行,则将执行时间sendDate改为明天8点 |
| | | calendar.add(Calendar.DATE, 1); |
| | | sendDate = calendar.getTime(); |
| | | }else { |
| | | // 若当前时间没有超过defaultdate时间,则将执行时间sendDate改为defaultdate |
| | | sendDate = defaultdate; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ----------------每刻任务 ---------------- |
| | | * 启动服务器后,若此时时间没过8点,等待。到了8点自动执行一次,15分钟后再执行一次,周而复始 |
| | | * 启动服务器后,若此时时间超过8点,会立刻执行一次,等到15分钟后再次执行一次,周而复始 到了第二天,不会再判断是否是8点,这个开始时间,只会判断一次而已 |
| | | */ |
| | | Timer qTimer = new Timer(); |
| | | qTimer.schedule(new TimerTask() { |
| | | |
| | | @Override |
| | | public void run() { |
| | | System.out.println("每刻任务已执行"); |
| | | // TODO 写你的逻辑 |
| | | } |
| | | }, defaultdate, 1 * 60 * 1000);// 定时每15分钟 |
| | | System.out.println("每刻定时发送Xml信息监听--已启动!"); |
| | | |
| | | /** |
| | | * ----------------每日任务 ---------------- |
| | | * 启动服务器后,若此时时间没过8点,等待。到了8点自动执行一次,24小时后(第二天8点)再执行一次,周而复始 |
| | | * 启动服务器后,若此时时间已经超过8点,则等到24小时后(第二天8点)才执行一次,周而复始 |
| | | */ |
| | | Timer dTimer = new Timer(); |
| | | dTimer.schedule(new TimerTask() { |
| | | |
| | | @Override |
| | | public void run() { |
| | | System.out.println("每日任务已经执行"); |
| | | // TODO 写你的逻辑 |
| | | } |
| | | }, sendDate, 24 * 60 * 60 * 1000);// 定时24小时:24 * 60 * 60 * 1000 |
| | | System.out.println("每日定时发送Xml信息监听--已启动!"); |
| | | |
| | | /** |
| | | * ----------------每月任务 ---------------- |
| | | * 启动服务器后,若此时时间没过8点,等待。到了8点自动执行判断是否是当前月份的1号,若是则执行一次, |
| | | * 24小时后(第二天8点)再执行一次判断(每月1号以后后的29天或30天后才会是下月1号,再执行一次),周而复始 启动服务器后,若此时时间已经超过8点,会立刻执行一次,等到下个月1号再次执行一次,周而复始 |
| | | */ |
| | | Timer mTimer = new Timer(); |
| | | mTimer.schedule(new TimerTask() { |
| | | |
| | | @Override |
| | | public void run() { |
| | | Calendar c = Calendar.getInstance(); |
| | | int day = c.get(Calendar.DAY_OF_MONTH); |
| | | System.out.println("月任务 判断中"); |
| | | if (day == 1) { |
| | | // 每天执行,若为每月1号才执行 |
| | | System.out.println("月任务执行已执行"); |
| | | // TODO 写你的逻辑 |
| | | } |
| | | |
| | | } |
| | | }, sendDate, 24 * 60 * 60 * 1000);// 每天执行一次检查 |
| | | |
| | | System.out.println("每月定时发送Xml信息监听--已启动!"); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.task; |
| | | |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.env.Environment; |
| | | 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; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | public class SwaggerConfig { |
| | | |
| | | //配置了Swagger的Docket的bean实例 |
| | | @Bean |
| | | public Docket docket(Environment environment){ |
| | | |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()) |
| | | .enable(true) //配置是否启用Swagger,如果是false,在浏览器将无法访问 |
| | | .select()// 通过.select()方法,去配置扫描接口,RequestHandlerSelectors配置如何扫描接口 |
| | | .apis(RequestHandlerSelectors.basePackage("com.dg.core")) |
| | | // 配置如何通过path过滤,即这里只扫描请求以/longdi开头的接口 |
| | | // .paths(PathSelectors.ant("/longdi/**")) |
| | | .build(); |
| | | |
| | | } |
| | | |
| | | |
| | | //配置文档信息 |
| | | private ApiInfo apiInfo() { |
| | | Contact contact = new Contact("花城e+", "http://localhost:8181/swagger-ui/index.html", "项目"); |
| | | return new ApiInfo( |
| | | "花城e+接口文档", // 标题 |
| | | "花城e+接口文档", // 描述 |
| | | "v1.0", // 版本 |
| | | "http://localhost:8181/swagger-ui/index.html", // 组织链接 |
| | | contact, // 联系人信息 |
| | | "Apach 2.0 许可", // 许可 |
| | | "许可链接", // 许可连接 |
| | | new ArrayList<>()// 扩展 |
| | | ); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | |
| | | import java.lang.management.ManagementFactory; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 时间工具类 |
| | | * |
| | | * @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 int differentDaysByMillisecond(Date date1, Date date2) |
| | | { |
| | | return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24))); |
| | | } |
| | | |
| | | /** |
| | | * 计算两个时间差 |
| | | */ |
| | | 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 + "分钟"; |
| | | } |
| | | |
| | | /** |
| | | * 增加 LocalDateTime ==> Date |
| | | */ |
| | | public static Date toDate(LocalDateTime temporalAccessor) |
| | | { |
| | | ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault()); |
| | | return Date.from(zdt.toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 增加 LocalDate ==> Date |
| | | */ |
| | | public static Date toDate(LocalDate temporalAccessor) |
| | | { |
| | | LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0)); |
| | | ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); |
| | | return Date.from(zdt.toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前日期前(后)x天的日期 |
| | | * |
| | | * @param day |
| | | * 天数(如果day数为负数,说明是此日期前的天数) |
| | | * @param sdf 日期格式 |
| | | */ |
| | | public static String getBeforNumDay(SimpleDateFormat sdf,int day) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.add(Calendar.DATE, day); |
| | | return sdf.format(calendar.getTime()); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前日期前(后)n天的日期集合 |
| | | * @param sdf 时间格式化字符 |
| | | * @param dayNum 前(后)的天数 |
| | | * @param isAround 1.前 2.后 |
| | | * @return 当前日期前(后)n天的日期集合 |
| | | */ |
| | | public static List<String> getLastDayDateList(SimpleDateFormat sdf,Integer dayNum,Integer isAround){ |
| | | List<String> dateList = new ArrayList<>(); |
| | | for (int i = dayNum; i > 0; i--) { |
| | | String date = ""; |
| | | if(isAround.equals(2)){ |
| | | date = getBeforNumDay(sdf,i); |
| | | }else{ |
| | | date = getBeforNumDay(sdf,-i); |
| | | } |
| | | dateList.add(date); |
| | | } |
| | | return dateList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | /** |
| | | * ID生成器工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class IdUtils |
| | | { |
| | | /** |
| | | * 获取随机UUID |
| | | * |
| | | * @return 随机UUID |
| | | */ |
| | | public static String randomUUID() |
| | | { |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | /** |
| | | * 简化的UUID,去掉了横线 |
| | | * |
| | | * @return 简化的UUID,去掉了横线 |
| | | */ |
| | | public static String simpleUUID() |
| | | { |
| | | return UUID.randomUUID().toString(true); |
| | | } |
| | | |
| | | /** |
| | | * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID |
| | | * |
| | | * @return 随机UUID |
| | | */ |
| | | public static String fastUUID() |
| | | { |
| | | return UUID.fastUUID().toString(); |
| | | } |
| | | |
| | | /** |
| | | * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID |
| | | * |
| | | * @return 简化的UUID,去掉了横线 |
| | | */ |
| | | public static String fastSimpleUUID() |
| | | { |
| | | return UUID.fastUUID().toString(true); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.dg.core.spring.SpringUtils; |
| | | import org.springframework.context.MessageSource; |
| | | import org.springframework.context.i18n.LocaleContextHolder; |
| | | |
| | | /** |
| | | * 获取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()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | @MapperScan("com.zyd.mapper") |
| | | public class MyBatisPlusConfig { |
| | | /** |
| | | * 分页插件 |
| | | */ |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | |
| | | public class MyUtil { |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | | * @author ruoyi 序列生成类 |
| | | */ |
| | | public class Seq |
| | | { |
| | | // 通用序列类型 |
| | | public static final String commSeqType = "COMMON"; |
| | | |
| | | // 上传序列类型 |
| | | public static final String uploadSeqType = "UPLOAD"; |
| | | |
| | | // 通用接口序列数 |
| | | private static AtomicInteger commSeq = new AtomicInteger(1); |
| | | |
| | | // 上传接口序列数 |
| | | private static AtomicInteger uploadSeq = new AtomicInteger(1); |
| | | |
| | | // 机器标识 |
| | | private static String machineCode = "A"; |
| | | |
| | | /** |
| | | * 获取通用序列号 |
| | | * |
| | | * @return 序列值 |
| | | */ |
| | | public static String getId() |
| | | { |
| | | return getId(commSeqType); |
| | | } |
| | | |
| | | /** |
| | | * 默认16位序列号 yyMMddHHmmss + 一位机器标识 + 3长度循环递增字符串 |
| | | * |
| | | * @return 序列值 |
| | | */ |
| | | public static String getId(String type) |
| | | { |
| | | AtomicInteger atomicInt = commSeq; |
| | | if (uploadSeqType.equals(type)) |
| | | { |
| | | atomicInt = uploadSeq; |
| | | } |
| | | return getId(atomicInt, 3); |
| | | } |
| | | |
| | | /** |
| | | * 通用接口序列号 yyMMddHHmmss + 一位机器标识 + length长度循环递增字符串 |
| | | * |
| | | * @param atomicInt 序列数 |
| | | * @param length 数值长度 |
| | | * @return 序列值 |
| | | */ |
| | | public static String getId(AtomicInteger atomicInt, int length) |
| | | { |
| | | String result = DateUtils.dateTimeNow(); |
| | | result += machineCode; |
| | | result += getSeq(atomicInt, length); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 序列循环递增字符串[1, 10 的 (length)幂次方), 用0左补齐length位数 |
| | | * |
| | | * @return 序列值 |
| | | */ |
| | | private synchronized static String getSeq(AtomicInteger atomicInt, int length) |
| | | { |
| | | // 先取值再+1 |
| | | int value = atomicInt.getAndIncrement(); |
| | | |
| | | // 如果更新后值>=10 的 (length)幂次方则重置为1 |
| | | int maxSeq = (int) Math.pow(10, length); |
| | | if (atomicInt.get() >= maxSeq) |
| | | { |
| | | atomicInt.set(1); |
| | | } |
| | | // 转字符串,用0左补齐 |
| | | return StringUtils.padl(value, length); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * 客户端工具类 |
| | | * |
| | | * @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); |
| | | } |
| | | |
| | | /** |
| | | * 获取Boolean参数 |
| | | */ |
| | | public static Boolean getParameterToBool(String name) |
| | | { |
| | | return Convert.toBool(getRequest().getParameter(name)); |
| | | } |
| | | |
| | | /** |
| | | * 获取Boolean参数 |
| | | */ |
| | | public static Boolean getParameterToBool(String name, Boolean defaultValue) |
| | | { |
| | | return Convert.toBool(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 待渲染的字符串 |
| | | */ |
| | | public static void renderString(HttpServletResponse response, String string) |
| | | { |
| | | try |
| | | { |
| | | response.setStatus(200); |
| | | response.setContentType("application/json"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | response.getWriter().print(string); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 是否是Ajax异步请求 |
| | | * |
| | | * @param request |
| | | */ |
| | | public static boolean isAjaxRequest(HttpServletRequest request) |
| | | { |
| | | String accept = request.getHeader("accept"); |
| | | if (accept != null && accept.contains("application/json")) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | String xRequestedWith = request.getHeader("X-Requested-With"); |
| | | if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | String uri = request.getRequestURI(); |
| | | if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | String ajax = request.getParameter("__ajax"); |
| | | return StringUtils.inStringIgnoreCase(ajax, "json", "xml"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | |
| | | /** |
| | | * 雪花id获取工具类 |
| | | * @author lyq |
| | | * @date 2022-03-04 |
| | | */ |
| | | public class Snowflake { |
| | | public static long getId() { |
| | | cn.hutool.core.lang.Snowflake snowflake = IdUtil.getSnowflake(1, 1); |
| | | long id = snowflake.nextId(); |
| | | return id; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import cn.hutool.core.text.StrFormatter; |
| | | import com.dg.core.file.Constants; |
| | | import org.springframework.util.AntPathMatcher; |
| | | |
| | | import java.text.NumberFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 字符串工具类 |
| | | * |
| | | * @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); |
| | | } |
| | | |
| | | /** |
| | | * 是否为http(s)://开头 |
| | | * |
| | | * @param link 链接 |
| | | * @return 结果 |
| | | */ |
| | | public static boolean ishttp(String link) |
| | | { |
| | | return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS); |
| | | } |
| | | |
| | | /** |
| | | * 字符串转set |
| | | * |
| | | * @param str 字符串 |
| | | * @param sep 分隔符 |
| | | * @return set集合 |
| | | */ |
| | | public static final Set<String> str2Set(String str, String sep) |
| | | { |
| | | return new HashSet<String>(str2List(str, sep, true, false)); |
| | | } |
| | | |
| | | /** |
| | | * 字符串转list |
| | | * |
| | | * @param str 字符串 |
| | | * @param sep 分隔符 |
| | | * @param filterBlank 过滤纯空白 |
| | | * @param trim 去掉首尾空白 |
| | | * @return list集合 |
| | | */ |
| | | public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) |
| | | { |
| | | List<String> list = new ArrayList<String>(); |
| | | if (StringUtils.isEmpty(str)) |
| | | { |
| | | return list; |
| | | } |
| | | |
| | | // 过滤空白字符串 |
| | | if (filterBlank && StringUtils.isBlank(str)) |
| | | { |
| | | return list; |
| | | } |
| | | String[] split = str.split(sep); |
| | | for (String string : split) |
| | | { |
| | | if (filterBlank && StringUtils.isBlank(string)) |
| | | { |
| | | continue; |
| | | } |
| | | if (trim) |
| | | { |
| | | string = string.trim(); |
| | | } |
| | | list.add(string); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写 |
| | | * |
| | | * @param cs 指定字符串 |
| | | * @param searchCharSequences 需要检查的字符串数组 |
| | | * @return 是否包含任意一个字符串 |
| | | */ |
| | | public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) |
| | | { |
| | | if (isEmpty(cs) || isEmpty(searchCharSequences)) |
| | | { |
| | | return false; |
| | | } |
| | | for (CharSequence testStr : searchCharSequences) |
| | | { |
| | | if (containsIgnoreCase(cs, testStr)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 驼峰转下划线命名 |
| | | */ |
| | | 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(); |
| | | } |
| | | |
| | | /** |
| | | * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 |
| | | * |
| | | * @param str 指定字符串 |
| | | * @param strs 需要检查的字符串数组 |
| | | * @return 是否匹配 |
| | | */ |
| | | public static boolean matches(String str, List<String> strs) |
| | | { |
| | | if (isEmpty(str) || isEmpty(strs)) |
| | | { |
| | | return false; |
| | | } |
| | | for (String pattern : strs) |
| | | { |
| | | if (isMatch(pattern, str)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 判断url是否与规则配置: |
| | | * ? 表示单个字符; |
| | | * * 表示一层路径内的任意字符串,不可跨层级; |
| | | * ** 表示任意层路径; |
| | | * |
| | | * @param pattern 匹配规则 |
| | | * @param url 需要匹配的url |
| | | * @return |
| | | */ |
| | | public static boolean isMatch(String pattern, String url) |
| | | { |
| | | AntPathMatcher matcher = new AntPathMatcher(); |
| | | return matcher.match(pattern, url); |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public static <T> T cast(Object obj) |
| | | { |
| | | return (T) obj; |
| | | } |
| | | |
| | | /** |
| | | * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 |
| | | * |
| | | * @param num 数字对象 |
| | | * @param size 字符串指定长度 |
| | | * @return 返回数字的字符串格式,该字符串为指定长度。 |
| | | */ |
| | | public static final String padl(final Number num, final int size) |
| | | { |
| | | return padl(num.toString(), size, '0'); |
| | | } |
| | | |
| | | /** |
| | | * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 |
| | | * |
| | | * @param s 原始字符串 |
| | | * @param size 字符串指定长度 |
| | | * @param c 用于补齐的字符 |
| | | * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 |
| | | */ |
| | | public static final String padl(final String s, final int size, final char c) |
| | | { |
| | | final StringBuilder sb = new StringBuilder(size); |
| | | if (s != null) |
| | | { |
| | | final int len = s.length(); |
| | | if (s.length() <= size) |
| | | { |
| | | for (int i = size - len; i > 0; i--) |
| | | { |
| | | sb.append(c); |
| | | } |
| | | sb.append(s); |
| | | } |
| | | else |
| | | { |
| | | return s.substring(len - size, len); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = size; i > 0; i--) |
| | | { |
| | | sb.append(c); |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 给数字左边补齐0 |
| | | * @param nub 数值 |
| | | * @param digit 位数 |
| | | * @return 补齐0以后的字符串 |
| | | */ |
| | | public static final String leftSupplementZero(Integer nub,Integer digit) |
| | | { |
| | | //得到一个NumberFormat的实例 |
| | | NumberFormat nf = NumberFormat.getInstance(); |
| | | //设置是否使用分组 |
| | | nf.setGroupingUsed(false); |
| | | //设置最大整数位数 |
| | | nf.setMaximumIntegerDigits(digit); |
| | | //设置最小整数位数 |
| | | nf.setMinimumIntegerDigits(digit); |
| | | return nf.format(nub); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | 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 result; |
| | | |
| | | /** 消息内容 */ |
| | | private String msg; |
| | | |
| | | /** |
| | | * 表格数据对象 |
| | | */ |
| | | public TableDataInfo() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | * |
| | | * @param list 列表数据 |
| | | * @param total 总记录数 |
| | | */ |
| | | public TableDataInfo(List<?> list, long 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 getResult() |
| | | { |
| | | return result; |
| | | } |
| | | |
| | | public void setResult(int result) |
| | | { |
| | | this.result = result; |
| | | } |
| | | |
| | | public String getMsg() |
| | | { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) |
| | | { |
| | | this.msg = msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | |
| | | import com.dg.core.exception.UtilException; |
| | | |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.SecureRandom; |
| | | import java.util.Random; |
| | | import java.util.concurrent.ThreadLocalRandom; |
| | | |
| | | /** |
| | | * 提供通用唯一识别码(universally unique identifier)(UUID)实现 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public final class UUID implements java.io.Serializable, Comparable<UUID> |
| | | { |
| | | private static final long serialVersionUID = -1185015143654744140L; |
| | | |
| | | /** |
| | | * SecureRandom 的单例 |
| | | * |
| | | */ |
| | | private static class Holder |
| | | { |
| | | static final SecureRandom numberGenerator = getSecureRandom(); |
| | | } |
| | | |
| | | /** 此UUID的最高64有效位 */ |
| | | private final long mostSigBits; |
| | | |
| | | /** 此UUID的最低64有效位 */ |
| | | private final long leastSigBits; |
| | | |
| | | /** |
| | | * 私有构造 |
| | | * |
| | | * @param data 数据 |
| | | */ |
| | | private UUID(byte[] data) |
| | | { |
| | | long msb = 0; |
| | | long lsb = 0; |
| | | assert data.length == 16 : "data must be 16 bytes in length"; |
| | | for (int i = 0; i < 8; i++) |
| | | { |
| | | msb = (msb << 8) | (data[i] & 0xff); |
| | | } |
| | | for (int i = 8; i < 16; i++) |
| | | { |
| | | lsb = (lsb << 8) | (data[i] & 0xff); |
| | | } |
| | | this.mostSigBits = msb; |
| | | this.leastSigBits = lsb; |
| | | } |
| | | |
| | | /** |
| | | * 使用指定的数据构造新的 UUID。 |
| | | * |
| | | * @param mostSigBits 用于 {@code UUID} 的最高有效 64 位 |
| | | * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位 |
| | | */ |
| | | public UUID(long mostSigBits, long leastSigBits) |
| | | { |
| | | this.mostSigBits = mostSigBits; |
| | | this.leastSigBits = leastSigBits; |
| | | } |
| | | |
| | | /** |
| | | * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。 |
| | | * |
| | | * @return 随机生成的 {@code UUID} |
| | | */ |
| | | public static UUID fastUUID() |
| | | { |
| | | return randomUUID(false); |
| | | } |
| | | |
| | | /** |
| | | * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 |
| | | * |
| | | * @return 随机生成的 {@code UUID} |
| | | */ |
| | | public static UUID randomUUID() |
| | | { |
| | | return randomUUID(true); |
| | | } |
| | | |
| | | /** |
| | | * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 |
| | | * |
| | | * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能 |
| | | * @return 随机生成的 {@code UUID} |
| | | */ |
| | | public static UUID randomUUID(boolean isSecure) |
| | | { |
| | | final Random ng = isSecure ? Holder.numberGenerator : getRandom(); |
| | | |
| | | byte[] randomBytes = new byte[16]; |
| | | ng.nextBytes(randomBytes); |
| | | randomBytes[6] &= 0x0f; /* clear version */ |
| | | randomBytes[6] |= 0x40; /* set to version 4 */ |
| | | randomBytes[8] &= 0x3f; /* clear variant */ |
| | | randomBytes[8] |= 0x80; /* set to IETF variant */ |
| | | return new UUID(randomBytes); |
| | | } |
| | | |
| | | /** |
| | | * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。 |
| | | * |
| | | * @param name 用于构造 UUID 的字节数组。 |
| | | * |
| | | * @return 根据指定数组生成的 {@code UUID} |
| | | */ |
| | | public static UUID nameUUIDFromBytes(byte[] name) |
| | | { |
| | | MessageDigest md; |
| | | try |
| | | { |
| | | md = MessageDigest.getInstance("MD5"); |
| | | } |
| | | catch (NoSuchAlgorithmException nsae) |
| | | { |
| | | throw new InternalError("MD5 not supported"); |
| | | } |
| | | byte[] md5Bytes = md.digest(name); |
| | | md5Bytes[6] &= 0x0f; /* clear version */ |
| | | md5Bytes[6] |= 0x30; /* set to version 3 */ |
| | | md5Bytes[8] &= 0x3f; /* clear variant */ |
| | | md5Bytes[8] |= 0x80; /* set to IETF variant */ |
| | | return new UUID(md5Bytes); |
| | | } |
| | | |
| | | /** |
| | | * 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。 |
| | | * |
| | | * @param name 指定 {@code UUID} 字符串 |
| | | * @return 具有指定值的 {@code UUID} |
| | | * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常 |
| | | * |
| | | */ |
| | | public static UUID fromString(String name) |
| | | { |
| | | String[] components = name.split("-"); |
| | | if (components.length != 5) |
| | | { |
| | | throw new IllegalArgumentException("Invalid UUID string: " + name); |
| | | } |
| | | for (int i = 0; i < 5; i++) |
| | | { |
| | | components[i] = "0x" + components[i]; |
| | | } |
| | | |
| | | long mostSigBits = Long.decode(components[0]).longValue(); |
| | | mostSigBits <<= 16; |
| | | mostSigBits |= Long.decode(components[1]).longValue(); |
| | | mostSigBits <<= 16; |
| | | mostSigBits |= Long.decode(components[2]).longValue(); |
| | | |
| | | long leastSigBits = Long.decode(components[3]).longValue(); |
| | | leastSigBits <<= 48; |
| | | leastSigBits |= Long.decode(components[4]).longValue(); |
| | | |
| | | return new UUID(mostSigBits, leastSigBits); |
| | | } |
| | | |
| | | /** |
| | | * 返回此 UUID 的 128 位值中的最低有效 64 位。 |
| | | * |
| | | * @return 此 UUID 的 128 位值中的最低有效 64 位。 |
| | | */ |
| | | public long getLeastSignificantBits() |
| | | { |
| | | return leastSigBits; |
| | | } |
| | | |
| | | /** |
| | | * 返回此 UUID 的 128 位值中的最高有效 64 位。 |
| | | * |
| | | * @return 此 UUID 的 128 位值中最高有效 64 位。 |
| | | */ |
| | | public long getMostSignificantBits() |
| | | { |
| | | return mostSigBits; |
| | | } |
| | | |
| | | /** |
| | | * 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。 |
| | | * <p> |
| | | * 版本号具有以下含意: |
| | | * <ul> |
| | | * <li>1 基于时间的 UUID |
| | | * <li>2 DCE 安全 UUID |
| | | * <li>3 基于名称的 UUID |
| | | * <li>4 随机生成的 UUID |
| | | * </ul> |
| | | * |
| | | * @return 此 {@code UUID} 的版本号 |
| | | */ |
| | | public int version() |
| | | { |
| | | // Version is bits masked by 0x000000000000F000 in MS long |
| | | return (int) ((mostSigBits >> 12) & 0x0f); |
| | | } |
| | | |
| | | /** |
| | | * 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。 |
| | | * <p> |
| | | * 变体号具有以下含意: |
| | | * <ul> |
| | | * <li>0 为 NCS 向后兼容保留 |
| | | * <li>2 <a href="http://www.ietf.org/rfc/rfc4122.txt">IETF RFC 4122</a>(Leach-Salz), 用于此类 |
| | | * <li>6 保留,微软向后兼容 |
| | | * <li>7 保留供以后定义使用 |
| | | * </ul> |
| | | * |
| | | * @return 此 {@code UUID} 相关联的变体号 |
| | | */ |
| | | public int variant() |
| | | { |
| | | // This field is composed of a varying number of bits. |
| | | // 0 - - Reserved for NCS backward compatibility |
| | | // 1 0 - The IETF aka Leach-Salz variant (used by this class) |
| | | // 1 1 0 Reserved, Microsoft backward compatibility |
| | | // 1 1 1 Reserved for future definition. |
| | | return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63)); |
| | | } |
| | | |
| | | /** |
| | | * 与此 UUID 相关联的时间戳值。 |
| | | * |
| | | * <p> |
| | | * 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。<br> |
| | | * 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。 |
| | | * |
| | | * <p> |
| | | * 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。<br> |
| | | * 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 |
| | | * |
| | | * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。 |
| | | */ |
| | | public long timestamp() throws UnsupportedOperationException |
| | | { |
| | | checkTimeBase(); |
| | | return (mostSigBits & 0x0FFFL) << 48// |
| | | | ((mostSigBits >> 16) & 0x0FFFFL) << 32// |
| | | | mostSigBits >>> 32; |
| | | } |
| | | |
| | | /** |
| | | * 与此 UUID 相关联的时钟序列值。 |
| | | * |
| | | * <p> |
| | | * 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。 |
| | | * <p> |
| | | * {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的 UUID,则此方法抛出 |
| | | * UnsupportedOperationException。 |
| | | * |
| | | * @return 此 {@code UUID} 的时钟序列 |
| | | * |
| | | * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 |
| | | */ |
| | | public int clockSequence() throws UnsupportedOperationException |
| | | { |
| | | checkTimeBase(); |
| | | return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48); |
| | | } |
| | | |
| | | /** |
| | | * 与此 UUID 相关的节点值。 |
| | | * |
| | | * <p> |
| | | * 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。 |
| | | * <p> |
| | | * 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。<br> |
| | | * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 |
| | | * |
| | | * @return 此 {@code UUID} 的节点值 |
| | | * |
| | | * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 |
| | | */ |
| | | public long node() throws UnsupportedOperationException |
| | | { |
| | | checkTimeBase(); |
| | | return leastSigBits & 0x0000FFFFFFFFFFFFL; |
| | | } |
| | | |
| | | /** |
| | | * 返回此{@code UUID} 的字符串表现形式。 |
| | | * |
| | | * <p> |
| | | * UUID 的字符串表示形式由此 BNF 描述: |
| | | * |
| | | * <pre> |
| | | * {@code |
| | | * UUID = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node> |
| | | * time_low = 4*<hexOctet> |
| | | * time_mid = 2*<hexOctet> |
| | | * time_high_and_version = 2*<hexOctet> |
| | | * variant_and_sequence = 2*<hexOctet> |
| | | * node = 6*<hexOctet> |
| | | * hexOctet = <hexDigit><hexDigit> |
| | | * hexDigit = [0-9a-fA-F] |
| | | * } |
| | | * </pre> |
| | | * |
| | | * </blockquote> |
| | | * |
| | | * @return 此{@code UUID} 的字符串表现形式 |
| | | * @see #toString(boolean) |
| | | */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return toString(false); |
| | | } |
| | | |
| | | /** |
| | | * 返回此{@code UUID} 的字符串表现形式。 |
| | | * |
| | | * <p> |
| | | * UUID 的字符串表示形式由此 BNF 描述: |
| | | * |
| | | * <pre> |
| | | * {@code |
| | | * UUID = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node> |
| | | * time_low = 4*<hexOctet> |
| | | * time_mid = 2*<hexOctet> |
| | | * time_high_and_version = 2*<hexOctet> |
| | | * variant_and_sequence = 2*<hexOctet> |
| | | * node = 6*<hexOctet> |
| | | * hexOctet = <hexDigit><hexDigit> |
| | | * hexDigit = [0-9a-fA-F] |
| | | * } |
| | | * </pre> |
| | | * |
| | | * </blockquote> |
| | | * |
| | | * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串 |
| | | * @return 此{@code UUID} 的字符串表现形式 |
| | | */ |
| | | public String toString(boolean isSimple) |
| | | { |
| | | final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36); |
| | | // time_low |
| | | builder.append(digits(mostSigBits >> 32, 8)); |
| | | if (!isSimple) |
| | | { |
| | | builder.append('-'); |
| | | } |
| | | // time_mid |
| | | builder.append(digits(mostSigBits >> 16, 4)); |
| | | if (!isSimple) |
| | | { |
| | | builder.append('-'); |
| | | } |
| | | // time_high_and_version |
| | | builder.append(digits(mostSigBits, 4)); |
| | | if (!isSimple) |
| | | { |
| | | builder.append('-'); |
| | | } |
| | | // variant_and_sequence |
| | | builder.append(digits(leastSigBits >> 48, 4)); |
| | | if (!isSimple) |
| | | { |
| | | builder.append('-'); |
| | | } |
| | | // node |
| | | builder.append(digits(leastSigBits, 12)); |
| | | |
| | | return builder.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 返回此 UUID 的哈希码。 |
| | | * |
| | | * @return UUID 的哈希码值。 |
| | | */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | | long hilo = mostSigBits ^ leastSigBits; |
| | | return ((int) (hilo >> 32)) ^ (int) hilo; |
| | | } |
| | | |
| | | /** |
| | | * 将此对象与指定对象比较。 |
| | | * <p> |
| | | * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。 |
| | | * |
| | | * @param obj 要与之比较的对象 |
| | | * |
| | | * @return 如果对象相同,则返回 {@code true};否则返回 {@code false} |
| | | */ |
| | | @Override |
| | | public boolean equals(Object obj) |
| | | { |
| | | if ((null == obj) || (obj.getClass() != UUID.class)) |
| | | { |
| | | return false; |
| | | } |
| | | UUID id = (UUID) obj; |
| | | return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits); |
| | | } |
| | | |
| | | // Comparison Operations |
| | | |
| | | /** |
| | | * 将此 UUID 与指定的 UUID 比较。 |
| | | * |
| | | * <p> |
| | | * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。 |
| | | * |
| | | * @param val 与此 UUID 比较的 UUID |
| | | * |
| | | * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。 |
| | | * |
| | | */ |
| | | @Override |
| | | public int compareTo(UUID val) |
| | | { |
| | | // The ordering is intentionally set up so that the UUIDs |
| | | // can simply be numerically compared as two numbers |
| | | return (this.mostSigBits < val.mostSigBits ? -1 : // |
| | | (this.mostSigBits > val.mostSigBits ? 1 : // |
| | | (this.leastSigBits < val.leastSigBits ? -1 : // |
| | | (this.leastSigBits > val.leastSigBits ? 1 : // |
| | | 0)))); |
| | | } |
| | | |
| | | // ------------------------------------------------------------------------------------------------------------------- |
| | | // Private method start |
| | | /** |
| | | * 返回指定数字对应的hex值 |
| | | * |
| | | * @param val 值 |
| | | * @param digits 位 |
| | | * @return 值 |
| | | */ |
| | | private static String digits(long val, int digits) |
| | | { |
| | | long hi = 1L << (digits * 4); |
| | | return Long.toHexString(hi | (val & (hi - 1))).substring(1); |
| | | } |
| | | |
| | | /** |
| | | * 检查是否为time-based版本UUID |
| | | */ |
| | | private void checkTimeBase() |
| | | { |
| | | if (version() != 1) |
| | | { |
| | | throw new UnsupportedOperationException("Not a time-based UUID"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG) |
| | | * |
| | | * @return {@link SecureRandom} |
| | | */ |
| | | public static SecureRandom getSecureRandom() |
| | | { |
| | | try |
| | | { |
| | | return SecureRandom.getInstance("SHA1PRNG"); |
| | | } |
| | | catch (NoSuchAlgorithmException e) |
| | | { |
| | | throw new UtilException(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取随机数生成器对象<br> |
| | | * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。 |
| | | * |
| | | * @return {@link ThreadLocalRandom} |
| | | */ |
| | | public static ThreadLocalRandom getRandom() |
| | | { |
| | | return ThreadLocalRandom.current(); |
| | | } |
| | | } |
New file |
| | |
| | | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
| | | spring.datasource.username=root |
| | | spring.datasource.password=nahanMysqlPwd&&RemoteRemote2019nahan |
| | | spring.datasource.url=jdbc:mysql://10.8.0.74:3306/flower_city_automessage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8 |
| | | #spring.datasource.url=jdbc:mysql://localhost:3306/flower_city_automessage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8 |
| | | |
| | | server.port=8080 |
| | | #server.port=8088 |
| | | |
| | | swagger.enabled=true |
| | | swagger.pathMapping=/ |
| | | #Redis |
| | | spring.redis.host=127.0.0.1 |
| | | spring.redis.port=6379 |
| | | |
| | | |
| | | spring.mvc.pathmatch.matching-strategy=ant_path_matcher |
| | | |
| | | |
| | | spring.servlet.multipart.max-file-size=20MB |
| | | spring.servlet.multipart.max-request-size=50MB |
| | | |
| | | # ?????? |
| | | # ???? ??? Windows??D:/ruoyi/uploadPath?Linux?? /home/ruoyi/uploadPath? |
| | | #profile=E:/java/flower_city_automessage/flower_citys/files |
| | | profile=D:/tupianshuju |
| | | |
| | | |
| | | wx.open.app_id=wx118de8a734d269f0 |
| | | wx.open.app_secret=0264342daefde5cd70a6adada09ee5b1 |
| | | wx.open.redirect_url=http://yq.cdnhxx.com:8080/ucenter/wx/callback |
| | | yygh.baseUrl=http://localhost:8080 |
| | | |
| | | |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.AgreementMapper"> |
| | | <resultMap type="com.dg.core.db.gen.entity.Agreement" id="AgreementResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="agreement" column="agreement" /> |
| | | <id property="updateUserId" column="update_user_id" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="createUserId" column="create_user_id" /> |
| | | <id property="agreementContent" column="agreement_content" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectAgreement"> |
| | | select id,agreement, |
| | | (select user_name from sys_user where user_id=a.update_user_id)updateUserName, |
| | | update_user_id,create_time, |
| | | (select user_name from sys_user where user_id=a.create_user_id)createUserName, |
| | | create_user_id,agreement_content FROM agreement a |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="AgreementResult"> |
| | | <include refid="selectAgreement" /> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.AreaCode2022Mapper"> |
| | | <resultMap type="com.dg.core.db.gen.entity.AreaCode2022" id="AreaCodeResult"> |
| | | <id property="code" column="code" /> |
| | | <id property="name" column="name" /> |
| | | <id property="level" column="level" /> |
| | | <id property="pcode" column="pcode" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectAreaCode"> |
| | | select code,name,level,pcode FROM area_code_2022 |
| | | </sql> |
| | | |
| | | <select id="selectByIdSet" resultMap="AreaCodeResult"> |
| | | <include refid="selectAreaCode" /> |
| | | WHERE code IN |
| | | <foreach collection="list" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.ClassifyAdministrationMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.ClassifyAdministration" id="ClassifyAdministrationEntityResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="classifyGrade" column="classify_grade" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="classifyIcon" column="classify_icon" /> |
| | | <id property="parentId" column="parent_id" /> |
| | | <id property="classifyName" column="classify_name" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectClassifyAdministrationEntityVo"> |
| | | SELECT |
| | | id, |
| | | classify_grade, |
| | | create_time, |
| | | update_time, |
| | | parent_id, |
| | | (select ca.classify_name from classify_administration as ca where ca.id= classify_administration.parent_id) as parentName, |
| | | classify_name, |
| | | classify_icon |
| | | FROM |
| | | classify_administration |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="ClassifyAdministrationEntityResult"> |
| | | <include refid="selectClassifyAdministrationEntityVo"/> |
| | | <where> |
| | | <if test="classifyName != null and classifyName != ''"> |
| | | AND classify_name like concat('%', #{classifyName}, '%') |
| | | </if> |
| | | <if test="classifyGrade != null and classifyGrade != ''"> |
| | | AND classify_grade = #{classifyGrade} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectRootList" resultMap="ClassifyAdministrationEntityResult"> |
| | | <include refid="selectClassifyAdministrationEntityVo"/> |
| | | <where> |
| | | parent_id=#{parentId} |
| | | <if test="departmentId!=null"> |
| | | and id in ( |
| | | select classify_id from transaction_event where department_id=#{departmentId} UNION |
| | | select parent_id from classify_administration where id in (select classify_id FROM transaction_event where department_id=#{departmentId}) ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.ClassifyAdministration"> |
| | | insert into classify_administration ( |
| | | <if test="id != null">id,</if> |
| | | <if test="classifyGrade != null and classifyGrade != '' ">classify_grade,</if> |
| | | <if test="parentId != null">parent_id,</if> |
| | | <if test="classifyName != null and classifyName != '' ">classify_name,</if> |
| | | <if test="classifyIcon != null and classifyIcon != '' ">classify_icon,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="classifyGrade != null and classifyGrade != '' ">#{classifyGrade},</if> |
| | | <if test="parentId != null">#{parentId},</if> |
| | | <if test="classifyName != null and classifyName != '' ">#{classifyName},</if> |
| | | <if test="classifyIcon != null and classifyIcon != '' ">#{classifyIcon},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.ClassifyAdministration"> |
| | | update classify_administration |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="classifyGrade != null and classifyGrade != '' ">classify_grade=#{classifyGrade},</if> |
| | | <if test="parentId != null">parent_id=#{parentId},</if> |
| | | <if test="classifyName != null and classifyName != '' ">classify_name=#{classifyName},</if> |
| | | <if test="classifyIcon != null and classifyIcon != '' ">classify_icon=#{classifyIcon},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="String"> |
| | | delete from classify_administration where id= #{id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from classify_administration |
| | | <where> |
| | | <if test="classifyName != null and classifyName != ''"> |
| | | AND classify_name like concat('%', #{classifyName}, '%') |
| | | </if> |
| | | <if test="classifyGrade != null and classifyGrade != ''"> |
| | | AND classify_grade = #{classifyGrade} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.ElseAccessoryMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.ElseAccessoryEntity" id="ElseAccessoryEntityResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="departmentId" column="department_id" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="name" column="name" /> |
| | | <id property="url" column="url" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectElseAccessoryEntityVo"> |
| | | SELECT |
| | | id, |
| | | department_id, |
| | | (select organization_name from organization_chart where organization_chart.id=else_accessory.department_id) as departmentName, |
| | | create_time, |
| | | update_time, |
| | | url, |
| | | name |
| | | FROM |
| | | else_accessory |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="ElseAccessoryEntityResult"> |
| | | <include refid="selectElseAccessoryEntityVo"/> |
| | | <where> |
| | | <if test="Name != null and Name != ''"> |
| | | AND else_accessory.name like concat('%', #{Name}, '%') |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.ElseAccessoryEntity"> |
| | | insert into else_accessory ( |
| | | <if test="id != null">id,</if> |
| | | <if test="departmentId != null and departmentId != '' ">department_id,</if> |
| | | <if test="name != null and name != '' ">name,</if> |
| | | <if test="url != null and url != '' ">url,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="departmentId != null and departmentId != '' ">#{departmentId},</if> |
| | | <if test="name != null and name != '' ">#{name},</if> |
| | | <if test="url != null and url != '' ">#{url},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.ElseAccessoryEntity"> |
| | | update else_accessory |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="departmentId != null and departmentId != '' ">department_id=#{departmentId},</if> |
| | | <if test="name != null and name != '' ">name=#{name},</if> |
| | | <if test="url != null and url != '' ">url=#{url},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from else_accessory where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from else_accessory |
| | | <where> |
| | | <if test="Name != null and Name != ''"> |
| | | AND else_accessory.name like concat('%', #{Name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.GuideEvolveMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.GuideEvolveEntity" id="GuideEvolveResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="departmentalId" column="departmental_id" /> |
| | | <id property="toUserId" column="to_user_id" /> |
| | | <id property="fromUserId" column="from_user_id" /> |
| | | <id property="state" column="state" /> |
| | | <id property="remark" column="remark" /> |
| | | <id property="guideId" column="guide_id" /> |
| | | <id property="transactionId" column="transaction_id" /> |
| | | <id property="accessoryId" column="accessory_id" /> |
| | | <id property="accessoryName" column="accessory_name" /> |
| | | <id property="accessoryUrl" column="accessory_url" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="fromDepartmentalId" column="from_departmental_id" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectGuideEvolveVo"> |
| | | SELECT |
| | | id, |
| | | departmental_id, |
| | | to_user_id, |
| | | from_user_id, |
| | | state, |
| | | remark, |
| | | guide_id, |
| | | transaction_id, |
| | | accessory_id, |
| | | accessory_name, |
| | | accessory_url, |
| | | from_departmental_id, |
| | | create_time, |
| | | update_time |
| | | FROM |
| | | guide_evolve |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="GuideEvolveResult"> |
| | | <include refid="selectGuideEvolveVo"/> |
| | | <where> |
| | | <if test="guideId != null and guideId != ''"> |
| | | AND guide_id=#{guideId} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.GuideEvolveEntity"> |
| | | insert into guide_evolve ( |
| | | <if test="id != null">id,</if> |
| | | <if test="departmentalId != null and departmentalId != '' ">departmental_id,</if> |
| | | <if test="toUserId != null and toUserId != '' ">to_user_id,</if> |
| | | <if test="fromUserId != null and fromUserId != '' ">from_user_id,</if> |
| | | <if test="state != null and state != '' ">state,</if> |
| | | <if test="remark != null and remark != '' ">remark,</if> |
| | | <if test="guideId != null and guideId != '' ">guide_id,</if> |
| | | <if test="transactionId != null and transactionId != '' ">transaction_id,</if> |
| | | <if test="accessoryId != null and accessoryId != '' ">accessory_id,</if> |
| | | <if test="accessoryName != null and accessoryName != '' ">accessory_name,</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">accessory_url,</if> |
| | | <if test="fromDepartmentalId != null and fromDepartmentalId != '' ">from_departmental_id,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="departmentalId != null and departmentalId != '' ">#{departmentalId},</if> |
| | | <if test="toUserId != null and toUserId != '' ">#{toUserId},</if> |
| | | <if test="fromUserId != null and fromUserId != '' ">#{fromUserId},</if> |
| | | <if test="state != null and state != '' ">#{state},</if> |
| | | <if test="remark != null and remark != '' ">#{remark},</if> |
| | | <if test="guideId != null and guideId != '' ">#{guideId},</if> |
| | | <if test="transactionId != null and transactionId != '' ">#{transactionId},</if> |
| | | <if test="accessoryId != null and accessoryId != '' ">#{accessoryId},</if> |
| | | <if test="accessoryName != null and accessoryName != '' ">#{accessoryName},</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">#{accessoryUrl},</if> |
| | | <if test="fromDepartmentalId != null and fromDepartmentalId != '' ">#{fromDepartmentalId},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.GuideEvolveEntity"> |
| | | update guide_evolve |
| | | <set> |
| | | <if test="departmentalId != null and departmentalId != '' ">departmental_id=#{departmentalId},</if> |
| | | <if test="toUserId != null and toUserId != '' ">to_user_id=#{toUserId},</if> |
| | | <if test="fromUserId != null and fromUserId != '' ">from_user_id=#{fromUserId},</if> |
| | | <if test="state != null and state != '' ">state=#{state},</if> |
| | | <if test="remark != null and remark != '' ">remark=#{remark},</if> |
| | | <if test="guideId != null and guideId != '' ">guide_id=#{guideId},</if> |
| | | <if test="transactionId != null and transactionId != '' ">transaction_id=#{transactionId},</if> |
| | | <if test="accessoryId != null and accessoryId != '' ">accessory_id=#{accessoryId},</if> |
| | | <if test="accessoryName != null and accessoryName != '' ">accessory_name=#{accessoryName},</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">accessory_url=#{accessoryUrl},</if> |
| | | <if test="fromDepartmentalId != null and fromDepartmentalId != '' ">from_departmental_id=#{fromDepartmentalId},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{Id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from guide_evolve where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from guide_evolve |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.GuideRepairOrderImageMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.GuideRepairOrderMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.GuideRepairOrder" id="GuideRepairOrderResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="orderNum" column="order_num" /> |
| | | <id property="matterId" column="matter_id" /> |
| | | <id property="matterName" column="matter_name" /> |
| | | <id property="departmentId" column="department_id" /> |
| | | <id property="classifyId" column="classify_id" /> |
| | | <id property="consultContent" column="consult_content" /> |
| | | <id property="consultUserName" column="consult_user_name" /> |
| | | <id property="submitUserId" column="submit_user_id" /> |
| | | <id property="guideUserId" column="guide_user_id" /> |
| | | <id property="guideDepartmentId" column="guide_department_id" /> |
| | | <id property="state" column="state" /> |
| | | <id property="consultUserPhone" column="consult_user_phone" /> |
| | | <id property="submitUserPhone" column="submit_user_phone" /> |
| | | <id property="guideUserPhone" column="guide_user_phone" /> |
| | | <id property="areaCode" column="area_code" /> |
| | | <id property="detailedAddress" column="detailed_address" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="evaluateContent" column="evaluate_content" /> |
| | | <id property="suggest" column="suggest" /> |
| | | <id property="evaluateState" column="evaluate_state" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectGuideRepairOrderVo"> |
| | | SELECT |
| | | id, |
| | | order_num, |
| | | matter_id, |
| | | matter_name, |
| | | department_id, |
| | | classify_id, |
| | | consult_content, |
| | | consult_user_name, |
| | | submit_user_id, |
| | | guide_user_id, |
| | | guide_department_id, |
| | | state, |
| | | consult_user_phone, |
| | | submit_user_phone, |
| | | guide_user_phone, |
| | | area_code, |
| | | detailed_address, |
| | | create_time, |
| | | update_time, |
| | | evaluate_content, |
| | | suggest, |
| | | evaluate_state |
| | | FROM |
| | | guide_repair_order |
| | | </sql> |
| | | |
| | | <select id="selectConfigData" resultMap="GuideRepairOrderResult"> |
| | | <include refid="selectGuideRepairOrderVo"/> |
| | | <where> |
| | | <if test="Id != null and Id != ''"> |
| | | AND id=#{Id} |
| | | </if> |
| | | <if test="orderNum != null and orderNum != ''"> |
| | | AND order_num=#{orderNum} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.GuideRepairOrder"> |
| | | update guide_repair_order |
| | | <set> |
| | | <if test="guideUserId != null and guideUserId != '' ">guide_user_id=#{guideUserId},</if> |
| | | <if test="guideDepartmentId != null and guideDepartmentId != '' ">guide_department_id=#{guideDepartmentId},</if> |
| | | <if test="state != null and state != '' ">state=#{state},</if> |
| | | <if test="guideUserPhone != null and guideUserPhone != '' ">guide_user_phone=#{guideUserPhone},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{Id} |
| | | </update> |
| | | |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from menu |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.KeywordMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.KeywordEntity" id="KeywordEntityResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="name" column="name" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="transactionId" column="transaction_id" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectKeywordEntityVo"> |
| | | SELECT |
| | | id, |
| | | name, |
| | | create_time, |
| | | update_time, |
| | | transaction_id |
| | | FROM |
| | | keyword |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="KeywordEntityResult"> |
| | | <include refid="selectKeywordEntityVo"/> |
| | | <!-- <where>--> |
| | | <!-- <if test="userName != null and userName != ''">--> |
| | | <!-- AND user_name like concat('%', #{userName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="streetName != null and streetName != ''">--> |
| | | <!-- AND street_name like concat('%', #{streetName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="loginName != null and loginName != ''">--> |
| | | <!-- AND login_name like concat('%', #{loginName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="phonenumber != null and phonenumber != ''">--> |
| | | <!-- AND phonenumber like concat('%', #{phonenumber}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="roleId != null and roleId != ''">--> |
| | | <!-- AND role_id=#{roleId}--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- </where>--> |
| | | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectConfigData" resultMap="KeywordEntityResult"> |
| | | <include refid="selectKeywordEntityVo"/> |
| | | <where> |
| | | <if test="Id != null and Id != ''"> |
| | | AND keyword.id=#{Id} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | AND keyword.name=#{name} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByName" resultMap="KeywordEntityResult"> |
| | | <include refid="selectKeywordEntityVo"/> |
| | | <where> |
| | | name like concat('%',#{keyWord}, '%') |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.KeywordEntity"> |
| | | insert into keyword ( |
| | | <if test="id != null">id,</if> |
| | | <if test="name != null and name != '' ">name,</if> |
| | | <if test="transactionId != null and transactionId !='' ">transaction_id,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="name != null and name != '' ">#{name},</if> |
| | | <if test="transactionId != null and transactionId !='' ">#{transactionId},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.KeywordEntity"> |
| | | update keyword |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="name != null and name != '' ">name=#{name},</if> |
| | | <if test="transactionId != null and transactionId !='' ">transaction_id=#{transactionId},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from keyword where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from keyword |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.MenuMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.MenuEntity" id="MenuEntityResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="title" column="title" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="remark" column="remark" /> |
| | | <id property="parentId" column="parent_id" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectMenuEntityVo"> |
| | | SELECT |
| | | id, |
| | | title, |
| | | create_time, |
| | | update_time, |
| | | parent_id, |
| | | remark |
| | | FROM |
| | | menu |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="MenuEntityResult"> |
| | | <include refid="selectMenuEntityVo"/> |
| | | <!-- <where>--> |
| | | <!-- <if test="userName != null and userName != ''">--> |
| | | <!-- AND user_name like concat('%', #{userName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="streetName != null and streetName != ''">--> |
| | | <!-- AND street_name like concat('%', #{streetName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="loginName != null and loginName != ''">--> |
| | | <!-- AND login_name like concat('%', #{loginName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="phonenumber != null and phonenumber != ''">--> |
| | | <!-- AND phonenumber like concat('%', #{phonenumber}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="roleId != null and roleId != ''">--> |
| | | <!-- AND role_id=#{roleId}--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- </where>--> |
| | | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.MenuEntity"> |
| | | insert into menu ( |
| | | <if test="id != null">id,</if> |
| | | <if test="title != null and title != '' ">title,</if> |
| | | <if test="parentId != null">parent_id,</if> |
| | | <if test="remark != null and remark != '' ">remark,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="title != null and title != '' ">#{title},</if> |
| | | <if test="parentId != null">#{parentId},</if> |
| | | <if test="remark != null and remark != '' ">#{remark},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.MenuEntity"> |
| | | update menu |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="title != null and title != '' ">title=#{title},</if> |
| | | <if test="parentId != null">parent_id=#{parentId},</if> |
| | | <if test="remark != null and remark != '' ">remark=#{remark},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{Id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="Long"> |
| | | delete from menu where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from menu |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.OrganizationChartMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.OrganizationChartEntity" id="OrganizationChartResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="organizationName" column="organization_name" /> |
| | | <id property="city" column="city" /> |
| | | <id property="district" column="district" /> |
| | | <id property="village" column="village" /> |
| | | <id property="detailedAddress" column="detailed_address" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="parentId" column="parent_id" /> |
| | | <id property="grade" column="grade" /> |
| | | <id property="resume" column="resume" /> |
| | | <id property="contactNumber" column="contact_number" /> |
| | | <id property="departmentalApplication" column="departmental_application" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectOrganizationChartVo"> |
| | | SELECT |
| | | id, |
| | | resume, |
| | | organization_name, |
| | | contact_number, |
| | | departmental_application, |
| | | create_time, |
| | | update_time, |
| | | parent_id, |
| | | (select organization_name from organization_chart as oc where oc.id=organization_chart.parent_id) as parentName, |
| | | city, |
| | | district, |
| | | village, |
| | | detailed_address, |
| | | grade, |
| | | resume,contact_number |
| | | FROM |
| | | organization_chart |
| | | </sql> |
| | | |
| | | <select id="selectConfigById" resultMap="OrganizationChartResult"> |
| | | <include refid="selectOrganizationChartVo"/> |
| | | where id= #{id} |
| | | </select> |
| | | |
| | | <select id="selectConfigList" resultMap="OrganizationChartResult"> |
| | | <include refid="selectOrganizationChartVo"/> |
| | | <where> |
| | | <if test="parentId != null and parentId != ''"> |
| | | AND parent_id=#{parentId} |
| | | </if> |
| | | |
| | | <if test="grade != null and grade != ''"> |
| | | AND grade=#{grade} |
| | | </if> |
| | | |
| | | </where> |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="selectByKeyWord" resultMap="OrganizationChartResult"> |
| | | <include refid="selectOrganizationChartVo"/> |
| | | where organization_name like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', organization_name, '%') |
| | | or detailed_address like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', detailed_address, '%') |
| | | or resume like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', resume, '%') |
| | | </select> |
| | | |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.OrganizationChartEntity"> |
| | | insert into organization_chart ( |
| | | <if test="id != null">id,</if> |
| | | <if test="organizationName != null and organizationName != '' ">organization_name,</if> |
| | | <if test="parentId != null">parent_id,</if> |
| | | <if test="city != null and city != '' ">city,</if> |
| | | <if test="district != null and district != '' ">district,</if> |
| | | <if test="village != null and village != '' ">village,</if> |
| | | <if test="detailedAddress != null and detailedAddress != '' ">detailed_address,</if> |
| | | <if test="grade != null and grade != '' ">grade,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="organizationName != null and organizationName != '' ">#{organizationName},</if> |
| | | <if test="parentId != null">#{parentId},</if> |
| | | <if test="city != null and city != '' ">#{city},</if> |
| | | <if test="district != null and district != '' ">#{district},</if> |
| | | <if test="village != null and village != '' ">#{village},</if> |
| | | <if test="detailedAddress != null and detailedAddress != '' ">#{detailedAddress},</if> |
| | | <if test="grade != null and grade != '' ">#{grade},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.OrganizationChartEntity"> |
| | | update organization_chart |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="organizationName != null and organizationName != '' ">organization_name=#{organizationName},</if> |
| | | <if test="parentId != null">parent_id=#{parentId},</if> |
| | | <if test="city != null and city != '' ">city=#{city},</if> |
| | | <if test="district != null and district != '' ">district=#{district},</if> |
| | | <if test="village != null and village != '' ">village=#{village},</if> |
| | | <if test="detailedAddress != null and detailedAddress != '' ">detailed_address=#{detailedAddress},</if> |
| | | <if test="grade != null and grade != '' ">grade=#{grade},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from organization_chart where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from organization_chart |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.ReplyTemplateMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.ReplyTemplateEntity" id="ReplyTemplateResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="name" column="name" /> |
| | | <id property="handleState" column="handle_state" /> |
| | | <id property="response" column="response" /> |
| | | <id property="guidance" column="guidance" /> |
| | | <id property="accessoryUrl" column="accessory_url" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="accessoryName" column="accessory_name" /> |
| | | <id property="videoUrl" column="video_url" /> |
| | | <id property="videoName" column="video_name" /> |
| | | <id property="createUserId" column="create_user_id" /> |
| | | <id property="departmentId" column="department_id" /> |
| | | <id property="pictureUrl" column="picture_url" /> |
| | | <id property="pictureName" column="picture_name" /> |
| | | <id property="accessoryId" column="accessory_id" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectReplyTemplateVo"> |
| | | SELECT |
| | | id, |
| | | name, |
| | | create_time, |
| | | update_time, |
| | | handle_state, |
| | | response, |
| | | accessory_url, |
| | | accessory_name, |
| | | video_url, |
| | | video_name, |
| | | picture_url, |
| | | picture_name, |
| | | department_id, |
| | | create_user_id, |
| | | accessory_id, |
| | | (select organization_name from organization_chart where organization_chart.id=reply_template.department_id) as departmentName, |
| | | (select user_name from sys_user where sys_user.user_id=reply_template.create_user_id) as createUser, |
| | | guidance |
| | | FROM |
| | | reply_template |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="ReplyTemplateResult"> |
| | | <include refid="selectReplyTemplateVo"/> |
| | | <where> |
| | | <if test="Name != null and Name != ''"> |
| | | AND name=#{Name} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectConfigData" parameterType="string" resultMap="ReplyTemplateResult"> |
| | | <include refid="selectReplyTemplateVo"/> |
| | | where id=#{Id} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.ReplyTemplateEntity"> |
| | | insert into reply_template ( |
| | | <if test="id != null">id,</if> |
| | | <if test="name != null and name != '' ">name,</if> |
| | | <if test="handleState != null and handleState != '' ">handle_state,</if> |
| | | <if test="response != null and response != '' ">response,</if> |
| | | <if test="guidance != null and guidance != '' ">guidance,</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">accessory_url,</if> |
| | | <if test="accessoryName != null and accessoryName != '' ">accessory_name,</if> |
| | | <if test="videoUrl != null and videoUrl != '' ">video_url,</if> |
| | | <if test="videoName != null and videoName != '' ">video_name,</if> |
| | | <if test="pictureUrl != null and pictureUrl != '' ">picture_url,</if> |
| | | <if test="pictureName != null and pictureName != '' ">picture_name,</if> |
| | | <if test="createUserId != null and createUserId != '' ">create_user_id,</if> |
| | | <if test="departmentId != null and departmentId != '' ">department_id,</if> |
| | | <if test="accessoryId != null and accessoryId != '' ">accessory_id,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="name != null and name != '' ">#{name},</if> |
| | | <if test="handleState != null and handleState != '' ">#{handleState},</if> |
| | | <if test="response != null and response != '' ">#{response},</if> |
| | | <if test="guidance != null and guidance != '' ">#{guidance},</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">#{accessoryUrl},</if> |
| | | <if test="accessoryName != null and accessoryName != '' ">#{accessoryName},</if> |
| | | <if test="videoUrl != null and videoUrl != '' ">#{videoUrl},</if> |
| | | <if test="videoName != null and videoName != '' ">#{videoName},</if> |
| | | <if test="pictureUrl != null and pictureUrl != '' ">#{pictureUrl},</if> |
| | | <if test="pictureName != null and pictureName != '' ">#{pictureName},</if> |
| | | <if test="createUserId != null and createUserId != '' ">#{createUserId},</if> |
| | | <if test="departmentId != null and departmentId != '' ">#{departmentId},</if> |
| | | <if test="accessoryId != null and accessoryId != '' ">#{accessoryId},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.ReplyTemplateEntity"> |
| | | update reply_template |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="name != null and name != '' ">name=#{name},</if> |
| | | <if test="handleState != null and handleState != '' ">handle_state=#{handleState},</if> |
| | | <if test="response != null and response != '' ">response=#{response},</if> |
| | | <if test="guidance != null and guidance != '' ">guidance=#{guidance},</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">accessory_url=#{accessoryUrl},</if> |
| | | <if test="accessoryName != null and accessoryName != '' ">accessory_name=#{accessoryName},</if> |
| | | <if test="videoUrl != null and videoUrl != '' ">video_url=#{videoUrl},</if> |
| | | <if test="videoName != null and videoName != '' ">video_name=#{videoName},</if> |
| | | <if test="pictureUrl != null and pictureUrl != '' ">picture_url=#{pictureUrl},</if> |
| | | <if test="pictureName != null and pictureName != '' ">picture_name=#{pictureName},</if> |
| | | <if test="createUserId != null and createUserId != '' ">create_user_id=#{createUserId},</if> |
| | | <if test="departmentId != null and departmentId != '' ">department_id=#{departmentId},</if> |
| | | <if test="accessoryId != null and accessoryId != '' ">accessory_id=#{accessoryId},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from reply_template where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" parameterType="string" resultType="integer"> |
| | | select count(id) from reply_template |
| | | <where> |
| | | <if test="Name != null and Name != ''"> |
| | | AND name=#{Name} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.RoleManagementMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.RoleManagementEntity" id="RoleManagementEntityResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="roleName" column="role_name" /> |
| | | <id property="createUserId" column="create_user_id" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateUserId" column="update_user_id" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="permission" column="permission" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectRoleManagementEntityVo"> |
| | | SELECT |
| | | id, |
| | | role_name, |
| | | permission, |
| | | create_time, |
| | | update_time, |
| | | create_user_id, |
| | | update_user_id |
| | | FROM |
| | | role_management |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="RoleManagementEntityResult"> |
| | | <include refid="selectRoleManagementEntityVo"/> |
| | | <!-- <where>--> |
| | | <!-- <if test="userName != null and userName != ''">--> |
| | | <!-- AND user_name like concat('%', #{userName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="streetName != null and streetName != ''">--> |
| | | <!-- AND street_name like concat('%', #{streetName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="loginName != null and loginName != ''">--> |
| | | <!-- AND login_name like concat('%', #{loginName}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="phonenumber != null and phonenumber != ''">--> |
| | | <!-- AND phonenumber like concat('%', #{phonenumber}, '%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="roleId != null and roleId != ''">--> |
| | | <!-- AND role_id=#{roleId}--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- </where>--> |
| | | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.RoleManagementEntity"> |
| | | insert into role_management ( |
| | | <if test="id != null">id,</if> |
| | | <if test="roleName != null and roleName != '' ">role_name,</if> |
| | | <if test="permission != null">permission,</if> |
| | | <if test="createUserId != null and createUserId != '' ">create_user_id,</if> |
| | | <if test="updateUserId != null and updateUserId != '' ">update_user_id,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="roleName != null and roleName != '' ">#{roleName},</if> |
| | | <if test="permission != null and permission != '' " >#{permission},</if> |
| | | <if test="createUserId != null and createUserId != '' ">#{createUserId},</if> |
| | | <if test="updateUserId != null and updateUserId != '' ">#{updateUserId},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.RoleManagementEntity"> |
| | | update role_management |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="roleName != null and roleName != '' ">role_name=#{roleName},</if> |
| | | <if test="permission != null and permission != '' " >permission=#{permission},</if> |
| | | <if test="createUserId != null and createUserId != '' ">create_user_id=#{createUserId},</if> |
| | | <if test="updateUserId != null and updateUserId != '' ">update_user_id=#{updateUserId},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{Id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from role_management where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from role_management |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.SlideshowMapper"> |
| | | <resultMap type="com.dg.core.db.gen.entity.Slideshow" id="SlideshowResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="url" column="url" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="linkType" column="link_type" /> |
| | | <id property="link" column="link" /> |
| | | <id property="title" column="title" /> |
| | | <id property="content" column="content" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.SysUserMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.SysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id" /> |
| | | <result property="loginName" column="login_name" /> |
| | | <result property="userName" column="user_name" /> |
| | | <result property="userType" column="user_type" /> |
| | | <result property="phonenumber" column="phonenumber" /> |
| | | <result property="sex" column="sex" /> |
| | | <result property="avatar" column="avatar" /> |
| | | <result property="password" column="password" /> |
| | | <result property="salt" column="salt" /> |
| | | <result property="status" column="status" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="loginIp" column="login_ip" /> |
| | | <result property="loginDate" column="login_date" /> |
| | | <result property="pwdUpdateDate" column="pwd_update_date" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="roleIds" column="role_ids" /> |
| | | <result property="dataPermission" column="data_permission" /> |
| | | <result property="departmentId" column="department_id" /> |
| | | <result property="stairId" column="stair_id" /> |
| | | <result property="secondLevelId" column="second_level_id" /> |
| | | |
| | | |
| | | <result property="departmentName" column="department_name" /> |
| | | <result property="departmentArea" column="department_area" /> |
| | | <result property="leisureState" column="leisure_state" /> |
| | | <result property="masterIds" column="master_ids" /> |
| | | <result property="masterNames" column="master_names" /> |
| | | <result property="transactionIds" column="transaction_ids" /> |
| | | <result property="transactionNames" column="transaction_names" /> |
| | | |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectSysUserVo"> |
| | | SELECT |
| | | user_id, |
| | | login_name, |
| | | user_name, |
| | | user_type, |
| | | phonenumber, |
| | | sex, |
| | | avatar, |
| | | salt, |
| | | status, |
| | | del_flag, |
| | | login_ip, |
| | | login_date, |
| | | pwd_update_date, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | role_ids, |
| | | data_permission, |
| | | department_id, |
| | | stair_id, |
| | | second_level_id, |
| | | (select organization_name from organization_chart where sys_user.department_id=organization_chart.id) as department_name, |
| | | department_area, |
| | | leisure_state, |
| | | master_ids, |
| | | master_names, |
| | | transaction_ids, |
| | | transaction_names, |
| | | remark |
| | | FROM |
| | | sys_user |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectNum" resultType="integer"> |
| | | select count(user_id) from sys_user |
| | | <where> |
| | | <if test="userType != null and userType != ''"> |
| | | AND user_type=#{userType} |
| | | </if> |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectConfigList" parameterType="string" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | <where> |
| | | <!-- <if test="userName != null and userName != ''">--> |
| | | <!-- AND user_name like concat('%', #{userName}, '%')--> |
| | | <!-- </if>--> |
| | | <if test="userType != null and userType != ''"> |
| | | AND user_type=#{userType} |
| | | </if> |
| | | |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.SysUser"> |
| | | insert into sys_user ( |
| | | create_time |
| | | <if test="userId != null and userId != '' ">,user_id</if> |
| | | <if test="loginName != null and loginName != '' ">,login_name</if> |
| | | <if test="userName != null and userName != '' ">,user_name</if> |
| | | <if test="userType != null and userType != '' ">,user_type</if> |
| | | <if test="phonenumber != null and phonenumber != '' ">,phonenumber</if> |
| | | <if test="sex != null and sex != '' ">,sex</if> |
| | | <if test="avatar != null and avatar != '' ">,avatar</if> |
| | | <if test="password != null and password != '' ">,password</if> |
| | | <if test="salt != null and salt != '' ">,salt</if> |
| | | <if test="status != null and status != '' ">,status</if> |
| | | <if test="delFlag != null and delFlag != '' ">,del_flag</if> |
| | | <if test="loginIp != null and loginIp != '' ">,login_ip</if> |
| | | <if test="loginDate != null ">,login_date</if> |
| | | <if test="pwdUpdateDate != null ">,pwd_update_date</if> |
| | | <if test="createBy != null and createBy != '' ">,create_by</if> |
| | | <if test="updateBy != null and updateBy != '' ">,update_by</if> |
| | | <if test="updateTime != null ">,update_time</if> |
| | | <if test="remark != null and remark != '' ">,remark</if> |
| | | <if test="roleIds != null and roleIds != '' ">,role_ids</if> |
| | | <if test="dataPermission != null and dataPermission != '' ">,data_permission</if> |
| | | <if test="departmentId != null and departmentId != '' ">,department_id</if> |
| | | <if test="stairId != null and stairId != '' ">,stair_id</if> |
| | | <if test="secondLevelId != null and secondLevelId != '' ">,second_level_id</if> |
| | | <if test="departmentName != null and departmentName != '' ">,department_name</if> |
| | | <if test="departmentArea != null and departmentArea != '' ">,department_area</if> |
| | | <if test="leisureState != null and leisureState != '' ">,leisure_state</if> |
| | | <if test="masterIds != null and masterIds != '' ">,master_ids</if> |
| | | <if test="masterNames != null and masterNames != '' ">,master_names</if> |
| | | <if test="transactionIds != null and transactionIds != '' ">,transaction_ids</if> |
| | | <if test="transactionNames != null and transactionNames != '' ">,transaction_names</if> |
| | | )values( |
| | | sysdate() |
| | | <if test="userId != null and userId != '' ">,#{userId}</if> |
| | | <if test="loginName != null and loginName != '' ">,#{loginName}</if> |
| | | <if test="userName != null and userName != '' ">,#{userName}</if> |
| | | <if test="userType != null and userType != '' ">,#{userType}</if> |
| | | <if test="phonenumber != null and phonenumber != '' ">,#{phonenumber}</if> |
| | | <if test="sex != null and sex != '' ">,#{sex}</if> |
| | | <if test="avatar != null and avatar != '' ">,#{avatar}</if> |
| | | <if test="password != null and password != '' ">,#{password}</if> |
| | | <if test="salt != null and salt != '' ">,#{salt}</if> |
| | | <if test="status != null and status != '' ">,#{status}</if> |
| | | <if test="delFlag != null and delFlag != '' ">,#{delFlag}</if> |
| | | <if test="loginIp != null and loginIp != '' ">,#{loginIp}</if> |
| | | <if test="loginDate != null ">,#{loginDate}</if> |
| | | <if test="pwdUpdateDate != null and pwdUpdateDate != '' ">,#{pwdUpdateDate}</if> |
| | | <if test="createBy != null and createBy != '' ">,#{createBy}</if> |
| | | <if test="updateBy != null and updateBy != '' ">,#{updateBy}</if> |
| | | <if test="updateTime != null ">,#{updateTime}</if> |
| | | <if test="remark != null and remark != '' ">,#{remark}</if> |
| | | <if test="roleIds != null and roleIds != '' ">,#{roleIds}</if> |
| | | <if test="dataPermission != null and dataPermission != '' ">,#{dataPermission}</if> |
| | | <if test="departmentId != null and departmentId != '' ">,#{departmentId}</if> |
| | | <if test="stairId != null and stairId != '' ">,#{stairId}</if> |
| | | <if test="secondLevelId != null and secondLevelId != '' ">,#{secondLevelId}</if> |
| | | <if test="departmentName != null and departmentName != '' ">,#{departmentName}</if> |
| | | <if test="departmentArea != null and departmentArea != '' ">,#{departmentArea}</if> |
| | | <if test="leisureState != null and leisureState != '' ">,#{leisureState}</if> |
| | | <if test="masterIds != null and masterIds != '' ">,#{masterIds}</if> |
| | | <if test="masterNames != null and masterNames != '' ">,#{masterNames}</if> |
| | | <if test="transactionIds != null and transactionIds != '' ">,#{transactionIds}</if> |
| | | <if test="transactionNames != null and transactionNames != '' ">,#{transactionNames}</if> |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.SysUser"> |
| | | update sys_user |
| | | <set> |
| | | <if test="userId != null and userId != '' ">user_id=#{userId}</if> |
| | | <if test="loginName != null and loginName != '' ">,login_name=#{loginName}</if> |
| | | <if test="userName != null and userName != '' ">,user_name=#{userName}</if> |
| | | <if test="userType != null and userType != '' ">,user_type=#{userType}</if> |
| | | <if test="phonenumber != null and phonenumber != '' ">,phonenumber=#{phonenumber}</if> |
| | | <if test="sex != null and sex != '' ">,sex=#{sex}</if> |
| | | <if test="avatar != null and avatar != '' ">,avatar=#{avatar}</if> |
| | | <if test="password != null and password != '' ">,password=#{password}</if> |
| | | <if test="salt != null and salt != '' ">,salt=#{salt}</if> |
| | | <if test="status != null and status != '' ">,status=#{status}</if> |
| | | <if test="delFlag != null and delFlag != '' ">,del_flag=#{delFlag}</if> |
| | | <if test="loginIp != null and loginIp != '' ">,login_ip=#{loginIp}</if> |
| | | <if test="loginDate != null ">,login_date=#{loginDate}</if> |
| | | <if test="pwdUpdateDate != null ">,pwd_update_date=#{pwdUpdateDate}</if> |
| | | <if test="createBy != null and createBy != '' ">,create_by=#{createBy}</if> |
| | | <if test="createTime != null ">,create_time=#{createTime}</if> |
| | | <if test="updateBy != null and updateBy != '' ">,update_by=#{updateBy}</if> |
| | | <if test="remark != null and remark != '' ">,remark=#{remark}</if> |
| | | <if test="roleIds != null and roleIds != '' ">,role_ids=#{roleIds}</if> |
| | | <if test="dataPermission != null and dataPermission != '' ">,data_permission=#{dataPermission}</if> |
| | | <if test="departmentId != null and departmentId != '' ">,department_id=#{departmentId}</if> |
| | | <if test="stairId != null and stairId != '' ">,stair_id=#{stairId}</if> |
| | | <if test="secondLevelId != null and secondLevelId != '' ">,second_level_id=#{secondLevelId}</if> |
| | | <if test="departmentName != null and departmentName != '' ">,department_name=#{departmentName}</if> |
| | | <if test="departmentArea != null and departmentArea != '' ">,department_area=#{departmentArea}</if> |
| | | <if test="leisureState != null and leisureState != '' ">,leisure_state=#{leisureState}</if> |
| | | <if test="masterIds != null and masterIds != '' ">,master_ids=#{masterIds}</if> |
| | | <if test="masterNames != null and masterNames != '' ">,master_names=#{masterNames}</if> |
| | | <if test="transactionIds != null and transactionIds != '' ">,transaction_ids=#{transactionIds}</if> |
| | | <if test="transactionNames != null and transactionNames != '' ">,transaction_names=#{transactionNames}</if> |
| | | ,update_time=sysdate() |
| | | </set> |
| | | where user_id= #{userId} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from sys_user where user_id= #{id} |
| | | </delete> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.TransactionEventMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.TransactionEvent" id="TransactionEventEntityResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="departmentId" column="department_id" /> |
| | | <id property="departmentArea" column="department_area" /> |
| | | <id property="classifyId" column="classify_id" /> |
| | | <id property="matterName" column="matter_name" /> |
| | | <id property="associateIds" column="associate_ids" /> |
| | | <id property="transactionNum" column="transaction_num" /> |
| | | <id property="browseNum" column="browse_num" /> |
| | | <id property="basicInformation" column="basic_information" /> |
| | | <id property="acceptConditions" column="accept_conditions" /> |
| | | <id property="applicationMaterial" column="application_material" /> |
| | | <id property="handlingProcedures" column="handling_procedures" /> |
| | | <id property="rates" column="rates" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="queryTime" column="query_time" /> |
| | | |
| | | <id property="associateNames" column="associate_names" /> |
| | | <id property="queryTime" column="query_time" /> |
| | | <id property="basicInformationUrl" column="basic_information_url" /> |
| | | <id property="acceptConditionsUrl" column="accept_conditions_url" /> |
| | | <id property="applicationMaterialUrl" column="application_material_url" /> |
| | | <id property="handlingProceduresUrl" column="handling_procedures_url" /> |
| | | <id property="ratesUrl" column="rates_url" /> |
| | | <id property="basicInformationFileName" column="basic_information_file_name" /> |
| | | <id property="acceptConditionsFileName" column="accept_conditions_file_name" /> |
| | | <id property="applicationMaterialFileName" column="application_material_file_name" /> |
| | | <id property="handlingProceduresFileName" column="handling_procedures_file_name" /> |
| | | <id property="ratesFileName" column="rates_file_name" /> |
| | | <id property="operationalGuidelineUrl" column="operational_guideline_url" /> |
| | | <id property="operationalGuidelineVideoUrl" column="operational_guideline_video_url" /> |
| | | |
| | | <id property="setGist" column="set_gist" /> |
| | | <id property="setGistUrl" column="set_gist_url" /> |
| | | <id property="setGistName" column="set_gist_name" /> |
| | | |
| | | <id property="commonProblem" column="common_problem" /> |
| | | <id property="commonProblemUrl" column="common_problem_url" /> |
| | | <id property="commonProblemName" column="common_problem_name" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectTransactionEventEntityVo"> |
| | | SELECT |
| | | id, |
| | | department_id, |
| | | department_area, |
| | | classify_id, |
| | | matter_name, |
| | | associate_ids, |
| | | transaction_num, |
| | | browse_num, |
| | | basic_information, |
| | | accept_conditions, |
| | | application_material, |
| | | handling_procedures, |
| | | rates, |
| | | create_time, |
| | | update_time, |
| | | query_time, |
| | | associate_names, |
| | | basic_information_url, |
| | | accept_conditions_url, |
| | | application_material_url, |
| | | handling_procedures_url, |
| | | rates_url, |
| | | basic_information_file_name, |
| | | accept_conditions_file_name, |
| | | application_material_file_name, |
| | | handling_procedures_file_name, |
| | | rates_file_name, |
| | | operational_guideline_url, |
| | | set_gist, |
| | | set_gist_url, |
| | | set_gist_name, |
| | | common_problem, |
| | | common_problem_url, |
| | | common_problem_name, |
| | | operational_guideline_video_url, |
| | | concat( |
| | | (select classify_name from classify_administration where id=(select parent_id from classify_administration where id=transaction_event.classify_id)), |
| | | '>',(select classify_name from classify_administration where id=transaction_event.classify_id) |
| | | ) sumClassifyName |
| | | FROM |
| | | transaction_event |
| | | </sql> |
| | | |
| | | <sql id="selectTransactionEventList"> |
| | | SELECT |
| | | id, |
| | | department_id, |
| | | department_area, |
| | | classify_id, |
| | | (select classify_grade from classify_administration where classify_administration.id=transaction_event.classify_id) as classifyName, |
| | | matter_name, |
| | | associate_ids, |
| | | associate_names, |
| | | transaction_num, |
| | | browse_num, |
| | | create_time, |
| | | update_time |
| | | FROM |
| | | transaction_event |
| | | </sql> |
| | | |
| | | <select id="selectConfigData" parameterType="string" resultMap="TransactionEventEntityResult"> |
| | | <include refid="selectTransactionEventEntityVo"/> |
| | | where id=#{Id} |
| | | </select> |
| | | |
| | | <select id="selectConfigList" resultMap="TransactionEventEntityResult"> |
| | | <include refid="selectTransactionEventList"/> |
| | | <where> |
| | | <if test="matterAndUser != null and matterAndUser != ''"> |
| | | AND associate_names like concat('%', #{matterAndUser}, '%') or matter_name like concat('%', #{matterAndUser}, '%') |
| | | </if> |
| | | <if test="classifyGrade != null and classifyGrade != ''"> |
| | | AND (select classify_grade from classify_administration where classify_administration.id=classify_id) = #{classifyGrade} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.TransactionEvent"> |
| | | insert into transaction_event ( |
| | | <if test="id != null">id,</if> |
| | | <if test="departmentId != null and departmentId != '' ">department_id,</if> |
| | | <if test="departmentArea != null">department_area,</if> |
| | | <if test="classifyId != null and classifyId != '' ">classify_id,</if> |
| | | <if test="matterName != null and matterName != '' ">matter_name,</if> |
| | | <if test="associateIds != null and associateIds != '' ">associate_ids,</if> |
| | | <if test="transactionNum != null ">transaction_num,</if> |
| | | <if test="browseNum != null ">browse_num,</if> |
| | | <if test="basicInformation != null and basicInformation != '' ">basic_information,</if> |
| | | <if test="acceptConditions != null and acceptConditions != '' ">accept_conditions,</if> |
| | | <if test="applicationMaterial != null and applicationMaterial != '' ">application_material,</if> |
| | | <if test="handlingProcedures != null and handlingProcedures != '' ">handling_procedures,</if> |
| | | <if test="rates != null and rates != '' ">rates,</if> |
| | | <if test="associateNames != null and associateNames != '' ">associate_names,</if> |
| | | <if test="queryTime != null">query_time,</if> |
| | | <if test="basicInformationUrl != null and basicInformationUrl != '' ">basic_information_url,</if> |
| | | <if test="acceptConditionsUrl != null and acceptConditionsUrl != '' ">accept_conditions_url,</if> |
| | | <if test="applicationMaterialUrl != null and applicationMaterialUrl != '' ">application_material_url,</if> |
| | | <if test="handlingProceduresUrl != null and handlingProceduresUrl != '' ">handling_procedures_url,</if> |
| | | <if test="ratesUrl != null and ratesUrl != '' ">rates_url,</if> |
| | | <if test="basicInformationFileName != null and basicInformationFileName != '' ">basic_information_file_name,</if> |
| | | <if test="acceptConditionsFileName != null and acceptConditionsFileName != '' ">accept_conditions_file_name,</if> |
| | | <if test="applicationMaterialFileName != null and applicationMaterialFileName != '' ">application_material_file_name,</if> |
| | | <if test="handlingProceduresFileName != null and handlingProceduresFileName != '' ">handling_procedures_file_name,</if> |
| | | <if test="ratesFileName != null and ratesFileName != '' ">rates_file_name,</if> |
| | | <if test="operationalGuidelineUrl != null and operationalGuidelineUrl != '' ">operational_guideline_url,</if> |
| | | <if test="operationalGuidelineVideoUrl != null and operationalGuidelineVideoUrl != '' ">operational_guideline_video_url,</if> |
| | | <if test="setGist != null and setGist != '' ">set_gist,</if> |
| | | <if test="setGistUrl != null and setGistUrl != '' ">set_gist_url,</if> |
| | | <if test="setGistName != null and setGistName != '' ">set_gist_name,</if> |
| | | <if test="commonProblem != null and commonProblem != '' ">common_problem,</if> |
| | | <if test="commonProblemUrl != null and commonProblemUrl != '' ">common_problem_url,</if> |
| | | <if test="commonProblemName != null and commonProblemName != '' ">common_problem_name,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | | <if test="id != null">#{id},</if> |
| | | <if test="departmentId != null and departmentId != '' ">#{departmentId},</if> |
| | | <if test="departmentArea != null">#{departmentArea},</if> |
| | | <if test="classifyId != null and classifyId != '' ">#{classifyId},</if> |
| | | <if test="matterName != null and matterName != '' ">#{matterName},</if> |
| | | <if test="associateIds != null and associateIds != '' ">#{associateIds},</if> |
| | | <if test="transactionNum != null ">#{transactionNum},</if> |
| | | <if test="browseNum != null ">#{browseNum},</if> |
| | | <if test="basicInformation != null and basicInformation != '' ">#{basicInformation},</if> |
| | | <if test="acceptConditions != null and acceptConditions != '' ">#{acceptConditions},</if> |
| | | <if test="applicationMaterial != null and applicationMaterial != '' ">#{applicationMaterial},</if> |
| | | <if test="handlingProcedures != null and handlingProcedures != '' ">#{handlingProcedures},</if> |
| | | <if test="rates != null and rates != '' ">#{rates},</if> |
| | | <if test="associateNames != null and associateNames != '' ">#{associateNames},</if> |
| | | <if test="queryTime != null">#{queryTime},</if> |
| | | <if test="basicInformationUrl != null and basicInformationUrl != '' ">#{basicInformationUrl},</if> |
| | | <if test="acceptConditionsUrl != null and acceptConditionsUrl != '' ">#{acceptConditionsUrl},</if> |
| | | <if test="applicationMaterialUrl != null and applicationMaterialUrl != '' ">#{applicationMaterialUrl},</if> |
| | | <if test="handlingProceduresUrl != null and handlingProceduresUrl != '' ">#{handlingProceduresUrl},</if> |
| | | <if test="ratesUrl != null and ratesUrl != '' ">#{ratesUrl},</if> |
| | | <if test="basicInformationFileName != null and basicInformationFileName != '' ">#{basicInformationFileName},</if> |
| | | <if test="acceptConditionsFileName != null and acceptConditionsFileName != '' ">#{acceptConditionsFileName},</if> |
| | | <if test="applicationMaterialFileName != null and applicationMaterialFileName != '' ">#{applicationMaterialFileName},</if> |
| | | <if test="handlingProceduresFileName != null and handlingProceduresFileName != '' ">#{handlingProceduresFileName},</if> |
| | | <if test="ratesFileName != null and ratesFileName != '' ">#{ratesFileName},</if> |
| | | <if test="operationalGuidelineUrl != null and operationalGuidelineUrl != '' ">#{operationalGuidelineUrl},</if> |
| | | <if test="operationalGuidelineVideoUrl != null and operationalGuidelineVideoUrl != '' ">#{operationalGuidelineVideoUrl},</if> |
| | | <if test="setGist != null and setGist != '' ">#{setGist},</if> |
| | | <if test="setGistUrl != null and setGistUrl != '' ">#{setGistUrl},</if> |
| | | <if test="setGistName != null and setGistName != '' ">#{setGistName},</if> |
| | | <if test="commonProblem != null and commonProblem != '' ">#{commonProblem},</if> |
| | | <if test="commonProblemUrl != null and commonProblemUrl != '' ">#{commonProblemUrl},</if> |
| | | <if test="commonProblemName != null and commonProblemName != '' ">#{commonProblemName},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.TransactionEvent"> |
| | | update transaction_event |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="departmentId != null and departmentId != '' ">department_id=#{departmentId},</if> |
| | | <if test="departmentArea != null">department_area=#{departmentArea},</if> |
| | | <if test="classifyId != null and classifyId != '' ">classify_id=#{classifyId},</if> |
| | | <if test="matterName != null and matterName != '' ">matter_name=#{matterName},</if> |
| | | <if test="associateIds != null and associateIds != '' ">associate_ids=#{associateIds},</if> |
| | | <if test="transactionNum != null ">transaction_num=#{transactionNum},</if> |
| | | <if test="browseNum != null ">browse_num=#{browseNum},</if> |
| | | <if test="basicInformation != null and basicInformation != '' ">basic_information=#{basicInformation},</if> |
| | | <if test="acceptConditions != null and acceptConditions != '' ">accept_conditions=#{acceptConditions},</if> |
| | | <if test="applicationMaterial != null and applicationMaterial != '' ">application_material=#{applicationMaterial},</if> |
| | | <if test="handlingProcedures != null and handlingProcedures != '' ">handling_procedures=#{handlingProcedures},</if> |
| | | <if test="rates != null and rates != '' ">rates=#{rates},</if> |
| | | <if test="associateNames != null and associateNames != '' ">associate_names=#{associateNames},</if> |
| | | <if test="queryTime != null">query_time=#{queryTime},</if> |
| | | <if test="basicInformationUrl != null and basicInformationUrl != '' ">basic_information_url=#{basicInformationUrl},</if> |
| | | <if test="acceptConditionsUrl != null and acceptConditionsUrl != '' ">accept_conditions_url=#{acceptConditionsUrl},</if> |
| | | <if test="applicationMaterialUrl != null and applicationMaterialUrl != '' ">application_material_url=#{applicationMaterialUrl},</if> |
| | | <if test="handlingProceduresUrl != null and handlingProceduresUrl != '' ">handling_procedures_url=#{handlingProceduresUrl},</if> |
| | | <if test="ratesUrl != null and ratesUrl != '' ">rates_url=#{ratesUrl},</if> |
| | | <if test="basicInformationFileName != null and basicInformationFileName != '' ">basic_information_file_name=#{basicInformationFileName},</if> |
| | | <if test="acceptConditionsFileName != null and acceptConditionsFileName != '' ">accept_conditions_file_name=#{acceptConditionsFileName},</if> |
| | | <if test="applicationMaterialFileName != null and applicationMaterialFileName != '' ">application_material_file_name=#{applicationMaterialFileName},</if> |
| | | <if test="handlingProceduresFileName != null and handlingProceduresFileName != '' ">handling_procedures_file_name=#{handlingProceduresFileName},</if> |
| | | <if test="ratesFileName != null and ratesFileName != '' ">rates_file_name=#{ratesFileName},</if> |
| | | <if test="operationalGuidelineUrl != null and operationalGuidelineUrl != '' ">operational_guideline_url=#{operationalGuidelineUrl},</if> |
| | | <if test="setGist != null and setGist != '' ">set_gist=#{setGist},</if> |
| | | <if test="setGistUrl != null and setGistUrl != '' ">set_gist_url=#{setGistUrl},</if> |
| | | <if test="setGistName != null and setGistName != '' ">set_gist_name=#{setGistName},</if> |
| | | <if test="commonProblem != null and commonProblem != '' ">common_problem=#{commonProblem},</if> |
| | | <if test="commonProblemUrl != null and commonProblemUrl != '' ">common_problem_url=#{commonProblemUrl},</if> |
| | | <if test="commonProblemName != null and commonProblemName != '' ">common_problem_name=#{commonProblemName},</if> |
| | | <if test="operationalGuidelineVideoUrl != null and operationalGuidelineVideoUrl != '' ">operational_guideline_video_url=#{operationalGuidelineVideoUrl},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="string"> |
| | | delete from transaction_event where id= #{Id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from transaction_event |
| | | <where> |
| | | <if test="matterAndUser != null and matterAndUser != ''"> |
| | | AND associate_names like concat('%', #{matterAndUser}, '%') or matter_name like concat('%', #{matterAndUser}, '%') |
| | | </if> |
| | | <if test="classifyGrade != null and classifyGrade != ''"> |
| | | AND (select classify_grade from classify_administration where classify_grade.id=classify_id) = #{classifyGrade} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="queryMatterNameList" resultMap="TransactionEventEntityResult"> |
| | | <include refid="selectTransactionEventEntityVo"/> |
| | | <where> |
| | | <if test="matterName != null and matterName != ''"> |
| | | AND (matter_name like concat('%', #{matterName}, '%') or #{matterName} like concat('%', matter_name, '%')) |
| | | </if> |
| | | |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="sumTransactionNum" resultMap="TransactionEventEntityResult"> |
| | | select sum(transaction_num)sumTransactionNum,count(*) counttransaction FROM transaction_event |
| | | </select> |
| | | |
| | | <select id="queryByClassifyIdList" resultMap="TransactionEventEntityResult"> |
| | | <include refid="selectTransactionEventEntityVo"/> |
| | | where (classify_id= #{classifyId} or classify_id in (select id FROM classify_administration where parent_id =#{classifyId} )) |
| | | <if test="departmentId!=null"> |
| | | and department_id=#{departmentId} |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="countNumByClassifyIdList" resultType="integer"> |
| | | select count(id) from transaction_event |
| | | where (classify_id= #{classifyId} or classify_id in (select id FROM classify_administration where parent_id =#{classifyId} )) |
| | | <if test="departmentId!=null"> |
| | | and department_id=#{departmentId} |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <update id="updateConfigByMatterName" parameterType="com.dg.core.db.gen.entity.TransactionEvent"> |
| | | update transaction_event |
| | | <set> |
| | | browse_num=browse_num+1,query_time=sysdate() |
| | | </set> |
| | | <where> |
| | | matter_name like concat('%', #{matterName}, '%') |
| | | </where> |
| | | |
| | | </update> |
| | | |
| | | <select id="countNumByMatterName" resultType="integer"> |
| | | select count(id) from transaction_event |
| | | <where> |
| | | <if test="matterName != null and matterName != ''"> |
| | | AND matter_name like concat('%', #{matterName}, '%') |
| | | </if> |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectSearch" resultType="com.dg.core.db.manual.pojo.Search"> |
| | | select title,content,views FROM( |
| | | select organization_name title,resume content,null views from organization_chart UNION |
| | | select matter_name title,concat((select classify_name from classify_administration |
| | | where id=(select parent_id from classify_administration where id=transaction_event.classify_id)), |
| | | '>',(select classify_name from classify_administration where id=transaction_event.classify_id)) content, |
| | | transaction_num views from transaction_event |
| | | ) k |
| | | where k.title like concat('%',#{keyWord}, '%') or k.content like concat('%', #{keyWord}, '%') |
| | | </select> |
| | | |
| | | <select id="selectSearchAssociate" resultType="com.dg.core.db.manual.pojo.Search"> |
| | | select matter_name title,concat((select classify_name from classify_administration |
| | | where id=(select parent_id from classify_administration where id=transaction_event.classify_id)), |
| | | '>',(select classify_name from classify_administration where id=transaction_event.classify_id)) content, |
| | | transaction_num views from transaction_event where associate_names like concat('%',#{keyWord}, '%') |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | @SpringBootTest |
| | | class WMApplicationTests { |
| | | |
| | | @Test |
| | | void contextLoads() { |
| | | } |
| | | |
| | | } |