瀏覽代碼

1.接口同步

yuanliang 1 年之前
父節點
當前提交
37c5a445f3

+ 5 - 5
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/controller/TenantActivationCodeController.java

@@ -71,6 +71,7 @@ import java.util.List;
 @RequestMapping("${app-config.url.tenant:}/tenantActivationCode")
 @Api(tags = "机构激活码")
 public class TenantActivationCodeController extends BaseController {
+
     @Autowired
     private TenantActivationCodeService tenantActivationCodeService;
 
@@ -294,7 +295,7 @@ public class TenantActivationCodeController extends BaseController {
 
     @PostMapping("/importActiveCode")
     @ApiOperation(value = "导入", notes = "传入file")
-    public HttpResponseResult<List<ErrMsg>> importActiveCode(
+    public HttpResponseResult<Object> importActiveCode(
             @RequestParam("file") MultipartFile file,
             @RequestParam("tenantAlbumPurchaseId") Long tenantAlbumPurchaseId) {
         if (null == file) {
@@ -312,11 +313,10 @@ public class TenantActivationCodeController extends BaseController {
         try {
             ExcelDataReader<TenantActivationCodeWrapper.ImportTemplate> reader =
                     ExcelUtils.getReader(TenantActivationCodeWrapper.ImportTemplate.class, file);
-            tenantActivationCodeService.importActiveCode(reader.getDataList(), user.getTenantId(), user.getId(),
+            return tenantActivationCodeService.importActiveCode(reader.getDataList(), user.getTenantId(), user.getId(),
                     tenantAlbumPurchaseId);
-            return HttpResponseResult.succeed();
-        } catch (ExcelException e) {
-            log.error("导入激活码失败:"+JSON.toJSONString(e.getErrMsgList()));
+        } catch (Exception e) {
+            log.error("导入激活码失败:"+JSON.toJSONString(e.getMessage()));
             return HttpResponseResult.failed("文件解析错误");
         }
     }