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 |
| | |
| | | # 花城e+自公告系统 后端 |
| | | # 不参与花城后台 完全独立 |
| | | # 只是用户表只做查询花城数据 |
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>com.aliyun</groupId> |
| | | <artifactId>aliyun-java-sdk-core</artifactId> |
| | | <version>4.5.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.74</version> |
| | | </dependency> |
| | | |
| | | <!-- okhttp --> |
| | | <dependency> |
| | | <groupId>com.squareup.okhttp</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | <version>2.7.1</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>4.1.1</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>4.1.1</version> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.icexxx</groupId> |
| | | <artifactId>iceworkday</artifactId> |
| | | <version>2.0.2.0</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> |
| | | |
| | | |
| | | <!-- 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> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.jcraft</groupId> |
| | | <artifactId>jsch</artifactId> |
| | | <version>0.1.53</version> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | <version>0.9.1</version> |
| | | </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; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.PropertySource; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 阿里云短信配置 |
| | | */ |
| | | @Component |
| | | @PropertySource(value = "classpath:application-sms.properties",encoding = "UTF-8") |
| | | public class AliyunConfig { |
| | | |
| | | @Value("${aliyun.key}") |
| | | private String key; |
| | | |
| | | @Value("${aliyun.screct}") |
| | | |
| | | private String screct; |
| | | @Value("${aliyun.SignName}") |
| | | private String SignName; |
| | | |
| | | @Value("${aliyun.TemplateCode}") |
| | | private String TemplateCode; |
| | | |
| | | @Value("${aliyun.TemplateCodeOvertime}") |
| | | private String TemplateCodeOvertime; |
| | | |
| | | @Value("${aliyun.TemplateCodeComplete}") |
| | | private String TemplateCodeComplete; |
| | | |
| | | |
| | | @Value("${aliyun.TemplateCodeSubmit}") |
| | | private String TemplateCodeSubmit; |
| | | |
| | | public String getTemplateCodeSubmit() { |
| | | return TemplateCodeSubmit; |
| | | } |
| | | |
| | | public void setTemplateCodeSubmit(String templateCodeSubmit) { |
| | | TemplateCodeSubmit = templateCodeSubmit; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public String getTemplateCodeComplete() { |
| | | return TemplateCodeComplete; |
| | | } |
| | | |
| | | public void setTemplateCodeComplete(String templateCodeComplete) { |
| | | TemplateCodeComplete = templateCodeComplete; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getTemplateCodeOvertime() { |
| | | return TemplateCodeOvertime; |
| | | } |
| | | |
| | | public void setTemplateCodeOvertime(String templateCodeOvertime) { |
| | | TemplateCodeOvertime = templateCodeOvertime; |
| | | } |
| | | |
| | | public String getScrect() { |
| | | return screct; |
| | | } |
| | | |
| | | public void setScrect(String screct) { |
| | | this.screct = screct; |
| | | } |
| | | |
| | | public String getSignName() { |
| | | return SignName; |
| | | } |
| | | |
| | | public void setSignName(String signName) { |
| | | SignName = signName; |
| | | } |
| | | |
| | | public String getTemplateCode() { |
| | | return TemplateCode; |
| | | } |
| | | |
| | | public void setTemplateCode(String templateCode) { |
| | | TemplateCode = templateCode; |
| | | } |
| | | } |
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 = 168; |
| | | |
| | | /** |
| | | * 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"; |
| | | |
| | | /** |
| | | * 小程序 花城e+token |
| | | */ |
| | | public static final String HCAUTHORIZATION = "HCAuthorization"; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | 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); |
| | | } |
| | | |
| | | } |
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.api; |
| | | |
| | | |
| | | 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 io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Api(tags = {"相关协议小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/agreement") |
| | | public class AgreementAppletsController { |
| | | |
| | | @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)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | import com.dg.core.controller.BaseController; |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Api(tags = {"所属地区小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applet/areaCode") |
| | | public class AreaCodeAppletsController 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.api; |
| | | |
| | | |
| | | 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.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IAutomessageCommonProblemService; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"常见问题小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/automessageCommonProblem") |
| | | public class AutomessageCommonProblemAppletsController extends BaseController { |
| | | |
| | | @Resource |
| | | private IAutomessageCommonProblemService iAutomessageCommonProblemService; |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页) |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取常见问题列表(不分页)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectList") |
| | | public ResultData selectList(){ |
| | | return ResultData.success(iAutomessageCommonProblemService.selectList()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页查找) |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取常见问题列表(不分页查找)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/queryList") |
| | | public ResultData queryList(@RequestParam(value = "title",required = false) String title){ |
| | | return ResultData.success(iAutomessageCommonProblemService.selectConfigList(title,null)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | 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.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.AutomessagePolicyDocuments; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IAutomessagePolicyDocumentsService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"获取法律法规政策文件小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/AutomessagePolicyDocumentsController") |
| | | public class AutomessagePolicyDocumentsAppletsController extends BaseController { |
| | | |
| | | @Resource |
| | | private IAutomessagePolicyDocumentsService iAutomessagePolicyDocumentsService; |
| | | |
| | | |
| | | /** |
| | | * 获取法律法规政策文件列表(不分页) |
| | | * @param name |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取法律法规政策文件列表(不分页)",response = AutomessagePolicyDocuments.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "类型(1.法律法规2.政策文件)", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping("/selectList") |
| | | public ResultData selectConfigList(@RequestParam(value = "name",required = false) String name, |
| | | @RequestParam(value = "type",required = false) String type, |
| | | @RequestParam(value = "departmentId",required = false) Integer departmentId){ |
| | | List<AutomessagePolicyDocuments> list = iAutomessagePolicyDocumentsService.selectConfigList(name,type,departmentId,null); |
| | | return ResultData.success(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取法律法规政策文件数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 根据id获取法律法规政策文件数据 ",response = AutomessagePolicyDocuments.class) |
| | | @GetMapping("/selectAutomessagePolicyDocumentById") |
| | | public ResultData selectAutomessagePolicyDocumentById(@RequestParam(value = "id") Integer id){ |
| | | AutomessagePolicyDocuments automessagePolicyDocuments = iAutomessagePolicyDocumentsService.selectAutomessagePolicyDocumentById(id); |
| | | if (automessagePolicyDocuments!=null){ |
| | | return ResultData.success(automessagePolicyDocuments); |
| | | }else { |
| | | return ResultData.error("查找失败"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | 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("/applets/classify") |
| | | public class ClassifyAdministrationAppletsController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | IClassifyAdministrationService iClassifyAdministrationService; |
| | | |
| | | |
| | | /** |
| | | * 获取管理菜单列表(无分页已分级) |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 获取管理菜单列表(无分页已分级))",response = ClassifyAdministration.class) |
| | | @GetMapping("/selectListByParentId") |
| | | public TableDataInfo selectListByParentId(@RequestParam(value = "parentId",required = false) String parentId, |
| | | @RequestParam(value = "departmentId",required = false) Integer departmentId){ |
| | | int num=iClassifyAdministrationService.countNum("",null); |
| | | if (parentId==null) |
| | | parentId="0"; |
| | | return getDataTable(iClassifyAdministrationService.selectConfigListByParentId(parentId, departmentId),num); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取分类根据id 如果是二级id则获取的是办事指南 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取分类根据id 如果是二级id则获取的是办事指南,不传参默认是0") |
| | | @GetMapping("/queryListById") |
| | | ResultData queryListById(@RequestParam(value = "id",required = false) Integer id){ |
| | | if(id==null) |
| | | id=0; |
| | | return iClassifyAdministrationService.queryListById(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | 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.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IElseAccessoryService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"其他附件小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/else") |
| | | public class ElseAccessoryAppletsController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | IElseAccessoryService iElseAccessoryService; |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | /** |
| | | * 获取附件列表 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取附件列表接口(全部)",response = ElseAccessoryEntity.class) |
| | | @GetMapping(path = "/getAllList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigListAll(@RequestParam(value = "Name",required = false) String Name, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | List<String> ids= PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return getDataTable("您没有权限查看该数据"); |
| | | } |
| | | List<ElseAccessoryEntity> list = iElseAccessoryService.selectConfigList(Name,ids,sysUser.getUserId()); |
| | | int num=iElseAccessoryService.countNum(Name,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增列表 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增附件",response = ElseAccessoryEntity.class) |
| | | @PostMapping(path = "/add") |
| | | @Authorization |
| | | 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(value = "更新附件",response = ElseAccessoryEntity.class) |
| | | @PostMapping(path = "/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody ElseAccessoryEntity entity) |
| | | { |
| | | return toAjax(iElseAccessoryService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除附件",response = ElseAccessoryEntity.class) |
| | | @DeleteMapping(path = "/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | return toAjax(iElseAccessoryService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.Snowflake; |
| | | 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("/applets/guidedo") |
| | | public class GuideDoAppletsController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | ISysUserService IUserService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据部门id及分类id获取导办用户 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "根据部门id及分类id获取导办用户",response = SysUser.class) |
| | | @GetMapping("/selectListByDepartmentId") |
| | | @Authorization |
| | | public ResultData selectListByDepartmentId(@RequestParam("departmentId") String departmentId, |
| | | @RequestParam(value = "classifyId",required = false) String classifyId){ |
| | | return ResultData.success(IUserService.selectListByDepartmentId(departmentId,classifyId)); |
| | | } |
| | | |
| | | /** |
| | | * 查询导办用户列表(不分页) |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = " 查询导办用户列表(不分页)",response = SysUser.class) |
| | | @GetMapping("/queryList") |
| | | public ResultData queryList(@RequestParam(value = "keyWord",required = false) String keyWord){ |
| | | return ResultData.success(IUserService.queryList(2,keyWord)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | |
| | | 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.controller.BaseController; |
| | | 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.db.manual.mapper.util.ConstantPropertiesUtil; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import com.dg.core.util.WxUtil; |
| | | 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.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 工单管理 |
| | | */ |
| | | @Api(tags = {"工单管理小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/guideRepairOrder") |
| | | public class GuideRepairOrderAppletsController extends BaseController { |
| | | |
| | | @Resource |
| | | private IGuideRepairOrderService iGuideRepairOrderService; |
| | | |
| | | @Autowired |
| | | private IGuideEvolveService iGuideEvolveService; |
| | | |
| | | @Resource |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | @Resource(name = "stringRedisTemplate") |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | private static String guideRepairOrderCompleteTemplateId = "7ZCHHii87rWPwVkdhZnvNiYbYi_Buq0NXO10cmUhAFk"; |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | /** |
| | | * 提交导办订单 |
| | | * @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()); |
| | | guideRepairOrder.setSubmitType(1); |
| | | int i = iGuideRepairOrderService.addOrder(guideRepairOrder); |
| | | if (i>0){ |
| | | iGuideEvolveService.updateGuid(); |
| | | return ResultData.success(); |
| | | } |
| | | else |
| | | return ResultData.error("提交失败,请检查你是否有相同的咨询内容在处理中"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @param orderNum |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取订单详情",response = GuideRepairOrder.class) |
| | | @GetMapping("/orderdata") |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam(value = "Id",required = false) String Id, |
| | | @RequestParam(value = "orderNum",required = false) String orderNum, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | if(StringUtils.isEmpty(Id) && StringUtils.isEmpty(orderNum)) |
| | | { |
| | | return ResultData.error("id或者订单号不能都为空"); |
| | | } |
| | | |
| | | GuideRepairOrder order=iGuideRepairOrderService.selectConfigData(Id,orderNum); |
| | | order.setGuideEvolveEntities(iGuideEvolveService.selectConfigList(Id,sysUser)); |
| | | |
| | | return ResultData.success(order); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 转派人员 |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "转派人员",response = GuideRepairOrder.class) |
| | | @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不能为空"); |
| | | } |
| | | |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | | |
| | | //新增转派记录 |
| | | GuideEvolveEntity entity=new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("10"); |
| | | entity.setDepartmentalId(order.getGuideDepartmentId()); |
| | | entity.setToUserId(order.getGuideUserId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | iGuideRepairOrderService.updateSysUserOrderNum(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 去处理 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "去处理",response = GuideRepairOrder.class) |
| | | @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(entity.getState(),"2")){//如果用户选择未解决则状态改为待办 |
| | | order.setState("2"); |
| | | entity.setState("9"); |
| | | } |
| | | else if(StringUtils.equals(entity.getState(),"4")){ |
| | | if (order.getSubmitType().equals(1))//小程序提交 |
| | | { |
| | | WxUtil wxUtil=new WxUtil(); |
| | | String accessToken="0"; |
| | | try { |
| | | accessToken= stringRedisTemplate.boundValueOps("access_token:access_token:" + ConstantPropertiesUtil.WX_OPEN_APP_ID).get(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | SysUser submitUser = iGuideRepairOrderService.getSubmitUser(order); |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,entity); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsCompleteNew(order.getConsultUserPhone(),order.getMatterName()); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | | entity.setState("7"); |
| | | } |
| | | //新增已办结记录 |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | iGuideRepairOrderService.updateSysUserOrderNum(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消导办工单 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "取消导办工单",response = GuideRepairOrder.class) |
| | | @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()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 工单评价 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "工单评价",response = GuideRepairOrder.class) |
| | | @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.isEmpty(entity.getEvaluateState())) |
| | | { |
| | | return ResultData.error("满意程度不能为空!"); |
| | | } |
| | | |
| | | //已办结 |
| | | entity.setState("3"); |
| | | //新增已办结记录 |
| | | GuideEvolveEntity guideEvolveEntity=new GuideEvolveEntity(); |
| | | guideEvolveEntity.setCreateTime(LocalDateTime.now()); |
| | | guideEvolveEntity.setUpdateTime(LocalDateTime.now()); |
| | | guideEvolveEntity.setState("13"); |
| | | guideEvolveEntity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | guideEvolveEntity.setFromUserId(sysUser.getUserId()+""); |
| | | guideEvolveEntity.setGuideId(entity.getId().toString()); |
| | | int i = iGuideRepairOrderService.updateConfig(entity); |
| | | if (i>0) |
| | | return toAjax( iGuideEvolveService.insertConfig(guideEvolveEntity)); |
| | | else |
| | | return ResultData.error(); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人中心工单数据 |
| | | * @param sysUser 当前登录人员信息 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取个人中心工单数据",response = GuideRepairOrder.class) |
| | | @GetMapping("/personalCenter") |
| | | @Authorization |
| | | public ResultData selectBySubmitId(@CurrentUser SysUser sysUser){ |
| | | return ResultData.success(iGuideRepairOrderService.selectBySubmitId(sysUser.getUserId().toString())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 小程序获取导办工单管理列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序获取导办工单管理列表",response = GuideRepairOrder.class) |
| | | @GetMapping("/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "state",required = false) String status, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | List<String> ids=null; |
| | | String userId=null; |
| | | if( StringUtils.equals("2",sysUser.getRoleIds())) |
| | | { |
| | | if(StringUtils.equals("1",sysUser.getIsDivisionHead())) |
| | | { |
| | | ids=PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | } |
| | | else |
| | | { |
| | | userId=sysUser.getUserId()+""; |
| | | ids=new ArrayList<>(); |
| | | ids.add(sysUser.getDepartmentId()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ids=PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | } |
| | | List<GuideRepairOrder> list = iGuideRepairOrderService.selectConfigList(null,ids,status,userId,null,null,null); |
| | | int num=iGuideRepairOrderService.countConfigList(null,ids,status,userId); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除评论 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除评论",response = GuideRepairOrder.class) |
| | | @GetMapping("/deleteComment") |
| | | @Authorization |
| | | public ResultData deleteComment(@RequestParam(value = "id",required = false) Integer id,@CurrentUser SysUser sysUser){ |
| | | return iGuideRepairOrderService.deleteComment(id,sysUser); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | 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("/applets/organization") |
| | | public class OrganizationAppletsController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | @ApiOperation("查询机构列表") |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList() |
| | | { |
| | | return getDataTable(iOrganizationChartService.selectConfigList("","" ,null)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(不分级不分页按等级排序) |
| | | */ |
| | | @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.api; |
| | | |
| | | 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.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.ReplyTemplateEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.service.IReplyTemplateService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"回复模板小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/reply") |
| | | public class ReplyTemplateAppletsController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | IReplyTemplateService iReplyTemplateService; |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | |
| | | /** |
| | | * 获取模板列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取模板列表",response = ReplyTemplateEntity.class) |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "Name",required = false) String Name, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Page<ReplyTemplateEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<String> ids= PermissionUtil.getStairDepartment(sysUser,iOrganizationChartService); |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return getDataTable("您没有权限查看该数据"); |
| | | } |
| | | List<ReplyTemplateEntity> list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids,null); |
| | | int num=iReplyTemplateService.countNum(Name,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取详情",response = ReplyTemplateEntity.class) |
| | | @GetMapping("/getdata") |
| | | @Authorization |
| | | 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(value = "新增模板",response = ReplyTemplateEntity.class) |
| | | @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(value = "更新模板",response = ReplyTemplateEntity.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | 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(value = "删除模板",response = ReplyTemplateEntity.class) |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | return toAjax(iReplyTemplateService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 复制模板 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "复制模板",response = ReplyTemplateEntity.class) |
| | | @PostMapping("/copy") |
| | | @Authorization |
| | | 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.api; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.controller.BaseController; |
| | | 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.*; |
| | | |
| | | @Api(tags = {"轮播图小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/slideshow") |
| | | public class SlideshowAppletsController 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)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.api; |
| | | |
| | | 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.controller.BaseController; |
| | | import com.dg.core.db.gen.entity.AutomessageSmartConsulting; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | 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.IAutomessageSmartConsultingService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | 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.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"导办事项管理(及办事指南)小程序接口"}) |
| | | @RestController |
| | | @RequestMapping("/applets/transaction") |
| | | public class TransactionEventAppletsController extends BaseController { |
| | | |
| | | @Autowired(required = true) |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | @Autowired(required = true) |
| | | IAutomessageSmartConsultingService iAutomessageSmartConsultingService; |
| | | |
| | | /** |
| | | * 查询导办事务详情 |
| | | * |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("查询导办事务详情") |
| | | @GetMapping("/getData") |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id, @CurrentUser SysUser sysUser) { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | return ResultData.success(iTransactionEventService.selectConfigData(Id, sysUser)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导办事物列表(不分页) |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导办事物列表(不分页)", response = TransactionEvent.class) |
| | | @GetMapping("/selectList") |
| | | public TableDataInfo selectList(@RequestParam(value = "keyWord", required = false) String keyWord) { |
| | | return getDataTable(iTransactionEventService.selectList(keyWord)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导办事务搜索(无分页用于小程序) |
| | | * |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导办事务搜索(无分页用于小程序)", response = QueryResults.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "isSmartConsulting", value = "是否是智能咨询(1.是 2.否)", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping("/queryKeyWord") |
| | | public QueryResults queryKeyWord(@RequestParam(value = "keyWord", required = false) String keyWord, @RequestParam(value = "isSmartConsulting", required = false) String isSmartConsulting, @CurrentUser SysUser sysUser) { |
| | | QueryResults queryResults = iTransactionEventService.queryMatterNameList(keyWord); |
| | | if (isSmartConsulting != null && isSmartConsulting.equals("1")) { |
| | | AutomessageSmartConsulting automessageSmartConsulting = new AutomessageSmartConsulting(); |
| | | if (sysUser != null) { |
| | | automessageSmartConsulting.setCreateUserId(sysUser.getUserId()); |
| | | } |
| | | automessageSmartConsulting.setType(1); |
| | | automessageSmartConsulting.setCreateTime(LocalDateTime.now()); |
| | | iAutomessageSmartConsultingService.add(automessageSmartConsulting); |
| | | } |
| | | 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("/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.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.time.LocalDateTime; |
| | | 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") |
| | | @Authorization |
| | | 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.setUpdateTime(LocalDateTime.now()); |
| | | 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.db.gen.entity.OrganizationChartEntity; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | | * 获取攀枝花所有所属地区 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取攀枝花所有所属地区",response = AreaCode2022.class) |
| | | @GetMapping("/getListByPCode") |
| | | public TableDataInfo getListByPCode(){ |
| | | return getDataTable(iAreaCodeService.getListByPCode("510400000000")); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IAutomessageCommonProblemService; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"常见问题接口"}) |
| | | @RestController |
| | | @RequestMapping("/automessageCommonProblem") |
| | | public class AutomessageCommonProblemController extends BaseController{ |
| | | |
| | | @Resource |
| | | private IAutomessageCommonProblemService iAutomessageCommonProblemService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(分页) |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取常见问题列表(分页)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectConfigList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "title",required = false) String title, |
| | | @RequestParam(value = "content",required = false) String content){ |
| | | Page<AutomessageCommonProblem> pageParam = new Page<>(pageNum,pageSize); |
| | | List<AutomessageCommonProblem> list = iAutomessageCommonProblemService.selectConfigList(pageParam,pageSize,title,content); |
| | | int num=iAutomessageCommonProblemService.countAutomessageCommonProblem(title,content); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 添加常见问题数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "添加常见问题数据)",response = AutomessageCommonProblem.class) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | ResultData add(@RequestBody AutomessageCommonProblem automessageCommonProblem,@CurrentUser SysUser sysUser){ |
| | | automessageCommonProblem.setCreateUserId(sysUser.getUserId().toString()); |
| | | automessageCommonProblem.setUpdateUserId(sysUser.getUserId().toString()); |
| | | return iAutomessageCommonProblemService.add(automessageCommonProblem); |
| | | } |
| | | |
| | | /** |
| | | * 修改常见问题数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改常见问题数据)",response = AutomessageCommonProblem.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | ResultData update(@RequestBody AutomessageCommonProblem automessageCommonProblem,@CurrentUser SysUser sysUser){ |
| | | automessageCommonProblem.setUpdateUserId(sysUser.getUserId().toString()); |
| | | return iAutomessageCommonProblemService.update(automessageCommonProblem); |
| | | } |
| | | |
| | | /** |
| | | * 删除常见问题数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除常见问题数据)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/delete") |
| | | @Authorization |
| | | ResultData delete( @RequestParam(value = "id") Integer id){ |
| | | return iAutomessageCommonProblemService.delete(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(分页) |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取常见问题列表(分页)(不加token)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectConfigListNoToken") |
| | | public TableDataInfo selectConfigListNoToken(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "title",required = false) String title, |
| | | @RequestParam(value = "content",required = false) String content){ |
| | | Page<AutomessageCommonProblem> pageParam = new Page<>(pageNum,pageSize); |
| | | List<AutomessageCommonProblem> list = iAutomessageCommonProblemService.selectConfigList(pageParam,pageSize,title,content); |
| | | int num=iAutomessageCommonProblemService.countAutomessageCommonProblem(title,content); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | } |
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.AutomessagePolicyDocuments; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IAutomessagePolicyDocumentsService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"获取法律法规政策文件接口"}) |
| | | @RestController |
| | | @RequestMapping("/AutomessagePolicyDocumentsController") |
| | | public class AutomessagePolicyDocumentsController extends BaseController { |
| | | |
| | | @Resource |
| | | private IAutomessagePolicyDocumentsService iAutomessagePolicyDocumentsService; |
| | | |
| | | @Resource |
| | | private IOrganizationChartService iOrganizationChartService; |
| | | |
| | | /** |
| | | * 获取法律法规政策文件列表(分页) |
| | | * @param name |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取法律法规政策文件列表(分页)",response = AutomessagePolicyDocuments.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "类型(1.法律法规2.政策文件)", required = true, dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "isPortal", value = "是否门户网(1.是 2.否) 不传则是门户网", required = true, dataType = "String", paramType = "query") |
| | | |
| | | }) |
| | | @GetMapping("/selectConfigList") |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String name, |
| | | @RequestParam(value = "type",required = false) String type, |
| | | @RequestParam(value = "departmentId",required = false) Integer departmentId, |
| | | @RequestParam(value = "isPortal",required = false) String isPortal, |
| | | @CurrentUser SysUser sysUser){ |
| | | Page<AutomessagePolicyDocuments> pageParam = new Page<>(pageNum,pageSize); |
| | | List<String> ids=null; |
| | | if ( (isPortal != null && isPortal.equals("2"))&&sysUser!=null&&(sysUser.getUserType().equals("2")||sysUser.getIsDivisionHead().equals("1"))){ |
| | | if (sysUser.getDepartmentId()!=null) |
| | | ids=iOrganizationChartService.getDepartmentId(sysUser.getDepartmentId()); |
| | | } |
| | | List<AutomessagePolicyDocuments> list = iAutomessagePolicyDocumentsService.selectConfigList(pageParam,pageSize,name,type,sysUser,departmentId,ids); |
| | | return getDataTable(list,iAutomessagePolicyDocumentsService.selectCountList(name,type,departmentId,ids)); |
| | | } |
| | | |
| | | /** |
| | | * 获取法律法规政策文件列表(不分页) |
| | | * @param name |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取法律法规政策文件列表(不分页)",response = AutomessagePolicyDocuments.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "类型(1.法律法规2.政策文件)", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping("/selectList") |
| | | public ResultData selectConfigList(@RequestParam(value = "name",required = false) String name, |
| | | @RequestParam(value = "type",required = false) String type, |
| | | @RequestParam(value = "departmentId",required = false) Integer departmentId){ |
| | | List<AutomessagePolicyDocuments> list = iAutomessagePolicyDocumentsService.selectConfigList(name,type,departmentId,null); |
| | | return ResultData.success(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增法律法规政策文件 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 新增法律法规政策文件 ",response = AutomessagePolicyDocuments.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "类型(1.法律法规2.政策文件)传参中的type 传入1则是新增的法律规范2则是政策文件", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData add(@RequestBody AutomessagePolicyDocuments automessagePolicyDocuments,@CurrentUser SysUser sysUser){ |
| | | automessagePolicyDocuments.setCreateUserId(sysUser.getUserId()); |
| | | automessagePolicyDocuments.setUpdateUserId(sysUser.getUserId()); |
| | | int add = iAutomessagePolicyDocumentsService.add(automessagePolicyDocuments); |
| | | if (add>0){ |
| | | return ResultData.success("新增成功"); |
| | | }else { |
| | | return ResultData.error("新增失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改法律法规政策文件 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 新增法律法规政策文件 ",response = AutomessagePolicyDocuments.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData update(@RequestBody AutomessagePolicyDocuments automessagePolicyDocuments,@CurrentUser SysUser sysUser){ |
| | | automessagePolicyDocuments.setUpdateUserId(sysUser.getUserId()); |
| | | int update = iAutomessagePolicyDocumentsService.update(automessagePolicyDocuments); |
| | | if (update>0){ |
| | | return ResultData.success("修改成功"); |
| | | }else { |
| | | return ResultData.error("修改失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除法律法规政策文件 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 删除法律法规政策文件 ",response = AutomessagePolicyDocuments.class) |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData delete(@RequestParam(value = "id") Integer id){ |
| | | int delete = iAutomessagePolicyDocumentsService.delete(id); |
| | | if (delete>0){ |
| | | return ResultData.success("删除成功"); |
| | | }else { |
| | | return ResultData.error("删除失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取法律法规政策文件数据 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = " 根据id获取法律法规政策文件数据 ",response = AutomessagePolicyDocuments.class) |
| | | @GetMapping("/selectAutomessagePolicyDocumentById") |
| | | public ResultData selectAutomessagePolicyDocumentById(@RequestParam(value = "id") Integer id){ |
| | | AutomessagePolicyDocuments automessagePolicyDocuments = iAutomessagePolicyDocumentsService.selectAutomessagePolicyDocumentById(id); |
| | | if (automessagePolicyDocuments!=null){ |
| | | return ResultData.success(automessagePolicyDocuments); |
| | | }else { |
| | | return ResultData.error("查找失败"); |
| | | } |
| | | } |
| | | } |
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.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 分类管理 |
| | | */ |
| | | @Api(tags = {"分类管理接口"}) |
| | | @RestController |
| | | @RequestMapping("/classify") |
| | | public class ClassifyAdministrationController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | IClassifyAdministrationService iClassifyAdministrationService; |
| | | |
| | | @Autowired(required = true) |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取管理菜单列表(无分页)",response = ClassifyAdministration.class) |
| | | @GetMapping("/getList") |
| | | @Authorization |
| | | 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") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String name, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade) |
| | | { |
| | | 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,classifyGrade); |
| | | int num=iClassifyAdministrationService.countNum(name,classifyGrade); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增分类 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增分类",response = ClassifyAdministration.class) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | 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") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody ClassifyAdministration entity) |
| | | { |
| | | return toAjax(iClassifyAdministrationService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除分类 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除分类") |
| | | @DeleteMapping("/delete/{Id}") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@PathVariable("Id") String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("id 不能为空"); |
| | | } |
| | | |
| | | /** |
| | | * 根据上级id查询子分类 |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<String> list=iClassifyAdministrationService.selectParent(Id); |
| | | if(list!=null && list.size()>0) |
| | | { |
| | | return ResultData.error("请先删除其下的二级分类"); |
| | | } |
| | | |
| | | List<String> listIds=iTransactionEventService.selectclassifyId(Id); |
| | | if(listIds!=null && listIds.size()>0) |
| | | { |
| | | return ResultData.error("分类下有办事指南!不能删除"); |
| | | } |
| | | |
| | | return toAjax(iClassifyAdministrationService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | /** |
| | | * 获取分类根据id 如果是二级id则获取的是办事指南 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取分类根据id 如果是二级id则获取的是办事指南,不传参默认是0") |
| | | @GetMapping("/queryListById") |
| | | ResultData queryListById(@RequestParam(value = "id",required = false) Integer id){ |
| | | if(id==null) |
| | | id=0; |
| | | return iClassifyAdministrationService.queryListById(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 树状分类选择列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation("树状分类选择列表") |
| | | @GetMapping("/getClassifyList") |
| | | public TableDataInfo getClassifyList() |
| | | { |
| | | List<ClassifyAdministration> list=iClassifyAdministrationService.selectConfigList("","1"); |
| | | |
| | | for(ClassifyAdministration entity:list) |
| | | { |
| | | entity.setClassifyAdministrationEntityList(iClassifyAdministrationService.selectParentData(entity.getId()+"")); |
| | | } |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.dg.core.CorsConfig; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.AjaxResult; |
| | | import com.dg.core.file.FtpConstants; |
| | | import com.dg.core.file.MimeTypeUtils; |
| | | import com.dg.core.file.SFTPUtil; |
| | | import com.dg.core.util.TestDate; |
| | | import com.iceyyy.workday.WorkUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.InputStream; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import static com.dg.core.file.FileTypeUploadUtils.assertAllowed; |
| | | |
| | | |
| | | @Api(tags = {"通用接口"}) |
| | | @RestController |
| | | @RequestMapping("/common") |
| | | public class CommonController extends BaseController { |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | @Autowired |
| | | private CorsConfig corsConfig; |
| | | |
| | | |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | @RequestMapping("/hello") |
| | | // @Authorization |
| | | public ResponseEntity<String> hello() { |
| | | return ResponseEntity.ok("hello world"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @ApiOperation("文件上传接口(通用)") |
| | | @PostMapping("/uploads") |
| | | public ResultData uploadFiles(List<MultipartFile> files) throws Exception { |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | for (MultipartFile file : files) { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | try { |
| | | assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | InputStream is = file.getInputStream(); |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | sftp.logout(); |
| | | |
| | | urls.add(url + "/idcard/" + name); |
| | | fileNames.add(name); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | |
| | | } catch (Exception e) { |
| | | return ResultData.error("上传文件失败 " + e.getMessage()); |
| | | } |
| | | } |
| | | AjaxResult ajax = new AjaxResult(); |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | return ResultData.success(ajax); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通用上传请求(单个) |
| | | */ |
| | | @ApiOperation("文件上传接口(通用)") |
| | | @PostMapping("/upload") |
| | | public ResultData uploadFile(MultipartFile file) throws Exception { |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | try { |
| | | assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | InputStream is = file.getInputStream(); |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | sftp.logout(); |
| | | |
| | | // urls.add(url + "/idcard/" + name); |
| | | // fileNames.add(name); |
| | | // originalFilenames.add(file.getOriginalFilename()); |
| | | return ResultData.success(url + "/idcard/" + name); |
| | | } catch (Exception e) { |
| | | return ResultData.error("上传文件失败 " + e.getMessage()); |
| | | } |
| | | |
| | | // AjaxResult ajax = new AjaxResult(); |
| | | // ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | // ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | // ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | } |
| | | |
| | | /** |
| | | * 判断当前时间是否是工作日,格式为“2022-10-16”,不传默认为今天 |
| | | */ |
| | | @ApiOperation("判断当前时间是否是工作日,格式为“20221016”,不传默认为今天") |
| | | @GetMapping("/isWeekday") |
| | | public ResultData isWeekday(@RequestParam(value = "dateTime", required = false) String dateTime) { |
| | | if (dateTime == null) { |
| | | Date date = new Date(); |
| | | SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd"); |
| | | dateTime = fmt.format(date); |
| | | } |
| | | if (WorkUtils.isWorkendDay(dateTime)) |
| | | return success("休息日或者周末"); |
| | | else |
| | | return success("工作日"); |
| | | } |
| | | |
| | | /** |
| | | * 获取天气默认为攀枝花 |
| | | */ |
| | | @ApiOperation("获取天气默认为攀枝花") |
| | | @GetMapping("/getWeather") |
| | | public ResultData getWeather(@RequestParam(value = "code", required = false) String code) { |
| | | TestDate td = new TestDate(); |
| | | Map weather; |
| | | if (code == null) {//默认为攀枝花 则从redis上获取redis上定时任务15分钟获取一次天气 |
| | | HashMap weather1 = (HashMap) redisTemplate.opsForValue().get("weather"); |
| | | return ResultData.success(weather1.get("lives")); |
| | | } else { |
| | | return ResultData.success(td.getWeather(code)); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
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.ElseAccessoryEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IElseAccessoryService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"其他附件接口"}) |
| | | @RestController |
| | | @RequestMapping("/else") |
| | | public class ElseAccessoryController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | IElseAccessoryService iElseAccessoryService; |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | /** |
| | | * 获取附件列表 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取附件列表接口") |
| | | @GetMapping(path = "/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String name, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Page<ElseAccessoryEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<String> ids= PermissionUtil.getStairDepartment(sysUser,iOrganizationChartService); |
| | | List<ElseAccessoryEntity> list; |
| | | if (sysUser.getUserType().equals("1")||sysUser.getIsDivisionHead().equals("1")){ |
| | | list = iElseAccessoryService.selectConfigList(pageParam,pageSize,name,ids,null); |
| | | } |
| | | else { |
| | | list = iElseAccessoryService.selectConfigList(pageParam,pageSize,name,ids,sysUser.getUserId()); |
| | | } |
| | | int num=iElseAccessoryService.countNum(name,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 获取附件列表 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取附件列表接口(全部)") |
| | | @GetMapping(path = "/getAllList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigListAll(@RequestParam(value = "Name",required = false) String Name, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | List<String> ids= PermissionUtil.getStairDepartment(sysUser,iOrganizationChartService); |
| | | List<ElseAccessoryEntity> list = iElseAccessoryService.selectConfigList(Name,ids,sysUser.getUserId()); |
| | | int num=iElseAccessoryService.countNum(Name,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增列表 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增附件") |
| | | @PostMapping(path = "/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody ElseAccessoryEntity entity,@CurrentUser SysUser sysUser) |
| | | { |
| | | 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("部门不能为空"); |
| | | } |
| | | entity.setCreateUserId(sysUser.getUserId()); |
| | | return toAjax(iElseAccessoryService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 更新附件 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("更新附件") |
| | | @PostMapping(path = "/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody ElseAccessoryEntity entity) |
| | | { |
| | | return toAjax(iElseAccessoryService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除附件") |
| | | @DeleteMapping(path = "/delete") |
| | | @Authorization |
| | | 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.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | import com.dg.core.util.Snowflake; |
| | | 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.data.repository.query.Param; |
| | | 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; |
| | | |
| | | |
| | | @Autowired |
| | | IGuideRepairOrderService iGuideRepairOrderService; |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation("用户列表接口") |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "keyword",required = false) String keyword, |
| | | @RequestParam(value = "isDivisionHead",required = false) String isDivisionHead, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<SysUser> pageParam = new Page<>(pageNum,pageSize); |
| | | List<String> ids= PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | List<SysUser> list ; |
| | | int num; |
| | | if (isDivisionHead!=null&&!isDivisionHead.equals("")){ |
| | | list = IUserService.selectConfigList(pageParam,pageSize,"2",keyword,ids,isDivisionHead); |
| | | num=IUserService.selectNum("2",keyword,ids,isDivisionHead); |
| | | } |
| | | else{ |
| | | list = IUserService.selectConfigList(pageParam,pageSize,"2",keyword,ids,null); |
| | | num=IUserService.selectNum("2",keyword,ids,null); |
| | | } |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增用户 |
| | | * |
| | | * @param config 参数配置信息- |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("新增导办用户接口") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody SysUser config,@CurrentUser SysUser sysUser) |
| | | { |
| | | 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.getPhonenumber())) |
| | | { |
| | | return error("手机号不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getUserName())) |
| | | { |
| | | return error("昵称不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getDepartmentId())) |
| | | { |
| | | return error("部门不能为空"); |
| | | } |
| | | |
| | | config.setUserType("2"); |
| | | |
| | | SysUser user=IUserService.selectData(null,config.getPhonenumber(),null); |
| | | if (user != null) |
| | | { |
| | | user.setPassword(config.getPassword()); |
| | | user.setDepartmentId(config.getDepartmentId()); |
| | | user.setUserName(config.getUserName()); |
| | | user.setPhonenumber(config.getPhonenumber()); |
| | | user.setLoginName(config.getLoginName()); |
| | | user.setMasterIds(config.getMasterIds()); |
| | | //是否是部门领导(1是 2不是) |
| | | if(StringUtils.equals("1",config.getIsDivisionHead())) |
| | | { |
| | | user.setRoleIds("13"); |
| | | if(StringUtils.isEmpty(config.getDataPermission())) { |
| | | user.setDataPermission(config.getMoreDepartmentIds()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if(StringUtils.isEmpty(config.getDataPermission())) { |
| | | user.setDataPermission(config.getDepartmentId()); |
| | | } |
| | | user.setRoleIds("2"); |
| | | } |
| | | user.setUserType("2"); |
| | | user.setIsDivisionHead(config.getIsDivisionHead()); |
| | | user.setStatus(config.getStatus()); |
| | | user.setUpdateTime(LocalDateTime.now()); |
| | | user.setDepartmentIds(config.getDepartmentIds()); |
| | | user.setDepartmentIdStr(config.getDepartmentIdStr()); |
| | | user.setMoreDepartmentIds(config.getMoreDepartmentIds()); |
| | | user.setMattersIds(config.getMattersIds()); |
| | | user.setMasterNames(config.getMasterNames()); |
| | | user.setMattersNames(config.getMattersNames()); |
| | | if (config.getMoreDepartmentIds()!=null&&config.getMoreDepartmentIds().indexOf(",")>0) |
| | | user.setDataPermission(config.getMoreDepartmentIds().substring(config.getMoreDepartmentIds().indexOf(",")+1)); |
| | | //提示用户名或密码错误 |
| | | return toAjax(IUserService.updateConfig(user)); |
| | | } |
| | | //是否是部门领导(1是 2不是) |
| | | if(StringUtils.equals("1",config.getIsDivisionHead())) |
| | | { |
| | | config.setRoleIds("13"); |
| | | if(StringUtils.isEmpty(config.getDataPermission())) { |
| | | config.setDataPermission(config.getMoreDepartmentIds()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if(StringUtils.isEmpty(config.getDataPermission())) { |
| | | config.setDataPermission(config.getDepartmentId()); |
| | | } |
| | | config.setRoleIds("2"); |
| | | } |
| | | config.setCreateBy(sysUser.getUserId()); |
| | | config.setCreateTime(LocalDateTime.now()); |
| | | config.setUpdateTime(LocalDateTime.now()); |
| | | config.setUserId(Snowflake.getId()+""); |
| | | if (config.getMoreDepartmentIds()!=null&&config.getMoreDepartmentIds().indexOf(",")>0) |
| | | config.setDataPermission(config.getMoreDepartmentIds().substring(config.getMoreDepartmentIds().indexOf(",")+1)); |
| | | config.setIsDivisionHead(config.getIsDivisionHead()); |
| | | 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.getPhonenumber())) |
| | | { |
| | | return error("手机号不能为空"); |
| | | } |
| | | |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | | { |
| | | return error("账户不能为空"); |
| | | } |
| | | |
| | | config.setUserType("2"); |
| | | |
| | | //是否是部门领导(1是 2不是) |
| | | if(StringUtils.equals("1",config.getIsDivisionHead())) |
| | | { |
| | | if (config.getMoreDepartmentIds()!=null&&config.getMoreDepartmentIds().indexOf(",")>0) |
| | | config.setDataPermission(config.getMoreDepartmentIds().substring(config.getMoreDepartmentIds().indexOf(",")+1)); |
| | | else |
| | | { |
| | | config.setDataPermission("0"); |
| | | } |
| | | |
| | | config.setRoleIds("13"); |
| | | } |
| | | else |
| | | { |
| | | if(StringUtils.isEmpty(config.getDataPermission())) { |
| | | config.setDataPermission(config.getDepartmentId()); |
| | | } |
| | | config.setRoleIds("2"); |
| | | } |
| | | |
| | | SysUser user=IUserService.selectData(null,config.getPhonenumber(),null); |
| | | if (user != null && !(user.getUserId().equals(config.getUserId()))) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.error("该手机账户已存在!请更换手机号"); |
| | | } |
| | | 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不能为空"); |
| | | } |
| | | |
| | | int a=iGuideRepairOrderService.countUser(userId,"2"); |
| | | if(a>0) |
| | | { |
| | | return error("该人员有工单未处理完不能删除"); |
| | | } |
| | | SysUser user=IUserService.selectData(userId,null,null); |
| | | user.setUserType("4"); |
| | | user.setRoleIds("4"); |
| | | user.setIsDivisionHead("2"); |
| | | return toAjax(IUserService.updateConfig(user)); |
| | | } |
| | | |
| | | /** |
| | | * 修改导办用户空闲状态接口 |
| | | * |
| | | * @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)); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门id及分类id获取导办用户 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("根据部门id及分类id获取导办用户") |
| | | @GetMapping("/selectListByDepartmentId") |
| | | @Authorization |
| | | public ResultData selectListByDepartmentId(@RequestParam("departmentId") String departmentId, |
| | | @RequestParam(value = "classifyId",required = false) String classifyId) |
| | | { |
| | | return ResultData.success(IUserService.selectListByDepartmentId(departmentId,classifyId)); |
| | | } |
| | | |
| | | /** |
| | | * 查询导办用户列表(不分页) |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(" 查询导办用户列表(不分页)") |
| | | @GetMapping("/queryList") |
| | | @Authorization |
| | | public ResultData queryList(@RequestParam(value = "keyWord",required = false) String keyWord){ |
| | | return ResultData.success(IUserService.queryList(2,keyWord)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.*; |
| | | import com.dg.core.db.manual.mapper.util.ConstantPropertiesUtil; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import com.dg.core.util.WxUtil; |
| | | 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.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 工单管理 |
| | | */ |
| | | @Api(tags = {"工单管理接口"}) |
| | | @RestController |
| | | @RequestMapping("/guideRepairOrder") |
| | | public class GuideRepairOrderController extends BaseController { |
| | | |
| | | @Resource |
| | | private IGuideRepairOrderService iGuideRepairOrderService; |
| | | |
| | | @Autowired |
| | | private IGuideEvolveService iGuideEvolveService; |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | @Resource(name = "stringRedisTemplate") |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | private static String guideRepairOrderCompleteTemplateId = "7ZCHHii87rWPwVkdhZnvNiYbYi_Buq0NXO10cmUhAFk"; |
| | | |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | |
| | | /** |
| | | * 提交导办订单 |
| | | * @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()); |
| | | guideRepairOrder.setSubmitUserPhone(sysUser.getPhonenumber()); |
| | | guideRepairOrder.setSubmitType(2); |
| | | int i = iGuideRepairOrderService.addOrder(guideRepairOrder); |
| | | if (i>0){ |
| | | iGuideEvolveService.updateGuid(); |
| | | return ResultData.success(); |
| | | } |
| | | else |
| | | return ResultData.error("提交失败,请检查你是否有相同的咨询内容在处理中"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @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, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | if(StringUtils.isEmpty(Id) && StringUtils.isEmpty(orderNum)) |
| | | { |
| | | return ResultData.error("id或者订单号不能都为空"); |
| | | } |
| | | |
| | | GuideRepairOrder order=iGuideRepairOrderService.selectConfigData(Id,orderNum); |
| | | order.setGuideEvolveEntities(iGuideEvolveService.selectConfigList(Id,sysUser)); |
| | | |
| | | 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不能为空"); |
| | | } |
| | | |
| | | |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | | |
| | | //新增分配记录 |
| | | GuideEvolveEntity entity=new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("11"); |
| | | entity.setDepartmentalId(order.getGuideDepartmentId()); |
| | | entity.setToUserId(order.getGuideUserId()); |
| | | entity.setFromUserId(sysUser.getUserId().toString()); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideRepairOrderService.updateSysUserOrderNum(entity); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | order=iGuideRepairOrderService.setTimeoutTim(order); |
| | | 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不能为空"); |
| | | } |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | | |
| | | //新增转派记录 |
| | | GuideEvolveEntity entity=new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("10"); |
| | | entity.setDepartmentalId(order.getGuideDepartmentId()); |
| | | entity.setToUserId(order.getGuideUserId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setGuideId(order.getId().toString()); |
| | | |
| | | iGuideEvolveService.insertConfig(entity); |
| | | iGuideRepairOrderService.updateSysUserOrderNum(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(entity.getState(),"2")){//如果用户选择未解决则状态改为待办 |
| | | order.setState("2"); |
| | | entity.setState("9"); |
| | | } |
| | | else if(StringUtils.equals(entity.getState(),"4")){ |
| | | //待评价 |
| | | if (order.getSubmitType().equals(1))//小程序提交 |
| | | { |
| | | WxUtil wxUtil=new WxUtil(); |
| | | String accessToken="0"; |
| | | try { |
| | | accessToken= stringRedisTemplate.boundValueOps("access_token:access_token:" + ConstantPropertiesUtil.WX_OPEN_APP_ID).get(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | SysUser submitUser = iGuideRepairOrderService.getSubmitUser(order); |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,entity); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsCompleteNew(order.getConsultUserPhone(),order.getMatterName()); |
| | | } |
| | | order.setState("4"); |
| | | entity.setState("7"); |
| | | } |
| | | //新增已办结记录 |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | iGuideRepairOrderService.updateSysUserOrderNum(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()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | 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.isEmpty(entity.getEvaluateState())) |
| | | { |
| | | return ResultData.error("满意程度不能为空!"); |
| | | } |
| | | //已办结 |
| | | entity.setState("3"); |
| | | //新增已办结记录 |
| | | GuideEvolveEntity guideEvolveEntity=new GuideEvolveEntity(); |
| | | guideEvolveEntity.setCreateTime(LocalDateTime.now()); |
| | | guideEvolveEntity.setUpdateTime(LocalDateTime.now()); |
| | | guideEvolveEntity.setState("13"); |
| | | guideEvolveEntity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | guideEvolveEntity.setFromUserId(sysUser.getUserId()+""); |
| | | guideEvolveEntity.setGuideId(entity.getId().toString()); |
| | | int i = iGuideRepairOrderService.updateConfig(entity); |
| | | if (i>0) |
| | | return toAjax( iGuideEvolveService.insertConfig(guideEvolveEntity)); |
| | | else |
| | | return ResultData.error(); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人中心工单数据 |
| | | * @param sysUser 当前登录人员信息 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取个人中心工单数据",response = GuideRepairOrder.class) |
| | | @GetMapping("/personalCenter") |
| | | @Authorization |
| | | public ResultData selectBySubmitId(@CurrentUser SysUser sysUser){ |
| | | return ResultData.success(iGuideRepairOrderService.selectBySubmitId(sysUser.getUserId().toString())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取工单列表(分页) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取工单列表(分页)",response = GuideRepairOrder.class) |
| | | @GetMapping("/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "matterName",required = false) String matterName, |
| | | @RequestParam(value = "status",required = false) String status, |
| | | @RequestParam(value = "createTimeStartTime",required = false) String createTimeStartTime, |
| | | @RequestParam(value = "createTimeTimeEndTime",required = false) String createTimeTimeEndTime, |
| | | @RequestParam(value = "classifyId",required = false)String classifyId, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Page<GuideRepairOrder> pageParam = new Page<>(pageNum,pageSize); |
| | | |
| | | List<String> ids=null; |
| | | String userId=null; |
| | | if( StringUtils.equals("2",sysUser.getRoleIds())) |
| | | { |
| | | if(StringUtils.equals("1",sysUser.getIsDivisionHead())) |
| | | { |
| | | ids=PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | } |
| | | else |
| | | { |
| | | userId=sysUser.getUserId()+""; |
| | | ids=new ArrayList<>(); |
| | | ids.add(sysUser.getDepartmentId()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ids=PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | } |
| | | |
| | | List<GuideRepairOrder> list = iGuideRepairOrderService.selectConfigList(pageParam,pageSize, |
| | | matterName,ids,status,userId,createTimeStartTime,createTimeTimeEndTime,classifyId); |
| | | int num=iGuideRepairOrderService.countConfigList(matterName,ids,status,userId); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("导办工单统计不同状态工单数") |
| | | @GetMapping("/getWorkOrder") |
| | | @Authorization |
| | | public ResultData getWorkOrder(@CurrentUser SysUser sysUser) |
| | | { |
| | | WorkOrder workOrder=new WorkOrder(); |
| | | List<String> ids=null; |
| | | String userId=null; |
| | | if( StringUtils.equals("2",sysUser.getRoleIds())) |
| | | { |
| | | if(StringUtils.equals("1",sysUser.getIsDivisionHead())) |
| | | { |
| | | ids=PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | } |
| | | else |
| | | { |
| | | userId=sysUser.getUserId()+""; |
| | | ids=new ArrayList<>(); |
| | | ids.add(sysUser.getDepartmentId()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ids=PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | } |
| | | |
| | | //状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 ) |
| | | workOrder.setAllNum(iGuideRepairOrderService.countStatisticsNum("",ids,null,null,null,null,null,userId)); |
| | | workOrder.setWaitDistribution(iGuideRepairOrderService.countStatisticsNum("1",ids,null,null,null,null,null,userId)); |
| | | workOrder.setWaitDealWith(iGuideRepairOrderService.countStatisticsNum("2",ids,null,null,null,null,null,userId)); |
| | | workOrder.setHaveDealWith(iGuideRepairOrderService.countStatisticsNum("3",ids,null,null,null,null,null,userId)); |
| | | workOrder.setRemainEvaluated(iGuideRepairOrderService.countStatisticsNum("4",ids,null,null,null,null,null,userId)); |
| | | workOrder.setCanceled(iGuideRepairOrderService.countStatisticsNum("5",ids,null,null,null,null,null,userId)); |
| | | |
| | | //服务状态(1.已解决 2.未解决) |
| | | workOrder.setUnsolved(iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,null,"2",userId)); |
| | | workOrder.setResolved(iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,null,"1",userId)); |
| | | |
| | | //是否超时 (1 未超时 2已超时) 超时未办结 |
| | | workOrder.setOvertime(iGuideRepairOrderService.countStatisticsNum(null,ids,null,"2",null,null,null,userId)); |
| | | workOrder.setOvertimeWaitDealWith(iGuideRepairOrderService.countStatisticsNum("2",ids,null,"2",null,null,null,userId)); |
| | | return ResultData.success(workOrder); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除工单 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除工单",response = GuideRepairOrder.class) |
| | | @DeleteMapping("/delete/{id}") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@PathVariable("id") String id,@CurrentUser SysUser sysUser) |
| | | { |
| | | if(StringUtils.equals("1",sysUser.getUserType()) || StringUtils.equals("1",sysUser.getIsDivisionHead()) ) |
| | | { |
| | | return toAjax(iGuideRepairOrderService.deleteConfigById(id)); |
| | | } |
| | | return error("只有超管或者部门领导才能删除"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除评论 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除评论",response = GuideRepairOrder.class) |
| | | @GetMapping("/deleteComment") |
| | | @Authorization |
| | | public ResultData deleteComment(@RequestParam(value = "id",required = false) Integer id,@CurrentUser SysUser sysUser){ |
| | | return iGuideRepairOrderService.deleteComment(id,sysUser); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.db.manual.pojo.AppletUserCount; |
| | | import com.dg.core.service.*; |
| | | 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.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Api(tags = {"首页统计接口"}) |
| | | @RestController |
| | | @RequestMapping("/Home") |
| | | public class HomeStatisticsController extends BaseController |
| | | { |
| | | //导办工单接口 |
| | | @Autowired |
| | | IGuideRepairOrderService iGuideRepairOrderService; |
| | | |
| | | //导办进展 |
| | | @Autowired |
| | | IGuideEvolveService iGuideEvolveService; |
| | | |
| | | |
| | | @Autowired |
| | | HomeStatisticsService homeStatisticsService; |
| | | |
| | | |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | |
| | | @Autowired |
| | | IAreaCodeService iAreaCodeService; |
| | | |
| | | @Autowired |
| | | private ISysUserRecordService iSysUserRecordService; |
| | | |
| | | @Autowired(required = true) |
| | | IAutomessageSmartConsultingService iAutomessageSmartConsultingService; |
| | | |
| | | |
| | | @ApiOperation("首页统计不同状态工单数") |
| | | @GetMapping("/getWorkOrder") |
| | | public ResultData<WorkOrder> getWorkOrder() |
| | | { |
| | | WorkOrder workOrder=new WorkOrder(); |
| | | //状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消) |
| | | workOrder.setAllNum(iGuideRepairOrderService.countStatisticsNum("",null,null,null,null,null,null,null)); |
| | | workOrder.setWaitDistribution(iGuideRepairOrderService.countStatisticsNum("1",null,null,null,null,null,null,null)); |
| | | workOrder.setWaitDealWith(iGuideRepairOrderService.countStatisticsNum("2",null,null,null,null,null,null,null)); |
| | | workOrder.setHaveDealWith(iGuideRepairOrderService.countStatisticsNum("3",null,null,null,null,null,null,null)); |
| | | workOrder.setRemainEvaluated(iGuideRepairOrderService.countStatisticsNum("4",null,null,null,null,null,null,null)); |
| | | workOrder.setCanceled(iGuideRepairOrderService.countStatisticsNum("5",null,null,null,null,null,null,null)); |
| | | // //服务状态(1.已解决 2.未解决) |
| | | workOrder.setUnsolved(iGuideRepairOrderService.countStatisticsNum(null,null,null,null,null,null,"2",null)); |
| | | workOrder.setResolved(iGuideRepairOrderService.countStatisticsNum(null,null,null,null,null,null,"1",null)); |
| | | |
| | | //是否超时 (1 未超时 2已超时) 超时未办结 |
| | | workOrder.setOvertime(iGuideRepairOrderService.countStatisticsNum(null,null,null,"2",null,null,null,null)); |
| | | // 超时未办结 |
| | | workOrder.setOvertimeWaitDealWith(iGuideRepairOrderService.countStatisticsNum("2",null,null,"2",null,null,null,null)); |
| | | return ResultData.success(workOrder); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("首页统计不同时间段的工单数量") |
| | | @GetMapping("/getTimeWorkOrder") |
| | | public ResultData<TimeWorkOrder> getTimeWorkOrder() |
| | | { |
| | | //1 今天 2昨天 3本月 4本年度 |
| | | //累计全部 本年 本月 今日 昨日 |
| | | TimeWorkOrder timeWorkOrder=new TimeWorkOrder(); |
| | | timeWorkOrder.setAllNum(iGuideRepairOrderService.countStatisticsNum(null,null,null,null,null,null,null,null)); |
| | | timeWorkOrder.setYearNum(iGuideRepairOrderService.countStatisticsNum(null,null,"4",null,null,null,null,null)); |
| | | timeWorkOrder.setMonthNum(iGuideRepairOrderService.countStatisticsNum(null,null,"3",null,null,null,null,null)); |
| | | timeWorkOrder.setTodayNum(iGuideRepairOrderService.countStatisticsNum(null,null,"1",null,null,null,null,null)); |
| | | timeWorkOrder.setYesterdayNum(iGuideRepairOrderService.countStatisticsNum(null,null,"2",null,null,null,null,null)); |
| | | return ResultData.success(timeWorkOrder); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("根据选择的时间段 筛选导办工单数 timeType:1 本年度 15 近15天的 30 近30天的") |
| | | @GetMapping("/getSelectionTimeOrder") |
| | | public ResultData<CountList> getSelectionTimeOrder(@RequestParam("timeType") Integer timeType) |
| | | { |
| | | if(timeType<1) |
| | | { |
| | | return ResultData.error("请输入时间"); |
| | | } |
| | | |
| | | if(timeType==1) |
| | | { |
| | | Calendar calendar=Calendar.getInstance(); |
| | | timeType=calendar.get(Calendar.DAY_OF_YEAR); |
| | | } |
| | | // System.out.println(timeType); |
| | | //1 本年度 15 近15天的 30 近30天的 |
| | | List<CountListNum> listOne=iGuideRepairOrderService.countListNum("2",null,timeType); |
| | | List<CountListNum> listTwo=iGuideRepairOrderService.countListNum("3",null,timeType); |
| | | CountList countList=new CountList(); |
| | | countList.setWaitDealWithList(listOne); |
| | | countList.setHaveDealWith(listTwo); |
| | | return ResultData.success(countList); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取效率比值") |
| | | @GetMapping("/getEfficiency") |
| | | public ResultData<EfficiencyEntity> getEfficiency() |
| | | { |
| | | EfficiencyEntity entity=new EfficiencyEntity(); |
| | | //总工单数 |
| | | int allNum=iGuideRepairOrderService.countStatisticsNum("",null,null,null,null,null,null,null); |
| | | |
| | | java.text.DecimalFormat weekDf=new java.text.DecimalFormat("##.##%");//传入格式模板 |
| | | |
| | | int bj=iGuideRepairOrderService.countStatisticsNum("3",null,null,null,null,null,null,null); |
| | | if(bj!=0) |
| | | { |
| | | // 好评率=评价为满意的导办工单数量/已办结状态工单数量 |
| | | String goodReputationEfficiency=weekDf.format((float)(iGuideRepairOrderService.countStatisticsNum(null,null,null,null,"1",null,null,null) |
| | | /(float)bj)); |
| | | entity.setGoodReputationEfficiency(goodReputationEfficiency); |
| | | |
| | | // 解决率=已解决状态的导办工单数量/已办结状态工单数量 |
| | | String resolveEfficiency=weekDf.format((float)(iGuideRepairOrderService.countStatisticsNum(null,null,null,null,null,null,"1",null) |
| | | /(float)bj)); |
| | | entity.setResolveEfficiency(resolveEfficiency); |
| | | |
| | | if(allNum!=0) |
| | | { |
| | | // 办结率=待评价+已办结状态的导办工单数量/总工单数量 |
| | | String workEfficiency=weekDf.format((float)((iGuideRepairOrderService.countStatisticsNum("4",null,null,null,null,null,null,null) |
| | | +bj)/(float)allNum)); |
| | | entity.setWorkEfficiency(workEfficiency); |
| | | } |
| | | } |
| | | |
| | | int cs=iGuideRepairOrderService.countStatisticsNum(null,null,null,"2",null,null,null,null); |
| | | if(cs!=0) |
| | | { |
| | | // 超时办结率=超时状态下的待评价+已办结状态的导办工单数量/超时状态的导办工单数量 |
| | | String timeoutEfficiency=weekDf.format((float)((iGuideRepairOrderService.countStatisticsNum("4",null,null,"2",null,null,null,null) |
| | | +iGuideRepairOrderService.countStatisticsNum("3",null,null,"2",null,null,null,null)) |
| | | /(float)cs)); |
| | | entity.setTimeoutEfficiency(timeoutEfficiency); |
| | | |
| | | } |
| | | |
| | | if(allNum!=0) |
| | | { |
| | | // 回复率=最新进展里大于0条回复的导办工单数量/总工单数量 |
| | | //状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6未解决 7已解决 8 系统自动分配 9 回复 10转派 11手动分配) |
| | | |
| | | String num=(homeStatisticsService.reversionRate("9",null)); |
| | | if(!StringUtils.isEmpty(num)) |
| | | { |
| | | String reversionRate=weekDf.format(Float.valueOf(num)/(float)allNum); |
| | | entity.setReversionRate(reversionRate); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | return ResultData.success(entity); |
| | | } |
| | | |
| | | @ApiOperation("工单 办事指南饼状图数据") |
| | | @GetMapping("/getPieChart") |
| | | public ResultData<PieChartAll> getPieChart() |
| | | { |
| | | PieChartAll pieChartAll=new PieChartAll(); |
| | | pieChartAll.setWorkOrderNum(iGuideRepairOrderService.countStatisticsNum("",null,null,null,null,null,null,null)+""); |
| | | pieChartAll.setFingerpostNum(homeStatisticsService.countStatisticsNum(null,null)+""); |
| | | List<PieChart> workOrderList=new ArrayList<>(); |
| | | List<PieChart> fingerpostList=new ArrayList<>(); |
| | | List<ClassifyAdministration> oneIds=homeStatisticsService.getClassify(null,"1"); |
| | | for (ClassifyAdministration oneClassify:oneIds) |
| | | { |
| | | PieChart workOrder=new PieChart(); |
| | | PieChart fingerpost=new PieChart(); |
| | | workOrder.setName(oneClassify.getClassifyName()); |
| | | fingerpost.setName(oneClassify.getClassifyName()); |
| | | List<ClassifyAdministration> twoIds = homeStatisticsService.getClassify(oneClassify.getId()+"",null); |
| | | |
| | | List clasIds=new ArrayList(); |
| | | |
| | | clasIds.add(oneClassify.getId()); |
| | | for (ClassifyAdministration classify:twoIds) |
| | | { |
| | | clasIds.add(classify.getId()); |
| | | } |
| | | int workOrderNum=0; |
| | | int fingerpostNum=0; |
| | | if(clasIds.size()>0) |
| | | { |
| | | workOrderNum=iGuideRepairOrderService.countStatisticsNum(null,null,null,null,null,clasIds,null,null); |
| | | fingerpostNum=homeStatisticsService.countStatisticsNum(clasIds,null); |
| | | } |
| | | workOrder.setNum(workOrderNum+""); |
| | | fingerpost.setNum(fingerpostNum+""); |
| | | workOrderList.add(workOrder); |
| | | fingerpostList.add(fingerpost); |
| | | } |
| | | |
| | | pieChartAll.setWorkOrderList(workOrderList); |
| | | pieChartAll.setFingerpostList(fingerpostList); |
| | | |
| | | return ResultData.success(pieChartAll); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("组织排行榜 type 1 安评价 2 按办结量") |
| | | @GetMapping("/getOrganization") |
| | | public TableDataInfo<OrganizationEntity> getOrganization(@RequestParam("type") String type) |
| | | { |
| | | List<OrganizationEntity> guidePlates=homeStatisticsService.getDepartment(); |
| | | |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | for (OrganizationEntity bean:guidePlates) |
| | | { |
| | | bean.setNum(0+""); |
| | | List<String> ids=iOrganizationChartService.getIds(bean.getId()+""); |
| | | |
| | | //总评分 |
| | | String scoreNum=homeStatisticsService.organizationScore(ids)+""; |
| | | int score=0; |
| | | if(!StringUtils.isEmpty(scoreNum) && !StringUtils.equals("null",scoreNum)) |
| | | { |
| | | score=Integer.valueOf(scoreNum); |
| | | } |
| | | |
| | | //总数量 |
| | | int allNum=homeStatisticsService.organizationNum(ids); |
| | | |
| | | if(allNum>0 && score>0) |
| | | { |
| | | java.text.DecimalFormat weekDf=new java.text.DecimalFormat("##.#");//传入格式模板 |
| | | String workEfficiency=weekDf.format((float)score/(float)allNum); |
| | | bean.setNum(workEfficiency); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (OrganizationEntity bean:guidePlates) |
| | | { |
| | | bean.setNum(0+""); |
| | | List<String> ids=iOrganizationChartService.getIds(bean.getId()+""); |
| | | //总数量 |
| | | int allNum=homeStatisticsService.organizationNum(ids); |
| | | if(allNum>0) |
| | | { |
| | | bean.setNum(allNum+""); |
| | | } |
| | | } |
| | | } |
| | | |
| | | OrganizationEntity entity=null; |
| | | for(int i = 0 ;i< guidePlates.size() -1; i++) { |
| | | for (int j = 0; j < guidePlates.size() - 1 - i; j++) { |
| | | |
| | | if(Float.valueOf(guidePlates.get(j).getNum())>Float.valueOf(guidePlates.get(j+1).getNum())) |
| | | { |
| | | entity=guidePlates.get(j); |
| | | guidePlates.set(j,guidePlates.get(j+1)); |
| | | guidePlates.set(j+1,entity); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Collections.reverse(guidePlates); |
| | | |
| | | return getDataTable(guidePlates,guidePlates.size()); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("导办人员排行榜 type 1 安评价 2 按办结量 3 按超时") |
| | | @GetMapping("/getGuidePlate") |
| | | public TableDataInfo<GuidePlate> getGuidePlate(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.staffNum(null); |
| | | |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | //安评价 |
| | | return getDataTable(homeStatisticsService.score(null),allNum); |
| | | } |
| | | else if(StringUtils.equals("2",type)) |
| | | { |
| | | //2 按办结量 |
| | | return getDataTable(homeStatisticsService.guidePlatePeople(null),allNum); |
| | | } |
| | | else |
| | | { |
| | | //3 按超时 |
| | | return getDataTable(homeStatisticsService.timeout(null),allNum); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation("办事指南排行榜 type 1 按浏览量 2 按办结量") |
| | | @GetMapping("/getGuidance") |
| | | public TableDataInfo<Guidance> getGuidance(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.countWork(null); |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceBrowse(null),allNum); |
| | | } |
| | | else |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceTransaction(null),allNum); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("导办工单按区域统计") |
| | | @GetMapping("/getRangeStatistics") |
| | | public TableDataInfo<RangeStatistics> getRangeStatistics() |
| | | { |
| | | List<AreaCode2022> code2022s=iAreaCodeService.getListByPCode("510400000000"); |
| | | |
| | | List<RangeStatistics> rangeStatistics=new ArrayList<>(); |
| | | |
| | | for (AreaCode2022 bean:code2022s) |
| | | { |
| | | RangeStatistics range=new RangeStatistics(); |
| | | range.setName(bean.getName()); |
| | | |
| | | List<String> ids; |
| | | |
| | | if(bean.getCode()==510401000000L) |
| | | { |
| | | ids=homeStatisticsService.countId(""); |
| | | } |
| | | else |
| | | { |
| | | ids=homeStatisticsService.countId(bean.getCode()+""); |
| | | } |
| | | int num=0; |
| | | if(ids!=null&&ids.size()>0) |
| | | { |
| | | num=homeStatisticsService.rangeStatistics(ids); |
| | | } |
| | | range.setNum(num+""); |
| | | rangeStatistics.add(range); |
| | | } |
| | | |
| | | |
| | | return getDataTable(rangeStatistics); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问",response = AppletUserCount.class) |
| | | @GetMapping("/selectUserRecordCount") |
| | | public ResultData selectUserRecordCount(){ |
| | | return iSysUserRecordService.selectUserRecordCount(); |
| | | } |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.近15天 2.近30天 3.近一年 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序用户访问量统计1.近15天 2.近30天 3.近一年",response = AppletUserCount.class) |
| | | @GetMapping("/selectByDateType") |
| | | public ResultData selectByDateType(@RequestParam("dateType") Integer dateType){ |
| | | return iSysUserRecordService.selectByDateType(dateType); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /*************************************************** 部门数据统计 start **********************************************************/ |
| | | |
| | | |
| | | @ApiOperation("部门数据根据选择的时间段 筛选导办工单数 timeType:1 本年度 15 近15天的 30 近30天的") |
| | | @GetMapping("/department/getSelectionTimeOrder") |
| | | public ResultData<CountList> getDepartmentOrder(@RequestParam("timeType") Integer timeType,@RequestParam("ids") List<String> ids) |
| | | { |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return ResultData.success(); |
| | | } |
| | | |
| | | if(timeType<1) |
| | | { |
| | | return ResultData.error("请输入时间"); |
| | | } |
| | | |
| | | if(timeType==1) |
| | | { |
| | | Calendar calendar=Calendar.getInstance(); |
| | | timeType=calendar.get(Calendar.DAY_OF_YEAR); |
| | | } |
| | | // System.out.println(timeType); |
| | | //1 本年度 15 近15天的 30 近30天的 |
| | | List<CountListNum> listOne=iGuideRepairOrderService.countListNum("2",ids,timeType); |
| | | List<CountListNum> listTwo=iGuideRepairOrderService.countListNum("3",ids,timeType); |
| | | CountList countList=new CountList(); |
| | | countList.setWaitDealWithList(listOne); |
| | | countList.setHaveDealWith(listTwo); |
| | | return ResultData.success(countList); |
| | | } |
| | | |
| | | @ApiOperation("部门数据首页统计不同时间段的工单数量") |
| | | @GetMapping("/department/getTimeWorkOrder") |
| | | public ResultData<TimeWorkOrder> getDepartmentTimeWorkOrder(@RequestParam("ids") List<String> ids) |
| | | { |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return ResultData.success(); |
| | | } |
| | | |
| | | |
| | | //1 今天 2昨天 3本月 4本年度 |
| | | //累计全部 本年 本月 今日 昨日 |
| | | TimeWorkOrder timeWorkOrder=new TimeWorkOrder(); |
| | | timeWorkOrder.setAllNum(iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,null,null,null)); |
| | | timeWorkOrder.setYearNum(iGuideRepairOrderService.countStatisticsNum(null,ids,"4",null,null,null,null,null)); |
| | | timeWorkOrder.setMonthNum(iGuideRepairOrderService.countStatisticsNum(null,ids,"3",null,null,null,null,null)); |
| | | timeWorkOrder.setTodayNum(iGuideRepairOrderService.countStatisticsNum(null,ids,"1",null,null,null,null,null)); |
| | | timeWorkOrder.setYesterdayNum(iGuideRepairOrderService.countStatisticsNum(null,ids,"2",null,null,null,null,null)); |
| | | return ResultData.success(timeWorkOrder); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("部门数据首页统计不同状态工单数") |
| | | @GetMapping("/department/getWorkOrder") |
| | | public ResultData<WorkOrder> getDepartmentWorkOrder(@RequestParam("ids") List<String> ids) |
| | | { |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return ResultData.success(); |
| | | } |
| | | WorkOrder workOrder=new WorkOrder(); |
| | | //状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消) |
| | | workOrder.setAllNum(iGuideRepairOrderService.countStatisticsNum("",ids,null,null,null,null,null,null)); |
| | | workOrder.setWaitDistribution(iGuideRepairOrderService.countStatisticsNum("1",ids,null,null,null,null,null,null)); |
| | | workOrder.setWaitDealWith(iGuideRepairOrderService.countStatisticsNum("2",ids,null,null,null,null,null,null)); |
| | | workOrder.setHaveDealWith(iGuideRepairOrderService.countStatisticsNum("3",ids,null,null,null,null,null,null)); |
| | | workOrder.setRemainEvaluated(iGuideRepairOrderService.countStatisticsNum("4",ids,null,null,null,null,null,null)); |
| | | workOrder.setCanceled(iGuideRepairOrderService.countStatisticsNum("5",ids,null,null,null,null,null,null)); |
| | | // //服务状态(1.已解决 2.未解决) |
| | | workOrder.setUnsolved(iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,null,"2",null)); |
| | | workOrder.setResolved(iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,null,"1",null)); |
| | | |
| | | //是否超时 (1 未超时 2已超时) 超时未办结 |
| | | workOrder.setOvertime(iGuideRepairOrderService.countStatisticsNum(null,ids,null,"2",null,null,null,null)); |
| | | // 超时未办结 |
| | | workOrder.setOvertimeWaitDealWith(iGuideRepairOrderService.countStatisticsNum("2",ids,null,"2",null,null,null,null)); |
| | | return ResultData.success(workOrder); |
| | | } |
| | | |
| | | @ApiOperation("部门数据获取效率比值") |
| | | @GetMapping("/department/getEfficiency") |
| | | public ResultData<EfficiencyEntity> getDepartmentEfficiency(@RequestParam("ids") List<String> ids) |
| | | { |
| | | |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return ResultData.success(); |
| | | } |
| | | |
| | | EfficiencyEntity entity=new EfficiencyEntity(); |
| | | //总工单数 |
| | | int allNum=iGuideRepairOrderService.countStatisticsNum("",ids,null,null,null,null,null,null); |
| | | |
| | | java.text.DecimalFormat weekDf=new java.text.DecimalFormat("##.##%");//传入格式模板 |
| | | |
| | | int bj=iGuideRepairOrderService.countStatisticsNum("3",ids,null,null,null,null,null,null); |
| | | if(bj!=0) |
| | | { |
| | | // 好评率=评价为满意的导办工单数量/已办结状态工单数量 |
| | | String goodReputationEfficiency=weekDf.format((float)(iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,"1",null,null,null) |
| | | /(float)bj)); |
| | | entity.setGoodReputationEfficiency(goodReputationEfficiency); |
| | | |
| | | // 解决率=已解决状态的导办工单数量/已办结状态工单数量 |
| | | String resolveEfficiency=weekDf.format((float)(iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,null,"1",null) |
| | | /(float)bj)); |
| | | entity.setResolveEfficiency(resolveEfficiency); |
| | | |
| | | if(allNum!=0) |
| | | { |
| | | // 办结率=待评价+已办结状态的导办工单数量/总工单数量 |
| | | String workEfficiency=weekDf.format((float)((iGuideRepairOrderService.countStatisticsNum("4",ids,null,null,null,null,null,null) |
| | | +bj)/(float)allNum)); |
| | | entity.setWorkEfficiency(workEfficiency); |
| | | } |
| | | } |
| | | |
| | | int cs=iGuideRepairOrderService.countStatisticsNum(null,ids,null,"2",null,null,null,null); |
| | | if(cs!=0) |
| | | { |
| | | // 超时办结率=超时状态下的待评价+已办结状态的导办工单数量/超时状态的导办工单数量 |
| | | String timeoutEfficiency=weekDf.format((float)((iGuideRepairOrderService.countStatisticsNum("4",ids,null,"2",null,null,null,null) |
| | | +iGuideRepairOrderService.countStatisticsNum("3",ids,null,"2",null,null,null,null)) |
| | | /(float)cs)); |
| | | entity.setTimeoutEfficiency(timeoutEfficiency); |
| | | |
| | | } |
| | | |
| | | if(allNum!=0) |
| | | { |
| | | // 回复率=最新进展里大于0条回复的导办工单数量/总工单数量 |
| | | //状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6未解决 7已解决 8 系统自动分配 9 回复 10转派 11手动分配) |
| | | |
| | | String num=(homeStatisticsService.reversionRate("9",null)); |
| | | if(!StringUtils.isEmpty(num)) |
| | | { |
| | | String reversionRate=weekDf.format(Float.valueOf(num)/(float)allNum); |
| | | entity.setReversionRate(reversionRate); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | return ResultData.success(entity); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("部门数据 工单 办事指南饼状图数据") |
| | | @GetMapping("/department/getPieChart") |
| | | public ResultData<PieChartAll> getDepartmentPieChart(@RequestParam("ids") List<String> ids) |
| | | { |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return ResultData.success(); |
| | | } |
| | | |
| | | PieChartAll pieChartAll=new PieChartAll(); |
| | | pieChartAll.setWorkOrderNum(iGuideRepairOrderService.countStatisticsNum("",ids,null,null,null,null,null,null)+""); |
| | | pieChartAll.setFingerpostNum(homeStatisticsService.countStatisticsNum(null,ids)+""); |
| | | List<PieChart> workOrderList=new ArrayList<>(); |
| | | List<PieChart> fingerpostList=new ArrayList<>(); |
| | | List<ClassifyAdministration> oneIds=homeStatisticsService.getClassify(null,"1"); |
| | | for (ClassifyAdministration oneClassify:oneIds) |
| | | { |
| | | PieChart workOrder=new PieChart(); |
| | | PieChart fingerpost=new PieChart(); |
| | | workOrder.setName(oneClassify.getClassifyName()); |
| | | fingerpost.setName(oneClassify.getClassifyName()); |
| | | List<ClassifyAdministration> twoIds = homeStatisticsService.getClassify(oneClassify.getId()+"",null); |
| | | |
| | | List clasIds=new ArrayList(); |
| | | |
| | | clasIds.add(oneClassify.getId()); |
| | | for (ClassifyAdministration classify:twoIds) |
| | | { |
| | | clasIds.add(classify.getId()); |
| | | } |
| | | int workOrderNum=0; |
| | | int fingerpostNum=0; |
| | | if(clasIds.size()>0) |
| | | { |
| | | workOrderNum=iGuideRepairOrderService.countStatisticsNum(null,ids,null,null,null,clasIds,null,null); |
| | | fingerpostNum=homeStatisticsService.countStatisticsNum(clasIds,ids); |
| | | } |
| | | workOrder.setNum(workOrderNum+""); |
| | | fingerpost.setNum(fingerpostNum+""); |
| | | workOrderList.add(workOrder); |
| | | fingerpostList.add(fingerpost); |
| | | } |
| | | |
| | | pieChartAll.setWorkOrderList(workOrderList); |
| | | pieChartAll.setFingerpostList(fingerpostList); |
| | | |
| | | return ResultData.success(pieChartAll); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("部门数据导办人员排行榜 type 1 安评价 2按工单量 3按办结量 4 按未办结量 5 按超时") |
| | | @GetMapping("/department/getGuidePlate") |
| | | public TableDataInfo<GuidePlate> getDepartmentGuidePlate(@RequestParam("type") String type,@RequestParam("ids") List<String> ids) |
| | | { |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return getDataTable(new ArrayList<>()); |
| | | } |
| | | |
| | | int allNum=homeStatisticsService.staffNum(ids); |
| | | |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | //安评价 |
| | | return getDataTable(homeStatisticsService.score(ids),allNum); |
| | | } |
| | | else if(StringUtils.equals("2",type)) |
| | | { |
| | | //2按工单量 |
| | | return getDataTable(homeStatisticsService.workunit(ids),allNum); |
| | | } |
| | | else if(StringUtils.equals("3",type)) |
| | | { |
| | | //3 按办结量 |
| | | return getDataTable(homeStatisticsService.guidePlatePeople(ids),allNum); |
| | | } |
| | | else if(StringUtils.equals("4",type)) |
| | | { |
| | | //4按未办结量 |
| | | return getDataTable(homeStatisticsService.tosettled(ids),allNum); |
| | | } |
| | | else |
| | | { |
| | | //5 按超时 |
| | | return getDataTable(homeStatisticsService.timeout(ids),allNum); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("部门数据办事指南排行榜 type 1 按浏览量 2 按办结量") |
| | | @GetMapping("/department/getGuidance") |
| | | public TableDataInfo<Guidance> getDepartmentGuidance(@RequestParam("type") String type,@RequestParam("ids") List<String> ids) |
| | | { |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | return getDataTable(new ArrayList<>()); |
| | | } |
| | | |
| | | int allNum=homeStatisticsService.countWork(ids); |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceBrowse(ids),allNum); |
| | | } |
| | | else |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceTransaction(ids),allNum); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /*************************************************** 部门数据统计 end **********************************************************/ |
| | | |
| | | |
| | | /** |
| | | * 统计访问量 |
| | | * @return |
| | | */ |
| | | @ApiOperation("统计访问量") |
| | | @GetMapping("/countSmartConsulting") |
| | | public ResultData countSmartConsulting(){ |
| | | return ResultData.success(iAutomessageSmartConsultingService.countSmartConsulting()) ; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
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.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") |
| | | @Authorization |
| | | 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") |
| | | @Authorization |
| | | 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") |
| | | @Authorization |
| | | 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") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody KeywordEntity entity) |
| | | { |
| | | return toAjax(iKeywordService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除关键词 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("关键词删除接口") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | 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.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.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Api(tags = {"组织架构接口"}) |
| | | @RestController |
| | | @RequestMapping("/organization") |
| | | public class OrganizationController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | @Autowired(required = true) |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | @ApiOperation(value = "查询机构列表",response = OrganizationChartEntity.class) |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList() |
| | | { |
| | | return getDataTable(iOrganizationChartService.selectConfigList("","",null)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(权限) |
| | | */ |
| | | @ApiOperation(value = "查询机构列表(权限 选择用 ) ",response = OrganizationChartEntity.class) |
| | | @GetMapping("/selectJurisdiction") |
| | | @Authorization |
| | | public TableDataInfo selectJurisdiction(@CurrentUser SysUser sysUser) |
| | | { |
| | | return getDataTable(iOrganizationChartService.selectConfigList(sysUser.getDepartmentId(),"",null)); |
| | | } |
| | | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | @ApiOperation(value = "新增机构",response = OrganizationChartEntity.class) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | 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(value = "更新机构",response = OrganizationChartEntity.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity,@CurrentUser SysUser sysUser) |
| | | { |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setUpdateUserId(sysUser.getUserId()); |
| | | return toAjax(iOrganizationChartService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除机构 |
| | | */ |
| | | @ApiOperation("删除机构") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | List<OrganizationChartEntity> list=iOrganizationChartService.selectParentList(Id,""); |
| | | |
| | | if(list!=null && list.size()>0) |
| | | { |
| | | return ResultData.error("该机构下存在其他部门!请先删除子部门"); |
| | | } |
| | | |
| | | List<String> ids=new ArrayList<>(); |
| | | ids.add(Id); |
| | | List<TransactionEvent> transactionEvents=iTransactionEventService.selectConfigList(null,null,ids); |
| | | |
| | | if(transactionEvents!=null && transactionEvents.size()>0) |
| | | { |
| | | return ResultData.error("该机构下已绑定办事指南!请解绑办事指南"); |
| | | } |
| | | 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)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | @ApiOperation(value = "查询机构列表(分页)(部门应用)",response = OrganizationChartEntity.class) |
| | | @GetMapping("/queryList") |
| | | @Authorization |
| | | public TableDataInfo queryList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "organizationName",required = false)String organizationName, |
| | | @CurrentUser SysUser sysUser){ |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<OrganizationChartEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<String> ids= PermissionUtil.getPermission(sysUser,iOrganizationChartService); |
| | | return getDataTable(iOrganizationChartService.queryList(pageParam,pageSize,organizationName,ids), |
| | | iOrganizationChartService.countList(organizationName,ids)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过父级id查询对应机构下的全部部门id |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "通过父级id查询对应机构下的全部部门") |
| | | @GetMapping("/getdepartment/id") |
| | | public TableDataInfo getOrganizationIds(@RequestParam(value = "department",required = false) String departmentId) |
| | | { |
| | | if(StringUtils.isEmpty(departmentId)) |
| | | { |
| | | return getDataTable("departmentId 不能为空"); |
| | | } |
| | | |
| | | List<String> ids=new ArrayList<>(); |
| | | List<String> getId=iOrganizationChartService.getIds(departmentId); |
| | | ids.addAll(getId); |
| | | return getDataTable(ids); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过父级id查询对应机构下的全部部门 |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "通过父级id查询对应机构下的全部部门",response = OrganizationChartEntity.class) |
| | | @GetMapping("/getdepartment") |
| | | public TableDataInfo getOrganizations(@RequestParam(value = "department",required = false) String departmentId) |
| | | { |
| | | List<OrganizationChartEntity> ids=new ArrayList<>(); |
| | | List<OrganizationChartEntity> lists=null; |
| | | if(StringUtils.isEmpty(departmentId)) |
| | | { |
| | | lists= iOrganizationChartService.selectParentList(null,"1"); |
| | | |
| | | } |
| | | else |
| | | { |
| | | lists= iOrganizationChartService.selectParentList(departmentId,null); |
| | | } |
| | | |
| | | if(lists.size()<1) |
| | | { |
| | | lists.add(iOrganizationChartService.selectConfigById(departmentId)); |
| | | } |
| | | ids=disposestreet(lists); |
| | | if(ids.size()<1) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(departmentId)) |
| | | { |
| | | ids.add(iOrganizationChartService.selectConfigById(departmentId)); |
| | | } |
| | | |
| | | return getDataTable(ids); |
| | | } |
| | | |
| | | //递归取id |
| | | private List<OrganizationChartEntity> disposestreet(List<OrganizationChartEntity> lists) |
| | | { |
| | | List<OrganizationChartEntity> ids=new ArrayList<>(); |
| | | for (OrganizationChartEntity sysStreet:lists) |
| | | { |
| | | if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) |
| | | { |
| | | ids.addAll(disposestreet(sysStreet.getChild())); |
| | | } |
| | | else |
| | | { |
| | | ids.add(sysStreet); |
| | | } |
| | | } |
| | | return ids; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | @ApiOperation(value = "查询可切换机构列表",response = OrganizationChartEntity.class) |
| | | @GetMapping("switch/getList") |
| | | @Authorization |
| | | public TableDataInfo switchGetList(@CurrentUser SysUser sysUser) |
| | | { |
| | | List<String> ids=new ArrayList<>(); |
| | | if(!StringUtils.isEmpty(sysUser.getMoreDepartmentIds())) |
| | | { |
| | | if(sysUser.getMoreDepartmentIds().indexOf(",")==-1) |
| | | { |
| | | ids.add(sysUser.getDepartmentId()); |
| | | } |
| | | else |
| | | { |
| | | String[] list=sysUser.getMoreDepartmentIds().split(","); |
| | | for (String id:list) |
| | | { |
| | | ids.add(id); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ids.add(sysUser.getDepartmentId()); |
| | | } |
| | | |
| | | return getDataTable(iOrganizationChartService.selectConfigList(ids)); |
| | | } |
| | | } |
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.IOrganizationChartService; |
| | | import com.dg.core.service.IReplyTemplateService; |
| | | import com.dg.core.util.PermissionUtil; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"回复模板接口"}) |
| | | @RestController |
| | | @RequestMapping("/reply") |
| | | public class ReplyTemplateController extends BaseController |
| | | { |
| | | |
| | | @Autowired |
| | | IReplyTemplateService iReplyTemplateService; |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | |
| | | /** |
| | | * 获取模板列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取模板列表") |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String Name, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Page<ReplyTemplateEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<String> ids=PermissionUtil.getStairDepartment(sysUser,iOrganizationChartService); |
| | | List<ReplyTemplateEntity> list; |
| | | if (sysUser.getUserType().equals("1")||sysUser.getIsDivisionHead().equals("1")){ |
| | | list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids,null); |
| | | } |
| | | else { |
| | | list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids,sysUser.getUserId()); |
| | | } |
| | | int num=iReplyTemplateService.countNum(Name,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取详情") |
| | | @GetMapping("/getdata") |
| | | @Authorization |
| | | 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("模板名称不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getDepartmentId())) |
| | | { |
| | | return ResultData.error("部门id不能为空 请分配部门id"); |
| | | } |
| | | |
| | | List<String> ids=iOrganizationChartService.getIds(entity.getDepartmentId()); |
| | | int num=iReplyTemplateService.countNum(entity.getName(),ids); |
| | | |
| | | if(num>0) |
| | | { |
| | | return ResultData.error("部门里办事名称重复!"); |
| | | } |
| | | |
| | | entity.setId(null); |
| | | entity.setDepartmentId(entity.getDepartmentId()); |
| | | entity.setCreateUserId(sysUser.getUserId()+""); |
| | | |
| | | return toAjax(iReplyTemplateService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 更新模板 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("更新模板") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | 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") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | return toAjax(iReplyTemplateService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 复制模板 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("复制模板") |
| | | @PostMapping("/copy") |
| | | @Authorization |
| | | public ResultData copy(@RequestParam(value = "Id",required = false) String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("Id不能为空"); |
| | | } |
| | | |
| | | ReplyTemplateEntity entity=iReplyTemplateService.selectConfigData(Id); |
| | | |
| | | if(entity==null) |
| | | { |
| | | return ResultData.error("模板不存在!"); |
| | | } |
| | | entity.setCreateUserId(sysUser.getUserId()); |
| | | entity.setName(entity.getName()+"(副本)"); |
| | | 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.Authorization; |
| | | 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.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.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") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String name) |
| | | { |
| | | if(pageNum==null) |
| | | { |
| | | return getDataTable("分页不能为空"); |
| | | } |
| | | if(pageSize==null) |
| | | { |
| | | return getDataTable("分页条数不能为空"); |
| | | } |
| | | |
| | | Page<RoleManagementEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | List<RoleManagementEntity> list = iRoleManagementService.selectConfigList(pageParam,pageSize,name); |
| | | |
| | | int num=iRoleManagementService.countNum(name); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 新增角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增角色") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody RoleManagementEntity entity, @CurrentUser SysUser sysUser) |
| | | { |
| | | entity.setCreateUserId(sysUser.getUserId()+""); |
| | | return toAjax(iRoleManagementService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑角色 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("编辑角色") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody RoleManagementEntity entity,@CurrentUser SysUser sysUser) |
| | | { |
| | | entity.setUpdateUserId(sysUser.getUserId()+""); |
| | | return toAjax(iRoleManagementService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除角色 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | 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.annotation.Authorization; |
| | | 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") |
| | | @Authorization |
| | | public ResultData update(@RequestBody Slideshow slideshow){ |
| | | return iSlideshowService.update(slideshow); |
| | | } |
| | | |
| | | /** |
| | | * 删除轮播图数据 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation(value = "删除轮播图数据",response = Slideshow.class) |
| | | @GetMapping("/delete") |
| | | @Authorization |
| | | public ResultData delete(@RequestParam("id") Integer id){ |
| | | return iSlideshowService.delete(id); |
| | | } |
| | | |
| | | } |
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.AutomessageSysSettings; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.ISysSettingsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Api(tags = {"系统设置接口"}) |
| | | @RestController |
| | | @RequestMapping("/sysSettings") |
| | | public class SysSettingsController { |
| | | |
| | | @Resource |
| | | private ISysSettingsService sysSettingsService; |
| | | |
| | | /** |
| | | * 按设置名称查找设置信息 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation(value = "按设置名称查找设置信息",response = AutomessageSysSettings.class) |
| | | @GetMapping("/selectByName") |
| | | @Authorization |
| | | public ResultData selectByName(@RequestParam(value = "settingName",required = false) String settingName){ |
| | | if (settingName==null) |
| | | settingName="系统超时基础设置"; |
| | | return sysSettingsService.selectByName(settingName); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改设置信息 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation(value = "修改设置信息",response = AutomessageSysSettings.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData update(@RequestBody AutomessageSysSettings automessageSysSettings,@CurrentUser SysUser sysUser){ |
| | | automessageSysSettings.setUpdateUserId(sysUser.getUserId()); |
| | | automessageSysSettings.setUpdateTime(LocalDateTime.now()); |
| | | if (automessageSysSettings.getTimeoutRemindNum()>(automessageSysSettings.getTimeoutNotificationNum()*60)){ |
| | | return ResultData.error("系统提醒时间不能大于系统通知时间*60"); |
| | | } |
| | | return sysSettingsService.update(automessageSysSettings); |
| | | } |
| | | |
| | | |
| | | } |
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.AjaxResult; |
| | | import com.dg.core.db.gen.entity.AutomessageSmartConsulting; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | 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.file.FtpConstants; |
| | | import com.dg.core.file.MimeTypeUtils; |
| | | import com.dg.core.file.SFTPUtil; |
| | | import com.dg.core.service.IAutomessageSmartConsultingService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | 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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.InputStream; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | import static com.dg.core.file.FileTypeUploadUtils.assertAllowed; |
| | | |
| | | @Api(tags = {"导办事项管理接口"}) |
| | | @RestController |
| | | @RequestMapping("/transaction") |
| | | public class TransactionEventController extends BaseController |
| | | { |
| | | |
| | | @Autowired(required = true) |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | |
| | | @Autowired(required = true) |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | @Autowired(required = true) |
| | | IAutomessageSmartConsultingService iAutomessageSmartConsultingService; |
| | | |
| | | /** |
| | | * 查询导办事务详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("查询导办事务详情") |
| | | @GetMapping("/getData") |
| | | |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | return ResultData.success(iTransactionEventService.selectConfigData(Id,sysUser)); |
| | | } |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation("导办事物列表") |
| | | @GetMapping("/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "keyword",required = false) String keyword, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade, |
| | | @RequestParam(value = "departmentId",required = false) String departmentId, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Page<TransactionEvent> pageParam = new Page<>(pageNum,pageSize); |
| | | List<TransactionEvent> list; |
| | | int num; |
| | | if (departmentId!=null&&departmentId.length()>0){ |
| | | List<String> ids=iOrganizationChartService.getDepartmentId(departmentId); |
| | | list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | classifyGrade,ids); |
| | | num=iTransactionEventService.countNum(keyword,classifyGrade,ids); |
| | | |
| | | }else { |
| | | list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | classifyGrade,null); |
| | | num=iTransactionEventService.countNum(keyword,classifyGrade,null); |
| | | } |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation("根据部门id获取导办事物列表") |
| | | @PostMapping("/department/getList") |
| | | @Authorization |
| | | public TableDataInfo<TransactionEvent> selectConfigList(@RequestBody List<String> DepartmentId, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | if(DepartmentId==null||DepartmentId.size()<1) |
| | | { |
| | | DepartmentId=null; |
| | | } |
| | | List<TransactionEvent> list = iTransactionEventService.selectConfigList(null,null,DepartmentId); |
| | | int num=iTransactionEventService.countNum(null,null,DepartmentId); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 导办事物列表(不分页) |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导办事物列表(不分页)",response = TransactionEvent.class) |
| | | @GetMapping("/selectList") |
| | | public TableDataInfo selectList(@RequestParam(value = "keyWord",required = false) String keyWord) |
| | | { |
| | | return getDataTable(iTransactionEventService.selectList(keyWord)); |
| | | } |
| | | |
| | | /** |
| | | * 新增导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("新增导办事务") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | if(StringUtils.isEmpty(entity.getDepartmentId())) |
| | | { |
| | | return ResultData.error("部门id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getMatterName())) |
| | | { |
| | | return ResultData.error("事件名称不能为空"); |
| | | } |
| | | |
| | | String id=iTransactionEventService.selectDataIfExist(entity.getDepartmentId(),entity.getMatterName()); |
| | | if(!StringUtils.isEmpty(id)) |
| | | { |
| | | return ResultData.error("事件名称已存在"); |
| | | } |
| | | |
| | | return toAjax(iTransactionEventService.insertConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 修改导办事务 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("修改导办事务") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | if(StringUtils.isEmpty(entity.getDepartmentId())) |
| | | { |
| | | return ResultData.error("部门id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getMatterName())) |
| | | { |
| | | return ResultData.error("事件名称不能为空"); |
| | | } |
| | | |
| | | |
| | | |
| | | return toAjax(iTransactionEventService.updateConfig(entity)); |
| | | } |
| | | |
| | | /** |
| | | * 删除接口 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除导办事务") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | int i = iTransactionEventService.deleteConfigById(Id); |
| | | if (i>0) |
| | | return ResultData.success("删除成功"); |
| | | else |
| | | return ResultData.error("删除失败可能该工单有单据"); |
| | | } |
| | | |
| | | /** |
| | | * 导办事务搜索 |
| | | * @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; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据分类id查询导办事务(分页) |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据分类id查询导办事务(分页)",response = TransactionEvent.class) |
| | | @GetMapping("/queryByClassifyIdConfigList") |
| | | public TableDataInfo queryByClassifyIdConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "classifyId",required = false) String classifyId, |
| | | @RequestParam(required = false,name="departmentId") Integer departmentId){ |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Page<TransactionEvent> pageParam = new Page<>(pageNum,pageSize); |
| | | return getDataTable(iTransactionEventService.queryByClassifyIdList(pageParam,pageSize,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,@CurrentUser SysUser sysUser){ |
| | | AutomessageSmartConsulting automessageSmartConsulting = new AutomessageSmartConsulting(); |
| | | if (sysUser!=null){ |
| | | automessageSmartConsulting.setCreateUserId(sysUser.getUserId()); |
| | | } |
| | | automessageSmartConsulting.setType(2); |
| | | automessageSmartConsulting.setCreateTime(LocalDateTime.now()); |
| | | iAutomessageSmartConsultingService.add(automessageSmartConsulting); |
| | | return iTransactionEventService.smartConsulting(keyWord); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 办事指南复制 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "办事指南复制",response = ResultData.class) |
| | | @GetMapping("/copy") |
| | | @Authorization |
| | | public ResultData copy(@RequestParam("Id") String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("Id不能为空"); |
| | | } |
| | | |
| | | TransactionEvent transactionEvent=iTransactionEventService.selectConfigData(Id,null); |
| | | if(transactionEvent==null) |
| | | { |
| | | return ResultData.error("复制项不存在"); |
| | | } |
| | | |
| | | transactionEvent.setDepartmentId(sysUser.getDepartmentId()); |
| | | transactionEvent.setMatterName(transactionEvent.getMatterName()+"(副本)"); |
| | | |
| | | transactionEvent.setId(null); |
| | | return toAjax(iTransactionEventService.insertConfig(transactionEvent)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 办事指南根据分类id筛选 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "办事指南根据分类id筛选",response = ResultData.class) |
| | | @GetMapping("/selectClassifyList") |
| | | @Authorization |
| | | public TableDataInfo<TransactionEvent> selectClassifyList(@RequestParam("ids") List<String> ids) |
| | | { |
| | | if(ids==null || ids.size()<1) |
| | | { |
| | | ids=null; |
| | | } |
| | | return getDataTable(iTransactionEventService.selectClassifyList(ids)); |
| | | } |
| | | |
| | | @ApiOperation("文件导入") |
| | | @PostMapping("/import") |
| | | public ResultData uploadFiles(MultipartFile file) throws Exception |
| | | { |
| | | boolean a = false; |
| | | String fileName = file.getOriginalFilename(); |
| | | Integer b = iTransactionEventService.batchImport(fileName, file); |
| | | if (b == 3) {// |
| | | return ResultData.success("全部导入成功");//全部导入成功 |
| | | } else if (b == 2) { |
| | | return ResultData.success("部分导入成功");//部分导入成功 |
| | | } else if (b == 0) { |
| | | return ResultData.error("部分失败");//导入失败 |
| | | } |
| | | return ResultData.error("部分失败");//导入失败 |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
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.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.Snowflake; |
| | | 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 |
| | | SmsUtil smsUtil; |
| | | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @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=null; |
| | | //管理员登录 |
| | | user= IUserService.getUserByAccount(account); |
| | | |
| | | if(user==null) |
| | | { |
| | | List<HuaChengSysUser> list=iHuaChengSysUserService.selectData("",account,""); |
| | | HuaChengSysUser huaChengSysUser=null; |
| | | |
| | | if(list!=null && list.size()>0 ) |
| | | { |
| | | huaChengSysUser=list.get(0); |
| | | } |
| | | |
| | | if(huaChengSysUser==null || !password.equals(huaChengSysUser.getPassword())) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "用户名或密码错误"); |
| | | } |
| | | |
| | | //本地表查询用户 |
| | | user = IUserService.selectData(huaChengSysUser.getUserId()+"",null,null); |
| | | if (user == null) { |
| | | //本地没有此用户 新用户 |
| | | SysUser newSysUser=new SysUser(); |
| | | //默认 1系统后台用户 |
| | | newSysUser.setUserType("3"); |
| | | newSysUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newSysUser.setUserId(huaChengSysUser.getUserId()); |
| | | newSysUser.setUserName(huaChengSysUser.getNickName()); |
| | | newSysUser.setSex(huaChengSysUser.getSex()); |
| | | newSysUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newSysUser.setCreateTime(LocalDateTime.now()); |
| | | newSysUser.setUpdateTime(LocalDateTime.now()); |
| | | newSysUser.setOpenid(huaChengSysUser.getOpenid()); |
| | | IUserService.insertConfig(newSysUser); |
| | | } |
| | | |
| | | user = IUserService.selectData(huaChengSysUser.getUserId()+"",null,null); |
| | | |
| | | if (user == null) { |
| | | return ResultData.error("用户不存在!请联系管理员"); |
| | | } |
| | | |
| | | String token = tokenManager.getTokenByUserId(user.getUserId()); |
| | | 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()); |
| | | map.put("permission", user.getPermission()); |
| | | map.put("userType", user.getUserType()); |
| | | map.put("departmentId", user.getDepartmentId()); |
| | | map.put("departmentName", user.getDepartmentName()); |
| | | map.put("moreDepartmentIds", user.getMoreDepartmentIds()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | else |
| | | { |
| | | if(StringUtils.equals("4",user.getUserType())) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "账户不存在"); |
| | | } |
| | | |
| | | if(!password.equals(user.getPassword())) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "用户名或密码错误"); |
| | | } |
| | | String token = tokenManager.getTokenByUserId(user.getUserId()); |
| | | 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()); |
| | | map.put("permission", user.getPermission()); |
| | | map.put("userType", user.getUserType()); |
| | | map.put("departmentId", user.getDepartmentId()); |
| | | map.put("departmentName", user.getDepartmentName()); |
| | | map.put("moreDepartmentIds", user.getMoreDepartmentIds()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("发送登录短信验证码") |
| | | @PostMapping(value = "/sendSms", consumes = "application/json") |
| | | public ResultData smsSend(@RequestBody SysUser user) { |
| | | return IUserService.smsSend(user); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("账号密码验证登录") |
| | | @GetMapping(value = "/loginByAccount") |
| | | public ResultData loginByAccount(@RequestParam String phonenumber,@RequestParam String code) { |
| | | return IUserService.loginByAccount(phonenumber,code); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("通过手机号获取用户信息 登录") |
| | | @PostMapping(value = "/loginPhionne") |
| | | public ResultData loginPhionne(@RequestParam String phonenumber) |
| | | { |
| | | if(StringUtils.isEmpty(phonenumber)) |
| | | { |
| | | return ResultData.error("请输入手机号"); |
| | | } |
| | | return IUserService.loginByPhonenumber(phonenumber); |
| | | } |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | @ApiOperation("用户列表接口") |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "keyword",required = false) String keyword) |
| | | { |
| | | 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,null,keyword,null,"1"); |
| | | |
| | | int num=IUserService.selectNum(null,keyword,null,"1"); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增用户 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation("新增用户接口") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody SysUser config, @CurrentUser SysUser sysUser) |
| | | { |
| | | 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("昵称不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getPhonenumber())) |
| | | { |
| | | return error("手机号不能为空"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | SysUser user = IUserService.selectData("",config.getPhonenumber(),""); |
| | | SysUser user2 = IUserService.selectData("","",config.getLoginName()); |
| | | if (user != null) { |
| | | if(StringUtils.equals("4",user.getUserType())) |
| | | { |
| | | config.setUserId(user.getUserId()); |
| | | config.setCreateBy(user.getUserId()+""); |
| | | config.setUserType("3"); |
| | | config.setIsDivisionHead("1"); |
| | | config.setUpdateTime(LocalDateTime.now()); |
| | | config.setMasterIds(user2.getMasterIds()); |
| | | config.setDepartmentIds(config.getDepartmentIds()); |
| | | config.setDepartmentIdStr(config.getDepartmentIdStr()); |
| | | config.setMattersIds(config.getMattersIds()); |
| | | config.setMasterNames(config.getMasterNames()); |
| | | config.setMattersNames(config.getMattersNames()); |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | else |
| | | { |
| | | //提示用户名或密码错误 |
| | | return error("该用户已存在!"); |
| | | } |
| | | } |
| | | |
| | | if(user2 != null) |
| | | { |
| | | if(StringUtils.equals("4",user2.getUserType())) |
| | | { |
| | | config.setUserId(user2.getUserId()); |
| | | config.setCreateBy(user2.getUserId()+""); |
| | | config.setUserType("3"); |
| | | config.setIsDivisionHead("1"); |
| | | config.setUpdateTime(LocalDateTime.now()); |
| | | config.setMasterIds(user2.getMasterIds()); |
| | | config.setDepartmentIds(config.getDepartmentIds()); |
| | | config.setDepartmentIdStr(config.getDepartmentIdStr()); |
| | | config.setMattersIds(config.getMattersIds()); |
| | | config.setMasterNames(config.getMasterNames()); |
| | | config.setMattersNames(config.getMattersNames()); |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | else |
| | | { |
| | | //提示用户名或密码错误 |
| | | return error("该用户已存在!"); |
| | | } |
| | | } |
| | | |
| | | config.setCreateBy(sysUser.getUserId()+""); |
| | | config.setUserId(Snowflake.getId()+""); |
| | | config.setUserType("3"); |
| | | config.setIsDivisionHead("1"); |
| | | config.setMoreDepartmentIds(config.getDepartmentId()); |
| | | 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,@CurrentUser SysUser sys) |
| | | { |
| | | if(config.getId()==null) |
| | | { |
| | | return error("Id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | | { |
| | | return error("账户不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getDepartmentId())) |
| | | { |
| | | return error("请选择部门"); |
| | | } |
| | | |
| | | config.setMoreDepartmentIds(config.getDepartmentId()); |
| | | config.setPassword(null); |
| | | config.setUpdateBy(sys.getUserId()+""); |
| | | |
| | | 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.selectData(userId,null,null); |
| | | //删除标志(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.selectData(config.getUserId()+"",null,null); |
| | | if(sysUser==null) |
| | | { |
| | | return error("用户不存在"); |
| | | } |
| | | |
| | | if(StringUtils.equals(sysUser.getPassword(),config.getPassword())) |
| | | { |
| | | return error("输入密码与原密码不能相同!"); |
| | | } |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取登录人员信息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "获取登录人员信息,userType=1 为超级管理员 isDivisionHead=1 为部门领导",response = SysUser.class) |
| | | @PostMapping("/getLoginInformation") |
| | | @Authorization |
| | | public ResultData getLoginInformation(@CurrentUser SysUser sysUse) |
| | | { |
| | | return ResultData.success(sysUse); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("切换部门接口") |
| | | @GetMapping(value = "/switch/department") |
| | | public ResultData switchDepartment(@RequestParam(value = "departmentId",required = false) String departmentId, |
| | | @CurrentUser SysUser sysUse) |
| | | { |
| | | sysUse.setDepartmentId(departmentId); |
| | | return toAjax(IUserService.updateConfig(sysUse)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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("automessage_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("修改时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | 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.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | 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.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-20 |
| | | */ |
| | | @TableName("automessage_area_code_2022") |
| | | @Data |
| | | @ApiModel("所属地区实体类") |
| | | public class AreaCode2022 implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 区划代码 |
| | | */ |
| | | @ApiModelProperty("区划代码") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long code; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty("name") |
| | | private String name; |
| | | |
| | | /** |
| | | * 级别1-5,省市县镇村 |
| | | */ |
| | | @ApiModelProperty("级别1-5,省市县镇村") |
| | | private Integer level; |
| | | |
| | | /** |
| | | * 父级区划代码 |
| | | */ |
| | | @ApiModelProperty("父级区划代码") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long pcode; |
| | | |
| | | /** |
| | | * 子节点 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("子节点") |
| | | private List<AreaCode2022> child; |
| | | |
| | | |
| | | } |
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 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-23 |
| | | */ |
| | | @TableName("automessage_common_problem") |
| | | @Data |
| | | @ApiModel("常见问题实体类") |
| | | public class AutomessageCommonProblem implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 常见问题标题 |
| | | */ |
| | | @ApiModelProperty("常见问题标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 常见问题解答内容 |
| | | */ |
| | | @ApiModelProperty("常见问题解答内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @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 updateUserId; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty("创建人id") |
| | | private String createUserId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "updateUserName", value = "上次修改人") |
| | | private String updateUserName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "createUserName", value = "创建人") |
| | | private String createUserName; |
| | | |
| | | |
| | | } |
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 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-11-10 |
| | | */ |
| | | @TableName("automessage_policy_documents") |
| | | @Data |
| | | @ApiModel("法律法规政策文件实体类") |
| | | public class AutomessagePolicyDocuments implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 部门id |
| | | */ |
| | | @ApiModelProperty("部门id") |
| | | private Integer departmentId; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty("名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 跳转链接类型(1.富文本2.微信文章) |
| | | */ |
| | | @ApiModelProperty(" 跳转链接类型(1.富文本2.微信文章)") |
| | | private String linkType; |
| | | |
| | | /** |
| | | * 文章链接 |
| | | */ |
| | | @ApiModelProperty("文章链接") |
| | | private String articleLink; |
| | | |
| | | /** |
| | | * 文章富文本 |
| | | */ |
| | | @ApiModelProperty("文章富文本") |
| | | private String richText; |
| | | |
| | | /** |
| | | * 类型(1.法律法规2.政策文件) |
| | | */ |
| | | @ApiModelProperty("类型(1.法律法规2.政策文件)") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty("创建人") |
| | | private String createUserId; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty("修改时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty("修改人") |
| | | private String updateUserId; |
| | | |
| | | /** |
| | | * 部门名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("部门名称") |
| | | private String departmentName; |
| | | |
| | | /** |
| | | * 修改人名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("修改人名称") |
| | | private String updateUserName; |
| | | |
| | | /** |
| | | * 创建人名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("创建人名称") |
| | | private String createUserName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("是否能够删除1.可以删除修改 2.不能删除修改") |
| | | private Integer isDelete; |
| | | } |
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 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-11-16 |
| | | */ |
| | | @TableName("automessage_smart_consulting") |
| | | @Data |
| | | @ApiModel("智能咨询访问类") |
| | | public class AutomessageSmartConsulting implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 咨询类型:1.小程序访问 2.门户网访问 |
| | | */ |
| | | @ApiModelProperty("咨询类型:1.小程序访问 2.门户网访问") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 咨询人id 可以为 空 |
| | | */ |
| | | @ApiModelProperty("咨询人id 可以为 空") |
| | | private String createUserId; |
| | | |
| | | |
| | | |
| | | } |
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-10-14 |
| | | */ |
| | | @TableName("automessage_sys_settings") |
| | | @Data |
| | | @ApiModel("系统设置类") |
| | | public class AutomessageSysSettings implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设置名称 |
| | | */ |
| | | @ApiModelProperty("设置名称") |
| | | private String settingName; |
| | | |
| | | /** |
| | | * 系统通知时间 |
| | | */ |
| | | @ApiModelProperty("系统通知时间") |
| | | private Integer timeoutNotificationNum; |
| | | |
| | | |
| | | /** |
| | | * 系统提醒时间 |
| | | */ |
| | | @ApiModelProperty("系统提醒时间") |
| | | private Integer timeoutRemindNum; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty("创建人id") |
| | | private Integer createUserId; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty("更新时间") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty("修改人id") |
| | | private String updateUserId; |
| | | |
| | | /** |
| | | * 小程序二维码 |
| | | */ |
| | | @ApiModelProperty("小程序二维码") |
| | | private String appletsUrl; |
| | | |
| | | /** |
| | | * 官网二维码 |
| | | */ |
| | | @ApiModelProperty("小程序二维码") |
| | | private String websiteUrl; |
| | | |
| | | } |
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 lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置记录表 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-10-14 |
| | | */ |
| | | @TableName("automessage_sys_settings_record") |
| | | @Data |
| | | @ApiModel("系统设置类") |
| | | public class AutomessageSysSettingsRecord implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设置id |
| | | */ |
| | | private Integer settingId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 创建人id(及修改设置的人员) |
| | | */ |
| | | private String createUserId; |
| | | |
| | | |
| | | |
| | | } |
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 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-10-15 |
| | | */ |
| | | @TableName("automessage_sys_user_record") |
| | | @Data |
| | | @ApiModel("用户访问记录类") |
| | | public class AutomessageSysUserRecord implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 访问时间 |
| | | */ |
| | | @ApiModelProperty("访问时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 进入方式(1.扫码进入 2.花城进入 3.分享进入) |
| | | */ |
| | | @ApiModelProperty("进入方式(1.扫码进入 2.花城进入 3.分享进入)") |
| | | private Integer joinType; |
| | | |
| | | |
| | | |
| | | |
| | | } |
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.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 fengjin |
| | | * @since 2022-09-26 |
| | | */ |
| | | @TableName("automessage_transaction_event_interview") |
| | | @Data |
| | | @ApiModel("办事指南访问表实体类") |
| | | public class AutomessageTransactionEventInterview implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 办事指南id |
| | | */ |
| | | @ApiModelProperty("办事指南id") |
| | | private Integer transactionEventId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 访问时间 |
| | | */ |
| | | @ApiModelProperty("访问时间") |
| | | private LocalDateTime interviewTime; |
| | | |
| | | |
| | | |
| | | } |
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("automessage_classify_administration") |
| | | 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; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "transactNum", value = "办理事项数量") |
| | | private String transactNum; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @ApiModel("时间筛选列表实体类") |
| | | @Data |
| | | public class CountList implements Serializable |
| | | { |
| | | |
| | | @ApiModelProperty("待办结列表") |
| | | private List<CountListNum> waitDealWithList; |
| | | |
| | | @ApiModelProperty("已办结列表") |
| | | private List<CountListNum> haveDealWith; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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 CountListNum implements Serializable |
| | | { |
| | | @ApiModelProperty("时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("数量") |
| | | private Integer num; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel("首页效率实体类") |
| | | public class EfficiencyEntity implements Serializable |
| | | { |
| | | /** |
| | | * 回复率 |
| | | */ |
| | | @ApiModelProperty("回复率") |
| | | private String reversionRate="0%"; |
| | | |
| | | /** |
| | | * 办结率 |
| | | */ |
| | | @ApiModelProperty("办结率") |
| | | private String workEfficiency="0%"; |
| | | |
| | | /** |
| | | * 解决率 |
| | | */ |
| | | @ApiModelProperty("解决率") |
| | | private String resolveEfficiency="0%"; |
| | | |
| | | /** |
| | | * 好评率 |
| | | */ |
| | | @ApiModelProperty("好评率") |
| | | private String goodReputationEfficiency="0%"; |
| | | |
| | | |
| | | /** |
| | | * 超时办结率 |
| | | */ |
| | | @ApiModelProperty("超时办结率") |
| | | private String timeoutEfficiency="0%"; |
| | | |
| | | |
| | | } |
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; |
| | | |
| | | @Data |
| | | @ApiModel("其他附件管理实体类") |
| | | @TableName("automessage_else_accessory") |
| | | 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; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(name = "createUserId", value = "创建人id") |
| | | private String createUserId; |
| | | |
| | | /** |
| | | * 是否能删除修改 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "isDelete", value = "是否能删除修改") |
| | | private Integer isDelete; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "createUserName", value = "创建人") |
| | | private String createUserName; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("办事指南表") |
| | | @Data |
| | | public class Guidance implements Serializable |
| | | { |
| | | |
| | | @ApiModelProperty(name = "name", value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(name = "num", value = "内容") |
| | | private String num; |
| | | } |
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; |
| | | |
| | | @Data |
| | | @ApiModel("导办工单进展记录表") |
| | | @TableName("automessage_guide_evolve") |
| | | 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; |
| | | |
| | | /** |
| | | * state", value = "状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6未解决 7已解决 8 系统自动分配 9 回复 10转派 11手动分配12默认好评13评价14.删除评论) |
| | | */ |
| | | @ApiModelProperty(name = "state", value = "状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6未解决 7已解决 8 系统自动分配 9 回复 10转派 11手动分配 12默认好评 13用户评价14.删除评论)") |
| | | private String state; |
| | | |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @ApiModelProperty(name = "guideOrderNum", value = "工单号") |
| | | private String guideOrderNum; |
| | | /** |
| | | * 超时状态 是否超时 (1未超时 2超时) |
| | | */ |
| | | @ApiModelProperty(name = "isTimeout", value = "超时状态 是否超时 (1未超时 2超时)") |
| | | private String isTimeout; |
| | | |
| | | /** |
| | | * 备注内容 |
| | | */ |
| | | @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; |
| | | |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(name = "guidOrderNum", value = "工单号") |
| | | private String guidOrderNum; |
| | | |
| | | |
| | | /** |
| | | * 视频url |
| | | */ |
| | | @ApiModelProperty(name = "videoUrl", value = "视频url") |
| | | private String videoUrl; |
| | | |
| | | /** |
| | | * 图片url |
| | | */ |
| | | @ApiModelProperty(name = "pictureUrl", value = "图片url") |
| | | private String pictureUrl; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "toUserName", value = "发起人名字") |
| | | private String toUserName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "toUserName", value = "接收人名字") |
| | | private String fromUserName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "elseAccessoryEntities", value = "其他附件列表") |
| | | private List<ElseAccessoryEntity> elseAccessoryEntities; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "transactionEvents", value = "推荐办事指南列表") |
| | | private List<TransactionEvent> transactionEvents; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("导办工单进展记录表") |
| | | @Data |
| | | public class GuidePlate implements Serializable |
| | | { |
| | | |
| | | @ApiModelProperty(name = "userName", value = "用户名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(name = "departmentNmae", value = "部门") |
| | | private String departmentNmae; |
| | | |
| | | @ApiModelProperty(name = "num", value = "内容") |
| | | private String num; |
| | | } |
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("automessage_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 已取消) |
| | | */ |
| | | @ApiModelProperty("状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消)") |
| | | private String state; |
| | | |
| | | /** |
| | | * 咨询人电话 |
| | | */ |
| | | @ApiModelProperty("咨询人电话") |
| | | private String consultUserPhone; |
| | | |
| | | /** |
| | | * 提交用户电话 |
| | | */ |
| | | @ApiModelProperty("提交用户电话") |
| | | private String submitUserPhone; |
| | | |
| | | /** |
| | | * 导办人员电话 |
| | | */ |
| | | @ApiModelProperty("导办人员电话") |
| | | private String guideUserPhone; |
| | | |
| | | /** |
| | | * 所属地区 |
| | | */ |
| | | @ApiModelProperty("所属地区") |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 详情地址 |
| | | */ |
| | | @ApiModelProperty("详情地址") |
| | | private String detailedAddress; |
| | | |
| | | /** |
| | | * 提交方式(1 小程序 2.门户网) |
| | | */ |
| | | @ApiModelProperty("提交方式(1 小程序 2.门户网)") |
| | | private Integer submitType; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @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(name = "images", value = "图片地址(用逗号分隔)") |
| | | private String images; |
| | | |
| | | @ApiModelProperty(name = "video", value = "视频地址") |
| | | private String video; |
| | | |
| | | @ApiModelProperty(name = "isTimeout", value = "是否超时 (1 未超时 2已超时)") |
| | | private String isTimeout; |
| | | |
| | | @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 = "评价状态(1 满意 2不满意)") |
| | | private String evaluateState; |
| | | |
| | | @ApiModelProperty(name = "serviceState", value = "服务状态(1.已解决 2.未解决)") |
| | | private Integer serviceState; |
| | | |
| | | /** |
| | | * 超时时间 |
| | | */ |
| | | @ApiModelProperty("超时时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime timeoutTime; |
| | | |
| | | /** |
| | | * 是否推送过(1 是 2 否) |
| | | */ |
| | | @ApiModelProperty("是否推送过(1 是 2 否)") |
| | | private Integer isPush; |
| | | |
| | | |
| | | /** |
| | | * 是否提醒推送过(1 是 2 否) |
| | | */ |
| | | @ApiModelProperty("是否提醒推送过(1 是 2 否)") |
| | | private Integer isRemindPush; |
| | | |
| | | /** |
| | | * 是否隐藏评论(1 是 2 否) |
| | | */ |
| | | @ApiModelProperty("是否隐藏评论(1 是 2 否)") |
| | | private Integer isHideComments; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "sumClassifyName", value = "完整分类名称") |
| | | private String sumClassifyName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "consultUser", value = "咨询人姓名+电话") |
| | | private String consultUser; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "submitUser", value = "提交人姓名+电话") |
| | | private String submitUser; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "guideUser", value = "导办人姓名+电话") |
| | | private String guideUser; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "organizationName", value = "创建部门") |
| | | private String organizationName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "guideDepartmentName", value = "导办部门") |
| | | private String guideDepartmentName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "areaName", value = "所属地区名字") |
| | | private String areaName; |
| | | |
| | | @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 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 fengjin |
| | | * @since 2022-09-19 |
| | | */ |
| | | @TableName("automessage_guide_repair_order_image") |
| | | @ApiModel("导办工单图片管理实体类") |
| | | @Data |
| | | public class GuideRepairOrderImage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 导办工单id |
| | | */ |
| | | @ApiModelProperty("导办工单id") |
| | | private String guideRepairOrderId; |
| | | |
| | | /** |
| | | * 路径 |
| | | */ |
| | | @ApiModelProperty("路径") |
| | | private String url; |
| | | |
| | | |
| | | /** |
| | | * 路径 |
| | | */ |
| | | @ApiModelProperty("类型1,视频 2.图片") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | |
| | | @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.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; |
| | | |
| | | |
| | | /** |
| | | * 此类为花城e+主体类 |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | */ |
| | | @ApiModel("花城用户信息实体类") |
| | | @Data |
| | | @TableName("sys_user") |
| | | public class HuaChengSysUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | @ApiModelProperty(name = "userId", value = "主键用户id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | private String userId; |
| | | |
| | | /** |
| | | * 登录账户 |
| | | */ |
| | | @ApiModelProperty(name = "account", value = "登录账户") |
| | | private String account; |
| | | |
| | | /** |
| | | * 登录密码 |
| | | */ |
| | | @ApiModelProperty(name = "password", value = "登录密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 微信小程序唯一标识 |
| | | */ |
| | | @ApiModelProperty(name = "openid", value = "微信小程序唯一标识") |
| | | private String openid; |
| | | |
| | | /** |
| | | * 会话密钥 |
| | | */ |
| | | @ApiModelProperty(name = "sessionKey", value = "会话密钥") |
| | | private String sessionKey; |
| | | |
| | | /** |
| | | * 用户在开放平台的唯一标识符 |
| | | */ |
| | | @ApiModelProperty(name = "unionid", value = "用户在开放平台的唯一标识符") |
| | | private String unionid; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @ApiModelProperty(name = "phone", value = "手机号") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @ApiModelProperty(name = "nickName", value = "昵称") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 真实名字 |
| | | */ |
| | | @ApiModelProperty(name = "name", value = "真实名字") |
| | | private String name; |
| | | |
| | | /** |
| | | * 社区ID |
| | | */ |
| | | @ApiModelProperty(name = "communityId", value = "社区ID") |
| | | private String communityId; |
| | | |
| | | /** |
| | | * 性别 1 男 2 女 |
| | | */ |
| | | @ApiModelProperty(name = "sex", value = "性别 1 男 2 女") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @ApiModelProperty(name = "idCard", value = "身份证号") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @ApiModelProperty(name = "birthday", value = "生日") |
| | | private String birthday; |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @ApiModelProperty(name = "imageUrl", value = "头像") |
| | | private String imageUrl; |
| | | |
| | | /** |
| | | * 用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10 便民服务商家后台 11三说会堂后台 12行业分中心后台 |
| | | */ |
| | | @ApiModelProperty(name = "type", value = "用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10 便民服务商家后台 11三说会堂后台 12行业分中心后台") |
| | | private String type; |
| | | |
| | | /** |
| | | * 职业 |
| | | */ |
| | | @ApiModelProperty(name = "job", value = "职业") |
| | | private String job; |
| | | |
| | | /** |
| | | * 是否志愿者 0 否 1 是 |
| | | */ |
| | | @ApiModelProperty(name = "isVolunteer", value = "是否志愿者 0 否 1 是") |
| | | private String isVolunteer; |
| | | |
| | | /** |
| | | * 是否党员 0 否 1 是 |
| | | */ |
| | | @ApiModelProperty(name = "isPartymember", value = "是否党员 0 否 1 是") |
| | | private String isPartymember; |
| | | |
| | | /** |
| | | * 1 启用 2 禁用 |
| | | */ |
| | | @ApiModelProperty(name = "status", value = "1 启用 2 禁用") |
| | | private String status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(name = "createAt", value = "创建时间") |
| | | private String createAt; |
| | | |
| | | /** |
| | | * 最后登录时间 |
| | | */ |
| | | @ApiModelProperty(name = "lastLoginTime", value = "最后登录时间") |
| | | private String lastLoginTime; |
| | | |
| | | /** |
| | | * 标签多个用,隔开 |
| | | */ |
| | | @ApiModelProperty(name = "tags", value = "标签多个用,隔开") |
| | | private String tags; |
| | | |
| | | /** |
| | | * 家庭id |
| | | */ |
| | | @ApiModelProperty(name = "familyId", value = "家庭id") |
| | | private String familyId; |
| | | |
| | | /** |
| | | * 人脸采集照片url |
| | | */ |
| | | @ApiModelProperty(name = "faceUrl", value = "人脸采集照片url") |
| | | private String faceUrl; |
| | | |
| | | /** |
| | | * 人脸采集审核状态 0 待审核 1 审核通过 2驳回 |
| | | */ |
| | | @ApiModelProperty(name = "faceState", value = "人脸采集审核状态 0 待审核 1 审核通过 2驳回") |
| | | private String faceState; |
| | | |
| | | /** |
| | | * 驳回原因 |
| | | */ |
| | | @ApiModelProperty(name = "rejectReson", value = "驳回原因") |
| | | private String rejectReson; |
| | | |
| | | /** |
| | | * 小区id |
| | | */ |
| | | @ApiModelProperty(name = "areaId", value = "小区id") |
| | | private String areaId; |
| | | |
| | | /** |
| | | * 证件照(人相面)照片 |
| | | */ |
| | | @ApiModelProperty(name = "cardPhotoFront", value = "证件照(人相面)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | /** |
| | | * 证件照(国徽面)照片 |
| | | */ |
| | | @ApiModelProperty(name = "cardPhotoBack", value = "证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | /** |
| | | * 户口本 |
| | | */ |
| | | @ApiModelProperty(name = "familyBook", value = "户口本") |
| | | private String familyBook; |
| | | |
| | | /** |
| | | * 连续登陆天数 每天凌晨定时任务更新 |
| | | */ |
| | | @ApiModelProperty(name = "continuousLandingDays", value = "连续登陆天数 每天凌晨定时任务更新") |
| | | private String continuousLandingDays; |
| | | |
| | | /** |
| | | * 小程序首页是否显示公告(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty(name = "isTips", value = "小程序首页是否显示公告(1.是 2.否)") |
| | | private String isTips; |
| | | |
| | | /** |
| | | * 网格员工作状态(1.在岗 2.脱岗 3.已下班) |
| | | */ |
| | | @ApiModelProperty(name = "workStatus", value = "网格员工作状态(1.在岗 2.脱岗 3.已下班)") |
| | | private String workStatus; |
| | | |
| | | /** |
| | | * 网格员上班开始时间 |
| | | */ |
| | | @ApiModelProperty(name = "workStartTime", value = "网格员上班开始时间") |
| | | private String workStartTime; |
| | | |
| | | /** |
| | | * 网格员上班结束时间 |
| | | */ |
| | | @ApiModelProperty(name = "workEndTime", value = "网格员上班结束时间") |
| | | private String workEndTime; |
| | | |
| | | /** |
| | | * 高龄认证显示提示(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty(name = "bigAgeTips", value = "高龄认证显示提示(1.是 2.否)") |
| | | private String bigAgeTips; |
| | | |
| | | /** |
| | | * 明文密码 |
| | | */ |
| | | @ApiModelProperty(name = "plaintextPassword", value = "明文密码") |
| | | private String plaintextPassword; |
| | | |
| | | /** |
| | | * 街道id |
| | | */ |
| | | @ApiModelProperty(name = "streetId", value = "街道id") |
| | | private String streetId; |
| | | |
| | | /** |
| | | * 绑定单位 |
| | | */ |
| | | @ApiModelProperty(name = "relationName", value = "绑定单位") |
| | | private String relationName; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty(name = "appId", value = "") |
| | | private String appId; |
| | | |
| | | /** |
| | | * 是否接收推送 |
| | | */ |
| | | @ApiModelProperty(name = "isAccept", value = "是否接收推送") |
| | | private String isAccept; |
| | | |
| | | /** |
| | | * 报到单位id |
| | | */ |
| | | @ApiModelProperty(name = "bindingCheckUnitId", value = "报到单位id") |
| | | private String bindingCheckUnitId; |
| | | |
| | | } |
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("automessage_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.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("automessage_menu") |
| | | 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") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | 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("automessage_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; |
| | | |
| | | /** |
| | | * areaList |
| | | */ |
| | | @ApiModelProperty("areaList") |
| | | private String areaList; |
| | | |
| | | /** |
| | | * 机构等级 |
| | | */ |
| | | @ApiModelProperty("部门应用") |
| | | private String departmentalApplication; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty("修改人") |
| | | private String updateUserId; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("修改人姓名") |
| | | private String updateUserName; |
| | | |
| | | |
| | | /** |
| | | * 下属机构 |
| | | */ |
| | | @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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("组织排行榜") |
| | | @Data |
| | | public class OrganizationEntity implements Serializable { |
| | | @ApiModelProperty("id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty(name = "departmentNmae", value = "部门") |
| | | private String departmentNmae; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "num", value = "内容") |
| | | private String num="0"; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("饼状图子类实体类") |
| | | @Data |
| | | public class PieChart implements Serializable |
| | | { |
| | | @ApiModelProperty("一级分类名称") |
| | | private String name; |
| | | |
| | | |
| | | @ApiModelProperty("一级分类数量") |
| | | private String num; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @ApiModel("饼状图实体类") |
| | | @Data |
| | | public class PieChartAll implements Serializable |
| | | { |
| | | @ApiModelProperty("工单总数") |
| | | private String workOrderNum; |
| | | |
| | | @ApiModelProperty("办事指南总数") |
| | | private String fingerpostNum; |
| | | |
| | | @ApiModelProperty("工单统计图数据") |
| | | private List<PieChart> workOrderList; |
| | | |
| | | @ApiModelProperty("办事指南统计图数据") |
| | | private List<PieChart> fingerpostList; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("导办工单根据地区统计") |
| | | @Data |
| | | public class RangeStatistics implements Serializable |
| | | { |
| | | @ApiModelProperty("区域名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("数量") |
| | | private String num; |
| | | } |
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 |
| | | 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; |
| | | |
| | | /** |
| | | * 附件列表 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("附件列表") |
| | | private List<ElseAccessoryEntity> elseAccessoryEntityList; |
| | | |
| | | /** |
| | | * 推荐办事指南列表 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("推荐办事指南列表") |
| | | private List<TransactionEvent> transactionEventList; |
| | | |
| | | |
| | | /** |
| | | * 是否能够删除修改 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("是否能够删除修改") |
| | | private Integer isDelete; |
| | | |
| | | } |
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; |
| | | |
| | | |
| | | @ApiModel("角色管理实体类") |
| | | @Data |
| | | @TableName("automessage_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; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("创建者名称") |
| | | private String createName; |
| | | |
| | | |
| | | |
| | | } |
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("automessage_role_menu") |
| | | public class RoleMenuEntity implements Serializable |
| | | { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 角色id |
| | | */ |
| | | @ApiModelProperty("角色id") |
| | | private String roleId; |
| | | |
| | | /** |
| | | * 菜单id |
| | | */ |
| | | @ApiModelProperty("菜单id") |
| | | private String menuId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty("修改时间") |
| | | @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.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("automessage_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("automessage_sys_user") |
| | | public class SysUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private String userId; |
| | | |
| | | |
| | | /** |
| | | * 登录账号 |
| | | */ |
| | | @ApiModelProperty("登录账号") |
| | | private String loginName; |
| | | |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | @ApiModelProperty("用户昵称") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 用户类型(1系统后台用户 2导办人员用户) |
| | | */ |
| | | @ApiModelProperty("用户类型(1系统后台用户 2导办人员用户 3.普通用户 4.小程序用户") |
| | | private String userType; |
| | | |
| | | |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | @ApiModelProperty("手机号码") |
| | | private String phonenumber; |
| | | |
| | | /** |
| | | * 性别 1 男 2 女 |
| | | */ |
| | | @ApiModelProperty("性别 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 departmentIdStr; |
| | | |
| | | /** |
| | | * 数据权限 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 微信小程序id |
| | | */ |
| | | @ApiModelProperty("微信小程序id") |
| | | private String openid; |
| | | |
| | | /** |
| | | * 待处理办事指南数量 |
| | | */ |
| | | @ApiModelProperty("待处理办事指南数量") |
| | | private Integer transactionNum; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("权限资格") |
| | | private String permission; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("角色名称") |
| | | private String roleName; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("创建人名称") |
| | | private String createName; |
| | | |
| | | @ApiModelProperty("是否是部门领导(1是 2不是)") |
| | | private String isDivisionHead; |
| | | |
| | | @ApiModelProperty("办理事项ids") |
| | | private String mattersIds; |
| | | |
| | | |
| | | @ApiModelProperty("部门ids") |
| | | private String departmentIds; |
| | | |
| | | |
| | | @ApiModelProperty("多部门ids") |
| | | private String moreDepartmentIds; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("办理事项名称") |
| | | private String mattersNames; |
| | | |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("办结事项数目") |
| | | private String transactionEndNum; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 导办工单统计类 |
| | | */ |
| | | |
| | | @ApiModel("不同时间段的工单数量") |
| | | @Data |
| | | public class TimeWorkOrder implements Serializable |
| | | { |
| | | //累计全部 本年 本月 今日 昨日 |
| | | /** |
| | | * 总数量 |
| | | */ |
| | | @ApiModelProperty("累计总数量") |
| | | private Integer allNum=0; |
| | | |
| | | @ApiModelProperty("本年") |
| | | private Integer yearNum; |
| | | |
| | | @ApiModelProperty("本月") |
| | | private Integer monthNum; |
| | | |
| | | @ApiModelProperty("今天") |
| | | private Integer todayNum; |
| | | |
| | | @ApiModelProperty("昨天") |
| | | private Integer yesterdayNum; |
| | | } |
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; |
| | | |
| | | @ApiModel("导办事项管理实体类") |
| | | @Data |
| | | @TableName("automessage_transaction_event") |
| | | 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; |
| | | |
| | | /** |
| | | * 部门电话 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("部门电话") |
| | | private String contactNumber; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty("分类id") |
| | | private String classifyId; |
| | | |
| | | /** |
| | | * 所属分类等级 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("所属分类等级") |
| | | private String classifyName; |
| | | |
| | | /** |
| | | * 部门名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("部门名称") |
| | | private String departmentName; |
| | | /** |
| | | * 事项名称 |
| | | */ |
| | | @ApiModelProperty("事项名称") |
| | | private String matterName; |
| | | |
| | | /** |
| | | * 联想词ids |
| | | */ |
| | | @ApiModelProperty("联想词ids") |
| | | private String associateIds; |
| | | |
| | | /** |
| | | * 导办数量 |
| | | */ |
| | | @ApiModelProperty("导办数量") |
| | | private Integer transactionNum; |
| | | |
| | | /** |
| | | * 浏览数量 |
| | | */ |
| | | @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; |
| | | |
| | | |
| | | @ApiModelProperty("手机移动端申报") |
| | | private String transactionArea; |
| | | |
| | | @ApiModelProperty("手机移动端申报url") |
| | | private String transactionAreaUrl; |
| | | |
| | | @ApiModelProperty("手机移动端申报文件名称") |
| | | private String transactionAreaName; |
| | | |
| | | |
| | | @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; |
| | | |
| | | @ApiModelProperty(name = "operationalGuidelineVideoName", value = "操作指南视频名称") |
| | | private String operationalGuidelineVideoName; |
| | | |
| | | @ApiModelProperty(name = "operationalGuidelineName", value = "操作指南名称") |
| | | private String operationalGuidelineName; |
| | | |
| | | @ApiModelProperty(name = "classifyIds", value = "前端使用") |
| | | private String classifyIds; |
| | | |
| | | |
| | | @ApiModelProperty(name = "departmentIds", value = "所属部门列") |
| | | private String departmentIds; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "departmentNames", value = "所属部门列名称集合") |
| | | private String departmentNames; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 导办工单统计类 |
| | | */ |
| | | @ApiModel("导办工单统计类") |
| | | @Data |
| | | public class WorkOrder implements Serializable |
| | | { |
| | | /** |
| | | * 总数量 |
| | | */ |
| | | @ApiModelProperty("总数量") |
| | | private Integer allNum=0; |
| | | |
| | | |
| | | /** |
| | | * 待分配 |
| | | */ |
| | | @ApiModelProperty("待分配数量") |
| | | private Integer waitDistribution=0; |
| | | |
| | | /** |
| | | * 待办结 |
| | | */ |
| | | @ApiModelProperty("待办结") |
| | | private Integer waitDealWith=0; |
| | | |
| | | /** |
| | | * 已办结 |
| | | */ |
| | | @ApiModelProperty("已办结") |
| | | private Integer haveDealWith=0; |
| | | |
| | | |
| | | /** |
| | | * 待评价 |
| | | */ |
| | | @ApiModelProperty("待评价") |
| | | private Integer remainEvaluated=0; |
| | | |
| | | /** |
| | | * 已取消 |
| | | */ |
| | | @ApiModelProperty("已取消") |
| | | private Integer canceled=0; |
| | | |
| | | /** |
| | | * 已超时 |
| | | */ |
| | | @ApiModelProperty("已超时") |
| | | private Integer overtime=0; |
| | | |
| | | /** |
| | | * 超时未办结 |
| | | */ |
| | | @ApiModelProperty("超时未办结") |
| | | private Integer overtimeWaitDealWith=0; |
| | | |
| | | /** |
| | | * 未解决 |
| | | */ |
| | | @ApiModelProperty("未解决") |
| | | private Integer unsolved=0; |
| | | |
| | | /** |
| | | * 已解决 |
| | | */ |
| | | @ApiModelProperty("已解决") |
| | | private Integer resolved=0; |
| | | |
| | | } |
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.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-23 |
| | | */ |
| | | public interface AutomessageCommonProblemMapper extends BaseMapper<AutomessageCommonProblem> { |
| | | |
| | | /** |
| | | * 获取常见问题列表(分页) |
| | | * @param page |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<AutomessageCommonProblem> selectConfigList(IPage<AutomessageCommonProblem> page, Integer state, @Param("title") String title, @Param("content") String content); |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页查找) |
| | | * @return |
| | | */ |
| | | List<AutomessageCommonProblem> selectConfigList(@Param("title") String title, @Param("content") String content); |
| | | |
| | | /** |
| | | * 获取常见问题列表统计数量 |
| | | * @return |
| | | */ |
| | | Integer countConfigList(@Param("title") String title, @Param("content") String content); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.entity.AutomessagePolicyDocuments; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-11-10 |
| | | */ |
| | | public interface AutomessagePolicyDocumentsMapper extends BaseMapper<AutomessagePolicyDocuments> { |
| | | |
| | | /** |
| | | * 获取法律法规政策文件 (分页) |
| | | * @param page |
| | | * @param state |
| | | * @param name 名称 |
| | | * @param type 类型 |
| | | * @return |
| | | */ |
| | | List<AutomessagePolicyDocuments> selectConfigList(IPage<AutomessagePolicyDocuments> page, Integer state, @Param("name") String name, @Param("type") String type, @Param("departmentId") Integer departmentId, @Param("ids") List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 获取法律法规政策文件 (不分页) |
| | | * @param name 名称 |
| | | * @param type 类型 |
| | | * @return |
| | | */ |
| | | List<AutomessagePolicyDocuments> selectConfigList(@Param("name") String name, @Param("type") String type, @Param("departmentId") Integer departmentId, @Param("ids") List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 根据id获取法律法规政策文件数据 |
| | | * @return |
| | | */ |
| | | AutomessagePolicyDocuments selectAutomessagePolicyDocumentById(Integer id); |
| | | |
| | | /** |
| | | * 获取法律法规政策文件 (统计) |
| | | * @return |
| | | */ |
| | | Integer selectCountList(@Param("name") String name, @Param("type") String type,@Param("departmentId") Integer departmentId, @Param("ids") List<String> ids); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageSmartConsulting; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-11-16 |
| | | */ |
| | | public interface AutomessageSmartConsultingMapper extends BaseMapper<AutomessageSmartConsulting> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageSysSettings; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-10-14 |
| | | */ |
| | | public interface AutomessageSysSettingsMapper extends BaseMapper<AutomessageSysSettings> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageSysSettingsRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-10-14 |
| | | */ |
| | | public interface AutomessageSysSettingsRecordMapper extends BaseMapper<AutomessageSysSettingsRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageSysUserRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.manual.pojo.AppletUserCount; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-10-15 |
| | | */ |
| | | public interface AutomessageSysUserRecordMapper extends BaseMapper<AutomessageSysUserRecord> { |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectUserRecordCount(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近15天 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByDay(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近30天 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByMonth(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近一年 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByYear(); |
| | | |
| | | /** |
| | | * 删除因为token问题产出的重复脏数据 |
| | | * @return |
| | | */ |
| | | Integer deleteDistinct(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageTransactionEventInterview; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 办事指南访问表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-26 |
| | | */ |
| | | public interface AutomessageTransactionEventInterviewMapper extends BaseMapper<AutomessageTransactionEventInterview> { |
| | | |
| | | } |
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); |
| | | |
| | | |
| | | /** |
| | | * 根据上级id查询子分类 |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<String> selectParent(String parentId); |
| | | |
| | | |
| | | List<ClassifyAdministration> selectParentData(String parentId); |
| | | |
| | | |
| | | |
| | | |
| | | } |
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("ids") List<String> ids, |
| | | @Param("userId") String userId); |
| | | |
| | | /** |
| | | * 获取附件列表全部 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public List<ElseAccessoryEntity> selectConfigList(@Param("Name") String Name, |
| | | @Param("ids") List<String> ids, |
| | | @Param("userId") String userId); |
| | | |
| | | |
| | | /** |
| | | * 新增列表 |
| | | * @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(@Param("Name") String Name,@Param("ids") List<String> ids); |
| | | |
| | | /** |
| | | * 按ids查找相关附件列表 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<ElseAccessoryEntity> selectListByIds(String[] list); |
| | | |
| | | } |
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 org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface GuideEvolveMapper extends BaseMapper<GuideEvolveEntity> |
| | | { |
| | | |
| | | /** |
| | | * 查询记录列表 |
| | | * @return |
| | | */ |
| | | public List<GuideEvolveEntity> selectConfigList(String guideId); |
| | | |
| | | /** |
| | | * 查询记录列表(隐藏工单姓名) |
| | | * @return |
| | | */ |
| | | public List<GuideEvolveEntity> selectHideList(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(); |
| | | |
| | | /** |
| | | * 更新工单id为空的脏数据 |
| | | * @return |
| | | */ |
| | | int updateGuid(); |
| | | |
| | | |
| | | |
| | | |
| | | } |
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.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.entity.CountListNum; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <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); |
| | | |
| | | |
| | | /** |
| | | * 获取个人中心工单数据 |
| | | * @param submitUserId |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectBySubmitId(String submitUserId); |
| | | |
| | | /** |
| | | * 获取工单列表(分页) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectConfigList(IPage<GuideRepairOrder> page, Integer state, |
| | | @Param("matterName") String matterName, |
| | | @Param("ids") List<String> ids, |
| | | @Param("status") String status, |
| | | @Param("guideUserId") String guideUserId, |
| | | @Param("createTimeStartTime") String createTimeStartTime, |
| | | @Param("createTimeTimeEndTime") String createTimeTimeEndTime, |
| | | @Param("classifyId") String classifyId); |
| | | |
| | | |
| | | /** |
| | | * 获取工单列表(不分页用于小程序) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectConfigList(@Param("matterName") String matterName, |
| | | @Param("ids") List<String> ids, |
| | | @Param("status") String status, |
| | | @Param("guideUserId") String guideUserId, |
| | | @Param("createTimeStartTime") String createTimeStartTime, |
| | | @Param("createTimeTimeEndTime") String createTimeTimeEndTime, |
| | | @Param("classifyId") String classifyId |
| | | ); |
| | | |
| | | /** |
| | | * 获取工单列表(求和) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | int countConfigList(@Param("matterName") String matterName, |
| | | @Param("ids") List<String> ids, |
| | | @Param("status") String status, |
| | | @Param("guideUserId") String guideUserId); |
| | | |
| | | |
| | | /** |
| | | * 很具用户id查询是否有对应工单 |
| | | * @return |
| | | */ |
| | | int countUser(@Param("userId") String userId,@Param("state") String state); |
| | | |
| | | |
| | | /** |
| | | * 删除工单 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 统计工单用 1 今天 2昨天 3本月 4本年度 |
| | | * @return |
| | | */ |
| | | int countStatisticsNum(@Param("state") String state, |
| | | @Param("ids") List<String> ids, |
| | | @Param("time") String time, |
| | | @Param("isTimeout") String isTimeout, |
| | | @Param("evaluateState") String evaluateState, |
| | | @Param("classifyIds") List<String> classifyIds, |
| | | @Param("serviceState") String serviceState, |
| | | @Param("guideUserId") String guideUserId); |
| | | |
| | | /** |
| | | * 统计工单用 |
| | | * @return |
| | | */ |
| | | List<CountListNum> countListNum(@Param("state") String state, |
| | | @Param("ids") List<String> ids, |
| | | @Param("time") Integer time); |
| | | /** |
| | | * 获取超时工单 |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectOvertime(); |
| | | |
| | | /** |
| | | * 更改状态为好评 |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectEvaluate(); |
| | | |
| | | |
| | | /** |
| | | * 获取需要通知的单据 |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectNoticeTime(@Param("minute") Integer minute); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.Guidance; |
| | | import com.dg.core.db.gen.entity.GuidePlate; |
| | | import com.dg.core.db.gen.entity.OrganizationEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface HomeStatisticsMapper extends BaseMapper<GuidePlate> |
| | | { |
| | | /** |
| | | * 按办结量排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> guidePlatePeople(List<String> ids); |
| | | |
| | | /** |
| | | *按评分排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> score(List<String> ids); |
| | | |
| | | /** |
| | | * 按超时 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> timeout(List<String> ids); |
| | | |
| | | /** |
| | | * 按未办结 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<GuidePlate> tosettled(List<String> ids); |
| | | |
| | | /** |
| | | * 按工单量 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<GuidePlate> workunit(List<String> ids); |
| | | |
| | | /** |
| | | * 导办人员统计数 |
| | | * @return |
| | | */ |
| | | Integer staffNum(List<String> ids); |
| | | |
| | | /** |
| | | * 办事指南数量统计 |
| | | * @return |
| | | */ |
| | | Integer countWork(List<String> ids); |
| | | |
| | | /** |
| | | * 获取一级部门 |
| | | * @return |
| | | */ |
| | | List<OrganizationEntity> getDepartment(); |
| | | |
| | | /** |
| | | * 评分 |
| | | * @return |
| | | */ |
| | | Integer organizationScore(List<String> ids); |
| | | |
| | | /** |
| | | * 办结量 |
| | | * @return |
| | | */ |
| | | Integer organizationNum(List<String> ids); |
| | | |
| | | /** |
| | | * 办事指南根据导办数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceTransaction(List<String> ids); |
| | | |
| | | /** |
| | | * 办事指南根据浏览数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceBrowse(List<String> ids); |
| | | |
| | | /** |
| | | * 获取统计数据 首页用 勿动 |
| | | */ |
| | | int countStatisticsNum(@Param("classifyIds") List<String> classifyIds, |
| | | @Param("ids") List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 首页统计用 |
| | | * @param parentId |
| | | * @param classifyGrade |
| | | * @return |
| | | */ |
| | | public List<ClassifyAdministration> getClassify(@Param("parentId") String parentId, |
| | | @Param("classifyGrade") String classifyGrade); |
| | | |
| | | |
| | | List<String> countId(String district); |
| | | |
| | | |
| | | int rangeStatistics(List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 首页统计用 |
| | | * @return |
| | | */ |
| | | String reversionRate(@Param("state") String state,@Param("isTimeout") String isTimeout); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户信息表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiang |
| | | * @since 2022-07-11 |
| | | */ |
| | | public interface HuaChengSysUserMapper extends BaseMapper<HuaChengSysUser> |
| | | { |
| | | public List<HuaChengSysUser> selectConfigList(); |
| | | |
| | | public List<HuaChengSysUser> selectData(@Param("userId") String userId,@Param("account") String account,@Param("phone") String phone); |
| | | |
| | | public int selectNum(); |
| | | } |
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.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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, |
| | | @Param("ids") List<String> ids); |
| | | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | 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); |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, |
| | | @Param("organizationName") String organizationName,@Param("ids") List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 统计数量(部门应用) |
| | | */ |
| | | int countList(@Param("organizationName") String organizationName,@Param("ids") List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 根据所属地区查找部门 |
| | | */ |
| | | List<OrganizationChartEntity> selectByCode(@Param("id")String id, @Param("areaCode") String areaCode); |
| | | |
| | | |
| | | |
| | | } |
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("ids") List<String> ids, |
| | | @Param("userId") String userId); |
| | | |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @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(@Param("Name") String Name,@Param("ids") List<String> ids); |
| | | |
| | | |
| | | |
| | | |
| | | } |
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 org.springframework.data.repository.query.Param; |
| | | |
| | | 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("name") String name); |
| | | |
| | | /** |
| | | * 新增角色 |
| | | * @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(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.RoleMenuEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface RoleMenuEntityMapper extends BaseMapper<RoleMenuEntity> |
| | | { |
| | | /** |
| | | * 根据角色获取菜单id |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | public List<RoleMenuEntity> selectConfigList(String roleId); |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(RoleMenuEntity entity); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(RoleMenuEntity entity); |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | |
| | | |
| | | |
| | | } |
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("userName") String userName, |
| | | @Param("ids") List<String> ids, |
| | | @Param("isDivisionHead") String isDivisionHead); |
| | | |
| | | |
| | | |
| | | SysUser selectData(@Param("userId") String userId, |
| | | @Param("phonenumber") String phonenumber, |
| | | @Param("loginName") String loginName); |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | | * @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(@Param("userType") String userType, |
| | | @Param("userName") String userName, |
| | | @Param("ids") List<String> ids, |
| | | @Param("isDivisionHead") String isDivisionHead); |
| | | |
| | | /** |
| | | * 根据部门id及分类id获取导办用户 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | List<SysUser> selectListByDepartmentId(@Param("list") List<String> list,@Param("classifyIdFront") String classifyIdFront,@Param("classifyIdAfter") String classifyIdAfter); |
| | | |
| | | |
| | | /** |
| | | * 查询用户列表(不分页) |
| | | * @param userType 用户类型 |
| | | * @return 结果 |
| | | */ |
| | | List<SysUser> queryList(@Param("userType") Integer userType,@Param("keyWord") String keyWord); |
| | | } |
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("keyword") String keyword, |
| | | @Param("classifyGrade") String classifyGrade, |
| | | @Param("ids") List<String> ids); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 导办事物列表 (部分也) |
| | | * @param |
| | | * @return |
| | | */ |
| | | public List<TransactionEvent> selectConfigList(@Param("keyword") String keyword, |
| | | @Param("classifyGrade") String classifyGrade, |
| | | @Param("ids") List<String> ids); |
| | | |
| | | /** |
| | | * 新增导办事务 |
| | | * @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("keyword") String keyword, |
| | | @Param("classifyGrade") String classifyGrade, |
| | | @Param("ids") List<String> ids); |
| | | |
| | | /** |
| | | * 导办事务搜索 |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryMatterNameList(IPage<TransactionEvent> page, Integer state, String matterName); |
| | | |
| | | /** |
| | | * 导办事务搜索(不带分页) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryMatterNameList(@Param("matterName") String matterName,@Param("classifyId") String classifyId); |
| | | |
| | | /** |
| | | * 导办事务搜索(不带分页)(关联词) |
| | | * @param associateNames |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryAssociateNamesList(@Param("associateNames") String associateNames,@Param("classifyId") String classifyId); |
| | | |
| | | /** |
| | | * 导办事务搜索统计数量 |
| | | * @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); |
| | | |
| | | |
| | | /** |
| | | * 根据分离查询导办事务(分页) |
| | | * @param classifyId |
| | | * @return |
| | | * |
| | | */ |
| | | List<TransactionEvent> queryByClassifyIdList(IPage<TransactionEvent> page, Integer state,@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> selectSearchList(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); |
| | | |
| | | /** |
| | | * 按ids查找导办事务列表 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> selectListByIds(String[] list); |
| | | |
| | | /** |
| | | * 根据分类筛选数据 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> selectClassifyList(List<String> ids); |
| | | |
| | | /** |
| | | * 根据部门判断是否有事项名称重复 |
| | | */ |
| | | String selectDataIfExist(@Param("departmentId") String departmentId, |
| | | @Param("matterName") String matterName); |
| | | |
| | | /** |
| | | * 根据办事分类获取办事指南 |
| | | */ |
| | | List<String> selectclassifyId(String classifyId); |
| | | |
| | | |
| | | /** |
| | | * 根据关联词导办事务搜索搜索(不分页)(去重用于小程序) |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | List<Search> selectSearchAssociateDistinct( 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 io.netty.channel.ConnectTimeoutException; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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/huacheng_smart_life?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("automessage_smart_consulting") // 设置需要生成的表名 |
| | | .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 com.dg.core.annotation.Authorization; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @ApiModel("小程序用户统计结果") |
| | | @Data |
| | | public class AppletUserCount { |
| | | |
| | | @ApiModelProperty("日期,可以是月也可以是日") |
| | | private String date; |
| | | |
| | | @ApiModelProperty("访问量") |
| | | private Long visits; |
| | | |
| | | @ApiModelProperty("类型1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问量") |
| | | private Integer type; |
| | | } |
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.AutomessagePolicyDocuments; |
| | | 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 QueryResults { |
| | | |
| | | |
| | | @ApiModelProperty("数量") |
| | | private long total; |
| | | |
| | | @ApiModelProperty("办事指南列表或者部门") |
| | | private List<Search> searchList; |
| | | |
| | | @ApiModelProperty("推荐办事指南列表") |
| | | private List<Search> transactionEventList; |
| | | |
| | | @ApiModelProperty("联想词列表") |
| | | private List<KeywordEntity> keywordEntityList; |
| | | |
| | | @ApiModelProperty("关联联想词列表") |
| | | private List<KeywordEntity> keywordAssociationList; |
| | | |
| | | @ApiModelProperty("办事部门列表") |
| | | private List<OrganizationChartEntity> organizationChartEntityList; |
| | | |
| | | @ApiModelProperty("政策文件列表") |
| | | private List<AutomessagePolicyDocuments> automessagePolicyDocuments; |
| | | |
| | | @ApiModelProperty("法律法规列表") |
| | | private List<AutomessagePolicyDocuments> regulations; |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessagePolicyDocuments; |
| | | 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; |
| | | |
| | | @ApiModelProperty("政策文件列表") |
| | | private List<AutomessagePolicyDocuments> automessagePolicyDocuments; |
| | | |
| | | @ApiModelProperty("法律法规列表") |
| | | private List<AutomessagePolicyDocuments> regulations; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | 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 Search { |
| | | |
| | | @ApiModelProperty("id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("搜索结果标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("搜索结果内容(部门是简历,指南则是改指南的分级)") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("浏览次数") |
| | | private Integer views; |
| | | |
| | | @ApiModelProperty("分类id") |
| | | private Integer classifyId; |
| | | |
| | | @ApiModelProperty("分类id父id") |
| | | private Integer parentClassifyId; |
| | | |
| | | @ApiModelProperty("搜索数据类型1.办事部门2.办事指南 3.推荐办事指南4.分类 5.政策文件 6.法律法规") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("办事指南") |
| | | private List<TransactionEvent> transactionEventList; |
| | | |
| | | } |
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.file; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * 基础异常 |
| | | * |
| | | * @author |
| | | */ |
| | | 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; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 文件信息异常类 |
| | | * |
| | | * @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.tomcat.util.http.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.exception.file; |
| | | |
| | | 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.exception.file; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | /** |
| | | * spring工具类 方便在非spring管理环境中获取bean |
| | | * |
| | | * @author huanghongfa |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware { |
| | | /** Spring应用上下文环境 */ |
| | | private static ConfigurableListableBeanFactory beanFactory; |
| | | |
| | | private static 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 = 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 !ObjectUtils.isEmpty(activeProfiles) ? activeProfiles[0] : null; |
| | | } |
| | | |
| | | @Override |
| | | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { |
| | | SpringUtils.beanFactory = beanFactory; |
| | | } |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| | | SpringUtils.applicationContext = applicationContext; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.file; |
| | | |
| | | import com.dg.core.exception.file.FileSizeLimitExceededException; |
| | | import com.dg.core.exception.file.InvalidExtensionException; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 文件上传工具类 |
| | | * |
| | | * @author |
| | | */ |
| | | public class FileTypeUploadUtils { |
| | | /** |
| | | * 默认大小 50M |
| | | */ |
| | | public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; |
| | | |
| | | /** |
| | | * 默认的文件名最大长度 100 |
| | | */ |
| | | public static final int DEFAULT_FILE_NAME_LENGTH = 100; |
| | | |
| | | |
| | | /** |
| | | * 文件大小校验 |
| | | * |
| | | * @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; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: ftp |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 13:39 |
| | | **/ |
| | | public class FtpConstants { |
| | | /** |
| | | * ftp站点 |
| | | */ |
| | | public static final String FTPHOST = "47.104.148.185"; |
| | | /** |
| | | * 端口号 |
| | | */ |
| | | public static final Integer FTPPORT = 22; |
| | | /** |
| | | * ftp访问用户名 |
| | | */ |
| | | public static final String FTPUSERNAME = "root"; |
| | | /** |
| | | * ftp访问密码 |
| | | */ |
| | | public static final String FTPPASSWORD = "evanN7F2K5M6"; |
| | | /** |
| | | * excel模板 |
| | | */ |
| | | public static final String FTPFILEPATH_MUBAN = "/mnt/data/ftp/muban/"; |
| | | /** |
| | | * 党员保存 |
| | | */ |
| | | public static final String FTPFILEPATH_IDCARD = "/mnt/data/ftp/idcard/"; |
| | | /** |
| | | * http访问路径 |
| | | */ |
| | | public static final String HTTP_URL = "http://image.panzhihua.nhys.cdnhxx.com/"; |
| | | } |
New file |
| | |
| | | package com.dg.core.file; |
| | | |
| | | /** |
| | | * 媒体类型工具类 |
| | | * |
| | | * @author |
| | | */ |
| | | 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.file; |
| | | |
| | | import com.jcraft.jsch.*; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.io.*; |
| | | import java.util.Properties; |
| | | import java.util.Vector; |
| | | |
| | | /** |
| | | * @version 1.0.0 |
| | | * @ClassName: SFTPUtil |
| | | * @Description: sftp连接工具类 |
| | | */ |
| | | public class SFTPUtil { |
| | | private transient Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | private ChannelSftp sftp; |
| | | |
| | | private Session session; |
| | | |
| | | // FTP 登录用户名 |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | private String host; |
| | | // FTP 端口 |
| | | private int port; |
| | | |
| | | /** |
| | | * 构造基于密码认证的sftp对象 |
| | | * |
| | | * @param userName |
| | | * @param password |
| | | * @param host |
| | | * @param port |
| | | */ |
| | | public SFTPUtil(String userName, String password, String host, int port) { |
| | | this.userName = userName; |
| | | this.password = password; |
| | | this.host = host; |
| | | this.port = port; |
| | | } |
| | | |
| | | public SFTPUtil() { |
| | | this.userName = FtpConstants.FTPUSERNAME; |
| | | this.password = FtpConstants.FTPPASSWORD; |
| | | this.host = FtpConstants.FTPHOST; |
| | | this.port = FtpConstants.FTPPORT; |
| | | } |
| | | |
| | | public static void main(String[] args) throws SftpException, IOException { |
| | | SFTPUtil sftp = new SFTPUtil("root", "evanN7F2K5M6", "47.104.148.185", 22); |
| | | sftp.login(); |
| | | File file = new File("F:\\settings.xml"); |
| | | InputStream is = new FileInputStream(file); |
| | | // 多级目录创建并上传 |
| | | sftp.uploadMore("/mnt/data/ftp/ss", "settings.xml", is); |
| | | sftp.logout(); |
| | | } |
| | | |
| | | /** |
| | | * 连接sftp服务器 |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | public void login() { |
| | | try { |
| | | JSch jsch = new JSch(); |
| | | log.info("sftp connect by host:{} username:{}", host, userName); |
| | | |
| | | session = jsch.getSession(userName, host, port); |
| | | log.info("Session is build"); |
| | | if (password != null) { |
| | | session.setPassword(password); |
| | | } |
| | | Properties config = new Properties(); |
| | | config.put("StrictHostKeyChecking", "no"); |
| | | |
| | | session.setConfig(config); |
| | | session.connect(); |
| | | log.info("Session is connected"); |
| | | |
| | | Channel channel = session.openChannel("sftp"); |
| | | channel.connect(); |
| | | log.info("channel is connected"); |
| | | |
| | | sftp = (ChannelSftp)channel; |
| | | log.info(String.format("sftp server host:[%s] port:[%s] is connect successfull", host, port)); |
| | | } catch (JSchException e) { |
| | | log.error("Cannot connect to specified sftp server : {}:{} \n Exception message is: {}", host, port, |
| | | e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 关闭连接 server |
| | | */ |
| | | public void logout() { |
| | | if (sftp != null) { |
| | | if (sftp.isConnected()) { |
| | | sftp.disconnect(); |
| | | log.info("sftp is closed already"); |
| | | } |
| | | } |
| | | if (session != null) { |
| | | if (session.isConnected()) { |
| | | session.disconnect(); |
| | | log.info("sshSession is closed already"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 递归根据路径创建文件夹 |
| | | * |
| | | * @param dirs |
| | | * 根据 / 分隔后的数组文件夹名称 |
| | | * @param tempPath |
| | | * 拼接路径 |
| | | * @param length |
| | | * 文件夹的格式 |
| | | * @param index |
| | | * 数组下标 |
| | | * @return |
| | | */ |
| | | public void mkdirDir(String[] dirs, String tempPath, int length, int index) { |
| | | // 以"/a/b/c/d"为例按"/"分隔后,第0位是"";顾下标从1开始 |
| | | index++; |
| | | if (index < length) { |
| | | // 目录不存在,则创建文件夹 |
| | | tempPath += "/" + dirs[index]; |
| | | } |
| | | try { |
| | | log.info("检测目录[" + tempPath + "]"); |
| | | sftp.cd(tempPath); |
| | | if (index < length) { |
| | | mkdirDir(dirs, tempPath, length, index); |
| | | } |
| | | } catch (SftpException ex) { |
| | | log.warn("创建目录[" + tempPath + "]"); |
| | | try { |
| | | sftp.mkdir(tempPath); |
| | | sftp.cd(tempPath); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | log.error("创建目录[" + tempPath + "]失败,异常信息[" + e.getMessage() + "]"); |
| | | |
| | | } |
| | | log.info("进入目录[" + tempPath + "]"); |
| | | mkdirDir(dirs, tempPath, length, index); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 将输入流的数据上传到sftp作为文件(多层目录) |
| | | * |
| | | * @param directory |
| | | * 上传到该目录(多层目录) |
| | | * @param sftpFileName |
| | | * sftp端文件名 |
| | | * @param input |
| | | * 输入流 |
| | | * @throws SftpException |
| | | * @throws Exception |
| | | */ |
| | | public void uploadMore(String directory, String sftpFileName, InputStream input) throws SftpException { |
| | | try { |
| | | sftp.cd(directory); |
| | | } catch (SftpException e) { |
| | | // 目录不存在,则创建文件夹 |
| | | String[] dirs = directory.split("/"); |
| | | String tempPath = ""; |
| | | int index = 0; |
| | | mkdirDir(dirs, tempPath, dirs.length, index); |
| | | } |
| | | sftp.put(input, sftpFileName);// 上传文件 |
| | | } |
| | | |
| | | /** |
| | | * 将输入流的数据上传到sftp作为文件 |
| | | * |
| | | * @param directory |
| | | * 上传到该目录(单层目录) |
| | | * @param sftpFileName |
| | | * sftp端文件名 |
| | | * @param input |
| | | * 输入流 |
| | | * @throws SftpException |
| | | * @throws Exception |
| | | */ |
| | | public void upload(String directory, String sftpFileName, InputStream input) throws SftpException { |
| | | try { |
| | | sftp.cd(directory); |
| | | } catch (SftpException e) { |
| | | log.warn("directory is not exist"); |
| | | sftp.mkdir(directory); |
| | | sftp.cd(directory); |
| | | } |
| | | sftp.put(input, sftpFileName); |
| | | log.info("file:{} is upload successful", sftpFileName); |
| | | } |
| | | |
| | | /** |
| | | * 上传单个文件 |
| | | * |
| | | * @param directory |
| | | * 上传到sftp目录 |
| | | * @param uploadFile |
| | | * 要上传的文件,包括路径 |
| | | * @throws FileNotFoundException |
| | | * @throws SftpException |
| | | * @throws Exception |
| | | */ |
| | | public void upload(String directory, String uploadFile) throws FileNotFoundException, SftpException { |
| | | File file = new File(uploadFile); |
| | | upload(directory, file.getName(), new FileInputStream(file)); |
| | | } |
| | | |
| | | /** |
| | | * 将byte[]上传到sftp,作为文件。注意:从String生成byte[]是,要指定字符集。 |
| | | * |
| | | * @param directory |
| | | * 上传到sftp目录 |
| | | * @param sftpFileName |
| | | * 文件在sftp端的命名 |
| | | * @param byteArr |
| | | * 要上传的字节数组 |
| | | * @throws SftpException |
| | | * @throws Exception |
| | | */ |
| | | public void upload(String directory, String sftpFileName, byte[] byteArr) throws SftpException { |
| | | upload(directory, sftpFileName, new ByteArrayInputStream(byteArr)); |
| | | } |
| | | |
| | | /** |
| | | * 将字符串按照指定的字符编码上传到sftp |
| | | * |
| | | * @param directory |
| | | * 上传到sftp目录 |
| | | * @param sftpFileName |
| | | * 文件在sftp端的命名 |
| | | * @param dataStr |
| | | * 待上传的数据 |
| | | * @param charsetName |
| | | * sftp上的文件,按该字符编码保存 |
| | | * @throws UnsupportedEncodingException |
| | | * @throws SftpException |
| | | * @throws Exception |
| | | */ |
| | | public void upload(String directory, String sftpFileName, String dataStr, String charsetName) |
| | | throws UnsupportedEncodingException, SftpException { |
| | | upload(directory, sftpFileName, new ByteArrayInputStream(dataStr.getBytes(charsetName))); |
| | | } |
| | | |
| | | /** |
| | | * 下载文件 |
| | | * |
| | | * @param directory |
| | | * 下载目录 |
| | | * @param downloadFile |
| | | * 下载的文件 |
| | | * @param saveFile |
| | | * 存在本地的路径 |
| | | * @throws SftpException |
| | | * @throws FileNotFoundException |
| | | * @throws Exception |
| | | */ |
| | | public void download(String directory, String downloadFile, String saveFile) |
| | | throws SftpException, FileNotFoundException { |
| | | if (directory != null && !"".equals(directory)) { |
| | | sftp.cd(directory); |
| | | } |
| | | File file = new File(saveFile); |
| | | sftp.get(downloadFile, new FileOutputStream(file)); |
| | | log.info("file:{} is download successful", downloadFile); |
| | | } |
| | | |
| | | /** |
| | | * 下载文件 |
| | | * |
| | | * @param directory |
| | | * 下载目录 |
| | | * @param downloadFile |
| | | * 下载的文件名 |
| | | * @return 字节数组 |
| | | * @throws SftpException |
| | | * @throws IOException |
| | | * @throws Exception |
| | | */ |
| | | public byte[] download(String directory, String downloadFile) throws SftpException, IOException { |
| | | if (directory != null && !"".equals(directory)) { |
| | | sftp.cd(directory); |
| | | } |
| | | InputStream is = sftp.get(downloadFile); |
| | | byte[] fileData = IOUtils.toByteArray(is); |
| | | log.info("file:{} is download successful", downloadFile); |
| | | return fileData; |
| | | } |
| | | |
| | | /** |
| | | * 下载文件 |
| | | * |
| | | * @param directory |
| | | * 下载目录 |
| | | * @param downloadFile |
| | | * 下载的文件名 |
| | | * @return 字节数组 |
| | | * @throws SftpException |
| | | * @throws IOException |
| | | * @throws Exception |
| | | */ |
| | | public InputStream downloadInputStream(String directory, String downloadFile) throws SftpException, IOException { |
| | | if (directory != null && !"".equals(directory)) { |
| | | sftp.cd(directory); |
| | | } |
| | | InputStream is = sftp.get(downloadFile); |
| | | // byte[] fileData = IOUtils.toByteArray(is); |
| | | // log.info("file:{} is download successful", downloadFile); |
| | | return is; |
| | | } |
| | | |
| | | /** |
| | | * 删除文件 |
| | | * |
| | | * @param directory |
| | | * 要删除文件所在目录 |
| | | * @param deleteFile |
| | | * 要删除的文件 |
| | | * @throws SftpException |
| | | * @throws Exception |
| | | */ |
| | | public void delete(String directory, String deleteFile) throws SftpException { |
| | | sftp.cd(directory); |
| | | sftp.rm(deleteFile); |
| | | } |
| | | |
| | | /** |
| | | * 列出目录下的文件 |
| | | * |
| | | * @param directory |
| | | * 要列出的目录 |
| | | * @return |
| | | * @throws SftpException |
| | | */ |
| | | public Vector<?> listFiles(String directory) throws SftpException { |
| | | return sftp.ls(directory); |
| | | } |
| | | |
| | | /** |
| | | * 判断文件或者目录是否存在 |
| | | * |
| | | * @param path |
| | | * 目录或者文件的路径 |
| | | * @return 存在结果 |
| | | */ |
| | | public boolean isExistDir(String path) { |
| | | boolean isExist = false; |
| | | try { |
| | | SftpATTRS sftpATTRS = sftp.lstat(path); |
| | | isExist = true; |
| | | return sftpATTRS.isDir(); |
| | | } catch (Exception e) { |
| | | if (e.getMessage().toLowerCase().equals("no such file")) { |
| | | isExist = false; |
| | | } |
| | | } |
| | | return isExist; |
| | | |
| | | } |
| | | } |
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.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.service.ISysUserRecordService; |
| | | 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.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 自定义拦截器,判断此次请求是否有权限 |
| | | */ |
| | | /** |
| | | * 自定义拦截器,判断此次请求是否有权限 |
| | | */ |
| | | @Component |
| | | public class AuthorizationInterceptor extends HandlerInterceptorAdapter { |
| | | @Autowired |
| | | private TokenManager manager; |
| | | |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @Autowired |
| | | private ISysUserRecordService iSysUserRecordService; |
| | | |
| | | @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); |
| | | //花城token |
| | | String HCtoken = request.getHeader(Constant.HCAUTHORIZATION); |
| | | |
| | | if(StringUtils.isEmpty(token)) |
| | | { |
| | | if (manager.checkHCToken(HCtoken)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getHCUserId(HCtoken)); |
| | | System.out.println("花城用户id:"+manager.getHCUserId(HCtoken)); |
| | | List<HuaChengSysUser> list=iHuaChengSysUserService.selectData(manager.getHCUserId(HCtoken)+"","",""); |
| | | HuaChengSysUser huaChengSysUser=null; |
| | | |
| | | if(list!=null || list.size()>0 ) |
| | | { |
| | | huaChengSysUser=list.get(0); |
| | | } |
| | | |
| | | if(huaChengSysUser!=null && !StringUtils.isEmpty(huaChengSysUser.getUserId()) ) |
| | | { |
| | | SysUser sysUser = IUserService.selectData(null,huaChengSysUser.getPhone(),null); |
| | | if(sysUser==null) |
| | | { |
| | | //本地没有此用户 新用户 |
| | | SysUser newSysUser=new SysUser(); |
| | | //默认 1系统后台用户 |
| | | newSysUser.setUserType("4"); |
| | | newSysUser.setRoleIds("4"); |
| | | newSysUser.setIsDivisionHead("2"); |
| | | newSysUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newSysUser.setUserId(huaChengSysUser.getUserId()); |
| | | newSysUser.setUserName(huaChengSysUser.getNickName()); |
| | | newSysUser.setSex(huaChengSysUser.getSex()); |
| | | newSysUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newSysUser.setCreateTime(LocalDateTime.now()); |
| | | newSysUser.setUpdateTime(LocalDateTime.now()); |
| | | newSysUser.setOpenid(huaChengSysUser.getOpenid()); |
| | | IUserService.insertConfig(newSysUser); |
| | | } |
| | | else |
| | | { |
| | | if(StringUtils.isEmpty(sysUser.getOpenid())) |
| | | { |
| | | sysUser.setOpenid(huaChengSysUser.getOpenid()); |
| | | IUserService.updateConfig(sysUser); |
| | | } |
| | | } |
| | | //新增浏览记录 |
| | | iSysUserRecordService.add(sysUser); |
| | | //删除因为token问题产出的重复脏数据 |
| | | iSysUserRecordService.deleteDistinct(); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (manager.checkToken(token)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getUserId(token)); |
| | | // SysUser ss = IUserService.selectData(manager.getUserId(token)+""); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | // if(!StringUtils.isEmpty(token)) |
| | | // { |
| | | //如果验证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.db.gen.entity.HuaChengSysUser; |
| | | import io.jsonwebtoken.Claims; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.jsonwebtoken.SignatureAlgorithm; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * token验证处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JWTTokenUtil implements Serializable { |
| | | /** |
| | | * 从数据声明生成令牌 |
| | | * |
| | | * @param claims |
| | | * 数据声明 |
| | | * @return 令牌 |
| | | */ |
| | | private static String generateToken(Map<String, Object> claims) { |
| | | Date expirationDate = new Date(System.currentTimeMillis() + TokenConstant.EXPIRETIME_LONG * 60 * 1000 * 72); |
| | | return Jwts.builder().setClaims(claims).setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, TokenConstant.SECRET).compact(); |
| | | } |
| | | |
| | | /** |
| | | * 生成刷新token |
| | | * |
| | | * @param claims |
| | | * tokenbody |
| | | * @return refreshtoken |
| | | */ |
| | | private static String generateTokenRefreshToken(Map<String, Object> claims) { |
| | | Date expirationDate = new Date(System.currentTimeMillis() + TokenConstant.EXPIRETIME_REFRESH * 60 * 60 * 1000); |
| | | return Jwts.builder().setClaims(claims).setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, TokenConstant.SECRET).compact(); |
| | | } |
| | | |
| | | /** |
| | | * 从令牌中获取数据声明 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 数据声明 |
| | | */ |
| | | public static Claims getClaimsFromToken(String token) { |
| | | Claims claims; |
| | | try { |
| | | claims = Jwts.parser().setSigningKey(TokenConstant.SECRET).parseClaimsJws(token).getBody(); |
| | | } catch (Exception e) { |
| | | claims = null; |
| | | } |
| | | return claims; |
| | | } |
| | | |
| | | /** |
| | | * 生成令牌 |
| | | * |
| | | * @param loginUserInfoVO |
| | | * 用户 |
| | | * @return 令牌 |
| | | */ |
| | | public static String generateToken(HuaChengSysUser loginUserInfoVO) { |
| | | Map<String, Object> claims = new HashMap<>(2); |
| | | claims.put("sub", loginUserInfoVO.getUserId()); |
| | | claims.put("created", new Date()); |
| | | claims.put("type", loginUserInfoVO.getType()); |
| | | return generateToken(claims); |
| | | } |
| | | |
| | | /** |
| | | * 从令牌中获取用户名 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 用户名 |
| | | */ |
| | | public static String getUsernameFromToken(String token) { |
| | | String username; |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | username = claims.getSubject(); |
| | | } catch (Exception e) { |
| | | username = null; |
| | | } |
| | | return username; |
| | | } |
| | | |
| | | /** |
| | | * 判断令牌是否过期 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 是否过期 |
| | | */ |
| | | public static Boolean isTokenExpired(String token) { |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | Date expiration = claims.getExpiration(); |
| | | return expiration.before(new Date()); |
| | | } catch (Exception e) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 刷新令牌 |
| | | * |
| | | * @param token |
| | | * 原令牌 |
| | | * @return 新令牌 |
| | | */ |
| | | public static String refreshToken(String token) { |
| | | String refreshedToken; |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | claims.put("created", new Date()); |
| | | refreshedToken = generateToken(claims); |
| | | } catch (Exception e) { |
| | | refreshedToken = null; |
| | | } |
| | | return refreshedToken; |
| | | } |
| | | |
| | | /** |
| | | * 验证令牌 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @param loginUserInfoVO |
| | | * 用户 |
| | | * @return 是否有效 |
| | | */ |
| | | public static Boolean validateToken(String token, HuaChengSysUser loginUserInfoVO) { |
| | | String username = getUsernameFromToken(token); |
| | | return (username.equals(loginUserInfoVO.getUserId()) && !isTokenExpired(token)); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken( |
| | | "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjIsInR5cGUiOjEsImV4cCI6MTYwNjM1NzkzOSwiY3JlYXRlZCI6MTYwNjM1NjEzOTEzN30.zIj31TLHk4B9F45OszrJWfOlhZL5CWviP2RgsFP6LZuci6MlPn0iVbekioP01DRsu59mWd5FMyhd9WLvMtfxMg"); |
| | | Boolean tokenExpired = JWTTokenUtil.isTokenExpired( |
| | | "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjIsInR5cGUiOjEsImV4cCI6MTYwNjM2MDQzNSwiY3JlYXRlZCI6MTYwNjM1ODYzNTI3MX0.7R3SG6hu-sr_KiPpgepubl_1FdaooCNJ0URHWv6Jynr7m8JIar2kUAnhHfWOfHrNILQb5Q-nqxceXdavcuVOXg"); |
| | | System.out.println(claims); |
| | | } |
| | | |
| | | /** |
| | | * 生成刷新token |
| | | * |
| | | * @param loginUserInfoVO |
| | | * 登录用户基本信息 |
| | | * @return refreshtoken |
| | | */ |
| | | public static String generateRefeshToken(HuaChengSysUser loginUserInfoVO) { |
| | | Map<String, Object> claims = new HashMap<>(2); |
| | | claims.put("sub", loginUserInfoVO.getUserId()); |
| | | claims.put("created", new Date()); |
| | | claims.put("type", loginUserInfoVO.getType()); |
| | | return generateTokenRefreshToken(claims); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | import com.dg.core.Constant; |
| | | import io.jsonwebtoken.Claims; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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 org.springframework.util.ObjectUtils; |
| | | |
| | | 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(String userId, String 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 (StringUtils.isEmpty(token)) { |
| | | 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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 验证花城token |
| | | * @param token |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean checkHCToken(String token) { |
| | | if (StringUtils.isEmpty(token)) { |
| | | return false; |
| | | } |
| | | // token解析 |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken(token); |
| | | if (ObjectUtils.isEmpty(claims)) { |
| | | return false; |
| | | } |
| | | String userId = claims.getSubject(); |
| | | if (ObjectUtils.isEmpty(userId)) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public long getUserId(String token) { |
| | | if (token == null) { |
| | | return -1; |
| | | } |
| | | String userId = redis.boundValueOps(token).get(); |
| | | return Long.parseLong(userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取花城e+的 UserId |
| | | * @param token |
| | | * @return |
| | | */ |
| | | @Override |
| | | public long getHCUserId(String token) { |
| | | if (token == null) { |
| | | return -1; |
| | | } |
| | | // token解析 |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken(token); |
| | | if (ObjectUtils.isEmpty(claims)) { |
| | | return -1; |
| | | } |
| | | String userId = claims.getSubject(); |
| | | if (ObjectUtils.isEmpty(userId)) |
| | | { |
| | | return -1; |
| | | } |
| | | return Long.parseLong(userId); |
| | | } |
| | | |
| | | public void deleteToken(String token) { |
| | | redis.delete(token); |
| | | } |
| | | |
| | | @Override |
| | | public String getTokenByUserId(String userId) { |
| | | return redis.boundValueOps(userId).get(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: token |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 14:44 |
| | | **/ |
| | | public class TokenConstant { |
| | | |
| | | public static final String TOKEN_HEADER = "Authorization"; |
| | | public static final String TOKEN_LOGOUT = "token_logout"; |
| | | public static final String TOKEN_PRE = "Bearer "; |
| | | public static final String TOKEN_USERINFO = "token_userinfo"; |
| | | /** |
| | | * 30分钟 |
| | | */ |
| | | public static final int EXPIRETIME = 300; |
| | | public static final Long EXPIRETIME_LONG = 300L; |
| | | public static final String SECRET = "UTivpbn%n9O!KnnL"; |
| | | /** |
| | | * 24小时 |
| | | */ |
| | | public static final int EXPIRETIME_REFRESH = 24; |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | public interface TokenManager { |
| | | /** |
| | | * 创建一个token关联上指定用户 |
| | | * |
| | | * @param userId 指定用户的id |
| | | * @return 生成的token |
| | | */ |
| | | public String createToken(String userId, String role); |
| | | |
| | | /** |
| | | * 检查token是否有效 |
| | | * |
| | | * @param token |
| | | * @return 是否有效 |
| | | */ |
| | | public boolean checkToken(String token); |
| | | |
| | | /** |
| | | * 检查花城token是否有效 |
| | | * @param token |
| | | * @return |
| | | */ |
| | | public boolean checkHCToken(String token); |
| | | |
| | | public long getUserId(String token); |
| | | public long getHCUserId(String token); |
| | | |
| | | public void deleteToken(String token); |
| | | |
| | | public String getTokenByUserId(String 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.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 增加方法注入,将含有CurrentUser注解的方法参数注入当前登录用户 |
| | | */ |
| | | @Component |
| | | public class CurrentUserMethodArgumentResolver implements HandlerMethodArgumentResolver { |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @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) { |
| | | //从数据库中查询并返回 |
| | | SysUser sysUser=userService.selectData(currentUserId+"",null,null); |
| | | if(sysUser!=null) |
| | | { |
| | | return sysUser; |
| | | } |
| | | |
| | | List<HuaChengSysUser> list=iHuaChengSysUserService.selectData(currentUserId+"","",""); |
| | | HuaChengSysUser huaChengSysUser=null; |
| | | |
| | | if(list!=null || list.size()>0 ) |
| | | { |
| | | huaChengSysUser=list.get(0); |
| | | } |
| | | |
| | | if(huaChengSysUser!=null) |
| | | { |
| | | sysUser=userService.selectData(null,huaChengSysUser.getPhone(),null); |
| | | if(sysUser!=null) |
| | | { |
| | | return sysUser; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // throw new MissingServletRequestPartException(Constant.CURRENT_USER_ID); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.Guidance; |
| | | import com.dg.core.db.gen.entity.GuidePlate; |
| | | import com.dg.core.db.gen.entity.OrganizationEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface HomeStatisticsService |
| | | { |
| | | /** |
| | | * 按办结量排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> guidePlatePeople(List<String> ids); |
| | | |
| | | /** |
| | | *按评分排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> score(List<String> ids); |
| | | |
| | | /** |
| | | * 按超时 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> timeout(List<String> ids); |
| | | |
| | | /** |
| | | * 按未办结 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<GuidePlate> tosettled(List<String> ids); |
| | | |
| | | /** |
| | | * 按工单量 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<GuidePlate> workunit(List<String> ids); |
| | | |
| | | /** |
| | | * 评分 |
| | | * @return |
| | | */ |
| | | Integer organizationScore(List<String> ids); |
| | | |
| | | /** |
| | | * 办结量 |
| | | * @return |
| | | */ |
| | | Integer organizationNum(List<String> ids); |
| | | /** |
| | | * 获取一级部门 |
| | | * @return |
| | | */ |
| | | List<OrganizationEntity> getDepartment(); |
| | | |
| | | /** |
| | | * 办事指南根据导办数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceTransaction(List<String> ids); |
| | | |
| | | /** |
| | | * 办事指南根据浏览数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceBrowse(List<String> ids); |
| | | |
| | | /** |
| | | * 导办人员统计数 |
| | | * @return |
| | | */ |
| | | Integer staffNum(List<String> ids); |
| | | |
| | | /** |
| | | * 办事指南数量统计 |
| | | * @return |
| | | */ |
| | | Integer countWork(List<String> ids); |
| | | |
| | | /** |
| | | * 获取统计数据 首页用 勿动 |
| | | */ |
| | | int countStatisticsNum(List<String> classifyIds,List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 首页统计用 |
| | | * @param parentId |
| | | * @param classifyGrade |
| | | * @return |
| | | */ |
| | | public List<ClassifyAdministration> getClassify(String parentId, |
| | | String classifyGrade); |
| | | |
| | | |
| | | List<String> countId(String district); |
| | | |
| | | /** |
| | | * 首页统计用 |
| | | * @return |
| | | */ |
| | | String reversionRate(String state,String isTimeout); |
| | | |
| | | |
| | | int rangeStatistics(List<String> ids); |
| | | |
| | | } |
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 com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAreaCodeService { |
| | | |
| | | /** |
| | | * 根据指南id获取所属地区 |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> getAreaCodeByTransactionId(Integer transactionId); |
| | | |
| | | /** |
| | | * 根据pcode获取所属地区 |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> getListByPCode(String id); |
| | | } |
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.AutomessageCommonProblem; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAutomessageCommonProblemService { |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页) |
| | | * @return |
| | | */ |
| | | List<AutomessageCommonProblem> selectList(); |
| | | |
| | | /** |
| | | * 获取常见问题列表(分页) |
| | | * @param page |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<AutomessageCommonProblem> selectConfigList(IPage<AutomessageCommonProblem> page, Integer state, String title, String content); |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页查找) |
| | | * @return |
| | | */ |
| | | List<AutomessageCommonProblem> selectConfigList(String title, String content); |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表统计数量 |
| | | * @return |
| | | */ |
| | | Integer countAutomessageCommonProblem( String title, String content); |
| | | |
| | | |
| | | /** |
| | | * 添加常见问题数据 |
| | | * @return |
| | | */ |
| | | ResultData add(AutomessageCommonProblem automessageCommonProblem); |
| | | |
| | | /** |
| | | * 修改常见问题数据 |
| | | * @return |
| | | */ |
| | | ResultData update(AutomessageCommonProblem automessageCommonProblem); |
| | | |
| | | /** |
| | | * 删除常见问题数据 |
| | | * @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.AutomessagePolicyDocuments; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAutomessagePolicyDocumentsService { |
| | | |
| | | /** |
| | | * 获取法律法规政策文件 (分页) |
| | | * @param page |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<AutomessagePolicyDocuments> selectConfigList(IPage<AutomessagePolicyDocuments> page, Integer state, String name, String type, SysUser sysUser,Integer departmentId, List<String> ids); |
| | | |
| | | /** |
| | | * 获取法律法规政策文件 (不分页) |
| | | * @param name 名称 |
| | | * @param type 类型 |
| | | * @return |
| | | */ |
| | | List<AutomessagePolicyDocuments> selectConfigList(String name, String type,Integer departmentId, List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 新增法律法规政策文件 |
| | | * @return |
| | | */ |
| | | int add(AutomessagePolicyDocuments automessagePolicyDocuments); |
| | | |
| | | /** |
| | | * 修改法律法规政策文件 |
| | | * @return |
| | | */ |
| | | int update(AutomessagePolicyDocuments automessagePolicyDocuments); |
| | | |
| | | /** |
| | | * 删除法律法规政策文件 |
| | | * @return |
| | | */ |
| | | int delete(Integer id); |
| | | |
| | | /** |
| | | * 根据id获取法律法规政策文件数据 |
| | | * @return |
| | | */ |
| | | AutomessagePolicyDocuments selectAutomessagePolicyDocumentById(Integer id); |
| | | |
| | | /** |
| | | * 获取法律法规政策文件 (统计) |
| | | * @return |
| | | */ |
| | | Integer selectCountList(String name,String type,Integer departmentId,List<String> ids); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageSmartConsulting; |
| | | |
| | | public interface IAutomessageSmartConsultingService { |
| | | |
| | | /** |
| | | * 新增智能咨询访问记录 |
| | | * @return |
| | | */ |
| | | int add(AutomessageSmartConsulting automessageSmartConsulting); |
| | | |
| | | /** |
| | | * 统计访问量 |
| | | * @return |
| | | */ |
| | | Long countSmartConsulting(); |
| | | } |
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.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); |
| | | |
| | | |
| | | /** |
| | | * 获取分类根据id 如果是二级id则获取的是办事指南 |
| | | * @return |
| | | */ |
| | | ResultData queryListById(Integer id); |
| | | |
| | | /** |
| | | * 根据上级id查询子分类 |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<String> selectParent(String parentId); |
| | | |
| | | List<ClassifyAdministration> selectParentData(String parentId); |
| | | |
| | | |
| | | } |
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, |
| | | String Name,List<String> ids,String userId); |
| | | |
| | | /** |
| | | * 获取附件列表全部 |
| | | * @param Name |
| | | * @return |
| | | */ |
| | | public List<ElseAccessoryEntity> selectConfigList(String Name,List<String> ids,String userId); |
| | | |
| | | |
| | | /** |
| | | * 新增列表 |
| | | * @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,List<String> ids); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IGuideEvolveService |
| | | { |
| | | /** |
| | | * 查询记录列表 |
| | | * @return |
| | | */ |
| | | public List<GuideEvolveEntity> selectConfigList(String guideId, SysUser sysUser); |
| | | |
| | | /** |
| | | * 新增记录 |
| | | * @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(); |
| | | |
| | | /** |
| | | * 更新工单id为空的脏数据 |
| | | * @return |
| | | */ |
| | | int updateGuid(); |
| | | |
| | | } |
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.*; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | 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); |
| | | |
| | | /** |
| | | * 获取个人中心工单数据 |
| | | * @param submitUserId |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectBySubmitId(String submitUserId); |
| | | |
| | | /** |
| | | * 获取工单列表(分页) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectConfigList(IPage<GuideRepairOrder> page, Integer state, |
| | | String matterName, List<String> ids, String status, String guideUserId, |
| | | String createTimeStartTime, String createTimeTimeEndTime, String classifyId); |
| | | |
| | | /** |
| | | * 获取工单列表(不分页用于小程序) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | List<GuideRepairOrder> selectConfigList(String matterName, List<String> ids,String status, |
| | | String guideUserId, String createTimeStartTime,String createTimeTimeEndTime,String classifyId); |
| | | |
| | | |
| | | /** |
| | | * 获取工单列表(求和) |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | int countConfigList(String matterName,List<String> ids,String status,String guideUserId); |
| | | |
| | | |
| | | /** |
| | | * 很具用户id查询是否有对应工单 |
| | | * @return |
| | | */ |
| | | int countUser(String userId,String state); |
| | | |
| | | /** |
| | | * 根据进展类修改用户代办数量 |
| | | * @param order |
| | | * @return |
| | | */ |
| | | int updateSysUserOrderNum(GuideEvolveEntity order); |
| | | |
| | | /** |
| | | * 统计工单用 1 今天 2昨天 3本月 4本年度 String time |
| | | * @return |
| | | */ |
| | | int countStatisticsNum(String state,List<String> ids,String time,String isTimeout, |
| | | String evaluateState,List<String> classifyIds, |
| | | String serviceState,String guideUserId); |
| | | |
| | | /** |
| | | * 统计数据 |
| | | * @param state |
| | | * @param ids |
| | | * @param time |
| | | * @return |
| | | */ |
| | | List<CountListNum> countListNum(String state, |
| | | List<String> ids, |
| | | Integer time); |
| | | |
| | | /** |
| | | * 获取提工单提交交人员信息 |
| | | * @return |
| | | */ |
| | | SysUser getSubmitUser(GuideRepairOrder guideRepairOrder); |
| | | |
| | | |
| | | /** |
| | | * 设置超时时间 |
| | | * @return |
| | | */ |
| | | GuideRepairOrder setTimeoutTim(GuideRepairOrder guideRepairOrder); |
| | | |
| | | |
| | | /** |
| | | * 导办人员有新订单推送消息 |
| | | * @return |
| | | */ |
| | | void sendGuideRepairOrderSubmit (String openid,GuideRepairOrder guideRepairOrder); |
| | | |
| | | /** |
| | | * 删除工单 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | int deleteConfigById(String Id); |
| | | |
| | | /** |
| | | * 推送超时工单 |
| | | * @return |
| | | */ |
| | | ResultData pushOvertimeGuideRepairOrder(); |
| | | |
| | | /** |
| | | * 更改状态为好评 |
| | | * @return |
| | | */ |
| | | int updateEvaluate(); |
| | | |
| | | |
| | | /** |
| | | * 删除评论 |
| | | * @return |
| | | */ |
| | | ResultData deleteComment(Integer id, SysUser sysUser); |
| | | |
| | | |
| | | /** |
| | | * 发送工单提醒信息 |
| | | * @return |
| | | */ |
| | | ResultData pushNoticeTimeRepairOrder(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IHuaChengSysUserService |
| | | { |
| | | public List<HuaChengSysUser> selectConfigList(); |
| | | |
| | | public List<HuaChengSysUser> selectData(String userId,String account,String phone); |
| | | |
| | | public int selectNum(); |
| | | } |
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.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IOrganizationChartService |
| | | { |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | public List<OrganizationChartEntity> selectConfigList(String parentId,String grade,List<String> ids); |
| | | |
| | | |
| | | public List<OrganizationChartEntity> selectConfigList(List<String> ids); |
| | | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | 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); |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName,List<String> ids); |
| | | |
| | | |
| | | /** |
| | | * 统计数量(部门应用) |
| | | */ |
| | | int countList(String organizationName,List<String> ids); |
| | | |
| | | /** |
| | | * 获取部门下子部门的全部id |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<String> getIds(String id); |
| | | |
| | | |
| | | /** |
| | | * 根据id 查询是否有子部门 |
| | | * @param parentId |
| | | * @param grade |
| | | * @return |
| | | */ |
| | | public List<OrganizationChartEntity> selectParentList(String parentId,String grade); |
| | | |
| | | /** |
| | | * 获取该部门所有上级部门及其所有下级部门 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<String> getDepartmentId(String id); |
| | | |
| | | |
| | | /** |
| | | * 获取该部门的一级部门 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String getStairId(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,List<String> ids,String userId); |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @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,List<String> ids); |
| | | |
| | | } |
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,String name); |
| | | |
| | | /** |
| | | * 新增角色 |
| | | * @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(String name); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.RoleMenuEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IRoleMenuService |
| | | { |
| | | /** |
| | | * 根据角色获取菜单id |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | public List<RoleMenuEntity> selectConfigList(String roleId); |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int insertConfig(RoleMenuEntity entity); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public int updateConfig(RoleMenuEntity entity); |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public int deleteConfigById(String Id); |
| | | } |
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.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.AutomessageSysSettings; |
| | | |
| | | public interface ISysSettingsService { |
| | | |
| | | |
| | | /** |
| | | * 按设置名称查找设置信息 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData selectByName(String settingName); |
| | | |
| | | /** |
| | | * 修改设置信息 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData update(AutomessageSysSettings automessageSysSettings); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | |
| | | |
| | | public interface ISysUserRecordService { |
| | | |
| | | /** |
| | | * 增加用户访问记录 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData add(SysUser sysUser); |
| | | |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | ResultData selectUserRecordCount(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.近15天 2.近30天 3.近一年 |
| | | * @return |
| | | */ |
| | | ResultData selectByDateType(Integer dateType); |
| | | |
| | | /** |
| | | * 删除因为token问题产出的重复脏数据 |
| | | * @return |
| | | */ |
| | | Integer deleteDistinct(); |
| | | } |
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.SysUser; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ISysUserService |
| | | { |
| | | SysUser getUserByAccount(String account); |
| | | /** |
| | | * 查询聊天列表 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType, |
| | | String userName,List<String> ids,String isDivisionHead); |
| | | |
| | | |
| | | SysUser selectData(String userId,String phonenumber,String loginName); |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | | * @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,String userName,List<String> ids,String isDivisionHead); |
| | | |
| | | /** |
| | | * 发送验证码(如果没有该用户则新建用户) |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | ResultData smsSend(SysUser user); |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | ResultData loginByAccount(String phonenumber, String code); |
| | | |
| | | /** |
| | | * 根据部门id及分类id获取导办用户 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | List<SysUser> selectListByDepartmentId(String departmentId,String classifyId); |
| | | |
| | | /** |
| | | * 通过手机号获取用户信息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | ResultData loginByPhonenumber(String phonenumber); |
| | | |
| | | |
| | | /** |
| | | * 查询用户列表(不分页) |
| | | * @param userType 用户类型 |
| | | * @return 结果 |
| | | */ |
| | | List<SysUser> queryList(Integer userType,String keyWor); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | 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 org.springframework.data.repository.query.Param; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ITransactionEventService |
| | | { |
| | | /** |
| | | * 查询导办事务详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public TransactionEvent selectConfigData(String Id, SysUser sysUser); |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @return |
| | | */ |
| | | public List<TransactionEvent> selectConfigList(IPage<TransactionEvent> page, Integer state, |
| | | String keyword, String classifyGrade, |
| | | List<String> ids); |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @return |
| | | */ |
| | | public List<TransactionEvent> selectConfigList(String keyword, String classifyGrade, |
| | | List<String> ids); |
| | | |
| | | /** |
| | | * 新增导办事务 |
| | | * @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 keyword,String classifyGrade,List<String> ids); |
| | | |
| | | /** |
| | | * 导办事务搜索 |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | QueryResults queryMatterNameList(IPage<Search> page, Integer state,Integer recommendSize, String keyWord); |
| | | |
| | | |
| | | /** |
| | | * 导办事务搜索(无分页用于小程序) |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | QueryResults queryMatterNameList(String keyWord); |
| | | |
| | | /** |
| | | * 导办事务搜索统计数量 |
| | | * @param matterName |
| | | * @return |
| | | */ |
| | | int countNumByMatterName(String matterName); |
| | | |
| | | /** |
| | | * 根据分类id查询导办事务 |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryByClassifyIdList(String classifyId,Integer departmentId); |
| | | |
| | | |
| | | /** |
| | | * 根据分类id查询导办事务(分页) |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryByClassifyIdList(IPage<TransactionEvent> page, Integer state,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(String keyWord); |
| | | |
| | | /** |
| | | * 智能咨询 |
| | | * @return |
| | | */ |
| | | RecommendResult smartConsulting(String keyWord); |
| | | |
| | | |
| | | /** |
| | | * 根据部门判断是否有事项名称重复 |
| | | */ |
| | | String selectDataIfExist(@Param("departmentId") String departmentId, |
| | | @Param("matterName") String matterName); |
| | | |
| | | |
| | | /** |
| | | * 根据办事分类获取办事指南 |
| | | */ |
| | | List<String> selectclassifyId(String classifyId); |
| | | |
| | | |
| | | /** |
| | | * 根据分类筛选数据 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> selectClassifyList(List<String> ids); |
| | | Integer batchImport(String fileName, MultipartFile file) ; |
| | | |
| | | } |
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.Arrays; |
| | | import java.util.HashMap; |
| | | 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) { |
| | | List<String> areaCodes = new ArrayList<>(); |
| | | TransactionEvent transactionEvent = transactionEventMapper.selectOne(new QueryWrapper<TransactionEvent>().lambda(). |
| | | eq(TransactionEvent::getId, transactionId)); |
| | | List<String> departmentIds = new ArrayList<>(); |
| | | if (transactionEvent.getDepartmentIds() != null) { |
| | | departmentIds = new ArrayList<>(Arrays.asList(transactionEvent.getDepartmentIds().split(","))); |
| | | } |
| | | |
| | | departmentIds.add(transactionEvent.getDepartmentId()); |
| | | for (String departmentId : departmentIds) { |
| | | OrganizationChartEntity organizationChartEntity = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getId, departmentId)); |
| | | 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()); |
| | | } |
| | | |
| | | } |
| | | return baseMapper.selectByIdSet(areaCodes); |
| | | } |
| | | |
| | | |
| | | public List<String> getAreaCodeIds(List<String> areaCodes, OrganizationChartEntity organizationChartEntity) { |
| | | List<OrganizationChartEntity> organizationChartEntitys = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChartEntity.getId())); |
| | | for (OrganizationChartEntity organizationChart : organizationChartEntitys) { |
| | | if (organizationChart.getCity() != null) |
| | | areaCodes.add(organizationChart.getCity()); |
| | | if (organizationChart.getDistrict() != null) |
| | | areaCodes.add(organizationChart.getDistrict()); |
| | | if (organizationChart.getVillage() != null) |
| | | areaCodes.add(organizationChart.getVillage()); |
| | | getAreaCodeIds(areaCodes, organizationChart); |
| | | } |
| | | return areaCodes; |
| | | } |
| | | |
| | | @Override |
| | | public List<AreaCode2022> getListByPCode(String id) { |
| | | List<AreaCode2022> areaCode2022s = baseMapper.selectList(new QueryWrapper<AreaCode2022>().lambda().eq(AreaCode2022::getPcode, id)); |
| | | for (AreaCode2022 areaCode2022 : areaCode2022s) { |
| | | if (areaCode2022.getLevel() != 3) |
| | | areaCode2022.setChild(this.getListByPCode(areaCode2022.getCode().toString())); |
| | | } |
| | | return areaCode2022s; |
| | | } |
| | | |
| | | |
| | | } |
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.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.mapper.AutomessageCommonProblemMapper; |
| | | import com.dg.core.service.IAutomessageCommonProblemService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AutomessageCommonProblemServiceImpl extends ServiceImpl<AutomessageCommonProblemMapper, AutomessageCommonProblem> implements IAutomessageCommonProblemService { |
| | | |
| | | @Override |
| | | public List<AutomessageCommonProblem> selectList(){ |
| | | return baseMapper.selectList(new QueryWrapper<AutomessageCommonProblem>().lambda()); |
| | | } |
| | | |
| | | @Override |
| | | public List<AutomessageCommonProblem> selectConfigList(IPage<AutomessageCommonProblem> page, Integer state, String title, String content) { |
| | | return baseMapper.selectConfigList(page,state,title,content); |
| | | } |
| | | |
| | | @Override |
| | | public List<AutomessageCommonProblem> selectConfigList(String title, String content) { |
| | | return baseMapper.selectConfigList(title,content); |
| | | } |
| | | |
| | | @Override |
| | | public Integer countAutomessageCommonProblem( String title, String content){ |
| | | return baseMapper.countConfigList(title,content); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData add(AutomessageCommonProblem automessageCommonProblem){ |
| | | if (automessageCommonProblem.getContent()==null){ |
| | | return ResultData.error("常见问题不能空"); |
| | | } |
| | | if (automessageCommonProblem.getTitle()==null){ |
| | | return ResultData.error("回答内容题不能空"); |
| | | } |
| | | automessageCommonProblem.setCreateTime(LocalDateTime.now()); |
| | | automessageCommonProblem.setUpdateTime(LocalDateTime.now()); |
| | | int insert = baseMapper.insert(automessageCommonProblem); |
| | | if (insert>0){ |
| | | return ResultData.success(); |
| | | } |
| | | else { |
| | | return ResultData.error("添加失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ResultData update(AutomessageCommonProblem automessageCommonProblem){ |
| | | if (automessageCommonProblem.getContent()==null){ |
| | | return ResultData.error("常见问题不能空"); |
| | | } |
| | | if (automessageCommonProblem.getTitle()==null){ |
| | | return ResultData.error("回答内容题不能空"); |
| | | } |
| | | automessageCommonProblem.setUpdateTime(LocalDateTime.now()); |
| | | int i = baseMapper.updateById(automessageCommonProblem); |
| | | if (i>0){ |
| | | return ResultData.success(); |
| | | } |
| | | else { |
| | | return ResultData.error("修改失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @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.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.AutomessagePolicyDocuments; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.AutomessagePolicyDocumentsMapper; |
| | | import com.dg.core.service.IAutomessagePolicyDocumentsService; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AutomessagePolicyDocumentsServiceImpl extends ServiceImpl<AutomessagePolicyDocumentsMapper, AutomessagePolicyDocuments> implements IAutomessagePolicyDocumentsService { |
| | | |
| | | @Override |
| | | public List<AutomessagePolicyDocuments> selectConfigList(IPage<AutomessagePolicyDocuments> page, Integer state, String name, String type, SysUser sysUser,Integer departmentId, List<String> ids) { |
| | | List<AutomessagePolicyDocuments> automessagePolicyDocumentsList = baseMapper.selectConfigList(page, state, name, type, departmentId, ids); |
| | | if (sysUser!=null){ |
| | | for (AutomessagePolicyDocuments automessagePolicyDocuments:automessagePolicyDocumentsList) { |
| | | if(sysUser.getUserType().equals("1")){//超级管理员 |
| | | automessagePolicyDocuments.setIsDelete(1); |
| | | }else if ( sysUser.getIsDivisionHead().equals("1")){//部门领导 |
| | | if (sysUser.getDepartmentId().equals(automessagePolicyDocuments.getDepartmentId().toString())){//如果是一个部门则可以删除 |
| | | automessagePolicyDocuments.setIsDelete(1); |
| | | }else { |
| | | automessagePolicyDocuments.setIsDelete(2); |
| | | } |
| | | } |
| | | else if (sysUser.getUserType().equals("2")){//导办人员 |
| | | if(sysUser.getUserId().equals(automessagePolicyDocuments.getCreateUserId())){//如果它创建的则可以删除 |
| | | automessagePolicyDocuments.setIsDelete(1); |
| | | }else { |
| | | automessagePolicyDocuments.setIsDelete(2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return automessagePolicyDocumentsList; |
| | | } |
| | | |
| | | @Override |
| | | public List<AutomessagePolicyDocuments> selectConfigList(String name, String type,Integer departmentId, List<String> ids) { |
| | | return baseMapper.selectConfigList(name,type,departmentId,ids); |
| | | } |
| | | |
| | | @Override |
| | | public int add(AutomessagePolicyDocuments automessagePolicyDocuments) { |
| | | automessagePolicyDocuments.setCreateTime(LocalDateTime.now()); |
| | | automessagePolicyDocuments.setUpdateTime(LocalDateTime.now()); |
| | | return baseMapper.insert(automessagePolicyDocuments); |
| | | } |
| | | |
| | | @Override |
| | | public int update(AutomessagePolicyDocuments automessagePolicyDocuments) { |
| | | automessagePolicyDocuments.setCreateTime(LocalDateTime.now()); |
| | | automessagePolicyDocuments.setUpdateTime(LocalDateTime.now()); |
| | | return baseMapper.updateById(automessagePolicyDocuments); |
| | | } |
| | | |
| | | @Override |
| | | public int delete(Integer id) { |
| | | return baseMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public AutomessagePolicyDocuments selectAutomessagePolicyDocumentById(Integer id) { |
| | | return baseMapper.selectAutomessagePolicyDocumentById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCountList(String name,String type,Integer departmentId,List<String> ids) { |
| | | return baseMapper.selectCountList(name,type,departmentId,ids); |
| | | } |
| | | |
| | | |
| | | } |
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.TransactionEvent; |
| | | import com.dg.core.db.gen.mapper.ClassifyAdministrationMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ClassifyAdministrationImpl extends ServiceImpl<ClassifyAdministrationMapper, ClassifyAdministration> |
| | | implements IClassifyAdministrationService |
| | | { |
| | | |
| | | |
| | | @Resource |
| | | private TransactionEventMapper transactionEventMapper; |
| | | |
| | | @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 ResultData queryListById(Integer id){ |
| | | if (id.equals(0)){ |
| | | return ResultData.success(baseMapper.selectList(new QueryWrapper<ClassifyAdministration>().lambda() |
| | | .eq(ClassifyAdministration::getParentId,0))); |
| | | } |
| | | ClassifyAdministration classifyAdministration = baseMapper.selectOne(new QueryWrapper<ClassifyAdministration>().lambda() |
| | | .eq(ClassifyAdministration::getId, id)); |
| | | if (classifyAdministration.getClassifyGrade().equals("1")){ |
| | | return ResultData.success(baseMapper.selectList(new QueryWrapper<ClassifyAdministration>().lambda() |
| | | .eq(ClassifyAdministration::getParentId,classifyAdministration.getId()))); |
| | | }else if (classifyAdministration.getClassifyGrade().equals("2")){ |
| | | return ResultData.success(transactionEventMapper.queryByClassifyIdList(id.toString(),null)); |
| | | } |
| | | return ResultData.error(); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> selectParent(String parentId) { |
| | | return baseMapper.selectParent(parentId); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClassifyAdministration> selectParentData(String parentId) { |
| | | return baseMapper.selectParentData(parentId); |
| | | } |
| | | |
| | | |
| | | @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,List<String> ids,String userId) { |
| | | return baseMapper.selectConfigList(page,state,Name, ids,userId); |
| | | } |
| | | |
| | | @Override |
| | | public List<ElseAccessoryEntity> selectConfigList(String Name,List<String> ids,String userId) { |
| | | return baseMapper.selectConfigList(Name,ids,userId); |
| | | } |
| | | |
| | | @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,List<String> ids) { |
| | | return baseMapper.countNum(Name,ids); |
| | | } |
| | | } |
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.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.ElseAccessoryMapper; |
| | | import com.dg.core.db.gen.mapper.GuideEvolveMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class GuideEvolveImpl extends ServiceImpl<GuideEvolveMapper, GuideEvolveEntity> implements IGuideEvolveService |
| | | { |
| | | |
| | | |
| | | @Resource |
| | | private ElseAccessoryMapper elseAccessoryMapper; |
| | | |
| | | @Resource |
| | | private TransactionEventMapper transactionEventMapper; |
| | | |
| | | @Override |
| | | public List<GuideEvolveEntity> selectConfigList(String guideId,SysUser sysUser) { |
| | | List<GuideEvolveEntity> guideEvolveEntities; |
| | | if ((sysUser.getUserType().equals("3")&&sysUser.getIsDivisionHead().equals("2"))||(sysUser.getUserType().equals("4"))){ |
| | | guideEvolveEntities=baseMapper.selectHideList(guideId); |
| | | }else { |
| | | guideEvolveEntities = baseMapper.selectConfigList(guideId); |
| | | } |
| | | for (GuideEvolveEntity guideEvolveEntity: guideEvolveEntities) { |
| | | String[] split; |
| | | if (guideEvolveEntity.getAccessoryId()!=null){ |
| | | split = guideEvolveEntity.getAccessoryId().split(","); |
| | | guideEvolveEntity.setElseAccessoryEntities( elseAccessoryMapper.selectListByIds(split)); |
| | | } |
| | | if (guideEvolveEntity.getTransactionId()!=null){ |
| | | split=guideEvolveEntity.getTransactionId().split(","); |
| | | guideEvolveEntity.setTransactionEvents(transactionEventMapper.selectListByIds(split)); |
| | | } |
| | | } |
| | | return guideEvolveEntities; |
| | | } |
| | | |
| | | @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(); |
| | | } |
| | | |
| | | @Override |
| | | public int updateGuid() { |
| | | return baseMapper.updateGuid(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | 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.*; |
| | | import com.dg.core.db.gen.mapper.*; |
| | | import com.dg.core.db.manual.mapper.util.ConstantPropertiesUtil; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.ISysSettingsService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.Snowflake; |
| | | import com.dg.core.util.TestDate; |
| | | import com.dg.core.util.WxUtil; |
| | | import com.iceyyy.workday.WorkUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class GuideRepairOrderServiceImpl extends ServiceImpl<GuideRepairOrderMapper, GuideRepairOrder> |
| | | implements IGuideRepairOrderService { |
| | | |
| | | @Resource |
| | | private TransactionEventMapper transactionEventMapper; |
| | | |
| | | @Resource |
| | | private GuideRepairOrderImageMapper guideRepairOrderImageMapper; |
| | | |
| | | @Resource |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | @Resource |
| | | private GuideEvolveMapper guideEvolveMapper; |
| | | |
| | | @Resource |
| | | private AutomessageSysSettingsMapper iSysSettingsMapper; |
| | | |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | @Resource(name = "stringRedisTemplate") |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | private static WxUtil wxUtil; |
| | | |
| | | |
| | | @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()); |
| | | List<String> departmentIds = new ArrayList<>(); |
| | | Boolean isAdd = true;//是否能够新建工单 |
| | | List<GuideRepairOrder> guideRepairOrders = baseMapper.selectList(new QueryWrapper<GuideRepairOrder>().lambda() |
| | | .eq(GuideRepairOrder::getMatterId, guideRepairOrder.getMatterId()) |
| | | .eq(GuideRepairOrder::getConsultContent, guideRepairOrder.getConsultContent())); |
| | | if (guideRepairOrders.size() == 0) { |
| | | isAdd = true; |
| | | } else { |
| | | for (GuideRepairOrder guideRepair : guideRepairOrders) { |
| | | if (guideRepair.getState().equals("1") || guideRepair.getState().equals("2") || guideRepair.getState().equals("6") || guideRepair.getState().equals("7")) { |
| | | isAdd = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (isAdd) { |
| | | //自动分配业务代码开始 |
| | | List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectByCode(transactionEvent.getDepartmentId(), guideRepairOrder.getAreaCode()); |
| | | if (organizationChartEntities.size() > 0) { |
| | | for (OrganizationChartEntity organizationChart : organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | } |
| | | List<SysUser> sysUsers = sysUserMapper.selectListByDepartmentId(departmentIds, "," + transactionEvent.getId(), transactionEvent.getId() + ",");//获取导半人员 |
| | | if (sysUsers.size() == 0) {//如果此所属地区部门没有导半人员则看其下级地区有没有相关分类导办人员 |
| | | for (OrganizationChartEntity organizationChart : organizationChartEntities) { |
| | | //获取下级部门 |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser != null) |
| | | departmentIds = this.getDepartmentIds(organizationChartEntitiesUser, departmentIds); |
| | | } |
| | | sysUsers = sysUserMapper.selectListByDepartmentId(departmentIds, "," + transactionEvent.getId(), transactionEvent.getId() + ",");//获取导半人员 |
| | | if (sysUsers.size() == 0) {//如果该所属地区没有导办人员则为获取其上級地区有没有相关分类导办人员 |
| | | List<String> departmentIdsParent = new ArrayList<>(); |
| | | departmentIdsParent.addAll(departmentIds); |
| | | for (String departmentId : departmentIdsParent) { |
| | | OrganizationChartEntity organizationChart = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getId, departmentId)); |
| | | OrganizationChartEntity organizationChartParent = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getId, organizationChart.getParentId())); |
| | | if (organizationChartParent != null) { |
| | | departmentIds.add(organizationChartParent.getId().toString()); |
| | | } |
| | | } |
| | | sysUsers = sysUserMapper.selectListByDepartmentId(departmentIds, "," + transactionEvent.getId(), transactionEvent.getId() + ",");//获取导半人员 |
| | | if (sysUsers.size() == 0) { |
| | | sysUsers = sysUserMapper.selectListByDepartmentId(departmentIds, null, null);//获取导半人员 |
| | | if (sysUsers.size() == 0) { |
| | | //如果该所属地区没有导办人员则为特殊单据需要手动分配 |
| | | guideRepairOrder.setState("1"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (sysUsers.size() > 0) {//系统分配导办人员 |
| | | SysUser sysUser = sysUsers.get(0);//因为sql用了升序排序所以第一条就是待办结最少的人员之一 |
| | | guideRepairOrder.setState("2"); |
| | | sysUser.setTransactionNum(sysUser.getTransactionNum() + 1); |
| | | sysUserMapper.updateById(sysUser); |
| | | guideRepairOrder.setGuideUserId(sysUser.getUserId().toString()); |
| | | guideRepairOrder.setGuideDepartmentId(sysUser.getDepartmentId()); |
| | | guideRepairOrder.setGuideUserPhone(sysUser.getPhonenumber()); |
| | | //新增分配记录 |
| | | GuideEvolveEntity entity = new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("8"); |
| | | entity.setDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setToUserId(guideRepairOrder.getGuideUserId() + ""); |
| | | // entity.setFromUserId(guideRepairOrder.getSubmitUserId()); |
| | | // entity.setFromDepartmentalId(guideRepairOrder.getGuideDepartmentId()); |
| | | entity.setGuidOrderNum(guideRepairOrder.getOrderNum()); |
| | | //超时时间设置业务开始 |
| | | guideRepairOrder = this.setTimeoutTim(guideRepairOrder); |
| | | //超时时间设置业务结束 |
| | | //消息推送 |
| | | this.sendGuideRepairOrderSubmit(sysUser.getOpenid(), guideRepairOrder); |
| | | //短信发送 |
| | | smsUtil.sendSmsSubmitNew(sysUser.getPhonenumber(), sysUser.getUserName()); |
| | | guideEvolveMapper.insertConfig(entity); |
| | | } |
| | | } else {//如果该办事指南用户所选所属地区无导半部门则为特殊单据需要手动分配 |
| | | guideRepairOrder.setState("1"); |
| | | } |
| | | //自动分配业务代码结束 |
| | | |
| | | guideRepairOrder.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrder.setUpdateTime(LocalDateTime.now()); |
| | | guideRepairOrder.setIsPush(2); |
| | | transactionEvent.setTransactionNum(transactionEvent.getTransactionNum() + 1); |
| | | //保存图片地址 |
| | | if (guideRepairOrder.getImages() != null) { |
| | | String[] images = guideRepairOrder.getImages().split(","); |
| | | for (String image : images) { |
| | | GuideRepairOrderImage guideRepairOrderImage = new GuideRepairOrderImage(); |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | | guideRepairOrderImage.setUrl(image); |
| | | guideRepairOrderImage.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrderImage.setType(1); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | | } |
| | | //保存视频地址 |
| | | if (guideRepairOrder.getVideo() != null) { |
| | | if (guideRepairOrder.getOrderNum() != null) { |
| | | GuideRepairOrderImage guideRepairOrderImage = new GuideRepairOrderImage(); |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | | guideRepairOrderImage.setUrl(guideRepairOrder.getVideo()); |
| | | guideRepairOrderImage.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrderImage.setType(2); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | | } |
| | | |
| | | int ans = baseMapper.insert(guideRepairOrder); |
| | | int i = transactionEventMapper.updateById(transactionEvent); |
| | | if (ans > 0 && i > 0) |
| | | return 1; |
| | | else |
| | | return 0; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public List<String> getDepartmentIds(List<OrganizationChartEntity> organizationChartEntities, List<String> departmentIds) { |
| | | for (OrganizationChartEntity organizationChart : organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser != null) |
| | | departmentIds = this.getDepartmentIds(organizationChartEntitiesUser, departmentIds); |
| | | |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | @Override |
| | | public GuideRepairOrder selectConfigData(String Id, String orderNum) { |
| | | return baseMapper.selectConfigData(Id, orderNum); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(GuideRepairOrder order) { |
| | | if (order.getGuideUserId() != null && !order.getGuideUserId().equals("")) { |
| | | SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, order.getGuideUserId())); |
| | | order.setGuideUserPhone(sysUser.getPhonenumber()); |
| | | } |
| | | return baseMapper.updateConfig(order); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuideRepairOrder> selectBySubmitId(String submitUserId) { |
| | | return baseMapper.selectBySubmitId(submitUserId); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuideRepairOrder> selectConfigList(IPage<GuideRepairOrder> page, Integer state, |
| | | String matterName, List<String> ids, String status, |
| | | String guideUserId, String createTimeStartTime, |
| | | String createTimeTimeEndTime, String classifyId) { |
| | | return baseMapper.selectConfigList(page, state, matterName, ids, status, guideUserId, createTimeStartTime, createTimeTimeEndTime, classifyId); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuideRepairOrder> selectConfigList(String matterName, List<String> ids, String status, |
| | | String guideUserId, String createTimeStartTime, String createTimeTimeEndTime, String classifyId) { |
| | | return baseMapper.selectConfigList(matterName, ids, status, guideUserId, createTimeStartTime, createTimeTimeEndTime, classifyId); |
| | | } |
| | | |
| | | @Override |
| | | public int countConfigList(String matterName, List<String> ids, String status, String guideUserId) { |
| | | return baseMapper.countConfigList(matterName, ids, status, guideUserId); |
| | | } |
| | | |
| | | @Override |
| | | public int countUser(String userId, String state) { |
| | | return baseMapper.countUser(userId, state); |
| | | } |
| | | |
| | | @Override |
| | | public int updateSysUserOrderNum(GuideEvolveEntity order) { |
| | | if (order.getState() != null) { |
| | | if (order.getState().equals("11")) { |
| | | SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, order.getToUserId())); |
| | | GuideRepairOrder guideRepairOrder = baseMapper.selectOne(new QueryWrapper<GuideRepairOrder>().lambda() |
| | | .eq(GuideRepairOrder::getId, order.getGuideId())); |
| | | if (guideRepairOrder != null) { |
| | | this.sendGuideRepairOrderSubmit(sysUser.getOpenid(), guideRepairOrder); |
| | | } |
| | | //短信发送 |
| | | smsUtil.sendSmsSubmitNew(sysUser.getPhonenumber(), sysUser.getUserName()); |
| | | sysUser.setTransactionNum(sysUser.getTransactionNum() + 1); |
| | | return sysUserMapper.updateById(sysUser); |
| | | } else if (order.getState().equals("10")) { |
| | | SysUser sysUserTo = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, order.getToUserId())); |
| | | SysUser sysUserFrom = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, order.getFromUserId())); |
| | | sysUserTo.setTransactionNum(sysUserTo.getTransactionNum() + 1); |
| | | if (sysUserFrom.getUserType().equals(2)) { |
| | | sysUserFrom.setTransactionNum(sysUserFrom.getTransactionNum() - 1); |
| | | sysUserMapper.updateById(sysUserFrom); |
| | | } |
| | | GuideRepairOrder guideRepairOrder = baseMapper.selectOne(new QueryWrapper<GuideRepairOrder>().lambda() |
| | | .eq(GuideRepairOrder::getId, order.getGuideId())); |
| | | //短信发送 |
| | | smsUtil.sendSmsSubmitNew(sysUserTo.getPhonenumber(), sysUserTo.getUserName()); |
| | | if (guideRepairOrder != null) { |
| | | this.sendGuideRepairOrderSubmit(sysUserTo.getOpenid(), guideRepairOrder); |
| | | } |
| | | return sysUserMapper.updateById(sysUserTo); |
| | | } else if (order.getState().equals("7")) { |
| | | SysUser sysUserFrom = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, order.getFromUserId())); |
| | | sysUserFrom.setTransactionNum(sysUserFrom.getTransactionNum() - 1); |
| | | return sysUserMapper.updateById(sysUserFrom); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * 1 今天 2昨天 3本月 4本年度 String time |
| | | * |
| | | * @param state |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int countStatisticsNum(String state, List<String> ids, String time, |
| | | String isTimeout, String evaluateState, |
| | | List<String> classifyIds, String serviceState, |
| | | String guideUserId) { |
| | | return baseMapper.countStatisticsNum(state, ids, time, isTimeout, evaluateState, classifyIds, serviceState, guideUserId); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountListNum> countListNum(String state, List<String> ids, Integer time) { |
| | | return baseMapper.countListNum(state, ids, time); |
| | | } |
| | | |
| | | @Override |
| | | public SysUser getSubmitUser(GuideRepairOrder guideRepairOrder) { |
| | | return sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, guideRepairOrder.getSubmitUserId())); |
| | | } |
| | | |
| | | @Override |
| | | public GuideRepairOrder setTimeoutTim(GuideRepairOrder guideRepairOrder) { |
| | | AutomessageSysSettings automessageSysSettings = iSysSettingsMapper.selectOne( |
| | | new QueryWrapper<AutomessageSysSettings>().lambda() |
| | | .eq(AutomessageSysSettings::getSettingName, "系统超时基础设置")); |
| | | LocalDateTime startTime = LocalDate.now().atTime(0, 0, 0);//今天开始时间 |
| | | LocalDateTime morningStartTime = LocalDate.now().atTime(9, 0, 0);//上午工作开始时间 |
| | | LocalDateTime morningEndTime = LocalDate.now().atTime(12, 0, 0);//上午工作结束时间 |
| | | LocalDateTime afternoonStartTime = LocalDate.now().atTime(13, 30, 0);//下午工作开始时间 |
| | | LocalDateTime afternoonEndTime = LocalDate.now().atTime(17, 0, 0);//下午工作结束时间 |
| | | LocalDateTime endTime = LocalDate.now().atTime(23, 59, 59);//今天结束时间 |
| | | TestDate td = new TestDate(); |
| | | DateTime dateTimeUser = DateTime.now(); |
| | | String format = "YYYYMMdd"; |
| | | String dateTimeToday = dateTimeUser.toString(format); |
| | | if (!WorkUtils.isWorkendDay(dateTimeToday)) { |
| | | if (LocalDateTime.now().isAfter(startTime) && LocalDateTime.now().isBefore(morningStartTime)) {//提交时间是上午上班前 |
| | | guideRepairOrder.setTimeoutTime(LocalDate.now(). |
| | | atTime(9 + automessageSysSettings.getTimeoutNotificationNum(), 0, 0)); |
| | | } else if (LocalDateTime.now().isAfter(morningStartTime) && LocalDateTime.now().isBefore(morningEndTime)) {//提交时间在上午工作日内 |
| | | guideRepairOrder.setTimeoutTime(LocalDateTime.now().plusHours(automessageSysSettings.getTimeoutNotificationNum())); |
| | | } else if (LocalDateTime.now().isAfter(morningEndTime) && LocalDateTime.now().isBefore(afternoonStartTime)) {//提交时间在工作日午休内 |
| | | guideRepairOrder.setTimeoutTime(LocalDate.now(). |
| | | atTime(13 + automessageSysSettings.getTimeoutNotificationNum(), 30, 0)); |
| | | } else if (LocalDateTime.now().isAfter(afternoonStartTime) && LocalDateTime.now().isBefore(afternoonEndTime)) {//提交时间在下午工作日内 |
| | | guideRepairOrder.setTimeoutTime(LocalDateTime.now().plusHours(automessageSysSettings.getTimeoutNotificationNum())); |
| | | } else if (LocalDateTime.now().isAfter(afternoonEndTime) && LocalDateTime.now().isBefore(endTime)) {//提交时间在下午下班后 |
| | | DateTime dateTime = td.nextWeekDay(dateTimeUser); |
| | | Calendar calendar = dateTime.toCalendar(); |
| | | LocalDateTime localDateTime = LocalDateTime.of(calendar.get(Calendar.YEAR), |
| | | calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DATE), |
| | | 9 + automessageSysSettings.getTimeoutNotificationNum(), 0);//设置时间为下一个工作日时间的9点+设置超时时间 |
| | | guideRepairOrder.setTimeoutTime(localDateTime); |
| | | } |
| | | } else//当前不是工作日则获取下一个工作日 |
| | | { |
| | | DateTime dateTime = td.nextWeekDay(dateTimeUser); |
| | | Calendar calendar = dateTime.toCalendar(); |
| | | LocalDateTime localDateTime = LocalDateTime.of(calendar.get(Calendar.YEAR), |
| | | calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DATE), |
| | | 9 + automessageSysSettings.getTimeoutNotificationNum(), 0);//设置时间为下一个工作日时间的9点+设置超时时间 |
| | | guideRepairOrder.setTimeoutTime(localDateTime); |
| | | } |
| | | return guideRepairOrder; |
| | | } |
| | | |
| | | @Override |
| | | public void sendGuideRepairOrderSubmit(String openid, GuideRepairOrder guideRepairOrder) { |
| | | WxUtil wxUtil = new WxUtil(); |
| | | String accessToken = "0"; |
| | | try { |
| | | accessToken = stringRedisTemplate.boundValueOps("access_token:access_token:" + ConstantPropertiesUtil.WX_OPEN_APP_ID).get(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | wxUtil.sendGuideRepairOrderSubmit(openid, accessToken, "WggWK_yG7_qfrTj8bQe-2co4ATgpXamLzT1xvrTu4K0", guideRepairOrder); |
| | | // smsUtil.sendSmsOvertime(sysUser.getPhonenumber(),guideRepairOrder.getMatterName()); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | GuideRepairOrder guideRepairOrderDelete = baseMapper.selectOne(new QueryWrapper<GuideRepairOrder>().lambda().eq(GuideRepairOrder::getId, Id)); |
| | | //删除进展记录 |
| | | guideEvolveMapper.delete(new QueryWrapper<GuideEvolveEntity>().lambda().eq(GuideEvolveEntity::getGuideId, Id)); |
| | | TransactionEvent transactionEvent = transactionEventMapper.selectOne(new QueryWrapper<TransactionEvent>().lambda().eq(TransactionEvent::getId, guideRepairOrderDelete.getMatterId())); |
| | | if (transactionEvent.getTransactionNum() > 0) { |
| | | transactionEvent.setTransactionNum(transactionEvent.getTransactionNum() - 1); |
| | | } |
| | | //对应办事指南减一 |
| | | transactionEventMapper.updateById(transactionEvent); |
| | | SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, guideRepairOrderDelete.getGuideUserId())); |
| | | if (sysUser != null) { |
| | | //对应导半人员待导半数量建议 |
| | | sysUser.setTransactionNum(sysUser.getTransactionNum() - 1); |
| | | sysUserMapper.updateById(sysUser); |
| | | } |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData pushOvertimeGuideRepairOrder() { |
| | | List<GuideRepairOrder> guideRepairOrders = baseMapper.selectOvertime(); |
| | | WxUtil wxUtil = new WxUtil(); |
| | | String accessToken = "0"; |
| | | try { |
| | | accessToken = stringRedisTemplate.boundValueOps("access_token:access_token:" + ConstantPropertiesUtil.WX_OPEN_APP_ID).get(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | for (GuideRepairOrder guideRepairOrder : guideRepairOrders) { |
| | | List<SysUser> sysUsers = sysUserMapper.selectList(new QueryWrapper<SysUser>().lambda().eq(SysUser::getDepartmentId, guideRepairOrder.getGuideDepartmentId()).eq(SysUser::getIsDivisionHead, 1)); |
| | | if (sysUsers != null && sysUsers.size() > 0) { |
| | | for (SysUser sysUser : sysUsers) { |
| | | // transactionEventMapper.selectOne(new QueryWrapper<TransactionEvent>().lambda().eq(TransactionEvent::getId, guideRepairOrder.getMatterId())); |
| | | // SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, guideRepairOrder.getGuideUserId())); |
| | | if (sysUser != null) { |
| | | smsUtil.sendSmsOvertimeNew(sysUser.getPhonenumber(), sysUser.getUserName()); |
| | | wxUtil.sendGuideRepairOrderOvertime(sysUser.getOpenid(), accessToken, "86JgWHhR8b1XxD72WYqMnndyfkiMtSSoCk9NFMwLEZ8", sysUser); |
| | | guideRepairOrder.setIsPush(1); |
| | | guideRepairOrder.setIsTimeout("2"); |
| | | baseMapper.updateById(guideRepairOrder); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | return ResultData.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData pushNoticeTimeRepairOrder(){ |
| | | AutomessageSysSettings automessageSysSettings = iSysSettingsMapper.selectOne( |
| | | new QueryWrapper<AutomessageSysSettings>().lambda() |
| | | .eq(AutomessageSysSettings::getSettingName, "系统超时基础设置")); |
| | | Integer timeoutRemindNum = automessageSysSettings.getTimeoutRemindNum(); |
| | | List<GuideRepairOrder> guideRepairOrders = baseMapper.selectNoticeTime(timeoutRemindNum); |
| | | for (GuideRepairOrder guideRepairOrder:guideRepairOrders){ |
| | | SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, guideRepairOrder.getGuideUserId())); |
| | | if (sysUser != null) { |
| | | smsUtil.sendSmsOvertimeRemind(sysUser.getPhonenumber(), sysUser.getUserName()); |
| | | guideRepairOrder.setIsRemindPush(1); |
| | | baseMapper.updateById(guideRepairOrder); |
| | | } |
| | | } |
| | | return ResultData.success(); |
| | | } |
| | | |
| | | @Override |
| | | public int updateEvaluate() { |
| | | //查找一天没有评价的单据 |
| | | List<GuideRepairOrder> guideRepairOrders = baseMapper.selectEvaluate(); |
| | | for (GuideRepairOrder guideRepairOrder : guideRepairOrders) { |
| | | guideRepairOrder.setEvaluateState("1"); |
| | | guideRepairOrder.setEvaluateContent("好评"); |
| | | guideRepairOrder.setServiceState(1); |
| | | guideRepairOrder.setState("3"); |
| | | baseMapper.updateById(guideRepairOrder); |
| | | //新增默认好评进展 |
| | | GuideEvolveEntity entity = new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("12"); |
| | | entity.setFromUserId(guideRepairOrder.getSubmitUserId() + ""); |
| | | entity.setGuideId(guideRepairOrder.getId().toString()); |
| | | guideEvolveMapper.insertConfig(entity); |
| | | |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public ResultData deleteComment(Integer id, SysUser sysUser) { |
| | | if (sysUser.getUserType().equals("1") || sysUser.getIsDivisionHead().equals("1")) { |
| | | GuideRepairOrder guideRepairOrder = baseMapper.selectOne(new QueryWrapper<GuideRepairOrder>().lambda().eq(GuideRepairOrder::getId, id)); |
| | | if (guideRepairOrder != null && guideRepairOrder.getState().equals("3")) { |
| | | guideRepairOrder.setIsHideComments(1); |
| | | baseMapper.updateById(guideRepairOrder); |
| | | //新增删除评论进展 |
| | | GuideEvolveEntity entity = new GuideEvolveEntity(); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("14"); |
| | | entity.setFromUserId(sysUser.getUserId() + ""); |
| | | entity.setGuideId(guideRepairOrder.getId().toString()); |
| | | guideEvolveMapper.insertConfig(entity); |
| | | baseMapper.updateById(guideRepairOrder); |
| | | return ResultData.success("删除评论成功"); |
| | | } else { |
| | | return ResultData.error("已办结的单据才能进行删除评论操作"); |
| | | } |
| | | } else { |
| | | return ResultData.error("只能部门领导和超级管理员才能删除评论"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.Guidance; |
| | | import com.dg.core.db.gen.entity.GuidePlate; |
| | | import com.dg.core.db.gen.entity.OrganizationEntity; |
| | | import com.dg.core.db.gen.mapper.HomeStatisticsMapper; |
| | | import com.dg.core.service.HomeStatisticsService; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | @Service |
| | | public class HomeStatisticsImpl extends ServiceImpl<HomeStatisticsMapper, GuidePlate> |
| | | implements HomeStatisticsService |
| | | { |
| | | |
| | | @Override |
| | | public List<GuidePlate> guidePlatePeople(List<String> ids) { |
| | | return baseMapper.guidePlatePeople(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuidePlate> score(List<String> ids) { |
| | | return baseMapper.score(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuidePlate> timeout(List<String> ids) { |
| | | return baseMapper.timeout(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuidePlate> tosettled(List<String> ids) { |
| | | return baseMapper.tosettled(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuidePlate> workunit(List<String> ids) { |
| | | return baseMapper.workunit(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer organizationScore(List<String> ids) { |
| | | return baseMapper.organizationScore(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer organizationNum(List<String> ids) { |
| | | return baseMapper.organizationNum(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationEntity> getDepartment() { |
| | | return baseMapper.getDepartment(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Guidance> guidanceTransaction(List<String> ids) { |
| | | return baseMapper.guidanceTransaction(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<Guidance> guidanceBrowse(List<String> ids) { |
| | | return baseMapper.guidanceBrowse(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer staffNum(List<String> ids) { |
| | | return baseMapper.staffNum(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer countWork(List<String> ids) { |
| | | return baseMapper.countWork(ids); |
| | | } |
| | | |
| | | @Override |
| | | public int countStatisticsNum(List<String> classifyIds,List<String> ids) { |
| | | return baseMapper.countStatisticsNum(classifyIds,ids); |
| | | } |
| | | @Override |
| | | public List<ClassifyAdministration> getClassify(String parentId, String classifyGrade) { |
| | | return baseMapper.getClassify(parentId,classifyGrade); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> countId(String district) { |
| | | return baseMapper.countId(district); |
| | | } |
| | | |
| | | @Override |
| | | public String reversionRate(String state, String isTimeout) { |
| | | return baseMapper.reversionRate(state,isTimeout); |
| | | } |
| | | |
| | | @Override |
| | | public int rangeStatistics(List<String> ids) { |
| | | return baseMapper.rangeStatistics(ids); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.mapper.HuaChengSysUserMapper; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class HuaChengSysUserImpl extends ServiceImpl<HuaChengSysUserMapper, HuaChengSysUser> implements IHuaChengSysUserService |
| | | { |
| | | |
| | | @Override |
| | | public List<HuaChengSysUser> selectConfigList() { |
| | | return baseMapper.selectConfigList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<HuaChengSysUser> selectData(String userId,String account,String phone) { |
| | | return baseMapper.selectData(userId,account,phone); |
| | | } |
| | | |
| | | @Override |
| | | public int selectNum() { |
| | | return baseMapper.selectNum(); |
| | | } |
| | | } |
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.AutomessageSmartConsulting; |
| | | import com.dg.core.db.gen.mapper.AutomessageSmartConsultingMapper; |
| | | import com.dg.core.service.IAutomessageSmartConsultingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class IAutomessageSmartConsultingServiceImpl extends ServiceImpl<AutomessageSmartConsultingMapper, AutomessageSmartConsulting> implements IAutomessageSmartConsultingService { |
| | | |
| | | @Override |
| | | public int add(AutomessageSmartConsulting automessageSmartConsulting){ |
| | | return baseMapper.insert(automessageSmartConsulting); |
| | | } |
| | | |
| | | @Override |
| | | public Long countSmartConsulting(){ |
| | | return baseMapper.selectCount(new QueryWrapper<AutomessageSmartConsulting>().lambda()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.RoleMenuEntity; |
| | | import com.dg.core.db.gen.mapper.RoleMenuEntityMapper; |
| | | import com.dg.core.service.IRoleMenuService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class IRoleMenuImpl extends ServiceImpl<RoleMenuEntityMapper, RoleMenuEntity> implements IRoleMenuService { |
| | | |
| | | @Override |
| | | public List<RoleMenuEntity> selectConfigList(String roleId) { |
| | | return baseMapper.selectConfigList(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public int insertConfig(RoleMenuEntity entity) { |
| | | return baseMapper.insertConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int updateConfig(RoleMenuEntity entity) { |
| | | return baseMapper.updateConfig(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteConfigById(String Id) { |
| | | return baseMapper.deleteConfigById(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.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.core.metadata.IPage; |
| | | 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.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class OrganizationChartImpl extends ServiceImpl<OrganizationChartMapper, OrganizationChartEntity> |
| | | implements IOrganizationChartService |
| | | { |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectConfigList(String parentId,String grade,List<String> ids) |
| | | { |
| | | List<OrganizationChartEntity> ocList=baseMapper.selectConfigList(parentId,"1",ids); |
| | | |
| | | if(ocList==null || ocList.size()<1) |
| | | { |
| | | List<String> id=new ArrayList<>(); |
| | | id.add(parentId); |
| | | ocList=baseMapper.selectConfigList(null,null,id); |
| | | } |
| | | |
| | | for (OrganizationChartEntity entity:ocList) |
| | | { |
| | | entity.setChild(baseMapper.selectConfigList(entity.getId()+"","",null)); |
| | | |
| | | if (entity.getChild()!=null) |
| | | { |
| | | entity.setChild(this.selectConfigList(entity.getId().toString())); |
| | | } |
| | | } |
| | | return ocList; |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectConfigList(List<String> ids) { |
| | | List<OrganizationChartEntity> ocList=baseMapper.selectConfigList(null,null,ids); |
| | | 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,"",null); |
| | | for (OrganizationChartEntity sysStreet:list) { |
| | | sysStreet.setChild(baseMapper.selectConfigList(sysStreet.getId().toString(),"",null)); |
| | | 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); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, |
| | | String organizationName,List<String> ids) { |
| | | return baseMapper.queryList(page,state,organizationName,ids); |
| | | } |
| | | |
| | | @Override |
| | | public int countList(String organizationName,List<String> ids) { |
| | | return baseMapper.countList(organizationName,ids); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectParentList(String parentId, String grade) { |
| | | return baseMapper.selectConfigList(parentId,grade,null); |
| | | } |
| | | |
| | | /** |
| | | * 递归获取id 内部使用 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | |
| | | @Override |
| | | public List<String> getIds(String id) |
| | | { |
| | | List<String> ids=new ArrayList<>(); |
| | | List<OrganizationChartEntity> lists = baseMapper.selectConfigList(id,"",null); |
| | | if(lists.size()<1) |
| | | { |
| | | lists.add(baseMapper.selectConfigById(id)); |
| | | } |
| | | ids=disposestreetId(lists); |
| | | if(ids.size()<1) |
| | | { |
| | | return null; |
| | | } |
| | | ids.add(id); |
| | | return ids; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getDepartmentId(String id){ |
| | | String parentId = parentId(id); |
| | | List<String> departmentIds=new ArrayList<>(); |
| | | departmentIds.add(parentId); |
| | | List<OrganizationChartEntity> organizationChartEntities = baseMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getParentId, parentId)); |
| | | for (OrganizationChartEntity organizationChart :organizationChartEntities){ |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | departmentIds=getDepartmentIds(organizationChart.getId().toString(),departmentIds); |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | @Override |
| | | public String getStairId(String id) |
| | | { |
| | | OrganizationChartEntity entity= baseMapper.selectConfigById(id); |
| | | if(entity!=null && StringUtils.isEmpty(entity.getParentId())) |
| | | { |
| | | return entity.getId()+""; |
| | | } |
| | | else |
| | | { |
| | | return getParentId(entity.getParentId()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id 获取一级部门id 递归 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public String getParentId(String id) |
| | | { |
| | | String ultimatelyId; |
| | | OrganizationChartEntity entity= baseMapper.selectConfigById(id); |
| | | if(entity==null) |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(entity.getParentId())) |
| | | { |
| | | ultimatelyId= getParentId(entity.getParentId()); |
| | | return ultimatelyId; |
| | | } |
| | | else |
| | | { |
| | | ultimatelyId=entity.getId()+""; |
| | | return ultimatelyId; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public String parentId(String id){ |
| | | String parentId=id; |
| | | OrganizationChartEntity organizationChart = baseMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getId, id)); |
| | | if (organizationChart.getParentId().length()>0){ |
| | | parentId=parentId(organizationChart.getParentId()); |
| | | } |
| | | return parentId; |
| | | } |
| | | |
| | | public List<String> getDepartmentIds(String id,List<String> departmentIds){ |
| | | List<OrganizationChartEntity> organizationChartEntities = baseMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda().eq(OrganizationChartEntity::getParentId, id)); |
| | | if (organizationChartEntities.size()==0){ |
| | | return departmentIds; |
| | | } |
| | | else { |
| | | for (OrganizationChartEntity organizationChart :organizationChartEntities){ |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | departmentIds=getDepartmentIds(organizationChart.getId().toString(),departmentIds); |
| | | } |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | |
| | | |
| | | //递归取id |
| | | private List<String> disposestreetId(List<OrganizationChartEntity> lists) |
| | | { |
| | | List<String> ids=new ArrayList<>(); |
| | | if(lists==null || lists.size()<1) |
| | | { |
| | | return ids; |
| | | } |
| | | |
| | | for (OrganizationChartEntity sysStreet:lists) |
| | | { |
| | | if(sysStreet!=null&&sysStreet.getId()!=null) |
| | | { |
| | | if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) |
| | | { |
| | | ids.addAll(disposestreetId(sysStreet.getChild())); |
| | | } |
| | | else |
| | | { |
| | | ids.add(sysStreet.getId()+""); |
| | | } |
| | | } |
| | | } |
| | | return ids; |
| | | } |
| | | |
| | | |
| | | } |
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.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.entity.ReplyTemplateEntity; |
| | | import com.dg.core.db.gen.mapper.ElseAccessoryMapper; |
| | | import com.dg.core.db.gen.mapper.ReplyTemplateMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.service.IReplyTemplateService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ReplyTemplateImpl extends ServiceImpl<ReplyTemplateMapper, ReplyTemplateEntity> implements IReplyTemplateService |
| | | { |
| | | |
| | | @Resource |
| | | private ElseAccessoryMapper elseAccessoryMapper; |
| | | |
| | | @Resource |
| | | private TransactionEventMapper transactionEventMapper; |
| | | |
| | | @Override |
| | | public List<ReplyTemplateEntity> selectConfigList(IPage<ReplyTemplateEntity> page, |
| | | Integer state,String Name,List<String> ids,String userId) { |
| | | return baseMapper.selectConfigList(page,state,Name,ids,userId); |
| | | } |
| | | |
| | | @Override |
| | | public ReplyTemplateEntity selectConfigData(String Id) { |
| | | ReplyTemplateEntity replyTemplateEntity = baseMapper.selectConfigData(Id); |
| | | if (replyTemplateEntity!=null) |
| | | { |
| | | if(!StringUtils.isEmpty(replyTemplateEntity.getAccessoryId())) |
| | | { |
| | | if(replyTemplateEntity.getAccessoryId().indexOf(",")<0) |
| | | { |
| | | String[] split=new String[]{replyTemplateEntity.getAccessoryId()}; |
| | | replyTemplateEntity.setElseAccessoryEntityList( elseAccessoryMapper.selectListByIds(split)); |
| | | } |
| | | else |
| | | { |
| | | String[] split; |
| | | split = replyTemplateEntity.getAccessoryId().split(","); |
| | | replyTemplateEntity.setElseAccessoryEntityList( elseAccessoryMapper.selectListByIds(split)); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (!StringUtils.isEmpty(replyTemplateEntity.getGuidance())){ |
| | | |
| | | if(replyTemplateEntity.getGuidance().indexOf(",")<0) |
| | | { |
| | | String[] split=new String[]{replyTemplateEntity.getGuidance()}; |
| | | replyTemplateEntity.setTransactionEventList(transactionEventMapper.selectListByIds(split)); |
| | | } |
| | | else |
| | | { |
| | | String[] split; |
| | | split = replyTemplateEntity.getGuidance().split(","); |
| | | replyTemplateEntity.setTransactionEventList(transactionEventMapper.selectListByIds(split)); |
| | | } |
| | | |
| | | |
| | | } |
| | | return replyTemplateEntity; |
| | | } |
| | | else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @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,List<String> ids) { |
| | | return baseMapper.countNum(Name,ids); |
| | | } |
| | | } |
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,String name) { |
| | | return baseMapper.selectConfigList(page,state,name); |
| | | } |
| | | |
| | | @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(String name) { |
| | | return baseMapper.countNum(name); |
| | | } |
| | | } |
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.getLinkType().equals(2)) { |
| | | if (slideshow.getTitle() == null || slideshow.getTitle() == "") |
| | | return ResultData.error("类型为富文本时,标题不能为空"); |
| | | if (slideshow.getContent() == null || slideshow.getContent() == "") |
| | | return ResultData.error("类型为富文本时,富文本内容不能为空"); |
| | | } |
| | | if (slideshow.getLinkType().equals(3) && (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.getLinkType().equals(2)) { |
| | | if (slideshow.getTitle() == null || slideshow.getTitle() == "") |
| | | return ResultData.error("类型为富文本时,标题不能为空"); |
| | | if (slideshow.getContent() == null || slideshow.getContent() == "") |
| | | return ResultData.error("类型为富文本时,富文本内容不能为空"); |
| | | } |
| | | if (slideshow.getLinkType().equals(3) && (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.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.AutomessageSysSettings; |
| | | import com.dg.core.db.gen.entity.AutomessageSysSettingsRecord; |
| | | import com.dg.core.db.gen.mapper.AutomessageSysSettingsMapper; |
| | | import com.dg.core.db.gen.mapper.AutomessageSysSettingsRecordMapper; |
| | | import com.dg.core.service.ISysSettingsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Service |
| | | public class SysSettingsServiceImpl extends ServiceImpl<AutomessageSysSettingsMapper, AutomessageSysSettings> implements ISysSettingsService { |
| | | |
| | | @Resource |
| | | private AutomessageSysSettingsRecordMapper automessageSysSettingsRecordMapper; |
| | | |
| | | @Override |
| | | public ResultData selectByName(String settingName){ |
| | | AutomessageSysSettings automessageSysSettings = baseMapper.selectOne( |
| | | new QueryWrapper<AutomessageSysSettings>().lambda() |
| | | .eq(AutomessageSysSettings::getSettingName,settingName)); |
| | | return ResultData.success(automessageSysSettings); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData update(AutomessageSysSettings automessageSysSettings){ |
| | | AutomessageSysSettingsRecord automessageSysSettingsRecord=new AutomessageSysSettingsRecord(); |
| | | automessageSysSettingsRecord.setSettingId(automessageSysSettings.getId()); |
| | | automessageSysSettingsRecord.setCreateUserId(automessageSysSettings.getUpdateUserId()); |
| | | automessageSysSettingsRecord.setCreateTime(LocalDateTime.now()); |
| | | int i = baseMapper.updateById(automessageSysSettings); |
| | | if (i>0){ |
| | | return ResultData.success(automessageSysSettingsRecordMapper.insert(automessageSysSettingsRecord)); |
| | | }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.ResultData; |
| | | import com.dg.core.db.gen.entity.AutomessageSysUserRecord; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.AutomessageSysUserRecordMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.service.ISysUserRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Service |
| | | public class SysUserRecordServiceImpl extends ServiceImpl<AutomessageSysUserRecordMapper, AutomessageSysUserRecord> implements ISysUserRecordService { |
| | | |
| | | @Resource |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public ResultData add(SysUser sysUser){ |
| | | if (sysUser!=null){ |
| | | LocalDateTime startTime = LocalDate.now().atTime(0, 0, 0); |
| | | LocalDateTime endTime = LocalDate.now().atTime(23, 59, 59); |
| | | AutomessageSysUserRecord automessageSysUserRecord = baseMapper.selectOne(new QueryWrapper<AutomessageSysUserRecord>() |
| | | .lambda().eq(AutomessageSysUserRecord::getUserId, sysUser.getUserId()) |
| | | .orderByDesc(AutomessageSysUserRecord::getCreateTime) |
| | | .last("limit 1")); |
| | | //判断上次访问时间是不是今天 如果是今天不增加浏览次数 |
| | | if (automessageSysUserRecord==null||(!(automessageSysUserRecord.getCreateTime().isAfter(startTime)&&automessageSysUserRecord.getCreateTime().isBefore(endTime)))) { |
| | | AutomessageSysUserRecord automessageSysUserRecordNew = new AutomessageSysUserRecord(); |
| | | automessageSysUserRecordNew.setUserId(sysUser.getUserId()); |
| | | automessageSysUserRecordNew.setCreateTime(LocalDateTime.now()); |
| | | sysUser.setLoginDate(LocalDateTime.now()); |
| | | sysUserMapper.updateById(sysUser); |
| | | return ResultData.success(baseMapper.insert(automessageSysUserRecordNew)); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResultData selectUserRecordCount() { |
| | | return ResultData.success(baseMapper.selectUserRecordCount()); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData selectByDateType(Integer dateType) { |
| | | if (dateType.equals(1)) |
| | | return ResultData.success(baseMapper.selectByDay()); |
| | | if (dateType.equals(2)) |
| | | return ResultData.success(baseMapper.selectByMonth()); |
| | | if (dateType.equals(3)) |
| | | return ResultData.success(baseMapper.selectByYear()); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteDistinct() { |
| | | return baseMapper.deleteDistinct(); |
| | | } |
| | | |
| | | } |
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.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.Snowflake; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService |
| | | { |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @Override |
| | | public SysUser getUserByAccount(String account) { |
| | | SysUser sysUsers = baseMapper.getUserByAccount(account); |
| | | return sysUsers; |
| | | } |
| | | |
| | | @Override |
| | | public ResultData smsSend(SysUser user){ |
| | | return smsUtil.sendSmsNew(user.getPhonenumber()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ResultData loginByAccount(String phonenumber, String code){ |
| | | String code1 = redisTemplate.opsForValue().get(phonenumber) + ""; |
| | | |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser==null){ |
| | | //查询花城e+是否存在此用户 |
| | | List<HuaChengSysUser> list=iHuaChengSysUserService.selectData("","",phonenumber); |
| | | HuaChengSysUser huaChengSysUser=null; |
| | | |
| | | if( list.size()>0 ) |
| | | { |
| | | huaChengSysUser=list.get(0); |
| | | } |
| | | |
| | | if(huaChengSysUser==null) |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(Snowflake.getId()+""); |
| | | newUser.setLoginName(phonenumber); |
| | | newUser.setUserName(phonenumber.substring(0,3)+"xxxx"+phonenumber.substring(7,11)+"用户"); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(phonenumber); |
| | | newUser.setSex("1"); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insertConfig(newUser); |
| | | } |
| | | else |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(huaChengSysUser.getUserId()+""); |
| | | newUser.setLoginName(huaChengSysUser.getPhone()); |
| | | newUser.setUserName(huaChengSysUser.getNickName()); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newUser.setSex(huaChengSysUser.getSex()); |
| | | newUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | newUser.setOpenid(huaChengSysUser.getOpenid()); |
| | | baseMapper.insertConfig(newUser); |
| | | } |
| | | } |
| | | |
| | | if (code.equals(code1)) { |
| | | sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser!=null){ |
| | | String token = tokenManager.getTokenByUserId(sysUser.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | | System.out.println("token "+token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(sysUser.getUserId(), sysUser.getUserId()); |
| | | } |
| | | |
| | | sysUser.setLoginDate(LocalDateTime.now()); |
| | | //更新登录时间 |
| | | this.updateConfig(sysUser); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", sysUser.getUserId()); |
| | | map.put("userName", sysUser.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | else { |
| | | return ResultData.error("验证码错误"); |
| | | } |
| | | |
| | | } |
| | | return ResultData.error("验证码错误"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> selectListByDepartmentId(String departmentId, String classifyId) { |
| | | List<String> departmentIds=new ArrayList<>(); |
| | | departmentIds.add(departmentId); |
| | | List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, departmentId)); |
| | | if (organizationChartEntities!=null){ |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser!=null) |
| | | departmentIds=this.getDepartmentIds(organizationChartEntitiesUser,departmentIds); |
| | | } |
| | | } |
| | | if (classifyId==null) |
| | | return baseMapper.selectListByDepartmentId(departmentIds,null,null); |
| | | else |
| | | return baseMapper.selectListByDepartmentId(departmentIds,","+classifyId,classifyId+","); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData loginByPhonenumber(String phonenumber) |
| | | { |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser==null){ |
| | | //查询花城e+是否存在此用户 |
| | | List<HuaChengSysUser> list=iHuaChengSysUserService.selectData("","",phonenumber); |
| | | HuaChengSysUser huaChengSysUser=null; |
| | | |
| | | if(list!=null || list.size()>0 ) |
| | | { |
| | | huaChengSysUser=list.get(0); |
| | | } |
| | | |
| | | SysUser newUser = new SysUser(); |
| | | if(huaChengSysUser==null) |
| | | { |
| | | newUser.setUserId(Snowflake.getId()+""); |
| | | newUser.setLoginName(phonenumber); |
| | | newUser.setUserName(phonenumber.substring(0,3)+"xxxx"+phonenumber.substring(7,11)+"用户"); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(phonenumber); |
| | | newUser.setSex("1"); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insertConfig(newUser); |
| | | } |
| | | else |
| | | { |
| | | newUser.setUserId(huaChengSysUser.getUserId()); |
| | | newUser.setLoginName(huaChengSysUser.getPhone()); |
| | | newUser.setUserName(huaChengSysUser.getNickName()); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newUser.setSex(huaChengSysUser.getSex()); |
| | | newUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | newUser.setOpenid(huaChengSysUser.getOpenid()); |
| | | baseMapper.insertConfig(newUser); |
| | | } |
| | | |
| | | String token = tokenManager.getTokenByUserId(newUser.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | | System.out.println("token " + token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(newUser.getUserId(), newUser.getUserId()); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", newUser.getUserId()); |
| | | map.put("userName", newUser.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | |
| | | } |
| | | else |
| | | { |
| | | String token = tokenManager.getTokenByUserId(sysUser.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | | System.out.println("token " + token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(sysUser.getUserId(), sysUser.getUserId()); |
| | | } |
| | | |
| | | sysUser.setLoginDate(LocalDateTime.now()); |
| | | //更新登录时间 |
| | | this.updateConfig(sysUser); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", sysUser.getUserId()); |
| | | map.put("userName", sysUser.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> queryList(Integer userType,String keyWord) { |
| | | return baseMapper.queryList(userType,keyWord); |
| | | } |
| | | |
| | | public List<String> getDepartmentIds( List<OrganizationChartEntity> organizationChartEntities,List<String> departmentIds){ |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser!=null) |
| | | departmentIds=this.getDepartmentIds(organizationChartEntitiesUser,departmentIds); |
| | | |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType,String userName,List<String> ids,String isDivisionHead) { |
| | | return baseMapper.selectConfigList(page, state,userType,userName,ids,isDivisionHead); |
| | | } |
| | | |
| | | @Override |
| | | public SysUser selectData(String userId,String phonenumber,String loginName) { |
| | | return baseMapper.selectData(userId,phonenumber,loginName); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | | * @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,String userName,List<String> ids,String isDivisionHead) { |
| | | return baseMapper.selectNum(userType,userName,ids,isDivisionHead); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
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.*; |
| | | import com.dg.core.db.gen.mapper.*; |
| | | 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.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class TransactionEventImpl extends ServiceImpl<TransactionEventMapper, TransactionEvent> implements ITransactionEventService { |
| | | |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | @Resource |
| | | private KeywordMapper keywordMapper; |
| | | |
| | | @Resource |
| | | private AutomessageTransactionEventInterviewMapper automessageTransactionEventInterviewMapper; |
| | | |
| | | |
| | | @Resource |
| | | private GuideRepairOrderMapper guideRepairOrderMapper; |
| | | |
| | | |
| | | @Resource |
| | | private AutomessagePolicyDocumentsMapper automessagePolicyDocumentsMapper; |
| | | |
| | | @Override |
| | | public TransactionEvent selectConfigData(String Id, SysUser sysUser) { |
| | | TransactionEvent transactionEvent = baseMapper.selectConfigData(Id); |
| | | //如果当前没有登录用户则不增加浏览次数 |
| | | if (sysUser != null) { |
| | | LocalDateTime startTime = LocalDate.now().atTime(0, 0, 0); |
| | | LocalDateTime endTime = LocalDate.now().atTime(23, 59, 59); |
| | | AutomessageTransactionEventInterview automessageTransactionEventInterview = automessageTransactionEventInterviewMapper.selectOne(new QueryWrapper<AutomessageTransactionEventInterview>() |
| | | .lambda().eq(AutomessageTransactionEventInterview::getTransactionEventId, Id) |
| | | .eq(AutomessageTransactionEventInterview::getUserId, sysUser.getUserId()) |
| | | .orderByDesc(AutomessageTransactionEventInterview::getInterviewTime) |
| | | .last("limit 1")); |
| | | transactionEvent.setQueryTime(LocalDateTime.now()); |
| | | //判断上次访问时间是不是今天 如果是今天不增加浏览次数 |
| | | if (automessageTransactionEventInterview == null || (!(transactionEvent.getQueryTime().isAfter(startTime) && transactionEvent.getQueryTime().isBefore(endTime)))) { |
| | | transactionEvent.setBrowseNum(transactionEvent.getBrowseNum() + 1); |
| | | baseMapper.updateById(transactionEvent); |
| | | AutomessageTransactionEventInterview automessageTransactionEventInterviewNew = |
| | | new AutomessageTransactionEventInterview(); |
| | | automessageTransactionEventInterviewNew.setTransactionEventId(Integer.valueOf(Id)); |
| | | automessageTransactionEventInterviewNew.setUserId(new Long(sysUser.getUserId())); |
| | | automessageTransactionEventInterviewNew.setInterviewTime(LocalDateTime.now()); |
| | | automessageTransactionEventInterviewMapper.insert(automessageTransactionEventInterviewNew); |
| | | } |
| | | } |
| | | return transactionEvent; |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> selectConfigList(IPage<TransactionEvent> page, Integer state, |
| | | String keyword, String classifyGrade, List<String> ids) { |
| | | return baseMapper.selectConfigList(page, state, keyword, classifyGrade, ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> selectConfigList(String keyword, String classifyGrade, List<String> ids) { |
| | | return baseMapper.selectConfigList(keyword, classifyGrade, ids); |
| | | } |
| | | |
| | | @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) { |
| | | List<GuideRepairOrder> guideRepairOrders = guideRepairOrderMapper |
| | | .selectList(new QueryWrapper<GuideRepairOrder>().lambda().eq(GuideRepairOrder::getMatterId, Id)); |
| | | if (guideRepairOrders.size() == 0) { |
| | | return baseMapper.deleteConfigById(Id); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public int countNum(String matterAndUser, String classifyGrade, List<String> ids) { |
| | | return baseMapper.countNum(matterAndUser, classifyGrade, ids); |
| | | } |
| | | |
| | | @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())); |
| | | List<TransactionEvent> transactionEventEntities = baseMapper.queryMatterNameList(keyWord, null); |
| | | List<String> list = new ArrayList<>(); |
| | | for (TransactionEvent transactionEvent : transactionEventEntities) { |
| | | if (transactionEvent.getAssociateNames() != null) { |
| | | String[] associateNames = transactionEvent.getAssociateNames().split(","); |
| | | for (String associateName : associateNames) { |
| | | list.add(associateName); |
| | | } |
| | | } |
| | | } |
| | | List<KeywordEntity> keywordEntityList = new ArrayList<>(); |
| | | |
| | | String[] keywords = list.stream().distinct().collect(Collectors.joining(",")).split(",");//去重 |
| | | for (String keyword : keywords) { |
| | | if (keyword != null && !keyword.equals("")) { |
| | | KeywordEntity keywordEntity = new KeywordEntity(); |
| | | keywordEntity.setName(keyword); |
| | | keywordEntityList.add(keywordEntity); |
| | | } |
| | | } |
| | | queryResults.setKeywordAssociationList(keywordEntityList); |
| | | return queryResults; |
| | | } |
| | | |
| | | @Override |
| | | public QueryResults queryMatterNameList(String keyWord) { |
| | | QueryResults queryResults = new QueryResults(); |
| | | List<Search> searches = baseMapper.selectSearchList(keyWord); |
| | | for (Search search : searches) { |
| | | search.setTransactionEventList(baseMapper.queryMatterNameList(keyWord, search.getClassifyId().toString())); |
| | | } |
| | | queryResults.setOrganizationChartEntityList(organizationChartMapper.selectByKeyWord(keyWord)); |
| | | queryResults.setSearchList(searches); |
| | | List<Search> searchesAssociate = baseMapper.selectSearchAssociateDistinct(keyWord); |
| | | for (Search search : searchesAssociate) { |
| | | search.setTransactionEventList(baseMapper.queryAssociateNamesList(keyWord, search.getClassifyId().toString())); |
| | | } |
| | | queryResults.setTransactionEventList(searchesAssociate); |
| | | queryResults.setKeywordEntityList(keywordMapper.selectByName(keyWord)); |
| | | queryResults.setAutomessagePolicyDocuments(automessagePolicyDocumentsMapper.selectConfigList(keyWord,"2",null,null)); |
| | | queryResults.setRegulations(automessagePolicyDocumentsMapper.selectConfigList(keyWord,"1",null,null)); |
| | | return queryResults; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public RecommendResult smartConsulting(String keyWord) { |
| | | RecommendResult recommendResult = new RecommendResult(); |
| | | List<KeywordEntity> keywordEntityList = new ArrayList<>(); |
| | | List<TransactionEvent> transactionEventEntities = baseMapper.queryMatterNameList(keyWord, null); |
| | | List<TransactionEvent> transactionEvents = baseMapper.queryAssociateNamesList(keyWord, null); |
| | | recommendResult.setTransactionEventList(transactionEventEntities); |
| | | List<String> list = new ArrayList<>(); |
| | | for (TransactionEvent transactionEvent : transactionEvents) { |
| | | // 直接返回办事指南名称 |
| | | list.add(transactionEvent.getMatterName()); |
| | | // 遍历关键词列表 可能后面流程更改会遇到暂时保存代码; |
| | | /* if (transactionEvent.getAssociateNames() != null) { |
| | | String[] associateNames = transactionEvent.getAssociateNames().split(","); |
| | | for (String associateName : associateNames) { |
| | | list.add(associateName); |
| | | } |
| | | }*/ |
| | | } |
| | | String[] keywords = list.stream().distinct().collect(Collectors.joining(",")).split(",");//去重 |
| | | for (String keyword : keywords) { |
| | | if (keyword != null && !keyword.equals("")) { |
| | | KeywordEntity keywordEntity = new KeywordEntity(); |
| | | keywordEntity.setName(keyword); |
| | | keywordEntityList.add(keywordEntity); |
| | | } |
| | | } |
| | | recommendResult.setKeywordEntityList(keywordEntityList); |
| | | List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectByKeyWord(keyWord); |
| | | recommendResult.setAutomessagePolicyDocuments(automessagePolicyDocumentsMapper.selectConfigList(keyWord,"2",null,null)); |
| | | recommendResult.setRegulations(automessagePolicyDocumentsMapper.selectConfigList(keyWord,"1",null,null)); |
| | | recommendResult.setOrganizationChartEntityList(organizationChartEntities); |
| | | return recommendResult; |
| | | } |
| | | |
| | | @Override |
| | | public String selectDataIfExist(String departmentId, String matterName) { |
| | | return baseMapper.selectDataIfExist(departmentId, matterName); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> selectclassifyId(String classifyId) { |
| | | return baseMapper.selectclassifyId(classifyId); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionEvent> selectClassifyList(List<String> ids) { |
| | | return baseMapper.selectClassifyList(ids); |
| | | } |
| | | |
| | | |
| | | @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> queryByClassifyIdList(IPage<TransactionEvent> page, Integer state, String classifyId, Integer departmentId) { |
| | | return baseMapper.queryByClassifyIdList(page, state, 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(String keyWord) { |
| | | if (keyWord != null && keyWord != "") { |
| | | return baseMapper.selectList(new QueryWrapper<TransactionEvent>().lambda().like(TransactionEvent::getMatterName, keyWord)); |
| | | } else { |
| | | return baseMapper.selectList(new QueryWrapper<TransactionEvent>().lambda()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Integer batchImport(String fileName, MultipartFile file) { |
| | | boolean notNull = false; |
| | | if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { |
| | | throw new RuntimeException("选择文件格式不正确,请下载模板上传"); |
| | | } |
| | | boolean isExcel2003 = true; |
| | | if (fileName.matches("^.+\\.(?i)(xlsx)$")) { |
| | | isExcel2003 = false; |
| | | } |
| | | InputStream is = null; |
| | | try { |
| | | is = file.getInputStream(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | Workbook wb = null; |
| | | |
| | | if (isExcel2003) { |
| | | try { |
| | | wb = new HSSFWorkbook(is); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } else { |
| | | try { |
| | | wb = new XSSFWorkbook(is); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | Integer failNum = 0;//失败数量 |
| | | // 获取excel的sheet页数 |
| | | int numberOfSheets = wb.getNumberOfSheets(); |
| | | for (int j = 0; j < numberOfSheets; j++) { |
| | | int i = 2; |
| | | //获取excel字段名称进行比较 |
| | | Sheet sheetAt = wb.getSheetAt(j); |
| | | if(sheetAt.getRow(2)!=null){ |
| | | if (new DataFormatter().formatCellValue(sheetAt.getRow(1).getCell(1)).length()>=3){ |
| | | i--; |
| | | } |
| | | Row row1 = sheetAt.getRow(i); |
| | | TransactionEvent transactionEvent = baseMapper.selectOne(new QueryWrapper<TransactionEvent>().lambda().eq(TransactionEvent::getMatterName, new DataFormatter().formatCellValue(row1.getCell(1)))); |
| | | boolean isAdd = false; |
| | | if (transactionEvent == null) { |
| | | transactionEvent = new TransactionEvent(); |
| | | isAdd = true; |
| | | } |
| | | transactionEvent.setMatterName(new DataFormatter().formatCellValue(row1.getCell(1))); |
| | | Row row2 = sheetAt.getRow(i+1); |
| | | transactionEvent.setSetGist("<p>" + new DataFormatter().formatCellValue(row2.getCell(1)) + "</p>"); |
| | | Row row3 = sheetAt.getRow(i+2); |
| | | Row row4 = sheetAt.getRow(i+3); |
| | | transactionEvent.setBasicInformation("<p> 事项名称:" + new DataFormatter().formatCellValue(row1.getCell(1)) + "<br />" |
| | | + new DataFormatter().formatCellValue(row3.getCell(0)) + ":" + new DataFormatter().formatCellValue(row3.getCell(1))+ "<br />" |
| | | + new DataFormatter().formatCellValue(row3.getCell(3)) + ":" + new DataFormatter().formatCellValue(row3.getCell(4)) + "<br />" |
| | | + new DataFormatter().formatCellValue(row4.getCell(0)) + ":" + new DataFormatter().formatCellValue(row4.getCell(1)) + "</p>"); |
| | | i = i+5; |
| | | String applicationMaterial = "<p>"; |
| | | while (true) { |
| | | Row row = sheetAt.getRow(i); |
| | | if (new DataFormatter().formatCellValue(row.getCell(0)).equals("办理途径、条件和注意事项")) { |
| | | i = i + 2; |
| | | break; |
| | | } |
| | | applicationMaterial = applicationMaterial + "办理区域:" + new DataFormatter().formatCellValue(row.getCell(0)) + "<br />" |
| | | + "部门名称:" + new DataFormatter().formatCellValue(row.getCell(1)) + "<br />" |
| | | + "咨询电话:" + new DataFormatter().formatCellValue(row.getCell(2)) + "<br />" |
| | | + "办公地址:" + new DataFormatter().formatCellValue(row.getCell(3)) + "<br />" |
| | | + "办公时间:" + new DataFormatter().formatCellValue(row.getCell(4)) + "<br />"; |
| | | applicationMaterial = applicationMaterial + "<br />"; |
| | | i++; |
| | | } |
| | | applicationMaterial = applicationMaterial + "</p>"; |
| | | transactionEvent.setApplicationMaterial(applicationMaterial); |
| | | String acceptConditions = "<p>"; |
| | | while (true) { |
| | | Row row = sheetAt.getRow(i); |
| | | if (new DataFormatter().formatCellValue(row.getCell(0)).equals("(二)网上申报")) { |
| | | i = i + 1; |
| | | break; |
| | | } |
| | | acceptConditions = acceptConditions + new DataFormatter().formatCellValue(row.getCell(0)) + " " |
| | | +new DataFormatter().formatCellValue( row.getCell(1)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(2)) + " " |
| | | +new DataFormatter().formatCellValue( row.getCell(3)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(4)) + " "; |
| | | acceptConditions = acceptConditions + "<br />"; |
| | | i++; |
| | | } |
| | | acceptConditions = acceptConditions + "</p>"; |
| | | transactionEvent.setAcceptConditions(acceptConditions); |
| | | String rates = "<p>"; |
| | | while (true) { |
| | | Row row = sheetAt.getRow(i); |
| | | if (new DataFormatter().formatCellValue(row.getCell(0)).equals("(三)手机移动申报")) { |
| | | i = i + 1; |
| | | break; |
| | | } |
| | | rates = rates + new DataFormatter().formatCellValue(row.getCell(0)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(1)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(2)) + " " |
| | | +new DataFormatter().formatCellValue( row.getCell(3)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(4)) + " "; |
| | | rates = rates + "<br />"; |
| | | i++; |
| | | } |
| | | rates = rates + "</p>"; |
| | | transactionEvent.setRates(rates); |
| | | String transactionArea = "<p>"; |
| | | while (true) { |
| | | Row row = sheetAt.getRow(i); |
| | | if (new DataFormatter().formatCellValue(row.getCell(0)).equals("(四)经营许可(备案)事项程序运行图谱(附电子版)")) { |
| | | i = i + 1; |
| | | break; |
| | | } |
| | | transactionArea = transactionArea + new DataFormatter().formatCellValue(row.getCell(0)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(1)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(2)) + " " |
| | | +new DataFormatter().formatCellValue( row.getCell(3)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(4)) + " "; |
| | | transactionArea = transactionArea + "<br />"; |
| | | i++; |
| | | } |
| | | transactionArea = transactionArea + "</p>"; |
| | | transactionEvent.setTransactionArea(transactionArea); |
| | | String handlingProcedures = "<p>"; |
| | | while (true) { |
| | | Row row = sheetAt.getRow(i); |
| | | if (new DataFormatter().formatCellValue(row.getCell(0)).equals("(五)经营许可(备案)事项实施内容一览表(附电子版)")) { |
| | | i = i + 1; |
| | | break; |
| | | } |
| | | handlingProcedures = handlingProcedures + new DataFormatter().formatCellValue(row.getCell(0)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(1)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(2)) + " " |
| | | +new DataFormatter().formatCellValue( row.getCell(3)) + " " |
| | | + new DataFormatter().formatCellValue(row.getCell(4)) + " "; |
| | | handlingProcedures = handlingProcedures + "<br />"; |
| | | i++; |
| | | } |
| | | handlingProcedures = handlingProcedures + "</p>"; |
| | | transactionEvent.setHandlingProcedures(handlingProcedures); |
| | | int ans; |
| | | if (isAdd) { |
| | | ans = baseMapper.insert(transactionEvent); |
| | | } else { |
| | | ans = baseMapper.updateById(transactionEvent); |
| | | } |
| | | if (ans <= 0) { |
| | | failNum++; |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (failNum == 0) {// |
| | | return 3;//全部导入成功 |
| | | } else if (failNum < numberOfSheets) { |
| | | return 2;//部分导入成功 |
| | | } else if (failNum.equals(numberOfSheets)) { |
| | | return 0;//导入失败 |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.task; |
| | | |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.util.TestDate; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.ServletContextEvent; |
| | | import javax.servlet.ServletContextListener; |
| | | import javax.servlet.annotation.WebListener; |
| | | import java.util.*; |
| | | |
| | | @WebListener |
| | | @Slf4j |
| | | public class SendWsListener implements ServletContextListener { |
| | | |
| | | @Resource |
| | | private IGuideRepairOrderService iGuideRepairOrderService; |
| | | |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Override |
| | | public void contextDestroyed(ServletContextEvent arg0) { |
| | | log.info("定时发送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() { |
| | | log.info("每刻任务已执行"); |
| | | //定时更新超时状态 |
| | | iGuideRepairOrderService.pushOvertimeGuideRepairOrder(); |
| | | //定时更新未评价的单据评价状态 |
| | | iGuideRepairOrderService.updateEvaluate(); |
| | | //定时发送工单提醒信息 |
| | | iGuideRepairOrderService.pushNoticeTimeRepairOrder(); |
| | | TestDate td = new TestDate(); |
| | | Map weather = td.getWeather("510400"); |
| | | redisTemplate.opsForValue().set("weather",weather); |
| | | // TODO 写你的逻辑 |
| | | } |
| | | }, defaultdate, 1 * 60 * 1000);// 定时每15分钟 |
| | | log.info("每刻定时发送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.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 com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | public class PermissionUtil |
| | | { |
| | | |
| | | public static List<String> getPermission(SysUser sysUser,IOrganizationChartService iOrganizationChartService) |
| | | { |
| | | if (StringUtils.equals("3", sysUser.getUserType())) { |
| | | if (StringUtils.isEmpty(sysUser.getDataPermission())) { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | List<String> ids = new ArrayList<>(); |
| | | if (sysUser.getDataPermission().indexOf(",")>0) |
| | | { |
| | | String[] idl=sysUser.getDataPermission().split(","); |
| | | Collections.addAll(ids,idl); |
| | | } |
| | | else |
| | | { |
| | | ids.add(sysUser.getDataPermission()); |
| | | } |
| | | return ids; |
| | | } |
| | | } else if (StringUtils.equals("4", sysUser.getUserType())) { |
| | | if (StringUtils.isEmpty(sysUser.getDataPermission())) { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | List<String> ids = new ArrayList<>(); |
| | | if (sysUser.getDataPermission().indexOf(",")>0) |
| | | { |
| | | String[] idl=sysUser.getDataPermission().split(","); |
| | | Collections.addAll(ids,idl); |
| | | } |
| | | else |
| | | { |
| | | ids.add(sysUser.getDataPermission()); |
| | | } |
| | | return ids; |
| | | } |
| | | } else if(StringUtils.equals("2", sysUser.getUserType())) |
| | | { |
| | | //导办人员 |
| | | List<String> ids=iOrganizationChartService.getIds(sysUser.getDepartmentId()); |
| | | // List<String> ids=getStairDepartment(sysUser,iOrganizationChartService); |
| | | return ids; |
| | | } |
| | | else if(StringUtils.equals("1", sysUser.getUserType())) |
| | | { |
| | | //管理员 |
| | | // List<String> ids=iOrganizationChartService.getIds(""); |
| | | List<String> ids=null; |
| | | return ids; |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过部门id 获取一级部门下的全部子部门以及一级部门 |
| | | * @param sysUser |
| | | * @param iOrganizationChartService |
| | | * @return |
| | | */ |
| | | public static List<String> getStairDepartment(SysUser sysUser,IOrganizationChartService iOrganizationChartService) |
| | | { |
| | | if(StringUtils.equals("1", sysUser.getUserType())) |
| | | { |
| | | //管理员 |
| | | List<String> ids=null; |
| | | return ids; |
| | | } |
| | | else |
| | | { |
| | | //获取一级部门id |
| | | String stairId= iOrganizationChartService.getStairId(sysUser.getDepartmentId()); |
| | | List<String> ids=iOrganizationChartService.getIds(stairId); |
| | | return ids; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aliyuncs.CommonRequest; |
| | | import com.aliyuncs.CommonResponse; |
| | | import com.aliyuncs.DefaultAcsClient; |
| | | import com.aliyuncs.IAcsClient; |
| | | import com.aliyuncs.exceptions.ClientException; |
| | | import com.aliyuncs.http.MethodType; |
| | | import com.aliyuncs.profile.DefaultProfile; |
| | | import com.dg.core.AliyunConfig; |
| | | import com.dg.core.ResultData; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.squareup.okhttp.OkHttpClient; |
| | | import com.squareup.okhttp.Request; |
| | | import com.squareup.okhttp.Response; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 阿里云短信工具类 |
| | | */ |
| | | @Component |
| | | public class SmsUtil { |
| | | |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(SmsUtil.class); |
| | | |
| | | // 注入阿里云配置 |
| | | @Resource |
| | | AliyunConfig aliyunConfig; |
| | | |
| | | // 注入redisTemplate |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | private String LoginName="DSC1210052"; |
| | | |
| | | private String Pwd="pzhsjj@123"; |
| | | |
| | | private String FeeType="2"; |
| | | |
| | | /** |
| | | * 发送短信登录验证码 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | */ |
| | | public ResultData<Object> sendSms(String tel) { |
| | | //cn-hangzhou 是阿里定义的签名固定值。填写阿里云申请短信签名的key和secret值 |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunConfig.getKey(), aliyunConfig.getScrect()); |
| | | /*阿里云提供的短信发送api的近期的相关代码,代码以最新的阿里api提供为准*/ |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | CommonRequest request = new CommonRequest(); |
| | | request.setSysMethod(MethodType.POST); |
| | | request.setSysDomain("dysmsapi.aliyuncs.com"); |
| | | request.setSysVersion("2017-05-25"); |
| | | request.setSysAction("SendSms"); |
| | | request.putQueryParameter("RegionId", "cn-hangzhou"); |
| | | // 接收人电话 |
| | | request.putQueryParameter("PhoneNumbers", tel); |
| | | // 短信签名 |
| | | request.putQueryParameter("SignName", "集慧科技"); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCode()); |
| | | Random rd = new Random(); |
| | | int code = rd.nextInt(900000) + 100000; |
| | | // 短信内容 |
| | | request.putQueryParameter("TemplateParam", "{code:" + code + "}"); |
| | | // 获取短信发送的响应结果 |
| | | try { |
| | | CommonResponse rs = client.getCommonResponse(request); |
| | | LOGGER.debug(rs.getData().toString()); |
| | | // 把json格式的字符串装换成java的map的数据类型 |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | HashMap<String, Object> m = mapper.readValue(rs.getData().toString(), HashMap.class); |
| | | if (m.get("Message").equals("OK")) { |
| | | redisTemplate.opsForValue().set(tel, code + "", 5, TimeUnit.MINUTES); |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | |
| | | /** |
| | | * 发送短信登录验证码(电信平台) |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | */ |
| | | |
| | | public ResultData sendSmsNew(String tel) { |
| | | String url = |
| | | "https://dxsdk.028lk.com:8082/Api/SendSms?"+"LoginName="+LoginName+"&Pwd="+Pwd+"&FeeType="+FeeType+"&Mobile="+tel+"&Content="; |
| | | Random rd = new Random(); |
| | | int code = rd.nextInt(900000) + 100000; |
| | | String content="您的验证码为:"+code+",用于手机验证,15分钟内有效,请勿泄露于他人!"; |
| | | url=url+content; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |
| | | //解密数据 |
| | | String rsa = null; |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .get() |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | redisTemplate.opsForValue().set(tel, code + "", 5, TimeUnit.MINUTES); |
| | | // rsa = response.body().string().split("|")[0]; |
| | | rsa = response.message(); |
| | | if (!rsa.equals("OK")){ |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | return ResultData.success("短信发送成功"); |
| | | } |
| | | |
| | | /** |
| | | * 发送工单超时短信 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsOvertime(String tel,String name) { |
| | | //cn-hangzhou 是阿里定义的签名固定值。填写阿里云申请短信签名的key和secret值 |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunConfig.getKey(), aliyunConfig.getScrect()); |
| | | /*阿里云提供的短信发送api的近期的相关代码,代码以最新的阿里api提供为准*/ |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | CommonRequest request = new CommonRequest(); |
| | | request.setSysMethod(MethodType.POST); |
| | | request.setSysDomain("dysmsapi.aliyuncs.com"); |
| | | request.setSysVersion("2017-05-25"); |
| | | request.setSysAction("SendSms"); |
| | | request.putQueryParameter("RegionId", "cn-hangzhou"); |
| | | // 接收人电话 |
| | | request.putQueryParameter("PhoneNumbers", tel); |
| | | // 短信签名 |
| | | request.putQueryParameter("SignName", "集慧科技"); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCodeOvertime()); |
| | | Random rd = new Random(); |
| | | // 短信内容 |
| | | request.putQueryParameter("TemplateParam", "{name:'" + name + "'}"); |
| | | // 获取短信发送的响应结果 |
| | | try { |
| | | CommonResponse rs = client.getCommonResponse(request); |
| | | LOGGER.debug(rs.getData().toString()); |
| | | // 把json格式的字符串装换成java的map的数据类型 |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | HashMap<String, Object> m = mapper.readValue(rs.getData().toString(), HashMap.class); |
| | | if (m.get("Message").equals("OK")) { |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送工单超时短信(电信) |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsOvertimeNew(String tel,String name) { |
| | | String url = |
| | | "https://dxsdk.028lk.com:8082/Api/SendSms?"+"LoginName="+LoginName+"&Pwd="+Pwd+"&FeeType="+FeeType+"&Mobile="+tel+"&Content="; |
| | | Random rd = new Random(); |
| | | String content=name+"的导办工单超时未处理,请及时通知!"; |
| | | url=url+content; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |
| | | //解密数据 |
| | | String rsa = null; |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .get() |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | rsa = response.message(); |
| | | if (!rsa.equals("OK")){ |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | return ResultData.success("短信发送成功"); |
| | | } |
| | | |
| | | /** |
| | | * 发送工单完成短信 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsComplete(String tel,String name) { |
| | | //cn-hangzhou 是阿里定义的签名固定值。填写阿里云申请短信签名的key和secret值 |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunConfig.getKey(), aliyunConfig.getScrect()); |
| | | /*阿里云提供的短信发送api的近期的相关代码,代码以最新的阿里api提供为准*/ |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | CommonRequest request = new CommonRequest(); |
| | | request.setSysMethod(MethodType.POST); |
| | | request.setSysDomain("dysmsapi.aliyuncs.com"); |
| | | request.setSysVersion("2017-05-25"); |
| | | request.setSysAction("SendSms"); |
| | | request.putQueryParameter("RegionId", "cn-hangzhou"); |
| | | // 接收人电话 |
| | | request.putQueryParameter("PhoneNumbers", tel); |
| | | // 短信签名 |
| | | request.putQueryParameter("SignName", "集慧科技"); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCodeComplete()); |
| | | Random rd = new Random(); |
| | | // 短信内容 |
| | | request.putQueryParameter("TemplateParam", "{name:'" + name + "'}"); |
| | | // 获取短信发送的响应结果 |
| | | try { |
| | | CommonResponse rs = client.getCommonResponse(request); |
| | | LOGGER.debug(rs.getData().toString()); |
| | | // 把json格式的字符串装换成java的map的数据类型 |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | HashMap<String, Object> m = mapper.readValue(rs.getData().toString(), HashMap.class); |
| | | if (m.get("Message").equals("OK")) { |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送工单完成短信 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsCompleteNew(String tel,String name) { |
| | | String url = |
| | | "https://dxsdk.028lk.com:8082/Api/SendSms?"+"LoginName="+LoginName+"&Pwd="+Pwd+"&FeeType="+FeeType+"&Mobile="+tel+"&Content="; |
| | | Random rd = new Random(); |
| | | String content="您的"+name+"导办工单已由工作人员处理完成,请通过个人中心-我的申请导办查询。"; |
| | | url=url+content; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |
| | | //解密数据 |
| | | String rsa = null; |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .get() |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | rsa = response.message(); |
| | | if (!rsa.equals("OK")){ |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | return ResultData.success("短信发送成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送工单提交短信 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsSubmit(String tel,String name) { |
| | | //cn-hangzhou 是阿里定义的签名固定值。填写阿里云申请短信签名的key和secret值 |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunConfig.getKey(), aliyunConfig.getScrect()); |
| | | /*阿里云提供的短信发送api的近期的相关代码,代码以最新的阿里api提供为准*/ |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | CommonRequest request = new CommonRequest(); |
| | | request.setSysMethod(MethodType.POST); |
| | | request.setSysDomain("dysmsapi.aliyuncs.com"); |
| | | request.setSysVersion("2017-05-25"); |
| | | request.setSysAction("SendSms"); |
| | | request.putQueryParameter("RegionId", "cn-hangzhou"); |
| | | // 接收人电话 |
| | | request.putQueryParameter("PhoneNumbers", tel); |
| | | // 短信签名 |
| | | request.putQueryParameter("SignName", "集慧科技"); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCodeSubmit()); |
| | | Random rd = new Random(); |
| | | // 短信内容 |
| | | request.putQueryParameter("TemplateParam", "{name:'" + name + "'}"); |
| | | // 获取短信发送的响应结果 |
| | | try { |
| | | CommonResponse rs = client.getCommonResponse(request); |
| | | LOGGER.debug(rs.getData().toString()); |
| | | // 把json格式的字符串装换成java的map的数据类型 |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | HashMap<String, Object> m = mapper.readValue(rs.getData().toString(), HashMap.class); |
| | | if (m.get("Message").equals("OK")) { |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送工单提交短信(电信平台) |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsSubmitNew(String tel,String name) { |
| | | String url = |
| | | "https://dxsdk.028lk.com:8082/Api/SendSms?"+"LoginName="+LoginName+"&Pwd="+Pwd+"&FeeType="+FeeType+"&Mobile="+tel+"&Content="; |
| | | Random rd = new Random(); |
| | | String content="您有新的导办工单,请"+name+"尽快处理。"; |
| | | url=url+content; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |
| | | //解密数据 |
| | | String rsa = null; |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .get() |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | rsa = response.message(); |
| | | if (!rsa.equals("OK")){ |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | return ResultData.success("短信发送成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送工单提交短信(电信平台) |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsOvertimeRemind(String tel,String name) { |
| | | String url = |
| | | "https://dxsdk.028lk.com:8082/Api/SendSms?"+"LoginName="+LoginName+"&Pwd="+Pwd+"&FeeType="+FeeType+"&Mobile="+tel+"&Content="; |
| | | Random rd = new Random(); |
| | | String content="您的待处理导办工单已超时,请 "+name+"尽快处理。"; |
| | | url=url+content; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |
| | | //解密数据 |
| | | String rsa = null; |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .get() |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | rsa = response.message(); |
| | | if (!rsa.equals("OK")){ |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | return ResultData.success("短信发送成功"); |
| | | } |
| | | } |
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 com.dg.core.ResultData; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 表格分页数据对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TableDataInfo<T> implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 总记录数 */ |
| | | private long total; |
| | | |
| | | /** 列表数据 */ |
| | | private List<T> rows; |
| | | |
| | | /** 消息状态码 */ |
| | | private int result; |
| | | |
| | | /** 消息内容 */ |
| | | private String msg; |
| | | |
| | | /** |
| | | * 表格数据对象 |
| | | */ |
| | | public TableDataInfo() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | * |
| | | * @param list 列表数据 |
| | | * @param total 总记录数 |
| | | */ |
| | | public TableDataInfo(List<T> list, long total) |
| | | { |
| | | this.rows = list; |
| | | this.total = total; |
| | | } |
| | | |
| | | public long getTotal() |
| | | { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(long total) |
| | | { |
| | | this.total = total; |
| | | } |
| | | |
| | | public List<T> getRows() |
| | | { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(List<T> 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 lombok.Data; |
| | | |
| | | @Data |
| | | public class TemplateParam { |
| | | |
| | | private String key; |
| | | private String value; |
| | | |
| | | public TemplateParam(String key, String value) { |
| | | this.key = key; |
| | | this.value = value; |
| | | } |
| | | public TemplateParam() { |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.iceyyy.workday.WorkUtils; |
| | | import com.squareup.okhttp.OkHttpClient; |
| | | import com.squareup.okhttp.Request; |
| | | import com.squareup.okhttp.Response; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p>TestDate 此类用于:</p> |
| | | * <p>@author:hujm</p> |
| | | * <p>@date:2021年04月22日 17:43</p> |
| | | * <p>@remark:</p> |
| | | */ |
| | | public class TestDate { |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(getJjr(2021, 4)); |
| | | System.out.println(getMonthWekDay(2021, 4)); |
| | | System.out.println(JJR(2021, 4)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取周末和节假日 |
| | | * |
| | | * @param year |
| | | * @param month |
| | | * @return |
| | | */ |
| | | public static Set<String> JJR(int year, int month) { |
| | | //获取所有的周末 |
| | | Set<String> monthWekDay = getMonthWekDay(year, month); |
| | | //http://timor.tech/api/holiday api文档地址 |
| | | Map jjr = getJjr(year, month + 1); |
| | | Integer code = (Integer) jjr.get("code"); |
| | | if (code != 0) { |
| | | return monthWekDay; |
| | | } |
| | | Map<String, Map<String, Object>> holiday = (Map<String, Map<String, Object>>) jjr.get("holiday"); |
| | | Set<String> strings = holiday.keySet(); |
| | | for (String str : strings) { |
| | | Map<String, Object> stringObjectMap = holiday.get(str); |
| | | Integer wage = (Integer) stringObjectMap.get("wage"); |
| | | String date = (String) stringObjectMap.get("date"); |
| | | //筛选掉补班 |
| | | if (wage.equals(1)) { |
| | | monthWekDay.remove(date); |
| | | } else { |
| | | monthWekDay.add(date); |
| | | } |
| | | } |
| | | return monthWekDay; |
| | | } |
| | | |
| | | /** |
| | | * 获取节假日不含周末 |
| | | * |
| | | * @param year |
| | | * @param month |
| | | * @return |
| | | */ |
| | | private static Map getJjr(int year, int month) { |
| | | String url = "http://timor.tech/api/holiday/year/"; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |
| | | //解密数据 |
| | | String rsa = null; |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .get() |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | rsa = response.body().string(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return JSONObject.parseObject(rsa, Map.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取节假日不含周末 |
| | | * |
| | | * @return |
| | | */ |
| | | public Map getWeather(String code) { |
| | | String url = "https://restapi.amap.com/v3/weather/weatherInfo?key=9e0d819935da8a01de0e476ba8a9019e&city="+code; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |
| | | //解密数据 |
| | | String rsa = null; |
| | | Request request = new Request.Builder() |
| | | .url(url) |
| | | .get() |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | try { |
| | | response = client.newCall(request).execute(); |
| | | rsa = response.body().string(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return JSONObject.parseObject(rsa, Map.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取周末 月从0开始 |
| | | * |
| | | * @param year |
| | | * @param mouth |
| | | * @return |
| | | */ |
| | | public static Set<String> getMonthWekDay(int year, int mouth) { |
| | | Set<String> dateList = new HashSet<>(); |
| | | SimpleDateFormat simdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Calendar calendar = new GregorianCalendar(year, mouth, 1); |
| | | Calendar endCalendar = new GregorianCalendar(year, mouth, 1); |
| | | endCalendar.add(Calendar.MONTH, 1); |
| | | while (true) { |
| | | int weekday = calendar.get(Calendar.DAY_OF_WEEK); |
| | | if (weekday == 1 || weekday == 7) { |
| | | dateList.add(simdf.format(calendar.getTime())); |
| | | } |
| | | calendar.add(Calendar.DATE, 1); |
| | | if (calendar.getTimeInMillis() >= endCalendar.getTimeInMillis()) { |
| | | break; |
| | | } |
| | | } |
| | | return dateList; |
| | | } |
| | | |
| | | /** |
| | | * 判断该日期是否为工作日 |
| | | * |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | public Boolean isWeekday(DateTime dateTime){ |
| | | TestDate td=new TestDate(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(dateTime); |
| | | Set<String> jjr = td.JJR(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)); |
| | | String strdate = dateTime.toString("yyyy-MM-dd"); |
| | | for (String ans: jjr ) { |
| | | if (ans.equals(strdate)) |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 获取该日期的下个工作日是多少 |
| | | * |
| | | * @param dateTime |
| | | * @return |
| | | */ |
| | | public DateTime nextWeekDay(DateTime dateTime){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(dateTime); |
| | | while (true){ |
| | | calendar.add(calendar.DATE,1); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | String dateTimeToday = sdf.format(calendar.getTime()); |
| | | if (!WorkUtils.isWorkendDay(dateTimeToday)){ |
| | | return new DateTime(calendar);//返回日期 |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
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 |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | @ApiModel("微信订阅消息请求参数") |
| | | @Data |
| | | public class WxSubscribeDTO { |
| | | |
| | | @ApiModelProperty("用户在小程序的openid") |
| | | private String touser; |
| | | |
| | | @ApiModelProperty("所需下发的订阅模板id") |
| | | private String template_id; |
| | | |
| | | @ApiModelProperty("点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。") |
| | | private String page; |
| | | |
| | | @ApiModelProperty("模板内容,格式形如 { \"key1\": { \"value\": any }, \"key2\": { \"value\": any } }") |
| | | private Object data; |
| | | |
| | | @ApiModelProperty("跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版") |
| | | private String miniprogram_state; |
| | | |
| | | @ApiModelProperty("进入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN") |
| | | private String lang; |
| | | |
| | | private List<TemplateParam> templateParamList; |
| | | |
| | | public String toJSON() { |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("{"); |
| | | buffer.append(String.format("\"touser\":\"%s\"", this.touser)).append(","); |
| | | buffer.append(String.format("\"template_id\":\"%s\"", this.template_id)).append(","); |
| | | if (StringUtils.isNotEmpty(this.page)) { |
| | | buffer.append(String.format("\"page\":\"%s\"", this.page)).append(","); |
| | | } |
| | | if (StringUtils.isNotEmpty(this.miniprogram_state)) { |
| | | buffer.append(String.format("\"miniprogram_state\":\"%s\"", this.miniprogram_state)).append(","); |
| | | } |
| | | buffer.append("\"data\":{"); |
| | | TemplateParam param = null; |
| | | for (int i = 0; i < this.templateParamList.size(); i++) { |
| | | param = templateParamList.get(i); |
| | | // 判断是否追加逗号 |
| | | if (i < this.templateParamList.size() - 1) { |
| | | buffer.append(String.format("\"%s\": {\"value\":\"%s\"},", param.getKey(), param.getValue())); |
| | | } else { |
| | | buffer.append(String.format("\"%s\": {\"value\":\"%s\"}", param.getKey(), param.getValue())); |
| | | } |
| | | } |
| | | buffer.append("}"); |
| | | buffer.append("}"); |
| | | return buffer.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.dg.core.annotation.Authorization; |
| | | 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.db.manual.mapper.util.ConstantPropertiesUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.DefaultHttpClient; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class WxUtil { |
| | | |
| | | private static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential"; |
| | | |
| | | private static String miniprogramState="trial";//trial 为测试版 formal 为正式版 切记发布版本时候改为正式版 |
| | | |
| | | @Resource(name = "stringRedisTemplate") |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | private static WxUtil wxUtil; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | wxUtil = this; |
| | | wxUtil.stringRedisTemplate = this.stringRedisTemplate; |
| | | } |
| | | |
| | | /** |
| | | * 获取花城token,(ps:0=token获取失败) |
| | | * |
| | | * @return |
| | | */ |
| | | public String getBatteryCarAccessToken() throws Exception { |
| | | String accessToken = "0"; |
| | | // try { |
| | | // // 此处APP_ID APP_SECRET 在微信小程序后端可见 |
| | | // // String accessTokenUrl = String.format(TEMP_URL, APP_ID, APP_SECRET); |
| | | // String accessTokenUrl = ACCESS_TOKEN_URL + "&appid=" + ConstantPropertiesUtil.WX_OPEN_APP_ID |
| | | // + "&secret=" +ConstantPropertiesUtil.WX_OPEN_APP_SECRET; |
| | | // String result = httpGet(accessTokenUrl, null, null); |
| | | // Map<String, Object> resultMap = JSON.parseObject(result, Map.class); |
| | | // if (resultMap.containsKey("access_token")) { |
| | | // accessToken = resultMap.get("access_token").toString(); |
| | | // } |
| | | // } catch (IOException ioe) { |
| | | // ioe.printStackTrace(); |
| | | // } |
| | | accessToken =wxUtil.stringRedisTemplate.boundValueOps("access_token:access_token:" + ConstantPropertiesUtil.WX_OPEN_APP_ID).get(); |
| | | return accessToken; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * http请求工具类,get请求 |
| | | * |
| | | * @param url |
| | | * @param params |
| | | * @param resonseCharSet |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String httpGet(String url, Map<String, Object> params, String... resonseCharSet) throws Exception { |
| | | DefaultHttpClient defaultHttpClient = null; |
| | | BufferedReader bufferedReader = null; |
| | | try { |
| | | defaultHttpClient = new DefaultHttpClient(); |
| | | if (params != null) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | Iterator<String> iterator = params.keySet().iterator(); |
| | | String key; |
| | | while (iterator.hasNext()) { |
| | | key = iterator.next(); |
| | | Object val = params.get(key); |
| | | if (val instanceof List) { |
| | | List v = (List) val; |
| | | for (Object o : v) { |
| | | stringBuilder.append(key).append("=").append(o.toString()).append("&"); |
| | | } |
| | | } else { |
| | | stringBuilder.append(key).append("=").append(val.toString()).append("&"); |
| | | } |
| | | } |
| | | stringBuilder.deleteCharAt(stringBuilder.length() - 1); |
| | | url = url + "?" + stringBuilder.toString(); |
| | | } |
| | | HttpGet httpGet = new HttpGet(url); |
| | | httpGet.setHeader("Content-Type", "application/json;charset=ut-8"); |
| | | HttpResponse httpResponse = defaultHttpClient.execute(httpGet); |
| | | if (httpResponse.getStatusLine().getStatusCode() != 200) { |
| | | String errorLog = "请求失败,errorCode:" + httpResponse.getStatusLine().getStatusCode(); |
| | | |
| | | throw new Exception(url + errorLog); |
| | | } |
| | | // 读取返回信息 |
| | | String charSet = "utf-8"; |
| | | if (resonseCharSet != null && resonseCharSet.length > 0) |
| | | charSet = resonseCharSet[0]; |
| | | String output; |
| | | bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), charSet)); |
| | | |
| | | StringBuilder dataBuilder = new StringBuilder(); |
| | | while ((output = bufferedReader.readLine()) != null) { |
| | | dataBuilder.append(output); |
| | | } |
| | | return dataBuilder.toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | throw e; |
| | | } finally { |
| | | if (defaultHttpClient != null) |
| | | defaultHttpClient.getConnectionManager().shutdown(); |
| | | if (bufferedReader != null) |
| | | bufferedReader.close(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * http请求工具类,post请求 |
| | | * |
| | | * @param url url |
| | | * @param param 参数值 仅支持String |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String httpPost(String url, String param) throws Exception { |
| | | DefaultHttpClient defaultHttpClient = null; |
| | | BufferedReader bufferedReader = null; |
| | | try { |
| | | defaultHttpClient = new DefaultHttpClient(); |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setHeader("Content-Type", "application/json;charset=ut-8"); |
| | | if (StringUtils.isNotBlank(param)) { |
| | | HttpEntity httpEntity = new StringEntity(param, "utf-8"); |
| | | httpPost.setEntity(httpEntity); |
| | | } |
| | | HttpResponse httpResponse = defaultHttpClient.execute(httpPost); |
| | | if (httpResponse.getStatusLine().getStatusCode() != 200) { |
| | | String errorLog = "请求失败,errorCode:" + httpResponse.getStatusLine().getStatusCode(); |
| | | throw new Exception(url + errorLog); |
| | | } |
| | | // 读取返回信息 |
| | | String output; |
| | | bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), "utf-8")); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | while ((output = bufferedReader.readLine()) != null) { |
| | | stringBuilder.append(output); |
| | | } |
| | | return stringBuilder.toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | throw e; |
| | | } finally { |
| | | if (defaultHttpClient != null) |
| | | defaultHttpClient.getConnectionManager().shutdown(); |
| | | if (bufferedReader != null) |
| | | bufferedReader.close(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public static String wxMessageModeSendUrl(String token, WxSubscribeDTO subscribeDTO) throws Exception { |
| | | String tmpurl = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN"; |
| | | String url = tmpurl.replace("ACCESS_TOKEN", token); |
| | | return httpPost(url, subscribeDTO.toJSON()); |
| | | } |
| | | |
| | | /** |
| | | * 订阅消息推送 |
| | | * |
| | | * @param accessToken |
| | | * 获取会话token |
| | | * @return 消息推送结果 |
| | | */ |
| | | static void sendSubscribe(String accessToken, WxSubscribeDTO subscribeDTO) throws Exception { |
| | | String resultString = wxMessageModeSendUrl(accessToken, subscribeDTO); |
| | | JSONObject jsonResult = JSON.parseObject(resultString); |
| | | if (jsonResult != null) { |
| | | int errorCode = jsonResult.getIntValue("errcode"); |
| | | String errorMessage = jsonResult.getString("errmsg"); |
| | | if (errorCode == 0) { |
| | | System.out.println("订阅消息推送成功,openId:" + subscribeDTO.getTouser()); |
| | | } else { |
| | | System.out.println( |
| | | "订阅消息发送失败,错误码:" + errorCode + ",错误信息:" + errorMessage + "用户openid:" + subscribeDTO.getTouser()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 工单完成推送 |
| | | * |
| | | * @param openId |
| | | * 用户openid |
| | | * @param accessToken |
| | | * token会话标识 |
| | | */ |
| | | public void sendGuideRepairOrderComplete(String openId, String accessToken, String templateId, GuideEvolveEntity guideRepairOrder){ |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | subscribeDTO.setMiniprogram_state(miniprogramState); |
| | | subscribeDTO.setPage("packageE/pages/myApply/myApply"); |
| | | List<TemplateParam> paras=new ArrayList<TemplateParam>(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | paras.add(new TemplateParam("thing1","导办申请"));//业务办理类型 |
| | | paras.add(new TemplateParam("thing3",guideRepairOrder.getRemark())); |
| | | paras.add(new TemplateParam("phrase8","已完成")); |
| | | calendar.setTime(new Date()); |
| | | paras.add(new TemplateParam("time4",calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+"日"));//结束日期 |
| | | subscribeDTO.setTemplateParamList(paras); |
| | | try { |
| | | sendSubscribe(accessToken,subscribeDTO); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 工单提交推送 |
| | | * |
| | | * @param openId |
| | | * 用户openid |
| | | * @param accessToken |
| | | * token会话标识 |
| | | */ |
| | | public void sendGuideRepairOrderSubmit(String openId, String accessToken, String templateId, GuideRepairOrder guideRepairOrder){ |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | subscribeDTO.setMiniprogram_state(miniprogramState); |
| | | subscribeDTO.setPage("packageE/pages/applyHandle/index/index"); |
| | | List<TemplateParam> paras=new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing4","您有一个新的导办工单需要处理"));//工单新增提示内容 |
| | | paras.add(new TemplateParam("thing2",guideRepairOrder.getConsultUserName()));//咨询人 |
| | | paras.add(new TemplateParam("thing3",guideRepairOrder.getConsultContent()));//咨询内容 |
| | | subscribeDTO.setTemplateParamList(paras); |
| | | try { |
| | | sendSubscribe(accessToken,subscribeDTO); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 工单超时推送 |
| | | * |
| | | * @param openId |
| | | * 用户openid |
| | | * @param accessToken |
| | | * token会话标识 |
| | | */ |
| | | public void sendGuideRepairOrderOvertime(String openId, String accessToken, String templateId, SysUser sysUser){ |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | subscribeDTO.setMiniprogram_state(miniprogramState); |
| | | subscribeDTO.setPage("packageE/pages/applyHandle/index/index"); |
| | | List<TemplateParam> paras=new ArrayList<TemplateParam>(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | paras.add(new TemplateParam("time1",calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+"日"));//超时时间 |
| | | paras.add(new TemplateParam("thing2",sysUser.getUserName()+"导办人员有个工单已超时"));//咨询人 |
| | | subscribeDTO.setTemplateParamList(paras); |
| | | try { |
| | | sendSubscribe(accessToken,subscribeDTO); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2001 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20010120", false); // 班 |
| | | map.put("20010121", false); // 班 |
| | | map.put("20010124", true); // 休 |
| | | map.put("20010125", true); // 休 |
| | | map.put("20010126", true); // 休 |
| | | map.put("20010129", true); // 休 |
| | | map.put("20010130", true); // 休 |
| | | map.put("20010428", false); // 班 |
| | | map.put("20010429", false); // 班 |
| | | map.put("20010501", true); // 休 |
| | | map.put("20010502", true); // 休 |
| | | map.put("20010503", true); // 休 |
| | | map.put("20010504", true); // 休 |
| | | map.put("20010507", true); // 休 |
| | | map.put("20010929", false); // 班 |
| | | map.put("20010930", false); // 班 |
| | | map.put("20011001", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2002 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20020101", true); // 休 |
| | | map.put("20020102", true); // 休 |
| | | map.put("20020103", true); // 休 |
| | | map.put("20020209", false); // 班 |
| | | map.put("20020210", false); // 班 |
| | | map.put("20020212", true); // 休 |
| | | map.put("20020213", true); // 休 |
| | | map.put("20020214", true); // 休 |
| | | map.put("20020215", true); // 休 |
| | | map.put("20020218", true); // 休 |
| | | map.put("20020427", false); // 班 |
| | | map.put("20020428", false); // 班 |
| | | map.put("20020501", true); // 休 |
| | | map.put("20020502", true); // 休 |
| | | map.put("20020503", true); // 休 |
| | | map.put("20020506", true); // 休 |
| | | map.put("20020507", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2003 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20030101", true); // 休 |
| | | map.put("20030203", true); // 休 |
| | | map.put("20030204", true); // 休 |
| | | map.put("20030205", true); // 休 |
| | | map.put("20030206", true); // 休 |
| | | map.put("20030207", true); // 休 |
| | | map.put("20030208", false); // 班 |
| | | map.put("20030209", false); // 班 |
| | | map.put("20030426", false); // 班 |
| | | map.put("20030427", false); // 班 |
| | | map.put("20030501", true); // 休 |
| | | map.put("20030502", true); // 休 |
| | | map.put("20030505", true); // 休 |
| | | map.put("20030506", true); // 休 |
| | | map.put("20030507", true); // 休 |
| | | map.put("20030927", false); // 班 |
| | | map.put("20030928", false); // 班 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2004 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20040101", true); // 休 |
| | | map.put("20040117", false); // 班 |
| | | map.put("20040118", false); // 班 |
| | | map.put("20040122", true); // 休 |
| | | map.put("20040123", true); // 休 |
| | | map.put("20040126", true); // 休 |
| | | map.put("20040127", true); // 休 |
| | | map.put("20040128", true); // 休 |
| | | map.put("20040503", true); // 休 |
| | | map.put("20040504", true); // 休 |
| | | map.put("20040505", true); // 休 |
| | | map.put("20040506", true); // 休 |
| | | map.put("20040507", true); // 休 |
| | | map.put("20040508", false); // 班 |
| | | map.put("20040509", false); // 班 |
| | | map.put("20041001", true); // 休 |
| | | map.put("20041003", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2005 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20050103", true); // 休 |
| | | map.put("20050205", false); // 班 |
| | | map.put("20050206", false); // 班 |
| | | map.put("20050209", true); // 休 |
| | | map.put("20050210", true); // 休 |
| | | map.put("20050211", true); // 休 |
| | | map.put("20050214", true); // 休 |
| | | map.put("20050215", true); // 休 |
| | | map.put("20050430", false); // 班 |
| | | map.put("20050502", true); // 休 |
| | | map.put("20050503", true); // 休 |
| | | map.put("20050504", true); // 休 |
| | | map.put("20050505", true); // 休 |
| | | map.put("20050506", true); // 休 |
| | | map.put("20050508", false); // 班 |
| | | map.put("20051003", true); // 休 |
| | | map.put("20051004", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2006 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20060102", true); // 休 |
| | | map.put("20060103", true); // 休 |
| | | map.put("20060128", false); // 班 |
| | | map.put("20060130", true); // 休 |
| | | map.put("20060131", true); // 休 |
| | | map.put("20060201", true); // 休 |
| | | map.put("20060202", true); // 休 |
| | | map.put("20060203", true); // 休 |
| | | map.put("20060205", false); // 班 |
| | | map.put("20060429", false); // 班 |
| | | map.put("20060430", false); // 班 |
| | | map.put("20060501", true); // 休 |
| | | map.put("20060502", true); // 休 |
| | | map.put("20060503", true); // 休 |
| | | map.put("20060504", true); // 休 |
| | | map.put("20060505", true); // 休 |
| | | map.put("20060930", false); // 班 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2007 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20070101", true); // 休 |
| | | map.put("20070102", true); // 休 |
| | | map.put("20070103", true); // 休 |
| | | map.put("20070217", false); // 班 |
| | | map.put("20070219", true); // 休 |
| | | map.put("20070220", true); // 休 |
| | | map.put("20070221", true); // 休 |
| | | map.put("20070222", true); // 休 |
| | | map.put("20070223", true); // 休 |
| | | map.put("20070225", false); // 班 |
| | | map.put("20070428", false); // 班 |
| | | map.put("20070429", false); // 班 |
| | | map.put("20070501", true); // 休 |
| | | map.put("20070502", true); // 休 |
| | | map.put("20070503", true); // 休 |
| | | map.put("20070504", true); // 休 |
| | | map.put("20070507", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2008 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20080101", true); // 休 |
| | | map.put("20080203", false); // 班 |
| | | map.put("20080206", true); // 休 |
| | | map.put("20080207", true); // 休 |
| | | map.put("20080208", true); // 休 |
| | | map.put("20080211", true); // 休 |
| | | map.put("20080212", true); // 休 |
| | | map.put("20080404", true); // 休 |
| | | map.put("20080501", true); // 休 |
| | | map.put("20080502", true); // 休 |
| | | map.put("20080504", false); // 班 |
| | | map.put("20080609", true); // 休 |
| | | map.put("20080915", true); // 休 |
| | | map.put("20080927", false); // 班 |
| | | map.put("20080928", false); // 班 |
| | | map.put("20080929", true); // 休 |
| | | map.put("20080930", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2009 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20090101", true); // 休 |
| | | map.put("20090102", true); // 休 |
| | | map.put("20090104", false); // 班 |
| | | map.put("20090124", false); // 班 |
| | | map.put("20090126", true); // 休 |
| | | map.put("20090127", true); // 休 |
| | | map.put("20090128", true); // 休 |
| | | map.put("20090129", true); // 休 |
| | | map.put("20090130", true); // 休 |
| | | map.put("20090201", false); // 班 |
| | | map.put("20090406", true); // 休 |
| | | map.put("20090501", true); // 休 |
| | | map.put("20090528", true); // 休 |
| | | map.put("20090529", true); // 休 |
| | | map.put("20090531", false); // 班 |
| | | map.put("20090927", false); // 班 |
| | | map.put("20091001", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2010 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20100101", true); // 休 |
| | | map.put("20100215", true); // 休 |
| | | map.put("20100216", true); // 休 |
| | | map.put("20100217", true); // 休 |
| | | map.put("20100218", true); // 休 |
| | | map.put("20100219", true); // 休 |
| | | map.put("20100220", false); // 班 |
| | | map.put("20100221", false); // 班 |
| | | map.put("20100405", true); // 休 |
| | | map.put("20100503", true); // 休 |
| | | map.put("20100612", false); // 班 |
| | | map.put("20100613", false); // 班 |
| | | map.put("20100614", true); // 休 |
| | | map.put("20100615", true); // 休 |
| | | map.put("20100616", true); // 休 |
| | | map.put("20100919", false); // 班 |
| | | map.put("20100922", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2011 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20110103", true); // 休 |
| | | map.put("20110130", false); // 班 |
| | | map.put("20110202", true); // 休 |
| | | map.put("20110203", true); // 休 |
| | | map.put("20110204", true); // 休 |
| | | map.put("20110207", true); // 休 |
| | | map.put("20110208", true); // 休 |
| | | map.put("20110212", false); // 班 |
| | | map.put("20110402", false); // 班 |
| | | map.put("20110404", true); // 休 |
| | | map.put("20110405", true); // 休 |
| | | map.put("20110502", true); // 休 |
| | | map.put("20110606", true); // 休 |
| | | map.put("20110912", true); // 休 |
| | | map.put("20111003", true); // 休 |
| | | map.put("20111004", true); // 休 |
| | | map.put("20111005", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2012 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20120102", true); // 休 |
| | | map.put("20120103", true); // 休 |
| | | map.put("20120121", false); // 班 |
| | | map.put("20120123", true); // 休 |
| | | map.put("20120124", true); // 休 |
| | | map.put("20120125", true); // 休 |
| | | map.put("20120126", true); // 休 |
| | | map.put("20120127", true); // 休 |
| | | map.put("20120129", false); // 班 |
| | | map.put("20120331", false); // 班 |
| | | map.put("20120401", false); // 班 |
| | | map.put("20120402", true); // 休 |
| | | map.put("20120403", true); // 休 |
| | | map.put("20120404", true); // 休 |
| | | map.put("20120428", false); // 班 |
| | | map.put("20120430", true); // 休 |
| | | map.put("20120501", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2013 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20130101", true); // 休 |
| | | map.put("20130102", true); // 休 |
| | | map.put("20130103", true); // 休 |
| | | map.put("20130105", false); // 班 |
| | | map.put("20130106", false); // 班 |
| | | map.put("20130211", true); // 休 |
| | | map.put("20130212", true); // 休 |
| | | map.put("20130213", true); // 休 |
| | | map.put("20130214", true); // 休 |
| | | map.put("20130215", true); // 休 |
| | | map.put("20130216", false); // 班 |
| | | map.put("20130217", false); // 班 |
| | | map.put("20130404", true); // 休 |
| | | map.put("20130405", true); // 休 |
| | | map.put("20130407", false); // 班 |
| | | map.put("20130427", false); // 班 |
| | | map.put("20130428", false); // 班 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2014 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20140101", true); // 休 |
| | | map.put("20140126", false); // 班 |
| | | map.put("20140131", true); // 休 |
| | | map.put("20140203", true); // 休 |
| | | map.put("20140204", true); // 休 |
| | | map.put("20140205", true); // 休 |
| | | map.put("20140206", true); // 休 |
| | | map.put("20140208", false); // 班 |
| | | map.put("20140407", true); // 休 |
| | | map.put("20140501", true); // 休 |
| | | map.put("20140502", true); // 休 |
| | | map.put("20140504", false); // 班 |
| | | map.put("20140602", true); // 休 |
| | | map.put("20140908", true); // 休 |
| | | map.put("20140928", false); // 班 |
| | | map.put("20141001", true); // 休 |
| | | map.put("20141002", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2015 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20150101", true); // 休 |
| | | map.put("20150102", true); // 休 |
| | | map.put("20150104", false); // 班 |
| | | map.put("20150215", false); // 班 |
| | | map.put("20150218", true); // 休 |
| | | map.put("20150219", true); // 休 |
| | | map.put("20150220", true); // 休 |
| | | map.put("20150223", true); // 休 |
| | | map.put("20150224", true); // 休 |
| | | map.put("20150228", false); // 班 |
| | | map.put("20150406", true); // 休 |
| | | map.put("20150501", true); // 休 |
| | | map.put("20150622", true); // 休 |
| | | map.put("20150903", true); // 休 |
| | | map.put("20150904", true); // 休 |
| | | map.put("20150906", false); // 班 |
| | | map.put("20151001", true); // 休 |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util.presence; |
| | | |
| | | import com.iceyyy.icework.presence.Year20xx; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class Year2016 implements Year20xx { |
| | | @Override |
| | | public Map<String, Boolean> getYearMap() { |
| | | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
| | | map.put("20160101", true); // 休 |
| | | map.put("20160206", false); // 班 |
| | | map.put("20160208", true); // 休 |
| | | map.put("20160209", true); // 休 |
| | | map.put("20160210", true); // 休 |
| | | map.put("20160211", true); // 休 |
| | | map.put("20160212", true); // 休 |
| | | map.put("20160214", false); // 班 |
| | | map.put("20160404", true); // 休 |
| | | map.put("20160502", true); // 休 |
| | | map.put("20160609", true); // 休 |
| | | map.put("20160610", true); // 休 |
| | | map.put("20160612", false); // 班 |
| | | map.put("20160915", true); // 休 |
| | | map.put("20160916", true); // 休 |
| | | map.put("20160918", false); // 班 |
| | | map.put("20161003", true); // 休 |
| | | return map; |
| | | } |
| | | } |
flower_city/src/main/java/com/dg/core/util/presence/Year2017.java
flower_city/src/main/java/com/dg/core/util/presence/Year2018.java
flower_city/src/main/java/com/dg/core/util/presence/Year2019.java
flower_city/src/main/java/com/dg/core/util/presence/Year2020.java
flower_city/src/main/java/com/dg/core/util/presence/Year20xx.java
flower_city/src/main/java/com/dg/core/util/presence/YearMap.java
flower_city/src/main/java/com/dg/core/util/workday/Data.java
flower_city/src/main/java/com/dg/core/util/workday/WorkUtils.java
flower_city/src/main/java/com/dg/core/util/workday/WorkdayGen.java
flower_city/src/main/resources/application-sms.properties
flower_city/src/main/resources/application.properties
flower_city/src/main/resources/mapper/AgreementMapper.xml
flower_city/src/main/resources/mapper/AreaCode2022Mapper.xml
flower_city/src/main/resources/mapper/AutomessageCommonProblemMapper.xml
flower_city/src/main/resources/mapper/AutomessagePolicyDocumentsMapper.xml
flower_city/src/main/resources/mapper/AutomessageSmartConsultingMapper.xml
flower_city/src/main/resources/mapper/AutomessageSysSettingsMapper.xml
flower_city/src/main/resources/mapper/AutomessageSysSettingsRecordMapper.xml
flower_city/src/main/resources/mapper/AutomessageSysUserRecordMapper.xml
flower_city/src/main/resources/mapper/AutomessageTransactionEventInterviewMapper.xml
flower_city/src/main/resources/mapper/ClassifyAdministrationMapper.xml
flower_city/src/main/resources/mapper/ElseAccessoryMapper.xml
flower_city/src/main/resources/mapper/GuideEvolveMapper.xml
flower_city/src/main/resources/mapper/GuideRepairOrderImageMapper.xml
flower_city/src/main/resources/mapper/GuideRepairOrderMapper.xml
flower_city/src/main/resources/mapper/HomeStatisticsMapper.xml
flower_city/src/main/resources/mapper/HuaChengSysUserMapper.xml
flower_city/src/main/resources/mapper/KeywordMapper.xml
flower_city/src/main/resources/mapper/MenuMapper.xml
flower_city/src/main/resources/mapper/OrganizationChartMapper.xml
flower_city/src/main/resources/mapper/ReplyTemplateMapper.xml
flower_city/src/main/resources/mapper/RoleManagementMapper.xml
flower_city/src/main/resources/mapper/RoleMenuMapper.xml
flower_city/src/main/resources/mapper/SlideshowMapper.xml
flower_city/src/main/resources/mapper/SysUserMapper.xml
flower_city/src/main/resources/mapper/TransactionEventMapper.xml
flower_city/src/test/java/com/dg/core/WMApplicationTests.java |