feat: 通过发票获取单据

dev_drug_dmyh250207
chenhc 1 week ago
parent 7e6bdee92e
commit 7c3e59be83

@ -124,5 +124,12 @@ public class IoOrderInvoiceService extends ServiceImpl<IoOrderInvoiceMapper, IoO
return ioOrderInvoiceMapper.filterByInvoiceCode(orderInvoiceRequest);
}
public String selectBillNoByInvoiceEncode(String code) {
List<IoOrderInvoiceEntity> invoiceEncode = ioOrderInvoiceMapper.selectList(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode", code));
if (CollUtil.isNotEmpty(invoiceEncode)) {
return invoiceEncode.get(0).getInvoiceEncode();
}
return null;
}
}

@ -103,6 +103,9 @@ public class IoOrderServiceImpl implements IoOrderService {
private HttpOkClient httpOkClient;
@Resource
private BasicCorpDao basicCorpDao;
@Resource
IoOrderInvoiceService ioOrderInvoiceService;
@Override
public List<IoOrderEntity> findAll(FilterOrderRequest filterOrderRequest) {
QueryWrapper<IoOrderEntity> queryWrapper = new QueryWrapper<IoOrderEntity>()
@ -134,7 +137,14 @@ public class IoOrderServiceImpl implements IoOrderService {
@Override
public IoOrderEntity findByBillNo(String billNO) {
return orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", billNO));
IoOrderEntity orderEntity = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", billNO));
if (orderEntity == null) {
String billNoByInvoiceEncode = ioOrderInvoiceService.selectBillNoByInvoiceEncode(billNO);
if (billNoByInvoiceEncode != null) {
orderEntity = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", billNoByInvoiceEncode));
}
}
return orderEntity;
}
@Override

Loading…
Cancel
Save