rk
15 小时以前 086be7eae50e48ad554fd8a3f4cb1e333d587595
Merge remote-tracking branch 'origin/master'
已添加1个文件
已修改10个文件
291 ■■■■■ 文件已修改
admin/src/api/business/workbench.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/business/OperaGoodsOrderDetail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/index.vue 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsorderController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_admin/src/main/java/com/doumee/api/business/WorkbenchController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/dao/business/MemberCouponMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/dao/business/model/MemberCoupon.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/dao/system/vo/NumberDataCountVO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/WorkbenchService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/impl/WorkbenchServiceImpl.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/business/workbench.js
@@ -15,3 +15,13 @@
    trim: true
  })
}
export function couponData (data) {
  return request.post('/business/workbench/couponData', data, {
    trim: true
  })
}
export function integralData (data) {
  return request.post('/business/workbench/integralData', data, {
    trim: true
  })
}
admin/src/components/business/OperaGoodsOrderDetail.vue
@@ -105,7 +105,7 @@
        <div class="info-item"  >
          <div class="info-item-a">返还用户积分:<span class="orange"> {{(info.returnMemberIntegral||0)}}</span></div>
          <div class="info-item-a">返还经销商积分:<span class="orange">{{info.returnCustomerIntegral || 0 }}</span></div>
          <div class="info-item-a"></div>
          <div class="info-item-a">经销商金额:<span class="orange"> ï¿¥{{(info.shopSettlement||0).toFixed(2)}}</span></div>
        </div>
        <div class="info-item"></div>
      <div class="header">
admin/src/views/index.vue
@@ -56,7 +56,7 @@
      <div class="change-style">
        <div class="count-left">
          <div class="item-title" style="display: flex;">
            <span style="flex: 1">经销商IOP10</span>
            <span style="flex: 1">经销商TOP10</span>
            <div class="tab-item" style="text-align: right;flex: 1.5; ">
              <span v-for="(item,index) in tabs1" :key="'tab'+index"  :class="item.index==tabIndex1?'active-tab tab-btn':'tab-btn'" @click="changeTab1(item)">{{item.name}}</span>
            </div>
@@ -98,7 +98,7 @@
        <div class="tab-title" style="display: flex;align-items: center; ">
          <span style="">营销数据分析</span>
          <div class="tab-item" style="margin-left: 20px;" >
            <el-date-picker  style="width: 110px;height: 22px;margin-right: 10px;"   v-model="searchForm.topYear2"  type="year"
            <el-date-picker  style="width: 110px;height: 22px;margin-right: 10px;"   v-model="searchForm.topYear2"  type="year" @change="changeYear"
                             clearable  value-format="yyyy"     format="yyyy'å¹´'"   placeholder="年份" ></el-date-picker>
          </div>
        </div>
