Merge branch 'master' of codeup.aliyun.com:6428039c708c83a3fd907211/hzwmiot/hzwmiot24_java
# Conflicts: # fastbee-open-api/src/main/java/com/fastbee/data/controller/devicedetail/DeviceDetailController.java # fastbee-open-api/src/main/java/com/fastbee/data/service/devicedetail/IDeviceDetailService.java # fastbee-open-api/src/main/java/com/fastbee/data/service/devicedetail/impl/DeviceDetailServiceImpl.java
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 = "设备详情数据")
|
||||
@ -126,6 +124,16 @@ public class DeviceDetailController extends BaseController {
|
||||
}
|
||||
return AjaxResult.success(deviceDetailService.anfangInfo(deviceId));
|
||||
}
|
||||
@ApiOperation("箱门打开控制")
|
||||
@PostMapping("/hwcmd")
|
||||
public CommonResult<CmdHaiWeiVo> cmdDevices(@RequestBody CmdHaiWeiDto cmdHwDto) {
|
||||
return deviceDetailService.cmdDevices(cmdHwDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fastbee.data.controller.waterele;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -57,8 +58,8 @@ public class MaWatereleRecordController extends BaseController {
|
||||
@GetMapping("/echart")
|
||||
@ApiOperation("查询水电双计数据记录echart")
|
||||
public Map<String, Object> echart(MaWatereleRecord maWatereleRecord) {
|
||||
Map<String, Object> map = maWatereleRecordService.chartData(maWatereleRecord);
|
||||
return success(map);
|
||||
ArrayList<Object> list = maWatereleRecordService.chartData(maWatereleRecord);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,15 +1,17 @@
|
||||
package com.fastbee.data.service.devicedetail;
|
||||
|
||||
import com.fastbee.common.core.domain.CommonResult;
|
||||
import com.fastbee.common.model.vo.iot.QueryLogVo;
|
||||
import com.fastbee.data.domain.vo.AnfangInfoVo;
|
||||
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 {
|
||||
@ -29,5 +31,7 @@ public interface IDeviceDetailService {
|
||||
|
||||
List<XjInspectionRecords> xunjianRecord(QueryLogVo queryLogVo);
|
||||
|
||||
CommonResult<CmdHaiWeiVo> cmdDevices(CmdHaiWeiDto cmdHaiWeiDto);
|
||||
|
||||
AnfangInfoVo anfangInfo(Long deviceId);
|
||||
}
|
||||
|
@ -1,13 +1,17 @@
|
||||
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.common.utils.StringUtils;
|
||||
import com.fastbee.data.domain.vo.AnfangInfoVo;
|
||||
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;
|
||||
@ -35,6 +39,8 @@ public class DeviceDetailServiceImpl implements IDeviceDetailService {
|
||||
private XjInspectionRoutesMapper xjInspectionRoutesMapper;
|
||||
@Autowired
|
||||
private XjInspectionRecordsMapper xjInspectionRecordsMapper;
|
||||
@Autowired
|
||||
private HaiWeiService haiWeiService;
|
||||
public DeviceDetailServiceImpl(DeviceMapper deviceMapper) {
|
||||
this.deviceMapper = deviceMapper;
|
||||
}
|
||||
@ -138,6 +144,18 @@ public class DeviceDetailServiceImpl implements IDeviceDetailService {
|
||||
//获取安防历史记录
|
||||
return null;
|
||||
}
|
||||
@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