Commit 0ffd0831 by lanmw

add getSystemByCode method

parent ecee4836
...@@ -95,11 +95,6 @@ public class TagCtrl { ...@@ -95,11 +95,6 @@ public class TagCtrl {
return tagService.searchSystemTagByPage(userName, keyword, path, domain, new Page(pageSize, pageNo)); return tagService.searchSystemTagByPage(userName, keyword, path, domain, new Page(pageSize, pageNo));
} }
@ApiOperation(value = "查询系统标签", notes = "查询系统标签")
@GetMapping(value = "/listSysTags")
public List<SysTag> listSysTags() {
return tagService.listSysTags();
}
@ApiOperation(value = "搜索维度标签里面的个人标签", notes = "搜索维度标签里面的个人标签") @ApiOperation(value = "搜索维度标签里面的个人标签", notes = "搜索维度标签里面的个人标签")
@GetMapping(value = "/searchPersonalDimensionTagByPage") @GetMapping(value = "/searchPersonalDimensionTagByPage")
...@@ -131,5 +126,21 @@ public class TagCtrl { ...@@ -131,5 +126,21 @@ public class TagCtrl {
tagService.shareTags(tagIds); tagService.shareTags(tagIds);
} }
//---------------以下为导入系统的时候用到------------------
@ApiOperation(value = "查询系统标签", notes = "查询系统标签")
@GetMapping(value = "/listSystems")
public List<SysTag> listSysTags() {
return tagService.listSysTags();
}
@ApiOperation(value = "查询系统标签", notes = "查询系统标签")
@GetMapping(value = "/getSystemByCode")
public SysTag getSystemByCode(@RequestParam("code") String code) {
return tagService.getSystemByCode(code);
}
} }
...@@ -38,13 +38,6 @@ public class TagFileCtrl { ...@@ -38,13 +38,6 @@ public class TagFileCtrl {
return tagExportService.importExcel(userName, dept, file); return tagExportService.importExcel(userName, dept, file);
} }
@PostMapping("/importSysTag")
public String importSysExcel(MultipartFile file, HttpServletResponse response) throws Exception {
String userName = UserInfoUtils.getUserName();
return tagExportService.importSysExcel(userName, file);
}
@ApiOperation(value = "分页获取导入日志", notes = "分页获取导入日志") @ApiOperation(value = "分页获取导入日志", notes = "分页获取导入日志")
@GetMapping(value = "/listImportTagLogByPage") @GetMapping(value = "/listImportTagLogByPage")
public Page searchPersonalDimensionTagByPage(@RequestParam("pageNo") Integer pageNo, public Page searchPersonalDimensionTagByPage(@RequestParam("pageNo") Integer pageNo,
...@@ -59,4 +52,13 @@ public class TagFileCtrl { ...@@ -59,4 +52,13 @@ public class TagFileCtrl {
} }
//----------------------以下为导入系统的时候
@PostMapping("/importSystem")
public String importSystem(MultipartFile file, HttpServletResponse response) throws Exception {
String userName = UserInfoUtils.getUserName();
return tagExportService.importSystem(userName, file);
}
} }
...@@ -58,7 +58,7 @@ public class TagFileService { ...@@ -58,7 +58,7 @@ public class TagFileService {
return "ok"; return "ok";
} }
public String importSysExcel(String userName, MultipartFile file) throws Exception { public String importSystem(String userName, MultipartFile file) throws Exception {
ImportLog importLog = new ImportLog(UUID.randomUUID().toString()); ImportLog importLog = new ImportLog(UUID.randomUUID().toString());
importLog.setType(Constants.SYS_TAG_LOG_TYPE); importLog.setType(Constants.SYS_TAG_LOG_TYPE);
importLog.setCreator(userName); importLog.setCreator(userName);
......
...@@ -389,4 +389,8 @@ public class TagService { ...@@ -389,4 +389,8 @@ public class TagService {
return mongoOperations.findAll(SysTag.class); return mongoOperations.findAll(SysTag.class);
} }
public SysTag getSystemByCode(String code) {
return mongoOperations.findOne(Query.query(Criteria.where("systemCode").is(code)), SysTag.class);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment