|
@ -5,13 +5,11 @@ package com.yihu.wlyy.service.manager.specialist;/**
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.wlyy.entity.Hospital;
|
|
|
import com.yihu.wlyy.repository.HospitalDao;
|
|
|
import com.yihu.wlyy.repository.SystemDictDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
@ -29,33 +27,12 @@ import java.util.Map;
|
|
|
public class SpecialistHospitalItemService extends BaseService {
|
|
|
|
|
|
private static org.slf4j.Logger logger = LoggerFactory.getLogger(SpecialistHospitalItemService.class);
|
|
|
|
|
|
private static String URL = "specialist:url";
|
|
|
@Autowired
|
|
|
private HospitalDao hospitalDao;
|
|
|
@Autowired
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
@Autowired
|
|
|
private RedisTemplate redisTemplate;
|
|
|
@Autowired
|
|
|
private SystemDictDao systemDictDao;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取url
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public String getBaseUrl(){
|
|
|
String url = (String) redisTemplate.opsForValue().get(URL);
|
|
|
String url1 = systemDictDao.findByDictNameAndCode3("SPECIALIST_URL","SPECIALIST_URL");
|
|
|
if (url != null && url1.equalsIgnoreCase(url)){
|
|
|
return url;
|
|
|
}else {
|
|
|
redisTemplate.opsForValue().set(URL,url1);
|
|
|
return url1;
|
|
|
}
|
|
|
}
|
|
|
@Value("${specialist.url}")
|
|
|
private String specialistUrl;
|
|
|
|
|
|
/**
|
|
|
*
|
|
@ -68,7 +45,7 @@ public class SpecialistHospitalItemService extends BaseService {
|
|
|
|
|
|
public JSONObject insert(String hospitalServiceItem){
|
|
|
String response = null;
|
|
|
String url =getBaseUrl() + "createHospitalServiceItem";
|
|
|
String url =specialistUrl + "svr-specialist/createHospitalServiceItem";
|
|
|
Map<String,String> params = new HashMap<>();
|
|
|
params.put("hospitalServiceItem",hospitalServiceItem);
|
|
|
try {
|
|
@ -89,7 +66,7 @@ public class SpecialistHospitalItemService extends BaseService {
|
|
|
*/
|
|
|
public JSONObject selectItemByHospital(String hospital){
|
|
|
String response = null;
|
|
|
String url =getBaseUrl() + "selectItemByHospital";
|
|
|
String url =specialistUrl + "svr-specialist/selectItemByHospital";
|
|
|
Map<String,String> params = new HashMap<>();
|
|
|
params.put("hospital",hospital);
|
|
|
try {
|