|
@@ -22,6 +22,7 @@ import com.fdkankan.ucenter.common.PageInfo;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.ucenter.common.constants.ResultCodeMsg;
|
|
|
+import com.fdkankan.ucenter.config.ThreadPoolConfig;
|
|
|
import com.fdkankan.ucenter.constant.CameraConstant;
|
|
|
import com.fdkankan.ucenter.constant.LoginConstant;
|
|
|
import com.fdkankan.ucenter.entity.*;
|
|
@@ -48,6 +49,7 @@ import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
@@ -214,9 +216,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
this.lockOrUnLockBySpace(cameraDetail,cameraId);
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ThreadPoolConfig threadPoolConfig;
|
|
|
@Override
|
|
|
public void lockOrUnLockBySpace(CameraDetail cameraDetail, Long cameraId) {
|
|
|
- ThreadUtil.execute(() -> {
|
|
|
+ threadPoolConfig.taskExecutor().execute(() -> {
|
|
|
log.info("异步任务执行,当前线程:" + Thread.currentThread().getName());
|
|
|
List<SimpleSceneVo> voList = this.getSimpleSceneVo(cameraDetail);
|
|
|
if(voList .size() <=0){
|
|
@@ -265,8 +269,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
log.info("lockOrUnLockBySpace---cameraId:{},totalSpace:{},useSpace{},space:{},payStatus:{}", cameraId,totalSpace,usedSpace,space,1);
|
|
|
lockOrUnLockScenes(lockedIds,1,cameraType);
|
|
|
}
|
|
|
+ log.info("异步任务执行,当前线程:" + Thread.currentThread().getName()+"执行完毕");
|
|
|
});
|
|
|
- log.info("异步任务执行,当前线程:" + Thread.currentThread().getName()+"执行完毕");
|
|
|
|
|
|
}
|
|
|
|
|
@@ -652,6 +656,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
Long userId = scenePro == null ? scenePlus.getUserId() :scenePro.getUserId();
|
|
|
+ Integer status = scenePro == null ? scenePlus.getSceneStatus() :scenePro.getStatus();
|
|
|
// 判断是否有绑定会员权益
|
|
|
Long count = userIncrementService.getValidCountByCameraId(cameraId);
|
|
|
if(count <= 0){
|
|
@@ -660,6 +665,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(userId == null){
|
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5013, SceneConstant.FAILURE_MSG_5013);
|
|
|
}
|
|
|
+ if(status !=-2){
|
|
|
+ throw new BusinessException(SceneConstant.FAILURE_CODE_5033, SceneConstant.FAILURE_MSG_5033);
|
|
|
+ }
|
|
|
//只能复制自己的场景
|
|
|
User user = userService.getByUserName(userName);
|
|
|
if(user == null || !user.getId().equals(userId) ){
|