Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 1 year ago
parent
commit
a158ab20eb
  1. 36
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java
  2. 1
      zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java
  3. 2
      zc-business/src/main/resources/mapper/business/DcEventTrafficCongestionMapper.xml

36
zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java

@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.Parameter;
import okhttp3.Response; import okhttp3.Response;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -166,6 +167,10 @@ public class DcDeviceController extends BaseController {
@GetMapping("/properties/latest/{deviceId}") @GetMapping("/properties/latest/{deviceId}")
public AjaxResult getDeviceLatestProperties(@PathVariable @Parameter(description = "设备ID") String deviceId) throws HttpException, IOException { public AjaxResult getDeviceLatestProperties(@PathVariable @Parameter(description = "设备ID") String deviceId) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
@ -187,6 +192,11 @@ public class DcDeviceController extends BaseController {
public AjaxResult queryDeviceProperties(@PathVariable @Parameter(description = "设备ID") String deviceId, public AjaxResult queryDeviceProperties(@PathVariable @Parameter(description = "设备ID") String deviceId,
@PathVariable @Parameter(description = "属性ID") String propertyId, @PathVariable @Parameter(description = "属性ID") String propertyId,
@Parameter(hidden = true) HashMap<String, Object> props) throws HttpException, IOException { @Parameter(hidden = true) HashMap<String, Object> props) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId) || !StringUtils.hasText(propertyId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(props); RequestParams requestParams = new RequestParams(props);
@ -210,6 +220,11 @@ public class DcDeviceController extends BaseController {
@GetMapping("/properties/latest/{deviceId}/{propertyId}") @GetMapping("/properties/latest/{deviceId}/{propertyId}")
public AjaxResult getDeviceLatestProperty(@PathVariable @Parameter(description = "设备ID") String deviceId, public AjaxResult getDeviceLatestProperty(@PathVariable @Parameter(description = "设备ID") String deviceId,
@PathVariable @Parameter(description = "属性ID") String propertyId) throws HttpException, IOException { @PathVariable @Parameter(description = "属性ID") String propertyId) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId) || !StringUtils.hasText(propertyId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
@ -232,6 +247,10 @@ public class DcDeviceController extends BaseController {
@PathVariable String propertyId, @PathVariable String propertyId,
@RequestParam HashMap<String, Object> props) throws HttpException, IOException { @RequestParam HashMap<String, Object> props) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId) || !StringUtils.hasText(propertyId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(props); RequestParams requestParams = new RequestParams(props);
@ -257,6 +276,10 @@ public class DcDeviceController extends BaseController {
@PathVariable String deviceId, @PathVariable String deviceId,
@RequestBody DeviceGetPropertiesOperateRequest props) throws HttpException, IOException { @RequestBody DeviceGetPropertiesOperateRequest props) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
@ -286,6 +309,11 @@ public class DcDeviceController extends BaseController {
@PathVariable String deviceId, @PathVariable String deviceId,
@RequestBody HashMap<String, Object> props @RequestBody HashMap<String, Object> props
) throws HttpException, IOException { ) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(props); RequestParams requestParams = new RequestParams(props);
@ -313,6 +341,10 @@ public class DcDeviceController extends BaseController {
@PathVariable String functionId, @PathVariable String functionId,
@RequestBody HashMap<String, Object> props) throws HttpException, IOException { @RequestBody HashMap<String, Object> props) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId) || !StringUtils.hasText(functionId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(props); RequestParams requestParams = new RequestParams(props);
@ -343,6 +375,10 @@ public class DcDeviceController extends BaseController {
@Parameter(hidden = true) HashMap<String, Object> queryParam @Parameter(hidden = true) HashMap<String, Object> queryParam
) throws HttpException, IOException { ) throws HttpException, IOException {
if (!StringUtils.hasText(deviceId) || !StringUtils.hasText(eventId)) {
return AjaxResult.error("设备未接入");
}
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(queryParam); RequestParams requestParams = new RequestParams(queryParam);

1
zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java

@ -82,6 +82,7 @@ public class DcEventTrafficCongestion extends BaseEntity
private Integer locationType; private Integer locationType;
@ApiModelProperty("地点描述") @ApiModelProperty("地点描述")
private String locationDescription; private String locationDescription;
@ApiModelProperty("终止桩号") @ApiModelProperty("终止桩号")
private String endStakeMark; private String endStakeMark;

2
zc-business/src/main/resources/mapper/business/DcEventTrafficCongestionMapper.xml

@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationDescription != null">#{locationDescription},</if> <if test="locationDescription != null">#{locationDescription},</if>
<if test="locationType != null">#{locationType},</if> <if test="locationType != null">#{locationType},</if>
<if test="detailedReasons != null">#{detailedReasons},</if> <if test="detailedReasons != null">#{detailedReasons},</if>
<if test="endStakeMark != null">#{end_stake_mark},</if> <if test="endStakeMark != null">#{endStakeMark},</if>
</trim> </trim>
</insert> </insert>

Loading…
Cancel
Save