|
|
@@ -101,8 +101,8 @@ public class GateWayUserInfoService {
|
|
|
public GateWayUserInfo gateWayBindMqttUser(GateWayInfo gateWayInfo) {
|
|
|
GateWayUserInfo gateWayUserInfo = null;
|
|
|
if (ObjectUtils.isNotEmpty(gateWayInfo)) {
|
|
|
- GateWay2User gateWay2User = gateWay2UserDao.findTopByGateWayInfo(gateWayInfo);
|
|
|
- if (ObjectUtils.isEmpty(gateWay2User)) {
|
|
|
+ GateWay2User gateWay2User = gateWay2UserDao.findTopByGateWayInfoOrderByCreateTimeDesc(gateWayInfo);
|
|
|
+ if (ObjectUtils.isEmpty(gateWay2User) || ObjectUtils.isEmpty(gateWay2User.getGateWayUserInfo())) {
|
|
|
GateWayUserInfoAddParam userParam = new GateWayUserInfoAddParam();
|
|
|
String userName = CommonUtil.generateRandomString(8);
|
|
|
String roleName = userName;
|
|
|
@@ -114,7 +114,10 @@ public class GateWayUserInfoService {
|
|
|
ResultContent<GateWayUserInfo> resultContent = addGateWayUser(userParam);
|
|
|
if (resultContent.isSuccess()) {
|
|
|
gateWayUserInfo = resultContent.getContent();
|
|
|
- gateWay2User = new GateWay2User();
|
|
|
+ if(ObjectUtils.isEmpty(gateWay2User)) {
|
|
|
+ gateWay2User = new GateWay2User();
|
|
|
+ }
|
|
|
+
|
|
|
gateWay2User.setGateWayInfo(gateWayInfo);
|
|
|
gateWay2User.setGateWayId(gateWayInfo.getGateWayId());
|
|
|
gateWay2User.setGateWayUserInfo(gateWayUserInfo);
|