| | |
| | | * @return 属性的显示对象 |
| | | */ |
| | | @GetMapping("/gridAttribute") |
| | | @VciUnCheckRight |
| | | @VciBusinessLog(operateName = "属性列表") |
| | | public BaseResult<OsAttributeVO> gridAttribute(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(attributeService.gridAttribute(baseQueryObject)); |
| | |
| | | */ |
| | | @PutMapping( "/updateAttribute") |
| | | @VciBusinessLog(operateName = "修改属性") |
| | | @VciUnCheckRight |
| | | public BaseResult updateAttribute(@RequestBody OsAttributeDTO osAttributeDTO) { |
| | | try { |
| | | return attributeService.updateAttribute(osAttributeDTO) ? BaseResult.success("属性修改成功!"):BaseResult.fail("属性修改失败!"); |
| | |
| | | @VciBusinessLog(operateName = "导出属性") |
| | | public void exportAttributes(String exportFileName,String attrNames, HttpServletResponse response){ |
| | | try { |
| | | String excelPath = attributeService.exportAttributes(exportFileName,attrNames); |
| | | String excelPath = attributeService.exportAttributes(exportFileName,attrNames,false); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "导出枚举时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/importAttributes") |
| | | @VciUnCheckRight |
| | | @VciBusinessLog(operateName = "导入属性") |
| | | public BaseResult importAttributes(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 attributeService.importAttributes(file1); |
| | | return attributeService.importAttributes(file1,false); |
| | | } else { |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"}); |
| | | } |