From ef96dbc9278ebae4af204cca9de98c63f0d6328e Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期三, 20 九月 2023 19:16:21 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai

---
 cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java
index c2e3036..3f62769 100644
--- a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java
+++ b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java
@@ -12,6 +12,7 @@
 import com.dsh.competition.feignclient.account.model.Student;
 import com.dsh.competition.feignclient.course.CoursePackagePaymentClient;
 import com.dsh.competition.feignclient.course.model.PaymentDeductionClassHour;
+import com.dsh.competition.feignclient.model.BillingRequest;
 import com.dsh.competition.feignclient.other.StoreClient;
 import com.dsh.competition.feignclient.other.model.Store;
 import com.dsh.competition.mapper.PaymentCompetitionMapper;
@@ -81,7 +82,10 @@
      */
     @Override
     public List<CompetitionListVo> queryMyCompetitionList(Integer uid, Integer type, Integer pageSize, Integer pageNo) throws Exception {
-        pageSize = (pageSize - 1) * pageNo;
+        pageNo = (pageNo - 1) * pageSize;
+        if(0 == type){
+            type = null;
+        }
         return this.baseMapper.queryMyCompetitionList(uid, type, pageSize, pageNo);
     }
 
@@ -102,7 +106,7 @@
         competitionInfo.setImgs(competition.getImgs());
         competitionInfo.setName(competition.getName());
         competitionInfo.setRegisterCondition(competition.getRegisterCondition());
-        Store store = storeClient.queryStoreById(competition.getStoreId());
+        Store store = storeClient.queryStoreById(Integer.valueOf(competition.getStoreId().split(",")[0]));
         competitionInfo.setStoreName(store.getName());
         competitionInfo.setStoreAddress(store.getAddress());
         competitionInfo.setStoreLon(store.getLon());
@@ -115,8 +119,9 @@
         competitionInfo.setProvince(competition.getEntryProvince());
         competitionInfo.setCity(competition.getEntryCity());
         competitionInfo.setAddress(competition.getEntryAddress());
-        competitionInfo.setPayType(competition.getPayType());
-        competitionInfo.setPrice(competition.getPrice().doubleValue());
+        competitionInfo.setCashPrice(competition.getCashPrice());
+        competitionInfo.setPlayPaiCoin(competition.getPlayPaiCoin());
+        competitionInfo.setClassPrice(competition.getClassPrice());
         competitionInfo.setIntroduction(competition.getIntroduction());
         competitionInfo.setRegistrationNotes(competition.getRegistrationNotes());
         competitionInfo.setApply(1);
@@ -139,6 +144,8 @@
         if(paymentCompetition.getPayStatus() == 3){
             competitionInfo.setStatus(4);
         }
+        competitionInfo.setPayMoney(paymentCompetition.getAmount());
+        competitionInfo.setPayType(paymentCompetition.getPayType());
         return competitionInfo;
     }
 
@@ -183,6 +190,7 @@
             paymentCompetition.setRefundOrderNo(refund_id);
             paymentCompetition.setRefundTime(new Date());
             paymentCompetition.setPayStatus(3);
+            paymentCompetition.setAppUserId(null);
             this.updateById(paymentCompetition);
 
             competition.setApplicantsNumber(competition.getApplicantsNumber() - 1);
@@ -196,6 +204,7 @@
             paymentCompetition.setRefundOrderNo("");
             paymentCompetition.setRefundTime(new Date());
             paymentCompetition.setPayStatus(3);
+            paymentCompetition.setAppUserId(null);
             this.updateById(paymentCompetition);
 
             competition.setApplicantsNumber(competition.getApplicantsNumber() - 1);
@@ -208,7 +217,7 @@
                 Student student = studentClient.queryStudentByPhone(participant.getPhone());
                 PaymentDeductionClassHour paymentDeductionClassHour = new PaymentDeductionClassHour();
                 paymentDeductionClassHour.setId(student.getId());
-                paymentDeductionClassHour.setClassHour(competition.getPrice().intValue());
+                paymentDeductionClassHour.setClassHour(competition.getClassPrice());
                 paymentDeductionClassHour.setCode(code);
                 coursePackagePaymentClient.rollbackPaymentDeductionClassHour(paymentDeductionClassHour);
             }
@@ -216,6 +225,7 @@
             paymentCompetition.setRefundOrderNo("");
             paymentCompetition.setRefundTime(new Date());
             paymentCompetition.setPayStatus(3);
+            paymentCompetition.setAppUserId(null);
             this.updateById(paymentCompetition);
 
             competition.setApplicantsNumber(competition.getApplicantsNumber() - 1);
@@ -223,4 +233,14 @@
         }
         return ResultUtil.success();
     }
+
+    @Override
+    public List<BillingRequest> queryDatas(Integer appUserId, String monthStart, String monthEnd) {
+        return this.baseMapper.queryDatas(appUserId,monthStart,monthEnd);
+    }
+
+    @Override
+    public List<BillingRequest> queryCancelDatas(Integer appUserId, String monthStart, String monthEnd) {
+        return this.baseMapper.queryCancelDatas(appUserId,monthStart,monthEnd);
+    }
 }

--
Gitblit v1.7.1