| | |
| | | import com.project.common.utils.poi.ExcelUtil; |
| | | import com.project.system.domain.bo.editBo.SysCompanyBo; |
| | | import com.project.system.domain.bo.queryBo.SysCompanyQueryBo; |
| | | import com.project.system.domain.vo.SysCompanyResultVo; |
| | | import com.project.system.domain.vo.SysCompanyVo; |
| | | import com.project.system.service.ISysCompanyService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return util.exportExcel(null, "企业信息模板"); |
| | | } |
| | | |
| | | @ApiOperation(value = "导入活动指标") |
| | | @ApiImplicitParam(value = "上传文件", name = "file", dataType = "file", dataTypeClass = MultipartFile.class) |
| | | @PostMapping("/import") |
| | | public AjaxResult importList(@RequestParam MultipartFile file) throws Exception |
| | | @ApiOperation(value = "处理导入信息") |
| | | @Log(title = "导入企业信息处理" , businessType = BusinessType.OTHER) |
| | | @ApiImplicitParam(value = "企业信息", name = "file", dataType = "file", dataTypeClass = MultipartFile.class) |
| | | @PostMapping("/doImport") |
| | | public AjaxResult doImport(@RequestPart(value = "file") MultipartFile file) throws Exception |
| | | { |
| | | |
| | | ExcelUtil<SysCompanyVo> util = new ExcelUtil<>(SysCompanyVo.class); |
| | | List<SysCompanyVo> list = util.importExcel(file.getInputStream()); |
| | | return toAjax(iSysCompanyService.importList(list) ? 1 : 0); |
| | | return AjaxResult.success(iSysCompanyService.doImport(list)); |
| | | } |
| | | |
| | | @ApiOperation(value = "校验导入信息") |
| | | @Log(title = "导入企业信息校验" , businessType = BusinessType.OTHER) |
| | | @PostMapping("/checkImport") |
| | | public AjaxResult checkImport(@RequestBody SysCompanyResultVo resultVo) |
| | | { |
| | | return AjaxResult.success(iSysCompanyService.checkImport(resultVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存导入信息") |
| | | @Log(title = "导入企业信息保存" , businessType = BusinessType.IMPORT) |
| | | @PostMapping("/saveImport") |
| | | public AjaxResult saveImport(@RequestBody SysCompanyResultVo resultVo) |
| | | { |
| | | return toAjax(iSysCompanyService.saveImport(resultVo) ? 1 : 0); |
| | | } |
| | | |
| | | |
| | | } |