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