Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.APSJ
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
佟礼
HYH.APSJ
Commits
f7145795
Commit
f7145795
authored
Dec 31, 2025
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备维修
parent
bd0aa5e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
MaintenanceWindowController.java
...com/aps/controller/gantt/MaintenanceWindowController.java
+95
-0
No files found.
src/main/java/com/aps/controller/gantt/MaintenanceWindowController.java
0 → 100644
View file @
f7145795
package
com
.
aps
.
controller
.
gantt
;
import
com.aps.common.util.ParamValidator
;
import
com.aps.common.util.R
;
import
com.aps.entity.Algorithm.Chromosome
;
import
com.aps.entity.basic.MaintenanceWindow
;
import
com.aps.service.plan.PlanResultService
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.responses.ApiResponse
;
import
io.swagger.v3.oas.annotations.responses.ApiResponses
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@RestController
@RequestMapping
(
"/maintenance"
)
@Tag
(
name
=
"维护窗口管理"
,
description
=
"维护窗口相关API"
)
public
class
MaintenanceWindowController
{
@Autowired
private
PlanResultService
planResultService
;
@PostMapping
(
"/add"
)
@Operation
(
summary
=
"添加维护窗口"
,
description
=
"为指定机器添加维护窗口"
,
requestBody
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
parameters
.
RequestBody
(
description
=
"维护窗口参数"
,
content
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Content
(
mediaType
=
"application/json"
,
examples
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
ExampleObject
(
name
=
"添加维护窗口示例"
,
value
=
"{\n \"sceneId\": \"B571EF6682DB463AB2977B1055A74112\",\n \"machineId\": 3402,\n \"maintenanceWindow\": {\n \"id\": \"maintenance-001\",\n \"startTime\": \"2025-11-03T07:36:00.000Z\",\n \"endTime\": \"2025-11-03T09:36:00.000Z\",\n \"reason\": \"定期维护\"\n }\n}"
)
)
)
)
public
R
<
Chromosome
>
addMaintenanceWindow
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
String
sceneId
=
ParamValidator
.
getString
(
params
,
"sceneId"
,
"场景ID"
);
Long
machineId
=
ParamValidator
.
getLong
(
params
,
"machineId"
,
"机器ID"
);
MaintenanceWindow
maintenanceWindow
=
(
MaintenanceWindow
)
params
.
get
(
"maintenanceWindow"
);
Chromosome
result
=
planResultService
.
AddMaintenanceWindow
(
sceneId
,
machineId
,
maintenanceWindow
);
return
R
.
ok
(
result
);
}
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除维护窗口"
,
description
=
"删除指定机器的维护窗口"
,
requestBody
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
parameters
.
RequestBody
(
description
=
"删除维护窗口请求参数"
,
content
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Content
(
mediaType
=
"application/json"
,
examples
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
ExampleObject
(
name
=
"删除维护窗口示例"
,
value
=
"{\n \"sceneId\": \"scene001\",\n \"machineId\": 1,\n \"maintenanceId\": \"maint001\"\n}"
)
)
)
)
public
R
<
Chromosome
>
delMaintenanceWindow
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
String
sceneId
=
ParamValidator
.
getString
(
params
,
"sceneId"
,
"场景ID"
);
Long
machineId
=
ParamValidator
.
getLong
(
params
,
"machineId"
,
"机器ID"
);
String
maintenanceId
=
ParamValidator
.
getString
(
params
,
"maintenanceId"
,
"维护窗口ID"
);
Chromosome
result
=
planResultService
.
DelMaintenanceWindow
(
sceneId
,
machineId
,
maintenanceId
);
return
R
.
ok
(
result
);
}
@PostMapping
(
"/get"
)
@Operation
(
summary
=
"获取维护窗口"
,
description
=
"获取指定机器的维护窗口列表"
,
requestBody
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
parameters
.
RequestBody
(
description
=
"获取维护窗口请求参数"
,
content
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
Content
(
mediaType
=
"application/json"
,
examples
=
@io
.
swagger
.
v3
.
oas
.
annotations
.
media
.
ExampleObject
(
name
=
"获取维护窗口示例"
,
value
=
"{\n \"sceneId\": \"scene001\",\n \"machineId\": 1\n}"
)
)
)
)
@ApiResponses
({
@ApiResponse
(
responseCode
=
"200"
,
description
=
"成功获取维护窗口列表"
)
})
public
R
<
List
<
MaintenanceWindow
>>
getMaintenanceWindow
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
String
sceneId
=
ParamValidator
.
getString
(
params
,
"sceneId"
,
"场景ID"
);
Long
machineId
=
ParamValidator
.
getLong
(
params
,
"machineId"
,
"机器ID"
);
List
<
MaintenanceWindow
>
result
=
planResultService
.
GetMaintenanceWindow
(
sceneId
,
machineId
,
null
);
return
R
.
ok
(
result
);
}
}
\ No newline at end of file
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