diff --git a/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java b/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java index 90b5183..4547ba9 100644 --- a/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java +++ b/invoice/src/main/java/com/djy/invoice/controller/InvLinkInfoController.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.djy.core.http.HttpResult; import com.djy.invoice.dto.SendEmail; import com.djy.invoice.dto.SendEmailParams; +import com.djy.invoice.model.InvInvoiceInfo; import com.djy.invoice.model.InvLinkInfo; import com.djy.invoice.service.InvLinkInfoService; import io.swagger.v3.oas.annotations.Operation; @@ -57,6 +58,13 @@ public class InvLinkInfoController { } + @Operation(description = "获取链接下的发票") + @PostMapping("getLinkInvoice") + public HttpResult getLinkInvoice(InvLinkInfo info) { + List list = invLinkInfoService.getLinkInvoice(info); + return HttpResult.ok(list); + } + // @Operation(description = "查询发票") // @PostMapping("getInvoice") // public HttpResult getInvoice(InvLinkInfo info) { diff --git a/invoice/src/main/java/com/djy/invoice/service/InvLinkInfoService.java b/invoice/src/main/java/com/djy/invoice/service/InvLinkInfoService.java index 036d58b..da77b6b 100644 --- a/invoice/src/main/java/com/djy/invoice/service/InvLinkInfoService.java +++ b/invoice/src/main/java/com/djy/invoice/service/InvLinkInfoService.java @@ -3,8 +3,11 @@ package com.djy.invoice.service; import com.djy.core.http.HttpResult; +import com.djy.invoice.model.InvInvoiceInfo; import com.djy.invoice.model.InvLinkInfo; +import java.util.List; + public interface InvLinkInfoService { @@ -17,4 +20,6 @@ public interface InvLinkInfoService { HttpResult uploadInvoice(InvLinkInfo info); HttpResult getInvoice(InvLinkInfo info); + + List getLinkInvoice(InvLinkInfo info); } diff --git a/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java b/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java index b14371f..7f274e1 100644 --- a/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java +++ b/invoice/src/main/java/com/djy/invoice/service/impl/InvLinkInfoServiceImpl.java @@ -1259,6 +1259,20 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService { } + @Transactional + public List getLinkInvoice(InvLinkInfo info){ + + List invoices = new ArrayList<>(); + + List list = invInvoiceSplitMapper.getIdsBylinkdId(info.getGID()); + for(String str : list){ + InvInvoiceInfo invoice = invInvoiceInfoMapper.getByGid(str); + invoices.add(invoice); + } + + return invoices; + } + public static String getCmdName() { return cmdName; }