核算的分权
This commit is contained in:
parent
a69bd42b49
commit
be88b90f56
|
|
@ -33,7 +33,6 @@ public class AddUpDeductionDTO {
|
|||
* 主键id
|
||||
*/
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
@TableTitle(title = "id", dataIndex = "id", key = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ public class AddUpDeductionRecordDTO {
|
|||
|
||||
//主键id
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
@TableTitle(title = "id", dataIndex = "id", key = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
//员工id
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ public class AddUpSituationDTO {
|
|||
//主键id
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
@TableTitle(title = "id", dataIndex = "id", key = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
//员工id
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import java.util.Date;
|
|||
public class AddUpSituationRecordDTO {
|
||||
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
@TableTitle(title = "id", dataIndex = "id", key = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty(index = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.entity.datacollection.dto;
|
|||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -30,8 +31,8 @@ public class OtherDeductionRecordDTO {
|
|||
private Long id;
|
||||
|
||||
//申报月份
|
||||
|
||||
@SalaryTableColumn(text = "申报月份", width = "10%", column = "declareMonth", transmethod = "com.engine.salary.transmethod.TransMethod.timeToMoth")
|
||||
@TableTitle(title = "申报月份", dataIndex = "declareMonth", key = "declareMonth")
|
||||
private Date declareMonth;
|
||||
|
||||
//员工id
|
||||
|
|
@ -41,6 +42,7 @@ public class OtherDeductionRecordDTO {
|
|||
|
||||
//个税扣缴义务人
|
||||
@SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName")
|
||||
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
|
||||
private String taxAgentName;
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
|
|
@ -50,31 +52,38 @@ public class OtherDeductionRecordDTO {
|
|||
|
||||
//部门
|
||||
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
//手机号
|
||||
@SalaryTableColumn(text = "手机号", width = "10%", column = "mobile")
|
||||
@TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile")
|
||||
private String mobile;
|
||||
|
||||
private String idNo;
|
||||
|
||||
//工号
|
||||
@SalaryTableColumn(text = "工号", width = "10%", column = "jobNum")
|
||||
@TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum")
|
||||
private String jobNum;
|
||||
|
||||
//商业健康保险
|
||||
@SalaryTableColumn(text = "商业健康保险", width = "10%", column = "businessHealthyInsurance")
|
||||
@TableTitle(title = "商业健康保险", dataIndex = "businessHealthyInsurance", key = "businessHealthyInsurance")
|
||||
private String businessHealthyInsurance;
|
||||
|
||||
//税延养老保险
|
||||
@SalaryTableColumn(text = "税延养老保险", width = "10%", column = "taxDelayEndowmentInsurance")
|
||||
@TableTitle(title = "税延养老保险", dataIndex = "taxDelayEndowmentInsurance", key = "taxDelayEndowmentInsurance")
|
||||
private String taxDelayEndowmentInsurance;
|
||||
|
||||
//其他
|
||||
@SalaryTableColumn(text = "其他", width = "10%", column = "otherDeduction")
|
||||
@TableTitle(title = "其他", dataIndex = "otherDeduction", key = "otherDeduction")
|
||||
private String otherDeduction;
|
||||
|
||||
//准予扣除的捐赠额
|
||||
@SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "deductionAllowedDonation")
|
||||
@TableTitle(title = "准予扣除的捐赠额", dataIndex = "deductionAllowedDonation", key = "deductionAllowedDonation")
|
||||
private String deductionAllowedDonation;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@ import java.time.YearMonth;
|
|||
public class AttendQuoteCheckOperationParam {
|
||||
|
||||
//薪资所属月
|
||||
@DataCheck(require = true, message = "薪资所属月必传")
|
||||
private YearMonth salaryYearMonth;
|
||||
|
||||
@DataCheck(require = true, message = "薪资所属月必传")
|
||||
private String salaryYearMonthStr;
|
||||
|
||||
//关联账套id
|
||||
@DataCheck(require = true, message = "关联账套id必传")
|
||||
private Long salarySobId;
|
||||
|
|
|
|||
|
|
@ -129,10 +129,11 @@ public class SalarySobBO {
|
|||
* @param salarySobPO 薪资账套po
|
||||
* @return
|
||||
*/
|
||||
public static SalarySobBasicFormDTO convert2FormDTO(SalarySobPO salarySobPO) {
|
||||
return new SalarySobBasicFormDTO()
|
||||
public static SalarySobBasicFormDTO convert2FormDTO(SalarySobBasicFormDTO basicForm,SalarySobPO salarySobPO) {
|
||||
return basicForm
|
||||
.setId(salarySobPO.getId())
|
||||
.setName(salarySobPO.getName())
|
||||
.setName(salarySobPO.getName())
|
||||
.setTaxableItems(salarySobPO.getIncomeCategory())
|
||||
.setSalaryCycleType(salarySobPO.getSalaryCycleType())
|
||||
.setSalaryCycleFromDay(salarySobPO.getSalaryCycleFromDay())
|
||||
|
|
@ -140,7 +141,7 @@ public class SalarySobBO {
|
|||
.setAttendCycleType(salarySobPO.getAttendCycleType())
|
||||
.setAttendCycleFromDay(salarySobPO.getAttendCycleFromDay())
|
||||
.setSocialSecurityCycleType(salarySobPO.getSocialSecurityCycleType())
|
||||
.setEmployeeRange("1")
|
||||
.setTaxAgentId(salarySobPO.getTaxAgentId())
|
||||
.setDescription(salarySobPO.getDescription());
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ public class SalarySobBasicFormDTO {
|
|||
// //薪资账套的名称")
|
||||
private String name;
|
||||
|
||||
private Long taxAgentId;
|
||||
// private String taxAgentName;
|
||||
|
||||
/**
|
||||
* 薪资类型
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ public class SalarySobListDTO {
|
|||
//主键id
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
@TableTitle(title = "id", key = "id", dataIndex = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
@SalaryTableColumn(text = "账套名称", width = "10%", column = "name")
|
||||
|
|
@ -48,7 +47,6 @@ public class SalarySobListDTO {
|
|||
private String salaryCycle;
|
||||
|
||||
@SalaryTableColumn(text = "薪资周期起始日期", width = "10%", column = "salaryCycleFromDay", display = false)
|
||||
@TableTitle(title = "薪资周期起始日期", key = "salaryCycleFromDay", dataIndex = "salaryCycleFromDay", display = false)
|
||||
private String salaryCycleFromDay;
|
||||
|
||||
@SalaryTableColumn(text = "启用", width = "10%", column = "disable")
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public enum TargetTypeEnum implements BaseEnum<Integer> {
|
|||
* @return
|
||||
*/
|
||||
public static List<Map<String, Object>> getSelectList() {
|
||||
return Arrays.asList(TargetTypeEnum.values()).stream().filter(e -> e != ALL && e != SUBCOMPANY).map(e -> {
|
||||
return Arrays.asList(TargetTypeEnum.values()).stream().filter(e -> e != ALL ).map(e -> {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", e.name());
|
||||
map.put("name", e.defaultLabel);
|
||||
|
|
|
|||
|
|
@ -396,24 +396,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return getAddUpDeductionMapper().getById(id);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取作为修改者的最新记录
|
||||
// * 说明:以人员id和个税口角义务人id去重
|
||||
// *
|
||||
// * @param currentEmployeeId
|
||||
// * @return
|
||||
// */
|
||||
// private List<AddUpDeduction> getLastListByModifier(Long currentEmployeeId) {
|
||||
// List<AddUpDeductionPO> list = new LambdaQueryChainWrapper<>(getAddUpDeductionMapper())
|
||||
// .eq(AddUpDeductionPO::getDeleteType, 0)
|
||||
// .eq(AddUpDeductionPO::getTenantKey)
|
||||
// .eq(AddUpDeductionPO::getModifier, currentEmployeeId)
|
||||
// .orderByDesc(AddUpDeductionPO::getDeclareMonth)
|
||||
// .list();
|
||||
// return list.stream()
|
||||
// .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new));
|
||||
// }
|
||||
|
||||
@Override
|
||||
public PageInfo<AddUpDeductionDTO> listPage(AddUpDeductionQueryParam queryParam) {
|
||||
long employeeId = user.getUID();
|
||||
|
|
@ -424,23 +406,17 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<AddUpDeductionDTO> list = getAddUpDeductionMapper().list(queryParam);
|
||||
return new PageInfo<>(list, AddUpDeductionDTO.class);
|
||||
} else {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// List<AddUpDeductionPO> lastList = getLastListByModifier(employeeId);
|
||||
List<AddUpDeductionDTO> list = getAddUpDeductionMapper().list(queryParam);
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
// 作为分管理员
|
||||
// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
|
||||
// 自己最后修改过的,则可以看到最新和其历史
|
||||
// || lastList.stream().anyMatch(l -> l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getDeclareMonth().isBefore(f.getDeclareMonth()))
|
||||
).collect(Collectors.toList());
|
||||
// 填充总数和当页数据
|
||||
// 分页参数
|
||||
PageInfo<AddUpDeductionDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AddUpDeductionDTO.class);
|
||||
dtoPage.setTotal(list.size());
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getSize(), list));
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getPageSize(), list));
|
||||
return dtoPage;
|
||||
}
|
||||
}
|
||||
|
|
@ -454,23 +430,17 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<AddUpDeductionRecordDTO> list = getAddUpDeductionMapper().recordList(queryParam);
|
||||
return new PageInfo<>(list, AddUpDeductionRecordDTO.class);
|
||||
} else {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// List<AddUpDeductionPO> lastList = getLastListByModifier(employeeId, tenantKey);
|
||||
List<AddUpDeductionRecordDTO> list = getAddUpDeductionMapper().recordList(queryParam);
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
// 作为分管理员
|
||||
// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
|
||||
// 自己最后修改过的,则可以看到最新和其历史
|
||||
// || lastList.stream().anyMatch(l -> l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getDeclareMonth().isBefore(f.getDeclareMonth()))
|
||||
).collect(Collectors.toList());
|
||||
// 分页参数
|
||||
// 填充总数和当页数据
|
||||
PageInfo<AddUpDeductionRecordDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AddUpDeductionRecordDTO.class);
|
||||
dtoPage.setTotal(list.size());
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getSize(), list));
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getPageSize(), list));
|
||||
return dtoPage;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
|
|||
import com.engine.salary.entity.datacollection.param.AddUpSituationImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -169,26 +168,17 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
List<AddUpSituationDTO> list = getAddUpSituationMapper().list(queryParam);
|
||||
return new PageInfo<>(list, AddUpSituationDTO.class);
|
||||
} else {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// List<AddUpSituation> lastList = getLastListByModifier(employeeId, tenantKey);
|
||||
// List<ExtEmployeePO> extEmployeeList = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey);
|
||||
List<AddUpSituationDTO> list = getAddUpSituationMapper().list(queryParam);
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
// // 作为分管理员
|
||||
// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
|
||||
// // 自己最后修改过的,则可以看到最新和其历史
|
||||
// || lastList.stream().anyMatch(l -> l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getTaxYearMonth().isBefore(f.getTaxYearMonth()))
|
||||
// // 外部人员
|
||||
// || extEmployeeList.stream().anyMatch(t -> t.getTaxAgentId().equals(f.getTaxAgentId()) && t.getId().equals(f.getEmployeeId()))
|
||||
).collect(Collectors.toList());
|
||||
// 分页参数
|
||||
PageInfo<AddUpSituationDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AddUpSituationDTO.class);
|
||||
// 填充总数和当页数据
|
||||
dtoPage.setTotal(list.size());
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getSize(), list));
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getPageSize(), list));
|
||||
return dtoPage;
|
||||
}
|
||||
}
|
||||
|
|
@ -202,26 +192,17 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
List<AddUpSituationRecordDTO> list = getAddUpSituationMapper().recordList(queryParam);
|
||||
return new PageInfo<>(list, AddUpSituationRecordDTO.class);
|
||||
} else {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// List<AddUpSituationPO> lastList = getLastListByModifier(employeeId, tenantKey);
|
||||
// List<ExtEmployeePO> extEmployeeList = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey);
|
||||
List<AddUpSituationRecordDTO> list = getAddUpSituationMapper().recordList(queryParam);
|
||||
// 分页参数
|
||||
PageInfo<AddUpSituationRecordDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), AddUpSituationRecordDTO.class);
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
// // 作为分管理员
|
||||
// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
|
||||
// // 自己最后修改过的,则可以看到最新和其历史
|
||||
// || lastList.stream().anyMatch(l -> l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getTaxYearMonth().isBefore(f.getTaxYearMonth()))
|
||||
// // 外部人员
|
||||
// || extEmployeeList.stream().anyMatch(t -> t.getTaxAgentId().equals(f.getTaxAgentId()) && t.getId().equals(f.getEmployeeId()))
|
||||
).collect(Collectors.toList());
|
||||
// 填充总数和当页数据
|
||||
dtoPage.setTotal(list.size());
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getSize(), list));
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getPageSize(), list));
|
||||
return dtoPage;
|
||||
}
|
||||
}
|
||||
|
|
@ -273,17 +254,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
List<AddUpSituationDTO> list = biz.list(param);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentV2Service(user).isOpenDevolution() && !getTaxAgentV2Service(user).isChief(employeeId)) {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
// // 作为分管理员
|
||||
// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
|
||||
// // 自己最后修改过的,则可以看到最新和其历史
|
||||
// || lastList.stream().anyMatch(l->l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getTaxYearMonth().isBefore(f.getTaxYearMonth()))
|
||||
// // 外部人员
|
||||
// || extEmployeeList.stream().anyMatch(t -> t.getTaxAgentId().equals(f.getTaxAgentId()) && t.getId().equals(f.getEmployeeId()))
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
|
@ -346,19 +319,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
|
||||
// 开启了分权
|
||||
if (getTaxAgentV2Service(user).isOpenDevolution() || !getTaxAgentV2Service(user).isChief(employeeId)) {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// List<ExtEmployeePO> extEmployeeList = extEmployeeService.listCanUseByEmployeeId(employeeId);
|
||||
// List<AddUpSituationPO> lastList = getLastListByModifier(employeeId);
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
// // 作为分管理员
|
||||
// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
|
||||
// // 自己最后修改过的,则可以看到最新和其历史
|
||||
// || lastList.stream().anyMatch(l->l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getTaxYearMonth().isBefore(f.getTaxYearMonth()))
|
||||
// // 外部人员
|
||||
// || extEmployeeList.stream().anyMatch(t -> t.getTaxAgentId().equals(f.getTaxAgentId()) && t.getId().equals(f.getEmployeeId()))
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
final List<List<String>> dataRowList = Optional.ofNullable(list)
|
||||
|
|
|
|||
|
|
@ -319,7 +319,10 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
po.setEmployeeId(employeeId);
|
||||
pos.add(po);
|
||||
for (Map<String, Object> attendQuoteData : attendQuoteSyncData) {
|
||||
if (attendQuoteData.get("employeeId").toString().equals(employeeId.toString())) {
|
||||
if (!Objects.isNull(attendQuoteData.get("employeeId")) &&
|
||||
!Objects.isNull(employeeId) &&
|
||||
!Objects.isNull(attendQuoteData.get("attendQuoteFieldId")) &&
|
||||
attendQuoteData.get("employeeId").toString().equals(employeeId.toString())) {
|
||||
values.add(AttendQuoteDataValuePO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
.createTime(now)
|
||||
|
|
@ -625,7 +628,6 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
}
|
||||
|
||||
|
||||
|
||||
for (int j = 0; j < headers.size(); j++) {
|
||||
String key = headers.get(j);
|
||||
if (key == null) {
|
||||
|
|
|
|||
|
|
@ -79,9 +79,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
List<OtherDeductionListDTO> list = getOtherDeductionMapper().list(queryParam);
|
||||
return new PageInfo<>(list, OtherDeductionListDTO.class);
|
||||
} else {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// List<OtherDeductionPO> lastList = getLastListByModifier(employeeId, tenantKey);
|
||||
List<OtherDeductionListDTO> list = getOtherDeductionMapper().list(queryParam);
|
||||
|
||||
list = list.stream().filter(f ->
|
||||
|
|
@ -93,7 +91,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
PageInfo<OtherDeductionListDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), OtherDeductionListDTO.class);
|
||||
// 填充总数和当页数据
|
||||
dtoPage.setTotal(list.size());
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getSize(), list));
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getPageSize(), list));
|
||||
return dtoPage;
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +118,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
PageInfo<OtherDeductionRecordDTO> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), OtherDeductionRecordDTO.class);
|
||||
// 填充总数和当页数据
|
||||
dtoPage.setTotal(list.size());
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getSize(), list));
|
||||
dtoPage.setList(SalaryPageUtil.subList(dtoPage.getPageNum(), dtoPage.getPageSize(), list));
|
||||
return dtoPage;
|
||||
}
|
||||
}
|
||||
|
|
@ -391,7 +389,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
List<OtherDeductionListDTO> list = getOtherDeductionMapper().list(param);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentV2Service(user).isOpenDevolution() && !getTaxAgentV2Service(user).isChief(employeeId)) {
|
||||
// List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentV2Service(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentV2Service(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
long currentEmployeeId = user.getUID();
|
||||
// 参数
|
||||
SalaryAcctRecordPO po = SalaryAcctRecordPO.builder().build();
|
||||
PageInfo<SalaryAcctRecordPO> page = new PageInfo<>();
|
||||
PageInfo<SalaryAcctRecordPO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
if (StringUtils.isNotEmpty(queryParam.getName())) {
|
||||
// 根据查询条件中的薪资账套名称查询薪资账套
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByNameLike(queryParam.getName());
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
|
||||
// 获取所有个税扣缴义务人
|
||||
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll();
|
||||
Collection<SalaryArchiveListDTO> salaryArchives = salaryArchiveMapper.list(queryParam);
|
||||
List<SalaryArchiveListDTO> salaryArchives = list(queryParam);
|
||||
List<Map<String, Object>> listMaps = buildSalaryArchiveData(salaryArchives, taxAgentList, salaryItems, Boolean.FALSE);
|
||||
// 组装数据
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -109,7 +109,8 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
if (StringUtils.isEmpty(name)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return salarySobMapper.listSome(SalarySobPO.builder().name(name).build());
|
||||
List<SalarySobPO> salarySobPOS = salarySobMapper.listSome(SalarySobPO.builder().name(name).build());
|
||||
return filterByAuthority(salarySobPOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -117,12 +118,14 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
if (StringUtils.isEmpty(nameLike)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return salarySobMapper.listByParam(SalarySobPO.builder().name(nameLike).build());
|
||||
List<SalarySobPO> salarySobPOS = salarySobMapper.listByParam(SalarySobPO.builder().name(nameLike).build());
|
||||
return filterByAuthority(salarySobPOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySobPO> listByDisable(Integer disable) {
|
||||
return salarySobMapper.listSome(SalarySobPO.builder().disable(disable).build());
|
||||
List<SalarySobPO> salarySobPOS = salarySobMapper.listSome(SalarySobPO.builder().disable(disable).build());
|
||||
return filterByAuthority(salarySobPOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -148,21 +151,20 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
build.setName(name);
|
||||
}
|
||||
if (BooleanUtils.isTrue(openDevolution) && !isChief) {
|
||||
List<SalarySobPO> salarySobPOS = salarySobMapper.listSome(build);
|
||||
|
||||
List<SalarySobPO> salarySobPOS = salarySobMapper.listSome(build);
|
||||
// 根据权限过滤
|
||||
List<SalarySobPO> salarySobsFilterByAuthority = filterByAuthority(salarySobPOS);
|
||||
if (CollectionUtils.isEmpty(salarySobsFilterByAuthority)) {
|
||||
return page;
|
||||
}
|
||||
List<SalarySobPO> subSalarySobs = SalaryPageUtil.subList((int) page.getPageNum(), (int) page.getSize(), salarySobsFilterByAuthority);
|
||||
List<SalarySobPO> subSalarySobs = SalaryPageUtil.subList((int) page.getPageNum(), (int) page.getPageSize(), salarySobsFilterByAuthority);
|
||||
page.setTotal(salarySobsFilterByAuthority.size());
|
||||
page.setList(subSalarySobs);
|
||||
return page;
|
||||
}else{
|
||||
} else {
|
||||
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
List<SalarySobPO> salarySobPOS = salarySobMapper.listSome(build);
|
||||
return new PageInfo<>(salarySobPOS,SalarySobPO.class);
|
||||
return new PageInfo<>(salarySobPOS, SalarySobPO.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +187,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
|
||||
Boolean adminEnable = getTaxAgentService(user).isAdminEnable(employeeId);
|
||||
//非管理员
|
||||
if(!adminEnable){
|
||||
if (!adminEnable) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
|
@ -198,7 +200,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
}
|
||||
return salarySobsFilterByAuthority;
|
||||
|
||||
}else{
|
||||
} else {
|
||||
return salarySobMapper.listSome(build);
|
||||
}
|
||||
}
|
||||
|
|
@ -500,8 +502,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||
// 开启分权后
|
||||
// 总管理员都能看见
|
||||
// 管理员可以看见自己创建的+自己下面的分管理员创建的
|
||||
// 分管理员只能看见自己创建的
|
||||
// 管理员自己管理的个税下的
|
||||
if (!openDevolution || isChief) {
|
||||
return salarySobPOS;
|
||||
}
|
||||
|
|
@ -511,9 +512,6 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
// 查询个税扣缴义务人的管理员
|
||||
List<TaxAgentAdminPO> taxAgentAdminPOS = getTaxAgentAdminService(user).listByTaxAgentIds(allTaxAgentIds);
|
||||
Map<Long, Set<Long>> adminMap = SalaryEntityUtil.group2Map(taxAgentAdminPOS, TaxAgentAdminPO::getEmployeeId, TaxAgentAdminPO::getTaxAgentId);
|
||||
// 查询个税扣缴义务人的分管理员
|
||||
// List<TaxAgentSubAdminPO> taxAgentSubAdminPOS = taxAgentSubAdminService.listByTaxAgentIds(allTaxAgentIds, tenantKey);
|
||||
// Map<Long, Set<Long>> subAdminMap = SalaryEntityUtil.group2Map(taxAgentSubAdminPOS, TaxAgentSubAdminPO::getTaxAgentId, TaxAgentSubAdminPO::getEmployeeId);
|
||||
return salarySobPOS.stream().filter(salarySobPO -> {
|
||||
Set<Long> taxAgentIds = adminMap.get(employeeId);
|
||||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class SalarySobController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listSalarySob(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobListQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySobListQueryParam, Map<String, Object>>(user).run(getSalarySobWrapper(user)::listPage, queryParam);
|
||||
return new ResponseResult<SalarySobListQueryParam, PageInfo<SalarySobListDTO>>(user).run(getSalarySobWrapper(user)::listPage, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -107,6 +107,10 @@ public class AttendQuoteWrapper extends Service {
|
|||
*/
|
||||
public Boolean checkOperation(AttendQuoteCheckOperationParam checkOperationParam) {
|
||||
ValidUtil.doValidator(checkOperationParam);
|
||||
|
||||
String salaryYearMonthStr = checkOperationParam.getSalaryYearMonthStr();
|
||||
YearMonth yearMonth = SalaryDateUtil.String2YearMonth(salaryYearMonthStr);
|
||||
checkOperationParam.setSalaryYearMonth(yearMonth);
|
||||
return getAttendQuoteService(user).checkOperation(checkOperationParam.getSalaryYearMonth(), checkOperationParam.getSalarySobId());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ public class SalarySendWrapper extends Service {
|
|||
// 是否合并计税
|
||||
// TODO: 1/25/22 判断是否合并计税
|
||||
|
||||
// Page<Map<String, Object>> listPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount());
|
||||
// Page<Map<String, Object>> listPage = new Page<>(page.getCurrent(), page.getPageSize(), page.getTotal(), page.isSearchCount());
|
||||
// listPage.setRecords(listMaps);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
|||
import com.engine.salary.service.SalarySobService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.SalarySobServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
|
@ -38,8 +39,10 @@ public class SalarySobWrapper extends Service {
|
|||
return (SalarySobService) ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService taxAgentService;
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
/**
|
||||
* 薪资账套列表
|
||||
*
|
||||
|
|
@ -85,7 +88,7 @@ public class SalarySobWrapper extends Service {
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除"));
|
||||
}
|
||||
// 薪资装套po转换成薪资账套详情dto
|
||||
basicForm = SalarySobBO.convert2FormDTO(salarySobPO);
|
||||
basicForm = SalarySobBO.convert2FormDTO(basicForm,salarySobPO);
|
||||
}
|
||||
// 转换成前端所需的数据格式
|
||||
data.put("basicForm", basicForm);
|
||||
|
|
@ -155,11 +158,11 @@ public class SalarySobWrapper extends Service {
|
|||
}
|
||||
|
||||
// 判断是否开启了分权
|
||||
Boolean openDevolution = taxAgentService.isOpenDevolution();
|
||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||
if (!openDevolution) {
|
||||
return true;
|
||||
}
|
||||
Collection<TaxAgentPO> taxAgentPOS = taxAgentService.listAllTaxAgents(employeeId);
|
||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId);
|
||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId);
|
||||
|
||||
return taxAgentIds.contains(salarySobPO.getTaxAgentId());
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class TaxAgentSubAdminWrapper extends Service {
|
|||
PageInfo<TaxAgentSubAdminListDTO> listPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxAgentSubAdminListDTO.class);
|
||||
// 填充总数和当页数据
|
||||
listPage.setTotal(records.size());
|
||||
listPage.setList(SalaryPageUtil.subList(listPage.getPageNum(), listPage.getSize(), records));
|
||||
listPage.setList(SalaryPageUtil.subList(listPage.getPageNum(), listPage.getPageSize(), records));
|
||||
|
||||
return listPage;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue