Commit b031d102 by tyfanchz

Merge remote-tracking branch 'origin/dev' into dev

2 parents 7e40c885 6c53a110
......@@ -9,6 +9,7 @@ import com.glsx.smart.dao.entity.SmartUserChannel;
import com.glsx.smart.dao.entity.SmartUserRelation;
import com.glsx.smart.service.SmartUserRelationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -75,6 +76,7 @@ public class UserRelationController {
request.setSource(userRelation.getSource());
request.setName(userRelation.getName());
if(user != null){
request.setId(user.getId());
userRelationService.updateByPrimaryKeySelective(request);
return R.ok().data(this.updateChannelUser(user));
}
......@@ -98,7 +100,7 @@ public class UserRelationController {
private String updateChannelUser(SmartUserRelation user){
List<SmartUserChannel> list = user.getChannelList();
String tuYaId;
if(list.isEmpty()){
if(CollectionUtils.isEmpty(list)){
userRelationService.syncAqaraUser(user.getPhone(), user.getId());
tuYaId = userRelationService
.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!