Merge remote-tracking branch 'origin/master'

master
bynt 12 months ago
commit ef0a06b257

@ -29,17 +29,18 @@ public class StoreUserServiceImpl extends ExtendServiceImpl<StoreUserMapper, Sto
private final SysUserService sysUserService; private final SysUserService sysUserService;
private final BusinessProperties businessProperties; private final BusinessProperties businessProperties;
@Override @Override
public List<SysUserNameRoleDTO> listByRoleCode() { public List<SysUserNameRoleDTO> listByRoleCode() {
List<SysUserNameRoleDTO> sysUserNameRoleS = sysUserService.listByRoleCodeAndUserId(businessProperties.getStoreCode(), SecurityUtils.getCurrentUserId()); //todo 可以1对多,不去重
List<SysUserNameRoleDTO> list = new ArrayList<>(); // List<SysUserNameRoleDTO> list = new ArrayList<>();
if (sysUserNameRoleS != null) { // if (sysUserNameRoleS != null) {
//已经绑定的业务员 // //已经绑定的业务员
List<StoreUserEntity> storeUserEntities = baseMapper.selectList(new LambdaQueryWrapper<StoreUserEntity>().eq(StoreUserEntity::getCreateBy, SecurityUtils.getCurrentUserId())); // List<StoreUserEntity> storeUserEntities = baseMapper.selectList(new LambdaQueryWrapper<StoreUserEntity>().eq(StoreUserEntity::getCreateBy, SecurityUtils.getCurrentUserId()));
list = sysUserNameRoleS.stream().filter(item -> !storeUserEntities.stream().map(StoreUserEntity::getUserId).collect(Collectors.toList()).contains(item.getUserId())).collect(Collectors.toList()); // list = sysUserNameRoleS.stream().filter(item -> !storeUserEntities.stream().map(StoreUserEntity::getUserId).collect(Collectors.toList()).contains(item.getUserId())).collect(Collectors.toList());
} // }
return list; return sysUserService.listByRoleCodeAndUserId(businessProperties.getStoreCode(), SecurityUtils.getCurrentUserId());
} }
@Override @Override
@ -55,7 +56,7 @@ public class StoreUserServiceImpl extends ExtendServiceImpl<StoreUserMapper, Sto
List<StoreUserEntity> storeUserEntities = baseMapper.selectList List<StoreUserEntity> storeUserEntities = baseMapper.selectList
(Wrappers.<StoreUserEntity>lambdaQuery().eq(StoreUserEntity::getStoreId, storeId) (Wrappers.<StoreUserEntity>lambdaQuery().eq(StoreUserEntity::getStoreId, storeId)
.orderByDesc(StoreUserEntity::getId)); .orderByDesc(StoreUserEntity::getId));
if (CollUtil.isNotEmpty(storeUserEntities)){ if (CollUtil.isNotEmpty(storeUserEntities)) {
return storeUserEntities.get(0).getUserId(); return storeUserEntities.get(0).getUserId();
} }
return 0L; return 0L;

Loading…
Cancel
Save