|
@ -24,32 +24,32 @@ public class MedicineServive {
|
|
|
private MediicinedrugsDao mediicinedrugsDao;
|
|
|
|
|
|
|
|
|
public void getOrgPhysicDict(String orgCode,String name,String orgName,String physicCode){
|
|
|
String param="";
|
|
|
if (StringUtils.isNoneBlank(orgCode)){
|
|
|
param="?orgCode="+orgCode;
|
|
|
public void getOrgPhysicDict(String orgCode, String name, String orgName, String physicCode) {
|
|
|
String param = "";
|
|
|
if (StringUtils.isNoneBlank(orgCode)) {
|
|
|
param = "?orgCode=" + orgCode;
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(name)){
|
|
|
param+="?name="+name;
|
|
|
if (StringUtils.isNoneBlank(name)) {
|
|
|
param += "?name=" + name;
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(orgName)){
|
|
|
param+="?orgName"+orgName;
|
|
|
if (StringUtils.isNoneBlank(orgName)) {
|
|
|
param += "?orgName" + orgName;
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(physicCode)){
|
|
|
param+="?physicCode"+physicCode;
|
|
|
if (StringUtils.isNoneBlank(physicCode)) {
|
|
|
param += "?physicCode" + physicCode;
|
|
|
}
|
|
|
JSONObject re = wlyyHttpService.sendWlyyMesGet("getOrgPhysicDict",param);
|
|
|
if(re!=null){
|
|
|
JSONObject re = wlyyHttpService.sendWlyyMesGet("getOrgPhysicDict", param);
|
|
|
if (re != null) {
|
|
|
JSONArray jsonArray = JSONArray.parseArray(re.getString("data"));
|
|
|
logger.info("mediicinedrugs size:"+jsonArray.size());
|
|
|
if(jsonArray!=null&&jsonArray.size()>0){
|
|
|
logger.info("mediicinedrugs size:" + jsonArray.size());
|
|
|
if (jsonArray != null && jsonArray.size() > 0) {
|
|
|
Integer addCount = 0;
|
|
|
Integer updateCount =0;
|
|
|
List<Mediicinedrugs>list=new ArrayList<>();
|
|
|
for(int i=0;i<jsonArray.size();i++){
|
|
|
Integer updateCount = 0;
|
|
|
List<Mediicinedrugs> list = new ArrayList<>();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject h = (JSONObject) jsonArray.get(i);
|
|
|
String drugCode = h.getString("physic_code");
|
|
|
if(!mediicinedrugsDao.existsByDrugCodeAndOrgCode(drugCode,h.getString("orgCode"))){
|
|
|
if (!mediicinedrugsDao.existsByDrugCodeAndOrgCode(drugCode, h.getString("orgCode"))) {
|
|
|
Mediicinedrugs org = new Mediicinedrugs();
|
|
|
org.setDrugCode(drugCode);
|
|
|
org.setDosForm(h.getString("physic_form_name"));
|
|
@ -65,8 +65,8 @@ public class MedicineServive {
|
|
|
org.setPackUnit(h.getString("pack_unit_name"));
|
|
|
list.add(org);
|
|
|
addCount++;
|
|
|
}else{
|
|
|
Mediicinedrugs org = mediicinedrugsDao.findByDrugCodeAndOrgCode(drugCode,h.getString("orgCode"));
|
|
|
} else {
|
|
|
Mediicinedrugs org = mediicinedrugsDao.findByDrugCodeAndOrgCode(drugCode, h.getString("orgCode"));
|
|
|
org.setDrugCode(drugCode);
|
|
|
org.setDosForm(h.getString("physic_form_name"));
|
|
|
org.setDrugName(h.getString("physic_name"));
|
|
@ -84,8 +84,26 @@ public class MedicineServive {
|
|
|
}
|
|
|
}
|
|
|
mediicinedrugsDao.save(list);
|
|
|
logger.info("mediicinedrugs:addCount:"+addCount+" updateCount:"+updateCount);
|
|
|
logger.info("mediicinedrugs:addCount:" + addCount + " updateCount:" + updateCount);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public JSONObject SetTemperatureAndHumidity(String devId, String temperature, String humidity, Boolean temperatureControl
|
|
|
, Boolean humidityControl, Boolean heat) {
|
|
|
String param = "";
|
|
|
if (StringUtils.isNoneBlank(devId)) {
|
|
|
param = "?devId=" + devId;
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(temperature)) {
|
|
|
param += "?temperature=" + temperature;
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(humidity)) {
|
|
|
param += "?humidity=" + humidity;
|
|
|
}
|
|
|
param += "?temperatureControl=" + temperatureControl;
|
|
|
param += "?humidityControl=" + humidityControl;
|
|
|
param += "?heat=" + heat;
|
|
|
return wlyyHttpService.sendWlyyMesGet("http://yik.ab-inbev.vip/c/upws/send", param);
|
|
|
}
|
|
|
}
|