@Data
public class Inner3MappingConfig {
private Logger LOGGER = LoggerFactory.getLogger(Inner3MappingConfig.class);
private static final HashMap<String,HashMap<String,String>> inner3MappingConfigMap = new HashMap<>();
private static Inner3MappingConfig instance;
static {
instance = new Inner3MappingConfig();
}
private Inner3MappingConfig() {
LOGGER.info("Inner3MappingConfig初始化ing...");
this.staffFunction();
this.applyType();
this.isNewStaff();
this.isNewRole();
this.afterIsBaseRoleDelete();
this.beforeIsBaseRoleDelete();
this.riskAccountType();
this.isRiskAccount();
this.isSchedule();
this.isLeave();
LOGGER.info("Inner3MappingConfig初始化结束...");
}
/**
* 员工职能 1客服 2总监 3项目经理 4主管 5中控 6质检 7培训 8数据 9外包IT 10商务 11测试 12外包移动工单 20其他职能
* */
private void staffFunction() {
HashMap staffFunctionHashMap = new HashMap();
staffFunctionHashMap.put("1","客服");
staffFunctionHashMap.put("2","总监");
staffFunctionHashMap.put("3","项目经理");
staffFunctionHashMap.put("4","主管");
staffFunctionHashMap.put("5","中控");
staffFunctionHashMap.put("6","质检");
staffFunctionHashMap.put("7","培训");
staffFunctionHashMap.put("8","数据");
staffFunctionHashMap.put("9","外包IT");
staffFunctionHashMap.put("10","商务");
staffFunctionHashMap.put("11","测试");
staffFunctionHashMap.put("12","外包移动工单");
staffFunctionHashMap.put("20","其他职能");
inner3MappingConfigMap.put("staffFunction",staffFunctionHashMap);
}
/**
* 角色申请方式 1-IAM权限申请 2-移动工单支援申请 3-太平洋峰值支援申请 4-邮件申请 5-太平洋支援申请
* */
private void applyType() {
HashMap applyTypeHashMap = new HashMap();
applyTypeHashMap.put("1","IAM权限申请");
applyTypeHashMap.put("2","移动工单支援申请");
applyTypeHashMap.put("3","太平洋峰值支援申请");
applyTypeHashMap.put("4","邮件申请");
applyTypeHashMap.put("5","太平洋支援申请");
inner3MappingConfigMap.put("applyType",applyTypeHashMap);
}
/**
* 是否新增员工 1是 0否
* */
private void isNewStaff() {
HashMap isNewStaffHashMap = new HashMap();
isNewStaffHashMap.put("1","是");
isNewStaffHashMap.put("2","否");
inner3MappingConfigMap.put("isNewStaff",isNewStaffHashMap);
}
/**
* 是否新增角色 1是 0否
* */
private void isNewRole() {
HashMap isNewRoleHashMap = new HashMap();
isNewRoleHashMap.put("1","是");
isNewRoleHashMap.put("2","否");
inner3MappingConfigMap.put("isNewRole",isNewRoleHashMap);
}
/**
* 转岗后员工基础角色是否被删除 1-是 0-否
* */
private void afterIsBaseRoleDelete() {
HashMap afterIsBaseRoleDeleteHashMap = new HashMap();
afterIsBaseRoleDeleteHashMap.put("1","是");
afterIsBaseRoleDeleteHashMap.put("0","否");
inner3MappingConfigMap.put("afterIsBaseRoleDelete",afterIsBaseRoleDeleteHashMap);
}
/**
* 转岗前员工基础角色是否被删除 1-是 0-否
* */
private void beforeIsBaseRoleDelete() {
HashMap beforeIsBaseRoleDeleteHashMap = new HashMap();
beforeIsBaseRoleDeleteHashMap.put("1","是");
beforeIsBaseRoleDeleteHashMap.put("0","否");
inner3MappingConfigMap.put("beforeIsBaseRoleDelete",beforeIsBaseRoleDeleteHashMap);
}
/**
* 员工转岗角色异常类型 0表示转岗无角色异常 1-转岗后不含基础角色 2-转岗后含转岗前基础角色并且该基础的在转岗日后16天仍有效 3-1&2
* */
private void riskAccountType() {
HashMap riskAccountTypeHashMap = new HashMap();
riskAccountTypeHashMap.put("1","转岗后不含基础角色");
riskAccountTypeHashMap.put("2","转岗后含转岗前基础角色并且该基础的在转岗日后16天仍有效");
riskAccountTypeHashMap.put("3","转岗后不含基础角色 并且 转岗后含转岗前基础角色并且该基础的在转岗日后16天仍有效");
inner3MappingConfigMap.put("riskAccountType",riskAccountTypeHashMap);
}
/**
* 是否为风险账号 1是 0否 2申请角色为空无法进行判断
* */
private void isRiskAccount() {
HashMap isRiskAccountHashMap = new HashMap();
isRiskAccountHashMap.put("0","否");
isRiskAccountHashMap.put("1","是");
isRiskAccountHashMap.put("2","申请角色为空无法进行判断");
inner3MappingConfigMap.put("isRiskAccount",isRiskAccountHashMap);
}
/**
* 前7天内是否有排班记录 1是 0否
* */
private void isSchedule() {
HashMap isScheduleHashMap = new HashMap();
isScheduleHashMap.put("1","是");
isScheduleHashMap.put("0","否");
inner3MappingConfigMap.put("isSchedule",isScheduleHashMap);
}
/**
* 前7天内是否请假记录 1是 0否
* */
private void isLeave() {
HashMap isLeaveHashMap = new HashMap();
isLeaveHashMap.put("1","是");
isLeaveHashMap.put("0","否");
inner3MappingConfigMap.put("isLeave",isLeaveHashMap);
}
/**
* 是否禁赔用户 1是 0否
private void isProhibitedUser() {
HashMap isProhibitedUserHashMap = new HashMap();
isProhibitedUserHashMap.put("0","否");
isProhibitedUserHashMap.put("1","是");
inner3MappingConfigMap.put("isProhibitedUser",isProhibitedUserHashMap);
} */
/**
* 是否为无联络赔付 1是 0否
*
private void isWithoutContactRefund() {
HashMap isWithoutContactRefund = new HashMap();
isWithoutContactRefund.put("0","否");
isWithoutContactRefund.put("1","是");
inner3MappingConfigMap.put("isWithoutContactRefund",isWithoutContactRefund);
}*/
/**
* 是否大金额赔付(大于3000) 1是 0否
*
private void isBigAmtRefund() {
HashMap isBigAmtRefundHashMap = new HashMap();
isBigAmtRefundHashMap.put("0","否");
isBigAmtRefundHashMap.put("1","是");
inner3MappingConfigMap.put("isBigAmtRefund",isBigAmtRefundHashMap);
} */
public static void convertInner3Mapping(Map<String, Object> paramtersMap){
for(Map.Entry<String, Object> entry : paramtersMap.entrySet()) {
String paramKey = entry.getKey();
Object paramValue = entry.getValue();
if(Inner3MappingConfig.inner3MappingConfigMap.containsKey(paramKey)){
HashMap<String,String> mappings = Inner3MappingConfig.inner3MappingConfigMap.get(paramKey);
paramtersMap.put(paramKey,mappings.get(String.valueOf(paramValue)));
}
}
}
public static String getConvertValueByInner3MappingConfigMapKey(String inner3MappingConfigMapKey,String value){
if(Inner3MappingConfig.inner3MappingConfigMap.containsKey(inner3MappingConfigMapKey)){
HashMap<String,String> mappings = Inner3MappingConfig.inner3MappingConfigMap.get(inner3MappingConfigMapKey);
return mappings.get(value);
}
return null;
}
}