...
|
...
|
@@ -163,6 +163,39 @@ public class CutDownPriceServiceImpl implements ICutDownPriceService { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Integer queryDoingCutPrice(CutPriceHelpUserRequestBO cutPriceHelpUserRequestBO) {
|
|
|
Integer activityId = cutPriceHelpUserRequestBO.getActivityId();
|
|
|
Integer productSkn = cutPriceHelpUserRequestBO.getProductSkn();
|
|
|
Integer userId = cutPriceHelpUserRequestBO.getUserId();
|
|
|
// 查询活动信息
|
|
|
CutDownPriceActivityBo activityBo = cutDownActivityService.queryActivityInfo(activityId);
|
|
|
checkValidActivity(activityBo, activityId);
|
|
|
// 查询商品配置信息
|
|
|
CutDownPriceProductBo cutDownPriceProductBo = cutDownPriceProductService.queryCutDownPriceProductBo(activityId, productSkn);
|
|
|
if(cutDownPriceProductBo==null){
|
|
|
logger.warn(" the cutdown product not exist, activityId is {}, productSkn is {}", activityId, productSkn);
|
|
|
throw new ServiceException(ServiceError.ACTIVITY_CUTDOWNPRICE_PRODUCT_NOTEXIST_ERROR);
|
|
|
}
|
|
|
Integer result = CutPriceConstant.NOT_EXIST_DOING_CUT;
|
|
|
// 组装信息
|
|
|
CutDownPriceActivityProductBo bo = buildCutDownPriceActivityProductBo(activityBo, cutDownPriceProductBo, null, null);
|
|
|
CutDownPriceUserRecord record = cutDownPriceUserRecordMapper.selectCutDownPriceUserRecord(userId, cutPriceHelpUserRequestBO.getActivityId(), cutPriceHelpUserRequestBO.getProductSkn());
|
|
|
if(record!=null){
|
|
|
bo.setCanUseCount(record.getUseCount());
|
|
|
bo.setHasJoinNum(record.getHelpCount());
|
|
|
bo.setCreateTime(record.getCreateTime());
|
|
|
buildCutStatus(bo);
|
|
|
if(bo.getCutStatus()==CutPriceConstant.CUT_STATUS_EXPIRE){
|
|
|
result = CutPriceConstant.NOT_EXIST_DOING_CUT;
|
|
|
}else if(bo.getCutStatus()==CutPriceConstant.CUT_STATUS_ONGOING || bo.getCutStatus()==CutPriceConstant.CUT_STATUS_SUCCESS){
|
|
|
result = CutPriceConstant.EXIST_DOING_CUT;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public CutDownPriceActivityProductBo queryCutProductInfoForOrder(CutPriceHelpUserRequestBO cutPriceHelpUserRequestBO) {
|
|
|
Integer activityId = cutPriceHelpUserRequestBO.getActivityId();
|
|
|
Integer productSkn = cutPriceHelpUserRequestBO.getProductSkn();
|
...
|
...
|
|