|
@@ -65,6 +65,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
|
|
@Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
|
|
public void startAllocation(StartDTO startDTO, Long hospId) {
|
|
public void startAllocation(StartDTO startDTO, Long hospId) {
|
|
|
|
+ long timeMillis = System.currentTimeMillis();
|
|
// 得到这个月的所有导入的成本数据
|
|
// 得到这个月的所有导入的成本数据
|
|
List<CostCostingGroup> costingGroups = costCostingGroupService.getByYearAndDate(startDTO.getYear(), startDTO.getMonth(), hospId);
|
|
List<CostCostingGroup> costingGroups = costCostingGroupService.getByYearAndDate(startDTO.getYear(), startDTO.getMonth(), hospId);
|
|
// 没有重新导入
|
|
// 没有重新导入
|
|
@@ -171,7 +172,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
targetAllocation.setDateMonth(startDTO.getMonth()).setDateYear(startDTO.getYear()).setLevelSort(shareLevelVO.getLeverSort())
|
|
targetAllocation.setDateMonth(startDTO.getMonth()).setDateYear(startDTO.getYear()).setLevelSort(shareLevelVO.getLeverSort())
|
|
.setLevelName(shareLevelVO.getShareName()).setHospId(hospId).setResponsibilityCode(responsibility.getResponsibilityCode())
|
|
.setLevelName(shareLevelVO.getShareName()).setHospId(hospId).setResponsibilityCode(responsibility.getResponsibilityCode())
|
|
.setResponsibilityName(responsibility.getResponsibilityName()).setAccountShareId(accountShareId).setAmount(targetAmount)
|
|
.setResponsibilityName(responsibility.getResponsibilityName()).setAccountShareId(accountShareId).setAmount(targetAmount)
|
|
- .setCreateTime(System.currentTimeMillis()).setTargetResponsibilityCode(valueResponsibilityCode).setTargetResponsibilityName(targetRespName)
|
|
|
|
|
|
+ .setCreateTime(timeMillis).setTargetResponsibilityCode(valueResponsibilityCode).setTargetResponsibilityName(targetRespName)
|
|
.setShareParamCode(paramValue.getShareParamCode()).setShareParamName(shareParamName).setTotalAmount(totalAmount).setShareParamValueNum(paramValue.getValueNum())
|
|
.setShareParamCode(paramValue.getShareParamCode()).setShareParamName(shareParamName).setTotalAmount(totalAmount).setShareParamValueNum(paramValue.getValueNum())
|
|
.setShareParamRate(numerator.divide(reduce, 4))
|
|
.setShareParamRate(numerator.divide(reduce, 4))
|
|
;
|
|
;
|
|
@@ -647,7 +648,7 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
// TODO: 2021/8/26 计算 中间的钱
|
|
// TODO: 2021/8/26 计算 中间的钱
|
|
- BigDecimal amount = allocationQueryService.getTotalByAccountAndRespCode(hospId, dateYear, month, account.getCode(), respCodes.get(i));
|
|
|
|
|
|
+ BigDecimal amount = allocationQueryService.getTotalByAccountAndRespCode(hospId, dateYear, month, account.getCode(), respCodes.get(i));
|
|
map.put(i + 1, amount);
|
|
map.put(i + 1, amount);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -673,15 +674,30 @@ public class AllocationServiceImpl extends ServiceImpl<AllocationMapper, Allocat
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 这年月的数据
|
|
|
|
|
|
+ * 分摊后报表输出
|
|
|
|
+ *
|
|
|
|
+ * @param date yyyy-MM-dd
|
|
|
|
+ * @param hospId 医院id
|
|
|
|
+ * @return List
|
|
*/
|
|
*/
|
|
- private List<AllocationQuery> getAllocationQueriesByYear(Long hospId, int dateYear, int month) {
|
|
|
|
- List<AllocationQuery> list = allocationQueryService.list(
|
|
|
|
- new LambdaQueryWrapper<AllocationQuery>()
|
|
|
|
- .eq(AllocationQuery::getDateYear, dateYear)
|
|
|
|
- .eq(AllocationQuery::getDateMonth, month)
|
|
|
|
- .eq(AllocationQuery::getHospId, hospId)
|
|
|
|
- );
|
|
|
|
- return list;
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<AfterAllocationFormVO> afterAllocationFormList(String date, Long hospId) {
|
|
|
|
+
|
|
|
|
+ DateTime parse = DateUtil.parse(date);
|
|
|
|
+ int year = DateUtil.year(parse);
|
|
|
|
+ int month = DateUtil.month(parse) + 1;
|
|
|
|
+ // 得到这个月的分摊过的分摊层级
|
|
|
|
+ List<Allocation> list = baseMapper.getAllSortLevel(hospId, year, month);
|
|
|
|
+// list.
|
|
|
|
+ List<AfterAllocationFormVO> vos = list.stream().map(i -> {
|
|
|
|
+ AfterAllocationFormVO vo = new AfterAllocationFormVO();
|
|
|
|
+ vo.setYear(i.getDateYear());
|
|
|
|
+ vo.setMonth(i.getDateMonth());
|
|
|
|
+ vo.setShareLevel(i.getLevelSort());
|
|
|
|
+ vo.setShareReportName(i.getShareParamName() + "分摊");
|
|
|
|
+ vo.setShareTime(DateUtil.date(i.getCreateTime()));
|
|
|
|
+ return vo;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ return vos;
|
|
}
|
|
}
|
|
}
|
|
}
|