|
|
@@ -215,7 +215,13 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
|
|
|
if(user == null){
|
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3021, LoginConstant.FAILURE_MSG_3021);
|
|
|
}
|
|
|
- saveCooperationCommon(param,Arrays.asList(user));
|
|
|
+ String[] nums = param.getSceneNum().split(",");
|
|
|
+ List<String> numList = Arrays.asList(nums);
|
|
|
+ List<ScenePro> proList = sceneProService.getListByNums(numList);
|
|
|
+ List<ScenePlus> plusList = scenePlusService.getListByNums(numList);
|
|
|
+ this.deleteCooperationList(proList,plusList);
|
|
|
+
|
|
|
+ saveCooperationCommon(param,Arrays.asList(user),proList,plusList);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -240,25 +246,27 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
|
|
|
List<ScenePlus> plusList = scenePlusService.getListByNums(numList);
|
|
|
this.deleteCooperationList(proList,plusList);
|
|
|
|
|
|
- saveCooperationCommon(param,users);
|
|
|
+ saveCooperationCommon(param,users,proList,plusList);
|
|
|
|
|
|
}
|
|
|
@Autowired
|
|
|
LaserService laserService;
|
|
|
|
|
|
- private void saveCooperationCommon(SceneCooperationParam param,List<User> user){
|
|
|
+ private void saveCooperationCommon(SceneCooperationParam param,List<User> userList,List<ScenePro> proList, List<ScenePlus> plusList){
|
|
|
|
|
|
+ for (User user : userList) {
|
|
|
+ if( !proList.isEmpty()){
|
|
|
+ this.saveBatchByList(proList,new ArrayList<>(),user.getId(),null);
|
|
|
+ }
|
|
|
+ if(!plusList.isEmpty()){
|
|
|
+ this.saveBatchByList(new ArrayList<>(),plusList,user.getId(),null);
|
|
|
+ }
|
|
|
|
|
|
- if( !proList.isEmpty()){
|
|
|
- this.saveBatchByList(proList,new ArrayList<>(),user.getId(),null);
|
|
|
- }
|
|
|
- if(!plusList.isEmpty()){
|
|
|
- this.saveBatchByList(new ArrayList<>(),plusList,user.getId(),null);
|
|
|
+ if("aws".equals(NacosProperty.uploadType)){
|
|
|
+ mailTemplateService.sendSceneCooperation(proList,plusList,user.getUserName(),param.getLang());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if("aws".equals(NacosProperty.uploadType)){
|
|
|
- mailTemplateService.sendSceneCooperation(proList,plusList,user.getUserName(),param.getLang());
|
|
|
- }
|
|
|
List<ScenePro> collect1 = proList.stream().filter(e -> SceneSourceUtil.getLaserList().contains(e.getSceneSource())).collect(Collectors.toList());
|
|
|
List<ScenePlus> collect2 = plusList.stream().filter(e -> SceneSourceUtil.getLaserList().contains(e.getSceneSource())).collect(Collectors.toList());
|
|
|
List<String> numList1 = collect1.stream().map(ScenePro::getNum).collect(Collectors.toList());
|