Compare commits

..

65 Commits

Author SHA1 Message Date
andy
d26e02f364 数据清洗, 调整导出 2026-02-24 15:56:05 +08:00
andy
832a1d3972 1 2026-02-14 12:02:41 +08:00
andy
4ec6865d5e 1 2026-02-14 11:19:21 +08:00
andy
16952f2a9f 调整列表名称展示 订单新增运营商搜索条件 2026-02-14 11:16:01 +08:00
andy
b52496609a 1 2026-02-11 16:49:53 +08:00
andy
1f9037cf85 新增订单导出 2026-02-11 15:22:23 +08:00
andy
130a85e2c9 相关代码接口调整 2026-01-26 14:22:35 +08:00
andy
9b6485db8d 云平台接口调整 2025-12-12 11:24:37 +08:00
andy
90d74beb03 站控版本 相关业务上线 2025-10-29 10:55:51 +08:00
andy
c4271768e1 调整mq消息, 处理支付问题 2025-09-06 16:16:59 +08:00
andy
f51c0df5f7 优化 2025-08-30 14:10:54 +08:00
andy
285c46024b 优化 调整, 站控部分相关代码 2025-08-28 15:41:39 +08:00
andy
eb64434b2c websocket de 相关业务调整 2025-07-26 09:58:12 +08:00
andy
3a040fe510 调整微信websocket的数据推送接口调整
取消没用的mqtt
2025-07-25 15:35:42 +08:00
andy
c87d090a71 1 2025-07-24 15:43:20 +08:00
andy
d08bb52783 新增订单详情接口
处理订单金额  <0 默认为0
2025-07-24 14:49:34 +08:00
andy
089ead49be Merge branch 'order_reconstruction' 2025-07-23 09:25:27 +08:00
andy
dfaa807ff2 订单改版 2025-07-23 09:24:48 +08:00
andy
be3c8e9e4c 小程序接口相关调整 2025-07-03 10:28:09 +08:00
tzy
ac525609f6 refactor(order): 合并 OrderService 和 OrderSwapBatteryService 接口
- 将 OrderSwapBatteryService 接口中的方法合并到 OrderService 接口
- 更新 OrderServiceImpl 实现类,添加新合并的方法实现
- 修改相关的控制器和 Feign 客户端接口,以适应新的 OrderService 接口
- 删除了未使用的 OrderSwapBatteryService 接口文件
2025-06-20 16:38:57 +08:00
andy
805be30f64 订单改版 2025-06-20 10:23:41 +08:00
andy
bd46317d2b 调整配置 2025-05-30 16:12:50 +08:00
andy
f44d78c94c 订单改版中--未完成代码 2025-05-26 16:45:35 +08:00
andy
dfeb83d111 1 2025-05-15 17:29:48 +08:00
andy
f4f5766eeb 调整首页, 优化接口 2025-05-15 17:29:07 +08:00
andy
c7da74d85b 调整代码 2025-05-10 13:40:38 +08:00
andy
4f79eb01bb 调整费用策略获取接口 2025-05-09 13:29:26 +08:00
andy
5bec1c3043 1 2025-05-07 14:36:50 +08:00
andy
8d45177d10 mqtt 处理站点运营消息通知 2025-05-07 14:34:55 +08:00
lhb
d7c5bae22f fix:添加用户绑定微信用户 2025-05-05 15:32:18 +08:00
andy
36d2208c60 调整慧鹏反推规则 2025-05-05 11:30:29 +08:00
andy
0988b0f45e 大华token失效问题 2025-05-05 08:43:15 +08:00
andy
ad9fdb60e4 根据慧鹏站的 车牌号和站点code生成车辆信息和预约单信息 2025-05-04 10:23:00 +08:00
lhb
ee953896c9 fix:小程序退款及公众号推送消息+配置回调地址2 2025-04-30 16:36:48 +08:00
lhb
25d0c60809 fix:小程序退款及公众号推送消息+配置回调地址 2025-04-30 16:36:25 +08:00
lhb
f10bbd184e fix:小程序退款及公众号推送消息 2025-04-30 16:33:22 +08:00
andy
42323ded0d 集成mongodb, 记录电池信息 2025-04-30 09:48:01 +08:00
andy
9800c2695f 1 2025-04-26 08:33:50 +08:00
andy
1616a61843 1 2025-04-25 10:18:41 +08:00
andy
d7043d53f8 分账字段调整 2025-04-25 10:14:59 +08:00
andy
534ac97440 调整首页数据动态显示 2025-04-25 09:10:01 +08:00
andy
df6ea01c3e 调整接口 2025-04-23 15:31:52 +08:00
andy
a3f357ba55 分账信息生成 2025-04-23 11:07:18 +08:00
lhb
93e47c4233 fix:公司审核流程及解绑 2025-04-22 16:11:31 +08:00
lhb
8c11459e9c fix:微信用户绑定公司审核流程 2025-04-21 17:29:16 +08:00
andy
77d09ea71c 1 2025-04-21 16:16:44 +08:00
andy
a806fceaf7 大华摄像头相关代码提交 2025-04-21 16:14:51 +08:00
tzy
30fc855216 refactor(base-commons): 重构基础模块并添加新功能
- 修改 PageListWalletRequest 中 uname 字段名为 accName
- 在 WalletAccountController 中添加更新账户姓名的接口
- 更新 WalletAccountServiceImpl 中的 list 方法,使用新的 accName 字段
2025-04-19 15:37:50 +08:00
lhb
b682441d39 fix:微信修改名称 2025-04-19 15:22:34 +08:00
tzy
4dd8c53649 Merge branch 'master' of https://git.evo-techina.com/hbyt/cloud-battery-manage 2025-04-19 13:59:38 +08:00
tzy
aa096bb997 feat(cloud): 添加修改资金账户名称功能并优化相关服务
- 在 BatteryStation 实体类中添加 EqualsAndHashCode 注解
- 在 CloudService 接口中添加 updateName 方法
- 修改 GZHMessageTemplateService 中的模板 ID 引用- 在 PageListWalletRequest 中添加 uname 字段
- 在 WalletAccountController 中添加 updateName 接口
- 在 WalletAccountService 接口中添加 updateName 方法
- 实现 WalletAccountServiceImpl 中的 updateName 方法
- 在 WechatUserService 实现类中调用 updateName 方法更新微信用户信息
2025-04-19 13:57:24 +08:00
lhb
2eeeab2fca fix:充值明细关联订单信息 2025-04-19 13:37:52 +08:00
andy
54141790ce 角色表新增业务code字段, 用于区分数据来源
账号管理列表返回接口新增数据来源信息
角色管理列表返回接口洗澡能数据来源信息
2025-04-19 10:25:42 +08:00
andy
9b5b0bdb41 处理微信小程序查不到预约单问题 2025-04-19 08:51:08 +08:00
andy
3ad1d4f7e9 处理bug 2025-04-18 18:58:22 +08:00
tzy
1a68ba3e9e refactor(order): 优化订单相关逻辑和性能
- 重构了订单预览添加逻辑,增加了对车辆信息的查询和验证
- 改进了预约单过期处理任务,提高了查询效率和代码可读性
2025-04-18 16:53:51 +08:00
andy
5f43f7510c 费用标准时间查重验证
费用结算 如果当前时间段不存在, 默认往前找, 前面没有,往后找
2025-04-18 16:38:03 +08:00
andy
8f9e5cf565 1 2025-04-18 14:33:09 +08:00
tzy
90b805d0f4 fix(cloud): 优化预约单过期处理和微信支付回调逻辑
- 添加费标准详情字段并实现相关查询逻辑
- 优化预约单过期处理逻辑,增加缓冲期和精确的时间判断
- 完善微信支付回调处理,增加参数校验和幂等性检查
- 添加支付成功通知功能
2025-04-18 14:09:04 +08:00
andy
a0fef83bf3 定时器, 获取token 导致的 httpRequest为null. 出现的空指针问题 2025-04-18 13:58:41 +08:00
andy
5966258bff 项目结构调整 2025-04-18 11:52:44 +08:00
andy
204b814994 Merge remote-tracking branch 'remotes/origin/permission_dev'
# Conflicts:
#	base-commons/common-core/src/main/java/com/evotech/hd/common/core/entity/cloud/BatteryStation.java
#	cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/OrderSwapBatteryService.java
#	cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/impl/BatteryStationServiceImpl.java
#	cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/impl/OrderSwapBatteryServiceImpl.java
#	gateway-server/src/main/java/com/evotech/hd/gateway/oauth2/AuthorizationManager.java
2025-04-18 10:09:04 +08:00
tzy
09c9a3a066 Merge branch 'master' of https://git.evo-techina.com/hbyt/cloud-battery-manage 2025-04-18 10:00:33 +08:00
tzy
9048b368d7 feat(cloud-manage-server): 实现订单状态更新和费用结算功能
- 添加订单状态更新逻辑,处理不同状态下的订单
- 实现按电量和SOC计算订单费用的功能
- 优化换电步骤记录和电池状态更新
- 新增预约单过期检查和提醒功能
- 重构部分代码以提高可维护性
2025-04-18 09:59:34 +08:00
lhb
263cdaab1f fix:用户分配角色由多角色修改为单角色 2025-04-16 14:14:21 +08:00
447 changed files with 22845 additions and 6021 deletions

View File

@ -9,15 +9,20 @@
<module name="common-mybatis" /> <module name="common-mybatis" />
<module name="authorization-server" /> <module name="authorization-server" />
<module name="resource-server" /> <module name="resource-server" />
<module name="common-permission" />
<module name="gateway-server" /> <module name="gateway-server" />
<module name="admin-server" /> <module name="admin-server" />
<module name="common-web" /> <module name="common-web" />
<module name="common-mongodb" />
<module name="wechat-server" /> <module name="wechat-server" />
<module name="cloud-manage-server" /> <module name="cloud-manage-server" />
<module name="common-redis" /> <module name="common-redis" />
<module name="common-core" /> <module name="common-core" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel>
<module name="common-websocket" target="17" />
</bytecodeTargetLevel>
</component> </component>
<component name="JavacSettings"> <component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE"> <option name="ADDITIONAL_OPTIONS_OVERRIDE">
@ -25,9 +30,12 @@
<module name="authorization-server" options="-parameters" /> <module name="authorization-server" options="-parameters" />
<module name="cloud-manage-server" options="-parameters" /> <module name="cloud-manage-server" options="-parameters" />
<module name="common-core" options="-parameters" /> <module name="common-core" options="-parameters" />
<module name="common-mongodb" options="-parameters" />
<module name="common-mybatis" options="-parameters" /> <module name="common-mybatis" options="-parameters" />
<module name="common-permission" options="-parameters" />
<module name="common-redis" options="-parameters" /> <module name="common-redis" options="-parameters" />
<module name="common-web" options="-parameters" /> <module name="common-web" options="-parameters" />
<module name="common-websocket" options="-parameters" />
<module name="gateway-server" options="-parameters" /> <module name="gateway-server" options="-parameters" />
<module name="resource-server" options="-parameters" /> <module name="resource-server" options="-parameters" />
<module name="wechat-server" options="-parameters" /> <module name="wechat-server" options="-parameters" />

View File

@ -4,9 +4,12 @@
<file url="file://$PROJECT_DIR$/admin-server/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/admin-server/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/authorization-server/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/authorization-server/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/common-core/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/base-commons/common-core/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/common-mongodb/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/common-mybatis/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/base-commons/common-mybatis/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/common-permission/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/common-redis/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/base-commons/common-redis/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/common-web/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/base-commons/common-web/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/common-websocket/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/base-commons/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/base-commons/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/base-commons/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cloud-manage-server/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/cloud-manage-server/src/main/java" charset="UTF-8" />

View File

@ -7,6 +7,11 @@
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
</list> </list>
</option> </option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/base-commons/common-websocket/pom.xml" />
</set>
</option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="17 (2)" project-jdk-type="JavaSDK" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="17 (2)" project-jdk-type="JavaSDK" />
</project> </project>

View File

@ -28,6 +28,8 @@ spring:
serverAddr: 192.168.5.213:8848 serverAddr: 192.168.5.213:8848
username: nacos username: nacos
password: nacos password: nacos
config:
namespace: ${nacos.namespace:public}
discovery: discovery:
namespace: ${nacos.namespace:public} namespace: ${nacos.namespace:public}
register-enabled: true register-enabled: true

View File

