44323
2023-10-13 a7900eee85457c085a97427b4932537dcdd6a343
后台代码提交
16个文件已修改
1257 ■■■■■ 已修改文件
cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/model/query/appUserQuery/QueryAppUser.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java 401 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-course/src/main/resources/mapper/CoursePackagePaymentConfigMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/account/model/QueryAppUser.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/competition/CompetitionClient.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentClient.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/DataStatisticsController.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/platformIncome.html 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/storeIncome.html 245 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
@@ -264,6 +264,12 @@
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id));
        return list.stream().map(TAppUser::getId).collect(Collectors.toList());
    }
    @PostMapping("/student/getUserStore")
    @ResponseBody
    public  List<Integer> getUserStore(@RequestBody Integer id){
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId,id));
        return list.stream().map(TAppUser::getId).collect(Collectors.toList());
    }
    @ResponseBody
    @PostMapping("/student/getUserPtVip")
    public List<Integer> getUserPtVip(){
@@ -271,12 +277,7 @@
        return list.stream().map(TAppUser::getId).collect(Collectors.toList());
    }
    @PostMapping("/student/getUserStore")
    @ResponseBody
   public  List<Integer> getUserStore(@RequestBody Integer id){
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId,id));
        return list.stream().map(TAppUser::getId).collect(Collectors.toList());
    }
    @ResponseBody
@@ -393,6 +394,192 @@
        HashMap<String, Object> map = new HashMap<>();
        // 所有的
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1));
        List<Integer> collect1 = list.stream().map(TAppUser::getId).collect(Collectors.toList());
        if(collect1.size()==0){
            collect1.add(-1);
        }
        List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1));
        map.put("allUser",students.size());
        ArrayList<Object> integers = new ArrayList<>();
        int year = DateUtil.year(new Date());
        for (int i = 0; i < 10; i++) {
            integers.add(year-i);
        }
        List<Object> collect = integers.stream().sorted().collect(Collectors.toList());
        // 年
        ArrayList<Long> years = new ArrayList<>();
        for (Object o : collect) {
            String s = o.toString();
            long count = students.stream().filter(e -> e.getInsertTime().toString().contains(s)).count();
            years.add(count);
        }
        map.put("yearData",years);
        ArrayList<Long> months = new ArrayList<>();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        // 月
        for (int i = 1; i <= 12; i++) {
            String m=i+"";
            if(i<10){
                m="0"+i;
            }
            String s = year + "-" + m;
            long count = students.stream().filter(e -> format.format(e.getInsertTime()).contains(s)).count();
            months.add(count);
        }
        map.put("monthData",months);
        // 周
        // 获取最近四周
        LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN);
        LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX);
        // 周度数据
        String s1 = minNow.minusDays(6).toString();
        String s2 = maxNow.toString();
        String s3 = minNow.minusDays(13).toString();
        String s4 = maxNow.minusDays(6).toString();
        String s5 = minNow.minusDays(20).toString();
        String s6 = maxNow.minusDays(13).toString();
        String s7 = minNow.minusDays(27).toString();
        String s8 = maxNow.minusDays(20).toString();
        int count = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s7, s8));
        int count1 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s5,s6));
        int count2 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s3,s4));
        int count3 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s1,s2));
        map.put("count",count);
        map.put("count1",count1);
        map.put("count2",count2);
        map.put("count3",count3);
        // 日
        ArrayList<Integer> days = new ArrayList<>();
        for (int i = 6; i >= 0; i--) {
            String s = minNow.minusDays(i).toString();
            String s9 = maxNow.minusDays(i).toString();
            int count4 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s,s9));
            days.add(count4);
        }
        map.put("dayData",days);
        return map;
    }
    @ResponseBody
    @PostMapping("/student/stuYys")
    public HashMap<String, Object>  stuYys(@RequestBody Integer id){
        HashMap<String, Object> map = new HashMap<>();
        // 所有的
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getAddUserId, id));
        List<Integer> collect1 = list.stream().map(TAppUser::getId).collect(Collectors.toList());
        if(collect1.size()==0){
            collect1.add(-1);
        }
        List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1));
        map.put("allUser",students.size());
        ArrayList<Object> integers = new ArrayList<>();
        int year = DateUtil.year(new Date());
        for (int i = 0; i < 10; i++) {
            integers.add(year-i);
        }
        List<Object> collect = integers.stream().sorted().collect(Collectors.toList());
        // 年
        ArrayList<Long> years = new ArrayList<>();
        for (Object o : collect) {
            String s = o.toString();
            long count = students.stream().filter(e -> e.getInsertTime().toString().contains(s)).count();
            years.add(count);
        }
        map.put("yearData",years);
        ArrayList<Long> months = new ArrayList<>();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        // 月
        for (int i = 1; i <= 12; i++) {
            String m=i+"";
            if(i<10){
                m="0"+i;
            }
            String s = year + "-" + m;
            long count = students.stream().filter(e -> format.format(e.getInsertTime()).contains(s)).count();
            months.add(count);
        }
        map.put("monthData",months);
        // 周
        // 获取最近四周
        LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN);
        LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX);
        // 周度数据
        String s1 = minNow.minusDays(6).toString();
        String s2 = maxNow.toString();
        String s3 = minNow.minusDays(13).toString();
        String s4 = maxNow.minusDays(6).toString();
        String s5 = minNow.minusDays(20).toString();
        String s6 = maxNow.minusDays(13).toString();
        String s7 = minNow.minusDays(27).toString();
        String s8 = maxNow.minusDays(20).toString();
        int count = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s7, s8));
        int count1 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s5,s6));
        int count2 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s3,s4));
        int count3 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s1,s2));
        map.put("count",count);
        map.put("count1",count1);
        map.put("count2",count2);
        map.put("count3",count3);
        // 日
        ArrayList<Integer> days = new ArrayList<>();
        for (int i = 6; i >= 0; i--) {
            String s = minNow.minusDays(i).toString();
            String s9 = maxNow.minusDays(i).toString();
            int count4 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s,s9));
            days.add(count4);
        }
        map.put("dayData",days);
        return map;
    }
    @ResponseBody
    @PostMapping("/student/stuStores")
    public HashMap<String, Object>  stuStores(@RequestBody Integer id){
        HashMap<String, Object> map = new HashMap<>();
        // 所有的
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getAddUserId, id));
        List<Integer> collect1 = list.stream().map(TAppUser::getId).collect(Collectors.toList());
        if(collect1.size()==0){
            collect1.add(-1);
@@ -872,7 +1059,7 @@
    }
    @PostMapping("/student/queryUserAgeYys")
    public HashMap<String, Object> queryUserAgeYys(Integer id){
    public HashMap<String, Object> queryUserAgeYys(@RequestBody Integer id){
        HashMap<String, Object> map = new HashMap<>();
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id));
        List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList());
cloud-server-account/src/main/java/com/dsh/account/model/query/appUserQuery/QueryAppUser.java
@@ -13,5 +13,9 @@
   private String phone;
   private Integer isVip;
   private Integer state;
   private String salesmanUserName;
   private String salesmanUserId;
   // 角色类型
   private Integer insertType;
   // 平台/运营商/门店id
   private Integer typeId;
}
cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml
@@ -66,8 +66,14 @@
            <if test="query.isVip!=null and query.isVip!= ''">
                and t1.isVip = #{query.isVip}
            </if>
            <if test="query.isVip!=null and query.isVip!= ''">
                and t1.isVip = #{query.isVip}
            <if test="query.salesmanUserId!=null and query.salesmanUserId!= ''">
                and t1.salesmanUserId = #{query.salesmanUserId}
            </if>
            <if test="query.insertType!=null and query.insertType!= ''">
                and t1.insertType = #{query.insertType}
            </if>
            <if test="query.typeId!=null and query.typeId!= ''">
                and t1.addUserId = #{query.typeId}
            </if>
            and t1.state != 3
        </where>
cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java
@@ -24,6 +24,7 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.runtime.regexp.joni.constants.OPCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -665,6 +666,59 @@
    }
    @ResponseBody
    @PostMapping("/base/competition/actYys")
    public HashMap<String, Object> actYys(@RequestBody CompetionVO vo){
        HashMap<String, Object> map = new HashMap<>();
        if(vo.getIds().size()==0){
            vo.getIds().add(-1);
        }
        ArrayList<Object> integers = new ArrayList<>();
        int year = DateUtil.year(new Date());
        for (int i = 0; i < 10; i++) {
            integers.add(year-i);
        }
        List<Object> collect = integers.stream().sorted().collect(Collectors.toList());
        // 年
        ArrayList<Integer> years = new ArrayList<>();
        ArrayList<Integer> yearsUser = new ArrayList<>();
        Integer operatorId = vo.getOperatorId();
        List<Integer> operatorId1 = cttService.list(new QueryWrapper<Competition>().eq("operatorId", operatorId))
                .stream().map(Competition::getId).collect(Collectors.toList());
        for (Object o : collect) {
            String s = o.toString();
            int count = cttService.count(new LambdaQueryWrapper<Competition>().like(Competition::getInsertTime, s).eq(Competition::getOperatorId,vo.getOperatorId()));
            int count1 = ucttService.count(new LambdaQueryWrapper<UserCompetition>().in(UserCompetition::getAppUserId, vo.getIds()).like(UserCompetition::getInsertTime,s));
            years.add(count);
            yearsUser.add(count1);
        }
        map.put("yearData",years);
        map.put("yearsUser",yearsUser);
        // 月
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        ArrayList<Integer> months = new ArrayList<>();
        ArrayList<Integer> monthsUser = new ArrayList<>();
        for (int i = 1; i <= 12; i++) {
            double sum=0.0;
            String m=i+"";
            if(i<10){
                m="0"+i;
            }
            String s = year + "-" + m;
            int count = cttService.count(new LambdaQueryWrapper<Competition>().like(Competition::getInsertTime, s).ne(Competition::getOperatorId,operatorId));
            int count1 = ucttService.count(new LambdaQueryWrapper<UserCompetition>().in(UserCompetition::getAppUserId, vo.getIds()).like(UserCompetition::getInsertTime,s));
            months.add(count);
            monthsUser.add(count1);
        }
        map.put("monthData",months);
        map.put("monthsUser",monthsUser);
        return map;
    }
}
cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java
@@ -54,8 +54,11 @@
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@@ -142,7 +145,7 @@
        Integer studentId = packagePayment.getStudentId();
        // 添加学员上课记录
        CoursePackageStudent coursePackageStudent = new CoursePackageStudent();
        TCoursePackagePayment one = packagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", packagePayment)
        TCoursePackagePayment one = packagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", packagePayment.getStudentId())
                .orderByDesc("insertTime")
                .last("LIMIT 1"));
@@ -1645,7 +1648,7 @@
                    if(ToolUtil.isEmpty(coursePackage.getNeedNum())){
                        coursePackageStudent.setNeedNum(0);
                    }else {
                        coursePackageStudent.setNeedNum(coursePackageStudent.getNeedNum());
                        coursePackageStudent.setNeedNum(coursePackage.getNeedNum());
                    }
                }
            }
@@ -1661,7 +1664,7 @@
        ArrayList<Integer> years = new ArrayList<>();
        for (Object o : collect) {
            String s = o.toString();
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).collect(Collectors.toList());
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).filter(student -> student.getNeedNum() != null).collect(Collectors.toList());
            int sum2 = collect1.stream().mapToInt(CoursePackageStudent::getNeedNum).sum();
            years.add(sum2);
        }
@@ -1682,47 +1685,391 @@
                m="0"+i;
            }
            String s = year + "-" + m;
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> format.format(e.getInsertTime()).contains(s)).collect(Collectors.toList());
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> format.format(e.getInsertTime()).contains(s)).filter(student -> student.getNeedNum() != null).collect(Collectors.toList());
            int sum2 = collect1.stream().mapToInt(CoursePackageStudent::getNeedNum).sum();
            months.add(sum2);
        }
        map.put("monthData",months);
        // 周
        // 获取最近四周
        LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN);
        LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX);
        // 周度数据
        String s1 = minNow.minusDays(6).toString();
        String s2 = maxNow.toString();
        LocalDateTime s1 = minNow.minusDays(6);
        LocalDateTime s2 = maxNow;
        String s3 = minNow.minusDays(13).toString();
        String s4 = maxNow.minusDays(6).toString();
        LocalDateTime s3 = minNow.minusDays(13);
        LocalDateTime s4 = maxNow.minusDays(6);
        String s5 = minNow.minusDays(20).toString();
        String s6 = maxNow.minusDays(13).toString();
        LocalDateTime s5 = minNow.minusDays(20);
        LocalDateTime s6 = maxNow.minusDays(13);
        String s7 = minNow.minusDays(27).toString();
        String s8 = maxNow.minusDays(20).toString();
        LocalDateTime s7 = minNow.minusDays(27);
        LocalDateTime s8 = maxNow.minusDays(20);
        ArrayList<Object> weekData = new ArrayList<>();
