weaver-hrm-salary/src/com/engine/salary/encrypt/siaccount/SiAccountEncrypt.java

62 lines
2.0 KiB
Java

package com.engine.salary.encrypt.siaccount;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import java.util.List;
/**
* hrsa_bill_batch 加解密
* 字段:
* other_pay
* social_pay
* fund_pay
*/
@Deprecated
public class SiAccountEncrypt {
@Deprecated
public static List<InsuranceAccountBatchPO> encryptInsuranceAccountBatchList(List<InsuranceAccountBatchPO> list) {
list.forEach(item -> {
item.setOtherPay(AESEncryptUtil.encrypt(item.getOtherPay()));
item.setSocialPay(AESEncryptUtil.encrypt(item.getSocialPay()));
item.setFundPay(AESEncryptUtil.encrypt(item.getFundPay()));
});
return list;
}
@Deprecated
public static List<InsuranceAccountBatchPO> decryptInsuranceAccountBatchList(List<InsuranceAccountBatchPO> list) {
if(list == null || list.size() == 0) {
return list;
}
list.forEach(item -> {
item.setOtherPay(AESEncryptUtil.decrypt(item.getOtherPay()));
item.setSocialPay(AESEncryptUtil.decrypt(item.getSocialPay()));
item.setFundPay(AESEncryptUtil.decrypt(item.getFundPay()));
});
return list;
}
@Deprecated
public static InsuranceAccountBatchPO encryptInsuranceAccountBatch(InsuranceAccountBatchPO item) {
if(item == null) {
return item;
}
item.setOtherPay(AESEncryptUtil.encrypt(item.getOtherPay()));
item.setSocialPay(AESEncryptUtil.encrypt(item.getSocialPay()));
item.setFundPay(AESEncryptUtil.encrypt(item.getFundPay()));
return item;
}
@Deprecated
public static InsuranceAccountBatchPO decryptInsuranceAccountBatch(InsuranceAccountBatchPO item) {
if(item == null) {
return item;
}
item.setOtherPay(AESEncryptUtil.decrypt(item.getOtherPay()));
item.setSocialPay(AESEncryptUtil.decrypt(item.getSocialPay()));
item.setFundPay(AESEncryptUtil.decrypt(item.getFundPay()));
return item;
}
}