|
@@ -20,6 +20,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
@@ -42,27 +44,7 @@ public class Scene3dNumServiceImpl extends ServiceImpl<IScene3dNumMapper, Scene3
|
|
|
@Autowired
|
|
|
RedisLockUtil redisLockUtil;
|
|
|
|
|
|
- @Override
|
|
|
- public List<String> findSceneNum() {
|
|
|
- return baseMapper.findSceneNum();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Scene3dNum findByNum(String sceneCode) {
|
|
|
- List<Scene3dNum> list = this.list(new LambdaQueryWrapper<Scene3dNum>()
|
|
|
- .eq(Scene3dNum::getTbStatus, TbStatus.VALID.code())
|
|
|
- .eq(Scene3dNum::getNum, sceneCode));
|
|
|
- if(CollUtil.isEmpty(list)){
|
|
|
- return null;
|
|
|
- }
|
|
|
- return list.get(0);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateUsedStatus(List<String> nums) {
|
|
|
- baseMapper.updateUsedStatus(nums);
|
|
|
- }
|
|
|
-
|
|
|
+ @Transactional(propagation = Propagation.NOT_SUPPORTED)
|
|
|
@Override
|
|
|
public String generateSceneNum(){
|
|
|
// 从缓存中获取
|
|
@@ -81,7 +63,7 @@ public class Scene3dNumServiceImpl extends ServiceImpl<IScene3dNumMapper, Scene3
|
|
|
redisUtil.lRightPushAll(RedisKey.FDKANKAN_SCENE_NUMS, nums);
|
|
|
log.info("场景码加载完成");
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error("场景码加载失败", e);
|
|
|
} finally {
|
|
|
redisUtil.decr(RedisLockKey.LOCK_FDKANKAN_SCENE_NUMS, 1);
|
|
|
}
|
|
@@ -101,4 +83,25 @@ public class Scene3dNumServiceImpl extends ServiceImpl<IScene3dNumMapper, Scene3
|
|
|
return sceneNum;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<String> findSceneNum() {
|
|
|
+ return baseMapper.findSceneNum();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Scene3dNum findByNum(String sceneCode) {
|
|
|
+ List<Scene3dNum> list = this.list(new LambdaQueryWrapper<Scene3dNum>()
|
|
|
+ .eq(Scene3dNum::getTbStatus, TbStatus.VALID.code())
|
|
|
+ .eq(Scene3dNum::getNum, sceneCode));
|
|
|
+ if(CollUtil.isEmpty(list)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return list.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateUsedStatus(List<String> nums) {
|
|
|
+ baseMapper.updateUsedStatus(nums);
|
|
|
+ }
|
|
|
+
|
|
|
}
|