From 165a775074e75e479d21eea366f1aa53bbcac623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 5 Mar 2025 16:42:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E8=B4=A6=E5=A5=97=E5=92=8C?= =?UTF-8?q?=E6=89=A3=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA=E8=87=AA=E5=85=B3?= =?UTF-8?q?=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salarysob/po/SalarySobPO.java | 1 + .../service/impl/SalarySobServiceImpl.java | 32 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java index fd93761fb..a24fd7b06 100644 --- a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java @@ -58,6 +58,7 @@ public class SalarySobPO { @Deprecated private Long taxAgentId; + @XStreamOmitField List taxAgentIds; /** diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 53085bc9b..ac2c94e36 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.engine.common.util.ServiceUtil; @@ -992,25 +993,22 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { @Override public void handleHistory() { - - int count = getSobTaxLinkMapper().count(); - if (count > 0) { - return; - } - List salarySobPOS = getSalarySobMapper().listAll(); salarySobPOS.forEach(sobPO -> { - SobTaxLinkPO taxLinkPO = SobTaxLinkPO.builder() - .id(IdGenerator.generate()) - .taxAgentId(sobPO.getTaxAgentId()) - .sobId(sobPO.getId()) - .creator((long) user.getUID()) - .createTime(new Date()) - .updateTime(new Date()) - .deleteType(0) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); - getSobTaxLinkMapper().insertIgnoreNull(taxLinkPO); + List sobTaxLinkPOS = getSobTaxLinkMapper().listSome(SobTaxLinkPO.builder().sobId(sobPO.getId()).build()); + if(CollUtil.isEmpty(sobTaxLinkPOS)){ + SobTaxLinkPO taxLinkPO = SobTaxLinkPO.builder() + .id(IdGenerator.generate()) + .taxAgentId(sobPO.getTaxAgentId()) + .sobId(sobPO.getId()) + .creator((long) user.getUID()) + .createTime(new Date()) + .updateTime(new Date()) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getSobTaxLinkMapper().insertIgnoreNull(taxLinkPO); + } }); } }