From ef3b1b5570ca8b73cffde8be68387dc68c7c3990 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 20 七月 2023 16:41:30 +0800 Subject: [PATCH] 1 --- src/main/java/com/yssh/config/InitConfig.java | 10 ++++------ src/main/java/com/yssh/service/SuYuanService.java | 7 +++++++ src/main/java/com/yssh/controller/SuYuanController.java | 11 ++++++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/yssh/config/InitConfig.java b/src/main/java/com/yssh/config/InitConfig.java index e38bf06..8711ca3 100644 --- a/src/main/java/com/yssh/config/InitConfig.java +++ b/src/main/java/com/yssh/config/InitConfig.java @@ -6,7 +6,6 @@ import org.apache.commons.logging.LogFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.stereotype.Component; @@ -22,10 +21,10 @@ //protected final Log logger = LogFactory.getLog(this.getClass()); protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - @Autowired + @Resource private CommonService commonService; - @Autowired + @Resource private DictRecordService dictRecordService; @Resource @@ -39,9 +38,8 @@ CacheUtils.init(); boolean tableExists = commonService.checkTableExists("dict_record"); - if (!tableExists) { - dictRecordService.createDictRecoTable(); - } + if (!tableExists) dictRecordService.createDictRecoTable(); + // 璇诲彇dat鏁版嵁 commonService.readDatData(); diff --git a/src/main/java/com/yssh/controller/SuYuanController.java b/src/main/java/com/yssh/controller/SuYuanController.java index 7f39785..196bfa4 100644 --- a/src/main/java/com/yssh/controller/SuYuanController.java +++ b/src/main/java/com/yssh/controller/SuYuanController.java @@ -170,7 +170,7 @@ @ApiOperation(value = "鏍规嵁X锛孻鍊兼煡璇㈠湴鍧�", notes = "鏍规嵁X锛孻鍊兼煡璇㈠湴鍧�") @ApiOperationSupport(order = 14) @GetMapping("/selectCoords") - public Result selectCoords(@RequestParam(value = "x") Integer x, @RequestParam(value = "y") Integer y, @RequestParam(value = "isSuYuan") Integer isSuYuan) { + public Result selectCoords(@RequestParam(value = "x") Integer x, @RequestParam(value = "y") Integer y, @RequestParam(value = "isSuYuan") Integer isSuYuan) { if (isSuYuan < 1) { x = x / 10; y = y / 10; @@ -194,4 +194,13 @@ return Result.OK(suYuanService.selectRects(x, y)); } + + @ApiOperation(value = "鏍规嵁鍚嶇О鏌ヨ婧簮ID", notes = "鏍规嵁鍚嶇О鏌ヨ婧簮ID") + @ApiOperationSupport(order = 16) + @GetMapping("/selectSuYuanIdByName") + public Result selectSuYuanIdByName(@RequestParam(value = "name") String name) { + if (null == name || name.length() == 0) return Result.OK(null); + + return Result.OK(suYuanService.selectSuYuanIdByName(name)); + } } diff --git a/src/main/java/com/yssh/service/SuYuanService.java b/src/main/java/com/yssh/service/SuYuanService.java index d6630de..f697546 100644 --- a/src/main/java/com/yssh/service/SuYuanService.java +++ b/src/main/java/com/yssh/service/SuYuanService.java @@ -319,4 +319,11 @@ return null; } + + public String selectSuYuanIdByName(String name) { + MonitorPointPosition mpp = commonService.select3dCheckPointByName(name); + if (null == mpp) return null; + + return mpp.getId().substring(0, mpp.getId().lastIndexOf("_") + 1) + "0"; + } } -- Gitblit v1.9.3