|
@@ -2,15 +2,9 @@ package com.fdkankan.ucenter.pay.strategy.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-import com.fdkankan.ucenter.entity.DownloadOrder;
|
|
|
-import com.fdkankan.ucenter.entity.ScenePlus;
|
|
|
-import com.fdkankan.ucenter.entity.ScenePro;
|
|
|
-import com.fdkankan.ucenter.entity.User;
|
|
|
+import com.fdkankan.ucenter.entity.*;
|
|
|
import com.fdkankan.ucenter.pay.strategy.OrderStrategy;
|
|
|
-import com.fdkankan.ucenter.service.IDownloadOrderService;
|
|
|
-import com.fdkankan.ucenter.service.IScenePlusService;
|
|
|
-import com.fdkankan.ucenter.service.ISceneProService;
|
|
|
-import com.fdkankan.ucenter.service.IUserService;
|
|
|
+import com.fdkankan.ucenter.service.*;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -27,6 +21,8 @@ public class DownloadOrderImpl implements OrderStrategy {
|
|
|
private ISceneProService sceneProService;
|
|
|
@Autowired
|
|
|
private IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusExtService scenePlusExtService;
|
|
|
|
|
|
@Override
|
|
|
public void handleOrder(String orderSn, String tradeNo, String openId, int paymentTypeName, Long spaceId) throws Exception {
|
|
@@ -45,8 +41,25 @@ public class DownloadOrderImpl implements OrderStrategy {
|
|
|
LambdaUpdateWrapper<User> wrapper = new LambdaUpdateWrapper<>();
|
|
|
wrapper.eq(User::getId,downloadOrder.getUserId());
|
|
|
if(StringUtils.isNotBlank(downloadOrder.getSceneNum())){
|
|
|
- Integer sceneSource = sceneProService.getSceneSourceByNum(downloadOrder.getSceneNum());
|
|
|
- if(sceneSource != null && sceneSource == 4){ //深时场景
|
|
|
+ Integer sceneSource = null;
|
|
|
+ Integer isObj = null;
|
|
|
+ ScenePro scenePro = sceneProService.getByNum(downloadOrder.getSceneNum());
|
|
|
+ if(scenePro != null){
|
|
|
+ sceneSource = scenePro.getSceneSource();
|
|
|
+ isObj = scenePro.getIsObj();
|
|
|
+ }
|
|
|
+ if(scenePro == null){
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByNum(downloadOrder.getSceneNum());
|
|
|
+ if(scenePlus != null){
|
|
|
+ sceneSource = scenePlus.getSceneSource();
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
+ if(scenePlusExt !=null){
|
|
|
+ isObj = scenePlusExt.getIsObj();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(sceneSource != null && sceneSource == 4 && isObj!=null && isObj == 0){ //深时场景
|
|
|
wrapper.setSql("ss_download_num_total = ss_download_num_total + " + downloadOrder.getCount());
|
|
|
}else {
|
|
|
wrapper.setSql("download_num_total = download_num_total + " + downloadOrder.getCount());
|