|
@@ -10,7 +10,9 @@ import com.hfln.portal.domain.customer.util.CopyUtils;
|
|
|
import com.hfln.portal.domain.exception.ErrorEnum;
|
|
|
import com.hfln.portal.domain.gateway.PubGateway;
|
|
|
import com.hfln.portal.infrastructure.mqtt.MqttClient;
|
|
|
+import com.hfln.portal.infrastructure.po.DevInfo;
|
|
|
import com.hfln.portal.infrastructure.po.TblOssFile;
|
|
|
+import com.hfln.portal.infrastructure.service.DevInfoService;
|
|
|
import com.hfln.portal.infrastructure.service.OssFileService;
|
|
|
import com.hfln.portal.infrastructure.service.TblDicItemService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -36,6 +38,9 @@ public class PubGatewayImpl implements PubGateway {
|
|
|
@Autowired
|
|
|
private MqttClient mqttClient;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DevInfoService devInfoService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public List<DicItemDto> query(String dicType) {
|
|
@@ -91,5 +96,14 @@ public class PubGatewayImpl implements PubGateway {
|
|
|
log.info("批量OTA升级操作完成,共处理{}个设备", params.getClientIds().size());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String queryClientIdByDeviD(Long devId) {
|
|
|
+ DevInfo devInfo = devInfoService.getById(devId);
|
|
|
+ if (devInfo == null) {
|
|
|
+ throw new BizException(ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorCode(), ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorMessage());
|
|
|
+ }
|
|
|
+ return devInfo.getClientId();
|
|
|
+ }
|
|
|
}
|
|
|
|