From 44050285d9b0f2df69e625f92e69309a530902b6 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期三, 11 十二月 2024 16:57:34 +0800 Subject: [PATCH] 1.财务报表详情-部分统计字段新增 2.合伙人报表-部分统计字段新增 --- src/main/java/com/mzl/flower/dto/response/report/OrderDetailReportResultVO.java | 32 ++++++++++++++++ src/main/resources/mapper/report/OrderReportMapper.xml | 17 +++++++- src/main/java/com/mzl/flower/service/impl/report/OrderReportServiceImpl.java | 48 +++++++++++++++++++----- 3 files changed, 85 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/mzl/flower/dto/response/report/OrderDetailReportResultVO.java b/src/main/java/com/mzl/flower/dto/response/report/OrderDetailReportResultVO.java index 260211a..2e162e0 100644 --- a/src/main/java/com/mzl/flower/dto/response/report/OrderDetailReportResultVO.java +++ b/src/main/java/com/mzl/flower/dto/response/report/OrderDetailReportResultVO.java @@ -50,11 +50,17 @@ @ApiModelProperty("合伙人区间加价") private BigDecimal partnerSectionFeeAmount; + @ApiModelProperty("优惠合计") + private BigDecimal orderDiscountTotalFee; + @ApiModelProperty("会员折扣") private BigDecimal orderPriceDiscountAmount; @ApiModelProperty("优惠券") private BigDecimal orderCouponAmountTotal; + + @ApiModelProperty("质检总扣款") + private BigDecimal orderCheckTotalFee; @ApiModelProperty("质检降级扣款") private BigDecimal orderCheckFee; @@ -65,6 +71,10 @@ @ApiModelProperty("质检补货扣款") private BigDecimal orderReplaceFee; + + @ApiModelProperty("售后总扣款") + private BigDecimal orderTotalFee; + @ApiModelProperty("售后扣合伙人款") private BigDecimal orderFeePartner; @@ -73,6 +83,19 @@ @ApiModelProperty("售后扣平台款") private BigDecimal orderFeePlatform; + + @ApiModelProperty("售后打包扣款") + private BigDecimal orderFeePlatformPack; + + @ApiModelProperty("售后质检扣款") + private BigDecimal orderFeePlatformCheck; + + @ApiModelProperty("售后物流扣款") + private BigDecimal orderFeePlatformTransport; + + @ApiModelProperty("售后打包运费扣款") + private BigDecimal orderFeePackingTransport; + @ApiModelProperty("总包干费") private BigDecimal partnerTotalFeeAmount; @@ -84,6 +107,15 @@ @ApiModelProperty("实际销售扎数") private Integer realSaleNum; + @ApiModelProperty("缺货扎数") + private BigDecimal orderLackNum; + + @ApiModelProperty("降级扎数") + private BigDecimal orderReduceNum; + + @ApiModelProperty("补货扎数") + private BigDecimal orderReplaceNum; + @ApiModelProperty("利润") private BigDecimal profitFeeAmount; diff --git a/src/main/java/com/mzl/flower/service/impl/report/OrderReportServiceImpl.java b/src/main/java/com/mzl/flower/service/impl/report/OrderReportServiceImpl.java index 0e270b3..3ef65aa 100644 --- a/src/main/java/com/mzl/flower/service/impl/report/OrderReportServiceImpl.java +++ b/src/main/java/com/mzl/flower/service/impl/report/OrderReportServiceImpl.java @@ -179,10 +179,12 @@ orderReportCalendarBO.setStartDate(calculateStartTime(orderTime)); orderReportCalendarBO.setEndDate(calculateEndTime(orderTime)); List<OrderDetailReportResultVO> odrs = orderReportMapper.getOrderDetailReport(orderReportCalendarBO, null); - String[] rowsName = new String[]{"序号","订单号", "下单用户", "收货人地址", "合伙人", "下单时间", "订单金额" - , "花农底价", "平台区间加价", "平台加价", "平台区域加价", "合伙人加价", "合伙人区间加价", "会员折扣" - , "优惠券", "降级扣款", "缺货扣款", "补货扣款", "售后扣合伙人款", "售后扣花农款", "售后扣平台款", "总包干费" - , "销售扎数", "利润", "结算状态"}; + String[] rowsName = new String[]{"序号","订单号", "下单用户", "收货人地址", "合伙人", "下单时间", "订单金额","订单金额(实付)" + , "花农底价", "平台区间加价", "平台加价", "平台区域加价", "合伙人加价", "合伙人区间加价", + "优惠合计","会员折扣", "优惠券", + "质检总扣款","降级扣款", "缺货扣款", "补货扣款", + "售后总扣款","售后供应商扣款","售后平台扣款","售后合伙人扣款","售后打包扣款","售后质检扣款","售后物流扣款","售后打包运费扣款", + "总包干费","总销售扎数","实际销售扎数","缺货扎数","降级扎数","补货扎数","利润","结算状态",}; List<Object[]> dataList = new ArrayList<>(); int sn = 1; for (OrderDetailReportResultVO o : odrs) { @@ -195,22 +197,40 @@ objs[a++] = o.getPartnerName(); objs[a++] = o.getOrderDate(); objs[a++] = o.getOrderTotal(); + objs[a++] = o.getTotalAmount(); + objs[a++] = o.getOrderSupplierPriceAmount(); objs[a++] = o.getOrderMarkupOneAmount(); objs[a++] = o.getOrderMarkupTwoAmount(); objs[a++] = o.getPlatformAreaFeeAmount(); objs[a++] = o.getOrderMarkupPartnerAmount(); objs[a++] = o.getPartnerSectionFeeAmount(); + + objs[a++] = o.getOrderDiscountTotalFee();//优惠合计 objs[a++] = o.getOrderPriceDiscountAmount(); objs[a++] = o.getOrderCouponAmountTotal(); + + objs[a++] = o.getOrderCheckTotalFee();//质检总扣款 objs[a++] = o.getOrderCheckFee(); objs[a++] = o.getOrderLackFeeSupplier(); objs[a++] = o.getOrderReplaceFee(); - objs[a++] = o.getOrderFeePartner(); - objs[a++] = o.getOrderFeeSupplier(); - objs[a++] = o.getOrderFeePlatform(); - objs[a++] = o.getPartnerTotalFeeAmount(); - objs[a++] = o.getRealSaleNum(); + + objs[a++] = o.getOrderTotalFee(); //售后总扣款 + objs[a++] = o.getOrderFeeSupplier(); //售后供应商扣款 + objs[a++] = o.getOrderFeePlatform(); //售后平台扣款 + objs[a++] = o.getOrderFeePartner(); //售后合伙人扣款 + objs[a++] = o.getOrderFeePlatformPack(); //售后打包扣款 + objs[a++] = o.getOrderFeePlatformCheck(); // 售后质检扣款 + objs[a++] = o.getOrderFeePlatformTransport(); //售后物流扣款 + objs[a++] = o.getOrderFeePackingTransport(); //售后打包运费扣款 + + objs[a++] = o.getPartnerTotalFeeAmount(); // 总包干费 + objs[a++] = o.getOrderNum(); // 总销售扎数 + objs[a++] = o.getRealSaleNum(); // 实际销售扎数 + objs[a++] = o.getOrderLackNum(); // 缺货扎数 + objs[a++] = o.getOrderReduceNum(); // 降级扎数 + objs[a++] = o.getOrderReplaceNum(); // 补货扎数 + objs[a++] = o.getProfitFeeAmount(); objs[a++] = o.getSettleStatus(); dataList.add(objs); @@ -261,7 +281,9 @@ String[] rowsName = new String[]{"序号","下单日期", "合伙人ID", "合伙人","底价" - , "合伙人加价", "会员折扣","优惠券","售后扣合伙人款","总包干费","实际销售扎数"}; + , "合伙人加价", "会员折扣","优惠券","售后扣合伙人款","总包干费" + ,"总售扎数","实际销售扎数","缺货扎数","降级扎数","补货扎数" + }; List<Object[]> dataList = new ArrayList<>(); int sn = 1; for (OrderPartnerReportResultVO o : list) { @@ -277,7 +299,13 @@ objs[a++] = o.getOrderCouponAmountTotal(); // 优惠券 objs[a++] = o.getOrderFeePartner(); //售后扣合伙人款 objs[a++] = o.getPartnerTotalFeeAmount(); // 总包干费 + + objs[a++] = o.getOrderNum(); // 总售扎数 objs[a++] = o.getRealSaleNum(); // 实际销售扎数 + objs[a++] = o.getOrderLackNum(); // 缺货扎数 + objs[a++] = o.getOrderReduceNum(); // 降级扎数 + objs[a++] = o.getOrderReplaceNum(); // 补货扎数 + dataList.add(objs); sn++; } diff --git a/src/main/resources/mapper/report/OrderReportMapper.xml b/src/main/resources/mapper/report/OrderReportMapper.xml index f58f1ae..b9b2d5c 100644 --- a/src/main/resources/mapper/report/OrderReportMapper.xml +++ b/src/main/resources/mapper/report/OrderReportMapper.xml @@ -216,6 +216,7 @@ IFNULL(sum(order_markup_partner_amount),0) as order_markup_partner_amount, IFNULL(sum(order_price_discount_amount),0) as order_price_discount_amount, IFNULL(sum(order_coupon_amount_total),0) as order_coupon_amount_total, + IFNULL(sum(order_check_fee)+sum(order_lack_fee_supplier)+sum(order_replace_fee),0) as order_check_total_fee, IFNULL(sum(order_check_fee),0) as order_check_fee, IFNULL(sum(order_lack_fee_supplier),0) as order_lack_fee_supplier, IFNULL(sum(order_replace_fee),0) as order_replace_fee, @@ -265,6 +266,7 @@ <sql id="baseSql"> select t2.*, + IFNULL(t2.order_check_fee+t2.order_lack_fee_supplier+t2.order_replace_fee,0) as order_check_total_fee, IFNULL(t3.fee_supplier,0) as order_fee_supplier, IFNULL(t3.fee_partner,0) as order_fee_partner, IFNULL(t3.fee_platform,0) as order_fee_platform, @@ -277,8 +279,19 @@ select t1.order_id, t1.total_amount ,sum(t1.num) as order_num , ( sum( t1.supplier_price_amount )+sum( t1.markup_one_amount )+sum( t1.markup_two_amount )+sum( t1.markup_partner_amount ) + t1.packing_fee + t1.transport_fee ) AS order_total, - sum(t1.supplier_price_amount) as order_supplier_price_amount, sum(t1.markup_one_amount) as order_markup_one_amount,sum(t1.markup_two_amount) as order_markup_two_amount, sum(t1.markup_partner_amount) as order_markup_partner_amount,sum(t1.price_amount) as order_price_amount,sum(t1.original_price_amount) as order_original_price_amount,sum(t1.price_discount_amount) as order_price_discount_amount,sum(t1.coupon_amount_total) as order_coupon_amount_total,sum(t1.check_fee) as order_check_fee,sum(t1.lack_fee_supplier) as order_lack_fee_supplier,sum(t1.replace_fee) as order_replace_fee, - sum(replace_num) as order_replace_num,sum(reduce_num) as order_reduce_num,sum(lack_num) as order_lack_num + sum(t1.supplier_price_amount) as order_supplier_price_amount, + sum(t1.markup_one_amount) as order_markup_one_amount, + sum(t1.markup_two_amount) as order_markup_two_amount, + sum(t1.markup_partner_amount) as order_markup_partner_amount, + sum(t1.price_amount) as order_price_amount,sum(t1.original_price_amount) as order_original_price_amount, + sum(t1.price_discount_amount) as order_price_discount_amount, + sum(t1.coupon_amount_total) as order_coupon_amount_total, + sum(t1.check_fee) as order_check_fee, + sum(t1.lack_fee_supplier) as order_lack_fee_supplier, + sum(t1.replace_fee) as order_replace_fee, + sum(replace_num) as order_replace_num, + sum(reduce_num) as order_reduce_num, + sum(lack_num) as order_lack_num from ( SELECT o.total_amount, o.flower_amount, o.packing_fee, o.transport_fee, -- Gitblit v1.9.3