| | |
| | | } |
| | | case 2: |
| | | if (merchandise.getType() == 2) { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code,returnId); |
| | | } else { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code,returnId); |
| | | } |
| | | default: |
| | | break; |
| | |
| | | } |
| | | case 2: |
| | | if (merchandise.getType() == 2) { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code,returnId); |
| | | } else { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code,returnId); |
| | | } |
| | | default: |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | private ResultUtil AlipayPayment(BigDecimal cash, String code) { |
| | | private ResultUtil AlipayPayment(BigDecimal cash, String code,Long returnId) { |
| | | System.out.println("金额:"+cash); |
| | | ResultUtil alipay = payMoneyUtil.alipay("课包续费", "课包续费", "", code, cash.toString(), |
| | | ResultUtil alipay = payMoneyUtil.alipay("课包续费", "课包续费", String.valueOf(returnId), code, cash.toString(), |
| | | "/base/pointMer/exchangeGoodPaymentAliCallback"); |
| | | if(alipay.getCode() == 200){ |
| | | new Thread(new Runnable() { |
| | |
| | | AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderString", response.getBody()); |
| | | map.put("returnId",passbackParams); |
| | | System.out.println(map);//就是orderString 可以直接给客户端请求,无需再做处理。 |
| | | return ResultUtil.success(map); |
| | | } catch (AlipayApiException e) { |
| | |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryCouponByUser/{userId}") |
| | | public List<Integer> queryCouponByUser(@PathVariable("userId") Integer userId){ |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2) |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2).eq("userPopulation",2) |
| | | .le("startTime", new Date()).ge("endTime", new Date()).eq("auditStatus", 2) |
| | | .eq("state", 1)); |
| | | |
| | |
| | | |
| | | // Print the result |
| | | if (isSameDate) { |
| | | detailsResponse.setUseStatus(3); |
| | | |
| | | } else { |
| | | System.out.println("The two dates do not have the same date."); |
| | | detailsResponse.setUseStatus(3); |
| | | } |
| | | |
| | | |
| | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | if (students.size() > 0) { |
| | | userPopulation.add(3);//已有学员用户 |
| | | } |
| | | List<Coupon> list = this.list(new QueryWrapper<Coupon>().eq("distributionMethod", distributionMethod) |
| | | .in("userPopulation", userPopulation) |
| | | .eq("auditStatus", 2).eq("status", 2).eq("state", 1) |
| | | .last(" and now() between startTime and endTime order by insertTime desc")); |
| | | // List<Coupon> list = this.list(new QueryWrapper<Coupon>().eq("distributionMethod", distributionMethod) |
| | | // .in("userPopulation", userPopulation) |
| | | // .eq("auditStatus", 2).eq("status", 2).eq("state", 1) |
| | | // .last(" and now() between startTime and endTime order by insertTime desc")); |
| | | |
| | | |
| | | List<Coupon> list = this.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2).eq("userPopulation",2) |
| | | .le("startTime", new Date()).ge("endTime", new Date()).eq("auditStatus", 2) |
| | | .eq("state", 1)); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (Coupon coupon : list) { |
| | | CouponListVo couponListVo = new CouponListVo(); |