|
@@ -1,5 +1,6 @@
|
|
|
package com.ankaibei.workFlow.webadmin.upms.controller;
|
|
|
|
|
|
+import com.ankaibei.workFlow.webadmin.upms.service.SysDeptService;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import cn.jimmyshi.beanquery.BeanQuery;
|
|
@@ -36,6 +37,8 @@ public class SysPostController {
|
|
|
|
|
|
@Autowired
|
|
|
private SysPostService sysPostService;
|
|
|
+ @Autowired
|
|
|
+ private SysDeptService sysDeptService;
|
|
|
|
|
|
/**
|
|
|
* 新增岗位管理数据。
|
|
@@ -153,9 +156,10 @@ public class SysPostController {
|
|
|
* @return 应答结果对象,包含的数据为 List<Map<String, String>>,map中包含两条记录,key的值分别是id和name,value对应具体数据。
|
|
|
*/
|
|
|
@GetMapping("/listDict")
|
|
|
- public ResponseResult<List<Map<String, Object>>> listDict(SysPost filter) {
|
|
|
+ public ResponseResult<List<Map<String, String>>> listDict(SysPost filter) {
|
|
|
List<SysPost> resultList = sysPostService.getListByFilter(filter);
|
|
|
- return ResponseResult.success(BeanQuery.select("postId as id", "postName as name").executeFrom(resultList));
|
|
|
+ List<Map<String, Object>> mapList = BeanQuery.select("postId as id", "postName as name").executeFrom(resultList);
|
|
|
+ return ResponseResult.success(sysDeptService.lossOfAccuracy(mapList));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -165,8 +169,9 @@ public class SysPostController {
|
|
|
* @return 应答结果对象,包含字典形式的数据集合。
|
|
|
*/
|
|
|
@PostMapping("/listDictByIds")
|
|
|
- public ResponseResult<List<Map<String, Object>>> listDictByIds(@RequestBody List<Long> postIds) {
|
|
|
+ public ResponseResult<List<Map<String, String>>> listDictByIds(@RequestBody List<Long> postIds) {
|
|
|
List<SysPost> resultList = sysPostService.getInList(new HashSet<>(postIds));
|
|
|
- return ResponseResult.success(BeanQuery.select("postId as id", "postName as name").executeFrom(resultList));
|
|
|
+ List<Map<String, Object>> mapList = BeanQuery.select("postId as id", "postName as name").executeFrom(resultList);
|
|
|
+ return ResponseResult.success(sysDeptService.lossOfAccuracy(mapList));
|
|
|
}
|
|
|
}
|