| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.domain.Person; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | |
| | | recordVo.setUserId(appUserId); |
| | | recordVo.setSiteId(coursePackage.getSiteId()); |
| | | List<Integer> ids = getIds(coursePackage.getSiteId()); |
| | | recordVo.setIds(ids); |
| | | |
| | | recordVo.setCoursePackageName(coursePackage.getName()); |
| | | recordVo.setCourseHours(tCoursePackagePayment.getClassHours()); |
| | | Date date = DateUtil.getDate(); |
| | |
| | | } |
| | | return recordVoList; |
| | | } |
| | | public List<Integer> getIds(Integer siteId) { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/get_space_area?space_id=" + siteId); |
| | | HttpResponse execute = httpRequest.execute(); |
| | | String body = execute.body(); |
| | | JSONObject jsonObject = JSONObject.parseObject(body); |
| | | Object data = jsonObject.get("data"); |
| | | JSONArray array = JSONArray.parseArray(data.toString()); |
| | | List<Integer> ids =new ArrayList<>(); |
| | | for (Object o : array) { |
| | | JSONObject jsonObject1 = JSONObject.parseObject(o.toString()); |
| | | Object id = jsonObject1.get("id"); |
| | | Integer integer = Integer.valueOf(id.toString()); |
| | | ids.add(integer); |
| | | } |
| | | return ids; |
| | | |
| | | } |
| | | @Override |
| | | public ResultUtil insertVipPaymentCallback(String code, String orderNumber) { |
| | | TCoursePackagePayment coursePackagePayment = this.baseMapper.getCoursePackagePaymentByCode(code); |