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