| | |
| | | package com.vci.web.controller; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.portal.data.PLTabPage; |
| | | import com.vci.corba.portal.data.PLUILayout; |
| | |
| | | /** |
| | | * 导入UI上下文 |
| | | * @param file 上传的文件 |
| | | * @param isCovered 是否覆盖 |
| | | * @param selectBtm 选择导入到的业务类型 |
| | | * @return |
| | | */ |
| | | @PostMapping("/impUiContextData") |
| | | public BaseResult impUIContextData(MultipartFile file){try { |
| | | return uiManagerService.impUIContextData(file); |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | } |
| | | public BaseResult impUIContextData(MultipartFile file, boolean isCovered,String selectBtm){ |
| | | String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename()); |
| | | File file1 = new File(excelFileName); |
| | | try { |
| | | file.transferTo(new File(excelFileName)); |
| | | if (file != null) { |
| | | return uiManagerService.impUIContextData(file1, isCovered,selectBtm); |
| | | } else { |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"}); |
| | | } |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | }finally { |
| | | file1.delete(); |
| | | } |
| | | } |
| | | |
| | | /** |