demand: 进仓详情导出增加进仓子单号
committer: heyu
This commit is contained in:
parent
1b87708e30
commit
d6fa69984a
@ -224,6 +224,7 @@ public class EmisWarehouseInController extends EmisBaseController
|
||||
List<Object[]> dataList = list.stream()
|
||||
.map(item -> new Object[] {
|
||||
item.getInNo(),
|
||||
item.getInSonNo(),
|
||||
item.getBillCode(),
|
||||
item.getOrderSn(),
|
||||
item.getEntryDate(),
|
||||
|
||||
@ -12,6 +12,9 @@ public class WarehouseInExport {
|
||||
@ExcelProperty("进仓单号")
|
||||
private String inNo;
|
||||
|
||||
@ExcelProperty("进仓子单号")
|
||||
private String inSonNo;
|
||||
|
||||
@ExcelProperty("运单号")
|
||||
private String billCode;
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
public class ImageExcelHandler {
|
||||
private static final int IMAGE_COLUMN_START = 11; // 图片起始列
|
||||
private static final int IMAGE_COLUMN_START = 12; // 图片起始列
|
||||
private static final int ROW_HEIGHT = 80; // 行高(像素)
|
||||
private static final int IMAGE_COLUMN_WIDTH = 15; // 每个图片列的宽度
|
||||
|
||||
@ -38,16 +38,17 @@ public class ImageExcelHandler {
|
||||
|
||||
// 设置列宽
|
||||
sheet.setColumnWidth(0, 15 * 256); // 进仓单号
|
||||
sheet.setColumnWidth(1, 15 * 256); // 运单号
|
||||
sheet.setColumnWidth(2, 15 * 256); // 订单号
|
||||
sheet.setColumnWidth(3, 20 * 256); // 进仓时间
|
||||
sheet.setColumnWidth(4, 10 * 256); // 件数
|
||||
sheet.setColumnWidth(5, 10 * 256); // 重量
|
||||
sheet.setColumnWidth(6, 10 * 256); // 体积
|
||||
sheet.setColumnWidth(7, 15 * 256); // 快递公司
|
||||
sheet.setColumnWidth(8, 15 * 256); // 快递单号
|
||||
sheet.setColumnWidth(9, 20 * 256); // 品名
|
||||
sheet.setColumnWidth(10, 15 * 256); // 供应商
|
||||
sheet.setColumnWidth(1, 15 * 256); // 进仓子单号
|
||||
sheet.setColumnWidth(2, 15 * 256); // 运单号
|
||||
sheet.setColumnWidth(3, 15 * 256); // 订单号
|
||||
sheet.setColumnWidth(4, 20 * 256); // 进仓时间
|
||||
sheet.setColumnWidth(5, 10 * 256); // 件数
|
||||
sheet.setColumnWidth(6, 10 * 256); // 重量
|
||||
sheet.setColumnWidth(7, 10 * 256); // 体积
|
||||
sheet.setColumnWidth(8, 15 * 256); // 快递公司
|
||||
sheet.setColumnWidth(9, 15 * 256); // 快递单号
|
||||
sheet.setColumnWidth(10, 20 * 256); // 品名
|
||||
sheet.setColumnWidth(11, 15 * 256); // 供应商
|
||||
|
||||
// 设置所有图片列的宽度
|
||||
for (int i = 0; i < maxImageCount; i++) {
|
||||
@ -57,7 +58,7 @@ public class ImageExcelHandler {
|
||||
// 创建标题行
|
||||
Row headerRow = sheet.createRow(0);
|
||||
headerRow.setHeight((short) (30 * 20)); // 设置标题行高
|
||||
String[] headers = { "进仓单号", "运单号", "订单号", "进仓时间", "件数", "重量", "体积", "快递公司", "快递单号", "品名", "供应商", "图片" };
|
||||
String[] headers = {"进仓单号", "进仓子单号", "运单号", "订单号", "进仓时间", "件数", "重量", "体积", "快递公司", "快递单号", "品名", "供应商", "图片"};
|
||||
|
||||
// 创建标题单元格
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
|
||||
@ -266,35 +266,63 @@ public class EmisWarehouseInServiceImpl implements IEmisWarehouseInService
|
||||
try {
|
||||
WarehouseInExport exportDTO = new WarehouseInExport();
|
||||
// 进仓单号
|
||||
exportDTO.setInNo(warehouseIn.getInNo());
|
||||
if(StringUtil.isNotBlank(warehouseIn.getInNo())){
|
||||
exportDTO.setInNo(warehouseIn.getInNo());
|
||||
}
|
||||
// 进仓子单号
|
||||
if (StringUtil.isNotBlank(warehouseIn.getInNo())) {
|
||||
if (StringUtil.isNotBlank(batch.getInBatchNo())) {
|
||||
exportDTO.setInSonNo(warehouseIn.getInNo() + "-" + batch.getInBatchNo());
|
||||
} else {
|
||||
exportDTO.setInSonNo(warehouseIn.getInNo() + "-");
|
||||
}
|
||||
}
|
||||
// 运单号
|
||||
exportDTO.setBillCode(warehouseIn.getBillCode());
|
||||
if(StringUtil.isNotBlank(warehouseIn.getBillCode())){
|
||||
exportDTO.setBillCode(warehouseIn.getBillCode());
|
||||
}
|
||||
// 订单号
|
||||
exportDTO.setOrderSn(warehouseIn.getOrderSn());
|
||||
if(StringUtil.isNotBlank(warehouseIn.getOrderSn())){
|
||||
exportDTO.setOrderSn(warehouseIn.getOrderSn());
|
||||
}
|
||||
// 进仓时间
|
||||
exportDTO.setEntryDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",batch.getEntryDate()));
|
||||
if (batch.getEntryDate() != null) {
|
||||
exportDTO.setEntryDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", batch.getEntryDate()));
|
||||
}
|
||||
|
||||
// 件数
|
||||
exportDTO.setTotalParcelQty(batch.getTotalParcelQty());
|
||||
if(batch.getTotalParcelQty()!=null){
|
||||
exportDTO.setTotalParcelQty(batch.getTotalParcelQty());
|
||||
}
|
||||
// 重量
|
||||
exportDTO.setTotalWeight(batch.getTotalWeight().stripTrailingZeros().toPlainString());
|
||||
if(batch.getTotalWeight()!=null){
|
||||
exportDTO.setTotalWeight(batch.getTotalWeight().stripTrailingZeros().toPlainString());
|
||||
}
|
||||
// 体积
|
||||
exportDTO.setTotalVolume(batch.getTotalVolume().stripTrailingZeros().toPlainString());
|
||||
if(batch.getTotalVolume()!=null){
|
||||
exportDTO.setTotalVolume(batch.getTotalVolume().stripTrailingZeros().toPlainString());
|
||||
}
|
||||
// 快递公司
|
||||
exportDTO.setPrepareInExpress(batch.getPrepareInExpress());
|
||||
if(StringUtil.isNotBlank(batch.getPrepareInExpress())){
|
||||
exportDTO.setPrepareInExpress(batch.getPrepareInExpress());
|
||||
}
|
||||
// 快递单号
|
||||
exportDTO.setPrepareInBillCode(batch.getPrepareInBillCode());
|
||||
if(StringUtil.isNotBlank(batch.getPrepareInBillCode())){
|
||||
exportDTO.setPrepareInBillCode(batch.getPrepareInBillCode());
|
||||
}
|
||||
// 品名
|
||||
String goodsName = batch.getCargoList().stream()
|
||||
.map(EmisWarehouseInDtl::getGoodsName)
|
||||
.distinct()
|
||||
.filter(i -> StringUtil.isNotEmpty(i))
|
||||
.collect(Collectors.joining(","));
|
||||
if (StringUtil.isNotEmpty(goodsName)) {
|
||||
if (StringUtil.isNotBlank(goodsName)) {
|
||||
exportDTO.setGoodsName(goodsName);
|
||||
}
|
||||
// 供应商
|
||||
exportDTO.setPrepareInSupplier(batch.getPrepareInSupplier());
|
||||
if(StringUtil.isNotBlank(batch.getPrepareInSupplier())){
|
||||
exportDTO.setPrepareInSupplier(batch.getPrepareInSupplier());
|
||||
}
|
||||
|
||||
// 处理图片 - 处理所有图片
|
||||
if (StringUtil.isNotEmpty(batch.getPicUrl())) {
|
||||
|
||||
@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<collection property="stockInBatchList" ofType="EmisWarehouseInBatch">
|
||||
<id property="id" column="batch_id"/>
|
||||
<result property="inNo" column="batch_in_no"/>
|
||||
<result property="inBatchNo" column="in_batch_no"/>
|
||||
<result property="entryDate" column="batch_entry_date"/>
|
||||
<result property="totalParcelQty" column="batch_total_parcel_qty"/>
|
||||
<result property="totalWeight" column="batch_total_weight"/>
|
||||
@ -305,6 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
wi.total_volume,
|
||||
wib.id as batch_id,
|
||||
wib.in_no as batch_in_no,
|
||||
wib.in_batch_no as in_batch_no,
|
||||
wib.entry_date as batch_entry_date,
|
||||
wib.total_parcel_qty as batch_total_parcel_qty,
|
||||
wib.total_weight as batch_total_weight,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user