Compare commits
42 Commits
3f7e9f1062
...
d1ff02d10b
Author | SHA1 | Date | |
---|---|---|---|
d1ff02d10b | |||
|
a60a5c5e65 | ||
90039cd800 | |||
3cd33d97d9 | |||
e024c3018c | |||
bd4bac2ced | |||
ae89050d8d | |||
77070a7c99 | |||
42671a4074 | |||
143dbc6cac | |||
25a8f51223 | |||
edb974c3ce | |||
4ab42970a3 | |||
9ec2f804f8 | |||
91c7e2f15c | |||
b4d10f30cd | |||
0735a44297 | |||
938662d535 | |||
a8643e80d5 | |||
a463de07a7 | |||
76a080268c | |||
f4a240d8b3 | |||
1fa722df3c | |||
c9717a5d08 | |||
bf422b35ae | |||
cd80d93d6d | |||
867efb2f51 | |||
e9a982bda9 | |||
0b17b8f59b | |||
70cf1947c8 | |||
7ac24d8509 | |||
d87d9ba6b9 | |||
f18d321415 | |||
1b7f9b73d7 | |||
145b7e7a30 | |||
06a1ea6b7d | |||
9b49aab040 | |||
b87906b4ec | |||
a04ca1f359 | |||
92a765c9d6 | |||
ccc8138948 | |||
|
c5942eb785 |
@ -23,11 +23,6 @@
|
||||
<artifactId>ludu-job-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-system</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
|
@ -1,8 +1,6 @@
|
||||
package com.xxl.job.admin.framework.security.config;
|
||||
|
||||
import com.xxl.job.admin.enums.ApiConstants;
|
||||
import com.xxl.job.admin.framework.security.core.filter.TokenAuthenticationFilter;
|
||||
import com.xxl.job.admin.framework.security.core.handler.AccessDeniedHandlerImpl;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
@ -16,42 +14,18 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Demo 模块的 Security 配置
|
||||
* Security 配置 由于案例单点登录模块引入了spring-boot-starter-security,要配Security配置,不然会使用默认全部拦截
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableWebSecurity
|
||||
public class SecurityConfiguration {
|
||||
@Resource
|
||||
private TokenAuthenticationFilter tokenAuthenticationFilter;
|
||||
|
||||
@Resource
|
||||
private AccessDeniedHandlerImpl accessDeniedHandler;
|
||||
@Resource
|
||||
private AuthenticationEntryPoint authenticationEntryPoint;
|
||||
|
||||
@Bean
|
||||
protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
|
||||
// 设置 URL 安全权限
|
||||
httpSecurity.csrf().disable() // 禁用 CSRF 保护
|
||||
.authorizeRequests()
|
||||
// 1. 静态资源,可匿名访问
|
||||
.antMatchers("/**").permitAll()
|
||||
.antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()
|
||||
// 2. 登录相关的接口,可匿名访问
|
||||
.antMatchers("/toLogin").permitAll()
|
||||
.antMatchers("/auth/login-by-code").permitAll()
|
||||
.antMatchers("/auth/refresh-token").permitAll()
|
||||
.antMatchers("/auth/logout").permitAll()
|
||||
// last. 兜底规则,必须认证
|
||||
.and().authorizeRequests()
|
||||
.anyRequest().authenticated();
|
||||
|
||||
// 设置处理器
|
||||
httpSecurity.exceptionHandling().accessDeniedHandler(accessDeniedHandler)
|
||||
.authenticationEntryPoint(authenticationEntryPoint);
|
||||
|
||||
// 添加 Token Filter
|
||||
httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
.anyRequest().permitAll(); // 放行所有,使用xxl-job的拦截器拦截
|
||||
return httpSecurity.build();
|
||||
}
|
||||
|
||||
|
@ -1,67 +0,0 @@
|
||||
package com.xxl.job.admin.framework.security.core.filter;
|
||||
|
||||
|
||||
import com.xxl.job.admin.client.OAuth2Client;
|
||||
import com.xxl.job.admin.client.dto.CommonResult;
|
||||
import com.xxl.job.admin.client.dto.oauth2.OAuth2CheckTokenRespDTO;
|
||||
import com.xxl.job.admin.framework.security.core.LoginUser;
|
||||
import com.xxl.job.admin.framework.security.core.util.SecurityUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Token 过滤器,验证 token 的有效性
|
||||
* 验证通过后,获得 {@link LoginUser} 信息,并加入到 Spring Security 上下文
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Component
|
||||
public class TokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
@Resource
|
||||
private OAuth2Client oauth2Client;
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
|
||||
FilterChain filterChain) throws ServletException, IOException {
|
||||
// 1. 获得访问令牌
|
||||
String token = SecurityUtils.obtainAuthorization(request, "Authorization");
|
||||
if (StringUtils.hasText(token)) {
|
||||
// 2. 基于 token 构建登录用户
|
||||
LoginUser loginUser = buildLoginUserByToken(token);
|
||||
// 3. 设置当前用户
|
||||
if (loginUser != null) {
|
||||
SecurityUtils.setLoginUser(loginUser, request);
|
||||
}
|
||||
}
|
||||
|
||||
// 继续过滤链
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
private LoginUser buildLoginUserByToken(String token) {
|
||||
try {
|
||||
CommonResult<OAuth2CheckTokenRespDTO> accessTokenResult = oauth2Client.checkToken(token);
|
||||
OAuth2CheckTokenRespDTO accessToken = accessTokenResult.getData();
|
||||
if (accessToken == null) {
|
||||
return null;
|
||||
}
|
||||
// 构建登录用户
|
||||
return new LoginUser().setId(accessToken.getUserId()).setUserType(accessToken.getUserType())
|
||||
.setTenantId(accessToken.getTenantId()).setScopes(accessToken.getScopes())
|
||||
.setAccessToken(accessToken.getAccessToken());
|
||||
} catch (Exception exception) {
|
||||
// 校验 Token 不通过时,考虑到一些接口是无需登录的,所以直接返回 null 即可
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package com.xxl.job.admin.framework.security.core.handler;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import com.xxl.job.admin.client.dto.CommonResult;
|
||||
import com.xxl.job.admin.framework.security.core.util.SecurityUtils;
|
||||
import com.xxl.job.admin.framework.security.core.util.ServletUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.web.access.AccessDeniedHandler;
|
||||
import org.springframework.security.web.access.ExceptionTranslationFilter;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 访问一个需要认证的 URL 资源,已经认证(登录)但是没有权限的情况下,返回 {@link GlobalErrorCodeConstants#FORBIDDEN} 错误码。
|
||||
*
|
||||
* 补充:Spring Security 通过 {@link ExceptionTranslationFilter#handleAccessDeniedException(HttpServletRequest, HttpServletResponse, FilterChain, AccessDeniedException)} 方法,调用当前类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Component
|
||||
@SuppressWarnings("JavadocReference")
|
||||
@Slf4j
|
||||
public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
|
||||
|
||||
@Override
|
||||
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException e)
|
||||
throws IOException, ServletException {
|
||||
// 打印 warn 的原因是,不定期合并 warn,看看有没恶意破坏
|
||||
log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(),
|
||||
SecurityUtils.getLoginUserId(), e);
|
||||
// 返回 403
|
||||
CommonResult<Object> result = new CommonResult<>();
|
||||
result.setCode(HttpStatus.FORBIDDEN.value());
|
||||
result.setMsg("没有该操作权限");
|
||||
ServletUtils.writeJSON(response, result);
|
||||
}
|
||||
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package com.xxl.job.admin.framework.security.core.handler;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import com.xxl.job.admin.client.dto.CommonResult;
|
||||
import com.xxl.job.admin.framework.security.core.util.ServletUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||
import org.springframework.security.web.access.ExceptionTranslationFilter;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 访问一个需要认证的 URL 资源,但是此时自己尚未认证(登录)的情况下,返回 {@link GlobalErrorCodeConstants#UNAUTHORIZED} 错误码,从而使前端重定向到登录页
|
||||
*
|
||||
* 补充:Spring Security 通过 {@link ExceptionTranslationFilter#sendStartAuthentication(HttpServletRequest, HttpServletResponse, FilterChain, AuthenticationException)} 方法,调用当前类
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@SuppressWarnings("JavadocReference") // 忽略文档引用报错
|
||||
public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint {
|
||||
|
||||
@Override
|
||||
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
|
||||
log.debug("[commence][访问 URL({}) 时,没有登录]", request.getRequestURI(), e);
|
||||
// 返回 401
|
||||
CommonResult<Object> result = new CommonResult<>();
|
||||
result.setCode(HttpStatus.UNAUTHORIZED.value());
|
||||
result.setMsg("账号未登录");
|
||||
ServletUtils.writeJSON(response, result);
|
||||
}
|
||||
|
||||
}
|
@ -69,17 +69,6 @@ public class SecurityUtils {
|
||||
return authentication.getPrincipal() instanceof LoginUser ? (LoginUser) authentication.getPrincipal() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前用户的编号,从上下文中
|
||||
*
|
||||
* @return 用户编号
|
||||
*/
|
||||
@Nullable
|
||||
public static Long getLoginUserId() {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
return loginUser != null ? loginUser.getId() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前用户
|
||||
*
|
||||
|
@ -1,32 +0,0 @@
|
||||
package com.xxl.job.admin.framework.security.core.util;
|
||||
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 客户端工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public class ServletUtils {
|
||||
|
||||
/**
|
||||
* 返回 JSON 字符串
|
||||
*
|
||||
* @param response 响应
|
||||
* @param object 对象,会序列化成 JSON 字符串
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // 必须使用 APPLICATION_JSON_UTF8_VALUE,否则会乱码
|
||||
public static void writeJSON(HttpServletResponse response, Object object) {
|
||||
String content = JSONUtil.toJsonStr(object);
|
||||
ServletUtil.write(response, content, MediaType.APPLICATION_JSON_UTF8_VALUE);
|
||||
}
|
||||
|
||||
public static void write(HttpServletResponse response, String text, String contentType) {
|
||||
ServletUtil.write(response, text, contentType);
|
||||
}
|
||||
|
||||
}
|
@ -10,8 +10,6 @@ import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.admin.core.util.JacksonUtil;
|
||||
import com.xxl.job.admin.dao.XxlJobUserDao;
|
||||
import com.xxl.job.admin.framework.security.core.LoginUser;
|
||||
import com.xxl.job.admin.framework.security.core.filter.TokenAuthenticationFilter;
|
||||
import com.xxl.job.admin.framework.security.core.handler.AccessDeniedHandlerImpl;
|
||||
import com.xxl.job.admin.framework.security.core.util.SecurityUtils;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -3,7 +3,7 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: crm.fjptzykj.com:8849
|
||||
discovery:
|
||||
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||
metadata:
|
||||
@ -16,7 +16,7 @@ spring:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||
server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址
|
||||
namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
|
@ -18,11 +18,12 @@ $(function(){
|
||||
// 直接清理cookie,直接设置过期
|
||||
document.cookie = "ACCESS_TOKEN=; max-age=0; path=/xxl-job-admin";
|
||||
document.cookie = "REFRESH_TOKEN=; max-age=0; path=/xxl-job-admin";
|
||||
layer.open({
|
||||
/*layer.open({
|
||||
icon: '2',
|
||||
title: I18n.system_tips,
|
||||
content: ('已退出登录请关闭当前会话框!' || I18n.logout_success)
|
||||
});
|
||||
content: ('已退出登录!' || I18n.logout_success)
|
||||
});*/
|
||||
window.location.href = "http://127.0.0.1:80/logout"
|
||||
/*$.post(base_url + "/logout", function(data, status) {
|
||||
if (data.code == "200") {
|
||||
layer.msg( I18n.logout_success );
|
||||
|
49
ludu-module-datacenter/ludu-module-datacenter-api/pom.xml
Normal file
49
ludu-module-datacenter/ludu-module-datacenter-api/pom.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ludu-module-datacenter</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ludu-module-datacenter-api</artifactId>
|
||||
|
||||
<packaging>jar</packaging> <!-- 2. 新增 packaging 为 jar -->
|
||||
|
||||
<name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
|
||||
<description> <!-- 4. 新增 description 为该模块的描述 -->
|
||||
数据中心 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 新增 yudao-common 依赖 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.datacenter.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.RpcConstants;
|
||||
|
||||
/**
|
||||
* API 相关的枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public class ApiConstants {
|
||||
|
||||
/**
|
||||
* 服务名
|
||||
*
|
||||
* 注意,需要保证和 spring.application.name 保持一致
|
||||
*/
|
||||
public static final String NAME = "datacenter-server";
|
||||
|
||||
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/datacenter";
|
||||
|
||||
public static final String VERSION = "1.0.0";
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.datacenter.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
ErrorCode ASSET_NOT_EXISTS = new ErrorCode(1_005_001_000, "设备不存在");
|
||||
ErrorCode CHECK_TICKET_NOT_EXISTS = new ErrorCode(1_005_001_001, "检票不存在");
|
||||
ErrorCode SALE_DATA_NOT_EXISTS = new ErrorCode(1_005_001_002, "售票不存在");
|
||||
}
|
145
ludu-module-datacenter/ludu-module-datacenter-biz/pom.xml
Normal file
145
ludu-module-datacenter/ludu-module-datacenter-biz/pom.xml
Normal file
@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ludu-module-datacenter</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ludu-module-datacenter-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>ludu-module-datacenter-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- mongodb -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||
</dependency>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-env</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-infra-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Registry 注册中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Config 配置中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 消息队列相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-ip</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 监控相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<!-- 打包 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.datacenter;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Description 大屏服务启动类
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class DatacenterServerApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DatacenterServerApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.asset;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.asset.vo.AssetRespVO;
|
||||
import cn.iocoder.yudao.module.datacenter.service.asset.AssetService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @Description 设备
|
||||
*/
|
||||
@Tag(name = "大屏服务 - 设备")
|
||||
@RestController
|
||||
@RequestMapping("/datacenter/asset")
|
||||
@Validated
|
||||
public class AssetApi {
|
||||
@Resource
|
||||
private AssetService assetService;
|
||||
@GetMapping("/type")
|
||||
@Operation(summary = "获得所有设备名称和数量")
|
||||
public CommonResult<List<Map<String, String>>> countAsset() {
|
||||
return success(assetService.countAsset());
|
||||
}
|
||||
@GetMapping("/name/{assettypename}")
|
||||
@Operation(summary = "获取符合设备类型名的所有设备")
|
||||
public CommonResult<List<AssetRespVO>> nameAsset(@PathVariable("assettypename") String assettypename) {
|
||||
return success(assetService.nameAsset(assettypename));
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.asset.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 设备 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AssetRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30538")
|
||||
@ExcelProperty("ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "数据ID", example = "15059")
|
||||
@ExcelProperty("数据ID")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "设备名称", example = "芋艿")
|
||||
@ExcelProperty("设备名称")
|
||||
private String assetname;
|
||||
|
||||
@Schema(description = "设备类型ID", example = "2")
|
||||
@ExcelProperty("设备类型ID")
|
||||
private String assettype;
|
||||
|
||||
@Schema(description = "设备类型名称", example = "芋艿")
|
||||
@ExcelProperty("设备类型名称")
|
||||
private String assettypename;
|
||||
|
||||
@Schema(description = "设备状态")
|
||||
@ExcelProperty(value = "设备状态", converter = DictConvert.class)
|
||||
@DictFormat("asset_status_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String isOnline;
|
||||
|
||||
@Schema(description = "最后一次反馈时间")
|
||||
@ExcelProperty("最后一次反馈时间")
|
||||
private Long lastfeedbacktime;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.datacenter.service.checkticket.CheckTicketService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @Description 检票
|
||||
*/
|
||||
@Tag(name = "大屏服务 - 检票")
|
||||
@RestController
|
||||
@RequestMapping("/datacenter/checkticket")
|
||||
@Validated
|
||||
public class CheckTicketApi {
|
||||
@Resource
|
||||
private CheckTicketService checkTicketService;
|
||||
@GetMapping("/{day}")
|
||||
@Operation(summary = "获得日期当天的检票人数")
|
||||
public CommonResult<Long> checkTicketTotal(@PathVariable("day") String day) {
|
||||
return success(checkTicketService.checkTicketTotal(day));
|
||||
}
|
||||
|
||||
@GetMapping("/qushi/{day}")
|
||||
@Operation(summary = "获取日期当天各个时段的检票人数")
|
||||
public CommonResult<List<Map<String, String>>> findbytimetemp(@PathVariable("day") String day) {
|
||||
return success(checkTicketService.findbytimetemp(day));
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 检票分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CheckTicketPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "ID", example = "16476")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据ID", example = "15422")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "检票点ID")
|
||||
private String checkstation;
|
||||
|
||||
@Schema(description = "检票点名称", example = "李四")
|
||||
private String checkstationname;
|
||||
|
||||
@Schema(description = "检票日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] checkticketdate;
|
||||
|
||||
@Schema(description = "检票时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] checktickettime;
|
||||
|
||||
@Schema(description = "人数", example = "23164")
|
||||
private Integer personcount;
|
||||
|
||||
@Schema(description = "订单明细ID")
|
||||
private String sdshipping;
|
||||
|
||||
@Schema(description = "票ID")
|
||||
private String ticket;
|
||||
|
||||
@Schema(description = "销售特征名称(票种名称)", example = "张三")
|
||||
private String salepropetyvaluename;
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 检票 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CheckTicketRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16476")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据ID", example = "15422")
|
||||
@ExcelProperty("数据ID")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "检票点ID")
|
||||
@ExcelProperty("检票点ID")
|
||||
private String checkstation;
|
||||
|
||||
@Schema(description = "检票点名称", example = "李四")
|
||||
@ExcelProperty("检票点名称")
|
||||
private String checkstationname;
|
||||
|
||||
@Schema(description = "检票日期")
|
||||
@ExcelProperty("检票日期")
|
||||
private String checkticketdate;
|
||||
|
||||
@Schema(description = "检票时间")
|
||||
@ExcelProperty("检票时间")
|
||||
private String checktickettime;
|
||||
|
||||
@Schema(description = "人数", example = "23164")
|
||||
@ExcelProperty("人数")
|
||||
private Integer personcount;
|
||||
|
||||
@Schema(description = "订单明细ID")
|
||||
@ExcelProperty("订单明细ID")
|
||||
private String sdshipping;
|
||||
|
||||
@Schema(description = "票ID")
|
||||
@ExcelProperty("票ID")
|
||||
private String ticket;
|
||||
|
||||
@Schema(description = "销售特征名称(票种名称)", example = "张三")
|
||||
@ExcelProperty("销售特征名称(票种名称)")
|
||||
private String salepropetyvaluename;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 检票新增/修改 Request VO")
|
||||
@Data
|
||||
public class CheckTicketSaveReqVO {
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16476")
|
||||
private Long id;
|
||||
@Schema(description = "数据ID", example = "15422")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "检票点ID")
|
||||
private String checkstation;
|
||||
|
||||
@Schema(description = "检票点名称", example = "李四")
|
||||
private String checkstationname;
|
||||
|
||||
@Schema(description = "检票日期")
|
||||
private String checkticketdate;
|
||||
|
||||
@Schema(description = "检票时间")
|
||||
private String checktickettime;
|
||||
|
||||
@Schema(description = "人数", example = "23164")
|
||||
private Integer personcount;
|
||||
|
||||
@Schema(description = "订单明细ID")
|
||||
private String sdshipping;
|
||||
|
||||
@Schema(description = "票ID")
|
||||
private String ticket;
|
||||
|
||||
@Schema(description = "销售特征名称(票种名称)", example = "张三")
|
||||
private String salepropetyvaluename;
|
||||
|
||||
@Schema(description = "租户编号")
|
||||
private Long tenant_id;
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.saledata;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.datacenter.service.saledata.SaleDataService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @Description 售票
|
||||
*/
|
||||
@Tag(name = "大屏服务 - 售票")
|
||||
@RestController
|
||||
@RequestMapping("/datacenter/saledata")
|
||||
@Validated
|
||||
public class SaleDataApi {
|
||||
@Resource
|
||||
private SaleDataService saleDataService;
|
||||
|
||||
@GetMapping("/{day}")
|
||||
@Operation(summary = "获得输入日期的当天总售票数")
|
||||
public CommonResult<Long> checkTicketTotal(@PathVariable("day") String day) {
|
||||
return success(saleDataService.countBySddate(day));
|
||||
}
|
||||
|
||||
@GetMapping("/thisyear/{startTime}")
|
||||
@Operation(summary = "获得今年日期往前十天内的数据")
|
||||
public CommonResult<List<Map<String, String>>> thisyearNum(@PathVariable("startTime") String startTime) {
|
||||
return success(saleDataService.findCheckticketcountBytime(startTime));
|
||||
}
|
||||
|
||||
@GetMapping("/lastyear/{startTime}")
|
||||
@Operation(summary = "获得去年日期往前推十天的数据")
|
||||
public CommonResult<List<Map<String, String>>> lastyearNum(@PathVariable("startTime") String startTime) {
|
||||
return success(saleDataService.findCheckticketcountBytime(startTime));
|
||||
}
|
||||
|
||||
@GetMapping("/gender")
|
||||
@Operation(summary = "获得所有数据的男女数量")
|
||||
public CommonResult<List<Map<String, String>>> findByGender() {
|
||||
return success(saleDataService.findByGender());
|
||||
}
|
||||
|
||||
@GetMapping("/age")
|
||||
@Operation(summary = "获得所有数据的年龄分段和数量")
|
||||
public CommonResult<List<Map<String, String>>> findByage() {
|
||||
return success(saleDataService.findByAge());
|
||||
}
|
||||
|
||||
@GetMapping("/lastyear/region")
|
||||
@Operation(summary = "查询去年各个省份的人数")
|
||||
public CommonResult<List<Map<String, String>>> lastyearfindByregion() {
|
||||
return success(saleDataService.findByregion(saleDataService.findEventsLastYear()));
|
||||
}
|
||||
|
||||
@GetMapping("/thisyear/region")
|
||||
@Operation(summary = "查询今年各个省份的人数")
|
||||
public CommonResult<List<Map<String, String>>> thisyearfindByregion() {
|
||||
return success(saleDataService.findByregion(saleDataService.findEventsThisYear()));
|
||||
}
|
||||
|
||||
@GetMapping("/salemethod")
|
||||
@Operation(summary = "查询各个销售渠道的购票人数")
|
||||
public CommonResult<List<Map<String, String>>> findBysaleMethod() {
|
||||
return success(saleDataService.findBySaleMethod());
|
||||
}
|
||||
|
||||
@GetMapping("/wuyi/{x}")
|
||||
@Operation(summary = "查询最近前几年当年的五一期间的数据")
|
||||
public CommonResult<List<Map<String, String>>> findByWuyi(@PathVariable("x") int x) {
|
||||
return success(saleDataService.findWuyi(x));
|
||||
}
|
||||
|
||||
@GetMapping("/guoqing/{x}")
|
||||
@Operation(summary = "查询最近前几年当年的国庆期间的数据")
|
||||
public CommonResult<List<Map<String, String>>> findByGuoqing(@PathVariable("x") int x) {
|
||||
return success(saleDataService.findGuoqing(x));
|
||||
}
|
||||
|
||||
@GetMapping("/rijunthisyear/{startTime}")
|
||||
@Operation(summary = "查询今年对应日期的近三十天日均售票数量")
|
||||
public CommonResult<String> findThisyearRijun(@PathVariable("startTime") String startTime) {
|
||||
return success(saleDataService.findrijun(startTime));
|
||||
}
|
||||
|
||||
@GetMapping("/rijunlastyear/{startTime}")
|
||||
@Operation(summary = "查询去年对应日期的近三十天日均售票数量")
|
||||
public CommonResult<String> findLastyearRijun(@PathVariable("startTime") String startTime) {
|
||||
return success(saleDataService.findrijun(startTime));
|
||||
}
|
||||
|
||||
// TODO 年度平均什么,并没有说清楚,原代码是直接计算一年的总金额
|
||||
@GetMapping("/thisyear/nianjun")
|
||||
@Operation(summary = "查询今年年度售票平均金额")
|
||||
public CommonResult<BigDecimal> findmoneythisyear() {
|
||||
return success(saleDataService.findyearJun(saleDataService.findEventsThisYear()));
|
||||
}
|
||||
|
||||
@GetMapping("/lastyear/nianjun")
|
||||
@Operation(summary = "查询去年年度售票平均金额")
|
||||
public CommonResult<BigDecimal> findmoneylastyear() {
|
||||
return success(saleDataService.findyearJun(saleDataService.findEventsLastYear()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description 自定义年龄分段
|
||||
*/
|
||||
@Data
|
||||
public class AgeVo {
|
||||
private String one;
|
||||
private String two;
|
||||
private String three;
|
||||
private String four;
|
||||
private String five;
|
||||
private String six;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AggregationVO {
|
||||
private long maleCount;
|
||||
private long femaleCount;
|
||||
private double maleRatio;
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 售票分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SaleDataPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "ID", example = "20492")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据id", example = "32044")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "证件号")
|
||||
private String certificateno;
|
||||
|
||||
@Schema(description = "证件类别", example = "2")
|
||||
private String certificatetype;
|
||||
|
||||
@Schema(description = "产品ID")
|
||||
private String item;
|
||||
|
||||
@Schema(description = "产品名称", example = "张三")
|
||||
private String itemname;
|
||||
|
||||
@Schema(description = "产品类型ID", example = "2")
|
||||
private String itemtype;
|
||||
|
||||
@Schema(description = "产品类型名称", example = "张三")
|
||||
private String itemtypename;
|
||||
|
||||
@Schema(description = "出游日期")
|
||||
private String productbatchno;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer quantity;
|
||||
|
||||
@Schema(description = "销售日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] sddate;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private String sdno;
|
||||
|
||||
@Schema(description = "销售时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] sdtime;
|
||||
|
||||
@Schema(description = "交易类别(订单类型)")
|
||||
private String transactiontypeno;
|
||||
|
||||
@Schema(description = "销售特征名称(票种名称)", example = "赵六")
|
||||
private String salepropetyvaluename;
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 售票 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SaleDataRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20492")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据id", example = "32044")
|
||||
@ExcelProperty("数据id")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "金额")
|
||||
@ExcelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "证件号")
|
||||
@ExcelProperty("证件号")
|
||||
private String certificateno;
|
||||
|
||||
@Schema(description = "证件类别", example = "2")
|
||||
@ExcelProperty("证件类别")
|
||||
private String certificatetype;
|
||||
|
||||
@Schema(description = "产品ID")
|
||||
@ExcelProperty("产品ID")
|
||||
private String item;
|
||||
|
||||
@Schema(description = "产品名称", example = "张三")
|
||||
@ExcelProperty("产品名称")
|
||||
private String itemname;
|
||||
|
||||
@Schema(description = "产品类型ID", example = "2")
|
||||
@ExcelProperty("产品类型ID")
|
||||
private String itemtype;
|
||||
|
||||
@Schema(description = "产品类型名称", example = "张三")
|
||||
@ExcelProperty("产品类型名称")
|
||||
private String itemtypename;
|
||||
|
||||
@Schema(description = "出游日期")
|
||||
@ExcelProperty("出游日期")
|
||||
private String productbatchno;
|
||||
|
||||
@Schema(description = "数量")
|
||||
@ExcelProperty("数量")
|
||||
private Integer quantity;
|
||||
|
||||
@Schema(description = "销售日期")
|
||||
@ExcelProperty("销售日期")
|
||||
private String sddate;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
@ExcelProperty("订单号")
|
||||
private String sdno;
|
||||
|
||||
@Schema(description = "销售时间")
|
||||
@ExcelProperty("销售时间")
|
||||
private String sdtime;
|
||||
|
||||
@Schema(description = "交易类别(订单类型)")
|
||||
@ExcelProperty("交易类别(订单类型)")
|
||||
private String transactiontypeno;
|
||||
|
||||
@Schema(description = "销售特征名称(票种名称)", example = "赵六")
|
||||
@ExcelProperty("销售特征名称(票种名称)")
|
||||
private String salepropetyvaluename;
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 售票新增/修改 Request VO")
|
||||
@Data
|
||||
public class SaleDataSaveReqVO {
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16476")
|
||||
private Long id;
|
||||
@Schema(description = "数据id", example = "32044")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "证件号")
|
||||
private String certificateno;
|
||||
|
||||
@Schema(description = "证件类别", example = "2")
|
||||
private String certificatetype;
|
||||
|
||||
@Schema(description = "产品ID")
|
||||
private String item;
|
||||
|
||||
@Schema(description = "产品名称", example = "张三")
|
||||
private String itemname;
|
||||
|
||||
@Schema(description = "产品类型ID", example = "2")
|
||||
private String itemtype;
|
||||
|
||||
@Schema(description = "产品类型名称", example = "张三")
|
||||
private String itemtypename;
|
||||
|
||||
@Schema(description = "出游日期")
|
||||
private String productbatchno;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer quantity;
|
||||
|
||||
@Schema(description = "销售日期")
|
||||
private String sddate;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private String sdno;
|
||||
|
||||
@Schema(description = "销售时间")
|
||||
private String sdtime;
|
||||
|
||||
@Schema(description = "交易类别(订单类型)")
|
||||
private String transactiontypeno;
|
||||
|
||||
@Schema(description = "销售特征名称(票种名称)", example = "赵六")
|
||||
private String salepropetyvaluename;
|
||||
|
||||
@Schema(description = "租户编号")
|
||||
private Long tenant_id;
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.transitionflight;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description 车辆过渡情况
|
||||
*/
|
||||
@Tag(name = "大屏服务 - 车辆过渡情况")
|
||||
@RestController
|
||||
@RequestMapping("/h5/transitionFlight")
|
||||
@Validated
|
||||
public class TransitionFlightApi {
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.weather;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.weather.vo.WeatherInfoVO;
|
||||
import cn.iocoder.yudao.module.datacenter.utlis.GoodWeatherUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description 大屏服务-天气接口
|
||||
*/
|
||||
@Tag(name = "大屏服务 - 天气接口")
|
||||
@RestController
|
||||
@RequestMapping("/h5/weather")
|
||||
@Validated
|
||||
public class WeatherApi {
|
||||
@GetMapping(value = "/getWeather")
|
||||
@Operation(summary = "获得输入城市的天气")
|
||||
public CommonResult<WeatherInfoVO> getWeather(String cityCode) {
|
||||
String weatherData = GoodWeatherUtil.getWeatherData(cityCode);
|
||||
WeatherInfoVO weatherInfo = GoodWeatherUtil.GetWeather(weatherData);
|
||||
return CommonResult.success(weatherInfo);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.admin.weather.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description 天气数据实体
|
||||
*/
|
||||
@Data
|
||||
public class WeatherInfoVO {
|
||||
private String weatherInfo;//天气
|
||||
private Integer temperature;//气温
|
||||
private String ultravioletRay;//紫外线
|
||||
private String visibility;//能见度
|
||||
private String typhoonInfo;//台风信息
|
||||
private String windPower;//风力
|
||||
private String windDirection;//风向
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.datacenter.dal.dataobject.asset;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
|
||||
@Document("asset")
|
||||
@Data
|
||||
public class Asset {
|
||||
private String id;
|
||||
private String dataId;
|
||||
private String assetname;
|
||||
private String assettype;
|
||||
private String assettypename;
|
||||
private String isOnline;
|
||||
private Long lastFeedbackTime;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.datacenter.dal.dataobject.checkticket;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document("checkticket")
|
||||
//@Document("checktickettest")
|
||||
@Data
|
||||
public class CheckTicket {
|
||||
private String id;
|
||||
private String dataId;
|
||||
private String checkstation;
|
||||
private String checkstationname;
|
||||
private String ticket;
|
||||
private String checkticketdate;
|
||||
private String checktickettime;
|
||||
private Integer personcount;
|
||||
private String sdshipping;
|
||||
private String salepropetyvaluename;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.datacenter.dal.dataobject.saledata;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Document("saledata")
|
||||
@Data
|
||||
public class SaleData {
|
||||
private String id;
|
||||
private String dataId;
|
||||
private String sdno;
|
||||
private String transactiontypeno;
|
||||
private String sddate;
|
||||
private String sdtime;
|
||||
private BigDecimal amount;
|
||||
private Integer quantity;
|
||||
private String certificatetype;
|
||||
private String certificateno;
|
||||
private String itemtype;
|
||||
private String itemtypename;
|
||||
private String item;
|
||||
private String itemname;
|
||||
private String productbatchno;
|
||||
private String salepropetyvaluename;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.datacenter.dal.mongodb.asset;
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.asset.Asset;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
*/
|
||||
@Repository
|
||||
public interface AssetRepository extends MongoRepository<Asset,String> {
|
||||
|
||||
List<Asset> findAllByAssettypename(String assettypename);
|
||||
Asset findByDataId(String dataId);
|
||||
List<Asset> findAllByIsOnline(String online);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.datacenter.dal.mongodb.checkticket;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.checkticket.CheckTicket;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@Repository
|
||||
public interface CheckTicketRepository extends MongoRepository<CheckTicket,String> {
|
||||
@Query("{'name': {'$regex': '?0', '$options': 'i'}}")
|
||||
Page<CheckTicket> findByName(String q, PageRequest pageable);
|
||||
|
||||
int countByCheckticketdate(String day);
|
||||
|
||||
@Query("{'checktickettime':{'$gte': ?0, '$lt': ?1},'checkticketdate':{'$dt': ?2}}")
|
||||
List<CheckTicket> findByTimestampBetweenAndCheckticketdate(String startTime, String endTime,String day);
|
||||
|
||||
List<CheckTicket>findByCheckticketdateAndChecktickettimeBetween(String day,String startTime, String endTime);
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.datacenter.dal.mongodb.saledata;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo.AgeVo;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo.AggregationVO;
|
||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.saledata.SaleData;
|
||||
import org.springframework.data.mongodb.repository.Aggregation;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
import org.springframework.data.mongodb.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@Repository
|
||||
public interface SaleDataRepository extends MongoRepository<SaleData,String> {
|
||||
/*@Query("{'name': {'$regex': '?0', '$options': 'i'}}")
|
||||
Page<SaleData> findByName(String q, PageRequest pageable);*/
|
||||
int countBySddate(String day);
|
||||
|
||||
|
||||
// @Query("{ 'sddate' : { $gte: ?0, $lte: ?1 } }")
|
||||
@Query(value = "{ 'sddate': { $gte: ?0, $lte: ?1 } }", fields = "{ 'certificateno': 1, 'amount': 1}")
|
||||
List<SaleData>findBySddateBetween(String begin,String end);
|
||||
|
||||
@Aggregation(pipeline = {
|
||||
"{$project: {certLength: {$strLenCP: '$certificateno'}, secondLastChar: {$substrCP: ['$certificateno', {$subtract: [{$strLenCP: '$certificateno'}, 2]}, 1]}}}",
|
||||
"{$group: {_id: null, maleCount: {$sum: {$cond: {if: {$eq: [{$mod: [{$toInt: '$secondLastChar'}, 2]}, 1]}, then: 1, else: 0}}}, femaleCount: {$sum: {$cond: {if: {$eq: [{$mod: [{$toInt: '$secondLastChar'}, 2]}, 0]}, then: 1, else: 0}}}, totalCount: {$sum: 1}}}",
|
||||
"{$project: {_id: 0, maleCount: 1, femaleCount: 1, maleRatio: {$divide: ['$maleCount', '$totalCount']}}}"
|
||||
})
|
||||
AggregationVO findAllByCertificateno();
|
||||
|
||||
@Aggregation(pipeline = {
|
||||
"{$match: {certificateno: {$regex: '^.{18}$'}}}",
|
||||
"{$project: {birthYear: {$toInt: {$substr: ['$certificateno', 6, 4]}}, currentYear: {$year: '$$NOW'}}}",
|
||||
"{$addFields: {age: {$subtract: ['$currentYear', '$birthYear']}}}",
|
||||
"{$group: {_id: null, one: {$sum: {$cond: [{$lte: ['$age', 20]}, 1, 0]}}, " +
|
||||
"two: {$sum: {$cond: [{$and: [{$gt: ['$age', 20]}, {$lte: ['$age', 30]}]}, 1, 0]}}, " +
|
||||
"three: {$sum: {$cond: [{$and: [{$gt: ['$age', 30]}, {$lte: ['$age', 40]}]}, 1, 0]}}, " +
|
||||
"four: {$sum: {$cond: [{$and: [{$gt: ['$age', 40]}, {$lte: ['$age', 50]}]}, 1, 0]}}, " +
|
||||
"five: {$sum: {$cond: [{$and: [{$gt: ['$age', 50]}, {$lte: ['$age', 60]}]}, 1, 0]}}, " +
|
||||
"six: {$sum: {$cond: [{$gt: ['$age', 60]}, 1, 0]}}}}"
|
||||
})
|
||||
AgeVo findByAge();
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.yudao.module.datacenter.framework.rpc.config;
|
||||
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {})
|
||||
public class RpcConfiguration {
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.datacenter.framework.security.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
||||
|
||||
/**
|
||||
* Demo 模块的 Security 配置
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
|
||||
.antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
|
||||
// Spring Boot Actuator 的安全配置
|
||||
registry.antMatchers("/actuator").anonymous()
|
||||
.antMatchers("/actuator/**").anonymous();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.asset;
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.asset.vo.AssetRespVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface AssetService {
|
||||
|
||||
|
||||
/**
|
||||
* 计算不同设备的数量
|
||||
* @param
|
||||
* @return 所有设备名称和数量
|
||||
*/
|
||||
public List<Map<String, String>> countAsset();
|
||||
|
||||
/**
|
||||
* 获取符合设备类型名的所有设备
|
||||
* @param assettypename 设备类型名
|
||||
* @return java.util.List<cn.iocoder.yudao.module.ticket.dal.dataobject.asset.AssetDO>
|
||||
*/
|
||||
public List<AssetRespVO> nameAsset(String assettypename);
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.asset;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.asset.vo.AssetRespVO;
|
||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.asset.Asset;
|
||||
import cn.iocoder.yudao.module.datacenter.dal.mongodb.asset.AssetRepository;
|
||||
import com.baomidou.dynamic.datasource.annotation.Slave;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* 设备 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class AssetServiceImpl implements AssetService {
|
||||
|
||||
@Autowired
|
||||
private AssetRepository assetRepository;
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> countAsset() {
|
||||
List<Asset> assetList = assetRepository.findAll();
|
||||
int[] assetTypeCounts = new int[3];
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
for (Asset asset : assetList) {
|
||||
String assettype = asset.getAssettype();
|
||||
switch (assettype) {
|
||||
case "C":
|
||||
assetTypeCounts[0]++;
|
||||
break;
|
||||
case "D":
|
||||
assetTypeCounts[1]++;
|
||||
break;
|
||||
case "F":
|
||||
assetTypeCounts[2]++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
map.put("其他电子设备", String.valueOf(assetTypeCounts[0]));
|
||||
map.put("运输设备", String.valueOf(assetTypeCounts[1]));
|
||||
map.put("手持机", String.valueOf(assetTypeCounts[2]));
|
||||
List<Map<String,String>>mapList=new ArrayList<>();
|
||||
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
|
||||
Map<String, String> map1=new LinkedHashMap<>();
|
||||
map1.put("assettype",stringStringEntry.getKey());
|
||||
map1.put("count",stringStringEntry.getValue());
|
||||
mapList.add(map1);
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AssetRespVO> nameAsset(String assettypename) {
|
||||
List<AssetRespVO> assetRespVOList = new ArrayList<>();
|
||||
for (Asset assetDO : assetRepository.findAllByAssettypename(assettypename)) {
|
||||
AssetRespVO assetRespVO = BeanUtils.toBean(assetDO, AssetRespVO.class);
|
||||
if (assetDO.getLastFeedbackTime() != null) {
|
||||
assetRespVO.setLastfeedbacktime(assetDO.getLastFeedbackTime());
|
||||
}
|
||||
assetRespVOList.add(assetRespVO);
|
||||
}
|
||||
return assetRespVOList;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.checkticket;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检票 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface CheckTicketService {
|
||||
|
||||
|
||||
/**
|
||||
* 获取日期当天各个时段的检票人数
|
||||
* @param day
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.String>>
|
||||
*/
|
||||
public List<Map<String, String>> findbytimetemp(String day);
|
||||
|
||||
/**
|
||||
* 获得日期当天的检票人数
|
||||
* @param day 日期
|
||||
* @return long 检票人数
|
||||
*/
|
||||
public long checkTicketTotal(String day);
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.checkticket;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.checkticket.CheckTicket;
|
||||
import cn.iocoder.yudao.module.datacenter.dal.mongodb.checkticket.CheckTicketRepository;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 检票 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CheckTicketServiceImpl implements CheckTicketService {
|
||||
|
||||
@Resource
|
||||
private CheckTicketRepository checkTicketRepository;
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> findbytimetemp(String day) {
|
||||
LocalDateTime startTime = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
|
||||
List<Map<String, String>> mapList = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < 24; i++) {
|
||||
Map<String,String>map =new LinkedHashMap<>();
|
||||
LocalDateTime hourStartTime = startTime.withHour(i).withMinute(0).withSecond(0).withNano(0);
|
||||
LocalDateTime hourEndTime = hourStartTime.plusHours(1);
|
||||
String begintime = formatter.format(hourStartTime);
|
||||
String endtime = formatter.format(hourEndTime);
|
||||
List<CheckTicket> checkTickets = checkTicketRepository.findByCheckticketdateAndChecktickettimeBetween(day,begintime,endtime);
|
||||
map.put("date",begintime+"-"+endtime);
|
||||
map.put("count", String.valueOf(checkTickets.stream().count()));
|
||||
mapList.add(map);
|
||||
}
|
||||
|
||||
return mapList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long checkTicketTotal(String day) {
|
||||
return checkTicketRepository.countByCheckticketdate(day);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.saledata;
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.saledata.SaleData;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 售票 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SaleDataService {
|
||||
|
||||
/**
|
||||
* 获得输入日期的当天总售票数
|
||||
* @param day 日期
|
||||
* @return 当天总售票数
|
||||
*/
|
||||
public long countBySddate(String day);
|
||||
/**
|
||||
* 日期往前十天内的数据
|
||||
* @param startTime 起始日期
|
||||
* @return java.util.List<java.util.Map>
|
||||
*/
|
||||
|
||||
public List<Map<String,String>> findCheckticketcountBytime(String startTime);
|
||||
|
||||
/**
|
||||
* 查询男女人数
|
||||
* @return 男女人数
|
||||
*/
|
||||
public List<Map<String, String>> findByGender();
|
||||
|
||||
/**
|
||||
* 查询各个年龄段的人数
|
||||
* @return 各个年龄段的人数
|
||||
*/
|
||||
public List<Map<String, String>> findByAge();
|
||||
|
||||
/**
|
||||
* 查询去年1月1日到12月31日的全部数据
|
||||
* @return
|
||||
*/
|
||||
public List<SaleData> findEventsLastYear();
|
||||
/**
|
||||
* 查询今年1月1日到12月31日的全部数据
|
||||
* @return
|
||||
*/
|
||||
public List<SaleData> findEventsThisYear();
|
||||
|
||||
/**
|
||||
* 查询各个省份和人数
|
||||
* @param list 售票数据
|
||||
* @return 各个省份和人数
|
||||
*/
|
||||
public List<Map<String, String>> findByregion(List<SaleData> list);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询销售渠道
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, String>> findBySaleMethod();
|
||||
|
||||
/**
|
||||
* 查询最近前x年五一期间的数据
|
||||
* @param x 前几年
|
||||
*/
|
||||
List<Map<String, String>> findWuyi(int x);
|
||||
/**
|
||||
* 查询最近前x年国庆期间的数据
|
||||
* @param x 前几年
|
||||
*/
|
||||
List<Map<String, String>> findGuoqing(int x);
|
||||
|
||||
/**
|
||||
* 查询今年的近三十天日均
|
||||
* @param startTime 中间时间
|
||||
* @return java.lang.Object
|
||||
*/
|
||||
String findrijun(String startTime);
|
||||
|
||||
/**
|
||||
* 查年度平均
|
||||
* @param list 一年的全部数据
|
||||
* @return java.math.BigDecimal
|
||||
*/
|
||||
BigDecimal findyearJun(List<SaleData> list);
|
||||
}
|
@ -0,0 +1,360 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.saledata;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.ticket.IdCardUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo.AgeVo;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo.AggregationVO;
|
||||
import cn.iocoder.yudao.module.datacenter.dal.dataobject.saledata.SaleData;
|
||||
import cn.iocoder.yudao.module.datacenter.dal.mongodb.saledata.SaleDataRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* 售票 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
public class SaleDataServiceImpl implements SaleDataService {
|
||||
|
||||
@Autowired
|
||||
private SaleDataRepository saleDataRepository;
|
||||
@Override
|
||||
public long countBySddate(String day) {
|
||||
return saleDataRepository.countBySddate(day);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,String>> findCheckticketcountBytime(String startTime) {
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date date1= null;
|
||||
try {
|
||||
date1 = inputFormat.parse(startTime);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
calendar.setTime(date1);
|
||||
calendar.add(Calendar.DAY_OF_YEAR, -9);
|
||||
List<Map<String,String>>map = new ArrayList<>();
|
||||
while (!calendar.getTime().after(date1)){
|
||||
Map<String,String>map1= new HashMap<>();
|
||||
String date = inputFormat.format(calendar.getTime());
|
||||
map1.put("date",outputFormat.format(calendar.getTime()));
|
||||
map1.put("count", String.valueOf(this.countBySddate(date)));
|
||||
map.add(map1);
|
||||
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> findByGender() {
|
||||
AggregationVO allByCertificateno = saleDataRepository.findAllByCertificateno();
|
||||
List<Map<String, String>> map = new ArrayList<>();
|
||||
Map<String,String>map1=new HashMap<>();
|
||||
Map<String,String>map2=new HashMap<>();
|
||||
map1.put("sex","女生" );
|
||||
map1.put("count",Long.toString(allByCertificateno.getFemaleCount()));
|
||||
map2.put("sex","男生" );
|
||||
map2.put("count", Long.toString(allByCertificateno.getMaleCount()));
|
||||
map.add(map1);
|
||||
map.add(map2);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> findByAge() {
|
||||
AgeVo byAge = saleDataRepository.findByAge();
|
||||
List<Map<String,String>>map=new ArrayList<>();
|
||||
Map<String,String>map1=new LinkedHashMap<>();
|
||||
Map<String,String>map2=new LinkedHashMap<>();
|
||||
Map<String,String>map3=new LinkedHashMap<>();
|
||||
Map<String,String>map4=new LinkedHashMap<>();
|
||||
Map<String,String>map5=new LinkedHashMap<>();
|
||||
Map<String,String>map6=new LinkedHashMap<>();
|
||||
|
||||
map1.put("age","20以下");
|
||||
map1.put("count",byAge.getOne());
|
||||
map2.put("age","20-30");
|
||||
map2.put("count",byAge.getTwo());
|
||||
map3.put("age","30-40");
|
||||
map3.put("count",byAge.getThree());
|
||||
map4.put("age","40-50");
|
||||
map4.put("count",byAge.getFour());
|
||||
map5.put("age","50-60");
|
||||
map5.put("count",byAge.getFive());
|
||||
map6.put("age","60以上");
|
||||
map6.put("count",byAge.getSix());
|
||||
map.add(map1);
|
||||
map.add(map2);
|
||||
map.add(map3);
|
||||
map.add(map4);
|
||||
map.add(map5);
|
||||
map.add(map6);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SaleData> findEventsLastYear() {
|
||||
DateTimeFormatter date = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
LocalDate lastYear = LocalDate.now().minusYears(1);
|
||||
LocalDate startOfYear = lastYear.withDayOfYear(1);
|
||||
LocalDate endOfYear = lastYear.withDayOfYear(lastYear.lengthOfYear());
|
||||
String start = date.format(startOfYear);
|
||||
String end = date.format(endOfYear);
|
||||
return saleDataRepository.findBySddateBetween(start, end);
|
||||
}
|
||||
@Override
|
||||
public List<SaleData> findEventsThisYear() {
|
||||
DateTimeFormatter date = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
LocalDate thisYear = LocalDate.now().minusYears(0);
|
||||
LocalDate startOfYear = thisYear.withDayOfYear(1);
|
||||
LocalDate endOfYear = thisYear.withDayOfYear(thisYear.lengthOfYear());
|
||||
String start = date.format(startOfYear);
|
||||
String end = date.format(endOfYear);
|
||||
return saleDataRepository.findBySddateBetween(start,end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> findByregion(List<SaleData> list) {
|
||||
// 初始化每个省市的计数器
|
||||
Map<String, Integer> regionCounts = new LinkedHashMap<>();
|
||||
String[] regions = {
|
||||
"北京市", "天津市", "河北省", "山西省", "内蒙古自治区", "辽宁省", "吉林省", "黑龙江省",
|
||||
"上海市", "江苏省", "浙江省", "安徽省", "福建省", "江西省", "山东省", "河南省",
|
||||
"湖北省", "湖南省", "广东省", "广西壮族自治区", "海南省", "重庆市", "四川省",
|
||||
"贵州省", "云南省", "西藏自治区", "陕西省", "甘肃省", "青海省", "宁夏回族自治区",
|
||||
"新疆维吾尔自治区", "台湾省", "香港特别行政区", "澳门特别行政区"
|
||||
};
|
||||
for (String region : regions) {
|
||||
regionCounts.put(region, 0);
|
||||
}
|
||||
|
||||
// 遍历销售数据列表
|
||||
for (SaleData saleData : list) {
|
||||
String certificateno = saleData.getCertificateno();
|
||||
if (certificateno.length() != 18) {
|
||||
continue;
|
||||
}
|
||||
String region = IdCardUtil.getRegion(certificateno);
|
||||
if (regionCounts.containsKey(region)) {
|
||||
regionCounts.put(region, regionCounts.get(region) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 构建返回的结果列表
|
||||
List<Map<String, String>> mapList = new ArrayList<>();
|
||||
for (Map.Entry<String, Integer> entry : regionCounts.entrySet()) {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("region", entry.getKey());
|
||||
map.put("count", String.valueOf(entry.getValue()));
|
||||
mapList.add(map);
|
||||
}
|
||||
|
||||
return mapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> findBySaleMethod() {
|
||||
List<SaleData> saleDataList = saleDataRepository.findAll();
|
||||
int[] saleMethodCounts = new int[5];
|
||||
Map<String,String>map=new LinkedHashMap<>();
|
||||
for (SaleData saleData : saleDataList) {
|
||||
String transactiontypeno = saleData.getTransactiontypeno();
|
||||
switch (transactiontypeno){
|
||||
case "SD01":
|
||||
saleMethodCounts[0]++;
|
||||
break;
|
||||
case "SD02":
|
||||
saleMethodCounts[1]++;
|
||||
break;
|
||||
case "SD03":
|
||||
saleMethodCounts[2]++;
|
||||
break;
|
||||
case "SD04":
|
||||
saleMethodCounts[3]++;
|
||||
break;
|
||||
case "SD05":
|
||||
saleMethodCounts[4]++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
map.put("一般销货", String.valueOf(saleMethodCounts[0]));
|
||||
map.put("网络订单", String.valueOf(saleMethodCounts[1]));
|
||||
map.put("特殊退票", String.valueOf(saleMethodCounts[2]));
|
||||
map.put("预约单", String.valueOf(saleMethodCounts[3]));
|
||||
map.put("快速购票", String.valueOf(saleMethodCounts[4]));
|
||||
List<Map<String,String>>mapList=new ArrayList<>();
|
||||
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
|
||||
Map<String, String> map1=new LinkedHashMap<>();
|
||||
map1.put("transactiontypeno",stringStringEntry.getKey());
|
||||
map1.put("count",stringStringEntry.getValue());
|
||||
mapList.add(map1);
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> findWuyi(int x) {
|
||||
DateTimeFormatter date = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
LocalDate xYear = LocalDate.now().minusYears(x);
|
||||
LocalDate month = xYear.withMonth(5);
|
||||
LocalDate startOfMonth = month.withDayOfMonth(1);
|
||||
LocalDate endOfMonth = month.withDayOfMonth(5);
|
||||
String start = date.format(startOfMonth);
|
||||
String end = date.format(endOfMonth);
|
||||
List<SaleData> saleDataList = saleDataRepository.findBySddateBetween(start, end);
|
||||
int[] Counts = new int[5];
|
||||
for (SaleData saleData : saleDataList) {
|
||||
String sddate = saleData.getSddate();
|
||||
String substring = sddate.substring(6, 8);
|
||||
switch (substring){
|
||||
case "01":
|
||||
Counts[0]++;
|
||||
break;
|
||||
case "02":
|
||||
Counts[1]++;
|
||||
break;
|
||||
case "03":
|
||||
Counts[2]++;
|
||||
break;
|
||||
case "04":
|
||||
Counts[3]++;
|
||||
break;
|
||||
case "05":
|
||||
Counts[4]++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<Map<String,String>>mapList=new ArrayList<>();
|
||||
Map<String,String> map=new LinkedHashMap();
|
||||
map.put("第一天", String.valueOf(Counts[0]));
|
||||
map.put("第二天", String.valueOf(Counts[1]));
|
||||
map.put("第三天", String.valueOf(Counts[2]));
|
||||
map.put("第四天", String.valueOf(Counts[3]));
|
||||
map.put("第五天", String.valueOf(Counts[4]));
|
||||
for (Map.Entry stringStringEntry : map.entrySet()) {
|
||||
Map map1=new LinkedHashMap();
|
||||
map1.put("day",stringStringEntry.getKey());
|
||||
map1.put("count",stringStringEntry.getValue());
|
||||
mapList.add(map1);
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> findGuoqing(int x) {
|
||||
DateTimeFormatter date = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
LocalDate xYear = LocalDate.now().minusYears(x);
|
||||
LocalDate month = xYear.withMonth(10);
|
||||
LocalDate startOfMonth = month.withDayOfMonth(1);
|
||||
LocalDate endOfMonth = month.withDayOfMonth(7);
|
||||
String start = date.format(startOfMonth);
|
||||
String end = date.format(endOfMonth);
|
||||
List<SaleData> saleDataList = saleDataRepository.findBySddateBetween(start, end);
|
||||
int[] Counts = new int[7];
|
||||
for (SaleData saleData : saleDataList) {
|
||||
String sddate = saleData.getSddate();
|
||||
String substring = sddate.substring(6, 8);
|
||||
switch (substring){
|
||||
case "01":
|
||||
Counts[0]++;
|
||||
break;
|
||||
case "02":
|
||||
Counts[1]++;
|
||||
break;
|
||||
case "03":
|
||||
Counts[2]++;
|
||||
break;
|
||||
case "04":
|
||||
Counts[3]++;
|
||||
break;
|
||||
case "05":
|
||||
Counts[4]++;
|
||||
break;
|
||||
case "06":
|
||||
Counts[5]++;
|
||||
break;
|
||||
case "07":
|
||||
Counts[6]++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<Map<String,String>>mapList=new ArrayList<>();
|
||||
Map<String,String> map=new LinkedHashMap();
|
||||
map.put("第一天", String.valueOf(Counts[0]));
|
||||
map.put("第二天", String.valueOf(Counts[1]));
|
||||
map.put("第三天", String.valueOf(Counts[2]));
|
||||
map.put("第四天", String.valueOf(Counts[3]));
|
||||
map.put("第五天", String.valueOf(Counts[4]));
|
||||
map.put("第六天", String.valueOf(Counts[5]));
|
||||
map.put("第七天", String.valueOf(Counts[6]));
|
||||
for (Map.Entry stringStringEntry : map.entrySet()) {
|
||||
Map map1=new LinkedHashMap();
|
||||
map1.put("day",stringStringEntry.getKey());
|
||||
map1.put("count",stringStringEntry.getValue());
|
||||
mapList.add(map1);
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findrijun(String startTime) {
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date date1 = null;
|
||||
try {
|
||||
date1 = inputFormat.parse(startTime);
|
||||
} catch (ParseException e) {
|
||||
// throw new RuntimeException(e);
|
||||
System.out.println("抛出日期转换异常");
|
||||
}
|
||||
assert date1 != null;
|
||||
calendar.setTime(date1);
|
||||
calendar.add(Calendar.DAY_OF_YEAR, -29);
|
||||
Map<String,String>map = new LinkedHashMap<>();
|
||||
int count = 0;
|
||||
while (!calendar.getTime().after(date1)){
|
||||
String date = inputFormat.format(calendar.getTime());
|
||||
long i = this.countBySddate(date);
|
||||
count+=i;
|
||||
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
||||
}
|
||||
return String.valueOf(count/30);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal findyearJun(List<SaleData> list) {
|
||||
BigDecimal total=new BigDecimal(0);
|
||||
for (SaleData saleData : list) {
|
||||
BigDecimal amount = saleData.getAmount();
|
||||
total=total.add(amount);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
package cn.iocoder.yudao.module.datacenter.utlis;
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.controller.admin.weather.vo.WeatherInfoVO;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* 获取天气数据
|
||||
*/
|
||||
|
||||
public class GoodWeatherUtil {
|
||||
|
||||
//高德地图
|
||||
private static final String WEATHER_SERVICES_URL = "https://restapi.amap.com/v3/weather/weatherInfo?city=";
|
||||
private static final String WEATHER_KEY = "&key=172993e9541be0a4f824feedeb210b7e";
|
||||
|
||||
//和风天气
|
||||
private static final String WEATHER_SERVICES_URL2 = "https://geoapi.qweather.com/v2/city/lookup?";
|
||||
private static final String LOCATION = "location="; //区县名称
|
||||
private static final String ADM = "&adm="; //城市名称
|
||||
private static final String PRIVATE_KEY = "&key=1c0db79d181441258030a633197fb429";
|
||||
|
||||
|
||||
|
||||
public static String getWeatherData(String cityCode){
|
||||
int codelength = cityCode.length();
|
||||
if (6 != codelength){
|
||||
return "500";
|
||||
}
|
||||
StringBuffer sb = new StringBuffer();
|
||||
try {
|
||||
String weather_url = WEATHER_SERVICES_URL+cityCode+WEATHER_KEY;
|
||||
URL url = new URL(weather_url);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
connection.setRequestProperty("Charset", "utf-8");
|
||||
connection.connect();
|
||||
//读取URL的响应
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null)
|
||||
sb.append(line + " ");
|
||||
reader.close();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 将JSON格式数据进行解析 ,返回一个weather对象
|
||||
*/
|
||||
public static WeatherInfoVO GetWeather(String weatherInfobyJson) {
|
||||
if ("500".equals(weatherInfobyJson)){
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject dataOfJson = JSONObject.parseObject(weatherInfobyJson);
|
||||
System.out.println(dataOfJson);
|
||||
//创建WeatherInfo对象,提取所需的天气信息
|
||||
WeatherInfoVO weatherInfoVO = new WeatherInfoVO();
|
||||
|
||||
//从json数据中提取数据
|
||||
JSONArray forecasts = dataOfJson.getJSONArray("lives");
|
||||
JSONObject weather = forecasts.getJSONObject(0);
|
||||
|
||||
// 取得当天的天气信息
|
||||
weatherInfoVO.setWeatherInfo(weather.getString("weather"));
|
||||
|
||||
// 设置气温
|
||||
String temperature = weather.getString("temperature");
|
||||
weatherInfoVO.setTemperature(Integer.parseInt(temperature));
|
||||
|
||||
//设置风力信息
|
||||
String windPower = weather.getString("windpower");
|
||||
weatherInfoVO.setWindPower(windPower);
|
||||
|
||||
//设置风向信息
|
||||
String windDirection = weather.getString("winddirection");
|
||||
weatherInfoVO.setWindDirection(windDirection);
|
||||
|
||||
return weatherInfoVO;
|
||||
}
|
||||
|
||||
//
|
||||
// public static String getWeatherDataHF(String areaName,String cityName){
|
||||
// if (areaName == null && cityName == null){
|
||||
// return "500";
|
||||
// }
|
||||
// StringBuffer sb = new StringBuffer();
|
||||
// try {
|
||||
// String weather_url = WEATHER_SERVICES_URL2+LOCATION+areaName+ADM+cityName+PRIVATE_KEY;
|
||||
// URL url = new URL(weather_url);
|
||||
// HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
// connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
// connection.setRequestProperty("Charset", "utf-8");
|
||||
// connection.connect();
|
||||
// //读取URL的响应
|
||||
// BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
|
||||
// String line = null;
|
||||
// while ((line = reader.readLine()) != null)
|
||||
// sb.append(line + " ");
|
||||
// reader.close();
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return sb.toString();
|
||||
// }
|
||||
|
||||
/*
|
||||
* 将JSON格式数据进行解析 ,返回一个weather对象
|
||||
*/
|
||||
// public static String GetWeatherHF(String weatherInfobyJson) {
|
||||
// if ("500".equals(weatherInfobyJson)){
|
||||
// return null;
|
||||
// }
|
||||
// JSONObject dataOfJson = JSONObject.parseObject(weatherInfobyJson);
|
||||
// System.out.println(dataOfJson);
|
||||
// //创建WeatherInfo对象,提取所需的天气信息
|
||||
// WeatherInfoVO weatherInfoVO = new WeatherInfoVO();
|
||||
//
|
||||
// //从json数据中提取数据
|
||||
// JSONArray location = dataOfJson.getJSONArray("location");
|
||||
// JSONObject weather = location.getJSONObject(0);
|
||||
//
|
||||
// // 取得当天的天气信息
|
||||
// weatherInfoVO.setWeatherInfo(weather.getString("weather"));
|
||||
//
|
||||
// // 设置气温
|
||||
// String temperature = weather.getString("temperature");
|
||||
// weatherInfoVO.setTemperature(Integer.parseInt(temperature));
|
||||
//
|
||||
// //设置风力信息
|
||||
// String windPower = weather.getString("windpower");
|
||||
// weatherInfoVO.setWindPower(windPower);
|
||||
//
|
||||
// //设置风向信息
|
||||
// String windDirection = weather.getString("winddirection");
|
||||
// weatherInfoVO.setWindDirection(windDirection);
|
||||
//
|
||||
// return weatherInfoVO;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public static void main(String [] args) {
|
||||
String weatherData = GoodWeatherUtil.getWeatherData("360730");
|
||||
|
||||
|
||||
WeatherInfoVO weatherInfoVO = GoodWeatherUtil.GetWeather(weatherData);
|
||||
|
||||
System.out.println(weatherInfoVO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
# 数据源配置项
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: # 控制台管理用户名和密码
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 5 # 初始连接数
|
||||
min-idle: 10 # 最小连接池数量
|
||||
max-active: 20 # 最大连接池数量
|
||||
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: 123456
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
host: 400-infra.server.iocoder.cn # 地址
|
||||
port: 6379 # 端口
|
||||
database: 1 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
# Spring Boot Admin Client 客户端的相关配置
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||
# Spring Boot Admin Server 服务端的相关配置
|
||||
context-path: /admin # 配置 Spring
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
yudao:
|
||||
xss:
|
||||
enable: false
|
||||
web:
|
||||
admin-ui:
|
||||
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
|
||||
demo: true # 开启演示模式
|
@ -0,0 +1,132 @@
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
# mongodb数据源
|
||||
data:
|
||||
mongodb:
|
||||
uri: mongodb://root:123456@120.46.37.243:27017/admin?authMechanism=SCRAM-SHA-256
|
||||
database: sn-lundu-db
|
||||
# 数据源配置项
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: # 控制台管理用户名和密码
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 1 # 初始连接数
|
||||
min-idle: 1 # 最小连接池数量
|
||||
max-active: 20 # 最大连接池数量
|
||||
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://120.46.37.243:3306/ludu_ticketing?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
|
||||
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例
|
||||
# url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
|
||||
username: root
|
||||
password: xpower1234
|
||||
# username: sa # SQL Server 连接的示例
|
||||
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
|
||||
# username: SYSDBA # DM 连接的示例
|
||||
# password: SYSDBA # DM 连接的示例
|
||||
slave: # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
host: crm.fjptzykj.com # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
xxl:
|
||||
job:
|
||||
enabled: false # 是否开启调度中心,默认为 true 开启
|
||||
admin:
|
||||
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
# Spring Boot Admin Client 客户端的相关配置
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
level:
|
||||
# 配置自己写的 MyBatis Mapper 打印日志
|
||||
cn.iocoder.yudao.module.system.dal.mysql: debug
|
||||
cn.iocoder.yudao.module.system.dal.mysql.sensitiveword.SensitiveWordMapper: INFO # 配置 SensitiveWordMapper 的日志级别为 info
|
||||
cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
yudao:
|
||||
env: # 多环境的配置项
|
||||
tag: ${HOSTNAME}
|
||||
web:
|
||||
admin-ui:
|
||||
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
|
||||
security:
|
||||
mock-enable: true
|
||||
xss:
|
||||
enable: false
|
||||
access-log: # 访问日志的配置项
|
||||
enable: false
|
||||
demo: false # 关闭演示模式
|
@ -0,0 +1,98 @@
|
||||
spring:
|
||||
main:
|
||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
||||
|
||||
# Servlet 配置
|
||||
servlet:
|
||||
# 文件上传相关配置项
|
||||
multipart:
|
||||
max-file-size: 16MB # 单个文件大小
|
||||
max-request-size: 32MB # 设置总上传的文件大小
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ANT_PATH_MATCHER # 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题,参见 SpringFoxHandlerProviderBeanPostProcessor 类
|
||||
|
||||
# Jackson 配置项
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
|
||||
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
|
||||
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
|
||||
fail-on-empty-beans: false # 允许序列化无属性的 Bean
|
||||
|
||||
# Cache 配置项
|
||||
cache:
|
||||
type: REDIS
|
||||
redis:
|
||||
time-to-live: 1h # 设置过期时间为 1 小时
|
||||
|
||||
--- #################### 接口文档配置 ####################
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: true # 1. 是否开启 Swagger 接文档的元数据
|
||||
path: /v3/api-docs
|
||||
swagger-ui:
|
||||
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
|
||||
path: /swagger-ui.html
|
||||
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
|
||||
|
||||
knife4j:
|
||||
enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
|
||||
setting:
|
||||
language: zh_cn
|
||||
|
||||
# MyBatis Plus 的配置项
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
||||
# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
||||
# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
type-aliases-package: ${yudao.info.base-package}.dal.dataobject
|
||||
encryptor:
|
||||
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
|
||||
|
||||
mybatis-plus-join:
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
|
||||
# Spring Data Redis 配置
|
||||
spring:
|
||||
data:
|
||||
redis:
|
||||
repositories:
|
||||
enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度
|
||||
|
||||
# VO 转换(数据翻译)相关
|
||||
easy-trans:
|
||||
is-enable-global: true # 启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
|
||||
is-enable-cloud: false # 禁用 TransType.RPC 微服务模式
|
||||
|
||||
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
yudao:
|
||||
info:
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.yudao.module.datacenter
|
||||
swagger:
|
||||
title: 管理后台
|
||||
description: 提供管理员管理的所有功能
|
||||
version: ${yudao.info.version}
|
||||
base-package: ${yudao.info.base-package}
|
||||
captcha:
|
||||
enable: true # 验证码的开关,默认为 true;
|
||||
tenant: # 多租户相关配置项
|
||||
enable: true
|
||||
ignore-urls:
|
||||
ignore-tables:
|
||||
|
||||
debug: false
|
@ -0,0 +1,23 @@
|
||||
--- #################### 注册中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: crm.fjptzykj.com:8849
|
||||
discovery:
|
||||
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
|
||||
--- #################### 配置中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址
|
||||
namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
@ -0,0 +1,14 @@
|
||||
spring:
|
||||
application:
|
||||
name: datacenter-server
|
||||
|
||||
profiles:
|
||||
active: local
|
||||
|
||||
server:
|
||||
port: 48092
|
||||
|
||||
# 日志文件配置。注意,如果 logging.file.name 不放在 bootstrap.yaml 配置文件,而是放在 application.yaml 中,会导致出现 LOG_FILE_IS_UNDEFINED 文件
|
||||
logging:
|
||||
file:
|
||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.ticket.dal.mysql.asset.AssetMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.ticket.dal.mysql.checkticket.CheckTicketMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.ticket.dal.mysql.saledata.SaleDataMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
24
ludu-module-datacenter/pom.xml
Normal file
24
ludu-module-datacenter/pom.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ludu-module-datacenter</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
<modules>
|
||||
<module>ludu-module-datacenter-biz</module>
|
||||
<module>ludu-module-datacenter-api</module>
|
||||
</modules>
|
||||
<description>
|
||||
大屏服务的数据 模块,我们放数据中心业务,只负责调用数据(读)。
|
||||
例如:售票数据、检票数据等
|
||||
</description>
|
||||
|
||||
</project>
|
54
ludu-module-parking/ludu-module-parking-api/pom.xml
Normal file
54
ludu-module-parking/ludu-module-parking-api/pom.xml
Normal file
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ludu-module-parking</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>2.1.0-jdk8-snapshot</version> <!-- 1. 修改 version 为 ${revision} -->
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>ludu-module-parking-api</artifactId>
|
||||
<packaging>jar</packaging> <!-- 2. 新增 packaging 为 jar -->
|
||||
|
||||
<name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
|
||||
<description> <!-- 4. 新增 description 为该模块的描述 -->
|
||||
demo 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies> <!-- 5. 新增 yudao-common 依赖 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.parking.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.RpcConstants;
|
||||
|
||||
/**
|
||||
* API 相关的枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public class ApiConstants {
|
||||
|
||||
/**
|
||||
* 服务名
|
||||
*
|
||||
* 注意,需要保证和 spring.application.name 保持一致
|
||||
*/
|
||||
public static final String NAME = "parking-server";
|
||||
|
||||
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/parking";
|
||||
|
||||
public static final String VERSION = "1.0.0";
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.parking.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
// ========== 进出记录图片 1_005_001_015 ==========
|
||||
ErrorCode ACCESS_RECORD_PICTURE_NOT_EXISTS = new ErrorCode(1_005_001_015, "进出记录图片不存在");
|
||||
ErrorCode VEHICLE_RENEWAL_RECORD_NOT_EXISTS = new ErrorCode(22222, "固定车续费记录不存在");
|
||||
ErrorCode WARNING_NOT_EXISTS = new ErrorCode(33333, "告警记录不存在");
|
||||
ErrorCode WHITE_NOT_EXISTS = new ErrorCode(444444, "白名单管理不存在");
|
||||
}
|
171
ludu-module-parking/ludu-module-parking-biz/pom.xml
Normal file
171
ludu-module-parking/ludu-module-parking-biz/pom.xml
Normal file
@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ludu-module-parking</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>2.1.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging> <!-- 2. 新增 packaging 为 jar -->
|
||||
|
||||
<artifactId>ludu-module-parking-biz</artifactId>
|
||||
|
||||
<name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
|
||||
<description> <!-- 4. 新增 description 为该模块的描述 -->
|
||||
demo 模块,主要实现 XXX、YYY、ZZZ 等功能。
|
||||
</description>
|
||||
|
||||
<dependencies> <!-- 5. 新增依赖,这里引入的都是比较常用的业务组件、技术组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>ludu-module-parking-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-env</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 依赖服务 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-infra-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.cloud</groupId>-->
|
||||
<!-- <artifactId>yudao-spring-boot-starter-banner</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.cloud</groupId>-->
|
||||
<!-- <artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.cloud</groupId>-->
|
||||
<!-- <artifactId>yudao-spring-boot-starter-biz-dict</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.cloud</groupId>-->
|
||||
<!-- <artifactId>yudao-spring-boot-starter-biz-error-code</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Registry 注册中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Config 配置中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Job 定时任务相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-job</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 消息队列相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 监控相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<!-- 打包 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.parking;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
*/
|
||||
@SpringBootApplication
|
||||
//@MapperScan("cn.iocoder.yudao.module.parking.dal.mysql.channelinformation.ChannelInformationMapper")
|
||||
public class ParkingServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ParkingServerApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.util.BlueCardResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.accessrecordpicture.AccessRecordPictureDO;
|
||||
import cn.iocoder.yudao.module.parking.service.accessrecordpicture.AccessRecordPictureService;
|
||||
|
||||
@Tag(name = "管理后台 - 进出记录图片")
|
||||
@RestController
|
||||
@RequestMapping("/parking/access-record-picture")
|
||||
@Validated
|
||||
public class AccessRecordPictureController {
|
||||
|
||||
@Resource
|
||||
private AccessRecordPictureService accessRecordPictureService;
|
||||
|
||||
@PostMapping("/bcinterface/UpImage")
|
||||
public BlueCardResult insertAccessRecordPicture (@RequestBody AccessRecordPictureDO accessRecordPicture){
|
||||
return accessRecordPictureService.uploadAccessRecordPicture(accessRecordPicture);
|
||||
}
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建进出记录图片")
|
||||
@PreAuthorize("@ss.hasPermission('parking:access-record-picture:create')")
|
||||
public CommonResult<Long> createAccessRecordPicture(@Valid @RequestBody AccessRecordPictureSaveReqVO createReqVO) {
|
||||
return success(accessRecordPictureService.createAccessRecordPicture(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新进出记录图片")
|
||||
@PreAuthorize("@ss.hasPermission('parking:access-record-picture:update')")
|
||||
public CommonResult<Boolean> updateAccessRecordPicture(@Valid @RequestBody AccessRecordPictureSaveReqVO updateReqVO) {
|
||||
accessRecordPictureService.updateAccessRecordPicture(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除进出记录图片")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('parking:access-record-picture:delete')")
|
||||
public CommonResult<Boolean> deleteAccessRecordPicture(@RequestParam("id") Long id) {
|
||||
accessRecordPictureService.deleteAccessRecordPicture(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得进出记录图片")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('parking:access-record-picture:query')")
|
||||
public CommonResult<AccessRecordPictureRespVO> getAccessRecordPicture(@RequestParam("id") Long id) {
|
||||
AccessRecordPictureDO accessRecordPicture = accessRecordPictureService.getAccessRecordPicture(id);
|
||||
return success(BeanUtils.toBean(accessRecordPicture, AccessRecordPictureRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得进出记录图片分页")
|
||||
@PreAuthorize("@ss.hasPermission('parking:access-record-picture:query')")
|
||||
public CommonResult<PageResult<AccessRecordPictureRespVO>> getAccessRecordPicturePage(@Valid AccessRecordPicturePageReqVO pageReqVO) {
|
||||
PageResult<AccessRecordPictureDO> pageResult = accessRecordPictureService.getAccessRecordPicturePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AccessRecordPictureRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出进出记录图片 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('parking:access-record-picture:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAccessRecordPictureExcel(@Valid AccessRecordPicturePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AccessRecordPictureDO> list = accessRecordPictureService.getAccessRecordPicturePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "进出记录图片.xls", "数据", AccessRecordPictureRespVO.class,
|
||||
BeanUtils.toBean(list, AccessRecordPictureRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 进出记录图片分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AccessRecordPicturePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "图片名称", example = "赵六")
|
||||
private String imageName;
|
||||
|
||||
@Schema(description = "图片内容")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "图片来源地址")
|
||||
private String imgAddress;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 进出记录图片 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AccessRecordPictureRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18669")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "图片名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty("图片名称")
|
||||
private String imageName;
|
||||
|
||||
@Schema(description = "图片内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("图片内容")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "图片来源地址")
|
||||
@ExcelProperty("图片来源地址")
|
||||
private String imgAddress;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 进出记录图片新增/修改 Request VO")
|
||||
@Data
|
||||
public class AccessRecordPictureSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18669")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "场库编号不能为空")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "图片名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "图片名称不能为空")
|
||||
private String imageName;
|
||||
|
||||
@Schema(description = "图片内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "图片内容不能为空")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "图片来源地址")
|
||||
private String imgAddress;
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.vehiclerenewalrecord;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.util.BlueCardResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.vehiclerenewalrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.vehiclerenewalrecord.VehicleRenewalRecordDO;
|
||||
import cn.iocoder.yudao.module.parking.service.vehiclerenewalrecord.VehicleRenewalRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 固定车续费记录")
|
||||
@RestController
|
||||
@RequestMapping("/parking/vehicle-renewal-record")
|
||||
@Validated
|
||||
public class VehicleRenewalRecordController {
|
||||
|
||||
@Resource
|
||||
private VehicleRenewalRecordService vehicleRenewalRecordService;
|
||||
|
||||
/**
|
||||
* 固定车续费记录上传
|
||||
* @param vehicleRenewalRecordDO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/UpRenewalRecord")
|
||||
public BlueCardResult UpRenewalRecord(@RequestBody VehicleRenewalRecordDO vehicleRenewalRecordDO) {
|
||||
VehicleRenewalRecordDO vehicleRenewalRecordDOs = new VehicleRenewalRecordDO();
|
||||
VehicleRenewalRecordDO datas = vehicleRenewalRecordDO.getDatas().get(0);
|
||||
vehicleRenewalRecordDOs.setParkNumber(vehicleRenewalRecordDO.getParkNumber());
|
||||
vehicleRenewalRecordDOs.setMethod(vehicleRenewalRecordDO.getMethod());
|
||||
vehicleRenewalRecordDOs.setPlate(datas.getPlate());
|
||||
vehicleRenewalRecordDOs.setCarGroupName(datas.getCarGroupName());
|
||||
vehicleRenewalRecordDOs.setPayTime(datas.getPayTime());
|
||||
vehicleRenewalRecordDOs.setPayCharge(datas.getPayCharge());
|
||||
vehicleRenewalRecordDOs.setNumber(datas.getNumber());
|
||||
vehicleRenewalRecordDOs.setFeeMonth(datas.getFeeMonth());
|
||||
vehicleRenewalRecordDOs.setEnd(datas.getEnd());
|
||||
// vehicleRenewalRecordDOs.setPlaceFeeOrderRecId
|
||||
vehicleRenewalRecordDO.setCarOwnerName(datas.getCarOwnerName());
|
||||
vehicleRenewalRecordDOs.setPayType(datas.getPayType());
|
||||
vehicleRenewalRecordDOs.setOrderNo(datas.getOrderNo());
|
||||
return vehicleRenewalRecordService.UpRenewalRecord(vehicleRenewalRecordDOs);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建固定车续费记录")
|
||||
@PreAuthorize("@ss.hasPermission('parking:vehicle-renewal-record:create')")
|
||||
public CommonResult<String> createVehicleRenewalRecord(@Valid @RequestBody VehicleRenewalRecordSaveReqVO createReqVO) {
|
||||
return success(vehicleRenewalRecordService.createVehicleRenewalRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新固定车续费记录")
|
||||
@PreAuthorize("@ss.hasPermission('parking:vehicle-renewal-record:update')")
|
||||
public CommonResult<Boolean> updateVehicleRenewalRecord(@Valid @RequestBody VehicleRenewalRecordSaveReqVO updateReqVO) {
|
||||
vehicleRenewalRecordService.updateVehicleRenewalRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除固定车续费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('parking:vehicle-renewal-record:delete')")
|
||||
public CommonResult<Boolean> deleteVehicleRenewalRecord(@RequestParam("id") String id) {
|
||||
vehicleRenewalRecordService.deleteVehicleRenewalRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得固定车续费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('parking:vehicle-renewal-record:query')")
|
||||
public CommonResult<VehicleRenewalRecordRespVO> getVehicleRenewalRecord(@RequestParam("id") String id) {
|
||||
VehicleRenewalRecordDO vehicleRenewalRecord = vehicleRenewalRecordService.getVehicleRenewalRecord(id);
|
||||
return success(BeanUtils.toBean(vehicleRenewalRecord, VehicleRenewalRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得固定车续费记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('parking:vehicle-renewal-record:query')")
|
||||
public CommonResult<PageResult<VehicleRenewalRecordRespVO>> getVehicleRenewalRecordPage(@Valid VehicleRenewalRecordPageReqVO pageReqVO) {
|
||||
PageResult<VehicleRenewalRecordDO> pageResult = vehicleRenewalRecordService.getVehicleRenewalRecordPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, VehicleRenewalRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出固定车续费记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('parking:vehicle-renewal-record:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportVehicleRenewalRecordExcel(@Valid VehicleRenewalRecordPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<VehicleRenewalRecordDO> list = vehicleRenewalRecordService.getVehicleRenewalRecordPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "固定车续费记录.xls", "数据", VehicleRenewalRecordRespVO.class,
|
||||
BeanUtils.toBean(list, VehicleRenewalRecordRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.vehiclerenewalrecord.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 固定车续费记录分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class VehicleRenewalRecordPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "接口名称")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "车牌")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "固定车组名称", example = "张三")
|
||||
private String carGroupName;
|
||||
|
||||
@Schema(description = "支付时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] payTime;
|
||||
|
||||
@Schema(description = "续费金额")
|
||||
private String payCharge;
|
||||
|
||||
@Schema(description = "车位号")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "续费时长")
|
||||
private String feeMonth;
|
||||
|
||||
@Schema(description = "过期日期")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "车主名称", example = "李四")
|
||||
private String carOwnerName;
|
||||
|
||||
@Schema(description = "支付类型", example = "1")
|
||||
private String payType;
|
||||
|
||||
@Schema(description = "支付流水号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.vehiclerenewalrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 固定车续费记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class VehicleRenewalRecordRespVO {
|
||||
|
||||
@Schema(description = "续费订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24242")
|
||||
@ExcelProperty("续费订单号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "接口名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("接口名称")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "车牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("车牌")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "固定车组名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("固定车组名称")
|
||||
private String carGroupName;
|
||||
|
||||
@Schema(description = "支付时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("支付时间")
|
||||
private String payTime;
|
||||
|
||||
@Schema(description = "续费金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("续费金额")
|
||||
private String payCharge;
|
||||
|
||||
@Schema(description = "车位号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("车位号")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "续费时长", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("续费时长")
|
||||
private String feeMonth;
|
||||
|
||||
@Schema(description = "过期日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("过期日期")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "车主名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("车主名称")
|
||||
private String carOwnerName;
|
||||
|
||||
@Schema(description = "支付类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "支付类型", converter = DictConvert.class)
|
||||
@DictFormat("pay_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String payType;
|
||||
|
||||
@Schema(description = "支付流水号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("支付流水号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.vehiclerenewalrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 固定车续费记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleRenewalRecordSaveReqVO {
|
||||
|
||||
@Schema(description = "续费订单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24242")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "场库编号不能为空")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "接口名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "接口名称不能为空")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "车牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "车牌不能为空")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "固定车组名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "固定车组名称不能为空")
|
||||
private String carGroupName;
|
||||
|
||||
@Schema(description = "支付时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "支付时间不能为空")
|
||||
private String payTime;
|
||||
|
||||
@Schema(description = "续费金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "续费金额不能为空")
|
||||
private String payCharge;
|
||||
|
||||
@Schema(description = "车位号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "车位号不能为空")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "续费时长", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "续费时长不能为空")
|
||||
private String feeMonth;
|
||||
|
||||
@Schema(description = "过期日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "过期日期不能为空")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "车主名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "车主名称不能为空")
|
||||
private String carOwnerName;
|
||||
|
||||
@Schema(description = "支付类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "支付类型不能为空")
|
||||
private String payType;
|
||||
|
||||
@Schema(description = "支付流水号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "支付流水号不能为空")
|
||||
private String orderNo;
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.warning;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.util.BlueCardResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.warning.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.warning.WarningDO;
|
||||
import cn.iocoder.yudao.module.parking.service.warning.WarningService;
|
||||
|
||||
@Tag(name = "管理后台 - 告警记录")
|
||||
@RestController
|
||||
@RequestMapping("/parking/warning")
|
||||
@Validated
|
||||
public class WarningController {
|
||||
|
||||
@Resource
|
||||
private WarningService warningService;
|
||||
|
||||
/**
|
||||
* 设备告警信息上传
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/upWarning")
|
||||
public BlueCardResult upWarning(@RequestBody WarningDO warningDO) {
|
||||
WarningDO warningDOs = new WarningDO();
|
||||
warningDOs.setParkNumber(warningDO.getParkNumber());
|
||||
// warningDOs.setmethod
|
||||
WarningDO datas = warningDO.getDatas().get(0);
|
||||
warningDOs.setAreaCode(datas.getAreaCode());
|
||||
warningDOs.setPortCode(datas.getPortCode());
|
||||
warningDOs.setObjectId(datas.getObjectId());
|
||||
warningDOs.setObjectName(datas.getObjectName());
|
||||
warningDOs.setObjectCode(datas.getObjectCode());
|
||||
warningDOs.setObjectType(datas.getObjectType());
|
||||
warningDOs.setWarningTime(datas.getWarningTime());
|
||||
warningDOs.setReportTime(datas.getReportTime());
|
||||
warningDOs.setWarningType(datas.getWarningType());
|
||||
warningDOs.setWarningDetail(datas.getWarningDetail());
|
||||
return warningService.upWarning(warningDOs);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建告警记录")
|
||||
@PreAuthorize("@ss.hasPermission('parking:warning:create')")
|
||||
public CommonResult<String> createWarning(@Valid @RequestBody WarningSaveReqVO createReqVO) {
|
||||
return success(warningService.createWarning(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新告警记录")
|
||||
@PreAuthorize("@ss.hasPermission('parking:warning:update')")
|
||||
public CommonResult<Boolean> updateWarning(@Valid @RequestBody WarningSaveReqVO updateReqVO) {
|
||||
warningService.updateWarning(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除告警记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('parking:warning:delete')")
|
||||
public CommonResult<Boolean> deleteWarning(@RequestParam("id") String id) {
|
||||
warningService.deleteWarning(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得告警记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('parking:warning:query')")
|
||||
public CommonResult<WarningRespVO> getWarning(@RequestParam("id") String id) {
|
||||
WarningDO warning = warningService.getWarning(id);
|
||||
return success(BeanUtils.toBean(warning, WarningRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得告警记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('parking:warning:query')")
|
||||
public CommonResult<PageResult<WarningRespVO>> getWarningPage(@Valid WarningPageReqVO pageReqVO) {
|
||||
PageResult<WarningDO> pageResult = warningService.getWarningPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WarningRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出告警记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('parking:warning:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportWarningExcel(@Valid WarningPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WarningDO> list = warningService.getWarningPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "告警记录.xls", "数据", WarningRespVO.class,
|
||||
BeanUtils.toBean(list, WarningRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.warning.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 告警记录分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WarningPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "停车区域 ")
|
||||
private String areaCode;
|
||||
|
||||
@Schema(description = "车位编码")
|
||||
private String portCode;
|
||||
|
||||
@Schema(description = "告警对象 Id", example = "31270")
|
||||
private String objectId;
|
||||
|
||||
@Schema(description = "告警对象编码")
|
||||
private String objectCode;
|
||||
|
||||
@Schema(description = "告警对象名称", example = "芋艿")
|
||||
private String objectName;
|
||||
|
||||
@Schema(description = "告警对象类型", example = "1")
|
||||
private String objectType;
|
||||
|
||||
@Schema(description = "告警时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] warningTime;
|
||||
|
||||
@Schema(description = "上报时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] reportTime;
|
||||
|
||||
@Schema(description = "告警类型", example = "1")
|
||||
private String warningType;
|
||||
|
||||
@Schema(description = "告警详情")
|
||||
private String warningDetail;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.warning.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 告警记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WarningRespVO {
|
||||
|
||||
@Schema(description = "表自增 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21274")
|
||||
@ExcelProperty("表自增 id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "停车区域 ")
|
||||
@ExcelProperty("停车区域 ")
|
||||
private String areaCode;
|
||||
|
||||
@Schema(description = "车位编码")
|
||||
@ExcelProperty("车位编码")
|
||||
private String portCode;
|
||||
|
||||
@Schema(description = "告警对象 Id", example = "31270")
|
||||
@ExcelProperty("告警对象 Id")
|
||||
private String objectId;
|
||||
|
||||
@Schema(description = "告警对象编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("告警对象编码")
|
||||
private String objectCode;
|
||||
|
||||
@Schema(description = "告警对象名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("告警对象名称")
|
||||
private String objectName;
|
||||
|
||||
@Schema(description = "告警对象类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "告警对象类型", converter = DictConvert.class)
|
||||
@DictFormat("object_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String objectType;
|
||||
|
||||
@Schema(description = "告警时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("告警时间")
|
||||
private String warningTime;
|
||||
|
||||
@Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("上报时间")
|
||||
private String reportTime;
|
||||
|
||||
@Schema(description = "告警类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "告警类型", converter = DictConvert.class)
|
||||
@DictFormat("warning_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String warningType;
|
||||
|
||||
@Schema(description = "告警详情")
|
||||
@ExcelProperty("告警详情")
|
||||
private String warningDetail;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.warning.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 告警记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class WarningSaveReqVO {
|
||||
|
||||
@Schema(description = "表自增 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21274")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "场库编号不能为空")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "停车区域 ")
|
||||
private String areaCode;
|
||||
|
||||
@Schema(description = "车位编码")
|
||||
private String portCode;
|
||||
|
||||
@Schema(description = "告警对象 Id", example = "31270")
|
||||
private String objectId;
|
||||
|
||||
@Schema(description = "告警对象编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "告警对象编码不能为空")
|
||||
private String objectCode;
|
||||
|
||||
@Schema(description = "告警对象名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "告警对象名称不能为空")
|
||||
private String objectName;
|
||||
|
||||
@Schema(description = "告警对象类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "告警对象类型不能为空")
|
||||
private String objectType;
|
||||
|
||||
@Schema(description = "告警时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "告警时间不能为空")
|
||||
private String warningTime;
|
||||
|
||||
@Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "上报时间不能为空")
|
||||
private String reportTime;
|
||||
|
||||
@Schema(description = "告警类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "告警类型不能为空")
|
||||
private String warningType;
|
||||
|
||||
@Schema(description = "告警详情")
|
||||
private String warningDetail;
|
||||
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.white;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.util.BlueCardResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.white.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.white.WhiteDO;
|
||||
import cn.iocoder.yudao.module.parking.service.white.WhiteService;
|
||||
|
||||
@Tag(name = "管理后台 - 白名单管理")
|
||||
@RestController
|
||||
@RequestMapping("/parking/white")
|
||||
@Validated
|
||||
public class WhiteController {
|
||||
|
||||
@Resource
|
||||
private WhiteService whiteService;
|
||||
|
||||
|
||||
/**
|
||||
* 同步白名单信息
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/upWhite")
|
||||
public BlueCardResult upWhite(@RequestBody WhiteUtilDO whiteUtilDO) {
|
||||
|
||||
return whiteService.upWhite(whiteUtilDO);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建白名单管理")
|
||||
@PreAuthorize("@ss.hasPermission('parking:white:create')")
|
||||
public CommonResult<Integer> createWhite(@Valid @RequestBody WhiteSaveReqVO createReqVO) {
|
||||
return success(whiteService.createWhite(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新白名单管理")
|
||||
@PreAuthorize("@ss.hasPermission('parking:white:update')")
|
||||
public CommonResult<Boolean> updateWhite(@Valid @RequestBody WhiteSaveReqVO updateReqVO) {
|
||||
whiteService.updateWhite(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除白名单管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('parking:white:delete')")
|
||||
public CommonResult<Boolean> deleteWhite(@RequestParam("id") Integer id) {
|
||||
whiteService.deleteWhite(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得白名单管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('parking:white:query')")
|
||||
public CommonResult<WhiteRespVO> getWhite(@RequestParam("id") Integer id) {
|
||||
WhiteDO white = whiteService.getWhite(id);
|
||||
return success(BeanUtils.toBean(white, WhiteRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得白名单管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('parking:white:query')")
|
||||
public CommonResult<PageResult<WhiteRespVO>> getWhitePage(@Valid WhitePageReqVO pageReqVO) {
|
||||
PageResult<WhiteDO> pageResult = whiteService.getWhitePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WhiteRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出白名单管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('parking:white:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportWhiteExcel(@Valid WhitePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WhiteDO> list = whiteService.getWhitePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "白名单管理.xls", "数据", WhiteRespVO.class,
|
||||
BeanUtils.toBean(list, WhiteRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.white.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.areasandvalidity.AreasAndValidityDO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class WhiteDatasDO {
|
||||
private String plate;
|
||||
private Integer fixedId;
|
||||
private String chargeType;
|
||||
private String name;
|
||||
private String certificate;
|
||||
private String address;
|
||||
private String phone;
|
||||
private String plateColor;
|
||||
private String start;
|
||||
private String end;
|
||||
private String dept;
|
||||
private String carType;
|
||||
private String memo;
|
||||
private String timeStamp;
|
||||
private String source;
|
||||
private List<AreasAndValidityDO> areasAndValidity;
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.white.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 白名单管理分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WhitePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "车牌号")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "收费类型", example = "2")
|
||||
private String chargeType;
|
||||
|
||||
@Schema(description = "身份证信息")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "生效日期")
|
||||
private String start;
|
||||
|
||||
@Schema(description = "失效日期")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "部门")
|
||||
private String dept;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String memo;
|
||||
|
||||
@Schema(description = "来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.white.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 白名单管理 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WhiteRespVO {
|
||||
|
||||
@Schema(description = "白名单记录流水号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19660")
|
||||
@ExcelProperty("白名单记录流水号")
|
||||
private Integer fixedId;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "车牌号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("车牌号")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "收费类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty(value = "收费类型", converter = DictConvert.class)
|
||||
@DictFormat("charge_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String chargeType;
|
||||
|
||||
@Schema(description = "身份证信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("身份证信息")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "生效日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生效日期")
|
||||
private String start;
|
||||
|
||||
@Schema(description = "失效日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("失效日期")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("部门")
|
||||
private String dept;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String memo;
|
||||
|
||||
@Schema(description = "来源", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.white.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 白名单管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class WhiteSaveReqVO {
|
||||
|
||||
@Schema(description = "白名单记录流水号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19660")
|
||||
private Integer fixedId;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "场库编号不能为空")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "车牌号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "车牌号不能为空")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "收费类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "收费类型不能为空")
|
||||
private String chargeType;
|
||||
|
||||
@Schema(description = "身份证信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "身份证信息不能为空")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "生效日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生效日期不能为空")
|
||||
private String start;
|
||||
|
||||
@Schema(description = "失效日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "失效日期不能为空")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "部门不能为空")
|
||||
private String dept;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
@NotEmpty(message = "备注不能为空")
|
||||
private String memo;
|
||||
|
||||
@Schema(description = "来源", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "来源不能为空")
|
||||
private String source;
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.white.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class WhiteUtilDO {
|
||||
private String parkNumber;
|
||||
private String method;
|
||||
private List<WhiteDatasDO> datas;
|
||||
private Integer size;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.accessrecordpicture;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 进出记录图片 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("access_record_picture")
|
||||
@KeySequence("access_record_picture_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AccessRecordPictureDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 场库编号
|
||||
*/
|
||||
private String parkNumber;
|
||||
/**
|
||||
* 图片名称
|
||||
*/
|
||||
private String imageName;
|
||||
/**
|
||||
* 图片内容
|
||||
*/
|
||||
private String image;
|
||||
/**
|
||||
* 图片来源地址
|
||||
*/
|
||||
private String imgAddress;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.areasandvalidity;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 区域时间信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("areas_and_validity")
|
||||
@KeySequence("areas_and_validity_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AreasAndValidityDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 区域Id
|
||||
*/
|
||||
private Integer areaId;
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
private String start;
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
private String end;
|
||||
/**
|
||||
* 白名单记录流水号
|
||||
*/
|
||||
private Integer fixedId;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.carinfo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 车辆信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("car_info")
|
||||
@KeySequence("car_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CarInfoDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String plate;
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
private String plateColor;
|
||||
/**
|
||||
* 无牌车票号
|
||||
*/
|
||||
private String ticketCode;
|
||||
/**
|
||||
* 车类型
|
||||
*/
|
||||
private String carType;
|
||||
/**
|
||||
* 车牌识别可信度
|
||||
*/
|
||||
private Integer confidence;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.userinfo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 车主信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("user_info")
|
||||
@KeySequence("user_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserInfoDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 证件号码
|
||||
*/
|
||||
// @TableId(type = IdType.INPUT)
|
||||
private String idCard;
|
||||
/**
|
||||
* 车主姓名
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.vehiclerenewalrecord;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 固定车续费记录 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("fixed_vehicle_renewal_record")
|
||||
@KeySequence("fixed_vehicle_renewal_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleRenewalRecordDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 续费订单号
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String id;
|
||||
/**
|
||||
* 场库编号
|
||||
*/
|
||||
private String parkNumber;
|
||||
/**
|
||||
* 接口名称
|
||||
*/
|
||||
private String method;
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String plate;
|
||||
/**
|
||||
* 固定车组名称
|
||||
*/
|
||||
private String carGroupName;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private String payTime;
|
||||
/**
|
||||
* 续费金额
|
||||
*/
|
||||
private String payCharge;
|
||||
/**
|
||||
* 车位号
|
||||
*/
|
||||
private Integer number;
|
||||
/**
|
||||
* 续费时长
|
||||
*/
|
||||
private String feeMonth;
|
||||
/**
|
||||
* 过期日期
|
||||
*/
|
||||
private String end;
|
||||
/**
|
||||
* 车主名称
|
||||
*/
|
||||
private String carOwnerName;
|
||||
/**
|
||||
* 支付类型
|
||||
*
|
||||
* 枚举 {@link TODO pay_type 对应的类}
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 支付流水号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
|
||||
private List<VehicleRenewalRecordDO> datas;
|
||||
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.warning;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 告警记录 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("device_warning")
|
||||
@KeySequence("device_warning_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WarningDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 表自增 id
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String id;
|
||||
/**
|
||||
* 场库编号
|
||||
*/
|
||||
private String parkNumber;
|
||||
/**
|
||||
* 停车区域
|
||||
*/
|
||||
private String areaCode;
|
||||
/**
|
||||
* 车位编码
|
||||
*/
|
||||
private String portCode;
|
||||
/**
|
||||
* 告警对象 Id
|
||||
*/
|
||||
private String objectId;
|
||||
/**
|
||||
* 告警对象编码
|
||||
*/
|
||||
private String objectCode;
|
||||
/**
|
||||
* 告警对象名称
|
||||
*/
|
||||
private String objectName;
|
||||
/**
|
||||
* 告警对象类型
|
||||
*
|
||||
* 枚举 {@link TODO object_type 对应的类}
|
||||
*/
|
||||
private String objectType;
|
||||
/**
|
||||
* 告警时间
|
||||
*/
|
||||
private String warningTime;
|
||||
/**
|
||||
* 上报时间
|
||||
*/
|
||||
private String reportTime;
|
||||
/**
|
||||
* 告警类型
|
||||
*
|
||||
* 枚举 {@link TODO warning_type 对应的类}
|
||||
*/
|
||||
private String warningType;
|
||||
/**
|
||||
* 告警详情
|
||||
*/
|
||||
private String warningDetail;
|
||||
|
||||
private List<WarningDO> datas;
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.white;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 白名单管理 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("white")
|
||||
@KeySequence("white_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WhiteDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 白名单记录流水号
|
||||
*/
|
||||
@TableId
|
||||
private Integer fixedId;
|
||||
/**
|
||||
* 场库编号
|
||||
*/
|
||||
private String parkNumber;
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String plate;
|
||||
/**
|
||||
* 收费类型
|
||||
*
|
||||
* 枚举 {@link TODO charge_type 对应的类}
|
||||
*/
|
||||
private String chargeType;
|
||||
/**
|
||||
* 身份证信息
|
||||
*/
|
||||
private String certificate;
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
private String start;
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
private String end;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String dept;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 来源
|
||||
*/
|
||||
private String source;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.accessrecordpicture;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.accessrecordpicture.AccessRecordPictureDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture.vo.*;
|
||||
|
||||
/**
|
||||
* 进出记录图片 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface AccessRecordPictureMapper extends BaseMapperX<AccessRecordPictureDO> {
|
||||
|
||||
default PageResult<AccessRecordPictureDO> selectPage(AccessRecordPicturePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AccessRecordPictureDO>()
|
||||
.eqIfPresent(AccessRecordPictureDO::getParkNumber, reqVO.getParkNumber())
|
||||
.likeIfPresent(AccessRecordPictureDO::getImageName, reqVO.getImageName())
|
||||
.eqIfPresent(AccessRecordPictureDO::getImage, reqVO.getImage())
|
||||
.eqIfPresent(AccessRecordPictureDO::getImgAddress, reqVO.getImgAddress())
|
||||
.betweenIfPresent(AccessRecordPictureDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(AccessRecordPictureDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.areasandvalidity;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.areasandvalidity.AreasAndValidityDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 区域时间信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface AreasAndValidityMapper extends BaseMapperX<AreasAndValidityDO> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.carinfo;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.carinfo.CarInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface CarInfoMapper extends BaseMapperX<CarInfoDO> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.userinfo;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.userinfo.UserInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 车主信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserInfoMapper extends BaseMapperX<UserInfoDO> {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.vehiclerenewalrecord;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.vehiclerenewalrecord.VehicleRenewalRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.vehiclerenewalrecord.vo.*;
|
||||
|
||||
/**
|
||||
* 固定车续费记录 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface VehicleRenewalRecordMapper extends BaseMapperX<VehicleRenewalRecordDO> {
|
||||
|
||||
default PageResult<VehicleRenewalRecordDO> selectPage(VehicleRenewalRecordPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<VehicleRenewalRecordDO>()
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getParkNumber, reqVO.getParkNumber())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getMethod, reqVO.getMethod())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getPlate, reqVO.getPlate())
|
||||
.likeIfPresent(VehicleRenewalRecordDO::getCarGroupName, reqVO.getCarGroupName())
|
||||
.betweenIfPresent(VehicleRenewalRecordDO::getPayTime, reqVO.getPayTime())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getPayCharge, reqVO.getPayCharge())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getNumber, reqVO.getNumber())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getFeeMonth, reqVO.getFeeMonth())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getEnd, reqVO.getEnd())
|
||||
.likeIfPresent(VehicleRenewalRecordDO::getCarOwnerName, reqVO.getCarOwnerName())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getPayType, reqVO.getPayType())
|
||||
.eqIfPresent(VehicleRenewalRecordDO::getOrderNo, reqVO.getOrderNo())
|
||||
.betweenIfPresent(VehicleRenewalRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(VehicleRenewalRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.warning;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.warning.WarningDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.warning.vo.*;
|
||||
|
||||
/**
|
||||
* 告警记录 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarningMapper extends BaseMapperX<WarningDO> {
|
||||
|
||||
default PageResult<WarningDO> selectPage(WarningPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WarningDO>()
|
||||
.eqIfPresent(WarningDO::getParkNumber, reqVO.getParkNumber())
|
||||
.eqIfPresent(WarningDO::getAreaCode, reqVO.getAreaCode())
|
||||
.eqIfPresent(WarningDO::getPortCode, reqVO.getPortCode())
|
||||
.eqIfPresent(WarningDO::getObjectId, reqVO.getObjectId())
|
||||
.eqIfPresent(WarningDO::getObjectCode, reqVO.getObjectCode())
|
||||
.likeIfPresent(WarningDO::getObjectName, reqVO.getObjectName())
|
||||
.eqIfPresent(WarningDO::getObjectType, reqVO.getObjectType())
|
||||
.betweenIfPresent(WarningDO::getWarningTime, reqVO.getWarningTime())
|
||||
.betweenIfPresent(WarningDO::getReportTime, reqVO.getReportTime())
|
||||
.eqIfPresent(WarningDO::getWarningType, reqVO.getWarningType())
|
||||
.eqIfPresent(WarningDO::getWarningDetail, reqVO.getWarningDetail())
|
||||
.betweenIfPresent(WarningDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WarningDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.white;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.white.WhiteDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.white.vo.*;
|
||||
|
||||
/**
|
||||
* 白名单管理 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface WhiteMapper extends BaseMapperX<WhiteDO> {
|
||||
|
||||
default PageResult<WhiteDO> selectPage(WhitePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WhiteDO>()
|
||||
.eqIfPresent(WhiteDO::getParkNumber, reqVO.getParkNumber())
|
||||
.eqIfPresent(WhiteDO::getPlate, reqVO.getPlate())
|
||||
.eqIfPresent(WhiteDO::getChargeType, reqVO.getChargeType())
|
||||
.eqIfPresent(WhiteDO::getCertificate, reqVO.getCertificate())
|
||||
.eqIfPresent(WhiteDO::getStart, reqVO.getStart())
|
||||
.eqIfPresent(WhiteDO::getEnd, reqVO.getEnd())
|
||||
.eqIfPresent(WhiteDO::getDept, reqVO.getDept())
|
||||
.eqIfPresent(WhiteDO::getMemo, reqVO.getMemo())
|
||||
.eqIfPresent(WhiteDO::getSource, reqVO.getSource())
|
||||
.betweenIfPresent(WhiteDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WhiteDO::getFixedId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.parking.framework.security.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import cn.iocoder.yudao.module.parking.enums.ApiConstants;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
||||
|
||||
/**
|
||||
* Demo 模块的 Security 配置
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
|
||||
.antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
|
||||
// Druid 监控
|
||||
registry.antMatchers("/druid/**").anonymous();
|
||||
// Spring Boot Actuator 的安全配置
|
||||
registry.antMatchers("/actuator").anonymous()
|
||||
.antMatchers("/actuator/**").anonymous();
|
||||
// RPC 服务的安全配置
|
||||
registry.antMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.parking.service.accessrecordpicture;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.accessrecordpicture.AccessRecordPictureDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.parking.util.BlueCardResult;
|
||||
|
||||
/**
|
||||
* 进出记录图片 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface AccessRecordPictureService {
|
||||
|
||||
/**
|
||||
* 创建进出记录图片
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createAccessRecordPicture(@Valid AccessRecordPictureSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新进出记录图片
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateAccessRecordPicture(@Valid AccessRecordPictureSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除进出记录图片
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteAccessRecordPicture(Long id);
|
||||
|
||||
/**
|
||||
* 获得进出记录图片
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 进出记录图片
|
||||
*/
|
||||
AccessRecordPictureDO getAccessRecordPicture(Long id);
|
||||
|
||||
/**
|
||||
* 获得进出记录图片分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 进出记录图片分页
|
||||
*/
|
||||
PageResult<AccessRecordPictureDO> getAccessRecordPicturePage(AccessRecordPicturePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 上传进出记录图片
|
||||
* @param accessRecordPicture
|
||||
* @return cn.iocoder.yudao.module.parking.util.BlueCardResult
|
||||
*/
|
||||
BlueCardResult uploadAccessRecordPicture(AccessRecordPictureDO accessRecordPicture);
|
||||
|
||||
/**
|
||||
* 通过图片名称查找上传记录
|
||||
* @param inImage
|
||||
* @return cn.iocoder.yudao.module.parking.dal.dataobject.accessrecordpicture.AccessRecordPictureDO
|
||||
*/
|
||||
AccessRecordPictureDO findByImageName(String inImage);
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.parking.service.accessrecordpicture;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.util.Base64Util;
|
||||
import cn.iocoder.yudao.module.parking.util.BlueCardResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.accessrecordpicture.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.accessrecordpicture.AccessRecordPictureDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.dal.mysql.accessrecordpicture.AccessRecordPictureMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 进出记录图片 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class AccessRecordPictureServiceImpl implements AccessRecordPictureService {
|
||||
|
||||
@Resource
|
||||
private AccessRecordPictureMapper accessRecordPictureMapper;
|
||||
@Resource
|
||||
private Base64Util base64Util;
|
||||
@Value("${lundu.imgPath}")
|
||||
private String imgPath;
|
||||
@Override
|
||||
public Long createAccessRecordPicture(AccessRecordPictureSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
AccessRecordPictureDO accessRecordPicture = BeanUtils.toBean(createReqVO, AccessRecordPictureDO.class);
|
||||
accessRecordPictureMapper.insert(accessRecordPicture);
|
||||
// 返回
|
||||
return accessRecordPicture.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAccessRecordPicture(AccessRecordPictureSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateAccessRecordPictureExists(updateReqVO.getId());
|
||||
// 更新
|
||||
AccessRecordPictureDO updateObj = BeanUtils.toBean(updateReqVO, AccessRecordPictureDO.class);
|
||||
accessRecordPictureMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAccessRecordPicture(Long id) {
|
||||
// 校验存在
|
||||
validateAccessRecordPictureExists(id);
|
||||
// 删除
|
||||
accessRecordPictureMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateAccessRecordPictureExists(Long id) {
|
||||
if (accessRecordPictureMapper.selectById(id) == null) {
|
||||
throw exception(ACCESS_RECORD_PICTURE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessRecordPictureDO getAccessRecordPicture(Long id) {
|
||||
return accessRecordPictureMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<AccessRecordPictureDO> getAccessRecordPicturePage(AccessRecordPicturePageReqVO pageReqVO) {
|
||||
return accessRecordPictureMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlueCardResult uploadAccessRecordPicture(AccessRecordPictureDO accessRecordPicture) {
|
||||
base64Util.GenerateImage(accessRecordPicture.getImage(), accessRecordPicture.getImageName());//图片解密
|
||||
accessRecordPicture.setImgAddress(imgPath+accessRecordPicture.getImageName());
|
||||
accessRecordPictureMapper.insert(accessRecordPicture);
|
||||
return BlueCardResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessRecordPictureDO findByImageName(String inImage) {
|
||||
return accessRecordPictureMapper.selectOne(AccessRecordPictureDO::getImageName, inImage);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.parking.service.areasandvalidity;
|
||||
|
||||
|
||||
/**
|
||||
* 区域时间信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface AreasAndValidityService {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.parking.service.areasandvalidity;
|
||||
|
||||
import cn.iocoder.yudao.module.parking.dal.mysql.areasandvalidity.AreasAndValidityMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 区域时间信息 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class AreasAndValidityServiceImpl implements AreasAndValidityService {
|
||||
|
||||
@Resource
|
||||
private AreasAndValidityMapper andValidityMapper;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.parking.service.carinfo;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface CarInfoService {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.parking.service.carinfo;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.module.parking.dal.mysql.carinfo.CarInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆信息 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CarInfoServiceImpl implements CarInfoService {
|
||||
|
||||
@Resource
|
||||
private CarInfoMapper carInfoMapper;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.parking.service.userinfo;
|
||||
|
||||
|
||||
/**
|
||||
* 车主信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface UserInfoService {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.parking.service.userinfo;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.module.parking.dal.mysql.userinfo.UserInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 车主信息 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class UserInfoServiceImpl implements UserInfoService {
|
||||
|
||||
@Resource
|
||||
private UserInfoMapper userInfoMapper;
|
||||
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user