diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/CountrySelectorController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/CountrySelectorController.java new file mode 100644 index 0000000..3254ccf --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/CountrySelectorController.java @@ -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> regionGlobal = iDictClient.getList("region_global"); + if (!regionGlobal.isSuccess()) { + return R.fail("查询数据不存在"); + } + List collect = regionGlobal.getData().stream() + .filter(item -> item.getParentId().longValue() == 1684523498650771L) + .collect(Collectors.toList()); + return R.data(collect); + } + + + /** + * 查询省份字典数据 + * + * @return + */ + @GetMapping("/loadProvince") + public R loadProvince() { + R> regionGlobal = iDictClient.getList("region_global"); + if (!regionGlobal.isSuccess()) { + return R.fail("查询数据不存在"); + } + List collect = regionGlobal.getData().stream() + .filter(item -> item.getParentId().longValue() == 1684523498650771459L) + .collect(Collectors.toList()); + return R.data(collect); + } + + +} \ No newline at end of file