licailing 4 лет назад
Родитель
Сommit
019bb2de45

+ 4 - 9
src/main/java/com/izouma/jiashanxia/domain/User.java

@@ -21,6 +21,7 @@ import javax.validation.constraints.Pattern;
 import javax.validation.constraints.Size;
 import javax.validation.constraints.Size;
 import java.io.Serializable;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
 import java.util.HashSet;
 import java.util.HashSet;
 import java.util.List;
 import java.util.List;
 import java.util.Set;
 import java.util.Set;
@@ -78,18 +79,9 @@ public class User extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "可提现收益")
     @ApiModelProperty(value = "可提现收益")
     private BigDecimal amount;
     private BigDecimal amount;
 
 
-//    @ApiModelProperty(value = "直卖收益")
-//    private BigDecimal promote;
-//
-//    @ApiModelProperty(value = "二级收益")
-//    private BigDecimal childPromote;
-
     @ApiModelProperty(value = "待入账")
     @ApiModelProperty(value = "待入账")
     private BigDecimal cacheAmount;
     private BigDecimal cacheAmount;
 
 
-//    @ApiModelProperty(value = "已提现收益")
-//    private BigDecimal withdraw;
-
     private Long parent;
     private Long parent;
 
 
     @ApiModelProperty(value = "企业id")
     @ApiModelProperty(value = "企业id")
@@ -113,6 +105,9 @@ public class User extends BaseEntity implements Serializable {
 
 
     private boolean isVip;
     private boolean isVip;
 
 
+    @ApiModelProperty(value = "成为vip时间")
+    private LocalDateTime becomeTime;
+
     @Transient
     @Transient
     private String sessionKey;
     private String sessionKey;
 
 

+ 29 - 4
src/main/java/com/izouma/jiashanxia/dto/StatisticVO.java

@@ -1,11 +1,36 @@
 package com.izouma.jiashanxia.dto;
 package com.izouma.jiashanxia.dto;
 
 
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 
 
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
 public class StatisticVO {
 public class StatisticVO {
-    @ApiModelProperty(value = "直推团长")
-    private int directlyPush;
-    @ApiModelProperty(value = "间推团长")
-    private int indirectPush;
+    private Long userId;
+
+    @ApiModelProperty(value = "直推佳人数量")
+    private int expert;
+
+    @ApiModelProperty(value = "直推佳人销售")
+    private BigDecimal expertAmount;
+
+    @ApiModelProperty(value = "直推普通用户销售额")
+    private BigDecimal normalAmount;
+
+    private LocalDate date;
+
+    @ApiModelProperty(value = "下级推荐佳人人数(直推/间推)")
+    private int childrenExpert;
+
+    private BigDecimal childrenExpertAmount;
 
 
+    private BigDecimal childrenNormalAmount;
 }
 }

+ 6 - 1
src/main/java/com/izouma/jiashanxia/repo/OrderInfoRepo.java

@@ -9,6 +9,7 @@ import org.springframework.data.jpa.repository.Query;
 
 
 import javax.transaction.Transactional;
 import javax.transaction.Transactional;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.Collection;
 import java.util.List;
 import java.util.List;
 
 
 public interface OrderInfoRepo extends JpaRepository<OrderInfo, Long>, JpaSpecificationExecutor<OrderInfo> {
 public interface OrderInfoRepo extends JpaRepository<OrderInfo, Long>, JpaSpecificationExecutor<OrderInfo> {
@@ -25,7 +26,7 @@ public interface OrderInfoRepo extends JpaRepository<OrderInfo, Long>, JpaSpecif
     @Query(nativeQuery = true, value = "SELECT count(1) FROM order_info")
     @Query(nativeQuery = true, value = "SELECT count(1) FROM order_info")
     int orderNum();
     int orderNum();
 
 
-    long countByStatus(OrderInfoStatus status);
+    long countByStatusIn(List<OrderInfoStatus> status);
 
 
     List<OrderInfo> findAllByPaidAtBetweenAndStatus(LocalDateTime paidAt, LocalDateTime paidAt2, OrderInfoStatus status);
     List<OrderInfo> findAllByPaidAtBetweenAndStatus(LocalDateTime paidAt, LocalDateTime paidAt2, OrderInfoStatus status);
 
 
@@ -36,4 +37,8 @@ public interface OrderInfoRepo extends JpaRepository<OrderInfo, Long>, JpaSpecif
     List<OrderInfo> findAllByStatus(OrderInfoStatus status);
     List<OrderInfo> findAllByStatus(OrderInfoStatus status);
 
 
     List<OrderInfo> findAllByStatusAndUserId(OrderInfoStatus status, Long userId);
     List<OrderInfo> findAllByStatusAndUserId(OrderInfoStatus status, Long userId);
+
+    List<OrderInfo> findAllByStatusInAndUserIdIn(List<OrderInfoStatus> status, Iterable<Long> userId);
+
+    List<OrderInfo> findAllByStatusInAndUserIdInAndPaidAtBetween(Collection<OrderInfoStatus> status, Collection<Long> userId, LocalDateTime paidAt, LocalDateTime paidAt2);
 }
 }

+ 1 - 2
src/main/java/com/izouma/jiashanxia/repo/UserRepo.java

@@ -9,6 +9,7 @@ import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.jpa.repository.Query;
 
 
 import javax.transaction.Transactional;
 import javax.transaction.Transactional;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.List;
 
 
 public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExecutor<User> {
 public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExecutor<User> {
@@ -37,8 +38,6 @@ public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExe
     @Query("select u.id from User u  where u.parent in ?1")
     @Query("select u.id from User u  where u.parent in ?1")
     List<Long> findIdByParentInAndDelFalse(Iterable<Long> parent);
     List<Long> findIdByParentInAndDelFalse(Iterable<Long> parent);
 
 
-    long countByParentAndDelFalse(Long parentId);
-
     // 身份为其他身份的下级的数量
     // 身份为其他身份的下级的数量
     long countByParentAndMemberAndDelFalse(Long parent, Member member);
     long countByParentAndMemberAndDelFalse(Long parent, Member member);
 
 

+ 1 - 1
src/main/java/com/izouma/jiashanxia/service/PackageService.java

@@ -155,6 +155,6 @@ public class PackageService {
     }
     }
 
 
     public String shareImg(Long userId, Long id) throws IOException, WxErrorException {
     public String shareImg(Long userId, Long id) throws IOException, WxErrorException {
-        return userService.createShareImg2(userId, true, id,"share_package/v2/");
+        return userService.createShareImg2(userId, false, id,"share_package/v2/");
     }
     }
 }
 }

