撤回个税申报
This commit is contained in:
parent
b2f39f56e2
commit
c37750b538
|
|
@ -21,6 +21,11 @@ import java.time.YearMonth;
|
|||
@AllArgsConstructor
|
||||
public class TaxDeclarationSaveParam {
|
||||
|
||||
/**
|
||||
* 个税申报id
|
||||
*/
|
||||
private Long taxDeclarationId;
|
||||
|
||||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
<update id="deleteByIdZj">
|
||||
UPDATE hrsa_tax_declaration
|
||||
SET delete_type = 3
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -45,4 +45,9 @@ public interface TaxDeclarationService {
|
|||
*/
|
||||
boolean checkByAuthority(TaxDeclarationPO taxDeclarationPO, Long employeeId);
|
||||
|
||||
/**
|
||||
* 撤回个税申报单
|
||||
* @param taxDeclarationId
|
||||
*/
|
||||
void withDrawTaxDeclaration(Long taxDeclarationId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -315,4 +315,24 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withDrawTaxDeclaration(Long taxDeclarationId) {
|
||||
TaxDeclarationPO po = getTaxDeclarationMapper().getById(taxDeclarationId);
|
||||
if(Objects.isNull(po)){
|
||||
throw new SalaryRunTimeException("个税申报表不存在");
|
||||
}
|
||||
// 获取当前个税扣缴义务人下的薪资账套
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByTaxAgentId(po.getTaxAgentId());
|
||||
List<Long> salarySobIds = salarySobPOS.stream().map(SalarySobPO::getId).collect(Collectors.toList());
|
||||
// 获取记录
|
||||
LocalDateRange dateRange = new LocalDateRange(po.getSalaryMonth(), po.getSalaryMonth());
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listBySalarySobIdsAndSalaryMonth(salarySobIds, dateRange);
|
||||
List<Long> salaryAcctRecordIds = salaryAcctRecords.stream().map(SalaryAcctRecordPO::getId).collect(Collectors.toList());
|
||||
// 删除个税申报表
|
||||
getTaxDeclarationMapper().deleteByIdZj(po.getId());
|
||||
// 修改薪资核算记录状态为已归档
|
||||
if(CollectionUtils.isNotEmpty(salaryAcctRecordIds)){
|
||||
getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds,SalaryAcctRecordStatusEnum.ARCHIVED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,15 @@ public class TaxDeclarationController {
|
|||
return new ResponseResult<TaxDeclarationListQueryParam, PageInfo<TaxDeclarationListDTO>>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/withDrawTaxDeclaration")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteTaxDeclaration(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclarationWrapper(user)::withDrawTaxDeclaration, param.getTaxDeclarationId());
|
||||
}
|
||||
|
||||
|
||||
//个税申报表表单
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
|
|
|
|||
|
|
@ -151,5 +151,11 @@ public class TaxDeclarationWrapper extends Service {
|
|||
getTaxDeclarationService(user).save(saveParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 撤回个税申报
|
||||
* @param taxDeclarationId
|
||||
*/
|
||||
public void withDrawTaxDeclaration(Long taxDeclarationId) {
|
||||
getTaxDeclarationService(user).withDrawTaxDeclaration(taxDeclarationId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue