社保加解密

This commit is contained in:
Harryxzy 2024-03-14 11:07:01 +08:00
parent 26a3199b1e
commit 8543d70a66
6 changed files with 134 additions and 4 deletions

View File

@ -313,7 +313,55 @@
</select>
<select id="listAll" resultType="com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO">
SELECT
<include refid="baseColumns"/>
t
.
id
, t.employee_id
, t.bill_month
, t.bill_status
, t.payment_status
, t.supplementary_month
, t.supplementary_projects
, t.resource_from
, t.social_pay_org
, t.social_account
, t.fund_pay_org
, t.fund_account
, t.supplement_fund_account
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.social_payment_com_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, t.fund_payment_com_base_string
, t.other_scheme_id
, t.other_payment_base_string
, t.other_payment_com_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
, t.fund_per_sum
, t.other_per_json
, t.other_per_sum
, t.per_sum
, t.social_com_json
, t.social_com_sum
, t.fund_com_json
, t.fund_com_sum
, t.other_com_json
, t.other_com_sum
, t.com_sum
, t.social_sum
, t.fund_sum
, t.other_sum
, t.total
, t.creator
, t.delete_type
, t.create_time
, t.update_time
, t.tenant_key
, t.payment_organization
FROM
hrsa_excel_bill_detail t
WHERE t.delete_type = 0

View File

@ -1143,6 +1143,29 @@
</if>
</foreach>
</trim>
<trim prefix="social_payment_com_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialPaymentComBaseString!=null">
when id=#{item.id} then #{item.socialPaymentComBaseString}
</if>
</foreach>
</trim>
<trim prefix="fund_payment_com_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundPaymentComBaseString!=null">
when id=#{item.id} then #{item.fundPaymentComBaseString}
</if>
</foreach>
</trim>
<trim prefix="other_payment_com_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherPaymentComBaseString!=null">
when id=#{item.id} then #{item.otherPaymentComBaseString}
</if>
</foreach>
</trim>
<trim prefix="social_per_json =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialPerJson!=null">

View File

@ -285,6 +285,13 @@
</if>
</foreach>
</trim>
<trim prefix="fund_payment_com_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundPaymentComBaseString!=null">
when id=#{item.id} then #{item.fundPaymentComBaseString}
</if>
</foreach>
</trim>
<trim prefix="delete_type =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.deleteType!=null">

View File

@ -275,6 +275,13 @@
</if>
</foreach>
</trim>
<trim prefix="other_payment_com_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherPaymentComBaseString!=null">
when id=#{item.id} then #{item.otherPaymentComBaseString}
</if>
</foreach>
</trim>
<trim prefix="delete_type =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.deleteType!=null">

View File

@ -929,6 +929,13 @@
</if>
</foreach>
</trim>
<trim prefix="social_payment_com_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialPaymentComBaseString!=null">
when id=#{item.id} then #{item.socialPaymentComBaseString}
</if>
</foreach>
</trim>
<trim prefix="delete_type =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.deleteType!=null">

View File

@ -1121,12 +1121,50 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (CollectionUtils.isNotEmpty(excelInsuranceDetailPOS)) {
excelInsuranceDetailPOS.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
encryptUtil.decrypt(po, ExcelInsuranceDetailPO.class);
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo));
po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo));
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo));
po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo));
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo));
po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), 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 {
encryptUtil.encrypt(po, ExcelInsuranceDetailPO.class);
po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString()));
po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString()));
po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString()));
po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString()));
po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString()));
po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString()));
po.setSocialPerJson(AESEncryptUtil.encrypt(po.getSocialPerJson()));
po.setSocialPerSum(AESEncryptUtil.encrypt(po.getSocialPerSum()));
po.setFundPerJson(AESEncryptUtil.encrypt(po.getFundPerJson()));
po.setFundPerSum(AESEncryptUtil.encrypt(po.getFundPerSum()));
po.setOtherPerJson(AESEncryptUtil.encrypt(po.getOtherPerJson()));
po.setOtherPerSum(AESEncryptUtil.encrypt(po.getOtherPerSum()));
po.setPerSum(AESEncryptUtil.encrypt(po.getPerSum()));
po.setSocialComJson(AESEncryptUtil.encrypt(po.getSocialComJson()));
po.setSocialComSum(AESEncryptUtil.encrypt(po.getSocialComSum()));
po.setComSum(AESEncryptUtil.encrypt(po.getComSum()));
po.setSocialSum(AESEncryptUtil.encrypt(po.getSocialSum()));
po.setFundSum(AESEncryptUtil.encrypt(po.getFundSum()));
po.setOtherSum(AESEncryptUtil.encrypt(po.getOtherSum()));
po.setTotal(AESEncryptUtil.encrypt(po.getTotal()));
}
});
List<List<ExcelInsuranceDetailPO>> partition = Lists.partition(excelInsuranceDetailPOS, 50);
List<List<ExcelInsuranceDetailPO>> partition = Lists.partition(excelInsuranceDetailPOS, 10);
ExcelInsuranceDetailMapper mapper = sqlSession.getMapper(ExcelInsuranceDetailMapper.class);
partition.forEach(mapper::updateBatchSelective);
sqlSession.commit();