获取部门数,修改企业类型,换成多个类型查询
parent
0a835970ba
commit
c240208edf
|
|
@ -189,7 +189,7 @@ public class DepartmentQueryExe {
|
|||
|
||||
public Collection<DepartmentTreeInfoCO> listAllTreeByCorpType(DepartmentTreeQry 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)) {
|
||||
parmas.put("inType",enterpriseType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class DepartmentTreeQry {
|
|||
private List<Integer> inType;
|
||||
|
||||
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseType")
|
||||
private Integer enterpriseType;
|
||||
private List<Integer> enterpriseType;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.basic.info.domain.enums;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -46,6 +47,18 @@ public enum CorpTypeEnum {
|
|||
public static List<Integer> getCodesByEnterpriseType(Integer enterpriseType) {
|
||||
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) {
|
||||
for (CorpTypeEnum corpType : values()) {
|
||||
if (corpType.code.equals(code)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue