| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.dto.ClonePortalVIDTOList; |
| | | import com.vci.dto.DeletePortalVIDTOList; |
| | | import com.vci.dto.OsBtmTypeDTO; |
| | | import com.vci.dto.PortalVIDTO; |
| | | import com.vci.pagemodel.KeyValue; |
| | | import com.vci.pagemodel.PortalVIVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.enumpck.ItemDblEnum; |
| | | import com.vci.web.enumpck.ItemTypeEnum; |
| | | import com.vci.web.service.OsPortalVIServiceI; |
| | | import com.vci.web.service.WebBtmIOServiceI; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 公式控制器 |
| | | * 表单/表格控制器 |
| | | * @author weidy |
| | | * @date 2022-2-11 |
| | | */ |
| | | @VciBusinessLog(modelName="表单/表格控制器",notStore=true) |
| | | @RestController |
| | | @RequestMapping("/portalVIController") |
| | | public class WebPortalVIController { |
| | |
| | | |
| | | } |
| | | /** |
| | | * 业务类型删除 |
| | | * 表单/table删除 |
| | | * btmTypeDTO 业务类型对象 |
| | | * @return 删除结果 |
| | | */ |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 业务类型删除 |
| | | * 表单/table删除 |
| | | * btmTypeDTO 业务类型对象 |
| | | * @return 删除结果 |
| | | */ |
| | |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 表单/table克隆 |
| | | * @param portalVIDTOList clong对象 |
| | | * @return |
| | | */ |
| | | @PostMapping("/clone") |
| | | @VciBusinessLog(operateName = "克隆表单/表格") |
| | |
| | | /** |
| | | * 导出数据库的表信息到excel |
| | | * @param response 响应对象 |
| | | * @param btmTypeIds 业务类型的编号,用逗号分割 |
| | | * @param ids 业务类型的编号,用逗号分割 |
| | | */ |
| | | @PostMapping("/exportExcel") |
| | | @VciBusinessLog(operateName = "导出表单/表格到excel中") |
| | | public void exportExcel(String btmTypeIds,HttpServletResponse response){ |
| | | String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(btmTypeIds)); |
| | | public void exportExcel(String ids,HttpServletResponse response){ |
| | | String excelFileName = portalVIServiceI.exportToExcel(VciBaseUtil.str2List(ids)); |
| | | try { |
| | | ControllerUtil.writeFileToResponse(response,excelFileName); |
| | | } catch (IOException e) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出数据库的表信息到excel |
| | | * @param file 上传的文件 |
| | | */ |
| | | @PostMapping("/importData") |
| | | @VciBusinessLog(operateName = "导入表单/表格") |
| | | public BaseResult importData(MultipartFile file){ |
| | | 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 portalVIServiceI.importData(file1); |
| | | } 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(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取属性字段类型 |
| | | */ |