| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | |
| | | * 获取维修物品二级结构 |
| | | */ |
| | | @ApiOperation(value = "获取维修物品二级结构") |
| | | @PostMapping(value = "/getItemList") |
| | | public R<List<TItemTypeVO>> getItemList() { |
| | | List<TItemTypeVO> itemTypes = itemTypeService.getItemList(); |
| | | @GetMapping(value = "/getItemList") |
| | | public R<List<TItemTypeVO>> getItemList(@RequestParam(required = false) String itemName) { |
| | | List<TItemTypeVO> itemTypes = itemTypeService.getItemList(itemName); |
| | | List<TItem> items = itemService.list(); |
| | | itemTypes.forEach(itemType -> { |
| | | itemType.setItemList(items.stream().filter(item -> itemType.getId().equals(item.getTypeId())).collect(Collectors.toList())); |