diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java index 105c0f636..1129a814f 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.java @@ -36,4 +36,8 @@ public interface ExcelInsuranceDetailMapper { * 批量保存 */ void batchSave(@Param("accounts") Collection accounts); + + List listAll(); + + void updateBatchSelective(@Param("list")List excelInsuranceDetailPOS); } diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml index 15ac635ce..53c1265b1 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml @@ -69,10 +69,13 @@ , 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 @@ -114,6 +117,185 @@ + + update hrsa_excel_bill_detail + + + + + + when id = #{item.id} then #{item.socialPaymentComBaseString} + + + + + + + when id = #{item.id} then #{item.fundPaymentComBaseString} + + + + + + + when id = #{item.id} then #{item.otherPaymentComBaseString} + + + + + + + when id = #{item.id} then #{item.socialPaymentBaseString} + + + + + + + when id = #{item.id} then #{item.fundPaymentBaseString} + + + + + + + when id = #{item.id} then #{item.otherPaymentBaseString} + + + + + + + when id = #{item.id} then #{item.socialPerJson} + + + + + + + when id = #{item.id} then #{item.socialPerSum} + + + + + + + when id = #{item.id} then #{item.fundPerJson} + + + + + + + when id = #{item.id} then #{item.fundPerSum} + + + + + + + when id = #{item.id} then #{item.otherPerJson} + + + + + + + when id = #{item.id} then #{item.otherPerSum} + + + + + + + when id = #{item.id} then #{item.perSum} + + + + + + + when id = #{item.id} then #{item.socialComJson} + + + + + + + when id = #{item.id} then #{item.socialComSum} + + + + + + + when id = #{item.id} then #{item.fundComJson} + + + + + + + when id = #{item.id} then #{item.fundComSum} + + + + + + + when id = #{item.id} then #{item.otherComJson} + + + + + + + when id = #{item.id} then #{item.otherComSum} + + + + + + + when id = #{item.id} then #{item.comSum} + + + + + + + when id = #{item.id} then #{item.socialSum} + + + + + + + when id = #{item.id} then #{item.fundSum} + + + + + + + when id = #{item.id} then #{item.otherSum} + + + + + + + when id = #{item.id} then #{item.total} + + + + + where id in + + #{item.id} + + + + diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index f99f6ef0c..2b3754e64 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -1143,6 +1143,29 @@ + + + + + when id=#{item.id} then #{item.socialPaymentComBaseString} + + + + + + + when id=#{item.id} then #{item.fundPaymentComBaseString} + + + + + + + when id=#{item.id} then #{item.otherPaymentComBaseString} + + + + diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index afdde68a1..750d36814 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -285,6 +285,13 @@ + + + + when id=#{item.id} then #{item.fundPaymentComBaseString} + + + diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index 12adf7fb4..7885d7358 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -275,6 +275,13 @@ + + + + when id=#{item.id} then #{item.otherPaymentComBaseString} + + + diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 79562932f..14bc0be8e 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -929,6 +929,13 @@ + + + + when id=#{item.id} then #{item.socialPaymentComBaseString} + + + diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index cf3c4b893..24050fafc 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -13,6 +13,7 @@ import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; +import com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO; @@ -28,6 +29,7 @@ import com.engine.salary.mapper.datacollection.OtherDeductionMapper; import com.engine.salary.mapper.datacollection.SpecialAddDeductionMapper; import com.engine.salary.mapper.salaryacct.ExcelAcctResultMapper; import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper; +import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siarchives.FundSchemeMapper; @@ -45,12 +47,12 @@ import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.enums.*; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; -import com.engine.salary.util.db.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -143,6 +145,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return MapperProxyFactory.getProxy(SpecialAddDeductionMapper.class); } + private ExcelInsuranceDetailMapper getExcelInsuranceDetailMapper() { + return MapperProxyFactory.getProxy(ExcelInsuranceDetailMapper.class); + } + private SalarySysConfService getSalarySysConfService(User user) { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } @@ -1107,14 +1113,81 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } return 1; }); - int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get(); - if (flag == 14) { + + Future submit14 = fixedThreadPool.submit(() -> { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + List excelInsuranceDetailPOS = getExcelInsuranceDetailMapper().listAll(); + if (CollectionUtils.isNotEmpty(excelInsuranceDetailPOS)) { + excelInsuranceDetailPOS.forEach(po -> { + if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { + 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 { + 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> partition = Lists.partition(excelInsuranceDetailPOS, 10); + ExcelInsuranceDetailMapper mapper = sqlSession.getMapper(ExcelInsuranceDetailMapper.class); + partition.forEach(mapper::updateBatchSelective); + sqlSession.commit(); + log.info("finish hrsa_excel_bill_detail"); + } + } catch (Exception e) { + sqlSession.rollback(); + log.error("fail hrsa_excel_bill_detail", e); + return 0; + } finally { + sqlSession.close(); + } + return 1; + }); + + int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get(); + if (flag == 15) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "success", 30); } else { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); } Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS); - return flag == 14; + return flag == 15; } catch (Exception e) { Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30); Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS);