加密日志

This commit is contained in:
钱涛 2023-02-21 13:58:30 +08:00
parent 4f22df09f0
commit 84e63d4d40
1 changed files with 32 additions and 31 deletions

View File

@ -49,6 +49,7 @@ import com.weaver.util.threadPool.ThreadPoolUtil;
import com.weaver.util.threadPool.constant.ModulePoolEnum;
import com.weaver.util.threadPool.entity.LocalRunnable;
import dm.jdbc.util.IdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -71,6 +72,7 @@ import static java.util.concurrent.Executors.newFixedThreadPool;
* @author qiantao
* @version 1.0
**/
@Slf4j
public class SalarySysConfServiceImpl extends Service implements SalarySysConfService {
private EncryptUtil encryptUtil = new EncryptUtil();
@ -492,8 +494,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
}
private Boolean encryptOrDecryptDbWithAsync(String isOpenEncrypt, String progressId) {
BaseBean baseBean = new BaseBean();
baseBean.writeLog("应用设置加解密数据开始");
log.info("应用设置加解密数据开始");
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "in_progress");
//多线程批量更新需要加密的表
try {
@ -515,11 +516,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
SalaryAcctResultMapper mapper = sqlSession.getMapper(SalaryAcctResultMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_salary_acct_result");
log.info("finish hrsa_salary_acct_result");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_salary_acct_result:" + e.getMessage());
log.error("fail hrsa_salary_acct_result", e);
return 0;
} finally {
sqlSession.close();
@ -541,12 +542,12 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
List<List<ExcelAcctResultPO>> partition = Lists.partition(excelAcctResultPos, 50);
ExcelAcctResultMapper mapper = sqlSession.getMapper(ExcelAcctResultMapper.class);
partition.forEach(mapper::batchUpdate);
baseBean.writeLog("hrsa_excel_acct_result:");
log.info("finish hrsa_excel_acct_result");
sqlSession.commit();
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_excel_acct_result:", e.getMessage());
log.error("fail hrsa_excel_acct_result", e);
return 0;
} finally {
sqlSession.close();
@ -569,11 +570,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
TaxDeclarationDetailMapper mapper = sqlSession.getMapper(TaxDeclarationDetailMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_tax_declaration_detail");
log.info("finish hrsa_tax_declaration_detail");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_tax_declaration_detail:", e.getMessage());
log.error("fail hrsa_tax_declaration_detail", e);
return 0;
} finally {
sqlSession.close();
@ -600,11 +601,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
InsuranceSchemeDetailMapper mapper = sqlSession.getMapper(InsuranceSchemeDetailMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_scheme_detail");
log.info("finish hrsa_scheme_detail");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_scheme_detail:", e.getMessage());
log.error("fail hrsa_scheme_detail", e);
return 0;
} finally {
sqlSession.close();
@ -627,11 +628,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
SocialSchemeMapper mapper = sqlSession.getMapper(SocialSchemeMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_social_archives:");
log.info("finish hrsa_social_archives");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_social_archives:", e.getMessage());
log.error("fail hrsa_social_archives", e);
return 0;
} finally {
sqlSession.close();
@ -654,11 +655,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
FundSchemeMapper mapper = sqlSession.getMapper(FundSchemeMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_fund_archives:");
log.info("finish hrsa_fund_archives");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_fund_archives:", e.getMessage());
log.error("fail hrsa_fund_archives", e);
return 0;
} finally {
sqlSession.close();
@ -681,11 +682,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
OtherSchemeMapper mapper = sqlSession.getMapper(OtherSchemeMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_other_archives");
log.info("finish hrsa_other_archives");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_other_archives:", e.getMessage());
log.error("fail hrsa_other_archives", e);
return 0;
} finally {
sqlSession.close();
@ -712,11 +713,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
InsuranceAccountBatchMapper mapper = sqlSession.getMapper(InsuranceAccountBatchMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_bill_batch:");
log.info("finish hrsa_bill_batch");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_bill_batch:", e.getMessage());
log.error("fail hrsa_bill_batch", e);
return 0;
} finally {
sqlSession.close();
@ -771,11 +772,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
InsuranceAccountDetailMapper mapper = sqlSession.getMapper(InsuranceAccountDetailMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_bill_detail:");
log.info("finish hrsa_bill_detail");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_bill_detail:", e.getMessage());
log.error("fail hrsa_bill_detail", e);
return 0;
} finally {
sqlSession.close();
@ -798,11 +799,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
SalaryArchiveItemMapper mapper = sqlSession.getMapper(SalaryArchiveItemMapper.class);
partition.forEach(mapper::batchUpdate);
sqlSession.commit();
baseBean.writeLog("hrsa_salary_archive_item:");
log.info("finish hrsa_salary_archive_item");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_salary_archive_item:", e.getMessage());
log.error("fail hrsa_salary_archive_item", e);
return 0;
} finally {
sqlSession.close();
@ -825,11 +826,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
partition.forEach(mapper::updateData);
sqlSession.commit();
baseBean.writeLog("hrsa_add_up_deduction");
log.info("finish hrsa_add_up_deduction");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_add_up_deduction:", e.getMessage());
log.error("fail hrsa_add_up_deduction", e);
return 0;
} finally {
sqlSession.close();
@ -858,11 +859,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
OtherDeductionMapper mapper = sqlSession.getMapper(OtherDeductionMapper.class);
partition.forEach(mapper::updateData);
sqlSession.commit();
baseBean.writeLog("hrsa_other_deduction");
log.info("finish hrsa_other_deduction");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_other_deduction:", e.getMessage());
log.error("fail hrsa_other_deduction", e);
return 0;
} finally {
sqlSession.close();
@ -917,11 +918,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class);
partition.forEach(mapper::updateData);
sqlSession.commit();
baseBean.writeLog("hrsa_add_up_situation");
log.info("finish hrsa_add_up_situation");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_add_up_situation:", e.getMessage());
log.error("fail hrsa_add_up_situation", e);
return 0;
} finally {
sqlSession.close();
@ -944,11 +945,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
SpecialAddDeductionMapper mapper = sqlSession.getMapper(SpecialAddDeductionMapper.class);
partition.forEach(mapper::updateBatchSelective);
sqlSession.commit();
baseBean.writeLog("hrsa_special_add_deduction");
log.info("finish hrsa_special_add_deduction");
}
} catch (Exception e) {
sqlSession.rollback();
baseBean.writeLog("hrsa_special_add_deduction:", e.getMessage());
log.error("fail hrsa_special_add_deduction", e);
return 0;
} finally {
sqlSession.close();
@ -966,7 +967,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
} catch (Exception e) {
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30);
Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS);
baseBean.writeLog("应用设置加解密数据异常", e.getMessage());
log.error("应用设置加解密数据异常", e);
return false;
} finally {
Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS);