业务线分权;
This commit is contained in:
parent
a688ca8b52
commit
9c6e7f46b5
|
|
@ -108,12 +108,9 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
private List<Map<String, Object>> buildReportIdsOptions(Long employeeId) {
|
||||
List<Map<String, Object>> reportIdsOptions = new ArrayList<>();
|
||||
List<SalaryStatisticsReportPO> reportPOS = getSalaryStatisticsReportService(user).listAll();
|
||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
||||
if (needAuth) {
|
||||
// 只能够分享创建人是本人的报表
|
||||
reportPOS = reportPOS.stream().filter(po -> po.getCreator().compareTo(employeeId) == 0).collect(Collectors.toList());
|
||||
}
|
||||
reportPOS.forEach( po -> {
|
||||
// 只能够分享创建人是本人的报表
|
||||
reportPOS = reportPOS.stream().filter(po -> po.getCreator().compareTo(employeeId) == 0).collect(Collectors.toList());
|
||||
reportPOS.forEach(po -> {
|
||||
Map<String, Object> option = new HashMap<>();
|
||||
option.put("id", po.getId().toString());
|
||||
option.put("reportName", po.getReportName());
|
||||
|
|
@ -129,10 +126,6 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
if (Objects.isNull(salaryStatisticsPushPO)) {
|
||||
throw new SalaryRunTimeException("该分享记录不存在");
|
||||
}
|
||||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
||||
if (needAuth && salaryStatisticsPushPO.getCreator().compareTo(Long.valueOf(user.getUID())) != 0) {
|
||||
throw new SalaryRunTimeException("无权查看该分享记录");
|
||||
}
|
||||
SalaryStatisticsPushDetail result = new SalaryStatisticsPushDetail();
|
||||
result.setDetailForm(buildDetailForm(salaryStatisticsPushPO));
|
||||
result.setDetailTable(buildDetailTable(param));
|
||||
|
|
@ -279,10 +272,10 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
List<SalaryStatisticsPushDetailPO> salaryStatisticsPushDetailPOS = getSalaryStatisticsPushDetailService(user).queryPushDetailPOByBatchIds(batchId);
|
||||
salaryStatisticsPushDetailPOS.stream().filter(po -> Objects.equals(po.getPushStatus(), "true") && !(Objects.equals(po.getRebackStatus(), "true")) && Objects.equals(uid, po.getEmployeeId()))
|
||||
.collect(Collectors.toList()).forEach(e -> {
|
||||
e.setViewStatus("true");
|
||||
e.setUpdateTime(new Date());
|
||||
getSalaryStatisticsPushDetailService(user).updateIgnoreNull(e);
|
||||
});
|
||||
e.setViewStatus("true");
|
||||
e.setUpdateTime(new Date());
|
||||
getSalaryStatisticsPushDetailService(user).updateIgnoreNull(e);
|
||||
});
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
|
@ -342,7 +335,6 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
}
|
||||
|
||||
|
||||
|
||||
// public CancleMessageEntity buildCancelMessageEntity(SalaryStatisticsPushDetailPO po, Long employeeId, String tenantKey) {
|
||||
// SalaryStatisticsPushPO pushPO = salaryStatisticsPushMapper.selectById(po.getBatchId());
|
||||
// CancleMessageEntity cancleMessageEntity = new CancleMessageEntity();
|
||||
|
|
@ -650,7 +642,7 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
|
||||
List<SalaryStatisticsPushPO> salaryStatisticsPushPOS;
|
||||
if (needAuth) {
|
||||
salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().creator(Long.valueOf(user.getUID())).build());
|
||||
salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().creator((long) user.getUID()).build());
|
||||
} else {
|
||||
salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().build());
|
||||
}
|
||||
|
|
@ -729,7 +721,7 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
return Collections.emptyList();
|
||||
}
|
||||
List<SalaryStatisticsPushPO> pushList = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition((List<Long>)batchIds, 1000);
|
||||
List<List<Long>> partition = Lists.partition((List<Long>) batchIds, 1000);
|
||||
partition.forEach(ids -> {
|
||||
pushList.addAll(getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().ids(ids).build()));
|
||||
});
|
||||
|
|
@ -739,13 +731,13 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
@Override
|
||||
public List<SalaryStatisticsPushPO> getPushListByReportIdAndIds(Long reportId, List<Long> ids) {
|
||||
List<SalaryStatisticsPushPO> pushList = getSalaryStatisticsPushMapper().listByReportIdAndIds(reportId.toString(), ids);
|
||||
pushList = pushList.stream().filter( push -> {
|
||||
pushList = pushList.stream().filter(push -> {
|
||||
return Arrays.asList(push.getReportIds().split(",")).contains(reportId.toString());
|
||||
}).collect(Collectors.toList());
|
||||
return pushList;
|
||||
}
|
||||
|
||||
List<SalaryStatisticsPushPO> filterReportByTime(List<SalaryStatisticsPushPO> pushList){
|
||||
List<SalaryStatisticsPushPO> filterReportByTime(List<SalaryStatisticsPushPO> pushList) {
|
||||
// 报表分享时间校验
|
||||
String formatLocalDateTime = SalaryDateUtil.getFormatLocalDate(LocalDateTime.now());
|
||||
List<SalaryStatisticsPushPO> result = pushList.stream().filter(pushPO -> {
|
||||
|
|
@ -763,14 +755,14 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt
|
|||
List<SalaryStatisticsPushDetailPO> successPushDetailList = getSalaryStatisticsPushDetailService(user).getSuccessPushDetailListByReceiver(uid);
|
||||
// 根据报表id,分享批次id查询分享批次信息
|
||||
List<Long> batchIds = successPushDetailList.stream().map(SalaryStatisticsPushDetailPO::getBatchId).collect(Collectors.toList());
|
||||
List<SalaryStatisticsPushPO> pushList= getPushListByReportIdAndIds(reportId,batchIds);
|
||||
List<SalaryStatisticsPushPO> pushList = getPushListByReportIdAndIds(reportId, batchIds);
|
||||
if (CollectionUtils.isEmpty(pushList)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"暂无权限查看该报表"));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "暂无权限查看该报表"));
|
||||
}
|
||||
// 校验是否在分享的有效时间内
|
||||
pushList = filterReportByTime(pushList);
|
||||
if (CollectionUtils.isEmpty(pushList)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该报表的分享不在有效期内,无法查看"));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该报表的分享不在有效期内,无法查看"));
|
||||
}
|
||||
return pushList;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue