获取部门数,修改企业类型,换成多个类型查询

main
zhaokai 2026-01-22 17:05:24 +08:00
parent 0a835970ba
commit c240208edf
3 changed files with 15 additions and 2 deletions

View File

@ -189,7 +189,7 @@ public class DepartmentQueryExe {
public Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry qry) { public Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry qry) {
Map<String, Object> parmas = PageQueryHelper.toHashMap(qry); Map<String, Object> parmas = PageQueryHelper.toHashMap(qry);
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) parmas.get("enterpriseType")); List<Integer> enterpriseType =CorpTypeEnum.getCodesByEnterpriseType(qry.getEnterpriseType());
if (CollUtil.isNotEmpty(enterpriseType)) { if (CollUtil.isNotEmpty(enterpriseType)) {
parmas.put("inType",enterpriseType); parmas.put("inType",enterpriseType);
} }

View File

@ -35,7 +35,7 @@ public class DepartmentTreeQry {
private List<Integer> inType; private List<Integer> inType;
@ApiModelProperty(value = "企业类型1监管 2企业 3相关方", name = "enterpriseType") @ApiModelProperty(value = "企业类型1监管 2企业 3相关方", name = "enterpriseType")
private Integer enterpriseType; private List<Integer> enterpriseType;
} }

View File

@ -1,5 +1,6 @@
package com.zcloud.basic.info.domain.enums; package com.zcloud.basic.info.domain.enums;
import cn.hutool.core.collection.CollUtil;
import lombok.Getter; import lombok.Getter;
import java.util.*; import java.util.*;
@ -46,6 +47,18 @@ public enum CorpTypeEnum {
public static List<Integer> getCodesByEnterpriseType(Integer enterpriseType) { public static List<Integer> getCodesByEnterpriseType(Integer enterpriseType) {
return ENTERPRISE_TYPE_CODE_MAP.getOrDefault(enterpriseType, Collections.emptyList()); return ENTERPRISE_TYPE_CODE_MAP.getOrDefault(enterpriseType, Collections.emptyList());
} }
public static List<Integer> getCodesByEnterpriseType(List<Integer> enterpriseTypeList) {
if(CollUtil.isEmpty(enterpriseTypeList)){
return null;
}
return enterpriseTypeList.stream()
.flatMap(enterpriseType ->
ENTERPRISE_TYPE_CODE_MAP.getOrDefault(enterpriseType, Collections.emptyList()).stream())
.distinct()
.collect(Collectors.toList());
}
public static Integer getUserTypeByCode(Integer code) { public static Integer getUserTypeByCode(Integer code) {
for (CorpTypeEnum corpType : values()) { for (CorpTypeEnum corpType : values()) {
if (corpType.code.equals(code)) { if (corpType.code.equals(code)) {