| | |
| | | double originalPrice1 = coursePackageListVo.getOriginalPrice(); |
| | | double paymentPrice1 = coursePackageListVo.getPaymentPrice(); |
| | | |
| | | double minPrice = Math.min(vipPrice1, Math.min(originalPrice1, paymentPrice1)); |
| | | double maxPrice = Math.max(vipPrice1, Math.max(originalPrice1, paymentPrice1)); |
| | | coursePackageListVo.setPaymentPrice(minPrice); |
| | | coursePackageListVo.setOriginalPrice(maxPrice); |
| | | System.out.println("Minimum price: " + minPrice); |
| | | System.out.println("Maximum price: " + maxPrice); |
| | | // double minPrice = Math.min(vipPrice1, Math.min(originalPrice1, paymentPrice1)); |
| | | // double maxPrice = Math.max(vipPrice1, Math.max(originalPrice1, paymentPrice1)); |
| | | // coursePackageListVo.setPaymentPrice(minPrice); |
| | | // coursePackageListVo.setOriginalPrice(maxPrice); |
| | | // System.out.println("Minimum price: " + minPrice); |
| | | |
| | | |
| | | |
| | | // } |
| | | // else{ |
| | | // List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | |
| | | // coursePackageListVo.setPaymentPrice(vipPrice); |
| | | // coursePackageListVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | // } |
| | | |
| | | if (coursePackageListVo.getPaymentPrice()<coursePackageListVo.getVipPrice()){ |
| | | coursePackageListVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | // coursePackageListVo.setVipPrice(null); |
| | | } |
| | | |
| | | if(appUser.getIsVip() == 1) { |
| | | if (coursePackageListVo.getVipPrice() < coursePackageListVo.getPaymentPrice()) { |
| | | coursePackageListVo.setPaymentPrice(coursePackageListVo.getVipPrice()); |
| | | } |
| | | }else { |
| | | coursePackageListVo.setVipPrice(null); |
| | | } |
| | | |
| | | |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(coursePackageList.getLon() + "," + coursePackageList.getLat(), store.getLon() + "," + store.getLat()); |
| | | coursePackageListVo.setDistance(distance.get("WGS84") / 1000); |
| | |
| | | |
| | | // coursePackagePaymentConfigVo.setPayType(coursePackage.getPayType()); |
| | | //会员显示原价和支付价(会员价)。非会员显示会员价和支付价(最低) |
| | | if(appUser.getIsVip() == 0){//非会员 |
| | | // if(appUser.getIsVip() == 0){//非会员 |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | |
| | | |
| | | |
| | | |
| | | 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); |
| | | // 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); |
| | | // } |
| | | if(appUser.getIsVip() == 1) { |
| | | if (coursePackagePaymentConfigVo.getVipPrice()<coursePackagePaymentConfigVo.getPaymentPrice()){ |
| | | coursePackagePaymentConfigVo.setPaymentPrice(coursePackagePaymentConfigVo.getVipPrice()); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (coursePackagePaymentConfigVo.getPaymentPrice()<coursePackagePaymentConfigVo.getVipPrice()){ |
| | | coursePackagePaymentConfigVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | coursePackagePaymentConfigVo.setVipPrice(null); |
| | | } |
| | | |
| | | } |
| | | else{ |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | | } |
| | | coursePackagePaymentConfigVo.setPaymentPrice(vipPrice); |
| | | coursePackagePaymentConfigVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | } |
| | | |
| | | |
| | | |
| | | // } |
| | | // else{ |
| | | // List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | // .eq("type", 1).eq("auditStatus", 2)); |
| | | // Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | // for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | // Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | // if(vipPrice.compareTo(num1) > 0){ |
| | | // vipPrice = num1; |
| | | // } |
| | | // } |
| | | // coursePackagePaymentConfigVo.setPaymentPrice(vipPrice); |
| | | // coursePackagePaymentConfigVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | // } |
| | | list.add(coursePackagePaymentConfigVo); |
| | | }); |
| | | coursePackageInfo.setList(list); |
| | |
| | | } |
| | | price = new BigDecimal(price).subtract(new BigDecimal(num1)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | userCoupon.setStatus(2); |
| | | userCouponClient.edit(userCoupon); |
| | | |
| | | } |
| | | |
| | | if(paymentCourseVo.getPayType() == 1){//微信支付 |
| | |
| | | // coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | // coursePackagePaymentServiceOne.setTotalClassHours(coursePackagePaymentServiceOne.getTotalClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePaymentServiceOne.setLaveClassHours(coursePackagePaymentServiceOne.getLaveClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePaymentServiceOne.setCode(code); |
| | | coursePackagePaymentServiceOne.setCode(code); |
| | | // |
| | | // coursePackagePaymentServiceOne.setAppUserId(null); |
| | | coursePackagePaymentServiceOne.setPayStatus(2); |
| | | coursePackagePaymentServiceOne.setSalesName("续课"); |
| | | coursePackagePaymentServiceOne.setAppUserId(null); |
| | | // coursePackagePaymentServiceOne.setPayStatus(2); |
| | | // coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | // |
| | | // Integer sId = null; |
| | | // Student student = studentClient.queryDefaultStudent(uid); |
| | |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Thread.sleep(1000); |
| | | |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10){ |
| | |
| | | Thread.sleep(wait); |
| | | List<TCoursePackagePayment> list = coursePackagePaymentService.list(new QueryWrapper<TCoursePackagePayment>().eq("state", 1).eq("code", code).eq("payType", 2)); |
| | | TCoursePackagePayment one = list.get(0); |
| | | AlipayTradeQueryResponse alipayTradeQueryResponse = payMoneyUtil.queryALIOrder(code); |
| | | if(one.getPayStatus() == 2){ |
| | | break; |
| | | } |
| | | AlipayTradeQueryResponse alipayTradeQueryResponse = payMoneyUtil.queryALIOrder(code); |
| | | |
| | | if( one.getPayStatus() == 1){ |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | |
| | | String tradeNo = alipayTradeQueryResponse.getTradeNo(); |
| | | if("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | if (coursePackagePayment.getStudentName()!=null){ |
| | | if (coursePackagePayment.getStudentName().equals("续课")){ |
| | | coursePackagePayment.setPayStatus(2); |
| | | } |
| | | } |
| | | |
| | | coursePackagePayment.setStatus(3); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | |
| | | if (count == can) { |
| | | break; |
| | | } |
| | | int wei = DateUtil.dayOfWeek(date); |
| | | int wei = DateUtil.dayOfWeek(date)-1; |
| | | if (week.contains(wei)) { |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | if (count == can) { |