|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.SceneConstant;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.ucenter.common.PageInfo;
|
|
@@ -95,32 +96,32 @@ public class IncrementOrderServiceImpl extends ServiceImpl<IIncrementOrderMapper
|
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
|
}
|
|
|
// 5 专业会员,6 下载 , 7 高级会员
|
|
|
- if(param.getDateType() != 5 && param.getDateType() != 6 && param.getDateType() !=7){
|
|
|
+ if(param.getDateType() != 6 && param.getIncrementTypeId() == null){
|
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5012, SceneConstant.FAILURE_MSG_5012);
|
|
|
}
|
|
|
- return getGoodsSkuVo(param.getDateType(), param.getUserIncrementId(),param.getMonthQy());
|
|
|
+ return getGoodsSkuVo(param.getDateType(), param.getUserIncrementId(),param.getMonthQy(),param.getIncrementTypeId());
|
|
|
|
|
|
}
|
|
|
|
|
|
- private GoodsSkuVo getGoodsSkuVo (Integer dateType,Integer userIncrementId,Integer monthDy){
|
|
|
+ private GoodsSkuVo getGoodsSkuVo (Integer dateType,Integer userIncrementId,Integer monthDy,Integer incrementTypeId){
|
|
|
GoodsSkuVo goodsSkuVo = new GoodsSkuVo();
|
|
|
IncrementType incrementType = null;
|
|
|
- switch (dateType){
|
|
|
- case 5 : incrementType = incrementTypeService.list().get(0);
|
|
|
- goodsSkuVo.setPrice(incrementType.getPrice());
|
|
|
- goodsSkuVo.setSkuSn(incrementType.getId().toString());
|
|
|
- goodsSkuVo.setDeadLine(getDateTime(incrementType,userIncrementId,monthDy).toDate().getTime());
|
|
|
- break;
|
|
|
- case 6: incrementType = incrementTypeService.list().get(0);
|
|
|
- goodsSkuVo.setPrice(incrementType.getDownloadPrice());
|
|
|
- goodsSkuVo.setSkuSn(incrementType.getId().toString());
|
|
|
- goodsSkuVo.setDeadLine(getDateTime(incrementType,userIncrementId,monthDy).toDate().getTime());
|
|
|
- break;
|
|
|
- case 7 : incrementType = incrementTypeService.list().get(1);
|
|
|
- goodsSkuVo.setPrice(incrementType.getPrice());
|
|
|
- goodsSkuVo.setSkuSn(incrementType.getId().toString());
|
|
|
- goodsSkuVo.setDeadLine(getDateTime(incrementType,userIncrementId,monthDy).toDate().getTime());
|
|
|
- break;
|
|
|
+ if(incrementTypeId != null){ //购买会员
|
|
|
+ incrementType = incrementTypeService.getById(incrementTypeId);
|
|
|
+ if(incrementType == null){
|
|
|
+ throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ goodsSkuVo.setPrice(incrementType.getPrice());
|
|
|
+ goodsSkuVo.setSkuSn(incrementType.getId().toString());
|
|
|
+ goodsSkuVo.setDeadLine(getDateTime(incrementType,userIncrementId,monthDy).toDate().getTime());
|
|
|
+ return goodsSkuVo;
|
|
|
+ }
|
|
|
+ if(dateType == 6){ //下载场景
|
|
|
+ incrementType = incrementTypeService.list().get(0);
|
|
|
+ goodsSkuVo.setPrice(incrementType.getDownloadPrice());
|
|
|
+ goodsSkuVo.setSkuSn(incrementType.getId().toString());
|
|
|
+ goodsSkuVo.setDeadLine(getDateTime(incrementType,userIncrementId,monthDy).toDate().getTime());
|
|
|
+ return goodsSkuVo;
|
|
|
}
|
|
|
|
|
|
return goodsSkuVo;
|