diff --git a/blade-biz-common/src/main/java/org/springblade/common/serializer/BigDecimal4WVSerializer.java b/blade-biz-common/src/main/java/org/springblade/common/serializer/BigDecimal4WVSerializer.java new file mode 100644 index 000000000..63a19aa97 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/serializer/BigDecimal4WVSerializer.java @@ -0,0 +1,29 @@ +package org.springblade.common.serializer; + + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +import java.io.IOException; +import java.math.BigDecimal; + +/** + * 重量提价方面的格式化 + * 页面呈现4位小数 + * + * @see BigDecimal + * @用法 @JsonSerialize(using = BigDecimalSerializer.class) + */ +public class BigDecimal4WVSerializer extends JsonSerializer { + @Override + public void serialize(BigDecimal bigDecimal, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (bigDecimal != null) { + BigDecimal number = bigDecimal.setScale(4, BigDecimal.ROUND_HALF_UP); + jsonGenerator.writeNumber(number); + } else { + jsonGenerator.writeNumber(bigDecimal); + } + + } +} diff --git a/blade-biz-common/src/main/java/org/springblade/common/serializer/BigDecimalSerializer.java b/blade-biz-common/src/main/java/org/springblade/common/serializer/BigDecimalSerializer.java new file mode 100644 index 000000000..4df6dd0ea --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/serializer/BigDecimalSerializer.java @@ -0,0 +1,29 @@ +package org.springblade.common.serializer; + + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +import java.io.IOException; +import java.math.BigDecimal; + +/** + * 金额方面的格式化 + * 页面呈现2位小数 + * + * @see BigDecimal + * @用法 @JsonSerialize(using = BigDecimalSerializer.class) + */ +public class BigDecimalSerializer extends JsonSerializer { + @Override + public void serialize(BigDecimal bigDecimal, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (bigDecimal != null) { + BigDecimal number = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP); + jsonGenerator.writeNumber(number); + } else { + jsonGenerator.writeNumber(bigDecimal); + } + + } +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java index 4a2efec6f..046381fb0 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java @@ -1,7 +1,10 @@ package com.logpm.statistics.entity; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.springblade.common.serializer.BigDecimalSerializer; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; @@ -18,42 +21,50 @@ public class TrunklineCarCostEntity extends TenantEntity { /** * 申请时间 */ + @ApiModelProperty(value = "申请时间") private Date effectTime; /** * 车牌号 */ + @ApiModelProperty(value = "车牌号") private String plateNumber; /** * 司机名称 */ + @ApiModelProperty(value = "司机名称") private String driverName; /** * 实际收款人 */ + @ApiModelProperty(value = "实际收款人") private String actualReceivablePerson; /** * 车次号码 */ + @ApiModelProperty(value = "车次号码") private String carsNo; /** - * 车次类型 外请 自有 目前该字段不使用 + * 车次类型 1外请 2自有 目前该字段不使用 * */ + @ApiModelProperty(value = "车次类型 1外请 2自有 ") private Integer carsNoType; /** * 调车员 */ + @ApiModelProperty(value = "调车员") private String driverStaff; /** * 车辆类型(结算车辆类型) */ + @ApiModelProperty(value = "车辆类型") private String vehicleType; // /** @@ -64,156 +75,203 @@ public class TrunklineCarCostEntity extends TenantEntity { /** * 货物品牌,多个拼接在一起 */ + @ApiModelProperty(value = "货物品牌,多个拼接在一起") private String brands; /** * 起始站点 */ + @ApiModelProperty(value = "起始站点") private String startStation; /** * 外请网点 */ + @ApiModelProperty(value = "外请网点") private String outStation; /** * 货数 */ + @ApiModelProperty(value = "货数") private Integer goodsNum; /** * 原价(元) */ + @ApiModelProperty(value = "原价") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal originalPrice; /** * 实际驾驶员费用(元) */ + @ApiModelProperty(value = "实际驾驶员费用(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal actualDriverFee; /** * 燃油卡费(元) */ + @ApiModelProperty(value = "燃油卡费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal fuelCardFee; /** * 路桥费f(元) */ + @ApiModelProperty(value = "路桥费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal bridgeFee; /** * 现付运输费(元) */ + @ApiModelProperty(value = "现付运输费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal nowFreightFee; /** * 回收货运费(元) */ + @ApiModelProperty(value = "回收货运费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal returnFreightFee; /** * 到付运输费(元) */ + @ApiModelProperty(value = "到付运输费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal payFreightFee; /** * 整车信息费(元) */ + @ApiModelProperty(value = "整车信息费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal trailerInsuranceFee; /** * 整车保险费(元) */ + @ApiModelProperty(value = "整车保险费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal trailerInsuranceCost; /** * 整车落地费(元) */ + @ApiModelProperty(value = "整车落地费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal landingFee; /** * 发站装车费(元) */ + @ApiModelProperty(value = "发站装车费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal stationLoadingFee; /** * 发站其它费(元) */ + @ApiModelProperty(value = "发站其它费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal otherStationFee; /** * 到站卸车费(元) */ + @ApiModelProperty(value = "到站卸车费(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal stationUnloadingFee; /** * 其他费用(元) */ + @ApiModelProperty(value = "其他费用(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal otherFee; /** *额外费用(元) */ + @ApiModelProperty(value = "额外费用(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal additionalFee; /** * 平台结算fee(元) */ + @ApiModelProperty(value = "平台结算fee(元)") + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal platformSettlementFee; /** *钉钉编号 */ + @ApiModelProperty(value = "钉钉编号") private String dingDingNumber; /** * 平台订单号 */ + @ApiModelProperty(value = "平台订单号") private String platformOrderNumber; /** * 付款时间 */ + @ApiModelProperty(value = "付款时间") private Date paymentTime; /** * 付款方名称 */ + @ApiModelProperty(value = "付款方名称") private String paymentName; /** * 付款方账号 */ + @ApiModelProperty(value = "付款方账号") private String paymentAccount; /** * 收款方如是平台叫车该字段未平台名称 */ + @ApiModelProperty(value = "收款方如是平台叫车该字段未平台名称") private String receiveName; /** * 收款账号 */ + @ApiModelProperty(value = "收款账号") private String receiveAccount; /** * 线路名称 */ + @ApiModelProperty(value = "线路名称") private String routeName; /** - * 付款记录 + * 付款记录ID */ + @ApiModelProperty(value = "付款记录ID") private String carPayId; /** * 是否确认1确认0未确认 */ + @ApiModelProperty(value = "是否确认1确认0未确认") private Integer isEnter; /** * 是否支付(0:未支付,1:已支付) */ + @ApiModelProperty(value = "是否支付(0:未支付,1:已支付)") private Integer isPayment; } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java index da8b02c54..4d3352970 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java @@ -1,5 +1,8 @@ package com.logpm.statistics.vo; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.springblade.common.serializer.BigDecimal4WVSerializer; +import org.springblade.common.serializer.BigDecimalSerializer; import lombok.Data; import java.io.Serializable; @@ -54,23 +57,34 @@ public class StatisticsOrderInfoVO implements Serializable { */ private String goodsPrice; private Integer totalNum;//订单数量 + @JsonSerialize(using = BigDecimal4WVSerializer.class) private BigDecimal totalWeight;//订单重量 + @JsonSerialize(using = BigDecimal4WVSerializer.class) private BigDecimal totalVolume;//订单体积 - + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal sysTotalFee; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal totalFee; - + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal systemFreightPrice; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal freightPrice; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal systemPickupPrice; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal pickupPrice; - + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal warehouseServiceFee; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal warehouseFee; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal warehouseManageFee; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal warehouseSortingFee; + @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal warehouseOperatingFee; + private BigDecimal systemDeliveryFee; private BigDecimal deliveryFee; private BigDecimal deliveryServiceFee; diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostExcel.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostExcel.java new file mode 100644 index 000000000..a098c3c5a --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostExcel.java @@ -0,0 +1,281 @@ +package com.logpm.statistics.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.alibaba.excel.annotation.format.NumberFormat; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class TrunklineCarCostExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 申请时间 + */ + @ExcelProperty(value = "申请时间") + @DateTimeFormat("yyyy-MM-dd") + private Date effectTime; + + /** + * 车牌号 + */ + @ExcelProperty(value = "车牌号") + private String plateNumber; + + /** + * 司机名称 + */ + @ExcelProperty(value = "司机名称") + private String driverName; + + /** + * 实际收款人 + */ + @ExcelProperty(value = "实际收款人") + private String actualReceivablePerson; + + /** + * 车次号码 + */ + @ExcelProperty(value = "车次号码") + private String carsNo; + + /** + * 车次类型 1外请 2自有 目前该字段不使用 + * + */ + @ExcelProperty(value = "车次类型 1外请 2自有 ") + private Integer carsNoType; + + /** + * 调车员 + */ + @ExcelProperty(value = "调车员") + private String driverStaff; + + /** + * 车辆类型(结算车辆类型) + */ + @ExcelProperty(value = "车辆类型") + private String vehicleType; + +// /** +// * 客户名称 和货物品牌 相同 +// */ +// private String customerName; + + /** + * 货物品牌,多个拼接在一起 + */ + @ExcelProperty(value = "货物品牌,多个拼接在一起") + private String brands; + + /** + * 起始站点 + */ + @ExcelProperty(value = "起始站点") + private String startStation; + + /** + * 外请网点 + */ + @ExcelProperty(value = "外请网点") + private String outStation; + + /** + * 货数 + */ + @ExcelProperty(value = "货数") + private Integer goodsNum; + + /** + * 原价(元) + */ + @ExcelProperty(value = "原价") + @NumberFormat("##.00") + private BigDecimal originalPrice; + + /** + * 实际驾驶员费用(元) + */ + @ExcelProperty(value = "实际驾驶员费用(元)") + @NumberFormat("##.00") + private BigDecimal actualDriverFee; + + /** + * 燃油卡费(元) + */ + @ExcelProperty(value = "燃油卡费(元)") + @NumberFormat("0.00") + private BigDecimal fuelCardFee; + + /** + * 路桥费f(元) + */ + @ExcelProperty(value = "路桥费(元)") + @NumberFormat("0.00") + private BigDecimal bridgeFee; + + /** + * 现付运输费(元) + */ + @ExcelProperty(value = "现付运输费(元)") + @NumberFormat("0.00") + private BigDecimal nowFreightFee; + + /** + * 回收货运费(元) + */ + @ExcelProperty(value = "回收货运费(元)") + @NumberFormat("0.00") + private BigDecimal returnFreightFee; + + /** + * 到付运输费(元) + */ + @ExcelProperty(value = "到付运输费(元)") + @NumberFormat("0.00") + private BigDecimal payFreightFee; + + /** + * 整车信息费(元) + */ + @ExcelProperty(value = "整车信息费(元)") + @NumberFormat("0.00") + private BigDecimal trailerInsuranceFee; + + /** + * 整车保险费(元) + */ + @ExcelProperty(value = "整车保险费(元)") + @NumberFormat("0.00") + private BigDecimal trailerInsuranceCost; + + /** + * 整车落地费(元) + */ + @ExcelProperty(value = "整车落地费(元)") + @NumberFormat("0.00") + private BigDecimal landingFee; + + /** + * 发站装车费(元) + */ + @ExcelProperty(value = "发站装车费(元)") + @NumberFormat("0.00") + private BigDecimal stationLoadingFee; + + /** + * 发站其它费(元) + */ + @ExcelProperty(value = "发站其它费(元)") + @NumberFormat("0.00") + private BigDecimal otherStationFee; + + /** + * 到站卸车费(元) + */ + @ExcelProperty(value = "到站卸车费(元)") + @NumberFormat("0.00") + private BigDecimal stationUnloadingFee; + + /** + * 其他费用(元) + */ + @ExcelProperty(value = "其他费用(元)") + @NumberFormat("0.00") + private BigDecimal otherFee; + + /** + *额外费用(元) + */ + @ExcelProperty(value = "额外费用(元)") + @NumberFormat("0.00") + private BigDecimal additionalFee; +// +// /** +// * 平台结算fee(元) +// */ +// @ExcelProperty(value = "平台结算fee(元)") +// @NumberFormat("0.00") +// private BigDecimal platformSettlementFee; +// +// /** +// *钉钉编号 +// */ +// @ExcelProperty(value = "钉钉编号") +// private String dingDingNumber; +// +// /** +// * 平台订单号 +// */ +// @ExcelProperty(value = "平台订单号") +// private String platformOrderNumber; +// +// /** +// * 付款时间 +// */ +// @ExcelProperty(value = "付款时间") +// @DateTimeFormat("yyyy-MM-dd") +// private Date paymentTime; +// +// /** +// * 付款方名称 +// */ +// @ExcelProperty(value = "付款方名称") +// private String paymentName; +// +// /** +// * 付款方账号 +// */ +// @ExcelProperty(value = "付款方账号") +// private String paymentAccount; +// +// /** +// * 收款方如是平台叫车该字段未平台名称 +// */ +// @ExcelProperty(value = "收款方如是平台叫车该字段未平台名称") +// private String receiveName; +// +// /** +// * 收款账号 +// */ +// @ExcelProperty(value = "收款账号") +// private String receiveAccount; +// +// /** +// * 线路名称 +// */ +// @ExcelProperty(value = "线路名称") +// private String routeName; +// +// /** +// * 付款记录ID +// */ +// @ExcelProperty(value = "付款记录ID") +// private String carPayId; +// +// /** +// * 是否确认1确认0未确认 +// */ +// @ExcelProperty(value = "是否确认1确认0未确认") +// private Integer isEnter; +// +// /** +// * 是否支付(0:未支付,1:已支付) +// */ +// @ExcelProperty(value = "是否支付(0:未支付,1:已支付)") +// private Integer isPayment; + +} diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java index 13304e135..b763c5ed8 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java @@ -105,4 +105,8 @@ public interface IWarehouseWaybillClient { @GetMapping(API_PREFIX+"/updateWaybillCondigneeId") void updateWaybillCondigneeIdToNull(@RequestParam Long waybillId); + + + @GetMapping(API_PREFIX + "/findWaybillVOByOrderCode") + List findWaybillVOByOrderCode(@RequestParam String orderCode); } diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java index 53decf3c1..865f170b9 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java @@ -77,11 +77,11 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { // 移除当前的仓库 groupedByWarehouse.remove(result.getDepartureWarehouseName()); result.setStartWarehouseNumber(startWarehouseNumber); - temp +=startWarehouseNumber!=null?startWarehouseNumber.getNumber():temp; + temp +=startWarehouseNumber!=null?startWarehouseNumber.getNumber():0; /*********************************m目的仓 start********************************/ String destinationWarehouseName = result.getDestinationWarehouseName(); WarehouseNumberVO endWarehouseNumber=buildWarehouse(groupedByWarehouse,destinationWarehouseName); - temp +=endWarehouseNumber!=null?endWarehouseNumber.getNumber():temp; + temp +=endWarehouseNumber!=null?endWarehouseNumber.getNumber():0; // 计算预约数量 List end = groupedByWarehouse.get(destinationWarehouseName); @@ -102,7 +102,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { } WarehouseNumberVO middleWarehouseNumberVO = buildWarehouse(groupedByWarehouse,key); models.add(middleWarehouseNumberVO); - temp +=middleWarehouseNumberVO!=null?middleWarehouseNumberVO.getNumber():temp; + temp +=middleWarehouseNumberVO!=null?middleWarehouseNumberVO.getNumber():0; } // 加入中转的数据 result.setMiddleWarehouseNumber(models); @@ -190,14 +190,17 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { private R dataOrder(String order) { - - // 通过订单查询站存单导入时间 - - - //todo - - - - return null; + // 通过订单查询运单号 + List waybillVOByOrderCode = warehouseWaybillClient.findWaybillVOByOrderCode(order); + // 对集合中的运单号进行分组 + Map> groupedByWaybillNo = waybillVOByOrderCode.stream() + .collect(Collectors.groupingBy(WarehouseWaybillEntity::getWaybillNo)); + Set keys = groupedByWaybillNo.keySet(); + List data = new ArrayList<>(); + for (String key : keys) { + WaybillInfoVO waybillInfoVO = dataWEaybill(key); + data.add(waybillInfoVO); + } + return R.data(data); } } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java index 673cd7462..7f0585ac1 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java @@ -1,26 +1,33 @@ package com.logpm.statistics.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.statistics.dto.MerchantStatisticsDTO; import com.logpm.statistics.entity.ExpenseDispatchPriceOverZoneEntity; import com.logpm.statistics.entity.TrunklineCarCostEntity; import com.logpm.statistics.query.ExpenseDispatchTrainDetailMonthQuery; import com.logpm.statistics.service.ITrunklineCarCostService; import com.logpm.statistics.vo.ExpenseDispatchWarehouseMonthVO; +import com.logpm.statistics.vo.StatisticsOrderInfoExportVO; +import com.logpm.statistics.vo.TrunklineCarCostExcel; import com.logpm.statistics.vo.TrunklineCarCostVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import org.jetbrains.annotations.NotNull; import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springblade.core.tool.utils.BeanUtil; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; import java.util.Map; /** @@ -39,7 +46,7 @@ public class TrunklineCarCostController extends BladeController { /** * 分页列表 */ - @GetMapping("/page") + @PostMapping("/page") @ApiOperationSupport(order = 1) @ApiOperation(value = "分页", notes = "传入expenseDispatchWarehouseMonth") public R> page(@ApiIgnore @RequestParam Map expenseDispatchPriceOverZone, Query query) { @@ -51,5 +58,37 @@ public class TrunklineCarCostController extends BladeController { } + /** + * 数据导出 + * @param response + */ + @PostMapping("/export") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "干线车次费用导出", notes = "传入merchantStatisticsDTO") + public void export(@RequestBody Map args, HttpServletResponse response) { + + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + if(args.get("carsNoType") != null){ + lambdaQueryWrapper.eq(TrunklineCarCostEntity::getCarsNoType, args.get("carsNoType")); + } + List ls = trunklineCarCostService.list(lambdaQueryWrapper); + + List data = getTrunklineCarCostExcels(ls); + //导出ls + ExcelUtil.export(response, "干线车次费用", "干线车次费用", data, TrunklineCarCostExcel.class); + } + + @NotNull + private static List getTrunklineCarCostExcels(List ls) { + List data = new ArrayList<>(); + for (TrunklineCarCostEntity l : ls) { + TrunklineCarCostExcel t =BeanUtil.copy(l, TrunklineCarCostExcel.class); + + data.add(t); + } + return data; + } + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java index f07bd9242..9398fb03f 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java @@ -49,10 +49,10 @@ public class StationArrivedEnterListener { log.warn("{}:车次存在未点击卸车确认完成的数据",vo.getCarsNo()); return ; } - if(StringUtil.isBlank(vo.getOutDriverPerson())){ - log.warn("{}:该车次自由车次数据",vo.getCarsNo()); - return ; - } +// if(StringUtil.isBlank(vo.getOutDriverPerson())){ +// log.warn("{}:该车次自由车次数据",vo.getCarsNo()); +// return ; +// } // 构建需要保存的数据 TrunklineCarCostEntity costEntity = buildCostEntity(vo); @@ -75,7 +75,8 @@ public class StationArrivedEnterListener { data.setDriverName(main.getDriverName()); data.setActualReceivablePerson(main.getDriverName()); data.setCarsNo(main.getCarsNo()); - data.setCarsNoType(1); + // 如存在外情人 标识该车次为外请车次 + data.setCarsNoType(StringUtil.isBlank(main.getOutDriverPerson())?2:1); data.setDriverStaff(main.getOutDriverPerson()); data.setVehicleType(main.getCarSettlementType()); // data.setCustomerName(main.getBrandNames()); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java index 44523274c..2b05582ed 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java @@ -134,4 +134,9 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient { public void updateWaybillCondigneeIdToNull(Long waybillId) { warehouseWaybillService.updateWaybillCondigneeIdToNull(waybillId); } + + @Override + public List findWaybillVOByOrderCode(String orderCode) { + return warehouseWaybillService.findWaybillVOByOrderCode(orderCode); + } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java index 5dfa2a9e5..374ddeb28 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java @@ -81,4 +81,6 @@ public interface WarehouseWaybillMapper extends BaseMapper findWaybillVOByWaybillNoSet(@Param("waybillNos") Set allWaybillNoSet); void updateWaybillCondigneeIdToNull(@Param("waybillId") Long waybillId); + + List findWaybillVOByOrderCode(@Param("orderCode") String orderCode); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index e5c3d418c..6e9f7785a 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -1275,6 +1275,12 @@ group by lww.id + update logpm_warehouse_waybill set consignee_id = null where id = #{waybillId} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java index a9ee08635..04e2574a1 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java @@ -93,4 +93,6 @@ public interface IWarehouseWaybillService extends BaseService findWaybillVOByWaybillNoSet(Set allWaybillNoSet); void updateWaybillCondigneeIdToNull(Long waybillId); + + List findWaybillVOByOrderCode(String orderCode); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java index 4e43be3d7..1c6da9a3c 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java @@ -1229,4 +1229,9 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl findWaybillVOByOrderCode(String orderCode) { + return baseMapper.findWaybillVOByOrderCode(orderCode); + } }