src/main/java/com/yssh/config/InitConfig.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/yssh/controller/SuYuanController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/yssh/service/SuYuanService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
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(); src/main/java/com/yssh/controller/SuYuanController.java
@@ -170,7 +170,7 @@ @ApiOperation(value = "根据X,Y值查询地址", notes = "根据X,Y值查询地址") @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)); } } 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"; } }