Browse Source

uploadBallScreenVideo

lyhzzz 3 years ago
parent
commit
33dd2e41e2
1 changed files with 13 additions and 2 deletions
  1. 13 2
      src/main/java/com/cdf/service/impl/FdkkSceneEditService.java

+ 13 - 2
src/main/java/com/cdf/service/impl/FdkkSceneEditService.java

@@ -87,15 +87,26 @@ public class FdkkSceneEditService {
             if(type == null){
                 continue;
             }
-            HotRelation hotRelation = new HotRelation();
+            HotRelation hotRelation = hotRelationService.getById(sid);
+            boolean update = true;
+            if(hotRelation == null){
+                 hotRelation = new HotRelation();
+                 update = false;
+            }
             hotRelation.setHotId(sid);
             hotRelation.setHotType(type);
             if(relationIds !=null && relationIds.size() >0){
                 hotRelation.setRelationIds(JSONArray.toJSONString(relationIds));
+            }else {
+                hotRelation.setRelationIds(null);
             }
             hotRelation.setNum(fdkkHotRequest.getNum());
             hotRelation.setContent(fdkkHotData.getHotContent());
-            hotRelationService.saveOrUpdate(hotRelation);
+            if(update){
+                hotRelationService.updateById(hotRelation);
+            }else {
+                hotRelationService.save(hotRelation);
+            }
         }
         return fdkkResponse;
     }