|
@@ -63,7 +63,7 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
|
|
|
@Override
|
|
|
public Object getAuthType(SceneParam param) {
|
|
|
- if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null){
|
|
|
+ if(StringUtils.isBlank(param.getNum()) && param.getCaseId() == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() !=null){
|
|
@@ -97,7 +97,7 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
|
|
|
@Override
|
|
|
public Object getAuthList(SceneParam param) {
|
|
|
- if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null){
|
|
|
+ if(StringUtils.isBlank(param.getNum()) && param.getCaseId() == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() !=null){
|
|
@@ -205,7 +205,7 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
@Override
|
|
|
public void setAuthType(JySceneUserAuth param) {
|
|
|
|
|
|
- if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null || param.getAuthType() == null){
|
|
|
+ if((StringUtils.isBlank(param.getNum()) && param.getCaseId() == null )|| param.getAuthType() == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() !=null){
|
|
@@ -231,7 +231,7 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
|
|
|
@Override
|
|
|
public synchronized void addAuth(JySceneUserAuth param) {
|
|
|
- if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null ){
|
|
|
+ if(StringUtils.isBlank(param.getNum()) && param.getCaseId() == null ){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
|
|
@@ -408,15 +408,33 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
|
|
|
@Override
|
|
|
public Object checkAuthOther(JySceneUserAuth param) {
|
|
|
- if(StringUtils.isBlank(param.getNum())){
|
|
|
+ if(StringUtils.isBlank(param.getNum()) && param.getCaseId() == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
- ScenePro pro = sceneProService.getByNum(param.getNum());
|
|
|
- ScenePlus plus = scenePlusService.getByNum(param.getNum());
|
|
|
- if(pro == null && plus == null){
|
|
|
- throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
|
|
|
+ if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() !=null){
|
|
|
+ param.setCaseId(null);
|
|
|
}
|
|
|
- Long sceneUserId = pro == null ? plus.getUserId() :pro.getUserId();
|
|
|
+ Long sceneUserId = null;
|
|
|
+ if(StringUtils.isNotBlank(param.getNum())){
|
|
|
+ ScenePlus plus = scenePlusService.getByNum(param.getNum());
|
|
|
+ if(plus == null){
|
|
|
+ throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
|
|
|
+ }
|
|
|
+ caseService.checkNumInCase(param.getNum());
|
|
|
+ sceneUserId = plus.getUserId();
|
|
|
+ }
|
|
|
+ if(param.getCaseId() != null){
|
|
|
+ Case caseEntity = caseService.getById(param.getCaseId());
|
|
|
+ if(caseEntity == null){
|
|
|
+ throw new BusinessException(ResultCode.CASE_NOT_EXIST);
|
|
|
+ }
|
|
|
+ JyUser jyUser2 = jyUserService.getBySysId(caseEntity.getSysUserId());
|
|
|
+ if(jyUser2 == null){
|
|
|
+ throw new BusinessException(ResultCode.USER_NOT_EXIST);
|
|
|
+ }
|
|
|
+ sceneUserId = jyUser2.getUserId();
|
|
|
+ }
|
|
|
+
|
|
|
CheckOtherVo vo = new CheckOtherVo();
|
|
|
SysUser byId = sysUserService.getById(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
JyUser jyUser = jyUserService.getBySysId(byId.getId());
|
|
@@ -425,7 +443,13 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
vo.setEditAuth(1);
|
|
|
vo.setLookAuth(1);
|
|
|
}else {
|
|
|
- JySceneUserAuth auth = jySceneUserAuthService.getByNumAndJyUserId(jyUser.getId(), param.getNum(),param.getAuthType());
|
|
|
+ JySceneUserAuth auth = null;
|
|
|
+ if(StringUtils.isNotBlank(param.getNum())){
|
|
|
+ auth = jySceneUserAuthService.getByNumAndJyUserId(jyUser.getId(), param.getNum(),param.getAuthType());
|
|
|
+ }
|
|
|
+ if(param.getCaseId() != null){
|
|
|
+ auth = jySceneUserAuthService.getByCaseIdAndJyUserId(jyUser.getId(), param.getCaseId(),param.getAuthType());
|
|
|
+ }
|
|
|
if(auth !=null){
|
|
|
if(auth.getCanAuthLook() == 1 ){
|
|
|
vo.setLookAuth(auth.getLookAuth());
|