| | |
| | | import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
| | | import cn.hutool.core.io.resource.ClassPathResource; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.OrderNumConstants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | |
| | | return AjaxResult.success(dataGeneratorService.pageList(query)); |
| | | } |
| | | |
| | | @Log(title = "数据生成-数据生成删除", businessType = BusinessType.DELETE) |
| | | @ApiOperation( value = "数据生成删除") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<String> deleteById(@RequestParam("id") Long id) { |
| | | dataGeneratorService.removeById(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Log(title = "数据生成-数据覆盖", businessType = BusinessType.UPDATE) |
| | | @ApiOperation( value = "数据覆盖") |
| | | @GetMapping(value = "/dataCoverage") |
| | | public AjaxResult<String> dataCoverage(@RequestParam(value = "id") Long id) { |
| | |
| | | ClassPathResource classPathResource = new ClassPathResource("template/销售数据列表.xls"); |
| | | TemplateExportParams params = new TemplateExportParams(classPathResource.getPath()); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, result); |
| | | |
| | | Sheet firstSheet = workbook.getSheetAt(0); |
| | | // List<CellRangeAddress> mergedRegions = firstSheet.getMergedRegions(); |
| | | // List<Integer> removeMergedRegionIndexList = new ArrayList<>(); |
| | | // 处理数据不显示 |
| | | // for (int i = 0; i < mergedRegions.size(); i++) { |
| | | // CellRangeAddress mergedRegion = mergedRegions.get(i); |
| | | // int firstColumn = mergedRegion.getFirstColumn(); |
| | | // int lastColumn = mergedRegion.getLastColumn(); |
| | | // int firstRow = mergedRegion.getFirstRow(); |
| | | // if(firstRow >= 2 && firstColumn >= 3 && lastColumn <= 5){ |
| | | // removeMergedRegionIndexList.add(i); |
| | | // } |
| | | // } |
| | | // firstSheet.removeMergedRegions(removeMergedRegionIndexList); |
| | | |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |