admin
2019-08-23 d1bcc87e41d8d176ce58ee9e27a17ec93d0d7cb2
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("{口令}", 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;
         }