Skip to content

Commit

Permalink
Merge pull request #248 from Jzow/master
Browse files Browse the repository at this point in the history
Add sale retail purchase export new api and function
  • Loading branch information
Jzow committed Dec 1, 2023
2 parents e19ecd6 + c863aa4 commit d959e79
Show file tree
Hide file tree
Showing 29 changed files with 632 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.wansenai.service.receipt.ReceiptPurchaseService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.receipt.purchase.*;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down Expand Up @@ -133,4 +134,19 @@ public Response<String> deletePurchaseRefund(@PathVariable("ids") List<Long> ids
public Response<Page<PurchaseArrearsVO>> arrearsPageList(@RequestBody QueryPurchaseArrearsDTO arrearsDTO) {
return purchaseService.getPurchaseArrearsPage(arrearsDTO);
}

@GetMapping("/order/export")
public void exportOrderExcel(@ModelAttribute QueryPurchaseOrderDTO queryPurchaseOrderDTO, HttpServletResponse response) throws Exception {
purchaseService.exportPurchaseOrderExcel(queryPurchaseOrderDTO, response);
}

@GetMapping("/storage/export")
public void exportStorageExcel(@ModelAttribute QueryPurchaseStorageDTO queryPurchaseStorageDTO, HttpServletResponse response) throws Exception {
purchaseService.exportPurchaseStorageExcel(queryPurchaseStorageDTO, response);
}

@GetMapping("/refund/export")
public void exportRefundExcel(@ModelAttribute QueryPurchaseRefundDTO queryPurchaseRefundDTO, HttpServletResponse response) throws Exception {
purchaseService.exportPurchaseRefundExcel(queryPurchaseRefundDTO, response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,11 @@ public Response<String> refundUpdateStatus(@RequestParam("ids") List<Long> ids,

@GetMapping("/shipments/export")
public void exportShipmentsExcel(@ModelAttribute QueryShipmentsDTO queryShipmentsDTO, HttpServletResponse response) throws Exception {
var file = receiptRetailService.exportRetailShipmentsExcel(queryShipmentsDTO, response);
ExcelUtils.downloadExcel(file, "零售出库单", response);
receiptRetailService.exportRetailShipmentsExcel(queryShipmentsDTO, response);
}

@GetMapping("/refund/export")
public void exportRefundExcel(@ModelAttribute QueryRetailRefundDTO queryRetailRefundDTO, HttpServletResponse response) throws Exception {
var file = receiptRetailService.exportRetailRefundExcel(queryRetailRefundDTO, response);
ExcelUtils.downloadExcel(file, "零售退货单", response);
receiptRetailService.exportRetailRefundExcel(queryRetailRefundDTO, response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wansenai.dto.receipt.sale.*;
import com.wansenai.service.receipt.ReceiptRetailService;
import com.wansenai.service.receipt.ReceiptSaleService;
import com.wansenai.utils.response.Response;
import com.wansenai.vo.receipt.sale.*;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;
Expand Down Expand Up @@ -126,4 +126,19 @@ public Response<String> deleteRefund(@PathVariable("ids") List<Long> ids) {
public Response<Page<SaleArrearsVO>> arrearsPageList(@RequestBody QuerySaleArrearsDTO arrearsDTO) {
return receiptSaleService.getSaleArrearsPage(arrearsDTO);
}

@GetMapping("/order/export")
public void exportOrderExcel(@ModelAttribute QuerySaleOrderDTO querySaleOrderDTO, HttpServletResponse response) throws Exception {
receiptSaleService.exportSaleOrderExcel(querySaleOrderDTO, response);
}

@GetMapping("/shipments/export")
public void exportStorageExcel(@ModelAttribute QuerySaleShipmentsDTO querySaleShipmentsDTO, HttpServletResponse response) throws Exception {
receiptSaleService.exportSaleShipmentsExcel(querySaleShipmentsDTO, response);
}

@GetMapping("/refund/export")
public void exportRefundExcel(@ModelAttribute QuerySaleRefundDTO querySaleRefundDTO, HttpServletResponse response) throws Exception {
receiptSaleService.exportSaleRefundExcel(querySaleRefundDTO, response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import com.wansenai.utils.excel.ExcelExport;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -32,27 +33,37 @@ public class PurchaseOrderVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@ExcelExport(value = "供应商")
private String supplierName;

@ExcelExport(value = "单据编号")
private String receiptNumber;

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelExport(value = "单据日期")
private LocalDateTime receiptDate;

@ExcelExport(value = "商品信息")
private String productInfo;

@ExcelExport(value = "操作员")
private String operator;

@ExcelExport(value = "商品数量")
private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "金额合计")
private BigDecimal totalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "含税合计")
private BigDecimal taxRateTotalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "收取定金")
private BigDecimal deposit;

@ExcelExport(value = "状态", kv = "0-未审核;1-已审核;2-审核中;3-部分采购;4-完成采购;")
private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import com.wansenai.utils.excel.ExcelExport;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -32,33 +33,45 @@ public class PurchaseRefundVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@ExcelExport(value = "供应商")
private String supplierName;

@ExcelExport(value = "单据编号")
private String receiptNumber;

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelExport(value = "单据日期")
private LocalDateTime receiptDate;

@ExcelExport(value = "商品信息")
private String productInfo;

@ExcelExport(value = "操作员")
private String operator;

@ExcelExport(value = "商品数量")
private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "金额合计")
private BigDecimal totalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "含税合计")
private BigDecimal taxIncludedAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "待退金额")
private BigDecimal refundTotalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次退款")
private BigDecimal thisRefundAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次欠款")
private BigDecimal thisArrearsAmount;

@ExcelExport(value = "状态", kv = "0-未审核;1-已审核;2-审核中;3-部分采购;4-完成采购;")
private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import com.wansenai.utils.excel.ExcelExport;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -32,33 +33,45 @@ public class PurchaseStorageVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@ExcelExport(value = "供应商")
private String supplierName;

@ExcelExport(value = "单据编号")
private String receiptNumber;

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelExport(value = "单据日期")
private LocalDateTime receiptDate;

@ExcelExport(value = "商品信息")
private String productInfo;

@ExcelExport(value = "操作员")
private String operator;

@ExcelExport(value = "商品数量")
private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "金额合计")
private BigDecimal totalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "含税合计")
private BigDecimal taxIncludedAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "待付金额")
private BigDecimal totalPaymentAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次付款")
private BigDecimal thisPaymentAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次欠款")
private BigDecimal thisArrearsAmount;