@ -1,7 +1,10 @@
package com.evotech.hd.authorization.config.oauth2; package com.evotech.hd.authorization.config.oauth2;
import java.io.IOException; import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.enums.CodeMsg;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.server.ServletServerHttpResponse; import org.springframework.http.server.ServletServerHttpResponse;
@ -11,12 +14,7 @@ import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.core.OAuth2Error; import org.springframework.security.oauth2.core.OAuth2Error;
import org.springframework.security.web.authentication.AuthenticationFailureHandler; import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import com.evotech.hd.common.core.entity.Result; import java.io.IOException;
import com.evotech.hd.common.core.enums.CodeMsg;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
public class MyAuthenticationFailureHandler implements AuthenticationFailureHandler { public class MyAuthenticationFailureHandler implements AuthenticationFailureHandler {

View File

@ -1,9 +1,9 @@
package com.evotech.hd.authorization.config.oauth2; package com.evotech.hd.authorization.config.oauth2;
import java.io.IOException; import com.evotech.hd.common.core.Dto.Result;
import java.time.temporal.ChronoUnit; import jakarta.servlet.ServletException;
import java.util.Map; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
@ -17,11 +17,9 @@ import org.springframework.security.oauth2.server.authorization.authentication.O
import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import com.evotech.hd.common.core.entity.Result; import java.io.IOException;
import java.time.temporal.ChronoUnit;
import jakarta.servlet.ServletException; import java.util.Map;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
public class MyAuthenticationSuccessHandler implements AuthenticationSuccessHandler { public class MyAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
@ -56,7 +54,7 @@ public class MyAuthenticationSuccessHandler implements AuthenticationSuccessHand
ServletServerHttpResponse httpResponse = new ServletServerHttpResponse(response); ServletServerHttpResponse httpResponse = new ServletServerHttpResponse(response);
this.accessTokenHttpResponseConverter.write(new Result<String>().success(tokenResponseParameters), null, httpResponse); this.accessTokenHttpResponseConverter.write(new Result<Map<String, Object>>().success(tokenResponseParameters), null, httpResponse);
} }

View File

@ -1,17 +1,16 @@
package com.evotech.hd.authorization.config.security; package com.evotech.hd.authorization.config.security;
import java.io.IOException; import com.evotech.hd.common.core.Dto.Result;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.server.ServletServerHttpResponse; import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.access.AccessDeniedHandler;
import com.evotech.hd.common.core.entity.Result; import java.io.IOException;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
/** /**
* 登陆了没有权限时触发异常 返回信息 * 登陆了没有权限时触发异常 返回信息

View File

@ -1,6 +1,10 @@
package com.evotech.hd.authorization.config.security; package com.evotech.hd.authorization.config.security;
import java.io.IOException; import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.enums.CodeMsg;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.server.ServletServerHttpResponse; import org.springframework.http.server.ServletServerHttpResponse;
@ -8,12 +12,7 @@ import org.springframework.security.core.AuthenticationException;
import org.springframework.security.oauth2.server.resource.InvalidBearerTokenException; import org.springframework.security.oauth2.server.resource.InvalidBearerTokenException;
import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.security.web.AuthenticationEntryPoint;
import com.evotech.hd.common.core.entity.Result; import java.io.IOException;
import com.evotech.hd.common.core.enums.CodeMsg;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
/** /**
* 未认证没有登录返回异常 信息 * 未认证没有登录返回异常 信息

View File

@ -1,17 +1,16 @@
package com.evotech.hd.authorization.config.security.userdetail; package com.evotech.hd.authorization.config.security.userdetail;
import cn.hutool.core.bean.BeanUtil;
import com.evotech.hd.authorization.service.ResourceService;
import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.entity.resource.auth.AuthUser;
import com.evotech.hd.common.core.enums.CodeMsg;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.authentication.DisabledException; import org.springframework.security.authentication.DisabledException;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import com.evotech.hd.authorization.service.ResourceService;
import com.evotech.hd.common.core.entity.Result;
import com.evotech.hd.common.core.entity.resource.auth.AuthUser;
import com.evotech.hd.common.core.enums.CodeMsg;
import cn.hutool.core.bean.BeanUtil;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public class UserDetailService implements UserDetailsService { public class UserDetailService implements UserDetailsService {

View File

@ -1,17 +1,15 @@
package com.evotech.hd.authorization.controller; package com.evotech.hd.authorization.controller;
import com.evotech.hd.authorization.service.CaptchaService;
import com.evotech.hd.common.core.Dto.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.evotech.hd.authorization.service.CaptchaService;
import com.evotech.hd.common.core.entity.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
@Tag(name = "验证码") @Tag(name = "验证码")
@RestController @RestController
@RequestMapping("/captcha") @RequestMapping("/captcha")

View File

@ -1,18 +1,9 @@
package com.evotech.hd.authorization.controller; package com.evotech.hd.authorization.controller;
import org.apache.http.auth.AuthenticationException;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.evotech.hd.authorization.entity.LoginRequest; import com.evotech.hd.authorization.entity.LoginRequest;
import com.evotech.hd.authorization.entity.UserVo; import com.evotech.hd.authorization.entity.UserVo;
import com.evotech.hd.authorization.service.LoginService; import com.evotech.hd.authorization.service.LoginService;
import com.evotech.hd.common.core.entity.Result; import com.evotech.hd.common.core.Dto.Result;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.Parameters;
@ -20,6 +11,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import org.apache.http.auth.AuthenticationException;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.*;
@Tag(name = "登陆") @Tag(name = "登陆")
@RestController @RestController

View File

@ -1,6 +1,7 @@
package com.evotech.hd.authorization.service; package com.evotech.hd.authorization.service;
import com.evotech.hd.common.core.entity.Result;
import com.evotech.hd.common.core.Dto.Result;
public interface CaptchaService { public interface CaptchaService {

View File

@ -1,6 +1,6 @@
package com.evotech.hd.authorization.service; package com.evotech.hd.authorization.service;
import com.evotech.hd.common.core.Dto.BaseResponse; import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.entity.cloud.BatteryStation; import com.evotech.hd.common.core.entity.cloud.BatteryStation;
import com.evotech.hd.common.core.entity.cloud.Company; import com.evotech.hd.common.core.entity.cloud.Company;
import com.evotech.hd.common.core.entity.cloud.VehicleInfo; import com.evotech.hd.common.core.entity.cloud.VehicleInfo;
@ -11,16 +11,19 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
@FeignClient(value = "cloud-server", path = "/cloud") @FeignClient(name = "${CLOUD-SERVER-API-NAME}", path = "${CLOUD-SERVER-API-PATH}")
public interface CloudService { public interface CloudService {
@GetMapping(value = "/batterystation/login/list", consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE}) @GetMapping(value = "/battery/station/login/list", consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public BaseResponse<List<BatteryStation>> loadBatteryStation(@RequestParam("proxyCode") String proxyCode); public Result<List<BatteryStation>> loadBatteryStation(@RequestParam("proxyCode") String proxyCode);
@GetMapping(value = "/company/login/one", consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE}) @GetMapping(value = "/company/login/one", consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public BaseResponse<Company> loadCompany(@RequestParam("code") String code); public Result<Company> loadCompany(@RequestParam("code") String code);
@GetMapping(value = "/vehicle/login/list", consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE}) @GetMapping(value = "/vehicle/login/list", consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public BaseResponse<List<VehicleInfo>> loadVehicleInfo(@RequestParam("companyCode") String companyCode); public Result<List<VehicleInfo>> loadVehicleInfo(@RequestParam("companyCode") String companyCode);
@GetMapping(value = "/home/login/data", consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public void loadIndexData();
} }

View File

@ -1,11 +1,10 @@
package com.evotech.hd.authorization.service; package com.evotech.hd.authorization.service;
import org.apache.http.auth.AuthenticationException;
import com.evotech.hd.authorization.entity.LoginRequest; import com.evotech.hd.authorization.entity.LoginRequest;
import com.evotech.hd.authorization.entity.UserVo; import com.evotech.hd.authorization.entity.UserVo;
import com.evotech.hd.common.core.entity.Result; import com.evotech.hd.common.core.Dto.Result;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.apache.http.auth.AuthenticationException;
public interface LoginService { public interface LoginService {

View File

@ -1,8 +1,7 @@
package com.evotech.hd.authorization.service; package com.evotech.hd.authorization.service;
import com.evotech.hd.common.core.Dto.BaseResponse; import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.entity.LoginCacheInfo; import com.evotech.hd.common.core.entity.LoginCacheInfo;
import com.evotech.hd.common.core.entity.Result;
import com.evotech.hd.common.core.entity.resource.LogLogin; import com.evotech.hd.common.core.entity.resource.LogLogin;
import com.evotech.hd.common.core.entity.resource.auth.AuthUser; import com.evotech.hd.common.core.entity.resource.auth.AuthUser;
import com.evotech.hd.common.core.entity.resource.auth.AuthUserStation; import com.evotech.hd.common.core.entity.resource.auth.AuthUserStation;
@ -16,27 +15,27 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
@FeignClient(value = "resource-server") @FeignClient(name = "${RESOURCE-SERVER-API-NAME}", path = "${RESOURCE-SERVER-API-PATH}")
public interface ResourceService { public interface ResourceService {
@GetMapping(value = "/resource/user/userbyname", @GetMapping(value = "/user/userbyname",
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
public Result<AuthUser> loadUserByName(@RequestParam("uname") String userName); public Result<AuthUser> loadUserByName(@RequestParam("uname") String userName);
@PostMapping(value = "/resource/user/userpermbyid", @PostMapping(value = "/user/userpermbyid",
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
public Result<String> userPermById(@NotNull @RequestParam("uid") String userId, @RequestParam("type")Integer type); public Result<String> userPermById(@NotNull @RequestParam("uid") String userId, @RequestParam("type")Integer type);
@PostMapping(value = "/resource/loginlog/add", @PostMapping(value = "/loginlog/add",
consumes = {MediaType.APPLICATION_JSON_VALUE}) consumes = {MediaType.APPLICATION_JSON_VALUE})
public Result<Integer> addLoginLog(@RequestBody LogLogin log); public Result<Integer> addLoginLog(@RequestBody LogLogin log);
@GetMapping(value = "/resource/logininfo/get", @GetMapping(value = "/logininfo/get",
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
public Result<LoginCacheInfo> loginInfo(@RequestParam("uid") String uid); public Result<LoginCacheInfo> loginInfo(@RequestParam("uid") String uid);
@GetMapping(value = "/resource/user/station",consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE}) @GetMapping(value = "/user/station",consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public BaseResponse<List<AuthUserStation>> loadBatteryStation(@RequestParam("uid") String uid); public Result<List<AuthUserStation>> loadBatteryStation(@RequestParam("uid") String uid);
} }

View File

@ -1,18 +1,16 @@
package com.evotech.hd.authorization.service.impl; package com.evotech.hd.authorization.service.impl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.evotech.hd.authorization.service.CaptchaService;
import com.evotech.hd.common.core.constant.HDConstant;
import com.evotech.hd.common.core.entity.Result;
import com.evotech.hd.common.redis.utils.RedisUtil;
import cn.hutool.captcha.CaptchaUtil; import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.LineCaptcha; import cn.hutool.captcha.LineCaptcha;
import cn.hutool.captcha.generator.RandomGenerator; import cn.hutool.captcha.generator.RandomGenerator;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.evotech.hd.authorization.service.CaptchaService;
import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.constant.HDConstant;
import com.evotech.hd.common.redis.utils.RedisUtil;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Service @Service
public class CaptchaServiceImpl implements CaptchaService { public class CaptchaServiceImpl implements CaptchaService {
@ -32,7 +30,7 @@ public class CaptchaServiceImpl implements CaptchaService {
String imageBase64Data = captcha.getImageBase64Data(); String imageBase64Data = captcha.getImageBase64Data();
String captchaId = IdUtil.fastSimpleUUID(); String captchaId = IdUtil.fastSimpleUUID();
redisUtil.set(HDConstant.CAPTCHA_REDIS_PREFIX + captchaId, code, captchaExpire); redisUtil.set(HDConstant.CAPTCHA_REDIS_PREFIX + captchaId, code, captchaExpire);
return new Result<String>().success("OK", captchaId + ":" + imageBase64Data); return new Result<String>().success(captchaId + ":" + imageBase64Data);
} }
@Override @Override

View File

@ -15,10 +15,10 @@ import com.evotech.hd.authorization.service.ResourceService;
import com.evotech.hd.authorization.utils.LoginRequesHeadertUtil; import com.evotech.hd.authorization.utils.LoginRequesHeadertUtil;
import com.evotech.hd.authorization.utils.Oauth2AccessTokenUtil; import com.evotech.hd.authorization.utils.Oauth2AccessTokenUtil;
import com.evotech.hd.authorization.utils.TokenUtil; import com.evotech.hd.authorization.utils.TokenUtil;
import com.evotech.hd.common.core.Dto.BaseResponse; import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.Dto.ResultUtil;
import com.evotech.hd.common.core.constant.HDConstant; import com.evotech.hd.common.core.constant.HDConstant;
import com.evotech.hd.common.core.entity.LoginCacheInfo; import com.evotech.hd.common.core.entity.LoginCacheInfo;
import com.evotech.hd.common.core.entity.Result;
import com.evotech.hd.common.core.entity.cloud.BatteryStation; import com.evotech.hd.common.core.entity.cloud.BatteryStation;
import com.evotech.hd.common.core.entity.cloud.Company; import com.evotech.hd.common.core.entity.cloud.Company;
import com.evotech.hd.common.core.entity.cloud.VehicleInfo; import com.evotech.hd.common.core.entity.cloud.VehicleInfo;
@ -32,6 +32,7 @@ import com.evotech.hd.common.redis.utils.RedisUtil;
import com.evotech.hd.common.web.util.IpUtil; import com.evotech.hd.common.web.util.IpUtil;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.auth.AuthenticationException; import org.apache.http.auth.AuthenticationException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
@ -44,6 +45,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j
@Service @Service
public class LoginServiceImpl implements LoginService { public class LoginServiceImpl implements LoginService {
@ -68,7 +70,7 @@ public class LoginServiceImpl implements LoginService {
// 1. 校验验证码 // 1. 校验验证码
Result<Boolean> res = captchaService.checkCaptcha(lr.getCode()); Result<Boolean> res = captchaService.checkCaptcha(lr.getCode());
if (res.getStatus() != 1) { if (res.getStatus() != 1) {
return new Result<UserVo>().error(res.getCode(), res.getMsg()); return new Result<UserVo>().error(CodeMsg.getCodeMsgByCode(res.getCode()), res.getMsg());
} }
// 2. 从请求头获取client信息 // 2. 从请求头获取client信息
Map<String, String> oAuth2Client = LoginRequesHeadertUtil.getOAuth2Client(request); Map<String, String> oAuth2Client = LoginRequesHeadertUtil.getOAuth2Client(request);
@ -160,6 +162,9 @@ public class LoginServiceImpl implements LoginService {
BeanUtils.copyProperties(user, uv); BeanUtils.copyProperties(user, uv);
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":user", user, tokenExp); redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":user", user, tokenExp);
//异步缓存首页统计
asyncIndexTask();
List<AuthRole> roleList = JSONUtil.toList(jo.getJSONArray("roleList"), AuthRole.class); List<AuthRole> roleList = JSONUtil.toList(jo.getJSONArray("roleList"), AuthRole.class);
uv.setRoleList(roleList); uv.setRoleList(roleList);
String rcodes = roleList.stream().map(i -> i.getRcode()).collect(Collectors.joining(",")); String rcodes = roleList.stream().map(i -> i.getRcode()).collect(Collectors.joining(","));
@ -178,64 +183,61 @@ public class LoginServiceImpl implements LoginService {
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_AUTH_USER_UID+":"+user.getPkId(), user.getUid()); redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_AUTH_USER_UID+":"+user.getPkId(), user.getUid());
//如果是运营方的类型账号 //如果是运营方的类型账号
String pkIds = "-1", codes="-1"; String pkIds = "-1", codes="-1";
if(Integer.valueOf(2).equals(user.getType())){ if(Integer.valueOf(2).equals(user.getType())) {
if(rcodeList.contains(HDConstant.OPERATOR_ROLE_CODE)){ if (rcodeList.contains(HDConstant.OPERATOR_ROLE_CODE)) {
BaseResponse<List<BatteryStation>> result = cloudService.loadBatteryStation(user.getBusinessCode()); List<BatteryStation> list = ResultUtil.getValue(cloudService.loadBatteryStation(user.getBusinessCode()));
if(CodeMsg.SUCCESS.getCode().equals(result.getCode())){ if (CollectionUtils.isNotEmpty(list)) {
List<BatteryStation> list = result.getData();
if(CollectionUtils.isNotEmpty(list)){
pkIds = list.stream().map(BatteryStation::getPkId).map(String::valueOf).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(",")); pkIds = list.stream().map(BatteryStation::getPkId).map(String::valueOf).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(","));
codes = list.stream().map(BatteryStation::getCode).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(",")); codes = list.stream().map(BatteryStation::getCode).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(","));
} }
} } else {
}else{
//不是运营商管理角色 //不是运营商管理角色
// 检查当前角色的站点信息 // 检查当前角色的站点信息
BaseResponse<List<AuthUserStation>> result = resourceService.loadBatteryStation(user.getUid()); List<AuthUserStation> list = ResultUtil.getValue(resourceService.loadBatteryStation(user.getUid()));
if(CodeMsg.SUCCESS.getCode().equals(result.getCode())){ if (CollectionUtils.isNotEmpty(list)) {
List<AuthUserStation> list = result.getData();
if(CollectionUtils.isNotEmpty(list)){
pkIds = list.stream().map(AuthUserStation::getStationId).map(String::valueOf).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(",")); pkIds = list.stream().map(AuthUserStation::getStationId).map(String::valueOf).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(","));
codes = list.stream().map(AuthUserStation::getStationCode).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(",")); codes = list.stream().map(AuthUserStation::getStationCode).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(","));
} }
} }
} }
} redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_PROXY_CODE + ":" + user.getPkId(), user.getBusinessCode());
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_PROXY_CODE+":"+user.getPkId(), user.getBusinessCode()); redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_STATION_ID + ":" + user.getPkId(), pkIds);
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_STATION_ID+":"+user.getPkId(), pkIds); redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_STATION_CODE + ":" + user.getPkId(), codes);
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_STATION_CODE+":"+user.getPkId(), codes);
//客户角色 //客户角色
String companyId="-1", companyCode="-1", carIds="-1", carPlateNums="-1"; String companyId = "-1", companyCode = "-1", carIds = "-1", carPlateNums = "-1";
if(Integer.valueOf(3).equals(user.getType())){ if (Integer.valueOf(3).equals(user.getType())) {
BaseResponse<Company> companyResult = cloudService.loadCompany(user.getBusinessCode()); if (rcodeList.contains(HDConstant.COMPANY_ROLE_CODE)) {
if(rcodeList.contains(HDConstant.COMPANY_ROLE_CODE)){ Company company = ResultUtil.getValue(cloudService.loadCompany(user.getBusinessCode()));
if(CodeMsg.SUCCESS.getCode().equals(companyResult.getCode())){ if (!ObjectUtils.isEmpty(company)) {
Company company = companyResult.getData();
if(!ObjectUtils.isEmpty(company)){
companyId = String.valueOf(company.getPkId()); companyId = String.valueOf(company.getPkId());
companyCode = company.getCcode(); companyCode = company.getCcode();
BaseResponse<List<VehicleInfo>> vehicleInfoResult = cloudService.loadVehicleInfo(company.getCcode()); List<VehicleInfo> list = ResultUtil.getValue(cloudService.loadVehicleInfo(company.getCcode()));
if(CodeMsg.SUCCESS.getCode().equals(vehicleInfoResult.getCode())){ if (CollectionUtils.isNotEmpty(list)) {
List<VehicleInfo> list = vehicleInfoResult.getData();
if(CollectionUtils.isNotEmpty(list)){
carIds = list.stream().map(VehicleInfo::getPkId).map(String::valueOf).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(",")); carIds = list.stream().map(VehicleInfo::getPkId).map(String::valueOf).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(","));
carPlateNums = list.stream().map(VehicleInfo::getPlateNum).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(",")); carPlateNums = list.stream().map(VehicleInfo::getPlateNum).filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).collect(Collectors.joining(","));
} }
} }
} }
} }
} redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_COMPANY_ID + ":" + user.getPkId(), companyId);
} redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_COMPANY_CODE + ":" + user.getPkId(), companyCode);
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_COMPANY_ID+":"+user.getPkId(), companyId); redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_CAR_ID + ":" + user.getPkId(), carIds);
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_COMPANY_CODE+":"+user.getPkId(), companyCode); redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_CAR_CODE + ":" + user.getPkId(), carPlateNums);
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_CAR_ID+":"+user.getPkId(), carIds);
redisUtil.set(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.PermissionConstant.PERMISSION_CAR_CODE+":"+user.getPkId(), carPlateNums);
return uv; return uv;
} }
private void asyncIndexTask(){
// CompletableFuture<Void> asyncTask = CompletableFuture.runAsync(()->{
// try {
// cloudService.loadIndexData();
// } catch (Exception e) {
// log.error("异步处理首页数据异常:{}", e.getMessage());
// }
// });
}
@Override @Override
@ -243,7 +245,16 @@ public class LoginServiceImpl implements LoginService {
String authorization = request.getHeader(HDConstant.AUTHORIZATION_KEY); String authorization = request.getHeader(HDConstant.AUTHORIZATION_KEY);
if (authorization != null && authorization.contains(HDConstant.JWT_PREFIX)) { if (authorization != null && authorization.contains(HDConstant.JWT_PREFIX)) {
String token = authorization.substring(HDConstant.JWT_PREFIX.length()); String token = authorization.substring(HDConstant.JWT_PREFIX.length());
String jti = TokenUtil.getJti(token); String jti = TokenUtil.getJti(token);
AuthUser user = (AuthUser)redisUtil.get(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":user");
Integer id = user.getPkId();
redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.IndexConstant.HOME_DATA_5+":"+id);
redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + HDConstant.IndexConstant.HOME_DATA_6+":"+id);
redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":token"); redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":token");
redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":user"); redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":user");
redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":rcodes"); redisUtil.del(HDConstant.LOGIN_CACHE_KEY_PREFIX + jti + ":rcodes");

View File

@ -15,7 +15,8 @@ spring:
config: config:
import: import:
- nacos:yt-common.properties?refreshEnabled=true - nacos:yt-common.properties?refreshEnabled=true
- nacos:${spring.application.name}.yaml?refreshEnabled=true - nacos:oauth2-server.yaml?refreshEnabled=true
- nacos:yt-redis.yaml?refreshEnabled=true
cloud: cloud:
nacos: nacos:
serverAddr: 192.168.5.213:8848 serverAddr: 192.168.5.213:8848

View File

@ -28,7 +28,10 @@
<groupId>org.hibernate.validator</groupId> <groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
@ -67,6 +70,16 @@
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
<artifactId>hutool-crypto</artifactId> <artifactId>hutool-crypto</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

View File

@ -1,41 +0,0 @@
package com.evotech.hd.common.core.Dto;
import com.evotech.hd.common.core.enums.CodeMsg;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 请求返回对象
* @ClassName:BaseResponse
* @date: 2025年04月15日 16:37
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class BaseResponse<T> implements Serializable {
@Schema(description = "请求处理状态", example = "1")
private Integer status;
@Schema(description = "状态码", example = "1000")
private String code;
@Schema(description = "返回消息")
private String msg;
@Schema(description = "返回数据")
private T data;
public BaseResponse() {
}
public BaseResponse<T> success(T o) {
this.status = 1;
this.code = CodeMsg.SUCCESS.getCode();
this.msg = CodeMsg.SUCCESS.getMsg();
this.data = o;
return this;
}
}

View File

@ -0,0 +1,30 @@
package com.evotech.hd.common.core.Dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* Options
*
* @author andy.shi
* @ClassName:Options
* @date: 2026年02月14日 9:54
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Schema(name = "下拉菜单参数")
public class Options {
@Schema(description = "下拉菜单的label")
String label;
@Schema(description = "下拉菜单的value")
String value;
public Options() {
}
public Options(String label, String value) {
this.label = label;
this.value = value;
}
}

View File

@ -0,0 +1,104 @@
package com.evotech.hd.common.core.Dto;
import com.evotech.hd.common.core.enums.CodeMsg;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 请求返回对象
* @ClassName:BaseResponse
* @date: 2025年04月15日 16:37
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class Result<T> implements Serializable {
@Schema(description = "请求处理状态", example = "1")
private Integer status;
@Schema(description = "状态码", example = "1000")
private String code;
@Schema(description = "返回消息")
private String msg;
@Schema(description = "返回数据")
private T data;
public static <T> Result<T> getInstance(){
return new Result<T>();
}
public Result() {
}
public <T> Result<T> build(Class<T> cls) {
return (Result<T>) this;
}
public <T> Result<List<T>> buildList(Class<T> cls) {
return (Result<List<T>>) this;
}
public Result<T> success() {
this.status = 1;
this.code = CodeMsg.SUCCESS.getCode();
this.msg = CodeMsg.SUCCESS.getMsg();
return this;
}
public Result<T> success(T o) {
this.status = 1;
this.code = CodeMsg.SUCCESS.getCode();
this.msg = CodeMsg.SUCCESS.getMsg();
this.data = o;
return this;
}
public Result<T> error(String errMsg) {
this.status = 1;
this.code = CodeMsg.ERROR.getCode();
this.msg = errMsg;
return this;
}
public Result<T> error(String errMsg, T data) {
this.status = 1;
this.code = CodeMsg.ERROR.getCode();
this.msg = errMsg;
this.data = data;
return this;
}
public Result<T> error(CodeMsg codeMsg) {
this.status = 1;
this.code = codeMsg.getCode();
this.msg = codeMsg.getMsg();
return this;
}
public Result<T> error(CodeMsg codeMsg, String errorMsg) {
this.status = 1;
this.code = codeMsg.getCode();
this.msg = errorMsg;
return this;
}
public Result<T> exception(T data) {
this.status = -1;
this.code = CodeMsg.ERROR.getCode();
this.msg = CodeMsg.ERROR.getMsg();
this.data = data;
return this;
}
public Result<T> businessException(String code, String msg, T o) {
this.status = -1;
this.code = code;
this.msg = msg;
this.data = o;
return this;
}
}

View File

@ -0,0 +1,29 @@
package com.evotech.hd.common.core.Dto;
import com.evotech.hd.common.core.enums.CodeMsg;
import lombok.extern.slf4j.Slf4j;
/**
* 请求相应工具类
* @ClassName:ResponseUtil
* @date: 2025年04月22日 16:38
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Slf4j
public class ResultUtil {
public static <T> T getValue(Result<T> result){
if(CodeMsg.SUCCESS.getCode().equals(result.getCode())){
return result.getData();
}
log.error("当前请求出现异常{}", result.getMsg());
return null;
}
public static <T> Boolean verifyCode(Result<T> result){
return CodeMsg.SUCCESS.getCode().equals(result.getCode());
}
}

View File

@ -0,0 +1,44 @@
package com.evotech.hd.common.core.Dto.device;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @ClassName:DeviceDto
* @date: 2025年04月21日 14:36
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Schema(name = "运营商信息-> 站端信息-> 设备信息")
public class DeviceDto {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED)
private String id;
@Schema(description = "父级Id")
private String parentId;
@Schema(description = "名称")
private String name;
@Schema(description = "设备ID")
private String deviceId;
@Schema(description = "通道ID")
private String channelId;
@Schema(description = "子集信息")
List<DeviceDto> childList;
public DeviceDto() {
}
public DeviceDto(String id, String parentId, String name, String deviceId, String channelId, List<DeviceDto> childList) {
this.id = id;
this.parentId = parentId;
this.name = name;
this.deviceId = deviceId;
this.channelId = channelId;
this.childList = childList;
}
}

View File

@ -0,0 +1,35 @@
package com.evotech.hd.common.core.Dto.home;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ClassName:HomeOrderInfo
* @date: 2025年05月08日 17:34
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Schema(name = "首页换电订单信息")
public class HomeOrderInfo {
@Schema(description = "换电时间")
@JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss")
private Date swapTime;
@Schema(description = "换电车辆")
private String swapCar;
@Schema(description = "换电人")
private String swapUserName;
@Schema(description = "换电金额")
private Double swapAmount;
}

View File

@ -0,0 +1,30 @@
package com.evotech.hd.common.core.Dto.home;
import lombok.Data;
/**
* 首页订单金额统计类
*
* @ClassName:HomeOrderSwapBatteryAmountDto
* @date: 2025年04月24日 11:14
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class HomeOrderSwapBatteryAmountDto {
Double amount;
Long dataCount;
Integer status;
public HomeOrderSwapBatteryAmountDto() {
}
public HomeOrderSwapBatteryAmountDto(Double amount, Long dataCount) {
this.amount = amount;
this.dataCount = dataCount;
}
}

View File

@ -0,0 +1,32 @@
package com.evotech.hd.common.core.Dto.home;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 近半年订单交易金额统计
*
* @ClassName:HomeOrderSwapBatteryAmountDto
* @date: 2025年04月24日 11:14
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class HomeOrderSwapBatteryHalfYearAmountDto {
@Schema(description = "年月")
private String month;
@Schema(description = "交易数")
private Long quantity;
@Schema(description = "交易金额")
private Double totalMoney;
// @Schema(description = "类型")
// private Integer status;
//
// @Schema(description = "支付类型")
// private Integer payType;
}

View File

@ -0,0 +1,23 @@
package com.evotech.hd.common.core.Dto.home;
import lombok.Data;
/**
* 近半年订单统计
*
* @ClassName:HomeOrderSwapBatteryAmountDto
* @date: 2025年04月24日 11:14
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class HomeOrderSwapBatteryHalfYearDto {
private String month;
private Long quantity;
private Double totalMoney;
}

View File

@ -0,0 +1,29 @@
package com.evotech.hd.common.core.Dto.home;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 换电站订单占比类
*
* @ClassName:HomeOrderSwapBatteryDto
* @date: 2025年04月24日 10:06
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Schema(name = "首页换电站订单数,换电站占比相关数据")
public class HomeOrderSwapBatteryProportionDto {
@Schema(description = "换电站名称")
String stationName;
@Schema(description = "换电站code")
String stationCode;
@Schema(description = "换电站订单数量")
Long quantity;
// @Schema(description = "订单类型")
// Integer orderType;
}

View File

@ -0,0 +1,77 @@
package com.evotech.hd.common.core.Dto.order;
import com.evotech.hd.common.core.excel.Excel;
import com.evotech.hd.common.core.utils.Collections;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
*
*
* @ClassName:OrderListVo
* @date: 2025年05月16日 13:54
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Schema(name = "电子账单")
public class OrderBillListVo {
/***
* 结算总金额
*/
@Schema(description = "订单总额")
Double orderTotalAmount;
/***
* 站点名称
*/
@Schema(description = "站点名称")
@Excel(name="站点名称")
String stationName;
/***
* 车牌号
*/
@Schema(description = "车牌号")
@Excel(name="车牌号")
String plateNum;
/***
* 换电人
*/
@Schema(description = "换电人")
@Excel(name="换电人")
String preName;
/***
* 换电次数
*/
@Schema(description = "换电次数")
Integer orderNum;
/***
* 换电时间
*/
@Schema(description = "换电时间")
@Excel(name="换电时间", dateFormat ="yyyy-MM-dd HH:mm:ss")
Date orderTime;
/***
* 订单金额
*/
@Schema(description = "订单金额")
Integer orderAmount;
@Excel(name="订单金额", isStatistics = true)
@JsonIgnore
Double orderAmountExcel;
/***
* 订单状态
*/
@Schema(description = "订单状态")
Integer status;
@Schema(description = "换电订单详情")
List<OrderBillListVo> childList = Collections.emptyList();;
}

View File

@ -0,0 +1,111 @@
package com.evotech.hd.common.core.Dto.order;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*
* @ClassName:OrderDetailVo
* @date: 2025年07月23日 15:12
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class OrderDetailVo {
@Schema(description = "订单编号")
private String orderNo;
@Schema(title = "订单类型", description = "1=换电;2=充电")
private Integer orderType;
@Schema(title = "车牌号")
private String plateNum;
@Schema(title = "订单状态", description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消, -1-退款")
private Integer status;
@Schema(title = "订单时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date orderTime;
@Schema(title = "换电站")
private String stationName;
@Schema(title = "预约人")
private String perName;
@Schema(title = "交易编码", description = "第三方收款返回的唯一标识")
private String notifyOrderNo;
@Schema(title = "订单总金额")
private Integer amount;
@Schema(title = "计费类型", description="1-ODO, 2-SOC, 3-电量")
private Integer feeType;
@Schema(title = "订单金额")
private Integer orderFee;
@Schema(title = "服务金额")
private Integer serviceFee;
@Schema(title = "服务开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date serviceTimeBegin;
@Schema(title = "服务结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date serviceTimeEnd;
@Schema(title = "订单开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTimeBegin;
@Schema(title = "订单结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTimeEnd;
@Schema(title = "耗电量", description = "耗电量; 如果是soc结算 则是soc的差值, ODO则是里程")
private Double electricityQuantity;
@Schema(title = "开始充电的电量", description = "feeType=3时, 不为空")
private Double electStart;
@Schema(title = "结束充电的电量", description = "feeType=3时, 不为空")
private Double electEnd;
@Schema(title = "租借电池包仓位", description = "feeType=2时, 不为空")
private String rentBatNo;
@Schema(title = "租借电池包编码", description = "feeType=2时, 不为空")
private String rentBatCode;
@Schema(title = "租借电池包SOC", description = "feeType=2时, 不为空")
private Double rentBatSoc;
@Schema(title = "归还电池包仓位", description = "feeType=2时, 不为空")
private String returnBatNo;
@Schema(title = "归还电池包编码", description = "feeType=2时, 不为空")
private String returnBatCode;
@Schema(title = "归还电池包SOC", description = "feeType=2时, 不为空")
private Double returnBatSoc;
@Schema(title = "换电模式", description="1-全自动; 2-半自动; 3-人工干预")
private Integer changeMode;
@Schema(title = "换电车道", description="1-换电车道A; 2-换电车道B")
private Integer changeLane;
}

View File

@ -0,0 +1,59 @@
package com.evotech.hd.common.core.Dto.order;
import com.evotech.hd.common.core.excel.Excel;
import com.evotech.hd.common.core.excel.handler.impl.OrderSourceExcelHandlerAdapter;
import com.evotech.hd.common.core.excel.handler.impl.OrderStatusExcelHandlerAdapter;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* OrderExportVo
*
* @author andy.shi
* @ClassName:OrderExportVo
* @date: 2026年02月10日 10:13
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class OrderExportVo {
@Excel(name="序号", needMerge=true)
Integer serialNumber;
@Excel(name="订单编号", needMerge=true)
String orderNo;
@Excel(name="站点名称", needMerge=true)
String stationName;
@Excel(name="订单来源", needMerge=true, handler = OrderSourceExcelHandlerAdapter.class)
String orderSource;
@Excel(name="换电结果", needMerge=true, handler = OrderStatusExcelHandlerAdapter.class)
String orderType;
@Excel(name="车牌号", needMerge=true)
String plateNum;
@Excel(name="拆卸电池编号", needMerge=true)
String returnBatCode;
@Excel(name="拆卸电池SOC", needMerge=true)
String returnBatSoc;
@Excel(name="安装电池编号", needMerge=true)
String rentBatCode;
@Excel(name="安装电池SOC", needMerge=true)
String rentBatSoc;
@Excel(name="车辆进站时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
Date serviceTimeBegin;
@Excel(name="服务结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
Date serviceTimeEnd;
@Excel(name="服务耗时", needMerge=true)
String serviceDuration;
@Excel(name="换电开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
Date startTime;
@Excel(name="换电结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
Date closeTime;
@Excel(name="换电耗时", needMerge=true)
String batteryDuration;
@Excel(name="流程是否完整", needMerge=true)
String processComplete;
@Excel(name="换电步骤")
List<OrderStepExportVo> stepList;
}

View File

@ -0,0 +1,55 @@
package com.evotech.hd.common.core.Dto.order;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*
* @ClassName:OrderListVo
* @date: 2025年05月16日 13:54
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Schema(name = "订单列表")
public class OrderListVo {
@Schema(description = "唯一标识")
private Integer pkId;
@Schema(description = "订单编号")
private String orderNo;
@Schema(name = "订单类型", description = "1=换电;2=充电")
private Integer orderType;
@Schema(name = "车牌号")
private String plateNum;
@Schema(name = "换电站")
private String stationName;
@Schema(name = "订单金额")
private Integer amount;
@Schema(name = "预约人")
private String perName;
@Schema(name = "订单时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date orderTime;
@Schema(name = "订单状态", description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消, -1-退款")
private Integer status;
@Schema(name = "交易编码", description = "第三方收款返回的唯一标识")
private String notifyOrderNo;
}

View File

@ -0,0 +1,24 @@
package com.evotech.hd.common.core.Dto.order;
import com.evotech.hd.common.core.excel.Excel;
import com.evotech.hd.common.core.excel.handler.impl.OrderStepExcelHandlerAdapter;
import lombok.Data;
import java.util.Date;
/**
* OrderDetailExportVo
*
* @author andy.shi
* @ClassName:OrderDetailExportVo
* @date: 2026年02月10日 14:18
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class OrderStepExportVo {
Integer step;
@Excel(name="步骤", handler = OrderStepExcelHandlerAdapter.class)
String stepName;
@Excel(name="时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
Date stepTime;
}

View File

@ -0,0 +1,33 @@
package com.evotech.hd.common.core.Dto.request;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ClassName:HomeRequestDto
* @date: 2025年04月24日 10:00
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class HomeRequestDto {
Date begin;
Date end;
public HomeRequestDto() {
}
public HomeRequestDto(Date begin, Date end) {
this.begin = begin;
this.end = end;
}
}

View File

@ -0,0 +1,53 @@
package com.evotech.hd.common.core.Dto.request.order;
import com.evotech.hd.common.core.entity.BasePageRequest;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*
* @ClassName:OrderRequest
* @date: 2025年05月16日 15:28
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Schema(name = "查询订单请求参数", hidden = true)
@EqualsAndHashCode(callSuper=false)
public class OrderRequest extends BasePageRequest {
@Schema(description = "订单编码")
private String orderNo;
@Schema(description = "车牌号")
private String plateNum;
@Schema(description = "订单时间开始", example = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date orderTimeBegin;
@Schema(description = "订单时间结束")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date orderTimeEnd;
@Schema(description = "换电站编码")
private String stationCode;
@Schema(description = "交易编码")
private String tradeNo;
@Schema(description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消")
private String status;
}

View File

@ -0,0 +1,25 @@
package com.evotech.hd.common.core.Dto.request.template;
import lombok.Data;
import java.util.List;
/**
*
*
* @ClassName:AlarmTemplateDto
* @date: 2025年05月05日 16:29
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class AlarmTemplateDto {
List<String> wuid;
String stationName;
String alarmMsg;
}

View File

@ -0,0 +1,34 @@
package com.evotech.hd.common.core.Dto.request.template;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
*
*
* @ClassName:AlarmTemplateDto
* @date: 2025年05月05日 16:29
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class StopServerTemplateDto {
/***
* key 用户的wuid, value为用户的车牌号信息
*/
Map<String,String> plateNum;
/***
* 站管理员的wuid
*/
List<String> adminWuId;
String stationName;
String reason;
}

View File

@ -2,7 +2,180 @@ package com.evotech.hd.common.core.constant;
public interface HDConstant { public interface HDConstant {
public static final class PermissionConstant{ /***
* 全局删除标识-已删除
*/
final static Integer DELETE_YES = 1;
/***
* 全局删除标识-未删除
*/
final static Integer DELETE_NO = 0;
final static String PUBLIC_KEY="public_key";
final static String PRIVATE_KEY="private_key";
/***
* 大华设备相关CONSTANT
*/
final class IndexConstant{
//redis accessToken的key
public static final String HOME_DATA_5 = "homeData5";
public static final String HOME_DATA_6 = "homeData6";
}
final class DcConstant{
/** 出租中 */
public static final Integer STATUS_CZ = 1;
/** 充电中 */
public static final Integer STATUS_CD = 2;
/** 空闲 */
public static final Integer STATUS_KX = 3;
/** 故障 */
public static final Integer STATUS_GZ = 4;
/** 其他 */
public static final Integer STATUS_QT = 5;
/** 来源_电站 */
public static final Integer SOURCE_FROM_STATION = 1;
/** 来源_车 */
public static final Integer SOURCE_FROM_CAR = 2;
/** 电站 */
public static final Integer POINT_TYPE_STATION = 1;
/** 车 */
public static final Integer POINT_TYPE_CAR = 2;
}
/***
* 订单相关参数
*/
final class OrderConstant{
/***
* 计费方式-ODO(里程数)
*/
public static final int FEE_TYPE_ODO = 1;
/***
* 计费方式-SOC(电池百分比)
*/
public static final int FEE_TYPE_SOC = 2;
/***
* 计费方式-电量
*/
public static final int FEE_TYPE_DL = 3;
/***
* 换电模式 全自动
*/
public static final Integer CHANGE_MODE_AUTOMATIC = 1;
/***
* 换电模式 半自动
*/
public static final Integer CHANGE_MODE_AUTOMATIC_SEMI = 2;
/***
* 换电模式 人工干预
*/
public static final Integer CHANGE_MODE_ARTIFICIAL = 3;
/***
* 换电车道 A
*/
public static final Integer CHANGE_LANE_A = 1;
/***
* 换电车道 B
*/
public static final Integer CHANGE_LANE_B = 2;
/***
* 订单类型-充电
*/
public static final Integer ORDER_TYPE_CHARGING = 2;
/***
* 订单类型-换电
*/
public static final Integer ORDER_TYPE_SWAP = 1;
/***
* 支付方式-支付宝支付
*/
public static final String PAY_TYPE_ALI_PAY = "aliPay";
/***
* 支付方式-微信支付
*/
public static final String PAY_TYPE_WECHAT_PAY = "wechatPay";
/***
* 支付方式-余额支付
*/
public static final String PAY_TYPE_BALANCE_PAY = "balancePay";
//
// /***
// * 订单状态-已创建
// */
// public static final Integer ORDER_STATUS_CREATE = 1;
// /***
// * 订单状态-换电中
// */
// public static final Integer ORDER_STATUS_BATTERY_SWAPPING = 2;
// /***
// * 订单状态-换电完成
// */
// public static final Integer ORDER_STATUS_BATTERY_SWAPPING_END = 3;
// /***
// * 订单状态-充电中
// */
// public static final Integer ORDER_STATUS_CHARGING = 4;
// /***
// * 订单状态-充电完成
// */
// public static final Integer ORDER_STATUS_CHARGING_END = 5;
// /***
// * 订单状态-待结算
// */
// public static final Integer ORDER_STATUS_TO_BE_SETTLED = 6;
// /***
// * 订单状态-已完成
// */
// public static final Integer ORDER_STATUS_END = 7;
// /***
// * 订单状态-已取消
// */
// public static final Integer ORDER_STATUS_CLOSE = 9;
// /***
// * 订单状态-退款
// */
// public static final Integer ORDER_STATUS_REFUND = -1;
}
/***
* 大华设备相关CONSTANT
*/
final class DHConstant{
//redis accessToken的key
public static final String DH_ACCESS_TOKEN_KEY = "accessToken";
//redis accessToken的获取时间的key
public static final String DH_ACCESS_TOKEN_TIME_KEY = "accessTokenGetTime";
//redis accessToken的过期时间的key
public static final String DH_ACCESS_TOKEN_EXPIRE_TIME_KEY = "accessTokenExpireTime";
//redis accessToken的过期时间从新获取的临界值, 默认1小时, 秒级
public static final long DH_REACQUIRE_ACCESS_TOKEN_CRITICAL_VALUE = 1*60*60;
public static final String SUCCESS_CODE = "1000";
public static final String LIVE_EXISTS_CODE = "MP130007";
public static final String LIVE_NOT_EXISTS_CODE = "LV1002";
}
/***
* 权限相关CONSTANT
*/
final class PermissionConstant{
/** /**
* 当前登录用户的UID * 当前登录用户的UID
*/ */
@ -141,4 +314,8 @@ public interface HDConstant {
* 预约单失效前缀 * 预约单失效前缀
*/ */
String preOrder="pre_order:"; String preOrder="pre_order:";
/***
* 站控推送策略
*/
String STRATEGY_NAME = "站控推送";
} }

View File

@ -0,0 +1,12 @@
package com.evotech.hd.common.core.dao.cloud;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evotech.hd.common.core.entity.common.AlarmTemplate;
/**
* @author zrb
* @since 2025-02-10
*/
public interface AlarmTemplateDao extends BaseMapper<AlarmTemplate> {
}

View File

@ -16,4 +16,6 @@ import java.util.List;
public interface BatteryStationCdStrategyDao extends BaseMapper<BatteryStationCdStrategy> { public interface BatteryStationCdStrategyDao extends BaseMapper<BatteryStationCdStrategy> {
List<BatteryStationCdStrategy> listCdStrategy(@Param("stationCode") String stationCode, @Param("status") Integer status); List<BatteryStationCdStrategy> listCdStrategy(@Param("stationCode") String stationCode, @Param("status") Integer status);
BatteryStationCdStrategy getBatteryStationCdStrategyByName(@Param("stationCode") String stationCode, @Param("name") String name);
} }

View File

@ -0,0 +1,53 @@
package com.evotech.hd.common.core.dao.cloud;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evotech.hd.common.core.Dto.order.OrderExportVo;
import com.evotech.hd.common.core.entity.cloud.request.PageListSwapOrderRequest;
import com.evotech.hd.common.core.entity.order.Order;
import com.evotech.hd.common.core.Dto.home.*;
import com.evotech.hd.common.core.Dto.request.HomeRequestDto;
import com.evotech.hd.common.core.constant.HDConstant;
import com.evotech.hd.common.core.permission.DataScope;
import com.evotech.hd.common.core.permission.DataScopes;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 接口
*
* @ClassName:OrderMapper
* @date: 2025年05月16日 14:00
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@DataScopes({
@DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE),
@DataScope(permissionObject = HDConstant.COMPANY_ROLE_CODE, permissionScopeName = "plate_num", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_CAR_CODE),
})
//@DataScopeOpenMethod(openMethod = true, methodName = {"homeFindHalfYearAmountData"})
public interface OrderDao extends BaseMapper<Order> {
List<HomeOrderSwapBatteryProportionDto> homeFindProportionData(@Param("params") HomeRequestDto params);
List<HomeOrderSwapBatteryAmountDto> homeFindAmountData(@Param("params") HomeRequestDto params);
//
List<HomeOrderSwapBatteryHalfYearDto> homeFindHalfYearOrderData(@Param("params") HomeRequestDto params);
// @DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, tableAlias = "osb", permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE)
List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearAmountData(@Param("params") HomeRequestDto params);
//因为站端不需要显示金额, 所有重新写一个
List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearStationAmountData(@Param("params") HomeRequestDto params);
Long homeFindOrderCountData(@Param("date") Date date);
Double homeFindOrderAmountData(@Param("date") Date date);
List<HomeOrderInfo> findOrderListByStatus(@Param("status") Integer status);
List<Order> findBillList(@Param("companyCode") String companyCode, @Param("orderTimeEnd")String orderTimeEnd);
List<OrderExportVo> findExportList(PageListSwapOrderRequest plsor);
}

View File

@ -0,0 +1,16 @@
package com.evotech.hd.common.core.dao.cloud;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evotech.hd.common.core.entity.order.OrderDetail;
/**
* 接口
*
* @ClassName:OrderDetailDap
* @date: 2025年05月17日 11:09
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public interface OrderDetailDao extends BaseMapper<OrderDetail> {
}

View File

@ -14,6 +14,24 @@ import com.evotech.hd.common.core.permission.DataScopes;
@DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE), @DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE),
@DataScope(permissionObject = HDConstant.COMPANY_ROLE_CODE, permissionScopeName = "plate_num", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_CAR_CODE), @DataScope(permissionObject = HDConstant.COMPANY_ROLE_CODE, permissionScopeName = "plate_num", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_CAR_CODE),
}) })
//@DataScopeOpenMethod(openMethod = true, methodName = {"homeFindHalfYearAmountData"})
public interface OrderSwapBatteryDao extends BaseMapper<OrderSwapBattery> { public interface OrderSwapBatteryDao extends BaseMapper<OrderSwapBattery> {
//
// List<HomeOrderSwapBatteryProportionDto> homeFindProportionData(@Param("params") HomeRequestDto params);
//
// List<HomeOrderSwapBatteryAmountDto> homeFindAmountData(@Param("params") HomeRequestDto params);
//
// List<HomeOrderSwapBatteryHalfYearDto> homeFindHalfYearOrderData(@Param("params") HomeRequestDto params);
// @DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, tableAlias = "osb", permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE)
// List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearAmountData(@Param("params") HomeRequestDto params);
//因为站端不需要显示金额, 所有重新写一个
// List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearStationAmountData(@Param("params") HomeRequestDto params);
//
// Long homeFindOrderCountData(@Param("date") Date date);
//
// Double homeFindOrderAmountData(@Param("date") Date date);
//
// List<HomeOrderInfo> findOrderListByStatus(@Param("status") Integer status);
} }

View File

@ -0,0 +1,16 @@
package com.evotech.hd.common.core.dao.cloud;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evotech.hd.common.core.entity.system.SysParam;
/**
* 接口
*
* @ClassName:SysParamDao
* @date: 2025年07月02日 14:32
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public interface SysParamDao extends BaseMapper<SysParam> {
}

View File

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evotech.hd.common.core.constant.HDConstant; import com.evotech.hd.common.core.constant.HDConstant;
import com.evotech.hd.common.core.entity.resource.auth.AuthUser; import com.evotech.hd.common.core.entity.resource.auth.AuthUser;
import com.evotech.hd.common.core.permission.DataScope; import com.evotech.hd.common.core.permission.DataScope;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author zrb * @author zrb
@ -12,4 +15,6 @@ import com.evotech.hd.common.core.permission.DataScope;
@DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "creater", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_AUTH_USER_UID) @DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "creater", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_AUTH_USER_UID)
public interface AuthUserDao extends BaseMapper<AuthUser> { public interface AuthUserDao extends BaseMapper<AuthUser> {
List<String> findWuIdByStationCodeAndProxyCode(@Param("stationCode") String stationCode, @Param("proxyCode") String proxyCode);
} }

View File

@ -1,7 +1,9 @@
package com.evotech.hd.common.core.dao.resource.auth; package com.evotech.hd.common.core.dao.resource.auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evotech.hd.common.core.constant.HDConstant;
import com.evotech.hd.common.core.entity.resource.auth.AuthUserStation; import com.evotech.hd.common.core.entity.resource.auth.AuthUserStation;
import com.evotech.hd.common.core.permission.DataScope;
/** /**
* @desc: 用户和充电站的关联 * @desc: 用户和充电站的关联
@ -11,5 +13,7 @@ import com.evotech.hd.common.core.entity.resource.auth.AuthUserStation;
* @contact: 17330188597 * @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步 * @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/ */
@DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE)
public interface AuthUserStationDao extends BaseMapper<AuthUserStation> { public interface AuthUserStationDao extends BaseMapper<AuthUserStation> {
} }

View File

@ -2,18 +2,12 @@ package com.evotech.hd.common.core.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.Min;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
@ -23,25 +17,16 @@ import java.util.Date;
*/ */
@Data @Data
@Schema(name = "BaseEntity", description = "基础实体类") @Schema(name = "BaseEntity", description = "基础实体类")
public class BaseEntity implements Serializable { public class BaseEntity extends IdEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "pk_id", type = IdType.AUTO)
@Hidden
private Integer pkId;
@Schema(description = "创建人", hidden = true) @Schema(description = "创建人", hidden = true)
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private String creater; private String creater;
@Schema(description = "创建时间", hidden = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@TableField(fill = FieldFill.INSERT)
private Date ctime;
@Schema(description = "更新人", hidden = true) @Schema(description = "更新人", hidden = true)
@TableField(fill = FieldFill.UPDATE) @TableField(fill = FieldFill.UPDATE)
private String updater; private String updater;
@ -52,4 +37,10 @@ public class BaseEntity implements Serializable {
@TableField(fill = FieldFill.UPDATE) @TableField(fill = FieldFill.UPDATE)
private Date uptime; private Date uptime;
public BaseEntity() {
}
public BaseEntity(Integer pkId) {
super(pkId);
}
} }

View File

@ -0,0 +1,46 @@
package com.evotech.hd.common.core.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* @ClassName:IdEntity
* @date: 2025年05月16日 11:08
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class IdEntity implements Serializable {
@TableId(value = "pk_id", type = IdType.AUTO)
@Hidden
private Integer pkId;
@Schema(description = "创建时间", hidden = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@TableField(fill = FieldFill.INSERT)
private Date ctime;
public IdEntity() {
}
public IdEntity(Integer pkId) {
this.pkId = pkId;
}
}

View File

@ -1,164 +1,171 @@
package com.evotech.hd.common.core.entity; //package com.evotech.hd.common.core.entity;
//
import java.io.Serializable; //import java.io.Serializable;
//
import com.evotech.hd.common.core.enums.CodeMsg; //import com.evotech.hd.common.core.enums.CodeMsg;
//
import io.swagger.v3.oas.annotations.media.Schema; //import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; //import lombok.Data;
//
/** ///**
* @author zrb // * @author zrb
* @date 2024年9月2日17:25:54 // * @date 2024年9月2日17:25:54
*/ // */
@Data //@Data
@Schema(name = "请求返回对象") //@Schema(name = "请求返回对象")
public class Result<T> implements Serializable { //public class Result<T> implements Serializable {
//
private static final long serialVersionUID = -7806513009135956518L; // private static final long serialVersionUID = -7806513009135956518L;
//
@Schema(description = "请求处理状态", example = "1") // @Schema(description = "请求处理状态", example = "1")
private Integer status; // private Integer status;
@Schema(description = "状态码", example = "1000") // @Schema(description = "状态码", example = "1000")
private String code; // private String code;
@Schema(description = "返回消息") // @Schema(description = "返回消息")
private String msg; // private String msg;
@Schema(description = "返回数据") // @Schema(description = "返回数据")
private Object data; // private Object data;
//
private T obj; // private T obj;
//
//
public Result(Integer status, String code, String msg, Object data) { // public Result(Integer status, String code, String msg, Object data) {
this.status = status; // this.status = status;
this.code = code; // this.code = code;
this.msg = msg; // this.msg = msg;
this.data = data; // this.data = data;
} // }
//
public Result(Integer status, String msg, Object data) { // public Result(Integer status, String msg, Object data) {
this.status = status; // this.status = status;
this.msg = msg; // this.msg = msg;
this.data = data; // this.data = data;
} // }
//
public Result(Integer status) { // public Result(Integer status) {
this.status = status; // this.status = status;
} // }
//
public Result() { // public Result() {
} // }
//
public Result(Integer status, String code, String msg) { // public Result(Integer status, String code, String msg) {
this.status = status; // this.status = status;
this.code = code; // this.code = code;
this.msg = msg; // this.msg = msg;
} // }
//
public Result(Integer status, String msg) { // public Result(Integer status, String msg) {
this.status = status; // this.status = status;
this.msg = msg; // this.msg = msg;
} // }
//
public Result<T> success(Object o) { // public Result<T> success() {
this.status = 1; // this.status = 1;
this.code = CodeMsg.SUCCESS.getCode(); // this.code = CodeMsg.SUCCESS.getCode();
this.msg = CodeMsg.SUCCESS.getMsg(); // this.msg = CodeMsg.SUCCESS.getMsg();
this.data = o; // return this;
return this; // }
} //
// public Result<T> success(Object o) {
public Result<T> success(String msg, Object o) { // this.status = 1;
this.status = 1; // this.code = CodeMsg.SUCCESS.getCode();
this.code = CodeMsg.SUCCESS.getCode(); // this.msg = CodeMsg.SUCCESS.getMsg();
this.msg = msg; // this.data = o;
this.data = o; // return this;
return this; // }
} //
// public Result<T> success(String msg, Object o) {
public Result<T> success(String msg) { // this.status = 1;
this.status = 1; // this.code = CodeMsg.SUCCESS.getCode();
this.code = CodeMsg.SUCCESS.getCode(); // this.msg = msg;
this.msg = msg; // this.data = o;
this.data = CodeMsg.SUCCESS.getMsg(); // return this;
return this; // }
} //
// public Result<T> success(String msg) {
public Result<T> success(String code, String msg, Object o) { // this.status = 1;
this.status = 1; // this.code = CodeMsg.SUCCESS.getCode();
this.code = code; // this.msg = msg;
this.msg = msg; // this.data = CodeMsg.SUCCESS.getMsg();
this.data = o; // return this;
return this; // }
} //
// public Result<T> success(String code, String msg, Object o) {
public Result<T> success(CodeMsg cm, Object o) { // this.status = 1;
this.status = 0; // this.code = code;
this.code = cm.getCode(); // this.msg = msg;
this.msg = cm.getMsg(); // this.data = o;
this.data = o; // return this;
return this; // }
} //
// public Result<T> success(CodeMsg cm, Object o) {
public Result<T> error(String msg) { // this.status = 0;
this.status = 0; // this.code = cm.getCode();
this.code = CodeMsg.ERROR.getCode(); // this.msg = cm.getMsg();
this.msg = msg; // this.data = o;
this.data = "ERROR"; // return this;
return this; // }
} //
// public Result<T> error(String msg) {
public Result<T> error(String code, String msg) { // this.status = 0;
this.status = 0; // this.code = CodeMsg.ERROR.getCode();
this.code = code; // this.msg = msg;
this.msg = msg; // this.data = "ERROR";
this.data = "ERROR"; // return this;
return this; // }
} //
// public Result<T> error(String code, String msg) {
public Result<T> error(CodeMsg cm) { // this.status = 0;
this.status = 0; // this.code = code;
this.code = cm.getCode(); // this.msg = msg;
this.msg = cm.getMsg(); // this.data = "ERROR";
return this; // return this;
} // }
//
public Result<T> error(CodeMsg cm, Object o) { // public Result<T> error(CodeMsg cm) {
return error(cm.getCode(), cm.getMsg(), o); // this.status = 0;
} // this.code = cm.getCode();
// this.msg = cm.getMsg();
public Result<T> error(String code, String msg, Object o) { // return this;
this.status = 0; // }
this.code = code; //
this.msg = msg; // public Result<T> error(CodeMsg cm, Object o) {
this.data = o; // return error(cm.getCode(), cm.getMsg(), o);
return this; // }
} //
// public Result<T> error(String code, String msg, Object o) {
public Result<T> error(String msg, Object o) { // this.status = 0;
this.status = 0; // this.code = code;
this.code = CodeMsg.ERROR.getCode(); // this.msg = msg;
this.msg = msg; // this.data = o;
this.data = o; // return this;
return this; // }
} //
// public Result<T> error(String msg, Object o) {
// this.status = 0;
public Result<T> exception(Object data) { // this.code = CodeMsg.ERROR.getCode();
this.status = -1; // this.msg = msg;
this.code = CodeMsg.ERROR.getCode(); // this.data = o;
this.msg = CodeMsg.ERROR.getMsg(); // return this;
this.data = data==null?"未知异常":data; // }
return this; //
} //
// public Result<T> exception(Object data) {
// this.status = -1;
public Result<T> bussinessException(String code, String msg, Object o) { // this.code = CodeMsg.ERROR.getCode();
this.status = -1; // this.msg = CodeMsg.ERROR.getMsg();
this.code = code; // this.data = data==null?"未知异常":data;
this.msg = msg; // return this;
this.data = o; // }
return this; //
} //
// public Result<T> bussinessException(String code, String msg, Object o) {
} // this.status = -1;
// this.code = code;
// this.msg = msg;
// this.data = o;
// return this;
// }
//
//}

View File

@ -1,28 +1,22 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/** /**
* @author zrb * @author zrb
* @since 2024-10-15 * @since 2024-10-15
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
@TableName("hd_cloud_manage.yt_t_battery_station") @TableName("hd_cloud_manage.yt_t_battery_station")
@Schema(name = "BatteryStation", description = "换电站") @Schema(name = "BatteryStation", description = "换电站")
@ -33,6 +27,11 @@ public class BatteryStation extends BaseEntity implements Serializable {
@Schema(description = "归属运营商ID", requiredMode = RequiredMode.REQUIRED) @Schema(description = "归属运营商ID", requiredMode = RequiredMode.REQUIRED)
@NotBlank(message = "无关联运营商信息") @NotBlank(message = "无关联运营商信息")
private String proxyId; private String proxyId;
@Schema(description = "运营商名称", requiredMode = RequiredMode.REQUIRED)
@TableField(exist = false)
private String poname;
@Schema(description = "站点名称", requiredMode = RequiredMode.REQUIRED) @Schema(description = "站点名称", requiredMode = RequiredMode.REQUIRED)
@NotBlank(message = "站点名称不能为空") @NotBlank(message = "站点名称不能为空")
@ -63,6 +62,10 @@ public class BatteryStation extends BaseEntity implements Serializable {
@Schema(description = "地址-区县") @Schema(description = "地址-区县")
private String addressArea; private String addressArea;
@Schema(description = "区划编码", requiredMode = RequiredMode.REQUIRED)
@NotBlank(message = "区划编码不能为空")
private String divisionNo;
@Schema(description = "注册日期") @Schema(description = "注册日期")
private String registerDate; private String registerDate;
@ -132,4 +135,12 @@ public class BatteryStation extends BaseEntity implements Serializable {
@Schema(description = "营业止时间") @Schema(description = "营业止时间")
private String runEndTime; private String runEndTime;
@Schema(description = "场地id--DH")
private String storeId;
@Schema(description = "场地Code--DH")
private String orgCode;
@Schema(description = "告警状态", hidden = true)
private Boolean alarm;
} }

View File

@ -1,22 +1,16 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/** /**
* @author zrb * @author zrb
* @since 2025-02-10 * @since 2025-02-10
@ -50,4 +44,18 @@ public class BatteryStationCdStrategyDetail extends BaseEntity implements Serial
@Schema(description = "充电功率") @Schema(description = "充电功率")
private Double chargingPower; private Double chargingPower;
/***
* 数据状态, 1正常, 2修改, 3删除
*/
@TableField(exist = false)
private Integer dataType = 1;
public BatteryStationCdStrategyDetail() {
}
public BatteryStationCdStrategyDetail(Integer pkId, Integer dataType) {
super(pkId);
this.dataType = dataType;
}
} }

View File

@ -1,16 +1,7 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
@ -18,6 +9,8 @@ import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.io.Serializable;
/** /**
* @author zrb * @author zrb
* @since 2024-10-17 * @since 2024-10-17
@ -54,11 +47,16 @@ public class BatteryStationDc extends BaseEntity implements Serializable {
@Schema(description = "站码或车牌照", requiredMode = RequiredMode.REQUIRED) @Schema(description = "站码或车牌照", requiredMode = RequiredMode.REQUIRED)
@NotBlank @NotBlank
private String sourceCode; private String sourceCode;
/***
* 具体参考 HDConstant.DcConstant.STATUS_*
*/
@Schema(description = "状态1-出租中2-充电中3-空闲4-故障5-其它", requiredMode = RequiredMode.REQUIRED) @Schema(description = "状态1-出租中2-充电中3-空闲4-故障5-其它", requiredMode = RequiredMode.REQUIRED)
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
private Integer status; private Integer status;
/***
* 具体参考 HDConstant.DcConstant.POINT_TYPE_*
*/
@Schema(description = "轨迹点类型1-电站2-车辆") @Schema(description = "轨迹点类型1-电站2-车辆")
private Integer pointType; private Integer pointType;
@ -72,7 +70,7 @@ public class BatteryStationDc extends BaseEntity implements Serializable {
private Integer soc; private Integer soc;
@Schema(description = "电池仓位号") @Schema(description = "电池仓位号")
private Integer dccNo; private String dccNo;
@Schema(description = "删除标志1-已删除0-未删除", hidden = true) @Schema(description = "删除标志1-已删除0-未删除", hidden = true)
private Integer delFlag; private Integer delFlag;

View File

@ -1,27 +1,19 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType; import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.hutool.core.date.DatePattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/** /**
* @author zrb * @author zrb
* @since 2024-10-17 * @since 2024-10-17
@ -44,6 +36,9 @@ public class BatteryStationHdFeeStandard extends BaseEntity implements Serializa
@Schema(description = "换电站编码") @Schema(description = "换电站编码")
private String stationName; private String stationName;
@Schema(description = "基本服务费")
private BigDecimal serviceFee;
@Schema(description = "开始日期", requiredMode = RequiredMode.REQUIRED, example = DatePattern.PURE_DATE_PATTERN) @Schema(description = "开始日期", requiredMode = RequiredMode.REQUIRED, example = DatePattern.PURE_DATE_PATTERN)
@NotBlank(message = "开始时间不能为空") @NotBlank(message = "开始时间不能为空")
private String dayBegin; private String dayBegin;
@ -61,6 +56,9 @@ public class BatteryStationHdFeeStandard extends BaseEntity implements Serializa
@Schema(description = "每度电收费") @Schema(description = "每度电收费")
private BigDecimal eachKwhFee; private BigDecimal eachKwhFee;
@Schema(description = "正常换电服务费") @Schema(description = "正常换电服务费")
private BigDecimal commonRemainFee; private BigDecimal commonRemainFee;

View File

@ -1,26 +1,19 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType; import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.hutool.core.date.DatePattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalTime;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalTime;
/** /**
* @author zrb * @author zrb
@ -42,6 +35,9 @@ public class BatteryStationHdFeeStandardDetail extends BaseEntity implements Ser
@NotNull @NotNull
private Integer standardId; private Integer standardId;
@Schema(description = "服务费")
private BigDecimal serviceFee;
@Schema(description = "每公里收费") @Schema(description = "每公里收费")
private BigDecimal eachKmFee; private BigDecimal eachKmFee;
@ -61,6 +57,5 @@ public class BatteryStationHdFeeStandardDetail extends BaseEntity implements Ser
@DateTimeFormat(pattern = DatePattern.NORM_TIME_PATTERN) @DateTimeFormat(pattern = DatePattern.NORM_TIME_PATTERN)
private LocalTime timeEnd; private LocalTime timeEnd;
@Schema(description = "谷段服务费")
private BigDecimal timeServiceFee;
} }

View File

@ -0,0 +1,97 @@
package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 分账表
* @ClassName:IndependentAccount
* @date: 2025年04月22日 11:46
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@TableName(value = "yt_t_independent_account", schema = "hd_cloud_manage")
public class IndependentAccount {
@TableId(value = "pk_id", type = IdType.AUTO)
@Hidden
private Integer pkId;
/***
* 运营商id
*/
private Integer proxyId;
/***
* 运营商Code
*/
private String proxyCode;
/***
* 运营商名称
*/
private String proxyName;
/***
* 订单数量
*/
private Integer orderCount;
/***
* 分账总金额
*/
private Double accountTotalAmount;
/***
* 应分金额
*/
private Double orderTotalAmount;
/***
* 税点金额()
*/
private Double taxPointTotalAmount;
/***
* 手续费
* 当前商户承担的手续费
* 应分金额/提现总额*总手续费=当前商户承担手续费
*/
private Double handlingFee;
/***
* 手续费
* 当前操作产生的所有手续费
*/
private Double totalHandlingFee;
/***
* 实分金额
*/
private Double totalAmount;
/***
* 分账开始时间
*/
private Date independentAccountBegin;
/***
* 分账结束时间
*/
private Date independentAccountEnd;
/***
* 分账状态 0待分账. 1已分账
*/
private Integer status;
/***
* 分账人uid
*/
private String creater;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@TableField(fill = FieldFill.INSERT)
private Date ctime;
}

View File

@ -0,0 +1,58 @@
package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 分账详情表
* @ClassName:IndependentAccountDetail
* @date: 2025年04月22日 11:58
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@TableName(value = "yt_t_independent_account_detail", schema = "hd_cloud_manage")
public class IndependentAccountDetail {
@TableId(value = "pk_id", type = IdType.AUTO)
@Hidden
private Integer pkId;
/***
* 分账表id
*/
private Integer independentAccountId;
/***
* 订单Id
*/
private Integer orderId;
/***
* 订单号
*/
private String orderNo;
/***
* 订单金额
*/
private Double orderAmount;
/***
* 税点Id
*/
private Integer taxPointId;
/***
* 税点金额
*/
private Double taxPointAmount;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@TableField(fill = FieldFill.INSERT)
private Date ctime;
}

View File

@ -1,55 +0,0 @@
package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
* @author zrb
* @since 2024-11-22
*/
@Getter
@Setter
@TableName("hd_cloud_manage.yt_t_order_recharge")
@Schema(name = "充值订单")
public class OrderRecharge extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "订单时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date orderTime;
@Schema(description = "订单编码", hidden = true)
private String orderNo;
@Schema(description = "换电站编码")
private String stationCode;
@Schema(description = "换电站名称")
private String stationName;
@Schema(description = "钱包账户账号")
private String accountCode;
@Schema(description = "充值账号ID")
private String userId;
@Schema(description = "交易编码")
private String tradeNo;
@Schema(description = "删除状态1-已删除0-未删除", hidden = true)
private Integer delFlag;
}

View File

@ -1,23 +1,19 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/** /**
* @author zrb * @author zrb
@ -72,7 +68,7 @@ public class OrderSwapBattery extends BaseEntity implements Serializable {
@Schema(description = "订单金额") @Schema(description = "订单金额")
private Integer amount; private Integer amount;
@Schema(description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消") @Schema(description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消, -1-退款")
private Integer status; private Integer status;
@Schema(description = "计算费用方式1-ODO2-SOC3-按电量") @Schema(description = "计算费用方式1-ODO2-SOC3-按电量")
@ -96,6 +92,9 @@ public class OrderSwapBattery extends BaseEntity implements Serializable {
@Schema(description = "费用标准") @Schema(description = "费用标准")
private String feeStandardJson; private String feeStandardJson;
@Schema(description = "费用标准详情")
@TableField(exist = false)
private BatteryStationHdFeeStandard feeStandardDetail;
@Schema(description = "上次租赁电池时车辆里程") @Schema(description = "上次租赁电池时车辆里程")
private BigDecimal lastRentBatCarOdo; private BigDecimal lastRentBatCarOdo;

View File

@ -1,21 +1,17 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/** /**
* @author zrb * @author zrb
@ -35,7 +31,7 @@ public class OrderSwapBatteryPre extends BaseEntity implements Serializable {
@Schema(description = "来源是站端时记录发送Id其他来源不需要", hidden = true) @Schema(description = "来源是站端时记录发送Id其他来源不需要", hidden = true)
private String sourceId; private String sourceId;
@Schema(description = "预约人编码", requiredMode = RequiredMode.REQUIRED) @Schema(description = "预约人的微信Id", requiredMode = RequiredMode.REQUIRED)
private String ucode; private String ucode;
@Schema(description = "预约人姓名", requiredMode = RequiredMode.REQUIRED) @Schema(description = "预约人姓名", requiredMode = RequiredMode.REQUIRED)

View File

@ -1,19 +1,15 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType; import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/** /**
* @author zrb * @author zrb
* @since 2024-12-11 * @since 2024-12-11
@ -35,6 +31,7 @@ public class OrderSwapBatteryStep extends BaseEntity implements Serializable {
private String stepName; private String stepName;
@Schema(description = "步骤时间") @Schema(description = "步骤时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date stepTime; private Date stepTime;
} }

View File

@ -0,0 +1,52 @@
package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 税点表
* @ClassName:TaxPoint
* @date: 2025年04月22日 11:28
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@TableName(value = "yt_t_tax_point", schema = "hd_cloud_manage")
public class TaxPoint {
@TableId(value = "pk_id", type = IdType.AUTO)
@Hidden
private Integer pkId;
/***
* 税点金额
*/
private Double taxPoint;
/***
* 税点金额, 具体参考 数据字典TAX_POINT
*/
private String taxPointRatio;
/***
* 订单id
*/
private Integer orderId;
/***
* 订单号
*/
private String orderNo;
/***
* 订单金额
*/
private Double orderAmount;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@TableField(fill = FieldFill.INSERT)
private Date ctime;
}

View File

@ -1,19 +1,15 @@
package com.evotech.hd.common.core.entity.cloud; package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/** /**
* @author zrb * @author zrb
* @since 2024-11-22 * @since 2024-11-22
@ -28,38 +24,34 @@ public class TradeDetail extends BaseEntity implements Serializable {
@Schema(description = "换电站编码") @Schema(description = "换电站编码")
private String stationCode; private String stationCode;
@Schema(description = "交易人") @Schema(description = "交易人微信Id")
private String plateCompanyCode;
@Schema(description = "交易人name")
private String trader; private String trader;
@Schema(description = "交易人编码") @Schema(description = "交易人微信Id")
private String traderCode; private String traderCode;
@Schema(description = "交易类型1-充值2-订单消费3-提现")
private Integer tradeType;
@Schema(description = "变动金额的钱包账户,钱包金额不变时不需要")
private String wallet;
@Schema(description = "appid")
private String appid;
@Schema(description = "银行类型")
private String bankType;
@Schema(description = "收款商户号")
private String mchid;
@Schema(description = "微信支付API类型")
private String wechatPayApiType;
@Schema(description = "订单总描述")
private String description;
@Schema(description = "交易编码") @Schema(description = "交易编码")
private String outTradeNo; private String outTradeNo;
@Schema(description = "支付方式1-账户余额2-微信3-支付宝4-网银5 -充电补偿") @Schema(description = "交易类型1-充值2-订单消费3-退款, 9-提现")
private Integer tradeType;
@Schema(description = "支付方式1-账户余额2-微信3-支付宝4-网银5 -充电补偿, 6-公对公转账")
private Integer payType; private Integer payType;
@Schema(description = "微信支付API类型")
private String wechatPayApiType;
/***
* 交易信息
*/
private String tradeMessage;
/***
* 交易账号
*/
// @Schema(description = "变动金额的钱包账户,钱包金额不变时不需要")
private String payAccount;
@Schema(description = "订单数量") @Schema(description = "订单数量")
private Integer orderCount; private Integer orderCount;
@ -79,14 +71,11 @@ public class TradeDetail extends BaseEntity implements Serializable {
@Schema(description = "微信支付订单号") @Schema(description = "微信支付订单号")
private String transactionId; private String transactionId;
@Schema(description = "支付结果,暂用微信结果的枚举类型") @Schema(description = "支付结果,暂用微信结果的枚举类型, 新增 paymentInProgress 结算中类型")
private String payResult; private String payResult;
@Schema(description = "在微信等支付网关创建支付订单时失败,返回的失败原因")
private String payMsg;
@Schema(description = "付款人编码,对于个人账户,交易发起人和付款人一般是同一人。公司账户交易发起人是公司,付款人可能是 微信账户") @Schema(description = "付款人编码,对于个人账户,交易发起人和付款人一般是同一人。公司账户交易发起人是公司,付款人可能是 微信账户")
private String payer; private String payWechatId;
@Schema(description = "支付完成时间") @Schema(description = "支付完成时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ -96,12 +85,33 @@ public class TradeDetail extends BaseEntity implements Serializable {
@Schema(description = "删除标识1-已删除0-未删除", hidden = true) @Schema(description = "删除标识1-已删除0-未删除", hidden = true)
private Integer delFlag; private Integer delFlag;
@Schema(description = "退款结果: 0-未退款, 1-退款中2-已退款, 3-退款失败") @Schema(description = "appid")
private Integer refundResult; private String appid;
//
@Schema(description = "银行类型")
private String bankType;
@Schema(description = "在微信等退款网关创建退款订单时失败,返回的失败原因") @Schema(description = "收款商户号")
private String refundMsg; private String mchid;
@Schema(description = "退款返回数据") @Schema(description = "订单总描述")
private String refundReturn; private String description;
@Schema(description = "状态: edit-编辑中, submit-提交. finish-完成, reject-打回")
private String status;
// @Schema(description = "在微信等支付网关创建支付订单时失败,返回的失败原因")
// private String payMsg;
// @Schema(description = "退款结果: 0-未退款, 1-退款中2-已退款, 3-退款失败")
// private Integer refundResult;
//
// @Schema(description = "在微信等退款网关创建退款订单时失败,返回的失败原因")
// private String refundMsg;
//
// @Schema(description = "退款返回数据")
// private String refundReturn;
} }

View File

@ -1,15 +1,13 @@
package com.evotech.hd.common.core.entity.cloud.request; package com.evotech.hd.common.core.entity.cloud.request;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.evotech.hd.common.core.entity.BasePageRequest; import com.evotech.hd.common.core.entity.BasePageRequest;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data @Data
@ -55,6 +53,9 @@ public class PageListSwapOrderRequest extends BasePageRequest {
@Schema(description = "公司编码") @Schema(description = "公司编码")
private String ccode; private String ccode;
@Schema(description = "运营商code")
private String proCode;

View File

@ -19,10 +19,16 @@ public class PageListWalletRequest extends BasePageRequest {
@Schema(description = "户主ID") @Schema(description = "户主ID")
private String ownerId; private String ownerId;
@Schema(description = "用户名")
private String accName;
@Schema(description = "编码") @Schema(description = "编码")
private String code; private String code;
@Schema(description = "引入站点") @Schema(description = "引入站点")
private String stationCode; private String stationCode;
@Schema(description = "客户电话")
private String phone;
} }

View File

@ -0,0 +1,39 @@
package com.evotech.hd.common.core.entity.cloud.request;
import com.evotech.hd.common.core.entity.BasePageRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@Schema(name = "查询资金账户请求参数", hidden = true)
@EqualsAndHashCode(callSuper=false)
public class PrePayRequest extends BasePageRequest {
@Schema(description = "用户编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank
private String wuid;
@Schema(description = "支付金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull
@Min(1)
@Max(100000000)
private Integer total;
@Schema(description = "商户订单号")
private String outTradeNo;
@Schema(description = "微信支付订单号")
private String transactionId;
@Schema(description = "退款原因")
private String reason;
@Schema(description = "金额")
private Integer money;
@Schema(description = "支付方式")
private Integer payType;
@Schema(description = "交易类型")
private Integer tradeType;
}

View File

@ -0,0 +1,158 @@
package com.evotech.hd.common.core.entity.cloud.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.evotech.hd.common.core.entity.cloud.BatteryStationHdFeeStandard;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
* @ClassName:OrderVo
* @date: 2025年06月20日 16:08
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class OrderVo {
private static final long serialVersionUID = 1L;
@Schema(description = "预约订单ID")
private Integer orderPreId;
@Schema(description = "预约用户")
private String orderPreUid;
@Schema(description = "预约用户名称")
private String orderPreUname;
@Schema(description = "预约用户手机")
private String orderPrePhone;
@NotNull(message = "订单类型不能为空")
private Integer orderType;
@Schema(description = "订单编码", hidden = true)
private String orderNo;
@NotBlank(message = "车牌号不能为空")
private String plateNum;
@Schema(description = "订单时间", example = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date orderTime;
@NotBlank(message = "换电站编码不能为空")
private String stationCode;
@NotBlank(message = "换电站名称不能为空")
private String stationName;
@Schema(description = "金额账号")
private String accountCode;
@Schema(description = "订单金额")
private Integer amount;
@Schema(description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消, -1-退款")
private Integer status;
@Schema(description = "计算费用方式1-ODO2-SOC3-按电量")
private Integer feeType;
@Schema(description = "基础费用")
private BigDecimal basicFee;
@Schema(description = "服务开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date serviceTimeBegin;
@Schema(description = "服务结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date serviceTimeEnd;
@Schema(description = "服务费")
private BigDecimal serviceFee;
@Schema(description = "费用标准")
private String feeStandardJson;
@Schema(description = "费用标准详情")
@TableField(exist = false)
private BatteryStationHdFeeStandard feeStandardDetail;
@Schema(description = "上次租赁电池时车辆里程")
private BigDecimal lastRentBatCarOdo;
@Schema(description = "归还电池时车辆里程")
private BigDecimal nowReturnBatCarOdo;
@Schema(description = "按ODO换电费")
private BigDecimal odoAmount;
@Schema(description = "充电开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date chargeTimeBegin;
@Schema(description = "充电结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date chargeTimeEnd;
@Schema(description = "总充电量")
private BigDecimal electAmount;
@Schema(description = "租借电池包仓位")
private Integer rentBatNo;
@Schema(description = "租用电池包编码")
private String rentBatCode;
@Schema(description = "租用电池包SOC")
private Integer rentBatSoc;
@Schema(description = "归还电池包编码")
private String returnBatCode;
@Schema(description = "归还电池包仓位")
private Integer returnBatNo;
@Schema(description = "归还电池包SOC")
private Integer returnBatSoc;
@Schema(description = "归还电池租出时soc")
private Integer returnBatRentSoc;
@Schema(description = "归还电池租出的换电站编码")
private String returnBatRentStationCode;
@Schema(description = "归还电池租出的换电站")
private String returnBatRentStationName;
@Schema(description = "换电模式1-全自动2-半自动3-人工干预 ")
private Integer changeMode;
@Schema(description = "换电车道 1-A 车道;2-B 车道")
private Integer changeLane;
@Schema(description = "删除状态1-已删除0-未删除", hidden = true)
private Integer delFlag;
@Schema(description = "交易编码", hidden = true)
private String tradeNo;
@Schema(description = "备注信息")
private String remark;
}

View File

@ -0,0 +1,64 @@
package com.evotech.hd.common.core.entity.cloud.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@Schema(name = "账户列表返回结果")
public class WalletAccountVO {
@Schema(hidden = true)
private Integer pkId;
@Schema(description = "户主类型1-个人2-企业", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "类型不能为空")
private Integer ownerType;
@Schema(description = "户主ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "用户编码不能为空")
private String ownerId;
@Schema(description = "名称")
private String accName;
@Schema(description = "手机号")
private String phone;
@Schema(description = "编码", hidden = true)
private String code;
@Schema(description = "账户总金额,分:总金额=充值金额+赠送金额")
private Integer totalAmount;
@Schema(description = "充值余额,分")
private Integer rechargeAmount;
@Schema(description = "赠送金额,分")
private Integer giftAmount;
@Schema(description = "积分余额")
private Integer point;
@Schema(description = "押金")
private Integer deposit;
@Schema(description = "SN码")
private String snCode;
@Schema(description = "租金")
private Integer rent;
@Schema(description = "状态")
private Integer status;
@Schema(description = "引入站点")
private String stationCode;
@Schema(description = "创建人")
private String creater;
}

View File

@ -0,0 +1,40 @@
package com.evotech.hd.common.core.entity.common;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* AlarmTemplate
*
* @author andy.shi
* @ClassName:AlarmTemplate
* @date: 2025年10月28日 15:01
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "sys_alarm_template", schema = "hd_cloud_manage")
@Schema(name = "AlarmTemplate", description = "异常通知")
public class AlarmTemplate extends BaseEntity implements Serializable {
@Schema(description = "路径", requiredMode = Schema.RequiredMode.REQUIRED)
String path;
@Schema(description = "通知人员", requiredMode = Schema.RequiredMode.REQUIRED)
String recipientIds;
//通知人员姓名
@TableField(exist = false)
String recipientNames;
@TableField(exist = false)
String area;
@TableField(exist = false)
String message;
}

View File

@ -0,0 +1,63 @@
package com.evotech.hd.common.core.entity.order;
import com.evotech.hd.common.core.entity.IdEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*
* @ClassName:BaseOrder
* @date: 2025年05月16日 11:11
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
public class BaseOrder extends IdEntity {
/***
* 订单编码
*/
private String orderNo;
/***
* 订单金额
*/
private Integer orderAmount;
/***
* 订单状态, 具体参考 OrderStatusEnums //HDConstant.OrderConstant.ORDER_STATUS_*
*/
private Integer status;
/***
* 支付方式 具体参考 HDConstant.OrderConstant.PAY_TYPE_*
*/
private String payType;
/***
* 支付时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date payTime;
/***
* 支付人的微信ID
*/
private String payWechatId;
/***
* 第三方返回的唯一订单标识
*/
private String notifyOrderNo;
/***
* 支付的回调信息
*/
private String notifyInfo;
/***
* 交易编码
*/
private String tradeNo;
}

View File

@ -0,0 +1,80 @@
package com.evotech.hd.common.core.entity.order;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*
* @ClassName:SwapOrder
* @date: 2025年05月16日 11:29
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "yt_t_order", schema = "hd_cloud_manage")
public class Order extends BaseOrder{
private Integer orderPreId;
/***
* 预约用户的微信ID
*/
private String preWechatId;
/***
* 预约用户名称
*/
private String orderPreUname;
/***
* 订单类型, 具体参考 HDConstant.OrderConstant.ORDER_TYPE_*
*/
private Integer orderType;
/***
* 车牌号
*/
private String plateNum;
/***
* 下单时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date orderTime;
/***
* '换电站编码'
*/
private String stationCode;
/***
* ''换电站名称''
*/
private String stationName;
/***
* 订单状态, 具体参考 HDConstant.DELETE_*
*/
private Integer delFlag;
/***
* 备注信息
*/
private String remark;
/***
* 变更时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
@TableField(exist = false)
private OrderDetail orderDetail;
}

View File

@ -0,0 +1,108 @@
package com.evotech.hd.common.core.entity.order;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @ClassName:OrderDetail
* @date: 2025年05月17日 9:10
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@TableName(value = "yt_t_order_detail", schema = "hd_cloud_manage")
@EqualsAndHashCode(callSuper=false)
public class OrderDetail extends IdEntity {
private Integer orderId;
/***
* 计费类型, 具体参考 HDConstant.OrderConstant.FEE_TYPE_*
*/
private Integer feeType;
/***
* 订单金额 (此金额是当前订单的金额, 不包含基础服务费, 所以不是订单总额)
*/
private Integer orderFee;
/***
* 服务费
*/
private Integer serviceFee;
/***
* 单价()
*/
private Integer unitPrice;
/***
* 服务开始时间
*/
private Date serviceTimeBegin;
/***
* 服务结束时间
*/
private Date serviceTimeEnd;
/***
* 订单开始时间
*/
private Date orderTimeBegin;
/***
* 订单结束时间
*/
private Date orderTimeEnd;
/***
* 费用标准详情
*/
private String feeStandard;
/***
* 耗电量; 如果是soc结算 则是soc的差值, ODO则是里程
*/
private Double electricityQuantity;
/***
* 开始充电的电量
*/
private Double electStart;
/***
* 结束充电的电量
*/
private Double electEnd;
/***
* 租借电池包仓位
*/
private String rentBatNo;
/***
* 租借电池包编码
*/
private String rentBatCode;
/***
* 租借电池包SOC
*/
private Double rentBatSoc;
/***
* 归还电池包仓位
*/
private String returnBatNo;
/***
* 归还电池包编码
*/
private String returnBatCode;
/***
* 归还电池包SOC
*/
private Double returnBatSoc;
/***
* 换电模式 HDConstant.OrderConstant.CHANGE_MODE_*
*/
private Integer changeMode;
/***
* 换电车道 HDConstant.OrderConstant.CHANGE_LANE_*
*/
private Integer changeLane;
}

View File

@ -0,0 +1,28 @@
package com.evotech.hd.common.core.entity.order;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @author zrb
* @since 2024-11-22
*/
@Data
@TableName(value = "yt_t_order_recharge", schema = "hd_cloud_manage")
@Schema(name = "充值订单")
public class OrderRecharge extends BaseOrder implements Serializable {
/***
* 1 待支付 2 已支付
*/
private Integer orderType;
private String wuId;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,72 @@
package com.evotech.hd.common.core.entity.order;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.IdEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 退款订单类
*
* @ClassName:OrderRefund
* @date: 2025年06月28日 16:21
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@TableName(value = "yt_t_order_refund", schema = "hd_cloud_manage")
@Schema(name = "退款订单")
public class OrderRefund extends IdEntity {
/***
* 微信支付单号
*/
String transactionId;
/***
* 退款订单号
*/
String refundOrderNo;
/***
* 充值订单号
*/
String outTradeNo;
/***
* 退款原因
*/
String reason;
/***
* 订单金额
*/
Integer orderAmount;
/***
* 退款金额
*/
Integer refundAmount;
/***
* 退款状态. 默认待退款
* PENDING_REFUND-待退款
* SUCCESS退款成功
* CLOSED退款关闭
* PROCESSING退款处理中
* ABNORMAL退款异常退款到银行发现用户的卡作废或者冻结了导致原路退款银行卡失败可前往商户平台-交易中心手动处理此笔退款可参考 退款异常的处理或者通过发起异常退款接口进行处理
*/
String refundStatus = "PENDING_REFUND";
/***
* 微信退款单号
*/
String refundId;
/***
* 微信退款用户Id
*/
String refundWechatId;
/***
* 微信请求结果
*/
String refundRequestInfo;
/***
* 微信退款回调结果
*/
String notifyInfo;
}

View File

@ -1,15 +1,13 @@
package com.evotech.hd.common.core.entity.resource.auth; package com.evotech.hd.common.core.entity.resource.auth;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* @author zrb * @author zrb
@ -40,4 +38,10 @@ public class AuthRole extends BaseEntity implements Serializable {
@Schema(description = "是否内置角色,内置角色不允许修改") @Schema(description = "是否内置角色,内置角色不允许修改")
private Integer readonly; private Integer readonly;
@Schema(description = "业务code, 如果是开发者创建, 则为空")
private String businessCode;
@TableField(exist = false)
private String businessName;
} }

View File

@ -40,6 +40,8 @@ public class AuthUser extends BaseEntity implements Serializable {
@Schema(description = "业务code, 即公司类型,为公司统一社会信息代码, 运营商类型为运营商统一社会信用代码", hidden = true) @Schema(description = "业务code, 即公司类型,为公司统一社会信息代码, 运营商类型为运营商统一社会信用代码", hidden = true)
private String businessCode; private String businessCode;
@TableField(exist = false)
private String businessName;
@Schema(description = "关联方代码") @Schema(description = "关联方代码")
private String typeRelateCode; private String typeRelateCode;
@ -91,28 +93,15 @@ public class AuthUser extends BaseEntity implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date lastLoginTime; private Date lastLoginTime;
/*@Schema(description = "创建人", hidden = true)
@TableField(fill = FieldFill.INSERT)
private String creater;
@Schema(description = "创建时间", hidden = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@TableField(fill = FieldFill.INSERT)
private Date ctime;
@Schema(description = "更新人", hidden = true)
@TableField(fill = FieldFill.UPDATE)
private String updater;
@Schema(description = "更新时间", hidden = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@TableField(fill = FieldFill.UPDATE)
private Date uptime;*/
@Schema(description = "角色编码", hidden = true) @Schema(description = "角色编码", hidden = true)
@TableField(exist = false) @TableField(exist = false)
private String rcodes; private String rcodes;
@Schema(description = "站编码", hidden = true)
@TableField(exist = false)
private String stationCodes;
@Schema(description = "微信用户id")
private String wuid;
} }

View File

@ -1,17 +1,13 @@
package com.evotech.hd.common.core.entity.resource.auth; package com.evotech.hd.common.core.entity.resource.auth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.evotech.hd.common.core.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* 账户和站的关系, 一般是运营端使用 * 账户和站的关系, 一般是运营端使用
@ -25,7 +21,7 @@ import java.util.Date;
@Setter @Setter
@TableName("yt_auth_user_station") @TableName("yt_auth_user_station")
@Schema(name = "账号角色关系") @Schema(name = "账号角色关系")
public class AuthUserStation implements Serializable { public class AuthUserStation extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -0,0 +1,34 @@
package com.evotech.hd.common.core.entity.system;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @ClassName:SysParam
* @date: 2025年07月02日 14:26
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "yt_t_sys_param", schema = "hd_cloud_manage")
public class SysParam extends IdEntity {
/** 参数名 */
private String paramName;
/** 参数码 */
private String paramCode;
/** 参数值 */
private String paramValue;
/** 说明 */
private String description;
}

View File

@ -1,8 +1,6 @@
package com.evotech.hd.common.core.entity.wechat; package com.evotech.hd.common.core.entity.wechat;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evotech.hd.common.core.entity.BaseEntity; import com.evotech.hd.common.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -68,4 +66,12 @@ public class WechatUser extends BaseEntity implements Serializable {
@Schema(description = "审核状态1-待审核2-审核成功3-审核失败") @Schema(description = "审核状态1-待审核2-审核成功3-审核失败")
private Integer state; private Integer state;
@Schema(description = "审核通过时间(即绑定公司时间)")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date bindtime;
@Schema(description = "审核失败原因")
private String reason;
} }

View File

@ -0,0 +1,16 @@
package com.evotech.hd.common.core.enums;
/**
* 枚举
*
* @ClassName:BaseEnum
* @date: 2025年05月19日 15:36
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public interface BaseEnum<K, V> {
K getKey();
V getValue();
}

View File

@ -1,5 +1,9 @@
package com.evotech.hd.common.core.enums; package com.evotech.hd.common.core.enums;
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 100 Continue 继续客户端应继续其请求 * 100 Continue 继续客户端应继续其请求
101 Switching Protocols 切换协议服务器根据客户端的请求切换协议只能切换到更高级的协议例如切换到HTTP的新版本协议 101 Switching Protocols 切换协议服务器根据客户端的请求切换协议只能切换到更高级的协议例如切换到HTTP的新版本协议
@ -100,4 +104,10 @@ public enum CodeMsg {
this.msg = msg; this.msg = msg;
} }
public static CodeMsg getCodeMsgByCode(String code){
Map<String, CodeMsg> map = Arrays.stream(CodeMsg.values()).collect(Collectors.toMap(CodeMsg::getCode, v->v));
return map.get(code);
}
} }

View File

@ -1,10 +1,10 @@
package com.evotech.hd.common.core.enums; package com.evotech.hd.common.core.enums;
public enum OrderStatusEnums { public enum OrderStatusEnums implements BaseEnum<Integer, String> {
CREATE(1, "已创建"), CREATE(1, "已创建"),
SWAP(2, "换电开始"), SWAP(2, "换电"),
SWAPOVER(3, "换电完成"), SWAPOVER(3, "换电完成"),
@ -16,13 +16,24 @@ public enum OrderStatusEnums {
FINISH(7, "已完成"), FINISH(7, "已完成"),
CANCLE(9, "已取消"); SETTLEMENT_IN_PROGRESS(8, "结算中"),
CANCLE(9, "已取消"),
REFUND(-1, "订单退款"),
REFUND_PART(-2, "订单不分退款"),
;
Integer code; Integer code;
String name; String name;
public Integer getCode() { public Integer getCode() {
return code; return code;
} }
@ -36,4 +47,14 @@ public enum OrderStatusEnums {
this.name = name; this.name = name;
} }
@Override
public Integer getKey() {
return this.code;
}
@Override
public String getValue() {
return this.name;
}
} }

View File

@ -9,6 +9,9 @@ public enum PayTypeEnums {
ALIPAY(3, "支付宝"), ALIPAY(3, "支付宝"),
BANK(4, "网银"), BANK(4, "网银"),
CHARGING_COMPENSATION(5, "充电补偿"),
BUSINESS_TO_BUSINESS(6, "公对公"),
OTHER(9, "其他"); OTHER(9, "其他");

View File

@ -0,0 +1,61 @@
package com.evotech.hd.common.core.enums;
/**
* 枚举
*
* @ClassName:SwapBatteryStepEnum
* @date: 2025年06月23日 16:08
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public enum SwapBatteryStepEnum implements BaseEnum<Integer, String>{
// @Schema(description = "步骤1-车辆进站2-车辆到达指定位置3-对中机构4-取新电5-拆旧电6-装新电7-放旧电8-完成")
VEHICLES_ENTER_STATION(1, "车辆进站"),
VEHICLE_POSITION(2, "车辆到达指定位置"),
INSTITUTIONS_FOR_CHINA(3, "启动对中机构"),
GET_NEW_ELECTRICITY(4, "取新电池"),
DISMANTLE_OLD_ELECTRICITY(5, "拆旧电池"),
INSTALL_NEW_ELECTRICITY(6, "装新电池"),
DISCHARGE_OLD_ELECTRICITY(7, "放旧电池"),
COMPLETED(8, "换电完成"),
;
Integer code;
String name;
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
SwapBatteryStepEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
@Override
public Integer getKey() {
return this.code;
}
@Override
public String getValue() {return this.name;}
}

View File

@ -0,0 +1,203 @@
package com.evotech.hd.common.core.excel;
import com.evotech.hd.common.core.excel.handler.ExcelFieldHandlerAdapter;
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.math.BigDecimal;
/**
* 自定义导出Excel数据注解
*
* @author evo
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Excel
{
/**
* 导出时在excel中排序
*/
public int sort() default Integer.MAX_VALUE;
/**
* 导出到Excel中的名字.
*/
public String name() default "";
/**
* 日期格式, : yyyy-MM-dd
*/
public String dateFormat() default "";
/**
* 如果是字典类型请设置字典的type值 (: sys_user_sex)
*/
public String dictType() default "";
/**
* 读取内容转表达式 (: 0=,1=,2=未知)
*/
public String readConverterExp() default "";
/**
* 分隔符读取字符串组内容
*/
public String separator() default ",";
/**
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
*/
public int scale() default -1;
/**
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
*/
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
/**
* 导出时在excel中每个列的高度
*/
public double height() default 14;
/**
* 导出时在excel中每个列的宽度
*/
public double width() default 16;
/**
* 文字后缀,% 90 变成90%
*/
public String suffix() default "";
/**
* 当值为空时,字段的默认值
*/
public String defaultValue() default "";
/**
* 提示信息
*/
public String prompt() default "";
/**
* 设置只能选择不能输入的列内容.
*/
public String[] combo() default {};
/**
* 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解.
*/
public boolean comboReadDict() default false;
/**
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
*/
public boolean needMerge() default false;
/**
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
*/
public boolean isExport() default true;
/**
* 另一个类中的属性名称,支持多级获取,以小数点隔开
*/
public String targetAttr() default "";
/**
* 是否自动统计数据,在最后追加一行统计数据总和
*/
public boolean isStatistics() default false;
/**
* 导出类型0数字 1字符串 2图片
*/
public ColumnType cellType() default ColumnType.STRING;
/**
* 导出列头背景颜色
*/
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
/**
* 导出列头字体颜色
*/
public IndexedColors headerColor() default IndexedColors.WHITE;
/**
* 导出单元格背景颜色
*/
public IndexedColors backgroundColor() default IndexedColors.WHITE;
/**
* 导出单元格字体颜色
*/
public IndexedColors color() default IndexedColors.BLACK;
/**
* 导出字段对齐方式
*/
public HorizontalAlignment align() default HorizontalAlignment.CENTER;
/**
* 自定义数据处理器
*/
public Class<?> handler() default ExcelHandlerAdapter.class;
/**
* 自定义数据处理器
*/
public boolean customExcelField() default false;
/**
* 自定义数据处理器
*/
public Class<?> excelFieldHandler() default ExcelFieldHandlerAdapter.class;
/**
* 自定义数据处理器参数
*/
public String[] args() default {};
/**
* 字段类型0导出导入1仅导出2仅导入
*/
Type type() default Type.ALL;
public enum Type
{
ALL(0), EXPORT(1), IMPORT(2);
private final int value;
Type(int value)
{
this.value = value;
}
public int value()
{
return this.value;
}
}
public enum ColumnType
{
NUMERIC(0), STRING(1), IMAGE(2), TEXT(3);
private final int value;
ColumnType(int value)
{
this.value = value;
}
public int value()
{
return this.value;
}
}
}

View File

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

View File

@ -0,0 +1,17 @@
package com.evotech.hd.common.core.excel.handler;
import java.util.List;
/**
* 特殊出具处理接口
*
* @ClassName:ExcelFieldHandlerAdapter
* @date: 2025年07月12日 10:40
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public interface ExcelFieldHandlerAdapter {
List<String> buildExcel();
}

View File

@ -0,0 +1,24 @@
package com.evotech.hd.common.core.excel.handler;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
/**
* Excel数据格式处理适配器
*
* @author evo
*/
public interface ExcelHandlerAdapter
{
/**
* 格式化
*
* @param value 单元格数据值
* @param args excel注解args参数组
* @param cell 单元格对象
* @param wb 工作簿对象
*
* @return 处理后的值
*/
Object format(Object value, String[] args, Cell cell, Workbook wb);
}

View File

@ -0,0 +1,35 @@
package com.evotech.hd.common.core.excel.handler.impl;
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
/**
* OrderStatusExcelHandlerAdapter
*
* @author andy.shi
* @ClassName:OrderStatusExcelHandlerAdapter
* @date: 2026年02月11日 14:23
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public class OrderSourceExcelHandlerAdapter implements ExcelHandlerAdapter {
@Override
public Object format(Object value, String[] args, Cell cell, Workbook wb) {
if(ObjectUtils.isNotEmpty(value)){
switch (String.valueOf(value)){
case "1":
return "小程序";
case "2":
return "云端";
case "3":
return "站端";
default:
return "";
}
}
return null;
}
}

View File

@ -0,0 +1,32 @@
package com.evotech.hd.common.core.excel.handler.impl;
import com.evotech.hd.common.core.enums.OrderStatusEnums;
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
/**
* OrderStatusExcelHandlerAdapter
*
* @author andy.shi
* @ClassName:OrderStatusExcelHandlerAdapter
* @date: 2026年02月11日 14:23
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public class OrderStatusExcelHandlerAdapter implements ExcelHandlerAdapter {
@Override
public Object format(Object value, String[] args, Cell cell, Workbook wb) {
if(ObjectUtils.isNotEmpty(value)){
Integer val = Integer.valueOf(String.valueOf(value));
for (OrderStatusEnums orderStatus : OrderStatusEnums.values()){
if(orderStatus.getCode().equals(val)){
return orderStatus.getName();
}
}
}
return null;
}
}

View File

@ -0,0 +1,33 @@
package com.evotech.hd.common.core.excel.handler.impl;
import com.evotech.hd.common.core.enums.SwapBatteryStepEnum;
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
/**
* OrderStatusExcelHandlerAdapter
*
* @author andy.shi
* @ClassName:OrderStatusExcelHandlerAdapter
* @date: 2026年02月11日 14:23
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public class OrderStepExcelHandlerAdapter implements ExcelHandlerAdapter {
@Override
public Object format(Object value, String[] args, Cell cell, Workbook wb) {
if(ObjectUtils.isNotEmpty(value)){
Integer val = Integer.valueOf(String.valueOf(value));
for (SwapBatteryStepEnum stepEnum : SwapBatteryStepEnum.values()){
if(stepEnum.getCode().equals(val)){
return stepEnum.getName();
}
}
}
return null;
}
}

View File

@ -0,0 +1,19 @@
package com.evotech.hd.common.core.permission;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD,ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface DataScopeOpenMethod {
/***
* 是否开启方法查询
*/
boolean openMethod() default false;
String[] methodName();
}

View File

@ -0,0 +1,300 @@
package com.evotech.hd.common.core.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
/**
* @DES 集合类型工具类
* @author andy.shi
* @createDate 2020年12月25日下午2:16:13
* @typeName Collections
*/
public class Collections implements Serializable{
static Logger log = LoggerFactory.getLogger(Collections.class);
/**
*
*/
private static final long serialVersionUID = -611031509912595162L;
/**
*
* @param ts
* @return
*/
public static <T> boolean isEmpty(T[] ts) {
return ts == null || ts.length == 0;
}
/**
*
* @param ts
* @return
*/
public static <T> boolean isNotEmpty(T[] ts) {
return ! isEmpty(ts);
}
/************************ 以上为公共方法 以下为list ************************************************/
/**
* @DES 检查集合为空
* @author andy.shi
* @createDate 2020年12月25日下午2:14:43
* @methodName Collections.isEmpty
* @param list
* @return
* @returnType boolean
*/
public static boolean isEmpty(Collection list) {
return list == null || list.size() == 0;
}
/**
* @DES 检查集合不为空
* @author andy.shi
* @createDate 2020年12月25日下午2:15:07
* @methodName Collections.isNotEmpty
* @param collection
* @return
* @returnType boolean
*/
public static boolean isNotEmpty(Collection collection) {
return ! (isEmpty(collection));
}
/**
* 将list进行分页
* @author Andy.shi
* @date 2020年9月15日上午9:37:07
* @param <T> 泛型, 根据传入的对对象类型,返回类型
* @param list 需要分组的集合
* @param pageNum 当前页数
* @param pageSize 每页显示的条数
* @return
*/
public static <T> List<T> pageList(List<T> list, Integer pageNum, Integer pageSize){
if(isEmpty(list)) {
log.warn(String.format("[info " + Collections.class.getName() + " 执行信息] : list info: [%s] 为空", new Object[]{list}));
return list;
}
try {
//如果当前页为0, 更改为1
if(pageNum == 0)
pageNum = 1;
//计算formIndex
Integer fromIndex = ((pageNum-1)*pageSize);
//计算toIndex
Integer toIndex = fromIndex + pageSize;
//防止下标越界
if(toIndex > list.size())
toIndex = list.size();
log.info(String.format("[info " + Collections.class.getName() + " 执行信息] : list info: [%s] and pageNum info:[%s] and pageSize info: [%s]", new Object[]{list, pageNum, pageSize}));
return list.subList(fromIndex, toIndex);
} catch (Exception e) {
// TODO Auto-generated catch block
log.error(String.format("Class {%s}, Method {%s}", new Object[]{Collections.class.getName(), "pageList"}),e);
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: list info: [%s] and pageNum info:[%s] and pageSize info: [%s] ", new Object[]{list, pageNum, pageSize}), e);
}
}
/**
* 创建对象
* @author Andy.shi
* @date 2020年9月15日上午9:37:07
* @param <T>
* @return
*/
public static <T> List<T> emptyList() {
return new LinkedList<T>();
}
/**
* @DES 数组转对象
* @author andy.shi
* @createDate 2020年12月25日下午2:09:14
* @methodName Collections.asList
* @param objs
* @return
* @returnType List<T>
*/
public static <T> List<T> asList(T... objs) {
if (isEmpty(objs))
return emptyList();
List<T> list = emptyList();
for (T obj : objs)
list.add(obj);
return list;
}
/**
*
* @param objs
* @return
*/
public static <T> List<T> asList(Collection<T> objs) {
if (isEmpty(objs))
return emptyList();
List<T> list = emptyList();
list.addAll(objs);
return list;
}
/**
* 去除集合的重复项
* @author Andy.shi
* @date 2020年9月24日上午9:09:07
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() equals()
* @param list1 去重的集合1
* @param list2 去重的集合2
* @return list 去重后的对象
*/
@SuppressWarnings("unchecked")
public static <T> List<T> removeDuplicatesList(List<T> list1, List<T> list2){
return removeDuplicatesList(new List[] {list1, list2});
}
/**
* 去除集合的重复项
* @author Andy.shi
* @date 2020年9月24日上午9:13:09
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() equals()
* @param listArray 去重的集合数组
* @return list 去重后的对象
*/
@SuppressWarnings("unchecked")
public static <T> List<T> removeDuplicatesList(List<T>... listArray){
try {
List<T> listAll = emptyList();
if(listArray == null || listArray.length == 0) {
log.warn("[info " + Collections.class.getName() + " 执行信息] : 数据集合为空, 返回空对象 ");
return emptyList();
}
for (List<T> list : listArray) {
if(isNotEmpty(list)) {
listAll.addAll(list);
}
}
return (List<T>) listAll.stream().distinct().collect(Collectors.toList());
} catch (Exception e) {
// TODO Auto-generated catch block
log.error(String.format("Class {%s}, Method {%s}", new Object[]{Collections.class.getName(), "removeDuplicatesList"}),e);
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: listArray info: [%s] 去除重复数据异常; ", new Object[]{listArray}), e);
}
}
/**
* 获取重复数据
* @author Andy.shi
* @date 2020年9月24日上午9:46:03
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() equals()
* @param list1 查重的集合1
* @param list2 查重的集合1
* @return 并集的数据集合
*/
@SuppressWarnings("unchecked")
public static <T> List<T> findDuplicatesList(List<T> list1, List<T> list2){
return findDuplicatesList(new List[] {list1, list2});
}
/**
* 获取重复数据
* @author Andy.shi
* @date 2020年9月24日上午9:44:30
* @param <T> 泛型,字段的类型, 如果是对象, 请重写hashCode() equals()
* @param listArray 需要查重的集合数组
* @return 并集的数据集合
*/
public static <T> List<T> findDuplicatesList(List<T>... listArray){
try {
if(listArray == null || listArray.length == 0) {
log.warn("[info " + Collections.class.getName() + " 执行信息] : 数据集合为空, 返回空对象 ");
return emptyList();
}
if(listArray.length == 1) {
log.warn("[info " + Collections.class.getName() + " 执行信息] : 集合数组只有一个, 不存在重复数据 ");
return listArray[0];
}
List<T> firstList = listArray[0];
for (int i = 1; i < listArray.length; i++) {
firstList.retainAll(listArray[i]);
}
return firstList;
} catch (Exception e) {
// TODO Auto-generated catch block
log.error(String.format("Class {%s}, Method {%s}", new Object[]{Collections.class.getName(), "findDuplicatesList"}),e);
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: listArray info: [%s] 获取重复数据异常; ", new Object[]{listArray}), e);
}
}
/********************** 以上操作list 以下操作map **************************************/
/**
*
* @param map
* @return
*/
public static boolean isNotEmpty(Map<?, ?> map) {
return ! isEmpty(map);
}
/**
* @param map
* @return
*/
public static boolean isEmpty(Map<?, ?> map) {
return map == null || map.size() == 0;
}
/**
* @DES 创建空的map对象
* @author andy.shi
* @company 龙腾工作室
* @createDate 2020年12月25日下午1:36:35
* @methodName MapLists.emptyMap
* @return
* @returnType Map<k,v>
*/
public static final <K, V> Map<K, V> emptyMap() {
return new LinkedHashMap<K, V>();
}
/**
* @DES 组装map数据对象
* @author andy.shi
* @createDate 2020年12月25日下午1:37:05
* @methodName MapLists.createMap
* @param args
* @return
* @returnType Map<k,v>
*/
@SuppressWarnings("unchecked")
public static <K, V> Map<K, V> asMap(Object... args) {
Map<K, V> map = emptyMap();
if (args == null || args.length == 0) {
log.warn(String.format("[info " + Collections.class.getName() + " 执行信息] : params的参数不为偶数; args length: [%s]; args info: [%s] ", new Object[]{args.length, args}));
return map;
} else if (args.length % 2 != 0) {
throw new RuntimeException(String.format("EntityInfo --- " + Collections.class.getName() + " error: args must completely match: even param is key, odd param is value, please check your arguments. args length [%s]; args info: [%s]; ", new Object[]{args.length, args}));
}
for (int i=0; i<args.length;i+=2) {
Object key = args[i];
Object val = i + 1 < args.length ? args[i+1] : null;
map.put( (K) key, (V) val);
}
return map;
}
/********************** 以上操作map 以下操作公共方法 **************************************/
}

View File

@ -1,10 +1,13 @@
package com.evotech.hd.common.core.utils; package com.evotech.hd.common.core.utils;
import java.util.Date;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
public class CommonUtil { public class CommonUtil {
@ -48,5 +51,18 @@ public class CommonUtil {
} }
public static BigDecimal yuanToFen(BigDecimal yuan){
if(ObjectUtils.isEmpty(yuan)){
return new BigDecimal(0);
}
return yuan.multiply(new BigDecimal(100));
}
public static BigDecimal fenToYuan(BigDecimal yuan){
if(ObjectUtils.isEmpty(yuan)){
return new BigDecimal(0);
}
return yuan.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
}
} }

View File

@ -0,0 +1,37 @@
package com.evotech.hd.common.core.utils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import java.math.BigDecimal;
import java.util.Map;
/**
*
*
* @ClassName:DataUtils
* @date: 2025年06月03日 10:25
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
public class DataUtils {
public static final BigDecimal DEFAULT_VALUE = new BigDecimal(0);
public static <T> T findDefaultValue(T v, T dv){
if(ObjectUtils.isNotEmpty(v)){
return v;
}
return dv;
}
public static <K, V> V getValOrDefault(Map<K, V> map, K key, V dv) {
if(!map.containsKey(key) || ObjectUtils.isEmpty(map.get(key))){
return dv;
}
return map.get(key); // 键不存在时Java默认返回null
}
}

View File

@ -0,0 +1,30 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.evotech.hd</groupId>
<artifactId>base-commons</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>common-mongodb</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models</artifactId>
<version>2.2.19</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,105 @@
package com.evotech.hd.common.config;
import com.mongodb.ConnectionString;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
import org.springframework.util.StringUtils;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
/**
* mongoDB类
*
* @ClassName:AbstractMongoDbConfig
* @date: 2025年04月29日 14:41
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Data
@Configuration
public abstract class AbstractMongoDbConfig{
// MongoDB Properties
@Value("${yt.base_properties.uri:}")
private String uri;
@Value("${yt.base_properties.user_name:''}")
private String userName;
@Value("${yt.base_properties.password:''}")
private String password;
@Value("${yt.base_properties.host:''}")
private String host;
@Value("${yt.base_properties.authentication-database:''}")
private String authenticationDataBase;
private String dataBase;
@Value("${yt.base_properties.port:''}")
private Integer port;
public MongoDatabaseFactory mongoDbFactory(){
//String connectionString = "mongodb://" + userName + ":" + password+ "@"+ host+":"+port+"/" + dataBase+"?authSource="+authenticationDataBase;
return new SimpleMongoClientDatabaseFactory(getConnectionString());
}
private ConnectionString getConnectionString(){
if (StringUtils.hasText(uri)) {
return new ConnectionString(uri);
}
StringBuilder builder = new StringBuilder("mongodb://");
if (StringUtils.hasText(userName)) {
builder.append(encode(userName));
builder.append(":");
if (StringUtils.hasText(password)) {
builder.append(encode(password));
}
builder.append("@");
}
builder.append((StringUtils.hasText(host)) ? host : "localhost");
if (port != null) {
builder.append(":");
builder.append(port);
}
//集群多地址配置, 具体参考 propertiesMongoConnectionDetails
// if (this.properties.getAdditionalHosts() != null) {
// builder.append(",");
// builder.append(String.join(",", this.properties.getAdditionalHosts()));
// }
builder.append("/");
builder.append(dataBase);
List<String> options = getOptions();
if (!options.isEmpty()) {
builder.append("?");
builder.append(String.join("&", options));
}
return new ConnectionString(builder.toString());
}
private String encode(String input) {
return URLEncoder.encode(input, StandardCharsets.UTF_8);
}
private List<String> getOptions() {
List<String> options = new ArrayList<>();
//集群,名称. 具体参考 propertiesMongoConnectionDetails
// if (this.properties.getReplicaSetName() != null) {
// options.add("replicaSet=" + this.properties.getReplicaSetName());
// }
if (StringUtils.hasText(userName) && StringUtils.hasText(authenticationDataBase)) {
options.add("authSource=" + authenticationDataBase);
}
return options;
}
abstract public MongoTemplate getMongoTemplate() throws Exception;
}

View File

@ -0,0 +1,30 @@
package com.evotech.hd.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;
/**
*
*
* @ClassName:BatteryInfoProperties
* @date: 2025年04月29日 16:32
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Configuration
@ConfigurationProperties(prefix = "yt.battery-box", ignoreInvalidFields = true)
public class BatteryBoxProperties extends AbstractMongoDbConfig {
@Bean("mongoTemplateBatteryBox")
@Override
public MongoTemplate getMongoTemplate() throws Exception {
return new MongoTemplate(mongoDbFactory());
}
}

View File

@ -0,0 +1,30 @@
package com.evotech.hd.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.mongodb.core.MongoTemplate;
/**
*
*
* @ClassName:BatteryInfoProperties
* @date: 2025年04月29日 16:32
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Configuration
@ConfigurationProperties(prefix = "yt.battery-info", ignoreInvalidFields = true)
public class BatteryInfoProperties extends AbstractMongoDbConfig {
@Primary
@Bean("mongoTemplateBatteryInfo")
@Override
public MongoTemplate getMongoTemplate() throws Exception {
return new MongoTemplate(mongoDbFactory());
}
}

View File

@ -0,0 +1,27 @@
package com.evotech.hd.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;
/**
* 站相关推送信息记录类
*
* @ClassName:BatteryInfoProperties
* @date: 2025年04月29日 16:32
* @author: andy.shi
* @contact: 17330188597
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/
@Configuration
@ConfigurationProperties(prefix = "yt.station-info", ignoreInvalidFields = true)
public class StationInfoProperties extends AbstractMongoDbConfig {
@Bean("mongoTemplateStationInfo")
@Override
public MongoTemplate getMongoTemplate() throws Exception {
return new MongoTemplate(mongoDbFactory());
}
}

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