You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package com.engine.organization.service.impl;
|
|
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
import com.engine.hrm.entity.RuleCodeType;
|
|
|
|
import com.engine.organization.service.CodeSettingService;
|
|
|
|
import com.engine.organization.util.response.ReturnResult;
|
|
|
|
import weaver.hrm.HrmUserVarify;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Author weaver_cl
|
|
|
|
* @Description: TODO
|
|
|
|
* @Date 2022/5/30
|
|
|
|
* @Version V1.0
|
|
|
|
**/
|
|
|
|
public class CodeSettingServiceImpl extends Service implements CodeSettingService {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ReturnResult getHasRight(String serialtype) {
|
|
|
|
boolean hasRight = false;
|
|
|
|
Map<String, Object> retmap = new HashMap<>();
|
|
|
|
switch (RuleCodeType.getByValue(serialtype)) {
|
|
|
|
case SUBCOMPANY:
|
|
|
|
hasRight = HrmUserVarify.checkUserRight("HrmCodeRuleSubcompany:All", user);
|
|
|
|
break;
|
|
|
|
case DEPARTMENT:
|
|
|
|
hasRight = HrmUserVarify.checkUserRight("HrmCodeRuleDepartment:All", user);
|
|
|
|
break;
|
|
|
|
case JOBTITLES:
|
|
|
|
hasRight = HrmUserVarify.checkUserRight("HrmCodeRuleJobtitles:All", user);
|
|
|
|
break;
|
|
|
|
case USER:
|
|
|
|
hasRight = HrmUserVarify.checkUserRight("HrmCodeRuleUser:All", user);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
retmap.put("hasRight", hasRight);
|
|
|
|
return ReturnResult.successed(retmap);
|
|
|
|
}
|
|
|
|
}
|