+ 91 - 9
src/main/java/com/izouma/jiashanxia/service/StatisticService.java

@@ -1,11 +1,10 @@
 package com.izouma.jiashanxia.service;
 package com.izouma.jiashanxia.service;
 
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
-import com.izouma.jiashanxia.domain.CommissionRecord;
-import com.izouma.jiashanxia.domain.OrderInfo;
-import com.izouma.jiashanxia.domain.Withdraw;
-import com.izouma.jiashanxia.domain.WxFee;
+import com.izouma.jiashanxia.domain.*;
 import com.izouma.jiashanxia.dto.StatisticDTO;
 import com.izouma.jiashanxia.dto.StatisticDTO;
+import com.izouma.jiashanxia.dto.StatisticVO;
+import com.izouma.jiashanxia.enums.Member;
 import com.izouma.jiashanxia.enums.OrderInfoStatus;
 import com.izouma.jiashanxia.enums.OrderInfoStatus;
 import com.izouma.jiashanxia.enums.WithdrawStatus;
 import com.izouma.jiashanxia.enums.WithdrawStatus;
 import com.izouma.jiashanxia.repo.*;
 import com.izouma.jiashanxia.repo.*;
@@ -17,10 +16,7 @@ import javax.persistence.criteria.Predicate;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.LocalTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 @Service
 @Service
