|  |  |  | 
|---|
|  |  |  | package com.doumee.cloud.board; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.config.annotation.LoginNoRequired; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.PlatformLogMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformLog; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformWarnEvent; | 
|---|
|  |  |  | import com.doumee.dao.web.response.platformReport.*; | 
|---|
|  |  |  | import com.doumee.service.business.PlatformLogService; | 
|---|
|  |  |  | import com.doumee.service.business.third.BoardService; | 
|---|
|  |  |  | 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.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestParam; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.File; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Random; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by IntelliJ IDEA. | 
|---|
|  |  |  | 
|---|
|  |  |  | * @create 2024/10/28 13:42 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Api(tags = "场内调度看板") | 
|---|
|  |  |  | @Api(tags = "【看板大屏】场内调度看板") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/board/api/onSitDispatch") | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse<List<PlatformWarnEvent>> warningList(@RequestParam Integer  size) { | 
|---|
|  |  |  | int limit = Constants.formatIntegerNum(size)>0?size:7; | 
|---|
|  |  |  | List<PlatformWarnEvent> data = boardService.warningList(limit); | 
|---|
|  |  |  | if(data ==null || data.size()==0){ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ApiResponse.success(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("实时作业效率") | 
|---|
|  |  |  | @GetMapping("/workEfficiency") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type", value = "查询类型:0=入库;1=出库", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type", value = "查询类型:0=入库;1=出库,默认 0", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<List<WorkEfficiencyVO>> workEfficiency(@RequestParam Integer type) { | 
|---|
|  |  |  | List<WorkEfficiencyVO> workEfficiencyVOList = new ArrayList<>(); | 
|---|
|  |  |  | Random random = new Random(); | 
|---|
|  |  |  | Integer totalWorkNum = 0; | 
|---|
|  |  |  | for (int i = 8; i <= 20; i++) { | 
|---|
|  |  |  | if(i%2==0){ | 
|---|
|  |  |  | WorkEfficiencyVO workEfficiencyVO = new WorkEfficiencyVO(); | 
|---|
|  |  |  | workEfficiencyVO.setWorkNum(200+random.nextInt(100)); | 
|---|
|  |  |  | totalWorkNum = totalWorkNum + workEfficiencyVO.getWorkNum(); | 
|---|
|  |  |  | workEfficiencyVO.setTotalWorkNum(totalWorkNum); | 
|---|
|  |  |  | workEfficiencyVO.setWorkTime(StringUtils.leftPad(i+"",2,"0") +":00"); | 
|---|
|  |  |  | workEfficiencyVOList.add(workEfficiencyVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<WorkEfficiencyVO> workEfficiencyVOList = boardService.workEfficiency(type); | 
|---|
|  |  |  | return ApiResponse.success(workEfficiencyVOList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("实时月台作业信息") | 
|---|
|  |  |  | @GetMapping("/platformWorkData") | 
|---|
|  |  |  | public ApiResponse<List<PlatformWorkDataVO>> platformWorkData() { | 
|---|
|  |  |  | List<PlatformWorkDataVO> platformWorkDataVOList = new ArrayList<>(); | 
|---|
|  |  |  | Random random = new Random(); | 
|---|
|  |  |  | for (int i = 0; i < 3; i++) { | 
|---|
|  |  |  | PlatformWorkDataVO platformDurationVO = new PlatformWorkDataVO(); | 
|---|
|  |  |  | platformDurationVO.setPlatformName(i+"_月台名称"); | 
|---|
|  |  |  | platformDurationVO.setCarNo("皖A8" + random.nextInt(9) + random.nextInt(9) + random.nextInt(9) + random.nextInt(9)); | 
|---|
|  |  |  | platformDurationVO.setWorkType(random.nextInt(1)); | 
|---|
|  |  |  | platformDurationVO.setWorkNum(100+random.nextInt(100)); | 
|---|
|  |  |  | platformDurationVO.setFinishTime(Long.valueOf(System.currentTimeMillis()/1000 + 200+random.nextInt(100))); | 
|---|
|  |  |  | platformDurationVO.setStatus(random.nextInt(2)); | 
|---|
|  |  |  | platformWorkDataVOList.add(platformDurationVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<PlatformWorkDataVO> platformWorkDataVOList  = boardService.platformWorkData(); | 
|---|
|  |  |  | return ApiResponse.success(platformWorkDataVOList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|