@ExcelExport(value = "状态", kv = "0-未审核;1-已审核;2-审核中;3-部分采购;4-完成采购;")
private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import com.wansenai.utils.excel.ExcelExport;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -32,27 +33,37 @@ public class SaleOrderVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@ExcelExport(value = "客户")
private String customerName;

@ExcelExport(value = "单据编号")
private String receiptNumber;

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelExport(value = "单据日期")
private LocalDateTime receiptDate;

@ExcelExport(value = "商品信息")
private String productInfo;

@ExcelExport(value = "操作员")
private String operator;

@ExcelExport(value = "商品数量")
private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "金额合计")
private BigDecimal totalPrice;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "含税合计")
private BigDecimal taxRateTotalPrice;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "收取定金")
private BigDecimal deposit;

@ExcelExport(value = "状态", kv = "0-未审核;1-已审核;2-审核中;3-部分销售;4-完成销售;")
private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import com.wansenai.utils.excel.ExcelExport;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -32,33 +33,45 @@ public class SaleRefundVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@ExcelExport(value = "客户")
private String customerName;

@ExcelExport(value = "单据编号")
private String receiptNumber;

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelExport(value = "单据日期")
private LocalDateTime receiptDate;

@ExcelExport(value = "商品信息")
private String productInfo;

@ExcelExport(value = "操作员")
private String operator;

@ExcelExport(value = "商品数量")
private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "金额合计")
private BigDecimal totalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "含税合计")
private BigDecimal taxIncludedAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "待退金额")
private BigDecimal refundTotalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次退款")
private BigDecimal thisRefundAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次欠款")
private BigDecimal thisArrearsAmount;

@ExcelExport(value = "状态", kv = "0-未审核;1-已审核")
private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wansenai.bo.BigDecimalSerializerBO;
import com.wansenai.utils.excel.ExcelExport;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -32,33 +33,45 @@ public class SaleShipmentsVO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;

@ExcelExport(value = "客户")
private String customerName;

@ExcelExport(value = "单据编号")
private String receiptNumber;

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelExport(value = "单据日期")
private LocalDateTime receiptDate;

@ExcelExport(value = "商品信息")
private String productInfo;

@ExcelExport(value = "操作员")
private String operator;

@ExcelExport(value = "商品数量")
private Integer productNumber;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "金额合计")
private BigDecimal totalAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "含税合计")
private BigDecimal taxIncludedAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "待收金额")
private BigDecimal totalCollectAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次收款")
private BigDecimal thisCollectAmount;

@JsonSerialize(using = BigDecimalSerializerBO.class)
@ExcelExport(value = "本次欠款")
private BigDecimal thisArrearsAmount;

@ExcelExport(value = "状态", kv = "0-未审核;1-已审核")
private Integer status;
}
Loading

0 comments on commit d959e79

Please sign in to comment.