| | |
| | | return "ERROR"; |
| | | } |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | @Override |
| | | public List<RegisterCourseVo> queryRegisteredCourseList(CourseOfAfterRequest courseTypeId, Integer appUserId) { |
| | | List<RegisterCourseVo> courseVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId",appUserId )); |
| | | |
| | | List<TOrder> orders = orderService.list(new QueryWrapper<TOrder>().eq("appUserId", appUserId)); |
| | | |
| | | List<String> paysId = new ArrayList<>(); |
| | | |
| | | List<TCoursePackagePayment> tCoursePackagePayments = new ArrayList<>(); |
| | | for (TOrder order : orders) { |
| | | String[] split = order.getPaysId().split(","); |
| | | // paysId.add(split[0]); |
| | | TCoursePackagePayment byId = this.getById(split[0]); |
| | | byId.setPayStatus(order.getIsPay()); |
| | | byId.setOrderId(order.getId()); |
| | | tCoursePackagePayments.add(byId); |
| | | } |
| | | |
| | | // List<TCoursePackagePayment> tCoursePackagePayments = this.list(new QueryWrapper<TCoursePackagePayment>() |
| | | // .eq("appUserId",appUserId )); |
| | | // List<TCoursePackagePayment> tCoursePackagePayments = this.list(new QueryWrapper<TCoursePackagePayment>() |
| | | // .in("id",paysId )); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | System.out.println(tCoursePackagePayments); |
| | | if (tCoursePackagePayments.size() > 0){ |
| | | try { |
| | |
| | | // 2.0 |
| | | registerCourseVo.setType(coursePackage.getType()); |
| | | |
| | | registerCourseVo.setOrderId(tCoursePackagePayment.getOrderId()); |
| | | registerCourseVo.setCoursePayId(tCoursePackagePayment.getId()); |
| | | registerCourseVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | registerCourseVo.setCoursePackTypeId(coursePackage.getCoursePackageTypeId()); |
| | |
| | | // registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | registerCourseVo.setCourseNums(counts); |
| | | } |
| | | // registerCourseVo.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | registerCourseVo.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | |
| | | courseVos.add(registerCourseVo); |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | @Autowired |
| | | private TCoursePackageDiscountService coursePackageDiscountService; |
| | | |
| | | |
| | | @Resource StoreClient storeClient; |
| | | @Override |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId) { |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId,String lon,String lat) { |
| | | AppUser appUser = appuClient.queryAppUser(appUserId); |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | TCoursePackagePayment tCoursePackagePayment = this.baseMapper.selectById(coursePayId); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.baseMapper.selectList(new QueryWrapper<TCoursePackagePayment>().eq("appUserId", appUserId).eq("coursePackageId", tCoursePackagePayment.getCoursePackageId())); |
| | | List<Integer> stuIds = new ArrayList<>(); |
| | | for (TCoursePackagePayment coursePackagePayment : tCoursePackagePayments) { |
| | | stuIds.add(coursePackagePayment.getStudentId()); |
| | | } |
| | | response.setStuIds(stuIds); |
| | | // List<TCoursePackagePayment> tCoursePackagePayments = this.baseMapper.selectList(new QueryWrapper<TCoursePackagePayment>().eq("appUserId", appUserId).eq("coursePackageId", tCoursePackagePayment.getCoursePackageId())); |
| | | // List<Integer> stuIds = new ArrayList<>(); |
| | | // for (TCoursePackagePayment coursePackagePayment : tCoursePackagePayments) { |
| | | // stuIds.add(coursePackagePayment.getStudentId()); |
| | | // } |
| | | // response.setStuIds(stuIds); |
| | | response.setChooseHours(tCoursePackagePayment.getClassHours()); |
| | | |
| | | |
| | |
| | | response.setTime(new SimpleDateFormat("yyyy.MM.dd").format(coursePackage.getStartTime()) + "-" + new SimpleDateFormat("yyyy.MM.dd").format(coursePackage.getEndTime())); |
| | | } |
| | | |
| | | // Store store = storeClient.queryStoreById(coursePackage.getStoreId()); |
| | | // response.setStoreName(store.getName()); |
| | | // response.setStoreCoverDrawing(store.getCoverDrawing()); |
| | | // response.setStoreAddress(store.getAddress()); |
| | | // response.setLon(store.getLon()); |
| | | // response.setLat(store.getLat()); |
| | | // if(ToolUtil.isNotEmpty(lon) && ToolUtil.isNotEmpty(lat)){ |
| | | // Map<String, Double> distance = GeodesyUtil.getDistance(lon + "," + lat, store.getLon() + "," + store.getLat()); |
| | | // double wgs84 = new BigDecimal(distance.get("WGS84")).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | // response.setDistance(wgs84); |
| | | // } |
| | | Store store = storeClient.queryStoreById(coursePackage.getStoreId()); |
| | | response.setStoreName(store.getName()); |
| | | |
| | | if(ToolUtil.isNotEmpty(lon) && ToolUtil.isNotEmpty(lat)){ |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(lon + "," + lat, store.getLon() + "," + store.getLat()); |
| | | double wgs84 = new BigDecimal(distance.get("WGS84")).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | response.setDistance(wgs84); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | response.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |