mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-07-25 23:27:07 +08:00
feat(warehouseReceipt): 添加根据 ID 列表获取仓库单据信息的功能
- 在 WarehouseReceiptController 中添加了新的接口 getByIdList - 在 WarehouseReceiptService 中实现了根据 ID 列表获取仓库单据信息的方法 - 新增的方法可以批量获取仓库单据信息,提高数据查询效率
This commit is contained in:
@@ -16,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/warehouseReceipt")
|
||||
@SysLog(module = "仓库单据管理")
|
||||
@@ -45,6 +47,11 @@ public class WarehouseReceiptController {
|
||||
return this.service.getById(request.getId());
|
||||
}
|
||||
|
||||
@PostMapping("/getByIdList")
|
||||
public List<WarehouseReceiptDto> getByIdList(@RequestBody IdRequest request) {
|
||||
return this.service.getByIdList(request.getIds());
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
public Page<WarehouseReceiptListDto> list(@RequestBody CommonQuery request) {
|
||||
return this.service.list(request);
|
||||
|
||||
@@ -1329,4 +1329,20 @@ from (
|
||||
|
||||
return new PageImpl<>(ans, PageRequest.of(0, request.getPageSize()), count);
|
||||
}
|
||||
|
||||
public List<WarehouseReceiptDto> getByIdList(List<String> ids) {
|
||||
|
||||
|
||||
List<WarehouseReceiptEntity> allById = this.repository.findAllById(ids);
|
||||
|
||||
List<WarehouseReceiptDto> result = new ArrayList<>();
|
||||
for (WarehouseReceiptEntity entity : allById) {
|
||||
WarehouseReceiptDto dto = mapper.toDto(entity);
|
||||
result.add(dto);
|
||||
}
|
||||
return result;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user