Commit 6c53a110 by wnb0128

车家智能数据服务 需求V1.0.0功能--think.wang

1 parent a8d20993
...@@ -9,6 +9,7 @@ import com.glsx.smart.dao.entity.SmartUserChannel; ...@@ -9,6 +9,7 @@ import com.glsx.smart.dao.entity.SmartUserChannel;
import com.glsx.smart.dao.entity.SmartUserRelation; import com.glsx.smart.dao.entity.SmartUserRelation;
import com.glsx.smart.service.SmartUserRelationService; import com.glsx.smart.service.SmartUserRelationService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -75,6 +76,7 @@ public class UserRelationController { ...@@ -75,6 +76,7 @@ public class UserRelationController {
request.setSource(userRelation.getSource()); request.setSource(userRelation.getSource());
request.setName(userRelation.getName()); request.setName(userRelation.getName());
if(user != null){ if(user != null){
request.setId(user.getId());
userRelationService.updateByPrimaryKeySelective(request); userRelationService.updateByPrimaryKeySelective(request);
return R.ok().data(this.updateChannelUser(user)); return R.ok().data(this.updateChannelUser(user));
} }
...@@ -98,7 +100,7 @@ public class UserRelationController { ...@@ -98,7 +100,7 @@ public class UserRelationController {
private String updateChannelUser(SmartUserRelation user){ private String updateChannelUser(SmartUserRelation user){
List<SmartUserChannel> list = user.getChannelList(); List<SmartUserChannel> list = user.getChannelList();
String tuYaId; String tuYaId;
if(list.isEmpty()){ if(CollectionUtils.isEmpty(list)){
userRelationService.syncAqaraUser(user.getPhone(), user.getId()); userRelationService.syncAqaraUser(user.getPhone(), user.getId());
tuYaId = userRelationService tuYaId = userRelationService
.syncTuYaUser(user.getPhone(), user.getPassword(), user.getId()); .syncTuYaUser(user.getPhone(), user.getPassword(), user.getId());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!