jiangping
2023-08-22 4ca4e5271d03989e41bb5c0d6914a1dec380e47b
server/src/main/java/doumeemes/api/ext/StatisticsController.java
@@ -2,14 +2,19 @@
import doumeemes.api.BaseController;
import doumeemes.core.model.ApiResponse;
import doumeemes.dao.business.dto.statistics.StatisticsPlanDataModel;
import doumeemes.dao.business.dto.statistics.Unqualified7DayModel;
import doumeemes.dao.business.dto.statistics.UserProduceTopModel;
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.*;
@@ -21,28 +26,75 @@
 * @date 2022/04/20 10:56
 */
@RestController
@RequestMapping("/ext/statistic")
@RequestMapping("/statistics")
@Api(tags = "大屏数据看板-统计数据接口")
public class StatisticsController extends BaseController {
    @Autowired
    private StatisticsService statisticsService;
    @ApiOperation("数据统计,执行中、延期计划数、今日生产人数、今日生产设备数、今日不良品")
    @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) {
        return ApiResponse.success(statisticsService.getUserProduceTopData(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) {
        return ApiResponse.success(statisticsService.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));
    }