Merge remote-tracking branch 'origin/master'
# Conflicts:
# cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java
# cloud-server-course/src/main/java/com/dsh/course/controller/CourseStudentController.java
| | |
| | | <description>账户</description> |
| | | <dependencies> |
| | | <!--日志处理--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.binarywang</groupId>--> |
| | | <!-- <artifactId>wx-java-pay-spring-boot-starter</artifactId>--> |
| | |
| | | Date time = sdf.parse(substring); |
| | | return !time.before(lastWeekStartDate) && !time.after(lastOfDate); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | }) |
| | |
| | | Date time = sdf.parse(record.getTimeFrame().substring(11)); |
| | | return !time.before(lastMonthStartDate) && !time.after(lastOfDate); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | }) |
| | |
| | | Date time = sdf.parse(record.getTimeFrame().substring(11)); |
| | | return !time.before(lastYearStartDate) && !time.after(lastOfDate); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | }) |
| | |
| | | <name>福利</name> |
| | | <description>福利</description> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.gavaghan</groupId> |
| | | <artifactId>geodesy</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | <!--日志处理--> |
| | | <dependency> |
| | | <groupId>cn.mb.cloud</groupId> |
| | |
| | | |
| | | } else if (merchandise.getUseScope() == 3) { |
| | | // 指定门店 |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new LambdaQueryWrapper<PointsMerchandiseStore>().eq(PointsMerchandiseStore::getPointsMerchandiseId, merchandise.getId())); |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new LambdaQueryWrapper<PointsMerchandiseStore>() |
| | | .eq(PointsMerchandiseStore::getPointsMerchandiseId, merchandise.getId())); |
| | | List<Integer> collect = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList()); |
| | | detailsResponse.setSid(collect); |
| | | if (collect.size() > 0) { |
| | | // 获取rid |
| | | List<Integer> rid = stoClient.querySiteIdById(collect); |
| | | detailsResponse.setRid(rid); |
| | | // List<Integer> rid= stoClient.querySiteIdById(collect); |
| | | //detailsResponse.setRid(rid); |
| | | // todo 修改区域id 临时 |
| | | // 根据门店id 写死区域id 后续调整为门票指定多个区域 |
| | | // 以下代码均为临时代码 |
| | | for (Integer integer : collect) { |
| | | ArrayList<Integer> list2 = new ArrayList<>(); |
| | | if (integer==2024){ |
| | | list2.add(32); |
| | | detailsResponse.setRid(list2); |
| | | } |
| | | // 临时 根据门票id 指定的区域 |
| | | if (integer==9919){ |
| | | if (pointsMerchandise.getPointsMerchandiseId()==196||pointsMerchandise.getPointsMerchandiseId()==198){ |
| | | // 返回儿童区id |
| | | ArrayList<Integer> list3 = new ArrayList<>(); |
| | | list3.add(44); |
| | | detailsResponse.setRid(list3); |
| | | }else { |
| | | ArrayList<Integer> list4 = new ArrayList<>(); |
| | | list4.add(43); |
| | | detailsResponse.setRid(list4); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | if (null != map) { |
| | | String code = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", code).eq("payType", 2)); |
| | | if (paymentCompetition.getPayStatus() == 1) { |
| | | paymentCompetition.setAppUserId(null); |
| | |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(trade_no); |
| | | paymentCompetitionService.updateById(paymentCompetition); |
| | | |
| | | Competition competition = cttService.getById(paymentCompetition.getCompetitionId()); |
| | | competition.setApplicantsNumber(competition.getApplicantsNumber() + 1); |
| | | cttService.updateById(competition); |
| | |
| | | wrapper.lt(Competition::getStartTime, listQuery.getTime().split(" - ")[0] + " 00:00:00"); |
| | | wrapper.gt(Competition::getEndTime, listQuery.getTime().split(" - ")[1] + " 23:59:59"); |
| | | } |
| | | |
| | | if (ToolUtil.isNotEmpty(listQuery.getRegisterCondition())) { |
| | | wrapper.eq(Competition::getRegisterCondition, listQuery.getRegisterCondition()); |
| | | if(ToolUtil.isNotEmpty(listQuery.getRegisterCondition())){ |
| | | wrapper.eq(Competition::getRegisterCondition,listQuery.getRegisterCondition()); |
| | | } |
| | | |
| | | wrapper.in(Competition::getStoreId, listQuery.getIds()); |
| | | wrapper.eq(Competition::getAuditStatus, 2); |
| | | // 平台查询审核通过的赛事 |
| | | if (listQuery.getObj()==1){ |
| | | wrapper.eq(Competition::getAuditStatus,2); |
| | | } |
| | | // 赛事审核 |
| | | if (listQuery.getObj()==-1){ |
| | | wrapper.ne(Competition::getAuditStatus,2); |
| | | } |
| | | wrapper.in(Competition::getStoreId,listQuery.getIds()); |
| | | wrapper.orderByDesc(Competition::getInsertTime); |
| | | |
| | | Page<Competition> page = cttService.page(competitionPage, wrapper); |
| | | for (Competition record : page.getRecords()) { |
| | | |
| | | // 查询当前赛事有多少人报名了 |
| | | List<UserCompetition> competitionId = ucttService.list(new QueryWrapper<UserCompetition>() |
| | | .eq("competitionId", record.getId())); |
| | |
| | | private Integer state; |
| | | private Integer registerCondition; |
| | | private List<Integer> ids; |
| | | |
| | | // 角色类型 如果是平台1的话 查询审核通过的 如果是运营商查询所有属于 |
| | | private Integer obj; |
| | | } |
| | |
| | | <description>课程</description> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>net.sf.json-lib</groupId> |
| | | <artifactId>json-lib</artifactId> |
| | | <version>2.4</version> |
| | | <classifier>jdk15</classifier> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper</artifactId> |
| | | <version>5.2.1</version> |
| | |
| | | <version>3.23.5</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>net.sf.json-lib</groupId> |
| | | <artifactId>json-lib</artifactId> |
| | | <version>2.4</version> |
| | | <classifier>jdk15</classifier> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | @Autowired |
| | | private CourseCounsumService courseCounsumService; |
| | | |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderStudentService orderStudentService; |
| | | /** |
| | | * 添加数据 |
| | | * |
| | |
| | | public void addCancelledClasses(@RequestBody CancelledClasses cancelledClasses) { |
| | | cancelledClassesService.save(cancelledClasses); |
| | | |
| | | TCoursePackagePayment byId = coursePackagePaymentService.getById(cancelledClasses.getCoursePackagePaymentId()); |
| | | // TCoursePackagePayment byId = coursePackagePaymentService.getById(cancelledClasses.getCoursePackagePaymentId()); |
| | | orderStudentService.getById(cancelledClasses.getCoursePackagePaymentId()); |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(byId.getId()); |
| | | courseCounsum.setPaymentId(cancelledClasses.getCoursePackagePaymentId()); |
| | | courseCounsum.setChangeType(0); |
| | | courseCounsum.setNum(cancelledClasses.getCancelledClassesNumber()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | |
| | | public List<CoursePackagePaymentConfig> queryCoursePackagePaymentConfigList(@RequestBody Integer coursePackageId) { |
| | | return coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", coursePackageId)); |
| | | } |
| | | /** |
| | | * 根据课时规格id获取价格配置 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePaymentConfig/queryCoursePackagePaymentConfigList1") |
| | | public List<CoursePackagePaymentConfig> queryCoursePackagePaymentConfigList1(@RequestBody Integer coursePackagePaymentConfigId) { |
| | | return coursePackagePaymentConfigService. |
| | | list(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("id", coursePackagePaymentConfigId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | | import com.dsh.course.mapper.CoursePackageSchedulingMapper; |
| | | import com.dsh.course.mapper.CoursePackageStudentMapper; |
| | | import com.dsh.course.mapper.TCoursePackageMapper; |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import net.sf.json.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Autowired |
| | | private TCoursePackagePaymentService packagePaymentService; |
| | | |
| | | @Resource |
| | | private CoursePackageStudentMapper cpsMapper; |
| | | @Autowired |
| | | private ICoursePackageOrderService coursePackageOrderService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/add") |
| | | public Object addCoursePackagePayment(@RequestBody TCoursePackagePayment packagePayment) { |
| | | packagePayment.setInsertTime(new Date()); |
| | | packagePayment.setInsertTime(new Date()); |
| | | Integer studentId = packagePayment.getStudentId(); |
| | | // 添加学员上课记录 |
| | | CoursePackageStudent coursePackageStudent = new CoursePackageStudent(); |
| | | TCoursePackagePayment one = packagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", packagePayment.getStudentId()) |
| | | .orderByDesc("insertTime") |
| | | .last("LIMIT 1")); |
| | | |
| | | if (one != null) { |
| | | Integer totalClassHours = one.getTotalClassHours(); |
| | | Integer absencesNumber = one.getAbsencesNumber(); |
| | | // 没有过期 |
| | | if (one.getUseTime().after(new Date())) { |
| | | if (one.getLaveClassHours() - packagePayment.getClassHours() < 0) { |
| | | return 5002; |
| | | } |
| | | packagePayment.setTotalClassHours(one.getTotalClassHours()); |
| | | packagePayment.setLaveClassHours(one.getLaveClassHours() - packagePayment.getClassHours()); |
| | | packagePayment.setAbsencesNumber(one.getAbsencesNumber()); |
| | | //校验是否已经报满 |
| | | Integer cpId = Integer.valueOf((int) packagePayment.getCoursePackageId()); |
| | | Integer integer = coursePackagePaymentService.queryCountNumber(cpId); |
| | | TCoursePackage course = coursePackageService.getById(packagePayment.getCoursePackageId()); |
| | | if (course.getType() != 3) { |
| | | if (integer + 1 > course.getMaxSubscribeNumber()) { |
| | | return 5001; |
| | | } |
| | | packagePayment.setTotalClassHours(packagePayment.getClassHours()); |
| | | packagePayment.setLaveClassHours(packagePayment.getClassHours()); |
| | | packagePayment.setAbsencesNumber(one.getAbsencesNumber()); |
| | | } else { |
| | | packagePayment.setTotalClassHours(packagePayment.getClassHours()); |
| | | packagePayment.setLaveClassHours(packagePayment.getClassHours()); |
| | | packagePayment.setAbsencesNumber(0); |
| | | } |
| | | CoursePackageOrder coursePackageOrder = new CoursePackageOrder(); |
| | | coursePackageOrder.setAppUserId(packagePayment.getAppUserId()); |
| | | coursePackageOrder.setStudentIds(String.valueOf(packagePayment.getStudentId())); |
| | | coursePackageOrder.setCoursePackageId(packagePayment.getCoursePackageId()); |
| | | coursePackageOrder.setClassHours(packagePayment.getClassHours()); |
| | | coursePackageOrder.setOriginalPrice(packagePayment.getOriginalPrice()); |
| | | coursePackageOrder.setCashPayment(packagePayment.getCashPayment()); |
| | | coursePackageOrder.setPlayPaiCoin(packagePayment.getPlayPaiCoin()); |
| | | coursePackageOrder.setPayStatus(1); |
| | | coursePackageOrder.setState(1); |
| | | coursePackageOrder.setInsertTime(new Date()); |
| | | coursePackageOrder.setSalesName(packagePayment.getSalesName()); |
| | | coursePackageOrderService.save(coursePackageOrder); |
| | | // 生成排课数据 |
| | | TCoursePackage coursePackage = tcpService.getById(packagePayment.getCoursePackageId()); |
| | | //生成排课数据 |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date date = sdf1.parse(sdf.format(new Date()) + " 00:00:00"); |
| | | List<String> list = Arrays.asList(coursePackage.getClassWeeks().split(";")); |
| | | String value = coursePackage.getClassStartTime(); |
| | | String value1 = coursePackage.getClassEndTime(); |
| | | return 200; |
| | | |
| | | String[] star = value.split(","); |
| | | String[] end = value1.split(","); |
| | | for (int i = 0; i < star.length; i++) { |
| | | // int index = star[i].indexOf(","); |
| | | // String result = value.substring(0, index).trim(); |
| | | String classStartTime = star[i]; |
| | | String[] split = classStartTime.split(":"); |
| | | // String value1 = en; |
| | | int index1 = value1.indexOf(","); |
| | | // String result1 = value.substring(0, index1).trim(); |
| | | String classEndTime = end[i]; |
| | | String[] split1 = classEndTime.split(":"); |
| | | Calendar s = Calendar.getInstance(); |
| | | s.setTime(date); |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); |
| | | s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0])); |
| | | s.set(Calendar.MINUTE, Integer.valueOf(split[1])); |
| | | s.set(Calendar.SECOND, 0); |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 14); |
| | | long timeInMillis = e.getTimeInMillis(); |
| | | |
| | | while (true) { |
| | | int w = s.get(Calendar.DAY_OF_WEEK); |
| | | WeekEnum weekEnum = WeekEnum.getWeekEnum(w); |
| | | if (list.contains(weekEnum.getChineseName())) { |
| | | Calendar classDate = Calendar.getInstance(); |
| | | classDate.setTime(s.getTime()); |
| | | classDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0])); |
| | | classDate.set(Calendar.MINUTE, Integer.valueOf(split[1])); |
| | | classDate.set(Calendar.SECOND, 0); |
| | | |
| | | Calendar endDate = Calendar.getInstance(); |
| | | endDate.setTime(s.getTime()); |
| | | endDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split1[0])); |
| | | endDate.set(Calendar.MINUTE, Integer.valueOf(split1[1])); |
| | | endDate.set(Calendar.SECOND, 0); |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(coursePackage.getId()); |
| | | coursePackageScheduling.setClassDate(classDate.getTime()); |
| | | coursePackageScheduling.setEndDate(endDate.getTime()); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | coursePackageStudent.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | |
| | | List<CoursePackageScheduling> list1 = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>() |
| | | .eq("coursePackageId", coursePackage.getId()) |
| | | .eq("classDate", classDate.getTime()) |
| | | .eq("endDate", endDate.getTime())); |
| | | if (list1.size() + 1 > coursePackage.getMaxSubscribeNumber()) { |
| | | // 当前课包预约人数已满 |
| | | return 5001; |
| | | } |
| | | } |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); |
| | | if (s.getTimeInMillis() > timeInMillis) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | coursePackageStudent.setStudentId(packagePayment.getStudentId()); |
| | | coursePackageStudent.setCoursePackageId(packagePayment.getCoursePackageId()); |
| | | |
| | | |
| | | coursePackageStudent.setSignInOrNot(0); |
| | | coursePackageStudent.setReservationStatus(1); |
| | | coursePackageStudent.setInsertTime(new Date()); |
| | | coursePackageStudent.setAppUserId(packagePayment.getAppUserId()); |
| | | packagePaymentService.save(packagePayment); |
| | | coursePackageStudent.setCoursePackagePaymentId(packagePayment.getId()); |
| | | return coursePackageStudentService.save(coursePackageStudent); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/changeState") |
| | | public Object changeState(@RequestBody CoursePackagePayDTO dto) { |
| | | String ids = dto.getIds(); |
| | | Long aLong = Long.valueOf(ids); |
| | | CoursePackageOrder byId1 = coursePackageOrderService.getById(aLong); |
| | | TCoursePackage byId = coursePackageService.getById(byId1.getCoursePackageId()); |
| | | if (byId.getType()==1){ |
| | | // 如果重复购买 累加课时 |
| | | CoursePackageOrderStudent coursePackageOrderStudent = coursePackageOrderStudentService |
| | | .getOne(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", Integer.valueOf(byId1.getStudentIds())) |
| | | .eq("coursePackageId", byId1.getCoursePackageId()).eq("status", 1).eq("state", 1)); |
| | | if (null == coursePackageOrderStudent) { |
| | | coursePackageOrderStudent = new CoursePackageOrderStudent(); |
| | | coursePackageOrderStudent.setAppUserId(byId1.getAppUserId()); |
| | | coursePackageOrderStudent.setStudentId(Integer.valueOf(byId1.getStudentIds())); |
| | | coursePackageOrderStudent.setCoursePackageId(byId1.getCoursePackageId()); |
| | | coursePackageOrderStudent.setTotalClassHours(byId1.getClassHours()); |
| | | coursePackageOrderStudent.setLaveClassHours(byId1.getClassHours()); |
| | | coursePackageOrderStudent.setAbsencesNumber(0); |
| | | coursePackageOrderStudent.setStatus(1); |
| | | coursePackageOrderStudent.setState(1); |
| | | coursePackageOrderStudent.setInsertTime(new Date()); |
| | | // 判断这个订单购买的是哪一个课时规格 |
| | | CoursePackagePaymentConfig one1 = icppcService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", byId.getId()) |
| | | .eq("classHours", byId1.getClassHours())); |
| | | |
| | | // 判断当前购买的课包有没有赠送课时 |
| | | TCoursePackageDiscount one = tcpdService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackageId", byId.getId()) |
| | | .eq("type", 4).eq("auditStatus", 2).eq("status", 1) |
| | | .eq("coursePackagePaymentConfigId",one1.getId())); |
| | | if (one!=null){ |
| | | Integer giftClassHours = getGiftClassHours(one,null); |
| | | coursePackageOrderStudent.setGiftClassHours(giftClassHours); |
| | | coursePackageOrderStudent.setTotalClassHours(coursePackageOrderStudent.getTotalClassHours()+giftClassHours); |
| | | coursePackageOrderStudent.setLaveClassHours(coursePackageOrderStudent.getLaveClassHours()+giftClassHours); |
| | | }else{ |
| | | coursePackageOrderStudent.setGiftClassHours(0); |
| | | } |
| | | Integer validDays = byId.getValidDays(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + validDays); |
| | | coursePackageOrderStudent.setUseTime(calendar.getTime()); |
| | | |
| | | coursePackageOrderStudentService.saveOrUpdate(coursePackageOrderStudent); |
| | | Integer studentId = Integer.valueOf(byId1.getStudentIds()); |
| | | //开始排课 |
| | | addPackageStudent1(byId, byId1.getAppUserId(), studentId, coursePackageOrderStudent); |
| | | } else { |
| | | Date useTime = coursePackageOrderStudent.getUseTime(); |
| | | coursePackageOrderStudent.setTotalClassHours(coursePackageOrderStudent.getTotalClassHours() + byId1.getClassHours()); |
| | | coursePackageOrderStudent.setLaveClassHours(coursePackageOrderStudent.getLaveClassHours() + byId1.getClassHours()); |
| | | Integer validDays = byId.getValidDays(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(useTime.compareTo(new Date()) < 0 ? new Date() : useTime); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + validDays); |
| | | coursePackageOrderStudent.setUseTime(calendar.getTime()); |
| | | // 判断这个订单购买的是哪一个课时规格 |
| | | CoursePackagePaymentConfig one1 = icppcService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", byId.getId()) |
| | | .eq("classHours", byId1.getClassHours())); |
| | | // 判断当前购买的课包有没有赠送课时 |
| | | TCoursePackageDiscount one = tcpdService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackageId", byId.getId()) |
| | | .eq("type", 4).eq("auditStatus", 2).eq("status", 1) |
| | | .eq("coursePackagePaymentConfigId",one1.getId())); |
| | | if (one!=null){ |
| | | Integer giftClassHours = getGiftClassHours(one,null); |
| | | coursePackageOrderStudent.setGiftClassHours(giftClassHours); |
| | | }else{ |
| | | coursePackageOrderStudent.setGiftClassHours(0); |
| | | } |
| | | // 获取常规课的有效期 计算是哪一天 |
| | | Calendar calendar9 = Calendar.getInstance(); |
| | | calendar9.add(Calendar.DAY_OF_MONTH, byId.getValidDays()); |
| | | Date time = calendar9.getTime(); |
| | | coursePackageOrderStudent.setUseTime(time); |
| | | coursePackageOrderStudentService.saveOrUpdate(coursePackageOrderStudent); |
| | | Integer studentId = Integer.valueOf(byId1.getStudentIds()); |
| | | //中间断课,没有连续续费的情况需要重新排课 |
| | | if (useTime.compareTo(new Date()) < 0) { |
| | | addPackageStudent1(byId, byId1.getAppUserId(), studentId, coursePackageOrderStudent); |
| | | } |
| | | } |
| | | } |
| | | if(byId.getType() == 2){ |
| | | addPackageStudent1(byId, byId1.getAppUserId(), Integer.valueOf(byId1.getStudentIds()), null); |
| | | } |
| | | return packagePaymentService.changeState(dto); |
| | | } |
| | | |
| | | @GetMapping("/coursePackagePayment/courseStore/{appUserId}/{coursePackageId}") |
| | | public List<TCoursePackagePayment> getByUserIdAndCoursePackageId(@PathVariable("appUserId") Integer appUserId, @PathVariable("coursePackageId") Integer coursePackageId) { |
| | | List<TCoursePackagePayment> list = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | public List<CoursePackageOrderStudent> getByUserIdAndCoursePackageId(@PathVariable("appUserId") Integer appUserId, @PathVariable("coursePackageId") Integer coursePackageId) { |
| | | List<CoursePackageOrderStudent> list = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | .eq("appUserId", appUserId) |
| | | .eq("coursePackageId", coursePackageId)); |
| | | return list; |
| | |
| | | List<CoursePackagePaymentVO> res = packagePaymentService.listAll(query); |
| | | List<CoursePackagePaymentVO> result = new ArrayList<>(); |
| | | for (CoursePackagePaymentVO re : res) { |
| | | // 判断这条记录有没有赠送课时 |
| | | Integer coursePackageId = re.getCoursePackageId(); |
| | | Integer classHours = re.getClassHours(); |
| | | CoursePackagePaymentConfig one = icppcService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", coursePackageId) |
| | | .eq("classHours", classHours)); |
| | | if (one!=null){ |
| | | TCoursePackageDiscount one1 = discountService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackageId", coursePackageId) |
| | | .eq("coursePackagePaymentConfigId", one.getId()) |
| | | .eq("auditStatus",2).eq("status",1).eq("type",4)); |
| | | if (one1 == null){ |
| | | re.setGiftClassHours(0); |
| | | }else{ |
| | | Integer giftClassHours = getGiftClassHours(one1,re.getInsertTime()); |
| | | re.setGiftClassHours(giftClassHours); |
| | | } |
| | | }else{ |
| | | re.setGiftClassHours(0); |
| | | } |
| | | if (re.getCashPayment() == null) { |
| | | if (re.getPlayPaiCoin() != null) { |
| | | String value = String.valueOf(re.getPlayPaiCoin()); |
| | | re.setCashPayment(new BigDecimal(value)); |
| | | } |
| | | } |
| | | |
| | | Store store = storeClient.queryStoreById(re.getStoreId()); |
| | | TAppUser appUser = appUserClient.queryAppUser1(re.getAppUserId()); |
| | | Student student = studentClient.queryStudentById(re.getStudentId()); |
| | | re.setPayStudent(student.getName()); |
| | | String studentId = re.getStudentId(); |
| | | String[] split = studentId.split(","); |
| | | StringBuilder stringBuilder = new StringBuilder(""); |
| | | |
| | | for (String s : split) { |
| | | Student student = studentClient.queryStudentById(Integer.valueOf(s)); |
| | | stringBuilder.append(student.getName()+","); |
| | | } |
| | | String string = stringBuilder.toString(); |
| | | if (string.length() > 0) { |
| | | String stringWithoutLastCharacter = string.substring(0, string.length() - 1); |
| | | re.setPayStudent(stringWithoutLastCharacter); |
| | | } |
| | | re.setPayUser(appUser.getName()); |
| | | re.setPhone(appUser.getPhone()); |
| | | re.setStoreName(store.getName()); |
| | |
| | | } else { |
| | | List<Student> students = studentClient.queryStudentListByName(query.getPayStudent()); |
| | | for (Student student1 : students) { |
| | | if (student.getName().equals(student1.getName())) { |
| | | if (string.contains(student1.getName())) { |
| | | result.add(re); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (re.getPayType() != null) { |
| | | if (re.getPayType() == 1) { |
| | | re.setBuyTypeName("微信支付"); |
| | |
| | | if (discountService.list(new QueryWrapper<TCoursePackageDiscount>() |
| | | .eq("coursePackageId", re.getCoursePackageId()).eq("auditStatus", 2)).size() > 0) { |
| | | re.setBuyType(3); |
| | | re.setDiscountAmount(re.getOriginalPrice().subtract(re.getPayMoney())); |
| | | re.setDiscountAmount(re.getOriginalPrice().subtract(re.getCashPayment())); |
| | | } else { |
| | | re.setBuyType(2); |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/coursePack/getRecord") |
| | | public List<PurchaseRecordVo> getRecord(@RequestBody RecordTimeRequest recordTimeRequest) { |
| | | List<CoursePackageOrderStudent> list = new ArrayList<>(); |
| | | // List<CoursePackageOrderStudent> list = new ArrayList<>(); |
| | | Integer[] changes = {1, 0}; |
| | | if (recordTimeRequest.getType() == null) { |
| | | list = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", recordTimeRequest.getStuId()).eq("coursePackageId", recordTimeRequest.getLessionId()).orderByDesc("insertTime")); |
| | | } else { |
| | | |
| | | list = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", recordTimeRequest.getStuId()).eq("coursePackageId", recordTimeRequest.getLessionId()).orderByDesc("insertTime")); |
| | | } |
| | | List<Integer> appUserIds = list.stream().map(CoursePackageOrderStudent::getAppUserId).collect(Collectors.toList()); |
| | | // if (recordTimeRequest.getType() == null) { |
| | | // list = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", recordTimeRequest.getStuId()).eq("coursePackageId", recordTimeRequest.getLessionId()).orderByDesc("insertTime")); |
| | | // } else { |
| | | // |
| | | // list = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", recordTimeRequest.getStuId()).eq("coursePackageId", recordTimeRequest.getLessionId()).orderByDesc("insertTime")); |
| | | // } |
| | | // List<Integer> appUserIds = list.stream().map(CoursePackageOrderStudent::getAppUserId).collect(Collectors.toList()); |
| | | List<CoursePackageOrderStudent> list1 = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | .in("appUserId", appUserIds) |
| | | .in("studentId", recordTimeRequest.getStuId()) |
| | | .eq("studentId", recordTimeRequest.getStuId()) |
| | | .eq("coursePackageId", recordTimeRequest.getLessionId()) |
| | | .eq("state", 1) |
| | | ); |
| | |
| | | } |
| | | return videoVos; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/allPaymentCourseList") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 已报名课程详情 |
| | | */ |
| | |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "int") |
| | | |
| | | }) |
| | | public ResultUtil<CourseDetailsResponse> getRegisteredData(Long coursePayId, String lon, String lat, Integer orderId) { |
| | | public ResultUtil<CourseDetailsResponse> getRegisteredData(Long coursePayId, String lon, String lat) { |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if (null == appUserId) { |
| | |
| | | } |
| | | CourseDetailsResponse courseDetailsResponse = packagePaymentService.queryRegisteredCourseDetails(coursePayId, appUserId, lon, lat); |
| | | |
| | | |
| | | |
| | | |
| | | // |
| | | // if (orderId != null) { |
| | | // TOrder byId = orderService.getById(orderId); |
| | | // courseDetailsResponse.setAmount(byId.getPrice()); |
| | |
| | | return dateList.toArray(new Date[0]); |
| | | } |
| | | |
| | | public Integer getGiftClassHours(TCoursePackageDiscount one,Date insertTime){ |
| | | if (insertTime!=null){ |
| | | // 判断购买时间 是否满足折扣规则 |
| | | char c = one.getContent().charAt(0); |
| | | String value1 = String.valueOf(c); |
| | | JSONObject jsonObject ; |
| | | if (value1.equals("[")){ |
| | | jsonObject = JSONObject.fromObject(one.getContent() |
| | | .substring(1,one.getContent().length() - 1)); |
| | | }else{ |
| | | jsonObject = JSONObject.fromObject(one.getContent()); |
| | | } |
| | | // 赠送课时 判断当前课包有没有赠送课时 |
| | | String weeks = jsonObject.getString("weeks"); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(insertTime); |
| | | // 获取星期几,星期日是1,星期一是2,以此类推 |
| | | int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); |
| | | // 将星期日(Calendar定义为1)转换为7 |
| | | if (dayOfWeek == Calendar.SUNDAY) { |
| | | dayOfWeek = 7; |
| | | } else { |
| | | // 其他星期减一即可得到1-6的数字表示 |
| | | dayOfWeek -= 1; |
| | | } |
| | | // todo |
| | | if (weeks.contains(String.valueOf(dayOfWeek))){ |
| | | // 限时折扣判断是否在有效期 |
| | | try { |
| | | // 判断当日时间是否能享受到折扣 |
| | | String startTime = jsonObject.getString("startTime"); |
| | | String endTime = jsonObject.getString("endTime"); |
| | | |
| | | // 定义时间格式 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| | | // 解析开始时间和结束时间为Date对象 |
| | | Date startTime1 = sdf.parse(startTime); |
| | | Date endTime1 = sdf.parse(endTime); |
| | | Date date1 = new Date(); |
| | | date1.setHours(startTime1.getHours()); |
| | | date1.setMinutes(startTime1.getMinutes()); |
| | | date1.setSeconds(startTime1.getSeconds()); |
| | | Date date2 = new Date(); |
| | | date2.setHours(endTime1.getHours()); |
| | | date2.setMinutes(endTime1.getMinutes()); |
| | | date2.setSeconds(endTime1.getSeconds()); |
| | | // 检查当前时间是否在开始时间和结束时间之间 |
| | | if (insertTime.after(date1) && insertTime.before(date2)) { |
| | | System.out.println("当前时间在开始时间和结束时间之间。"); |
| | | String hour = jsonObject.getString("hour"); |
| | | return Integer.valueOf(hour); |
| | | } else { |
| | | System.out.println("当前时间不在开始时间和结束时间之间。"); |
| | | return 0; |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | // 判断购买时间 是否满足折扣规则 |
| | | char c = one.getContent().charAt(0); |
| | | String value1 = String.valueOf(c); |
| | | JSONObject jsonObject ; |
| | | if (value1.equals("[")){ |
| | | jsonObject = JSONObject.fromObject(one.getContent() |
| | | .substring(1,one.getContent().length() - 1)); |
| | | }else{ |
| | | jsonObject = JSONObject.fromObject(one.getContent()); |
| | | } |
| | | // 赠送课时 判断当前课包有没有赠送课时 |
| | | String weeks = jsonObject.getString("weeks"); |
| | | // 判断当前周几 是否满足折扣规则 |
| | | // 获取当前日期 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | // 获取当前日期是星期几的数字表示 |
| | | int dayOfWeekAsNumber = currentDate.getDayOfWeek().getValue(); |
| | | if (weeks.contains(String.valueOf(dayOfWeekAsNumber))){ |
| | | // 限时折扣判断是否在有效期 |
| | | try { |
| | | // 判断当日时间是否能享受到折扣 |
| | | String startTime = jsonObject.getString("startTime"); |
| | | String endTime = jsonObject.getString("endTime"); |
| | | // 获取当前时间 |
| | | Date currentTime = new Date(); |
| | | // 定义时间格式 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| | | // 解析开始时间和结束时间为Date对象 |
| | | Date startTime1 = sdf.parse(startTime); |
| | | Date endTime1 = sdf.parse(endTime); |
| | | Date date1 = new Date(); |
| | | date1.setHours(startTime1.getHours()); |
| | | date1.setMinutes(startTime1.getMinutes()); |
| | | date1.setSeconds(startTime1.getSeconds()); |
| | | Date date2 = new Date(); |
| | | date2.setHours(endTime1.getHours()); |
| | | date2.setMinutes(endTime1.getMinutes()); |
| | | date2.setSeconds(endTime1.getSeconds()); |
| | | // 检查当前时间是否在开始时间和结束时间之间 |
| | | if (currentTime.after(date1) && currentTime.before(date2)) { |
| | | System.out.println("当前时间在开始时间和结束时间之间。"); |
| | | String hour = jsonObject.getString("hour"); |
| | | |
| | | return Integer.valueOf(hour); |
| | | } else { |
| | | System.out.println("当前时间不在开始时间和结束时间之间。"); |
| | | return 0; |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Autowired |
| | | private TCoursePackageService coursePackageService; |
| | | private void addPackageStudent1(TCoursePackage tCoursePackage, Integer userId, Integer sId, CoursePackageOrderStudent coursePackageOrderStudent) { |
| | | try { |
| | | //1常规 2假期 3体验 |
| | | if (tCoursePackage.getType() == 1) { |
| | | //上课星期 |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | //上课时段 |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | //剩余课时 |
| | | Integer laveClassHours = coursePackageOrderStudent.getLaveClassHours(); |
| | | //扣除课时数 |
| | | Integer codeTime = tCoursePackage.getCodeTime(); |
| | | //排课 本周+下周,课时不够扣则直接剩余不排课 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | int day_week = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day_week = day_week - 1 == 0 ? 7 : day_week - 1; |
| | | int num = 8 - day_week + 7; |
| | | Date useTime = coursePackageOrderStudent.getUseTime(); |
| | | |
| | | for (int i = 0; i < num; i++) { |
| | | Date time = calendar.getTime(); |
| | | |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= useTime.getTime()) { |
| | | break; |
| | | } |
| | | for (int j = 0; j < split.length; j++) { |
| | | //剩余数量不足以排课 |
| | | if (laveClassHours.compareTo(codeTime) < 0) { |
| | | break; |
| | | } |
| | | |
| | | laveClassHours -= codeTime; |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setType(tCoursePackage.getType()); |
| | | coursePackageScheduling.setAppUserId(userId); |
| | | coursePackageScheduling.setStudentId(sId); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(time) + " " + split[j]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[j]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(userId); |
| | | student1.setStudentId(sId); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(coursePackageOrderStudent.getId()); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | } |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | |
| | | if (tCoursePackage.getType() == 2) { |
| | | //上课星期 |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | //上课时段 |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | Date startTime = tCoursePackage.getStartTime(); |
| | | Date endTime = tCoursePackage.getEndTime(); |
| | | //排课 本周+下周,课时不够扣则直接剩余不排课 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | //假期开始使用当前时间为起始时间进行排课 |
| | | calendar.setTime(startTime.getTime() > System.currentTimeMillis() ? startTime : new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | while (true) { |
| | | Date time = calendar.getTime(); |
| | | |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() > endTime.getTime()) { |
| | | break; |
| | | } |
| | | for (int j = 0; j < split.length; j++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setType(tCoursePackage.getType()); |
| | | coursePackageScheduling.setAppUserId(userId); |
| | | coursePackageScheduling.setStudentId(sId); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(time) + " " + split[j]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[j]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(userId); |
| | | student1.setStudentId(sId); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(null); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | } |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | private void addPackageStudent(Integer courseId, Integer userId, Integer sId, Long paymentId) throws ParseException { |
| | | // 课包 |
| | | TCoursePackage tCoursePackage = coursePackageService.getById(courseId); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 2.0 |
| | | TCourseInfoRecord tCourseInfoRecord = new TCourseInfoRecord(); |
| | | tCourseInfoRecord.setUserId(userId); |
| | |
| | | tCourseInfoRecord.setTime(new Date()); |
| | | tCourseInfoRecord.setType(2); |
| | | appUserClient.addCourseInfoRecord(tCourseInfoRecord); |
| | | |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | return packagePaymentService.getById(id); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/queryCoursePackagePaymentById1") |
| | | public CoursePackageOrderStudent queryCoursePackagePaymentById1(@RequestParam("id") Long id) { |
| | | return coursePackageOrderStudentService.getById(id); |
| | | } |
| | | |
| | | |
| | | // @Autowired |
| | | // private ICoursePackageOrderStudentService orderStudentService; |
| | |
| | | System.out.println("editCoursePackagePayment1====coursePackagePayment" + coursePackagePayment); |
| | | // coursePackagePayment.setCoursePackageId(null); |
| | | packagePaymentService.updateBytime(coursePackagePayment); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/editCoursePackagePayment2") |
| | | public void editCoursePackagePayment2(@RequestBody CoursePackageOrderStudent coursePackageOrderStudent) { |
| | | System.out.println("editCoursePackagePayment1====coursePackagePayment" + coursePackageOrderStudent); |
| | | // coursePackagePayment.setCoursePackageId(null); |
| | | // packagePaymentService.updateBytime(coursePackagePayment); |
| | | |
| | | coursePackageOrderStudentService.updateById(coursePackageOrderStudent); |
| | | } |
| | | |
| | | |
| | |
| | | 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); |
| | | // 查询介绍有礼课时数量 |
| | | map.put("allCourse",sum-sum1); |
| | | |
| | | //所有课包 |
| | | List<TCoursePackage> coursePackages = tcpService.list(); |
| | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderStudentService orderStudentService; |
| | | //获取可转移学员 |
| | | @RequestMapping("/getSelect") |
| | | @ResponseBody |
| | | public List<SelectDto> getSelect(@RequestParam("payId") Long payId) { |
| | | |
| | | TCoursePackagePayment byId = paymentService.getById(payId); |
| | | // TCoursePackagePayment byId = paymentService.getById(payId); |
| | | // |
| | | // List<Integer> studentIds = paymentService.getStudentIds(payId, byId.getCoursePackageId(), byId.getAppUserId()); |
| | | // System.out.println("=========studentIds=================>" + studentIds); |
| | | |
| | | List<Integer> studentIds = paymentService.getStudentIds(payId, byId.getCoursePackageId(), byId.getAppUserId()); |
| | | System.out.println("=========studentIds=================>" + studentIds); |
| | | CoursePackageOrderStudent coursePackageOrderStudent = orderStudentService.getById(payId); |
| | | |
| | | |
| | | List<CoursePackageOrderStudent> orderStudent = orderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>().eq("appUserId", coursePackageOrderStudent.getAppUserId()).eq("coursePackageId", coursePackageOrderStudent.getCoursePackageId()).ne("id",payId)); |
| | | |
| | | List<Integer> studentIds = new ArrayList<>(); |
| | | for (CoursePackageOrderStudent packageOrderStudent : orderStudent) { |
| | | studentIds.add(packageOrderStudent.getStudentId()); |
| | | } |
| | | |
| | | |
| | | if (studentIds.size() > 0) { |
| | | List<SelectDto> selectDtos = appUserClient.getSelects(studentIds); |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderStudentService orderStudentService; |
| | | |
| | | |
| | | @RequestMapping("/insertBack") |
| | | @ResponseBody |
| | |
| | | return moneyBacksck; |
| | | } |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService schedulingService; |
| | | |
| | | //课程转移 |
| | | @RequestMapping("/toClass") |
| | | @ResponseBody |
| | | public void toClass(@RequestBody ToClassDto toClassDto) throws ParseException { |
| | | System.out.println("===========到达getSelect=======" + toClassDto); |
| | | TCoursePackagePayment orinPay = paymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("id", toClassDto.getId())); |
| | | TCoursePackagePayment studentPay = paymentService.getOne |
| | | (new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("studentId", toClassDto.getToStudentId()) |
| | | .eq("coursePackageId", orinPay.getCoursePackageId())); |
| | | // System.out.println("===========到达getSelect=======" + toClassDto); |
| | | // TCoursePackagePayment orinPay = |
| | | // paymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("id", toClassDto.getId())); |
| | | // TCoursePackagePayment studentPay = paymentService.getOne |
| | | // (new QueryWrapper<TCoursePackagePayment>() |
| | | // .eq("studentId", toClassDto.getToStudentId()) |
| | | // .eq("coursePackageId", orinPay.getCoursePackageId())); |
| | | |
| | | |
| | | CoursePackageOrderStudent orinPay = orderStudentService.getById(toClassDto.getId()); |
| | | |
| | | CoursePackageOrderStudent studentPay = orderStudentService.getOne(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId", orinPay.getCoursePackageId())); |
| | | |
| | | TCoursePackage coursePackage = packageService.getById(orinPay.getCoursePackageId()); |
| | | |
| | | if (studentPay != null) { |
| | | //转移 |
| | | System.out.println("======orinPay=====>" + orinPay); |
| | | System.out.println("======studentPay=====>" + studentPay); |
| | | Integer laveClassHours = orinPay.getLaveClassHours(); |
| | | Integer totalClassHours = orinPay.getTotalClassHours(); |
| | | orinPay.setTotalClassHours(0); |
| | | orinPay.setLaveClassHours(0); |
| | | orinPay.setStatus(1); |
| | | orinPay.setStatus(5); |
| | | orinPay.setAppUserId(null); |
| | | paymentService.updateById(orinPay); |
| | | //删除orin的排课记录 |
| | | List<CoursePackageStudent> studentCourse1 = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", orinPay.getStudentId()).eq("coursePackageId", orinPay.getCoursePackageId())); |
| | | List<Long> collect1 = studentCourse1.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | //拿到最后一天的排课记录 |
| | | if (collect1.size() > 0) { |
| | | coursePackageSchedulingService.delete(new QueryWrapper<CoursePackageScheduling>().in("id", collect1)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId", studentPay.getCoursePackageId())); |
| | | } |
| | | orderStudentService.updateById(orinPay); |
| | | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | if (orinPay.getAppUserId() != studentPay.getAppUserId()) { |
| | | courseCounsum.setReason("课时转移"); |
| | | courseCounsum.setReason("课时赠送"); |
| | | } else { |
| | | courseCounsum.setReason("课时转移"); |
| | | } |
| | |
| | | studentPay.setAppUserId(null); |
| | | studentPay.setLaveClassHours(lave); |
| | | studentPay.setTotalClassHours(total); |
| | | paymentService.updateById(studentPay); |
| | | orderStudentService.updateById(studentPay); |
| | | |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | if (orinPay.getAppUserId() != studentPay.getAppUserId()) { |
| | | courseCounsum1.setReason("课时转移"); |
| | | courseCounsum1.setReason("课时赠送"); |
| | | } else { |
| | | courseCounsum1.setReason("课时转移"); |
| | | } |
| | |
| | | counsumService.save(courseCounsum1); |
| | | |
| | | |
| | | //排课 |
| | | TCoursePackage tCoursePackage = packageService.getById(studentPay.getCoursePackageId()); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | // 本周周几 |
| | | |
| | | List<CoursePackageStudent> studentCourse = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId", studentPay.getCoursePackageId())); |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | //拿到最后一天的排课记录 |
| | | if (collect.size() > 0) { |
| | | coursePackageSchedulingService.delete(new QueryWrapper<CoursePackageScheduling>().in("id", collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId", studentPay.getCoursePackageId())); |
| | | } |
| | | |
| | | Student student = studentClient.queryStudentById(toClassDto.getToStudentId()); |
| | | |
| | | Date today = new Date(); |
| | | |
| | | |
| | | TCoursePackagePayment pay = coursePackagePaymentService.getById(studentPay.getId()); |
| | | Integer laveClassHours2 = pay.getLaveClassHours(); |
| | | Integer codeTime = tCoursePackage.getCodeTime(); |
| | | Integer can = 0; |
| | | int count = 0; |
| | | // 本周周几 |
| | | // int i = DateUtil.dayOfWeek(new Date())-1; |
| | | |
| | | Date[] dates = generateDateArray(14, today); |
| | | can = laveClassHours2 / codeTime; |
| | | |
| | | for (Date date : dates) { |
| | | if (count == can) { |
| | | break; |
| | | } |
| | | int wei = DateUtil.dayOfWeek(date); |
| | | if (week.contains(wei)) { |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | if (count == can) { |
| | | break; |
| | | } |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(date) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(date) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.insert(coursePackageScheduling); |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(student.getAppUserId()); |
| | | student1.setStudentId(student.getId()); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(studentPay.getId()); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | count++; |
| | | } |
| | | } |
| | | } |
| | | schedulingService.addNewCoursePackageScheduling(studentPay.getId(),laveClassHours); |
| | | |
| | | |
| | | } else { |
| | | |
| | | |
| | | |
| | | |
| | | Student student = studentClient.queryStudentById(toClassDto.getToStudentId()); |
| | | TCoursePackagePayment to = new TCoursePackagePayment(); |
| | | CoursePackageOrderStudent to = new CoursePackageOrderStudent(); |
| | | to.setStudentId(toClassDto.getToStudentId()); |
| | | to.setTotalClassHours(orinPay.getTotalClassHours()); |
| | | to.setLaveClassHours(orinPay.getLaveClassHours()); |
| | | to.setCoursePackageId(orinPay.getCoursePackageId()); |
| | | to.setState(1); |
| | | to.setAppUserId(student.getAppUserId()); |
| | | to.setPayStatus(2); |
| | | to.setStatus(1); |
| | | to.setInsertTime(new Date()); |
| | | paymentService.save(to); |
| | | |
| | | Integer validDays = coursePackage.getValidDays(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + validDays); |
| | | to.setUseTime(calendar.getTime()); |
| | | |
| | | orderStudentService.save(to); |
| | | |
| | | |
| | | orinPay.setTotalClassHours(0); |
| | | orinPay.setLaveClassHours(0); |
| | | orinPay.setAppUserId(null); |
| | | orinPay.setStatus(1); |
| | | paymentService.updateById(orinPay); |
| | | orinPay.setStatus(6); |
| | | orderStudentService.updateById(orinPay); |
| | | |
| | | |
| | | //删除orin的排课记录 |
| | | List<CoursePackageStudent> studentCourse1 = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", orinPay.getStudentId()).eq("coursePackageId", orinPay.getCoursePackageId())); |
| | | List<Long> collect1 = studentCourse1.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | //拿到最后一天的排课记录 |
| | | if (collect1.size() > 0) { |
| | | coursePackageSchedulingService.delete(new QueryWrapper<CoursePackageScheduling>().in("id", collect1)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId", studentPay.getCoursePackageId())); |
| | | } |
| | | |
| | | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("课时转移"); |
| | | courseCounsum.setReason("课时赠送"); |
| | | courseCounsum.setNum(orinPay.getLaveClassHours()); |
| | | courseCounsum.setChangeType(0); |
| | | courseCounsum.setPaymentId(orinPay.getId()); |
| | |
| | | |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | courseCounsum1.setReason("课时转移"); |
| | | courseCounsum1.setReason("课时赠送"); |
| | | courseCounsum1.setNum(orinPay.getLaveClassHours()); |
| | | courseCounsum1.setChangeType(1); |
| | | courseCounsum1.setPaymentId(to.getId()); |
| | | counsumService.save(courseCounsum); |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(studentPay.getCoursePackageId()); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | // 本周周几 |
| | | |
| | | List<CoursePackageStudent> studentCourse = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId", studentPay.getCoursePackageId())); |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | //拿到最后一天的排课记录 |
| | | if (collect.size() > 0) { |
| | | coursePackageSchedulingService.delete(new QueryWrapper<CoursePackageScheduling>().in("id", collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", toClassDto.getToStudentId()).eq("coursePackageId", studentPay.getCoursePackageId())); |
| | | } |
| | | //开始排课 |
| | | addPackageStudent(coursePackage, to.getAppUserId(), to.getStudentId(), to); |
| | | |
| | | |
| | | Date today = new Date(); |
| | | |
| | | |
| | | TCoursePackagePayment pay = coursePackagePaymentService.getById(studentPay.getId()); |
| | | Integer laveClassHours2 = pay.getLaveClassHours(); |
| | | Integer codeTime = tCoursePackage.getCodeTime(); |
| | | Integer can = 0; |
| | | int count = 0; |
| | | // 本周周几 |
| | | // int i = DateUtil.dayOfWeek(new Date())-1; |
| | | } |
| | | |
| | | Date[] dates = generateDateArray(14, today); |
| | | can = laveClassHours2 / codeTime; |
| | | |
| | | for (Date date : dates) { |
| | | if (count == can) { |
| | | break; |
| | | } |
| | | int wei = DateUtil.dayOfWeek(date); |
| | | if (week.contains(wei)) { |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | if (count == can) { |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 新购买课程后的排课 |
| | | * |
| | | * @param userId |
| | | * @param sId |
| | | * @throws ParseException |
| | | */ |
| | | private void addPackageStudent(TCoursePackage tCoursePackage, Integer userId, Integer sId, CoursePackageOrderStudent coursePackageOrderStudent) { |
| | | try { |
| | | //1常规 2假期 3体验 |
| | | if (tCoursePackage.getType() == 1) { |
| | | //上课星期 |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | //上课时段 |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | |
| | | //剩余课时 |
| | | Integer laveClassHours = coursePackageOrderStudent.getLaveClassHours(); |
| | | //扣除课时数 |
| | | Integer codeTime = tCoursePackage.getCodeTime(); |
| | | //排课 本周+下周,课时不够扣则直接剩余不排课 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | int day_week = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day_week = day_week - 1 == 0 ? 7 : day_week - 1; |
| | | int num = 8 - day_week + 7; |
| | | Date useTime = coursePackageOrderStudent.getUseTime(); |
| | | |
| | | for (int i = 0; i < num; i++) { |
| | | Date time = calendar.getTime(); |
| | | |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= useTime.getTime()) { |
| | | break; |
| | | } |
| | | for (int j = 0; j < split.length; j++) { |
| | | //剩余数量不足以排课 |
| | | if (laveClassHours.compareTo(codeTime) < 0) { |
| | | break; |
| | | } |
| | | |
| | | laveClassHours -= codeTime; |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setType(tCoursePackage.getType()); |
| | | coursePackageScheduling.setAppUserId(userId); |
| | | coursePackageScheduling.setStudentId(sId); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(date) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(date) + " " + split1[i1]); |
| | | Date parse = format1.parse(format.format(time) + " " + split[j]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[j]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.insert(coursePackageScheduling); |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(student.getAppUserId()); |
| | | student1.setStudentId(student.getId()); |
| | | student1.setAppUserId(userId); |
| | | student1.setStudentId(sId); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(studentPay.getId()); |
| | | student1.setCoursePackagePaymentId(coursePackageOrderStudent.getId()); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | count++; |
| | | } |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | |
| | | if (tCoursePackage.getType() == 2) { |
| | | //上课星期 |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | //上课时段 |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | Date startTime = tCoursePackage.getStartTime(); |
| | | Date endTime = tCoursePackage.getEndTime(); |
| | | //排课 本周+下周,课时不够扣则直接剩余不排课 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | //假期开始使用当前时间为起始时间进行排课 |
| | | calendar.setTime(startTime.getTime() > System.currentTimeMillis() ? startTime : new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | while (true) { |
| | | Date time = calendar.getTime(); |
| | | |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() > endTime.getTime()) { |
| | | break; |
| | | } |
| | | for (int j = 0; j < split.length; j++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setType(tCoursePackage.getType()); |
| | | coursePackageScheduling.setAppUserId(userId); |
| | | coursePackageScheduling.setStudentId(sId); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(time) + " " + split[j]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[j]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.insert(coursePackageScheduling); |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(userId); |
| | | student1.setStudentId(sId); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(null); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | } |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Resource |
| | |
| | | * 课程有效期 |
| | | */ |
| | | @TableField("useTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date useTime; |
| | | } |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private Integer orderId; |
| | | @TableField("giftClassHours") |
| | | private Integer giftClassHours; |
| | | // 所选课时规格id |
| | | @TableField(exist = false) |
| | | private Integer coursePackageConfigId; |
| | | } |
| | |
| | | public interface CoursePackagePaymentConfigMapper extends BaseMapper<CoursePackagePaymentConfig> { |
| | | List<CoursePackagePaymentVO> listAll(@Param("query") CoursePackagePaymentQuery query); |
| | | |
| | | int changeState(@Param("ids") List<Long> ids, @Param("payUserName") String payUserName, @Param("payUserId") Integer payUserId); |
| | | int changeState(@Param("ids") Long ids, @Param("payUserName") String payUserName, @Param("payUserId") Integer payUserId); |
| | | |
| | | List<RegisterOrderVO> listAllRegister(@Param("query") RegisterOrderQuery query, @Param("sTime") String sTime, @Param("eTime") String eTime, @Param("amount") BigDecimal amount); |
| | | |
| | |
| | | */ |
| | | List<Map<String, Object>> queryRegistrationRecord(Page<Map<String, Object>> page, @Param("coursePackageId") Integer coursePackageId, |
| | | @Param("userIds") List<Integer> userIds, @Param("studentIds") List<Integer> studentIds); |
| | | List<Map<String, Object>> queryRegistrationRecord1(Page<Map<String, Object>> page, @Param("coursePackageId") Integer coursePackageId, |
| | | @Param("userIds") List<Integer> userIds, @Param("studentIds") List<Integer> studentIds); |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Data |
| | | public class CoursePackagePayDTO { |
| | | private List<String> ids; |
| | | private String ids; |
| | | private String payUserName; |
| | | // 操作人id |
| | | private Integer userId; |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import javax.naming.PartialResultException; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 购课记录列表VO |
| | |
| | | private String payUser; |
| | | private String phone; |
| | | // 学员id |
| | | private Integer studentId; |
| | | private String studentId; |
| | | private String payStudent; |
| | | private Integer payType; |
| | | private BigDecimal originalPrice; |
| | |
| | | private Integer buyType; |
| | | // 当状态为手动支付时使用 用于显示手动支付时显示操作人 |
| | | private String buyTypeName; |
| | | private Integer classHours; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date insertTime; |
| | | } |
| | |
| | | * 处理剩余课时已经全部排完课后临时增加课时后添加排课 |
| | | * @param coursePackageOrderStudentId |
| | | */ |
| | | void addNewCoursePackageScheduling(Integer coursePackageOrderStudentId, Integer classNumber); |
| | | void addNewCoursePackageScheduling(Long coursePackageOrderStudentId, Integer classNumber); |
| | | } |
| | |
| | | * @param coursePackageOrderStudentId |
| | | */ |
| | | @Override |
| | | public void addNewCoursePackageScheduling(Integer coursePackageOrderStudentId, Integer classNumber) { |
| | | public void addNewCoursePackageScheduling(Long coursePackageOrderStudentId, Integer classNumber) { |
| | | CoursePackageOrderStudent coursePackageOrderStudent = coursePackageOrderStudentService.getById(coursePackageOrderStudentId); |
| | | CoursePackageScheduling coursePackageScheduling = this.getOne(new QueryWrapper<CoursePackageScheduling>() |
| | | .eq("appUserId", coursePackageOrderStudent.getAppUserId()) |
| | |
| | | |
| | | @Override |
| | | public int changeState(CoursePackagePayDTO dto) { |
| | | List<String> ids = dto.getIds(); |
| | | List<Long> list = new ArrayList<>(); |
| | | for (String id : ids) { |
| | | long value = Long.parseLong(id); |
| | | list.add(value); |
| | | } |
| | | return cpConfigMapper.changeState(list, dto.getPayUserName(), dto.getUserId()); |
| | | |
| | | return cpConfigMapper.changeState(Long.valueOf(dto.getIds()), dto.getPayUserName(), dto.getUserId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | AppUser appUser = appuClient.queryAppUser(appUserId); |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | CoursePackageOrder coursePackageOrder = coursePackageOrderService.getById(coursePayId); |
| | | if (coursePackageOrder==null){ |
| | | // student = coursePackageStudentService.getById(coursePayId); |
| | | CoursePackageOrderStudent student = coursePackageOrderStudentService.getById(coursePayId); |
| | | |
| | | coursePackageOrder = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>().eq("appUserId", student.getAppUserId()).like("studentIds", student.getStudentId()).eq("coursePackageId", student.getCoursePackageId()).orderByDesc("insertTime").last("limit 1")); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | response.setChooseHours(coursePackageOrder.getClassHours()); |
| | |
| | | response.setVipAmount(discountMember); |
| | | break; |
| | | case 3: |
| | | response.setWpGold(playPaiCoin); |
| | | if (playPaiCoin!=null) { |
| | | response.setWpGold(playPaiCoin); |
| | | } |
| | | break; |
| | | } |
| | | |
| | |
| | | TCoursePackageDiscount discount = coursePackageDiscountService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 2).eq("auditStatus", 2)); |
| | | |
| | | Double continuingMember = JSON.parseObject(discount.getContent()).getDouble("continuingUser"); |
| | | Double vipcontinuingMember = JSON.parseObject(discount.getContent()).getDouble("continuingMember"); |
| | | |
| | | |
| | | if (coursePackagePaymentConfigVo.getPaymentPrice() > continuingMember) { |
| | | coursePackagePaymentConfigVo.setPaymentPrice(continuingMember); |
| | | } |
| | | if (coursePackagePaymentConfigVo.getVipPrice() > vipcontinuingMember) { |
| | | coursePackagePaymentConfigVo.setVipPrice(vipcontinuingMember); |
| | | } |
| | | // Double continuingMember = JSON.parseObject(discount.getContent()).getDouble("continuingUser"); |
| | | // Double vipcontinuingMember = JSON.parseObject(discount.getContent()).getDouble("continuingMember"); |
| | | // |
| | | // |
| | | // if (coursePackagePaymentConfigVo.getPaymentPrice() > continuingMember) { |
| | | // coursePackagePaymentConfigVo.setPaymentPrice(continuingMember); |
| | | // } |
| | | // if (coursePackagePaymentConfigVo.getVipPrice() > vipcontinuingMember) { |
| | | // coursePackagePaymentConfigVo.setVipPrice(vipcontinuingMember); |
| | | // } |
| | | |
| | | |
| | | if (coursePackagePaymentConfigVo.getPaymentPrice() < coursePackagePaymentConfigVo.getVipPrice()) { |
| | |
| | | @Override |
| | | public List<Map<String, Object>> queryRegistrationRecord(Page<Map<String, Object>> page, QueryRegistrationRecord queryRegistrationRecord) { |
| | | Integer coursePackageId = queryRegistrationRecord.getCoursePackageId(); |
| | | TCoursePackage coursePackage = coursePackageService.getById(coursePackageId); |
| | | String userName = queryRegistrationRecord.getUserName(); |
| | | List<Integer> userIds = null; |
| | | List<Integer> studentIds = null; |
| | |
| | | studentIds = students.stream().map(Student::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = this.baseMapper.queryRegistrationRecord(page, coursePackageId, userIds, studentIds); |
| | | |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | |
| | | if (coursePackage.getType()==1){ |
| | | list = this.baseMapper.queryRegistrationRecord(page, coursePackageId, userIds, studentIds);}else { |
| | | list = this.baseMapper.queryRegistrationRecord1(page, coursePackageId, userIds, studentIds); |
| | | } |
| | | for (Map<String, Object> map : list) { |
| | | |
| | | Long id = Long.valueOf(map.get("id").toString()); |
| | | Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); |
| | | Integer studentId = Integer.valueOf(map.get("studentId").toString()); |
| | | Integer studentId = 0; |
| | | if (coursePackage.getType()==1) { |
| | | studentId = Integer.valueOf(map.get("studentId").toString()); |
| | | }else { |
| | | studentId = Integer.valueOf(map.get("studentIds").toString()); |
| | | } |
| | | |
| | | TAppUser appUser = appuClient.queryAppUser1(appUserId); |
| | | map.put("userName", null != appUser ? appUser.getName() : ""); |
| | |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | } |
| | | if(coursePackage.getType() == 2){ |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), null); |
| | |
| | | <result column="playPaiCoin" property="playPaiCoin"/> |
| | | </resultMap> |
| | | <update id="changeState"> |
| | | update t_course_package_payment set |
| | | payStatus = 2,payUserName = #{payUserName},payType = 7,payUserId=#{payUserId} |
| | | update t_course_package_order set |
| | | payStatus = 2,payUserName = #{payUserName},payType = 7,payUserId=#{payUserId}, |
| | | payUserType = 2 |
| | | <where> |
| | | <if test="ids != null and ids.size()>0"> |
| | | AND t_course_package_payment.id IN |
| | | <foreach collection="ids" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | <if test="ids!=null and ids!= ''"> |
| | | and t_course_package_order.id = #{ids} |
| | | </if> |
| | | </where> |
| | | </update> |
| | | |
| | | <select id="listAll" resultType="com.dsh.course.model.CoursePackagePaymentVO"> |
| | | select |
| | | t1.id,t1.studentId,t1.payUserType,t1.payStatus,t1.payType,t1.originalPrice,t1.userCouponId,t1.payUserId,t1.giftClassHours,t1.studentId,t1.appUserId,t1.cashPayment,t1.playPaiCoin, |
| | | t1.payUserName as buyTypeName, |
| | | t1.id,t1.payUserType,t1.payStatus,t1.payType,t1.originalPrice,t1.userCouponId,t1.payUserId,t1.studentIds as studentId,t1.appUserId,t1.cashPayment,t1.playPaiCoin, |
| | | t1.payUserName as buyTypeName, t1.classHours as classHours,t1.insertTime as insertTime,t1.coursePackageId as coursePackageId, |
| | | CONCAT(t2.province,t2.city) as provinceAndCity,t2.coursePackageTypeId,t2.storeId,t2.name as coursePackage, |
| | | t3.name as coursePackageType |
| | | from t_course_package_payment t1 |
| | | from t_course_package_order t1 |
| | | left join t_course_package t2 on t1.coursePackageId = t2.id |
| | | left join t_course_package_type t3 on t2.coursePackageTypeId = t3.id |
| | | <where> |
| | |
| | | END, insertTime DESC |
| | | </select> |
| | | |
| | | <select id="queryRegistrationRecord1" resultType="map"> |
| | | select |
| | | CAST(id AS CHAR(20)) as id, |
| | | appUserId, |
| | | studentIds, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as insertTime, |
| | | `status` |
| | | from t_course_package_order where state = 1 |
| | | <if test="null != coursePackageId"> |
| | | and coursePackageId = #{coursePackageId} |
| | | </if> |
| | | <if test="null != userIds"> |
| | | and appUserId in |
| | | <foreach collection="userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != studentIds"> |
| | | and studentId in |
| | | <foreach collection="studentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | order by |
| | | insertTime DESC |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryWalkInStudentList" resultType="map"> |
| | | select |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 11:59 |
| | | */ |
| | | @Data |
| | | @TableName("t_course_package_order_student") |
| | | public class CoursePackageOrderStudent { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | @TableField("studentId") |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | @TableField("coursePackageId") |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 总课时 |
| | | */ |
| | | @TableField("totalClassHours") |
| | | private Integer totalClassHours; |
| | | /** |
| | | * 剩余课时 |
| | | */ |
| | | @TableField("laveClassHours") |
| | | private Integer laveClassHours; |
| | | /** |
| | | * 缺课次数 |
| | | */ |
| | | @TableField("absencesNumber") |
| | | private Integer absencesNumber; |
| | | /** |
| | | * 退课课时 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer dropoutsNumber; |
| | | /** |
| | | * 课程状态(1=正常,2=已退课) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 退课时间 |
| | | */ |
| | | @TableField("withdrawalTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date withdrawalTime; |
| | | /** |
| | | * 退课凭证 |
| | | */ |
| | | @TableField("certificate") |
| | | private String certificate; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 赠送课时 |
| | | */ |
| | | @TableField("giftClassHours") |
| | | private Integer giftClassHours; |
| | | /** |
| | | * 课程有效期 |
| | | */ |
| | | @TableField("useTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date useTime; |
| | | } |
| | |
| | | private Integer state; |
| | | private Integer registerCondition ; |
| | | private List<Integer> ids; |
| | | |
| | | // 角色类型 如果是平台1的话 查询审核通过的 如果是运营商查询所有属于 |
| | | private Integer obj; |
| | | } |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | import com.dsh.course.feignClient.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.feignClient.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackage; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackagePayment; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.CoursePackage; |
| | | |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @PostMapping("/coursePackagePayment/consumeCourse") |
| | | ResultUtil consumeCourse(@RequestBody Integer coursePackagePaymentId); |
| | | |
| | | @PostMapping("/coursePackagePayment/queryCoursePackagePaymentById1") |
| | | CoursePackageOrderStudent queryCoursePackagePaymentById1(@RequestParam("id")Long id); |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackagePayment |
| | |
| | | |
| | | @PostMapping("/coursePackagePayment/editCoursePackagePayment1") |
| | | void editCoursePackagePayment1(@RequestBody TCoursePackagePayment coursePackagePayment); |
| | | |
| | | @PostMapping("/coursePackagePayment/editCoursePackagePayment2") |
| | | void editCoursePackagePayment2(@RequestBody CoursePackageOrderStudent coursePackageOrderStudent); |
| | | |
| | | |
| | | @PostMapping("/coursePackagePayment/CountqueryByClassId") |
| | |
| | | HashMap<String, Object> courseStore(@RequestBody List<Integer> userPt); |
| | | |
| | | @GetMapping("/coursePackagePayment/courseStore/{appUserId}/{coursePackageId}") |
| | | List<TCoursePackagePayment> getByUserIdAndCoursePackageId(@PathVariable("appUserId") Integer appUserId,@PathVariable("coursePackageId") Integer coursePackageId); |
| | | List<CoursePackageOrderStudent> getByUserIdAndCoursePackageId |
| | | (@PathVariable("appUserId") Integer appUserId, @PathVariable("coursePackageId") Integer coursePackageId); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/coursePackagePaymentConfig/queryCoursePackagePaymentConfigList") |
| | | List<CoursePackagePaymentConfig> queryCoursePackagePaymentConfigList(Integer coursePackageId); |
| | | /** |
| | | * 根据课包id获取价格配置 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackagePaymentConfig/queryCoursePackagePaymentConfigList1") |
| | | List<CoursePackagePaymentConfig> queryCoursePackagePaymentConfigList1(Integer coursePackagePaymentConfigId); |
| | | |
| | | |
| | | /** |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 11:59 |
| | | */ |
| | | @Data |
| | | @TableName("t_course_package_order_student") |
| | | public class CoursePackageOrderStudent { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | @TableField("studentId") |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | @TableField("coursePackageId") |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 总课时 |
| | | */ |
| | | @TableField("totalClassHours") |
| | | private Integer totalClassHours; |
| | | /** |
| | | * 剩余课时 |
| | | */ |
| | | @TableField("laveClassHours") |
| | | private Integer laveClassHours; |
| | | /** |
| | | * 缺课次数 |
| | | */ |
| | | @TableField("absencesNumber") |
| | | private Integer absencesNumber; |
| | | /** |
| | | * 退课课时 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer dropoutsNumber; |
| | | /** |
| | | * 课程状态(1=正常,2=已退课) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 退课时间 |
| | | */ |
| | | @TableField("withdrawalTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date withdrawalTime; |
| | | /** |
| | | * 退课凭证 |
| | | */ |
| | | @TableField("certificate") |
| | | private String certificate; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 赠送课时 |
| | | */ |
| | | @TableField("giftClassHours") |
| | | private Integer giftClassHours; |
| | | /** |
| | | * 课程有效期 |
| | | */ |
| | | @TableField("useTime") |
| | | private Date useTime; |
| | | } |
| | |
| | | import com.dsh.course.dto.StudentSearch; |
| | | import com.dsh.course.dto.TStudentDto; |
| | | import com.dsh.course.feignClient.other.model.Banner; |
| | | import com.dsh.course.feignClient.other.model.GameDataQuery; |
| | | import com.dsh.course.feignClient.other.model.TGameRecord; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.BallQueryDto; |
| | | import com.dsh.guns.modular.system.model.dto.BookingQuery; |
| | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface BallClient { |
| | | |
| | | // 数据统计 |
| | | @PostMapping("/student/getData") |
| | | List<TGameRecord> getData(@RequestBody GameDataQuery query); |
| | | // 根据门店ids 获取游戏记录 |
| | | @PostMapping("/game/getGameByStoreIds") |
| | | List<Integer> getGameByStoreIds(@RequestBody List<Integer> storeIds); |
New file |
| | |
| | | package com.dsh.course.feignClient.other.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GameDataQuery { |
| | | Integer objectId; |
| | | Integer storeId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.other.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_game_record") |
| | | public class TGameRecord extends Model<TGameRecord> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | @TableField("gameId") |
| | | private Integer gameId; |
| | | |
| | | /** |
| | | * 1玩湃币 2微信 3支付宝 |
| | | */ |
| | | @TableField("payType") |
| | | private Integer payType; |
| | | |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private BigDecimal money; |
| | | |
| | | /** |
| | | * 0待支付 1已支付 |
| | | */ |
| | | private Integer status; |
| | | |
| | | private String number; |
| | | @TableField("orderNo") |
| | | private String orderNo; |
| | | |
| | | private Date time; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | |
| | | import com.alibaba.druid.sql.visitor.functions.If; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.CoachClient; |
| | |
| | | import com.dsh.course.feignClient.account.model.CoachType; |
| | | import com.dsh.course.feignClient.other.model.Site; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.modular.system.model.CoachChangeStateVO; |
| | | import com.dsh.guns.modular.system.model.CoachQuery; |
| | | import com.dsh.guns.modular.system.model.Store; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.bouncycastle.math.raw.Mod; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | private CoachClient coachClient; |
| | | @Autowired |
| | | private CityManagerClient cityManagerClient; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | @Autowired |
| | | private TOperatorService operatorService; |
| | | @Autowired |
| | | private TOperatorCityService operatorCityService; |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | /** |
| | | * 跳转教练管理首页 |
| | |
| | | */ |
| | | @RequestMapping("/addCoach") |
| | | public String addCoach(Model model) { |
| | | List<CityManager> province = cityManagerClient.listAll(); |
| | | Set<String> seenNames = new HashSet<>(); |
| | | List<CityManager> result = new ArrayList<>(); |
| | | for (CityManager cityManager : province) { |
| | | if(!seenNames.contains(cityManager.getProvince())){ |
| | | result.add(cityManager); |
| | | seenNames.add(cityManager.getProvince()); |
| | | } |
| | | } |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list1); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | CoachQuery coachQuery = new CoachQuery(); |
| | |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("data",data); |
| | | model.addAttribute("list",result); |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("objectId",objectId); |
| | | model.addAttribute("coachType",list); |
| | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/add") |
| | | public ResultUtil addCoach(@RequestBody Coach coach) { |
| | | |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | coach.setCityManagerId(objectId); |
| | |
| | | coachClient.changeState(vo); |
| | | return ResultUtil.success(); |
| | | } |
| | | /** |
| | | * 根据选择的市 查询有哪些运营商管理了所选的市 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/getYys") |
| | | @ResponseBody |
| | | public Object getYys(String pCode,String cCode){ |
| | | // 先获取管理全国的运营商 |
| | | List<TOperator> type = operatorService.list(new QueryWrapper<TOperator>().eq("type", 1)); |
| | | // 根据所选市 查询管理了这个市的运营商 |
| | | // 获取管理指定区域的运营商的ID 然后去重 |
| | | List<Integer> collect = operatorCityService.list(new QueryWrapper<TOperatorCity>()).stream().map(TOperatorCity::getOperatorId) |
| | | .distinct().collect(Collectors.toList()); |
| | | // 遍历 判断当前运营商是否管理了所选市 |
| | | for (Integer integer : collect) { |
| | | // 查询是否管理了省 |
| | | TOperatorCity code = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("code", pCode).eq("operatorId",integer)); |
| | | if (code==null)continue; |
| | | List<TOperatorCity> pid = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("pid", code.getId())); |
| | | // 如果pid长度为0 则说明管理整个省 |
| | | if (pid.size()==0){ |
| | | type.add(operatorService.getOne(new QueryWrapper<TOperator>() |
| | | .eq("id",integer))); |
| | | } |
| | | for (TOperatorCity tOperatorCity : pid) { |
| | | if (tOperatorCity.getCode().toString().equals(cCode)){ |
| | | TOperator id = operatorService.getOne(new QueryWrapper<TOperator>() |
| | | .eq("id", tOperatorCity.getOperatorId())); |
| | | if (id!=null)type.add(id); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return type; |
| | | } |
| | | |
| | | /** |
| | | * 跳转修改教练页面 |
| | |
| | | CoachQuery coachQuery = new CoachQuery(); |
| | | coachQuery.setId(id); |
| | | List<CoachSerchVO> data = coachClient.listAll(coachQuery); |
| | | List<CityManager> province = cityManagerClient.listAll(); |
| | | Set<String> seenNames = new HashSet<>(); |
| | | List<CityManager> result = new ArrayList<>(); |
| | | List<CityManager> city = new ArrayList<>(); |
| | | for (CityManager cityManager : province) { |
| | | if(!seenNames.contains(cityManager.getProvince())){ |
| | | result.add(cityManager); |
| | | seenNames.add(cityManager.getProvince()); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | // 省 |
| | | model.addAttribute("list",list1); |
| | | // 市 |
| | | Integer code = cityService.getOne(new QueryWrapper<TCity>() |
| | | .eq("code", data.get(0).getProvinceCode())).getId(); |
| | | |
| | | List<TCity> pid = cityService.list(new QueryWrapper<TCity>().eq("parent_id", code)); |
| | | model.addAttribute("city",pid); |
| | | // 获取所选省市下的运营商列表 |
| | | // 先获取管理全国的运营商 |
| | | List<TOperator> type = operatorService.list(new QueryWrapper<TOperator>().eq("type", 1)); |
| | | // 根据所选市 查询管理了这个市的运营商 |
| | | // 获取管理指定区域的运营商的ID 然后去重 |
| | | List<Integer> collect = operatorCityService.list(new QueryWrapper<TOperatorCity>()).stream().map(TOperatorCity::getOperatorId) |
| | | .distinct().collect(Collectors.toList()); |
| | | // 遍历 判断当前运营商是否管理了所选市 |
| | | for (Integer integer : collect) { |
| | | // 查询是否管理了省 |
| | | TOperatorCity code1 = operatorCityService.getOne(new QueryWrapper<TOperatorCity>() |
| | | .eq("code", data.get(0).getProvinceCode()) |
| | | .eq("operatorId",integer) |
| | | ); |
| | | if (code1==null)continue; |
| | | List<TOperatorCity> pid1 = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("pid", code1.getId())); |
| | | // 如果pid长度为0 则说明管理整个省 |
| | | if (pid1.size()==0){ |
| | | type.add(operatorService.getOne(new QueryWrapper<TOperator>() |
| | | .eq("id",integer))); |
| | | } |
| | | if(data.get(0).getProvince().equals(cityManager.getProvince())){ |
| | | city.add(cityManager); |
| | | for (TOperatorCity tOperatorCity : pid1) { |
| | | if (tOperatorCity.getCode().toString().equals(data.get(0).getCityCode())){ |
| | | TOperator id1 = operatorService.getOne(new QueryWrapper<TOperator>() |
| | | .eq("id", tOperatorCity.getOperatorId())); |
| | | if (id1!=null)type.add(id1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | List<CityManager> accounts = cityManagerClient.getAccount(data.get(0).getCity()); |
| | | List<CoachType> list = coachTypeClient.list(); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("data",data.get(0)); |
| | | model.addAttribute("list",result); |
| | | model.addAttribute("city",city); |
| | | model.addAttribute("cityManagers",accounts); |
| | | model.addAttribute("cityManagers",type); |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("objectId",objectId); |
| | | model.addAttribute("coachType",list); |
| | |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | coachQuery.setOperatorId(objectId); |
| | | } |
| | | |
| | | return coachClient.listAll(coachQuery); |
| | | List<CoachSerchVO> coachSerchVOS = coachClient.listAll(coachQuery); |
| | | for (CoachSerchVO coachSerchVO : coachSerchVOS) { |
| | | Integer cityManagerId = coachSerchVO.getCityManagerId(); |
| | | TOperator byId = operatorService.getById(cityManagerId); |
| | | Integer userId = byId.getUserId(); |
| | | User byId1 = userService.getById(userId); |
| | | coachSerchVO.setNameAndPhone(byId.getName()+""+byId1.getPhone()); |
| | | } |
| | | return coachSerchVOS; |
| | | } |
| | | } |
| | |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | import com.dsh.guns.modular.system.model.TCoursePackagePayment; |
| | | import com.dsh.guns.modular.system.model.dto.CoursePackage; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/addCoursePackagePayment/{id}") |
| | | public ResultUtil addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment, @PathVariable("id")Integer id) { |
| | | public Object addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment, @PathVariable("id")Integer id) { |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | String name = UserExt.getUser().getName(); |
| | |
| | | // 获取课包id |
| | | Integer coursePackageId = tCoursePackagePayment.getCoursePackageId(); |
| | | List<TCoursePackageDiscount> list = coursePackageDiscountClient.queryByCoursePackageId(coursePackageId); |
| | | |
| | | Date currentDate = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(currentDate); |
| | |
| | | for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) { |
| | | char c = tCoursePackageDiscount.getContent().charAt(0); |
| | | String value1 = String.valueOf(c); |
| | | |
| | | JSONObject jsonObject ; |
| | | if (value1.equals("[")){ |
| | | jsonObject = JSONObject.fromObject(tCoursePackageDiscount.getContent() |
| | |
| | | }else{ |
| | | jsonObject = JSONObject.fromObject(tCoursePackageDiscount.getContent()); |
| | | } |
| | | // 获取当前课包价格配置 |
| | | Integer coursePackageId1 = tCoursePackagePayment.getCoursePackageId(); |
| | | List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(coursePackageId1); |
| | | // 获取所选课时的课包价格配置 |
| | | List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = |
| | | coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList1 |
| | | (tCoursePackagePayment.getCoursePackageConfigId()); |
| | | if (coursePackagePaymentConfigs.size()!=0){ |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigs.get(0); |
| | | tCoursePackagePayment.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | tCoursePackagePayment.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); |
| | | |
| | | } |
| | | // 原价 |
| | | Double originalPrice = tCoursePackagePayment.getOriginalPrice(); |
| | |
| | | break; |
| | | case 2: |
| | | // 判断当前用户是否已经购买过当前课包 |
| | | List<com.dsh.course.feignClient.course.model.TCoursePackagePayment> result= coursePackagePaymentClient.getByUserIdAndCoursePackageId(tCoursePackagePayment.getAppUserId(),tCoursePackagePayment.getCoursePackageId()); |
| | | List<CoursePackageOrderStudent> result= |
| | | coursePackagePaymentClient.getByUserIdAndCoursePackageId(tCoursePackagePayment.getAppUserId(), |
| | | tCoursePackagePayment.getCoursePackageId()); |
| | | // 已经购买了 |
| | | if (result.size()!=0){ |
| | | // 会员续课折扣 |
| | |
| | | // 限时折扣判断是否在有效期 |
| | | String timeFrameStart = jsonObject.getString("startDate"); |
| | | String timeFrameEnd = jsonObject.getString("endDate"); |
| | | SimpleDateFormat format = new SimpleDateFormat(timeFrameStart); |
| | | SimpleDateFormat format1 = new SimpleDateFormat(timeFrameEnd); |
| | | try { |
| | | // 判断当日时间是否能享受到折扣 |
| | | String startTime = jsonObject.getString("startTime"); |
| | |
| | | } |
| | | break; |
| | | case 4: |
| | | // 赠送课时 |
| | | |
| | | // 赠送课时 判断当前课包有没有赠送课时 |
| | | String weeks = jsonObject.getString("weeks"); |
| | | // 判断当前周几 是否满足折扣规则 |
| | | Calendar calendar9 = Calendar.getInstance(); |
| | | int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); |
| | | if (weeks.contains(String.valueOf(dayOfWeek))){ |
| | | // 限时折扣判断是否在有效期 |
| | | String timeFrameStart1 = jsonObject.getString("startDate"); |
| | | String timeFrameEnd1 = jsonObject.getString("endDate"); |
| | | try { |
| | | // 判断当日时间是否能享受到折扣 |
| | | String startTime = jsonObject.getString("startTime"); |
| | | String endTime = jsonObject.getString("endTime"); |
| | | // 获取当前时间 |
| | | Date currentTime = new Date(); |
| | | // 定义时间格式 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| | | // 解析开始时间和结束时间为Date对象 |
| | | Date startTime1 = sdf.parse(startTime); |
| | | Date endTime1 = sdf.parse(endTime); |
| | | Date date1 = new Date(); |
| | | date1.setHours(startTime1.getHours()); |
| | | date1.setMinutes(startTime1.getMinutes()); |
| | | date1.setSeconds(startTime1.getSeconds()); |
| | | Date date2 = new Date(); |
| | | date2.setHours(endTime1.getHours()); |
| | | date2.setMinutes(endTime1.getMinutes()); |
| | | date2.setSeconds(endTime1.getSeconds()); |
| | | // 检查当前时间是否在开始时间和结束时间之间 |
| | | if (currentTime.after(date1) && currentTime.before(date2)) { |
| | | System.out.println("当前时间在开始时间和结束时间之间。"); |
| | | String hour = jsonObject.getString("hour"); |
| | | tCoursePackagePayment.setGiftClassHours(Integer.valueOf(hour)); |
| | | } else { |
| | | System.out.println("当前时间不在开始时间和结束时间之间。"); |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | |
| | | BigDecimal bigDecimal = new BigDecimal(minValue); |
| | | tCoursePackagePayment.setCashPayment(bigDecimal); |
| | | } |
| | | coursePackagePaymentClient.addCoursePackagePayment(tCoursePackagePayment); |
| | | return ResultUtil.success("添加成功"); |
| | | |
| | | return coursePackagePaymentClient.addCoursePackagePayment(tCoursePackagePayment); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.dsh.course.feignClient.course.*; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackage; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackagePayment; |
| | | import com.dsh.course.feignClient.other.BallClient; |
| | | import com.dsh.course.feignClient.other.SiteClient; |
| | | import com.dsh.course.feignClient.other.StoreClient; |
| | | import com.dsh.course.feignClient.other.model.GameDataQuery; |
| | | import com.dsh.course.feignClient.other.model.TGameRecord; |
| | | import com.dsh.course.model.MoneyBack; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | | private TOperatorService operatorService; |
| | | @Autowired |
| | | private BallClient ballClient; |
| | | /** |
| | | * 跳转到平台统计数据页面 |
| | | */ |
| | |
| | | public String index(Model model) { |
| | | Object o = type1(null); |
| | | model.addAttribute("data",o); |
| | | |
| | | |
| | | |
| | | // 教学统计 |
| | | HashMap<String, Object> map = appUserClient.queryUserAge(); |
| | | model.addAttribute("stuData",map); |
| | | |
| | | |
| | | |
| | | return PREFIX + "platformIncome.html"; |
| | | } |
| | | |
| | |
| | | IncomeQuery incomeQuery = new IncomeQuery(); |
| | | // 场地预约记录查询query |
| | | SiteBookingQuery siteBookingQuery = new SiteBookingQuery(); |
| | | // 智慧球场查询query |
| | | GameDataQuery gameDataQuery = new GameDataQuery(); |
| | | // 筛选运营商的是时候使用 |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | | // 根据运营商ID 查询运营商下的所有门店 |
| | |
| | | List<VipPayment> vipPayments = vipPaymentClient.registrationList(incomeQuery); |
| | | for (VipPayment vipPayment : vipPayments) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | if (vipPayment.getPayStatus()==1){ |
| | | temp.setInsertTime(vipPayment.getInsertTime()); |
| | | if (vipPayment.getState()!=3){ |
| | | temp.setInsertTime(vipPayment.getPayTime()); |
| | | incomeVOS.add(temp); |
| | | } |
| | | if (vipPayment.getAmount() != null) { |
| | |
| | | List<RechargeRecordsVO> rechargeRecordsVOS = financeClient.rechargeList(rechargeRecordsQuery); |
| | | for (RechargeRecordsVO rechargeRecordsVO : rechargeRecordsVOS) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | temp.setInsertTime(rechargeRecordsVO.getInsertTime()); |
| | | temp.setInsertTime(rechargeRecordsVO.getPayTime()); |
| | | if (rechargeRecordsVO.getAmount() != null) { |
| | | temp.setAmount(rechargeRecordsVO.getAmount()); |
| | | } |
| | | if (rechargeRecordsVO.getPayStatus() ==1){ |
| | | if (rechargeRecordsVO.getState() !=3){ |
| | | incomeVOS.add(temp); |
| | | } |
| | | |
| | | } |
| | | // 报名课程记录 |
| | | List<RegisterOrderVO> registerOrderVOS = coursePackagePaymentClient.listAllRegister(query); |
| | |
| | | } |
| | | } |
| | | // query权限设置 获取运营商下的门店集合 |
| | | |
| | | if (roleType==2){ |
| | | competitionQuery.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | |
| | | if (competition.getPayType()==3 || competition.getPayType()==4){ |
| | | continue; |
| | | } |
| | | if (competition.getState()==3)continue; |
| | | IncomeVO temp = new IncomeVO(); |
| | | temp.setInsertTime(competition.getInsertTime()); |
| | | temp.setInsertTime(competition.getPayTime()); |
| | | if (competition.getAmount() != null) { |
| | | temp.setAmount(new BigDecimal(competition.getAmount().toString())); |
| | | } |
| | |
| | | List<SiteBooking> siteBookings = siteClient.listAll(siteBookingQuery); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | if(siteBooking.getStatus()!=3){ |
| | | if(siteBooking.getStatus()==0 || siteBooking.getStatus()==5){ |
| | | continue; |
| | | } |
| | | if (siteBooking.getPayType() ==3 || siteBooking.getPayType() ==4)continue; |
| | | temp.setInsertTime(siteBooking.getPayTime()); |
| | | if (siteBooking.getPayMoney() != null) { |
| | | temp.setAmount(new BigDecimal(siteBooking.getPayMoney().toString())); |
| | |
| | | temp.setInsertTime(pointMerchandiseIncomeVo.getInsertTime()); |
| | | if (pointMerchandiseIncomeVo.getCash()!=null){ |
| | | temp.setAmount(pointMerchandiseIncomeVo.getCash()); |
| | | incomeVOS.add(temp); |
| | | } |
| | | } |
| | | // 平台智慧球场 |
| | | if (storeId==null&&operatorId==null){ |
| | | gameDataQuery.setObjectId(0); |
| | | List<TGameRecord> data = ballClient.getData(gameDataQuery); |
| | | for (TGameRecord datum : data) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | temp.setAmount(datum.getMoney()); |
| | | temp.setInsertTime(datum.getTime()); |
| | | incomeVOS.add(temp); |
| | | } |
| | | } |
| | | // 运营商 |
| | | if (operatorId!=null && storeId==null){ |
| | | gameDataQuery.setObjectId(operatorId); |
| | | List<TGameRecord> data = ballClient.getData(gameDataQuery); |
| | | for (TGameRecord datum : data) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | temp.setAmount(datum.getMoney()); |
| | | temp.setInsertTime(datum.getTime()); |
| | | incomeVOS.add(temp); |
| | | } |
| | | } |
| | | // 门店 |
| | | if (storeId!=null){ |
| | | gameDataQuery.setStoreId(storeId); |
| | | List<TGameRecord> data = ballClient.getData(gameDataQuery); |
| | | for (TGameRecord datum : data) { |
| | | IncomeVO temp = new IncomeVO(); |
| | | temp.setAmount(datum.getMoney()); |
| | | temp.setInsertTime(datum.getTime()); |
| | | incomeVOS.add(temp); |
| | | } |
| | | } |
| | |
| | | // 会员费 |
| | | HashMap<String, Object> map1 = appUserClient.queryFee(queryDataFee); |
| | | Object fee1 = map1.get("fee1"); |
| | | |
| | | map.put("fee1",fee1); |
| | | //玩湃比 |
| | | Object fee2 = map1.get("fee2"); |
| | |
| | | map.put("fee3",map3.get("fee")); |
| | | Object data = map3.get("data"); |
| | | map.put("courseData",data); |
| | | |
| | | |
| | | // 赛事收入 |
| | | Double aDouble1 = competitionClient.queryFee(queryDataFee); |
| | | map.put("fee4",aDouble1); |
| | | |
| | | // 订场 |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | |
| | | if(userIds.size()==0){ |
| | | userIds.add(-1); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getAppUserId,userIds); |
| | | vipPaymentLambdaQueryWrapper.ne(SiteBooking::getStatus,0); |
| | | vipPaymentLambdaQueryWrapper.ne(SiteBooking::getStatus,5); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | objects.add(2); |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getPayType,objects); |
| | | List<SiteBooking> list1 = siteBookingService.list(vipPaymentLambdaQueryWrapper); |
| | | List<SiteBooking> list1 = siteBookingService.list(new QueryWrapper<SiteBooking>() |
| | | .ne("status",0) |
| | | .ne("status",5) |
| | | .ne("payType",3) |
| | | .ne("payType",4)); |
| | | double sum = list1.stream().mapToDouble(SiteBooking::getPayMoney).sum(); |
| | | map.put("fee5",sum); |
| | | // 智慧球场查询query |
| | | GameDataQuery gameDataQuery = new GameDataQuery(); |
| | | gameDataQuery.setObjectId(0); |
| | | // 平台智慧球场 |
| | | List<TGameRecord> data1 = ballClient.getData(gameDataQuery); |
| | | double sum1 = data1.stream() |
| | | .map(TGameRecord::getMoney) // 获取每个 TGameRecord 对象的 money 字段 |
| | | .mapToDouble(BigDecimal::doubleValue) // 将 BigDecimal 转换为 double |
| | | .sum(); |
| | | map.put("fee5",sum+sum1); |
| | | |
| | | |
| | | List<Integer> collect = list1.stream().map(SiteBooking::getSiteId).collect(Collectors.toList()); |
| | |
| | | ids.add(-1); |
| | | } |
| | | Page<Competition> page = new PageFactory<Competition>().defaultPage(); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids,0); |
| | | Page<Competition> competitions = competitionClient.listAudit(listQuery); |
| | | for (Competition competition : competitions.getRecords()) { |
| | | for (TStore tStore : list) { |
| | |
| | | model.addAttribute("province",list4); |
| | | } |
| | | model.addAttribute("operator",objectId); |
| | | // 查询当前运营商管理了哪些门店 |
| | | List<TStore> stores = storeService |
| | | .list(new QueryWrapper<TStore>() |
| | | .eq("operatorId", UserExt.getUser().getObjectId())); |
| | | model.addAttribute("stores",stores); |
| | | } |
| | | if (UserExt.getUser().getObjectType()==1) model.addAttribute("operator",0); |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | if (UserExt.getUser().getObjectType()==3) model.addAttribute("operator",byId.getOperatorId()); |
| | | List<TOperator> list2 = tOperatorService.list(); |
| | | model.addAttribute("yysList",list2); |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | |
| | | ids = operatorId; |
| | | } |
| | | Page<Competition> page = new PageFactory<Competition>().defaultPage(); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids,UserExt.getUser().getObjectType()); |
| | | Page<Competition> competitions = competitionClient.list(listQuery); |
| | | List<Competition> records = new ArrayList<>(); |
| | | // for (Competition competition : competitions.getRecords()) { |
| | |
| | | @RequestMapping("/getProvinceYys") |
| | | @ResponseBody |
| | | public Object getProvinceYys(Integer operatorId) { |
| | | // 获取运营商管理的所有省 |
| | | List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", operatorId) |
| | | .eq("pid", 0)); |
| | | // 判断当前运营商是管理全国还是指定区域 |
| | | TOperator byId = tOperatorService.getById(operatorId); |
| | | // 说明是管理全国 |
| | | if (byId.getType()==1){ |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | return list; |
| | | }else{ |
| | | // 获取运营商管理的所有省 |
| | | List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", operatorId) |
| | | .eq("pid", 0)); |
| | | return list; |
| | | } |
| | | |
| | | return list; |
| | | |
| | | } |
| | | // 运营商根据省筛选市区 |
| | | @RequestMapping("/getCityYys") |
| | |
| | | @ResponseBody |
| | | public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1) { |
| | | try { |
| | | |
| | | |
| | | if(yyId==null || type==1){ |
| | | yyId=0; |
| | | } |
| | |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | tStore.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | | storeService.save(tStore); |
| | | |
| | | user.setObjectId(tStore.getId()); |
| | | userService.updateById(user); |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | |
| | | storeConfigs.add(storeConfig); |
| | | } |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | // 添加场地 |
| | | TSite tSite = new TSite(); |
| | | tSite.setName(tStore.getName()); |
| | | tSite.setStoreId(tStore.getId()); |
| | | tSite.setSign(1); |
| | | siteService.save(tSite); |
| | | |
| | | HashMap<String, String> mapSite = new HashMap<>(); |
| | | mapSite.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | mapSite.put("name",tStore.getName()); |
| | | mapSite.put("space_id",tStore.getId().toString()); |
| | | mapSite.put("area_id",tSite.getId().toString()); |
| | | HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceArea", mapSite); |
| | | // 添加门店 |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | |
| | | map1.put("remark",tStore.getIntroduce()); |
| | | map1.put("lat",tStore.getLat()); |
| | | map1.put("lng",tStore.getLon()); |
| | | map1.put("space_id",tStore.getId().toString()); |
| | | String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | System.out.println(result); |
| | | |
| | | |
| | | |
| | | for (String s : tStore.getIds().split(",")) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id",tStore.getId()+""); |
| | | map.put("device_id",s); |
| | | map.put("region_id",tSite.getId().toString()); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | System.out.println(s1); |
| | | } |
| | | |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String space_id = data.getString("space_id"); |
| | | Integer integer = Integer.valueOf(space_id); |
| | | tStore.setId(integer); |
| | | storeService.save(tStore); |
| | | System.err.println(tStore); |
| | | // HashMap<String, String> mapSite = new HashMap<>(); |
| | | // mapSite.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // mapSite.put("name",tStore.getName()); |
| | | // mapSite.put("space_id",tStore.getId().toString()); |
| | | // mapSite.put("area_id",tSite.getId().toString()); |
| | | // HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceArea", mapSite); |
| | | // for (String s : tStore.getIds().split(",")) { |
| | | // HashMap<String, String> map = new HashMap<>(); |
| | | // map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // map.put("space_id",tStore.getId()+""); |
| | | // map.put("device_id",s); |
| | | // map.put("region_id",tSite.getId().toString()); |
| | | // // 添加门禁 |
| | | // String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | // System.out.println(s1); |
| | | // } |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | site.setInsertTime(new Date()); |
| | | site.setState(1); |
| | | site.setOperatorId(UserExt.getUser().getObjectId()); |
| | | Integer integer1 = siteClient.addSite(site); |
| | | |
| | | |
| | | // 添加场地 |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name",site.getName()); |
| | | map.put("space_id",store.getId().toString()); |
| | | map.put("area_id",integer1.toString()); |
| | | String s = HttpRequestUtil.postRequest |
| | | ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | // 添加门禁 |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String area_id = data.getString("area_id"); |
| | | Integer integer = Integer.valueOf(area_id); |
| | | site.setId(integer); |
| | | Integer integer1 = siteClient.addSite(site); |
| | | // Integer integer = Integer.valueOf(spaceId); |
| | | if(StringUtils.hasLength( site.getIds())) { |
| | | for (String s1 : site.getIds().split(",")) { |
| | |
| | | public String updatePassword(Model model) { |
| | | return "/password.html" ; |
| | | } |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | /** |
| | | * 点击登录执行的动作 |
| | | */ |
| | | @RequestMapping(value = "/updatePassword", method = RequestMethod.POST) |
| | | public Object loginVali(String username, String password,String code) { |
| | | |
| | | User user = userService.getByAccount(username); |
| | | if (user==null)return "用户不存在"; |
| | | password = AESUtils.decrypt(password); |
| | | String s = MD5.md5(password); |
| | | if(user.getPassword().equals(s))return "新密码和旧密码一致"; |
| | | //验证短信验证码 |
| | | if(ToolUtil.isEmpty(code))return "无效的验证码"; |
| | | String value = redisUtil.getValue(user.getPhone()); |
| | | if(ToolUtil.isEmpty(value) || !code.equals(value))return "手机验证码不正确"; |
| | | user.setPassword(s); |
| | | return "修改成功!"; |
| | | } |
| | | // @Autowired |
| | | // private RedisUtil redisUtil; |
| | | // /** |
| | | // * 点击登录执行的动作 |
| | | // */ |
| | | // @RequestMapping(value = "/updatePassword", method = RequestMethod.POST) |
| | | // public Object loginVali(String username, String password,String code) { |
| | | // |
| | | // User user = userService.getByAccount(username); |
| | | // if (user==null)return "用户不存在"; |
| | | // password = AESUtils.decrypt(password); |
| | | // String s = MD5.md5(password); |
| | | // if(user.getPassword().equals(s))return "新密码和旧密码一致"; |
| | | // //验证短信验证码 |
| | | // if(ToolUtil.isEmpty(code))return "无效的验证码"; |
| | | // String value = redisUtil.getValue(user.getPhone()); |
| | | // if(ToolUtil.isEmpty(value) || !code.equals(value))return "手机验证码不正确"; |
| | | // user.setPassword(s); |
| | | // return "修改成功!"; |
| | | // } |
| | | /** |
| | | * 跳转到主页 |
| | | */ |
| | |
| | | f++; |
| | | loginFailures.put(username, f); |
| | | } |
| | | if (KaptchaUtil.getKaptchaOnOff()) { |
| | | String kaptcha = super.getPara("kaptcha").trim(); |
| | | String code = (String) super.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); |
| | | if (Objects.isNull(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { |
| | | model.addAttribute("tips", "验证码错误"); |
| | | return "/login.html"; |
| | | } |
| | | } |
| | | |
| | | // if (f > 5 && (System.currentTimeMillis() - t) <= (30 * 60 * 1000)) { |
| | | // model.addAttribute("tips", "登录次数过多,请等30分钟再试!"); |
| | | // return "/login.html"; |
| | |
| | | |
| | | List<SelectDto> selectDtos = appUserClient.giftSelect(giftSearchDto); |
| | | // 只查询当前用户下 同时也报名了该课程的学员 |
| | | for (SelectDto selectDto : selectDtos) { |
| | | // 获取课包id |
| | | TCoursePackagePayment tCoursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(giftSearchDto.getId()); |
| | | |
| | | Integer coursePackageId = tCoursePackagePayment.getCoursePackageId(); |
| | | // 学员id 拿到学员id 判断当前学员是否报名了这门课程 |
| | | Long id = selectDto.getId(); |
| | | // |
| | | } |
| | | // for (SelectDto selectDto : selectDtos) { |
| | | // // 获取课包id |
| | | // TCoursePackagePayment tCoursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(giftSearchDto.getId()); |
| | | // |
| | | // Integer coursePackageId = tCoursePackagePayment.getCoursePackageId(); |
| | | // // 学员id 拿到学员id 判断当前学员是否报名了这门课程 |
| | | // Long id = selectDto.getId(); |
| | | // // |
| | | // } |
| | | Map<String,List<SelectDto>> map = new HashMap<>(); |
| | | map.put("options",selectDtos); |
| | | // Map<String,List<SelectDto>> map = new HashMap<>(); |
| | |
| | | */ |
| | | @Data |
| | | public class CoursePackagePayDTO { |
| | | private List<String> ids; |
| | | private String ids; |
| | | private String payUserName; |
| | | // 操作人id |
| | | private Integer userId; |
| | |
| | | private String payUser; |
| | | private String phone; |
| | | // 学员id |
| | | private Integer studentId; |
| | | private String studentId; |
| | | private String payStudent; |
| | | private Integer payType; |
| | | |
| | |
| | | */ |
| | | @TableField("salesName") |
| | | private String salesName; |
| | | |
| | | @TableField("giftClassHours") |
| | | private Integer giftClassHours; |
| | | |
| | | private String studentName; |
| | | private String province; |
| | |
| | | private Integer hasHours; |
| | | private BigDecimal laveCashPayment; |
| | | private BigDecimal cashPayment1; |
| | | // 所选课时规格id |
| | | private Integer coursePackageConfigId; |
| | | } |
| | |
| | | @TableName("t_store") |
| | | @Data |
| | | public class TStore { |
| | | @TableId(type = IdType.AUTO) |
| | | @TableId(type = IdType.INPUT) |
| | | private Integer id; |
| | | @TableField("name") |
| | | private String name; |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | import com.dsh.course.feignClient.course.*; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.guns.config.UserExt; |
| | |
| | | @Override |
| | | public ResultUtil cancellationRecord(Long id, String cancelClasses, Integer deductClassHour) { |
| | | // CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | List<Long> integers = new ArrayList<>(); |
| | | |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingClient.queryCoursePackageSchedulingsById(id); |
| | | List<Long> integers = new ArrayList<>(); |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | integers.add(coursePackageScheduling.getId()); |
| | | coursePackageScheduling.setCancelClasses(cancelClasses); |
| | | coursePackageScheduling.setDeductClassHour(deductClassHour); |
| | | } |
| | | |
| | | |
| | | // for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | |
| | | // if(coursePackageScheduling.getStatus() == 1 || coursePackageScheduling.getStatus() == 4){ |
| | | // return ResultUtil.error("不能添加消课凭证"); |
| | | // } |
| | | // coursePackageScheduling.setCancelClasses(cancelClasses); |
| | | // coursePackageScheduling.setDeductClassHour(deductClassHour); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageSchedulings); |
| | | |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryByCoursePackageSchedulingId(integers); |
| | | for (CoursePackageStudent coursePackageStudent : coursePackageStudents) { |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | if (coursePackageStudent.getSignInOrNot()==2){ |
| | | break; |
| | | } |
| | | integers.add(coursePackageScheduling.getId()); |
| | | coursePackageScheduling.setCancelClasses(cancelClasses); |
| | | coursePackageScheduling.setDeductClassHour(deductClassHour); |
| | | } |
| | | |
| | | if(coursePackageStudent.getReservationStatus() == 0){ |
| | | if(coursePackageStudent.getSignInOrNot() == 2){ |
| | | continue; |
| | | } |
| | | TCoursePackagePayment tCoursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(coursePackageStudent.getCoursePackagePaymentId()); |
| | | // TCoursePackagePayment tCoursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(coursePackageStudent.getCoursePackagePaymentId()); |
| | | |
| | | CoursePackageOrderStudent coursePackageOrderStudent = coursePackagePaymentClient.queryCoursePackagePaymentById1(coursePackageStudent.getCoursePackagePaymentId()); |
| | | |
| | | if (deductClassHour!=null) { |
| | | if (tCoursePackagePayment.getLaveClassHours() - deductClassHour < 0) { |
| | | if (coursePackageOrderStudent.getLaveClassHours() - deductClassHour < 0) { |
| | | coursePackageStudentClient.editCoursePackageStudent(coursePackageStudent); |
| | | continue; |
| | | } |
| | | tCoursePackagePayment.setLaveClassHours(tCoursePackagePayment.getLaveClassHours() - deductClassHour); |
| | | coursePackageOrderStudent.setLaveClassHours(coursePackageOrderStudent.getLaveClassHours() - deductClassHour); |
| | | } |
| | | |
| | | if(coursePackageStudent.getReservationStatus() == 0){ |
| | | tCoursePackagePayment.setAbsencesNumber(tCoursePackagePayment.getAbsencesNumber() + 1); |
| | | coursePackageOrderStudent.setAbsencesNumber(coursePackageOrderStudent.getAbsencesNumber() + 1); |
| | | } |
| | | System.out.println("====tCoursePackagePayment====="+tCoursePackagePayment); |
| | | coursePackagePaymentClient.editCoursePackagePayment1(tCoursePackagePayment); |
| | | System.out.println("====tCoursePackagePayment====="+coursePackageOrderStudent); |
| | | coursePackagePaymentClient.editCoursePackagePayment2(coursePackageOrderStudent); |
| | | |
| | | |
| | | CancelledClasses cancelledClasses = new CancelledClasses(); |
| | | cancelledClasses.setType(1); |
| | | cancelledClasses.setCoursePackageId(coursePackageStudent.getCoursePackageId()); |
| | | cancelledClasses.setCoursePackagePaymentId(coursePackageStudent.getCoursePackagePaymentId()); |
| | | cancelledClasses.setCoursePackagePaymentId(coursePackageOrderStudent.getId()); |
| | | cancelledClasses.setCoursePackageSchedulingId(coursePackageStudent.getCoursePackageSchedulingId()); |
| | | cancelledClasses.setVoucher(cancelClasses); |
| | | if (deductClassHour!=null) { |
| | |
| | | |
| | | |
| | | } |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageSchedulings); |
| | | // } |
| | | |
| | | return ResultUtil.success(); |
| | |
| | | $("#t1").val("") |
| | | $("#t2").val("") |
| | | $("#t3").val("") |
| | | $("#page").val("") |
| | | $("#type").val("") |
| | | $("#pageId").val("") |
| | | }else { |
| | | $("#t1").show() |
| | | $("#t2").show() |
| | |
| | | |
| | | |
| | | function updateOne(e) { |
| | | console.log("看看选择页面") |
| | | console.log($('#page option:selected').text()) |
| | | if ($('#page option:selected').text()=="门店列表"){ |
| | | var page= $('#page option:selected').text(); |
| | | if (page=="门店列表" || page=="主页" || page=="充值中心"){ |
| | | $("#t3").hide(); |
| | | $("#t2").hide(); |
| | | $("#t2").val("") |
| | | $("#t3").val("") |
| | | $("#type").val("") |
| | | $("#pageId").val("") |
| | | } |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ |
| | |
| | | console.log("=-======0000") |
| | | $("#t2").val("") |
| | | $("#t2").hide() |
| | | $("#type").val("") |
| | | |
| | | } |
| | | }); |
| | | if (oneId==2 || oneId==25|| oneId==27){ |
| | | $("#t3").val("") |
| | | $("#t3").hide() |
| | | |
| | | $("#pageId").val("") |
| | | } |
| | | ajax.set("id",oneId); |
| | | ajax.start(); |
| | |
| | | if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ |
| | | $("#t3").hide() |
| | | $("#t3").val("") |
| | | $("#pageId").val("") |
| | | |
| | | }else{ |
| | | $("#t3").show() |
| | |
| | | } |
| | | } |
| | | window.onload = function() { |
| | | if ($('#model option:selected').text()=="不跳转"){ |
| | | $("#t1").hide(); |
| | | $("#t2").hide(); |
| | | $("#t3").hide(); |
| | | $("#page").val("") |
| | | $("#type").val("") |
| | | $("#pageId").val("") |
| | | } |
| | | |
| | | var temp = $("#turnId").val(); |
| | | var res= document.getElementById("imgPX"); |
| | | res.innerHTML ="推荐像素:780x472px"; |
| | | if (temp==""){ |
| | | $("#t3").hide(); |
| | | $("#t3").val("") |
| | | $("#pageId").val("") |
| | | } |
| | | // 查看跳转页面 有没有跳转类型 |
| | | var page = $('#page option:selected').text(); |
| | | if (page=="门店列表" || page=="主页" || page=="充值中心" ){ |
| | | $("#t2").hide(); |
| | | $("#t3").hide(); |
| | | $("#t2").val("") |
| | | $("#t3").val("") |
| | | $("#type").val("") |
| | | $("#pageId").val("") |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <div id="div2" class='table1' onclick="getContent(2)" style="border-right: 1px solid #333;">运营统计</div> |
| | | <div id="div3" class='table1' onclick="getContent(3)" style="border-right: 1px solid #333;">教学统计</div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row" id="content1" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-10"> |
| | | <h2>营收数据1</h2> |
| | | <h2>营收数据</h2> |
| | | </br> |
| | | <div id = "money1" style="width: 1500px" > |
| | | <span id="totalIncome">总营收:</span> |
| | |
| | | <script src="${ctxPath}/modular/system/dataStatistics/echarts.min.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | function search1() { |
| | | var time = $("#beginTime").val(); |
| | | var ajax9 = new $ax(Feng.ctxPath + "/data/type1", function(data){ |
| | | |
| | | }); |
| | | ajax9.set("time",time); |
| | | ajax9.start(); |
| | | } |
| | | var ans = []; |
| | | var weekX = ["1周","2周","3周","4周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | |
| | | |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backPt", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | |
| | | ajax4.start(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | option7 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度耗课数量', '月度耗课数量', '周度耗课数量', '日度耗课数量'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度耗课数量', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | ] |
| | | }; |
| | | myChart.on('legendselectchanged', obj => { |
| | | var options = myChart.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | |
| | | } |
| | | myChart6.setOption(options, true) |
| | | }); |
| | | |
| | | |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/stuPt", function(data){ |
| | | console.log(data) |
| | | |
| | | $("#allUser").text(data.allUser) |
| | | |
| | | option6 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | }); |
| | | ajax2.start() |
| | | myChart6.setOption(option6); |
| | | } |
| | | |
| | | |
| | | function ptCourse() { |
| | | console.log("调用") |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | myChart7.on('legendselectchanged', obj => { |
| | | var options = myChart7.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | console.log("看看选择") |
| | | console.log(obj.name) |
| | | if (obj.name == '年度耗课数量') { |
| | | console.log("看看年度轴") |
| | | options.xAxis[0].data = yearX |
| | | console.log(yearX) |
| | | } else if (obj.name == '月度耗课数量') { |
| | | console.log("看看月度轴") |
| | | options.xAxis[0].data = monthX |
| | | console.log(monthX) |
| | | }else if (obj.name == '周度耗课数量') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | }else if (obj.name == '日度耗课数量') { |
| | | console.log("看看日度轴") |
| | | options.xAxis[0].data = dataX |
| | | console.log(dataX) |
| | | } |
| | | myChart7.setOption(options, true) |
| | | }); |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/coursePt", function(data){ |
| | | console.log(data) |
| | | |
| | | $("#allHour").text(data.allHour) |
| | | |
| | | option7 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | name: '周度耗课数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [data.count,data.count1,data.count2,data.count3] |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度耗课数', |
| | |
| | | ] |
| | | }; |
| | | }); |
| | | console.log("调用") |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | myChart7.on('legendselectchanged', obj => { |
| | | var options = myChart7.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | console.log("看看选择") |
| | | console.log(obj.name) |
| | | if (obj.name == '年度耗课数') { |
| | | console.log("看看年度轴") |
| | | options.xAxis[0].data = yearX |
| | | console.log(yearX) |
| | | } else if (obj.name == '月度耗课数') { |
| | | console.log("看看月度轴") |
| | | options.xAxis[0].data = monthX |
| | | console.log(monthX) |
| | | }else if (obj.name == '周度耗课数') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | }else if (obj.name == '日度耗课数') { |
| | | console.log("看看日度轴") |
| | | options.xAxis[0].data = dataX |
| | | console.log(dataX) |
| | | } |
| | | myChart7.setOption(options, true) |
| | | }); |
| | | ajax2.start() |
| | | myChart7.setOption(option7); |
| | | } |
| | | |
| | | function ptCourse() { |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/coursePt", function(data){ |
| | | |
| | | $("#allHour").text(data.allHour) |
| | | console.log("周度") |
| | | console.log(data.weekData) |
| | | 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 |
| | | } |
| | | ] |
| | | }; |
| | | }); |
| | | console.log("调用") |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | myChart7.on('legendselectchanged', obj => { |
| | | var options = myChart7.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | console.log("看看选择") |
| | | console.log(obj.name) |
| | | if (obj.name == '年度耗课数') { |
| | | console.log("看看年度轴") |
| | | options.xAxis[0].data = yearX |
| | | console.log(yearX) |
| | | } else if (obj.name == '月度耗课数') { |
| | | console.log("看看月度轴") |
| | | options.xAxis[0].data = monthX |
| | | console.log(monthX) |
| | | }else if (obj.name == '周度耗课数') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | }else if (obj.name == '日度耗课数') { |
| | | console.log("看看日度轴") |
| | | options.xAxis[0].data = dataX |
| | | console.log(dataX) |
| | | } |
| | | myChart7.setOption(options, true) |
| | | }); |
| | | |
| | | |
| | | ajax2.start() |
| | | myChart7.setOption(option7); |
| | | } |
| | |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(objectType==1){ |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">*所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="pCode" name="pCode" onchange="TSite.oneChange()"> |
| | | <option value="">请选择省</option> |
| | | @for(obj in list){ |
| | | <option style="width: 300px" value="${obj.provinceCode}">${obj.province}</option> |
| | | <option style="width: 300px" value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @if(objectType==1){ |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">*所属账号:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="pCode" name="pCode" onchange="TSite.oneChange()"> |
| | | @for(obj in list){ |
| | | <option value="${obj.provinceCode}" ${obj.province == data.province ? 'selected=selected' : ''}>${obj.province}</option> |
| | | <option value="${obj.code}" ${obj.code == data.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <div class="col-sm-9"> |
| | | <select style="width: 300px" class="form-control" id="cCode" name="cCode" onchange="TSite.oneChangeNext(this)"> |
| | | @for(obj in city){ |
| | | <option value="${obj.cityCode}" ${obj.city == data.city ? 'selected=selected' : ''}>${obj.city}</option> |
| | | <option value="${obj.code}" ${obj.code == data.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">*姓名:</label> |
| | | <div class="col-sm-9" style="display: flex;"> |
| | | <input style="width: 300px" class="form-control" id="name" value="${data.name}" placeholder="请输入姓名" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">*生日:</label> |
| | | <div class="col-sm-9" style="display: flex"> |
| | |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | let id = "${pictures}" |
| | | let obj = [] |
| | | $(function() { |
| | | var id = "${pictures}" |
| | | }) |
| | | var id = "${pictures}" |
| | | var obj = [] |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | |
| | | }); |
| | | }, |
| | | changeImg(){ |
| | | console.log("看看id") |
| | | console.log(id) |
| | | var i = id.split(",") |
| | | console.log("看看后端返回的图片") |
| | | console.log(i.length) |
| | | console.log(i) |
| | | for (let j = 0; j <i.length; j++) { |
| | | let obj={ |
| | | fileName:i[j], |
| | |
| | | response:i[j], |
| | | } |
| | | this.imageUrl2.push(obj) |
| | | console.log("看看res") |
| | | console.log(obj.response); |
| | | TSite.goodsPicArray.push(obj.response) |
| | | } |
| | | console.log(this.imageUrl2) |
| | | }, |
| | | }, |
| | | created() { |
| | | this.changeImg() |
| | | TSite.goodsPicArray = this.imageUrl2 |
| | | console.log("看看执行") |
| | | var temp = [] |
| | | for (let i = 0; i < TSite.goodsPicArray.length; i++) { |
| | | temp.push(TSite.goodsPicArray[i].response) |
| | | } |
| | | TSite.goodsPicArray = temp; |
| | | console.log("赋值") |
| | | console.log(TSite.goodsPicArray) |
| | | }, |
| | | }); |
| | |
| | | <div class="ibox-title"> |
| | | <h5>赛事管理</h5> |
| | | </div> |
| | | |
| | | <input hidden id="type" value="${type}"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | |
| | | @if(type==1){ |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label" id="yys1">所属运营商:</label> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*门店类型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange3(this)"> |
| | | <input type="radio" name="type" value="1" onclick="updateType(1)" checked > 平台门店 |
| | | <input type="radio" name="type" value="2" onclick="updateType(2)" id="radio1" > 运营商门店 |
| | | </div> |
| | | </div> |
| | | <div id="yys" hidden> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所属运营商:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange3(this)" > |
| | | <option value="">选择运营商</option> |
| | | @for(i in yysList){ |
| | | <option value="${i.id}">${i.name}</option> |
| | | <option value="${i.id}" >${i.name}</option> |
| | | @} |
| | | </select> |
| | | <input type="checkbox" value="0" name="pt" id="pt" onchange="TCarInfoDlg.oneChangeYys(this)">平台</input> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange9(this)"> |
| | | |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(type==2){ |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange9(this)"> |
| | | <option value="">选择省</option> |
| | | @for(i in province){ |
| | | <option value="${i.code}">${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">举办市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode" onchange="TCarInfoDlg.oneChangeNext9(this)"> |
| | | <option value="">选择市</option> |
| | | |
| | | </select> |
| | | <div id="yys1"> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode1" name="pCode" onchange="TCarInfoDlg.oneChange9(this)"> |
| | | <option value="">选择省</option> |
| | | @for(i in list){ |
| | | <option value="${i.code}" >${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">举办市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode1" name="cCode" onchange="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | @} |
| | | @if(type==1){ |
| | | <div class="form-group" id="shop"> |
| | |
| | | <label class="col-sm-3 control-label">举办门店:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="shopId" name="shopId" multiple> |
| | | |
| | | <option value="">选择门店</option> |
| | | @for(i in stores){ |
| | | <option value="${i.id}" >${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">支付方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="checkbox" onclick="updateType(1,this)"> 现金支付 |
| | | <input type="checkbox" onclick="updateType(2,this)"> 玩湃币支付 |
| | | <input type="checkbox" onclick="updateType(3,this)"> 课时支付 |
| | | <input type="checkbox" onclick="updateType1(1,this)"> 现金支付 |
| | | <input type="checkbox" onclick="updateType1(2,this)"> 玩湃币支付 |
| | | <input type="checkbox" onclick="updateType1(3,this)"> 课时支付 |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | }else { |
| | | $("#payType1").hide(); |
| | | } |
| | | $("#yys").hide(); |
| | | $("#yys1").show(); |
| | | $("#pCode1").val(""); |
| | | $("#cCode1").val(""); |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | |
| | | } |
| | | if(e==2){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType2").show(); |
| | | }else { |
| | | $("#payType2").hide(); |
| | | } |
| | | $("#yys").show(); |
| | | $("#yys1").hide(); |
| | | $("#pCode1").val(""); |
| | | $("#cCode1").val(""); |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | |
| | | } |
| | | } |
| | | function updateType1(e,o) { |
| | | if(e==1){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType1").show(); |
| | | }else { |
| | | $("#payType1").hide(); |
| | | } |
| | | } |
| | | if(e==2){ |
| | | if($(o).is(":checked")){ |
| | |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | file.url =file.response |
| | | TCarInfoDlg.goodsPicArray.push(file); |
| | | TCarInfoDlg.goodsPicArray.push(res); |
| | | console.log(TCarInfoDlg.goodsPicArray) |
| | | }, |
| | | changeImg(){ |
| | | var i = id.split(",") |
| | | for (let j = 0; j <i.length; j++) { |
| | | let obj={ |
| | | fileName:i[j], |
| | | uuid:i[j], |
| | | url:i[j], |
| | | response:i[j], |
| | | } |
| | | this.imageUrl2.push(obj) |
| | | |
| | | } |
| | | console.log( this.imageUrl2,111) |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | |
| | | TCarInfoDlg.goodsPicArray = TCarInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | |
| | | }, |
| | | changeImg(){ |
| | | var i = id.split(",") |
| | | for (let j = 0; j <i.length; j++) { |
| | | let obj={ |
| | | fileName:i[j], |
| | | uuid:i[j], |
| | | url:i[j], |
| | | response:i[j], |
| | | } |
| | | this.imageUrl2.push(obj) |
| | | } |
| | | console.log( this.imageUrl2,111) |
| | | }, |
| | | }, |
| | | created() { |
| | |
| | | */ |
| | | TQuestion.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true}, |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, |
| | | {title: '门店名称', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | TQuestion.unfreeze = function () { |
| | | if (this.check()) { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | |
| | | console.log("看看选择") |
| | | console.log(selected) |
| | | const data1 = { |
| | | ids:[], |
| | | ids:TQuestion.seItem.id, |
| | | payUserName:"" |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | if (obj.payStatus == 2){ |
| | | Feng.error("订单已支付!不能再手动支付了") |
| | | return; |
| | | } |
| | | var id = ""; |
| | | id = obj.id; |
| | | console.log(obj.id); |
| | | data1.ids.push(id); |
| | | }); |
| | | if (TQuestion.seItem.payStatus == 2){ |
| | | Feng.error("订单已支付!不能再手动支付了") |
| | | return; |
| | | } |
| | | console.log(data1) |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/cpPayment/pay", |
| | |
| | | giftClassHours:null, |
| | | useTime:"", |
| | | payUserName:"", |
| | | coursePackageConfigId:null |
| | | }; |
| | | data.appUserId = appUserId; |
| | | console.log("我看看规格id") |
| | | console.log($("#courseTime").val()) |
| | | data.coursePackageConfigId = $("#courseTime").val(); |
| | | data.studentId = $("#student").val() |
| | | data.coursePackageId = $("#coursePackageName").val() |
| | | data.cashPayment = $("#cashPayment").val() |
| | |
| | | var courseTimeId= $("#courseTime").val() |
| | | console.log("看看课时") |
| | | console.log(courseTimeId) |
| | | data.coursePackageConfigId = courseTimeId; |
| | | if(typeof courseTimeId === 'undefined'){ |
| | | console.log("进入") |
| | | courseTimeId=0; |
| | |
| | | // 场地管理首页 选择对应的省市 |
| | | // 传1是场地管理首页 传2是场地管理添加页面 |
| | | TSite.oneChange = function () { |
| | | var province = $('#pCode option:selected').text(); |
| | | var province = $('#pCode').val(); |
| | | var citySelect = document.getElementById("cCode"); |
| | | var ajax = new $ax(Feng.ctxPath + "/tSite/getCity", function(data){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择市</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.cityCode+"'>"+v.city+"</option>"; |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | |
| | | $("#cCode").innerHTML = '<option value="">请先选择省/市</option>'; |
| | | } |
| | | |
| | | ajax.set("province",province); |
| | | ajax.set("oneId",province); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | TSite.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var city = $('#cCode option:selected').text(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tSite/accountChangeNext", function(data){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCoach/getYys", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择账号</option>'; |
| | | $.each(data, function(k,v) { |
| | |
| | | $("#account").empty().append(content); |
| | | } |
| | | }); |
| | | |
| | | ajax.set("pCode",$("#pCode").val()); |
| | | ajax.set("cCode",$("#cCode").val()); |
| | | ajax.start(); |
| | | if (oneId === ""){ |
| | | $("#account").innerHTML = '<option style="width: 300px" value="">请先选择省/市</option>'; |
| | | |
| | | } |
| | | ajax.set("oneId",city); |
| | | ajax.start(); |
| | | |
| | | // var ajax1 = new $ax(Feng.ctxPath + "/tSite/storeChangeNext", function(data){ |
| | | // if(data!=null && data.length !== 0){ |
| | | // var content='<option value="">选择门店</option>'; |
| | | // $.each(data, function(k,v) { |
| | | // content += "<option style='width: 300px' value='"+v.id+"'>"+v.name+"</option>"; |
| | | // }); |
| | | // $("#store").empty().append(content); |
| | | // }else { |
| | | // storeSelect.innerHTML = '<option value="">当前所选市没有门店</option>'; |
| | | // } |
| | | // }); |
| | | // ajax1.set("oneId",oneId); |
| | | // ajax1.start(); |
| | | }; |
| | | |
| | | /** |
| | |
| | | var em = "";// 门店经营结束时间:分钟 |
| | | |
| | | TSite.addSubmit = function(){ |
| | | |
| | | |
| | | var data = { |
| | | id:null, |
| | | province:"", |
| | |
| | | temp = temp+","+TSite.goodsPicArray[i]; |
| | | } |
| | | data.certificateImg = temp |
| | | |
| | | if ($("#objectType").val()==1){ |
| | | if($("#pCode").val()==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | |
| | | if($("#account").val()=='' ){ |
| | | Feng.info("请选择账号") |
| | | return; |
| | | } |
| | | } |
| | | if($("#coachTypeId").val()=='' ){ |
| | | Feng.info("请选择教练类型") |
| | |
| | | }); |
| | | }; |
| | | TSite.editSubmit = function(){ |
| | | |
| | | |
| | | var data = { |
| | | id:null, |
| | | province:"", |
| | |
| | | data.graduateSchool = $('#graduateSchool').val() |
| | | data.diploma = $('#img').val() |
| | | data.certificate = $('#certificate').val() |
| | | |
| | | var goodImgs = this.goodsPicArray; |
| | | if(goodImgs.length==0){ |
| | | Feng.info("请上传实景图") |
| | | return; |
| | | } |
| | | var temp = "" |
| | | |
| | | for (let i = 0; i < TSite.goodsPicArray.length; i++) { |
| | | console.log("循环") |
| | | console.log(TSite.goodsPicArray[i][`fileName`]) |
| | | temp = temp+","+TSite.goodsPicArray[i][`fileName`]; |
| | | console.log(TSite.goodsPicArray[i]) |
| | | temp = temp+","+TSite.goodsPicArray[i]; |
| | | } |
| | | data.certificateImg = temp |
| | | |
| | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | |
| | | var type = $("#type").val() |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | {title: '所在省', field: 'province', visible: type==2?false:true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '所在市', field: 'city', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在市', field: 'city', visible: type==2?false:true, align: 'center', valign: 'middle'}, |
| | | {title: '举办门店', field: 'storeName', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '赛事名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | |
| | | return {1:"未开始",2:"已开始",3:"已结束",4:"已取消"}[data] |
| | | } |
| | | }, |
| | | {title: '审核状态', field: 'auditStatus', visible: type==2?true:false, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"待审核",2:"已通过",3:"已拒绝"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | |
| | | } |
| | | |
| | | TCarInfoDlg.oneChange9 = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var elementById = document.getElementById("pt"); |
| | | |
| | | var elementById = document.getElementById("radio1"); |
| | | var operatorId; |
| | | if (elementById !== null) { |
| | | console.log(elementById) |
| | | operatorId = $("#account").val() |
| | | if (elementById.checked){ |
| | | operatorId = 0 |
| | | operatorId = $("#account").val() |
| | | }else{ |
| | | operatorId = $("#account").val() |
| | | operatorId = 0 |
| | | } |
| | | } |
| | | |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/getCityYys", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var pCode = $("#pCode").val(); |
| | | if(pCode==""){ |
| | | Feng.info("请选择省"); |
| | | return; |
| | | var pCode; |
| | | var cCode; |
| | | var elementById = document.getElementById("radio1"); |
| | | console.log("看看标签") |
| | | console.log(elementById) |
| | | if (elementById!=null){ |
| | | if (!elementById.checked){ |
| | | console.log("选中平台") |
| | | console.log($("#pCode1").val()) |
| | | console.log($("#cCode1").val()) |
| | | // 选中平台赛事 |
| | | pCode = $("#pCode1").val(); |
| | | if($("#pCode1").val()==""){ |
| | | Feng.info("请选择省"); |
| | | return; |
| | | } |
| | | cCode = $("#cCode1").val(); |
| | | if($("#cCode1").val()==""){ |
| | | Feng.info("请选择市"); |
| | | return; |
| | | } |
| | | }else{ |
| | | console.log("选中运营商") |
| | | console.log($("#pCode").val()) |
| | | console.log($("#cCode").val()) |
| | | // 选中运营商赛事 |
| | | pCode = $("#pCode").val(); |
| | | if(pCode==""){ |
| | | Feng.info("请选择省"); |
| | | return; |
| | | } |
| | | cCode = $("#cCode").val(); |
| | | if(cCode==""){ |
| | | Feng.info("请选择市"); |
| | | return; |
| | | } |
| | | } |
| | | var cCode = $("#cCode").val(); |
| | | if(cCode==""){ |
| | | Feng.info("请选择市"); |
| | | return; |
| | | } |
| | | |
| | | var shopId = $("#shopId").val(); |
| | | |
| | | if(shopId==""){ |
| | |
| | | |
| | | |
| | | TCarInfoDlg.oneChangeYys = function(e){ |
| | | |
| | | var oneId= $("input[name='pt']:checked").val() |
| | | |
| | | console.log("===========oneId=========="+oneId) |
| | | var oneId= $(e).val() |
| | | var SelectValue=""; |
| | | if(oneId=='0' ){ |
| | | oneId=0 |
| | | console.log("隐藏") |
| | | $("#yys1").hide(); |
| | | $("#t1").hide(); |
| | | $("#account").hide(); |
| | | }else{ |
| | | console.log("展示") |
| | | $("#yys1").show(); |
| | | $("#t1").show(); |
| | | $("#account").show(); |
| | | } |
| | | // var ajax = new $ax(Feng.ctxPath + "/tSite/getChangeOne", function(data){ |
| | |
| | | ajax.start(); |
| | | |
| | | |
| | | if (typeof(oneId) == "undefined"){ |
| | | if (oneId == "1"){ |
| | | console.log("===============") |
| | | |
| | | var button = document.getElementById("account"); |
| | | button.removeAttribute("disabled"); |
| | | |
| | |
| | | import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO; |
| | | import com.dsh.other.feignclient.model.AdvertisementQuery; |
| | | import com.dsh.other.model.BannerVo; |
| | | import com.dsh.other.model.dto.siteDto.GameDataQuery; |
| | | import com.dsh.other.service.*; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @Autowired |
| | | private TGameRecordService gameRecordService; |
| | | |
| | | // 数据统计 |
| | | @ResponseBody |
| | | @PostMapping("/student/getData") |
| | | public List<TGameRecord> getData(@RequestBody GameDataQuery query){ |
| | | if (query.getStoreId()==null){ |
| | | // 获取到游戏ids |
| | | List<Integer> gameIds = gameService.list(new QueryWrapper<Game>().eq("operationId", query.getObjectId())) |
| | | .stream().map(Game::getId).collect(Collectors.toList()); |
| | | // 根据游戏ids查询智慧球场支付记录 |
| | | List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().in("gameId", gameIds) |
| | | .eq("status", 1) |
| | | .ne("payType", 3) |
| | | .ne("payType", 4)); |
| | | return list; |
| | | }else{ |
| | | List<Integer> gameIds = gameService.list(new QueryWrapper<Game>().eq("storeId", query.getStoreId())) |
| | | .stream().map(Game::getId).collect(Collectors.toList()); |
| | | List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().in("gameId", gameIds) |
| | | .eq("status", 1).eq("payType", 1).eq("payType", 2)); |
| | | return list; |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/webStudentList") |
| | | public List<Game> list(@RequestBody BallQueryDto ballQueryDto) { |
| | |
| | | Date startTime = byId.getStartTime(); |
| | | Date endTime = byId.getEndTime(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | String startTimeString = sdf.format(startTime); |
| | | String endTimeString = sdf.format(endTime); |
| | | |
| | | String result = startTimeString + "-" + endTimeString.substring(11); |
| | | byId.setTimes(result); |
| | | |
| | | |
| | | byId.setSid(Arrays.asList(storeId)); |
| | | List<Site> list = siteService.list(new LambdaQueryWrapper<Site>().eq(Site::getStoreId, storeId).eq(Site::getSign, 1)); |
| | | List<Site> list = siteService.list(new LambdaQueryWrapper<Site>() |
| | | .eq(Site::getStoreId, storeId) |
| | | .eq(Site::getSign, 1)); |
| | | List<Integer> collect = list.stream().map(Site::getId).collect(Collectors.toList()); |
| | | byId.setRid(collect); |
| | | map.put("data", byId); |
New file |
| | |
| | | package com.dsh.other.model.dto.siteDto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GameDataQuery { |
| | | Integer objectId; |
| | | Integer storeId; |
| | | } |