| | |
| | | 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(){ |
| | |
| | | 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 |
| | |
| | | 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); |
| | |
| | | |
| | | } |
| | | @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()); |
| | |
| | | private String phone; |
| | | private Integer isVip; |
| | | private Integer state; |
| | | private String salesmanUserName; |
| | | private String salesmanUserId; |
| | | // 角色类型 |
| | | private Integer insertType; |
| | | // 平台/运营商/门店id |
| | | private Integer typeId; |
| | | } |
| | |
| | | <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> |
| | |
| | | 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.*; |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | @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; |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | | |
| | |
| | | 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")); |
| | | |
| | |
| | | if(ToolUtil.isEmpty(coursePackage.getNeedNum())){ |
| | | coursePackageStudent.setNeedNum(0); |
| | | }else { |
| | | coursePackageStudent.setNeedNum(coursePackageStudent.getNeedNum()); |
| | | coursePackageStudent.setNeedNum(coursePackage.getNeedNum()); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | | |
| | | } |
| | | } |
| | |
| | | </if> |
| | | and t1.payStatus = 2 |
| | | </where> |
| | | order by t1.insertTime desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | 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); |
| | | |
| | | |
| | | } |
| | |
| | | private String phone; |
| | | private Integer isVip; |
| | | private Integer state; |
| | | private String salesmanUserName; |
| | | private Integer salesmanUserId; |
| | | // 角色类型 |
| | | private Integer insertType; |
| | | // 平台/运营商/门店id |
| | | private Integer typeId; |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/competition/actPt") |
| | | HashMap<String, Object> actPt(List<Integer> ids); |
| | | @PostMapping("/base/competition/actYys") |
| | | HashMap<String, Object> actYys(@RequestBody CompetionVO vo); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @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); |
| | | } |
| | |
| | | // 获取课包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(); |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | |
| | | @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); |
| | |
| | | if(integer==0 && integer1==0){ |
| | | a=24; |
| | | }else { |
| | | a= integer1-integer; |
| | | a= integer-integer1; |
| | | } |
| | | l1 += l * a; |
| | | } |
| | |
| | | @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"; |
| | | } |
| | | |
| | |
| | | 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"; |
| | | } |
| | | |
| | |
| | | @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; |
| | | } |
| | |
| | | @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()); |
| | |
| | | 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){ |
| | |
| | | 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; |
| | | } |
| | |
| | | <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){ |
| | |
| | | <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" > |
| | |
| | | <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"> |
| | |
| | | |
| | | function search(){ |
| | | income(); |
| | | ptCourse() |
| | | ptStu() |
| | | if(cutType==1){ |
| | | srtj() |
| | | tuifei() |
| | |
| | | ptUser() |
| | | ptActivity() |
| | | |
| | | |
| | | } |
| | | if(cutType==3){ |
| | | jxtj() |
| | | |
| | | |
| | | } |
| | | } |
| | | function income(){ |
| | |
| | | |
| | | if(type==3){ |
| | | jxtj() |
| | | ptStu() |
| | | } |
| | | |
| | | |
| | |
| | | }, 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(); |
| | | |
| | |
| | | }, 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) |
| | |
| | | }, 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() |
| | |
| | | |
| | | }; |
| | | }); |
| | | ajax3.set("id",id) |
| | | if($("#objectType").val()==2){ |
| | | ajax3.set("id",$("#objectId").val()) |
| | | }else{ |
| | | ajax3.set("id",id) |
| | | } |
| | | ajax3.start(); |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | |
| | | 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: { |
| | |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("id",id) |
| | | if($("#objectType").val()==2){ |
| | | ajax2.set("id",$("#objectId").val()) |
| | | }else{ |
| | | ajax2.set("id",id) |
| | | } |
| | | |
| | | |
| | | ajax2.start() |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | |
| | | } |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/actYys", function(data){ |
| | | |
| | | $("#allHour").text(data.allHour) |
| | | $("#allHours").text("运营时长"+data.allHour+"小时") |
| | | |
| | | option4 = { |
| | | tooltip: { |
| | |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("id",id) |
| | | if($("#objectType").val()==2){ |
| | | ajax2.set("id",$("#objectId").val()) |
| | | }else { |
| | | ajax2.set("id", id) |
| | | } |
| | | ajax2.start() |
| | | myChart4.setOption(option4); |
| | | myChart5.setOption(option5); |
| | |
| | | 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; |
| | |
| | | <h2>课时数据</h2> |
| | | </br> |
| | | </br> |
| | | <span>现有课时总量:0小时</span> |
| | | <span id="allCourse">现有课时总量:0小时</span> |
| | | </br> |
| | | </br> |
| | | <div id="courseData" style="width: 1280px;height:500px;"></div> |
| | |
| | | getContent(1); |
| | | getContent1(1); |
| | | getContent2(1); |
| | | |
| | | |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){ |
| | |
| | | |
| | | 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' |
| | |
| | | name: '周度耗课数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [data.count,data.count1,data.count2,data.count3] |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度耗课数', |
| | |
| | | }); |
| | | ajax.start(); |
| | | ptStu() |
| | | ptCourse(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | </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"> |
| | |
| | | <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"> |
| | |
| | | |
| | | function search(){ |
| | | |
| | | ptStu() |
| | | ptCourse() |
| | | if(cutType==1){ |
| | | srtj() |
| | | tuifei() |
| | |
| | | ptActivity() |
| | | } |
| | | if(cutType==3){ |
| | | ptStu() |
| | | jxtj() |
| | | |
| | | } |
| | | } |
| | | function income(){ |
| | |
| | | |
| | | }); |
| | | 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')); |
| | |
| | | }, 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(); |
| | | |
| | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | if($("#objectType").val()==3){ |
| | | ajax.set("id",$("#objectId").val()) |
| | | }else { |
| | | ajax.set("id", id) |
| | | } |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | |
| | | if($("#objectType").val()==3){ |
| | | ajax.set("id",$("#objectId").val()) |
| | | }else { |
| | | ajax.set("id", id) |
| | | } |
| | | ajax.start(); |
| | | |
| | | } |
| | |
| | | |
| | | }; |
| | | }); |
| | | ajax3.set("id",id) |
| | | if($("#objectType").val()==3){ |
| | | ajax3.set("id",$("#objectId").val()) |
| | | }else { |
| | | ajax3.set("id", id) |
| | | } |
| | | ajax3.start(); |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | |
| | | 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')); |
| | |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("id",id) |
| | | 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')); |
| | |
| | | return; |
| | | } |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/actStore", function(data){ |
| | | |
| | | $("#allHour").text(data.allHour) |
| | | |
| | | $("#allHours").text(data.allHour) |
| | | option4 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("id",id) |
| | | |
| | | if($("#objectType").val()==3){ |
| | | ajax2.set("id",$("#objectId").val()) |
| | | }else { |
| | | ajax2.set("id", id) |
| | | } |
| | | ajax2.start() |
| | | myChart4.setOption(option4); |
| | | myChart5.setOption(option5); |
| | |
| | | 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; |