//
//        int count = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime, s7, s8));
//
//        int count1 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s5,s6));
//
//        int count2 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s3,s4));
//
//        int count3 = studentService.count(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect1).between(TStudent::getInsertTime,s1,s2));
        int count  = 0;
//        map.put("count",count);
//        map.put("count1",count1);
//        map.put("count2",count2);
//        map.put("count3",count3);
        return null;
        int count1 = 0;
        int count2 = 0;
        int count3 = 0;
        for (CoursePackageStudent coursePackageStudent : list) {
            if (coursePackageStudent.getNeedNum()==null){
                continue;
            }
            // 如果到课状态为否 则不计算
            if (coursePackageStudent.getSignInOrNot() != 0) {
                Date insertTime = coursePackageStudent.getInsertTime();
                Instant instant = insertTime.toInstant();
                ZoneId zoneId = ZoneId.systemDefault();
                LocalDateTime dateTime = instant.atZone(zoneId).toLocalDateTime();
                if (dateTime.isAfter(s1) && dateTime.isBefore(s2)){
                    count+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s3) && dateTime.isBefore(s4)){
                    count1+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s5) && dateTime.isBefore(s6)){
                    count2+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s7) && dateTime.isBefore(s8)){
                    count3+=coursePackageStudent.getNeedNum();
    }
}
        }
        weekData.add(count3);
        weekData.add(count2);
        weekData.add(count1);
        weekData.add(count);
        map.put("weekData",weekData);
        LocalDateTime currentDateTime = LocalDateTime.now();
        List<Integer> amountByDay = new ArrayList<>(Collections.nCopies(7,0));
        for (CoursePackageStudent coursePackageStudent : list) {
            Date insertTime = coursePackageStudent.getInsertTime();
            // 将 Date 转换为 LocalDateTime
            LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
            // 计算日期与当前日期的差距
            long daysDifference = ChronoUnit.DAYS.between(insertDateTime.toLocalDate(), currentDateTime.toLocalDate());
            // 如果日期在七天内,累加金额
            if (daysDifference >= 0 && daysDifference < 7) {
                int index = (int) (6 - daysDifference); // 计算对应的索引位置
                Integer needNum = coursePackageStudent.getNeedNum();
                if (needNum!=null){
                    int i = amountByDay.get(index) + needNum;
                    amountByDay.set(index, i);
                }
            }
        }
        map.put("dayData", amountByDay);
        return map;
    }
    @ResponseBody
    @PostMapping("/coursePackagePayment/courseYys")
    HashMap<String, Object> courseYys(@RequestBody List<Integer> userPt){
        if(userPt.size()==0){
            userPt.add(-1);
        }
        HashMap<String, Object> map = new HashMap<>();
        List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.listOne(userPt);
        int sum = tCoursePackagePayments.stream().mapToInt(TCoursePackagePayment::getTotalClassHours).sum();
        int sum1 = tCoursePackagePayments.stream().mapToInt(TCoursePackagePayment::getLaveClassHours).sum();
        map.put("allCourse",sum-sum1);
        //所有课包
        List<TCoursePackage> coursePackages = tcpService.list();
        // 年
        List<CoursePackageStudent> list = cspsService.list(new LambdaQueryWrapper<CoursePackageStudent>().in(CoursePackageStudent::getAppUserId, userPt));
        for (CoursePackageStudent coursePackageStudent : list) {
            for (TCoursePackage coursePackage : coursePackages) {
                if(coursePackageStudent.getCoursePackageId().equals(coursePackage.getId())){
                    if(ToolUtil.isEmpty(coursePackage.getNeedNum())){
                        coursePackageStudent.setNeedNum(0);
                    }else {
                        coursePackageStudent.setNeedNum(coursePackage.getNeedNum());
                    }
                }
            }
        }
        ArrayList<Object> integers = new ArrayList<>();
        int year = cn.hutool.core.date.DateUtil.year(new Date());
        for (int i = 0; i < 10; i++) {
            integers.add(year-i);
        }
        List<Object> collect = integers.stream().sorted().collect(Collectors.toList());
        // 年
        ArrayList<Integer> years = new ArrayList<>();
        for (Object o : collect) {
            String s = o.toString();
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).filter(student -> student.getNeedNum() != null).collect(Collectors.toList());
            int sum2 = collect1.stream().mapToInt(CoursePackageStudent::getNeedNum).sum();
            years.add(sum2);
        }
        map.put("yearData",years);
        ArrayList<Integer> months = new ArrayList<>();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        // 月
        for (int i = 1; i <= 12; i++) {
            String m=i+"";
            if(i<10){
                m="0"+i;
            }
            String s = year + "-" + m;
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> format.format(e.getInsertTime()).contains(s)).filter(student -> student.getNeedNum() != null).collect(Collectors.toList());
            int sum2 = collect1.stream().mapToInt(CoursePackageStudent::getNeedNum).sum();
            months.add(sum2);
        }
        map.put("monthData",months);
        // 周
        // 获取最近四周
        LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN);
        LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX);
        // 周度数据
        LocalDateTime s1 = minNow.minusDays(6);
        LocalDateTime s2 = maxNow;
        LocalDateTime s3 = minNow.minusDays(13);
        LocalDateTime s4 = maxNow.minusDays(6);
        LocalDateTime s5 = minNow.minusDays(20);
        LocalDateTime s6 = maxNow.minusDays(13);
        LocalDateTime s7 = minNow.minusDays(27);
        LocalDateTime s8 = maxNow.minusDays(20);
        ArrayList<Object> weekData = new ArrayList<>();
        int count  = 0;
        int count1 = 0;
        int count2 = 0;
        int count3 = 0;
        for (CoursePackageStudent coursePackageStudent : list) {
            if (coursePackageStudent.getNeedNum()==null){
                continue;
            }
            // 如果到课状态为否 则不计算
            if (coursePackageStudent.getSignInOrNot() != 0) {
                Date insertTime = coursePackageStudent.getInsertTime();
                Instant instant = insertTime.toInstant();
                ZoneId zoneId = ZoneId.systemDefault();
                LocalDateTime dateTime = instant.atZone(zoneId).toLocalDateTime();
                if (dateTime.isAfter(s1) && dateTime.isBefore(s2)){
                    count+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s3) && dateTime.isBefore(s4)){
                    count1+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s5) && dateTime.isBefore(s6)){
                    count2+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s7) && dateTime.isBefore(s8)){
                    count3+=coursePackageStudent.getNeedNum();
                }
            }
        }
        weekData.add(count3);
        weekData.add(count2);
        weekData.add(count1);
        weekData.add(count);
        map.put("weekData",weekData);
        LocalDateTime currentDateTime = LocalDateTime.now();
        List<Integer> amountByDay = new ArrayList<>(Collections.nCopies(7,0));
        for (CoursePackageStudent coursePackageStudent : list) {
            Date insertTime = coursePackageStudent.getInsertTime();
            // 将 Date 转换为 LocalDateTime
            LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
            // 计算日期与当前日期的差距
            long daysDifference = ChronoUnit.DAYS.between(insertDateTime.toLocalDate(), currentDateTime.toLocalDate());
            // 如果日期在七天内,累加金额
            if (daysDifference >= 0 && daysDifference < 7) {
                int index = (int) (6 - daysDifference); // 计算对应的索引位置
                Integer needNum = coursePackageStudent.getNeedNum();
                if (needNum!=null){
                    int i = amountByDay.get(index) + needNum;
                    amountByDay.set(index, i);
                }
            }
        }
        map.put("dayData", amountByDay);
        return map;
    }
    @ResponseBody
    @PostMapping("/coursePackagePayment/courseStore")
    HashMap<String, Object> courseStore(@RequestBody List<Integer> userPt){
        if(userPt.size()==0){
            userPt.add(-1);
        }
        HashMap<String, Object> map = new HashMap<>();
        List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.listOne(userPt);
        int sum = tCoursePackagePayments.stream().mapToInt(TCoursePackagePayment::getTotalClassHours).sum();
        int sum1 = tCoursePackagePayments.stream().mapToInt(TCoursePackagePayment::getLaveClassHours).sum();
        map.put("allCourse",sum-sum1);
        //所有课包
        List<TCoursePackage> coursePackages = tcpService.list();
        // 年
        List<CoursePackageStudent> list = cspsService.list(new LambdaQueryWrapper<CoursePackageStudent>().in(CoursePackageStudent::getAppUserId, userPt));
        for (CoursePackageStudent coursePackageStudent : list) {
            for (TCoursePackage coursePackage : coursePackages) {
                if(coursePackageStudent.getCoursePackageId().equals(coursePackage.getId())){
                    if(ToolUtil.isEmpty(coursePackage.getNeedNum())){
                        coursePackageStudent.setNeedNum(0);
                    }else {
                        coursePackageStudent.setNeedNum(coursePackage.getNeedNum());
                    }
                }
            }
        }
        ArrayList<Object> integers = new ArrayList<>();
        int year = cn.hutool.core.date.DateUtil.year(new Date());
        for (int i = 0; i < 10; i++) {
            integers.add(year-i);
        }
        List<Object> collect = integers.stream().sorted().collect(Collectors.toList());
        // 年
        ArrayList<Integer> years = new ArrayList<>();
        for (Object o : collect) {
            String s = o.toString();
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).filter(student -> student.getNeedNum() != null).collect(Collectors.toList());
            int sum2 = collect1.stream().mapToInt(CoursePackageStudent::getNeedNum).sum();
            years.add(sum2);
        }
        map.put("yearData",years);
        ArrayList<Integer> months = new ArrayList<>();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        // 月
        for (int i = 1; i <= 12; i++) {
            String m=i+"";
            if(i<10){
                m="0"+i;
            }
            String s = year + "-" + m;
            List<CoursePackageStudent> collect1 = list.stream().filter(e -> format.format(e.getInsertTime()).contains(s)).filter(student -> student.getNeedNum() != null).collect(Collectors.toList());
            int sum2 = collect1.stream().mapToInt(CoursePackageStudent::getNeedNum).sum();
            months.add(sum2);
        }
        map.put("monthData",months);
        // 周
        // 获取最近四周
        LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN);
        LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX);
        // 周度数据
        LocalDateTime s1 = minNow.minusDays(6);
        LocalDateTime s2 = maxNow;
        LocalDateTime s3 = minNow.minusDays(13);
        LocalDateTime s4 = maxNow.minusDays(6);
        LocalDateTime s5 = minNow.minusDays(20);
        LocalDateTime s6 = maxNow.minusDays(13);
        LocalDateTime s7 = minNow.minusDays(27);
        LocalDateTime s8 = maxNow.minusDays(20);
        ArrayList<Object> weekData = new ArrayList<>();
        int count  = 0;
        int count1 = 0;
        int count2 = 0;
        int count3 = 0;
        for (CoursePackageStudent coursePackageStudent : list) {
            if (coursePackageStudent.getNeedNum()==null){
                continue;
            }
            // 如果到课状态为否 则不计算
            if (coursePackageStudent.getSignInOrNot() != 0) {
                Date insertTime = coursePackageStudent.getInsertTime();
                Instant instant = insertTime.toInstant();
                ZoneId zoneId = ZoneId.systemDefault();
                LocalDateTime dateTime = instant.atZone(zoneId).toLocalDateTime();
                if (dateTime.isAfter(s1) && dateTime.isBefore(s2)){
                    count+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s3) && dateTime.isBefore(s4)){
                    count1+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s5) && dateTime.isBefore(s6)){
                    count2+=coursePackageStudent.getNeedNum();
                }else if(dateTime.isAfter(s7) && dateTime.isBefore(s8)){
                    count3+=coursePackageStudent.getNeedNum();
                }
            }
        }
        weekData.add(count3);
        weekData.add(count2);
        weekData.add(count1);
        weekData.add(count);
        map.put("weekData",weekData);
        LocalDateTime currentDateTime = LocalDateTime.now();
        List<Integer> amountByDay = new ArrayList<>(Collections.nCopies(7,0));
        for (CoursePackageStudent coursePackageStudent : list) {
            Date insertTime = coursePackageStudent.getInsertTime();
            // 将 Date 转换为 LocalDateTime
            LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
            // 计算日期与当前日期的差距
            long daysDifference = ChronoUnit.DAYS.between(insertDateTime.toLocalDate(), currentDateTime.toLocalDate());
            // 如果日期在七天内,累加金额
            if (daysDifference >= 0 && daysDifference < 7) {
                int index = (int) (6 - daysDifference); // 计算对应的索引位置
                Integer needNum = coursePackageStudent.getNeedNum();
                if (needNum!=null){
                    int i = amountByDay.get(index) + needNum;
                    amountByDay.set(index, i);
                }
            }
        }
        map.put("dayData", amountByDay);
        return map;
    }
}
cloud-server-course/src/main/resources/mapper/CoursePackagePaymentConfigMapper.xml
@@ -106,6 +106,7 @@
            </if>
            and t1.payStatus = 2
        </where>
        order by t1.insertTime desc
    </select>
