|
@@ -388,21 +388,21 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
|
public HttpResponseResult<Object> importActiveCode(List<ExcelDataReaderProperty<TenantActivationCodeWrapper.ImportTemplate>> dataList,
|
|
|
Long tenantId, Long userId, Long tenantAlbumPurchaseId) {
|
|
|
if (dataList.isEmpty()) {
|
|
|
- throw new BizException("未解析到数据");
|
|
|
+ return HttpResponseResult.failed(500, null, "未解析到数据");
|
|
|
}
|
|
|
dataList.sort(Comparator.comparingInt(ExcelDataReaderProperty::getRowIndex));
|
|
|
|
|
|
List<TenantActivationCodeWrapper.ImportTemplate> importTemplates = dataList.stream().map(ExcelDataReaderProperty::getClazz).collect(Collectors.toList());
|
|
|
List<String> codeList = importTemplates.stream().map(TenantActivationCodeWrapper.ImportTemplate::getCode).
|
|
|
filter(StringUtils::isNotEmpty).collect(Collectors.toList());
|
|
|
- if(codeList.isEmpty()){
|
|
|
- throw new BizException("未指定激活码");
|
|
|
+ if (codeList.isEmpty()) {
|
|
|
+ return HttpResponseResult.failed(500, null, "未指定激活码");
|
|
|
}
|
|
|
|
|
|
List<String> phoneList = importTemplates.stream().map(TenantActivationCodeWrapper.ImportTemplate::getPhone)
|
|
|
.filter(StringUtils::isNotEmpty).collect(Collectors.toList());
|
|
|
- if(phoneList.isEmpty()){
|
|
|
- throw new BizException("未指定手机号");
|
|
|
+ if (phoneList.isEmpty()) {
|
|
|
+ return HttpResponseResult.failed(500, null, "未指定手机号");
|
|
|
}
|
|
|
|
|
|
List<TenantActivationCode> activationCodes = this.lambdaQuery()
|
|
@@ -450,6 +450,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
|
lines.add(repeatLine);
|
|
|
}
|
|
|
lines.add(msgRowNo);
|
|
|
+ code_repeat_lines.put(code, lines);
|
|
|
} else {
|
|
|
codeRowMap.put(acCode, msgRowNo);
|
|
|
}
|
|
@@ -532,7 +533,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
|
return tenantActivationCode;
|
|
|
}).collect(Collectors.toList());
|
|
|
if (tenantActivationCodes.isEmpty()) {
|
|
|
- throw new BizException("没有合法的导入数据");
|
|
|
+ return HttpResponseResult.failed(500, null, "没有合法的导入数据");
|
|
|
}
|
|
|
this.updateBatchById(tenantActivationCodes, 50);
|
|
|
return HttpResponseResult.succeed();
|