|
|
@ -52,11 +52,11 @@ public class HisUserSupplierServiceImpl extends ServiceImpl<HisUserSupplierMappe |
|
|
|
List<String> userIds = param.getSelectUserIds(); |
|
|
|
if(param.getSelectUserIdsFlag()!=null&¶m.getSelectUserIdsFlag()){ |
|
|
|
for (String userId : param.getSelectUserIds()) { |
|
|
|
this.initByUserId(userId,false); |
|
|
|
this.initByUserId(userId,false,false); |
|
|
|
} |
|
|
|
}else { |
|
|
|
String userId = AuthContextUtils.getSysUserId(); |
|
|
|
this.initByUserId(userId,false); |
|
|
|
this.initByUserId(userId,false,false); |
|
|
|
userIds = Arrays.asList(userId); |
|
|
|
} |
|
|
|
if(CollectionUtil.isEmpty(userIds)){ |
|
|
@ -85,8 +85,13 @@ public class HisUserSupplierServiceImpl extends ServiceImpl<HisUserSupplierMappe |
|
|
|
public PageVo<BmsSupplier> selectPageSupplier(BmsSupplier param) { |
|
|
|
List<HisUserSupplier> hisUserSuppliers = selectHisSupplier(param,true); |
|
|
|
List<Long> supplierIds = hisUserSuppliers.stream().map(HisUserSupplier::getSupplierId).collect(Collectors.toList()); |
|
|
|
if(supplierIds.size()>0) { |
|
|
|
List<BmsSupplier> supplierList = bmsSupplierService.listByIds(supplierIds); |
|
|
|
return R.buildPageHelperList(supplierList); |
|
|
|
}else{ |
|
|
|
return R.buildPageHelperList(new ArrayList<>()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -100,9 +105,17 @@ public class HisUserSupplierServiceImpl extends ServiceImpl<HisUserSupplierMappe |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean initByUserId(String userId, boolean hasCheck) { |
|
|
|
return initByUserId(userId, hasCheck,null); |
|
|
|
public boolean initByUserId(String userId, boolean hasCheck, boolean nextChilds) { |
|
|
|
List<String> existUserIds = new ArrayList<>(); |
|
|
|
if(nextChilds) { |
|
|
|
List<String> childUserList = sysPostUserService.listByChildIds(userId); |
|
|
|
for (String childUserId : childUserList) { |
|
|
|
this.initByUserId(childUserId, false, existUserIds); |
|
|
|
} |
|
|
|
} |
|
|
|
return initByUserId(userId, hasCheck,existUserIds); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -116,12 +129,9 @@ public class HisUserSupplierServiceImpl extends ServiceImpl<HisUserSupplierMappe |
|
|
|
}else { |
|
|
|
existUserIds.add(userId); |
|
|
|
} |
|
|
|
existUserIds.add(userId); |
|
|
|
// existUserIds.add(userId);
|
|
|
|
boolean checkInit = this.checkInit(userId); |
|
|
|
List<String> childUserList = sysPostUserService.listByChildIds(userId); |
|
|
|
for (String childUserId : childUserList) { |
|
|
|
this.initByUserId(childUserId,false,existUserIds); |
|
|
|
} |
|
|
|
|
|
|
|
if(checkInit){ |
|
|
|
return true; |
|
|
|
} |
|
|
|