</mapper>
cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java
@@ -131,6 +131,10 @@
    HashMap<String, Object> userAndVipStore(Integer id);
    @PostMapping("/student/stuPt")
    HashMap<String, Object> stuPt();
    @PostMapping("/student/stuYys")
    HashMap<String, Object> stuYys(@RequestBody Integer id);
    @PostMapping("/student/stuStores")
    HashMap<String, Object> stuStores(@RequestBody Integer id);
}
cloud-server-management/src/main/java/com/dsh/course/feignClient/account/model/QueryAppUser.java
@@ -13,5 +13,9 @@
   private String phone;
   private Integer isVip;
   private Integer state;
   private String salesmanUserName;
   private Integer salesmanUserId;
   // 角色类型
   private Integer insertType;
   // 平台/运营商/门店id
   private Integer typeId;
}
cloud-server-management/src/main/java/com/dsh/course/feignClient/competition/CompetitionClient.java
@@ -48,6 +48,8 @@
    @PostMapping("/base/competition/actPt")
    HashMap<String, Object> actPt(List<Integer> ids);
    @PostMapping("/base/competition/actYys")
    HashMap<String, Object> actYys(@RequestBody CompetionVO vo);
}
cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentClient.java
@@ -95,4 +95,8 @@
    @PostMapping("/coursePackagePayment/coursePt")
    HashMap<String, Object> coursePt(List<Integer> userPt);
    @PostMapping("/coursePackagePayment/courseYys")
    HashMap<String, Object> courseYys(@RequestBody List<Integer> userPt);
    @PostMapping("/coursePackagePayment/courseStore")
    HashMap<String, Object> courseStore(@RequestBody List<Integer> userPt);
}
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java
@@ -94,7 +94,7 @@
        // 获取课包id
        Integer coursePackageId = tCoursePackagePayment.getCoursePackageId();
        List<TCoursePackageDiscount> list = coursePackageDiscountClient.queryByCoursePackageId(coursePackageId);
        TCoursePackageDiscount tCoursePackageDiscount1 = list.get(0);
        // 获取当前课包价格配置
        CoursePackagePaymentConfig coursePackagePaymentConfigs = coursePackagePaymentConfigClient.getById(id);
        Integer coursePackageId1 = tCoursePackagePayment.getCoursePackageId();
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/DataStatisticsController.java
@@ -7,6 +7,7 @@
import com.dsh.course.feignClient.account.model.*;
import com.dsh.course.feignClient.activity.PointMercharsClient;
import com.dsh.course.feignClient.competition.CompetitionClient;
import com.dsh.course.feignClient.competition.model.CompetionVO;
import com.dsh.course.feignClient.competition.model.Competition;
import com.dsh.course.feignClient.competition.model.CompetitionQuery;
import com.dsh.course.feignClient.competition.model.PaymentCompetition;
@@ -831,11 +832,40 @@
        HashMap<String, Object> map = appUserClient.stuPt();
        return map;
    }
    @RequestMapping(value = "/stuYys")
    @ResponseBody
    public Object stuYys(Integer id) {
        HashMap<String, Object> map = appUserClient.stuYys(id);
        return map;
    }
    @RequestMapping(value = "/stuStores")
    @ResponseBody
    public Object stuStores(Integer id) {
        HashMap<String, Object> map = appUserClient.stuStores(id);
        return map;
    }
    // 消耗课时数据-平台
    @RequestMapping(value = "/coursePt")
    @ResponseBody
    public Object coursePt() {
        List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1));
        HashMap<String, Object> map = coursePackagePaymentClient.coursePt(userPt);
        return map;
    }
    // 消耗课时数据-运营商
    @RequestMapping(value = "/courseYys")
    @ResponseBody
    public Object courseYys(Integer id) {
        List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(id));
        HashMap<String, Object> map = coursePackagePaymentClient.coursePt(userPt);
        return map;
    }
    // 消耗课时数据-运营商
    @RequestMapping(value = "/courseStore")
    @ResponseBody
    public Object courseStore(Integer id) {
        List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(id));
        HashMap<String, Object> map = coursePackagePaymentClient.coursePt(userPt);
        return map;
    }
