薪资档案加密设置更新
This commit is contained in:
parent
dc541e8e00
commit
9f651b173e
|
|
@ -4,6 +4,7 @@ import com.engine.salary.sys.constant.SalarySysConstant;
|
|||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.enums.OpenEnum;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.AES;
|
||||
import weaver.general.BaseBean;
|
||||
|
|
@ -28,7 +29,7 @@ public class AESEncryptUtil {
|
|||
public static String encrypt(String source) {
|
||||
String isEncrypt = getSalarySysConfigValue();
|
||||
//防止初始化老数据时二次加密
|
||||
if (StringUtils.isNotBlank(source) && OpenEnum.OPEN.getValue().equals(isEncrypt) && !source.startsWith(SalarySysConstant.PRE_SIGN_ENCRYPT)&& source.length() != 32) {
|
||||
if (StringUtils.isNotBlank(source) && OpenEnum.OPEN.getValue().equals(isEncrypt) && !source.startsWith(SalarySysConstant.PRE_SIGN_ENCRYPT) && source.length() != 32) {
|
||||
return SalarySysConstant.PRE_SIGN_ENCRYPT + AES.encrypt(source, aesEncryptScrect);
|
||||
}
|
||||
return source;
|
||||
|
|
@ -40,11 +41,11 @@ public class AESEncryptUtil {
|
|||
* @return
|
||||
*/
|
||||
private static String getSalarySysConfigValue() {
|
||||
String confValue = salarySysConfService.getOneByCode(SalarySysConstant.OPEN_APPLICATION_ENCRYPT).getConfValue();
|
||||
if (StringUtils.isEmpty(confValue)) {
|
||||
SalarySysConfPO sysConfPO = salarySysConfService.getOneByCode(SalarySysConstant.OPEN_APPLICATION_ENCRYPT);
|
||||
if (ObjectUtils.isEmpty(sysConfPO)) {
|
||||
return "1";
|
||||
}
|
||||
return confValue;
|
||||
return sysConfPO.getConfValue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue