|
|
@@ -11,6 +11,7 @@ import java.util.Map.Entry;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.lc.ibps.cloud.util.AESUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -201,6 +202,9 @@ public class PartyUserProvider extends GenericProvider implements IPartyUserServ
|
|
|
if(StringUtil.isNotEmpty(positionId)) {
|
|
|
list = partyUserRepository.queryDialogUserByParam4Post(queryFilter, positionId, inclueChild);
|
|
|
}
|
|
|
+ if (isFilterExtEmpEnabled()) {
|
|
|
+ list.removeIf(this::isExtEmployee);
|
|
|
+ }
|
|
|
APIPageList<PartyUserPo> pageList = getAPIPageList(list);
|
|
|
for (PartyUserPo user : list) {
|
|
|
user.setPassword(null);
|
|
|
@@ -992,5 +996,33 @@ public class PartyUserProvider extends GenericProvider implements IPartyUserServ
|
|
|
String entityId = pathArr[index];
|
|
|
return partyEntityRepository.get(entityId);
|
|
|
}
|
|
|
+
|
|
|
+ /** 读取配置开关:是否过滤外部员工 */
|
|
|
+ private boolean isFilterExtEmpEnabled() {
|
|
|
+ String setting = ContextUtil.getSetting();
|
|
|
+ if (StringUtil.isEmpty(setting)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
+ Map<String, Object> configMap = mapper.readValue(setting, Map.class);
|
|
|
+ Object value = configMap.get("filiterExtEmp");
|
|
|
+ return value != null && "true".equalsIgnoreCase(String.valueOf(value));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 判断是否为外部员工:ibps_party_employee表wcAccount 以 ^ 分割后首段为 ext */
|
|
|
+ private boolean isExtEmployee(PartyUserPo user) {
|
|
|
+ if (user == null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ String wcAccount = user.getWcAccount();
|
|
|
+ if (StringUtil.isEmpty(wcAccount)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return "ext".equalsIgnoreCase(wcAccount.split("\\^")[0]);
|
|
|
+ }
|
|
|
|
|
|
}
|