@@ -882,10 +912,14 @@
    @RequestMapping(value = "/actYys")
    @ResponseBody
    public Object actYys(Integer id) {
        List<Integer> userPt = appUserClient.getUserYYs(id);
        HashMap<String, Object> map = competitionClient.actPt(userPt);
        CompetionVO competionVO = new CompetionVO();
        List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0));
        List<Integer> userPt = appUserClient.getUserYYs(id);
        competionVO.setIds(userPt);
        competionVO.setOperatorId(id);
        HashMap<String, Object> map = competitionClient.actYys(competionVO);
        List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, id));
        long l1=0;
        for (TStore tStore : list) {
            long l = DateUtil.betweenDay(tStore.getCreateTime(), new Date(), true);
@@ -899,7 +933,7 @@
            if(integer==0 && integer1==0){
                a=24;
            }else {
                a= integer1-integer;
                a= integer-integer1;
            }
            l1 += l * a;
        }
@@ -942,9 +976,12 @@
    @RequestMapping("/operator")
    public String operator(Model model) {
        Integer objectType = UserExt.getUser().getObjectType();
        List<TOperator> list = operatorService.list(new LambdaQueryWrapper<TOperator>().ne(TOperator::getState, 3));
        Integer objectId = UserExt.getUser().getObjectId();
        List<TOperator> list = operatorService.list(new LambdaQueryWrapper<TOperator>().ne(TOperator::getState, 3).ne(TOperator::getId,0));
        model.addAttribute("list",list);
        model.addAttribute("objectType",objectType);
        model.addAttribute("objectId",objectId);
        return PREFIX + "operatorIncome.html";
    }
