|
@ -18,6 +18,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
@ -45,6 +47,8 @@ public class SpecialistHospitalItemService extends BaseService {
|
|
|
private SystemDictDao systemDictDao;
|
|
|
@Autowired
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
/**
|
|
|
* 获取url
|
|
@ -67,14 +71,20 @@ public class SpecialistHospitalItemService extends BaseService {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Hospital> selectHospital(String hospitalName){
|
|
|
public List<Hospital> selectHospital(String hospitalName,Integer grade){
|
|
|
List<Hospital> hospitals = new ArrayList<>();
|
|
|
if (StringUtils.isNoneBlank(hospitalName)){
|
|
|
Hospital hospital = new Hospital();
|
|
|
hospital = hospitalDao.findByName(hospitalName);
|
|
|
hospitals.add(hospital);
|
|
|
if (StringUtils.isNoneBlank(hospitalName) && grade != 0){
|
|
|
String sql = "select * from dm_hospital where name like '%"+hospitalName+"%' AND grade = "+grade;
|
|
|
hospitals = jdbcTemplate.query(sql,new BeanPropertyRowMapper(Hospital.class));
|
|
|
} else if (StringUtils.isNoneBlank(hospitalName)){
|
|
|
String sql = "select * from dm_hospital where name like '%"+hospitalName+"%'";
|
|
|
hospitals = jdbcTemplate.query(sql,new BeanPropertyRowMapper(Hospital.class));
|
|
|
}else if (grade != 0){
|
|
|
String sql = "select * from dm_hospital where grade = "+grade+"";
|
|
|
hospitals = jdbcTemplate.query(sql,new BeanPropertyRowMapper(Hospital.class));
|
|
|
}else {
|
|
|
hospitals = hospitalDao.findAllHospital();
|
|
|
}
|
|
|
hospitals = hospitalDao.findAllHospital();
|
|
|
return hospitals;
|
|
|
}
|
|
|
|
|
@ -150,12 +160,13 @@ public class SpecialistHospitalItemService extends BaseService {
|
|
|
/**
|
|
|
* 删除机构服务项目
|
|
|
*/
|
|
|
public JSONObject delete(String serviceItem,String hospital){
|
|
|
public JSONObject delete(String serviceItem,String hospital,String id){
|
|
|
String response = null;
|
|
|
String url =getBaseUrl() + "deleteHospitalItem";
|
|
|
Map<String,String> params = new HashMap<>();
|
|
|
params.put("hospital",hospital);
|
|
|
params.put("serviceItem",serviceItem);
|
|
|
params.put("id",id);
|
|
|
try {
|
|
|
response = httpClientUtil.httpPost(url,params);
|
|
|
}catch (Exception e){
|