Browse Source

测试async

dev
zxc 4 years ago
parent
commit
cf24e1cd79
  1. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -71,6 +71,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -231,8 +232,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
* @date 2022/2/12 11:11 上午 * @date 2022/2/12 11:11 上午
*/ */
@Override @Override
@Async
public Result neighborhoodImport(ImportInfoFormDTO formDTO, MultipartFile file,Result<ImportTaskCommonResultDTO> importTask) { public Result neighborhoodImport(ImportInfoFormDTO formDTO, MultipartFile file,Result<ImportTaskCommonResultDTO> importTask) {
executorService.submit(() -> { // executorService.submit(() -> {
// importNeighbor(formDTO,file,importTask); // importNeighbor(formDTO,file,importTask);
log.info("neighborhoodImport thread start====="); log.info("neighborhoodImport thread start=====");
ExcelReader excelReader = null; ExcelReader excelReader = null;
@ -264,7 +266,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
} }
} }
log.info("neighborhoodImport thread end====="); log.info("neighborhoodImport thread end=====");
}); // });
return new Result<>(); return new Result<>();
} }

Loading…
Cancel
Save