mirror of https://github.com/jeecgboot/jeecg-boot
Feature: Add SAV refunds (separate sheet) to invoice detail export
parent
476bbe47e2
commit
3aa3601303
|
@ -55,6 +55,8 @@ public class InvoiceController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISavRefundService iSavRefundService;
|
private ISavRefundService iSavRefundService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ISavRefundWithDetailService savRefundWithDetailService;
|
||||||
|
@Autowired
|
||||||
private IExchangeRatesService iExchangeRatesService;
|
private IExchangeRatesService iExchangeRatesService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IQuartzJobService quartzJobService;
|
private IQuartzJobService quartzJobService;
|
||||||
|
@ -98,14 +100,19 @@ public class InvoiceController {
|
||||||
String warehouseString = String.join(",", warehouses);
|
String warehouseString = String.join(",", warehouses);
|
||||||
QueryWrapper<PlatformOrder> queryWrapper = QueryGenerator.initQueryWrapper(platformOrder, req.getParameterMap());
|
QueryWrapper<PlatformOrder> queryWrapper = QueryGenerator.initQueryWrapper(platformOrder, req.getParameterMap());
|
||||||
LambdaQueryWrapper<PlatformOrder> lambdaQueryWrapper = queryWrapper.lambda();
|
LambdaQueryWrapper<PlatformOrder> lambdaQueryWrapper = queryWrapper.lambda();
|
||||||
if(type.equals("shipping"))
|
switch (type) {
|
||||||
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, OrderStatus.Shipped.getCode());
|
case "shipping":
|
||||||
else if(type.equals("pre-shipping"))
|
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, OrderStatus.Shipped.getCode());
|
||||||
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, Arrays.asList(OrderStatus.Pending.getCode(), OrderStatus.Preparing.getCode()));
|
break;
|
||||||
else if(type.equals("all"))
|
case "pre-shipping":
|
||||||
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, Arrays.asList(OrderStatus.Pending.getCode(), OrderStatus.Preparing.getCode(), OrderStatus.Shipped.getCode()));
|
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, Arrays.asList(OrderStatus.Pending.getCode(), OrderStatus.Preparing.getCode()));
|
||||||
else
|
break;
|
||||||
return Result.error("Error 404 : page not found.");
|
case "all":
|
||||||
|
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, Arrays.asList(OrderStatus.Pending.getCode(), OrderStatus.Preparing.getCode(), OrderStatus.Shipped.getCode()));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return Result.error("Error 404 : page not found.");
|
||||||
|
}
|
||||||
lambdaQueryWrapper.isNull(PlatformOrder::getShippingInvoiceNumber);
|
lambdaQueryWrapper.isNull(PlatformOrder::getShippingInvoiceNumber);
|
||||||
Page<PlatformOrder> page = new Page<>(pageNo, pageSize);
|
Page<PlatformOrder> page = new Page<>(pageNo, pageSize);
|
||||||
IPage<PlatformOrder> pageList;
|
IPage<PlatformOrder> pageList;
|
||||||
|
@ -262,6 +269,7 @@ public class InvoiceController {
|
||||||
} else {
|
} else {
|
||||||
log.info("Specified shop IDs : " + param.shopIDs());
|
log.info("Specified shop IDs : " + param.shopIDs());
|
||||||
lambdaQueryWrapper.in(PlatformOrder::getShopId, param.shopIDs());
|
lambdaQueryWrapper.in(PlatformOrder::getShopId, param.shopIDs());
|
||||||
|
lambdaQueryWrapper.isNull(PlatformOrder::getShippingInvoiceNumber);
|
||||||
if(param.getErpStatuses() != null) {
|
if(param.getErpStatuses() != null) {
|
||||||
log.info("Specified erpStatuses : " + param.getErpStatuses());
|
log.info("Specified erpStatuses : " + param.getErpStatuses());
|
||||||
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, param.getErpStatuses());
|
lambdaQueryWrapper.in(PlatformOrder::getErpStatus, param.getErpStatuses());
|
||||||
|
@ -294,6 +302,7 @@ public class InvoiceController {
|
||||||
} else {
|
} else {
|
||||||
log.info("Specified shop IDs : " + param.shopIDs());
|
log.info("Specified shop IDs : " + param.shopIDs());
|
||||||
lambdaQueryWrapper.in(PlatformOrder::getShopId, param.shopIDs());
|
lambdaQueryWrapper.in(PlatformOrder::getShopId, param.shopIDs());
|
||||||
|
lambdaQueryWrapper.isNull(PlatformOrder::getShippingInvoiceNumber);
|
||||||
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT id FROM platform_order po WHERE po.erp_status = '3' AND po.shipping_time between '" + param.getStart() + "' AND '" + param.getEnd() + "'" );
|
lambdaQueryWrapper.inSql(PlatformOrder::getId, "SELECT id FROM platform_order po WHERE po.erp_status = '3' AND po.shipping_time between '" + param.getStart() + "' AND '" + param.getEnd() + "'" );
|
||||||
// on récupère les résultats de la requete
|
// on récupère les résultats de la requete
|
||||||
List<PlatformOrder> orderID = platformOrderMapper.selectList(lambdaQueryWrapper);
|
List<PlatformOrder> orderID = platformOrderMapper.selectList(lambdaQueryWrapper);
|
||||||
|
@ -324,8 +333,9 @@ public class InvoiceController {
|
||||||
|
|
||||||
@GetMapping(value = "/downloadInvoiceDetail")
|
@GetMapping(value = "/downloadInvoiceDetail")
|
||||||
public byte[] downloadInvoiceDetail(@RequestParam("invoiceNumber") String invoiceNumber, @RequestParam("invoiceEntity") String invoiceEntity) throws IOException {
|
public byte[] downloadInvoiceDetail(@RequestParam("invoiceNumber") String invoiceNumber, @RequestParam("invoiceEntity") String invoiceEntity) throws IOException {
|
||||||
List<FactureDetail> res = shippingInvoiceService.getInvoiceDetail(invoiceNumber);
|
List<FactureDetail> factureDetails = shippingInvoiceService.getInvoiceDetail(invoiceNumber);
|
||||||
return shippingInvoiceService.exportToExcel(res, invoiceNumber, invoiceEntity);
|
List<SavRefundWithDetail> refunds = savRefundWithDetailService.getRefundsByInvoiceNumber(invoiceNumber);
|
||||||
|
return shippingInvoiceService.exportToExcel(factureDetails, refunds, invoiceNumber, invoiceEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/breakdown/byShop")
|
@GetMapping(value = "/breakdown/byShop")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.jeecg.modules.business.domain.excel;
|
package org.jeecg.modules.business.domain.excel;
|
||||||
|
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import lombok.Data;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
|
||||||
|
@ -12,32 +12,35 @@ import java.nio.file.Path;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide operation that manipulate Excel sheet driven by cursor.
|
* Provide operation that manipulates Excel sheet driven by cursor.
|
||||||
* The cursor's position is in the (0, 0) at the beginning.
|
* The cursor's position is in the (0, 0) at the beginning.
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class SheetManager {
|
public class SheetManager {
|
||||||
|
|
||||||
private final Workbook workbook;
|
private final Workbook workbook;
|
||||||
|
|
||||||
private final Sheet sheet;
|
private final Sheet detailSheet;
|
||||||
|
|
||||||
private int row;
|
private final Sheet savSheet;
|
||||||
|
|
||||||
private int col;
|
private Sheet currentSheet;
|
||||||
|
|
||||||
|
private int currentRow;
|
||||||
|
|
||||||
|
private int currentCol;
|
||||||
|
|
||||||
private int max_col;
|
private int max_col;
|
||||||
|
|
||||||
private SheetManager(Workbook workbook, Sheet sheet) {
|
private SheetManager(Workbook workbook, Sheet detailSheet, Sheet savSheet) {
|
||||||
this.workbook = workbook;
|
this.workbook = workbook;
|
||||||
this.sheet = sheet;
|
this.detailSheet = detailSheet;
|
||||||
row = 0;
|
this.savSheet = savSheet;
|
||||||
col = 0;
|
this.currentRow = 0;
|
||||||
|
this.currentCol = 0;
|
||||||
max_col = 10;
|
max_col = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Workbook getWorkbook() {
|
|
||||||
return workbook;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a manager for the first worksheet of an empty ".xlsx" Excel file.
|
* Create a manager for the first worksheet of an empty ".xlsx" Excel file.
|
||||||
* The created worksheet named "sheet1".
|
* The created worksheet named "sheet1".
|
||||||
|
@ -45,47 +48,44 @@ public class SheetManager {
|
||||||
* @return the sheetManager instance.
|
* @return the sheetManager instance.
|
||||||
*/
|
*/
|
||||||
public static SheetManager createXLSX() {
|
public static SheetManager createXLSX() {
|
||||||
return createXLSX("sheet1");
|
return createXLSX("Détails", "SAV");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as {@code createXLSX()}, with customer sheet name.
|
* Same as {@code createXLSX()}, with customer sheet name.
|
||||||
*
|
*
|
||||||
* @param name the customer sheet name
|
* @param detailSheetName Details sheet name
|
||||||
|
* @param savSheetName SAV sheet name
|
||||||
* @return the sheetManager object.
|
* @return the sheetManager object.
|
||||||
*/
|
*/
|
||||||
public static SheetManager createXLSX(String name) {
|
public static SheetManager createXLSX(String detailSheetName, String savSheetName) {
|
||||||
Workbook workbook = new XSSFWorkbook();
|
Workbook workbook = new XSSFWorkbook();
|
||||||
Sheet sheet = workbook.createSheet(name);
|
Sheet detailSheet = workbook.createSheet(detailSheetName);
|
||||||
return new SheetManager(workbook, sheet);
|
Sheet savSheet = workbook.createSheet(savSheetName);
|
||||||
|
return new SheetManager(workbook, detailSheet, savSheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void startDetailsSheet() {
|
||||||
* Create a sheet manager for a sheet of a ".xls" Excel workbook.
|
this.currentSheet = detailSheet;
|
||||||
*
|
}
|
||||||
* @param path path of the workbook.
|
|
||||||
* @param sheetIndex index of the sheet, begin from 0
|
public void startSavSheet() {
|
||||||
* @return the sheet manager object
|
this.currentSheet = savSheet;
|
||||||
* @throws IOException any error while opening the workbook.
|
this.currentRow = 0;
|
||||||
*/
|
this.currentCol = 0;
|
||||||
public static SheetManager readXLS(Path path, int sheetIndex) throws IOException {
|
|
||||||
FileInputStream fis = new FileInputStream(path.toFile());
|
|
||||||
Workbook workbook = new HSSFWorkbook(fis);
|
|
||||||
return new SheetManager(workbook, workbook.getSheetAt(sheetIndex));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as {@code readXLS} but for ".xlsx" Excel workbook.
|
* Same as {@code readXLS} but for ".xlsx" Excel workbook.
|
||||||
*
|
*
|
||||||
* @param path path of the workbook.
|
* @param path path of the workbook.
|
||||||
* @param sheetIndex index of the sheet, begin from 0
|
|
||||||
* @return the sheet manager object
|
* @return the sheet manager object
|
||||||
* @throws IOException any error while opening the workbook.
|
* @throws IOException any error while opening the workbook.
|
||||||
*/
|
*/
|
||||||
public static SheetManager readXLSX(Path path, int sheetIndex) throws IOException {
|
public static SheetManager readXLSX(Path path) throws IOException {
|
||||||
FileInputStream fis = new FileInputStream(path.toFile());
|
FileInputStream fis = new FileInputStream(path.toFile());
|
||||||
Workbook workbook = new XSSFWorkbook(fis);
|
Workbook workbook = new XSSFWorkbook(fis);
|
||||||
return new SheetManager(workbook, workbook.getSheetAt(sheetIndex));
|
return new SheetManager(workbook, workbook.getSheetAt(0), workbook.getSheetAt(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,12 +96,12 @@ public class SheetManager {
|
||||||
* @param col col index of the location
|
* @param col col index of the location
|
||||||
*/
|
*/
|
||||||
public void go(int row, int col) {
|
public void go(int row, int col) {
|
||||||
this.row = row;
|
this.currentRow = row;
|
||||||
_moveCol(col);
|
_moveCol(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void moveRow(int row) {
|
public void moveRow(int row) {
|
||||||
this.row = row;
|
this.currentRow = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void moveCol(int col) {
|
public void moveCol(int col) {
|
||||||
|
@ -109,31 +109,31 @@ public class SheetManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int row() {
|
public int row() {
|
||||||
return row;
|
return currentRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int col() {
|
public int col() {
|
||||||
return col;
|
return currentCol;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move cursor to the bottom cell.
|
* Move the cursor to the bottom cell.
|
||||||
*/
|
*/
|
||||||
public void nextRow() {
|
public void nextRow() {
|
||||||
this.row += 1;
|
this.currentRow += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move cursor to the left cell.
|
* Move the cursor to the left cell.
|
||||||
*/
|
*/
|
||||||
public void nextCol() {
|
public void nextCol() {
|
||||||
_moveCol(this.col + 1);
|
_moveCol(this.currentCol + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write a value to the cell pointed by cursor.
|
* Write a value to the cell pointed by cursor.
|
||||||
*
|
*
|
||||||
* @param value the value to be wrote, if value is null then we will change the cell to a Blank cell.
|
* @param value the value to be written, if value is null then we will change the cell to a Blank cell.
|
||||||
*/
|
*/
|
||||||
public void write(String value) {
|
public void write(String value) {
|
||||||
cell().setCellValue(value);
|
cell().setCellValue(value);
|
||||||
|
@ -142,7 +142,7 @@ public class SheetManager {
|
||||||
/**
|
/**
|
||||||
* Write a value to the cell pointed by cursor.
|
* Write a value to the cell pointed by cursor.
|
||||||
*
|
*
|
||||||
* @param value the value to be wrote, if value is null then we will change the cell to a Blank cell.
|
* @param value the value to be written, if value is null then we will change the cell to a Blank cell.
|
||||||
*/
|
*/
|
||||||
public void write(int value) {
|
public void write(int value) {
|
||||||
cell().setCellValue(value);
|
cell().setCellValue(value);
|
||||||
|
@ -151,7 +151,7 @@ public class SheetManager {
|
||||||
/**
|
/**
|
||||||
* Write a value to the cell pointed by cursor.
|
* Write a value to the cell pointed by cursor.
|
||||||
*
|
*
|
||||||
* @param value the value to be wrote, if value is null then we will change the cell to a Blank cell.
|
* @param value the value to be written, if value is null then we will change the cell to a Blank cell.
|
||||||
*/
|
*/
|
||||||
public void write(BigDecimal value) {
|
public void write(BigDecimal value) {
|
||||||
cell().setCellValue(value.doubleValue());
|
cell().setCellValue(value.doubleValue());
|
||||||
|
@ -160,7 +160,7 @@ public class SheetManager {
|
||||||
/**
|
/**
|
||||||
* Write a value to the cell pointed by cursor.
|
* Write a value to the cell pointed by cursor.
|
||||||
*
|
*
|
||||||
* @param value the value to be wrote
|
* @param value the value to be written
|
||||||
*/
|
*/
|
||||||
public void write(Date value) {
|
public void write(Date value) {
|
||||||
cell().setCellValue(value);
|
cell().setCellValue(value);
|
||||||
|
@ -202,7 +202,8 @@ public class SheetManager {
|
||||||
public void export(Path target) throws IOException {
|
public void export(Path target) throws IOException {
|
||||||
/* adjust all cols' width before export */
|
/* adjust all cols' width before export */
|
||||||
for (int i = 0; i < max_col; i++) {
|
for (int i = 0; i < max_col; i++) {
|
||||||
sheet.autoSizeColumn(i);
|
detailSheet.autoSizeColumn(i);
|
||||||
|
savSheet.autoSizeColumn(i);
|
||||||
}
|
}
|
||||||
FileOutputStream fos = new FileOutputStream(target.toFile());
|
FileOutputStream fos = new FileOutputStream(target.toFile());
|
||||||
workbook.write(fos);
|
workbook.write(fos);
|
||||||
|
@ -211,13 +212,13 @@ public class SheetManager {
|
||||||
|
|
||||||
private Cell cell() {
|
private Cell cell() {
|
||||||
|
|
||||||
Row row = sheet.getRow(this.row);
|
Row row = currentSheet.getRow(this.currentRow);
|
||||||
if (row == null) {
|
if (row == null) {
|
||||||
row = sheet.createRow(this.row);
|
row = currentSheet.createRow(this.currentRow);
|
||||||
}
|
}
|
||||||
Cell cell = row.getCell(col);
|
Cell cell = row.getCell(currentCol);
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
cell = row.createCell(col);
|
cell = row.createCell(currentCol);
|
||||||
}
|
}
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
@ -226,7 +227,7 @@ public class SheetManager {
|
||||||
if (dst > max_col) {
|
if (dst > max_col) {
|
||||||
max_col = dst + 5;
|
max_col = dst + 5;
|
||||||
}
|
}
|
||||||
col = dst;
|
currentCol = dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.jeecg.modules.business.domain.shippingInvoice.CompleteInvoice;
|
||||||
import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoice;
|
import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoice;
|
||||||
import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoiceFactory;
|
import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoiceFactory;
|
||||||
import org.jeecg.modules.business.entity.PlatformOrder;
|
import org.jeecg.modules.business.entity.PlatformOrder;
|
||||||
|
import org.jeecg.modules.business.entity.SavRefundWithDetail;
|
||||||
import org.jeecg.modules.business.mapper.*;
|
import org.jeecg.modules.business.mapper.*;
|
||||||
import org.jeecg.modules.business.vo.*;
|
import org.jeecg.modules.business.vo.*;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -23,6 +24,7 @@ import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -85,7 +87,7 @@ public class PlatformOrderShippingInvoiceService {
|
||||||
@Value("${jeecg.path.shippingInvoiceDetailDir}")
|
@Value("${jeecg.path.shippingInvoiceDetailDir}")
|
||||||
private String INVOICE_DETAIL_DIR;
|
private String INVOICE_DETAIL_DIR;
|
||||||
|
|
||||||
private final static String[] titles = {
|
private final static String[] DETAILS_TITLES = {
|
||||||
"Boutique",
|
"Boutique",
|
||||||
"N° de Mabang",
|
"N° de Mabang",
|
||||||
"N° de commande",
|
"N° de commande",
|
||||||
|
@ -107,6 +109,16 @@ public class PlatformOrderShippingInvoiceService {
|
||||||
"TVA",
|
"TVA",
|
||||||
"N° de facture"
|
"N° de facture"
|
||||||
};
|
};
|
||||||
|
private final static String[] SAV_TITLES = {
|
||||||
|
"Boutique",
|
||||||
|
"N° de Mabang",
|
||||||
|
"N° de commande",
|
||||||
|
"Date du remboursement",
|
||||||
|
"Montant d'achat remboursé",
|
||||||
|
"Montant de livraison remboursé",
|
||||||
|
"Montant total du remboursement",
|
||||||
|
"N° de facture"
|
||||||
|
};
|
||||||
|
|
||||||
public Period getValidPeriod(List<String> shopIDs) {
|
public Period getValidPeriod(List<String> shopIDs) {
|
||||||
Date begin = platformOrderMapper.findEarliestUninvoicedPlatformOrder(shopIDs);
|
Date begin = platformOrderMapper.findEarliestUninvoicedPlatformOrder(shopIDs);
|
||||||
|
@ -318,9 +330,10 @@ public class PlatformOrderShippingInvoiceService {
|
||||||
return factureDetailMapper.selectList(queryWrapper);
|
return factureDetailMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] exportToExcel(List<FactureDetail> details, String invoiceNumber, String invoiceEntity) throws IOException {
|
public byte[] exportToExcel(List<FactureDetail> details, List<SavRefundWithDetail> refunds, String invoiceNumber, String invoiceEntity) throws IOException {
|
||||||
SheetManager sheetManager = SheetManager.createXLSX();
|
SheetManager sheetManager = SheetManager.createXLSX();
|
||||||
for (String title : titles) {
|
sheetManager.startDetailsSheet();
|
||||||
|
for (String title : DETAILS_TITLES) {
|
||||||
sheetManager.write(title);
|
sheetManager.write(title);
|
||||||
sheetManager.nextCol();
|
sheetManager.nextCol();
|
||||||
}
|
}
|
||||||
|
@ -370,6 +383,37 @@ public class PlatformOrderShippingInvoiceService {
|
||||||
sheetManager.moveCol(0);
|
sheetManager.moveCol(0);
|
||||||
sheetManager.nextRow();
|
sheetManager.nextRow();
|
||||||
}
|
}
|
||||||
|
sheetManager.startSavSheet();
|
||||||
|
for (String title : SAV_TITLES) {
|
||||||
|
sheetManager.write(title);
|
||||||
|
sheetManager.nextCol();
|
||||||
|
}
|
||||||
|
sheetManager.moveCol(0);
|
||||||
|
sheetManager.nextRow();
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
for (SavRefundWithDetail refund : refunds) {
|
||||||
|
sheetManager.write(refund.getShopName());
|
||||||
|
sheetManager.nextCol();
|
||||||
|
sheetManager.write(refund.getMabangId());
|
||||||
|
sheetManager.nextCol();
|
||||||
|
sheetManager.write(refund.getPlatformOrderNumber());
|
||||||
|
sheetManager.nextCol();
|
||||||
|
sheetManager.write(sdf.format(refund.getRefundDate()));
|
||||||
|
sheetManager.nextCol();
|
||||||
|
sheetManager.write(refund.getPurchaseRefundAmount());
|
||||||
|
sheetManager.nextCol();
|
||||||
|
sheetManager.write(refund.getShippingFee()
|
||||||
|
.add(refund.getFretFee())
|
||||||
|
.add(refund.getVat())
|
||||||
|
.add(refund.getServiceFee()));
|
||||||
|
sheetManager.nextCol();
|
||||||
|
sheetManager.write(refund.getTotalRefundAmount());
|
||||||
|
sheetManager.nextCol();
|
||||||
|
sheetManager.write(refund.getInvoiceNumber());
|
||||||
|
sheetManager.moveCol(0);
|
||||||
|
sheetManager.nextRow();
|
||||||
|
}
|
||||||
|
|
||||||
Path target = Paths.get(INVOICE_DETAIL_DIR, "Détail_calcul_de_facture_" + invoiceNumber + "_(" + invoiceEntity + ").xlsx");
|
Path target = Paths.get(INVOICE_DETAIL_DIR, "Détail_calcul_de_facture_" + invoiceNumber + "_(" + invoiceEntity + ").xlsx");
|
||||||
int i = 2;
|
int i = 2;
|
||||||
|
|
Loading…
Reference in New Issue