!39 【轻量级PR】组织结构增加税号查询条件

Merge pull request !39 from 叶星/dev-7.2.5
pull/40/MERGE
stylefeng 2022-10-14 12:22:30 +00:00 committed by Gitee
commit e9bee2f646
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 11 additions and 0 deletions

View File

@ -113,6 +113,13 @@ public class HrOrganizationRequest extends BaseRequest {
/**
*
*/
@TableUniqueValue(
message = "企业税号存在重复",
groups = {add.class, edit.class},
tableName = "hr_organization",
columnName = "tax_no",
idFieldName = "org_id",
excludeLogicDeleteItems = true)
@ChineseDescription("税号")
private String taxNo;

View File

@ -447,6 +447,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
Long orgParentId = hrOrganizationRequest.getOrgParentId();
Long orgId = hrOrganizationRequest.getOrgId();
Integer orgType = hrOrganizationRequest.getOrgType();
String taxNo = hrOrganizationRequest.getTaxNo();
// 拼接组织机构名称条件
queryWrapper.like(ObjectUtil.isNotEmpty(orgName), HrOrganization::getOrgName, orgName);
@ -457,6 +458,9 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
// 组织机构类型拼接
queryWrapper.eq(ObjectUtil.isNotEmpty(orgType), HrOrganization::getOrgType, orgType);
// 税号查询条件
queryWrapper.eq(StrUtil.isNotEmpty(taxNo), HrOrganization::getTaxNo, taxNo);
// 拼接父机构id查询条件
if (ObjectUtil.isNotEmpty(orgParentId)) {
queryWrapper.and(qw -> {