Commit 4555e8a8 by 程裕兵

feat:list cashier record by ids

parent 327d50de
......@@ -146,13 +146,25 @@ public class StudioCashierServiceImpl implements StudioCashierService {
@Override
public List<StudioCashierRecordVO> listByIds(List<Long> ids) {
List<StudioCashierRecord> records = studioCashierRecordRpService.getListByIds(ids);
return CashierConvert.convertList(records);
List<String> payNos = Optional.ofNullable(records).orElse(new ArrayList<>(1)).stream()
.filter(e -> BrandCashierTransTypeEnum.PAY.getCode().equals(e.getTransType()))
.map(StudioCashierRecord::getTransNo)
.collect(Collectors.toList());
Map<String, List<StudioCashierRecord>> payNoRefundMap = studioCashierRecordRpService.mapByRelatedTransNos(
payNos);
return CashierConvert.convertList(records, payNoRefundMap);
}
@Override
public List<StudioCashierRecordVO> listByTransNo(List<String> transNos) {
List<StudioCashierRecord> records = studioCashierRecordRpService.listByTransNo(transNos);
return CashierConvert.convertList(records);
List<String> payNos = records.stream()
.filter(e -> BrandCashierTransTypeEnum.PAY.getCode().equals(e.getTransType()))
.map(StudioCashierRecord::getTransNo)
.collect(Collectors.toList());
Map<String, List<StudioCashierRecord>> payNoRefundMap = studioCashierRecordRpService.mapByRelatedTransNos(
payNos);
return CashierConvert.convertList(records, payNoRefundMap);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment