1、task分页查询bugfix
2、新增审批人属性
3、loginservice修改权限系统url
(cherry picked from commit e943a787d4)
This commit is contained in:
@@ -78,4 +78,14 @@ public class ProtectObject {
|
|||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
@Schema(description = "防护对象创建人ID", example = "0")
|
@Schema(description = "防护对象创建人ID", example = "0")
|
||||||
private Integer protectObjectCreateUserId;
|
private Integer protectObjectCreateUserId;
|
||||||
|
|
||||||
|
@JsonProperty("audit_user_name")
|
||||||
|
@Schema(description = "审核用户名称", example = "user11")
|
||||||
|
private String auditUserName;
|
||||||
|
@JsonProperty("audit_user_id")
|
||||||
|
@Schema(description = "审核用户id", example = "11111")
|
||||||
|
private String auditUserId;
|
||||||
|
@JsonProperty("audit_user_depart")
|
||||||
|
@Schema(description = "审核用户部门", example = "部门1")
|
||||||
|
private String auditUserDepart;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,16 @@ public class Template {
|
|||||||
@Schema(description = "策略模板展示id", accessMode = Schema.AccessMode.READ_ONLY)
|
@Schema(description = "策略模板展示id", accessMode = Schema.AccessMode.READ_ONLY)
|
||||||
private String templateDisplayId;
|
private String templateDisplayId;
|
||||||
|
|
||||||
|
@JsonProperty("audit_user_name")
|
||||||
|
@Schema(description = "审核用户名称", example = "user11")
|
||||||
|
private String auditUserName;
|
||||||
|
@JsonProperty("audit_user_id")
|
||||||
|
@Schema(description = "审核用户id", example = "11111")
|
||||||
|
private String auditUserId;
|
||||||
|
@JsonProperty("audit_user_depart")
|
||||||
|
@Schema(description = "审核用户部门", example = "部门1")
|
||||||
|
private String auditUserDepart;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置是否含有日常/应急/紧急防护等级态字段的字段
|
* 设置是否含有日常/应急/紧急防护等级态字段的字段
|
||||||
|
|||||||
@@ -106,6 +106,16 @@ public class DynamicRuleObject {
|
|||||||
@Schema(description = "动态规则审核状态(0为未审核,1为已退回,2为审核通过)", example = "2", accessMode = Schema.AccessMode.READ_ONLY)
|
@Schema(description = "动态规则审核状态(0为未审核,1为已退回,2为审核通过)", example = "2", accessMode = Schema.AccessMode.READ_ONLY)
|
||||||
private Integer auditStatus;
|
private Integer auditStatus;
|
||||||
|
|
||||||
|
@JsonProperty("audit_user_name")
|
||||||
|
@Schema(description = "审核用户名称", example = "user11")
|
||||||
|
private String auditUserName;
|
||||||
|
@JsonProperty("audit_user_id")
|
||||||
|
@Schema(description = "审核用户id", example = "11111")
|
||||||
|
private String auditUserId;
|
||||||
|
@JsonProperty("audit_user_depart")
|
||||||
|
@Schema(description = "审核用户部门", example = "部门1")
|
||||||
|
private String auditUserDepart;
|
||||||
|
|
||||||
public void checkAuditStatusValidate(AuditStatusEnum newAuditStatus) {
|
public void checkAuditStatusValidate(AuditStatusEnum newAuditStatus) {
|
||||||
if (!List.of(AuditStatusEnum.AUDITED.getNum(), AuditStatusEnum.USING.getNum()).contains(this.getAuditStatus())) {
|
if (!List.of(AuditStatusEnum.AUDITED.getNum(), AuditStatusEnum.USING.getNum()).contains(this.getAuditStatus())) {
|
||||||
throw new IllegalArgumentException("规则《" + this.getDynamicRuleName() + "》原审批状态非法");
|
throw new IllegalArgumentException("规则《" + this.getDynamicRuleName() + "》原审批状态非法");
|
||||||
|
|||||||
@@ -150,6 +150,17 @@ public class StaticRuleObject {
|
|||||||
@Schema(description = "频率,最低为1", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "频率,最低为1", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private Integer staticRuleFrequency;
|
private Integer staticRuleFrequency;
|
||||||
|
|
||||||
|
@JsonProperty("audit_user_name")
|
||||||
|
@Schema(description = "审核用户名称", example = "user11")
|
||||||
|
private String auditUserName;
|
||||||
|
@JsonProperty("audit_user_id")
|
||||||
|
@Schema(description = "审核用户id", example = "11111")
|
||||||
|
private String auditUserId;
|
||||||
|
@JsonProperty("audit_user_depart")
|
||||||
|
@Schema(description = "审核用户部门", example = "部门1")
|
||||||
|
private String auditUserDepart;
|
||||||
|
|
||||||
|
|
||||||
public void checkAuditStatusValidate(AuditStatusEnum newAuditStatus) {
|
public void checkAuditStatusValidate(AuditStatusEnum newAuditStatus) {
|
||||||
if (!List.of(AuditStatusEnum.AUDITED.getNum(), AuditStatusEnum.USING.getNum()).contains(this.getAuditStatus())) {
|
if (!List.of(AuditStatusEnum.AUDITED.getNum(), AuditStatusEnum.USING.getNum()).contains(this.getAuditStatus())) {
|
||||||
throw new IllegalArgumentException("规则《" + this.getStaticRuleName() + "》原审批状态非法");
|
throw new IllegalArgumentException("规则《" + this.getStaticRuleName() + "》原审批状态非法");
|
||||||
|
|||||||
@@ -91,4 +91,14 @@ public class Task {
|
|||||||
@NotNull(message = "task_range字段不能为空。")
|
@NotNull(message = "task_range字段不能为空。")
|
||||||
@Schema(description = "局点范围,由规则移动到任务", example = "1009")
|
@Schema(description = "局点范围,由规则移动到任务", example = "1009")
|
||||||
private String taskRange;
|
private String taskRange;
|
||||||
|
|
||||||
|
@JsonProperty("audit_user_name")
|
||||||
|
@Schema(description = "审核用户名称", example = "user11")
|
||||||
|
private String auditUserName;
|
||||||
|
@JsonProperty("audit_user_id")
|
||||||
|
@Schema(description = "审核用户id", example = "11111")
|
||||||
|
private String auditUserId;
|
||||||
|
@JsonProperty("audit_user_depart")
|
||||||
|
@Schema(description = "审核用户部门", example = "部门1")
|
||||||
|
private String auditUserDepart;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,4 +78,14 @@ public class WhiteListObject {
|
|||||||
@Schema(description = "白名单对象创建人部门")
|
@Schema(description = "白名单对象创建人部门")
|
||||||
private String createUserDepartment;
|
private String createUserDepartment;
|
||||||
|
|
||||||
|
@JsonProperty("audit_user_name")
|
||||||
|
@Schema(description = "审核用户名称", example = "user11")
|
||||||
|
private String auditUserName;
|
||||||
|
@JsonProperty("audit_user_id")
|
||||||
|
@Schema(description = "审核用户id", example = "11111")
|
||||||
|
private String auditUserId;
|
||||||
|
@JsonProperty("audit_user_depart")
|
||||||
|
@Schema(description = "审核用户部门", example = "部门1")
|
||||||
|
private String auditUserDepart;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ public class TaskService {
|
|||||||
if (task == null) {
|
if (task == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
task.setStaticRuleIds(taskMapper.queryStaticRuleIdsFromTaskId(task.getTaskId(),
|
task.setStaticRuleIds(taskMapper.queryStaticRuleIdsFromTaskId(task.getTaskId(),
|
||||||
List.of(AuditStatusEnum.AUDITED.getNum(), AuditStatusEnum.USING.getNum())));
|
List.of(AuditStatusEnum.AUDITED.getNum(), AuditStatusEnum.USING.getNum())));
|
||||||
task.setDynamicRuleIds(taskMapper.queryDynamicRuleIdsFromTaskId(task.getTaskId(),
|
task.setDynamicRuleIds(taskMapper.queryDynamicRuleIdsFromTaskId(task.getTaskId(),
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class LoginService {
|
|||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url("http://114.243.134.122:9217/passport/accessToken?grant_type=client_credentials")
|
.url("https://114.243.134.122:10217/passport/accessToken?grant_type=client_credentials")
|
||||||
// .url("https://passport.iam.pub/passport/accessToken?grant_type=client_credentials")
|
// .url("https://passport.iam.pub/passport/accessToken?grant_type=client_credentials")
|
||||||
.header("Authorization", "Basic TlNBRERAWlguT1JHOk14a1hHZ1ltOUNROUE3TCRSOCNLRW02R1pSeEhwd1c2")
|
.header("Authorization", "Basic TlNBRERAWlguT1JHOk14a1hHZ1ltOUNROUE3TCRSOCNLRW02R1pSeEhwd1c2")
|
||||||
.post(okhttp3.internal.Util.EMPTY_REQUEST)
|
.post(okhttp3.internal.Util.EMPTY_REQUEST)
|
||||||
@@ -76,7 +76,7 @@ public class LoginService {
|
|||||||
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
|
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
|
||||||
.addFormDataPart("sessionData", sessionData).build();
|
.addFormDataPart("sessionData", sessionData).build();
|
||||||
request = new Request.Builder()
|
request = new Request.Builder()
|
||||||
.url("http://114.243.134.122:9217/passport/accessApplication")
|
.url("https://114.243.134.122:10217/passport/accessApplication")
|
||||||
// .url("https://passport.iam.pub/passport/accessToken?grant_type=client_credentials")
|
// .url("https://passport.iam.pub/passport/accessToken?grant_type=client_credentials")
|
||||||
|
|
||||||
.header("Authorization", "Bearer " + accessToken)
|
.header("Authorization", "Bearer " + accessToken)
|
||||||
|
|||||||
@@ -344,7 +344,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="queryTaskTotalNum" resultType="java.lang.Integer">
|
<select id="queryTaskTotalNum" resultType="java.lang.Integer">
|
||||||
SELECT COUNT(*) FROM t_task
|
SELECT COUNT(*) FROM t_task
|
||||||
<if test="rule_name != null and creator != '' ">
|
<if test="rule_name != null and rule_name != '' ">
|
||||||
LEFT JOIN t_static_rule ON t_task.task_id = t_static_rule.static_rule_used_task_id
|
LEFT JOIN t_static_rule ON t_task.task_id = t_static_rule.static_rule_used_task_id
|
||||||
LEFT JOIN t_dynamic_rule ON t_task.task_id = t_dynamic_rule.dynamic_rule_used_task_id
|
LEFT JOIN t_dynamic_rule ON t_task.task_id = t_dynamic_rule.dynamic_rule_used_task_id
|
||||||
WHERE
|
WHERE
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.realtime.protection.server.defense.template;
|
package com.realtime.protection.server.defense.template;
|
||||||
|
|
||||||
import com.realtime.protection.ProtectionApplicationTests;
|
import com.realtime.protection.ProtectionApplicationTests;
|
||||||
|
import com.realtime.protection.configuration.entity.defense.object.ProtectObject;
|
||||||
import com.realtime.protection.configuration.entity.defense.template.ProtectLevel;
|
import com.realtime.protection.configuration.entity.defense.template.ProtectLevel;
|
||||||
import com.realtime.protection.configuration.entity.defense.template.Template;
|
import com.realtime.protection.configuration.entity.defense.template.Template;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
@@ -11,6 +12,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
@@ -112,4 +114,14 @@ class TemplateServiceTest extends ProtectionApplicationTests {
|
|||||||
templateService.updateAuditStatus(testTemplate.getTemplateId(), 2);
|
templateService.updateAuditStatus(testTemplate.getTemplateId(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void updateAuditInfo() {
|
||||||
|
List<Template> protectObjectList = templateService.queryTemplates(null, null, null, null, null, 1, 1);
|
||||||
|
List<Integer> idList = new ArrayList<>();
|
||||||
|
idList.add(protectObjectList.get(0).getTemplateId());
|
||||||
|
System.out.println(idList);
|
||||||
|
assertTrue(templateService.updateAuditInfo( idList, "te2st"));
|
||||||
|
assertEquals("te2st", templateService.queryAuditInfo(idList.get(0)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -107,8 +107,9 @@ class TaskServiceTest extends ProtectionApplicationTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testPageQueryTask(){
|
void testPageQueryTask(){
|
||||||
List<Task> tasks = taskService.queryTasks(null, null, null, null, null,null, null, null, null, 1, 10);
|
List<Task> tasks = taskService.queryTasks(null, null, "", "", null,"", null, "", "", 1, 10);
|
||||||
System.out.println(tasks);
|
// System.out.println(tasks);
|
||||||
|
tasks.forEach(task -> System.out.println(task));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -353,4 +354,9 @@ class TaskServiceTest extends ProtectionApplicationTests {
|
|||||||
map.put(43849,0);
|
map.put(43849,0);
|
||||||
System.out.println(taskService.queryAuditStatusBatch(map));
|
System.out.println(taskService.queryAuditStatusBatch(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testQueryTaskTotalNum(){
|
||||||
|
System.out.println(taskService.queryTaskTotalNum(null, null, "", "", null, "", "", "", ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user