@@ -1172,6 +1209,7 @@
        List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getState, 1));
        model.addAttribute("list",list);
        model.addAttribute("objectType",objectType);
        model.addAttribute("objectId",UserExt.getUser().getObjectId());
        return PREFIX + "storeIncome.html";
    }
@@ -1316,8 +1354,9 @@
    @ResponseBody
    public Object stuUserDataYys(Integer id) {
        ArrayList<Integer> objects = new ArrayList<>();
        objects.add(1);
        HashMap<String, Object> map = appUserClient.queryUserAgeYys(id);
        HashMap<String, Object> map = appUserClient.queryUserAgeYys(operatorService.getById(id).getId());
        return map;
    }
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java
@@ -144,14 +144,14 @@
    @RequestMapping("/listAll")
    @ResponseBody
    public List<QueryAppUserVO> listAll(String province, String city,String name,
                                        String phone,Integer isVip, String salesmanUserName){
                                        String phone,Integer isVip, Integer salesmanUserName){
        QueryAppUser queryAppUser = new QueryAppUser();
        queryAppUser.setProvince(province);
        queryAppUser.setCity(city);
        queryAppUser.setName(name);
        queryAppUser.setPhone(phone);
        queryAppUser.setIsVip(isVip);
        queryAppUser.setSalesmanUserName(salesmanUserName);
        queryAppUser.setSalesmanUserId(salesmanUserName);
        if (province!=null && (!province.equals(""))){
            TCity p = cityService.getOne(new QueryWrapper<TCity>().eq("code", province));
            queryAppUser.setProvince(p.getName());
@@ -160,6 +160,9 @@
            TCity c = cityService.getOne(new QueryWrapper<TCity>().eq("code", city));
            queryAppUser.setCity(c.getName());
        }
        Integer objectType = UserExt.getUser().getObjectType();
        queryAppUser.setInsertType(objectType);
        queryAppUser.setTypeId(UserExt.getUser().getObjectId());
        List<QueryAppUserVO> queryAppUserVOS = appUserClient.listAll(queryAppUser);
        for (QueryAppUserVO queryAppUserVO : queryAppUserVOS) {
            if (queryAppUserVO.getSalesmanUserId()!=null){
@@ -191,7 +194,7 @@
    public Object addAppUser(@RequestBody TAppUser appUser){
        Integer objectType = UserExt.getUser().getObjectType();
        appUser.setInsertType(objectType);
        appUser.setAddUserId(UserExt.getUser().getId());
        appUser.setAddUserId(UserExt.getUser().getObjectId());
        Object o = appUserClient.addAppUser1(appUser);
        return o;
    }
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/operatorIncome.html
@@ -41,7 +41,8 @@
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <input id="objectId" value="${objectId}" hidden>
            <input id="objectType" value="${objectType}" hidden>
            <div class="row">
                <br class="col-sm-10">
                    @if(objectType==1){
@@ -49,7 +50,7 @@
                        <div class="input-group">
                            <div class="input-group-btn open">
                                <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true">
                                    选择运营商1
                                    选择运营商
                                </button>
                            </div>
                            <select class="form-control" id="cCode" >
@@ -186,7 +187,7 @@
                                    <h2>运营数据</h2>
                                    </br>
                                    </br>
                                    <span>运营时长:0小时</span>
                                    <span id="allHours">运营时长:0小时</span>
                                    </br>
                                    </br>
                                    <div style="height: 25px;box-sizing: border-box;background:#f3f3f4;line-height: 25px;border:1px solid;margin-bottom: 20px;width: 500px">
@@ -294,6 +295,8 @@
    function search(){
        income();
        ptCourse()
        ptStu()
        if(cutType==1){
            srtj()
            tuifei()
@@ -304,9 +307,12 @@
            ptUser()
            ptActivity()
        }
        if(cutType==3){
            jxtj()
        }
    }
    function income(){
@@ -806,6 +812,7 @@
        if(type==3){
            jxtj()
            ptStu()
        }
@@ -944,7 +951,11 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==2){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.set("time",beginTime);
        ajax.start();
@@ -1063,11 +1074,106 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==2){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.start();
    }
    function ptCourse() {
        var myChart7 = echarts.init(document.getElementById('courseData'));
        myChart7.on('legendselectchanged', obj => {
            var options = myChart7.getOption()
            //这里是选择切换什么样的x轴,那么他会进行对Y值的切换
            if (obj.name == '年度耗课数') {
                options.xAxis[0].data = yearX
            } else if (obj.name == '月度耗课数') {
                options.xAxis[0].data = monthX
            }else if (obj.name == '周度耗课数') {
                options.xAxis[0].data = ["1周","2周","3周","4周"]
            }else if (obj.name == '日度耗课数') {
                options.xAxis[0].data = dataX
            }
            myChart7.setOption(options, true)
        });
    
        var ajax2 = new $ax(Feng.ctxPath + "/data/courseYys", function(data){
            console.log(data)
            $("#allCourse").text("现有课时总量:"+data.allCourse+"小时")
            option7  = {
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['年度耗课数', '月度耗课数', '周度耗课数', '日度耗课数'],
                    icon: 'stack',
                    selectedMode: 'single', // 单选
                    selected: {
                        年度耗课数: true,
                        月度耗课数: false,
                        周度耗课数: false,
                        日度耗课数: false
                    },
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: yearX
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '年度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.yearData
                    },
                    {
                        name: '月度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.monthData
                    },
                    {
                        name: '周度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.weekData
                    },
                    {
                        name: '日度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.dayData
                    }
                ]
            };
        });
        if($("#objectType").val()==2){
            ajax2.set("id",$("#objectId").val())
        }else {
            ajax2.set("id", $("#cCode").val())
        }
        ajax2.start()
        myChart7.setOption(option7);
    }
    function yytj() {
        let id  = $("#cCode").val()
        console.log(id)
@@ -1182,11 +1288,110 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==2){
            ajax.set("id",$("#objectId").val())
        }else{
            ajax.set("id",id)
        }
        ajax.start();
    }
    function ptStu() {
        var myChart6 = echarts.init(document.getElementById('teach'));
        myChart6.on('legendselectchanged', obj => {
            var options = myChart6.getOption()
            //这里是选择切换什么样的x轴,那么他会进行对Y值的切换
            if (obj.name == '年度学员数') {
                options.xAxis[0].data = yearX
            } else if (obj.name == '月度学员数') {
                options.xAxis[0].data = monthX
            }else if (obj.name == '周度学员数') {
                options.xAxis[0].data = ["1周","2周","3周","4周"]
            }else if (obj.name == '日度学员数') {
                options.xAxis[0].data = dataX
            }
            myChart6.setOption(options, true)
        });
        var ajax2 = new $ax(Feng.ctxPath + "/data/stuYys", function(data){
            console.log(data)
            $("#allUser").text(data.allUser)
            option6  = {
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['年度学员数', '月度学员数', '周度学员数', '日度学员数'],
                    icon: 'stack',
                    selectedMode: 'single', // 单选
                    selected: {
                        年度学员数: true,
                        月度学员数: false,
                        周度学员数: false,
                        日度学员数: false
                    },
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: yearX
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '年度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.yearData
                    },
                    {
                        name: '月度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.monthData
                    },
                    {
                        name: '周度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: [data.count,data.count1,data.count2,data.count3]
                    },
                    {
                        name: '日度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.dayData
                    }
                ]
            };
        });
        if($("#objectType").val()==2){
            ajax2.set("id",$("#objectId").val())
        }else{
            ajax2.set("id",$("#cCode").val())
        }
        // ajax2.set("id",$("#cCode").val());
        ajax2.start()
        myChart6.setOption(option6);
    }
    function tuifei() {
        var myChart1 = echarts.init(document.getElementById('refund'));
        let id  = $("#cCode").val()
@@ -1264,7 +1469,11 @@
            };
        });
        if($("#objectType").val()==2){
            ajax3.set("id",$("#objectId").val())
        }else{
        ajax3.set("id",id)
        }
        ajax3.start();
        myChart1.on('legendselectchanged', obj => {
@@ -1323,8 +1532,8 @@
            myChart3.setOption(options, true)
        });
        var ajax2 = new $ax(Feng.ctxPath + "/data/userAndVipYys", function(data){
            $("#userAll").text(data.allUser)
            $("#userVipAll").text(data.allVip)
            $("#d1").text("用户总数:"+data.allUser+"人")
            $("#d2").text("年费会员数量"+data.allVip+"人")
            console.log(data)
            option2  = {
                tooltip: {
@@ -1451,7 +1660,13 @@
                ]
            };
        });
        if($("#objectType").val()==2){
            ajax2.set("id",$("#objectId").val())
        }else{
        ajax2.set("id",id)
        }
        ajax2.start()
        myChart2.setOption(option2);
        myChart3.setOption(option3);
