From f0f6bd6f7499d1fa737f705091337befb98f5112 Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期四, 28 九月 2023 18:33:31 +0800
Subject: [PATCH] 后台

---
 cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java b/cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java
index bd53a3d..5057fec 100644
--- a/cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java
+++ b/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;
@@ -41,6 +44,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
 import org.springframework.web.client.RestTemplate;
 
 import javax.annotation.Resource;
@@ -131,6 +135,22 @@
             list.add(value);
         }
         return cpConfigMapper.changeState(list,dto.getPayUserName(),dto.getUserId());
+    }
+
+    @Override
+    public void updateBytime(TCoursePackagePayment coursePackagePayment) {
+        this.baseMapper.updateBytime(coursePackagePayment);
+    }
+
+    @Override
+    public List<RegisterOrderVO> listAllRegister(RegisterOrderQuery query) {
+        String STime = null;
+        String ETime = null;
+        if (StringUtils.hasLength(query.getRegisterTime())) {
+            STime = query.getRegisterTime().split(" - ")[0] + " 00:00:00";
+            ETime = query.getRegisterTime().split(" - ")[1] + " 23:59:59";
+        }
+        return cpConfigMapper.listAllRegister(query,STime,ETime,query.getAmount());
     }
 
     /**
@@ -625,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();
@@ -680,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);
@@ -991,9 +1033,10 @@
                     student1.setCoursePackageId(tCoursePackage.getId());
                     student1.setCoursePackagePaymentId(tCoursePackagePayment1.getId());
                     student1.setCoursePackageSchedulingId(coursePackageScheduling.getId());
-                    student1.setSignInOrNot(0);
+                    student1.setSignInOrNot(1);
                     student1.setReservationStatus(1);
                     student1.setInsertTime(new Date());
+                    student1.setType(1);
                     cpsMapper.insert(student1);
                 } catch (Exception e) {
                     e.printStackTrace();

--
Gitblit v1.7.1