update 电单车

This commit is contained in:
Guoqs
2024-09-21 14:54:58 +08:00
parent e3f60c6738
commit 335644cee0
7 changed files with 91 additions and 26 deletions

View File

@@ -8,6 +8,7 @@ import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.page.PageResponse;
import com.jsowell.common.enums.DelFlagEnum;
import com.jsowell.common.enums.SoftwareProtocolEnum;
import com.jsowell.common.enums.ykc.*;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.*;
@@ -107,8 +108,17 @@ public class PileService {
}
public int batchCreatePile(BatchCreatePileDTO dto) {
String softwareProtocol = dto.getSoftwareProtocol();
if (StringUtils.isBlank(softwareProtocol)) {
throw new BusinessException(ReturnCodeEnum.valueOf("软件协议不能为空"));
}
// 批量生成sn号
List<String> snList = snUtils.generateSN(dto.getNum());
List<String> snList = null;
if (StringUtils.equals(SoftwareProtocolEnum.YOU_DIAN.getValue(), softwareProtocol)) {
snList = snUtils.generateSN(dto.getNum());
} else {
snList = snUtils.generateSN(dto.getNum());
}
//
List<PileBasicInfo> basicInfoList = Lists.newArrayList();
@@ -125,7 +135,7 @@ public class PileService {
String secretKey = RandomStringUtils.randomAlphanumeric(8).toUpperCase(Locale.ROOT);
basicInfo.setSecretKey(secretKey);
}
basicInfo.setSoftwareProtocol(dto.getSoftwareProtocol()); // 软件协议
basicInfo.setSoftwareProtocol(softwareProtocol); // 软件协议
basicInfo.setMerchantId(Long.valueOf(dto.getMerchantId())); // 运营商id
basicInfo.setStationId(Long.valueOf(dto.getStationId())); // 站点id
basicInfo.setModelId(Long.valueOf(dto.getModelId())); // 型号id