箱门打开控制接口
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
package com.fastbee.data.controller.devicedetail;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.core.domain.CommonResult;
|
||||
import com.fastbee.common.model.vo.iot.QueryLogVo;
|
||||
import com.fastbee.common.utils.StringUtils;
|
||||
import com.fastbee.data.service.devicedetail.IDeviceDetailService;
|
||||
import com.fastbee.iot.domain.Device;
|
||||
import com.fastbee.iot.model.DeviceHistoryParam;
|
||||
import com.fastbee.iot.model.haiwei.CmdHaiWeiVo;
|
||||
import com.fastbee.iot.model.haiwei.dto.CmdHaiWeiDto;
|
||||
import com.fastbee.waterele.domain.MaWatereleRecord;
|
||||
import com.fastbee.waterele.domain.dto.MaGuangaiRecordDto;
|
||||
import com.fastbee.waterele.domain.dto.MaWatereleRecordDto;
|
||||
@ -15,10 +15,8 @@ import com.fastbee.xunjian.domain.XjInspectionRecords;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "设备详情数据")
|
||||
@ -112,6 +110,15 @@ public class DeviceDetailController extends BaseController {
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("箱门打开控制")
|
||||
@PostMapping("/hwcmd")
|
||||
public CommonResult<CmdHaiWeiVo> cmdDevices(@RequestBody CmdHaiWeiDto cmdHwDto) {
|
||||
return deviceDetailService.cmdDevices(cmdHwDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,14 +1,16 @@
|
||||
package com.fastbee.data.service.devicedetail;
|
||||
|
||||
import com.fastbee.common.core.domain.CommonResult;
|
||||
import com.fastbee.common.model.vo.iot.QueryLogVo;
|
||||
import com.fastbee.iot.domain.Device;
|
||||
import com.fastbee.iot.model.haiwei.CmdHaiWeiVo;
|
||||
import com.fastbee.iot.model.haiwei.dto.CmdHaiWeiDto;
|
||||
import com.fastbee.waterele.domain.MaWatereleRecord;
|
||||
import com.fastbee.waterele.domain.dto.MaGuangaiRecordDto;
|
||||
import com.fastbee.waterele.domain.dto.MaWatereleRecordDto;
|
||||
import com.fastbee.xunjian.domain.XjInspectionRecords;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public interface IDeviceDetailService {
|
||||
@ -27,4 +29,6 @@ public interface IDeviceDetailService {
|
||||
ArrayList<Object> gongdianChart(QueryLogVo queryLogVo);
|
||||
|
||||
List<XjInspectionRecords> xunjianRecord(QueryLogVo queryLogVo);
|
||||
|
||||
CommonResult<CmdHaiWeiVo> cmdDevices(CmdHaiWeiDto cmdHaiWeiDto);
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
package com.fastbee.data.service.devicedetail.impl;
|
||||
|
||||
import com.fastbee.common.core.domain.CommonResult;
|
||||
import com.fastbee.common.model.vo.iot.QueryLogVo;
|
||||
import com.fastbee.common.utils.DevParamsUtils;
|
||||
import com.fastbee.common.utils.StringUtils;
|
||||
import com.fastbee.data.service.devicedetail.IDeviceDetailService;
|
||||
import com.fastbee.iot.domain.Device;
|
||||
import com.fastbee.iot.domain.ThingsModel;
|
||||
import com.fastbee.iot.haiwei.service.HaiWeiService;
|
||||
import com.fastbee.iot.mapper.DeviceMapper;
|
||||
import com.fastbee.iot.model.haiwei.CmdHaiWeiVo;
|
||||
import com.fastbee.iot.model.haiwei.dto.CmdHaiWeiDto;
|
||||
import com.fastbee.iot.service.IDeviceService;
|
||||
import com.fastbee.iot.service.IThingsModelService;
|
||||
import com.fastbee.waterele.domain.MaWatereleRecord;
|
||||
@ -33,6 +37,8 @@ public class DeviceDetailServiceImpl implements IDeviceDetailService {
|
||||
private XjInspectionRoutesMapper xjInspectionRoutesMapper;
|
||||
@Autowired
|
||||
private XjInspectionRecordsMapper xjInspectionRecordsMapper;
|
||||
@Autowired
|
||||
private HaiWeiService haiWeiService;
|
||||
public DeviceDetailServiceImpl(DeviceMapper deviceMapper) {
|
||||
this.deviceMapper = deviceMapper;
|
||||
}
|
||||
@ -110,6 +116,18 @@ public class DeviceDetailServiceImpl implements IDeviceDetailService {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<CmdHaiWeiVo> cmdDevices(CmdHaiWeiDto cmdHaiWeiDto) {
|
||||
String url = "https://cloud.haiwell.com/api/project/machine/datagroup/setTagsValue";
|
||||
Device deviceEntity = deviceMapper.selectDeviceByDeviceId(cmdHaiWeiDto.getDeviceId());
|
||||
Map<String, Object> devParams1 = DevParamsUtils.getDevParams(deviceEntity.getDevParams());
|
||||
String guimenIds = devParams1.get("guimenIds").toString();
|
||||
if (StringUtils.isEmpty(guimenIds)) {
|
||||
return null;
|
||||
}
|
||||
cmdHaiWeiDto.setDeviceId(Long.valueOf(guimenIds));
|
||||
return haiWeiService.cmdDevices(cmdHaiWeiDto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user