Explorar el Código

眼科医院处方物流

ysj hace 5 años
padre
commit
3cc6346060

+ 19 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -469,7 +469,25 @@ public class MonitorPlatformService  {
        String response = sendGet(url,params);
        JSONObject json = JSONObject.parseObject(response);
        if(json.getInteger("status")==200){
            return json.getJSONObject("data");
            JSONObject tmp = json.getJSONObject("data");
            //查询物联网获取设备信息
            String sql = "SELECT d.device_sn,b.supplier_name supplierName,b.origin_place originPlace,e.product_img productImg" +
                    ",e.description  from iot_device d,iot_product_base_info b,iot_product_extend_info e" +
                    " WHERE d.device_sn = '"+deviceSn+"' and d.product_id = b.id and d.product_id = e.product_id";
            List<JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
            if(list!=null&&list.size()>0){
                JSONObject js = list.get(0);
                tmp.put("supplierName",js.getString("supplierName"));
                tmp.put("originPlace",js.getString("originPlace"));
                tmp.put("productImg",js.getString("productImg"));
                tmp.put("description",js.getString("description"));
            }else{
                tmp.put("supplierName","");
                tmp.put("originPlace","");
                tmp.put("productImg","");
                tmp.put("description","");
            }
            return tmp;
        }
        return new JSONObject();