修改关闭解密方法
This commit is contained in:
parent
4c11c54973
commit
b9d119bcf0
|
|
@ -61,8 +61,7 @@ public class AESEncryptUtil {
|
|||
* @param encryptStr 加密字符串
|
||||
* @return 解密字符串
|
||||
*/
|
||||
public static String closeEncryptSetting(String encryptStr) {
|
||||
SalarySysConfPO sysConfPo = salarySysConfService.getOneByCode(SalarySysConstant.OPEN_APPLICATION_ENCRYPT);
|
||||
public static String closeEncryptSetting(String encryptStr,SalarySysConfPO sysConfPo) {
|
||||
if (encryptStr == null) {
|
||||
return null;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.sys.service.impl;
|
|||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.cloudstore.dev.api.util.Util_DataCache;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
|
|
@ -56,6 +57,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
|
@ -141,6 +143,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
return MapperProxyFactory.getProxy(SpecialAddDeductionMapper.class);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 操作是否需要申报功能
|
||||
|
|
@ -590,6 +596,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "in_progress");
|
||||
//多线程批量更新需要加密的表
|
||||
try {
|
||||
SalarySysConfPO sysConfPo = getSalarySysConfService(user).getOneByCode(SalarySysConstant.OPEN_APPLICATION_ENCRYPT);
|
||||
Future<Integer> submit = fixedThreadPool.submit(() -> {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
|
|
@ -597,8 +604,8 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(salaryAcctResultPos)) {
|
||||
salaryAcctResultPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue()));
|
||||
po.setOriginResultValue(AESEncryptUtil.closeEncryptSetting(po.getOriginResultValue()));
|
||||
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue(), sysConfPo));
|
||||
po.setOriginResultValue(AESEncryptUtil.closeEncryptSetting(po.getOriginResultValue(), sysConfPo));
|
||||
} else {
|
||||
po.setResultValue(AESEncryptUtil.encrypt(po.getResultValue()));
|
||||
po.setOriginResultValue(AESEncryptUtil.encrypt(po.getOriginResultValue()));
|
||||
|
|
@ -626,7 +633,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(excelAcctResultPos)) {
|
||||
excelAcctResultPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue()));
|
||||
po.setResultValue(AESEncryptUtil.closeEncryptSetting(po.getResultValue(), sysConfPo));
|
||||
} else {
|
||||
po.setResultValue(AESEncryptUtil.encrypt(po.getResultValue()));
|
||||
}
|
||||
|
|
@ -653,7 +660,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(taxDeclarationDetailPos)) {
|
||||
taxDeclarationDetailPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setFieldValue(AESEncryptUtil.closeEncryptSetting(po.getFieldValue()));
|
||||
po.setFieldValue(AESEncryptUtil.closeEncryptSetting(po.getFieldValue(), sysConfPo));
|
||||
} else {
|
||||
po.setFieldValue(AESEncryptUtil.encrypt(po.getFieldValue()));
|
||||
}
|
||||
|
|
@ -680,9 +687,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPos)) {
|
||||
insuranceSchemeDetailPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setUpperLimit(AESEncryptUtil.closeEncryptSetting(po.getUpperLimit()));
|
||||
po.setFixedCost(AESEncryptUtil.closeEncryptSetting(po.getFixedCost()));
|
||||
po.setLowerLimit(AESEncryptUtil.closeEncryptSetting(po.getLowerLimit()));
|
||||
po.setUpperLimit(AESEncryptUtil.closeEncryptSetting(po.getUpperLimit(), sysConfPo));
|
||||
po.setFixedCost(AESEncryptUtil.closeEncryptSetting(po.getFixedCost(), sysConfPo));
|
||||
po.setLowerLimit(AESEncryptUtil.closeEncryptSetting(po.getLowerLimit(), sysConfPo));
|
||||
} else {
|
||||
po.setUpperLimit(AESEncryptUtil.encrypt(po.getUpperLimit()));
|
||||
po.setFixedCost(AESEncryptUtil.encrypt(po.getFixedCost()));
|
||||
|
|
@ -711,7 +718,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(insuranceArchivesSocialSchemePos)) {
|
||||
insuranceArchivesSocialSchemePos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString()));
|
||||
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo));
|
||||
} else {
|
||||
po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString()));
|
||||
}
|
||||
|
|
@ -738,7 +745,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(insuranceArchivesFundSchemePos)) {
|
||||
insuranceArchivesFundSchemePos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString()));
|
||||
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo));
|
||||
} else {
|
||||
po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString()));
|
||||
}
|
||||
|
|
@ -765,7 +772,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(insuranceArchivesOtherSchemePos)) {
|
||||
insuranceArchivesOtherSchemePos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString()));
|
||||
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo));
|
||||
} else {
|
||||
po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString()));
|
||||
}
|
||||
|
|
@ -792,9 +799,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(insuranceAccountBatchPos)) {
|
||||
insuranceAccountBatchPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setOtherPay(AESEncryptUtil.closeEncryptSetting(po.getOtherPay()));
|
||||
po.setSocialPay(AESEncryptUtil.closeEncryptSetting(po.getSocialPay()));
|
||||
po.setFundPay(AESEncryptUtil.closeEncryptSetting(po.getFundPay()));
|
||||
po.setOtherPay(AESEncryptUtil.closeEncryptSetting(po.getOtherPay(), sysConfPo));
|
||||
po.setSocialPay(AESEncryptUtil.closeEncryptSetting(po.getSocialPay(), sysConfPo));
|
||||
po.setFundPay(AESEncryptUtil.closeEncryptSetting(po.getFundPay(), sysConfPo));
|
||||
} else {
|
||||
po.setOtherPay(AESEncryptUtil.encrypt(po.getOtherPay()));
|
||||
po.setSocialPay(AESEncryptUtil.encrypt(po.getSocialPay()));
|
||||
|
|
@ -823,23 +830,23 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(insuranceAccountDetailPos)) {
|
||||
insuranceAccountDetailPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString()));
|
||||
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString()));
|
||||
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString()));
|
||||
po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson()));
|
||||
po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum()));
|
||||
po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson()));
|
||||
po.setFundPerSum(AESEncryptUtil.closeEncryptSetting(po.getFundPerSum()));
|
||||
po.setOtherPerJson(AESEncryptUtil.closeEncryptSetting(po.getOtherPerJson()));
|
||||
po.setOtherPerSum(AESEncryptUtil.closeEncryptSetting(po.getOtherPerSum()));
|
||||
po.setPerSum(AESEncryptUtil.closeEncryptSetting(po.getPerSum()));
|
||||
po.setSocialComJson(AESEncryptUtil.closeEncryptSetting(po.getSocialComJson()));
|
||||
po.setSocialComSum(AESEncryptUtil.closeEncryptSetting(po.getSocialComSum()));
|
||||
po.setComSum(AESEncryptUtil.closeEncryptSetting(po.getComSum()));
|
||||
po.setSocialSum(AESEncryptUtil.closeEncryptSetting(po.getSocialSum()));
|
||||
po.setFundSum(AESEncryptUtil.closeEncryptSetting(po.getFundSum()));
|
||||
po.setOtherSum(AESEncryptUtil.closeEncryptSetting(po.getOtherSum()));
|
||||
po.setTotal(AESEncryptUtil.closeEncryptSetting(po.getTotal()));
|
||||
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo));
|
||||
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo));
|
||||
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo));
|
||||
po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo));
|
||||
po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo));
|
||||
po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo));
|
||||
po.setFundPerSum(AESEncryptUtil.closeEncryptSetting(po.getFundPerSum(), sysConfPo));
|
||||
po.setOtherPerJson(AESEncryptUtil.closeEncryptSetting(po.getOtherPerJson(), sysConfPo));
|
||||
po.setOtherPerSum(AESEncryptUtil.closeEncryptSetting(po.getOtherPerSum(), sysConfPo));
|
||||
po.setPerSum(AESEncryptUtil.closeEncryptSetting(po.getPerSum(), sysConfPo));
|
||||
po.setSocialComJson(AESEncryptUtil.closeEncryptSetting(po.getSocialComJson(), sysConfPo));
|
||||
po.setSocialComSum(AESEncryptUtil.closeEncryptSetting(po.getSocialComSum(), sysConfPo));
|
||||
po.setComSum(AESEncryptUtil.closeEncryptSetting(po.getComSum(), sysConfPo));
|
||||
po.setSocialSum(AESEncryptUtil.closeEncryptSetting(po.getSocialSum(), sysConfPo));
|
||||
po.setFundSum(AESEncryptUtil.closeEncryptSetting(po.getFundSum(), sysConfPo));
|
||||
po.setOtherSum(AESEncryptUtil.closeEncryptSetting(po.getOtherSum(), sysConfPo));
|
||||
po.setTotal(AESEncryptUtil.closeEncryptSetting(po.getTotal(), sysConfPo));
|
||||
} else {
|
||||
po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString()));
|
||||
po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString()));
|
||||
|
|
@ -882,7 +889,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(salaryArchiveItemPos)) {
|
||||
salaryArchiveItemPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setItemValue(AESEncryptUtil.closeEncryptSetting(po.getItemValue()));
|
||||
po.setItemValue(AESEncryptUtil.closeEncryptSetting(po.getItemValue(), sysConfPo));
|
||||
} else {
|
||||
po.setItemValue(AESEncryptUtil.encrypt(po.getItemValue()));
|
||||
}
|
||||
|
|
@ -936,11 +943,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(otherDeductionPos)) {
|
||||
otherDeductionPos.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setBusinessHealthyInsurance(AESEncryptUtil.closeEncryptSetting(po.getBusinessHealthyInsurance()));
|
||||
po.setTaxDelayEndowmentInsurance(AESEncryptUtil.closeEncryptSetting(po.getTaxDelayEndowmentInsurance()));
|
||||
po.setOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getOtherDeduction()));
|
||||
po.setDeductionAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getDeductionAllowedDonation()));
|
||||
po.setPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getPrivatePension()));
|
||||
po.setBusinessHealthyInsurance(AESEncryptUtil.closeEncryptSetting(po.getBusinessHealthyInsurance(), sysConfPo));
|
||||
po.setTaxDelayEndowmentInsurance(AESEncryptUtil.closeEncryptSetting(po.getTaxDelayEndowmentInsurance(), sysConfPo));
|
||||
po.setOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getOtherDeduction(), sysConfPo));
|
||||
po.setDeductionAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getDeductionAllowedDonation(), sysConfPo));
|
||||
po.setPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getPrivatePension(), sysConfPo));
|
||||
} else {
|
||||
po.setBusinessHealthyInsurance(AESEncryptUtil.encrypt(po.getBusinessHealthyInsurance()));
|
||||
po.setTaxDelayEndowmentInsurance(AESEncryptUtil.encrypt(po.getTaxDelayEndowmentInsurance()));
|
||||
|
|
@ -971,24 +978,24 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (CollectionUtils.isNotEmpty(addUpSituations)) {
|
||||
addUpSituations.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setAddUpIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpIncome()));
|
||||
po.setAddUpSubtraction(AESEncryptUtil.closeEncryptSetting(po.getAddUpSubtraction()));
|
||||
po.setAddUpSocialSecurityTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpSocialSecurityTotal()));
|
||||
po.setAddUpAccumulationFundTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpAccumulationFundTotal()));
|
||||
po.setAddUpChildEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpChildEducation()));
|
||||
po.setAddUpContinuingEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpContinuingEducation()));
|
||||
po.setAddUpHousingLoanInterest(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingLoanInterest()));
|
||||
po.setAddUpHousingRent(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingRent()));
|
||||
po.setAddUpSupportElderly(AESEncryptUtil.closeEncryptSetting(po.getAddUpSupportElderly()));
|
||||
po.setAddUpEnterpriseAndOther(AESEncryptUtil.closeEncryptSetting(po.getAddUpEnterpriseAndOther()));
|
||||
po.setAddUpOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getAddUpOtherDeduction()));
|
||||
po.setAddUpTaxExemptIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxExemptIncome()));
|
||||
po.setAddUpAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getAddUpAllowedDonation()));
|
||||
po.setAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getAddUpAdvanceTax()));
|
||||
po.setAddUpIllnessMedical(AESEncryptUtil.closeEncryptSetting(po.getAddUpIllnessMedical()));
|
||||
po.setAddUpTaxSavings(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxSavings()));
|
||||
po.setAddUpInfantCare(AESEncryptUtil.closeEncryptSetting(po.getAddUpInfantCare()));
|
||||
po.setAddUpPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getAddUpPrivatePension()));
|
||||
po.setAddUpIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpIncome(), sysConfPo));
|
||||
po.setAddUpSubtraction(AESEncryptUtil.closeEncryptSetting(po.getAddUpSubtraction(), sysConfPo));
|
||||
po.setAddUpSocialSecurityTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpSocialSecurityTotal(), sysConfPo));
|
||||
po.setAddUpAccumulationFundTotal(AESEncryptUtil.closeEncryptSetting(po.getAddUpAccumulationFundTotal(), sysConfPo));
|
||||
po.setAddUpChildEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpChildEducation(), sysConfPo));
|
||||
po.setAddUpContinuingEducation(AESEncryptUtil.closeEncryptSetting(po.getAddUpContinuingEducation(), sysConfPo));
|
||||
po.setAddUpHousingLoanInterest(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingLoanInterest(), sysConfPo));
|
||||
po.setAddUpHousingRent(AESEncryptUtil.closeEncryptSetting(po.getAddUpHousingRent(), sysConfPo));
|
||||
po.setAddUpSupportElderly(AESEncryptUtil.closeEncryptSetting(po.getAddUpSupportElderly(), sysConfPo));
|
||||
po.setAddUpEnterpriseAndOther(AESEncryptUtil.closeEncryptSetting(po.getAddUpEnterpriseAndOther(), sysConfPo));
|
||||
po.setAddUpOtherDeduction(AESEncryptUtil.closeEncryptSetting(po.getAddUpOtherDeduction(), sysConfPo));
|
||||
po.setAddUpTaxExemptIncome(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxExemptIncome(), sysConfPo));
|
||||
po.setAddUpAllowedDonation(AESEncryptUtil.closeEncryptSetting(po.getAddUpAllowedDonation(), sysConfPo));
|
||||
po.setAddUpAdvanceTax(AESEncryptUtil.closeEncryptSetting(po.getAddUpAdvanceTax(), sysConfPo));
|
||||
po.setAddUpIllnessMedical(AESEncryptUtil.closeEncryptSetting(po.getAddUpIllnessMedical(), sysConfPo));
|
||||
po.setAddUpTaxSavings(AESEncryptUtil.closeEncryptSetting(po.getAddUpTaxSavings(), sysConfPo));
|
||||
po.setAddUpInfantCare(AESEncryptUtil.closeEncryptSetting(po.getAddUpInfantCare(), sysConfPo));
|
||||
po.setAddUpPrivatePension(AESEncryptUtil.closeEncryptSetting(po.getAddUpPrivatePension(), sysConfPo));
|
||||
} else {
|
||||
po.setAddUpIncome(AESEncryptUtil.encrypt(po.getAddUpIncome()));
|
||||
po.setAddUpSubtraction(AESEncryptUtil.encrypt(po.getAddUpSubtraction()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue