|
@@ -98,36 +98,34 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
|
|
|
|
|
|
@Override
|
|
|
public ResultData isLogin(String num, SSOUser ssoUser) throws Exception {
|
|
|
- if(StrUtil.isEmpty(num) ){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_3001);
|
|
|
- }
|
|
|
- if (ssoUser == null){
|
|
|
+
|
|
|
+ if(Objects.isNull(ssoUser)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3004);
|
|
|
}
|
|
|
-// List<UserRole> list = userRoleService.list(new LambdaQueryWrapper<UserRole>().eq(UserRole::getUserId, ssoUser.getId()));
|
|
|
-// Set<Long> roleIdSet = null;
|
|
|
-// if(CollUtil.isNotEmpty(list)){
|
|
|
-// roleIdSet = list.stream().map(ur -> ur.getRoleId()).collect(Collectors.toSet());
|
|
|
-// }
|
|
|
-// if(!roleIdSet.contains(5)){
|
|
|
-// ScenePro sceneProEntity = sceneProService.findBySceneNum(num);
|
|
|
-// if(!sceneProEntity.getUserId().equals(ssoUser.getId())){
|
|
|
-// if(!ssoUser.getRoleSet().contains("6")){
|
|
|
-// throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
-// }
|
|
|
-// User userEntity = iUserService.getById(sceneProEntity.getUserId());
|
|
|
-// User tokenUser = iUserService.getById(ssoUser.getId());
|
|
|
-// if(Objects.isNull(userEntity) || Objects.isNull(userEntity.getCompanyId())
|
|
|
-// || Objects.isNull(tokenUser) || Objects.isNull(tokenUser.getCompanyId())
|
|
|
-// || !userEntity.getCompanyId().equals(tokenUser.getCompanyId())){
|
|
|
-// throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
- //判断该场景是否属于增值权益
|
|
|
+
|
|
|
+ // 解密获得username,用于和数据库进行对比
|
|
|
+ String username = ssoUser.getUserName();
|
|
|
+
|
|
|
+ ScenePro sceneProEntity = sceneProService.findBySceneNum(num);
|
|
|
+ if(sceneProEntity == null){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
+ if(sceneProEntity.getPayStatus() != 1){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
+ if(sceneProEntity.getStatus() != 1 && sceneProEntity.getStatus() != -2){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
+
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
+ //判断本地资源是否已本删除,如果已删除,前端根据字段值为true提示用户不能使用某些功能,需要重算
|
|
|
+ Date algorithmTime = sceneProEntity.getCreateTime();
|
|
|
+ jsonObject.put("sourceExpired", false);
|
|
|
+ if (!ObjectUtils.isEmpty(expiredMonth) && com.fdkankan.common.util.DateUtil.delay(algorithmTime, expiredMonth, Calendar.MONTH).before(new Date())) {
|
|
|
+ jsonObject.put("sourceExpired", true);
|
|
|
+ }
|
|
|
+
|
|
|
jsonObject.put("isExpired", false );
|
|
|
jsonObject.put("isIncrement", false);
|
|
|
|