|
@@ -299,25 +299,18 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
|
|
|
User loginUser = userService.getByUserName(loginUserName);
|
|
|
if(numList.size() >1){
|
|
|
HashMap<String, List<User>> byNumList = this.getByNumList(numList, param.getSceneType());
|
|
|
- Boolean flag = true;
|
|
|
for (String num : numList) {
|
|
|
- Boolean inFlag = true;
|
|
|
- if(byNumList.get(num) != null && !byNumList.isEmpty()){
|
|
|
- if(byNumList.get(num).size() + param.getUserNameList().size() >5){
|
|
|
+ if(byNumList.get(num) != null && !byNumList.isEmpty()) {
|
|
|
+ if (byNumList.get(num).size() + param.getUserNameList().size() > 5) {
|
|
|
throw new BusinessException(ResultCode.COO_LIMIT_ERROR);
|
|
|
}
|
|
|
List<User> users = byNumList.get(num);
|
|
|
- List<String> collect = users.stream().map(User::getUserName).collect(Collectors.toList());
|
|
|
- for (String userName : param.getUserNameList()) {
|
|
|
- if(!collect.contains(userName)){
|
|
|
- inFlag = false;
|
|
|
- }
|
|
|
+ Set<String> collect = users.stream().map(User::getUserName).collect(Collectors.toSet());
|
|
|
+
|
|
|
+ if(collect.containsAll(param.getUserNameList())){
|
|
|
+ throw new BusinessException(ResultCode.COO_LIMIT_ERROR2);
|
|
|
}
|
|
|
}
|
|
|
- flag = !inFlag;
|
|
|
- }
|
|
|
- if(flag){
|
|
|
- throw new BusinessException(ResultCode.COO_LIMIT_ERROR2);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -528,7 +521,8 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
|
|
|
if(StringUtils.isNotBlank(sceneType) && "mesh".equals(sceneType)){
|
|
|
return;
|
|
|
}
|
|
|
- laserService.saveBatchCooperation(new ArrayList<>(numList1),snCodeList,LoginUser.getUserName(),collect,type);
|
|
|
+ String operatingMode = numList.size() > 1 ? "add" :"update";
|
|
|
+ laserService.saveBatchCooperation(new ArrayList<>(numList1),snCodeList,LoginUser.getUserName(),collect,type,operatingMode);
|
|
|
|
|
|
}
|
|
|
|