Merge branch 'fix/240301-加解密开关后社保台账线下对比bug' into release/3.0.0.2403.01

This commit is contained in:
Harryxzy 2024-03-15 09:18:30 +08:00
commit ea2a8540ef
7 changed files with 362 additions and 4 deletions

View File

@ -36,4 +36,8 @@ public interface ExcelInsuranceDetailMapper {
* 批量保存
*/
void batchSave(@Param("accounts") Collection<ExcelInsuranceDetailPO> accounts);
List<ExcelInsuranceDetailPO> listAll();
void updateBatchSelective(@Param("list")List<ExcelInsuranceDetailPO> excelInsuranceDetailPOS);
}

View File

@ -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 @@
</if>
</sql>
<update id="updateBatchSelective" parameterType="java.util.List">
update hrsa_excel_bill_detail
<trim prefix="set" suffixOverrides=",">
<trim prefix="social_payment_com_base_string = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<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="list" index="index" item="item">
<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="list" index="index" item="item">
<if test="item.otherPaymentComBaseString != null">
when id = #{item.id} then #{item.otherPaymentComBaseString}
</if>
</foreach>
</trim>
<trim prefix="social_payment_base_string = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.socialPaymentBaseString != null">
when id = #{item.id} then #{item.socialPaymentBaseString}
</if>
</foreach>
</trim>
<trim prefix="fund_payment_base_string = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.fundPaymentBaseString != null">
when id = #{item.id} then #{item.fundPaymentBaseString}
</if>
</foreach>
</trim>
<trim prefix="other_payment_base_string = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.otherPaymentBaseString != null">
when id = #{item.id} then #{item.otherPaymentBaseString}
</if>
</foreach>
</trim>
<trim prefix="social_per_json = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.socialPerJson != null">
when id = #{item.id} then #{item.socialPerJson}
</if>
</foreach>
</trim>
<trim prefix="social_per_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.socialPerSum != null">
when id = #{item.id} then #{item.socialPerSum}
</if>
</foreach>
</trim>
<trim prefix="fund_per_json = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.fundPerJson != null">
when id = #{item.id} then #{item.fundPerJson}
</if>
</foreach>
</trim>
<trim prefix="fund_per_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.fundPerSum != null">
when id = #{item.id} then #{item.fundPerSum}
</if>
</foreach>
</trim>
<trim prefix="other_per_json = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.otherPerJson != null">
when id = #{item.id} then #{item.otherPerJson}
</if>
</foreach>
</trim>
<trim prefix="other_per_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.otherPerSum != null">
when id = #{item.id} then #{item.otherPerSum}
</if>
</foreach>
</trim>
<trim prefix="per_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.perSum != null">
when id = #{item.id} then #{item.perSum}
</if>
</foreach>
</trim>
<trim prefix="social_com_json = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.socialComJson != null">
when id = #{item.id} then #{item.socialComJson}
</if>
</foreach>
</trim>
<trim prefix="social_com_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.socialComSum != null">
when id = #{item.id} then #{item.socialComSum}
</if>
</foreach>
</trim>
<trim prefix="fund_com_json = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.fundComJson != null">
when id = #{item.id} then #{item.fundComJson}
</if>
</foreach>
</trim>
<trim prefix="fund_com_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.fundComSum != null">
when id = #{item.id} then #{item.fundComSum}
</if>
</foreach>
</trim>
<trim prefix="other_com_json = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.otherComJson != null">
when id = #{item.id} then #{item.otherComJson}
</if>
</foreach>
</trim>
<trim prefix="other_com_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.otherComSum != null">
when id = #{item.id} then #{item.otherComSum}
</if>
</foreach>
</trim>
<trim prefix="com_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.comSum != null">
when id = #{item.id} then #{item.comSum}
</if>
</foreach>
</trim>
<trim prefix="social_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.socialSum != null">
when id = #{item.id} then #{item.socialSum}
</if>
</foreach>
</trim>
<trim prefix="fund_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.fundSum != null">
when id = #{item.id} then #{item.fundSum}
</if>
</foreach>
</trim>
<trim prefix="other_sum = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.otherSum != null">
when id = #{item.id} then #{item.otherSum}
</if>
</foreach>
</trim>
<trim prefix="total = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.total != null">
when id = #{item.id} then #{item.total}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id}
</foreach>
</update>
<select id="queryCompareList" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.social_per_json,t.social_com_json,
@ -129,6 +311,61 @@
AND t.payment_organization = #{paymentOrganization}
AND employee_id = #{employeeId}
</select>
<select id="listAll" resultType="com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO">
SELECT
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
</select>
<!-- 根据主键删除记录 -->
<delete id="deleteById" parameterType="com.engine.salary.entity.siaccount.po.ExcelInsuranceDetailPO">

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

@ -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<Integer> submit14 = fixedThreadPool.submit(() -> {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
List<ExcelInsuranceDetailPO> 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<List<ExcelInsuranceDetailPO>> 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);