fix
This commit is contained in:
parent
7ffc241b0a
commit
e66c86d32c
|
|
@ -25,42 +25,35 @@ public class SalaryArchivePO {
|
|||
/**
|
||||
* 主键id
|
||||
*/
|
||||
//主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 人员信息表的主键id
|
||||
*/
|
||||
//人员信息表的主键id")
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
//创建时间", ignore = true)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
//更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
//创建人", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
//是否已删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
//租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 范围表单
|
||||
|
|
@ -26,10 +28,10 @@ public class TaxAgentManageRangeFormDTO {
|
|||
//对象类型
|
||||
private TargetTypeEnum targetType;
|
||||
|
||||
// private List<TypesBrowserOption> targetOptions;
|
||||
|
||||
//对象id")
|
||||
//对象id
|
||||
private Long targetId;
|
||||
|
||||
private List<Map<String, Object>> targetTypeList;
|
||||
|
||||
private Collection<HrmStatus> employeeStatus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package com.engine.salary.enums.salarysob;
|
|||
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 人员范围的对象类型
|
||||
|
|
@ -19,7 +21,7 @@ public enum TargetTypeEnum implements BaseEnum<Integer> {
|
|||
SUBCOMPANY(3, "分部", 107369),
|
||||
POSITION(4, "岗位", 90633),
|
||||
ALL(5, "所有人", 107729);
|
||||
// EXT_EMPLOYEE(100, "外部人员", 0);
|
||||
// EXT_EMPLOYEE(100, "外部人员", 0);
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
|
@ -48,6 +50,21 @@ public enum TargetTypeEnum implements BaseEnum<Integer> {
|
|||
return defaultLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下拉列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static List<Map<String, Object>> getSelectList() {
|
||||
return Arrays.asList(TargetTypeEnum.values()).stream().filter(e -> e != ALL && e != SUBCOMPANY).map(e -> {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", e.name());
|
||||
map.put("name", e.defaultLabel);
|
||||
map.put("value", e.value);
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static TargetTypeEnum parseByValue(Integer value) {
|
||||
for (TargetTypeEnum targetTypeEnum : TargetTypeEnum.values()) {
|
||||
if (Objects.equals(targetTypeEnum.getValue(), value)) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
|||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum;
|
||||
|
|
@ -95,10 +96,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
|
||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
|
||||
if(needAuth){
|
||||
//获取管理的人员范围
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(currentEmployeeId);
|
||||
Set<Long> employeeId = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId);
|
||||
|
||||
//获取所有薪资档案
|
||||
List<SalaryArchiveListDTO> list = getSalaryArchiveMapper().list(queryParam);
|
||||
Set<Long> ids = SalaryEntityUtil.properties(list, SalaryArchiveListDTO::getId);
|
||||
List<SalaryArchiveTaxAgentPO> currentEffectiveTaxAgentList = getCurrentEffectiveTaxAgentList(ids);
|
||||
//todo
|
||||
|
||||
}else {
|
||||
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
List<SalaryArchiveListDTO> list = getSalaryArchiveMapper().list(queryParam);
|
||||
|
|
|
|||
|
|
@ -254,16 +254,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
* @return
|
||||
*/
|
||||
private List<TaxAgentManageRangePO> listBySubAdminIdAndIncludeType(Long subAdminId, Integer includeType) {
|
||||
|
||||
return getTaxAgentManageRangeMapper().listSome(TaxAgentManageRangePO.builder().taxAgentSubAdminId(subAdminId).rangeType(TaxAgentRangeTypeEnum.SUBADMIN.getValue()).includeType(includeType).build());
|
||||
// return new LambdaQueryChainWrapper<>(getTaxAgentManageRangeMapper())
|
||||
// .eq(TaxAgentManageRangePO::getTenantKey)
|
||||
// .eq(TaxAgentManageRangePO::getDeleteType, 0)
|
||||
// .eq(TaxAgentManageRangePO::getTaxAgentSubAdminId, subAdminId)
|
||||
// .eq(TaxAgentManageRangePO::getRangeType, TaxAgentRangeTypeEnum.SUBADMIN.getValue())
|
||||
// .eq(TaxAgentManageRangePO::getIncludeType, includeType)
|
||||
// .orderByDesc(TaxAgentManageRangePO::getId)
|
||||
// .list();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -334,7 +325,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
// 填充总数和当页数据
|
||||
dtoPage.setTotal(taxAgentManageRangeList.size());
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getSize(), taxAgentManageRangeList));
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getPageSize(), taxAgentManageRangeList));
|
||||
return dtoPage;
|
||||
}
|
||||
|
||||
|
|
@ -367,17 +358,17 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
), ArrayList::new));
|
||||
List<DataCollectionEmployee> allSalaryEmployees = this.getManageRangeSalaryEmployees(null, saveParam.getTaxAgentId(), allRanges);
|
||||
// 如果是排除是否会对分管理范围产生影响
|
||||
List<TaxAgentManageRangePO> allSubAdminRanges = listSunAdminRangeByTaxAgentId(saveParam.getTaxAgentId());
|
||||
if (saveParam.getIncludeType().equals(NumberUtils.INTEGER_ZERO)) {
|
||||
List<DataCollectionEmployee> allSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, saveParam.getTaxAgentId(), allSubAdminRanges);
|
||||
|
||||
List<Long> allSalaryEmployeeIds = allSalaryEmployees.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||
allSubAdminSalaryEmployees.removeIf(a -> allSalaryEmployeeIds.contains(a.getEmployeeId()));
|
||||
|
||||
if (CollectionUtils.isNotEmpty(allSubAdminSalaryEmployees)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110122, "分管理员包含该范围,不能删除"));
|
||||
}
|
||||
}
|
||||
// List<TaxAgentManageRangePO> allSubAdminRanges = listSunAdminRangeByTaxAgentId(saveParam.getTaxAgentId());
|
||||
// if (saveParam.getIncludeType().equals(NumberUtils.INTEGER_ZERO)) {
|
||||
// List<DataCollectionEmployee> allSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(null, saveParam.getTaxAgentId(), allSubAdminRanges);
|
||||
//
|
||||
// List<Long> allSalaryEmployeeIds = allSalaryEmployees.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||
// allSubAdminSalaryEmployees.removeIf(a -> allSalaryEmployeeIds.contains(a.getEmployeeId()));
|
||||
//
|
||||
// if (CollectionUtils.isNotEmpty(allSubAdminSalaryEmployees)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110122, "分管理员包含该范围,不能删除"));
|
||||
// }
|
||||
// }
|
||||
/** 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */
|
||||
// todo 保存
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertTaxAgentManageRanges())) {
|
||||
|
|
@ -390,7 +381,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
|
||||
/** 同步本地人员范围的关联人员=========================== */
|
||||
syncLocalEmp(saveParam.getTaxAgentId(), allSalaryEmployees, allSubAdminRanges);
|
||||
syncLocalEmp(saveParam.getTaxAgentId(), allSalaryEmployees, null);
|
||||
|
||||
// 记录日志 todo
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,10 +67,6 @@ public class SalaryArchiveWrapper extends Service {
|
|||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
// private SalaryBatchService salaryBatchService;
|
||||
// private ExecutorService taskExecutor;
|
||||
|
||||
|
||||
/**
|
||||
* 薪资档案列表(分页)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.engine.salary.entity.taxagent.param.*;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
|
|
@ -321,8 +322,9 @@ public class TaxAgentWrapper extends Service {
|
|||
public TaxAgentManageRangeFormDTO getRangeFrom() {
|
||||
// 查询人员状态
|
||||
List<HrmStatus> hrmStatusList = UserStatusEnum.getHrmStatusList();
|
||||
|
||||
return TaxAgentManageRangeFormDTO.builder().employeeStatus(hrmStatusList).build();
|
||||
//人员类型下拉列表
|
||||
List<Map<String, Object>> selectList = TargetTypeEnum.getSelectList();
|
||||
return TaxAgentManageRangeFormDTO.builder().employeeStatus(hrmStatusList).targetTypeList(selectList).build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue