Merge branch 'fix/薪资核算页面查看权限校验' into release/2.8.4.2306.02
This commit is contained in:
commit
2bb5d18b90
|
|
@ -200,4 +200,11 @@ public interface SalaryAcctResultService {
|
|||
List<SalaryAcctResultPO> listByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmpIds, Collection<Long> salaryItemIds);
|
||||
|
||||
List<Long> listAcctEmpIdByAcctEmpId(List<Long> salaryAcctEmployeeIds);
|
||||
|
||||
/**
|
||||
* 检查当前用户是否有查看权限
|
||||
* @param salaryAcctRecordId
|
||||
* @return
|
||||
*/
|
||||
Boolean checkAuth(Long salaryAcctRecordId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ import com.engine.salary.common.LocalDateRange;
|
|||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
|
||||
import com.engine.salary.entity.progress.ProgressDTO;
|
||||
import com.engine.salary.entity.report.bo.SalaryAcctResultReportBO;
|
||||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.*;
|
||||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
import com.engine.salary.entity.progress.ProgressDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
|
|
@ -20,6 +20,7 @@ import com.engine.salary.entity.salaryformula.ExpressFormula;
|
|||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.*;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
|
||||
|
|
@ -173,6 +174,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentAdminService getTaxAgentAdminService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentAdminServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private SalaryCheckResultService salaryCheckResultService;
|
||||
|
||||
|
|
@ -1031,4 +1036,21 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// }
|
||||
return salaryItemIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean checkAuth(Long salaryAcctRecordId) {
|
||||
// 获取该核算记录的个税扣缴义务
|
||||
SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
if(Objects.isNull(recordPO)) {
|
||||
return false;
|
||||
}
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(recordPO.getSalarySobId());
|
||||
Long taxAgentId = salarySobPO.getTaxAgentId();
|
||||
List<TaxAgentAdminPO> adminTaxAgentList = getTaxAgentAdminService(user).listByEmployeeId(Long.valueOf(user.getUID()));
|
||||
Optional<TaxAgentAdminPO> canOperate = adminTaxAgentList.stream().filter(po -> NumberUtils.compare(taxAgentId, po.getTaxAgentId()) == 0).findFirst();
|
||||
if(!canOperate.isPresent()){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -371,6 +371,13 @@ public class SalaryAcctController {
|
|||
// **********************************薪资核算人员相关 end*********************************/
|
||||
|
||||
// **********************************薪资核算结果 start*********************************/
|
||||
@GET
|
||||
@Path("/acctresult/checkAuth")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String checkAuth(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("salaryAcctRecordId") Long salaryAcctRecordId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Boolean>(user).run(getSalaryAcctResultWrapper(user)::checkAuth, salaryAcctRecordId);
|
||||
}
|
||||
|
||||
//薪资核算结果列表
|
||||
@POST
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.cache.SalaryCacheKey;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
import com.engine.salary.entity.progress.ProgressDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam;
|
||||
|
|
@ -249,6 +249,17 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有薪资核算结果的查看权限
|
||||
* @param salaryAcctRecordId
|
||||
*/
|
||||
public Boolean checkAuth(Long salaryAcctRecordId) {
|
||||
if(Objects.isNull(salaryAcctRecordId)){
|
||||
return false;
|
||||
}
|
||||
return getSalaryAcctResultService(user).checkAuth(salaryAcctRecordId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 薪资核算-校验
|
||||
|
|
|
|||
Loading…
Reference in New Issue