parent
6e7ccb2339
commit
ee535fc2bf
|
|
@ -10,6 +10,21 @@
|
|||
|
||||
<module name="配置" key="config">
|
||||
|
||||
<page name="个税扣缴义务人" key="taxAgent">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="业务线管理" key="auth">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="社保福利方案" key="siScheme">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="薪资项目管理" key="salaryItem">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
|
|
@ -22,13 +37,7 @@
|
|||
|
||||
</module>
|
||||
|
||||
|
||||
<module name="算薪" key="calculate">
|
||||
|
||||
<page name="社保福利方案" key="siScheme">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
<module name="计算" key="calculate">
|
||||
|
||||
<page name="社保福利档案" key="siArchive">
|
||||
<opt name="查询" key="query"/>
|
||||
|
|
@ -59,33 +68,40 @@
|
|||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
</module>
|
||||
|
||||
<module name="数据采集" key="tax">
|
||||
<page name="个税申报" key="taxDeclaration">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
</module>
|
||||
|
||||
<module name="数据采集" key="collection">
|
||||
|
||||
<page name="累计专项附加扣除" key="addUpDeduction">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="专项附加扣除" key="specialAddDeduction">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="其他免税扣除" key="otherDeduction">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="往期累计情况" key="addUpSituation">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="考勤引用" key="attendQuote">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
</page>
|
||||
|
||||
<page name="浮动数据" key="variableArchive">
|
||||
<opt name="查询" key="query"/>
|
||||
<opt name="管理" key="admin"/>
|
||||
|
|
|
|||
|
|
@ -30,4 +30,9 @@ update hrsa_salary_sob_default_item set delete_type =3 where delete_type =0;
|
|||
update hrsa_salary_sob_item set delete_type= 3 where delete_type =0 and salary_item_id in (select id from hrsa_salary_item where delete_type=0 and system_type=1 and use_in_employee_salary =0 and code not in('ressueTotal','issuedTotal')
|
||||
);
|
||||
|
||||
UPDATE hrsa_salary_item set delete_type = 3 where delete_type=0 and system_type=1 and use_in_employee_salary =0 and code not in('ressueTotal','issuedTotal');
|
||||
UPDATE hrsa_salary_item set delete_type = 3 where delete_type=0 and system_type=1 and use_in_employee_salary =0 and code not in('ressueTotal','issuedTotal');
|
||||
|
||||
|
||||
# 开启系统算税
|
||||
update hrsa_salary_sys_conf set conf_value = '1' where conf_key = 'taxDeclarationFunction'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.annotation.Auth;
|
||||
import com.engine.salary.annotation.I18n;
|
||||
import com.engine.salary.annotation.SalaryFormulaVar;
|
||||
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
|
||||
|
|
@ -28,6 +29,7 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
//hrsa_salary_acct_emp
|
||||
@ElogTransform(name = "薪资核算人员")
|
||||
@Auth(page = "salaryAcct")
|
||||
public class SalaryAcctEmployeePO {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
||||
|
|
@ -23,6 +25,8 @@ import com.engine.salary.report.entity.param.SalaryStatisticsEmployeeQueryParam;
|
|||
import com.engine.salary.report.entity.param.SalaryStatisticsEmployeeSalaryQueryParam;
|
||||
import com.engine.salary.report.service.SalaryStatisticsEmployeeService;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.auth.AuthService;
|
||||
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.util.SalaryAssert;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -33,7 +37,6 @@ import com.engine.salary.util.page.PageInfo;
|
|||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.wbi.util.Util;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -89,13 +92,19 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public AuthService getAuthService(User user) {
|
||||
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<SalaryStatisticsEmployeeListDTO> listPage(SalaryStatisticsEmployeeQueryParam queryParam) {
|
||||
List<SalaryStatisticsEmployeeListDTO> list = Collections.emptyList();
|
||||
PageInfo<SalaryStatisticsEmployeeListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, SalaryStatisticsEmployeeListDTO.class);
|
||||
|
||||
// 1.分权处理, 首先获取个税扣缴义务人参数
|
||||
Collection<TaxAgentPO> taxAgentViews = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
||||
TaxAgentQueryParam taxAgentQueryParam = new TaxAgentQueryParam();
|
||||
taxAgentQueryParam.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||
Collection<TaxAgentPO> taxAgentViews = getTaxAgentService(user).listAuth(taxAgentQueryParam);
|
||||
List<Long> taxAgentIds = Objects.isNull(taxAgentViews) ? Lists.newArrayList() : taxAgentViews.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(taxAgentIds)) {
|
||||
return page;
|
||||
|
|
@ -109,39 +118,15 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByTaxAgentAndSalaryMonth(taxAgentIds, salaryMonths);
|
||||
salaryAcctEmployeeList = getAuthService(user).auth(salaryAcctEmployeeList, AuthFilterTypeEnum.QUERY_DATA,SalaryAcctEmployeePO.class,"report");
|
||||
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||
return page;
|
||||
}
|
||||
// if (queryParam.getEmployeeType() != null) {
|
||||
// salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(s -> queryParam.getEmployeeType().getValue().equals(s.getEmployeeType())).collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
// // 外部人员id
|
||||
// Set<Long> extEmployeeIds = Sets.newHashSet();
|
||||
// 内部人员id
|
||||
Set<Long> innerEmployeeIds = Sets.newHashSet();
|
||||
for (SalaryAcctEmployeePO sae : salaryAcctEmployeeList) {
|
||||
// if (EmployeeTypeEnum.EXT_EMPLOYEE.getValue().equals(sae.getEmployeeType())) {
|
||||
// extEmployeeIds.add(sae.getEmployeeId());
|
||||
// } else if (EmployeeTypeEnum.ORGANIZATION.getValue().equals(sae.getEmployeeType())) {
|
||||
// innerEmployeeIds.add(sae.getEmployeeId());
|
||||
// }
|
||||
innerEmployeeIds.add(sae.getEmployeeId());
|
||||
}
|
||||
Set<Long> innerEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeeList, SalaryAcctEmployeePO::getEmployeeId);
|
||||
// 3.关键字搜索参数
|
||||
if (StringUtils.isNotEmpty(queryParam.getKeyword())) {
|
||||
// if (CollectionUtils.isNotEmpty(extEmployeeIds)) {
|
||||
// // 查询外部人员
|
||||
// List<ExtEmployeePO> extEmployeeList = new LambdaQueryChainWrapper<>(extEmployeeMapper)
|
||||
// .eq(ExtEmployeePO::getTenantKey, tenantKey)
|
||||
// .eq(ExtEmployeePO::getDeleteType, 0)
|
||||
// .list();
|
||||
// Set<Long> finalExtEmployeeIds = extEmployeeIds;
|
||||
// extEmployeeIds = extEmployeeList.stream()
|
||||
// .filter(e -> finalExtEmployeeIds.contains(e.getId()) && (e.getUsername().contains(queryParam.getKeyword()) || (StringUtils.isNotEmpty(e.getCardNum()) && e.getCardNum().contains(queryParam.getKeyword()))))
|
||||
// .map(ExtEmployeePO::getId)
|
||||
// .collect(Collectors.toSet());
|
||||
// }
|
||||
if (CollectionUtils.isNotEmpty(innerEmployeeIds)) {
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
||||
Set<Long> finalInnerEmployeeIds = innerEmployeeIds;
|
||||
|
|
@ -149,38 +134,15 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
.filter(e -> finalInnerEmployeeIds.contains(e.getEmployeeId()) && (e.getUsername().contains(queryParam.getKeyword()) || (StringUtils.isNotEmpty(e.getWorkcode()) && e.getWorkcode().contains(queryParam.getKeyword()))))
|
||||
.map(DataCollectionEmployee::getEmployeeId)
|
||||
.collect(Collectors.toSet());
|
||||
// Map<Long, String> idNoMap = idNoMapByEmployeeIds(finalInnerEmployeeIds);
|
||||
// for (Long k : idNoMap.keySet()) {
|
||||
// if (idNoMap.get(k) != null && idNoMap.get(k).contains(queryParam.getKeyword())) {
|
||||
// innerEmployeeIds.addAll(idNoMap.keySet());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
List<Long> innerEmployeeIdList = innerEmployeeIds.stream().sorted(Comparator.comparing(e -> e)).collect(Collectors.toList());
|
||||
// List<Long> extEmployeeIdList = extEmployeeIds.stream().sorted(Comparator.comparing(e -> e)).collect(Collectors.toList());
|
||||
// 排序,内部员工优先
|
||||
list = innerEmployeeIdList.stream().map(e -> SalaryStatisticsEmployeeListDTO.builder()
|
||||
.id(e)
|
||||
// .employeeType(EmployeeTypeEnum.ORGANIZATION.getValue())
|
||||
.build()).collect(Collectors.toList());
|
||||
// list.addAll(extEmployeeIdList.stream().map(e -> SalaryStatisticsEmployeeListDTO.builder()
|
||||
// .id(e)
|
||||
// .employeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue())
|
||||
// .build()).collect(Collectors.toList()));
|
||||
list = innerEmployeeIds.stream().map(e -> SalaryStatisticsEmployeeListDTO.builder().id(e).build()).collect(Collectors.toList());
|
||||
|
||||
// 第一页数据显示处理
|
||||
page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, SalaryStatisticsEmployeeListDTO.class);
|
||||
List<SalaryStatisticsEmployeeListDTO> salaryStatisticsEmployeeListDTOs = page.getList();
|
||||
List<Long> employeeIds = salaryStatisticsEmployeeListDTOs.stream().map(SalaryStatisticsEmployeeListDTO::getId).collect(Collectors.toList());
|
||||
// 查询外部人员
|
||||
// List<ExtEmployeePO> extEmployeeList = CollectionUtils.isEmpty(extEmployeeIdList) ? Lists.newArrayList() : new LambdaQueryChainWrapper<>(extEmployeeMapper)
|
||||
// .eq(ExtEmployeePO::getTenantKey, tenantKey)
|
||||
// .eq(ExtEmployeePO::getDeleteType, 0)
|
||||
// .in(ExtEmployeePO::getId, extEmployeeIdList)
|
||||
// .list();
|
||||
// Map<Long, ExtEmployeePO> extEmployeeMap = extEmployeeList.stream().collect(Collectors.toMap(ExtEmployeePO::getId, v -> v));
|
||||
List<DataCollectionEmployee> simpleEmployeeList = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
|
||||
Map<Long, DataCollectionEmployee> innerEmployeeMap = simpleEmployeeList.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, v -> v));
|
||||
salaryStatisticsEmployeeListDTOs.forEach(e -> {
|
||||
|
|
@ -295,11 +257,10 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
|
||||
@Override
|
||||
public PageInfo<SalaryAcctEmployeePO> listSalaryAcctEmp(SalaryStatisticsEmployeeSalaryQueryParam queryParam) {
|
||||
List<SalaryStatisticsEmployeeListDTO> list = Collections.emptyList();
|
||||
PageInfo<SalaryStatisticsEmployeeListDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, SalaryStatisticsEmployeeListDTO.class);
|
||||
|
||||
// 1.分权处理, 首先获取个税扣缴义务人参数
|
||||
Collection<TaxAgentPO> taxAgentViews = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
||||
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
|
||||
Collection<TaxAgentPO> taxAgentViews = getTaxAgentService(user).listAuth(param);
|
||||
List<Long> taxAgentIds = Objects.isNull(taxAgentViews) ? Lists.newArrayList() : taxAgentViews.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(queryParam.getTaxAgentIds())) {
|
||||
taxAgentIds = taxAgentIds.stream().filter(queryParam.getTaxAgentIds()::contains).collect(Collectors.toList());
|
||||
|
|
@ -323,6 +284,8 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByTaxAgentAndSalaryMonth(taxAgentIds, salaryMonths);
|
||||
salaryAcctEmployeeList = getAuthService(user).auth(salaryAcctEmployeeList, AuthFilterTypeEnum.QUERY_DATA,SalaryAcctEmployeePO.class,"report");
|
||||
|
||||
if (CollectionUtils.isNotEmpty(queryParam.getSubCompanyIds()) || CollectionUtils.isNotEmpty(queryParam.getDepartmentIds()) || StringUtils.isNotBlank(queryParam.getKeyword())) {
|
||||
// 根据分部、部门筛选
|
||||
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listBySubCompanyOrDepartment(queryParam.getSubCompanyIds(), queryParam.getDepartmentIds());
|
||||
|
|
|
|||
|
|
@ -255,6 +255,7 @@ public interface SalaryAcctEmployeeService {
|
|||
* @return
|
||||
*/
|
||||
List<SalaryAcctEmployeePO> listByTaxAgentAndSalaryMonth(List<Long> taxAgentIds, Set<Date> salaryMonths);
|
||||
List<SalaryAcctEmployeePO> listBySobAndSalaryMonth(List<Long> salarySobIds, Set<Date> salaryMonths);
|
||||
|
||||
/**
|
||||
* 锁定人员
|
||||
|
|
|
|||
|
|
@ -17,5 +17,7 @@ public interface AuthService {
|
|||
|
||||
<T> List<T> auth(List<T> list, AuthFilterTypeEnum filterType, Class<T> clazz);
|
||||
|
||||
<T> List<T> auth(List<T> list, AuthFilterTypeEnum filterType, Class<T> clazz,String page);
|
||||
|
||||
Permission permission(String page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ 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.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
|
@ -44,9 +45,13 @@ public class AuthServiceImpl extends Service implements AuthService {
|
|||
return MapperProxyFactory.getProxy(AuthMapper.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T> List<T> auth(List<T> list, AuthFilterTypeEnum filterType, Class<T> clazz) {
|
||||
return auth(list, filterType, clazz, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> auth(List<T> list, AuthFilterTypeEnum filterType, Class<T> clazz, String page) {
|
||||
Boolean isOpenDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||
boolean isAuth = clazz.isAnnotationPresent(Auth.class);
|
||||
|
||||
|
|
@ -91,7 +96,7 @@ public class AuthServiceImpl extends Service implements AuthService {
|
|||
|
||||
List<T> resultList = new ArrayList<>();
|
||||
|
||||
String page = auth.page();
|
||||
page = page == null ? auth.page() : page;
|
||||
AuthCheckTypeEnum checkType = auth.checkType();
|
||||
|
||||
//给各管理员赋值对应的扣缴义务人权限
|
||||
|
|
@ -286,13 +291,27 @@ public class AuthServiceImpl extends Service implements AuthService {
|
|||
|
||||
boolean able = false;
|
||||
|
||||
//如果是管理员,赋值管理权限返回
|
||||
if (isChief || isAdminEnable) {
|
||||
//不需要鉴权的页面
|
||||
List<String> noAuthPage = Lists.newArrayList("myBill");
|
||||
|
||||
//只允许总管理进去的界面
|
||||
List<String> chiefPage = Lists.newArrayList("auth");
|
||||
|
||||
if (noAuthPage.contains(page)) {
|
||||
opts.add("admin");
|
||||
able = true;
|
||||
} else if (chiefPage.contains(page)) {
|
||||
opts.add("admin");
|
||||
able = isChief;
|
||||
} else {
|
||||
opts = getAuthMapper().getOptsByPage(uid, page);
|
||||
able = CollectionUtil.isNotEmpty(opts);
|
||||
//如果是管理员,赋值管理权限返回
|
||||
if (isChief || isAdminEnable) {
|
||||
opts.add("admin");
|
||||
able = true;
|
||||
} else {
|
||||
opts = getAuthMapper().getOptsByPage(uid, page);
|
||||
able = CollectionUtil.isNotEmpty(opts);
|
||||
}
|
||||
}
|
||||
|
||||
return Permission.builder()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
|
|
@ -500,7 +501,9 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
throw new SalaryRunTimeException("税款所属期不能为空!");
|
||||
}
|
||||
// 获取所有个税扣缴义务人
|
||||
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
|
||||
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
|
||||
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
|
||||
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
|
||||
//个税扣缴义务人
|
||||
String taxAgentId = Util.null2String(addUpDeductionRecordParam.getTaxAgentId());
|
||||
// 获取租户下所有的人员
|
||||
|
|
@ -515,7 +518,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
//查询对于人员信息导入筛选的全局配置
|
||||
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
||||
List<AddUpDeduction> insertData = new ArrayList<>();
|
||||
List<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> taxAgentEmployees = Lists.newArrayList();
|
||||
Date now = new Date();
|
||||
//待插入数据库对象
|
||||
AddUpDeduction addUpDeduction = AddUpDeduction.builder().tenantKey(DEFAULT_TENANT_KEY).createTime(now).updateTime(now).creator((long) user.getUID()).declareMonth(declareMonth).build();
|
||||
|
|
@ -530,27 +532,15 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
//个税扣缴义务人不能为空
|
||||
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()) {
|
||||
addUpDeduction.setTaxAgentId(optionalTemp.get().getTaxAgentId());
|
||||
taxAgentEmployees = optionalTemp.get().getEmployeeList();
|
||||
addUpDeduction.setTaxAgentId(optionalTemp.get().getId());
|
||||
} else {
|
||||
//个税扣缴义务人不存在或不在权限范围内
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
||||
}
|
||||
}
|
||||
|
||||
//fixme 分权判断
|
||||
// if (openDevolution) {
|
||||
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId())).findFirst();
|
||||
// if (!optionalTaxAgentEmp.isPresent()) {
|
||||
// Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
|
||||
// errorData.add(errorMessageMap);
|
||||
// errorSum += 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId()) && f.getTaxAgentId().equals(addUpDeduction.getTaxAgentId())).findFirst();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import com.engine.salary.mapper.salarysob.SobTaxLinkMapper;
|
|||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryParam;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.auth.AuthService;
|
||||
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
|
|
@ -79,6 +81,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
return ServiceUtil.getService(SalaryAcctReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public AuthService getAuthService(User user) {
|
||||
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||
}
|
||||
|
||||
// private SalaryCheckResultDetailService salaryCheckResultDetailService;
|
||||
|
||||
// private SalaryComparisonResultService salaryComparisonResultService;
|
||||
|
|
@ -785,6 +791,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
return getSalaryAcctEmployeeMapper().listSome(SalaryAcctEmployeePO.builder().taxAgentIds(taxAgentIds).salaryMonths(salaryMonths).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctEmployeePO> listBySobAndSalaryMonth(List<Long> salarySobIds, Set<Date> salaryMonths) {
|
||||
return getSalaryAcctEmployeeMapper().listSome(SalaryAcctEmployeePO.builder().salarySobIds(salarySobIds).salaryMonths(salaryMonths).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lockEmp(SalaryAcctResultUpdateLockStatusParam updateParam) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue