|
|
@@ -307,8 +307,12 @@ public class PosOrderQsOprateController extends BaseController {
|
|
|
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PosOrder> pageParam = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page, size);
|
|
|
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PosOrder> result = posOrderService.page(pageParam, wrapper);
|
|
|
Set<Long> mdIds = result.getRecords().stream().map(PosOrder::getMdId).filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
+ Set<Long> userIds=result.getRecords().stream().map(PosOrder::getUserId).filter(Objects::nonNull)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
Map<Integer, PosStore> storeMap = mdIds.isEmpty() ? Collections.emptyMap() :
|
|
|
posStoreService.listByIds(mdIds).stream().collect(Collectors.toMap(PosStore::getId, s -> s));
|
|
|
+ Map<Long, InfoUser> userMap = userIds.isEmpty() ? Collections.emptyMap() :
|
|
|
+ infoUserService.listByIds(mdIds).stream().collect(Collectors.toMap(InfoUser::getUserId, s -> s));
|
|
|
JSONArray arr=new JSONArray();
|
|
|
for (PosOrder order : result.getRecords()) {
|
|
|
// 自动序列化所有PosOrder字段,新增字段无需手动添加
|
|
|
@@ -332,7 +336,7 @@ public class PosOrderQsOprateController extends BaseController {
|
|
|
|
|
|
// 以下为非PosOrder字段或需要特殊处理的字段
|
|
|
org.put("store", storeMap.get(order.getMdId().intValue()));
|
|
|
-
|
|
|
+ org.put("user",userMap.get(order.getUserId()));
|
|
|
arr.add(org);
|
|
|
}
|
|
|
JSONObject org=new JSONObject();
|