Browse Source

测试async

dev
zxc 4 years ago
parent
commit
f5459c41d7
  1. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  2. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

@ -40,6 +40,7 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcNeighborHoodService; import com.epmet.service.IcNeighborHoodService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -132,9 +133,11 @@ public class IcNeighborHoodController {
* @date 2022/2/12 10:47 上午 * @date 2022/2/12 10:47 上午
*/ */
@PostMapping("neighborhoodimport") @PostMapping("neighborhoodimport")
@Transactional(rollbackFor = Exception.class)
public Result neighborhoodImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file, public Result neighborhoodImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file,
@RequestParam("orgId")String orgId, @RequestParam("orgId")String orgId,
@RequestParam("orgType")String orgType) throws IOException { @RequestParam("orgType")String orgType) throws IOException {
log.info("地址:" + file.getResource().getURI().getPath().toString());
ImportInfoFormDTO formDTO = new ImportInfoFormDTO(); ImportInfoFormDTO formDTO = new ImportInfoFormDTO();
formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setOrgType(orgType); formDTO.setOrgType(orgType);

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

@ -243,6 +243,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
try { try {
inputStream = file.getInputStream(); inputStream = file.getInputStream();
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage());
throw new EpmetException("读取文件失败"); throw new EpmetException("读取文件失败");
} }

Loading…
Cancel
Save