diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderExcel.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderExcel.java new file mode 100644 index 000000000..220c7497b --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderExcel.java @@ -0,0 +1,186 @@ +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 io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 结算单导出 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class StatisticsBalanceOrderExcel implements Serializable { + + + @ExcelProperty(value = "结算单号") + private String balanceOrderNo; // 结算单号 + + @ExcelProperty(value = "品牌") + private String brand; // 品牌 + + @ExcelProperty(value = "运单号") + private String waybillNo; // 运单号 + + @ExcelProperty(value = "订单号") + private String orderCode; // 订单号 + + @ExcelProperty(value = "服务类型") + private String typeServiceName; // 服务类型 +// +// @ExcelProperty(value = "货物品类") +// private String productGoods; // 货物品类 + + @ExcelProperty(value = "结算总金额") + @NumberFormat("0.00") + private BigDecimal totalBalanceFee; // 结算总金额 + + @ExcelProperty(value = "总数量") + private Integer totalCount; // 总数量 + + @ExcelProperty(value = "总重量") + @NumberFormat("0.00") + private BigDecimal totalWeight; // 总重量 + + @ExcelProperty(value = "总体积") + @NumberFormat("0.00") + private BigDecimal totalVolume; // 总体积 + + + @ExcelProperty(value = "收货单位") + private String consignee; // 收货单位 + + @ExcelProperty(value = "实际费用") + @NumberFormat("0.00") + private BigDecimal realTotalFee; // 实际费用 + + @ExcelProperty(value = "提货费") + @NumberFormat("0.00") + private BigDecimal pickupFee; // 提货费 + + @ExcelProperty(value = "运费") + @NumberFormat("0.00") + private BigDecimal freightFee; // 运费 + + @ExcelProperty(value = "仓库服务费") + @NumberFormat("0.00") + private BigDecimal warehouseServiceFee; // 仓库服务费 + + @ExcelProperty(value = "仓储费") + @NumberFormat("0.00") + private BigDecimal warehouseFee; // 仓储费 + + @ExcelProperty(value = "仓储管理费") + @NumberFormat("0.00") + private BigDecimal warehouseManageFee; // 仓储管理费 + + @ExcelProperty(value = "仓储分拣费") + @NumberFormat("0.00") + private BigDecimal warehouseSortingFee; // 仓储分拣费 + + @ExcelProperty(value = "仓储操作费") + @NumberFormat("0.00") + private BigDecimal warehouseOperatingFee; // 仓储操作费 + + @ExcelProperty(value = "配送费") + @NumberFormat("0.00") + private BigDecimal deliveryFee; // 配送费 + + @ExcelProperty(value = "配送服务费") + @NumberFormat("0.00") + private BigDecimal deliveryServiceFee; // 配送服务费 + + @ExcelProperty(value = "配送装卸费") + @NumberFormat("0.00") + private BigDecimal deliveryLoadingFee; // 配送装卸费 + + @ExcelProperty(value = "配送分拣费") + @NumberFormat("0.00") + private BigDecimal deliverySortingFee; // 配送分拣费 + + @ExcelProperty(value = "配送上楼费") + @NumberFormat("0.00") + private BigDecimal deliveryUpfloorFee; // 配送上楼费 + + @ExcelProperty(value = "配送平移费") + @NumberFormat("0.00") + private BigDecimal deliveryMoveFee; // 配送平移费 + + @ExcelProperty(value = "配送其他费") + @NumberFormat("0.00") + private BigDecimal deliveryOtherFee; // 配送其他费 + + @ExcelProperty(value = "超区费") + @NumberFormat("0.00") + private BigDecimal deliveryCrossingFee; // 超区费 + + @ExcelProperty(value = "安装费") + @NumberFormat("0.00") + private BigDecimal installFee; // 安装费 + + @ExcelProperty(value = "其他费") + @NumberFormat("0.00") + private BigDecimal otherFee; // 其他费 + + @ExcelProperty(value = "是否有售后") + private String aftersaleName; // 是否有售后 + + @ExcelProperty(value = "售后单号") + private String aftersaleOrder; // 售后单号 + + @ExcelProperty(value = "售后金额") + @NumberFormat("0.00") + private BigDecimal aftersalesFee; // 售后金额 + + + + + @ExcelProperty(value = "结算状态") + private String balanceStatusName; // 0未结算 1部分结算 2已结算 + + @ExcelProperty(value = "已结算金额") + @NumberFormat("0.00") + private BigDecimal hasBalanceFee; // 已结算金额 + + @ExcelProperty(value = "未结算金额") + @NumberFormat("0.00") + private BigDecimal noBalanceFee; // 未结算金额 + + @ExcelProperty(value = "结算时间") + @DateTimeFormat("yyyy-MM-dd") + private Date balanceTime; // 结算时间 + + @ExcelProperty(value = "结算人") + private String balanceUserName; // 结算人 + + @ExcelProperty(value = "结算备注") + private String balanceRemark; // 结算备注 + + @ExcelProperty(value = "是否有异常结算") + private String abnormalBalanceStatusName; // 是否有异常结算 + + @ExcelProperty(value = "异常金额") + @NumberFormat("0.00") + private BigDecimal abnormalBalanceFee; // 异常金额 + + @ExcelProperty(value = "异常时间") + @DateTimeFormat("yyyy-MM-dd") + private Date abnormalTime; // 异常时间 + + @ExcelProperty(value = "异常确认人") + private String abnormalUserName; // 异常确认人 + + @ExcelProperty(value = "异常备注") + private String abnormalRemark; // 异常备注 + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java index afed76cc7..4346b0566 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java @@ -1,21 +1,28 @@ 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.dto.StatisticsBalanceAbnormalDTO; import com.logpm.statistics.dto.StatisticsBalanceRecordDTO; +import com.logpm.statistics.entity.TrunklineCarCostEntity; import com.logpm.statistics.service.IStatisticsBalanceOrderInfoService; +import com.logpm.statistics.vo.StatisticsBalanceOrderExcel; import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO; +import com.logpm.statistics.vo.TrunklineCarCostExcel; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.exception.CustomerException; +import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.Map; import java.util.Objects; @Slf4j @@ -207,5 +214,17 @@ public class MerchantBalanceController { } } + @PostMapping("/export") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "商家结算成本导出", notes = "传入merchantStatisticsDTO") + public void export(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO, HttpServletResponse response) { + + + List statisticsBalanceOrderExcels = balanceOrderInfoService.pageListExport(merchantStatisticsDTO); + //导出ls + ExcelUtil.export(response, "商家结算成本", "商家结算成本", statisticsBalanceOrderExcels, StatisticsBalanceOrderExcel.class); + } + + } 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 7f0585ac1..f581348c9 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,6 +1,7 @@ package com.logpm.statistics.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.statistics.dto.MerchantStatisticsDTO; @@ -46,7 +47,7 @@ public class TrunklineCarCostController extends BladeController { /** * 分页列表 */ - @PostMapping("/page") + @GetMapping("/page") @ApiOperationSupport(order = 1) @ApiOperation(value = "分页", notes = "传入expenseDispatchWarehouseMonth") public R> page(@ApiIgnore @RequestParam Map expenseDispatchPriceOverZone, Query query) { @@ -68,10 +69,7 @@ public class TrunklineCarCostController extends BladeController { public void export(@RequestBody Map args, HttpServletResponse response) { - LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - if(args.get("carsNoType") != null){ - lambdaQueryWrapper.eq(TrunklineCarCostEntity::getCarsNoType, args.get("carsNoType")); - } + QueryWrapper lambdaQueryWrapper = Condition.getQueryWrapper(args, TrunklineCarCostEntity.class); List ls = trunklineCarCostService.list(lambdaQueryWrapper); List data = getTrunklineCarCostExcels(ls); @@ -79,6 +77,7 @@ public class TrunklineCarCostController extends BladeController { ExcelUtil.export(response, "干线车次费用", "干线车次费用", data, TrunklineCarCostExcel.class); } + @NotNull private static List getTrunklineCarCostExcels(List ls) { List data = new ArrayList<>(); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java index d2f2fcb86..7ac98a22f 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java @@ -18,4 +18,6 @@ public interface StatisticsBalanceOrderInfoMapper extends BaseMapper balanceOrderIds); void deleteBanlanceOrderByIds(@Param("balanceOrderIds") List balanceOrderIds); + + List pageListExport(@Param("param") MerchantStatisticsDTO merchantStatisticsDTO); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml index 8c4f227f8..4fd8739d8 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml @@ -65,6 +65,58 @@ #{item} + delete from logpm_statistics_balance_order_info diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java index 69c074eae..e680ae9be 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java @@ -5,6 +5,7 @@ import com.logpm.statistics.dto.MerchantStatisticsDTO; import com.logpm.statistics.dto.StatisticsBalanceAbnormalDTO; import com.logpm.statistics.dto.StatisticsBalanceRecordDTO; import com.logpm.statistics.entity.StatisticsBalanceOrderInfoEntity; +import com.logpm.statistics.vo.StatisticsBalanceOrderExcel; import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; @@ -30,4 +31,7 @@ public interface IStatisticsBalanceOrderInfoService extends BaseService balanceOrderIds); R enterBalance(StatisticsBalanceRecordDTO balanceRecordDTO); + + List pageListExport(MerchantStatisticsDTO merchantStatisticsDTO); + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java index ab50870b1..f3ab3b12f 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java @@ -13,11 +13,13 @@ import com.logpm.statistics.entity.*; import com.logpm.statistics.mapper.StatisticsBalanceOrderInfoMapper; import com.logpm.statistics.service.*; import com.logpm.statistics.vo.StatisticsBalanceAbnormalVO; +import com.logpm.statistics.vo.StatisticsBalanceOrderExcel; import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO; import com.logpm.statistics.vo.StatisticsBalanceRecordVO; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; @@ -329,4 +331,37 @@ public R findBalanceDetail(Long balanceOrderId) { } + @Override + public List pageListExport(MerchantStatisticsDTO merchantStatisticsDTO) { + + + List result = new ArrayList<>(); + + List warehouseIds = warehouseClient.getWarehouseIds(); + if(!warehouseIds.isEmpty()){ + merchantStatisticsDTO.setWarehouseIds(warehouseIds); + } + + List dataList = baseMapper.pageListExport(merchantStatisticsDTO); + dataList.forEach(data ->{ + StatisticsBalanceOrderExcel statisticsBalanceOrderExcel = BeanUtil.copy(data, StatisticsBalanceOrderExcel.class); + assert statisticsBalanceOrderExcel != null; + statisticsBalanceOrderExcel.setTypeServiceName(DistributionTypeConstant.getName(String.valueOf(data.getTypeService()))); + + statisticsBalanceOrderExcel.setAbnormalBalanceStatusName(1==data.getAbnormalBalanceStatus()?"是":"否"); + statisticsBalanceOrderExcel.setAftersaleName(1==data.getIsAftersale()?"是":"否"); + + String balancesBalanceOName = "未结算"; + if(data.getBalanceStatus()==2){ + balancesBalanceOName = "已结算"; + }else if(data.getBalanceStatus()==1){ + balancesBalanceOName = "部分结算"; + } + statisticsBalanceOrderExcel.setBalanceStatusName(balancesBalanceOName); + result.add(statisticsBalanceOrderExcel); + + }); + + return result; + } }