@@ -106,25 +106,26 @@
      <div class="change-style">
        <div class="count-left">
          <div class="item-title">积分发放类型占比</div>
          <div  class="bottom2" style="display: flex">
              <div ref="integralCount" style="flex: 1"></div>
              <div style="flex: 1;font-size: 14px;font-weight: 500;">
                  <div>累计消耗:{{10000}}</div>
                  <div>累计优惠金额:¥{{10000 }}</div>
          <div  class="bottom2" style="display: flex;align-items: center">
              <div ref="integralCount" style="flex: 1;min-height: 200px;"></div>
              <div style="flex: 1;font-size: 14px;font-weight: 500;margin-left: 20px;">
                  <div>累计发放数量:{{( dataList4.num || 0 ) +( dataList4.num1 || 0 )+( dataList4.num2 || 0 )+( dataList4.num3 || 0 )}}</div>
                  <div>累计消耗:{{ dataList4.useNum || 0 }}</div>
                  <div>累计优惠金额:¥{{(dataList4.price || 0 ).toFixed(2) }}</div>
              </div>
          </div>
        </div>
        <div class="count-right">
          <div class="item-title">优惠券发放类型占比</div>
          <div  class="bottom2">
            <div  class="bottom2" style="display: flex">
              <div ref="couponCount" style="flex: 1"></div>
              <div style="flex: 1;font-size: 14px;font-weight: 500;">
                <div>已使用优惠券:{{10000}}</div>
                <div>累计优惠金额:¥{{10000 }}</div>
            <div  class="bottom2" style="display: flex;align-items: center">
              <div ref="couponCount" style="flex: 1;min-height: 200px;"></div>
              <div style="flex: 1;font-size: 14px;font-weight: 500;margin-left: 20px;">
                <div>累计发放数量:{{( dataList3.num || 0 ) +( dataList3.num1 || 0 )}}</div>
                <div>已使用优惠券:{{ dataList3.useNum || 0 }}</div>
                <div>累计优惠金额:¥{{(dataList3.price || 0 ).toFixed(2) }}</div>
                <div>促成交易金额:¥{{(dataList3.orderPrice || 0 ).toFixed(2) }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="change-style" v-if="1==2">
@@ -150,6 +151,8 @@
      loading1: false,
      loading2: false,
      loading3: false,
      loading4: false,
      loading5: false,
      tabs2: [{ index: 0, name: '按销量' }, { index: 1, name: '按销售额' }],
      tabs1: [{ index: 0, name: '按订单量' }, { index: 1, name: '按销售额' }, { index: 2, name: '按会员数' }],
      tabs: [{ index: 0, name: '今日' }, { index: 1, name: '近7日' }, { index: 2, name: '近30日' }, { index: 3, name: '近12月' }],
@@ -181,8 +184,12 @@
      },
      dataList1: [],
      dataList2: [],
      dataList4: [],
      dataList3: [],
      myChart0: null,
      myChart1: null
      myChart1: null,
      myChart2: null,
      myChart3: null
    }
  },
  created () {
@@ -197,11 +204,37 @@
    this.initTopData()
    this.initShopRankData()
    this.initGoodsRankData()
    this.initIntegralData()
    this.initCouponData()
  },
  methods: {
    changeYearMonth(){
      this.initGoodsRankData()
      this.initShopRankData()
    },
    changeYear(){
      this.initIntegralData()
      this.initCouponData()
    },
    initCouponData () {
      this.loading4 = true
      this.api.couponData({year: this.searchForm.topYear2}).then(res => {
        res = res || {}
        this.dataList3 = res
        this.renderEchartOption3()
      }).finally(() => {
        this.loading4 = false
      })
    },
    initIntegralData () {
      this.loading5 = true
      this.api.integralData({ year: this.searchForm.topYear2}).then(res => {
        res = res || {}
        this.dataList4 = res
        this.renderEchartOption2()
      }).finally(() => {
        this.loading5 = false
      })
    },
    initShopRankData () {
      this.loading2 = true
@@ -236,7 +269,7 @@
        res.cateList = res.cateList || []
        this.topData = res
        this.renderEchartOption0()
        this.renderEchartOption2()
        this.renderEchartOption1()
      }).finally(() => {
        this.loading1 = false
      })