@@ -41,7 +37,7 @@ public class StatisticService {
     public Map<String, Object> dataOverview() {
     public Map<String, Object> dataOverview() {
         long user = userRepo.count();
         long user = userRepo.count();
         long company = attractionsRepo.count();
         long company = attractionsRepo.count();
-        long order = orderInfoRepo.countByStatus(OrderInfoStatus.PAID);
+        long order = orderInfoRepo.countByStatusIn(CollUtil.newArrayList(OrderInfoStatus.PAID, OrderInfoStatus.USED));
         BigDecimal fee = wxFeeRepo.sumByAmount();
         BigDecimal fee = wxFeeRepo.sumByAmount();
 
 
         Map<String, Object> data = new HashMap<>();
         Map<String, Object> data = new HashMap<>();
@@ -233,4 +229,90 @@ public class StatisticService {
         }
         }
         return dtos;
         return dtos;
     }
     }
+
+    public List<StatisticVO> getVO(String time, Long userId) {
+        // 时间段
+        LocalDateTime start = DateTimeUtils.toLocalDateTime(time, "yyyy-MM-dd HH:mm:ss");
+        LocalDateTime end = start.plusMonths(1);
+        long day = end.toLocalDate().toEpochDay() - start.toLocalDate().toEpochDay();
+
+        // 用户
+        List<User> users = userRepo.findAllByParentAndDelFalse(userId);
+        List<Long> userIds = users.stream().map(User::getId).collect(Collectors.toList());
+        List<Long> normal = users.stream()
+                .filter(user -> Member.NORMAL.equals(user.getMember()))
+                .map(User::getId)
+                .collect(Collectors.toList());
+
+        // 下级的直推+间推
+        List<User> children = userRepo.findAllByParentInAndDelFalse(userIds);
+        List<Long> childrenIds = children.stream().map(User::getId).collect(Collectors.toList());
+        children.addAll(userRepo.findAllByParentInAndDelFalse(childrenIds));
+        childrenIds.addAll(userIds);
+        List<Long> childrenNormal = children.stream()
+                .filter(user -> Member.NORMAL.equals(user.getMember()))
+                .map(User::getId)
+                .collect(Collectors.toList());
+
+        // 订单
+        List<OrderInfo> orderInfos = orderInfoRepo
+                .findAllByStatusInAndUserIdInAndPaidAtBetween(CollUtil.newArrayList(OrderInfoStatus.PAID, OrderInfoStatus.USED), childrenIds, start, end);
+
+        List<StatisticVO> vos = new ArrayList<>();
+        // 按日期查找
+        while (day > 0) {
+            end = start.plusDays(1);
+            Map<String, BigDecimal> map = this.getMap(users, normal, orderInfos, start, end);
+            Map<String, BigDecimal> childrenMap = this.getMap(children, childrenNormal, orderInfos, start, end);
+            vos.add(StatisticVO.builder()
+                    .date(start.toLocalDate())
+                    .userId(userId)
+                    .expert(map.get("expert").intValue())
+                    .expertAmount(map.get("reduce"))
+                    .normalAmount(map.get("reduce2"))
+                    .childrenExpert(childrenMap.get("expert").intValue())
+                    .childrenExpertAmount(childrenMap.get("reduce"))
+                    .childrenNormalAmount(childrenMap.get("reduce2"))
+                    .build());
+            start = end;
+            day--;
+        }
+        return vos;
+    }
+
+    public Map<String, BigDecimal> getMap(List<User> users, List<Long> normal, List<OrderInfo> orderInfos,
+                                          LocalDateTime start, LocalDateTime end) {
+        // 佳人数量
+        long expert = users.stream()
+                .filter(user -> (Member.EXPERT.equals(user.getMember()) || Member.BIG_EXPERT.equals(user.getMember())) && !start
+                        .isAfter(user.getBecomeTime()) && end.isAfter(user.getBecomeTime()))
+                .count();
+
+        // 之前的佳人
+        List<Long> expertUser = users.stream()
+                .filter(user -> (Member.EXPERT.equals(user.getMember()) || Member.BIG_EXPERT.equals(user.getMember())) && start
+                        .isAfter(user.getBecomeTime()))
+                .map(User::getId)
+                .collect(Collectors.toList());
+
+        // 佳人销售额
+        BigDecimal reduce = orderInfos.stream()
+                .filter(order -> expertUser.contains(order.getUserId()) && !start.isAfter(order.getPaidAt()) && end
+                        .isAfter(order.getPaidAt()))
+                .map(OrderInfo::getPrice)
+                .reduce(BigDecimal.ZERO, BigDecimal::add);
+
+        // 普通用户销售额
+        BigDecimal reduce2 = orderInfos.stream()
+                .filter(order -> normal.contains(order.getUserId()) && !start.isAfter(order.getPaidAt()) && end
+                        .isAfter(order.getPaidAt()))
+                .map(OrderInfo::getPrice)
+                .reduce(BigDecimal.ZERO, BigDecimal::add);
+
+        Map<String, BigDecimal> map = new HashMap<>();
+        map.put("expert", new BigDecimal(expert));
+        map.put("reduce", reduce);
+        map.put("reduce2", reduce2);
+        return map;
+    }
 }
 }

