diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java index 0eaa2b5c2..bfdcf2ecc 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.java @@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; @@ -70,5 +71,5 @@ public interface OtherDeductionMapper { */ int delete(OtherDeductionPO otherDeduction); - OtherDeductionPO getByTaxAgentIdAndEmployeeId(@Param("taxAgentId") Long taxAgentId, @Param("employeeId") Long employeeId); + OtherDeductionPO getByTaxAgentIdAndEmployeeIdAndDeclareMonth(@Param("taxAgentId") Long taxAgentId, @Param("employeeId") Long employeeId, @Param("declareMonth") Date declareMonth); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml index ecebc3815..6d8496521 100644 --- a/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/OtherDeductionMapper.xml @@ -59,13 +59,14 @@ WHERE id = #{id} AND delete_type = 0 - SELECT FROM hrsa_other_deduction t WHERE delete_type = 0 AND tax_agent_id = #{taxAgentId} AND employee_id = #{employeeId} + AND declare_month = #{declareMonth} diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 49b627e22..b2d7cc2d0 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -763,7 +763,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction // 错误excel内容 List errorData = new ArrayList<>(); - List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 12, "OtherDeductionTemplate.xlsx"); + List derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx"); for (int i = 0; i < derateDeductionList.size(); i++) { EndowmentInsuranceListDTO dto = derateDeductionList.get(i); @@ -1510,7 +1510,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction po.handleList(); //清除旧数据 - OtherDeductionPO otherDeductionPO = getOtherDeductionMapper().getByTaxAgentIdAndEmployeeId(po.getTaxAgentId(), po.getEmployeeId()); + OtherDeductionPO otherDeductionPO = getOtherDeductionMapper().getByTaxAgentIdAndEmployeeIdAndDeclareMonth(po.getTaxAgentId(), po.getEmployeeId(), po.getDeclareMonth()); if (otherDeductionPO != null) { getOtherDeductionMapper().delete(otherDeductionPO); getFreeIncomeMapper().deleteByMainId(otherDeductionPO.getId());