/selectSpecificInvoiced 回显电子发票详情信息接口已完成
This commit is contained in:
parent
180b3427ea
commit
a68f6b0a23
@ -2,10 +2,7 @@ package com.xhpc.invoice.api;
|
||||
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.invoice.domain.InvoiceOrdersResponse;
|
||||
import com.xhpc.invoice.domain.InvoiceTitleResponse;
|
||||
import com.xhpc.invoice.domain.InvoicedOrdersRequest;
|
||||
import com.xhpc.invoice.domain.TitleResponse;
|
||||
import com.xhpc.invoice.domain.*;
|
||||
import com.xhpc.invoice.service.XhpcInvoiceService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -25,12 +22,36 @@ public class XhpcInvoiceApiController extends BaseController {
|
||||
@Resource
|
||||
XhpcInvoiceService xhpcInvoiceService;
|
||||
|
||||
/**
|
||||
* 查询用户开发票的历史记录
|
||||
*
|
||||
* @author WH
|
||||
* @date 2021/12/27 12:23
|
||||
* @since version-1.0
|
||||
*/
|
||||
@PostMapping(value = "/selectInvoiceHistoryRecords")
|
||||
public AjaxResult selectInvoiceHistoryRecords(@RequestBody InvoicedOrdersRequest invoicedOrdersRequest) {
|
||||
|
||||
return AjaxResult.success(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回显已经处理的开的的电子发票的详情信息
|
||||
*
|
||||
* @param invoiceId 要回显的发票id
|
||||
* @return 返回包含了指定数据的AjaxResult
|
||||
* @author WH
|
||||
* @date 2021/12/27 13:11
|
||||
* @since version-1.0
|
||||
*/
|
||||
@GetMapping(value = "/selectSpecificInvoiced")
|
||||
public AjaxResult selectSpecificInvoiced(@RequestParam Long invoiceId) {
|
||||
|
||||
SpecificInvoicedResponse specificInvoicedResponse = xhpcInvoiceService.selectInvoiceHistoryRecords(invoiceId);
|
||||
return AjaxResult.success(specificInvoicedResponse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户id,用户类型,要查询的当前时间的年月日,查询该用户3个月内可以开发票的订单
|
||||
*
|
||||
@ -46,6 +67,8 @@ public class XhpcInvoiceApiController extends BaseController {
|
||||
}
|
||||
InvoiceOrdersResponse invoiceOrdersResponse = xhpcInvoiceService.selectInvoicedOrders(invoicedOrdersRequest);
|
||||
return AjaxResult.success(invoiceOrdersResponse);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
package com.xhpc.invoice.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* /selectSpecificInvoiced接口的返回数据封装类
|
||||
*
|
||||
* @author WH
|
||||
* @date 2021/12/27 12:43
|
||||
* @since version-1.0
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class SpecificInvoicedResponse {
|
||||
|
||||
@JsonProperty("creatorTime")
|
||||
private String creatorTime;
|
||||
@JsonProperty("receiveEmail")
|
||||
private String receiveEmail;
|
||||
@JsonProperty("titleType")
|
||||
private Integer titleType;
|
||||
@JsonProperty("titleContent")
|
||||
private String titleContent;
|
||||
@JsonProperty("dutyNumber")
|
||||
private String dutyNumber;
|
||||
@JsonProperty("invoiceContent")
|
||||
private String invoiceContent;
|
||||
@JsonProperty("invoiceMoney")
|
||||
private BigDecimal invoiceMoney;
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
@JsonProperty("financeNotes")
|
||||
private String financeNotes;
|
||||
@JsonProperty("historyOrders")
|
||||
private HistoryOrdersDTO historyOrders;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class HistoryOrdersDTO {
|
||||
|
||||
@JsonProperty("totalItems")
|
||||
private Integer totalItems;
|
||||
@JsonProperty("historyOrdersData")
|
||||
private List<HistoryOrdersDataDTO> historyOrdersData;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class HistoryOrdersDataDTO {
|
||||
|
||||
@JsonProperty("historyOrderId")
|
||||
private Long historyOrderId;
|
||||
@JsonProperty("actPrice")
|
||||
private BigDecimal actPrice;
|
||||
@JsonProperty("historySerialNumber")
|
||||
private String historySerialNumber;
|
||||
@JsonProperty("orderCreateTime")
|
||||
private String orderCreateTime;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -145,7 +145,7 @@ public class XhpcInvoice implements Serializable {
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否已经阅读
|
||||
* 是否已经阅读(默认0表示没有阅读,1表示已经阅读)
|
||||
*/
|
||||
private Integer isRead;
|
||||
|
||||
|
||||
@ -88,4 +88,15 @@ public interface XhpcInvoiceService {
|
||||
*/
|
||||
InvoiceOrdersResponse selectInvoicedOrders(InvoicedOrdersRequest invoicedOrdersRequest);
|
||||
|
||||
/**
|
||||
* 根据发票id,查询回显发票所需要的数据
|
||||
*
|
||||
* @param invoiceId 发票id
|
||||
* @return 数据封装对象
|
||||
* @author WH
|
||||
* @date 2021/12/27 13:12
|
||||
* @since version-1.0
|
||||
*/
|
||||
SpecificInvoicedResponse selectInvoiceHistoryRecords(Long invoiceId);
|
||||
|
||||
}
|
||||
|
||||
@ -206,6 +206,49 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
return invoiceOrdersResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据发票id,查询回显发票所需要的数据
|
||||
*
|
||||
* @param invoiceId 发票id
|
||||
* @return 数据封装对象
|
||||
* @author WH
|
||||
* @date 2021/12/27 13:12
|
||||
* @since version-1.0
|
||||
*/
|
||||
@Override
|
||||
public SpecificInvoicedResponse selectInvoiceHistoryRecords(Long invoiceId) {
|
||||
|
||||
//对拷发票部分数据
|
||||
XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(invoiceId);
|
||||
SpecificInvoicedResponse specificInvoicedResponse = new SpecificInvoicedResponse();
|
||||
specificInvoicedResponse.setCreatorTime(DateUtils.parseDateToStr(xhpcInvoice.getCreateTime()));
|
||||
specificInvoicedResponse.setReceiveEmail(xhpcInvoice.getReceiveEmail());
|
||||
specificInvoicedResponse.setTitleType(xhpcInvoice.getTitleType());
|
||||
specificInvoicedResponse.setTitleContent(xhpcInvoice.getTitleContent());
|
||||
specificInvoicedResponse.setDutyNumber(xhpcInvoice.getDutyNumber());
|
||||
specificInvoicedResponse.setInvoiceContent(xhpcInvoice.getInvoiceContent());
|
||||
specificInvoicedResponse.setInvoiceMoney(xhpcInvoice.getInvoiceMoney());
|
||||
specificInvoicedResponse.setStatus(xhpcInvoice.getStatus());
|
||||
specificInvoicedResponse.setFinanceNotes(xhpcInvoice.getFinanceNotes());
|
||||
//查询关联订单
|
||||
List<XhpcInvoiceMapHistoryOrder> historyOrdersList = xhpcInvoiceMapHistoryOrderMapper.findOrdersByInvoiceId(xhpcInvoice.getInvoiceId());
|
||||
//封装关联订单数据
|
||||
ArrayList<SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO> historyOrdersDataDTOS = new ArrayList<>();
|
||||
for (XhpcInvoiceMapHistoryOrder xhpcInvoiceMapHistoryOrder : historyOrdersList) {
|
||||
SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO historyOrdersDataDTO = new SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO();
|
||||
historyOrdersDataDTO.setHistoryOrderId(xhpcInvoiceMapHistoryOrder.getHistoryOrderId());
|
||||
historyOrdersDataDTO.setActPrice(xhpcInvoiceMapHistoryOrder.getHistoryActPrice());
|
||||
historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHisotrySerialNumber());
|
||||
historyOrdersDataDTO.setOrderCreateTime(DateUtils.parseDateToStr(xhpcInvoiceMapHistoryOrder.getCreateTime()));
|
||||
historyOrdersDataDTOS.add(historyOrdersDataDTO);
|
||||
}
|
||||
SpecificInvoicedResponse.HistoryOrdersDTO historyOrdersDTO = new SpecificInvoicedResponse.HistoryOrdersDTO();
|
||||
historyOrdersDTO.setHistoryOrdersData(historyOrdersDataDTOS);
|
||||
historyOrdersDTO.setTotalItems(historyOrdersList.size());
|
||||
specificInvoicedResponse.setHistoryOrders(historyOrdersDTO);
|
||||
return specificInvoicedResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过发票id查找对应的发票数据
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user