往期累计模块

This commit is contained in:
钱涛 2024-09-20 17:01:37 +08:00
parent 0ece125d18
commit f62dfa17be
1 changed files with 10 additions and 25 deletions

View File

@ -218,17 +218,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
@Override
public PageInfo<AddUpSituationRecordDTO> recordListPage(AddUpSituationQueryParam queryParam) {
long employeeId = user.getUID();
Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId);
if (needAuth) {
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) {
return new PageInfo<>(AddUpSituationRecordDTO.class);
}
queryParam.setTaxAgentIds(taxAgentIdsAsAdmin);
}
List<AddUpSituationRecordDTO> list = getAddUpSituationMapper().recordList(queryParam);
PageInfo<AddUpSituationRecordDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
@ -252,7 +241,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100353, "参数有误:税款所属期必传"));
}
AddUpSituationBiz biz = new AddUpSituationBiz();
List<AddUpSituation> addUpSituations = biz.listSome(AddUpSituation.builder().taxAgentId(taxAgentId).taxYearMonth(taxCycle).build());
Set<Long> addUpSituationIds = SalaryEntityUtil.properties(addUpSituations, AddUpSituation::getId);
@ -266,8 +254,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
@Override
public XSSFWorkbook export(AddUpSituationQueryParam queryParam) {
queryParam.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
// 获取操作按钮资源
queryParam.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
List<List<Object>> rowList = getExcelRowList(queryParam, true);
// 记录日志
@ -291,7 +279,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
* @return 导出数据行集合
*/
private List<List<Object>> getExcelRowList(AddUpSituationQueryParam param, boolean hasData) {
long employeeId = user.getUID();
// excel标题
final List<Object> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用",
"累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人",
@ -544,8 +531,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
//税款所属期
String taxYearMonthStr = Util.null2String(importParam.getTaxYearMonth());
Long currentEmployeeId = (long) user.getUID();
// 获取所有个税扣缴义务人
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
@ -857,18 +842,19 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
*/
@Override
public void editAddUpSituation(AddUpSituationParam addUpSituationParam) {
Long currentEmployeeId = (long) user.getUID();
AddUpSituationBiz biz = new AddUpSituationBiz();
//税款所属期
String taxYearMonthStr = addUpSituationParam.getTaxYearMonth();
// 获取所有个税扣缴义务人
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
List<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
AddUpSituation byId = biz.getById(addUpSituationParam.getId());
if (byId == null) {
throw new SalaryRunTimeException("该数据不存在!");
}
Long taxAgentId = byId.getTaxAgentId();
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId));
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getId(), taxAgentId));
if (!canEdit) {
//没有编辑权限
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
@ -934,7 +920,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
//税款所属期
String taxYearMonthStr = Util.null2String(addUpSituationParam.getTaxYearMonth());
// 获取所有个税扣缴义务人
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
List<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
// 获取租户下所有的人员
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listEmployee();
// 已经核算过的不可操作
@ -948,8 +936,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
//合规数据
List<AddUpSituation> insertList = new ArrayList<>();
List<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> taxAgentEmployees = Lists.newArrayList();
//待插入数据库对象
AddUpSituation po = AddUpSituation.builder().tenantKey(DEFAULT_TENANT_KEY)
.createTime(now)
@ -971,10 +957,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
//个税扣缴义务人不能为空
throw new SalaryRunTimeException("个税扣缴义务人不能为空");
} else {
Optional<TaxAgentManageRangeEmployeeDTO> optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst();
Optional<TaxAgentPO> optionalTemp = taxAgentList.stream().filter(m -> m.getName().equals(taxAgentName)).findFirst();
if (optionalTemp.isPresent()) {
po.setTaxAgentId(optionalTemp.get().getTaxAgentId());
taxAgentEmployees = optionalTemp.get().getEmployeeList();
po.setTaxAgentId(optionalTemp.get().getId());
} else {
//个税扣缴义务人不存在
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");