jiaosong
2023-08-24 b97590d9e063b9ef13029ea768a296677c98f5d8
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package doumeemes.api.ext;
 
import doumeemes.api.BaseController;
import doumeemes.core.model.ApiResponse;
import doumeemes.core.model.PageData;
import doumeemes.core.model.PageWrap;
import doumeemes.dao.business.dto.statistics.*;
import doumeemes.dao.ext.dto.*;
import doumeemes.dao.ext.vo.DepartmentExtListVO;
import doumeemes.dao.ext.vo.DeviceCheckExtListVO;
import doumeemes.dao.ext.vo.PlansExtListVO;
import doumeemes.service.ext.StatisticsService;
import doumeemes.service.ext.WorkorderExtService;
import doumeemes.service.ext.WorkorderRecordExtService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 大屏统计数据接口
 * @author 江蹄蹄
 * @date 2022/04/20 10:56
 */
@RestController
@RequestMapping("/statistics")
@Api(tags = "大屏数据看板-统计数据接口")
public class StatisticsController extends BaseController {
 
    @Autowired
    private StatisticsService statisticsService;
 
    @ApiOperation("数据统计-成品计划,执行中、延期计划数、今日生产人数、今日生产设备数、今日不良品")
    @GetMapping("/getPlanData/{companyId}/{departId}")
    public ApiResponse<StatisticsPlanDataModel> getPlansData(@PathVariable Integer companyId, @PathVariable Integer departId) {
        return ApiResponse.success(statisticsService.getPlansData(companyId,departId));
    }
 
    @ApiOperation("数据统计-工序计划,执行中、延期计划数、今日生产人数、今日生产设备数、今日不良品")
    @GetMapping("/getProcedurePlanData/{companyId}/{departId}")
    public ApiResponse<StatisticsPlanDataModel> getProcedurePlanData(@PathVariable Integer companyId, @PathVariable Integer departId,@RequestParam(required = false) Integer procedureId) {
        return ApiResponse.success(statisticsService.getProcedurePlanData(companyId,departId,procedureId));
    }
    @ApiOperation("员工产品统计TOP10")
    @GetMapping("/userProduceTop/{companyId}/{departId}")
    public ApiResponse<List<UserProduceTopModel>> getUserProducceTop(@PathVariable Integer companyId, @PathVariable Integer departId,@RequestParam(required = false) Integer procedureId) {
        return ApiResponse.success(statisticsService.getUserProduceTopData(companyId,departId,procedureId));
    }
    @ApiOperation("近7天不良品分布-不良品数量统计")
    @GetMapping("/getUnqualified7DayData/{companyId}/{departId}")
    public ApiResponse<List<Unqualified7DayModel>> getUnqualified7DayData(@PathVariable Integer companyId, @PathVariable Integer departId,@RequestParam(required = false) Integer procedureId) {
        return ApiResponse.success(statisticsService.getUnqualified7DayData(companyId,departId,procedureId));
    }
    @ApiOperation("近7天不良品分布-不良品数量-按不良项统计")
    @GetMapping("/getUnqualifiedCateData/{companyId}/{departId}")
    public ApiResponse<List<UnqualifiedCateModel>> getUnqualifiedCateData(@PathVariable Integer companyId, @PathVariable Integer departId,@RequestParam(required = false) Integer procedureId) {
        return ApiResponse.success(statisticsService.getUnqualifiedCateData(companyId,departId,procedureId));
    }
    @ApiOperation("报工日志分页查询")
    @PostMapping("/getRecordLogPage/{companyId}/{departId}")
    public ApiResponse<PageData<RecordLogModel>> getRecordLogPage(@PathVariable Integer companyId, @PathVariable Integer departId
            , @RequestBody PageWrap<QueryWorkorderRecordExtDTO> pageWrap) {
        return ApiResponse.success(statisticsService.getRecordLogPage(companyId,departId,pageWrap));
    }
    @ApiOperation("巡检记录分页查询")
    @PostMapping("/getDeviceCheckPage/{companyId}/{departId}")
    public ApiResponse<PageData<DeviceCheckExtListVO>> getDeviceCheckPage (@PathVariable Integer companyId, @PathVariable Integer departId
            ,@RequestBody PageWrap<QueryDeviceCheckExtDTO> pageWrap) {
        return ApiResponse.success(statisticsService.getDeviceCheckPage(companyId,departId,pageWrap));
    }
    @ApiOperation("工序计划进度查询")
    @GetMapping("/getProcedurePlansList/{companyId}/{departId}")
    public ApiResponse<List<ProcedurePlansPageModel>> getProcedurePlansList (@PathVariable Integer companyId, @PathVariable Integer departId,@RequestParam(required = false) Integer procedureId) {
        return ApiResponse.success(statisticsService.getProcedurePlansPage(companyId,departId,procedureId));
    }
    @ApiOperation("成品计划进度查询")
    @GetMapping("/getWorkPlansList/{companyId}/{departId}")
    public ApiResponse<List<WorkPlansPageModel>> getWorkPlansList (@PathVariable Integer companyId, @PathVariable Integer departId   ) {
        return ApiResponse.success(statisticsService.getWorkPlansList(companyId,departId));
    }
    @ApiOperation("成品计划-工序进度查询")
    @GetMapping("/getProcedureProcessList/{companyId}/{departId}")
    public ApiResponse<List<ProcedureProcessModel>> getProcedureProcessList (@PathVariable Integer companyId, @PathVariable Integer departId   ) {
        return ApiResponse.success(statisticsService.getProcedureProcessList(companyId,departId));
    }
    @ApiOperation("成品计划-实时仓库余量统计")
    @GetMapping("/getStockList/{companyId}/{departId}")
    public ApiResponse<List<StockDataModel>> getStockList (@PathVariable Integer companyId, @PathVariable Integer departId   ) {
        return ApiResponse.success(statisticsService.getStockList(companyId,departId));
    }
 
    @ApiOperation("条件查询企业全部公司部门")
    @GetMapping("/getDepartmentList/{companyId}")
    public ApiResponse<List<DepartmentExtListVO>> getDepartmentList (@PathVariable Integer companyId ) {
        return ApiResponse.success(statisticsService.getDepartmentList(companyId));
    }
 
 
}