@@ -250,8 +283,18 @@
      window.addEventListener('resize', () => {
        this.myChart1.resize()
      })
      this.myChart2 = echarts.init(this.$refs.integralCount)
      window.addEventListener('resize', () => {
        this.myChart2.resize()
      })
      this.myChart3 = echarts.init(this.$refs.couponCount)
      window.addEventListener('resize', () => {
        this.myChart3.resize()
      })
      this.renderEchartOption0()
      this.renderEchartOption1()
      this.renderEchartOption2()
      this.renderEchartOption3()
    },
    changeTab (item) {
      if (this.loading1) {
@@ -336,7 +379,7 @@
        ]
      })
    },
    renderEchartOption2 () {
    renderEchartOption1 () {
      const series = []
      this.topData.cateList.forEach((item, index) => {
        series.push( {
@@ -347,7 +390,7 @@
          label: {
            // show: true
          },
          data: item.data||[]
          data: item.data || []
        })
      })
      this.myChart1.setOption({
@@ -375,10 +418,62 @@
          boundaryGap: false,
          data: this.topData.dateStrList || []
        },
        yAxis: { type: 'value' } ,
        yAxis: { type: 'value' },
        series
      })
    }
    },
    renderEchartOption2() {
      this.myChart2.setOption({
        tooltip: {
          trigger: 'item'
        },
        series: [
          {
            name: 'Access From',
            type: 'pie',
            radius: '50%',
            data: [
              { value: this.dataList4.num || 0, name: '手动增加' },
              { value: this.dataList4.num1 || 0, name: '邀请好友' },
              { value: this.dataList4.num2 || 0, name: '消费返利' },
              { value: this.dataList4.num3 || 0, name: '注册赠送' }
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      })
    },
    renderEchartOption3() {
      this.myChart3.setOption({
        tooltip: {
          trigger: 'item'
        },
        series: [
          {
            name: '优惠券发放',
            type: 'pie',
            radius: '50%',
            data: [
              { value: this.dataList3.num1 || 0, name: '折扣券' },
              { value: this.dataList3.num || 0, name: '满减券' }
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      })
    },
  }
}
</script>
server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsorderController.java
@@ -12,6 +12,8 @@
import com.doumee.core.utils.kuaidi100.ExpressUtils;
import com.doumee.dao.business.model.Goodsorder;
import com.doumee.dao.business.model.GoodsorderExport;
import com.doumee.dao.web.request.AfterSaleApplyRequest;
import com.doumee.service.business.AftersaleService;
import com.doumee.service.business.GoodsorderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -36,6 +38,8 @@
    @Autowired
    private GoodsorderService goodsorderService;
    @Autowired
    private AftersaleService aftersaleService;
    @PreventRepeat
    @ApiOperation("新建")
@@ -140,8 +144,8 @@
    @ApiOperation("订单退款")
    @PostMapping("/orderRefund")
    @RequiresPermissions("business:goodsorder:update")
    public ApiResponse orderRefund(@RequestBody Goodsorder goodsorder) {
        goodsorderService.orderRefund(goodsorder);
    public ApiResponse orderRefund(@RequestBody AfterSaleApplyRequest goodsorder) {
        aftersaleService.afterSaleApply(goodsorder);
        return ApiResponse.success(null);
    }
server/dmmall_admin/src/main/java/com/doumee/api/business/WorkbenchController.java
@@ -7,6 +7,7 @@
import com.doumee.dao.system.dto.CountDataDTO;
import com.doumee.dao.system.vo.BusinessDataCountVO;
import com.doumee.dao.system.vo.CountDataVO;
import com.doumee.dao.system.vo.NumberDataCountVO;
import com.doumee.service.business.FundService;
import com.doumee.service.business.WorkbenchService;
import io.swagger.annotations.Api;
@@ -34,6 +35,16 @@
    public ApiResponse<BusinessDataCountVO> businessData(@RequestBody CountDataDTO param) {
        return ApiResponse.success(workbenchService.businessData(param));
    }
    @ApiOperation("积分发放数据统计")
    @PostMapping("/integralData")
    public ApiResponse<NumberDataCountVO> integralData(@RequestBody CountDataDTO param) {
        return ApiResponse.success(workbenchService.integralData(param));
    }
    @ApiOperation("优惠券发放数据统计")
    @PostMapping("/couponData")
    public ApiResponse<NumberDataCountVO> couponData(@RequestBody CountDataDTO param) {
        return ApiResponse.success(workbenchService.couponData(param));
    }
    @ApiOperation("经销商TOP10")
    @PostMapping("/shopRankList10")
    public ApiResponse<List<BusinessDataCountVO>> shopRankList10(@RequestBody CountDataDTO param) {
server/dmmall_service/src/main/java/com/doumee/dao/business/MemberCouponMapper.java
@@ -7,6 +7,7 @@
import com.doumee.dao.business.model.MemberCoupon;
import com.doumee.dao.web.dto.CouponDTO;
import com.doumee.dao.web.response.MemberCouponResponse;
import com.github.yulichang.base.mapper.MPJJoinMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -14,7 +15,7 @@
 * @author æ±Ÿè¹„蹄
 * @date 2023/03/21 15:48
 */
public interface MemberCouponMapper extends BaseMapper<MemberCoupon> {
public interface MemberCouponMapper extends MPJJoinMapper<MemberCoupon> {
    @Select(" select m.*   " +
server/dmmall_service/src/main/java/com/doumee/dao/business/model/MemberCoupon.java
@@ -117,6 +117,9 @@
    @TableField(exist = false)
    @ExcelColumn(name="用户",width = 10,index = 1)
    private String nikeName;
    @ApiModelProperty(value = "统计数量")
    @TableField(exist = false)
    private Long num;
    @ApiModelProperty(value = "关联订单号号")
    @ExcelColumn(name="关联订单号",width = 10,index = 10)
    @TableField(exist = false)
server/dmmall_service/src/main/java/com/doumee/dao/system/vo/NumberDataCountVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.doumee.dao.system.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
@ApiModel("积分、优惠券发放统计数据")
public class NumberDataCountVO {
    @ApiModelProperty(value = "积分手动增加、满减优惠券数量")
    private Long num;
    @ApiModelProperty(value = "积分邀请好友增加、折扣券数据")
    private Long num1;
    @ApiModelProperty(value = "积分消费返利增加")
    private Long num2;
    @ApiModelProperty(value = "积分注册赠送增加")
    private Long num3;
    @ApiModelProperty(value = "累计消耗积分、累计使用优惠券数量")
    private Long useNum;
    @ApiModelProperty(value = "累计优惠金额")
    private BigDecimal price;
    @ApiModelProperty(value = "累计交易金额")
    private BigDecimal orderPrice;
}
server/dmmall_service/src/main/java/com/doumee/service/business/WorkbenchService.java
@@ -6,6 +6,7 @@
import com.doumee.dao.system.dto.CountDataDTO;
import com.doumee.dao.system.vo.BusinessDataCountVO;
import com.doumee.dao.system.vo.CountDataVO;
import com.doumee.dao.system.vo.NumberDataCountVO;
import java.util.List;
@@ -16,6 +17,8 @@
 */
public interface WorkbenchService {
    NumberDataCountVO integralData(CountDataDTO param);
    NumberDataCountVO couponData(CountDataDTO param);
    BusinessDataCountVO businessData(CountDataDTO param);
    List<BusinessDataCountVO> shopRankList10(CountDataDTO param);
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
@@ -1845,6 +1845,7 @@
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"操作失败:订单未完成,无法退款!");
        }
    }
server/dmmall_service/src/main/java/com/doumee/service/business/impl/WorkbenchServiceImpl.java
@@ -23,6 +23,7 @@
import com.doumee.dao.system.model.SystemUser;
import com.doumee.dao.system.vo.BusinessDataCountVO;
import com.doumee.dao.system.vo.CountDataVO;
import com.doumee.dao.system.vo.NumberDataCountVO;
import com.doumee.dao.web.dto.CollectDTO;
import com.doumee.dao.web.dto.MemberDTO;
import com.doumee.dao.web.dto.MultiFileDTO;
@@ -59,6 +60,12 @@
public class WorkbenchServiceImpl implements WorkbenchService {
    @Autowired
    private GoodsorderMapper goodsorderMapper;
    @Autowired
    private MemberCouponMapper memberCouponMapper;
    @Autowired
    private InviteRecordMapper inviteRecordMapper;
    @Autowired
    private IntegralMapper integralMapper;
    @Autowired
    private GoodsorderDetailMapper goodsorderDetailMapper;
    @Override
@@ -122,6 +129,86 @@
        return list1;
    }
    @Override
    public    NumberDataCountVO couponData(CountDataDTO param){
        NumberDataCountVO data = new NumberDataCountVO();
        //发放类型统计
        List<MemberCoupon> r1 =  memberCouponMapper.selectList(new MPJLambdaWrapper<MemberCoupon>()
                .select("(select count(t.id) )",MemberCoupon::getNum)
                .select( MemberCoupon::getCouponType)
                .apply(param.getYear()!=null,"YEAR ( t.CREATE_DATE )="+param.getYear() )
                .eq(MemberCoupon::getIsdeleted,Constants.ZERO)
                .groupBy(MemberCoupon::getCouponType));
        if(r1!=null){
            for(MemberCoupon c : r1){
                if(Constants.equalsInteger(c.getCouponType(),Constants.ZERO)){
                    data.setNum(Constants.formatLongNum(c.getNum()));//满减券
                }else{
                    data.setNum1(Constants.formatLongNum(c.getNum()));//满减券
                }
            }
        }
        //已使用
        Long r2 =  memberCouponMapper.selectCount(new MPJLambdaWrapper<MemberCoupon>()
                .apply(param.getYear()!=null,"YEAR ( t.use_Date )="+param.getYear() )
                .eq(MemberCoupon::getIsdeleted,Constants.ZERO));
        data.setUseNum(Constants.formatLongNum(r2));
        //优惠金额和交易金额
        Goodsorder r3 =  goodsorderMapper.selectOne(new MPJLambdaWrapper<Goodsorder>()
                .select("(select sum(t.total_price) )",Goodsorder::getTotalPrice)
                .select("(select sum(t.coupon_price) )",Goodsorder::getCouponPrice)
                .apply(param.getYear()!=null,"YEAR ( t.CREATE_DATE )="+param.getYear() )
                .eq(Goodsorder::getIsdeleted,Constants.ZERO)
                .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) );
        if(r3!=null){
            data.setPrice(Constants.formatBigdecimal(r3.getCouponPrice()));
            data.setOrderPrice(Constants.formatBigdecimal(r3.getTotalPrice()));
        }
        return  data;
    }
    @Override
    public    NumberDataCountVO integralData(CountDataDTO param){
        NumberDataCountVO data = new NumberDataCountVO();
        //发放积分类型统计
        List<Integral> r1 =  integralMapper.selectList(new MPJLambdaWrapper<Integral>()
                .select("(select sum(t.num) )",Integral::getNum)
                .select( Integral::getObjType)
                .apply(param.getYear()!=null,"YEAR ( t.CREATE_DATE )="+param.getYear() )
                .eq(Integral::getIsdeleted,Constants.ZERO)
                .eq(Integral::getType,Constants.ZERO)
                .in(Integral::getObjType,Constants.IntegralObjType.REGISTER.getKey(),
                        Constants.IntegralObjType.INVITENEWUSER.getKey(),
                        Constants.IntegralObjType.ORDER_DONATE.getKey(),
                        Constants.IntegralObjType.SYSTEM_RECHARGE.getKey())
                .groupBy(Integral::getObjType));
        if(r1!=null){
            for(Integral c : r1){
                if(Constants.equalsInteger(c.getObjType(),Constants.IntegralObjType.SYSTEM_RECHARGE.getKey())){
                    data.setNum(Constants.formatBigdecimal(c.getNum()).longValue());//平台添加
                }else if(Constants.equalsInteger(c.getObjType(),Constants.IntegralObjType.INVITENEWUSER.getKey())){
                    data.setNum1(Constants.formatBigdecimal(c.getNum()).longValue());//邀请
                }else if(Constants.equalsInteger(c.getObjType(),Constants.IntegralObjType.ORDER_DONATE.getKey())){
                    data.setNum2(Constants.formatBigdecimal(c.getNum()).longValue());//消费返利
                }else if(Constants.equalsInteger(c.getObjType(),Constants.IntegralObjType.REGISTER.getKey())){
                    data.setNum3(Constants.formatBigdecimal(c.getNum()).longValue());//注册
                }
            }
        }
        //优惠金额和交易金额
        Goodsorder r3 =  goodsorderMapper.selectOne(new MPJLambdaWrapper<Goodsorder>()
                .select("(select sum(t.integral) )",Goodsorder::getIntegral)
                .select("(select sum(t.use_integral) )",Goodsorder::getUseIntegral)
                .apply(param.getYear()!=null,"YEAR ( t.CREATE_DATE )="+param.getYear() )
                .eq(Goodsorder::getIsdeleted,Constants.ZERO)
                .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) );
        if(r3!=null){
            data.setUseNum(Constants.formatBigdecimal(r3.getUseIntegral()).longValue());
            data.setPrice(Constants.formatBigdecimal(r3.getIntegral()));
        }
        return  data;
    }
    @Override
    public BusinessDataCountVO businessData(CountDataDTO param) {
        BusinessDataCountVO data = new BusinessDataCountVO();
        int dataType = param.getDateType();//0今日 1近七日 2近30日 3近1å¹´