| | |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.Warehouse; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreas; |
| | | import com.vincent.rsf.server.manager.entity.vo.WarehouseVO; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasItemService; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasService; |
| | | import com.vincent.rsf.server.manager.service.WarehouseService; |
| | | import com.vincent.rsf.server.manager.utils.buildPageRowsUtils; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api(tags = "仓库") |
| | | @RestController |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Warehouse, BaseParam> pageParam = new PageParam<>(baseParam, Warehouse.class); |
| | | return R.ok().add(warehouseService.page(pageParam, pageParam.buildWrapper(true))); |
| | | PageParam<Warehouse, BaseParam> page = warehouseService.page(pageParam, pageParam.buildWrapper(true)); |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouse:list')") |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouse:list')") |
| | | @PostMapping("/warehouse/list2") |
| | | public R list2(@RequestBody Map<String, Object> map) { |
| | | List<Warehouse> warehouseList = warehouseService.list(new LambdaQueryWrapper<Warehouse>().select(Warehouse::getId,Warehouse::getName)); |
| | | |
| | | List<WarehouseVO> warehouseList2 = warehouseList.stream().map(warehouse -> { |
| | | WarehouseVO vo = new WarehouseVO(); |
| | | vo.setId(warehouse.getId()); |
| | | vo.setName(warehouse.getName()); |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | return R.ok().add(warehouseList2); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouse:list')") |
| | | @PostMapping({"/warehouse/many/{ids}", "/warehouses/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(warehouseService.listByIds(Arrays.asList(ids))); |