liujie
2023-09-28 f0f6bd6f7499d1fa737f705091337befb98f5112
cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java
@@ -1,6 +1,9 @@
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;
@@ -642,6 +645,12 @@
                        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();
@@ -697,7 +706,23 @@
        }
        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);