+ 10 - 3
src/main/java/com/izouma/jiashanxia/service/UserService.java

@@ -59,6 +59,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.net.URL;
 import java.net.URL;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.*;
 import java.util.List;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
@@ -155,6 +156,8 @@ public class UserService {
                     // 邀请成为黄金佳人 就改变上级为邀请者
                     // 邀请成为黄金佳人 就改变上级为邀请者
                     if (expert && !userInfo.isVip()) {
                     if (expert && !userInfo.isVip()) {
                         userInfo.setVip(true);
                         userInfo.setVip(true);
+                        // 成为时间,算直推间推数量
+                        userInfo.setBecomeTime(LocalDateTime.now());
                         userInfo.setMember(Member.EXPERT);
                         userInfo.setMember(Member.EXPERT);
                         userInfo.setParent(parent);
                         userInfo.setParent(parent);
                         // 邀请黄金佳人升级
                         // 邀请黄金佳人升级
@@ -176,11 +179,12 @@ public class UserService {
                     .teamFounder(false)
                     .teamFounder(false)
                     .sessionKey(sessionKey)
                     .sessionKey(sessionKey)
                     .member(Member.NORMAL)
                     .member(Member.NORMAL)
-//                    .withdraw(BigDecimal.ZERO)
                     .cacheAmount(BigDecimal.ZERO)
                     .cacheAmount(BigDecimal.ZERO)
                     .build();
                     .build();
             if (ObjectUtil.isNotEmpty(parent) && expert) {
             if (ObjectUtil.isNotEmpty(parent) && expert) {
                 userInfo.setVip(true);
                 userInfo.setVip(true);
+                // 成为时间,算直推间推数量
+                userInfo.setBecomeTime(LocalDateTime.now());
                 userInfo.setMember(Member.EXPERT);
                 userInfo.setMember(Member.EXPERT);
             }
             }
             userInfo = userRepo.saveAndFlush(userInfo);
             userInfo = userRepo.saveAndFlush(userInfo);
@@ -253,7 +257,6 @@ public class UserService {
                     .teamFounder(false)
                     .teamFounder(false)
                     .wxAuthorized(true)
                     .wxAuthorized(true)
                     .member(Member.NORMAL)
                     .member(Member.NORMAL)
-//                    .withdraw(BigDecimal.ZERO)
                     .cacheAmount(BigDecimal.ZERO)
                     .cacheAmount(BigDecimal.ZERO)
                     .build();
                     .build();
             user = userRepo.save(user);
             user = userRepo.save(user);
@@ -410,6 +413,9 @@ public class UserService {
         }), JpaUtils.toPageRequest(pageQuery));
         }), JpaUtils.toPageRequest(pageQuery));
     }
     }
 
 
+    /*
+    数据总揽
+     */
     public Map<String, Object> overview(Long userId) {
     public Map<String, Object> overview(Long userId) {
         Map<String, Object> map = new HashMap<>();
         Map<String, Object> map = new HashMap<>();
         List<CommissionRecord> records = commissionRecordRepo.findAllByUserIdAndIsRefundFalse(userId);
         List<CommissionRecord> records = commissionRecordRepo.findAllByUserIdAndIsRefundFalse(userId);
@@ -467,6 +473,7 @@ public class UserService {
         }
         }
         user.setMember(Member.EXPERT);
         user.setMember(Member.EXPERT);
         user.setVip(true);
         user.setVip(true);
+        user.setBecomeTime(LocalDateTime.now());
         return userRepo.save(user);
         return userRepo.save(user);
     }
     }
 
 
