提交 2ee33f6d authored 作者: 刘海泉's avatar 刘海泉

Merge remote-tracking branch 'origin/test' into test

...@@ -40,7 +40,6 @@ public class CarrierSettlementOwnerDetailController { ...@@ -40,7 +40,6 @@ public class CarrierSettlementOwnerDetailController {
private final SettlementOwnerDetailService settlementOwnerDetailService; private final SettlementOwnerDetailService settlementOwnerDetailService;
@ApiOperation(value = "运单计费列表(货主)",notes = "<br>By:刘海泉") @ApiOperation(value = "运单计费列表(货主)",notes = "<br>By:刘海泉")
@PostMapping("/pageSettlementOwnerDetail") @PostMapping("/pageSettlementOwnerDetail")
@UnitCovert(param = false) @UnitCovert(param = false)
...@@ -119,6 +118,14 @@ public class CarrierSettlementOwnerDetailController { ...@@ -119,6 +118,14 @@ public class CarrierSettlementOwnerDetailController {
} }
} }
@ApiOperation(value = "导出货主运单计费",notes = "<br>By:杨启发")
@PostMapping("/exportSettlementOwnerDetail")
public void exportSettlementOwnerDetail(@RequestBody @Validated PageCarrierSettlementOwnerDetailParam param, HttpServletResponse response) throws Exception {
try (SXSSFWorkbook workbook = settlementOwnerDetailService.exportSettlementOwnerDetail(param)) {
response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE);
workbook.write(response.getOutputStream());
}
}
@ApiOperation(value = "批量下载结算运单明细",notes = "<br>By:liruixin") @ApiOperation(value = "批量下载结算运单明细",notes = "<br>By:liruixin")
@PostMapping("/exportBatchSettlementOwnerDetail") @PostMapping("/exportBatchSettlementOwnerDetail")
......
...@@ -363,6 +363,10 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic ...@@ -363,6 +363,10 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
if (!Objects.equals(settlementOwnerDetail.getInvoiceChannel(), SettlementOwnerDetailEnum.InvoiceChannel.BROKER.getCode())){ if (!Objects.equals(settlementOwnerDetail.getInvoiceChannel(), SettlementOwnerDetailEnum.InvoiceChannel.BROKER.getCode())){
return; return;
} }
if (Objects.equals(settlementOwnerDetail.getInvoiceType(), SettlementOwnerEnum.InvoiceType.ORDINARY.getCode())){
// 普通单不同步状态
return;
}
if (!Objects.equals(settlementOwnerDetail.getInvoiceStatus(), SettlementOwnerDetailEnum.InvoiceStatus.NO.getCode())){ if (!Objects.equals(settlementOwnerDetail.getInvoiceStatus(), SettlementOwnerDetailEnum.InvoiceStatus.NO.getCode())){
return; return;
...@@ -427,6 +431,10 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic ...@@ -427,6 +431,10 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
if (!Objects.equals(settlementOwnerDetail.getInvoiceChannel(), SettlementOwnerDetailEnum.InvoiceChannel.BROKER.getCode())){ if (!Objects.equals(settlementOwnerDetail.getInvoiceChannel(), SettlementOwnerDetailEnum.InvoiceChannel.BROKER.getCode())){
return; return;
} }
if (Objects.equals(settlementOwnerDetail.getInvoiceType(), SettlementOwnerEnum.InvoiceType.ORDINARY.getCode())){
// 普通单不同步状态
return;
}
SettlementDriverDetail settlementDriverDetail = settlementDriverDetailDao SettlementDriverDetail settlementDriverDetail = settlementDriverDetailDao
.getByChildNo(orderChild.getChildNo()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); .getByChildNo(orderChild.getChildNo()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
......
...@@ -509,6 +509,78 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS ...@@ -509,6 +509,78 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS
return ExcelUtil.create(excelSheet); return ExcelUtil.create(excelSheet);
} }
@Override
public SXSSFWorkbook exportSettlementOwnerDetail(PageCarrierSettlementOwnerDetailParam param) {
param.setPage(1);
param.setPageSize(1000000);
IPage<CarrierPageSettlementOwnerDetailVO> settlementOwnerDetailPage = pageSettlementOwnerDetail(param);
List<CarrierPageSettlementOwnerDetailVO> list = settlementOwnerDetailPage.getRecords();
// 组装表头
List<ExcelField> fieldList = new ArrayList<>();
fieldList.add(new ExcelField(0, "运单编号", "childNo", 5000));
fieldList.add(new ExcelField(1, "货主编码", "ownerUserNo", 5000));
fieldList.add(new ExcelField(2, "货主名称", "ownerName", 5000));
fieldList.add(new ExcelField(3, "结算方式", "settlementWay", 5000));
fieldList.add(new ExcelField(4, "货物名称", "goodsName", 5000));
fieldList.add(new ExcelField(5, "实际净重(吨)", "weight", 5000));
fieldList.add(new ExcelField(6, "平台运费报价", "freightPrice", 5000));
fieldList.add(new ExcelField(7, "应付运费", "freight", 5000));
fieldList.add(new ExcelField(8, "货损吨数", "lossWeight", 5000));
fieldList.add(new ExcelField(9, "货损单价", "lossPrice", 5000));
fieldList.add(new ExcelField(10, "货损金额", "lossFreight", 5000));
fieldList.add(new ExcelField(11, "管理费率(%)", "invoiceServiceFeeRate", 5000));
fieldList.add(new ExcelField(12, "管理费", "invoiceServiceFee", 5000));
fieldList.add(new ExcelField(13, "预付运费金额", "prepayFreight", 5000));
fieldList.add(new ExcelField(14, "借款抵扣金额", "loanFreight", 5000));
fieldList.add(new ExcelField(15, "结算金额", "settlementFreight", 5000));
fieldList.add(new ExcelField(16, "开票金额", "invoiceFreight", 5000));
fieldList.add(new ExcelField(17, "开票公司", "invoicingCompanyShorterName", 5000));
fieldList.add(new ExcelField(18, "开票标识", "invoiceType", 5000));
fieldList.add(new ExcelField(19, "订单编号", "orderNo", 5000));
fieldList.add(new ExcelField(20, "结算单号", "settlementNo", 5000));
fieldList.add(new ExcelField(21, "创建时间", "createTime", 5000));
// 组装数据
List<List<ExcelData>> dataList = new ArrayList<>();
for (CarrierPageSettlementOwnerDetailVO dto : list) {
List<ExcelData> rowData = new ArrayList<>();
rowData.add(new ExcelData(dto.getChildNo()));
rowData.add(new ExcelData(dto.getOwnerUserNo()+""));
rowData.add(new ExcelData(dto.getOwnerName()));
rowData.add(new ExcelData(SettlementWayEnum.WayType.getMsgByCode(dto.getSettlementWay())));
rowData.add(new ExcelData(dto.getGoodsName()));
rowData.add(new ExcelData(dto.getWeight()));
rowData.add(new ExcelData(dto.getFreightPrice()==null?null:dto.getFreightPrice().movePointLeft(2)));
rowData.add(new ExcelData(dto.getFreight()==null?null:dto.getFreight().movePointLeft(2)));
rowData.add(new ExcelData(dto.getLossWeight()));
rowData.add(new ExcelData(dto.getLossPrice()==null?null:dto.getLossPrice().movePointLeft(2)));
rowData.add(new ExcelData(dto.getLossFreight()==null?null:dto.getLossFreight().movePointLeft(2)));
rowData.add(new ExcelData(dto.getInvoiceServiceFeeRate()));
rowData.add(new ExcelData(dto.getInvoiceServiceFee()==null?null:dto.getInvoiceServiceFee().movePointLeft(2)));
rowData.add(new ExcelData(dto.getPrepayFreight()==null?null:dto.getPrepayFreight().movePointLeft(2)));
rowData.add(new ExcelData(dto.getLoanFreight()==null?null:dto.getLoanFreight().movePointLeft(2)));
rowData.add(new ExcelData(dto.getSettlementFreight()==null?null:dto.getSettlementFreight().movePointLeft(2)));
rowData.add(new ExcelData(dto.getInvoiceFreight()==null?null:dto.getInvoiceFreight().movePointLeft(2)));
rowData.add(new ExcelData(dto.getInvoicingCompanyShorterName()));
rowData.add(new ExcelData(SettlementOwnerEnum.InvoiceType.getMsgByCode(dto.getInvoiceType())));
rowData.add(new ExcelData(dto.getOrderNo()));
rowData.add(new ExcelData(dto.getSettlementNo()));
rowData.add(new ExcelData(dto.getCreateTime()));
dataList.add(rowData);
}
ExcelSheet excelSheet = new ExcelSheet("货主运单计费", "货主运单计费", fieldList, dataList);
//创建excel
return ExcelUtil.create(excelSheet);
}
@Override @Override
public SXSSFWorkbook exportBatchSettlementOwnerDetail(ExportBatchOwnerSettlementDetailParam param) { public SXSSFWorkbook exportBatchSettlementOwnerDetail(ExportBatchOwnerSettlementDetailParam param) {
//通过结算单号查询结算运单明细 //通过结算单号查询结算运单明细
......
...@@ -51,6 +51,8 @@ public interface SettlementOwnerDetailService { ...@@ -51,6 +51,8 @@ public interface SettlementOwnerDetailService {
SXSSFWorkbook exportPendingSettlementOwnerDetail(PagePendingCarrierSettlementOwnerDetailParam param); SXSSFWorkbook exportPendingSettlementOwnerDetail(PagePendingCarrierSettlementOwnerDetailParam param);
SXSSFWorkbook exportSettlementOwnerDetail(PageCarrierSettlementOwnerDetailParam param);
SXSSFWorkbook exportBatchSettlementOwnerDetail(ExportBatchOwnerSettlementDetailParam param); SXSSFWorkbook exportBatchSettlementOwnerDetail(ExportBatchOwnerSettlementDetailParam param);
SXSSFWorkbook exportInvoiceOwnerSettlementOrderDetail(PageInvoiceOwnerSettlementOwnerDetailParam param); SXSSFWorkbook exportInvoiceOwnerSettlementOrderDetail(PageInvoiceOwnerSettlementOwnerDetailParam param);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论