| | |
| | | @PreAuthorize("hasAuthority('manager:code:list')") |
| | | @GetMapping("/code/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(codeService.getById(id)); |
| | | return R.ok().add(codeService.getCacheById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:code:save')") |
| | |
| | | Date now = new Date(); Long userId = getLoginUserId(); |
| | | for (Map<String, Object> map : list) { |
| | | Code code = Cools.conver(map, Code.class); |
| | | if (null != codeService.selectByData(code.getData())) { |
| | | if (null != codeService.getCacheByData(code.getData())) { |
| | | continue; |
| | | } |
| | | code.setData(Utils.zeroFill(code.getData(), CommonConstant.QR_CODE_LEN)); |