Commit 995eb79d authored by 技术总监-万宁's avatar 技术总监-万宁

查询发票feign接口修改接口参数

parent 923255a7
......@@ -129,7 +129,7 @@ public interface OrderFeignService {
* @return 查询结果
*/
@RequestMapping(value = "/order/feign/settle/account/invoice/find", method = RequestMethod.POST)
Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(@RequestBody @Valid OrderIdFeignVO feignVO);
Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(@RequestBody @Valid OrderNoFeignVO feignVO);
/**
* 支付服务 - 订单服务回调
......
package com.ssy.lingxi.order.api.model.vo.request;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 订单编号作为接口参数
* @author 万宁
* @version 2.0.0
* @date 2021-09-11
*/
public class OrderNoFeignVO implements Serializable {
private static final long serialVersionUID = -6498276378097949032L;
/**
* 订单编号
*/
@NotBlank(message = "订单编号不能为空")
private String orderNo;
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
}
......@@ -11,6 +11,25 @@ import java.io.Serializable;
public class OrderSettleAccountInvoiceFeignDetailVO implements Serializable {
private static final long serialVersionUID = -8343727065425750388L;
public OrderSettleAccountInvoiceFeignDetailVO() {
}
public OrderSettleAccountInvoiceFeignDetailVO(Long orderInvoiceId, Long orderId, String orderNo, Long invoiceId, Integer invoiceKind, Integer invoiceType, String title, String taxNo, String bank, String account, String address, String phone, Boolean defaultInvoice) {
this.orderInvoiceId = orderInvoiceId;
this.orderId = orderId;
this.orderNo = orderNo;
this.invoiceId = invoiceId;
this.invoiceKind = invoiceKind;
this.invoiceType = invoiceType;
this.title = title;
this.taxNo = taxNo;
this.bank = bank;
this.account = account;
this.address = address;
this.phone = phone;
this.defaultInvoice = defaultInvoice;
}
/**
* 订单服务生成的发票Id
*/
......@@ -22,6 +41,11 @@ public class OrderSettleAccountInvoiceFeignDetailVO implements Serializable {
private Long orderId;
/**
* 订单编号
*/
private String orderNo;
/**
* 发票Id
*/
private Long invoiceId;
......@@ -87,6 +111,14 @@ public class OrderSettleAccountInvoiceFeignDetailVO implements Serializable {
this.orderId = orderId;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public Long getInvoiceId() {
return invoiceId;
}
......
......@@ -161,7 +161,7 @@ public class OrderFeignController {
* @return 查询结果
*/
@RequestMapping(value = "/settle/account/invoice/find", method = RequestMethod.POST)
public Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(@RequestBody @Valid OrderIdFeignVO feignVO) {
public Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(@RequestBody @Valid OrderNoFeignVO feignVO) {
return orderFeignService.findSettleAccountInvoiceDetail(feignVO);
}
......
......@@ -109,7 +109,7 @@ public interface IOrderFeignService {
* @param feignVO 接口参数
* @return 查询结果
*/
Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(OrderIdFeignVO feignVO);
Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(OrderNoFeignVO feignVO);
/**
* 支付服务 - 订单服务回调
......
......@@ -390,28 +390,13 @@ public class OrderFeignServiceImpl implements IOrderFeignService {
* @return 查询结果
*/
@Override
public Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(OrderIdFeignVO feignVO) {
public Wrapper<OrderSettleAccountInvoiceFeignDetailVO> findSettleAccountInvoiceDetail(OrderNoFeignVO feignVO) {
QOrderInvoiceDO qOrderInvoice = QOrderInvoiceDO.orderInvoiceDO;
OrderInvoiceDO orderInvoice = jpaQueryFactory.select(qOrderInvoice).from(qOrderInvoice).where(qOrderInvoice.order.id.eq(feignVO.getOrderId())).fetchFirst();
if(orderInvoice == null) {
return Wrapper.success(null);
}
OrderSettleAccountInvoiceFeignDetailVO detailVO = new OrderSettleAccountInvoiceFeignDetailVO();
detailVO.setOrderInvoiceId(orderInvoice.getId());
detailVO.setOrderId(feignVO.getOrderId());
detailVO.setInvoiceId(orderInvoice.getInvoiceId());
detailVO.setInvoiceKind(orderInvoice.getInvoiceKind());
detailVO.setInvoiceType(orderInvoice.getInvoiceType());
detailVO.setTitle(orderInvoice.getTitle());
detailVO.setTaxNo(orderInvoice.getTaxNo());
detailVO.setBank(orderInvoice.getBank());
detailVO.setAccount(orderInvoice.getAccount());
detailVO.setAddress(orderInvoice.getAddress());
detailVO.setPhone(orderInvoice.getPhone());
detailVO.setDefaultInvoice(orderInvoice.getDefaultInvoice());
return Wrapper.success(detailVO);
QOrderDO qOrder = QOrderDO.orderDO;
return Wrapper.success(jpaQueryFactory.select(Projections.constructor(OrderSettleAccountInvoiceFeignDetailVO.class, qOrderInvoice.id, qOrder.id, qOrder.orderNo, qOrderInvoice.invoiceId, qOrderInvoice.invoiceKind, qOrderInvoice.invoiceType, qOrderInvoice.title, qOrderInvoice.taxNo, qOrderInvoice.bank, qOrderInvoice.account, qOrderInvoice.address, qOrderInvoice.phone, qOrderInvoice.defaultInvoice))
.from(qOrderInvoice)
.leftJoin(qOrder).on(qOrderInvoice.order.id.eq(qOrder.id))
.where(qOrder.orderNo.eq(feignVO.getOrderNo())).fetchFirst());
}
/**
......
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