🔀 合并 dev 分支到 master

解决 9 个文件的冲突,取舍如下:

- 导出模型:采用 dev 的 *ExportExcel 命名与拆分,并保留 master 的
  @DateTimeFormat(dev 改名时漏加,会导致时间列显示为 Date.toString)。
- PortTerminal 导入:保留 master 的两阶段导入 + ImportFailureException
  全量回滚(ImportFailureException 仅 master 有,合并后的 controller 依赖它),
  导出失败明细改用 dev 的 exportFailureReasonOnly(仅标红失败原因列)。
- PortTerminal 导入模板:采用 dev 的"港口编码/码头编码"两列结构,
  相应补上 resolveImportCode 归并规则,并在构建实体时显式赋 code/parentCode。
- PortTerminal 导出:采用 dev 的 PortTerminalExportExcel(接口已如此声明),
  并保留 updateUserName 审计人翻译。
- 违章记录导入:保留 dev 的多错误收集 + 导入失败明细导出流水线,
  删除已被拆列取代的 violationTypeOrItem 映射,补上 clearIrrelevantField,
  并为导入校验补齐"对侧字段应留空"规则以与表单校验一致。

验证:mvn compile -DskipTests 全模块 BUILD SUCCESS。
This commit is contained in:
2026-09-20 18:04:43 +08:00
762 changed files with 58612 additions and 3373 deletions
+16
View File
@@ -25,6 +25,10 @@
<groupId>org.springblade</groupId>
<artifactId>blade-scope-api</artifactId>
</exclusion>
<exclusion>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<groupId>org.springframework.cloud</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -59,10 +63,22 @@
<groupId>org.springblade</groupId>
<artifactId>blade-user-api</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-dict-api</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-mk-api</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-wechat-api</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-resource-api</artifactId>
@@ -43,6 +43,8 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
public class AuthApplication {
public static void main(String[] args) {
// 禁用框架注入的nacos import配置、config、discovery 配置
BladeApplication.disableNacosLaunchConfig();
BladeApplication.run(AppConstant.APPLICATION_AUTH_NAME, AuthApplication.class, args);
}
@@ -25,6 +25,7 @@
*/
package org.springblade.auth.config;
import org.springblade.auth.granter.IamAwareTokenGranterFactory;
import org.springblade.auth.handler.BladeAuthorizationHandler;
import org.springblade.auth.handler.BladeLockHandler;
import org.springblade.auth.handler.BladeLogHandler;
@@ -37,6 +38,9 @@ import org.springblade.core.jwt.props.JwtProperties;
import org.springblade.core.launch.props.BladeProperties;
import org.springblade.core.launch.server.ServerInfo;
import org.springblade.core.oauth2.config.OAuth2AutoConfiguration;
import org.springblade.core.oauth2.granter.TokenGranter;
import org.springblade.core.oauth2.granter.TokenGranterEnhancer;
import org.springblade.core.oauth2.granter.TokenGranterFactory;
import org.springblade.core.oauth2.handler.AuthorizationHandler;
import org.springblade.core.oauth2.handler.PasswordHandler;
import org.springblade.core.oauth2.handler.TokenHandler;
@@ -51,8 +55,11 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
/**
* BladeAuthConfiguration
*
@@ -101,4 +108,12 @@ public class BladeAuthConfiguration {
return new BladeUserDetailService(userClient);
}
@Primary
@Bean("iamAwareTokenGranterFactory")
public TokenGranterFactory tokenGranterFactory(List<TokenGranter> tokenGranters,
List<TokenGranterEnhancer> tokenGranterEnhancers,
OAuth2Properties properties) {
return new IamAwareTokenGranterFactory(tokenGranters, tokenGranterEnhancers, properties);
}
}
@@ -32,4 +32,10 @@ package org.springblade.auth.constant;
*/
public interface BladeAuthConstant {
/**
* 小程序/登录短信验证码资源编号(对应后台 /resource/sms 的 smsCode
*/
String LOGIN_SMS_CODE = "ali_reg";
}
@@ -26,6 +26,7 @@
package org.springblade.auth.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.Data;
import java.util.Map;
@@ -43,6 +44,13 @@ public class IamSsoProfileResponse {
*/
private String id;
/**
* IAM返回的本系统账号,部分部署直接返回在顶层。
*/
@JsonProperty("account_no")
@JsonAlias({"accountNo", "account", "username", "user_name"})
private String accountNo;
/**
* IAM用户扩展属性
*/
@@ -54,12 +62,20 @@ public class IamSsoProfileResponse {
* @return 本系统账号
*/
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
public String getAccountNo() {
if (attributes == null) {
return null;
public String resolveAccountNo() {
if (accountNo != null && !accountNo.isBlank()) {
return accountNo;
}
Object accountNo = attributes.get("account_no");
return accountNo == null ? null : String.valueOf(accountNo);
if (attributes == null) {
return id;
}
for (String key : new String[]{"account_no", "accountNo", "account", "username", "user_name"}) {
Object value = attributes.get(key);
if (value != null && !String.valueOf(value).isBlank()) {
return String.valueOf(value);
}
}
return id;
}
}
@@ -27,6 +27,7 @@ package org.springblade.auth.endpoint;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.security.PermitAll;
import jakarta.servlet.http.HttpServletRequest;
import lombok.AllArgsConstructor;
import org.springblade.core.oauth2.endpoint.OAuth2TokenEndPoint;
@@ -60,6 +61,7 @@ public class IamSsoEndpoint {
* @return token
*/
@RequestMapping(value = "/token", method = {RequestMethod.GET, RequestMethod.POST})
@PermitAll
@Operation(summary = "IAM统一身份认证登录", description = "使用IAM授权码换取本系统Token")
public ResponseEntity<Kv> token(HttpServletRequest request) {
String grantType = request.getParameter("grant_type");
@@ -0,0 +1,68 @@
package org.springblade.auth.endpoint;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.oauth2.endpoint.AbstractOAuth2MKEndpoint;
import org.springblade.core.oauth2.granter.TokenGranterFactory;
import org.springblade.core.oauth2.handler.TokenHandler;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.UrlUtil;
import org.springblade.thirdparty.mk.config.MKProperties;
import org.springblade.thirdparty.mk.service.IMKService;
import org.springframework.web.bind.annotation.RestController;
import java.util.stream.Stream;
/**
* @author bfhuange
* @date 2024/9/17
*/
@RestController
@Slf4j
@Tag(name = "跳转mk认证", description = "跳转mk认证端点")
public class OAuth2MKEndpoint extends AbstractOAuth2MKEndpoint {
/**
* 登录链接
*/
private static final String LOGIN_URL_FORMAT = "%s%s?appId=%s&redirection_url=%s";
private final MKProperties mkProperties;
private final IMKService mkService;
public OAuth2MKEndpoint(TokenGranterFactory granterFactory, TokenHandler tokenHandler, MKProperties mkProperties, IMKService mkService) {
super(granterFactory, tokenHandler);
this.mkProperties = mkProperties;
this.mkService = mkService;
}
@Override
protected String generateLoginUrl(String refererUrl) {
// 重定向到来源
return String.format(LOGIN_URL_FORMAT, mkProperties.getLoginUrl(), mkProperties.getMkSsoLoginUrl(), mkProperties.getOauthAppId(), UrlUtil.encode(refererUrl));
}
@Override
protected String getAccountByMkCode(String mkCode) {
return mkService.getMKAccount(mkCode);
}
@Override
protected boolean checkRefererUrl(String refererUrl) {
if (!mkProperties.isCheckReferer()) {
// 未开启校验来源,校验通过
return true;
}
if (StringUtil.isBlank(mkProperties.getErpBaseUrls())) {
log.error("未配置erp地址,无法校验来源");
return false;
}
if (StringUtil.isBlank(refererUrl)) {
// 来源地址为空,通过,以便用于调试
return true;
}
// 匹配到一个erp基础地址就行了
return Stream.of(mkProperties.getErpBaseUrls().split(","))
.map(String::trim)
.anyMatch(refererUrl::startsWith);
}
}
@@ -0,0 +1,94 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.auth.endpoint;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.oauth2.endpoint.OAuth2TokenEndPoint;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.feign.ISysClient;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
import java.util.Collections;
import java.util.List;
/**
* 增强 /oauth/user-info 响应,补充 permission 权限标识字段
*
* @author Chill
*/
@Slf4j
@RequiredArgsConstructor
@RestControllerAdvice(assignableTypes = OAuth2TokenEndPoint.class)
public class OAuth2UserInfoResponseAdvice implements ResponseBodyAdvice<Object> {
private final ISysClient sysClient;
@Override
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
return returnType.getMethod() != null && "userInfo".equals(returnType.getMethod().getName());
}
@Override
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType,
Class<? extends HttpMessageConverter<?>> selectedConverterType,
ServerHttpRequest request, ServerHttpResponse response) {
if (!(body instanceof BladeUser bladeUser)) {
return body;
}
OAuth2UserInfoVO userInfo = BeanUtil.copyProperties(bladeUser, OAuth2UserInfoVO.class);
if (userInfo == null) {
return body;
}
userInfo.setPermission(loadPermission(bladeUser.getRoleId()));
return userInfo;
}
private List<String> loadPermission(String roleId) {
if (Func.isBlank(roleId)) {
return Collections.emptyList();
}
try {
R<List<String>> result = sysClient.getPermissions(roleId);
if (result != null && result.isSuccess() && result.getData() != null) {
return result.getData();
}
} catch (Exception exception) {
log.warn("加载用户权限标识失败, roleId={}", roleId, exception);
}
return Collections.emptyList();
}
}
@@ -0,0 +1,55 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.auth.endpoint;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.secure.BladeUser;
import java.io.Serial;
import java.util.List;
/**
* OAuth用户信息(含权限标识,供小程序等客户端使用)
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "OAuth用户信息")
public class OAuth2UserInfoVO extends BladeUser {
@Serial
private static final long serialVersionUID = 1L;
/**
* 权限标识集合(菜单按钮 code)
*/
@Schema(description = "权限标识集合")
private List<String> permission;
}
@@ -28,13 +28,14 @@ package org.springblade.auth.endpoint;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.springblade.auth.constant.BladeAuthConstant;
import org.springblade.core.oauth2.props.OAuth2Properties;
import org.springblade.core.oauth2.provider.OAuth2Request;
import org.springblade.core.oauth2.service.OAuth2User;
import org.springblade.core.oauth2.service.OAuth2UserService;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SM2Util;
import org.springblade.core.tool.utils.StringPool;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.resource.feign.ISmsClient;
import org.springblade.resource.utils.SmsUtil;
@@ -73,11 +74,14 @@ public class Oauth2SmsEndpoint {
* 短信验证码发送
*
* @param tenantId 租户ID
* @param phone 手机号
* @param phone 手机号SM2 加密)
* @param code 短信资源编号,默认 ali_reg(后台 /resource/sms
*/
@SneakyThrows
@PostMapping("/oauth/sms/send-validate")
public R sendValidate(@RequestParam String tenantId, @RequestParam String phone) {
public R sendValidate(@RequestParam String tenantId,
@RequestParam String phone,
@RequestParam(required = false) String code) {
// 校验手机加密认证,防止恶意发送验证码
String decryptedPhone = SM2Util.decrypt(phone, properties.getPublicKey(), properties.getPrivateKey());
if (StringUtil.isBlank(decryptedPhone)) {
@@ -90,8 +94,9 @@ public class Oauth2SmsEndpoint {
if (oAuth2User == null) {
return R.fail(USER_PHONE_NOT_FOUND);
}
// 用户存在则发送验证码
R result = smsClient.sendValidate(tenantId, StringPool.EMPTY, decryptedPhone);
// 使用指定短信资源(默认 ali_reg)
String smsResourceCode = Func.toStr(code, BladeAuthConstant.LOGIN_SMS_CODE);
R result = smsClient.sendValidate(tenantId, smsResourceCode, decryptedPhone);
return result.isSuccess() ? R.data(result.getData(), SmsUtil.SEND_SUCCESS) : R.fail(SmsUtil.SEND_FAIL);
}
@@ -0,0 +1,13 @@
package org.springblade.auth.exception;
import org.springblade.auth.endpoint.OAuth2MKEndpoint;
import org.springblade.core.oauth2.exception.OAuth2ExceptionHandler;
import org.springframework.web.bind.annotation.ControllerAdvice;
/**
* @author bfhuange
* @date 2024/10/16
*/
@ControllerAdvice(basePackageClasses = OAuth2MKEndpoint.class)
public class OAuth2MKExceptionHandler extends OAuth2ExceptionHandler {
}
@@ -45,6 +45,7 @@ import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.StringPool;
import org.springblade.system.cache.DictCache;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.pojo.entity.User;
import org.springblade.system.pojo.entity.UserInfo;
@@ -65,8 +66,10 @@ import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.Base64;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@@ -82,8 +85,10 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
private static final String GRANT_TYPE = "iam_sso";
private static final String IAM_GRANT_TYPE = "authorization_code";
private static final String IAM_TOKEN_URI = "/iam/sso/token";
private static final String BEARER_PREFIX = "Bearer ";
private static final String BASIC_PREFIX = "Basic ";
private static final String IAM_DEFAULT_DICT_CODE = "iam_default";
private static final String IAM_DEFAULT_ROLE_NAME = "默认角色";
private static final String IAM_DEFAULT_DEPT_NAME = "默认部门";
private final OAuth2ClientService clientService;
private final IUserClient userClient;
@@ -141,7 +146,7 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
}
IamSsoProfileResponse profileResponse = requestIamProfile(accessToken);
String accountNo = profileResponse.getAccountNo();
String accountNo = profileResponse.resolveAccountNo();
if (StringUtil.isBlank(accountNo)) {
log.warn("IAM统一身份认证用户信息缺少account_noiamId={}", profileResponse.getId());
throw new UserInvalidException(OAuth2TokenConstant.USER_NOT_FOUND);
@@ -152,50 +157,98 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
log.warn("IAM统一身份认证请求缺少租户IDaccountNo={}", accountNo);
throw new UserInvalidException(OAuth2TokenConstant.USER_NOT_FOUND);
}
log.info("IAM统一身份认证开始匹配本系统账号,tenantId={}, accountNo={}", tenantId, accountNo);
UserInfo userInfo = loadOrCreateIamUser(request, profileResponse, tenantId, accountNo);
OAuth2User user = TokenUtil.convertUser(userInfo, request);
if (user == null) {
throw new UserInvalidException(OAuth2TokenConstant.USER_NOT_FOUND);
}
if (user.getAuthorities() == null || user.getAuthorities().isEmpty()) {
log.warn("IAM统一身份认证用户缺少可登录角色,tenantId={}, accountNo={}", tenantId, accountNo);
throw new UserInvalidException(OAuth2TokenConstant.USER_HAS_NO_ROLE);
}
user.setClient(client(request));
return user;
}
private UserInfo loadOrCreateIamUser(OAuth2Request request, IamSsoProfileResponse profileResponse, String tenantId, String accountNo) {
R<UserInfo> result = userClient.userInfo(tenantId, accountNo);
if (result.isSuccess() && result.getData() != null) {
if (result.isSuccess() && hasLoginAccess(result.getData())) {
return result.getData();
}
log.info("IAM统一身份认证未匹配到本系统账号,开始自动创建用户,tenantId={}, accountNo={}", tenantId, accountNo);
R<Boolean> saveResult = userClient.saveUser(buildIamUser(profileResponse, tenantId, accountNo));
if (result.isSuccess() && hasUser(result.getData())) {
log.info("IAM统一身份认证账号缺少有效角色或部门,开始补齐默认配置,tenantId={}, accountNo={}", tenantId, accountNo);
} else {
log.info("IAM统一身份认证未匹配到本系统账号,开始自动创建用户,tenantId={}, accountNo={}, querySuccess={}",
tenantId, accountNo, result.isSuccess());
}
R<Boolean> saveResult = userClient.saveIamUser(buildIamUser(profileResponse, tenantId, accountNo));
if (!saveResult.isSuccess() || !Boolean.TRUE.equals(saveResult.getData())) {
log.warn("IAM统一身份认证自动创建用户失败,tenantId={}, accountNo={}, msg={}", tenantId, accountNo, saveResult.getMsg());
throw new UserInvalidException(OAuth2TokenConstant.USER_NOT_FOUND);
String failMsg = StringUtil.isNotBlank(saveResult.getMsg()) ? saveResult.getMsg() : OAuth2TokenConstant.USER_HAS_NO_ROLE;
log.warn("IAM统一身份认证自动创建或补齐用户失败,tenantId={}, accountNo={}, msg={}", tenantId, accountNo, failMsg);
throw new UserInvalidException(failMsg);
}
R<UserInfo> createdResult = userClient.userInfo(tenantId, accountNo);
if (!createdResult.isSuccess() || createdResult.getData() == null) {
if (!createdResult.isSuccess() || !hasUser(createdResult.getData())) {
log.warn("IAM统一身份认证自动创建用户后未查询到用户,tenantId={}, accountNo={}", tenantId, accountNo);
throw new UserInvalidException(OAuth2TokenConstant.USER_NOT_FOUND);
}
if (!hasRoles(createdResult.getData())) {
log.warn("IAM统一身份认证自动创建用户后仍缺少可登录角色,tenantId={}, accountNo={}", tenantId, accountNo);
throw new UserInvalidException(OAuth2TokenConstant.USER_HAS_NO_ROLE);
}
return createdResult.getData();
}
/**
* Feign 返回成功时,data 仍可能是一个 user 为空的 UserInfo 包装对象。
* IAM 登录必须确保本地用户实体存在,避免被误报为密码校验失败。
*/
private boolean hasUser(UserInfo userInfo) {
return userInfo != null && userInfo.getUser() != null;
}
private boolean hasRoles(UserInfo userInfo) {
return userInfo != null && userInfo.getRoles() != null && !userInfo.getRoles().isEmpty();
}
private boolean hasLoginAccess(UserInfo userInfo) {
return hasUser(userInfo) && hasRoles(userInfo) && hasValidAssignment(userInfo.getUser());
}
private boolean hasValidAssignment(User user) {
return StringUtil.isNotBlank(user.getRoleId())
&& !StringPool.MINUS_ONE.equals(user.getRoleId())
&& StringUtil.isNotBlank(user.getDeptId())
&& !StringPool.MINUS_ONE.equals(user.getDeptId());
}
private User buildIamUser(IamSsoProfileResponse profileResponse, String tenantId, String accountNo) {
User user = new User();
user.setTenantId(tenantId);
user.setUserType(UserType.WEB.getCategory());
user.setAccount(accountNo);
user.setPassword(accountNo);
user.setPassword(UUID.randomUUID().toString());
user.setName(accountNo);
user.setRealName(accountNo);
user.setRoleId(StringPool.MINUS_ONE);
user.setDeptId(StringPool.MINUS_ONE);
user.setRoleId(resolveIamDefaultId(IAM_DEFAULT_ROLE_NAME));
user.setDeptId(resolveIamDefaultId(IAM_DEFAULT_DEPT_NAME));
user.setPostId(StringPool.MINUS_ONE);
user.setIsOa(1);
user.setSyncTime(new Date());
user.setStatus(StatusType.ACTIVE.getType());
log.info("IAM统一身份认证自动创建用户参数,tenantId={}, accountNo={}, iamId={}", tenantId, accountNo, profileResponse.getId());
return user;
}
private String resolveIamDefaultId(String dictValue) {
String dictKey = DictCache.getKey(IAM_DEFAULT_DICT_CODE, dictValue);
if (StringUtil.isBlank(dictKey) || StringPool.MINUS_ONE.equals(dictKey)) {
throw new UserInvalidException(StringUtil.format("IAM默认配置 [{}] 未配置有效键值", dictValue));
}
return dictKey;
}
public boolean supports(OAuth2Request request) {
return isIamRequest(request, false);
}
@@ -206,13 +259,13 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
}
private boolean isIamRequest(OAuth2Request request, boolean logMiss) {
String redirectUri = normalizeRedirectUri(request.getRedirectUri());
boolean iamRequest = StringUtil.isNotBlank(properties.getRedirectUri())
String redirectUri = resolveRedirectUri(request);
boolean iamRequest = StringUtil.isNotBlank(redirectUri)
&& StringUtil.isNotBlank(request.getCode())
&& StringUtil.equals(properties.getRedirectUri(), redirectUri);
&& isDedicatedIamEndpoint(request);
if (!iamRequest && logMiss) {
log.info("IAM统一身份认证请求未命中,configRedirectUri={}, requestRedirectUri={}, normalizedRedirectUri={}, code={}",
properties.getRedirectUri(), request.getRedirectUri(), redirectUri, request.getCode());
log.info("IAM统一身份认证请求未命中,configRedirectUri={}, requestRedirectUri={}, normalizedRedirectUri={}, hasCode={}",
properties.getRedirectUri(), request.getRedirectUri(), redirectUri, StringUtil.isNotBlank(request.getCode()));
}
return iamRequest;
}
@@ -247,8 +300,7 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
properties.getTokenUrl(),
properties.getProfileUrl(),
properties.getClientId(),
properties.getClientSecret(),
properties.getRedirectUri()
properties.getClientSecret()
)) {
throw new UserInvalidException("IAM统一身份认证配置不完整");
}
@@ -265,7 +317,7 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
.header(HttpHeaders.AUTHORIZATION, authorizationHeader())
.POST(HttpRequest.BodyPublishers.ofString(tokenBody, StandardCharsets.UTF_8))
.build();
log.info("IAM统一身份认证换取Token请求,method={}, headers={}, body={}", httpRequest.method(), httpRequest.headers().map(), tokenBody);
log.info("IAM统一身份认证换取Token请求,url={}, method={}", properties.getTokenUrl(), httpRequest.method());
HttpResponse<String> response = httpClient.send(
httpRequest,
HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)
@@ -286,20 +338,24 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
private IamSsoProfileResponse requestIamProfile(String accessToken) {
try {
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(buildProfileUrl(accessToken)))
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(URI.create(buildProfileUrl(accessToken)))
.timeout(Duration.ofSeconds(10))
.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE)
.header(HttpHeaders.AUTHORIZATION, profileAuthorizationHeader(accessToken))
.GET()
.build();
log.info("IAM统一身份认证获取用户信息请求,headers={}, body={}", httpRequest.headers().map(), "");
// 与 IAM 同步接口一致:Authorization 走网关凭证,Auth 走业务凭证。
.header(HttpHeaders.AUTHORIZATION, authorizationHeader());
String profileAuthHeader = profileAuthHeader();
if (StringUtil.isNotBlank(profileAuthHeader)) {
requestBuilder.header("Auth", profileAuthHeader);
}
HttpRequest httpRequest = requestBuilder.GET().build();
log.info("IAM统一身份认证获取用户信息请求,url={}, method={}", properties.getProfileUrl(), httpRequest.method());
HttpResponse<String> response = httpClient.send(
httpRequest,
HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)
);
log.info("IAM统一身份认证获取用户信息响应,headers={}, body={}", response.headers().map(), response.body());
log.info("IAM统一身份认证获取用户信息响应,status={}", response.statusCode());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
log.warn("IAM统一身份认证获取用户信息失败,status={}", response.statusCode());
log.warn("IAM统一身份认证获取用户信息失败,status={}, body={}", response.statusCode(), response.body());
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
}
return objectMapper.readValue(response.body(), IamSsoProfileResponse.class);
@@ -321,10 +377,24 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
if (StringUtil.isNotBlank(request.getState())) {
params.put("state", request.getState());
}
params.put("redirect_uri", properties.getRedirectUri());
params.put("redirect_uri", resolveRedirectUri(request));
return params;
}
/**
* 获取 IAM 回调地址,优先使用前端请求传入的值,兼容未传参时的后端默认配置。
*
* @param request OAuth2 请求
* @return IAM 回调地址
*/
private String resolveRedirectUri(OAuth2Request request) {
String requestRedirectUri = normalizeRedirectUri(request.getRedirectUri());
if (StringUtil.isNotBlank(requestRedirectUri)) {
return requestRedirectUri;
}
return normalizeRedirectUri(properties.getRedirectUri());
}
private String buildTokenBody(Map<String, String> params) {
return params.entrySet().stream()
.map(entry -> encode(entry.getKey()) + "=" + encode(entry.getValue()))
@@ -353,11 +423,15 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
return BASIC_PREFIX + authorization;
}
private String profileAuthorizationHeader(String accessToken) {
if (StringUtil.isNotBlank(properties.getProfileAuthorization())) {
return withBasicPrefix(properties.getProfileAuthorization());
/**
* IAM 业务侧 Auth 头。网关 Authorization 使用 {@link #authorizationHeader()}
* 用户令牌通过 query 参数 access_token 传递。
*/
private String profileAuthHeader() {
if (StringUtil.isBlank(properties.getProfileAuthorization())) {
return null;
}
return BEARER_PREFIX + accessToken;
return withBasicPrefix(properties.getProfileAuthorization());
}
private String encode(String value) {
@@ -26,6 +26,7 @@
package org.springblade.auth.granter;
import jakarta.servlet.http.HttpServletRequest;
import org.springblade.auth.constant.BladeAuthConstant;
import org.springblade.core.oauth2.constant.OAuth2TokenConstant;
import org.springblade.core.oauth2.exception.UserInvalidException;
import org.springblade.core.oauth2.granter.AbstractTokenGranter;
@@ -37,8 +38,8 @@ import org.springblade.core.oauth2.service.OAuth2User;
import org.springblade.core.oauth2.service.OAuth2UserService;
import org.springblade.core.sms.model.SmsCode;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SM2Util;
import org.springblade.core.tool.utils.StringPool;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.WebUtil;
import org.springblade.resource.feign.ISmsClient;
@@ -78,8 +79,10 @@ public class SmsTokenGranter extends AbstractTokenGranter {
if (StringUtil.isBlank(decryptedPhone)) {
throw new UserInvalidException(OAuth2TokenConstant.USER_PHONE_NOT_FOUND);
}
// 获取短信验证信息
R result = smsClient.validateMessage(tenantId, StringPool.EMPTY, smsCode.getId(), smsCode.getValue(), decryptedPhone);
// 与发送时使用同一短信资源编号(默认 ali_reg)
HttpServletRequest httpRequest = WebUtil.getRequest();
String smsResourceCode = Func.toStr(httpRequest.getParameter("code"), BladeAuthConstant.LOGIN_SMS_CODE);
R result = smsClient.validateMessage(tenantId, smsResourceCode, smsCode.getId(), smsCode.getValue(), decryptedPhone);
if (!result.isSuccess()) {
throw new UserInvalidException(OAuth2TokenConstant.CAPTCHA_NOT_CORRECT);
}
@@ -0,0 +1,102 @@
package org.springblade.auth.granter;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.oauth2.exception.UserInvalidException;
import org.springblade.core.oauth2.granter.AbstractTokenGranter;
import org.springblade.core.oauth2.handler.PasswordHandler;
import org.springblade.core.oauth2.provider.OAuth2Request;
import org.springblade.core.oauth2.service.OAuth2ClientService;
import org.springblade.core.oauth2.service.OAuth2User;
import org.springblade.core.oauth2.service.OAuth2UserService;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.WebUtil;
import org.springblade.system.feign.IUserClient;
import org.springblade.thirdparty.wechat.constant.WechatMiniConstant;
import org.springblade.thirdparty.wechat.exception.WechatMiniException;
import org.springblade.thirdparty.wechat.pojo.vo.WechatPhoneVO;
import org.springblade.thirdparty.wechat.pojo.vo.WechatSessionVO;
import org.springblade.thirdparty.wechat.service.IWechatMiniService;
import org.springframework.stereotype.Component;
/**
* 微信小程序手机号一键登录。
* <p>
* grant_type=wechat_applet,参数:loginCodewx.login)、phoneCodegetPhoneNumber)。
* 流程:换 openid + 手机号 → 按手机号查用户(不存在则拒绝)→ 记录 openid → 发令牌(与密码登录一致)。
*/
@Slf4j
@Component
public class WechatMiniTokenGranter extends AbstractTokenGranter {
private final OAuth2UserService userService;
private final IWechatMiniService wechatMiniService;
private final IUserClient userClient;
public WechatMiniTokenGranter(OAuth2ClientService clientService,
OAuth2UserService userService,
PasswordHandler passwordHandler,
IWechatMiniService wechatMiniService,
IUserClient userClient) {
super(clientService, userService, passwordHandler);
this.userService = userService;
this.wechatMiniService = wechatMiniService;
this.userClient = userClient;
}
@Override
public String type() {
return WechatMiniConstant.GRANT_TYPE;
}
@Override
public OAuth2User user(OAuth2Request request) {
// 先校验客户端是否允许该授权类型,避免先调微信再因客户端配置失败
var oauthClient = client(request);
HttpServletRequest httpRequest = WebUtil.getRequest();
String loginCode = httpRequest.getParameter("loginCode");
String phoneCode = httpRequest.getParameter("phoneCode");
if (StringUtil.isBlank(loginCode) || StringUtil.isBlank(phoneCode)) {
throw new UserInvalidException("微信登录参数不完整");
}
WechatSessionVO session;
WechatPhoneVO phoneInfo;
try {
session = wechatMiniService.code2Session(loginCode);
phoneInfo = wechatMiniService.getPhoneNumber(phoneCode);
} catch (WechatMiniException e) {
log.warn("微信小程序登录失败: {}", e.getMessage());
throw new UserInvalidException(e.getMessage());
}
String phone = Func.toStr(phoneInfo.getPurePhoneNumber(), phoneInfo.getPhoneNumber());
if (StringUtil.isBlank(phone)) {
throw new UserInvalidException("未获取到微信手机号");
}
OAuth2User user = userService.loadByPhone(phone, request);
if (!userService.validateUser(user)) {
throw new UserInvalidException("用户不存在,无法登录");
}
R<Boolean> bindResult = userClient.bindWxMiniOpenId(
request.getTenantId(),
Func.toLong(user.getUserId()),
session.getOpenid(),
phone
);
if (bindResult == null || !bindResult.isSuccess()) {
String msg = bindResult != null ? bindResult.getMsg() : "绑定 openid 失败";
log.warn("绑定微信 openid 失败 userId={} openid={} msg={}", user.getUserId(), session.getOpenid(), msg);
throw new UserInvalidException(StringUtil.isBlank(msg) ? "绑定 openid 失败" : msg);
}
user.setClient(oauthClient);
return user;
}
}
@@ -40,6 +40,7 @@ import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.DesUtil;
import org.springblade.core.tool.utils.SM2Util;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.SysCache;
import org.springblade.system.pojo.entity.Tenant;
@@ -74,6 +75,10 @@ public class BladeAuthorizationHandler extends AbstractAuthorizationHandler {
*/
@Override
public OAuth2Validation preValidation(OAuth2Request request) {
// IAM授权码已经由外部身份系统完成认证,不读取或校验本地密码。
if (StringUtil.equals("iam_sso", request.getGrantType())) {
return new OAuth2Validation();
}
if (request.isPassword() || request.isCaptchaCode()) {
// 生产环境弱密码校验
if (bladeProperties.isProd() && isWeakPassword(request.getPassword())) {
@@ -149,7 +154,11 @@ public class BladeAuthorizationHandler extends AbstractAuthorizationHandler {
*/
@Override
public void authFailure(OAuth2User user, OAuth2Request request, OAuth2Validation validation) {
// 自定义认证失败回调
log.error("用户:{},认证失败,失败原因:{}grantType={}authorities={}",
user == null ? request.getUsername() : user.getAccount(),
validation.getMessage(),
request.getGrantType(),
user == null ? null : user.getAuthorities());
}
/**
@@ -78,7 +78,8 @@ public class IamSsoProperties {
private String authorization;
/**
* IAM用户信息认证头。为空时默认使用 Bearer accessToken
* IAM业务侧 Auth 请求头。为空时不传 Auth;
* Authorization 统一使用网关凭证 {@link #authorization}。
*/
private String profileAuthorization;
@@ -25,11 +25,17 @@
*/
package org.springblade.auth.service;
import org.springblade.core.oauth2.constant.OAuth2GranterConstant;
import org.springblade.core.oauth2.provider.OAuth2Request;
import org.springblade.core.oauth2.service.OAuth2Client;
import org.springblade.core.oauth2.service.impl.OAuth2ClientDetailService;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringPool;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.Arrays;
import java.util.Optional;
/**
* BladeClientDetailService
*
@@ -57,6 +63,13 @@ public class BladeClientDetailService extends OAuth2ClientDetailService {
@Override
public boolean validateGranter(OAuth2Client client, String grantType) {
return super.validateGranter(client, grantType);
// 微信小程序一键登录:兼容库表未配置 wechat_applet 的存量客户端
if (OAuth2GranterConstant.WECHAT_APPLET.equals(grantType) || "wechat_mini".equals(grantType)) {
return true;
}
return Optional.ofNullable(client)
.map(c -> Arrays.stream(Func.split(c.getAuthorizedGrantTypes(), StringPool.COMMA))
.anyMatch(s -> s.trim().equals(grantType)))
.orElse(false);
}
}
@@ -1,15 +0,0 @@
#服务器端口
server:
port: 8100
#数据源配置
spring:
datasource:
url: ${blade.datasource.dev.url}
username: ${blade.datasource.dev.username}
password: ${blade.datasource.dev.password}
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
@@ -1,15 +0,0 @@
#服务器端口
server:
port: 8100
#数据源配置
spring:
datasource:
url: ${blade.datasource.prod.url}
username: ${blade.datasource.prod.username}
password: ${blade.datasource.prod.password}
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
@@ -1,15 +0,0 @@
#服务器端口
server:
port: 8100
#数据源配置
spring:
datasource:
url: ${blade.datasource.test.url}
username: ${blade.datasource.test.username}
password: ${blade.datasource.test.password}
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
+40 -1
View File
@@ -1,6 +1,30 @@
# 在使用Spring默认数据源Hikari的情况下配置以下配置项
#服务器端口
server:
port: 8100
spring:
application:
name: blade-auth
config:
import:
- nacos:blade.yaml?group=DEFAULT_GROUP&refreshEnabled=true
- nacos:blade-${spring.profiles.active}.yaml?group=DEFAULT_GROUP&refreshEnabled=true
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml?group=DEFAULT_GROUP&refreshEnabled=true
cloud:
nacos:
username: ${NACOS_USERNAME:${NACOS_PROD_USERNAME:nacos}}
password: ${NACOS_PASSWORD:${NACOS_PROD_PASSWORD:nacos}}
server-addr: ${NACOS_HOST:${NACOS_PROD_HOST:127.0.0.1:8848}}
discovery:
namespace: "${NACOS_NAMESPACE:}"
config:
# 文件后缀名
file-extension: yaml
namespace: "${NACOS_NAMESPACE:}"
datasource:
url: ${blade.datasource.${spring.profiles.active}.url}
username: ${blade.datasource.${spring.profiles.active}.username}
password: ${blade.datasource.${spring.profiles.active}.password}
# 在使用Spring默认数据源Hikari的情况下配置以下配置项
hikari:
# 自动提交从池中返回的连接
auto-commit: true
@@ -42,6 +66,8 @@ swagger:
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
oauth:
GITHUB:
client-id: 233************
@@ -63,3 +89,16 @@ social:
client-id: 233************
client-secret: 233************************************
redirect-uri: ${social.domain}/oauth/redirect/dingtalk
# IAM统一身份认证
iam:
sso:
token-url: ${IAM_SSO_TOKEN_URL:http://172.16.204.83:38000/gwzh/IAM/IAM_SSO_TOKEN}
profile-url: ${IAM_SSO_PROFILE_URL:http://172.16.204.83:38000/gwzh/IAM/IAM_SSO_PROFILE}
client-id: ${IAM_SSO_CLIENT_ID:f0b52f23f71b1649c468}
client-secret: ${IAM_SSO_CLIENT_SECRET:5b3d8575f0899946623ab86523ac3dd8ee98}
system-client-id: ${IAM_SSO_SYSTEM_CLIENT_ID:saber3}
system-client-secret: ${IAM_SSO_SYSTEM_CLIENT_SECRET:saber3_secret}
redirect-uri: ${IAM_SSO_REDIRECT_URI:http://172.16.203.228:8000/callback}
authorization: ${IAM_SSO_AUTHORIZATION:Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=}
profile-authorization: ${IAM_SSO_PROFILE_AUTHORIZATION:YjNlZmU0ODEwMzJiNGJhZTpkYzQ5NDY1NmQ4MzE0NThjODI5MzlmNzA2ZjliNDY3MQ==}
@@ -54,6 +54,12 @@ public interface LauncherConstant {
*/
String NACOS_PROD_ADDR = "172.16.203.228:8848";
String NACOS_PROD_HOST = "172.16.203.228:8848";
String NACOS_PROD_USERNAME = "nacos";
String NACOS_PROD_PASSWORD = "nacosTMS";
/**
* nacos test 地址
*/
@@ -156,13 +162,42 @@ public interface LauncherConstant {
* @return addr
*/
static String nacosAddr(String profile) {
String profileKey = profile == null ? "" : profile.toUpperCase();
String profileAddr = env("NACOS_" + profileKey + "_HOST");
if (profileAddr != null) return profileAddr;
String configuredAddr = env("NACOS_HOST");
if (configuredAddr != null) return configuredAddr;
return switch (profile) {
case (AppConstant.PROD_CODE) -> NACOS_PROD_ADDR;
case (AppConstant.PROD_CODE) -> NACOS_PROD_HOST;
case (AppConstant.TEST_CODE) -> NACOS_TEST_ADDR;
default -> NACOS_DEV_ADDR;
};
}
static String nacosUsername(String profile) {
String profileKey = profile == null ? "" : profile.toUpperCase();
String value = env("NACOS_" + profileKey + "_USERNAME");
if (value != null) return value;
value = env("NACOS_USERNAME");
if (value != null) return value;
return AppConstant.PROD_CODE.equals(profile) ? NACOS_PROD_USERNAME : NACOS_USERNAME;
}
static String nacosPassword(String profile) {
String profileKey = profile == null ? "" : profile.toUpperCase();
String value = env("NACOS_" + profileKey + "_PASSWORD");
if (value != null) return value;
value = env("NACOS_PASSWORD");
if (value != null) return value;
return AppConstant.PROD_CODE.equals(profile) ? NACOS_PROD_PASSWORD : NACOS_PASSWORD;
}
static String env(String name) {
String value = System.getProperty(name);
if (value == null || value.isBlank()) value = System.getenv(name);
return value == null || value.isBlank() ? null : value.trim();
}
/**
* 动态获取sentinel地址
*
@@ -57,6 +57,27 @@ import java.util.Objects;
*/
public class ImportFailureExcelUtil {
public static String formatErrorMessage(List<String> validationErrors) {
StringBuilder errorMessage = new StringBuilder();
for (int index = 0; index < validationErrors.size(); index++) {
if (index > 0) {
errorMessage.append(System.lineSeparator());
}
errorMessage.append(index + 1).append(". ").append(validationErrors.get(index));
}
return errorMessage.toString();
}
public static void addValidationError(List<String> validationErrors, boolean invalid, String message) {
if (invalid && message != null && !message.isBlank() && !validationErrors.contains(message)) {
validationErrors.add(message);
}
}
public static void addLengthValidationError(List<String> validationErrors, String value, int maxLength, String message) {
addValidationError(validationErrors, value != null && value.length() > maxLength, message);
}
private static final String FAILURE_REASON = "导入失败原因";
private static final String ERROR_MESSAGE_FIELD = "errorMessage";
private static final String FAILURE_REASON_FIELD = "failureReason";
@@ -74,6 +95,20 @@ public class ImportFailureExcelUtil {
* @param excelClass 原导入 Excel 类型
*/
public static void export(HttpServletResponse response, String fileName, String sheetName, List<?> data, Class<?> excelClass) {
exportFailureReasonOnly(response, fileName, sheetName, data, excelClass);
}
/**
* 导出仅标红失败原因列的导入失败明细
*
* @param response 响应
* @param fileName 文件名
* @param sheetName 工作表名
* @param data 失败数据
* @param excelClass 原导入 Excel 类型
*/
public static void exportFailureReasonOnly(HttpServletResponse response, String fileName, String sheetName,
List<?> data, Class<?> excelClass) {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
String encodeFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
@@ -83,7 +118,7 @@ public class ImportFailureExcelUtil {
List<List<Object>> rows = buildRows(data, excelFields);
try {
FastExcel.write(response.getOutputStream())
.registerWriteHandler(new ImportFailureCellStyleHandler(excelFields, rows))
.registerWriteHandler(new ImportFailureCellStyleHandler(excelFields.size()))
.head(head)
.sheet(sheetName)
.doWrite(rows);
@@ -93,12 +128,20 @@ public class ImportFailureExcelUtil {
}
private static List<Field> excelFields(Class<?> excelClass) {
return Arrays.stream(excelClass.getDeclaredFields())
.filter(field -> field.getAnnotation(ExcelProperty.class) != null)
.filter(field -> field.getAnnotation(ExcelIgnore.class) == null)
.filter(field -> !Objects.equals(field.getName(), ERROR_MESSAGE_FIELD))
.filter(field -> !Objects.equals(field.getName(), FAILURE_REASON_FIELD))
.toList();
List<Class<?>> classHierarchy = new ArrayList<>();
for (Class<?> current = excelClass; current != null; current = current.getSuperclass()) {
classHierarchy.add(0, current);
}
List<Field> fields = new ArrayList<>();
for (Class<?> current : classHierarchy) {
Arrays.stream(current.getDeclaredFields())
.filter(field -> field.getAnnotation(ExcelProperty.class) != null)
.filter(field -> field.getAnnotation(ExcelIgnore.class) == null)
.filter(field -> !Objects.equals(field.getName(), ERROR_MESSAGE_FIELD))
.filter(field -> !Objects.equals(field.getName(), FAILURE_REASON_FIELD))
.forEach(fields::add);
}
return fields;
}
private static List<List<String>> buildHead(List<Field> excelFields) {
@@ -161,44 +204,15 @@ public class ImportFailureExcelUtil {
throw new NoSuchFieldException(String.join(",", fieldNames));
}
private static String columnName(Field field) {
ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
String[] value = excelProperty.value();
return value.length == 0 ? field.getName() : value[0];
}
private static String normalize(String value) {
return value == null ? "" : value.replaceAll("[\\s*_:,。;;()()\\[\\]【】<>《》-]", "").toLowerCase();
}
private static List<String> columnKeywords(Field field) {
String columnName = columnName(field);
List<String> keywords = new ArrayList<>();
keywords.add(columnName);
keywords.add(field.getName());
keywords.addAll(Arrays.asList(columnName.replace("*", "").split("[//、()()\\s]+")));
return keywords.stream()
.map(ImportFailureExcelUtil::normalize)
.filter(keyword -> keyword.length() >= 2)
.distinct()
.toList();
}
private static class ImportFailureCellStyleHandler implements CellWriteHandler {
private final List<List<String>> columnKeywords;
private final List<List<Object>> rows;
private final int failureReasonColumnIndex;
private final Map<Short, CellStyle> redStyleCache = new HashMap<>();
private final Map<Short, CellStyle> noWrapStyleCache = new HashMap<>();
private final Map<Integer, Integer> columnWidthCache = new HashMap<>();
private ImportFailureCellStyleHandler(List<Field> excelFields, List<List<Object>> rows) {
this.columnKeywords = excelFields.stream()
.map(ImportFailureExcelUtil::columnKeywords)
.toList();
this.rows = rows;
this.failureReasonColumnIndex = excelFields.size();
private ImportFailureCellStyleHandler(int failureReasonColumnIndex) {
this.failureReasonColumnIndex = failureReasonColumnIndex;
}
@Override
@@ -216,25 +230,11 @@ public class ImportFailureExcelUtil {
return;
}
adjustColumnWidth(cell);
if (relativeRowIndex == null || relativeRowIndex < 0 || relativeRowIndex >= rows.size()) {
return;
}
if (shouldMarkRed(relativeRowIndex, cell.getColumnIndex())) {
if (cell.getColumnIndex() == failureReasonColumnIndex) {
markRed(cell);
}
}
private boolean shouldMarkRed(int rowIndex, int columnIndex) {
if (columnIndex == failureReasonColumnIndex) {
return true;
}
if (columnIndex < 0 || columnIndex >= columnKeywords.size()) {
return false;
}
String failureReason = normalize(String.valueOf(rows.get(rowIndex).get(failureReasonColumnIndex)));
return columnKeywords.get(columnIndex).stream().anyMatch(failureReason::contains);
}
private void markRed(Cell cell) {
CellStyle currentStyle = cell.getCellStyle();
CellStyle redStyle = redStyleCache.computeIfAbsent(currentStyle.getIndex(), styleIndex -> {
@@ -244,6 +244,7 @@ public class ImportFailureExcelUtil {
Font font = workbook.createFont();
font.setColor(IndexedColors.RED.getIndex());
newStyle.setFont(font);
newStyle.setWrapText(true);
return newStyle;
});
cell.setCellStyle(redStyle);
@@ -27,6 +27,7 @@ package org.springblade.common.launch;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.auto.service.AutoService;
import org.springblade.core.launch.BladeApplication;
import org.springblade.core.launch.service.LauncherService;
import org.springblade.core.launch.utils.PropsUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -45,14 +46,24 @@ public class LauncherServiceImpl implements LauncherService {
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
Properties props = System.getProperties();
// nacos注册中心配置
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username", LauncherConstant.NACOS_USERNAME);
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password", LauncherConstant.NACOS_PASSWORD);
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
// nacos配置中心配置
PropsUtil.setProperty(props, "spring.cloud.nacos.config.username", LauncherConstant.NACOS_USERNAME);
PropsUtil.setProperty(props, "spring.cloud.nacos.config.password", LauncherConstant.NACOS_PASSWORD);
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
if (BladeApplication.isNacosConfigEnabled()) {
String nacosUsername = LauncherConstant.nacosUsername(profile);
String nacosPassword = LauncherConstant.nacosPassword(profile);
String nacosAddr = LauncherConstant.nacosAddr(profile);
// nacos公共配置,spring.config.import在配置中心和注册中心初始化前读取
PropsUtil.setProperty(props, "spring.cloud.nacos.username", nacosUsername);
PropsUtil.setProperty(props, "spring.cloud.nacos.password", nacosPassword);
PropsUtil.setProperty(props, "spring.cloud.nacos.server-addr", nacosAddr);
// nacos注册中心配置
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username", nacosUsername);
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password", nacosPassword);
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", nacosAddr);
// nacos配置中心配置
PropsUtil.setProperty(props, "spring.cloud.nacos.config.username", nacosUsername);
PropsUtil.setProperty(props, "spring.cloud.nacos.config.password", nacosPassword);
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", nacosAddr);
}
// sentinel配置
PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
// 多数据源配置
@@ -48,10 +48,12 @@ public class AuthProvider {
DEFAULT_SKIP_URL.add("/oauth/sms/**");
DEFAULT_SKIP_URL.add("/oauth/clear-cache/**");
DEFAULT_SKIP_URL.add("/oauth/user-info");
DEFAULT_SKIP_URL.add("/oauth/logout/**");
DEFAULT_SKIP_URL.add("/oauth/render/**");
DEFAULT_SKIP_URL.add("/oauth/callback/**");
DEFAULT_SKIP_URL.add("/oauth/revoke/**");
DEFAULT_SKIP_URL.add("/oauth/refresh/**");
DEFAULT_SKIP_URL.add("/oauth/mk/**");
DEFAULT_SKIP_URL.add("/token/**");
DEFAULT_SKIP_URL.add("/actuator/**");
DEFAULT_SKIP_URL.add("/v3/api-docs/**");
@@ -60,6 +62,11 @@ public class AuthProvider {
DEFAULT_SKIP_URL.add("/process/diagram-view");
DEFAULT_SKIP_URL.add("/manager/check-upload");
DEFAULT_SKIP_URL.add("/assets/**");
DEFAULT_SKIP_URL.add("/iam/sso/token/**");
DEFAULT_SKIP_URL.add("/blade-transport/customer-archive/public/**");
DEFAULT_SKIP_URL.add("/customer-archive/public/**");
DEFAULT_SKIP_URL.add("/blade-openapi/openApi/mk/process/commonCallback");
DEFAULT_SKIP_URL.add("/openApi/mk/process/commonCallback");
}
/**
+2 -2
View File
@@ -83,11 +83,11 @@
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
</dependency>-->
<!--Taobao-Sdk-->
<dependency>
<!-- <dependency>
<groupId>com.taobao</groupId>
<artifactId>taobao-sdk</artifactId>
<version>20201116</version>
</dependency>
</dependency>-->
</dependencies>
<build>
@@ -1,6 +1,6 @@
package org.springblade.openapi.mk.api;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.FR;
import org.springblade.openapi.mk.pojo.dto.Api4MKProcessApprovalDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -14,9 +14,6 @@ public interface IApi4MK {
String API_PREFIX = "/openApi/mk";
String PROCESS_API_PREFIX = API_PREFIX + "/process";
String PROCESS_FINISH_CALLBACK = PROCESS_API_PREFIX + "/finishCallback";
String PROCESS_APPROVAL_CALLBACK = PROCESS_API_PREFIX + "/approvalCallback";
String PROCESS_REJECT_CALLBACK = PROCESS_API_PREFIX + "/rejectCallback";
String PROCESS_REVOKE_CALLBACK = PROCESS_API_PREFIX + "/revokeCallback";
String PROCESS_COMMON_CALLBACK = PROCESS_API_PREFIX + "/commonCallback";
/**
@@ -25,7 +22,7 @@ public interface IApi4MK {
* @return
*/
@PostMapping(PROCESS_COMMON_CALLBACK)
R<Boolean> processCommonCallback(@RequestBody Api4MKProcessApprovalDTO param);
FR<Boolean> processCommonCallback(@RequestBody Api4MKProcessApprovalDTO param);
/**
* 流程结束回调接口
@@ -33,29 +30,5 @@ public interface IApi4MK {
* @return
*/
@PostMapping(PROCESS_FINISH_CALLBACK)
R<Boolean> processFinishCallback(@RequestBody Api4MKProcessApprovalDTO param);
/**
* 流程审批同意回调接口
* @param param
* @return
*/
@PostMapping(PROCESS_APPROVAL_CALLBACK)
R<Boolean> processApprovalCallback(@RequestBody Api4MKProcessApprovalDTO param);
/**
* 流程审批拒绝回调接口
* @param param
* @return
*/
@PostMapping(PROCESS_REJECT_CALLBACK)
R<Boolean> processRejectCallback(@RequestBody Api4MKProcessApprovalDTO param);
/**
* 流程撤销回调接口
* @param param
* @return
*/
@PostMapping(PROCESS_REVOKE_CALLBACK)
R<Boolean> processRevokeCallback(@RequestBody Api4MKProcessApprovalDTO param);
FR<Boolean> processFinishCallback(@RequestBody Api4MKProcessApprovalDTO param);
}
@@ -0,0 +1,30 @@
package org.springblade.openapi.mk.constant;
/**
* 流程当前处理人相关redis锁key常量类
* @author bfhuange
* @since 2026/4/9
*/
public class ProcessLockKeyConstant {
/**
* 任务缓存key前缀
*/
public static final String TASK_KEY_PREFIX = "process:cur-handler:task:";
/**
* 等待队列key
*/
public static final String WAITING_KEY = "process:cur-handler:waiting";
/**
* 流程锁key前缀
*/
public static final String PROCESS_LOCK_KEY_PREFIX = "process:cur-handler:lock:";
/**
* 派工锁key
*/
public static final String DISPATCH_LOCK_KEY = "process:cur-handler:dispatch-lock";
/**
* worker租约map key
*/
public static final String WORKER_LEASE_KEY = "process:cur-handler:worker-leases";
}
@@ -69,13 +69,4 @@ public class Api4MKProcessApprovalDTO implements Serializable {
*/
private String operatorLoginName;
//====================非mk回调参数,回调接口设置参数===================
/**
* 是否流程已完成,非mk回调参数,回调接口设置参数
*/
private boolean complete;
/**
* 审批状态,非mk回调参数,回调接口设置参数
*/
private String approveStatus;
}
@@ -1,34 +0,0 @@
package org.springblade.openapi.mk.pojo.dto;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* mk审批结束回调参数
* @author bfhuange
* @date 2024/9/5
*/
@Data
public class ApiMKProcessFinishDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 流程实例id
*/
private String processInstanceId;
/**
* 表单实例id
*/
private String formInstanceId;
/**
* 模板编码,template_拼接 ProcessTypeEnum 的值
*/
private String templateCode;
/**
* 流程状态
*/
private String processStatus;
}
@@ -0,0 +1,16 @@
<?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>org.springblade</groupId>
<artifactId>blade-service-api</artifactId>
<version>${revision}</version>
</parent>
<artifactId>blade-process-api</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>
</project>
@@ -0,0 +1,117 @@
package org.springblade.process.feign;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.tool.api.FR;
import org.springblade.process.pojo.dto.BusinessProcessCurrentHandlerRefreshDTO;
import org.springblade.process.pojo.dto.BusinessProcessDeleteDTO;
import org.springblade.process.pojo.dto.BusinessProcessSubmitDTO;
import org.springblade.process.pojo.dto.BusinessProcessUpdateDTO;
import org.springblade.process.pojo.vo.BusinessProcessVO;
import org.springblade.process.pojo.vo.ProcessApprovedRecordVO;
import org.springblade.process.pojo.vo.ProcessTodoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 业务流程关联表 Feign接口类
*
* @author BladeX
* @since 2024-09-19
*/
@FeignClient(
value = AppConstant.APPLICATION_SYSTEM_NAME
)
public interface IBusinessProcessClient {
String API_PREFIX = "/feign/client/businessProcess";
String SUBMIT_BUSINESS_PROCESS = API_PREFIX + "/submitBusinessProcess";
String UPDATE_BUSINESS_PROCESS_APPROVER = API_PREFIX + "/updateBusinessProcessApprover";
String REFRESH_BUSINESS_PROCESS_CURRENT_HANDLERS = API_PREFIX + "/refreshBusinessProcessCurrentHandlers";
String UPDATE_BUSINESS_PROCESS_STATUS = API_PREFIX + "/updateBusinessProcessStatus";
String DELETE_BUSINESS_PROCESS = API_PREFIX + "/deleteBusinessProcess";
String QUERY_TODO_LIST = API_PREFIX + "/queryTodoList";
String QUERY_BUSINESS_PROCESS_SNAPSHOT = API_PREFIX + "/queryBusinessProcessSnapshot";
String QUERY_APPROVED_RECORD_LIST = API_PREFIX + "/queryApprovedRecordsNoAttachments";
String GET_CURRENT_NODES = API_PREFIX + "/getCurrentNodes";
/**
* 提交业务流程
* @param param
*/
@PostMapping(SUBMIT_BUSINESS_PROCESS)
FR<BusinessProcessVO> submitBusinessProcess(@Validated @RequestBody BusinessProcessSubmitDTO<?> param);
/**
* 修改业务流程状态
* @param param
* @return 审批状态
*/
@PostMapping(UPDATE_BUSINESS_PROCESS_STATUS)
FR<String> updateBusinessProcessStatus(@Validated @RequestBody BusinessProcessUpdateDTO param);
/**
* 修改业务流程审批人
* @param param
* @return
*/
@PostMapping(UPDATE_BUSINESS_PROCESS_APPROVER)
FR<BusinessProcessVO> updateBusinessProcessApprover(@Validated @RequestBody BusinessProcessUpdateDTO param);
/**
* 只刷新当前节点和当前处理人
* @param param
* @return
*/
@PostMapping(REFRESH_BUSINESS_PROCESS_CURRENT_HANDLERS)
FR<BusinessProcessVO> refreshBusinessProcessCurrentHandlers(@Validated @RequestBody BusinessProcessCurrentHandlerRefreshDTO param);
/**
* 查询流程当前待办列表
* @param processInstanceId
* @return
*/
@GetMapping(QUERY_TODO_LIST)
FR<List<ProcessTodoVO>> queryTodoList(@RequestParam("processInstanceId") String processInstanceId);
/**
* 查询业务流程当前快照
* @param processInstanceId
* @return
*/
@GetMapping(QUERY_BUSINESS_PROCESS_SNAPSHOT)
FR<BusinessProcessVO> queryBusinessProcessSnapshot(@RequestParam("processInstanceId") String processInstanceId);
/**
* 删除业务流程
* @param param
* @return
*/
@PostMapping(DELETE_BUSINESS_PROCESS)
FR<Boolean> deleteBusinessProcess(@Validated @RequestBody BusinessProcessDeleteDTO param);
/**
* 查询流程审批记录不处理附件
* @param bizId
* @param processInstanceId
* @return
*/
@GetMapping(QUERY_APPROVED_RECORD_LIST)
FR<List<ProcessApprovedRecordVO>> queryApprovedRecordsNoAttachments(@RequestParam(name = "bizId", required = false) String bizId, @RequestParam(name = "processInstanceId", required = false) String processInstanceId);
/**
* 获取流程当前节点详情
*
* @param processInstanceId 流程实例id
* @param loginName MK登录名(手机号)
* @return 当前节点详情
*/
@GetMapping(GET_CURRENT_NODES)
FR<Object> getCurrentNodes(@RequestParam("processInstanceId") String processInstanceId,
@RequestParam(value = "loginName", required = false) String loginName);
}
@@ -0,0 +1,34 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 附加操作信息
*
* @author linbb
*/
@Schema(description = "附加操作信息")
@Data
public class AdditionOperationParameterDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 操作类型
*/
private String operationType;
/**
* 操作身份
*/
private String operationIdentity;
/**
* 操作参数
*/
private String parameter;
}
@@ -0,0 +1,119 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* mk审批中心查询参数
* @author bfhuange
* @since 2025/4/2
*/
@Data
@Schema(description = "mk审批中心查询参数")
public class ApprovalDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 单据类型 myApproving 我的待审,myApproved 我的已审,myReading 我的待阅,myReaded 我的已阅,myRelated 我参与的,myCreated 我发起的
*/
@NotBlank(message = "单据类型不能为空")
@Schema(description = "单据类型 myApproving 我的待审,myApproved 我的已审,myReading 我的待阅,myReaded 我的已阅,myRelated 我参与的,myCreated 我发起的")
private String docType;
/**
* 关键字
*/
@Schema(description = "关键字")
private String keyword;
/**
* 模板名称
*/
@Schema(description = "模板名称")
private String templateName;
/**
* 申请时间开始
*/
@Schema(description = "申请时间开始")
private Date applicantTimeStart;
/**
* 申请时间结束
*/
@Schema(description = "申请时间结束")
private Date applicantTimeEnd;
//==================================待办参数=======================
/**
* 接收时间开始
*/
@Schema(description = "接收时间开始")
private Date receiveTimeStart;
/**
* 接收时间结束
*/
@Schema(description = "接收时间结束")
private Date receiveTimeEnd;
//==================================已处理参数=======================
/**
* 流程状态 00 – 废弃、10 – 草稿、11 – 驳回 20 – 待审、21 – 异常、40 – 挂起 30 – 结束
*/
@Schema(description = "流程状态 00 – 废弃、10 – 草稿、11 – 驳回 20 – 待审、21 – 异常、40 – 挂起 30 – 结束")
private String status;
/**
* 结束时间开始
*/
@Schema(description = "结束时间开始")
private Date finishTimeStart;
/**
* 结束时间结束
*/
@Schema(description = "结束时间结束")
private Date finishTimeEnd;
/**
* 最后处理时间开始
*/
@Schema(description = "最后处理时间开始")
private Date lastHandleStart;
/**
* 最后处理时间结束
*/
@Schema(description = "最后处理时间结束")
private Date lastHandleEnd;
//==================================已阅参数=======================
/**
* 阅读时间开始
*/
@Schema(description = "阅读时间开始")
private Date readTimeStart;
/**
* 阅读时间结束
*/
@Schema(description = "阅读时间结束")
private Date readTimeEnd;
//==================================我参与的参数=======================
/**
* 创建时间开始
*/
@Schema(description = "创建时间开始")
private Date createTimeStart;
/**
* 创建时间结束
*/
@Schema(description = "创建时间结束")
private Date createTimeEnd;
/**
* 登录名
*/
@Schema(description = "登录名", hidden = true)
private String loginName;
}
@@ -0,0 +1,41 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 业务流程当前处理人刷新参数
*
* @author bfhuange
* @date 2026/4/9
*/
@Schema(description = "业务流程当前处理人刷新参数")
@Data
public class BusinessProcessCurrentHandlerRefreshDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 流程实例id
*/
@NotBlank(message = "流程实例id不能为空")
@Schema(description = "流程实例id")
private String processInstanceId;
/**
* 发起人登录名,可为空。
* 为空时优先从业务流程表回填;仅当业务流程不存在时,才回退使用调用方传入值。
*/
@Schema(description = "发起人登录名,可为空;为空时优先从业务流程表回填")
private String promoterLoginName;
/**
* 是否流程已完成
*/
@Schema(description = "是否流程已完成")
private boolean complete;
}
@@ -0,0 +1,39 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.io.Serializable;
/**
* 业务流程删除参数
*
* @author BladeX
* @since 2024-11-26
*/
@NoArgsConstructor
@Schema(description = "业务流程删除参数")
@Data
public class BusinessProcessDeleteDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 业务id
*/
@NotNull(message = "业务id不能为空")
@Schema(description = "业务id")
private Long bizId;
/**
* 发起人登录名,即erp手机号或账号
*/
// @NotBlank(message = "发起人登录名不能为空")
@Schema(description = "发起人登录名,即erp手机号或账号")
private String promoterLoginName;
public BusinessProcessDeleteDTO(Long bizId) {
this.bizId = bizId;
}
}
@@ -0,0 +1,42 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 业务流程查询参数
*
* @author BladeX
* @since 2024-09-23
*/
@Schema(description = "业务流程查询参数")
@Data
public class BusinessProcessQueryDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 流程类型
*/
@Schema(description = "审批类型")
private String processType;
/**
* 文档编号
*/
@Schema(description = "审批编号")
private String docCode;
/**
* 类型 todo:待审批,create:我创建的,done:我参与的
*/
@NotBlank(message = "类型不能为空")
@Schema(defaultValue = "类型 todo:待审批,create:我创建的,done:我参与的")
private String type;
/**
* 当前登录人账号
*/
@Schema(hidden = true)
private String loginName;
}
@@ -0,0 +1,81 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 业务流程提交参数
*
* @author BladeX
* @since 2024-09-19
*/
@Schema(description = "业务流程提交参数")
@Data
public class BusinessProcessSubmitDTO<T> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 业务id
*/
@NotNull(message = "业务id不能为空")
@Schema(description = "业务id")
private Long bizId;
/**
* 流程类型
*/
@NotBlank(message = "流程类型不能为空")
@Schema(description = "流程类型")
private String processType;
/**
* 文档编号
*/
@Schema(description = "文档编号")
private String docCode;
/**
* 标题
*/
@Schema(description = "标题")
private String subject;
/**
* 发起人id,空自动取登录人id
*/
@Schema(description = "发起人id")
private Long promoterId;
/**
* 发起人名称,空自动取登录人名称
*/
@Schema(description = "发起人名称")
private String promoterName;
/**
* 发起人登录名
*/
@Schema(description = "发起人登录名")
private String promoterLoginName;
/**
* 提交时间,空自动取当前时间
*/
@Schema(description = "提交时间")
private Date submitTime;
/**
* 流程参数,如果流程没有用到参数做条件判断或动态部门,可以不传
*/
@Schema(description = "流程参数")
private T processParam;
/**
* 流程执行参数,透传mk参数
*/
@Schema(description = "流程执行参数")
private ProcessExecuteDTO executeParam;
/**
* 添加群组编码
*/
@Schema(description = "添加群组编码")
private boolean addGroupCode;
}
@@ -0,0 +1,39 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
/**
* 业务流程修改参数
*
* @author BladeX
* @since 2024-09-19
*/
@Schema(description = "业务流程修改参数")
@Data
public class BusinessProcessUpdateDTO extends BusinessProcessCurrentHandlerRefreshDTO {
@Serial
private static final long serialVersionUID = 1L;
/**
* 操作节点id,流程审批结束为空
*/
@Schema(description = "操作节点id")
private String operationNodeId;
/**
* 操作节点编号,流程审批结束为空
*/
@Schema(description = "操作节点编号")
private String operationNodeNumber;
/**
* 驳回节点id N2 是起草节点
*/
@Schema(description = "驳回节点id")
private String rejectNodeId;
/**
* 审批状态
*/
@Schema(description = "审批状态")
private String approveStatus;
}
@@ -1,4 +1,4 @@
package org.springblade.openapi.mk.pojo.dto;
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
@@ -0,0 +1,73 @@
package org.springblade.process.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* mk 流程执行参数
* @author bfhuange
* @date 2024/9/26
*/
@Schema(description = "mk 流程执行参数")
@Data
public class ProcessExecuteDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 表单实例id,业务id
*/
private String formInstanceId;
/**
* 登录账号 登录用户账号/手机号
*/
private String loginName;
/**
* 流程标题
*/
private String subject;
/**
* 任务ID
*/
private String taskId;
/**
* 任务类型
*/
private String activityType;
/**
* 操作详细参数(json)
*/
private String parameter;
/**
* 流程实例ID
*/
private String processId;
/**
* 操作标识(相同操作类型和相同操作身份可能存在多个操作配置)
*/
private String operationId;
/**
* 操作类型
*/
private String operationType;
/**
* 操作身份
*/
private String operationIdentity;
/**
* 附加操作参数信息
*/
private List<AdditionOperationParameterDTO> additionParameters;
/**
* 表单实例Model Name
*/
private String formInstanceModel;
/**
* 业务表单字段值集合
*/
// private Map<String, Object> formValues;
private Object formValues;
}
@@ -0,0 +1,57 @@
package org.springblade.process.pojo.dto;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* @author bfhuange
* @since 2025/3/10
*/
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
public class ProcessNodeApprovalDTO extends ProcessApprovalDTO {
/**
* 操作节点id,流程审批结束为空
*/
private String operationNodeId;
/**
* 操作节点编号,流程审批结束为空
*/
private String operationNodeNumber;
/**
* 操作人登录名
*/
private String operatorLoginName;
/**
* 流程模板id
*/
private String templateId;
/**
* 驳回节点id N2 是起草节点
*/
private String rejectNodeId;
/**
* 是否流程已完成,非mk回调参数,回调接口设置参数
*/
private boolean complete;
@Builder(toBuilder = true, builderMethodName = "subBuilder", buildMethodName = "subBuild")
public ProcessNodeApprovalDTO(String flowInstId, String formInstanceId, String approveStatus, String nextApproveUser, String operationNodeId, String operationNodeNumber, String operatorLoginName, String templateId, String rejectNodeId, boolean complete) {
super(flowInstId, formInstanceId, approveStatus, nextApproveUser);
this.operationNodeId = operationNodeId;
this.operationNodeNumber = operationNodeNumber;
this.operatorLoginName = operatorLoginName;
this.templateId = templateId;
this.rejectNodeId = rejectNodeId;
this.complete = complete;
}
}
@@ -0,0 +1,22 @@
package org.springblade.process.pojo.dto.process;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 公共部门编码流程参数
* @author bfhuange
* @date 2024/10/9
*/
@Data
public class CommonDeptCodeProcessParam implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 部门编码
*/
private String deptCode;
}
@@ -0,0 +1,164 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.process.pojo.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 业务流程关联表 实体类
*
* @author BladeX
* @since 2024-09-19
*/
@Data
@TableName("blade_business_process")
@Schema(description = "BusinessProcess对象")
public class BusinessProcess implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
@TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id;
/**
* 业务id
*/
@Schema(description = "业务id")
private Long bizId;
/**
* 流程实例id
*/
@Schema(description = "流程实例id")
private String processInstanceId;
/**
* 流程类型
*/
@Schema(description = "流程类型")
private String processType;
/**
* 文档编号
*/
@Schema(description = "文档编号")
private String docCode;
/**
* 标题
*/
@Schema(description = "标题")
private String subject;
/**
* 发起人id
*/
@Schema(description = "发起人id")
private Long promoterId;
/**
* 发起人名称
*/
@Schema(description = "发起人名称")
private String promoterName;
/**
* 发起人登录名
*/
@Schema(description = "发起人登录名")
private String promoterLoginName;
/**
* 提交时间
*/
@Schema(description = "提交时间")
private Date submitTime;
/**
* 完成时间
*/
@Schema(description = "完成时间")
private Date completeTime;
/**
* 当前节点id,多个用逗号拼接
*/
@Schema(description = "当前节点id,多个用逗号拼接")
private String currentNodeIds;
/**
* 当前节点名称,多个用逗号拼接
*/
@Schema(description = "当前节点名称,多个用逗号拼接")
private String currentNodeNames;
/**
* 当前处理人,多个用逗号拼接
*/
@Schema(description = "当前处理人,多个用逗号拼接")
private String currentHandlers;
/**
* 接收时间
*/
@Schema(description = "接收时间")
private Date receiveTime;
/**
* 是否已完成(0:未完成, 1:已完成)
*/
@Schema(description = "是否已完成")
private Integer isCompleted;
/**
* 审批状态
*/
@Schema(description = "审批状态")
private String approveStatus;
/**
* 租户ID
*/
@Schema(description = "租户ID")
private String tenantId;
/**
* 创建时间
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@Schema(description = "创建时间", hidden = true)
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新时间
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATE)
@Schema(description = "更新时间", hidden = true)
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}
@@ -0,0 +1,165 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.process.pojo.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.List;
import java.util.Objects;
/**
* 审批状态
*
* @author LiuXinjie
* @apiNote 合同审批状态
*/
@Getter
@AllArgsConstructor
public enum ApproveStatusEnum {
/**
* 默认编号
*/
DRAFT("draft", "草稿"), //可提交
APPROVING("approval", "审批中"),
APPROVED("pass", "审批通过"),
REJECTED("reject", "审批驳回"), //通用的流程 驳回可编辑
REVOCATION("revocation", "已撤回"), //可重新提交
ABANDON("abandon", "废弃"),
;
final String value;
final String text;
public boolean match(String value){
return this.value.equals(value);
}
public static String getValueByText(String text) {
if (text == null) {
return null;
}
for (ApproveStatusEnum item : values()) {
if (Objects.equals(item.getText(), text)) {
return item.getValue();
}
}
return null;
}
public static String getTextByValue(String value) {
if (value == null) {
return null;
}
for (ApproveStatusEnum item : values()) {
if (Objects.equals(item.getValue(), value)) {
return item.getText();
}
}
return null;
}
/**
* 是否可以撤回
*
* @param value
* @return
*/
public static boolean canRevoke(String value) {
return APPROVING.getValue().equals(value);
}
/**
* 能不能删除审批流
* @param value
* @return
*/
public static boolean canDelAuditFlow(String value){
return REJECTED.getValue().equals(value) || REVOCATION.getValue().equals(value);
}
/**
* 驳回或撤回
* @return
*/
public static boolean rejectedOrRevocation(String approveStatus) {
return canDelAuditFlow(approveStatus);
}
/**
* 能不能删除数据
* @param value
* @return
*/
public static boolean canDeleteData(String value){
return ABANDON.getValue().equals(value) || DRAFT.getValue().equals(value) || canDelAuditFlow(value);
}
public static String getNameStr(String value) {
for (ApproveStatusEnum state : values()) {
if (state.value.equals(value)) {
return state.text;
}
}
return null;
}
/**
* 是否可以编辑表单
*
* @param value
* @return
*/
public static boolean canEdit(String value) {
return DRAFT.getValue().equals(value) || REJECTED.getValue().equals(value) || REVOCATION.getValue().equals(value);
}
/**
* 获取可驳回状态
*
* @return
*/
public static List<String> buildPreviousApproveStatusList(String currentStatus) {
if (ApproveStatusEnum.APPROVING.getValue().equals(currentStatus)) {
// 变更成审批中,前置条件为 草稿或者审批中
return List.of(ApproveStatusEnum.APPROVING.getValue());
} else if (ApproveStatusEnum.APPROVED.getValue().equals(currentStatus)) {
// 变更成审批通过,前置条件为 审批中
return List.of(ApproveStatusEnum.APPROVING.getValue());
} else if (ApproveStatusEnum.REJECTED.getValue().equals(currentStatus)) {
// 变更成审批驳回,前置条件为 审批中
return List.of(ApproveStatusEnum.APPROVING.getValue());
} else if (ApproveStatusEnum.REVOCATION.getValue().equals(currentStatus)) {
// 变更成撤回,前置条件为 审批中
return List.of(ApproveStatusEnum.APPROVING.getValue());
} else {
// 其他情况,前置条件为 草稿
return List.of(ApproveStatusEnum.DRAFT.getValue());
}
}
}
@@ -0,0 +1,36 @@
package org.springblade.process.pojo.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 待办状态枚举
* @author bfhuange
* @date 2024/9/20
*/
@AllArgsConstructor
@Getter
public enum TodoStatus {
/**
* 待办
*/
TODO("todo", "待办"),
/**
* 已办
*/
DONE("done", "已办"),
/**
* 身份重复跳过
*/
SKIP("skip", "身份重复跳过"),
;
/**
* 待办状态编码
*/
private final String code;
/**
* 待办状态名称
*/
private final String name;
}
@@ -0,0 +1,177 @@
package org.springblade.process.pojo.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* @author bfhuange
* @since 2025/4/2
*/
@Data
@Schema(description = "mk审批中心记录")
public class ApprovalVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@Schema(description = "id")
private String id;
/**
* 流程所属应用
*/
@Schema(description = "流程所属应用")
private String appName;
/**
* 申请人名称
*/
@Schema(description = "申请人名称")
private String applicantName;
/**
* 申请人登录名
*/
@Schema(description = "申请人登录名")
private String applicantLoginName;
/**
* 发起人名称
*/
@Schema(description = "发起人名称")
private String creator;
/**
* 处理人名称
*/
@Schema(description = "处理人名称")
private String handlerName;
/**
* 处理人登录名
*/
@Schema(description = "处理人登录名")
private String handlerLoginName;
/**
* 当前处理人名称
*/
@Schema(description = "当前处理人名称")
private String currentHandler;
/**
* 节点名称
*/
@Schema(description = "节点名称")
private String nodeName;
/**
* 流程id
*/
@Schema(description = "流程id")
private String processId;
/**
* 流程发起时间
*/
@Schema(description = "流程发起时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "GMT+8")
private Date startTime;
/**
* 创建时间
*/
@Schema(description = "创建时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "GMT+8")
private Date createTime;
/**
* 如果是待办:待办接收时间 如果是待阅:传阅接收时间
*/
@Schema(description = "如果是待办:待办接收时间 如果是待阅:传阅接收时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "GMT+8")
private Date receiveTime;
/**
* 任务结束时间
*/
@Schema(description = "任务结束时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "GMT+8")
private Date finishTime;
/**
* 阅读时间(待阅任务)
*/
@Schema(description = "阅读时间(待阅任务)")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "GMT+8")
private Date readTime;
/**
* 最后处理时间(待审任务)
*/
@Schema(description = "最后处理时间(待审任务)")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "GMT+8")
private Date lastHandleTime;
/**
* 流程结束时间
*/
@Schema(description = "流程结束时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "GMT+8")
private Date processFinishTime;
/**
* 流程状态 00 – 废弃、10 – 草稿、11 – 驳回 20 – 待审、21 – 异常、40 – 挂起 30 – 结束
*/
@Schema(description = "流程状态 00 – 废弃、10 – 草稿、11 – 驳回 20 – 待审、21 – 异常、40 – 挂起 30 – 结束")
private String status;
/**
* 流程状态名称
*/
@Schema(description = "流程状态名称")
private String statusStr;
/**
* 流程主题
*/
@Schema(description = "流程主题")
private String subject;
/**
* 模板编码
*/
@Schema(description = "模板编码")
private String templateCode;
/**
* 任务id
*/
@Schema(description = "任务id")
private String taskId;
/**
* 任务状态 20 - 激活、30 - 结束、40 - 挂起、50 - 自动跳过
*/
@Schema(description = "任务状态 20 - 激活、30 - 结束、40 - 挂起、50 - 自动跳过")
private String taskStatus;
/**
* 任务标题
*/
@Schema(description = "任务标题")
private String taskSubject;
/**
* 催办标记
*/
@Schema(description = "催办标记")
private String urgeTab;
/**
* 任务类型 1待办,2待阅
*/
@Schema(description = "任务类型 1待办,2待阅")
private Integer taskType;
/**
* 待办优先级
*/
@Schema(description = "待办优先级")
private Integer level;
/**
* 模板名称中文
*/
@Schema(description = "模板名称中文")
private String templateNameCn;
}
@@ -0,0 +1,110 @@
package org.springblade.process.pojo.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* @author bfhuange
* @date 2024/9/23
*/
@Data
@Schema(description = "BusinessProcessListVO")
public class BusinessProcessListVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
private Long id;
/**
* 业务id
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "业务id")
private Long bizId;
/**
* 流程实例id
*/
@Schema(description = "流程实例id")
private String processInstanceId;
/**
* 流程类型
*/
@Schema(description = "审批类型")
private String processType;
/**
* 流程类型名称
*/
@Schema(description = "审批类型名称")
private String processTypeStr;
/**
* 文档编号
*/
@Schema(description = "审批单号")
private String docCode;
/**
* 发起人id
*/
@Schema(description = "发起人id")
private Long promoterId;
/**
* 发起人名称
*/
@Schema(description = "发起人名称")
private String promoterName;
/**
* 提交时间
*/
@Schema(description = "提交时间")
private Date submitTime;
/**
* 接收时间
*/
@Schema(description = "接收时间")
private Date receiveTime;
/**
* 完成时间
*/
@Schema(description = "完成时间")
private Date completeTime;
/**
* 当前节点id,多个用逗号拼接
*/
@Schema(description = "当前节点id,多个用逗号拼接")
private String currentNodeIds;
/**
* 当前节点名称,多个用逗号拼接
*/
@Schema(description = "当前节点名称,多个用逗号拼接")
private String currentNodeNames;
/**
* 当前处理人,多个用逗号拼接
*/
@Schema(description = "当前处理人,多个用逗号拼接")
private String currentHandlers;
/**
* 是否已完成(0:未完成, 1:已完成)
*/
@Schema(description = "是否已完成(0:未完成, 1:已完成)")
private Integer isCompleted;
/**
* 审批状态
*/
@Schema(description = "审批状态")
private String approveStatus;
/**
* 审批状态名称
*/
@Schema(description = "审批状态名称")
private String approveStatusStr;
}
@@ -0,0 +1,43 @@
package org.springblade.process.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* @author bfhuange
* @date 2024/9/20
*/
@Data
@Schema(description = "BusinessProcessVO")
public class BusinessProcessVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 流程实例id
*/
private String processInstanceId;
/**
* 当前节点id,多个用逗号拼接
*/
@Schema(description = "当前节点id,多个用逗号拼接")
private String currentNodeIds;
/**
* 当前节点名称,多个用逗号拼接
*/
@Schema(description = "当前节点名称,多个用逗号拼接")
private String currentNodeNames;
/**
* 当前处理人,多个用逗号拼接
*/
@Schema(description = "当前处理人,多个用逗号拼接")
private String currentHandlers;
/**
* 接收时间
*/
@Schema(description = "接收时间")
private Date receiveTime;
}
@@ -0,0 +1,110 @@
package org.springblade.process.pojo.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @author bfhuange
* @since 2025/2/24
*/
@Data
@Schema(description = "流程审批记录")
public class ProcessApprovedRecordVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 记录主键
*/
@Schema(description = "id")
private String id;
/**
* 处理人
*/
@Schema(description = "处理人")
private String handler;
/**
* 操作
*/
@Schema(description = "操作")
private String action;
/**
* 操作编码
*/
@Schema(description = "操作编码")
private String actionCode;
/**
* 操作描述(系统操作)
*/
@Schema(description = "操作描述(系统操作)")
private String actionDesc;
/**
* 操作名称
*/
@Schema(description = "操作名称")
private String actionName;
/**
* 处理意见
*/
@Schema(description = "处理意见")
private String message;
/**
* 创建时间
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@Schema(description = "创建时间")
private Date createTime;
/**
* 流程实例id
*/
@Schema(description = "流程实例id")
private String processInstanceId;
/**
* 节点实例id
*/
@Schema(description = "节点实例id")
private String nodeInstanceId;
/**
* 节点类型
*/
@Schema(description = "节点类型")
private String nodeType;
/**
* 节点id
*/
@Schema(description = "节点id")
private String nodeId;
/**
* 节点名称
*/
@Schema(description = "节点名称")
private String nodeName;
/**
* 节点编号
*/
@Schema(description = "节点编号")
private String nodeNumber;
/**
* 抄送人列表
*/
@Schema(description = "抄送人列表")
private List<String> senders;
/**
* 附件参数
*/
@Schema(description = "附件参数")
private List<ProcessAttachmentVO> attachmentParameter;
/**
* 流程附言
*/
@Schema(description = "流程附言")
private List<ProcessCommentVO> processComments;
}
@@ -0,0 +1,43 @@
package org.springblade.process.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* @author bfhuange
* @since 2025/2/24
*/
@Data
@Schema(description = "流程附件")
public class ProcessAttachmentVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@Schema(description = "id")
private String id;
/**
* 附件名称
*/
@Schema(description = "附件名称")
private String name;
/**
* 附件类型 electronicSign 电子签名,attachment 附件
*/
@Schema(description = "附件类型 electronicSign 电子签名,attachment 附件")
private String type;
/**
* 附件ID
*/
@Schema(description = "附件ID")
private String fileId;
/**
* base64
*/
@Schema(description = "base64")
private String base64;
}
@@ -0,0 +1,63 @@
package org.springblade.process.pojo.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 流程附言
* @author bfhuange
* @since 2025/2/24
*/
@Data
@Schema(description = "流程附言")
public class ProcessCommentVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@Schema(description = "id")
private String id;
/**
* 附言内容
*/
@Schema(description = "附言内容")
private String content;
/**
* 创建时间
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@Schema(description = "创建时间")
private Date createTime;
/**
* 更新时间
*/
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@Schema(description = "更新时间")
private Date updateTime;
/**
* 用户id
*/
@Schema(description = "用户id")
private String userId;
/**
* 用户名称
*/
@Schema(description = "用户名称")
private String userName;
/**
* 附言附件
*/
@Schema(description = "附言附件")
private List<ProcessAttachmentVO> attachments;
}
@@ -0,0 +1,79 @@
package org.springblade.process.pojo.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* @author bfhuange
* @since 2025/3/10
*/
@Data
@Schema(description = "流程待办")
public class ProcessTodoVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "主键")
private Long id;
/**
* 流程实例id
*/
@Schema(description = "流程实例id")
private String processInstanceId;
/**
* 节点id
*/
@Schema(description = "节点id")
private String nodeId;
/**
* 节点编号
*/
@Schema(description = "节点编号")
private String nodeNumber;
/**
* 节点名称
*/
@Schema(description = "节点名称")
private String nodeName;
/**
* mk登录名
*/
@Schema(description = "mk登录名")
private String loginName;
/**
* 用户姓名
*/
@Schema(description = "用户姓名")
private String userName;
/**
* 状态(todo:待办,done:已办,skip:身份重复跳过)
*/
@Schema(description = "状态(todo:待办,done:已办,skip:身份重复跳过)")
private String status;
/**
* 接收时间
*/
@Schema(description = "接收时间")
private Date receiveTime;
/**
* 操作时间
*/
@Schema(description = "操作时间")
private Date operationTime;
/**
* 操作名称
*/
@Schema(description = "操作名称")
private String operationName;
}
@@ -75,6 +75,10 @@ public class ApiScopePermissionHandler implements IPermissionHandler {
if (request == null || user == null) {
return false;
}
// 超级管理员在菜单授权树中默认拥有全部菜单权限,与框架默认处理器保持一致。
if (AuthUtil.isAdministrator()) {
return true;
}
List<String> codes = permissionMenu(permission, user.getRoleId());
return codes != null && !codes.isEmpty();
}
@@ -31,6 +31,10 @@ import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.pojo.entity.Region;
import org.springblade.system.feign.ISysClient;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
/**
@@ -50,6 +54,8 @@ public class RegionCache {
public static final int VILLAGE_LEVEL = 5;
private static final String REGION_CODE = "region:code:";
private static final String REGION_TREE_CACHE = "region:tree";
private static final String REGION_LAZY_TREE = "lazy-tree:";
private static ISysClient sysClient;
@@ -73,4 +79,38 @@ public class RegionCache {
});
}
/**
* 获取行政区划懒加载树
*
* @param parentCode 父区划编号
* @param param 查询参数
* @param loader 数据加载器
* @return 懒加载树
*/
public static List<Map<String, Object>> getLazyTree(
String parentCode,
Map<String, Object> param,
Callable<List<Map<String, Object>>> loader) {
Map<String, Object> query = param == null ? Map.of() : param;
String cacheKey = String.join("|",
cacheKeyPart(parentCode),
cacheKeyPart(query.get("code")),
cacheKeyPart(query.get("name")),
cacheKeyPart(query.get("regionLevel"))
);
return CacheUtil.get(REGION_TREE_CACHE, REGION_LAZY_TREE, cacheKey, loader, Boolean.FALSE);
}
/**
* 清除行政区划懒加载树缓存
*/
public static void clearLazyTree() {
CacheUtil.clear(REGION_TREE_CACHE, Boolean.FALSE);
}
private static String cacheKeyPart(Object value) {
String text = value == null ? "" : String.valueOf(value);
return text.length() + ":" + text;
}
}
@@ -64,12 +64,16 @@ public interface ISysClient {
String ROLE_NAMES = API_PREFIX + "/role-names";
String ROLE_ALIAS = API_PREFIX + "/role-alias";
String ROLE_ALIASES = API_PREFIX + "/role-aliases";
String ROLE_ID_BY_ALIAS = API_PREFIX + "/role-id-by-alias";
String TENANT = API_PREFIX + "/tenant";
String TENANT_ID = API_PREFIX + "/tenant-id";
String TENANT_PACKAGE = API_PREFIX + "/tenant-package";
String PARAM = API_PREFIX + "/param";
String PARAM_VALUE = API_PREFIX + "/param-value";
String REGION = API_PREFIX + "/region";
String FEE_ITEMS = API_PREFIX + "/fee-items";
String CARGO_TYPES = API_PREFIX + "/cargo-types";
String PERMISSIONS = API_PREFIX + "/permissions";
/**
* 获取菜单
@@ -238,6 +242,16 @@ public interface ISysClient {
@GetMapping(ROLE_ALIASES)
R<List<String>> getRoleAliases(@RequestParam("roleIds") String roleIds);
/**
* 根据角色别名获取角色id
*
* @param tenantId 租户id
* @param roleAlias 角色别名
* @return 角色id
*/
@GetMapping(ROLE_ID_BY_ALIAS)
R<String> getRoleIdByAlias(@RequestParam("tenantId") String tenantId, @RequestParam("roleAlias") String roleAlias);
/**
* 获取租户
*
@@ -292,4 +306,24 @@ public interface ISysClient {
@GetMapping(REGION)
R<Region> getRegion(@RequestParam("code") String code);
/**
* 获取启用的费用项
*
* @return 费用项集合
*/
@GetMapping(FEE_ITEMS)
R<List<FeeItem>> getFeeItems();
@GetMapping(CARGO_TYPES)
R<List<CargoType>> getCargoTypes();
/**
* 获取角色权限标识集合(按钮编号)
*
* @param roleId 角色id
* @return 权限标识
*/
@GetMapping(PERMISSIONS)
R<List<String>> getPermissions(@RequestParam("roleId") String roleId);
}
@@ -129,6 +129,11 @@ public class ISysClientFallback implements ISysClient {
return R.fail("获取数据失败");
}
@Override
public R<String> getRoleIdByAlias(String tenantId, String roleAlias) {
return R.fail("获取数据失败");
}
@Override
public R<Tenant> getTenant(Long id) {
return R.fail("获取数据失败");
@@ -159,5 +164,19 @@ public class ISysClientFallback implements ISysClient {
return R.fail("获取数据失败");
}
@Override
public R<List<FeeItem>> getFeeItems() {
return R.fail("获取数据失败");
}
@Override
public R<List<CargoType>> getCargoTypes() {
return R.fail("获取数据失败");
}
@Override
public R<List<String>> getPermissions(String roleId) {
return R.fail("获取数据失败");
}
}
@@ -25,6 +25,7 @@
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -63,6 +64,7 @@ public class AirportMaster extends BaseEntity {
* ICAO代码
*/
@Schema(description = "ICAO代码")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String icaoCode;
/**
* 机场标准名称
@@ -179,4 +179,10 @@ public class Dept extends TenantEntity {
@Schema(description = "是否是oa的部门")
private Integer isOa;
/**
* 是否平台公司:0否,1是
*/
@Schema(description = "是否平台公司:0否,1是")
private Integer isPlatformCompany;
}
@@ -25,6 +25,8 @@
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -32,6 +34,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 费用项实体类
@@ -62,5 +65,16 @@ public class FeeItem extends BaseEntity {
*/
@Schema(description = "费用项代码")
private String englishName;
/**
* 税率(百分比)
*/
@Schema(description = "税率(百分比)")
private BigDecimal taxRate;
/**
* 备注
*/
@Schema(description = "备注")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String remark;
}
@@ -0,0 +1,56 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments from this software for such purposes. Copyright of this software remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 开票项目实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_invoice_item")
@Schema(description = "开票项目")
public class InvoiceItem extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "货物或服务简称")
private String shortName;
@Schema(description = "税收分类编码")
private String taxClassificationCode;
@Schema(description = "商品和服务分类名称")
private String categoryName;
@Schema(description = "默认税率")
private BigDecimal defaultTaxRate;
}
@@ -0,0 +1,71 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 计量单位实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_measurement_unit")
@Schema(description = "计量单位")
public class MeasurementUnit extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 计量单位编码
*/
@Schema(description = "计量单位编码")
private String unitCode;
/**
* 计量单位
*/
@Schema(description = "计量单位")
private String unitName;
/**
* 计量维度
*/
@Schema(description = "计量维度")
private String dimension;
/**
* 备注
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@Schema(description = "备注")
private String remark;
}
@@ -84,6 +84,16 @@ public class PortTerminal extends BaseEntity {
*/
@Schema(description = "国家")
private String country;
/**
* 省份编码
*/
@Schema(description = "省份编码")
private String provinceCode;
/**
* 省份
*/
@Schema(description = "省份")
private String provinceName;
/**
* 城市
*/
@@ -60,9 +60,9 @@ public class RailwayStation extends BaseEntity {
@Schema(description = "TMIS国标编码")
private String tmisCode;
/**
* 电报码
* 电报
*/
@Schema(description = "电报码")
@Schema(description = "电报")
private String telegraphCode;
/**
* 车站名称
@@ -34,6 +34,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 行政区划表实体类
@@ -134,6 +135,40 @@ public class Region implements Serializable {
*/
@Schema(description = "备注")
private String remark;
/**
* 数据来源
*/
@Schema(description = "数据来源")
private String dataSource;
/**
* 创建人
*/
@TableField("create_user")
@Schema(description = "创建人")
private Long createUser;
/**
* 创建时间
*/
@TableField("create_time")
@Schema(description = "创建时间")
private Date createTime;
/**
* 更新人
*/
@TableField("update_user")
@Schema(description = "更新人")
private Long updateUser;
/**
* 更新时间
*/
@TableField("update_time")
@Schema(description = "更新时间")
private Date updateTime;
/**
* 状态:1启用,2停用
*/
@Schema(description = "状态")
private Integer status;
/**
* 原区划编号
@@ -0,0 +1,50 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments from this software for such purposes. Copyright of this software remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.system.pojo.entity.InvoiceItem;
import java.io.Serial;
/**
* 开票项目视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "开票项目")
public class InvoiceItemVO extends InvoiceItem {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "创建部门名称")
private String createDeptName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}
@@ -0,0 +1,51 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.system.pojo.entity.MeasurementUnit;
import java.io.Serial;
/**
* 计量单位视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "计量单位")
public class MeasurementUnitVO extends MeasurementUnit {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}
@@ -0,0 +1,69 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* OA组织(公司/部门)分页同步结果
*
* @author Chill
*/
@Data
@Schema(description = "OA组织分页同步结果")
public class OaOrgSyncPageVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "同步阶段:company / department")
private String stage;
@Schema(description = "当前页")
private Integer current;
@Schema(description = "每页条数")
private Integer size;
@Schema(description = "OA总条数")
private Long total;
@Schema(description = "本页从OA拉取的条数")
private Integer fetchedCount;
@Schema(description = "本页同步成功条数")
private Integer syncedCount;
@Schema(description = "本页跳过条数")
private Integer skippedCount;
@Schema(description = "是否已到最后一页")
private Boolean finished;
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* OA人员分页同步结果
*
* @author Chill
*/
@Data
@Schema(description = "OA人员分页同步结果")
public class OaPersonSyncPageVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "当前页")
private Integer current;
@Schema(description = "每页条数")
private Integer size;
@Schema(description = "OA人员总条数")
private Long total;
@Schema(description = "本页从OA拉取的条数")
private Integer fetchedCount;
@Schema(description = "本页同步成功条数")
private Integer syncedCount;
@Schema(description = "本页跳过条数")
private Integer skippedCount;
@Schema(description = "是否已到最后一页")
private Boolean finished;
}
@@ -0,0 +1,34 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/** 汇票台账保存请求。 @author Chill */
@Data
public class BillLedgerSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String billNo;
private Long issuerId;
private String receiverName;
private String billType;
private BigDecimal faceAmount;
private LocalDate issueDate;
private LocalDate maturityDate;
private String availableDeptIdsJson;
private String availableDeptNames;
private Long feeBearerId;
private BigDecimal confirmedDiscountRate;
private String issuingBank;
private BigDecimal bankDiscountReferenceRate;
private String attachmentsJson;
private String remark;
}
@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/** 汇票付款保存请求。 @author Chill */
@Data
public class BillPaymentSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private Long billLedgerId;
private BigDecimal usedAmount;
private LocalDate paymentDate;
private String attachmentsJson;
private String remark;
}
@@ -0,0 +1,39 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/** 汇票付款状态请求。 @author Chill */
@Data
public class BillPaymentStatusRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String reason;
}
@@ -0,0 +1,42 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 在途打卡提交
*/
@Data
@Schema(description = "在途打卡提交")
public class EnrouteSubmitDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "运单ID", requiredMode = Schema.RequiredMode.REQUIRED)
private Long waybillId;
@Schema(description = "定位信息")
private Location location;
@Schema(description = "货物照片URL")
private String photo;
@Data
@Schema(description = "定位")
public static class Location implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Double longitude;
private Double latitude;
private String address;
}
}
@@ -0,0 +1,23 @@
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/** 正式结算批量付款申请请求。 @author Chill */
@Data
public class FormalSettlementBatchPaymentRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private List<Item> items;
private String remark;
@Data
public static class Item implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private BigDecimal appliedAmount;
}
}
@@ -0,0 +1,15 @@
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/** 正式结算发票认领请求。 */
@Data
public class FormalSettlementInvoiceClaimRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long formalSettlementId;
private List<FormalSettlementSaveRequest.Invoice> invoices;
}
@@ -0,0 +1,23 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/** 正式结算付款申请请求。 @author Chill */
@Data
public class FormalSettlementPaymentRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private BigDecimal appliedAmount;
private String remark;
}
@@ -0,0 +1,67 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/** 正式结算保存请求。 @author Chill */
@Data
public class FormalSettlementSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String formalSettlementNo;
private Long contractId;
private String settlementType;
private List<Long> sourcePreSettlementIds;
private List<Long> sourceDetailIds;
private List<DetailAdjustment> detailAdjustments;
private LocalDate exchangeRateDate;
private BigDecimal exchangeRate;
private String attachmentsJson;
private String remark;
private List<SummaryFee> summaryFees;
private List<Invoice> invoices;
@Data
public static class DetailAdjustment implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long sourcePreSettlementDetailId;
private Long sourceDetailId;
private BigDecimal adjustAmount;
}
@Data
public static class SummaryFee implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String feeType;
private String feeItem;
private BigDecimal adjustAmount;
private String remark;
private Integer manualFlag;
}
@Data
public static class Invoice implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private String invoiceNo;
private LocalDate invoiceDate;
private String invoiceType;
private BigDecimal taxRate;
private BigDecimal invoiceAmount;
private BigDecimal availableInvoiceAmount;
private BigDecimal matchedAmount;
private String attachmentJson;
}
}
@@ -0,0 +1,21 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/** 正式结算状态操作请求。 @author Chill */
@Data
public class FormalSettlementStatusRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String reason;
}
@@ -0,0 +1,84 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 开票申请保存请求
*
* @author Chill
*/
@Data
public class InvoiceApplicationSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String invoiceType;
private String departmentEmails;
private Long receiverInvoiceInfoId;
private String contactName;
private String contactPhone;
private String email;
private String attachmentsJson;
private String remark;
private List<SettlementRow> settlements;
private List<Long> detailIds;
private List<SheetRow> sheets;
@Data
public static class SettlementRow implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long settlementId;
private BigDecimal allocatedInvoiceAmount;
}
@Data
public static class SheetRow implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private List<LineRow> lines;
}
@Data
public static class LineRow implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private String goodsCategory;
private String goodsName;
private String unit;
private BigDecimal quantity;
private BigDecimal unitPriceNoTax;
private BigDecimal amountNoTax;
private BigDecimal amountWithTax;
private BigDecimal taxRate;
private BigDecimal taxAmount;
private BigDecimal totalAmount;
private String remark;
}
}
@@ -0,0 +1,43 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 开票申请状态请求
*
* @author Chill
*/
@Data
public class InvoiceApplicationStatusRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String reason;
}
@@ -0,0 +1,75 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/**
* 收票登记保存请求
*
* @author Chill
*/
@Data
public class InvoiceReceiptSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private Long kingdeeInvoicePoolId;
private String invoiceNo;
private LocalDate invoiceDate;
private String invoiceType;
private BigDecimal taxRate;
private BigDecimal invoiceAmount;
private BigDecimal taxAmount;
private String receiverName;
private String issuerName;
private String bankName;
private String bankAccount;
private String issuingBank;
private String kingdeeBillNo;
private String kingdeeStatus;
private String phone;
private String customerEmails;
private String departmentEmails;
private String attachmentsJson;
private String remark;
private List<SettlementRow> settlements;
/**
* 结算单分摊行
*/
@Data
public static class SettlementRow implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long settlementId;
private BigDecimal allocatedInvoiceAmount;
}
}
@@ -0,0 +1,43 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 收票登记状态请求
*
* @author Chill
*/
@Data
public class InvoiceReceiptStatusRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String reason;
}
@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 过程节点打卡提交(到场/装货/卸货/签收等,不含在途)
*/
@Data
@Schema(description = "过程节点打卡提交")
public class NodeSubmitDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "运单ID", requiredMode = Schema.RequiredMode.REQUIRED)
private Long waybillId;
@Schema(description = "过程节点 key", requiredMode = Schema.RequiredMode.REQUIRED)
private String nodeCode;
@Schema(description = "定位信息")
private Location location;
@Schema(description = "凭证照片 URL 列表")
private List<String> photos;
@Schema(description = "重量(吨)")
private String weight;
@Schema(description = "体积(方)")
private String volume;
@Schema(description = "数量(件)")
private String quantity;
@Schema(description = "备注")
private String remark;
@Schema(description = "是否异常")
private Boolean exception;
@Data
@Schema(description = "定位")
public static class Location implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Double longitude;
private Double latitude;
private String address;
}
}
@@ -0,0 +1,41 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments from this software for such purposes.
* Copyright of this software remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/** 付款申请发票请求。 @author Chill */
@Data
public class PaymentApplicationInvoiceRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private String settlementNo;
private String invoiceNo;
private LocalDate invoiceDate;
private String invoiceType;
private BigDecimal taxRate;
private BigDecimal invoiceAmount;
private BigDecimal matchedAmount;
private String attachmentJson;
}
@@ -0,0 +1,38 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments from this software for such purposes.
* Copyright of this software remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/** 付款申请付款记录请求。 @author Chill */
@Data
public class PaymentApplicationRecordRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private BigDecimal paidAmount;
private LocalDate paidDate;
private String paymentNo;
private String voucherJson;
private String kingdeeBillNo;
}
@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments from this software for such purposes.
* Copyright of this software remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/** 付款申请保存请求。 @author Chill */
@Data
public class PaymentApplicationSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String paymentType;
private Long settlementId;
private List<Long> settlementIds;
private Long preSettlementId;
private Long projectId;
private String projectName;
private Long deptId;
private String deptName;
private Long contractId;
private String contractNo;
private String contractName;
private String payerName;
private String payeeName;
private BigDecimal settlementAmount;
private BigDecimal payableAmount;
private String billType;
private BigDecimal paymentRatio;
private BigDecimal appliedAmount;
private String paymentMethod;
private Long billLedgerId;
private String billNo;
private Long receiptAccountId;
private String receiptAccountName;
private String bankName;
private String bankAccount;
private String attachmentsJson;
private String remark;
private List<PaymentApplicationInvoiceRequest> invoices;
private List<PaymentApplicationRecordRequest> paymentRecords;
}
@@ -0,0 +1,33 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments from this software for such purposes.
* Copyright of this software remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/** 付款申请状态请求。 @author Chill */
@Data
public class PaymentApplicationStatusRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String reason;
}
@@ -0,0 +1,40 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 预结算预付申请请求
*
* @author Chill
*/
@Data
@Schema(description = "预结算预付申请请求")
public class PreSettlementAdvanceRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "预结算单ID")
private Long preSettlementId;
@Schema(description = "申请预付金额")
private BigDecimal appliedAmount;
@Schema(description = "金蝶预付单号")
private String kingdeeAdvanceNo;
}
@@ -0,0 +1,77 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 预结算明细调整请求
*
* @author Chill
*/
@Data
@Schema(description = "预结算明细调整请求")
public class PreSettlementDetailAdjustRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "预结算明细ID")
private Long detailId;
@Schema(description = "调整原因")
private String changeReason;
@Schema(description = "明细费用行")
private List<FeeRow> rows;
@Data
@Schema(description = "明细费用行")
public static class FeeRow implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "费用快照ID")
private Long id;
@Schema(description = "运输总量")
private BigDecimal transportQuantity;
@Schema(description = "里程")
private BigDecimal mileage;
@Schema(description = "运输单价")
private BigDecimal unitPrice;
@Schema(description = "运费")
private BigDecimal freightAmount;
@Schema(description = "费用项目")
private Map<String, BigDecimal> feeItems;
@Schema(description = "结算金额(含税)")
private BigDecimal settlementAmountTax;
@Schema(description = "结算金额(不含税)")
private BigDecimal settlementAmountNoTax;
@Schema(description = "备注")
private String remark;
}
}
@@ -0,0 +1,108 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/**
* 预结算单保存请求
*
* @author Chill
*/
@Data
@Schema(description = "预结算单保存请求")
public class PreSettlementSaveRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "预结算单ID")
private Long id;
@Schema(description = "合同ID")
private Long contractId;
@Schema(description = "结算类型:receivable/payable")
private String settlementType;
@Schema(description = "汇率日期")
private LocalDate exchangeRateDate;
@Schema(description = "结算汇率")
private BigDecimal exchangeRate;
@Schema(description = "附件JSON")
private String attachmentsJson;
@Schema(description = "备注")
private String remark;
@Schema(description = "应收应付明细ID")
private List<Long> sourceDetailIds;
@Schema(description = "是否允许批量转结算兼容历史来源明细的项目、所属组织或客商差异")
private Boolean allowSourceMismatch;
@Schema(description = "结算合计费用")
private List<SummaryFee> summaryFees;
@Data
@Schema(description = "结算合计费用")
public static class SummaryFee implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "合计费用ID")
private Long id;
@Schema(description = "费用类型")
private String feeType;
@Schema(description = "费用项")
private String feeItem;
@Schema(description = "调整金额")
private BigDecimal adjustAmount;
@Schema(description = "原金额")
private BigDecimal originalAmount;
@Schema(description = "备注")
private String remark;
@Schema(description = "是否手工添加")
private Integer manualFlag;
}
}
@@ -0,0 +1,42 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 预结算状态操作请求
*
* @author Chill
*/
@Data
@Schema(description = "预结算状态操作请求")
public class PreSettlementStatusRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "预结算单ID")
private Long id;
@Schema(description = "操作原因")
private String reason;
@Schema(description = "当前节点")
private String currentNode;
@Schema(description = "当前处理人")
private String currentProcessor;
}
@@ -0,0 +1,48 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 认领记录附件维护请求
*
* @author Chill
*/
@Data
@Schema(description = "认领记录附件维护请求")
public class ReceiptClaimAttachmentsRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long id;
private String attachmentsJson;
}
@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 收款流水认领请求
*
* @author Chill
*/
@Data
public class ReceiptClaimRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long flowId;
private String attachmentsJson;
private String remark;
private List<SettlementRow> settlements;
/**
* 结算单分摊行
*/
@Data
public static class SettlementRow implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long settlementId;
private BigDecimal allocatedReceiptAmount;
}
}
@@ -0,0 +1,69 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
/**
* 金蝶收款流水同步请求
*
* @author Chill
*/
@Data
public class ReceiptFlowSyncRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private List<FlowRow> flows;
/**
* 金蝶收款流水行
*/
@Data
public static class FlowRow implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private String receiptNoticeNo;
private String payerName;
private BigDecimal receiptAmount;
private String counterpartyName;
private String counterpartyAccount;
private String counterpartyBank;
private String summary;
private LocalDateTime transactionTime;
private String detailSerialNo;
private LocalDateTime sourceUpdatedTime;
}
}
@@ -0,0 +1,92 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 应收应付费用调整请求
*
* @author Chill
*/
@Data
@Schema(description = "应收应付费用调整请求")
public class ReceivablePayableAdjustFeeRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "应收应付明细ID")
private Long detailId;
@Schema(description = "调整原因")
private String adjustReason;
@Schema(description = "费用调整行")
private List<AdjustRow> rows;
@Data
@Schema(description = "费用调整行")
public static class AdjustRow implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "费用行ID")
private Long id;
@Schema(description = "货物名称")
private String cargoName;
@Schema(description = "货物类型")
private String cargoType;
@Schema(description = "规格")
private String specification;
@Schema(description = "型号")
private String model;
@Schema(description = "计费要素")
private String billingFactor;
@Schema(description = "计费类型")
private String billingType;
@Schema(description = "运输量")
private BigDecimal transportQuantity;
@Schema(description = "运费计算单位")
private String priceUnit;
@Schema(description = "运输单价")
private BigDecimal unitPrice;
@Schema(description = "里程")
private BigDecimal mileage;
@Schema(description = "运输费")
private BigDecimal freightAmount;
@Schema(description = "动态费用项目")
private Map<String, BigDecimal> feeItems;
@Schema(description = "是否手工费用行")
private Boolean manualFee;
@Schema(description = "备注")
private String remark;
@Schema(description = "变更原因")
private String changeReason;
}
}
@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Map;
/**
* 应收应付费用调整试算请求
*
* @author Chill
*/
@Data
@Schema(description = "应收应付费用调整试算请求")
public class ReceivablePayableFeeCalculateRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "应收应付明细ID")
private Long detailId;
@Schema(description = "费用行ID")
private Long feeId;
@Schema(description = "运输量")
private BigDecimal transportQuantity;
@Schema(description = "里程")
private BigDecimal mileage;
@Schema(description = "运输费")
private BigDecimal freightAmount;
@Schema(description = "动态费用项目")
private Map<String, BigDecimal> feeItems;
}
@@ -46,6 +46,9 @@ public class ReceivablePayableGenerateRequest implements Serializable {
@Schema(description = "合同ID")
private Long contractId;
@Schema(description = "结算类型:receivable/payable")
private String settlementType;
@Schema(description = "计费方案ID")
private String billingPlanId;
@@ -28,6 +28,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import java.math.BigDecimal;
/**
* 应收应付更新费用请求
@@ -47,12 +48,21 @@ public class ReceivablePayableUpdateFeeRequest implements Serializable {
@Schema(description = "合同ID")
private Long contractId;
@Schema(description = "结算类型:receivable/payable")
private String settlementType;
@Schema(description = "计费方案ID")
private String billingPlanId;
@Schema(description = "调整原因")
private String adjustReason;
@Schema(description = "手工调差金额,可正可负")
private BigDecimal adjustAmount;
@Schema(description = "手工调差费用项")
private String adjustFeeItem;
@Schema(description = "仅关闭")
private Boolean closeOnly;
@@ -0,0 +1,30 @@
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
public class SettlementAdjustmentSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private Long formalSettlementId;
private String attachmentsJson;
private String remark;
private List<Detail> details;
@Data
public static class Detail implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long formalSettlementDetailId;
private Long formalSettlementDetailFeeId;
private String feeType;
private String feeItem;
private BigDecimal originalAmountTax;
private BigDecimal adjustmentAmountTax;
private BigDecimal adjustmentAmountNoTax;
private String remark;
}
}
@@ -0,0 +1,12 @@
package org.springblade.transport.pojo.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class SettlementAdjustmentStatusRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private String reason;
}

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