|
@ -4,12 +4,10 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.care.dao.device.BaseDeviceElectricRecordDao;
|
|
|
import com.yihu.jw.care.dao.device.BaseHzInterfaceDictDao;
|
|
|
import com.yihu.jw.care.dao.device.PatientDeviceDao;
|
|
|
import com.yihu.jw.care.util.DSLUtils;
|
|
|
import com.yihu.jw.care.util.HttpToolUtil;
|
|
|
import com.yihu.jw.care.util.MD5Utils;
|
|
|
import com.yihu.jw.entity.care.device.BaseDeviceElectricRecordDO;
|
|
|
import com.yihu.jw.entity.care.device.DevicePatientDevice;
|
|
|
import com.yihu.jw.entity.util.BaseHzInterfaceDictEntity;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
@ -43,8 +41,6 @@ public class HzInterfaceService {
|
|
|
@Autowired
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
@Autowired
|
|
|
private PatientDeviceDao patientDeviceDao;
|
|
|
@Autowired
|
|
|
private BaseDeviceElectricRecordDao baseDeviceElectricRecordDao;
|
|
|
|
|
|
/**
|
|
@ -53,7 +49,7 @@ public class HzInterfaceService {
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
public synchronized BaseDeviceElectricRecordDO electricityTable(String queryDate,String patient){
|
|
|
public BaseDeviceElectricRecordDO electricityTable(String queryDate,String patient){
|
|
|
try {
|
|
|
List<BaseDeviceElectricRecordDO> list = new ArrayList<>();
|
|
|
if(StringUtils.isNotBlank(patient)){
|
|
@ -67,32 +63,6 @@ public class HzInterfaceService {
|
|
|
return list.get(0);
|
|
|
}
|
|
|
}
|
|
|
Map<String,Integer> map = new HashMap<>();
|
|
|
JSONArray jsonArray = getAreaApi(queryDate);
|
|
|
for (int i=0;i<jsonArray.size();i++){
|
|
|
JSONObject json = jsonArray.getJSONObject(i);
|
|
|
String consNo = json.getString("consNo");
|
|
|
if(!map.containsKey(consNo)){
|
|
|
map.put(consNo,0);
|
|
|
BaseDeviceElectricRecordDO recordDO = new BaseDeviceElectricRecordDO();
|
|
|
recordDO.setAddress(json.getString("address"));
|
|
|
recordDO.setConsNo(json.getString("consNo"));
|
|
|
recordDO.setHome(json.getString("home"));
|
|
|
recordDO.setLowerLimit(json.getString("lowerLimit"));
|
|
|
recordDO.setStatDate(json.getString("statDate"));
|
|
|
recordDO.setUpperLimit(json.getString("upperLimit"));
|
|
|
recordDO.setName(json.getString("name"));
|
|
|
DevicePatientDevice patientDevice = patientDeviceDao.findByDeviceSnAndCategoryCodeAndUserType(consNo,"20","-1");
|
|
|
if(patientDevice!=null){
|
|
|
recordDO.setPatient(patientDevice.getUser());
|
|
|
}
|
|
|
list.add(recordDO);
|
|
|
}
|
|
|
}
|
|
|
if(list.size()>0){
|
|
|
baseDeviceElectricRecordDao.save(list);
|
|
|
return list.get(0);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|