feat(REQ-3282): 修改测试中的bug
This commit is contained in:
parent
ea77b16104
commit
f5c9b41857
@ -195,6 +195,9 @@ public class CreateUnitReq implements Serializable {
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
}
|
||||
|
||||
@ -1,14 +1,29 @@
|
||||
# 查询协同关系
|
||||
POST {{host}}/api/org/cooperate-ship/list
|
||||
# 处理部门相关的逻辑
|
||||
POST {{host}}/api/org/node/process
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"workspaceId": 195,
|
||||
"status": 1,
|
||||
"organizationalUnitId": 5140,
|
||||
"cooperateTypes": [
|
||||
9,
|
||||
11
|
||||
]
|
||||
}
|
||||
"action": "CREATE",
|
||||
"operatorId": 123,
|
||||
"param": {
|
||||
"operatorId": 123,
|
||||
"organizationalUnitId":10748,
|
||||
"nodeType": 1,
|
||||
"nodeName": "随便测试的部门",
|
||||
"parentId": 0
|
||||
}
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
# 处理部门相关的逻辑
|
||||
POST {{host}}/api/org/node/list
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"id": 22588
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
# 查询协同关系
|
||||
POST {{host}}/api/org/cooperate-ship/list
|
||||
# 分页列表接口
|
||||
POST {{host}}/api/org/node-user/list
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"workspaceId": 195,
|
||||
"status": 1,
|
||||
"organizationalUnitId": 5140,
|
||||
"cooperateTypes": [
|
||||
9,
|
||||
11
|
||||
]
|
||||
}
|
||||
"id": 984
|
||||
}
|
||||
|
||||
###
|
||||
@ -1,14 +1,23 @@
|
||||
# 查询协同关系
|
||||
POST {{host}}/api/org/cooperate-ship/list
|
||||
#创建
|
||||
POST {{host}}/api/org/job/create
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"workspaceId": 195,
|
||||
"status": 1,
|
||||
"organizationalUnitId": 5140,
|
||||
"cooperateTypes": [
|
||||
9,
|
||||
11
|
||||
]
|
||||
}
|
||||
"name": "cold_blade2",
|
||||
"alias": "colde_blade2",
|
||||
"code": "colde_blade2"
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
# 查询
|
||||
POST {{host}}/api/org/job/list
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"name": "项目负责人"
|
||||
}
|
||||
|
||||
###
|
||||
@ -1,14 +1,23 @@
|
||||
# 查询协同关系
|
||||
POST {{host}}/api/org/cooperate-ship/list
|
||||
# 创建单位
|
||||
POST {{host}}/api/org/unit/create
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"workspaceId": 195,
|
||||
"status": 1,
|
||||
"organizationalUnitId": 5140,
|
||||
"cooperateTypes": [
|
||||
9,
|
||||
11
|
||||
]
|
||||
}
|
||||
"name": "随便写一个",
|
||||
"operatorId": 123
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
#分页列表接口
|
||||
POST {{host}}/api/org/unit/list
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"id": 10747,
|
||||
"name": "auto企业注册通过1215113919"
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
@ -156,6 +156,7 @@ public class OrganizationalNode implements Serializable {
|
||||
if (Objects.equals(this.getParentId(), 0L)) {
|
||||
this.topNodeId = id;
|
||||
this.path = id + ",";
|
||||
return;
|
||||
}
|
||||
Assert.notNull(parentNode, "重置路径时,父节点不能为空");
|
||||
this.topNodeId = parentNode.getTopNodeId();
|
||||
|
||||
@ -22,9 +22,7 @@ public interface OrgJobQueryRepository {
|
||||
class ListReq implements IPageReq {
|
||||
|
||||
@CriteriaField
|
||||
private Long id;
|
||||
@CriteriaField(field = "id", operator = Operator.IN)
|
||||
private Long parentId;
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ public interface UnitQueryRepository {
|
||||
private String uniformSocialCreditCode;
|
||||
|
||||
public void check() {
|
||||
Preconditions.checkArgument(id != null || CollUtil.isNotEmpty(ids), "参数异常");
|
||||
// Preconditions.checkArgument(id != null || CollUtil.isNotEmpty(ids), "参数异常");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ public class NodeFoundationServiceImpl implements NodeFoundationService {
|
||||
.orElseThrow(() -> BizResultCode.ENTITY_NOT_FOUND.toException("部门所在单位不存在{}", nodeCreate.getOrganizationalUnitId()));
|
||||
|
||||
// 获取上级节点,为了重新计算path、topNodeId等数据
|
||||
OrganizationalNode parentNode = nodeCreate.getParentId() == null || nodeCreate.getParentId() <= 0L ? null :
|
||||
OrganizationalNode parentNode = nodeCreate.getParentId() == 0L ? null :
|
||||
nodeQueryRepository.oneOpt(NodeQueryRepository.OneReq.builder().id(nodeCreate.getParentId()).build())
|
||||
.orElseThrow(() -> BizResultCode.ENTITY_NOT_FOUND.toException("父级部门不存在"));
|
||||
|
||||
|
||||
@ -84,6 +84,8 @@ public class NodeCreate {
|
||||
}
|
||||
|
||||
public void check() {
|
||||
Axssert.notNull(parentId, BizResultCode.INVALID_PARAM, "父id不能为空");
|
||||
Axssert.check(parentId >= 0, BizResultCode.INVALID_PARAM, "父id不能为负");
|
||||
Axssert.notNull(operatorId, BizResultCode.INVALID_PARAM, "操作人不能为空");
|
||||
Axssert.notNull(organizationalUnitId, BizResultCode.INVALID_PARAM, "部门所属单位不能为空");
|
||||
OrganizationalNode.TypeEnum nodeTypeEnum = OrganizationalNode.TypeEnum.getByValue(nodeType);
|
||||
|
||||
@ -18,7 +18,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class OrgJobServiceImpl implements OrgJobService {
|
||||
|
||||
private OrgJobFoundationService foundationService;
|
||||
private final OrgJobFoundationService foundationService;
|
||||
|
||||
@Override
|
||||
public OrgJobDTO create(CreateOrgJobReq req) {
|
||||
|
||||
@ -15,6 +15,7 @@ import cn.axzo.orgmanax.server.unit.foundation.dto.UnitCreator;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -34,8 +35,15 @@ public class UnitFoundationServiceImpl implements UnitFoundationService {
|
||||
|
||||
// 1. 重复校验
|
||||
// 根据单位名称或信用代码查询
|
||||
UnitQueryRepository.UnitResp unit = unitQueryRepository.one(UnitQueryRepository.OneReq.builder().name(creator.getCertificationLetterUrl()).build());
|
||||
Axssert.check(unit == null, BizResultCode.INVALID_PARAM,"创建失败, 单位重复");
|
||||
if (ObjectUtil.isNotEmpty(creator.getName())) {
|
||||
UnitQueryRepository.UnitResp unit = unitQueryRepository.one(UnitQueryRepository.OneReq.builder().name(creator.getName()).build());
|
||||
Axssert.check(unit == null, BizResultCode.INVALID_PARAM,"创建失败, 单位重复");
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(creator.getUniformSocialCreditCode())) {
|
||||
UnitQueryRepository.UnitResp unit = unitQueryRepository.one(UnitQueryRepository.OneReq.builder().uniformSocialCreditCode(creator.getUniformSocialCreditCode()).build());
|
||||
Axssert.check(unit == null, BizResultCode.INVALID_PARAM,"创建失败, 统一社会信用码重复");
|
||||
}
|
||||
|
||||
// todo 1. parentId 是否使用
|
||||
// todo 2. 信用代码是否调用三方进行验证
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user