| 
															
																@ -16,13 +16,8 @@ import com.yihu.jw.restmodel.iot.common.ExistVO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.restmodel.iot.device.IotDeviceImportRecordVO; 
															 | 
															
															 | 
															
																import com.yihu.jw.restmodel.iot.device.IotDeviceImportRecordVO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.restmodel.iot.device.IotDeviceImportVO; 
															 | 
															
															 | 
															
																import com.yihu.jw.restmodel.iot.device.IotDeviceImportVO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.restmodel.iot.device.IotDeviceVO; 
															 | 
															
															 | 
															
																import com.yihu.jw.restmodel.iot.device.IotDeviceVO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.rm.iot.IotRequestMapping; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import io.swagger.annotations.ApiOperation; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import io.swagger.annotations.ApiParam; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.beans.factory.annotation.Autowired; 
															 | 
															
															 | 
															
																import org.springframework.beans.factory.annotation.Autowired; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.stereotype.Service; 
															 | 
															
															 | 
															
																import org.springframework.stereotype.Service; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.web.bind.annotation.GetMapping; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.web.bind.annotation.RequestBody; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.web.multipart.MultipartFile; 
															 | 
															
															 | 
															
																import org.springframework.web.multipart.MultipartFile; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import java.io.IOException; 
															 | 
															
															 | 
															
																import java.io.IOException; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -45,8 +40,7 @@ public class DeviceService extends BaseService{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @return 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @throws IOException 
															 | 
															
															 | 
															
																     * @throws IOException 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public Envelop<IotDeviceVO> create(@ApiParam(name = "json_data", value = "", defaultValue = "") 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                          @RequestBody String jsonData) throws IOException { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public Envelop<IotDeviceVO> create(String jsonData) throws IOException { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
															
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("jsonData", jsonData); 
															 | 
															
															 | 
															
																        params.put("jsonData", jsonData); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.CreateDevice, params); 
															 | 
															
															 | 
															
																        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.CreateDevice, params); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -60,8 +54,6 @@ public class DeviceService extends BaseService{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @return 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @throws IOException 
															 | 
															
															 | 
															
																     * @throws IOException 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @GetMapping(value = IotRequestMapping.Device.api_getById) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @ApiOperation(value = "根据code查找设备", notes = "根据code查找设备") 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public Envelop<IotDeviceVO> findByCode(String id)throws IOException{ 
															 | 
															
															 | 
															
																    public Envelop<IotDeviceVO> findByCode(String id)throws IOException{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
															
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("id", id); 
															 | 
															
															 | 
															
																        params.put("id", id); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -107,7 +99,34 @@ public class DeviceService extends BaseService{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public BaseEnvelop updSim(String sim,String id) throws IOException{ 
															 | 
															
															 | 
															
																    public BaseEnvelop updSim(String sim,String id) throws IOException{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
															
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("sim", sim); 
															 | 
															
															 | 
															
																        params.put("sim", sim); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        HttpResponse response = HttpHelper.get(iotUrl + ServiceApi.Device.UpdSim, params); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("id", id); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.UpdSim, params); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        BaseEnvelop envelop = objectMapper.readValue(response.getBody(),BaseEnvelop.class); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        return envelop; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * 删除 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param id 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public Envelop<IotDeviceVO> delDevice(String id) throws IOException{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("id", id); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.DelDevice, params); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        Envelop<IotDeviceVO> envelop = objectMapper.readValue(response.getBody(),Envelop.class); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        return envelop; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * 修改设备 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param jsonData 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public BaseEnvelop updDevice(String jsonData) throws IOException{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        Map<String, Object> params = new HashMap<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("jsonData", jsonData); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        HttpResponse response = HttpHelper.post(iotUrl + ServiceApi.Device.UpdDevice, params); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        BaseEnvelop envelop = objectMapper.readValue(response.getBody(),BaseEnvelop.class); 
															 | 
															
															 | 
															
																        BaseEnvelop envelop = objectMapper.readValue(response.getBody(),BaseEnvelop.class); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return envelop; 
															 | 
															
															 | 
															
																        return envelop; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 |