| | |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入record") |
| | | public R<IPage<Record>> list(Record record, Query query) { |
| | | record.setStorage("1"); |
| | | IPage<Record> pages = recordService.page(Condition.getPage(query), Condition.getQueryWrapper(record)); |
| | | return R.data(pages); |
| | | } |
| | |
| | | @ApiOperation(value = "新增", notes = "传入record") |
| | | public R save(@Valid @RequestBody Record record) { |
| | | String cardid = record.getCardid(); |
| | | Map map = recordService.selectIn(cardid); |
| | | String type = record.getPtype(); |
| | | Map map = recordService.selectIn(cardid,type); |
| | | if (map != null) { |
| | | String id = map.get("id").toString(); |
| | | recordService.removeByIds(Func.toLongList(id)); |
| | |
| | | @ApiOperation(value = "新增", notes = "传入record") |
| | | public R rocordsave(@Valid @RequestBody Record record) { |
| | | String cardid = record.getCardid(); |
| | | Map map = recordService.selectIn(cardid); |
| | | String type = record.getPtype(); |
| | | Map map = recordService.selectIn(cardid,type); |
| | | if (map != null) { |
| | | record.setStorage("0"); |
| | | record.setPermitime(new Date()); |
| | |
| | | } else { |
| | | record.setStorage("0"); |
| | | record.setType("2"); |
| | | record.setPtype("2"); |
| | | record.setPermitime(new Date()); |
| | | recordService.save(record); |
| | | } |
| | |
| | | |
| | | |
| | | @PostMapping("/selectIn") |
| | | public R selectIn(String cardid) { |
| | | Map map = recordService.selectIn(cardid); |
| | | public R selectIn(String cardid,String type) { |
| | | Map map = recordService.selectIn(cardid,type); |
| | | return R.data(map); |
| | | } |
| | | } |