From 33bfa1b3d03236922cc95b9435d7d10c91e8c4e5 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期四, 22 八月 2019 09:22:59 +0800 Subject: [PATCH] 明细 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java index 0a0f0a6..43b17bc 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java @@ -1266,7 +1266,6 @@ userSystemCouponRecordService.updateByPrimaryKeySelective(couponRecord); UserSystemCoupon userSystemCoupon = couponRecord.getUserSystemCoupon(); - // 鐘舵�佸垵濮嬪寲 userSystemCoupon.setState(UserSystemCoupon.STATE_CAN_USE); userSystemCoupon.setUseTime(null); @@ -1367,8 +1366,10 @@ Date now = new Date(); Date endTime = userCoupon.getEndTime(); if (endTime != null && endTime.getTime() < now.getTime()) { - - // TODO 杩囨湡 + // 杩囨湡 + List<UserSystemCoupon> list = new ArrayList<UserSystemCoupon>(); + list.add(userCoupon); + updateCounponInvalid(list); return; } @@ -1730,7 +1731,7 @@ userCouponVO.setCouponPicture(systemCoupon.getPicture()); } - if (UserSystemCoupon.STATE_CAN_USE == state) { + if (UserSystemCoupon.STATE_CAN_USE == state || UserSystemCoupon.STATE_IN_USE == state) { int differentDays = 0; if (endTime != null && startTime != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @@ -1830,12 +1831,19 @@ } tips = tips.replace("{鍙d护}", tokenRecord.getToken()).replace("{涓嬭浇閾炬帴}", configService.get("app_down_link")); } + + Date endTimeGive = record.getEndTime(); + if (endTimeGive != null) { + Map<String, Object> remainDays = new HashMap<String, Object>(); + remainDays.put("content", "鍓╀綑" + DateUtil.dateDiff2(new Date(), endTimeGive) + "杩囨湡"); + remainDays.put("fontColor", "#F14242"); + userCouponVO.setRemainDays(remainDays); + } } } else { tips = ""; } userCouponVO.setGiveTips(tips); - } else if (UserSystemCoupon.STATE_END_USE == state) { if (give && CouponTypeEnum.freeCouponGive == type) { userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END); @@ -1983,8 +1991,9 @@ Date now = new Date(); Date endTime = userCoupon.getEndTime(); if (endTime != null && endTime.getTime() < now.getTime()) { - - // TODO 杩囨湡 + List<UserSystemCoupon> list = new ArrayList<UserSystemCoupon>(); + list.add(userCoupon); + updateCounponInvalid(list); continue; } -- Gitblit v1.8.0