|
@@ -28,10 +28,7 @@ import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -368,11 +365,19 @@ public class BrandServiceImpl implements BrandService {
|
|
}
|
|
}
|
|
//{brandId: 1, canShow: 0, type: -1, userId: "1"}
|
|
//{brandId: 1, canShow: 0, type: -1, userId: "1"}
|
|
public void bindUsers(Integer brandId,List<BrandBindUserVo> brandBindUserVoList) {
|
|
public void bindUsers(Integer brandId,List<BrandBindUserVo> brandBindUserVoList) {
|
|
- List<Long> userIdList = brandBindUserVoList.stream().map(BrandBindUserVo::getUserId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Long> userIdList = new ArrayList<>();
|
|
|
|
+ if(brandBindUserVoList !=null && brandBindUserVoList.size() >0){
|
|
|
|
+ userIdList = brandBindUserVoList.stream().map(BrandBindUserVo::getUserId).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+
|
|
mySysUserBrandService.unbindUserByBrandId(brandId,userIdList);
|
|
mySysUserBrandService.unbindUserByBrandId(brandId,userIdList);
|
|
- for (BrandBindUserVo vo : brandBindUserVoList) {
|
|
|
|
- bindUser(vo.getUserId(), vo.getBrandId(), vo.getCanShow());
|
|
|
|
|
|
+
|
|
|
|
+ if(brandBindUserVoList !=null && brandBindUserVoList.size() >0){
|
|
|
|
+ for (BrandBindUserVo vo : brandBindUserVoList) {
|
|
|
|
+ bindUser(vo.getUserId(), vo.getBrandId(), vo.getCanShow());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
// brandBindUserVoList.parallelStream().filter(vo -> !ObjectUtils.isEmpty(vo.getType())).forEach(vo -> {
|
|
// brandBindUserVoList.parallelStream().filter(vo -> !ObjectUtils.isEmpty(vo.getType())).forEach(vo -> {
|
|
// //绑定或者修改带看权限
|
|
// //绑定或者修改带看权限
|
|
// if (vo.getType().compareTo(1) == 0) {
|
|
// if (vo.getType().compareTo(1) == 0) {
|