Browse Source

14

master
zhouliwu 3 months ago
parent
commit
079386d8d2

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

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

Loading…
Cancel
Save