Authored by LUOXC

add query

@@ -21,6 +21,8 @@ public class TradeBillsReq extends PageRequestBO{ @@ -21,6 +21,8 @@ public class TradeBillsReq extends PageRequestBO{
21 private Integer id; 21 private Integer id;
22 22
23 private Long orderCode; 23 private Long orderCode;
  24 +
  25 + private Long orderCode2;
24 26
25 private Integer uid; 27 private Integer uid;
26 28
@@ -31,7 +31,14 @@ @@ -31,7 +31,14 @@
31 income_outcome=1 31 income_outcome=1
32 and deal_status != 1 32 and deal_status != 1
33 <if test="billsTradeReq.orderCode != null"> 33 <if test="billsTradeReq.orderCode != null">
34 - and (order_code = #{billsTradeReq.orderCode} or paid_order_code = #{billsTradeReq.orderCode}) 34 + and (
  35 + order_code = #{billsTradeReq.orderCode}
  36 + or paid_order_code = #{billsTradeReq.orderCode}
  37 + <if test="billsTradeReq.orderCode2 != null">
  38 + or order_code = #{billsTradeReq.orderCode2}
  39 + or paid_order_code = #{billsTradeReq.orderCode2}
  40 + </if>
  41 + )
35 </if> 42 </if>
36 <if test="billsTradeReq.uid != null"> 43 <if test="billsTradeReq.uid != null">
37 and uid = #{billsTradeReq.uid} 44 and uid = #{billsTradeReq.uid}
@@ -73,7 +73,9 @@ public class TradeBillsServiceImpl implements ITradeBillsService { @@ -73,7 +73,9 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
73 private TradeBillsMapper tradeBillsMapper; 73 private TradeBillsMapper tradeBillsMapper;
74 74
75 @Autowired 75 @Autowired
76 - private StoredSellerMapper storedSellerMapper; 76 + private BuyerOrderGoodsMapper buyerOrderGoodsMapper;
  77 + @Autowired
  78 + private SellerOrderMapper sellerOrderMapper;
77 79
78 @Autowired 80 @Autowired
79 private SellerWalletDetailMapper sellerWalletDetailMapper; 81 private SellerWalletDetailMapper sellerWalletDetailMapper;
@@ -235,6 +237,17 @@ public class TradeBillsServiceImpl implements ITradeBillsService { @@ -235,6 +237,17 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
235 req.setPayErrorCode(null); 237 req.setPayErrorCode(null);
236 } 238 }
237 239
  240 + if (Objects.nonNull(req.getOrderCode())){
  241 + req.setOrderCode2(Optional.of(req.getOrderCode())
  242 + .map(e->buyerOrderGoodsMapper.selectByOrderCodeOne(e.toString()))
  243 + .map(e->e.getSkup())
  244 + .map(e->sellerOrderMapper.selectBySkups(Lists.newArrayList(e)))
  245 + .filter(CollectionUtils::isNotEmpty)
  246 + .map(e->e.get(0).getOrderCode())
  247 + .map(Long::valueOf)
  248 + .orElse(null));
  249 + }
  250 +
238 251
239 int total = tradeBillsMapper.selectCountByCondition(req); 252 int total = tradeBillsMapper.selectCountByCondition(req);
240 if (total == 0) { 253 if (total == 0) {