|
@@ -11,16 +11,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.constant.SceneConstant;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
-import com.fdkankan.manage.common.OssPath;
|
|
|
-import com.fdkankan.manage.common.ResultCode;
|
|
|
+import com.fdkankan.manage.common.*;
|
|
|
+import com.fdkankan.manage.config.LaserConfig;
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
-import com.fdkankan.manage.common.PageInfo;
|
|
|
import com.fdkankan.common.util.*;
|
|
|
import com.fdkankan.manage.httpClient.client.FdKKClient;
|
|
|
import com.fdkankan.manage.httpClient.param.LaserSceneParam;
|
|
|
import com.fdkankan.manage.httpClient.service.LaserService;
|
|
|
-import com.fdkankan.manage.common.CameraConstant;
|
|
|
import com.fdkankan.manage.entity.*;
|
|
|
+import com.fdkankan.manage.httpClient.vo.LaserUpdateUserVo;
|
|
|
import com.fdkankan.manage.mapper.ISceneProMapper;
|
|
|
import com.fdkankan.manage.service.*;
|
|
|
import com.fdkankan.manage.util.SceneStatusUtil;
|
|
@@ -81,6 +80,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
@Autowired
|
|
|
LaserService laserService;
|
|
|
@Autowired
|
|
|
+ LaserConfig laserConfig;
|
|
|
+ @Autowired
|
|
|
FdKKClient fdKKClient;
|
|
|
@Autowired
|
|
|
IFolderSceneService folderSceneService;
|
|
@@ -320,7 +321,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
param.setPlatformId(loginPlatformId);
|
|
|
|
|
|
- if(byId.getRoleId() == 47L || param.getIsObj() != null){
|
|
|
+ if(byId.getRoleId() == 47L ){
|
|
|
param.setUserId(jyUser.getUserId());
|
|
|
}
|
|
|
}
|
|
@@ -331,7 +332,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(!openNums.isEmpty()){
|
|
|
param.getAuthNumList().addAll(openNums);
|
|
|
}
|
|
|
- List<JySceneUserAuth> list = jySceneUserAuthService.getByJyUserId(jyUser.getId());
|
|
|
+ List<JySceneUserAuth> list = jySceneUserAuthService.getByJyUserIdAndNum(jyUser.getId(),0,openNums);
|
|
|
if(list.size() >0){
|
|
|
List<String> numList = list.stream().filter(entity -> !(entity.getLookAuth()==0 && entity.getEditAuth() ==0)).map(JySceneUserAuth::getNum).collect(Collectors.toList());
|
|
|
param.getAuthNumList().addAll(numList);
|
|
@@ -359,49 +360,50 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Set<Long> userIds = null;
|
|
|
- HashMap<Long,JyUser> userMap = new HashMap<>();
|
|
|
- HashMap<String, JSONObject> laserMap = new HashMap<>();
|
|
|
+ Page<SceneVo> page ;
|
|
|
+ SceneTypeEnum enumByType ;
|
|
|
+ if(param.getIsObj() != null){
|
|
|
+ if(param.getIsObj() == 0){
|
|
|
+ page = this.getBaseMapper().selectLaser(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
+ }else {
|
|
|
+ page = this.getBaseMapper().selectMesh(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(param.getType() == null){
|
|
|
+ page = this.getBaseMapper().pageList2(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
+ }else {
|
|
|
+ enumByType = SceneTypeEnum.getEnumByType(param.getType());
|
|
|
+ if(enumByType == null){
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_TYPE_ERROR);
|
|
|
+ }
|
|
|
+ param.setSceneSource(enumByType.getSceneSource());
|
|
|
+ if(enumByType.getThreeCamera()){
|
|
|
+ param.setThreeCamType(true);
|
|
|
+ }else {
|
|
|
+ param.setNotThreeCamType(true);
|
|
|
+ }
|
|
|
+ if(enumByType.getLaser()){
|
|
|
+ page = this.getBaseMapper().selectLaser(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
+ }else {
|
|
|
+ page = this.getBaseMapper().selectMesh(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- Page<SceneVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
List<SceneVo> records = page.getRecords();
|
|
|
List<String> numList = records.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
|
|
|
- List<String> lasesrNumList = records.parallelStream().filter(e -> e.getSceneSource() ==4 || e.getSceneSource() == 5).map(SceneVo::getNum).collect(Collectors.toList());
|
|
|
-
|
|
|
- if(!lasesrNumList.isEmpty()){
|
|
|
- laserMap = laserService.getMapLaserSceneByDb(new LaserSceneParam(numList));
|
|
|
- }
|
|
|
- userIds = page.getRecords().stream().map(SceneVo::getUserId).collect(Collectors.toSet());
|
|
|
- userMap = jyUserService.getMapByUserIds(userIds);
|
|
|
|
|
|
HashMap<String,SceneCopyLog> map = copyLogService.getByNewNumList(numList);
|
|
|
|
|
|
for (SceneVo record : page.getRecords()) {
|
|
|
- if( param.getType() == null || param.getType() == 2 || param.getType() == 6 ){
|
|
|
- if(param.getIsObj() == null || param.getIsObj() == 0){
|
|
|
- if(record.getSceneSource() == 4 || record.getSceneSource() == 5){
|
|
|
- JSONObject ssObj = laserMap.get(record.getNum());
|
|
|
- if(ssObj!=null){
|
|
|
- record.setId(ssObj.getInteger("id"));
|
|
|
- record.setSceneName(ssObj.getString("title"));
|
|
|
- record.setThumb(ssObj.getString("thumb"));
|
|
|
- record.setWebSite(ssObj.getString("web_site"));
|
|
|
- record.setViewCount(ssObj.getInteger("view_count"));
|
|
|
- record.setStatus(laserService.toFdStatus(ssObj.getInteger("status")));
|
|
|
- record.setAlgorithmTime(ssObj.getString("algorithm_time"));
|
|
|
- }else if(record.getStatus() != 0){
|
|
|
- record.setStatus(-1);
|
|
|
- record.setWebSite(null);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if( record.getSceneType().equals("laser") ){
|
|
|
+ record.setStatus(laserService.toFdStatus(record.getStatus()));
|
|
|
+ record.setWebSite(laserConfig.getLaserWebSite()+record.getNum());
|
|
|
+ record.setPayStatus(1);
|
|
|
}
|
|
|
|
|
|
record.setStatusString(SceneStatusUtil.getStatusString(record));
|
|
|
- if(userMap.get(record.getUserId()) != null){
|
|
|
- record.setUserName(userMap.get(record.getUserId()).getRyNo());
|
|
|
- record.setNickName(userMap.get(record.getUserId()).getRyNickName());
|
|
|
- }
|
|
|
if(map !=null ){
|
|
|
SceneCopyLog sceneCopyLog = map.get(record.getNum());
|
|
|
if(sceneCopyLog != null){
|
|
@@ -434,21 +436,27 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}else {
|
|
|
record.setIsShare(true);
|
|
|
}
|
|
|
- record.setType( param.getType() == null ?setSceneType(record.getSceneSource(),record.getThreeCamType()) : param.getType());
|
|
|
+ record.setType( param.getType() == null ?setSceneType(record.getSceneSource(),record.getThreeCamType(),record.getSceneType()) : param.getType());
|
|
|
}
|
|
|
return PageInfo.PageInfo(page);
|
|
|
}
|
|
|
|
|
|
- private Integer setSceneType(Integer sceneSource,String threeCamType) {
|
|
|
+ private Integer setSceneType(Integer sceneSource,String threeCamType,String sceneType) {
|
|
|
if(sceneSource == 3 ){
|
|
|
return 1;
|
|
|
}
|
|
|
- if(sceneSource == 4 ){
|
|
|
+ if(sceneSource == 4 && sceneType.equals("laser")){
|
|
|
return 2;
|
|
|
}
|
|
|
- if(sceneSource == 5 ){
|
|
|
+ if(sceneSource == 4 && sceneType.equals("4dkankan")){
|
|
|
+ return 5;
|
|
|
+ }
|
|
|
+ if(sceneSource == 5 && sceneType.equals("laser")){
|
|
|
return 6;
|
|
|
}
|
|
|
+ if(sceneSource == 5 && sceneType.equals("4dkankan")){
|
|
|
+ return 7;
|
|
|
+ }
|
|
|
return StringUtils.isBlank(threeCamType) ? 0 : 8;
|
|
|
}
|
|
|
|
|
@@ -458,15 +466,22 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
SysUser byId = sysUserService.getById(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
JyUser jyUser = jyUserService.getBySysId(byId.getId());
|
|
|
LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
|
|
|
- if(byId.getRoleId() != 1L && byId.getRoleId() !=45L && byId.getRoleId() != 48){
|
|
|
+ if(byId.getRoleId() != 1L ){
|
|
|
if(jyUser == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
- wrapper.eq(ScenePlus::getUserId,jyUser.getUserId());
|
|
|
+ if(byId.getRoleId() !=45L && byId.getRoleId() != 48L){
|
|
|
+ wrapper.eq(ScenePlus::getUserId,jyUser.getUserId());
|
|
|
+ }
|
|
|
List<JySceneUserAuth> list = jySceneUserAuthService.getByJyUserId(jyUser.getId());
|
|
|
if(list.size() >0){
|
|
|
return 1;
|
|
|
}
|
|
|
+ List<JyUserShare> jyUserShares = jyUserShareService.getByJyUserId(jyUser.getId());
|
|
|
+ if(jyUserShares.size() >0){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
if(byId.getRoleId() == 45L || byId.getRoleId() == 48L){
|
|
@@ -518,6 +533,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
scenePlusService.update(wrapper);
|
|
|
jyMoveSceneLogService.saveLog(scenePlus.getNum(),scenePlus.getUserId(),jyUser.getUserId(),Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
|
|
|
+ laserService.updateSceneUser(new LaserUpdateUserVo(scenePlus.getUserId(),jyUser.getRyNo(),jyUser.getUserId(),scenePlus.getNum()));
|
|
|
}
|
|
|
|
|
|
@Override
|