fix: 管理员可以编辑该扣缴义务人数据,其他人可以编辑本人数据&一键累计所有个税扣缴义务人下的人员

This commit is contained in:
fcli 2022-11-08 13:46:56 +08:00
parent eb7311f0f3
commit dd5c2ba4ce
3 changed files with 11 additions and 11 deletions

View File

@ -160,7 +160,7 @@ public class SpecialAddDeductionBiz extends BaseBean {
public List<SpecialAddDeductionPO> getByEmployeeId(List<Long> employeeIds, Long taxAgentId) {
if (CollectionUtils.isEmpty(employeeIds)) {
return Collections.emptyList();
employeeIds = Collections.emptyList();
}
return mapper().getByEmployeeIds(employeeIds, taxAgentId)
.stream()

View File

@ -565,14 +565,14 @@
select
<include refid="Base_Column_List"/>
from hrsa_special_add_deduction t1
where
<if test="employeeIds == null or employeeIds.size() == 0">
1 = 2
</if>
<foreach collection="employeeIds" item="employeeId" separator="," open="employee_id in (" close=") ">
#{employeeId}
</foreach>
and tax_agent_id = #{taxAgentId}
and delete_type = 0
<where>
<if test="employeeIds != null and employeeIds.size() != 0">
<foreach collection="employeeIds" item="employeeId" separator="," open="employee_id in (" close=") ">
#{employeeId}
</foreach>
</if>
and tax_agent_id = #{taxAgentId}
and delete_type = 0
</where>
</select>
</mapper>

View File

@ -656,7 +656,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
Collection<Long> employeeIds = getTaxAgentService(user)
.listEmployeeIdsInTaxAgent(taxAgent.getId());
List<SpecialAddDeductionPO> employeePOs = getSpecialAddDeductionService(user)
.getSpecialAddDeductionPOByEmployee(new ArrayList<>(employeeIds), taxAgent.getId());
.getSpecialAddDeductionPOByEmployee(null, taxAgent.getId());
//获取上月员工数据用于累加
LocalDateTime lastMonthDateTime = LocalDateTime.now().minusMonths(1);