| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/t-vin-management") |
| | |
| | | public R<List<Long>> getVinIdsByAppUserId(@RequestParam Long appUserId) { |
| | | return R.ok(service.getVinIdsByAppUserId(appUserId)); |
| | | } |
| | | |
| | | /** |
| | | * 内部接口:根据VIN记录ID批量查询(订单侧列表/详情回填VIN码、车牌号、手机号使用) |
| | | */ |
| | | @PostMapping("/inner/list-by-ids") |
| | | public R<List<TVinManagement>> listByIds(@RequestBody List<Long> ids) { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<Long> distinctIds = ids.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList()); |
| | | return R.ok(distinctIds.isEmpty() ? new ArrayList<>() : service.listByIds(distinctIds)); |
| | | } |
| | | } |