|
@@ -3,14 +3,14 @@ package com.sd.framework.controller;
|
|
|
import com.fjhx.tenant.entity.dict.po.DictCommonData;
|
|
|
import com.fjhx.tenant.service.dict.DictCommonDataService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-@Controller
|
|
|
+@RestController
|
|
|
public class SdDictController {
|
|
|
|
|
|
@Autowired
|
|
@@ -20,9 +20,9 @@ public class SdDictController {
|
|
|
* 申购单分页
|
|
|
*/
|
|
|
@PostMapping("/allDictMap")
|
|
|
- public Map<String, DictCommonData> allDictMap() {
|
|
|
- return dictCommonDataService.list(q -> q.orderByAsc(DictCommonData::getSort)).stream()
|
|
|
- .collect(Collectors.toMap(DictCommonData::getDictCode, Function.identity()));
|
|
|
+ public Map<String, List<DictCommonData>> allDictMap() {
|
|
|
+ return dictCommonDataService.list(q -> q.orderByAsc(DictCommonData::getSort))
|
|
|
+ .stream().collect(Collectors.groupingBy(DictCommonData::getDictCode));
|
|
|
}
|
|
|
|
|
|
}
|