| | |
| | | import com.boying.util.FileUtil; |
| | | import com.boying.util.NumberToCN; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.apache.commons.io.FilenameUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/ticketblack") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/ticketblack" , name = "黑名单表接口" ) |
| | | public class TicketBlackController { |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @PostMapping("findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, TicketBlack ticket){ |
| | | QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(StringUtils.isNotBlank(ticket.getCarNo()),TicketBlack::getCarNo,ticket.getCarNo()) |
| | | .like(StringUtils.isNotBlank(ticket.getCarNo()),TicketBlack::getCarNo,ticket.getCarNo()) |
| | | .eq(ticket.getIsActive() != null,TicketBlack::getIsActive,ticket.getIsActive()) |
| | | .orderByDesc(TicketBlack::getCreateTime); |
| | | return R.ok(ticketBlackService.page(page, wrapper)); |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增黑名单" , description = "新增黑名单" ) |
| | | public Object save(TicketBlack ticket) throws IOException{ |
| | | QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | */ |
| | | @ApiOperation(value = "通过id查询", notes = "通过id查询") |
| | | @GetMapping("/{id}" ) |
| | | @Operation(summary = "通过id查询" , description = "通过id查询" ) |
| | | public R getById(@PathVariable("id" ) Integer id) { |
| | | TicketBlack byId = ticketBlackService.getById(id); |
| | | return R.ok(byId); |
| | |
| | | |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除黑名单" , description = "删除黑名单" ) |
| | | public Object delete(Long id){ |
| | | TicketBlack ticket =ticketBlackService.getById(id); |
| | | ticketBlackService.saveOrUpdate(ticket); |
| | | return R.ok("操作成功"); |
| | | if(ticket!=null){ |
| | | if(ticket.getViolationCount() >0 ){ |
| | | return R.failed("请先解决违章"); |
| | | } |
| | | ticketBlackService.removeById(ticket); |
| | | return R.ok("操作成功"); |
| | | } |
| | | return R.failed("未找到该车"); |
| | | } |
| | | |
| | | @PostMapping("/updateById") |
| | | @Operation(summary = "更新黑名单" , description = "更新黑名单" ) |
| | | public Object updateById(TicketBlack ticket){ |
| | | return R.ok( ticketBlackService.updateById(ticket)); |
| | | } |