Commit ce478de4 authored by 王蔡翾's avatar 王蔡翾
Browse files

更新

parent c7f2ac89
......@@ -4,6 +4,7 @@ package com.example.operation_platform.controller;
import com.example.operation_platform.model.dto.OperationDoDTO;
import com.example.operation_platform.model.entity.OperationDoEntity;
import com.example.operation_platform.model.entity.OperationItem;
import com.example.operation_platform.model.vo.AllCountVO;
import com.example.operation_platform.service.OperationDoService;
import com.platform.controller.BaseController;
import com.platform.model.resp.Result;
......@@ -44,6 +45,15 @@ public class OperationDoController extends BaseController {
operationDoService.stopDo(operationDoDTO);
return Result.success("项目已终止");
}
@PostMapping("/page/runLog")
public TableDataInfo pageRunLog(@RequestBody OperationDoDTO operationDoDTO) {
startPage(operationDoDTO.getPageNum(), operationDoDTO.getPageSize());
return getDataTable(operationDoService.queryDoRunLog(operationDoDTO));
}
@GetMapping("/count")
public Result<AllCountVO> count() {
return Result.data(operationDoService.querycount());
}
......
......@@ -7,10 +7,7 @@ import com.example.operation_platform.service.OperationJobService;
import com.platform.controller.BaseController;
import com.platform.model.resp.Result;
import com.platform.page.TableDataInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
......@@ -48,4 +45,9 @@ public class OperationJobController extends BaseController {
return Result.data(operationJobService.queryLastTime());
}
@GetMapping("/warn")//首页轮播告警信息
public Result queryWarn() {
return Result.data(operationJobService.queryWarn());
}
}
......@@ -7,6 +7,7 @@ import com.example.operation_platform.service.TbOperationRecordService;
import com.platform.controller.BaseController;
import com.platform.model.resp.Result;
import com.platform.page.TableDataInfo;
import org.springframework.security.core.parameters.P;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -38,6 +39,12 @@ public class OperationRecordController extends BaseController {
operationJobService.updateStatusById(id);
return toAjax(tbOperationRecordService.save(operationRecordDTO));
}
@PostMapping("/save/runLog")//告警处理记录,并更新任务状态
public Result saveRunLog(@RequestBody OperationRecordDTO operationRecordDTO) {
Integer id = operationRecordDTO.getOperationJobId();
operationJobService.updateRunLogStatus(id);
return toAjax(tbOperationRecordService.save(operationRecordDTO));
}
@GetMapping()//没用到,不必理会
public Result<List<OperationRecordVO>> queryrecordListById(@RequestParam(name = "stationId")String stationId, @RequestParam(name = "robotId") Long robotId) {
return Result.data(tbOperationRecordService.queryrecordListById(stationId,robotId));
......@@ -48,5 +55,9 @@ public class OperationRecordController extends BaseController {
startPage(operationRecordDTO.getPageNum(), operationRecordDTO.getPageSize());
return getDataTable(tbOperationRecordService.queryRunLogRecordList(operationRecordDTO));
}
@PostMapping("/warn/run")
public Result <List<OperationRecordVO>> pageWarnRun(@RequestBody OperationRecordDTO operationRecordDTO) {
return Result.data(tbOperationRecordService.queryRunLogRecordListAndWarnMessage(operationRecordDTO));
}
}
......@@ -2,6 +2,7 @@ package com.example.operation_platform.controller;
import com.example.operation_platform.model.dto.RunLogDTO;
import com.example.operation_platform.model.entity.UavOperateLogEntity;
import com.example.operation_platform.model.vo.OperationRecordVO;
import com.example.operation_platform.service.RunLogService;
import com.platform.controller.BaseController;
import com.platform.model.resp.Result;
......@@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/run/log")
......@@ -34,5 +36,13 @@ public class RunLogController extends BaseController {
public void download(@PathVariable("id") String id, HttpServletResponse response) {
runLogService.download(id,response);
}
@PostMapping("/warn/run/log")
public Result<List<Map<String, Object>>> getAlertAndFailureLogs() {
return Result.data(runLogService.getAlertAndFailureLogs());
}
@GetMapping("/warn/{id}")
public Result<String> getMergedContentForRunLogId(@PathVariable("id") String id) {
return Result.data(runLogService.getMergedContentForRunLogId(id));
}
}
......@@ -46,9 +46,9 @@ public class WorkerController extends BaseController {
// 返回操作结果
return toAjax(success);
}
@GetMapping("/{workerId}")//人员查询
public Result<WorkerVO> queryById(@PathVariable Integer workerId) {
return Result.data(workerService.queryById(workerId));
@GetMapping()//人员查询
public Result<WorkerVO> queryMyMessage(@RequestParam(name="username") String username) {
return Result.data(workerService.queryMyMessage(username));
}
@DeleteMapping("/{workerId}")//人员删除
......
......@@ -3,6 +3,7 @@ package com.example.operation_platform.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.operation_platform.model.dto.OperationDoDTO;
import com.example.operation_platform.model.entity.OperationDoEntity;
import com.example.operation_platform.model.vo.AllCountVO;
import com.example.operation_platform.model.vo.MessageNeedDataVo;
import com.example.operation_platform.model.vo.OperationDoVO;
import org.apache.ibatis.annotations.Param;
......@@ -24,6 +25,15 @@ public interface OperationDoMapper extends BaseMapper<OperationDoEntity> {
*/
void stopDo(OperationDoDTO operationDoDTO);
MessageNeedDataVo querymessage(@Param("id") Integer id);
/**
* 查看运行异常
* @param operationDoDTO operationDoDTO
* @return List<OperationVO>
*/
List<OperationDoVO> queryDoRunLog(OperationDoDTO operationDoDTO);
List<Integer> queryRunLogIdList();
AllCountVO querycount();
}
......@@ -44,5 +44,13 @@ public interface OperationJobMapper extends BaseMapper<OperationJob> {
* @return
*/
OperationJobVO queryLastTime();
/**
* 告警处理完成更新任务状态
* @param id
* @return
*/
void updateRunLogStatus(Integer id);
//首页轮播告警信息
OperationJobVO queryWarn();
}
......@@ -26,5 +26,6 @@ public interface TbOperationRecordMapper extends BaseMapper<TbOperationRecordEnt
* @return List<OperationRecordVO>
*/
List<OperationRecordVO> queryRunLogRecordList(OperationRecordDTO operationRecordDTO);
List<OperationRecordVO> queryRunLogRecordListAndWarnMessage(OperationRecordDTO operationRecordDTO);
}
......@@ -22,7 +22,7 @@ public interface WorkerMapper extends BaseMapper<WorkerEntity> {
*
* @return WorkerEntity
*/
WorkerVO queryById(Integer id);
WorkerVO queryMyMessage(String username);
/*
* 登录验证
* @param WorkerDTO WorkerDTO
......
......@@ -11,4 +11,5 @@ public class MessageDTO extends MessageEntity {
private Integer pageSize;
private String robotName;
private String stationName;
private String username;
}
......@@ -14,5 +14,6 @@ public class OperationRecordDTO extends TbOperationRecordEntity {
private Integer robotId;
private Long stationId;
private Integer droneId;
private String username;
private String stationName;
}
......@@ -26,6 +26,6 @@ public class UavOperateLogEntity {
@TableField(exist = false)
private String dataTimeStr;
@TableField("run_log_id")
private Integer runLogId;
private String runLogId;
}
package com.example.operation_platform.model.vo;
import lombok.Data;
@Data
public class AllCountVO {
private Integer operationDoCount;
private Integer JobCount;
private Integer warnCount;
}
......@@ -23,4 +23,5 @@ public class OperationDoVO {
private String operationItems;//维保项目名
private String droneId;//无人机id
private String lastTime;//最近维保时间
private String runLogId;
}
......@@ -18,6 +18,8 @@ public class OperationRecordVO {
private LocalDate operationDate;
private Integer id;
private String note;
private String warnMessage;
private Integer tb_run_log_id;
......
......@@ -14,4 +14,6 @@ public class PeopleMessageVO {
private Long hardwareNumber;
private Long operationNumber;
private Integer id;
private String stationName;
private String robotName;
}
......@@ -8,4 +8,5 @@ import java.util.List;
public interface OperateLogService {
List<UavOperateLogEntity> queryListByRunLogId(String id);
}
......@@ -3,6 +3,7 @@ package com.example.operation_platform.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.operation_platform.model.dto.OperationDoDTO;
import com.example.operation_platform.model.entity.OperationDoEntity;
import com.example.operation_platform.model.vo.AllCountVO;
import com.example.operation_platform.model.vo.OperationDoVO;
......@@ -18,4 +19,14 @@ public interface OperationDoService extends IService<OperationDoEntity> {
* @return OperationVO
*/
void stopDo(OperationDoDTO operationDoDTO);
/**
* 查看运行异常
* @param operationDoDTO operationDoDTO
* @return List<OperationVO>
*/
List<OperationDoVO> queryDoRunLog(OperationDoDTO operationDoDTO);
List<Integer> queryRunLogIdList();
//首页统计
AllCountVO querycount();
}
......@@ -44,4 +44,12 @@ public interface OperationJobService extends IService<OperationJob> {
* @return
*/
OperationJobVO queryLastTime();
/**
* 告警处理完成更新任务状态
* @param id
* @return
*/
void updateRunLogStatus(Integer id);
//首页轮播告警信息
OperationJobVO queryWarn();
}
......@@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.example.operation_platform.model.dto.RunLogDTO;
import com.example.operation_platform.model.entity.RunLogEntity;
import com.example.operation_platform.model.entity.UavOperateLogEntity;
import com.example.operation_platform.model.vo.OperationRecordVO;
import com.example.operation_platform.model.vo.RunLogVO;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
public interface RunLogService extends IService<RunLogEntity> {
List<RunLogVO> queryLogList(RunLogDTO runLogDTO);
......@@ -16,4 +18,8 @@ public interface RunLogService extends IService<RunLogEntity> {
List<UavOperateLogEntity> getInfoById(String id);
void download(String id, HttpServletResponse httpServletResponse);
List<Map<String, Object>> getAlertAndFailureLogs();
String getMergedContentForRunLogId(String id);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment