add:添加批量升级批次管理
parent
4758fbc6b5
commit
fade633289
|
@ -2,6 +2,7 @@ package cc.iotkit.manager.service;
|
||||||
|
|
||||||
import cc.iotkit.common.api.PageRequest;
|
import cc.iotkit.common.api.PageRequest;
|
||||||
import cc.iotkit.common.api.Paging;
|
import cc.iotkit.common.api.Paging;
|
||||||
|
import cc.iotkit.common.enums.ErrCode;
|
||||||
import cc.iotkit.common.exception.BizException;
|
import cc.iotkit.common.exception.BizException;
|
||||||
import cc.iotkit.common.oss.core.OssClient;
|
import cc.iotkit.common.oss.core.OssClient;
|
||||||
import cc.iotkit.common.oss.factory.OssFactory;
|
import cc.iotkit.common.oss.factory.OssFactory;
|
||||||
|
@ -36,6 +37,7 @@ import java.io.IOException;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: 石恒
|
* @Author: 石恒
|
||||||
|
@ -135,6 +137,9 @@ public class OtaService {
|
||||||
*/
|
*/
|
||||||
public void startUpgrade(Long otaId, List<String> deviceIds) {
|
public void startUpgrade(Long otaId, List<String> deviceIds) {
|
||||||
OtaPackage otaPackage = iOtaPackageData.findById(otaId);
|
OtaPackage otaPackage = iOtaPackageData.findById(otaId);
|
||||||
|
if(Objects.isNull(otaPackage)){
|
||||||
|
throw new BizException(ErrCode.DATA_NOT_EXIST);
|
||||||
|
}
|
||||||
DeviceOtaInfo deviceOtaInfo = deviceOtaInfoData.save(DeviceOtaInfo.builder()
|
DeviceOtaInfo deviceOtaInfo = deviceOtaInfoData.save(DeviceOtaInfo.builder()
|
||||||
.counts(deviceIds.size())
|
.counts(deviceIds.size())
|
||||||
.productKey(otaPackage.getProductKey())
|
.productKey(otaPackage.getProductKey())
|
||||||
|
|
Loading…
Reference in New Issue