瑞利声电固定资产管理系统
ycq
2026-10-16 dbbadb021c2fc171466cc82bd9a7a82cc47165f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package zbooksoft.fams.controller;
 
import com.ruili.wcp.web.model.AjaxResponse;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import zbooksoft.fams.service.AssetStatService;
 
import java.time.LocalDate;
 
/**
 * 资产统计分析页面
 * @author ycq
 * @date 2026-10-16
 */
@Controller
@RequestMapping("/fams/stat")
public class AssetStatController {
 
    @Autowired
    private AssetStatService assetStatService;
 
    /**
     * 统计分析页面
     * @return 视图名
     */
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    @RequiresUser
    public String index() {
        return "fams/stat/index";
    }
 
    /**
     * 统计数据
     * @param includeScrapped 分布统计是否包含报废资产
     * @return 统计数据
     */
    @RequestMapping(value = "/data", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    @ResponseBody
    @RequiresUser
    public Object data(@RequestParam(defaultValue = "false") boolean includeScrapped) {
        return new AjaxResponse(assetStatService.dashboard(LocalDate.now(), includeScrapped));
    }
}