报表复制
This commit is contained in:
parent
27255932de
commit
5f371a8e58
|
|
@ -70,6 +70,13 @@ public interface SalaryStatisticsReportService {
|
|||
*/
|
||||
Map<String, Object> delete(Collection<Long> ids );
|
||||
|
||||
/**
|
||||
* 复制
|
||||
* @param id
|
||||
*/
|
||||
void duplicate(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 保存统计范围
|
||||
*
|
||||
|
|
@ -106,5 +113,4 @@ public interface SalaryStatisticsReportService {
|
|||
*/
|
||||
void removeReportCache();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -338,6 +338,34 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void duplicate(Long id) {
|
||||
long uid = user.getUID();
|
||||
Date now = new Date();
|
||||
|
||||
SalaryStatisticsReportPO po = getById(id);
|
||||
SalaryAssert.notNull(po, SalaryI18nUtil.getI18nLabel(152563, "报表不存在"));
|
||||
|
||||
po.setId(IdGenerator.generate());
|
||||
po.setCreator(uid);
|
||||
po.setCreateTime(now);
|
||||
po.setUpdateTime(now);
|
||||
po.setReportName(po.getReportName()+"_copy");
|
||||
|
||||
getSalaryStatisticsReportMapper().insertIgnoreNull(po);
|
||||
|
||||
List<SalaryStatisticsItemPO> itemPOS = getSalaryStatisticsItemService(user).listByStatisticsReportId(id);
|
||||
List<SalaryStatisticsItemPO> itemList = itemPOS.stream().map(item -> {
|
||||
item.setId(IdGenerator.generate());
|
||||
item.setStatReportId(po.getId());
|
||||
item.setCreator(uid);
|
||||
item.setCreateTime(now);
|
||||
item.setUpdateTime(now);
|
||||
return item;
|
||||
}).collect(Collectors.toList());
|
||||
getSalaryStatisticsItemService(user).saveOrUpdateBatch(itemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<Map<String, Object>> buildReportRecords(SalaryStatisticsDimensionPO dimension, SalaryStatisticsReportDataQueryParam param, List<SalaryStatisticsItemPO> salaryStatisticsItemList) {
|
||||
Map<String, Boolean> checkMap = SalaryStatisticsReportBO.checkLoad(salaryStatisticsItemList);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,20 @@ public class SalaryStatisticsReportController {
|
|||
return new ResponseResult<Collection<Long>, Map<String, Object>>(user).run(getSalaryStatisticsReportWrapper(user)::delete, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制薪酬统计报表
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/duplicate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String duplicate(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getSalaryStatisticsReportWrapper(user)::duplicate, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取薪酬统计报表查询条件
|
||||
*
|
||||
|
|
|
|||
|
|
@ -212,6 +212,16 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
return getSalaryStatisticsReportService(user).delete(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制薪资账套
|
||||
* @param id
|
||||
*/
|
||||
public void duplicate(Long id) {
|
||||
if (id == null) {
|
||||
throw new SalaryRunTimeException("id为空");
|
||||
}
|
||||
getSalaryStatisticsReportService(user).duplicate(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取统计条件
|
||||
|
|
@ -470,8 +480,9 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 权限校验
|
||||
*
|
||||
* @param isShared 是否是被分享的报表
|
||||
* @param po 报表po
|
||||
* @param po 报表po
|
||||
*/
|
||||
private void sharedReportCheck(boolean isShared, SalaryStatisticsReportPO po) {
|
||||
if (isShared) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue