|
|
@@ -6,6 +6,7 @@ import com.fdkankan.common.annotation.Dict;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.InvoiceType;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.common.response.Result;
|
|
|
import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
|
import com.fdkankan.manage.entity.Invoice;
|
|
|
@@ -15,6 +16,7 @@ import com.fdkankan.manage.service.IInvoiceRegisterService;
|
|
|
import com.fdkankan.manage.service.IInvoiceService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.manage.vo.InvoicePageParamVO;
|
|
|
+import com.fdkankan.manage.vo.InvoiceRegisterDetailVO;
|
|
|
import com.fdkankan.manage.vo.InvoiceVO;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
@@ -101,4 +103,24 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
|
|
|
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResultData getInvoiceRegisterDetail(Long id) {
|
|
|
+
|
|
|
+ Invoice invoice = this.getById(id);
|
|
|
+ if(Objects.isNull(invoice)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_9001);
|
|
|
+ }
|
|
|
+ InvoiceRegister invoiceRegister = invoiceRegisterService.getByInvoiceId(id);
|
|
|
+ if(Objects.isNull(invoice)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_9004);
|
|
|
+ }
|
|
|
+ return ResultData.ok(InvoiceRegisterDetailVO.builder()
|
|
|
+ .type(invoice.getType())
|
|
|
+ .email(invoice.getEmailAddress())
|
|
|
+ .invoiceNum(invoiceRegister.getInvoiceNum())
|
|
|
+ .invoiceUrl(invoiceRegister.getInvoiceUrl())
|
|
|
+ .shipNum(invoiceRegister.getShipNum())
|
|
|
+ .build());
|
|
|
+ }
|
|
|
}
|