验证方式

This commit is contained in:
钱涛 2023-06-14 16:15:05 +08:00
parent 57798a8e3e
commit 912c80c97f
4 changed files with 92 additions and 0 deletions

View File

@ -61,4 +61,9 @@ public class SalarySysConstant {
*/
public static final String EDIT_IMPORT_AUTO_LOCK = "EditImportAutoLock";
/**
* 工资单二次验证方式
*/
public static final String SALARY_PAYROLL_CHECK_TYPE = "SALARY_PAYROLL_CHECK_TYPE";
}

View File

@ -0,0 +1,55 @@
package com.engine.salary.sys.enums;
import com.engine.salary.enums.BaseEnum;
import org.apache.commons.lang3.StringUtils;
/**
* 排序枚举
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public enum PayrollCheckTypeEnum implements BaseEnum<String> {
PWD("PWD", "密码验证", 1),
SMS("SMS", "短信验证", 1);
private String value;
private String defaultLabel;
private int labelId;
PayrollCheckTypeEnum(String value, String defaultLabel, int labelId) {
this.value = value;
this.defaultLabel = defaultLabel;
this.labelId = labelId;
}
@Override
public String getValue() {
return value;
}
@Override
public String getDefaultLabel() {
return defaultLabel;
}
@Override
public Integer getLabelId() {
return labelId;
}
public static PayrollCheckTypeEnum parseByValue(String value) {
for (PayrollCheckTypeEnum payrollCheckTypeEnum : PayrollCheckTypeEnum.values()) {
if (StringUtils.equals(payrollCheckTypeEnum.getValue(), value)) {
return payrollCheckTypeEnum;
}
}
return PWD;
}
}

View File

@ -5,6 +5,7 @@ import com.engine.salary.entity.salaryBill.dto.*;
import com.engine.salary.entity.salaryBill.param.*;
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.sys.enums.PayrollCheckTypeEnum;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.page.PageInfo;
@ -540,6 +541,18 @@ public class SalaryBillController {
}
/******** 工资单发放 end ***********************************************************************************************/
/**
* 获取验证方式
*
* @return
*/
@GET
@Path("/payrollCheckType")
@Produces(MediaType.APPLICATION_JSON)
public String payrollCheckType(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SMSCodeSendParam, PayrollCheckTypeEnum>(user).run(getSalarySendWrapper(user)::payrollCheckType);
}
/**
* 短信验证码

View File

@ -26,6 +26,11 @@ import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.salarybill.SalarySendMapper;
import com.engine.salary.service.*;
import com.engine.salary.service.impl.*;
import com.engine.salary.sys.constant.SalarySysConstant;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.enums.PayrollCheckTypeEnum;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
@ -78,6 +83,10 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
/**
* 工资单发放列表
@ -663,6 +672,16 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
public Boolean checkMobileCode(SMSCodeCheckParam param) {
return getSalarySendService(user).checkMobileCode(param);
}
public PayrollCheckTypeEnum payrollCheckType() {
SalarySysConfPO conf = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_PAYROLL_CHECK_TYPE);
if(conf == null){
return PayrollCheckTypeEnum.PWD;
}
return PayrollCheckTypeEnum.parseByValue(conf.getConfValue());
}
}