From 984ac5519665973f091ac8611530881fc92268be Mon Sep 17 00:00:00 2001 From: zhoushihao <zsh19950802@163.com> Date: 星期二, 17 十二月 2024 09:52:44 +0800 Subject: [PATCH] 1、卧理历史任务更新,按照设备id更新任务,避免两条线同时开启任务冲突 --- hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java | 39 ++++++++++++++++++++++----------------- 1 files changed, 22 insertions(+), 17 deletions(-) diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java index 62508b2..577dd92 100644 --- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java +++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/taskcache/controller/TaskCacheController.java @@ -1,29 +1,27 @@ package com.mes.taskcache.controller; +import com.mes.edgglasstask.entity.request.IdentWornRequest; import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; -import com.mes.edgstoragecage.service.EdgStorageCageService; -import com.mes.taskcache.entity.TaskCache; import com.mes.taskcache.service.TaskCacheService; import com.mes.utils.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; -import static com.mes.job.CacheGlassTask.engineerId; - /** * <p> - * 鍓嶇鎺у埗鍣� + * 鍓嶇鎺у埗鍣� * </p> * * @author zhoush * @since 2024-04-07 */ -@Api(description = "璇嗗埆鏄剧ず") +@Api(tags = "璇嗗埆鏄剧ず") @RestController @RequestMapping("/taskCache") public class TaskCacheController { @@ -32,9 +30,15 @@ private EdgStorageCageDetailsService edgStorageCageDetailsService; @Autowired - private EdgStorageCageService edgStorageCageService; - @Autowired private TaskCacheService taskCacheService; + + @ApiOperation("鏌ヨ閽㈠寲鐗堝浘淇℃伅-鏍规嵁 宸ョ▼鍙� 鍙傛暟(宸ョ▼鍙�)") + @PostMapping("/temperingTerritory") + @ResponseBody + public Result temperingTerritory(String current) { + List<Map<String, Object>> h = edgStorageCageDetailsService.selectTemperingTerritory(current); + return Result.build(200, "鎴愬姛", h); + } @ApiOperation("鏌ヨ鍒囧壊鐗堝浘淇℃伅-鏍规嵁 宸ョ▼鍙� 鍙傛暟(宸ョ▼鍙�)") @PostMapping("/cutTerritory") @@ -42,30 +46,31 @@ public Result cutTerritory(String current) { //engineerId=current; List<List<Map<String, Object>>> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); - return Result.build(200,"鎴愬姛",h); + return Result.build(200, "鎴愬姛", h); } + @ApiOperation("璇嗗埆鏄剧ず 褰撳墠鐗堝浘 鍙傛暟()") @PostMapping("/currentCutTerritory") @ResponseBody public Result currentCutTerritory() { List<Map<String, Object>> h = edgStorageCageDetailsService.selectCutTerritory(); - return Result.build(200,"鎴愬姛",h); + return Result.build(200, "鎴愬姛", h); } - @ApiOperation("璇嗗埆鎿嶄綔锛� 鐮存崯/鎷胯蛋 鍙傛暟锛圛D,鍔熻兘[200锛氭嬁璧帮紝201:鐮存崯]锛�") + + @ApiOperation("璇嗗埆鎿嶄綔锛� 鐮存崯/鎷胯蛋 鍙傛暟锛圛D,鍔熻兘[9锛氭嬁璧帮紝8:鐮存崯]锛�") @PostMapping("/identControls") @ResponseBody - public Result identControls(@RequestBody Map<String, Object> arguments) { - boolean issucess = edgStorageCageDetailsService.identWorn(arguments); - return Result.build(200,"鎴愬姛",issucess); + public Result<String> identControls(@RequestBody @Validated IdentWornRequest request) { + return Result.build(200, "鎴愬姛", edgStorageCageDetailsService.identControls(request)); } @ApiOperation("纾ㄨ竟浠诲姟 鍙傛暟()") @PostMapping("/selectEdgTask") @ResponseBody public Result selectEdgTask(@RequestBody Map<String, String> arguments) { - String line=arguments.get("line"); - List<Map<String,Object>> EdgTasks = taskCacheService.selectEdgInfo(line); - return Result.build(200,"鎴愬姛",EdgTasks); + String line = arguments.get("line"); + List<Map<String, Object>> EdgTasks = taskCacheService.selectEdgInfo(line); + return Result.build(200, "鎴愬姛", EdgTasks); } } -- Gitblit v1.8.0