Commit 933db0ef by 太阳与水 Committed by chenzg

完善籍贯

parent c793c5b9
......@@ -1422,23 +1422,31 @@ public class YgglController {
@PostMapping(value = "/jg")
@ApiOperation(value = "展示籍贯所有省市区", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 65)
public Result<List<String>> selectjgs(@CurrentUser UserBean userBean, @RequestBody YgjgDto ygjgDto) {
public Result<List<YgjgDto>> selectjgs(@CurrentUser UserBean userBean, @RequestBody YgjgDto ygjgDto) {
Integer type = ygjgDto.getType();
Integer upId = ygjgDto.getJgid();
List<String> a =new ArrayList<String>();
List<YgjgDto> maps = new ArrayList<YgjgDto>();
Map<Integer, String> map = new HashMap<Integer, String>();
if (type == 1) { //省份
List<YgProDto> proList = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getName).orderByAsc(YgProDto::getProvince).list();
for (YgProDto pro : proList) { a.add(pro.getName());}}
List<YgProDto> list = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).select(YgProDto::getId,YgProDto::getProvince,YgProDto::getName).orderByAsc(YgProDto::getProvince).list();
for (YgProDto pro : list) {
maps.add(new YgjgDto(pro.getId(), pro.getProvince(), pro.getName()));
}}
if (type == 2) { //城市
List<YgCityDto> cityList = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).select(YgCityDto::getId,YgCityDto::getName).eq(YgCityDto::getProvince, upId).orderByAsc(YgCityDto::getProvince).orderByAsc(YgCityDto::getCity).list();
for (YgCityDto city : cityList) { a.add(city.getName());}}
List<YgCityDto> list = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).select(YgCityDto::getId,YgCityDto::getCity,YgCityDto::getName).eq(YgCityDto::getProvince, upId).orderByAsc(YgCityDto::getProvince).orderByAsc(YgCityDto::getCity).list();
for (YgCityDto city : list) {
maps.add(new YgjgDto(city.getId(), city.getCity(), city.getName()));
}}
if (type == 3) { //地区
List<YgAreaDto> areaList = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).select(YgAreaDto::getId,YgAreaDto::getName).eq(YgAreaDto::getCity, upId).orderByAsc(YgAreaDto::getProvince).orderByAsc(YgAreaDto::getCity).list();
for (YgAreaDto area : areaList) { a.add(area.getName());}}
List<YgAreaDto> list = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).select(YgAreaDto::getId,YgAreaDto::getName).eq(YgAreaDto::getCity, upId).orderByAsc(YgAreaDto::getProvince).orderByAsc(YgAreaDto::getCity).list();
for (YgAreaDto area : list) {
maps.add(new YgjgDto(area.getId(), area.getId(), area.getName()));
}}
//IYgjgDto iYgjgDto = PunishFactory.getPunish(type);
//List<String> strings = iYgjgDto.exePunish();
//System.out.println(strings);
if (!a.isEmpty()) return ResultUtil.data(a, "展示籍贯成功");
if (!maps.isEmpty()) return ResultUtil.data(maps, "展示籍贯成功");
return ResultUtil.error("输入参数有误!");
}
......
......@@ -7,6 +7,10 @@ package cn.timer.api.dto.yggl;
import java.io.Serializable;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -26,12 +30,14 @@ public class YgjgDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value="省市区分类id",example="省pro,市city,区area")
@ApiModelProperty(value="省市区分类id",example="省1,市2,区3")
private Integer type;
@ApiModelProperty(value="省市区籍贯id",example="110000")
private Integer jgid;
@Transient
@TableField(exist = false)
private String jgname;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment