Compare commits

..

2 Commits

Author SHA1 Message Date
lhb
90bc96e060 fix:充值明细关联订单信息 2025-04-19 13:25:48 +08:00
lhb
e963606b0b fix:扫码支付输出回调信息 2025-04-18 16:37:30 +08:00
447 changed files with 6093 additions and 22917 deletions

View File

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

View File

@ -4,12 +4,9 @@
<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$/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-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-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/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/cloud-manage-server/src/main/java" charset="UTF-8" />

View File

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

View File

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

View File

@ -1,10 +1,7 @@
package com.evotech.hd.authorization.config.oauth2;
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 java.io.IOException;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.server.ServletServerHttpResponse;
@ -14,7 +11,12 @@ import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.core.OAuth2Error;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import java.io.IOException;
import com.evotech.hd.common.core.entity.Result;
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 {

View File

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

View File

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

View File

@ -1,10 +1,6 @@
package com.evotech.hd.authorization.config.security;
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 java.io.IOException;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.server.ServletServerHttpResponse;
@ -12,7 +8,12 @@ import org.springframework.security.core.AuthenticationException;
import org.springframework.security.oauth2.server.resource.InvalidBearerTokenException;
import org.springframework.security.web.AuthenticationEntryPoint;
import java.io.IOException;
import com.evotech.hd.common.core.entity.Result;
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,16 +1,17 @@
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.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
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
public class UserDetailService implements UserDetailsService {

View File

@ -1,15 +1,17 @@
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
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 = "验证码")
@RestController
@RequestMapping("/captcha")

View File

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

View File

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

View File

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

View File

@ -1,10 +1,11 @@
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.UserVo;
import com.evotech.hd.common.core.Dto.Result;
import com.evotech.hd.common.core.entity.Result;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.http.auth.AuthenticationException;
public interface LoginService {

View File

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

View File

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

View File

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

View File

@ -28,10 +28,7 @@
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@ -70,18 +67,8 @@
<groupId>cn.hutool</groupId>
<artifactId>hutool-crypto</artifactId>
</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>
<build>

View File

@ -0,0 +1,41 @@
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

@ -1,30 +0,0 @@
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

@ -1,104 +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;
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

@ -1,29 +0,0 @@
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

@ -1,44 +0,0 @@
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

@ -1,35 +0,0 @@
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

@ -1,30 +0,0 @@
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

@ -1,32 +0,0 @@
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

@ -1,23 +0,0 @@
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

@ -1,29 +0,0 @@
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

@ -1,77 +0,0 @@
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

@ -1,111 +0,0 @@
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

@ -1,59 +0,0 @@
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

@ -1,55 +0,0 @@
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

@ -1,24 +0,0 @@
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

@ -1,33 +0,0 @@
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

@ -1,53 +0,0 @@
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

@ -1,25 +0,0 @@
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

@ -1,34 +0,0 @@
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,180 +2,7 @@ package com.evotech.hd.common.core.constant;
public interface HDConstant {
/***
* 全局删除标识-已删除
*/
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{
public static final class PermissionConstant{
/**
* 当前登录用户的UID
*/
@ -251,14 +78,14 @@ public interface HDConstant {
*/
String JWT_PAYLOAD_KEY = "payload";
/**
* jwt中添加的属性
*/
String USER_ID_KEY = "uid";
String ROLE_CODE_KEY = "rcodes";
/**
* 登陆验证码缓存key
* hd:login:captcha: + captchaId
@ -270,37 +97,37 @@ public interface HDConstant {
* key: hd:login:jti:token
*/
String LOGIN_CACHE_KEY_PREFIX = "hd:login:";
/**
* 缓存系统token有效时间s
*/
String HD_CACHE_TOKEN_EXP_KEY = "hd:cache:tokenExp";
/**
* 资源权限类型
*/
String RESOURCE_TYPE_PERM = "PER";
String RESOURCE_TYPE_MENU = "MENU";
/**
* 交换数据非对称加密RSA秘钥前缀
*/
String HD_STATION_SECRET_KEY_RSA_PREFIX = "hd:station:secretKey:rsa:";
/**
* 交换数据对称加密AES秘钥前缀
* 交换数据对称加密AES秘钥前缀
*/
String HD_STATION_SECRET_KEY_AES_PREFIX = "hd:station:secretKey:aes:";
/**
* 微信服务请求头中权限验证字段
*/
String WECHAT_SERVER_AUTHORIZATION_KEY = "WXUID";
String WECHAT_SERVER_TOKEN_KEY = "WXTOKEN";
/**
* 微信登录缓存数据前缀
*/
@ -314,8 +141,4 @@ public interface HDConstant {
* 预约单失效前缀
*/
String preOrder="pre_order:";
/***
* 站控推送策略
*/
String STRATEGY_NAME = "站控推送";
}

View File

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

View File

@ -1,53 +0,0 @@
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

@ -1,16 +0,0 @@
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,24 +14,6 @@ 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.COMPANY_ROLE_CODE, permissionScopeName = "plate_num", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_CAR_CODE),
})
//@DataScopeOpenMethod(openMethod = true, methodName = {"homeFindHalfYearAmountData"})
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

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

View File

@ -1,9 +1,7 @@
package com.evotech.hd.common.core.dao.resource.auth;
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.permission.DataScope;
/**
* @desc: 用户和充电站的关联
@ -13,7 +11,5 @@ import com.evotech.hd.common.core.permission.DataScope;
* @contact: 17330188597
* @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> {
}

View File

@ -2,12 +2,18 @@ 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 io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.Min;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
@ -17,16 +23,25 @@ import java.util.Date;
*/
@Data
@Schema(name = "BaseEntity", description = "基础实体类")
public class BaseEntity extends IdEntity {
public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "pk_id", type = IdType.AUTO)
@Hidden
private Integer pkId;
@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;
@ -37,10 +52,4 @@ public class BaseEntity extends IdEntity {
@TableField(fill = FieldFill.UPDATE)
private Date uptime;
public BaseEntity() {
}
public BaseEntity(Integer pkId) {
super(pkId);
}
}

View File

@ -1,46 +0,0 @@
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,171 +1,164 @@
//package com.evotech.hd.common.core.entity;
//
//import java.io.Serializable;
//
//import com.evotech.hd.common.core.enums.CodeMsg;
//
//import io.swagger.v3.oas.annotations.media.Schema;
//import lombok.Data;
//
///**
// * @author zrb
// * @date 2024年9月2日17:25:54
// */
//@Data
//@Schema(name = "请求返回对象")
//public class Result<T> implements Serializable {
//
// private static final long serialVersionUID = -7806513009135956518L;
//
// @Schema(description = "请求处理状态", example = "1")
// private Integer status;
// @Schema(description = "状态码", example = "1000")
// private String code;
// @Schema(description = "返回消息")
// private String msg;
// @Schema(description = "返回数据")
// private Object data;
//
// private T obj;
//
//
// public Result(Integer status, String code, String msg, Object data) {
// this.status = status;
// this.code = code;
// this.msg = msg;
// this.data = data;
// }
//
// public Result(Integer status, String msg, Object data) {
// this.status = status;
// this.msg = msg;
// this.data = data;
// }
//
// public Result(Integer status) {
// this.status = status;
// }
//
// public Result() {
// }
//
// public Result(Integer status, String code, String msg) {
// this.status = status;
// this.code = code;
// this.msg = msg;
// }
//
// public Result(Integer status, String msg) {
// this.status = status;
// this.msg = msg;
// }
//
// public Result<T> success() {
// this.status = 1;
// this.code = CodeMsg.SUCCESS.getCode();
// this.msg = CodeMsg.SUCCESS.getMsg();
// return this;
// }
//
// public Result<T> success(Object o) {
// this.status = 1;
// this.code = CodeMsg.SUCCESS.getCode();
// this.msg = CodeMsg.SUCCESS.getMsg();
// this.data = o;
// return this;
// }
//
// public Result<T> success(String msg, Object o) {
// this.status = 1;
// this.code = CodeMsg.SUCCESS.getCode();
// this.msg = msg;
// this.data = o;
// return this;
// }
//
// public Result<T> success(String msg) {
// this.status = 1;
// this.code = CodeMsg.SUCCESS.getCode();
// this.msg = msg;
// this.data = CodeMsg.SUCCESS.getMsg();
// return this;
// }
//
// public Result<T> success(String code, String msg, Object o) {
// this.status = 1;
// this.code = code;
// this.msg = msg;
// this.data = o;
// return this;
// }
//
// public Result<T> success(CodeMsg cm, Object o) {
// this.status = 0;
// this.code = cm.getCode();
// this.msg = cm.getMsg();
// this.data = o;
// return this;
// }
//
// public Result<T> error(String msg) {
// this.status = 0;
// this.code = CodeMsg.ERROR.getCode();
// this.msg = msg;
// this.data = "ERROR";
// return this;
// }
//
// public Result<T> error(String code, String msg) {
// this.status = 0;
// this.code = code;
// this.msg = msg;
// this.data = "ERROR";
// return this;
// }
//
// public Result<T> error(CodeMsg cm) {
// this.status = 0;
// this.code = cm.getCode();
// this.msg = cm.getMsg();
// return this;
// }
//
// public Result<T> error(CodeMsg cm, Object o) {
// return error(cm.getCode(), cm.getMsg(), o);
// }
//
// public Result<T> error(String code, String msg, Object o) {
// this.status = 0;
// this.code = code;
// this.msg = msg;
// this.data = o;
// return this;
// }
//
// public Result<T> error(String msg, Object o) {
// this.status = 0;
// this.code = CodeMsg.ERROR.getCode();
// this.msg = msg;
// this.data = o;
// return this;
// }
//
//
// public Result<T> exception(Object data) {
// this.status = -1;
// this.code = CodeMsg.ERROR.getCode();
// this.msg = CodeMsg.ERROR.getMsg();
// this.data = data==null?"未知异常":data;
// 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;
// }
//
//}
package com.evotech.hd.common.core.entity;
import java.io.Serializable;
import com.evotech.hd.common.core.enums.CodeMsg;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author zrb
* @date 2024年9月2日17:25:54
*/
@Data
@Schema(name = "请求返回对象")
public class Result<T> implements Serializable {
private static final long serialVersionUID = -7806513009135956518L;
@Schema(description = "请求处理状态", example = "1")
private Integer status;
@Schema(description = "状态码", example = "1000")
private String code;
@Schema(description = "返回消息")
private String msg;
@Schema(description = "返回数据")
private Object data;
private T obj;
public Result(Integer status, String code, String msg, Object data) {
this.status = status;
this.code = code;
this.msg = msg;
this.data = data;
}
public Result(Integer status, String msg, Object data) {
this.status = status;
this.msg = msg;
this.data = data;
}
public Result(Integer status) {
this.status = status;
}
public Result() {
}
public Result(Integer status, String code, String msg) {
this.status = status;
this.code = code;
this.msg = msg;
}
public Result(Integer status, String msg) {
this.status = status;
this.msg = msg;
}
public Result<T> success(Object o) {
this.status = 1;
this.code = CodeMsg.SUCCESS.getCode();
this.msg = CodeMsg.SUCCESS.getMsg();
this.data = o;
return this;
}
public Result<T> success(String msg, Object o) {
this.status = 1;
this.code = CodeMsg.SUCCESS.getCode();
this.msg = msg;
this.data = o;
return this;
}
public Result<T> success(String msg) {
this.status = 1;
this.code = CodeMsg.SUCCESS.getCode();
this.msg = msg;
this.data = CodeMsg.SUCCESS.getMsg();
return this;
}
public Result<T> success(String code, String msg, Object o) {
this.status = 1;
this.code = code;
this.msg = msg;
this.data = o;
return this;
}
public Result<T> success(CodeMsg cm, Object o) {
this.status = 0;
this.code = cm.getCode();
this.msg = cm.getMsg();
this.data = o;
return this;
}
public Result<T> error(String msg) {
this.status = 0;
this.code = CodeMsg.ERROR.getCode();
this.msg = msg;
this.data = "ERROR";
return this;
}
public Result<T> error(String code, String msg) {
this.status = 0;
this.code = code;
this.msg = msg;
this.data = "ERROR";
return this;
}
public Result<T> error(CodeMsg cm) {
this.status = 0;
this.code = cm.getCode();
this.msg = cm.getMsg();
return this;
}
public Result<T> error(CodeMsg cm, Object o) {
return error(cm.getCode(), cm.getMsg(), o);
}
public Result<T> error(String code, String msg, Object o) {
this.status = 0;
this.code = code;
this.msg = msg;
this.data = o;
return this;
}
public Result<T> error(String msg, Object o) {
this.status = 0;
this.code = CodeMsg.ERROR.getCode();
this.msg = msg;
this.data = o;
return this;
}
public Result<T> exception(Object data) {
this.status = -1;
this.code = CodeMsg.ERROR.getCode();
this.msg = CodeMsg.ERROR.getMsg();
this.data = data==null?"未知异常":data;
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,22 +1,28 @@
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.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.RequiredMode;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* @author zrb
* @since 2024-10-15
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("hd_cloud_manage.yt_t_battery_station")
@Schema(name = "BatteryStation", description = "换电站")
@ -27,11 +33,6 @@ public class BatteryStation extends BaseEntity implements Serializable {
@Schema(description = "归属运营商ID", requiredMode = RequiredMode.REQUIRED)
@NotBlank(message = "无关联运营商信息")
private String proxyId;
@Schema(description = "运营商名称", requiredMode = RequiredMode.REQUIRED)
@TableField(exist = false)
private String poname;
@Schema(description = "站点名称", requiredMode = RequiredMode.REQUIRED)
@NotBlank(message = "站点名称不能为空")
@ -62,10 +63,6 @@ public class BatteryStation extends BaseEntity implements Serializable {
@Schema(description = "地址-区县")
private String addressArea;
@Schema(description = "区划编码", requiredMode = RequiredMode.REQUIRED)
@NotBlank(message = "区划编码不能为空")
private String divisionNo;
@Schema(description = "注册日期")
private String registerDate;
@ -135,12 +132,4 @@ public class BatteryStation extends BaseEntity implements Serializable {
@Schema(description = "营业止时间")
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,16 +1,22 @@
package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.TableField;
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 io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serializable;
/**
* @author zrb
* @since 2025-02-10
@ -44,18 +50,4 @@ public class BatteryStationCdStrategyDetail extends BaseEntity implements Serial
@Schema(description = "充电功率")
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,7 +1,16 @@
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 io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank;
@ -9,8 +18,6 @@ import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* @author zrb
* @since 2024-10-17
@ -47,16 +54,11 @@ public class BatteryStationDc extends BaseEntity implements Serializable {
@Schema(description = "站码或车牌照", requiredMode = RequiredMode.REQUIRED)
@NotBlank
private String sourceCode;
/***
* 具体参考 HDConstant.DcConstant.STATUS_*
*/
@Schema(description = "状态1-出租中2-充电中3-空闲4-故障5-其它", requiredMode = RequiredMode.REQUIRED)
@NotNull(message = "状态不能为空")
private Integer status;
/***
* 具体参考 HDConstant.DcConstant.POINT_TYPE_*
*/
@Schema(description = "轨迹点类型1-电站2-车辆")
private Integer pointType;
@ -70,7 +72,7 @@ public class BatteryStationDc extends BaseEntity implements Serializable {
private Integer soc;
@Schema(description = "电池仓位号")
private String dccNo;
private Integer dccNo;
@Schema(description = "删除标志1-已删除0-未删除", hidden = true)
private Integer delFlag;

View File

@ -1,19 +1,27 @@
package com.evotech.hd.common.core.entity.cloud;
import cn.hutool.core.date.DatePattern;
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.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.RequiredMode;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author zrb
* @since 2024-10-17
@ -36,9 +44,6 @@ public class BatteryStationHdFeeStandard extends BaseEntity implements Serializa
@Schema(description = "换电站编码")
private String stationName;
@Schema(description = "基本服务费")
private BigDecimal serviceFee;
@Schema(description = "开始日期", requiredMode = RequiredMode.REQUIRED, example = DatePattern.PURE_DATE_PATTERN)
@NotBlank(message = "开始时间不能为空")
private String dayBegin;
@ -56,9 +61,6 @@ public class BatteryStationHdFeeStandard extends BaseEntity implements Serializa
@Schema(description = "每度电收费")
private BigDecimal eachKwhFee;
@Schema(description = "正常换电服务费")
private BigDecimal commonRemainFee;

View File

@ -1,19 +1,26 @@
package com.evotech.hd.common.core.entity.cloud;
import cn.hutool.core.date.DatePattern;
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 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.RequiredMode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalTime;
/**
* @author zrb
@ -35,9 +42,6 @@ public class BatteryStationHdFeeStandardDetail extends BaseEntity implements Ser
@NotNull
private Integer standardId;
@Schema(description = "服务费")
private BigDecimal serviceFee;
@Schema(description = "每公里收费")
private BigDecimal eachKmFee;
@ -57,5 +61,6 @@ public class BatteryStationHdFeeStandardDetail extends BaseEntity implements Ser
@DateTimeFormat(pattern = DatePattern.NORM_TIME_PATTERN)
private LocalTime timeEnd;
@Schema(description = "谷段服务费")
private BigDecimal timeServiceFee;
}

View File

@ -1,97 +0,0 @@
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

@ -1,58 +0,0 @@
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

@ -0,0 +1,55 @@
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,19 +1,23 @@
package com.evotech.hd.common.core.entity.cloud;
import com.baomidou.mybatisplus.annotation.TableField;
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.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.RequiredMode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author zrb
@ -25,16 +29,16 @@ import java.util.Date;
public class OrderSwapBattery extends BaseEntity implements Serializable {
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;
@ -68,7 +72,7 @@ public class OrderSwapBattery extends BaseEntity implements Serializable {
@Schema(description = "订单金额")
private Integer amount;
@Schema(description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消, -1-退款")
@Schema(description = "订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消")
private Integer status;
@Schema(description = "计算费用方式1-ODO2-SOC3-按电量")
@ -92,9 +96,6 @@ public class OrderSwapBattery extends BaseEntity implements Serializable {
@Schema(description = "费用标准")
private String feeStandardJson;
@Schema(description = "费用标准详情")
@TableField(exist = false)
private BatteryStationHdFeeStandard feeStandardDetail;
@Schema(description = "上次租赁电池时车辆里程")
private BigDecimal lastRentBatCarOdo;
@ -104,7 +105,7 @@ public class OrderSwapBattery extends BaseEntity implements Serializable {
@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")
@ -153,10 +154,10 @@ public class OrderSwapBattery extends BaseEntity implements Serializable {
@Schema(description = "删除状态1-已删除0-未删除", hidden = true)
private Integer delFlag;
@Schema(description = "交易编码", hidden = true)
private String tradeNo;
@Schema(description = "备注信息")
private String remark;
}

View File

@ -1,17 +1,21 @@
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 io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @author zrb
@ -31,7 +35,7 @@ public class OrderSwapBatteryPre extends BaseEntity implements Serializable {
@Schema(description = "来源是站端时记录发送Id其他来源不需要", hidden = true)
private String sourceId;
@Schema(description = "预约人的微信Id", requiredMode = RequiredMode.REQUIRED)
@Schema(description = "预约人编码", requiredMode = RequiredMode.REQUIRED)
private String ucode;
@Schema(description = "预约人姓名", requiredMode = RequiredMode.REQUIRED)

View File

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

View File

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

View File

@ -1,13 +1,15 @@
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.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;
@Data
@ -52,9 +54,6 @@ public class PageListSwapOrderRequest extends BasePageRequest {
@Schema(description = "公司编码")
private String ccode;
@Schema(description = "运营商code")
private String proCode;

View File

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

View File

@ -1,39 +0,0 @@
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

@ -1,158 +0,0 @@
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

@ -1,64 +0,0 @@
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

@ -1,40 +0,0 @@
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

@ -1,63 +0,0 @@
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

@ -1,80 +0,0 @@
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

@ -1,108 +0,0 @@
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

@ -1,28 +0,0 @@
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

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

View File

@ -40,8 +40,6 @@ public class AuthUser extends BaseEntity implements Serializable {
@Schema(description = "业务code, 即公司类型,为公司统一社会信息代码, 运营商类型为运营商统一社会信用代码", hidden = true)
private String businessCode;
@TableField(exist = false)
private String businessName;
@Schema(description = "关联方代码")
private String typeRelateCode;
@ -93,15 +91,28 @@ public class AuthUser extends BaseEntity implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
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)
@TableField(exist = false)
private String rcodes;
@Schema(description = "站编码", hidden = true)
@TableField(exist = false)
private String stationCodes;
@Schema(description = "微信用户id")
private String wuid;
}

View File

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

View File

@ -1,34 +0,0 @@
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,6 +1,8 @@
package com.evotech.hd.common.core.entity.wechat;
import com.baomidou.mybatisplus.annotation.*;
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;
@ -66,12 +68,4 @@ public class WechatUser extends BaseEntity implements Serializable {
@Schema(description = "审核状态1-待审核2-审核成功3-审核失败")
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

@ -1,16 +0,0 @@
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,9 +1,5 @@
package com.evotech.hd.common.core.enums;
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 100 Continue 继续客户端应继续其请求
101 Switching Protocols 切换协议服务器根据客户端的请求切换协议只能切换到更高级的协议例如切换到HTTP的新版本协议
@ -103,11 +99,5 @@ public enum CodeMsg {
this.code = code;
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;
public enum OrderStatusEnums implements BaseEnum<Integer, String> {
public enum OrderStatusEnums {
CREATE(1, "已创建"),
SWAP(2, "换电"),
SWAP(2, "换电开始"),
SWAPOVER(3, "换电完成"),
@ -16,23 +16,12 @@ public enum OrderStatusEnums implements BaseEnum<Integer, String> {
FINISH(7, "已完成"),
SETTLEMENT_IN_PROGRESS(8, "结算中"),
CANCLE(9, "已取消"),
REFUND(-1, "订单退款"),
REFUND_PART(-2, "订单不分退款"),
;
CANCLE(9, "已取消");
Integer code;
String name;
public Integer getCode() {
return code;
@ -47,14 +36,4 @@ public enum OrderStatusEnums implements BaseEnum<Integer, String> {
this.name = name;
}
@Override
public Integer getKey() {
return this.code;
}
@Override
public String getValue() {
return this.name;
}
}

View File

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

View File

@ -1,61 +0,0 @@
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

@ -1,203 +0,0 @@
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

@ -1,18 +0,0 @@
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

@ -1,17 +0,0 @@
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

@ -1,24 +0,0 @@
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

@ -1,35 +0,0 @@
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

@ -1,32 +0,0 @@
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

@ -1,33 +0,0 @@
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

@ -1,19 +0,0 @@
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

@ -1,300 +0,0 @@
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,13 +1,10 @@
package com.evotech.hd.common.core.utils;
import java.util.Date;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
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 {
@ -50,19 +47,6 @@ public class CommonUtil {
return prefix + "1100";
}
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

@ -1,37 +0,0 @@
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

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<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

@ -1,105 +0,0 @@
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

@ -1,30 +0,0 @@
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

@ -1,30 +0,0 @@
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

@ -1,27 +0,0 @@
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