@@ -607,7 +614,7 @@ public class UserService {
 //            userRepo.save(user);
 //            userRepo.save(user);
 //        }
 //        }
 //        return user.getShareImg();
 //        return user.getShareImg();
-        return this.createShareImg2(userId, false, null, "share_img/v2/");
+        return this.createShareImg2(userId, true, null, "share_img/v2/");
     }
     }
 
 
     public String createShareImg(Long userId) throws IOException, WxErrorException {
     public String createShareImg(Long userId) throws IOException, WxErrorException {

+ 8 - 0
src/main/vue/src/router.js

@@ -79,6 +79,14 @@ const router = new Router({
                         title: '推广列表'
                         title: '推广列表'
                     }
                     }
                 },
                 },
+                {
+                    path: '/employee',
+                    name: 'employee',
+                    component: () => import(/* webpackChunkName: "employee" */ '@/views/employee/Employee.vue'),
+                    meta: {
+                        title: '直推'
+                    }
+                },
                 {
                 {
                     path: '/employeeList',
                     path: '/employeeList',
                     name: 'employeeList',
                     name: 'employeeList',

+ 2 - 2
src/main/vue/src/views/CommissionRecordList.vue

@@ -159,8 +159,8 @@ export default {
             if (this.dateRange && this.dateRange.length > 0) {
             if (this.dateRange && this.dateRange.length > 0) {
                 data.query.createdAt = this.dateRange[0] + ',' + this.dateRange[1];
                 data.query.createdAt = this.dateRange[0] + ',' + this.dateRange[1];
             }
             }
-            if (this.$route.query.id) {
-                data.query.userId = Number(this.$route.query.id);
+            if (this.$route.query.userId) {
+                data.query.userId = Number(this.$route.query.userId);
             }
             }
             if (this.transactionType) {
             if (this.transactionType) {
                 data.query.transactionType = this.transactionType;
                 data.query.transactionType = this.transactionType;

+ 0 - 1
src/main/vue/src/views/OrderInfoList.vue

@@ -100,7 +100,6 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-import { mapState } from 'vuex';
 import pageableTable from '@/mixins/pageableTable';
 import pageableTable from '@/mixins/pageableTable';
 
 
 export default {
 export default {

+ 1 - 1
src/main/vue/src/views/employee/ChildrenList.vue

@@ -97,7 +97,7 @@ export default {
             return {
             return {
                 search: this.search,
                 search: this.search,
                 query: {
                 query: {
-                    parent: Number(this.$route.query.id) || this.userInfo.id
+                    parent: Number(this.$route.query.userId) || this.userInfo.id
                 }
                 }
             };
             };
         },
         },

+ 57 - 0
src/main/vue/src/views/employee/Employee.vue

@@ -0,0 +1,57 @@
+<template>
+    <div class="edit-view">
+        <el-tabs class="my-tabs" v-model="active">
+            <el-tab-pane label="下级" name="first">
+                <ChildrenList @next="goNext" />
+            </el-tab-pane>
+            <el-tab-pane label="详细页" name="second">
+                <PackageEdit2 @next="goNext" />
+            </el-tab-pane>
+            <el-tab-pane label="分享素材" name="third">
+                <PackageEdit3 />
+            </el-tab-pane>
+        </el-tabs>
+    </div>
+</template>
+<script>
+import ChildrenList from './ChildrenList';
+import PackageEdit2 from '../../components/PackageEdit2';
+import PackageEdit3 from '../../components/PackageEdit3.vue';
+// import PackageGoodsTable from '../components/PackageGoodsTable';
+
+export default {
+    name: 'Employee',
+    data() {
+        return {
+            active: 'first',
+            id: 0,
+            formData: {},
+            stockList: [],
+            saving: false
+        };
+    },
+    methods: {
+        goNext(page) {
+            this.active = page;
+        }
+    },
+    components: {
+        ChildrenList,
+        PackageEdit2,
+        PackageEdit3
+    },
+    watch: {
+        // id() {
+        //     if (this.id) {
+        //         this.$refs.setGoodsList.getList(this.id);
+        //     }
+        // },
+        $route() {
+            if (this.$route.query.id) {
+                this.id = this.$route.query.id;
+            }
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 5 - 5
src/main/vue/src/views/employee/EmployeeList.vue

@@ -121,7 +121,7 @@ export default {
             return {
             return {
                 search: this.search,
                 search: this.search,
                 query: {
                 query: {
-                    member: 'EXPERT,BIG_EXPERT,PARTNER'
+                    member: 'EXPERT,PARTNER'
                 }
                 }
             };
             };
         },
         },
@@ -211,7 +211,7 @@ export default {
             this.$router.push({
             this.$router.push({
                 path: '/commissionRecordList',
                 path: '/commissionRecordList',
                 query: {
                 query: {
-                    id: id
+                    userId: id
                 }
                 }
             });
             });
         },
         },
@@ -219,7 +219,7 @@ export default {
             this.$router.push({
             this.$router.push({
                 path: '/childrenList',
                 path: '/childrenList',
                 query: {
                 query: {
-                    id: id
+                    userId: id
                 }
                 }
             });
             });
         },
         },
@@ -227,7 +227,7 @@ export default {
             this.$router.push({
             this.$router.push({
                 path: '/employeeOrderList',
                 path: '/employeeOrderList',
                 query: {
                 query: {
-                    id: id
+                    userId: id
                 }
                 }
             });
             });
         },
         },
@@ -235,7 +235,7 @@ export default {
             this.$router.push({
             this.$router.push({
                 path: '/employeeDashboard',
                 path: '/employeeDashboard',
                 query: {
                 query: {
-                    id: id
+                    userId: id
                 }
                 }
             });
             });
         }
         }

+ 1 - 1
src/main/vue/src/widgets/RecentCommission.vue

@@ -65,7 +65,7 @@ export default {
             this.$http
             this.$http
                 .get('/statistic/dayAddEmployee2', {
                 .get('/statistic/dayAddEmployee2', {
                     start: this.chooseDate,
                     start: this.chooseDate,
-                    userId: this.$route.query.id
+                    userId: this.$route.query.userId
                 })
                 })
                 .then(res => {
                 .then(res => {
                     this.loading = false;
                     this.loading = false;

+ 1 - 1
src/main/vue/src/widgets/RecentOrderEmployee.vue

@@ -70,7 +70,7 @@ export default {
             this.$http
             this.$http
                 .get('/statistic/dayAddEmployee', {
                 .get('/statistic/dayAddEmployee', {
                     start: this.chooseDate,
                     start: this.chooseDate,
-                    userId: this.$route.query.id
+                    userId: this.$route.query.userId
                 })
                 })
                 .then(res => {
                 .then(res => {
                     this.loading = false;
                     this.loading = false;

+ 1 - 1
src/main/vue/src/widgets/RecentSalesEmployee.vue

@@ -68,7 +68,7 @@ export default {
             this.$http
             this.$http
                 .get('/statistic/dayAddEmployee1', {
                 .get('/statistic/dayAddEmployee1', {
                     start: this.chooseDate,
                     start: this.chooseDate,
-                    userId: this.$route.query.id
+                    userId: this.$route.query.userId
                 })
                 })
                 .then(res => {
                 .then(res => {
                     this.loading = false;
                     this.loading = false;

+ 7 - 0
src/test/java/com/izouma/jiashanxia/service/StatisticServiceTest.java

@@ -1,6 +1,7 @@
 package com.izouma.jiashanxia.service;
 package com.izouma.jiashanxia.service;
 
 
 import com.izouma.jiashanxia.dto.StatisticDTO;
 import com.izouma.jiashanxia.dto.StatisticDTO;
+import com.izouma.jiashanxia.dto.StatisticVO;
 import org.junit.Test;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,4 +51,10 @@ public class StatisticServiceTest {
         List<StatisticDTO> statisticDTOS = statisticService.employeeCommission("2021-01-01 00:00:00", 921L);
         List<StatisticDTO> statisticDTOS = statisticService.employeeCommission("2021-01-01 00:00:00", 921L);
         statisticDTOS.forEach(System.out::println);
         statisticDTOS.forEach(System.out::println);
     }
     }
+
+    @Test
+    public void test4() {
+        List<StatisticVO> vo = statisticService.getVO("2021-03-01 00:00:00", 908L);
+        vo.forEach(System.out::println);
+    }
 }
 }