| | |
| | | } |
| | | 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").orderByDesc("insertTime")); |
| | | .last(" and now() between startTime and endTime order by insertTime desc")); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (Coupon coupon : list) { |
| | | CouponListVo couponListVo = new CouponListVo(); |
| | |
| | | if (coupon.getType() == 1) {//满减{"num1":1,"num2":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition("满" + jsonObject.getDouble("num1") + "元可用"); |
| | | couponListVo.setFavorable(jsonObject.getDouble("num2") + "元"); |
| | | couponListVo.setFavorable(jsonObject.getString("num2")); |
| | | } |
| | | if (coupon.getType() == 2) {//代金券{"num1":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition(""); |
| | | couponListVo.setFavorable(jsonObject.getDouble("num1") + "元"); |
| | | couponListVo.setFavorable(jsonObject.getString("num1")); |
| | | } |
| | | if (coupon.getType() == 3) {//体验券{"num1":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |