Browse Source

09 01 01 全院损益计算

hr 4 years ago
parent
commit
39ab41e30d

+ 7 - 2
src/main/java/com/imed/costaccount/service/impl/HospProfitAndLossServiceImpl.java

@@ -506,13 +506,18 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
      * @param hospId
      */
     @Override
-    @Transactional
+    @Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
     public void calcByResponsibility(String date, Long hospId) {
         List<Responsibility> leafResp = responsibilityService.getLeafResp(hospId);
         DateTime parse = DateUtil.parse(date);
         int year = DateUtil.year(parse);
         int month = DateUtil.month(parse) + 1;
-        this.remove(new LambdaQueryWrapper<HospProfitAndLoss>().eq(HospProfitAndLoss::getDateYear, year).eq(HospProfitAndLoss::getDateMonth, month).eq(HospProfitAndLoss::getHospId, hospId));
+        this.remove(
+                new LambdaQueryWrapper<HospProfitAndLoss>()
+                        .eq(HospProfitAndLoss::getDateYear, year)
+                        .eq(HospProfitAndLoss::getDateMonth, month)
+                        .eq(HospProfitAndLoss::getHospId, hospId)
+        );
         // 得到全院损益计算报表
         List<ReportForm> reportForms = reportFormService.getListByReportType(hospId, ReportTypeEnum.HOSP_PROFIT_LOSS.getType());
         if (CollUtil.isEmpty(reportForms)) {

+ 2 - 0
src/main/resources/mapper/HospProfitAndLossMapper.xml

@@ -15,6 +15,7 @@
         where date_year = #{year}
           and date_month = #{month}
           and hosp_id = #{hospId}
+          and delete_time = 0
         group by report_num
             limit #{startIndex}, #{pageSize}
     </select>
@@ -26,6 +27,7 @@
                  where date_year = #{year}
                    and date_month = #{month}
                    and hosp_id = #{hospId}
+                   and delete_time = 0
                  group by report_num) t
     </select>
 </mapper>