jiangping
2024-12-23 d70d789667434c1ba80b281f398137d66d68aa6d
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
package com.doumee.cloud.board;
 
import com.doumee.api.BaseController;
import com.doumee.config.annotation.LoginNoRequired;
import com.doumee.core.haikang.model.cars.response.CarsAlarmResultListResponse;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.join.PlatformJobJoinMapper;
import com.doumee.dao.business.model.Platform;
import com.doumee.dao.business.model.PlatformBooks;
import com.doumee.dao.business.model.PlatformJob;
import com.doumee.dao.business.model.PlatformWmsJob;
import com.doumee.dao.web.reqeust.CarsJobAndContractDTO;
import com.doumee.dao.web.response.platformReport.*;
import com.doumee.service.business.third.BoardService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/10/28 13:42
 */
 
@Api(tags = "【看板大屏】园区物流运行调度看板真实")
@RestController
@Slf4j
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/board/api/platformJobRun")
public class PlatformJobRunActController extends BaseController {
 
    @Autowired
    private PlatformJobJoinMapper platformJobJoinMapper;
    @Autowired
    private BoardService boardService;
 
    @LoginNoRequired
    @ApiOperation("查询本月、本年的累计出库量,出入库任务量、出入库作业效率统计数据")
    @GetMapping("/centerData")
    public ApiResponse<PlatformJobRunBoardNewVO> centerData() {
        PlatformJobRunBoardNewVO data = boardService.platformJobCenterData();
        return ApiResponse.success(data);
    }
 
 
 
    @LoginNoRequired
    @ApiOperation("运输任务分析")
    @GetMapping("/transportMeasure")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "queryType", value = "查询类型:0=周;1=月;2=年;", required = true),
    })
    public ApiResponse<List<TransportMeasureVO>> transportMeasure(@RequestParam Integer queryType) {
        List<TransportMeasureVO> list = boardService.transportMeasure(queryType);
        return ApiResponse.success(list);
    }
    @LoginNoRequired
    @ApiOperation("汽车状态、经纬度集合数据")
    @GetMapping("/carsList")
    public ApiResponse<BoardCarsListVO> carsList() {
        BoardCarsListVO data = boardService.platformJobCarsList();
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("汽车告警事件集合数据")
    @GetMapping("/carsEventList")
    public ApiResponse<List<CarsAlarmResultListResponse>> carsEventList() {
        List<CarsAlarmResultListResponse> data = boardService.carsEventList();
        return ApiResponse.success(data);
    }
 
    @LoginNoRequired
    @ApiOperation("根据车牌号查询作业信息和合同信息集合")
    @PostMapping("/getCarsJobDetails")
    public ApiResponse<CarsJobAndContractVO> getCarsJobDetails(@RequestBody CarsJobAndContractDTO param) {
        CarsJobAndContractVO data = boardService.getCarsJobDetails(param);
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("当日运输任务")
    @GetMapping("/platformJobList")
    public ApiResponse<List<PlatformJob>> platformJobList() {
        List<PlatformJob> list =  platformJobJoinMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAll(PlatformJob.class)
                        .selectAs(PlatformBooks::getId,PlatformJob::getBookId)
                        .selectAs(Platform::getName,PlatformJob::getPlatformName)
                        .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate)
                        .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName)
                        .selectAs(PlatformWmsJob::getRepertotyAddress,PlatformJob::getRepertotyAddress)
                        .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                        .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode)
                        .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getStatus
                                ,Constants.PlatformJobStatus.WAIT_CALL.getKey()
                                ,Constants.PlatformJobStatus.CALLED.getKey()
                                ,Constants.PlatformJobStatus.IN_WAIT.getKey()
                                ,Constants.PlatformJobStatus.WORKING.getKey()
                                ,Constants.PlatformJobStatus.TRANSFERING.getKey()
                                ,Constants.PlatformJobStatus.EXCEPTION.getKey()
//                                ,Constants.PlatformJobStatus.DONE.getKey()
                        )
                        .orderByDesc(PlatformJob::getSignNum)
                        .last(" limit 20 ")
        );
        return ApiResponse.success(list);
    }
    @LoginNoRequired
    @ApiOperation("出入库任务量")
    @GetMapping("/jobData")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "queryType", value = "查询类型:0=出库;1=入库;", required = true),
    })
    public ApiResponse<JobDataVO> jobData(@RequestParam Integer queryType) {
        Random random = new Random();
        JobDataVO jobDataVO = new JobDataVO();
        jobDataVO.setPlanTaskNum(BigDecimal.valueOf(random.nextInt(1000)));
        jobDataVO.setFinishTaskNum(BigDecimal.valueOf(jobDataVO.getPlanTaskNum().intValue()));
        return ApiResponse.success(jobDataVO);
    }
    @LoginNoRequired
    @ApiOperation("今日入库量统计")
    @GetMapping("/totalInList")
    public ApiResponse<List<GeneralVO>> totalInList() {
        List<GeneralVO> list = boardService.todayTotalInList();
        return ApiResponse.success(list);
    }
 
 
 
    @LoginNoRequired
    @ApiOperation("库存情况")
    @GetMapping("/stockList")
    public ApiResponse< BoardStockListVO > stockList() {
         BoardStockListVO list =  boardService.stockList();
        return ApiResponse.success(list);
    }
 
 
}