2
0
Эх сурвалжийг харах

09 01 01 全院损益计算

hr 4 жил өмнө
parent
commit
ef9698a5bd

+ 1 - 1
src/main/java/com/imed/costaccount/service/HospProfitAndLossService.java

@@ -49,7 +49,7 @@ public interface HospProfitAndLossService extends IService<HospProfitAndLoss> {
      */
     void calcByResponsibility(String date, Long hospId);
 
-    PageUtils hospProfitReports(Integer current, Integer pageSize, Long hospId);
+    PageUtils hospProfitReports(Integer current, Integer pageSize, Long hospId, String date);
 
 }
 

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

@@ -475,12 +475,18 @@ public class HospProfitAndLossServiceImpl extends ServiceImpl<HospProfitAndLossM
     }
 
     @Override
-    public PageUtils hospProfitReports(Integer current, Integer pageSize, Long hospId) {
+    public PageUtils hospProfitReports(Integer current, Integer pageSize, Long hospId, String date) {
+        DateTime parse = DateUtil.parse(date);
+        int year = DateUtil.year(parse);
+        int month = DateUtil.month(parse) + 1;
+
         Page<FileRecord> page = new Page<>(current, pageSize);
         Page<FileRecord> pageUtils = fileRecordService.page(page,
                 new LambdaQueryWrapper<FileRecord>()
                         .eq(FileRecord::getHospId, hospId)
                         .eq(FileRecord::getFileType, "全院损益")
+                        .eq(FileRecord::getDateYear, year)
+                        .eq(FileRecord::getDateMonth, month)
         );
         return new PageUtils(pageUtils);
     }

+ 4 - 2
src/main/java/com/imed/costaccount/web/HospProfitAndLossController.java

@@ -55,8 +55,10 @@ public class HospProfitAndLossController extends AbstractController {
     @ApiOperation("全院经营报表列表")
     @GetMapping("/hospReports")
     public Result hospReports(@RequestParam(value = "current", defaultValue = "1") Integer current,
-                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
-        PageUtils pageUtils = hospProfitAndLossService.hospProfitReports(current,pageSize,getHospId());
+                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
+                              @RequestParam(value = "date") String date) {
+
+        PageUtils pageUtils = hospProfitAndLossService.hospProfitReports(current, pageSize, getHospId(),date);
         return Result.ok(pageUtils);
     }
 }