@@ -1489,7 +1704,7 @@
        }
        var ajax2 = new $ax(Feng.ctxPath + "/data/actYys", function(data){
            $("#allHour").text(data.allHour)
            $("#allHours").text("运营时长"+data.allHour+"小时")
            option4 = {
                tooltip: {
@@ -1590,7 +1805,11 @@
                ]
            };
        });
        if($("#objectType").val()==2){
            ajax2.set("id",$("#objectId").val())
        }else {
        ajax2.set("id",id)
        }
        ajax2.start()
        myChart4.setOption(option4);
        myChart5.setOption(option5);
@@ -1660,6 +1879,19 @@
        timeX.push(String(i));
    }
    $(function(){
        var roleType = $("#objectType").val();
        if (roleType==2){
            ptActivity()
            ptUser()
            tuifei()
            ptStu()
            yytj()
            ptCourse()
            jxtj()
            srtj()
            income()
        }
        var chartDom = document.getElementById('cookieTicket');
        var myChart = echarts.init(chartDom);
        var option;
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/platformIncome.html
@@ -240,7 +240,7 @@
                                    <h2>课时数据</h2>
                                    </br>
                                    </br>
                                    <span>现有课时总量:0小时</span>
                                    <span id="allCourse">现有课时总量:0小时</span>
                                    </br>
                                    </br>
                                    <div id="courseData" style="width: 1280px;height:500px;"></div>
@@ -428,7 +428,6 @@
        getContent(1);
        getContent1(1);
        getContent2(1);
        var ajax = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){
@@ -1183,9 +1182,7 @@
        var ajax2 = new $ax(Feng.ctxPath + "/data/coursePt", function(data){
            console.log(data)
            $("#allHour").text(data.allHour)
            $("#allCourse").text("现有课时总量:"+data.allCourse+"小时")
            option7  = {
                tooltip: {
                    trigger: 'axis'
@@ -1238,7 +1235,7 @@
                        name: '周度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: [data.count,data.count1,data.count2,data.count3]
                        data: data.weekData
                    },
                    {
                        name: '日度耗课数',
@@ -1419,6 +1416,8 @@
            });
            ajax.start();
            ptStu()
            ptCourse();
        }
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/storeIncome.html
@@ -40,6 +40,8 @@
</style>
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <input id="objectId" value="${objectId}" hidden>
        <input id="objectType" value="${objectType}" hidden>
        <div class="form-horizontal">
            <div class="row">
                <br class="col-sm-10">
@@ -188,7 +190,7 @@
                                    <h2>运营数据</h2>
                                    </br>
                                    </br>
                                    <span>运营时长:0小时</span>
                                    <span id = "allHours">运营时长:0小时</span>
                                    </br>
                                    </br>
                                    <div style="height: 25px;box-sizing: border-box;background:#f3f3f4;line-height: 25px;border:1px solid;margin-bottom: 20px;width: 500px">
@@ -272,6 +274,8 @@
    function search(){
        ptStu()
        ptCourse()
        if(cutType==1){
            srtj()
            tuifei()
@@ -284,7 +288,9 @@
            ptActivity()
        }
        if(cutType==3){
            ptStu()
            jxtj()
        }
    }
    function income(){
@@ -387,7 +393,11 @@
        });
        ajax.set("type",1);
        ajax.set("storeId",$("#cCode").val());
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("storeId", $("#cCode").val())
        }
        ajax.start();
        // 营收
        var income  = echarts.init(document.getElementById('income'));
@@ -544,7 +554,11 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.set("time",beginTime);
        ajax.start();
@@ -665,7 +679,11 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.start();
    }
