yujian
2019-08-23 801418bedca56d718c851d0c927d56cc89e89211
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -228,9 +228,16 @@
         stateActivated = 0;
      }
      Integer expiryDay = null;
      if (stateActivated == 0)
         expiryDay = coupon.getActivateDay();
      if (expiryDay == null || expiryDay == 0)
         expiryDay = coupon.getExpiryDay();
      // 结束日期
      // 今天在内  减去一天
      String endDay = DateUtil.plusDay(coupon.getExpiryDay() - 1, new Date());
      String endDay = DateUtil.plusDay(expiryDay - 1, new Date());
      SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
      Date endTime = format.parse(endDay);
@@ -1662,9 +1669,18 @@
      } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name() && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
         stateActivated = 0;  // 无下级队员 --待激活
      } 
      Integer expiryDay = null;
      if (stateActivated == 0)
         expiryDay = coupon.getActivateDay();
      if (expiryDay == null || expiryDay == 0)
         expiryDay = coupon.getExpiryDay();
      //  计算结束日期:今天在内  减去一天
      String endDay = DateUtil.plusDay(coupon.getExpiryDay() - 1, new Date());
      String endDay = DateUtil.plusDay(expiryDay - 1, new Date());
      SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
      Date endTime = format.parse(endDay);
@@ -1791,6 +1807,8 @@
            give = false;
         }
         
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
         if (UserSystemCoupon.STATE_CAN_USE == state) {
            Map<String, Object> jumpLink = new HashMap<String, Object>();
            if (CouponTypeEnum.freeCouponGive == type) {
@@ -1847,7 +1865,6 @@
                  }
               } 
            } 
         } else if (give && UserSystemCoupon.STATE_END_USE == state) {
            userCouponVO.setCouponRule(systemCoupon.getRemark());
            if (CouponTypeEnum.freeCouponGive == type) {
@@ -1857,8 +1874,24 @@
            if (CouponTypeEnum.rebatePercentCoupon == type) {
               userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END);
            }
         }else if (give && UserSystemCoupon.STATE_OVERDUE == state) {
            userCouponVO.setCouponRule(systemCoupon.getRemark());
            Date useTime = userCouponVO.getUseTime();
            if (useTime != null) {
               Map<String, Object> remainDays = new HashMap<String, Object>();
               remainDays.put("content", "于" + sdf.format(useTime) + "成功赠送");
               remainDays.put("fontColor", "#999999");
               userCouponVO.setRemainDays(remainDays);
            }
         }else if (UserSystemCoupon.STATE_OVERDUE == state) {
            if (endTime != null) {
               Map<String, Object> remainDays = new HashMap<String, Object>();
               remainDays.put("content", "于" + sdf.format(endTime) + "过期");
               remainDays.put("fontColor", "#999999");
               userCouponVO.setRemainDays(remainDays);
            }
            if(give)
               userCouponVO.setCouponRule(systemCoupon.getRemark());
         }
         userCouponVO.setJumpBtn(jumpBtn);
      }