Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
王蔡翾
operation_platform
Commits
ce478de4
Commit
ce478de4
authored
Apr 02, 2025
by
王蔡翾
Browse files
更新
parent
c7f2ac89
Changes
35
Show whitespace changes
Inline
Side-by-side
src/main/java/com/example/operation_platform/controller/OperationDoController.java
View file @
ce478de4
...
@@ -4,6 +4,7 @@ package com.example.operation_platform.controller;
...
@@ -4,6 +4,7 @@ package com.example.operation_platform.controller;
import
com.example.operation_platform.model.dto.OperationDoDTO
;
import
com.example.operation_platform.model.dto.OperationDoDTO
;
import
com.example.operation_platform.model.entity.OperationDoEntity
;
import
com.example.operation_platform.model.entity.OperationDoEntity
;
import
com.example.operation_platform.model.entity.OperationItem
;
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.example.operation_platform.service.OperationDoService
;
import
com.platform.controller.BaseController
;
import
com.platform.controller.BaseController
;
import
com.platform.model.resp.Result
;
import
com.platform.model.resp.Result
;
...
@@ -44,6 +45,15 @@ public class OperationDoController extends BaseController {
...
@@ -44,6 +45,15 @@ public class OperationDoController extends BaseController {
operationDoService
.
stopDo
(
operationDoDTO
);
operationDoService
.
stopDo
(
operationDoDTO
);
return
Result
.
success
(
"项目已终止"
);
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
());
}
...
...
src/main/java/com/example/operation_platform/controller/OperationJobController.java
View file @
ce478de4
...
@@ -7,10 +7,7 @@ import com.example.operation_platform.service.OperationJobService;
...
@@ -7,10 +7,7 @@ import com.example.operation_platform.service.OperationJobService;
import
com.platform.controller.BaseController
;
import
com.platform.controller.BaseController
;
import
com.platform.model.resp.Result
;
import
com.platform.model.resp.Result
;
import
com.platform.page.TableDataInfo
;
import
com.platform.page.TableDataInfo
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
@RestController
@RestController
...
@@ -48,4 +45,9 @@ public class OperationJobController extends BaseController {
...
@@ -48,4 +45,9 @@ public class OperationJobController extends BaseController {
return
Result
.
data
(
operationJobService
.
queryLastTime
());
return
Result
.
data
(
operationJobService
.
queryLastTime
());
}
}
@GetMapping
(
"/warn"
)
//首页轮播告警信息
public
Result
queryWarn
()
{
return
Result
.
data
(
operationJobService
.
queryWarn
());
}
}
}
src/main/java/com/example/operation_platform/controller/OperationRecordController.java
View file @
ce478de4
...
@@ -7,6 +7,7 @@ import com.example.operation_platform.service.TbOperationRecordService;
...
@@ -7,6 +7,7 @@ import com.example.operation_platform.service.TbOperationRecordService;
import
com.platform.controller.BaseController
;
import
com.platform.controller.BaseController
;
import
com.platform.model.resp.Result
;
import
com.platform.model.resp.Result
;
import
com.platform.page.TableDataInfo
;
import
com.platform.page.TableDataInfo
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -38,6 +39,12 @@ public class OperationRecordController extends BaseController {
...
@@ -38,6 +39,12 @@ public class OperationRecordController extends BaseController {
operationJobService
.
updateStatusById
(
id
);
operationJobService
.
updateStatusById
(
id
);
return
toAjax
(
tbOperationRecordService
.
save
(
operationRecordDTO
));
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
()
//没用到,不必理会
@GetMapping
()
//没用到,不必理会
public
Result
<
List
<
OperationRecordVO
>>
queryrecordListById
(
@RequestParam
(
name
=
"stationId"
)
String
stationId
,
@RequestParam
(
name
=
"robotId"
)
Long
robotId
)
{
public
Result
<
List
<
OperationRecordVO
>>
queryrecordListById
(
@RequestParam
(
name
=
"stationId"
)
String
stationId
,
@RequestParam
(
name
=
"robotId"
)
Long
robotId
)
{
return
Result
.
data
(
tbOperationRecordService
.
queryrecordListById
(
stationId
,
robotId
));
return
Result
.
data
(
tbOperationRecordService
.
queryrecordListById
(
stationId
,
robotId
));
...
@@ -48,5 +55,9 @@ public class OperationRecordController extends BaseController {
...
@@ -48,5 +55,9 @@ public class OperationRecordController extends BaseController {
startPage
(
operationRecordDTO
.
getPageNum
(),
operationRecordDTO
.
getPageSize
());
startPage
(
operationRecordDTO
.
getPageNum
(),
operationRecordDTO
.
getPageSize
());
return
getDataTable
(
tbOperationRecordService
.
queryRunLogRecordList
(
operationRecordDTO
));
return
getDataTable
(
tbOperationRecordService
.
queryRunLogRecordList
(
operationRecordDTO
));
}
}
@PostMapping
(
"/warn/run"
)
public
Result
<
List
<
OperationRecordVO
>>
pageWarnRun
(
@RequestBody
OperationRecordDTO
operationRecordDTO
)
{
return
Result
.
data
(
tbOperationRecordService
.
queryRunLogRecordListAndWarnMessage
(
operationRecordDTO
));
}
}
}
src/main/java/com/example/operation_platform/controller/RunLogController.java
View file @
ce478de4
...
@@ -2,6 +2,7 @@ package com.example.operation_platform.controller;
...
@@ -2,6 +2,7 @@ package com.example.operation_platform.controller;
import
com.example.operation_platform.model.dto.RunLogDTO
;
import
com.example.operation_platform.model.dto.RunLogDTO
;
import
com.example.operation_platform.model.entity.UavOperateLogEntity
;
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.example.operation_platform.service.RunLogService
;
import
com.platform.controller.BaseController
;
import
com.platform.controller.BaseController
;
import
com.platform.model.resp.Result
;
import
com.platform.model.resp.Result
;
...
@@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RestController
@RequestMapping
(
"/run/log"
)
@RequestMapping
(
"/run/log"
)
...
@@ -34,5 +36,13 @@ public class RunLogController extends BaseController {
...
@@ -34,5 +36,13 @@ public class RunLogController extends BaseController {
public
void
download
(
@PathVariable
(
"id"
)
String
id
,
HttpServletResponse
response
)
{
public
void
download
(
@PathVariable
(
"id"
)
String
id
,
HttpServletResponse
response
)
{
runLogService
.
download
(
id
,
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
));
}
}
}
src/main/java/com/example/operation_platform/controller/WorkerController.java
View file @
ce478de4
...
@@ -46,9 +46,9 @@ public class WorkerController extends BaseController {
...
@@ -46,9 +46,9 @@ public class WorkerController extends BaseController {
// 返回操作结果
// 返回操作结果
return
toAjax
(
success
);
return
toAjax
(
success
);
}
}
@GetMapping
(
"/{workerId}"
)
//人员查询
@GetMapping
()
//人员查询
public
Result
<
WorkerVO
>
query
ById
(
@PathVariable
Integer
workerId
)
{
public
Result
<
WorkerVO
>
query
MyMessage
(
@RequestParam
(
name
=
"username"
)
String
username
)
{
return
Result
.
data
(
workerService
.
query
ById
(
workerId
));
return
Result
.
data
(
workerService
.
query
MyMessage
(
username
));
}
}
@DeleteMapping
(
"/{workerId}"
)
//人员删除
@DeleteMapping
(
"/{workerId}"
)
//人员删除
...
...
src/main/java/com/example/operation_platform/mapper/OperationDoMapper.java
View file @
ce478de4
...
@@ -3,6 +3,7 @@ package com.example.operation_platform.mapper;
...
@@ -3,6 +3,7 @@ package com.example.operation_platform.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.example.operation_platform.model.dto.OperationDoDTO
;
import
com.example.operation_platform.model.dto.OperationDoDTO
;
import
com.example.operation_platform.model.entity.OperationDoEntity
;
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.MessageNeedDataVo
;
import
com.example.operation_platform.model.vo.OperationDoVO
;
import
com.example.operation_platform.model.vo.OperationDoVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -24,6 +25,15 @@ public interface OperationDoMapper extends BaseMapper<OperationDoEntity> {
...
@@ -24,6 +25,15 @@ public interface OperationDoMapper extends BaseMapper<OperationDoEntity> {
*/
*/
void
stopDo
(
OperationDoDTO
operationDoDTO
);
void
stopDo
(
OperationDoDTO
operationDoDTO
);
MessageNeedDataVo
querymessage
(
@Param
(
"id"
)
Integer
id
);
MessageNeedDataVo
querymessage
(
@Param
(
"id"
)
Integer
id
);
/**
* 查看运行异常
* @param operationDoDTO operationDoDTO
* @return List<OperationVO>
*/
List
<
OperationDoVO
>
queryDoRunLog
(
OperationDoDTO
operationDoDTO
);
List
<
Integer
>
queryRunLogIdList
();
AllCountVO
querycount
();
}
}
src/main/java/com/example/operation_platform/mapper/OperationJobMapper.java
View file @
ce478de4
...
@@ -44,5 +44,13 @@ public interface OperationJobMapper extends BaseMapper<OperationJob> {
...
@@ -44,5 +44,13 @@ public interface OperationJobMapper extends BaseMapper<OperationJob> {
* @return
* @return
*/
*/
OperationJobVO
queryLastTime
();
OperationJobVO
queryLastTime
();
/**
* 告警处理完成更新任务状态
* @param id
* @return
*/
void
updateRunLogStatus
(
Integer
id
);
//首页轮播告警信息
OperationJobVO
queryWarn
();
}
}
src/main/java/com/example/operation_platform/mapper/TbOperationRecordMapper.java
View file @
ce478de4
...
@@ -26,5 +26,6 @@ public interface TbOperationRecordMapper extends BaseMapper<TbOperationRecordEnt
...
@@ -26,5 +26,6 @@ public interface TbOperationRecordMapper extends BaseMapper<TbOperationRecordEnt
* @return List<OperationRecordVO>
* @return List<OperationRecordVO>
*/
*/
List
<
OperationRecordVO
>
queryRunLogRecordList
(
OperationRecordDTO
operationRecordDTO
);
List
<
OperationRecordVO
>
queryRunLogRecordList
(
OperationRecordDTO
operationRecordDTO
);
List
<
OperationRecordVO
>
queryRunLogRecordListAndWarnMessage
(
OperationRecordDTO
operationRecordDTO
);
}
}
src/main/java/com/example/operation_platform/mapper/WorkerMapper.java
View file @
ce478de4
...
@@ -22,7 +22,7 @@ public interface WorkerMapper extends BaseMapper<WorkerEntity> {
...
@@ -22,7 +22,7 @@ public interface WorkerMapper extends BaseMapper<WorkerEntity> {
*
*
* @return WorkerEntity
* @return WorkerEntity
*/
*/
WorkerVO
query
ById
(
Integer
id
);
WorkerVO
query
MyMessage
(
String
username
);
/*
/*
* 登录验证
* 登录验证
* @param WorkerDTO WorkerDTO
* @param WorkerDTO WorkerDTO
...
...
src/main/java/com/example/operation_platform/model/dto/MessageDTO.java
View file @
ce478de4
...
@@ -11,4 +11,5 @@ public class MessageDTO extends MessageEntity {
...
@@ -11,4 +11,5 @@ public class MessageDTO extends MessageEntity {
private
Integer
pageSize
;
private
Integer
pageSize
;
private
String
robotName
;
private
String
robotName
;
private
String
stationName
;
private
String
stationName
;
private
String
username
;
}
}
src/main/java/com/example/operation_platform/model/dto/OperationRecordDTO.java
View file @
ce478de4
...
@@ -14,5 +14,6 @@ public class OperationRecordDTO extends TbOperationRecordEntity {
...
@@ -14,5 +14,6 @@ public class OperationRecordDTO extends TbOperationRecordEntity {
private
Integer
robotId
;
private
Integer
robotId
;
private
Long
stationId
;
private
Long
stationId
;
private
Integer
droneId
;
private
Integer
droneId
;
private
String
username
;
private
String
stationName
;
}
}
src/main/java/com/example/operation_platform/model/entity/UavOperateLogEntity.java
View file @
ce478de4
...
@@ -26,6 +26,6 @@ public class UavOperateLogEntity {
...
@@ -26,6 +26,6 @@ public class UavOperateLogEntity {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
dataTimeStr
;
private
String
dataTimeStr
;
@TableField
(
"run_log_id"
)
@TableField
(
"run_log_id"
)
private
Integer
runLogId
;
private
String
runLogId
;
}
}
src/main/java/com/example/operation_platform/model/vo/AllCountVO.java
0 → 100644
View file @
ce478de4
package
com.example.operation_platform.model.vo
;
import
lombok.Data
;
@Data
public
class
AllCountVO
{
private
Integer
operationDoCount
;
private
Integer
JobCount
;
private
Integer
warnCount
;
}
src/main/java/com/example/operation_platform/model/vo/OperationDoVO.java
View file @
ce478de4
...
@@ -23,4 +23,5 @@ public class OperationDoVO {
...
@@ -23,4 +23,5 @@ public class OperationDoVO {
private
String
operationItems
;
//维保项目名
private
String
operationItems
;
//维保项目名
private
String
droneId
;
//无人机id
private
String
droneId
;
//无人机id
private
String
lastTime
;
//最近维保时间
private
String
lastTime
;
//最近维保时间
private
String
runLogId
;
}
}
src/main/java/com/example/operation_platform/model/vo/OperationRecordVO.java
View file @
ce478de4
...
@@ -18,6 +18,8 @@ public class OperationRecordVO {
...
@@ -18,6 +18,8 @@ public class OperationRecordVO {
private
LocalDate
operationDate
;
private
LocalDate
operationDate
;
private
Integer
id
;
private
Integer
id
;
private
String
note
;
private
String
note
;
private
String
warnMessage
;
private
Integer
tb_run_log_id
;
...
...
src/main/java/com/example/operation_platform/model/vo/PeopleMessageVO.java
View file @
ce478de4
...
@@ -14,4 +14,6 @@ public class PeopleMessageVO {
...
@@ -14,4 +14,6 @@ public class PeopleMessageVO {
private
Long
hardwareNumber
;
private
Long
hardwareNumber
;
private
Long
operationNumber
;
private
Long
operationNumber
;
private
Integer
id
;
private
Integer
id
;
private
String
stationName
;
private
String
robotName
;
}
}
src/main/java/com/example/operation_platform/service/OperateLogService.java
View file @
ce478de4
...
@@ -8,4 +8,5 @@ import java.util.List;
...
@@ -8,4 +8,5 @@ import java.util.List;
public
interface
OperateLogService
{
public
interface
OperateLogService
{
List
<
UavOperateLogEntity
>
queryListByRunLogId
(
String
id
);
List
<
UavOperateLogEntity
>
queryListByRunLogId
(
String
id
);
}
}
src/main/java/com/example/operation_platform/service/OperationDoService.java
View file @
ce478de4
...
@@ -3,6 +3,7 @@ package com.example.operation_platform.service;
...
@@ -3,6 +3,7 @@ package com.example.operation_platform.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.example.operation_platform.model.dto.OperationDoDTO
;
import
com.example.operation_platform.model.dto.OperationDoDTO
;
import
com.example.operation_platform.model.entity.OperationDoEntity
;
import
com.example.operation_platform.model.entity.OperationDoEntity
;
import
com.example.operation_platform.model.vo.AllCountVO
;
import
com.example.operation_platform.model.vo.OperationDoVO
;
import
com.example.operation_platform.model.vo.OperationDoVO
;
...
@@ -18,4 +19,14 @@ public interface OperationDoService extends IService<OperationDoEntity> {
...
@@ -18,4 +19,14 @@ public interface OperationDoService extends IService<OperationDoEntity> {
* @return OperationVO
* @return OperationVO
*/
*/
void
stopDo
(
OperationDoDTO
operationDoDTO
);
void
stopDo
(
OperationDoDTO
operationDoDTO
);
/**
* 查看运行异常
* @param operationDoDTO operationDoDTO
* @return List<OperationVO>
*/
List
<
OperationDoVO
>
queryDoRunLog
(
OperationDoDTO
operationDoDTO
);
List
<
Integer
>
queryRunLogIdList
();
//首页统计
AllCountVO
querycount
();
}
}
src/main/java/com/example/operation_platform/service/OperationJobService.java
View file @
ce478de4
...
@@ -44,4 +44,12 @@ public interface OperationJobService extends IService<OperationJob> {
...
@@ -44,4 +44,12 @@ public interface OperationJobService extends IService<OperationJob> {
* @return
* @return
*/
*/
OperationJobVO
queryLastTime
();
OperationJobVO
queryLastTime
();
/**
* 告警处理完成更新任务状态
* @param id
* @return
*/
void
updateRunLogStatus
(
Integer
id
);
//首页轮播告警信息
OperationJobVO
queryWarn
();
}
}
src/main/java/com/example/operation_platform/service/RunLogService.java
View file @
ce478de4
...
@@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -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.dto.RunLogDTO
;
import
com.example.operation_platform.model.entity.RunLogEntity
;
import
com.example.operation_platform.model.entity.RunLogEntity
;
import
com.example.operation_platform.model.entity.UavOperateLogEntity
;
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
com.example.operation_platform.model.vo.RunLogVO
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
RunLogService
extends
IService
<
RunLogEntity
>
{
public
interface
RunLogService
extends
IService
<
RunLogEntity
>
{
List
<
RunLogVO
>
queryLogList
(
RunLogDTO
runLogDTO
);
List
<
RunLogVO
>
queryLogList
(
RunLogDTO
runLogDTO
);
...
@@ -16,4 +18,8 @@ public interface RunLogService extends IService<RunLogEntity> {
...
@@ -16,4 +18,8 @@ public interface RunLogService extends IService<RunLogEntity> {
List
<
UavOperateLogEntity
>
getInfoById
(
String
id
);
List
<
UavOperateLogEntity
>
getInfoById
(
String
id
);
void
download
(
String
id
,
HttpServletResponse
httpServletResponse
);
void
download
(
String
id
,
HttpServletResponse
httpServletResponse
);
List
<
Map
<
String
,
Object
>>
getAlertAndFailureLogs
();
String
getMergedContentForRunLogId
(
String
id
);
}
}
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment