mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
Merge remote-tracking branch 'gitee/jdk17-dev' into jdk17-dev
This commit is contained in:
commit
f3a03c1afa
42 files changed
+616
-390
No files matched your search
@@ -26,7 +26,6 @@ import com.pig4cloud.pigx.admin.api.entity.SysTenant;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteClientDetailsService;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteTenantService;
|
||||
import com.pig4cloud.pigx.admin.api.vo.TokenVO;
|
||||
import com.pig4cloud.pigx.auth.support.handler.PigxAuthenticationFailureEventHandler;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
@@ -55,7 +54,6 @@ import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
|
||||
import org.springframework.security.oauth2.server.authorization.OAuth2TokenType;
|
||||
import org.springframework.security.oauth2.server.resource.InvalidBearerTokenException;
|
||||
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -78,8 +76,6 @@ import java.util.stream.Collectors;
|
||||
@RequestMapping("/token")
|
||||
public class PigxTokenEndpoint {
|
||||
|
||||
private final PigxAuthenticationFailureEventHandler authenticationFailureHandler;
|
||||
|
||||
private final OAuth2AuthorizationService authorizationService;
|
||||
|
||||
private final RemoteClientDetailsService clientDetailsService;
|
||||
@@ -153,16 +149,14 @@ public class PigxTokenEndpoint {
|
||||
|
||||
if (StrUtil.isBlank(token)) {
|
||||
httpResponse.setStatusCode(HttpStatus.UNAUTHORIZED);
|
||||
this.authenticationFailureHandler.onAuthenticationFailure(request, response,
|
||||
new InvalidBearerTokenException(OAuth2ErrorCodesExpand.TOKEN_MISSING));
|
||||
return R.failed();
|
||||
return R.failed(OAuth2ErrorCodesExpand.TOKEN_MISSING);
|
||||
}
|
||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||
|
||||
// 如果令牌不存在 返回401
|
||||
if (authorization == null || authorization.getAccessToken() == null) {
|
||||
this.authenticationFailureHandler.onAuthenticationFailure(request, response,
|
||||
new InvalidBearerTokenException(OAuth2ErrorCodesExpand.INVALID_BEARER_TOKEN));
|
||||
httpResponse.setStatusCode(HttpStatus.UNAUTHORIZED);
|
||||
return R.failed(OAuth2ErrorCodesExpand.INVALID_BEARER_TOKEN);
|
||||
}
|
||||
|
||||
// 获取令牌
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
<properties>
|
||||
<pigx.version>5.6.0</pigx.version>
|
||||
<mybatis-plus.version>3.5.7</mybatis-plus.version>
|
||||
<mybatis-plus-join.version>1.4.13</mybatis-plus-join.version>
|
||||
<mybatis-plus.version>3.5.9</mybatis-plus.version>
|
||||
<mybatis-plus-join.version>1.5.2</mybatis-plus-join.version>
|
||||
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||
<druid.version>1.2.20</druid.version>
|
||||
<hutool.version>5.8.31</hutool.version>
|
||||
<druid.version>1.2.23</druid.version>
|
||||
<hutool.version>5.8.33</hutool.version>
|
||||
<mysql.connector.version>8.3.0</mysql.connector.version>
|
||||
<oracle.version>21.3.0.0</oracle.version>
|
||||
<sqlserver.version>8.4.1.jre8</sqlserver.version>
|
||||
@@ -31,7 +31,7 @@
|
||||
<knife4j.version>3.0.5</knife4j.version>
|
||||
<springdoc.version>2.1.0</springdoc.version>
|
||||
<swagger.core.version>2.2.14</swagger.core.version>
|
||||
<mp.weixin.version>4.6.0</mp.weixin.version>
|
||||
<mp.weixin.version>4.6.7.B</mp.weixin.version>
|
||||
<ijpay.version>2.9.10-17</ijpay.version>
|
||||
<groovy.version>3.0.3</groovy.version>
|
||||
<javax.version>4.0.1</javax.version>
|
||||
@@ -46,7 +46,7 @@
|
||||
<javers.version>7.3.3</javers.version>
|
||||
<seata.version>1.7.0</seata.version>
|
||||
<asm.version>7.1</asm.version>
|
||||
<sensitive.word.version>0.17.0</sensitive.word.version>
|
||||
<sensitive.word.version>0.21.0</sensitive.word.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<docker.plugin.version>0.33.0</docker.plugin.version>
|
||||
<cloud.plugin.version>1.0.0</cloud.plugin.version>
|
||||
@@ -54,6 +54,7 @@
|
||||
<anyline.version>8.7.2-jdk17-20240808</anyline.version>
|
||||
<sms4j.version>3.2.1</sms4j.version>
|
||||
<jakarta.mail.version>2.0.1</jakarta.mail.version>
|
||||
<dashscope.version>2.16.5</dashscope.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<common.io.version>2.16.1</common.io.version>
|
||||
<velocity.tool.version>3.1</velocity.tool.version>
|
||||
@@ -206,18 +207,6 @@
|
||||
<artifactId>sensitive-word</artifactId>
|
||||
<version>${sensitive.word.version}</version>
|
||||
</dependency>
|
||||
<!--mybatis plus extension,包含了mybatis plus core-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<!--mybatis-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
|
||||
@@ -272,7 +261,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmDialect-for-hibernate6.1</artifactId>
|
||||
<artifactId>DmDialect-for-hibernate5.3</artifactId>
|
||||
<version>${dm.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -432,6 +421,18 @@
|
||||
<artifactId>jakarta.mail</artifactId>
|
||||
<version>${jakarta.mail.version}</version>
|
||||
</dependency>
|
||||
<!-- 阿里云百炼工具 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dashscope-sdk-java</artifactId>
|
||||
<version>${dashscope.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!--webhook-->
|
||||
<dependency>
|
||||
<groupId>org.dromara.sms4j</groupId>
|
||||
@@ -505,6 +506,13 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-bom</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
+27
-12
@@ -28,6 +28,7 @@ import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -39,13 +40,13 @@ import java.util.Map;
|
||||
public class RepeatBodyRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private final byte[] bodyByteArray;
|
||||
|
||||
private final Map<String, String[]> parameterMap;
|
||||
|
||||
public RepeatBodyRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
this.bodyByteArray = getByteBody(request);
|
||||
this.parameterMap = super.getParameterMap();
|
||||
// 使用 HashMap 以便后续可以修改
|
||||
this.parameterMap = new HashMap<>(request.getParameterMap());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,17 +61,17 @@ public class RepeatBodyRequestWrapper extends HttpServletRequestWrapper {
|
||||
return new ServletInputStream() {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
return byteArrayInputStream.available() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return false;
|
||||
return true; // 可以读取
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener readListener) {
|
||||
// doNoting
|
||||
// doNothing
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,20 +85,34 @@ public class RepeatBodyRequestWrapper extends HttpServletRequestWrapper {
|
||||
byte[] body = new byte[0];
|
||||
try {
|
||||
body = StreamUtils.copyToByteArray(request.getInputStream());
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
log.error("解析流中数据异常", e);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重写 getParameterMap() 方法 解决 undertow 中流被读取后,会进行标记,从而导致无法正确获取 body 中的表单数据的问题
|
||||
* @return Map<String, String [ ]> parameterMap
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String[]> getParameterMap() {
|
||||
return this.parameterMap;
|
||||
return this.parameterMap; // 返回可变的 parameterMap
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置新的参数映射
|
||||
* @param parameterMap 新的参数映射
|
||||
*/
|
||||
public void setParameterMap(Map<String, String[]> parameterMap) {
|
||||
this.parameterMap.clear();
|
||||
this.parameterMap.putAll(parameterMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameter(String name) {
|
||||
String[] values = parameterMap.get(name);
|
||||
return (values != null && values.length > 0) ? values[0] : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterValues(String name) {
|
||||
return parameterMap.get(name);
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -40,6 +40,7 @@ import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -66,7 +67,9 @@ public class SysLogUtils {
|
||||
|
||||
// get 参数脱敏
|
||||
PigxLogProperties logProperties = SpringUtil.getBean(PigxLogProperties.class);
|
||||
Map<String, String[]> paramsMap = MapUtil.removeAny(request.getParameterMap(),
|
||||
|
||||
// 修复request.getParameterMap()其他容器不允许改,tomcat会报错,当然undertow默认可以的
|
||||
Map<String, String[]> paramsMap = MapUtil.removeAny(new HashMap<>(request.getParameterMap()),
|
||||
ArrayUtil.toArray(logProperties.getExcludeFields(), String.class));
|
||||
sysLog.setParams(HttpUtil.toParams(paramsMap));
|
||||
return sysLog;
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ public class PigxTocDefaultUserDetailsServiceImpl implements PigxUserDetailsServ
|
||||
UserDetails getUserDetailsAppUser(R<AppUserInfo> result) {
|
||||
// @formatter:off
|
||||
return RetOps.of(result)
|
||||
.assertSuccess(r -> new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodes.SERVER_ERROR, "用户信息获取失败",null)))
|
||||
.assertSuccess(r -> new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodes.SERVER_ERROR, "用户名或密码错误",null)))
|
||||
.getData()
|
||||
.map(this::convertUserDetailsAppUser)
|
||||
.orElseThrow(() -> new UsernameNotFoundException("用户不存在"));
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<description>pigx 分布式发号器</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 核心依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-core</artifactId>
|
||||
@@ -29,21 +30,10 @@
|
||||
<groupId>org.anyline</groupId>
|
||||
<artifactId>anyline-environment-spring-data-jdbc</artifactId>
|
||||
</dependency>
|
||||
<!-- 修改其他类型数据库时:根据数据库,添加不同的依赖 postgresql、oracle、dm-->
|
||||
<dependency>
|
||||
<groupId>org.anyline</groupId>
|
||||
<artifactId>anyline-data-jdbc-mysql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.anyline</groupId>
|
||||
<artifactId>anyline-data-jdbc-postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.anyline</groupId>
|
||||
<artifactId>anyline-data-jdbc-oracle</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.anyline</groupId>
|
||||
<artifactId>anyline-data-jdbc-dm</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+2
@@ -11,6 +11,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.flow.engine.utils.ModelUtil;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import com.pig4cloud.pigx.flow.task.entity.Process;
|
||||
@@ -95,6 +96,7 @@ public class EngineFlowController {
|
||||
* @param processInstanceParamDto 启动参数
|
||||
* @return 流程实例ID
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("/start")
|
||||
public R start(@RequestBody ProcessInstanceParamDto processInstanceParamDto) {
|
||||
Authentication.setAuthenticatedUserId(processInstanceParamDto.getStartUserId());
|
||||
|
||||
+8
-2
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
* @date 2023/7/14
|
||||
*/
|
||||
@FeignClient(contextId = "remoteAiFlowService", value = ServiceNameConstants.FLOW_TASK_SERVER)
|
||||
public interface RemoteAiFlowService {
|
||||
public interface RemoteFlowApiFlowService {
|
||||
|
||||
/**
|
||||
* 查询所有我可以发起的表单
|
||||
@@ -38,7 +38,13 @@ public interface RemoteAiFlowService {
|
||||
R<ProcessVO> getDetail(@RequestParam("flowId") String flowId);
|
||||
|
||||
|
||||
/**
|
||||
* 启动流程实例
|
||||
*
|
||||
* @param paramDto param dto
|
||||
* @return {@link R } 流程实例ID {@link String}
|
||||
*/
|
||||
@PostMapping("/process-instance/startProcessInstance")
|
||||
R startProcessInstance(@RequestBody ProcessInstanceParamDto paramDto);
|
||||
R<String> startProcessInstance(@RequestBody ProcessInstanceParamDto paramDto);
|
||||
|
||||
}
|
||||
+2
@@ -3,6 +3,7 @@ package com.pig4cloud.pigx.flow.task.api.feign;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.NoToken;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -48,6 +49,7 @@ public interface RemoteFlowEngineService {
|
||||
* @param processInstanceParamDto 流程实例参数
|
||||
* @return 启动流程结果
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/flow/start")
|
||||
R<String> startProcess(@RequestBody ProcessInstanceParamDto processInstanceParamDto);
|
||||
|
||||
|
||||
+7
@@ -2,6 +2,7 @@ package com.pig4cloud.pigx.flow.task.api.feign;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.NoToken;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -22,6 +23,7 @@ public interface RemoteFlowTaskService {
|
||||
* 节点开始事件
|
||||
* @param nodeRecordParamDto
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/remote/startNodeEvent")
|
||||
void startNodeEvent(@RequestBody ProcessNodeRecordParamDto nodeRecordParamDto);
|
||||
|
||||
@@ -29,6 +31,7 @@ public interface RemoteFlowTaskService {
|
||||
* 节点结束事件
|
||||
* @param nodeRecordParamDto
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/remote/endNodeEvent")
|
||||
void endNodeEvent(@RequestBody ProcessNodeRecordParamDto nodeRecordParamDto);
|
||||
|
||||
@@ -43,6 +46,7 @@ public interface RemoteFlowTaskService {
|
||||
* 创建流程事件
|
||||
* @param processInstanceRecordParamDto
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/remote/createProcessEvent")
|
||||
void createProcessEvent(@RequestBody ProcessInstanceRecordParamDto processInstanceRecordParamDto);
|
||||
|
||||
@@ -73,6 +77,7 @@ public interface RemoteFlowTaskService {
|
||||
* @param nodeId 节点id
|
||||
* @return
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/processNodeData/getNodeData")
|
||||
R<Node> queryNodeOriData(@RequestParam("flowId") String flowId, @RequestParam("nodeId") String nodeId);
|
||||
|
||||
@@ -80,6 +85,7 @@ public interface RemoteFlowTaskService {
|
||||
* 节点开始指派用户了
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/remote/startAssignUser")
|
||||
R startAssignUser(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
@@ -87,6 +93,7 @@ public interface RemoteFlowTaskService {
|
||||
* 任务结束事件
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/remote/taskEndEvent")
|
||||
R taskEndEvent(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto);
|
||||
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowTaskService
|
||||
com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowEngineService
|
||||
com.pig4cloud.pigx.flow.task.api.feign.RemoteAiFlowService
|
||||
com.pig4cloud.pigx.flow.task.api.feign.RemoteFlowApiFlowService
|
||||
@@ -98,21 +98,6 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<!-- 达梦驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
</dependency>
|
||||
<!-- postgresql 驱动 -->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
<!-- oracle 驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
|
||||
+14
@@ -1,6 +1,7 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.dto.TaskQueryParamDto;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessInstanceService;
|
||||
@@ -30,6 +31,19 @@ public class ProcessInstanceController {
|
||||
return processInstanceService.startProcessInstance(processInstanceParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动内部流程实例
|
||||
*
|
||||
* @param processInstanceParamDto 进程实例参数 DTO
|
||||
* @return {@link R }
|
||||
*/
|
||||
@Inner
|
||||
@SneakyThrows
|
||||
@PostMapping("startInnerProcessInstance")
|
||||
public R startInnerProcessInstance(@RequestBody ProcessInstanceParamDto processInstanceParamDto) {
|
||||
return processInstanceService.startProcessInstance(processInstanceParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前登录用户的待办任务
|
||||
* @param pageDto
|
||||
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.flow.task.dto.Node;
|
||||
import com.pig4cloud.pigx.flow.task.dto.ProcessNodeDataDto;
|
||||
import com.pig4cloud.pigx.flow.task.service.IProcessNodeDataService;
|
||||
@@ -38,6 +39,7 @@ public class ProcessNodeDataController {
|
||||
* @param nodeId
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("getNodeData")
|
||||
public R<Node> getNodeData(String flowId, String nodeId) {
|
||||
return processNodeDataService.getNodeData(flowId, nodeId);
|
||||
|
||||
+137
-118
@@ -1,6 +1,7 @@
|
||||
package com.pig4cloud.pigx.flow.task.controller;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.flow.task.dto.*;
|
||||
import com.pig4cloud.pigx.flow.task.service.IRemoteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -17,136 +18,154 @@ import java.util.Map;
|
||||
@RequestMapping("/remote")
|
||||
public class RemoteController {
|
||||
|
||||
private final IRemoteService remoteService;
|
||||
private final IRemoteService remoteService;
|
||||
|
||||
/**
|
||||
* 根据角色id集合查询用户id集合
|
||||
* @param roleIdList
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryUserIdListByRoleIdList")
|
||||
public R<List<Long>> queryUserIdListByRoleIdList(@RequestBody List<Long> roleIdList) {
|
||||
return remoteService.queryUserIdListByRoleIdList(roleIdList);
|
||||
}
|
||||
/**
|
||||
* 根据角色id集合查询用户id集合
|
||||
*
|
||||
* @param roleIdList
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryUserIdListByRoleIdList")
|
||||
public R<List<Long>> queryUserIdListByRoleIdList(@RequestBody List<Long> roleIdList) {
|
||||
return remoteService.queryUserIdListByRoleIdList(roleIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存抄送
|
||||
* @param copyDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("savecc")
|
||||
public R saveCC(@RequestBody ProcessCopyDto copyDto) {
|
||||
return remoteService.saveCC(copyDto);
|
||||
}
|
||||
/**
|
||||
* 保存抄送
|
||||
*
|
||||
* @param copyDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("savecc")
|
||||
public R saveCC(@RequestBody ProcessCopyDto copyDto) {
|
||||
return remoteService.saveCC(copyDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否是所有的父级
|
||||
* @param checkParentDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("checkIsAllParent")
|
||||
public R<Boolean> checkIsAllParent(@RequestBody CheckParentDto checkParentDto) {
|
||||
return remoteService.checkIsAllParent(checkParentDto);
|
||||
}
|
||||
/**
|
||||
* 检查是否是所有的父级
|
||||
*
|
||||
* @param checkParentDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("checkIsAllParent")
|
||||
public R<Boolean> checkIsAllParent(@RequestBody CheckParentDto checkParentDto) {
|
||||
return remoteService.checkIsAllParent(checkParentDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门id集合查询用户id集合
|
||||
* @param depIdList
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryUserIdListByDepIdList")
|
||||
public R<List<Long>> queryUserIdListByDepIdList(@RequestBody List<Long> depIdList) {
|
||||
return remoteService.queryUserIdListByDepIdList(depIdList);
|
||||
}
|
||||
/**
|
||||
* 根据部门id集合查询用户id集合
|
||||
*
|
||||
* @param depIdList
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryUserIdListByDepIdList")
|
||||
public R<List<Long>> queryUserIdListByDepIdList(@RequestBody List<Long> depIdList) {
|
||||
return remoteService.queryUserIdListByDepIdList(depIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否是所有的子级
|
||||
* @param checkChildDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("checkIsAllChild")
|
||||
public R<Boolean> checkIsAllChild(@RequestBody CheckChildDto checkChildDto) {
|
||||
return remoteService.checkIsAllChild(checkChildDto);
|
||||
}
|
||||
/**
|
||||
* 检查是否是所有的子级
|
||||
*
|
||||
* @param checkChildDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("checkIsAllChild")
|
||||
public R<Boolean> checkIsAllChild(@RequestBody CheckChildDto checkChildDto) {
|
||||
return remoteService.checkIsAllChild(checkChildDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的信息-包括扩展字段
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryUserAllInfo")
|
||||
public R<Map<String, Object>> queryUserAllInfo(long userId) {
|
||||
return remoteService.queryUserAllInfo(userId);
|
||||
}
|
||||
/**
|
||||
* 获取用户的信息-包括扩展字段
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryUserAllInfo")
|
||||
public R<Map<String, Object>> queryUserAllInfo(long userId) {
|
||||
return remoteService.queryUserAllInfo(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始节点事件
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("startNodeEvent")
|
||||
public R startNodeEvent(@RequestBody ProcessNodeRecordParamDto recordParamDto) {
|
||||
return remoteService.startNodeEvent(recordParamDto);
|
||||
}
|
||||
/**
|
||||
* 开始节点事件
|
||||
*
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("/startNodeEvent")
|
||||
public R startNodeEvent(@RequestBody ProcessNodeRecordParamDto recordParamDto) {
|
||||
return remoteService.startNodeEvent(recordParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程创建了
|
||||
* @param processInstanceRecordParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("createProcessEvent")
|
||||
public R createProcessEvent(@RequestBody ProcessInstanceRecordParamDto processInstanceRecordParamDto) {
|
||||
return remoteService.createProcessEvent(processInstanceRecordParamDto);
|
||||
}
|
||||
/**
|
||||
* 流程创建了
|
||||
*
|
||||
* @param processInstanceRecordParamDto
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("createProcessEvent")
|
||||
public R createProcessEvent(@RequestBody ProcessInstanceRecordParamDto processInstanceRecordParamDto) {
|
||||
return remoteService.createProcessEvent(processInstanceRecordParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束节点事件
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("endNodeEvent")
|
||||
public R endNodeEvent(@RequestBody ProcessNodeRecordParamDto recordParamDto) {
|
||||
return remoteService.endNodeEvent(recordParamDto);
|
||||
}
|
||||
/**
|
||||
* 结束节点事件
|
||||
*
|
||||
* @param recordParamDto
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("endNodeEvent")
|
||||
public R endNodeEvent(@RequestBody ProcessNodeRecordParamDto recordParamDto) {
|
||||
return remoteService.endNodeEvent(recordParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始设置执行人
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("startAssignUser")
|
||||
public R startAssignUser(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
return remoteService.startAssignUser(processNodeRecordAssignUserParamDto);
|
||||
}
|
||||
/**
|
||||
* 开始设置执行人
|
||||
*
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("startAssignUser")
|
||||
public R startAssignUser(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
return remoteService.startAssignUser(processNodeRecordAssignUserParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务结束事件
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("taskEndEvent")
|
||||
public R taskEndEvent(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
return remoteService.taskEndEvent(processNodeRecordAssignUserParamDto);
|
||||
}
|
||||
/**
|
||||
* 任务结束事件
|
||||
*
|
||||
* @param processNodeRecordAssignUserParamDto
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("taskEndEvent")
|
||||
public R taskEndEvent(@RequestBody ProcessNodeRecordAssignUserParamDto processNodeRecordAssignUserParamDto) {
|
||||
return remoteService.taskEndEvent(processNodeRecordAssignUserParamDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实例结束
|
||||
* @param processInstanceParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("endProcess")
|
||||
public R endProcess(@RequestBody ProcessInstanceParamDto processInstanceParamDto) {
|
||||
return remoteService.endProcess(processInstanceParamDto.getProcessInstanceId());
|
||||
}
|
||||
/**
|
||||
* 实例结束
|
||||
*
|
||||
* @param processInstanceParamDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("endProcess")
|
||||
public R endProcess(@RequestBody ProcessInstanceParamDto processInstanceParamDto) {
|
||||
return remoteService.endProcess(processInstanceParamDto.getProcessInstanceId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程管理员
|
||||
* @param flowId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryProcessAdmin")
|
||||
public R<Long> queryProcessAdmin(String flowId) {
|
||||
return remoteService.queryProcessAdmin(flowId);
|
||||
}
|
||||
/**
|
||||
* 查询流程管理员
|
||||
*
|
||||
* @param flowId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryProcessAdmin")
|
||||
public R<Long> queryProcessAdmin(String flowId) {
|
||||
return remoteService.queryProcessAdmin(flowId);
|
||||
}
|
||||
|
||||
}
|
||||
+48
-46
@@ -69,16 +69,18 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
*/
|
||||
@Override
|
||||
public R startProcessInstance(ProcessInstanceParamDto processInstanceParamDto) {
|
||||
// 如果没有传递根节点(发起人),则根据当前用户初始化一个
|
||||
if (StrUtil.isBlank(processInstanceParamDto.getStartUserId())) {
|
||||
PigxUser user = SecurityUtils.getUser();
|
||||
processInstanceParamDto.setStartUserId(String.valueOf(user.getId()));
|
||||
Map<String, Object> paramMap = processInstanceParamDto.getParamMap();
|
||||
Dict rootUser = Dict.create()
|
||||
.set("id", user.getId())
|
||||
.set("name", user.getUsername())
|
||||
.set("type", NodeUserTypeEnum.USER.getKey());
|
||||
paramMap.put("root", CollUtil.newArrayList(rootUser));
|
||||
}
|
||||
|
||||
PigxUser user = SecurityUtils.getUser();
|
||||
|
||||
processInstanceParamDto.setStartUserId(String.valueOf(user.getId()));
|
||||
Map<String, Object> paramMap = processInstanceParamDto.getParamMap();
|
||||
Dict rootUser = Dict.create()
|
||||
.set("id", user.getId())
|
||||
.set("name", user.getUsername())
|
||||
.set("type", NodeUserTypeEnum.USER.getKey());
|
||||
paramMap.put("root", CollUtil.newArrayList(rootUser));
|
||||
return flowEngineService.startProcess(processInstanceParamDto);
|
||||
}
|
||||
|
||||
@@ -91,56 +93,56 @@ public class ProcessInstanceServiceImpl implements IProcessInstanceService {
|
||||
@Override
|
||||
public R queryMineTask(TaskQueryParamDto taskQueryParamDto) {
|
||||
taskQueryParamDto.setAssign(SecurityUtils.getUser().getId().toString());
|
||||
R<Page<TaskDto>> r = flowEngineService.queryAssignTask(taskQueryParamDto);
|
||||
R<Page<TaskDto>> r = flowEngineService.queryAssignTask(taskQueryParamDto);
|
||||
|
||||
if (CollUtil.isEmpty(r.getData().getRecords())) {
|
||||
return r;
|
||||
}
|
||||
if (CollUtil.isEmpty(r.getData().getRecords())) {
|
||||
return r;
|
||||
}
|
||||
|
||||
Set<String> processInstanceIdSet = r.getData()
|
||||
.getRecords()
|
||||
.stream()
|
||||
.map(TaskDto::getProcessInstanceId)
|
||||
.collect(Collectors.toSet());
|
||||
Set<String> processInstanceIdSet = r.getData()
|
||||
.getRecords()
|
||||
.stream()
|
||||
.map(TaskDto::getProcessInstanceId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 流程实例记录
|
||||
List<ProcessInstanceRecord> processInstanceRecordList = processInstanceRecordService.lambdaQuery()
|
||||
.in(ProcessInstanceRecord::getProcessInstanceId, processInstanceIdSet)
|
||||
.list();
|
||||
// 流程实例记录
|
||||
List<ProcessInstanceRecord> processInstanceRecordList = processInstanceRecordService.lambdaQuery()
|
||||
.in(ProcessInstanceRecord::getProcessInstanceId, processInstanceIdSet)
|
||||
.list();
|
||||
|
||||
// 发起人
|
||||
// 发起人
|
||||
// 发起人
|
||||
List<Long> collect = processInstanceRecordList.stream().map(ProcessInstanceRecord::getUserId).collect(Collectors.toList());
|
||||
List<SysUser> startUserList = userService.getUserById(collect).getData();
|
||||
|
||||
Page<TaskDto> pageResultDto = r.getData();
|
||||
List<TaskDto> taskDtoList = new ArrayList<>();
|
||||
for (TaskDto record : r.getData().getRecords()) {
|
||||
ProcessInstanceRecord processInstanceRecord = processInstanceRecordList.stream()
|
||||
.filter(w -> StrUtil.equals(w.getProcessInstanceId(), record.getProcessInstanceId()))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
Page<TaskDto> pageResultDto = r.getData();
|
||||
List<TaskDto> taskDtoList = new ArrayList<>();
|
||||
for (TaskDto record : r.getData().getRecords()) {
|
||||
ProcessInstanceRecord processInstanceRecord = processInstanceRecordList.stream()
|
||||
.filter(w -> StrUtil.equals(w.getProcessInstanceId(), record.getProcessInstanceId()))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
|
||||
if (processInstanceRecord != null) {
|
||||
record.setProcessName(processInstanceRecord.getName());
|
||||
SysUser startUser = startUserList.stream()
|
||||
.filter(w -> w.getUserId().longValue() == processInstanceRecord.getUserId())
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
if (processInstanceRecord != null) {
|
||||
record.setProcessName(processInstanceRecord.getName());
|
||||
SysUser startUser = startUserList.stream()
|
||||
.filter(w -> w.getUserId().longValue() == processInstanceRecord.getUserId())
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
|
||||
record.setRootUserId(processInstanceRecord.getUserId());
|
||||
record.setGroupName(processInstanceRecord.getGroupName());
|
||||
record.setRootUserName(startUser.getUsername());
|
||||
record.setRootUserAvatarUrl(startUser.getAvatar());
|
||||
record.setStartTime(processInstanceRecord.getCreateTime());
|
||||
record.setRootUserId(processInstanceRecord.getUserId());
|
||||
record.setGroupName(processInstanceRecord.getGroupName());
|
||||
record.setRootUserName(startUser.getUsername());
|
||||
record.setRootUserAvatarUrl(startUser.getAvatar());
|
||||
record.setStartTime(processInstanceRecord.getCreateTime());
|
||||
|
||||
taskDtoList.add(record);
|
||||
}
|
||||
}
|
||||
taskDtoList.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
pageResultDto.setRecords(taskDtoList);
|
||||
pageResultDto.setRecords(taskDtoList);
|
||||
|
||||
return R.ok(pageResultDto);
|
||||
return R.ok(pageResultDto);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,24 +37,6 @@
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--PG-->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--DM8-->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<mybatis-spring-boot-starter.version>3.0.3</mybatis-spring-boot-starter.version>
|
||||
<jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version>
|
||||
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -97,14 +95,12 @@
|
||||
<dependency>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
<version>${jakarta.annotation-api.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<version>${jakarta.servlet-api.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package com.xxl.job.admin.controller;
|
||||
|
||||
import com.xxl.job.admin.controller.annotation.PermissionLimit;
|
||||
import com.xxl.job.admin.service.LoginService;
|
||||
import com.xxl.job.admin.service.XxlJobService;
|
||||
import com.xxl.job.admin.service.impl.LoginService;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@@ -37,7 +37,7 @@ public class IndexController {
|
||||
private LoginService loginService;
|
||||
|
||||
@RequestMapping("/")
|
||||
public String index(Model model, HttpServletRequest request) {
|
||||
public String index(Model model) {
|
||||
|
||||
Map<String, Object> dashboardMap = xxlJobService.dashboardInfo();
|
||||
model.addAllAttributes(dashboardMap);
|
||||
|
||||
+17
-13
@@ -1,5 +1,6 @@
|
||||
package com.xxl.job.admin.controller;
|
||||
|
||||
import com.xxl.job.admin.controller.interceptor.PermissionInterceptor;
|
||||
import com.xxl.job.admin.core.model.XxlJobInfo;
|
||||
import com.xxl.job.admin.core.model.XxlJobLogGlue;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
@@ -45,7 +46,7 @@ public class JobCodeController {
|
||||
}
|
||||
|
||||
// valid permission
|
||||
JobInfoController.validPermission(request, jobInfo.getJobGroup());
|
||||
PermissionInterceptor.validJobGroupPermission(request, jobInfo.getJobGroup());
|
||||
|
||||
// Glue类型-字典
|
||||
model.addAttribute("GlueTypeEnum", GlueTypeEnum.values());
|
||||
@@ -57,7 +58,7 @@ public class JobCodeController {
|
||||
|
||||
@RequestMapping("/save")
|
||||
@ResponseBody
|
||||
public ReturnT<String> save(Model model, int id, String glueSource, String glueRemark) {
|
||||
public ReturnT<String> save(HttpServletRequest request, int id, String glueSource, String glueRemark) {
|
||||
// valid
|
||||
if (glueRemark == null) {
|
||||
return new ReturnT<String>(500,
|
||||
@@ -66,23 +67,26 @@ public class JobCodeController {
|
||||
if (glueRemark.length() < 4 || glueRemark.length() > 100) {
|
||||
return new ReturnT<String>(500, I18nUtil.getString("jobinfo_glue_remark_limit"));
|
||||
}
|
||||
XxlJobInfo exists_jobInfo = xxlJobInfoDao.loadById(id);
|
||||
if (exists_jobInfo == null) {
|
||||
XxlJobInfo existsJobInfo = xxlJobInfoDao.loadById(id);
|
||||
if (existsJobInfo == null) {
|
||||
return new ReturnT<String>(500, I18nUtil.getString("jobinfo_glue_jobid_unvalid"));
|
||||
}
|
||||
|
||||
// update new code
|
||||
exists_jobInfo.setGlueSource(glueSource);
|
||||
exists_jobInfo.setGlueRemark(glueRemark);
|
||||
exists_jobInfo.setGlueUpdatetime(new Date());
|
||||
// valid permission
|
||||
PermissionInterceptor.validJobGroupPermission(request, existsJobInfo.getJobGroup());
|
||||
|
||||
exists_jobInfo.setUpdateTime(new Date());
|
||||
xxlJobInfoDao.update(exists_jobInfo);
|
||||
// update new code
|
||||
existsJobInfo.setGlueSource(glueSource);
|
||||
existsJobInfo.setGlueRemark(glueRemark);
|
||||
existsJobInfo.setGlueUpdatetime(new Date());
|
||||
|
||||
existsJobInfo.setUpdateTime(new Date());
|
||||
xxlJobInfoDao.update(existsJobInfo);
|
||||
|
||||
// log old code
|
||||
XxlJobLogGlue xxlJobLogGlue = new XxlJobLogGlue();
|
||||
xxlJobLogGlue.setJobId(exists_jobInfo.getId());
|
||||
xxlJobLogGlue.setGlueType(exists_jobInfo.getGlueType());
|
||||
xxlJobLogGlue.setJobId(existsJobInfo.getId());
|
||||
xxlJobLogGlue.setGlueType(existsJobInfo.getGlueType());
|
||||
xxlJobLogGlue.setGlueSource(glueSource);
|
||||
xxlJobLogGlue.setGlueRemark(glueRemark);
|
||||
|
||||
@@ -91,7 +95,7 @@ public class JobCodeController {
|
||||
xxlJobLogGlueDao.save(xxlJobLogGlue);
|
||||
|
||||
// remove code backup more than 30
|
||||
xxlJobLogGlueDao.removeOld(exists_jobInfo.getId(), 30);
|
||||
xxlJobLogGlueDao.removeOld(existsJobInfo.getId(), 30);
|
||||
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
+4
-4
@@ -68,7 +68,7 @@ public class JobGroupController {
|
||||
public ReturnT<String> save(XxlJobGroup xxlJobGroup) {
|
||||
|
||||
// valid
|
||||
if (xxlJobGroup.getAppname() == null || xxlJobGroup.getAppname().trim().isEmpty()) {
|
||||
if (xxlJobGroup.getAppname() == null || xxlJobGroup.getAppname().trim().length() == 0) {
|
||||
return new ReturnT<String>(500, (I18nUtil.getString("system_please_input") + "AppName"));
|
||||
}
|
||||
if (xxlJobGroup.getAppname().length() < 4 || xxlJobGroup.getAppname().length() > 64) {
|
||||
@@ -77,7 +77,7 @@ public class JobGroupController {
|
||||
if (xxlJobGroup.getAppname().contains(">") || xxlJobGroup.getAppname().contains("<")) {
|
||||
return new ReturnT<String>(500, "AppName" + I18nUtil.getString("system_unvalid"));
|
||||
}
|
||||
if (xxlJobGroup.getTitle() == null || xxlJobGroup.getTitle().trim().isEmpty()) {
|
||||
if (xxlJobGroup.getTitle() == null || xxlJobGroup.getTitle().trim().length() == 0) {
|
||||
return new ReturnT<String>(500,
|
||||
(I18nUtil.getString("system_please_input") + I18nUtil.getString("jobgroup_field_title")));
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class JobGroupController {
|
||||
I18nUtil.getString("jobgroup_field_title") + I18nUtil.getString("system_unvalid"));
|
||||
}
|
||||
if (xxlJobGroup.getAddressType() != 0) {
|
||||
if (xxlJobGroup.getAddressList() == null || xxlJobGroup.getAddressList().trim().isEmpty()) {
|
||||
if (xxlJobGroup.getAddressList() == null || xxlJobGroup.getAddressList().trim().length() == 0) {
|
||||
return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_addressType_limit"));
|
||||
}
|
||||
if (xxlJobGroup.getAddressList().contains(">") || xxlJobGroup.getAddressList().contains("<")) {
|
||||
@@ -96,7 +96,7 @@ public class JobGroupController {
|
||||
|
||||
String[] addresss = xxlJobGroup.getAddressList().split(",");
|
||||
for (String item : addresss) {
|
||||
if (item == null || item.trim().isEmpty()) {
|
||||
if (item == null || item.trim().length() == 0) {
|
||||
return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_registryList_unvalid"));
|
||||
}
|
||||
}
|
||||
|
||||
+25
-49
@@ -1,5 +1,6 @@
|
||||
package com.xxl.job.admin.controller;
|
||||
|
||||
import com.xxl.job.admin.controller.interceptor.PermissionInterceptor;
|
||||
import com.xxl.job.admin.core.exception.XxlJobException;
|
||||
import com.xxl.job.admin.core.model.XxlJobGroup;
|
||||
import com.xxl.job.admin.core.model.XxlJobInfo;
|
||||
@@ -8,11 +9,8 @@ import com.xxl.job.admin.core.route.ExecutorRouteStrategyEnum;
|
||||
import com.xxl.job.admin.core.scheduler.MisfireStrategyEnum;
|
||||
import com.xxl.job.admin.core.scheduler.ScheduleTypeEnum;
|
||||
import com.xxl.job.admin.core.thread.JobScheduleHelper;
|
||||
import com.xxl.job.admin.core.thread.JobTriggerPoolHelper;
|
||||
import com.xxl.job.admin.core.trigger.TriggerTypeEnum;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.admin.dao.XxlJobGroupDao;
|
||||
import com.xxl.job.admin.service.LoginService;
|
||||
import com.xxl.job.admin.service.XxlJobService;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
|
||||
@@ -28,7 +26,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* index controller
|
||||
@@ -62,7 +63,7 @@ public class JobInfoController {
|
||||
List<XxlJobGroup> jobGroupList_all = xxlJobGroupDao.findAll();
|
||||
|
||||
// filter group
|
||||
List<XxlJobGroup> jobGroupList = filterJobGroupByRole(request, jobGroupList_all);
|
||||
List<XxlJobGroup> jobGroupList = PermissionInterceptor.filterJobGroupByRole(request, jobGroupList_all);
|
||||
if (jobGroupList == null || jobGroupList.size() == 0) {
|
||||
throw new XxlJobException(I18nUtil.getString("jobgroup_empty"));
|
||||
}
|
||||
@@ -73,37 +74,6 @@ public class JobInfoController {
|
||||
return "jobinfo/jobinfo.index";
|
||||
}
|
||||
|
||||
public static List<XxlJobGroup> filterJobGroupByRole(HttpServletRequest request,
|
||||
List<XxlJobGroup> jobGroupList_all) {
|
||||
List<XxlJobGroup> jobGroupList = new ArrayList<>();
|
||||
if (jobGroupList_all != null && jobGroupList_all.size() > 0) {
|
||||
XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY);
|
||||
if (loginUser.getRole() == 1) {
|
||||
jobGroupList = jobGroupList_all;
|
||||
}
|
||||
else {
|
||||
List<String> groupIdStrs = new ArrayList<>();
|
||||
if (loginUser.getPermission() != null && loginUser.getPermission().trim().length() > 0) {
|
||||
groupIdStrs = Arrays.asList(loginUser.getPermission().trim().split(","));
|
||||
}
|
||||
for (XxlJobGroup groupItem : jobGroupList_all) {
|
||||
if (groupIdStrs.contains(String.valueOf(groupItem.getId()))) {
|
||||
jobGroupList.add(groupItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return jobGroupList;
|
||||
}
|
||||
|
||||
public static void validPermission(HttpServletRequest request, int jobGroup) {
|
||||
XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY);
|
||||
if (!loginUser.validPermission(jobGroup)) {
|
||||
throw new RuntimeException(
|
||||
I18nUtil.getString("system_permission_limit") + "[username=" + loginUser.getUsername() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/pageList")
|
||||
@ResponseBody
|
||||
public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start,
|
||||
@@ -115,14 +85,24 @@ public class JobInfoController {
|
||||
|
||||
@RequestMapping("/add")
|
||||
@ResponseBody
|
||||
public ReturnT<String> add(XxlJobInfo jobInfo) {
|
||||
return xxlJobService.add(jobInfo);
|
||||
public ReturnT<String> add(HttpServletRequest request, XxlJobInfo jobInfo) {
|
||||
// valid permission
|
||||
PermissionInterceptor.validJobGroupPermission(request, jobInfo.getJobGroup());
|
||||
|
||||
// opt
|
||||
XxlJobUser loginUser = PermissionInterceptor.getLoginUser(request);
|
||||
return xxlJobService.add(jobInfo, loginUser);
|
||||
}
|
||||
|
||||
@RequestMapping("/update")
|
||||
@ResponseBody
|
||||
public ReturnT<String> update(XxlJobInfo jobInfo) {
|
||||
return xxlJobService.update(jobInfo);
|
||||
public ReturnT<String> update(HttpServletRequest request, XxlJobInfo jobInfo) {
|
||||
// valid permission
|
||||
PermissionInterceptor.validJobGroupPermission(request, jobInfo.getJobGroup());
|
||||
|
||||
// opt
|
||||
XxlJobUser loginUser = PermissionInterceptor.getLoginUser(request);
|
||||
return xxlJobService.update(jobInfo, loginUser);
|
||||
}
|
||||
|
||||
@RequestMapping("/remove")
|
||||
@@ -145,15 +125,11 @@ public class JobInfoController {
|
||||
|
||||
@RequestMapping("/trigger")
|
||||
@ResponseBody
|
||||
// @PermissionLimit(limit = false)
|
||||
public ReturnT<String> triggerJob(int id, String executorParam, String addressList) {
|
||||
// force cover job param
|
||||
if (executorParam == null) {
|
||||
executorParam = "";
|
||||
}
|
||||
|
||||
JobTriggerPoolHelper.trigger(id, TriggerTypeEnum.MANUAL, -1, null, executorParam, addressList);
|
||||
return ReturnT.SUCCESS;
|
||||
public ReturnT<String> triggerJob(HttpServletRequest request, int id, String executorParam, String addressList) {
|
||||
// login user
|
||||
XxlJobUser loginUser = PermissionInterceptor.getLoginUser(request);
|
||||
// trigger
|
||||
return xxlJobService.trigger(loginUser, id, executorParam, addressList);
|
||||
}
|
||||
|
||||
@RequestMapping("/nextTriggerTime")
|
||||
|
||||
+18
-5
@@ -1,5 +1,6 @@
|
||||
package com.xxl.job.admin.controller;
|
||||
|
||||
import com.xxl.job.admin.controller.interceptor.PermissionInterceptor;
|
||||
import com.xxl.job.admin.core.complete.XxlJobCompleter;
|
||||
import com.xxl.job.admin.core.exception.XxlJobException;
|
||||
import com.xxl.job.admin.core.model.XxlJobGroup;
|
||||
@@ -22,9 +23,11 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -59,7 +62,7 @@ public class JobLogController {
|
||||
List<XxlJobGroup> jobGroupList_all = xxlJobGroupDao.findAll();
|
||||
|
||||
// filter group
|
||||
List<XxlJobGroup> jobGroupList = JobInfoController.filterJobGroupByRole(request, jobGroupList_all);
|
||||
List<XxlJobGroup> jobGroupList = PermissionInterceptor.filterJobGroupByRole(request, jobGroupList_all);
|
||||
if (jobGroupList == null || jobGroupList.size() == 0) {
|
||||
throw new XxlJobException(I18nUtil.getString("jobgroup_empty"));
|
||||
}
|
||||
@@ -77,7 +80,7 @@ public class JobLogController {
|
||||
model.addAttribute("jobInfo", jobInfo);
|
||||
|
||||
// valid permission
|
||||
JobInfoController.validPermission(request, jobInfo.getJobGroup());
|
||||
PermissionInterceptor.validJobGroupPermission(request, jobInfo.getJobGroup());
|
||||
}
|
||||
|
||||
return "joblog/joblog.index";
|
||||
@@ -98,8 +101,8 @@ public class JobLogController {
|
||||
String filterTime) {
|
||||
|
||||
// valid permission
|
||||
JobInfoController.validPermission(request, jobGroup); // 仅管理员支持查询全部;普通用户仅支持查询有权限的
|
||||
// jobGroup
|
||||
PermissionInterceptor.validJobGroupPermission(request, jobGroup); // 仅管理员支持查询全部;普通用户仅支持查询有权限的
|
||||
// jobGroup
|
||||
|
||||
// parse param
|
||||
Date triggerTimeStart = null;
|
||||
@@ -166,6 +169,13 @@ public class JobLogController {
|
||||
}
|
||||
}
|
||||
|
||||
// fix xss
|
||||
if (logResult.getContent() != null && StringUtils.hasText(logResult.getContent().getLogContent())) {
|
||||
String newLogContent = logResult.getContent().getLogContent();
|
||||
newLogContent = HtmlUtils.htmlEscape(newLogContent, "UTF-8");
|
||||
logResult.getContent().setLogContent(newLogContent);
|
||||
}
|
||||
|
||||
return logResult;
|
||||
}
|
||||
catch (Exception e) {
|
||||
@@ -213,8 +223,11 @@ public class JobLogController {
|
||||
|
||||
@RequestMapping("/clearLog")
|
||||
@ResponseBody
|
||||
public ReturnT<String> clearLog(int jobGroup, int jobId, int type) {
|
||||
public ReturnT<String> clearLog(HttpServletRequest request, int jobGroup, int jobId, int type) {
|
||||
// valid permission
|
||||
PermissionInterceptor.validJobGroupPermission(request, jobGroup);
|
||||
|
||||
// opt
|
||||
Date clearBeforeTime = null;
|
||||
int clearBeforeNum = 0;
|
||||
if (type == 1) {
|
||||
|
||||
+21
-11
@@ -1,12 +1,12 @@
|
||||
package com.xxl.job.admin.controller;
|
||||
|
||||
import com.xxl.job.admin.controller.annotation.PermissionLimit;
|
||||
import com.xxl.job.admin.controller.interceptor.PermissionInterceptor;
|
||||
import com.xxl.job.admin.core.model.XxlJobGroup;
|
||||
import com.xxl.job.admin.core.model.XxlJobUser;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.admin.dao.XxlJobGroupDao;
|
||||
import com.xxl.job.admin.dao.XxlJobUserDao;
|
||||
import com.xxl.job.admin.service.LoginService;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@@ -27,7 +27,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
public class JobUserController {
|
||||
|
||||
@Resource
|
||||
private XxlJobUserDao xxlJobUserDao;
|
||||
@@ -114,7 +114,7 @@ public class UserController {
|
||||
public ReturnT<String> update(HttpServletRequest request, XxlJobUser xxlJobUser) {
|
||||
|
||||
// avoid opt login seft
|
||||
XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY);
|
||||
XxlJobUser loginUser = PermissionInterceptor.getLoginUser(request);
|
||||
if (loginUser.getUsername().equals(xxlJobUser.getUsername())) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("user_update_loginuser_limit"));
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class UserController {
|
||||
public ReturnT<String> remove(HttpServletRequest request, int id) {
|
||||
|
||||
// avoid opt login seft
|
||||
XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY);
|
||||
XxlJobUser loginUser = PermissionInterceptor.getLoginUser(request);
|
||||
if (loginUser.getId() == id) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("user_update_loginuser_limit"));
|
||||
}
|
||||
@@ -154,11 +154,16 @@ public class UserController {
|
||||
|
||||
@RequestMapping("/updatePwd")
|
||||
@ResponseBody
|
||||
public ReturnT<String> updatePwd(HttpServletRequest request, String password) {
|
||||
public ReturnT<String> updatePwd(HttpServletRequest request, String password, String oldPassword) {
|
||||
|
||||
// valid password
|
||||
// valid
|
||||
if (oldPassword == null || oldPassword.trim().length() == 0) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(),
|
||||
I18nUtil.getString("system_please_input") + I18nUtil.getString("change_pwd_field_oldpwd"));
|
||||
}
|
||||
if (password == null || password.trim().length() == 0) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(), "密码不可为空");
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(),
|
||||
I18nUtil.getString("system_please_input") + I18nUtil.getString("change_pwd_field_oldpwd"));
|
||||
}
|
||||
password = password.trim();
|
||||
if (!(password.length() >= 4 && password.length() <= 20)) {
|
||||
@@ -166,13 +171,18 @@ public class UserController {
|
||||
}
|
||||
|
||||
// md5 password
|
||||
String md5OldPassword = DigestUtils.md5DigestAsHex(oldPassword.getBytes());
|
||||
String md5Password = DigestUtils.md5DigestAsHex(password.getBytes());
|
||||
|
||||
// update pwd
|
||||
XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY);
|
||||
|
||||
// do write
|
||||
// valid old pwd
|
||||
XxlJobUser loginUser = PermissionInterceptor.getLoginUser(request);
|
||||
XxlJobUser existUser = xxlJobUserDao.loadByUserName(loginUser.getUsername());
|
||||
if (!md5OldPassword.equals(existUser.getPassword())) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(),
|
||||
I18nUtil.getString("change_pwd_field_oldpwd") + I18nUtil.getString("system_unvalid"));
|
||||
}
|
||||
|
||||
// write new
|
||||
existUser.setPassword(md5Password);
|
||||
xxlJobUserDao.update(existUser);
|
||||
|
||||
+67
-2
@@ -1,9 +1,10 @@
|
||||
package com.xxl.job.admin.controller.interceptor;
|
||||
|
||||
import com.xxl.job.admin.controller.annotation.PermissionLimit;
|
||||
import com.xxl.job.admin.core.model.XxlJobGroup;
|
||||
import com.xxl.job.admin.core.model.XxlJobUser;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.admin.service.LoginService;
|
||||
import com.xxl.job.admin.service.impl.LoginService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
@@ -11,6 +12,10 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限拦截
|
||||
*
|
||||
@@ -50,10 +55,70 @@ public class PermissionInterceptor implements AsyncHandlerInterceptor {
|
||||
if (needAdminuser && loginUser.getRole() != 1) {
|
||||
throw new RuntimeException(I18nUtil.getString("system_permission_limit"));
|
||||
}
|
||||
request.setAttribute(LoginService.LOGIN_IDENTITY_KEY, loginUser);
|
||||
request.setAttribute(LoginService.LOGIN_IDENTITY_KEY, loginUser); // set
|
||||
// loginUser,
|
||||
// with
|
||||
// request
|
||||
}
|
||||
|
||||
return true; // proceed with the next interceptor
|
||||
}
|
||||
|
||||
// -------------------- permission tool --------------------
|
||||
|
||||
/**
|
||||
* get loginUser
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public static XxlJobUser getLoginUser(HttpServletRequest request) {
|
||||
XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); // get
|
||||
// loginUser,
|
||||
// with
|
||||
// request
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* valid permission by JobGroup
|
||||
* @param request
|
||||
* @param jobGroup
|
||||
*/
|
||||
public static void validJobGroupPermission(HttpServletRequest request, int jobGroup) {
|
||||
XxlJobUser loginUser = getLoginUser(request);
|
||||
if (!loginUser.validPermission(jobGroup)) {
|
||||
throw new RuntimeException(
|
||||
I18nUtil.getString("system_permission_limit") + "[username=" + loginUser.getUsername() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* filter XxlJobGroup by role
|
||||
* @param request
|
||||
* @param jobGroupList_all
|
||||
* @return
|
||||
*/
|
||||
public static List<XxlJobGroup> filterJobGroupByRole(HttpServletRequest request,
|
||||
List<XxlJobGroup> jobGroupList_all) {
|
||||
List<XxlJobGroup> jobGroupList = new ArrayList<>();
|
||||
if (jobGroupList_all != null && jobGroupList_all.size() > 0) {
|
||||
XxlJobUser loginUser = PermissionInterceptor.getLoginUser(request);
|
||||
if (loginUser.getRole() == 1) {
|
||||
jobGroupList = jobGroupList_all;
|
||||
}
|
||||
else {
|
||||
List<String> groupIdStrs = new ArrayList<>();
|
||||
if (loginUser.getPermission() != null && loginUser.getPermission().trim().length() > 0) {
|
||||
groupIdStrs = Arrays.asList(loginUser.getPermission().trim().split(","));
|
||||
}
|
||||
for (XxlJobGroup groupItem : jobGroupList_all) {
|
||||
if (groupIdStrs.contains(String.valueOf(groupItem.getId()))) {
|
||||
jobGroupList.add(groupItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return jobGroupList;
|
||||
}
|
||||
|
||||
}
|
||||
+18
-6
@@ -19,7 +19,16 @@ package com.xxl.job.admin.core.cron;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.SortedSet;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.TimeZone;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* Provides a parser and evaluator for unix-like cron expressions. Cron expressions
|
||||
@@ -360,9 +369,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
||||
// the second immediately following it.
|
||||
while (difference == 1000) {
|
||||
newDate = getTimeAfter(lastDate);
|
||||
if (newDate == null)
|
||||
if (newDate == null) {
|
||||
break;
|
||||
|
||||
}
|
||||
difference = newDate.getTime() - lastDate.getTime();
|
||||
|
||||
if (difference == 1000) {
|
||||
@@ -657,8 +666,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
||||
if (c == '-') {
|
||||
ValueSet vs = getValue(0, s, i + 1);
|
||||
lastdayOffset = vs.value;
|
||||
if (lastdayOffset > 30)
|
||||
if (lastdayOffset > 30) {
|
||||
throw new ParseException("Offset from last day must be <= 30", i + 1);
|
||||
}
|
||||
i = vs.pos;
|
||||
}
|
||||
if (s.length() > i) {
|
||||
@@ -727,8 +737,9 @@ public final class CronExpression implements Serializable, Cloneable {
|
||||
|
||||
if (c == 'L') {
|
||||
if (type == DAY_OF_WEEK) {
|
||||
if (val < 1 || val > 7)
|
||||
if (val < 1 || val > 7) {
|
||||
throw new ParseException("Day-of-Week values must be between 1 and 7", -1);
|
||||
}
|
||||
lastdayOfWeek = true;
|
||||
}
|
||||
else {
|
||||
@@ -747,10 +758,11 @@ public final class CronExpression implements Serializable, Cloneable {
|
||||
else {
|
||||
throw new ParseException("'W' option is not valid here. (pos=" + i + ")", i);
|
||||
}
|
||||
if (val > 31)
|
||||
if (val > 31) {
|
||||
throw new ParseException(
|
||||
"The 'W' option does not make sense with values larger than 31 (max number of days in a month)",
|
||||
i);
|
||||
}
|
||||
TreeSet<Integer> set = getSet(type);
|
||||
set.add(val);
|
||||
i++;
|
||||
|
||||
+4
-4
@@ -25,9 +25,9 @@
|
||||
// import org.slf4j.LoggerFactory;
|
||||
// import org.springframework.util.Assert;
|
||||
//
|
||||
// import javax.servlet.ServletException;
|
||||
// import javax.servlet.http.HttpServletRequest;
|
||||
// import javax.servlet.http.HttpServletResponse;
|
||||
// import jakarta.servlet.ServletException;
|
||||
// import jakarta.servlet.http.HttpServletRequest;
|
||||
// import jakarta.servlet.http.HttpServletResponse;
|
||||
// import java.io.IOException;
|
||||
// import java.util.Date;
|
||||
// import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -427,4 +427,4 @@
|
||||
// return jobList;
|
||||
// }*/
|
||||
//
|
||||
// }
|
||||
// }
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.xxl.job.admin.core.route.strategy;
|
||||
|
||||
import com.xxl.job.admin.core.route.ExecutorRouter;
|
||||
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
|
||||
import com.xxl.job.admin.core.route.ExecutorRouter;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.core.biz.ExecutorBiz;
|
||||
import com.xxl.job.core.biz.model.IdleBeatParam;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.xxl.job.admin.core.route.strategy;
|
||||
|
||||
import com.xxl.job.admin.core.route.ExecutorRouter;
|
||||
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
|
||||
import com.xxl.job.admin.core.route.ExecutorRouter;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.core.biz.ExecutorBiz;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
|
||||
+21
-8
@@ -303,18 +303,31 @@ public class JobScheduleHelper {
|
||||
}
|
||||
|
||||
private void refreshNextValidTime(XxlJobInfo jobInfo, Date fromTime) throws Exception {
|
||||
Date nextValidTime = generateNextValidTime(jobInfo, fromTime);
|
||||
if (nextValidTime != null) {
|
||||
jobInfo.setTriggerLastTime(jobInfo.getTriggerNextTime());
|
||||
jobInfo.setTriggerNextTime(nextValidTime.getTime());
|
||||
try {
|
||||
Date nextValidTime = generateNextValidTime(jobInfo, fromTime);
|
||||
if (nextValidTime != null) {
|
||||
jobInfo.setTriggerLastTime(jobInfo.getTriggerNextTime());
|
||||
jobInfo.setTriggerNextTime(nextValidTime.getTime());
|
||||
}
|
||||
else {
|
||||
// generateNextValidTime fail, stop job
|
||||
jobInfo.setTriggerStatus(0);
|
||||
jobInfo.setTriggerLastTime(0);
|
||||
jobInfo.setTriggerNextTime(0);
|
||||
logger.error(
|
||||
">>>>>>>>>>> xxl-job, refreshNextValidTime fail for job: jobId={}, scheduleType={}, scheduleConf={}",
|
||||
jobInfo.getId(), jobInfo.getScheduleType(), jobInfo.getScheduleConf());
|
||||
}
|
||||
}
|
||||
else {
|
||||
catch (Exception e) {
|
||||
// generateNextValidTime error, stop job
|
||||
jobInfo.setTriggerStatus(0);
|
||||
jobInfo.setTriggerLastTime(0);
|
||||
jobInfo.setTriggerNextTime(0);
|
||||
logger.warn(
|
||||
">>>>>>>>>>> xxl-job, refreshNextValidTime fail for job: jobId={}, scheduleType={}, scheduleConf={}",
|
||||
jobInfo.getId(), jobInfo.getScheduleType(), jobInfo.getScheduleConf());
|
||||
|
||||
logger.error(
|
||||
">>>>>>>>>>> xxl-job, refreshNextValidTime error for job: jobId={}, scheduleType={}, scheduleConf={}",
|
||||
jobInfo.getId(), jobInfo.getScheduleType(), jobInfo.getScheduleConf(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.xxl.job.admin.dao;
|
||||
import com.xxl.job.admin.core.model.XxlJobUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
+13
-2
@@ -1,6 +1,7 @@
|
||||
package com.xxl.job.admin.service;
|
||||
|
||||
import com.xxl.job.admin.core.model.XxlJobInfo;
|
||||
import com.xxl.job.admin.core.model.XxlJobUser;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -31,14 +32,14 @@ public interface XxlJobService {
|
||||
* @param jobInfo
|
||||
* @return
|
||||
*/
|
||||
public ReturnT<String> add(XxlJobInfo jobInfo);
|
||||
public ReturnT<String> add(XxlJobInfo jobInfo, XxlJobUser loginUser);
|
||||
|
||||
/**
|
||||
* update job
|
||||
* @param jobInfo
|
||||
* @return
|
||||
*/
|
||||
public ReturnT<String> update(XxlJobInfo jobInfo);
|
||||
public ReturnT<String> update(XxlJobInfo jobInfo, XxlJobUser loginUser);
|
||||
|
||||
/**
|
||||
* remove job *
|
||||
@@ -61,6 +62,16 @@ public interface XxlJobService {
|
||||
*/
|
||||
public ReturnT<String> stop(int id);
|
||||
|
||||
/**
|
||||
* trigger
|
||||
* @param loginUser
|
||||
* @param jobId
|
||||
* @param executorParam
|
||||
* @param addressList
|
||||
* @return
|
||||
*/
|
||||
public ReturnT<String> trigger(XxlJobUser loginUser, int jobId, String executorParam, String addressList);
|
||||
|
||||
/**
|
||||
* dashboard info
|
||||
* @return
|
||||
|
||||
+9
-5
@@ -1,4 +1,4 @@
|
||||
package com.xxl.job.admin.service;
|
||||
package com.xxl.job.admin.service.impl;
|
||||
|
||||
import com.xxl.job.admin.core.model.XxlJobUser;
|
||||
import com.xxl.job.admin.core.util.CookieUtil;
|
||||
@@ -6,18 +6,18 @@ import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.admin.core.util.JacksonUtil;
|
||||
import com.xxl.job.admin.dao.XxlJobUserDao;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.DigestUtils;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.DigestUtils;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* @author xuxueli 2019-05-04 22:13:264
|
||||
*/
|
||||
@Configuration
|
||||
@Service
|
||||
public class LoginService {
|
||||
|
||||
public static final String LOGIN_IDENTITY_KEY = "XXL_JOB_LOGIN_IDENTITY";
|
||||
@@ -25,6 +25,8 @@ public class LoginService {
|
||||
@Resource
|
||||
private XxlJobUserDao xxlJobUserDao;
|
||||
|
||||
// ---------------------- token tool ----------------------
|
||||
|
||||
private String makeToken(XxlJobUser xxlJobUser) {
|
||||
String tokenJson = JacksonUtil.writeValueAsString(xxlJobUser);
|
||||
String tokenHex = new BigInteger(tokenJson.getBytes()).toString(16);
|
||||
@@ -40,6 +42,8 @@ public class LoginService {
|
||||
return xxlJobUser;
|
||||
}
|
||||
|
||||
// ---------------------- login tool, with cookie and db ----------------------
|
||||
|
||||
public ReturnT<String> login(HttpServletRequest request, HttpServletResponse response, String username,
|
||||
String password, boolean ifRemember) {
|
||||
|
||||
+50
-3
@@ -4,10 +4,13 @@ import com.xxl.job.admin.core.cron.CronExpression;
|
||||
import com.xxl.job.admin.core.model.XxlJobGroup;
|
||||
import com.xxl.job.admin.core.model.XxlJobInfo;
|
||||
import com.xxl.job.admin.core.model.XxlJobLogReport;
|
||||
import com.xxl.job.admin.core.model.XxlJobUser;
|
||||
import com.xxl.job.admin.core.route.ExecutorRouteStrategyEnum;
|
||||
import com.xxl.job.admin.core.scheduler.MisfireStrategyEnum;
|
||||
import com.xxl.job.admin.core.scheduler.ScheduleTypeEnum;
|
||||
import com.xxl.job.admin.core.thread.JobScheduleHelper;
|
||||
import com.xxl.job.admin.core.thread.JobTriggerPoolHelper;
|
||||
import com.xxl.job.admin.core.trigger.TriggerTypeEnum;
|
||||
import com.xxl.job.admin.core.util.I18nUtil;
|
||||
import com.xxl.job.admin.dao.*;
|
||||
import com.xxl.job.admin.service.XxlJobService;
|
||||
@@ -15,11 +18,11 @@ import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
|
||||
import com.xxl.job.core.glue.GlueTypeEnum;
|
||||
import com.xxl.job.core.util.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
|
||||
@@ -67,7 +70,7 @@ public class XxlJobServiceImpl implements XxlJobService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnT<String> add(XxlJobInfo jobInfo) {
|
||||
public ReturnT<String> add(XxlJobInfo jobInfo, XxlJobUser loginUser) {
|
||||
|
||||
// valid base
|
||||
XxlJobGroup group = xxlJobGroupDao.load(jobInfo.getJobGroup());
|
||||
@@ -155,6 +158,11 @@ public class XxlJobServiceImpl implements XxlJobService {
|
||||
MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId") + "({0})"
|
||||
+ I18nUtil.getString("system_not_found")), childJobIdItem));
|
||||
}
|
||||
if (!loginUser.validPermission(childJobInfo.getJobGroup())) {
|
||||
return new ReturnT<String>(ReturnT.FAIL_CODE,
|
||||
MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId") + "({0})"
|
||||
+ I18nUtil.getString("system_permission_limit")), childJobIdItem));
|
||||
}
|
||||
}
|
||||
else {
|
||||
return new ReturnT<String>(ReturnT.FAIL_CODE,
|
||||
@@ -197,7 +205,7 @@ public class XxlJobServiceImpl implements XxlJobService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnT<String> update(XxlJobInfo jobInfo) {
|
||||
public ReturnT<String> update(XxlJobInfo jobInfo, XxlJobUser loginUser) {
|
||||
|
||||
// valid base
|
||||
if (jobInfo.getJobDesc() == null || jobInfo.getJobDesc().trim().length() == 0) {
|
||||
@@ -267,6 +275,11 @@ public class XxlJobServiceImpl implements XxlJobService {
|
||||
MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId") + "({0})"
|
||||
+ I18nUtil.getString("system_not_found")), childJobIdItem));
|
||||
}
|
||||
if (!loginUser.validPermission(childJobInfo.getJobGroup())) {
|
||||
return new ReturnT<String>(ReturnT.FAIL_CODE,
|
||||
MessageFormat.format((I18nUtil.getString("jobinfo_field_childJobId") + "({0})"
|
||||
+ I18nUtil.getString("system_permission_limit")), childJobIdItem));
|
||||
}
|
||||
}
|
||||
else {
|
||||
return new ReturnT<String>(ReturnT.FAIL_CODE,
|
||||
@@ -404,6 +417,40 @@ public class XxlJobServiceImpl implements XxlJobService {
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnT<String> trigger(XxlJobUser loginUser, int jobId, String executorParam, String addressList) {
|
||||
// permission
|
||||
if (loginUser == null) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("system_permission_limit"));
|
||||
}
|
||||
XxlJobInfo xxlJobInfo = xxlJobInfoDao.loadById(jobId);
|
||||
if (xxlJobInfo == null) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("jobinfo_glue_jobid_unvalid"));
|
||||
}
|
||||
if (!hasPermission(loginUser, xxlJobInfo.getJobGroup())) {
|
||||
return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("system_permission_limit"));
|
||||
}
|
||||
|
||||
// force cover job param
|
||||
if (executorParam == null) {
|
||||
executorParam = "";
|
||||
}
|
||||
|
||||
JobTriggerPoolHelper.trigger(jobId, TriggerTypeEnum.MANUAL, -1, null, executorParam, addressList);
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
private boolean hasPermission(XxlJobUser loginUser, int jobGroup) {
|
||||
if (loginUser.getRole() == 1) {
|
||||
return true;
|
||||
}
|
||||
List<String> groupIdStrs = new ArrayList<>();
|
||||
if (loginUser.getPermission() != null && loginUser.getPermission().trim().length() > 0) {
|
||||
groupIdStrs = Arrays.asList(loginUser.getPermission().trim().split(","));
|
||||
}
|
||||
return groupIdStrs.contains(String.valueOf(jobGroup));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> dashboardInfo() {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
admin_name=Scheduling Center
|
||||
admin_name_full=Distributed Task Scheduling Platform XXL-JOB
|
||||
admin_version=2.4.1-SNAPSHOT
|
||||
admin_version=2.5.0-SNAPSHOT
|
||||
admin_i18n=en
|
||||
|
||||
## system
|
||||
@@ -91,6 +91,7 @@ logout_fail=Logout fail
|
||||
## change pwd
|
||||
change_pwd=Change password
|
||||
change_pwd_suc_to_logout=Change password successful, about to log out login
|
||||
change_pwd_field_oldpwd=old password
|
||||
change_pwd_field_newpwd=new password
|
||||
|
||||
## dashboard
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
admin_name=任务调度中心
|
||||
admin_name_full=分布式任务调度平台XXL-JOB
|
||||
admin_version=2.4.1-SNAPSHOT
|
||||
admin_version=2.5.0-SNAPSHOT
|
||||
admin_i18n=
|
||||
|
||||
## system
|
||||
@@ -91,6 +91,7 @@ logout_fail=注销失败
|
||||
## change pwd
|
||||
change_pwd=修改密码
|
||||
change_pwd_suc_to_logout=修改密码成功,即将注销登陆
|
||||
change_pwd_field_oldpwd=旧密码
|
||||
change_pwd_field_newpwd=新密码
|
||||
|
||||
## dashboard
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
admin_name=任務調度中心
|
||||
admin_name_full=分布式任務調度平臺XXL-JOB
|
||||
admin_version=2.4.1-SNAPSHOT
|
||||
admin_version=2.5.0-SNAPSHOT
|
||||
admin_i18n=
|
||||
|
||||
## system
|
||||
@@ -91,6 +91,7 @@ logout_fail=登出失敗
|
||||
## change pwd
|
||||
change_pwd=修改密碼
|
||||
change_pwd_suc_to_logout=修改密碼成功,即將登出
|
||||
change_pwd_field_oldpwd=舊密碼
|
||||
change_pwd_field_newpwd=新密碼
|
||||
|
||||
## dashboard
|
||||
|
||||
@@ -99,15 +99,23 @@ $(function(){
|
||||
errorClass : 'help-block',
|
||||
focusInvalid : true,
|
||||
rules : {
|
||||
oldPassword : {
|
||||
required : true ,
|
||||
rangelength:[4,20]
|
||||
},
|
||||
password : {
|
||||
required : true ,
|
||||
rangelength:[4,50]
|
||||
rangelength:[4,20]
|
||||
}
|
||||
},
|
||||
messages : {
|
||||
oldPassword : {
|
||||
required : I18n.system_please_input +I18n.change_pwd_field_oldpwd,
|
||||
rangelength : "密码长度限制为4~20"
|
||||
},
|
||||
password : {
|
||||
required : '请输入密码' ,
|
||||
rangelength : "密码长度限制为4~50"
|
||||
required : I18n.system_please_input +I18n.change_pwd_field_newpwd,
|
||||
rangelength : "密码长度限制为4~20"
|
||||
}
|
||||
},
|
||||
highlight : function(element) {
|
||||
|
||||
@@ -123,7 +123,7 @@ $(function() {
|
||||
var id = $(this).attr("_id");
|
||||
var row = tableData['key'+id];
|
||||
|
||||
var html = '<div>';
|
||||
/*var html = '<div>';
|
||||
if (row.registryList) {
|
||||
for (var index in row.registryList) {
|
||||
html += (parseInt(index)+1) + '. <span class="badge bg-green" >' + row.registryList[index] + '</span><br>';
|
||||
@@ -135,8 +135,19 @@ $(function() {
|
||||
title: I18n.jobinfo_opt_registryinfo ,
|
||||
btn: [ I18n.system_ok ],
|
||||
content: html
|
||||
});
|
||||
});*/
|
||||
|
||||
var html = '<table class="table table-bordered"><tbody>';
|
||||
if (row.registryList) {
|
||||
for (var index in row.registryList) {
|
||||
html += '<tr><th>' + (parseInt(index)+1) + '</th>';
|
||||
html += '<th><span class="badge bg-green" >' + row.registryList[index] + '</span></th><tr>';
|
||||
}
|
||||
}
|
||||
html += '</tbody></table>';
|
||||
|
||||
$('#showRegistryListModal .data').html(html);
|
||||
$('#showRegistryListModal').modal({backdrop: false, keyboard: false}).modal('show');
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -107,9 +107,13 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal form" role="form" >
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">${I18n.change_pwd_field_oldpwd}<font color="red">*</font></label>
|
||||
<div class="col-sm-10"><input type="text" class="form-control" name="oldPassword" placeholder="${I18n.system_please_input} ${I18n.change_pwd_field_oldpwd}" maxlength="20" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">${I18n.change_pwd_field_newpwd}<font color="red">*</font></label>
|
||||
<div class="col-sm-10"><input type="text" class="form-control" name="password" placeholder="${I18n.system_please_input} ${I18n.change_pwd_field_newpwd}" maxlength="18" ></div>
|
||||
<div class="col-sm-10"><input type="text" class="form-control" name="password" placeholder="${I18n.system_please_input} ${I18n.change_pwd_field_newpwd}" maxlength="20" ></div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
|
||||
+23
-4
@@ -13,7 +13,7 @@
|
||||
<@netCommon.commonHeader />
|
||||
<!-- left -->
|
||||
<@netCommon.commonLeft "jobgroup" />
|
||||
|
||||
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
@@ -44,7 +44,7 @@
|
||||
<button class="btn btn-block btn-success add" type="button">${I18n.jobinfo_field_add}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
@@ -70,6 +70,25 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- 注册列表查看.模态框 -->
|
||||
<div class="modal fade" id="showRegistryListModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" >${I18n.jobinfo_opt_registryinfo}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="data" style="word-wrap: break-word;"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="text-center" >
|
||||
<button type="button" class="btn btn-info ok" data-dismiss="modal" >${I18n.system_ok}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增.模态框 -->
|
||||
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog ">
|
||||
@@ -85,7 +104,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_title}<font color="red">*</font></label>
|
||||
<div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="${I18n.system_please_input}${I18n.jobgroup_field_title}" maxlength="24" ></div>
|
||||
<div class="col-sm-10"><input type="text" class="form-control" name="title" placeholder="${I18n.system_please_input}${I18n.jobgroup_field_title}" maxlength="12" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">${I18n.jobgroup_field_addressType}<font color="red">*</font></label>
|
||||
@@ -158,7 +177,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- footer -->
|
||||
<@netCommon.commonFooter />
|
||||
</div>
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<spring-boot-admin.version>3.3.3</spring-boot-admin.version>
|
||||
<spring.authorization.version>1.3.1</spring.authorization.version>
|
||||
<spring-boot-admin.version>3.3.5</spring-boot-admin.version>
|
||||
<spring.authorization.version>1.3.3</spring.authorization.version>
|
||||
<maven.compiler.version>3.11.0</maven.compiler.version>
|
||||
<spring.checkstyle.version>0.0.39</spring.checkstyle.version>
|
||||
<git.commit.version>4.9.9</git.commit.version>
|
||||
|
||||
Reference in new issue
Block a user