...
|
...
|
@@ -50,7 +50,7 @@ import java.util.stream.Collectors; |
|
|
public class CutDownPriceServiceImpl implements ICutDownPriceService {
|
|
|
private static Logger logger = LoggerFactory.getLogger("cutPriceLog");
|
|
|
private static final Integer SYSTEM_HELP_ID = 0;
|
|
|
private static final Integer MAX_HELP_COUNT = 300;
|
|
|
private static final Integer MAX_HELP_COUNT = 30;
|
|
|
private static final Integer TIME_24_HOUR = 24*3600;
|
|
|
|
|
|
private static final String SYSTEM_HELP_NAME = "有货";
|
...
|
...
|
@@ -350,10 +350,9 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
String userImgUrl = cutPriceHelpUserRequestBO.getUserImgUrl();
|
|
|
String helpUserName = cutPriceHelpUserRequestBO.getHelpUserName();
|
|
|
String helpUserImgUrl = cutPriceHelpUserRequestBO.getHelpUserImgUrl();
|
|
|
|
|
|
int startTime = DateUtils.getTodayZero();
|
|
|
// 每位用户每天最多可以帮好友砍3次价
|
|
|
if(!SYSTEM_HELP_ID.equals(helpUserId)){
|
|
|
int startTime = DateUtils.getTodayZero();
|
|
|
int endTime = DateUtils.getTodayEnd();
|
|
|
List<CutDownPriceProductHelpUser> existHelpUsers = cutPriceUserHelpMapper.selectHelpInfoListCurrentDay(helpUserId, startTime, endTime);
|
|
|
if(CollectionUtils.isNotEmpty(existHelpUsers) && existHelpUsers.size() >= MAX_HELP_COUNT){
|
...
|
...
|
@@ -383,9 +382,9 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_HAS_HELPED_FULL_ERROR);
|
|
|
}
|
|
|
|
|
|
//判断用户是否已经针对该skn帮助砍价
|
|
|
//判断用户是否已经针对该skn帮助砍价,当天24小时内只能帮砍一次
|
|
|
if(!SYSTEM_HELP_ID.equals(helpUserId)){
|
|
|
Integer count = cutPriceUserHelpMapper.selectExistHelpInfo(helpUserId, activityId, productSkn, recordDb.getId());
|
|
|
Integer count = cutPriceUserHelpMapper.selectExistHelpInfo(helpUserId, activityId, productSkn, startTime);
|
|
|
if (count>0){
|
|
|
logger.warn(" you have help only one time, activityId is {}, productSkn is {}, helpUserId is {}", activityId, productSkn, helpUserId);
|
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_YOU_HAS_HELPED_ERROR);
|
...
|
...
|
|