|
@@ -202,6 +202,7 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
.eq(HospProfitAndLoss::getDateYear, year)
|
|
.eq(HospProfitAndLoss::getDateYear, year)
|
|
.eq(HospProfitAndLoss::getDateMonth, month)
|
|
.eq(HospProfitAndLoss::getDateMonth, month)
|
|
.eq(HospProfitAndLoss::getHospId, hospId)
|
|
.eq(HospProfitAndLoss::getHospId, hospId)
|
|
|
|
+ .eq(HospProfitAndLoss::getReportType, reportType)
|
|
);
|
|
);
|
|
// 得到全院损益计算报表
|
|
// 得到全院损益计算报表
|
|
List<ReportForm> reportForms = reportFormService.getListByReportType(hospId, reportType);
|
|
List<ReportForm> reportForms = reportFormService.getListByReportType(hospId, reportType);
|
|
@@ -385,6 +386,7 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
long l = System.currentTimeMillis();
|
|
long l = System.currentTimeMillis();
|
|
list.forEach(i -> {
|
|
list.forEach(i -> {
|
|
i.setCreateTime(l);
|
|
i.setCreateTime(l);
|
|
|
|
+ i.setReportType(reportType);
|
|
});
|
|
});
|
|
this.saveBatch(list);
|
|
this.saveBatch(list);
|
|
}
|
|
}
|
|
@@ -656,7 +658,7 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
Map<Long, Responsibility> responsibilityIdMap = responsibilityList.stream().collect(Collectors.toMap(Responsibility::getId, responsibility -> responsibility, (a, b) -> b));
|
|
Map<Long, Responsibility> responsibilityIdMap = responsibilityList.stream().collect(Collectors.toMap(Responsibility::getId, responsibility -> responsibility, (a, b) -> b));
|
|
|
|
|
|
// 查询所有的全院损益数据 内存溢出问题
|
|
// 查询所有的全院损益数据 内存溢出问题
|
|
- List<HospProfitAndLoss> hospProfitAndLosses = getAllDataByDate(year, month, hospId);
|
|
|
|
|
|
+ List<HospProfitAndLoss> hospProfitAndLosses = getAllDataByDate(year, month, hospId,NumberConstant.THREE);
|
|
if (CollectionUtils.isEmpty(hospProfitAndLosses)) {
|
|
if (CollectionUtils.isEmpty(hospProfitAndLosses)) {
|
|
throw new CostException(500, "未进行全院损益计算");
|
|
throw new CostException(500, "未进行全院损益计算");
|
|
}
|
|
}
|
|
@@ -1172,10 +1174,12 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
DateTime parse = DateUtil.parse(computeDate);
|
|
DateTime parse = DateUtil.parse(computeDate);
|
|
int year = DateUtil.year(parse);
|
|
int year = DateUtil.year(parse);
|
|
int month = DateUtil.month(parse) + 1;
|
|
int month = DateUtil.month(parse) + 1;
|
|
|
|
+ //查询全院损益报表配置
|
|
|
|
+ Integer integerReportType = Integer.valueOf(reportType);
|
|
// Integer year = ComputeDateUtils.getComputeYear(computeDate);
|
|
// Integer year = ComputeDateUtils.getComputeYear(computeDate);
|
|
// Integer month = ComputeDateUtils.getComputeMonth(computeDate);
|
|
// Integer month = ComputeDateUtils.getComputeMonth(computeDate);
|
|
// 查询所有的全院损益数据 内存溢出问题
|
|
// 查询所有的全院损益数据 内存溢出问题
|
|
- List<HospProfitAndLoss> hospProfitAndLosses = getAllDataByDate(year, month, hospId);
|
|
|
|
|
|
+ List<HospProfitAndLoss> hospProfitAndLosses = getAllDataByDate(year, month, hospId,integerReportType);
|
|
if (CollectionUtils.isEmpty(hospProfitAndLosses)) {
|
|
if (CollectionUtils.isEmpty(hospProfitAndLosses)) {
|
|
throw new CostException(500, "未进行全院损益计算");
|
|
throw new CostException(500, "未进行全院损益计算");
|
|
}
|
|
}
|
|
@@ -1184,8 +1188,6 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
if (!CollectionUtils.isEmpty(hospAllList)) {
|
|
if (!CollectionUtils.isEmpty(hospAllList)) {
|
|
hospProfitAndLosses.removeAll(hospAllList);
|
|
hospProfitAndLosses.removeAll(hospAllList);
|
|
}
|
|
}
|
|
- //查询全院损益报表配置
|
|
|
|
- Integer integerReportType = Integer.valueOf(reportType);
|
|
|
|
List<ReportForm> reportFormList = reportFormService.list(new QueryWrapper<ReportForm>().lambda()
|
|
List<ReportForm> reportFormList = reportFormService.list(new QueryWrapper<ReportForm>().lambda()
|
|
.eq(ReportForm::getHospId, hospId)
|
|
.eq(ReportForm::getHospId, hospId)
|
|
.eq(ReportForm::getReportType, integerReportType).eq(ReportForm::getHide, NumberConstant.ONE));
|
|
.eq(ReportForm::getReportType, integerReportType).eq(ReportForm::getHide, NumberConstant.ONE));
|
|
@@ -1220,11 +1222,11 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
hospProfitVO.setParentId(0L);
|
|
hospProfitVO.setParentId(0L);
|
|
hospProfitVO.setReportName("全院其他收支");
|
|
hospProfitVO.setReportName("全院其他收支");
|
|
hospProfitVO.setSort(costProfitVos.size());
|
|
hospProfitVO.setSort(costProfitVos.size());
|
|
- hospProfitVO.setReportType(3);
|
|
|
|
|
|
+ hospProfitVO.setReportType(integerReportType);
|
|
hospProfitVO.setFraction(3);
|
|
hospProfitVO.setFraction(3);
|
|
costProfitVos.add(hospProfitVO);
|
|
costProfitVos.add(hospProfitVO);
|
|
for (int i = 0, hospAllListSize = hospAllList.size(); i < hospAllListSize; i++) {
|
|
for (int i = 0, hospAllListSize = hospAllList.size(); i < hospAllListSize; i++) {
|
|
- costProfitVos.add(getHospProfitVO(hospAllList, i));
|
|
|
|
|
|
+ costProfitVos.add(getHospProfitVO(hospAllList, i,integerReportType));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1285,7 +1287,7 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private static @NotNull HospProfitVO getHospProfitVO(List<HospProfitAndLoss> hospAllList, int i) {
|
|
|
|
|
|
+ private static @NotNull HospProfitVO getHospProfitVO(List<HospProfitAndLoss> hospAllList, int i,int reportType) {
|
|
HospProfitAndLoss hospProfitAndLoss = hospAllList.get(i);
|
|
HospProfitAndLoss hospProfitAndLoss = hospAllList.get(i);
|
|
HospProfitVO hospProfitVO1 = new HospProfitVO();
|
|
HospProfitVO hospProfitVO1 = new HospProfitVO();
|
|
hospProfitVO1.setId(Long.valueOf(hospProfitAndLoss.getReportNum()));
|
|
hospProfitVO1.setId(Long.valueOf(hospProfitAndLoss.getReportNum()));
|
|
@@ -1293,18 +1295,19 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
hospProfitVO1.setParentId(-1L);
|
|
hospProfitVO1.setParentId(-1L);
|
|
hospProfitVO1.setReportName(hospProfitAndLoss.getReportName());
|
|
hospProfitVO1.setReportName(hospProfitAndLoss.getReportName());
|
|
hospProfitVO1.setSort(i);
|
|
hospProfitVO1.setSort(i);
|
|
- hospProfitVO1.setReportType(3);
|
|
|
|
|
|
+ hospProfitVO1.setReportType(reportType);
|
|
hospProfitVO1.setAmount(hospProfitAndLoss.getAmount());
|
|
hospProfitVO1.setAmount(hospProfitAndLoss.getAmount());
|
|
hospProfitVO1.setFraction(3);
|
|
hospProfitVO1.setFraction(3);
|
|
return hospProfitVO1;
|
|
return hospProfitVO1;
|
|
}
|
|
}
|
|
|
|
|
|
- private List<HospProfitAndLoss> getAllDataByDate(int year, int month, Long hospId) {
|
|
|
|
|
|
+ private List<HospProfitAndLoss> getAllDataByDate(int year, int month, Long hospId,int reportType) {
|
|
return this.list(
|
|
return this.list(
|
|
new LambdaQueryWrapper<HospProfitAndLoss>()
|
|
new LambdaQueryWrapper<HospProfitAndLoss>()
|
|
.eq(HospProfitAndLoss::getHospId, hospId)
|
|
.eq(HospProfitAndLoss::getHospId, hospId)
|
|
.eq(HospProfitAndLoss::getDateMonth, month)
|
|
.eq(HospProfitAndLoss::getDateMonth, month)
|
|
.eq(HospProfitAndLoss::getDateYear, year)
|
|
.eq(HospProfitAndLoss::getDateYear, year)
|
|
|
|
+ .eq(HospProfitAndLoss::getReportType, reportType)
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|