| | |
| | | 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); |
| | | } |
| | | @PostMapping("/impUIContextData") |
| | | public BaseResult impUIContextData(MultipartFile file, boolean isCovered,String selectBtm){ |
| | | File file1 = null; |
| | | try { |
| | | //覆盖,不需要传file |
| | | if(!isCovered){ |
| | | String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename()); |
| | | file1 = new File(excelFileName); |
| | | file.transferTo(new File(excelFileName)); |
| | | } |
| | | if (file != null || isCovered) { |
| | | 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 { |
| | | if(!isCovered){ |
| | | file1.delete(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 业务类型下拉查询 |
| | | * @param baseQueryObject selectBtmType 选择的源对象,带分页信息 |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @GetMapping( "/getBtmDatasByPage") |
| | | @VciBusinessLog(operateName = "业务类型下拉查询") |
| | | public BaseResult getBtmDatasByPage(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(uiManagerService.getBtmDatasByPage(baseQueryObject)); |
| | | }catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "业务类型下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * UI定义下拉查询(templateType为UI定义时的选择对象下拉查询) |
| | | * @param baseQueryObject selectBtmType 选择的源对象,带分页信息 |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @GetMapping( "/getUILayoutDatasByPage") |
| | | @VciBusinessLog(operateName = "UI定义下拉查询") |
| | | public BaseResult getUILayoutDatasByPage(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(uiManagerService.getUILayoutDatasByPage(baseQueryObject)); |
| | | }catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "UI定义下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 选择模板下拉查询 |
| | | * @param baseQueryObject |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @GetMapping( "/getPortalVIDatasByPage") |
| | | @VciBusinessLog(operateName = "选择模板下拉查询") |
| | | public BaseResult getPortalVIDatasByPage(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(uiManagerService.getPortalVIDatasByPage(baseQueryObject)); |
| | | }catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "选择模板下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询模板下拉查询 |
| | | * @param baseQueryObject |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @GetMapping( "/getQTInfoDatasByPage") |
| | | @VciBusinessLog(operateName = "查询模板下拉查询") |
| | | public BaseResult getQTInfoDatasByPage(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(uiManagerService.getQTInfoDatasByPage(baseQueryObject)); |
| | | }catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "查询模板下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | |
| | | //页面设计下配置按钮相关接口 |
| | | /** |
| | | * 获取页签区域按钮配置信息 |