Commit ec30ea66c05ae73a9e410a39d398cc2eb131caee
1 parent
88af4f2c
Exists in
dev
企业大屏:厂站列表接口
Showing
1 changed file
with
12 additions
and
10 deletions
Show diff stats
backend/lpg-api/src/main/java/com/hotent/lpg/api/controller/EnterpriseLargeScreenController.java
... | ... | @@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.GetMapping; |
14 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
15 | 15 | import org.springframework.web.bind.annotation.RestController; |
16 | 16 | |
17 | +import java.util.ArrayList; | |
18 | +import java.util.HashMap; | |
17 | 19 | import java.util.List; |
18 | 20 | import java.util.Map; |
19 | 21 | import java.util.stream.Collectors; |
... | ... | @@ -54,16 +56,16 @@ public class EnterpriseLargeScreenController { |
54 | 56 | @ApiOperation(value = "厂站集合", httpMethod = "GET", notes = "厂站集合") |
55 | 57 | public CommonResult<Object> stationList() { |
56 | 58 | List<WCzxx> list = mCzxxManager.list(); |
57 | - Map<String, String> map = list.stream().collect(Collectors.toMap(WCzxx::getId, WCzxx::getFCzmc)); | |
58 | - return new CommonResult(true, "操作成功").value(map); | |
59 | +// Map<String, String> map = list.stream().collect(Collectors.toMap(WCzxx::getId, WCzxx::getFCzmc)); | |
60 | +// return new CommonResult(true, "操作成功").value(map); | |
59 | 61 | |
60 | -// ArrayList<HashMap> maps = new ArrayList<>(); | |
61 | -// for (WQyxx wQyxx : list) { | |
62 | -// HashMap<String, String> map = new HashMap<>(); | |
63 | -// map.put("qymc",wQyxx.getFQymc()); | |
64 | -// map.put("qyId",wQyxx.getId()); | |
65 | -// maps.add(map); | |
66 | -// } | |
67 | -// return new CommonResult(true, "操作成功").value(maps); | |
62 | + ArrayList<HashMap> maps = new ArrayList<>(); | |
63 | + for (WCzxx wCzxx : list) { | |
64 | + HashMap<String, String> map = new HashMap<>(); | |
65 | + map.put("label",wCzxx.getFCzmc()); | |
66 | + map.put("value",wCzxx.getId()); | |
67 | + maps.add(map); | |
68 | + } | |
69 | + return new CommonResult(true, "操作成功").value(maps); | |
68 | 70 | } |
69 | 71 | } | ... | ... |