| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/7/14 |
| | | * @description: 盘点单导出 |
| | | * @version 1.0 |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:check:list')") |
| | | @PostMapping("/checkItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | List<WkOrderItem> orders = new ArrayList<>(); |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | orders = checkOrderItemService.list(new LambdaQueryWrapper<WkOrderItem>().in(WkOrderItem::getId, map.get("ids"))); |
| | | } else { |
| | | orders = checkOrderItemService.list(); |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(orders, WkOrderItem.class), response); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 下载模板 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/18 08:17 |
| | | */ |
| | | @PostMapping("/checkItem/template/download") |
| | | @ApiOperation("下载盘点单模板") |
| | | @PreAuthorize("hasAuthority('manager:check:update')") |
| | | public void downloadTemplate(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | CheckOrderTemplate template = ExcelUtil.mockData(CheckOrderTemplate.class); |
| | | List<CheckOrderTemplate> list = Arrays.asList(template); |
| | | ExcelUtil.build(ExcelUtil.create(list, CheckOrderTemplate.class, true), response); |
| | | } |
| | | |
| | | } |