|
@@ -86,6 +86,8 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
|
@Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
|
public void calc(String date, Long hospId) {
|
|
|
+ reportFormService.checkExistLoss(hospId);
|
|
|
+
|
|
|
DateTime parse = DateUtil.parse(date);
|
|
|
int year = DateUtil.year(parse);
|
|
|
int month = DateUtil.month(parse) + 1;
|
|
@@ -326,6 +328,9 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
|
* @param year
|
|
|
*/
|
|
|
private void calcByAccount(Long hospId, ReportForm reportForm, List<IncomeCollection> incomes, List<HospProfitAndLoss> list, List<AllocationQuery> allocationQueries, int month, int year) {
|
|
|
+ // check 这个医院是否有对应的损益标识
|
|
|
+ reportFormService.checkExistLoss(hospId);
|
|
|
+
|
|
|
// 报表项目关联的会计科目对象
|
|
|
List<RelationVO> accountRelations = reportRelationService.getAccountRelation(reportForm.getId(), hospId);
|
|
|
if (accountRelations.isEmpty()) {
|
|
@@ -360,6 +365,8 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
|
*/
|
|
|
@Override
|
|
|
public PageUtils getHospProfits(Integer current, Integer pageSize, String date, Long hospId) {
|
|
|
+ reportFormService.checkExistLoss(hospId);
|
|
|
+
|
|
|
DateTime parse = DateUtil.parse(date);
|
|
|
int year = DateUtil.year(parse);
|
|
|
int month = DateUtil.month(parse) + 1;
|
|
@@ -382,7 +389,7 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
|
byMonth.forEach(j -> {
|
|
|
if (j.getPaymentsType().equals(1)) {
|
|
|
total.set(total.get().add(j.getTotalAmount()));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
total.set(total.get().subtract(j.getTotalAmount()));
|
|
|
}
|
|
|
});
|
|
@@ -552,6 +559,7 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
|
|
|
.eq(FileRecord::getFileType, "全院损益")
|
|
|
.eq(FileRecord::getDateYear, year)
|
|
|
.eq(FileRecord::getDateMonth, month)
|
|
|
+ .orderByDesc(FileRecord::getCreateTime)
|
|
|
);
|
|
|
return new PageUtils(pageUtils);
|
|
|
}
|