Browse Source

1导入激活码提示优化

yuanliang 1 year ago
parent
commit
e67184a95b

+ 5 - 5
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantActivationCodeServiceImpl.java

@@ -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()