@@ -782,7 +800,12 @@
        }, function (data) {
        });
        ajax.set("id",id);
        if($("#objectType").val()==3){
            ajax.set("id",$("#objectId").val())
        }else {
            ajax.set("id", id)
        }
        ajax.start();
    }
@@ -863,7 +886,11 @@
            };
        });
        if($("#objectType").val()==3){
            ajax3.set("id",$("#objectId").val())
        }else {
        ajax3.set("id",id)
        }
        ajax3.start();
        myChart1.on('legendselectchanged', obj => {
@@ -883,7 +910,101 @@
        myChart1.setOption(option1);
    }
    function ptStu() {
        var myChart6 = echarts.init(document.getElementById('teach'));
        myChart6.on('legendselectchanged', obj => {
            var options = myChart6.getOption()
            //这里是选择切换什么样的x轴,那么他会进行对Y值的切换
            if (obj.name == '年度学员数') {
                options.xAxis[0].data = yearX
            } else if (obj.name == '月度学员数') {
                options.xAxis[0].data = monthX
            }else if (obj.name == '周度学员数') {
                options.xAxis[0].data = ["1周","2周","3周","4周"]
            }else if (obj.name == '日度学员数') {
                options.xAxis[0].data = dataX
            }
            myChart6.setOption(options, true)
        });
        var ajax2 = new $ax(Feng.ctxPath + "/data/stuStores", function(data){
            console.log(data)
            $("#allUser").text(data.allUser)
            option6  = {
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['年度学员数', '月度学员数', '周度学员数', '日度学员数'],
                    icon: 'stack',
                    selectedMode: 'single', // 单选
                    selected: {
                        年度学员数: true,
                        月度学员数: false,
                        周度学员数: false,
                        日度学员数: false
                    },
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: yearX
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '年度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.yearData
                    },
                    {
                        name: '月度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.monthData
                    },
                    {
                        name: '周度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: [data.count,data.count1,data.count2,data.count3]
                    },
                    {
                        name: '日度学员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.dayData
                    }
                ]
            };
        });
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
            ajax2.set("id", $("#cCode").val())
        }
        ajax2.start()
        myChart6.setOption(option6);
    }
    function ptUser() {
        var myChart2 = echarts.init(document.getElementById('user'));
@@ -1051,12 +1172,107 @@
                ]
            };
        });
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
        ajax2.set("id",id)
        }
        ajax2.start()
        myChart2.setOption(option2);
        myChart3.setOption(option3);
    }
    function ptCourse() {
        var myChart7 = echarts.init(document.getElementById('courseData'));
        myChart7.on('legendselectchanged', obj => {
            var options = myChart7.getOption()
            //这里是选择切换什么样的x轴,那么他会进行对Y值的切换
            if (obj.name == '年度耗课数') {
                options.xAxis[0].data = yearX
            } else if (obj.name == '月度耗课数') {
                options.xAxis[0].data = monthX
            }else if (obj.name == '周度耗课数') {
                options.xAxis[0].data = ["1周","2周","3周","4周"]
            }else if (obj.name == '日度耗课数') {
                options.xAxis[0].data = dataX
            }
            myChart7.setOption(options, true)
        });
        var ajax2 = new $ax(Feng.ctxPath + "/data/courseStore", function(data){
            console.log(data)
            $("#allCourse").text("现有课时总量:"+data.allCourse+"小时")
            option7  = {
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['年度耗课数', '月度耗课数', '周度耗课数', '日度耗课数'],
                    icon: 'stack',
                    selectedMode: 'single', // 单选
                    selected: {
                        年度耗课数: true,
                        月度耗课数: false,
                        周度耗课数: false,
                        日度耗课数: false
                    },
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: yearX
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '年度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.yearData
                    },
                    {
                        name: '月度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.monthData
                    },
                    {
                        name: '周度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.weekData
                    },
                    {
                        name: '日度耗课数',
                        type: 'line',
                        stack: 'Total',
                        data: data.dayData
                    }
                ]
            };
        });
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
            ajax2.set("id", $("#cCode").val())
        }
        ajax2.start()
        myChart7.setOption(option7);
    }
    function ptActivity() {
        var myChart4 = echarts.init(document.getElementById('activity'));
        var myChart5 = echarts.init(document.getElementById('prepare'));
@@ -1088,9 +1304,7 @@
            return;
        }
        var ajax2 = new $ax(Feng.ctxPath + "/data/actStore", function(data){
            $("#allHour").text(data.allHour)
            $("#allHours").text(data.allHour)
            option4 = {
                tooltip: {
                    trigger: 'axis'
@@ -1190,7 +1404,12 @@
                ]
            };
        });
        if($("#objectType").val()==3){
            ajax2.set("id",$("#objectId").val())
        }else {
        ajax2.set("id",id)
        }
        ajax2.start()
        myChart4.setOption(option4);
        myChart5.setOption(option5);
@@ -1665,6 +1884,16 @@
    myChart.setOption(option);
    });
    $(function(){
        if($("#objectType").val()==3){
            ptCourse()
            ptActivity()
            ptUser()
            ptStu()
            tuifei()
            yytj()
            srtj()
        }
        var chartDom = document.getElementById('cookieCourse');
        var myChart = echarts.init(chartDom);
        var option;