diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java index 94fd66386b..022e6d834b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java @@ -17,10 +17,6 @@ package com.epmet.controller; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; -import cn.hutool.poi.excel.ExcelUtil; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.exception.RenException; @@ -143,7 +139,7 @@ public class IcCommunitySelfOrganizationController { * @date 2021/11/25 9:03 上午 */ @PostMapping("importcommunityselforganization") - public void importCommunitySelfOrganization(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws Exception { + public Result importCommunitySelfOrganization(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws Exception { if (file.isEmpty()) { throw new RenException("请上传文件"); } @@ -164,6 +160,8 @@ public class IcCommunitySelfOrganizationController { } //2.执行导入程序 icCommunitySelfOrganizationService.importCommunitySelfOrganization(tokenDto, response, file, result.getData().getTaskId()); + + return new Result(); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java index 663461c62c..ca222a906c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java @@ -57,6 +57,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -80,6 +82,7 @@ import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN; */ @Service @Slf4j +@EnableAsync public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl implements IcCommunitySelfOrganizationService { @Autowired @@ -472,6 +475,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl fileList = new ArrayList<>(); CommunitySelfOrgImportExcel excel = null; diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java index 4f41645000..b29fd3f54a 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java @@ -17,6 +17,7 @@ package com.epmet.modules.partymember.controller; +import com.baomidou.mybatisplus.extension.api.R; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; @@ -124,7 +125,7 @@ public class IcPartymemberStyleController { } @PostMapping("import") - public void importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { + public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { // 校验文件类型 String extension = FilenameUtils.getExtension(file.getOriginalFilename()); if (!"xls".equals(extension) && !"xlsx".equals(extension)) { @@ -141,6 +142,8 @@ public class IcPartymemberStyleController { } //2.执行导入程序 icPartymemberStyleService.importData(tokenDto, response, file, result.getData().getTaskId()); + + return new Result(); } /** diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java index b17d3f3a4a..2d4533ff94 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java @@ -71,6 +71,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -92,6 +94,7 @@ import java.util.stream.Collectors; */ @Slf4j @Service +@EnableAsync public class IcPartymemberStyleServiceImpl extends BaseServiceImpl implements IcPartymemberStyleService { @Resource @@ -255,6 +258,7 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl fileList = new ArrayList<>(); PartyMemberImportExcel excel = null;