|
@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.print.DocFlavor;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@ -54,6 +55,8 @@ public class MedicineWarrayService extends BaseJpaService<Mediicinewarray, Medii
|
|
|
|
|
|
@Autowired
|
|
|
private HibenateUtils hibenateUtils;
|
|
|
@Autowired
|
|
|
MedicineServive medicineServive;
|
|
|
|
|
|
|
|
|
public JSONObject getDeviceInfo(String condition,String userId,int page,int size){
|
|
@ -1045,6 +1048,18 @@ public class MedicineWarrayService extends BaseJpaService<Mediicinewarray, Medii
|
|
|
deviceDao.save(mediicinedevice);
|
|
|
Mediicinewarray mediicinewarray = medicinedeviceService.uploadDeviceInfo(equNum, temperature, humidity, type, null, null, null, null);
|
|
|
result.put("msg",mediicinewarray);
|
|
|
/**
|
|
|
* 推送实时温湿度
|
|
|
*/
|
|
|
try {
|
|
|
JSONObject chargeNotice = new JSONObject();
|
|
|
chargeNotice.put("now_humidity",humidity+"");
|
|
|
chargeNotice.put("now_temperature",temperature+"");
|
|
|
medicineServive.sendSocketMessage(equNum+"_T","humidity_temperature", URLEncoder.encode(chargeNotice.toJSONString(),"UTF-8"));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
}
|