feat(mcp): 新增合同查询工具 contract.list/detail.query (REQ-20260911-0002)
This commit is contained in:
@@ -0,0 +1,258 @@
|
||||
package me.iiv.agent.mcp.tool;
|
||||
|
||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
import me.iiv.agent.entity.m0.Agent;
|
||||
import me.iiv.agent.entity.m0.User;
|
||||
import me.iiv.agent.entity.m2.ContractFile;
|
||||
import me.iiv.agent.entity.m2.ContractNew;
|
||||
import me.iiv.agent.entity.m2.ContractProcess;
|
||||
import me.iiv.agent.mapper.m0.AgentMapper;
|
||||
import me.iiv.agent.mapper.m0.UserMapper;
|
||||
import me.iiv.agent.mapper.m2.ContractFileMapper;
|
||||
import me.iiv.agent.mapper.m2.ContractNewMapper;
|
||||
import me.iiv.agent.mapper.m2.ContractProcessMapper;
|
||||
import me.iiv.agent.permission.PermissionService;
|
||||
import me.iiv.agent.security.AuthContext;
|
||||
import me.iiv.agent.security.AuthContextHolder;
|
||||
import org.apache.ibatis.builder.MapperBuilderAssistant;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyList;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class ContractToolsTest {
|
||||
|
||||
@Mock
|
||||
ContractNewMapper contractNewMapper;
|
||||
@Mock
|
||||
ContractFileMapper contractFileMapper;
|
||||
@Mock
|
||||
ContractProcessMapper contractProcessMapper;
|
||||
@Mock
|
||||
AgentMapper agentMapper;
|
||||
@Mock
|
||||
UserMapper userMapper;
|
||||
@Mock
|
||||
PermissionService permissionService;
|
||||
|
||||
ContractTools tools;
|
||||
User user;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""),
|
||||
ContractNew.class);
|
||||
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""),
|
||||
ContractFile.class);
|
||||
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""),
|
||||
ContractProcess.class);
|
||||
tools = new ContractTools(contractNewMapper, contractFileMapper, contractProcessMapper,
|
||||
agentMapper, userMapper, permissionService);
|
||||
user = new User();
|
||||
user.setId(7L);
|
||||
AuthContextHolder.set(new AuthContext(null, user));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void tearDown() {
|
||||
AuthContextHolder.clear();
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void listBuildsLegacyFiltersAndTruncatesRows() {
|
||||
ContractNew contract = sampleContract();
|
||||
when(contractNewMapper.selectCount(any())).thenReturn(1L);
|
||||
when(contractNewMapper.selectList(any())).thenReturn(List.of(contract));
|
||||
Agent contractAgent = new Agent();
|
||||
contractAgent.setId(17L);
|
||||
contractAgent.setName("合同所属公司A");
|
||||
Agent customerAgent = new Agent();
|
||||
customerAgent.setId(18L);
|
||||
customerAgent.setName("客户所属公司B");
|
||||
when(agentMapper.selectBatchIds(anyList())).thenReturn(List.of(contractAgent, customerAgent));
|
||||
User creator = new User();
|
||||
creator.setId(1000L);
|
||||
creator.setName("张三");
|
||||
when(userMapper.selectBatchIds(anyList())).thenReturn(List.of(creator));
|
||||
|
||||
Map<String, Object> result = tools.contractListQuery(
|
||||
"452542C", "服务合同", "望京", "金蝶客户", "452542",
|
||||
17L, 18L, 1L, 2, 1, "2026-01-01", "2026-12-31", 1, 500);
|
||||
|
||||
assertEquals(1, result.get("page"));
|
||||
assertEquals(100, result.get("rows"));
|
||||
assertEquals("rows 超过上限 100,已截断为 100", result.get("notice"));
|
||||
|
||||
ArgumentCaptor<LambdaQueryWrapper<ContractNew>> captor = ArgumentCaptor.forClass(LambdaQueryWrapper.class);
|
||||
verify(contractNewMapper).selectList(captor.capture());
|
||||
String sql = captor.getValue().getSqlSegment();
|
||||
assertTrue(sql.contains("contract_no LIKE"));
|
||||
assertTrue(sql.contains("contract_name LIKE"));
|
||||
assertTrue(sql.contains("property_name LIKE"));
|
||||
assertTrue(sql.contains("customer_name LIKE"));
|
||||
assertTrue(sql.contains("customer_no ="));
|
||||
assertTrue(sql.contains("contract_agent_id ="));
|
||||
assertTrue(sql.contains("customer_agent_id ="));
|
||||
assertTrue(sql.contains("property_id ="));
|
||||
assertTrue(sql.contains("contract_status ="));
|
||||
assertTrue(sql.contains("expire_remind ="));
|
||||
assertTrue(sql.contains("end_date >="));
|
||||
assertTrue(sql.contains("end_date <="));
|
||||
assertTrue(sql.contains("soft_delete ="));
|
||||
assertTrue(sql.contains("ORDER BY id DESC"));
|
||||
verify(permissionService).applyContractRowFilter(any(), any());
|
||||
|
||||
Map<String, Object> record = ((List<Map<String, Object>>) result.get("records")).get(0);
|
||||
assertEquals("452542C001", record.get("contractNo"));
|
||||
assertEquals("合同所属公司A", record.get("contractAgentName"));
|
||||
assertEquals("客户所属公司B", record.get("customerAgentName"));
|
||||
assertEquals("张三", record.get("createName"));
|
||||
assertEquals(2, record.get("contractStatus"));
|
||||
assertEquals("正常", record.get("contractStatusText"));
|
||||
assertEquals(new BigDecimal("120000.00"), record.get("amount"));
|
||||
assertEquals("2026-01-01", record.get("startDate"));
|
||||
assertEquals("2026-12-31", record.get("endDate"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void detailRequiresIdOrContractNo() {
|
||||
Map<String, Object> result = tools.contractDetailQuery(null, " ");
|
||||
|
||||
assertNull(result.get("record"));
|
||||
assertEquals("id 和 contractNo 必须传一个", result.get("notice"));
|
||||
verifyNoInteractions(contractNewMapper);
|
||||
}
|
||||
|
||||
@Test
|
||||
void detailReturnsNullRecordWithNoticeWhenMissingOrUnauthorized() {
|
||||
when(contractNewMapper.selectOne(any())).thenReturn(null);
|
||||
|
||||
Map<String, Object> result = tools.contractDetailQuery(404L, null);
|
||||
|
||||
assertNull(result.get("record"));
|
||||
assertEquals("id=404 不存在或当前身份无权查看", result.get("notice"));
|
||||
verify(permissionService).applyContractRowFilter(any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void detailByContractNoReturnsRecordFilesAndProcesses() {
|
||||
ContractNew contract = sampleContract();
|
||||
when(contractNewMapper.selectOne(any())).thenReturn(contract);
|
||||
Agent contractAgent = new Agent();
|
||||
contractAgent.setId(17L);
|
||||
contractAgent.setName("合同所属公司A");
|
||||
when(agentMapper.selectBatchIds(anyList())).thenReturn(List.of(contractAgent));
|
||||
User creator = new User();
|
||||
creator.setId(1000L);
|
||||
creator.setName("张三");
|
||||
when(userMapper.selectById(1000L)).thenReturn(creator);
|
||||
|
||||
ContractFile file = new ContractFile();
|
||||
file.setId(1L);
|
||||
file.setContractId(9L);
|
||||
file.setFileName("合同扫描件.pdf");
|
||||
file.setFileUrl("https://oss.example.com/contract/9/scan.pdf");
|
||||
when(contractFileMapper.selectList(any())).thenReturn(List.of(file));
|
||||
|
||||
ContractProcess process = new ContractProcess();
|
||||
process.setId(1L);
|
||||
process.setContractId(9L);
|
||||
process.setNodeType(1);
|
||||
process.setAuditLevel(0);
|
||||
process.setOperationType(1);
|
||||
process.setUserId(2000L);
|
||||
process.setUserName("李四");
|
||||
process.setScheduleState(2);
|
||||
process.setRemark("同意");
|
||||
when(contractProcessMapper.selectList(any())).thenReturn(List.of(process));
|
||||
|
||||
Map<String, Object> result = tools.contractDetailQuery(null, "452542C001");
|
||||
|
||||
ArgumentCaptor<LambdaQueryWrapper<ContractNew>> captor = ArgumentCaptor.forClass(LambdaQueryWrapper.class);
|
||||
verify(contractNewMapper).selectOne(captor.capture());
|
||||
assertTrue(captor.getValue().getSqlSegment().contains("contract_no ="));
|
||||
verify(permissionService).applyContractRowFilter(any(), any());
|
||||
|
||||
Map<String, Object> record = (Map<String, Object>) result.get("record");
|
||||
assertEquals("452542C001", record.get("contractNo"));
|
||||
assertEquals("合同所属公司A", record.get("contractAgentName"));
|
||||
assertEquals("未查询到", record.get("customerAgentName"));
|
||||
assertEquals("张三", record.get("createName"));
|
||||
assertEquals("正常", record.get("contractStatusText"));
|
||||
|
||||
List<Map<String, Object>> files = (List<Map<String, Object>>) result.get("files");
|
||||
assertEquals(1, files.size());
|
||||
assertEquals("合同扫描件.pdf", files.get(0).get("fileName"));
|
||||
assertEquals("https://oss.example.com/contract/9/scan.pdf", files.get(0).get("fileUrl"));
|
||||
|
||||
List<Map<String, Object>> processes = (List<Map<String, Object>>) result.get("processes");
|
||||
assertEquals(1, processes.size());
|
||||
assertEquals("部门内审核", processes.get(0).get("nodeTypeText"));
|
||||
assertEquals("审核通过", processes.get(0).get("operationTypeText"));
|
||||
assertEquals("已办", processes.get(0).get("scheduleStateText"));
|
||||
assertEquals("李四", processes.get(0).get("userName"));
|
||||
assertEquals("同意", processes.get(0).get("remark"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void springAiPublishesBothReviewedToolSchemas() {
|
||||
var callbacks = org.springframework.ai.tool.method.MethodToolCallbackProvider.builder()
|
||||
.toolObjects(tools).build().getToolCallbacks();
|
||||
Map<String, String> schemas = Arrays.stream(callbacks).collect(Collectors.toMap(
|
||||
callback -> callback.getToolDefinition().name(),
|
||||
callback -> callback.getToolDefinition().inputSchema()));
|
||||
|
||||
assertEquals(2, schemas.size());
|
||||
assertTrue(schemas.containsKey("contract.list.query"));
|
||||
assertTrue(schemas.containsKey("contract.detail.query"));
|
||||
assertTrue(schemas.get("contract.list.query").contains("contractStatus"));
|
||||
assertTrue(schemas.get("contract.detail.query").contains("contractNo"));
|
||||
}
|
||||
|
||||
private static ContractNew sampleContract() {
|
||||
ContractNew contract = new ContractNew();
|
||||
contract.setId(9L);
|
||||
contract.setContractNo("452542C001");
|
||||
contract.setContractName("望京SOHO厕纸服务合同");
|
||||
contract.setContractAgentId(17L);
|
||||
contract.setCustomerAgentId(18L);
|
||||
contract.setPropertyId(1L);
|
||||
contract.setPropertyName("望京SOHO");
|
||||
contract.setCustomerNo("452542");
|
||||
contract.setCustomerName("金蝶客户名称");
|
||||
contract.setAmount(new BigDecimal("120000.00"));
|
||||
contract.setContact("王五");
|
||||
contract.setStartDate(java.sql.Date.valueOf("2026-01-01"));
|
||||
contract.setEndDate(java.sql.Date.valueOf("2026-12-31"));
|
||||
contract.setExpireRemind(1);
|
||||
contract.setRemindDays(30);
|
||||
contract.setSaleId(1001L);
|
||||
contract.setSaleName("销售甲");
|
||||
contract.setContractStatus(2);
|
||||
contract.setCreateId(1000L);
|
||||
return contract;
|
||||
}
|
||||
}
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
package me.iiv.agent.permission;
|
||||
|
||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
import me.iiv.agent.entity.m0.Agent;
|
||||
import me.iiv.agent.entity.m0.AgentManageDistrictAuth;
|
||||
import me.iiv.agent.entity.m0.Authority;
|
||||
import me.iiv.agent.entity.m0.Properyt;
|
||||
import me.iiv.agent.entity.m0.User;
|
||||
import me.iiv.agent.entity.m2.ContractNew;
|
||||
import me.iiv.agent.entity.m2.WarehouseAgentAuth;
|
||||
import me.iiv.agent.mapper.m0.AgentManageDistrictAuthMapper;
|
||||
import me.iiv.agent.mapper.m0.AgentMapper;
|
||||
import me.iiv.agent.mapper.m0.AuthorityMapper;
|
||||
import me.iiv.agent.mapper.m0.ProperytMapper;
|
||||
import me.iiv.agent.mapper.m2.WarehouseAgentAuthMapper;
|
||||
import org.apache.ibatis.builder.MapperBuilderAssistant;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.verifyNoInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/** PermissionService.applyContractRowFilter 直接单测:contract_new 行级权限各分支(与站点/出纸机同一 getByIsAgent 变体)。 */
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class PermissionServiceContractRowFilterTest {
|
||||
|
||||
@Mock
|
||||
AuthorityMapper authorityMapper;
|
||||
@Mock
|
||||
AgentMapper agentMapper;
|
||||
@Mock
|
||||
WarehouseAgentAuthMapper warehouseAgentAuthMapper;
|
||||
@Mock
|
||||
AgentManageDistrictAuthMapper agentManageDistrictAuthMapper;
|
||||
@Mock
|
||||
ProperytMapper properytMapper;
|
||||
@Mock
|
||||
StringRedisTemplate redisTemplate;
|
||||
@Mock
|
||||
HashOperations<String, Object, Object> hashOperations;
|
||||
|
||||
PermissionService permissionService;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""),
|
||||
ContractNew.class);
|
||||
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""),
|
||||
Properyt.class);
|
||||
permissionService = new PermissionService(authorityMapper, agentMapper,
|
||||
warehouseAgentAuthMapper, agentManageDistrictAuthMapper, properytMapper, redisTemplate);
|
||||
}
|
||||
|
||||
@Test
|
||||
void headquartersContractFilterAddsNoBoundary() {
|
||||
User user = user(46L, 1L, null);
|
||||
when(authorityMapper.selectById(1L)).thenReturn(authority(1L, 0));
|
||||
|
||||
LambdaQueryWrapper<ContractNew> wrapper = new LambdaQueryWrapper<>();
|
||||
permissionService.applyContractRowFilter(wrapper, user);
|
||||
|
||||
assertTrue(wrapper.getSqlSegment().isBlank());
|
||||
}
|
||||
|
||||
@Test
|
||||
void agentContractFilterUsesSelfSubordinateAndManagedAgents() {
|
||||
User user = user(1000L, 108L, 1L);
|
||||
when(authorityMapper.selectById(108L)).thenReturn(authority(108L, 1));
|
||||
Agent subordinate = new Agent();
|
||||
subordinate.setId(2L);
|
||||
when(agentMapper.selectList(any())).thenReturn(List.of(subordinate));
|
||||
WarehouseAgentAuth managedAuth = new WarehouseAgentAuth();
|
||||
managedAuth.setManagerAgentId(3L);
|
||||
when(warehouseAgentAuthMapper.selectList(any())).thenReturn(List.of(managedAuth));
|
||||
when(agentManageDistrictAuthMapper.selectList(any())).thenReturn(List.of());
|
||||
|
||||
LambdaQueryWrapper<ContractNew> wrapper = new LambdaQueryWrapper<>();
|
||||
permissionService.applyContractRowFilter(wrapper, user);
|
||||
|
||||
String sql = wrapper.getSqlSegment();
|
||||
Collection<Object> values = wrapper.getParamNameValuePairs().values();
|
||||
assertTrue(sql.contains("contract_agent_id IN"));
|
||||
assertFalse(sql.contains("property_id"));
|
||||
assertTrue(values.contains(1L));
|
||||
assertTrue(values.contains(2L));
|
||||
assertTrue(values.contains(3L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void agentContractFilterAddsManagedPropertyOrBranch() {
|
||||
User user = user(1000L, 108L, 1L);
|
||||
when(authorityMapper.selectById(108L)).thenReturn(authority(108L, 1));
|
||||
when(agentMapper.selectList(any())).thenReturn(List.of());
|
||||
when(warehouseAgentAuthMapper.selectList(any())).thenReturn(List.of());
|
||||
AgentManageDistrictAuth districtAuth = new AgentManageDistrictAuth();
|
||||
districtAuth.setPropertyId(44L);
|
||||
when(agentManageDistrictAuthMapper.selectList(any())).thenReturn(List.of(districtAuth));
|
||||
|
||||
LambdaQueryWrapper<ContractNew> wrapper = new LambdaQueryWrapper<>();
|
||||
permissionService.applyContractRowFilter(wrapper, user);
|
||||
|
||||
String sql = wrapper.getSqlSegment();
|
||||
Collection<Object> values = wrapper.getParamNameValuePairs().values();
|
||||
assertTrue(sql.contains("contract_agent_id IN"));
|
||||
assertTrue(sql.contains("property_id IN"));
|
||||
assertTrue(sql.contains("OR"));
|
||||
assertTrue(values.contains(1L));
|
||||
assertTrue(values.contains(44L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void salesNonLeaderContractFilterUsesOwnCreatedPropertyIds() {
|
||||
User user = user(1000L, 108L, 1L);
|
||||
user.setDeptId(5L);
|
||||
user.setPostId(7L);
|
||||
when(authorityMapper.selectById(108L)).thenReturn(authority(108L, 1));
|
||||
when(agentMapper.selectList(any())).thenReturn(List.of());
|
||||
when(warehouseAgentAuthMapper.selectList(any())).thenReturn(List.of());
|
||||
when(redisTemplate.opsForHash()).thenReturn(hashOperations);
|
||||
when(hashOperations.get("Dictionary", "authDeptId")).thenReturn(",5,");
|
||||
when(hashOperations.get("Dictionary", "authDeptPostId")).thenReturn("8,");
|
||||
Properyt property = new Properyt();
|
||||
property.setId(55L);
|
||||
when(properytMapper.selectList(any())).thenReturn(List.of(property));
|
||||
|
||||
LambdaQueryWrapper<ContractNew> wrapper = new LambdaQueryWrapper<>();
|
||||
permissionService.applyContractRowFilter(wrapper, user);
|
||||
|
||||
String sql = wrapper.getSqlSegment();
|
||||
assertTrue(sql.contains("property_id IN"));
|
||||
assertFalse(sql.contains("contract_agent_id"));
|
||||
assertTrue(wrapper.getParamNameValuePairs().values().contains(55L));
|
||||
verifyNoInteractions(agentManageDistrictAuthMapper);
|
||||
}
|
||||
|
||||
@Test
|
||||
void salesNonLeaderWithoutVisiblePropertiesFiltersToZero() {
|
||||
User user = user(1000L, 108L, 1L);
|
||||
user.setDeptId(5L);
|
||||
user.setPostId(7L);
|
||||
when(authorityMapper.selectById(108L)).thenReturn(authority(108L, 1));
|
||||
when(agentMapper.selectList(any())).thenReturn(List.of());
|
||||
when(warehouseAgentAuthMapper.selectList(any())).thenReturn(List.of());
|
||||
when(redisTemplate.opsForHash()).thenReturn(hashOperations);
|
||||
when(hashOperations.get("Dictionary", "authDeptId")).thenReturn(",5,");
|
||||
when(hashOperations.get("Dictionary", "authDeptPostId")).thenReturn("8,");
|
||||
when(properytMapper.selectList(any())).thenReturn(List.of());
|
||||
|
||||
LambdaQueryWrapper<ContractNew> wrapper = new LambdaQueryWrapper<>();
|
||||
permissionService.applyContractRowFilter(wrapper, user);
|
||||
|
||||
String sql = wrapper.getSqlSegment();
|
||||
assertTrue(sql.contains("property_id IN"));
|
||||
assertFalse(sql.contains("contract_agent_id"));
|
||||
assertTrue(wrapper.getParamNameValuePairs().values().contains(0L));
|
||||
verifyNoInteractions(agentManageDistrictAuthMapper);
|
||||
}
|
||||
|
||||
@Test
|
||||
void agentUserWithoutAgentIdIsDeniedForContractFilter() {
|
||||
User user = user(1000L, 108L, null);
|
||||
when(authorityMapper.selectById(108L)).thenReturn(authority(108L, 1));
|
||||
|
||||
assertThrows(IllegalStateException.class,
|
||||
() -> permissionService.applyContractRowFilter(new LambdaQueryWrapper<>(), user));
|
||||
}
|
||||
|
||||
private static Authority authority(Long id, int isAgent) {
|
||||
Authority authority = new Authority();
|
||||
authority.setId(id);
|
||||
authority.setIsagent(isAgent);
|
||||
authority.setSoftDelete(0);
|
||||
return authority;
|
||||
}
|
||||
|
||||
private static User user(Long id, Long authorityId, Long agentId) {
|
||||
User user = new User();
|
||||
user.setId(id);
|
||||
user.setAuthorityId(authorityId);
|
||||
user.setAgentId(agentId);
|
||||
return user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user