ling li
1 year ago
62 changed files with 2707 additions and 261 deletions
@ -0,0 +1,295 @@ |
|||||
|
package com.ruoyi.sales.domain.exportDto; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.ruoyi.common.core.domain.BaseEntity; |
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
|
||||
|
/** |
||||
|
* 销售对账对象 sales_account_reconciliation |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2023-02-03 |
||||
|
*/ |
||||
|
public class SalesAccountReconciliationDto extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 销售物料id */ |
||||
|
@ExcelProperty("销售物料id") |
||||
|
private String salesFinishId; |
||||
|
|
||||
|
/** 发货通知单号 */ |
||||
|
@ExcelProperty("发货通知单号") |
||||
|
private String noticeOrderNumber; |
||||
|
|
||||
|
/** 发货日期 */ |
||||
|
@ExcelProperty("发货日期") |
||||
|
private String deliveryDate; |
||||
|
|
||||
|
/** 订单号码 */ |
||||
|
@ExcelProperty("订单号码") |
||||
|
private String salesOrderNumber; |
||||
|
|
||||
|
/** 客户代码 */ |
||||
|
@ExcelProperty("客户代码") |
||||
|
private String enterpriseCode; |
||||
|
|
||||
|
/** 客户名称 */ |
||||
|
@ExcelProperty("客户名称") |
||||
|
private String enterpriseName; |
||||
|
|
||||
|
/** 联系人 */ |
||||
|
@ExcelProperty("联系人") |
||||
|
private String customerContact; |
||||
|
|
||||
|
/** 成品代码 */ |
||||
|
@ExcelProperty("成品代码") |
||||
|
private String finishProductCode; |
||||
|
|
||||
|
/** 成品名称 */ |
||||
|
@ExcelProperty("成品名称") |
||||
|
private String finishProductName; |
||||
|
|
||||
|
/** 规格型号 */ |
||||
|
@ExcelProperty("规格型号") |
||||
|
private String specificationModel; |
||||
|
|
||||
|
/** 客户料号 */ |
||||
|
@ExcelProperty("客户料号") |
||||
|
private String customerNumber; |
||||
|
|
||||
|
/** 币别 */ |
||||
|
@ExcelProperty("币别") |
||||
|
private String commonCurrency; |
||||
|
|
||||
|
/** 单价 */ |
||||
|
@ExcelProperty("单价") |
||||
|
private String processPrice; |
||||
|
|
||||
|
/** 数量 */ |
||||
|
@ExcelProperty("数量") |
||||
|
private String productQuantity; |
||||
|
|
||||
|
/** 金额 */ |
||||
|
@ExcelProperty("金额") |
||||
|
private String amountMoney; |
||||
|
|
||||
|
/** 客户使用否 */ |
||||
|
@ExcelProperty("客户使用否") |
||||
|
private String customerUseOrNot; |
||||
|
|
||||
|
/** 客户使用数量 */ |
||||
|
@ExcelProperty("客户使用数量") |
||||
|
private String customerUseQuantity; |
||||
|
|
||||
|
/** 客户使用备注说明 */ |
||||
|
@ExcelProperty("客户使用备注说明") |
||||
|
private String customerUseRemarks; |
||||
|
|
||||
|
/** 对账否 */ |
||||
|
@ExcelProperty("对账否") |
||||
|
private String accountReconciliationOrNot; |
||||
|
|
||||
|
/** 对账人 */ |
||||
|
@ExcelProperty("对账人") |
||||
|
private String accountReconciliationPerson; |
||||
|
|
||||
|
/** 对账时间 */ |
||||
|
@ExcelProperty("对账时间") |
||||
|
private String accountReconciliationTime; |
||||
|
|
||||
|
public String getSalesFinishId() { |
||||
|
return salesFinishId; |
||||
|
} |
||||
|
|
||||
|
public void setSalesFinishId(String salesFinishId) { |
||||
|
this.salesFinishId = salesFinishId; |
||||
|
} |
||||
|
|
||||
|
public String getNoticeOrderNumber() { |
||||
|
return noticeOrderNumber; |
||||
|
} |
||||
|
|
||||
|
public void setNoticeOrderNumber(String noticeOrderNumber) { |
||||
|
this.noticeOrderNumber = noticeOrderNumber; |
||||
|
} |
||||
|
|
||||
|
public String getDeliveryDate() { |
||||
|
return deliveryDate; |
||||
|
} |
||||
|
|
||||
|
public void setDeliveryDate(String deliveryDate) { |
||||
|
this.deliveryDate = deliveryDate; |
||||
|
} |
||||
|
|
||||
|
public String getSalesOrderNumber() { |
||||
|
return salesOrderNumber; |
||||
|
} |
||||
|
|
||||
|
public void setSalesOrderNumber(String salesOrderNumber) { |
||||
|
this.salesOrderNumber = salesOrderNumber; |
||||
|
} |
||||
|
|
||||
|
public String getEnterpriseCode() { |
||||
|
return enterpriseCode; |
||||
|
} |
||||
|
|
||||
|
public void setEnterpriseCode(String enterpriseCode) { |
||||
|
this.enterpriseCode = enterpriseCode; |
||||
|
} |
||||
|
|
||||
|
public String getEnterpriseName() { |
||||
|
return enterpriseName; |
||||
|
} |
||||
|
|
||||
|
public void setEnterpriseName(String enterpriseName) { |
||||
|
this.enterpriseName = enterpriseName; |
||||
|
} |
||||
|
|
||||
|
public String getCustomerContact() { |
||||
|
return customerContact; |
||||
|
} |
||||
|
|
||||
|
public void setCustomerContact(String customerContact) { |
||||
|
this.customerContact = customerContact; |
||||
|
} |
||||
|
|
||||
|
public String getFinishProductCode() { |
||||
|
return finishProductCode; |
||||
|
} |
||||
|
|
||||
|
public void setFinishProductCode(String finishProductCode) { |
||||
|
this.finishProductCode = finishProductCode; |
||||
|
} |
||||
|
|
||||
|
public String getFinishProductName() { |
||||
|
return finishProductName; |
||||
|
} |
||||
|
|
||||
|
public void setFinishProductName(String finishProductName) { |
||||
|
this.finishProductName = finishProductName; |
||||
|
} |
||||
|
|
||||
|
public String getSpecificationModel() { |
||||
|
return specificationModel; |
||||
|
} |
||||
|
|
||||
|
public void setSpecificationModel(String specificationModel) { |
||||
|
this.specificationModel = specificationModel; |
||||
|
} |
||||
|
|
||||
|
public String getCustomerNumber() { |
||||
|
return customerNumber; |
||||
|
} |
||||
|
|
||||
|
public void setCustomerNumber(String customerNumber) { |
||||
|
this.customerNumber = customerNumber; |
||||
|
} |
||||
|
|
||||
|
public String getCommonCurrency() { |
||||
|
return commonCurrency; |
||||
|
} |
||||
|
|
||||
|
public void setCommonCurrency(String commonCurrency) { |
||||
|
this.commonCurrency = commonCurrency; |
||||
|
} |
||||
|
|
||||
|
public String getProcessPrice() { |
||||
|
return processPrice; |
||||
|
} |
||||
|
|
||||
|
public void setProcessPrice(String processPrice) { |
||||
|
this.processPrice = processPrice; |
||||
|
} |
||||
|
|
||||
|
public String getProductQuantity() { |
||||
|
return productQuantity; |
||||
|
} |
||||
|
|
||||
|
public void setProductQuantity(String productQuantity) { |
||||
|
this.productQuantity = productQuantity; |
||||
|
} |
||||
|
|
||||
|
public String getAmountMoney() { |
||||
|
return amountMoney; |
||||
|
} |
||||
|
|
||||
|
public void setAmountMoney(String amountMoney) { |
||||
|
this.amountMoney = amountMoney; |
||||
|
} |
||||
|
|
||||
|
public String getCustomerUseOrNot() { |
||||
|
return customerUseOrNot; |
||||
|
} |
||||
|
|
||||
|
public void setCustomerUseOrNot(String customerUseOrNot) { |
||||
|
this.customerUseOrNot = customerUseOrNot; |
||||
|
} |
||||
|
|
||||
|
public String getCustomerUseQuantity() { |
||||
|
return customerUseQuantity; |
||||
|
} |
||||
|
|
||||
|
public void setCustomerUseQuantity(String customerUseQuantity) { |
||||
|
this.customerUseQuantity = customerUseQuantity; |
||||
|
} |
||||
|
|
||||
|
public String getCustomerUseRemarks() { |
||||
|
return customerUseRemarks; |
||||
|
} |
||||
|
|
||||
|
public void setCustomerUseRemarks(String customerUseRemarks) { |
||||
|
this.customerUseRemarks = customerUseRemarks; |
||||
|
} |
||||
|
|
||||
|
public String getAccountReconciliationOrNot() { |
||||
|
return accountReconciliationOrNot; |
||||
|
} |
||||
|
|
||||
|
public void setAccountReconciliationOrNot(String accountReconciliationOrNot) { |
||||
|
this.accountReconciliationOrNot = accountReconciliationOrNot; |
||||
|
} |
||||
|
|
||||
|
public String getAccountReconciliationPerson() { |
||||
|
return accountReconciliationPerson; |
||||
|
} |
||||
|
|
||||
|
public void setAccountReconciliationPerson(String accountReconciliationPerson) { |
||||
|
this.accountReconciliationPerson = accountReconciliationPerson; |
||||
|
} |
||||
|
|
||||
|
public String getAccountReconciliationTime() { |
||||
|
return accountReconciliationTime; |
||||
|
} |
||||
|
|
||||
|
public void setAccountReconciliationTime(String accountReconciliationTime) { |
||||
|
this.accountReconciliationTime = accountReconciliationTime; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this) |
||||
|
.append("salesFinishId", salesFinishId) |
||||
|
.append("noticeOrderNumber", noticeOrderNumber) |
||||
|
.append("deliveryDate", deliveryDate) |
||||
|
.append("salesOrderNumber", salesOrderNumber) |
||||
|
.append("enterpriseCode", enterpriseCode) |
||||
|
.append("enterpriseName", enterpriseName) |
||||
|
.append("customerContact", customerContact) |
||||
|
.append("finishProductCode", finishProductCode) |
||||
|
.append("finishProductName", finishProductName) |
||||
|
.append("specificationModel", specificationModel) |
||||
|
.append("customerNumber", customerNumber) |
||||
|
.append("commonCurrency", commonCurrency) |
||||
|
.append("processPrice", processPrice) |
||||
|
.append("productQuantity", productQuantity) |
||||
|
.append("amountMoney", amountMoney) |
||||
|
.append("customerUseOrNot", customerUseOrNot) |
||||
|
.append("customerUseQuantity", customerUseQuantity) |
||||
|
.append("customerUseRemarks", customerUseRemarks) |
||||
|
.append("accountReconciliationOrNot", accountReconciliationOrNot) |
||||
|
.append("accountReconciliationPerson", accountReconciliationPerson) |
||||
|
.append("accountReconciliationTime", accountReconciliationTime) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.ruoyi.storehouse.utils; |
||||
|
|
||||
|
import com.alibaba.excel.write.handler.RowWriteHandler; |
||||
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
||||
|
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
||||
|
import org.apache.poi.ss.usermodel.*; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 自定义 excel 行处理 |
||||
|
* |
||||
|
* @author zjw |
||||
|
* @date 2021-08-31 |
||||
|
*/ |
||||
|
public class CustomRowWriteCellHandler implements RowWriteHandler { |
||||
|
|
||||
|
private final Map<Integer, Integer> colMap; |
||||
|
|
||||
|
public CustomRowWriteCellHandler(Map<Integer, Integer> colMap) { |
||||
|
this.colMap = colMap; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) { |
||||
|
if (relativeRowIndex == null) { |
||||
|
return; |
||||
|
} |
||||
|
for (Map.Entry<Integer, Integer> entry : colMap.entrySet()) { |
||||
|
int key = entry.getKey() - 1; |
||||
|
int val = entry.getValue() - 1; |
||||
|
Cell cell = row.createCell(key + 1); |
||||
|
cell.setCellStyle(row.getCell(key).getCellStyle()); |
||||
|
int rowNum = row.getRowNum(); |
||||
|
CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum, rowNum, key, val); |
||||
|
writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package com.ruoyi.storehouse.utils; |
||||
|
|
||||
|
import com.alibaba.excel.write.handler.RowWriteHandler; |
||||
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
||||
|
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
||||
|
import org.apache.poi.ss.usermodel.Cell; |
||||
|
import org.apache.poi.ss.usermodel.Row; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 自定义 excel 行处理 |
||||
|
* |
||||
|
* @author zjw |
||||
|
* @date 2021-08-31 |
||||
|
*/ |
||||
|
public class CustomRowWriteCellsHandler implements RowWriteHandler { |
||||
|
|
||||
|
private final Map<String, Integer> colMap; |
||||
|
|
||||
|
public CustomRowWriteCellsHandler(Map<String, Integer> colMap) { |
||||
|
this.colMap = colMap; |
||||
|
} |
||||
|
|
||||
|
// @Override
|
||||
|
// public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
|
||||
|
// for (Map.Entry<Integer, Integer> entry : colMap.entrySet()) {
|
||||
|
// Integer key = entry.getKey() - 1;
|
||||
|
// Integer val = entry.getValue() - 1;
|
||||
|
// Cell cell = row.createCell(key + 1);
|
||||
|
// cell.setCellStyle(row.getCell(key).getCellStyle());
|
||||
|
// int rowNum = row.getRowNum();
|
||||
|
// CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum, rowNum, key, val);
|
||||
|
// writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress);
|
||||
|
// }
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) { |
||||
|
Integer rowNum1 = colMap.get("rowNum1"); |
||||
|
Integer rowNum2 = colMap.get("rowNum2"); |
||||
|
Integer colNum1 = colMap.get("colNum1"); |
||||
|
Integer colNum2 = colMap.get("colNum2"); |
||||
|
Cell cell = row.createCell(rowNum1); |
||||
|
cell.setCellStyle(row.getCell(rowNum1).getCellStyle()); |
||||
|
int rowNum = row.getRowNum(); |
||||
|
CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum1, rowNum2, colNum1, colNum2); |
||||
|
writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress); |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.ruoyi.storehouse.utils; |
||||
|
|
||||
|
import com.alibaba.excel.write.handler.RowWriteHandler; |
||||
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
||||
|
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
||||
|
import org.apache.poi.ss.usermodel.*; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 自定义 excel 行处理 |
||||
|
* |
||||
|
* @author ll |
||||
|
* @date 2023-06-09 |
||||
|
*/ |
||||
|
public class CustomRowWriteHandler implements RowWriteHandler { |
||||
|
|
||||
|
private final List<Integer> cols; |
||||
|
|
||||
|
public CustomRowWriteHandler(Integer... cols) { |
||||
|
this.cols = Arrays.asList(cols); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) { |
||||
|
for (Integer col : cols) { |
||||
|
Cell cell = row.createCell(col + 1); |
||||
|
cell.setCellStyle(row.getCell(col).getCellStyle()); |
||||
|
int rowNum = row.getRowNum(); |
||||
|
CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum, rowNum, col, col + 1); |
||||
|
writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,86 @@ |
|||||
|
package com.ruoyi.storehouse.utils; |
||||
|
|
||||
|
import com.alibaba.excel.metadata.Head; |
||||
|
import com.alibaba.excel.write.merge.AbstractMergeStrategy; |
||||
|
import org.apache.poi.ss.usermodel.*; |
||||
|
import org.apache.poi.ss.util.CellRangeAddress; |
||||
|
import org.apache.poi.ss.util.RegionUtil; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 合并单元格处理类 |
||||
|
*/ |
||||
|
public class MyHandler extends AbstractMergeStrategy { |
||||
|
|
||||
|
/** |
||||
|
* 合并开始行 |
||||
|
*/ |
||||
|
private Integer startRow = 0; |
||||
|
/** |
||||
|
* list表格所有的合并列集合 |
||||
|
*/ |
||||
|
private List<CellRangeAddress> cellRangeAddressList = null; |
||||
|
|
||||
|
public MyHandler() { |
||||
|
} |
||||
|
|
||||
|
public MyHandler(int startRow, List<CellRangeAddress> cellRangeAddressList) { |
||||
|
this.startRow = startRow; |
||||
|
this.cellRangeAddressList = cellRangeAddressList; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { |
||||
|
// 设置样式
|
||||
|
CellStyle cellStyle = cell.getCellStyle(); |
||||
|
//水平居中
|
||||
|
cellStyle.setAlignment(HorizontalAlignment.CENTER); |
||||
|
//自动换行
|
||||
|
cellStyle.setWrapText(true); |
||||
|
//在这里判断从哪一行开始调用合并的方法
|
||||
|
if (cell.getRowIndex() > this.startRow) { |
||||
|
if (relativeRowIndex == null || relativeRowIndex == 0) { |
||||
|
return; |
||||
|
} |
||||
|
mergeColumn(sheet, cell, head, relativeRowIndex); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 合并单元格 |
||||
|
* |
||||
|
* @param sheet |
||||
|
* @param cell |
||||
|
* @param head |
||||
|
* @param relativeRowIndex |
||||
|
*/ |
||||
|
protected void mergeColumn(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { |
||||
|
int rowIndex = cell.getRowIndex(); |
||||
|
int colIndex = cell.getColumnIndex(); |
||||
|
sheet = cell.getSheet(); |
||||
|
// 获取前一行
|
||||
|
Row preRow = sheet.getRow(rowIndex - 1); |
||||
|
//获取前一列
|
||||
|
Cell preCell = preRow.getCell(colIndex); |
||||
|
List<CellRangeAddress> list = this.cellRangeAddressList; |
||||
|
for (int i = 0; i < list.size(); i++) { |
||||
|
CellRangeAddress cellRangeAddress = list.get(i); |
||||
|
if (cellRangeAddress.containsColumn(preCell.getColumnIndex())) { |
||||
|
int lastColIndex = cellRangeAddress.getLastColumn(); |
||||
|
int firstColIndex = cellRangeAddress.getFirstColumn(); |
||||
|
CellRangeAddress cra = new CellRangeAddress(cell.getRowIndex(), cell.getRowIndex(), firstColIndex, lastColIndex); |
||||
|
sheet.addMergedRegion(cra); |
||||
|
// 加边框
|
||||
|
RegionUtil.setBorderBottom(BorderStyle.THIN, cra, sheet); |
||||
|
RegionUtil.setBorderLeft(BorderStyle.THIN, cra, sheet); |
||||
|
RegionUtil.setBorderRight(BorderStyle.THIN, cra, sheet); |
||||
|
RegionUtil.setBorderTop(BorderStyle.THIN, cra, sheet); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue