diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 2a141497f..b61775290 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -19,6 +19,7 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO; +import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.archive.SalaryArchiveItemMapper; import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; @@ -35,6 +36,7 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper; +import com.engine.salary.mapper.taxdeclaration.TaxDeclarationValueMapper; import com.engine.salary.sys.constant.SalarySysConstant; import com.engine.salary.sys.entity.param.AppSettingSaveParam; import com.engine.salary.sys.entity.param.OrderRuleParam; @@ -138,6 +140,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe return MapperProxyFactory.getProxy(SpecialAddDeductionMapper.class); } + private TaxDeclarationValueMapper getTaxDeclarationValueMapper() { + return MapperProxyFactory.getProxy(TaxDeclarationValueMapper.class); + } + /** * 操作是否需要申报功能 @@ -447,7 +453,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe @Override public List getListByCodes(List codes) { - if(CollectionUtils.isEmpty(codes)){ + if (CollectionUtils.isEmpty(codes)) { return Collections.emptyList(); } return getSalarySysConfMapper().getListByCodes(codes); @@ -519,11 +525,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } SalarySysConfPO salaryAcctEmployeeRule = salarySysConfMap.get(SALARY_ACCT_EMPLOYEE_RULE); - if (salaryAcctEmployeeRule == null ) { + if (salaryAcctEmployeeRule == null) { // 薪资核算人员匹配规则 appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue()); } else { - appSettingVO.setSalaryAcctEmployeeRule( SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue() ); + appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue()); } SalarySysConfPO withDrawRule = salarySysConfMap.get(WITHDRAW_TAX_DECLARATION); @@ -544,7 +550,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe SalarySysConfPO salarySendFeedbackPO = salarySysConfMap.get(SALARY_SEND_FEEDBACK); - if (salarySendFeedbackPO == null ) { + if (salarySendFeedbackPO == null) { // 是否开启工资单反馈,默认不开启 appSettingVO.setSalarySendFeedback("0"); } else { @@ -1045,14 +1051,40 @@ 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 taxDeclarationValuePO = getTaxDeclarationValueMapper().listAll(); + if (CollectionUtils.isNotEmpty(taxDeclarationValuePO)) { + taxDeclarationValuePO.forEach(po -> { + if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { + encryptUtil.decrypt(po, TaxDeclarationValuePO.class); + } else { + encryptUtil.encrypt(po, TaxDeclarationValuePO.class); + } + }); + TaxDeclarationValueMapper mapper = sqlSession.getMapper(TaxDeclarationValueMapper.class); + taxDeclarationValuePO.forEach(mapper::updateIgnoreNull); + sqlSession.commit(); + log.info("finish hrsa_tax_declaration_detail"); + } + } catch (Exception e) { + sqlSession.rollback(); + log.error("fail hrsa_tax_declaration_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); diff --git a/src/com/engine/salary/web/SalarySystemConfigController.java b/src/com/engine/salary/web/SalarySystemConfigController.java index ae1b52d67..1d07bd7d3 100644 --- a/src/com/engine/salary/web/SalarySystemConfigController.java +++ b/src/com/engine/salary/web/SalarySystemConfigController.java @@ -274,7 +274,7 @@ public class SalarySystemConfigController { } /** - * 应用设置 + * 保存加密设置 * * @param request * @param response