From 26a3199b1ef3106c97d1111db4ad96f8360b3d80 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 13 Mar 2024 17:58:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E5=8A=A0=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../siaccount/ExcelInsuranceDetailMapper.java | 4 + .../siaccount/ExcelInsuranceDetailMapper.xml | 189 ++++++++++++++++++ .../impl/SalarySysConfServiceImpl.java | 43 +++- 3 files changed, 232 insertions(+), 4 deletions(-) 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..6372d29dd 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/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index cf3c4b893..8dc814429 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,43 @@ 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)) { + encryptUtil.decrypt(po, ExcelInsuranceDetailPO.class); + } else { + encryptUtil.encrypt(po, ExcelInsuranceDetailPO.class); + } + }); + List> partition = Lists.partition(excelInsuranceDetailPOS, 50); + 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); From 8543d70a6654fe507fab0aa0f8870f1b524ab20f Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 14 Mar 2024 11:07:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E5=8A=A0=E8=A7=A3?= =?UTF-8?q?=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../siaccount/ExcelInsuranceDetailMapper.xml | 50 ++++++++++++++++++- .../InsuranceAccountDetailMapper.xml | 23 +++++++++ .../mapper/siarchives/FundSchemeMapper.xml | 7 +++ .../mapper/siarchives/OtherSchemeMapper.xml | 7 +++ .../mapper/siarchives/SocialSchemeMapper.xml | 7 +++ .../impl/SalarySysConfServiceImpl.java | 44 ++++++++++++++-- 6 files changed, 134 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml index 6372d29dd..53c1265b1 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml @@ -313,7 +313,55 @@