...
|
...
|
@@ -167,6 +167,11 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_PRODUCT_NOTEXIST_ERROR);
|
|
|
}
|
|
|
CutDownPriceUserRecord record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, activityId, productSkn);
|
|
|
if(record==null){
|
|
|
logger.warn(" you have not create cutprice, activityId is {}, productSkn is {}", activityId, productSkn);
|
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_YOU_HASNOT_CREATE_CUTDOWN_ERROR);
|
|
|
}
|
|
|
|
|
|
// 组装信息
|
|
|
CutDownPriceActivityProductBo bo = buildCutDownPriceActivityProductBo(activityBo, cutDownPriceProductBo, null, null);
|
|
|
if(record!=null){
|
...
|
...
|
@@ -175,6 +180,22 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
// 设置已砍价记录
|
|
|
bo.setHasJoinNum(record.getHelpCount());
|
|
|
}
|
|
|
|
|
|
// 校验是否已经砍价成功
|
|
|
if(bo.getHasJoinNum()<bo.getJoinNum()){
|
|
|
logger.warn(" you have not cutdown success, params is {}", cutPriceHelpUserRequestBO);
|
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_YOU_HASNOT_CUTDOWN_SUCCESS_ERROR);
|
|
|
}
|
|
|
// 用户发起砍价成功后,24小时未付款,则取消
|
|
|
if(record.getCutTime()+24*3600 < DateUtils.getCurrentTimeSecond()){
|
|
|
logger.warn(" you create cutprice has expired, activityId is {}, productSkn is {}", activityId, productSkn);
|
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_CREATE_HAS_EXPIRED_ERROR);
|
|
|
}
|
|
|
// 校验是否已经使用过
|
|
|
if(bo.getCanUseCount()==0){
|
|
|
logger.warn(" you have used this cutdown, params is {}", cutPriceHelpUserRequestBO);
|
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_YOU_HAS_USED_CUTDOWNORDER_ERROR);
|
|
|
}
|
|
|
return bo;
|
|
|
}
|
|
|
|
...
|
...
|
|