Authored by wangshusheng

砍价状态

@@ -2,9 +2,11 @@ package com.yoho.activity.queue.constant; @@ -2,9 +2,11 @@ package com.yoho.activity.queue.constant;
2 2
3 3
4 public class CutPriceConstant { 4 public class CutPriceConstant {
5 - // 1:砍价中 2:已成功 3:已失效 4:已结束 5 + // 1:砍价中 2:已成功 3:已失效(活动已过期、发起砍价24小时未成功、砍价成功后24小时内未下单)
6 public static final Integer CUT_STATUS_ONGOING = 1; 6 public static final Integer CUT_STATUS_ONGOING = 1;
7 public static final Integer CUT_STATUS_SUCCESS = 2; 7 public static final Integer CUT_STATUS_SUCCESS = 2;
8 public static final Integer CUT_STATUS_EXPIRE = 3; 8 public static final Integer CUT_STATUS_EXPIRE = 3;
9 public static final Integer CUT_STATUS_END = 4; 9 public static final Integer CUT_STATUS_END = 4;
  10 +
  11 +
10 } 12 }
@@ -635,20 +635,33 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { @@ -635,20 +635,33 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService {
635 private void buildCutStatus(CutDownPriceActivityProductBo bo) { 635 private void buildCutStatus(CutDownPriceActivityProductBo bo) {
636 int currentTime = DateUtils.getCurrentTimeSecond(); 636 int currentTime = DateUtils.getCurrentTimeSecond();
637 bo.setCurrentTime(currentTime); 637 bo.setCurrentTime(currentTime);
  638 + // 活动进行中、已结束
638 if(currentTime>bo.getEndTime()){ 639 if(currentTime>bo.getEndTime()){
639 // 活动已结束 640 // 活动已结束
640 - bo.setCutStatus(CutPriceConstant.CUT_STATUS_END); 641 + bo.setCutStatus(CutPriceConstant.CUT_STATUS_EXPIRE);
641 }else{ 642 }else{
642 // 活动进行中 643 // 活动进行中
  644 + // 砍价成功、失败
643 if(bo.getHasJoinNum() > bo.getJoinNum()){ 645 if(bo.getHasJoinNum() > bo.getJoinNum()){
644 // 砍价已成功 646 // 砍价已成功
645 - bo.setCutStatus(CutPriceConstant.CUT_STATUS_SUCCESS); 647 + // 是否24小时内下单
  648 + if(bo.getCanUseCount()>0 && (currentTime - bo.getCutTime()>TIME_24_HOUR)){//标识未下单
  649 + bo.setCutStatus(CutPriceConstant.CUT_STATUS_EXPIRE);
  650 + }else{
  651 + bo.setCutStatus(CutPriceConstant.CUT_STATUS_SUCCESS);
  652 + }
646 }else if(currentTime - bo.getCreateTime()>TIME_24_HOUR){ 653 }else if(currentTime - bo.getCreateTime()>TIME_24_HOUR){
647 - // 未成功,发起已超过24小时,已失效 654 + // 砍价未成功,发起已超过24小时,已失效
648 bo.setCutStatus(CutPriceConstant.CUT_STATUS_EXPIRE); 655 bo.setCutStatus(CutPriceConstant.CUT_STATUS_EXPIRE);
649 }else{ 656 }else{
650 // 未成功,发起24小时内,砍价中 657 // 未成功,发起24小时内,砍价中
651 bo.setCutStatus(CutPriceConstant.CUT_STATUS_ONGOING); 658 bo.setCutStatus(CutPriceConstant.CUT_STATUS_ONGOING);
  659 + // 砍价截止时间,发起砍价后24小时,或者活动截止时间
  660 + if(bo.getCreateTime()+TIME_24_HOUR > bo.getEndTime()){
  661 + bo.setCutEndTime(bo.getEndTime());
  662 + }else{
  663 + bo.setCutEndTime(bo.getCreateTime()+TIME_24_HOUR);
  664 + }
652 } 665 }
653 } 666 }
654 } 667 }