zjh
2023-11-20 9cbc9025db84bb67ea8e91b99ec0847edbeec36b
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjHomePageController.java
@@ -6,6 +6,7 @@
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.common.core.domain.entity.SysDept;
import com.ltkj.common.core.domain.entity.SysUser;
import com.ltkj.common.core.redis.RedisCache;
import com.ltkj.common.utils.DateUtils;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.service.*;
@@ -42,6 +43,10 @@
    private ITjCustomerService customerService;
    @Resource
    private ITjProjectService projectService;
    @Resource
    private RedisCache redisCache;
    @Resource
    private TjAsyncService asyncService;
    @Resource
    private ISysDeptService deptService;
    @Resource
@@ -317,7 +322,7 @@
    @GetMapping("/GetAbnormalData")
    @ApiOperation(value = "体检结果异常数据统计分析")
    @PreAuthorize("@ss.hasPermi('home:page:GetAbnormalData')")
//    @PreAuthorize("@ss.hasPermi('home:page:GetAbnormalData')")
    public List<AbnormalVO> GetAbnormalData(@RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) {
        List<AbnormalVO> list = new ArrayList<>();
        List<TjOrderDetail> list1 = detailService.getTjOrderDetailList(startDate,endDate);
@@ -400,7 +405,7 @@
    @GetMapping("/getDiseaseList")
    @ApiOperation("根据疾病名称查询相关人员信息接口")
    @PreAuthorize("@ss.hasPermi('home:page:getDiseaseList')")
//    @PreAuthorize("@ss.hasPermi('home:page:getDiseaseList')")
    public AjaxResult getDiseaseList(@ApiParam(value = "疾病名称") @RequestParam String disesseName,
                                     @ApiParam(value = "开始时间") @RequestParam(required = false) String beginTime,
                                     @ApiParam(value = "结束时间") @RequestParam(required = false) String endTime) {
@@ -446,7 +451,16 @@
    @GetMapping("/getLineChart")
    @ApiOperation(value = "首页折线图数据")
    public AjaxResult getLineChart() {
        List<Map<Object, Object>> line = orderService.getLine();
        asyncService.getLineChart();
        if(redisCache.hasKey("getLineChart")){
            return redisCache.getCacheObject("getLineChart");
        }
        return getResult();
    }
    private AjaxResult getResult() {
//        List<Map<Object, Object>> line = orderService.getLine();
        List<LineChartsVo> line = orderService.getLine();
        Collections.reverse(line);
        return AjaxResult.success("折线图数据", line);
    }
@@ -454,6 +468,14 @@
    @GetMapping("/getPieChart")
    @ApiOperation(value = "首页饼状图登记人数接口")
    public AjaxResult getPieChart() {
        asyncService.getPieChart();
        if(redisCache.hasKey("getPieChart")){
            return redisCache.getCacheObject("getPieChart");
        }
        return getAjaxResult();
    }
    private AjaxResult getAjaxResult() {
        Map<String, Object> map = new HashMap<>();
        //获取体检登记数
@@ -477,6 +499,7 @@
        } else {
            map.put("tjyc", 0);
        }
        return AjaxResult.success(map);
    }