| | |
| | | @PostMapping("/base/appUser/addVipPaymentAliCallback") |
| | | public void addVipPaymentAliCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | System.err.println("==============购买优惠卷回调========="); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if (null != map) { |
| | | String out_trade_no = map.get("out_trade_no"); |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("/payment/callback") |
| | | @RequestMapping("") |
| | | public class PaymentCallbackController { |
| | | |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMer/exchangeGoodPaymentAliCallback") |
| | | public void addVipPaymentAliCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | public void exchangeGoodPaymentAliCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if (null != map) { |
| | |
| | | } |
| | | |
| | | private ResultUtil AlipayPayment(BigDecimal cash, String code, Long returnId) { |
| | | System.out.println("金额:" + cash); |
| | | ResultUtil alipay = payMoneyUtil.alipay("优惠卷", "优惠卷", String.valueOf(returnId), code, cash.toString(), |
| | | "/base/pointMer/exchangeGoodPaymentAliCallback"); |
| | | if (alipay.getCode() == 200) { |
| | |
| | | |
| | | List<UserPointsMerchandise> userPointsMerchandises = merChandiseClient.queryUserPointMerchaseByCode(outNum); |
| | | // PaymentCompetition code = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", outNum)); |
| | | if(userPointsMerchandises.size() > 0){ |
| | | Integer storeId = userPointsMerchandises.get(0).getStoreId(); |
| | | |
| | | // Competition byId1 = competitionService.getById(code.getCompetitionId()); |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private ResultUtil WechatPayment(BigDecimal cash, String code) throws Exception { |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("课包", "", code, cash.toString(), |
| | |
| | | AlipayTradeQueryResponse resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | |
| | | if (resultUtil.getCode().equals("10000")) { |
| | | // Map<String, String> map = resultUtil.getData(); |
| | | // String tradeStatus = map.get("tradeStatus"); |
| | | // String tradeNo = map.get("tradeNo"); |
| | | |
| | | String tradeNo = resultUtil.getTradeNo(); |
| | | String tradeStatus = resultUtil.getTradeStatus(); |
| | | System.out.println("ssssss" + tradeStatus); |
| | |
| | | VipPaymentServiceImpl.this.updateById(vipPayment1); |
| | | |
| | | TAppUser appUser = appUserService.getById(vipPayment1.getAppUserId()); |
| | | Date vipEndTime = appUser.getVipEndTime(); |
| | | if (null == vipEndTime) { |
| | | vipEndTime = new Date(); |
| | | } |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.setTime(vipEndTime); |
| | | calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1); |
| | | appUser.setIsVip(1); |
| | | appUser.setVipEndTime(calendar.getTime()); |
| | | appUserService.updateById(appUser); |
| | | // 注册会员送券 先判断是否有注册送券类型的优惠券 判断优惠券状态 审核是否通过 是否删除 是否在有效期内 是否领取数量达上限 |
| | |
| | | |
| | | private String key = "";//微信商户号 |
| | | |
| | | private String callbackPath = "8.137.22.229:56666/account";//支付回调网关地址 |
| | | private String callbackPath = "http://221.182.45.100:56666/account";//支付回调网关地址 |
| | | |
| | | private String app_cert_path = "C:/cert/alipay/user/app_cert_path.crt";//应用公钥证书路径 |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>().in("id", cIds) |
| | | QueryWrapper<PointsMerchandise> wrapper = new QueryWrapper<PointsMerchandise>() |
| | | .eq("state", 1) |
| | | .eq("shelves", 1) |
| | | .gt("endTime", new Date()).last("ORDER BY sort desc,insertTime desc")); |
| | | .gt("endTime", new Date()); |
| | | if(cIds.size() > 0){ |
| | | wrapper.in("id", cIds); |
| | | } |
| | | List<PointsMerchandise> merchandises = pmdsService.list(wrapper.last("ORDER BY sort desc,insertTime desc")); |
| | | if (merchandises.size() > 0) { |
| | | for (PointsMerchandise merchandise : merchandises) { |
| | | IntegralCommodity integralCommodity = new IntegralCommodity(); |
| | |
| | | for (CouponStore couponStore : storeId) { |
| | | storeCoupons.add(couponStore.getCouponId()); |
| | | } |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().in("id", storeCoupons).eq("state", 1).gt("endTime", new Date()).last("ORDER BY insertTime desc")); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | QueryWrapper<Coupon> queryWrapper = new QueryWrapper<Coupon>().eq("state", 1).gt("endTime", sdf.format(new Date())); |
| | | if(storeCoupons.size() > 0){ |
| | | queryWrapper.in("id", storeCoupons); |
| | | } |
| | | List<Coupon> list = couponService.list(queryWrapper.last(" ORDER BY insertTime desc")); |
| | | if (!list.isEmpty()){ |
| | | for (Coupon coupon : list) { |
| | | IntegralCommodity integralCommodity = new IntegralCommodity(); |
| | |
| | | */ |
| | | @PostMapping("/base/coursePackage/alipayRegisteredCoursesCallback") |
| | | public void alipayCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | System.err.println("========支付宝支付回调========"); |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if (null != map) { |
| | |
| | | .in(CoursePackageScheduling::getCoursePackageId, collect) |
| | | ); |
| | | List<Integer> collect1 = list8.stream().map(CoursePackageScheduling::getCoursePackageId).collect(Collectors.toList()); |
| | | // // 找出购买的课包 |
| | | // List<CoursePackageOrderStudent> list1 = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | // .eq("appUserId", courseDetailReq.getAppUserId()) |
| | | // .eq("studentId", courseDetailReq.getStuId()) |
| | | // .in("coursePackageId", collect1) |
| | | // .eq("status", 1) |
| | | // .eq("state", 1) |
| | | // ); |
| | | |
| | | |
| | | |
| | | // List<Integer> collect1 = list1.stream().map(CoursePackageOrderStudent::getCoursePackageId).collect(Collectors.toList()); |
| | | // List<Long> ids = list1.stream().map(CoursePackageOrderStudent::getId).collect(Collectors.toList()); |
| | | |
| | | |
| | | for (TCoursePackage tCoursePackage : list) { |
| | | DetailsListVo detailsListVo = new DetailsListVo(); |
| | | detailsListVo.setId(tCoursePackage.getId()); |
| | |
| | | if (signInOrNot1 == 2) { |
| | | detailsListVo.setType(3); |
| | | } |
| | | //体验购课去掉按钮 |
| | | if(coursePackageScheduling.getType() == 3){ |
| | | detailsListVo.setCourseType(3); |
| | | detailsListVo.setType(2); |
| | | } |
| | | |
| | | |
| | | detailsListVo.setIsType(coursePackageStudent.getType()); |
| | | Date classDate = coursePackageScheduling.getClassDate(); |
| | | Date endDate = coursePackageScheduling.getEndDate(); |
| | |
| | | |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingService.selectById(queryCoursePackageStudentList.getCoursePackageSchedulingId()); |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingService.selectList(new QueryWrapper<CoursePackageScheduling>().eq("coursePackageId", coursePackageScheduling.getCoursePackageId()).eq("classDate", coursePackageScheduling.getClassDate())); |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingService.selectList(new QueryWrapper<CoursePackageScheduling>() |
| | | .eq("coursePackageId", coursePackageScheduling.getCoursePackageId()).eq("classDate", coursePackageScheduling.getClassDate())); |
| | | |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | |
| | | Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); |
| | | Integer student_Id = Integer.valueOf(map.get("studentId").toString()); |
| | | TAppUser appUser = appUserClient.queryAppUser1(appUserId); |
| | | Student student = studentClient.queryStudentById(student_Id); |
| | | if(null != appUser){ |
| | | map.put("userName", appUser.getName()); |
| | | map.put("phone", student.getPhone()); |
| | | map.put("phone", appUser.getPhone()); |
| | | } |
| | | Student student = studentClient.queryStudentById(student_Id); |
| | | if(null != student){ |
| | | map.put("studentName", student.getName()); |
| | | map.put("age", null != student.getBirthday() ? now - Integer.valueOf(sdf.format(student.getBirthday())) : "-"); |
| | | map.put("sex", student.getSex()); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | |
| | | //剩余课时 |
| | | Integer laveClassHours = coursePackageOrderStudent.getLaveClassHours(); |
| | | //扣除课时数 |
| | |
| | | continue; |
| | | } |
| | | |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= validity.getTime()) { |
| | | break; |
| | | } |
| | | |
| | | //检查是否有体验购课 |
| | | int count = coursePackageSchedulingService.count(new QueryWrapper<CoursePackageScheduling>() |
| | | .eq("type", 3) |
| | | .eq("appUserId", userId) |
| | | .eq("studentId", sId) |
| | | .eq("coursePackageId", tCoursePackage.getId()) |
| | | .eq("status", 1) |
| | | .eq("DATE_FORMAT(classDate, '%Y-%m-%d')", format.format(time)) |
| | | ); |
| | | //有体验购课,不进行排课 |
| | | if(count != 0){ |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | for (int j = 0; j < split.length; j++) { |
| | | //剩余数量不足以排课 |
| | | if (laveClassHours.compareTo(codeTime) < 0) { |
| | |
| | | |
| | | private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号 |
| | | |
| | | private String callbackPath = "http://221.182.45.100:56666/course";//支付回调网关地址 |
| | | private String callbackPath = "http://8.137.22.229:56666/course";//支付回调网关地址 |
| | | |
| | | private String app_cert_path = "C:/cert/alipay/user/app_cert_path.crt";//应用公钥证书路径 |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TStudentTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tStudent/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TStudent.openAddTStudent()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tStudent/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TStudent.openTStudentDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tStudent/info")){ |
| | | <#button name="查看详情" icon="fa-edit" clickFun="TStudent.openTStudentDetail1()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tStudent/comit")){ |
| | | <#button name="学员评语" icon="fa-edit" clickFun="TStudent.openTStudentDetail2()" space="true"/> |
| | | <#button name="修改" icon="fa-edit" clickFun="TStudent.openTStudentDetail()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tStudent/frozen")){ |
| | | <#button name="冻结" icon="fa-edit" clickFun="TStudent.editCoursePackageState(2)" space="true"/> |
| | |
| | | @if(shiro.hasPermission("/tStudent/frozen")){ |
| | | <#button name="解冻" icon="fa-edit" clickFun="TStudent.editCoursePackageState(1)" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tStudent/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TStudent.delete()" space="true"/> |
| | | @if(shiro.hasPermission("/tStudent/info")){ |
| | | <#button name="查看详情" icon="fa-edit" clickFun="TStudent.openTStudentDetail1()" space="true"/> |
| | | @} |
| | | <!-- <button id="exportButton">TTTTTTTTTT</button>--> |
| | | @if(shiro.hasPermission("/tStudent/comit")){ |
| | | <#button name="学员评语" icon="fa-edit" clickFun="TStudent.openTStudentDetail2()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TStudentTable"/> |
| | | </div> |