吴门医述-学术传承-人员地址添加国外
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -12,12 +14,12 @@ import com.peanut.modules.sys.service.SysDictDataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.awt.print.Book;
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -38,6 +40,12 @@ public class MedicaldesController {
|
||||
private SysDictDataService sysDictDataService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
@Autowired
|
||||
private ProvinceService provinceService;
|
||||
@Autowired
|
||||
private CityService cityService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -165,6 +173,67 @@ public class MedicaldesController {
|
||||
return R.ok().put("result", list);
|
||||
}
|
||||
|
||||
//国际医师可能来自国外在省市里加入外国
|
||||
public String[] getCounts() {
|
||||
//countId 为1 2 3
|
||||
String[] count = {"马来西亚","越南","加拿大"};
|
||||
return count;
|
||||
}
|
||||
|
||||
public List getCityList(String count,int countId) {
|
||||
List<City> cityList = new ArrayList<>();
|
||||
City city = new City();
|
||||
city.setProvId((long)countId);
|
||||
city.setCityName(count);
|
||||
city.setCityId((long)countId);
|
||||
cityList.add(city);
|
||||
return cityList;
|
||||
}
|
||||
|
||||
//获取地址
|
||||
@RequestMapping(path = "/getMedicaldesProList")
|
||||
public R getMedicaldesProList() {
|
||||
String s = redisTemplate.opsForValue().get("Province");
|
||||
List<Province> provinceList = new ArrayList<>();
|
||||
if (getCounts() != null){
|
||||
for (int i=0;i<getCounts().length;i++){
|
||||
Province p = new Province();
|
||||
p.setProvName(getCounts()[i]);
|
||||
p.setProvId((long)i+1);
|
||||
p.setCityList(getCityList(getCounts()[i],i+1));
|
||||
provinceList.add(p);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(s)) {
|
||||
List<Object> redisData = JSONArray.parseArray(s);
|
||||
for (Object object : redisData) {
|
||||
Province ret = JSONObject.parseObject(object.toString(), Province.class);
|
||||
provinceList.add(ret);
|
||||
}
|
||||
return R.ok().put("provinceEntity", provinceList);
|
||||
}else {
|
||||
provinceList.addAll(provinceService.getCity());
|
||||
}
|
||||
return R.ok().put("provinceEntity", provinceList);
|
||||
}
|
||||
|
||||
//获取市列表
|
||||
@RequestMapping(path = "/getCityByPro")
|
||||
public R getCityByPro(@RequestParam("provId") Integer provId) {
|
||||
List<City> prov = new ArrayList<>();
|
||||
if (1==provId){
|
||||
prov.addAll(getCityList(getCounts()[0],1));
|
||||
}else if (2==provId){
|
||||
prov.addAll(getCityList(getCounts()[1],2));
|
||||
}else if (3==provId){
|
||||
prov.addAll(getCityList(getCounts()[2],3));
|
||||
}else {
|
||||
prov = cityService.getBaseMapper().selectList(new QueryWrapper<City>()
|
||||
.eq("prov_id", provId));
|
||||
}
|
||||
return R.ok().put("prov", prov);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getInheritById")
|
||||
public R getInheritById(String id) {
|
||||
LambdaQueryWrapper<MedicaldesInheritRelation> wrapper = new LambdaQueryWrapper();
|
||||
|
||||
Reference in New Issue
Block a user