Merge remote-tracking branch 'remotes/origin/release/2.8.4.2306.02' into feature/230602-数据库适配-PG
This commit is contained in:
commit
faee7160e3
|
|
@ -1,10 +1,7 @@
|
|||
package com.engine.salary.report.entity.po;
|
||||
|
||||
import com.engine.salary.report.enums.UnitTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
|
@ -14,6 +11,7 @@ import java.util.Date;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
//hrsa_salary_statistics_item")
|
||||
//薪酬报表统计子表自定义统计项")
|
||||
public class SalaryStatisticsItemPO implements Serializable {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class SalaryStatisticsItemServiceImpl extends Service implements SalarySt
|
|||
@Override
|
||||
public List<SalaryStatisticsItemPO> listByStatisticsReportId(Long statisticsReportId) {
|
||||
if (statisticsReportId == null) {
|
||||
return null;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return getSalaryStatisticsItemMapper().listSome(SalaryStatisticsItemPO.builder().statReportId(statisticsReportId).build());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,11 +260,12 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(161845, "薪酬统计报表不存在"));
|
||||
}
|
||||
|
||||
// 查询自定义统计项目
|
||||
List<SalaryStatisticsItemPO> salaryStatisticsItemList = this.getSalaryStatisticsItemService(user).listByStatisticsReportId(po.getId());
|
||||
|
||||
// 参数转换
|
||||
SalaryStatisticsReportBO.poToQueryParam(param, po);
|
||||
|
||||
|
||||
String paramMd5 = SecureUtil.md5(param.toString());
|
||||
String paramMd5 = SecureUtil.md5(param + salaryStatisticsItemList.toString());
|
||||
|
||||
//已缓存的报表id
|
||||
String salaryReportIds = Utils.null2String(getSalaryCacheService(user).get(SalaryCacheKey.SALARY_REPORT_IDS));
|
||||
|
|
@ -278,8 +279,6 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
// 查询自定义统计项目
|
||||
List<SalaryStatisticsItemPO> salaryStatisticsItemList = this.getSalaryStatisticsItemService(user).listByStatisticsReportId(po.getId());
|
||||
// 列表data
|
||||
PageInfo<Map<String, Object>> page = this.getSalaryStatisticsReportService(user).buildReportRecords(dimension, param, salaryStatisticsItemList);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -390,7 +390,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
List<Long> salaryItemIds = salaryItems.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
// 1.获取薪资档案所对应的当前生效的薪资项目数据
|
||||
List<SalaryArchiveItemPO> salaryArchiveItemList = Collections.emptyList();
|
||||
if(CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds)){
|
||||
if(CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage){
|
||||
salaryArchiveItemList = getCurrentEffectiveItemList(ids, salaryItemIds);
|
||||
}
|
||||
List<SalaryArchiveItemPO> finalSalaryArchiveItemList = salaryArchiveItemList;
|
||||
|
|
|
|||
|
|
@ -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