From 7865a1010be2f95faab151d99ecdb095f44c2a08 Mon Sep 17 00:00:00 2001
From: lisy <linlangsur163@163.com>
Date: 星期五, 14 七月 2023 16:30:34 +0800
Subject: [PATCH] 修复了积分商城详情页面的门店列表查询;兑换支付todo

---
 cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
index 26c9023..898ee0c 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
@@ -14,6 +14,7 @@
 import com.dsh.activity.service.*;
 import com.dsh.activity.util.GDMapGeocodingUtil;
 import com.dsh.activity.util.StrUtils;
+import com.dsh.activity.util.TokenUtil;
 import com.dsh.activity.util.ToolUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -23,6 +24,7 @@
 
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("")
@@ -58,6 +60,9 @@
 
     @Autowired
     private CouponStoreService cstoreService;
+
+    @Autowired
+    private TokenUtil tokenUtil;
 
 
     @PostMapping("/base/pointMerchars/convertGoods")
@@ -121,7 +126,7 @@
         switch (detailRequest.getGoodsType()){
             case 2:
 //                课包
-                CoursePackage coursePackage = cpClient.queryCoursePackageById(detailRequest.getGoodId());
+                CoursePackage coursePackage = cpClient.queryCoursePackageById(merchandise.getCoursePackageId());
 
                 detailsVo.setGoodId(coursePackage.getId());
                 List<String> list1 = Arrays.asList(StrUtils.splitStr2StrArr(coursePackage.getDetailDrawing(), ","));
@@ -144,16 +149,21 @@
                 detailsVo.setResidueNum(merchandise.getQuantityIssued() - coursePackageNums);
                 detailsVo.setPerLimit(merchandise.getPickUpQuantity());
                 if (merchandise.getRedemptionMethod() == 1){
+                    detailsVo.setExchangeType(1);
                     detailsVo.setRequiredType(merchandise.getIntegral() + "积分");
                 }else {
+                    detailsVo.setExchangeType(2);
                     detailsVo.setRequiredType(merchandise.getIntegral() + "积分+¥"+merchandise.getCash());
                 }
                 detailsVo.setCost(merchandise.getPrice());
                 if (merchandise.getUseScope() == 1){
+                    detailsVo.setExchangeAddrType(1);
                     detailsVo.setBelongs("全国通用");
                 }else if (merchandise.getUseScope() == 2){
+                    detailsVo.setExchangeAddrType(2);
                     detailsVo.setBelongs(merchandise.getProvince()+"|"+merchandise.getCity() + "用户可用");
                 }else {
+                    detailsVo.setExchangeAddrType(3);
                     List<PointsMerchandiseStore> list = pmdstoService.list(new QueryWrapper<PointsMerchandiseStore>()
                             .eq("pointsMerchandiseId",merchandise.getId() ));
                     PointsMerchandiseStore pointsMerchandiseStore = list.get(0);
@@ -394,4 +404,40 @@
         return detailsVo;
     }
 
+
+    @PostMapping("/base/pointMerchars/selectPointsMerchandiseById")
+    public PointsMerchandise selectPointsMerchandiseById(@RequestBody Integer speMercharsId){
+        return pmdsService.getById(speMercharsId);
+    }
+
+
+    @PostMapping("/base/pointMerchars/saveDetailsUserPointMercase")
+    public void saveDetailsUserPointMercase(@RequestBody UserPointsMerchandise merchandise){
+        upmseService.save(merchandise);
+    }
+
+
+    @PostMapping("/base/pointMerchars/updateDetailsUserPointMercase")
+    public void updateDetailsUserPointMercase(@RequestBody UserPointsMerchandise merchandise){
+        upmseService.updateById(merchandise);
+    }
+
+    @PostMapping("/base/pointMerchars/queryUserPointMerchaseByCode")
+    public List<UserPointsMerchandise> queryUserPointMerchaseByCode(@RequestBody String code){
+        return upmseService.list(new QueryWrapper<UserPointsMerchandise>()
+                .eq("code",code));
+    }
+
+
+    @PostMapping("/base/pointMerchars/queryStoreIdsOfMerchandise")
+    public List<Integer> queryPointMerStoreIds(@RequestBody Integer pointMerId){
+        List<Integer> storeIds = new ArrayList<>();
+        List<PointsMerchandiseStore> list = pmdstoService.list(new QueryWrapper<PointsMerchandiseStore>()
+                .eq("pointsMerchandiseId",pointMerId));
+        if (list.size() >  0){
+            storeIds = list.stream().map(PointsMerchandiseStore::getStoreId).collect(Collectors.toList());
+        }
+        return storeIds;
+    }
+
 }

--
Gitblit v1.7.1