段飞宇
1 year ago
1 changed files with 62 additions and 0 deletions
@ -0,0 +1,62 @@
|
||||
package com.hnac.hzims.operational.station.controller; |
||||
|
||||
|
||||
import io.swagger.annotations.Api; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.system.entity.Dict; |
||||
import org.springblade.system.feign.IDictClient; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
@RestController |
||||
@RequestMapping("/country/selector") |
||||
@Api(value = "国家管理", tags = "国家管理") |
||||
public class CountrySelectorController { |
||||
|
||||
|
||||
@Autowired |
||||
private IDictClient iDictClient; |
||||
|
||||
|
||||
/** |
||||
* 查询国家字典数据 |
||||
* |
||||
* @return |
||||
*/ |
||||
@GetMapping("/countryOfIssue") |
||||
public R countryOfIssue() { |
||||
R<List<Dict>> regionGlobal = iDictClient.getList("region_global"); |
||||
if (!regionGlobal.isSuccess()) { |
||||
return R.fail("查询数据不存在"); |
||||
} |
||||
List<Dict> collect = regionGlobal.getData().stream() |
||||
.filter(item -> item.getParentId().longValue() == 1684523498650771L) |
||||
.collect(Collectors.toList()); |
||||
return R.data(collect); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 查询省份字典数据 |
||||
* |
||||
* @return |
||||
*/ |
||||
@GetMapping("/loadProvince") |
||||
public R loadProvince() { |
||||
R<List<Dict>> regionGlobal = iDictClient.getList("region_global"); |
||||
if (!regionGlobal.isSuccess()) { |
||||
return R.fail("查询数据不存在"); |
||||
} |
||||
List<Dict> collect = regionGlobal.getData().stream() |
||||
.filter(item -> item.getParentId().longValue() == 1684523498650771459L) |
||||
.collect(Collectors.toList()); |
||||
return R.data(collect); |
||||
} |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue