4 changed files with 110 additions and 0 deletions
			
			
		@ -0,0 +1,31 @@ | 
				
			|||||||
 | 
					package com.hnac.hzims.real.vo; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import io.swagger.annotations.ApiModel; | 
				
			||||||
 | 
					import io.swagger.annotations.ApiModelProperty; | 
				
			||||||
 | 
					import lombok.Data; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.Map; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @author ysj | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@Data | 
				
			||||||
 | 
					@ApiModel(value = "设备历史查询参数") | 
				
			||||||
 | 
					public class RealDeviceParamVo { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@ApiModelProperty(value = "站点Id") | 
				
			||||||
 | 
						private String projectId; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@ApiModelProperty(value = "厂租ID") | 
				
			||||||
 | 
						private String deviceId; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@ApiModelProperty(value = "厂租点名称") | 
				
			||||||
 | 
						private String attrName; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@ApiModelProperty(value = "页码") | 
				
			||||||
 | 
						private Integer current; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@ApiModelProperty(value = "页码条数") | 
				
			||||||
 | 
						private Integer size; | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,34 @@ | 
				
			|||||||
 | 
					package com.hnac.hzims.real.controller; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; | 
				
			||||||
 | 
					import com.hnac.hzims.real.service.IRealDeviceService; | 
				
			||||||
 | 
					import com.hnac.hzims.real.vo.RealDeviceParamVo; | 
				
			||||||
 | 
					import io.swagger.annotations.Api; | 
				
			||||||
 | 
					import io.swagger.annotations.ApiOperation; | 
				
			||||||
 | 
					import lombok.AllArgsConstructor; | 
				
			||||||
 | 
					import org.springblade.core.boot.ctrl.BladeController; | 
				
			||||||
 | 
					import org.springblade.core.tool.api.R; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.PostMapping; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.RequestBody; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.RequestMapping; | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.RestController; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @author ysj | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@RestController | 
				
			||||||
 | 
					@AllArgsConstructor | 
				
			||||||
 | 
					@RequestMapping("/real") | 
				
			||||||
 | 
					@Api(value = "厂租点实时数据", tags = "厂租点实时数据") | 
				
			||||||
 | 
					public class RealDeviceController extends BladeController { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final IRealDeviceService service; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @PostMapping("/realAttrsData") | 
				
			||||||
 | 
					    @ApiOperationSupport(order = 1) | 
				
			||||||
 | 
					    @ApiOperation(value = "厂租点实时数据列表", notes = "获取厂租点实时数据列表") | 
				
			||||||
 | 
					    public R realAttrsData(@RequestBody RealDeviceParamVo param) { | 
				
			||||||
 | 
					        return R.data(service.realAttrsData(param)); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,12 @@ | 
				
			|||||||
 | 
					package com.hnac.hzims.real.service; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.hnac.hzims.real.vo.RealDeviceParamVo; | 
				
			||||||
 | 
					import org.springblade.core.tool.api.R; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @author ysj | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					public interface IRealDeviceService  { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						R realAttrsData(RealDeviceParamVo param); | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,33 @@ | 
				
			|||||||
 | 
					package com.hnac.hzims.real.service.impl; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.hnac.hzims.real.service.IRealDeviceService; | 
				
			||||||
 | 
					import com.hnac.hzims.real.vo.RealDeviceParamVo; | 
				
			||||||
 | 
					import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; | 
				
			||||||
 | 
					import lombok.AllArgsConstructor; | 
				
			||||||
 | 
					import org.springblade.core.tool.api.R; | 
				
			||||||
 | 
					import org.springframework.stereotype.Service; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List; | 
				
			||||||
 | 
					import java.util.Map; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @author ysj | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					@Service | 
				
			||||||
 | 
					@AllArgsConstructor | 
				
			||||||
 | 
					public class RealDeviceServiceImpl implements IRealDeviceService { | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final DeviceDataClient deviceDataClient; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /** | 
				
			||||||
 | 
					     * 获取厂租点实时数据列表 | 
				
			||||||
 | 
					     * @param param | 
				
			||||||
 | 
					     * @return | 
				
			||||||
 | 
					     */ | 
				
			||||||
 | 
					    @Override | 
				
			||||||
 | 
					    public R realAttrsData(RealDeviceParamVo param) { | 
				
			||||||
 | 
					        return deviceDataClient.getRealAttrsData(param.getProjectId(), 0,param.getDeviceId(), | 
				
			||||||
 | 
					                param.getAttrName(),param.getCurrent(),param.getSize()); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					} | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue