zhouliwu před 3 měsíci
rodič
revize
079386d8d2

+ 14
- 14
bhkj-delivery-module-backstage/src/main/java/com/bohuikeji/delivery/backstage/controller/api/customer/VoucherV2Api.java Zobrazit soubor

@@ -61,14 +61,14 @@ public class VoucherV2Api extends ApiController {
61 61
     @GetMapping("/customer/order/get")
62 62
     public APIEntity customerByOrderReceive(@RequestAttribute("JwtUserId") Integer id){
63 63
         List<TDiscountRecord> receiveRecords = new ArrayList<>(0);//receiveRecordService.list(new QueryWrapper<TDiscountRecord>().eq("customer_id",id).in("usage_status","未使用","使用中"));
64
-        /*if(receiveRecords.size()<1){
64
+        if(receiveRecords.size()<1){
65 65
             return APIEntity.success(receiveRecords);
66 66
         }
67 67
         for(TDiscountRecord receiveRecord : receiveRecords){
68 68
             if(LocalDate.now().isAfter(receiveRecord.getEndDate())){
69 69
                 receiveRecordService.updateById(receiveRecord.setUsageStatus("已过期"));
70 70
             }
71
-        }*/
71
+        }
72 72
         return APIEntity.success(receiveRecords);
73 73
     }
74 74
 
@@ -86,7 +86,7 @@ public class VoucherV2Api extends ApiController {
86 86
         if (StringUtils.isBlank(usageStatus)){
87 87
             return APIEntity.fail("查询参数为空!");
88 88
         }
89
-        /*List<TDiscountRecord> receiveRecords = receiveRecordService.list(new QueryWrapper<TDiscountRecord>().eq("customer_id",id));
89
+        List<TDiscountRecord> receiveRecords = receiveRecordService.list(new QueryWrapper<TDiscountRecord>().eq("customer_id",id));
90 90
         for(TDiscountRecord receiveRecord : receiveRecords){
91 91
             if(LocalDate.now().isAfter(receiveRecord.getEndDate())){
92 92
                 receiveRecordService.updateById(receiveRecord.setUsageStatus("已过期"));
@@ -102,9 +102,9 @@ public class VoucherV2Api extends ApiController {
102 102
                 return APIEntity.fail("无法识别参数usageStatus");
103 103
         }
104 104
         page = (DataPage) receiveRecordService.page(page,queryWrapper);
105
-        JSONArray tPatternCour = new JSONArray();
106
-        List<TDiscountRecord> tReceiveRecords = page.getRecords();*/
107
-        /*for(TDiscountRecord receiveRecord :tReceiveRecords){
105
+        /*JSONArray tPatternCour = new JSONArray();
106
+        List<TDiscountRecord> tReceiveRecords = page.getRecords();
107
+        for(TDiscountRecord receiveRecord :tReceiveRecords){
108 108
             TPatternInfo tPatternInfo = patternInfoService.getById(receiveRecord.getPatternId());
109 109
             receiveRecord.setPatternInfo(tPatternInfo);
110 110
             tPatternCour.add(receiveRecord);
@@ -120,14 +120,14 @@ public class VoucherV2Api extends ApiController {
120 120
 
121 121
     @ApiOperation("判断优惠卷是否弹框")
122 122
     @GetMapping("/get/voucher/bullet/frame/list")
123
-    public APIEntity getVoucherBulletFrame(@RequestAttribute("JwtUserId") Integer id) throws IOException {
123
+    public APIEntity getVoucherBulletFrame(@RequestAttribute("JwtUserId") Integer id) throws Exception {
124 124
         TCustomer tCustomer = customerService.getById(id);
125 125
         List<TDiscountMall> discountMalls;
126 126
         byte[] b = new byte[1024];
127 127
         if(tCustomer == null){
128 128
             return APIEntity.fail("当前用户不存在,请重新登陆");
129 129
         }
130
-        /*List<Object> couponIds = receiveRecordService.listObjs(new QueryWrapper<TDiscountRecord>().select("dis_id").eq("customer_id",id));
130
+        List<Object> couponIds = receiveRecordService.listObjs(new QueryWrapper<TDiscountRecord>().select("dis_id").eq("customer_id",id));
131 131
         if(couponIds.size()<1){
132 132
             discountMalls = createVoucherService.list(new QueryWrapper<TDiscountMall>().eq("dis_state","发放中").eq("receive_method","客户领取").eq("dis_mode","弹框"));
133 133
         }else {
@@ -136,8 +136,8 @@ public class VoucherV2Api extends ApiController {
136 136
 
137 137
         if(discountMalls.size()<1){
138 138
             return APIEntity.success();
139
-        }*/
140
-        /*log.info("获取弹框优惠卷的数量:[{}]",discountMalls.size());
139
+        }
140
+        log.info("获取弹框优惠卷的数量:[{}]",discountMalls.size());
141 141
         for(TDiscountMall discountMall : discountMalls){
142 142
             List<TDiscountRecord>  receiveRecords = receiveRecordService.list(new QueryWrapper<TDiscountRecord>().eq("dis_id",discountMall.getDisId()).eq("customer_id",id));
143 143
             if(receiveRecords.size()>1){
@@ -145,7 +145,7 @@ public class VoucherV2Api extends ApiController {
145 145
             }
146 146
             if(tCustomer.getTemplateId() != null && "商户卷".equals(discountMall.getGrantType())){
147 147
                 log.info("进入商户卷弹框");
148
-                return APIEntity.success(discountConst.frameTemplate(discountMall));
148
+                return APIEntity.success(discountConst.frameTemplate(discountMall,null));
149 149
             }
150 150
             List<TOrder> orderList = orderService.list(new QueryWrapper<TOrder>().eq("order_status","已完成").eq("player_id",tCustomer.getCustomerId()));
151 151
             log.info("当前客户的id:{},下单数量:{}",tCustomer.getCustomerId(),orderList.size());
@@ -155,13 +155,13 @@ public class VoucherV2Api extends ApiController {
155 155
             }
156 156
             if(orderList.size()>1 && "老客户卷".equals(discountMall.getGrantType())){
157 157
                 log.info("进入老客户卷弹框");
158
-                return APIEntity.success(discountConst.frameTemplate(discountMall));
158
+                return APIEntity.success(discountConst.frameTemplate(discountMall,null));
159 159
             }
160 160
             if("全部".equals(discountMall.getGrantType()) && tCustomer.getTemplateId()==null){
161 161
                 log.info("进入全部卷弹框");
162
-                return APIEntity.success(discountConst.frameTemplate(discountMall));
162
+                return APIEntity.success(discountConst.frameTemplate(discountMall,null));
163 163
             }
164
-        }*/
164
+        }
165 165
         return APIEntity.success();
166 166
     }
167 167
 /**

Načítá se…
Zrušit
Uložit