lyhzzz 4 kuukautta sitten
vanhempi
commit
5b034beb9d

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/ISceneCooperationService.java

@@ -22,7 +22,7 @@ public interface ISceneCooperationService extends IService<SceneCooperation> {
     Long getCooperationSceneNum(Long userId, List<Integer> sceneSourceList);
 
     void deleteCooperationList(List<ScenePro> sceneProList, List<ScenePlus> scenePlusList,List<Long> userIds) ;
-    void deleteCooperationList(List<String> numList,List<Long> userIds) ;
+    void deleteCooperationList(List<String> numList,List<Long> userIds,String sceneType) ;
 
     List<SceneCooperation> saveBatchByList(List<String> numList, List<Long> userId ,String type,String sceneType);
 

+ 9 - 3
src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

@@ -86,16 +86,19 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
         List<String> numList = sceneProList.stream().map(ScenePro::getNum).collect(Collectors.toList());
         List<String> numList2 = scenePlusList.stream().map(ScenePlus::getNum).collect(Collectors.toList());
         numList.addAll(numList2);
-        this.deleteCooperationList(numList,userIds);
+        this.deleteCooperationList(numList,userIds,null);
     }
 
     @Override
-    public void deleteCooperationList(List<String> numList,List<Long> userIds) {
+    public void deleteCooperationList(List<String> numList,List<Long> userIds,String sceneType) {
         if(CollectionUtils.isEmpty(numList) ){
             return;
         }
         LambdaQueryWrapper<SceneCooperation> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(SceneCooperation::getSceneNum,numList);
+        if(sceneType != null){
+            wrapper.eq(SceneCooperation::getSceneType,sceneType);
+        }
         if(userIds != null && !userIds.isEmpty()){
             wrapper.in(SceneCooperation::getUserId,userIds);
         }
@@ -287,13 +290,16 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
         List<String> numList =  Arrays.asList(nums);
 
         if(param.getUserNameList() == null || param.getUserNameList().isEmpty()){
-            this.deleteCooperationList(numList,null);
+            this.deleteCooperationList(numList,null,param.getSceneType());
             laserService.saveBatchCooperation(numList,new ArrayList<>(),param.getUserNameList(),"scene","update");
             return null;
         }
         if(param.getUserNameList().contains( loginUserName)){
             throw new BusinessException(LoginConstant.FAILURE_CODE_3024, LoginConstant.FAILURE_MSG_3024);
         }
+        if(param.getUserNameList().size() != new HashSet<>(param.getUserNameList()).size()){
+            throw new BusinessException(ResultCode.COO_LIMIT_ERROR2);
+        }
         if(param.getUserNameList().size() >5){
             throw new BusinessException(ResultCode.COO_LIMIT_ERROR);
         }