Commit 4a2d7d1c by huangtao

sys_user

parent b3fcf88d
...@@ -12,6 +12,12 @@ public class OrganizationDto { ...@@ -12,6 +12,12 @@ public class OrganizationDto {
@ApiModelProperty(value = "组织名称") @ApiModelProperty(value = "组织名称")
private String organizationName; private String organizationName;
@ApiModelProperty(value = "层级")
private Integer level;
@ApiModelProperty(value = "父级ID")
private Long parentId;
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
private String remark; private String remark;
......
...@@ -70,8 +70,15 @@ public class OrganizationServiceImpl extends AbstractService implements Organiza ...@@ -70,8 +70,15 @@ public class OrganizationServiceImpl extends AbstractService implements Organiza
if (existed.isPresent()) { if (existed.isPresent()) {
throw new ServiceException(ORGANIZATION_NAME_EXISTED, ":仓库名称=" + req.getOrganizationName()); throw new ServiceException(ORGANIZATION_NAME_EXISTED, ":仓库名称=" + req.getOrganizationName());
} }
SysOrganization organization = copyTo(req, new SysOrganization()); SysOrganization organization = copyTo(req, new SysOrganization());
if(ObjectUtil.isNotEmpty(req.getParentId())){
OrganizationDto organizationOrThrow = getOrganizationOrThrow(req.getParentId());
Integer level = organizationOrThrow.getLevel();
organization.setLevel(level+1);
}
sysOrganizationMapper.insert(organization); sysOrganizationMapper.insert(organization);
return convertTo(organization); return convertTo(organization);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment