|
@@ -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;
|
|
|
}
|