Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/xiepufeng/jihe-dc into develop

# Conflicts:
#	ruoyi-admin/src/main/resources/application.yml
develop
xiepufeng 1 year ago
parent
commit
62529ae6ac
  1. 14
      Dockerfile
  2. 53
      Jenkinsfile
  3. 6
      ruoyi-admin/src/main/resources/application.yml
  4. 4
      zc-business/src/main/java/com/zc/business/controller/DcBoardController.java
  5. 12
      zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java
  6. 94
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java
  7. 12
      zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java
  8. 12
      zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java
  9. 6
      zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java
  10. 12
      zc-business/src/main/java/com/zc/business/controller/DcInfoBoardVocabularyController.java
  11. 12
      zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java
  12. 109
      zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java
  13. 4
      zc-business/src/main/java/com/zc/business/domain/DcDevice.java
  14. 13
      zc-business/src/main/java/com/zc/business/domain/DcOrganization.java
  15. 159
      zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java
  16. 64
      zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java
  17. 64
      zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java
  18. 7
      zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java
  19. 10
      zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java
  20. 102
      zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java
  21. 6
      zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml
  22. 106
      zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml

14
Dockerfile

@ -0,0 +1,14 @@
# FROM java:8
FROM anapsix/alpine-java:8_server-jre_unlimited
# 将当前目录下的jar包复制到docker容器的/目录下
COPY *.jar /app.jar
# 运行过程中创建一个xx.jar文件
RUN touch /app.jar
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
ENV PARAMS="--spring.profiles.active=druid"
# 声明服务运行在8080端口
EXPOSE 8088
# 指定docker容器启动时运行jar包
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -jar /app.jar $PARAMS" ]

53
Jenkinsfile

@ -0,0 +1,53 @@
pipeline{
agent any
environment {
IMAGE_NAME = "ruoyi-admin"
WS = "${WORKSPACE}"
}
//定义流水线的加工流程
stages {
//流水线的所有阶段
stage('1.环境检查'){
steps {
sh 'pwd && ls -alh'
sh 'printenv'
sh 'docker version'
sh 'java -version'
sh 'git --version'
}
}
stage('2.编译'){
agent {
docker {
image 'maven:3-alpine'
args '-v maven-repository:/root/.m2'
}
}
steps {
sh 'pwd && ls -alh'
sh 'mvn -v'
sh 'cd ${WS} && mvn clean package -s "/var/jenkins_home/appconfig/maven/settings.xml" -Dmaven.test.skip=true'
}
}
stage('3.打包'){
steps {
sh 'pwd && ls -alh'
sh 'echo ${WS}'
// sh 'mv ${WS}/${IMAGE_NAME}/target/*.jar ${WS}/${IMAGE_NAME}.jar && pwd && ls -alh && docker build -t ${IMAGE_NAME} .'
sh 'docker build -t ${IMAGE_NAME} -f Dockerfile ${WS}/${IMAGE_NAME}/target/'
}
}
stage('4.部署'){
// 删除容器和虚悬镜像
steps {
sh 'pwd && ls -alh'
sh 'docker rm -f ${IMAGE_NAME} || true && docker rmi $(docker images -q -f dangling=true) || true'
sh 'docker run -d -p 8888:8080 --name ${IMAGE_NAME} -v /mydata/logs/${IMAGE_NAME}:/logs/${IMAGE_NAME} ${IMAGE_NAME}'
}
}
}
}

6
ruoyi-admin/src/main/resources/application.yml

@ -9,7 +9,7 @@ ruoyi:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: C:/home/ruoyi/uploadPath profile: /home/ruoyi/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 behavioral 行为验证码(拖动式与点触式) # 验证码类型 math 数组计算 char 字符验证 behavioral 行为验证码(拖动式与点触式)
@ -69,7 +69,7 @@ spring:
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
password: password: Redis123!@#
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -156,7 +156,7 @@ aj:
iot: iot:
# 物联平台地址 # 物联平台地址
address: 127.0.0.1:8080 address: http://127.0.0.1:8080
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址

4
zc-business/src/main/java/com/zc/business/controller/DcBoardController.java

@ -33,7 +33,7 @@ public class DcBoardController {
* 情报板发布 * 情报板发布
*/ */
@ApiOperation("情报板发布") @ApiOperation("情报板发布")
@PreAuthorize("@ss.hasPermi('business:board:publish')") // @PreAuthorize("@ss.hasPermi('business:board:publish')")
@PostMapping("/publish") @PostMapping("/publish")
public AjaxResult publish(@RequestBody DcBoardPublish dcBoardPublish){ public AjaxResult publish(@RequestBody DcBoardPublish dcBoardPublish){
return dcBoardService.publish(dcBoardPublish); return dcBoardService.publish(dcBoardPublish);
@ -44,7 +44,7 @@ public class DcBoardController {
* 情报板回读 * 情报板回读
*/ */
@ApiOperation("情报板回读") @ApiOperation("情报板回读")
@PreAuthorize("@ss.hasPermi('business:board:realtimeProperty')") // @PreAuthorize("@ss.hasPermi('business:board:realtimeProperty')")
@GetMapping("/realtimeProperty/{deviceId}") @GetMapping("/realtimeProperty/{deviceId}")
public AjaxResult realtimeProperty(@ApiParam(name = "deviceId", value = "设备id", required = true) @PathVariable("deviceId") String deviceId){ public AjaxResult realtimeProperty(@ApiParam(name = "deviceId", value = "设备id", required = true) @PathVariable("deviceId") String deviceId){
return dcBoardService.realtimeProperty(deviceId); return dcBoardService.realtimeProperty(deviceId);

12
zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java

@ -43,7 +43,7 @@ public class DcBoardReleaseLogController extends BaseController
* 查询情报板内容发布日志列表 * 查询情报板内容发布日志列表
*/ */
@ApiOperation("查询情报板内容发布日志列表") @ApiOperation("查询情报板内容发布日志列表")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:list')") // @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(DcBoardReleaseLog dcBoardReleaseLog) public TableDataInfo list(DcBoardReleaseLog dcBoardReleaseLog)
{ {
@ -56,7 +56,7 @@ public class DcBoardReleaseLogController extends BaseController
* 导出情报板内容发布日志列表 * 导出情报板内容发布日志列表
*/ */
@ApiOperation("导出情报板内容发布日志列表") @ApiOperation("导出情报板内容发布日志列表")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:export')") // @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:export')")
@Log(title = "情报板内容发布日志", businessType = BusinessType.EXPORT) @Log(title = "情报板内容发布日志", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, DcBoardReleaseLog dcBoardReleaseLog) public void export(HttpServletResponse response, DcBoardReleaseLog dcBoardReleaseLog)
@ -70,7 +70,7 @@ public class DcBoardReleaseLogController extends BaseController
* 获取情报板内容发布日志详细信息 * 获取情报板内容发布日志详细信息
*/ */
@ApiOperation("获取情报板内容发布日志详细信息") @ApiOperation("获取情报板内容发布日志详细信息")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:query')") // @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@ApiParam(value = "id", name = "id",required = true) @PathVariable("id") Long id) public AjaxResult getInfo(@ApiParam(value = "id", name = "id",required = true) @PathVariable("id") Long id)
{ {
@ -81,7 +81,7 @@ public class DcBoardReleaseLogController extends BaseController
* 新增情报板内容发布日志 * 新增情报板内容发布日志
*/ */
@ApiOperation("新增情报板内容发布日志") @ApiOperation("新增情报板内容发布日志")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:add')") // @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:add')")
@Log(title = "情报板内容发布日志", businessType = BusinessType.INSERT) @Log(title = "情报板内容发布日志", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcBoardReleaseLog dcBoardReleaseLog) public AjaxResult add(@RequestBody DcBoardReleaseLog dcBoardReleaseLog)
@ -92,7 +92,7 @@ public class DcBoardReleaseLogController extends BaseController
/** /**
* 修改情报板内容发布日志 * 修改情报板内容发布日志
*/ */
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:edit')") // @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:edit')")
@Log(title = "情报板内容发布日志", businessType = BusinessType.UPDATE) @Log(title = "情报板内容发布日志", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody DcBoardReleaseLog dcBoardReleaseLog) public AjaxResult edit(@RequestBody DcBoardReleaseLog dcBoardReleaseLog)
@ -104,7 +104,7 @@ public class DcBoardReleaseLogController extends BaseController
* 删除情报板内容发布日志 * 删除情报板内容发布日志
*/ */
@ApiOperation("删除情报板内容发布日志") @ApiOperation("删除情报板内容发布日志")
@PreAuthorize("@ss.hasPermi('business:boardReleaseLog:remove')") // @PreAuthorize("@ss.hasPermi('business:boardReleaseLog:remove')")
@Log(title = "情报板内容发布日志", businessType = BusinessType.DELETE) @Log(title = "情报板内容发布日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@ApiParam(value = "id", name = "id",required = true) @PathVariable Long[] ids) public AjaxResult remove(@ApiParam(value = "id", name = "id",required = true) @PathVariable Long[] ids)

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

@ -1,6 +1,7 @@
package com.zc.business.controller; package com.zc.business.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -8,7 +9,6 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.zc.business.domain.DcDevice; import com.zc.business.domain.DcDevice;
import com.zc.business.request.DeviceGetPropertiesOperateRequest; import com.zc.business.request.DeviceGetPropertiesOperateRequest;
import com.zc.business.request.DeviceOperateRequest;
import com.zc.business.service.IDcDeviceService; import com.zc.business.service.IDcDeviceService;
import com.zc.common.core.httpclient.OkHttp; import com.zc.common.core.httpclient.OkHttp;
import com.zc.common.core.httpclient.exception.HttpException; import com.zc.common.core.httpclient.exception.HttpException;
@ -20,15 +20,12 @@ 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.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 设备Controller * 设备Controller
@ -135,6 +132,7 @@ public class DcDeviceController extends BaseController {
/** /**
* 根据物联设备id获取最新属性数据 * 根据物联设备id获取最新属性数据
*
* @param deviceId 物联设备id * @param deviceId 物联设备id
* @return 获取属性数据操作结果 * @return 获取属性数据操作结果
*/ */
@ -144,30 +142,30 @@ public class DcDeviceController extends BaseController {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/properties/latest/" + deviceId) // 请求地址 .url(iotAddress + "/api/iot/device/properties/latest/" + deviceId) // 请求地址
.get(); // 请求方法 .get(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
} }
/** /**
* 查询设备指定属性列表 * 查询设备指定属性列表
* @param deviceId 设备id *
* @param deviceId 设备id
* @param propertyId 属性id * @param propertyId 属性id
* @param queryParam 查询条件 * @param props 查询条件
* @return 属性列表 * @return 属性列表
*/ */
@GetMapping("/properties/history/{deviceId}/{propertyId}") @GetMapping("/properties/history/{deviceId}/{propertyId}")
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) Map<String, Object> queryParam) throws HttpException, IOException { @Parameter(hidden = true) HashMap<String, Object> props) throws HttpException, IOException {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(); RequestParams requestParams = new RequestParams(props);
requestParams.put("queryParam", queryParam);
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/properties/history/" + deviceId + "/" + propertyId) // 请求地址 .url(iotAddress + "/api/iot/device/properties/history/" + deviceId + "/" + propertyId) // 请求地址
.data(requestParams) .data(requestParams)
.get(); // 请求方法 .get(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
@ -175,7 +173,8 @@ public class DcDeviceController extends BaseController {
/** /**
* 根据物联设备id获取最新属性数据 * 根据物联设备id获取最新属性数据
* @param deviceId 物联设备id *
* @param deviceId 物联设备id
* @param propertyId 属性id * @param propertyId 属性id
* @return 获取属性数据操作结果 * @return 获取属性数据操作结果
*/ */
@ -185,14 +184,15 @@ public class DcDeviceController extends BaseController {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/properties/latest/" + deviceId + "/" + propertyId) // 请求地址 .url(iotAddress + "/api/iot/device/properties/latest/" + deviceId + "/" + propertyId) // 请求地址
.get(); // 请求方法 .get(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
} }
/** /**
* 获取物联设备实时属性值 * 获取物联设备实时属性值
* @param deviceId 物联设备id *
* @param deviceId 物联设备id
* @param propertyId 属性 * @param propertyId 属性
* @return 属性实时数据 * @return 属性实时数据
*/ */
@ -200,16 +200,15 @@ public class DcDeviceController extends BaseController {
public AjaxResult getDeviceRealtimeProperty( public AjaxResult getDeviceRealtimeProperty(
@PathVariable String deviceId, @PathVariable String deviceId,
@PathVariable String propertyId, @PathVariable String propertyId,
@RequestParam Map<String, Object> headers) throws HttpException, IOException { @RequestParam HashMap<String, Object> props) throws HttpException, IOException {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(); RequestParams requestParams = new RequestParams(props);
requestParams.put("headers", headers);
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/properties/realtime/" + deviceId + "/" + propertyId) // 请求地址 .url(iotAddress + "/api/iot/device/properties/realtime/" + deviceId + "/" + propertyId) // 请求地址
.data(requestParams) .data(requestParams)
.get(); // 请求方法 .get(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
@ -217,47 +216,51 @@ public class DcDeviceController extends BaseController {
/** /**
* 批量获取物联设备实时属性 * 批量获取物联设备实时属性
*
* @param deviceId 物联设备id * @param deviceId 物联设备id
* @param props 属性id集 * @param props 属性id集
* @return 属性实时数据 * @return 属性实时数据
*/ */
@GetMapping("/properties/realtime/{deviceId}") @PostMapping("/properties/realtime/{deviceId}")
public AjaxResult getDeviceRealtimeProperties( public AjaxResult getDeviceRealtimeProperties(
@PathVariable String deviceId, @PathVariable String deviceId,
@ModelAttribute DeviceGetPropertiesOperateRequest props) throws HttpException, IOException { @RequestBody DeviceGetPropertiesOperateRequest props) throws HttpException, IOException {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams();
requestParams.put("props", props); String string = JSON.toJSONString(props);
JSONObject jsonObject = JSON.parseObject(string);
RequestParams requestParams = new RequestParams(jsonObject);
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/properties/realtime/" + deviceId) // 请求地址 .url(iotAddress + "/api/iot/device/properties/realtime/" + deviceId) // 请求地址
.data(requestParams) .data(requestParams)
.get(); // 请求方法 .post(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
} }
/** /**
* 发送设置属性指令到设备 * 发送设置属性指令到设备
*
* @param deviceId 物联设备id * @param deviceId 物联设备id
* @param props 参数 * @param props 参数
* @return 设备属性操作结果 * @return 设备属性操作结果
*/ */
@PostMapping("/properties/setting/{deviceId}") @PostMapping("/properties/setting/{deviceId}")
public AjaxResult setDeviceProperties( public AjaxResult setDeviceProperties(
@PathVariable String deviceId, @PathVariable String deviceId,
@RequestBody DeviceOperateRequest<Map<String, Object>> props @RequestBody HashMap<String, Object> props
) throws HttpException, IOException { ) throws HttpException, IOException {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(); RequestParams requestParams = new RequestParams(props);
requestParams.put("props", props);
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/properties/setting/" + deviceId) // 请求地址 .url(iotAddress + "/api/iot/device/properties/setting/" + deviceId) // 请求地址
.data(requestParams) .data(requestParams)
.post(); // 请求方法 .post(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
@ -265,25 +268,26 @@ public class DcDeviceController extends BaseController {
/** /**
* 设备功能调用 * 设备功能调用
* @param deviceId 物联设备id *
* @param deviceId 物联设备id
* @param functionId 功能id * @param functionId 功能id
* @param props 调用参数 * @param props 调用参数
* @return 调用结果 * @return 调用结果
*/ */
@PostMapping("/functions/{deviceId}/{functionId}") @PostMapping("/functions/{deviceId}/{functionId}")
public AjaxResult invokedFunction( public AjaxResult invokedFunction(
@PathVariable String deviceId, @PathVariable String deviceId,
@PathVariable String functionId, @PathVariable String functionId,
@RequestBody Map<String, Object> props) throws HttpException, IOException { @RequestBody HashMap<String, Object> props) throws HttpException, IOException {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(); RequestParams requestParams = new RequestParams(props);
requestParams.put("props", props);
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/functions/" + deviceId + "/" + functionId) // 请求地址 .url(iotAddress + "/api/iot/device/functions/" + deviceId + "/" + functionId) // 请求地址
.data(requestParams) .data(requestParams)
.post(); // 请求方法 .post(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
@ -292,8 +296,9 @@ public class DcDeviceController extends BaseController {
/** /**
* 查询物联设备事件数据 * 查询物联设备事件数据
* @param deviceId 物联设备id *
* @param eventId 事件id * @param deviceId 物联设备id
* @param eventId 事件id
* @param queryParam 查询条件 * @param queryParam 查询条件
* @return 查询事件结果 * @return 查询事件结果
*/ */
@ -301,18 +306,16 @@ public class DcDeviceController extends BaseController {
public AjaxResult queryPagerDeviceEvents( public AjaxResult queryPagerDeviceEvents(
@PathVariable @Parameter(description = "设备ID") String deviceId, @PathVariable @Parameter(description = "设备ID") String deviceId,
@PathVariable @Parameter(description = "事件ID") String eventId, @PathVariable @Parameter(description = "事件ID") String eventId,
@Parameter(hidden = true) Map<String, Object> queryParam @Parameter(hidden = true) HashMap<String, Object> queryParam
) throws HttpException, IOException ) throws HttpException, IOException {
{
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
RequestParams requestParams = new RequestParams(); RequestParams requestParams = new RequestParams(queryParam);
requestParams.put("queryParam", queryParam);
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/events/history/" + deviceId + "/" + eventId) // 请求地址 .url(iotAddress + "/api/iot/device/events/history/" + deviceId + "/" + eventId) // 请求地址
.data(requestParams) .data(requestParams)
.get(); // 请求方法 .get(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
@ -320,6 +323,7 @@ public class DcDeviceController extends BaseController {
/** /**
* 获取物联设备物模型 * 获取物联设备物模型
*
* @param id 物联设备id * @param id 物联设备id
* @return 更新结果 * @return 更新结果
*/ */
@ -329,7 +333,7 @@ public class DcDeviceController extends BaseController {
OkHttp okHttp = new OkHttp(); OkHttp okHttp = new OkHttp();
Response response // 请求响应 Response response // 请求响应
= okHttp = okHttp
.url(iotAddress + "/metadata/" + id) // 请求地址 .url(iotAddress + "/api/iot/device/metadata/" + id) // 请求地址
.get(); // 请求方法 .get(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class); return JSON.parseObject(response.body().string(), AjaxResult.class);
} }

12
zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java

@ -47,7 +47,7 @@ public class DcEventProcessController extends BaseController
* 查询事件处理流程列表 * 查询事件处理流程列表
*/ */
@ApiOperation("查询事件处理流程列表") @ApiOperation("查询事件处理流程列表")
@PreAuthorize("@ss.hasPermi('system:process:list')") // @PreAuthorize("@ss.hasPermi('system:process:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(DcEventProcess dcEventProcess) public TableDataInfo list(DcEventProcess dcEventProcess)
{ {
@ -62,7 +62,7 @@ public class DcEventProcessController extends BaseController
* 导出事件处理流程列表 * 导出事件处理流程列表
*/ */
@ApiOperation("导出事件处理流程列表") @ApiOperation("导出事件处理流程列表")
@PreAuthorize("@ss.hasPermi('system:process:export')") // @PreAuthorize("@ss.hasPermi('system:process:export')")
@Log(title = "事件处理流程", businessType = BusinessType.EXPORT) @Log(title = "事件处理流程", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, DcEventProcess dcEventProcess) public void export(HttpServletResponse response, DcEventProcess dcEventProcess)
@ -76,7 +76,7 @@ public class DcEventProcessController extends BaseController
* 获取事件处理流程详细信息 * 获取事件处理流程详细信息
*/ */
@ApiOperation("获取事件处理流程详细信息") @ApiOperation("获取事件处理流程详细信息")
@PreAuthorize("@ss.hasPermi('system:process:query')") // @PreAuthorize("@ss.hasPermi('system:process:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
@ -87,7 +87,7 @@ public class DcEventProcessController extends BaseController
* 新增事件处理流程 * 新增事件处理流程
*/ */
@ApiOperation("新增事件处理流程") @ApiOperation("新增事件处理流程")
@PreAuthorize("@ss.hasPermi('system:process:add')") // @PreAuthorize("@ss.hasPermi('system:process:add')")
@Log(title = "事件处理流程", businessType = BusinessType.INSERT) @Log(title = "事件处理流程", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) throws IOException, InvalidExtensionException { public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) throws IOException, InvalidExtensionException {
@ -103,7 +103,7 @@ public class DcEventProcessController extends BaseController
* 修改事件处理流程 * 修改事件处理流程
*/ */
@ApiOperation("修改事件处理流程") @ApiOperation("修改事件处理流程")
@PreAuthorize("@ss.hasPermi('system:process:edit')") // @PreAuthorize("@ss.hasPermi('system:process:edit')")
@Log(title = "事件处理流程", businessType = BusinessType.UPDATE) @Log(title = "事件处理流程", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody DcEventProcess dcEventProcess) public AjaxResult edit(@RequestBody DcEventProcess dcEventProcess)
@ -115,7 +115,7 @@ public class DcEventProcessController extends BaseController
* 删除事件处理流程 * 删除事件处理流程
*/ */
@ApiOperation("删除事件处理流程") @ApiOperation("删除事件处理流程")
@PreAuthorize("@ss.hasPermi('system:process:remove')") // @PreAuthorize("@ss.hasPermi('system:process:remove')")
@Log(title = "事件处理流程", businessType = BusinessType.DELETE) @Log(title = "事件处理流程", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)

12
zc-business/src/main/java/com/zc/business/controller/DcEventTypeController.java

@ -43,7 +43,7 @@ public class DcEventTypeController extends BaseController
* 查询事件类型列表 * 查询事件类型列表
*/ */
@ApiOperation("查询事件类型列表") @ApiOperation("查询事件类型列表")
@PreAuthorize("@ss.hasPermi('business:dcEventType:list')") // @PreAuthorize("@ss.hasPermi('business:dcEventType:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(DcEventType dcEventType) public TableDataInfo list(DcEventType dcEventType)
{ {
@ -55,7 +55,7 @@ public class DcEventTypeController extends BaseController
/** /**
* 导出事件类型列表 * 导出事件类型列表
*/ */
@PreAuthorize("@ss.hasPermi('business:dcEventType:export')") // @PreAuthorize("@ss.hasPermi('business:dcEventType:export')")
@Log(title = "事件类型", businessType = BusinessType.EXPORT) @Log(title = "事件类型", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, DcEventType dcEventType) public void export(HttpServletResponse response, DcEventType dcEventType)
@ -69,7 +69,7 @@ public class DcEventTypeController extends BaseController
* 获取事件类型详细信息 * 获取事件类型详细信息
*/ */
@ApiOperation("获取事件类型详细信息") @ApiOperation("获取事件类型详细信息")
@PreAuthorize("@ss.hasPermi('business:dcEventType:query')") // @PreAuthorize("@ss.hasPermi('business:dcEventType:query')")
@GetMapping(value = "/{eventType}") @GetMapping(value = "/{eventType}")
public AjaxResult getInfo(@PathVariable("eventType") @ApiParam(name = "eventType", value = "事件类型", required = true) Integer eventType) public AjaxResult getInfo(@PathVariable("eventType") @ApiParam(name = "eventType", value = "事件类型", required = true) Integer eventType)
{ {
@ -80,7 +80,7 @@ public class DcEventTypeController extends BaseController
* 新增事件类型 * 新增事件类型
*/ */
@ApiOperation("新增事件类型") @ApiOperation("新增事件类型")
@PreAuthorize("@ss.hasPermi('business:dcEventType:add')") // @PreAuthorize("@ss.hasPermi('business:dcEventType:add')")
@Log(title = "事件类型", businessType = BusinessType.INSERT) @Log(title = "事件类型", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcEventType dcEventType) public AjaxResult add(@RequestBody DcEventType dcEventType)
@ -92,7 +92,7 @@ public class DcEventTypeController extends BaseController
* 修改事件类型 * 修改事件类型
*/ */
@ApiOperation("修改事件类型") @ApiOperation("修改事件类型")
@PreAuthorize("@ss.hasPermi('business:dcEventType:edit')") // @PreAuthorize("@ss.hasPermi('business:dcEventType:edit')")
@Log(title = "事件类型", businessType = BusinessType.UPDATE) @Log(title = "事件类型", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody DcEventType dcEventType) public AjaxResult edit(@RequestBody DcEventType dcEventType)
@ -104,7 +104,7 @@ public class DcEventTypeController extends BaseController
* 删除事件类型 * 删除事件类型
*/ */
@ApiOperation("删除事件类型") @ApiOperation("删除事件类型")
@PreAuthorize("@ss.hasPermi('business:dcEventType:remove')") // @PreAuthorize("@ss.hasPermi('business:dcEventType:remove')")
@Log(title = "事件类型", businessType = BusinessType.DELETE) @Log(title = "事件类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{eventType}") @DeleteMapping("/{eventType}")
public AjaxResult remove(@PathVariable @ApiParam(value = "事件类型", name = "eventType", required = true) Integer eventType) public AjaxResult remove(@PathVariable @ApiParam(value = "事件类型", name = "eventType", required = true) Integer eventType)

6
zc-business/src/main/java/com/zc/business/controller/DcInfoBoardTemplateController.java

@ -38,7 +38,7 @@ public class DcInfoBoardTemplateController extends BaseController
* 新增情报板模板 * 新增情报板模板
*/ */
@ApiOperation("新增情报板模板") @ApiOperation("新增情报板模板")
@PreAuthorize("@ss.hasPermi('business:boardTemplate:add')") // @PreAuthorize("@ss.hasPermi('business:boardTemplate:add')")
@Log(title = "情报板模板", businessType = BusinessType.INSERT) @Log(title = "情报板模板", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcInfoBoardTemplate dcInfoBoardTemplate) public AjaxResult add(@RequestBody DcInfoBoardTemplate dcInfoBoardTemplate)
@ -50,7 +50,7 @@ public class DcInfoBoardTemplateController extends BaseController
* 修改情报板模板 * 修改情报板模板
*/ */
@ApiOperation("修改情报板模板") @ApiOperation("修改情报板模板")
@PreAuthorize("@ss.hasPermi('business:boardTemplate:edit')") // @PreAuthorize("@ss.hasPermi('business:boardTemplate:edit')")
@Log(title = "情报板模板", businessType = BusinessType.UPDATE) @Log(title = "情报板模板", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody DcInfoBoardTemplate dcInfoBoardTemplate) public AjaxResult edit(@RequestBody DcInfoBoardTemplate dcInfoBoardTemplate)
@ -62,7 +62,7 @@ public class DcInfoBoardTemplateController extends BaseController
* 删除情报板模板 * 删除情报板模板
*/ */
@ApiOperation("删除情报板模板") @ApiOperation("删除情报板模板")
@PreAuthorize("@ss.hasPermi('business:boardTemplate:remove')") // @PreAuthorize("@ss.hasPermi('business:boardTemplate:remove')")
@Log(title = "情报板模板", businessType = BusinessType.DELETE) @Log(title = "情报板模板", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable @ApiParam(value="id", name="id", required=true) Long id) public AjaxResult remove(@PathVariable @ApiParam(value="id", name="id", required=true) Long id)

12
zc-business/src/main/java/com/zc/business/controller/DcInfoBoardVocabularyController.java

@ -43,7 +43,7 @@ public class DcInfoBoardVocabularyController extends BaseController
* 查询情报板敏感字管理列表 * 查询情报板敏感字管理列表
*/ */
@ApiOperation("查询情报板敏感字管理列表") @ApiOperation("查询情报板敏感字管理列表")
@PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:list')") // @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(DcInfoBoardVocabulary dcInfoBoardVocabulary) public TableDataInfo list(DcInfoBoardVocabulary dcInfoBoardVocabulary)
{ {
@ -56,7 +56,7 @@ public class DcInfoBoardVocabularyController extends BaseController
* 导出情报板敏感字管理列表 * 导出情报板敏感字管理列表
*/ */
@ApiOperation("导出情报板敏感字管理列表") @ApiOperation("导出情报板敏感字管理列表")
@PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:export')") // @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:export')")
@Log(title = "情报板敏感字管理", businessType = BusinessType.EXPORT) @Log(title = "情报板敏感字管理", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, DcInfoBoardVocabulary dcInfoBoardVocabulary) public void export(HttpServletResponse response, DcInfoBoardVocabulary dcInfoBoardVocabulary)
@ -70,7 +70,7 @@ public class DcInfoBoardVocabularyController extends BaseController
* 获取情报板敏感字管理详细信息 * 获取情报板敏感字管理详细信息
*/ */
@ApiOperation("获取情报板敏感字管理详细信息") @ApiOperation("获取情报板敏感字管理详细信息")
@PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:query')") // @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") @ApiParam(value="id", name="id", required=true) Long id) public AjaxResult getInfo(@PathVariable("id") @ApiParam(value="id", name="id", required=true) Long id)
{ {
@ -81,7 +81,7 @@ public class DcInfoBoardVocabularyController extends BaseController
* 新增情报板敏感字管理 * 新增情报板敏感字管理
*/ */
@ApiOperation("新增情报板敏感字管理") @ApiOperation("新增情报板敏感字管理")
@PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:add')") // @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:add')")
@Log(title = "情报板敏感字管理", businessType = BusinessType.INSERT) @Log(title = "情报板敏感字管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcInfoBoardVocabulary dcInfoBoardVocabulary) public AjaxResult add(@RequestBody DcInfoBoardVocabulary dcInfoBoardVocabulary)
@ -93,7 +93,7 @@ public class DcInfoBoardVocabularyController extends BaseController
* 修改情报板敏感字管理 * 修改情报板敏感字管理
*/ */
@ApiOperation("修改情报板敏感字管理") @ApiOperation("修改情报板敏感字管理")
@PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:edit')") // @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:edit')")
@Log(title = "情报板敏感字管理", businessType = BusinessType.UPDATE) @Log(title = "情报板敏感字管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody DcInfoBoardVocabulary dcInfoBoardVocabulary) public AjaxResult edit(@RequestBody DcInfoBoardVocabulary dcInfoBoardVocabulary)
@ -105,7 +105,7 @@ public class DcInfoBoardVocabularyController extends BaseController
* 删除情报板敏感字管理 * 删除情报板敏感字管理
*/ */
@ApiOperation("删除情报板敏感字管理") @ApiOperation("删除情报板敏感字管理")
@PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:remove')") // @PreAuthorize("@ss.hasPermi('business:dcInfoBoardVocabulary:remove')")
@Log(title = "情报板敏感字管理", businessType = BusinessType.DELETE) @Log(title = "情报板敏感字管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable @ApiParam(value="id", name="id", required=true) Long id) public AjaxResult remove(@PathVariable @ApiParam(value="id", name="id", required=true) Long id)

12
zc-business/src/main/java/com/zc/business/controller/DcPublishInfoController.java

@ -43,7 +43,7 @@ public class DcPublishInfoController extends BaseController
* 查询 信息发布记录列表 * 查询 信息发布记录列表
*/ */
@ApiOperation("查询信息发布记录列表") @ApiOperation("查询信息发布记录列表")
@PreAuthorize("@ss.hasPermi('business:dcPublishInfo:list')") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(DcPublishInfo dcPublishInfo) public TableDataInfo list(DcPublishInfo dcPublishInfo)
{ {
@ -56,7 +56,7 @@ public class DcPublishInfoController extends BaseController
* 导出 信息发布记录列表 * 导出 信息发布记录列表
*/ */
@ApiOperation("导出信息发布记录") @ApiOperation("导出信息发布记录")
@PreAuthorize("@ss.hasPermi('business:dcPublishInfo:export')") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:export')")
@Log(title = " 信息发布记录", businessType = BusinessType.EXPORT) @Log(title = " 信息发布记录", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, DcPublishInfo dcPublishInfo) public void export(HttpServletResponse response, DcPublishInfo dcPublishInfo)
@ -70,7 +70,7 @@ public class DcPublishInfoController extends BaseController
* 获取 信息发布记录详细信息 * 获取 信息发布记录详细信息
*/ */
@ApiOperation("获取 信息发布记录详细信息") @ApiOperation("获取 信息发布记录详细信息")
@PreAuthorize("@ss.hasPermi('business:dcPublishInfo:query')") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") @ApiParam(name = "id", value = "id", required = true) Long id) public AjaxResult getInfo(@PathVariable("id") @ApiParam(name = "id", value = "id", required = true) Long id)
{ {
@ -81,7 +81,7 @@ public class DcPublishInfoController extends BaseController
* 新增 信息发布记录 * 新增 信息发布记录
*/ */
@ApiOperation("新增 信息发布记录") @ApiOperation("新增 信息发布记录")
@PreAuthorize("@ss.hasPermi('business:dcPublishInfo:add')") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:add')")
@Log(title = " 信息发布记录", businessType = BusinessType.INSERT) @Log(title = " 信息发布记录", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody DcPublishInfo dcPublishInfo) public AjaxResult add(@RequestBody DcPublishInfo dcPublishInfo)
@ -93,7 +93,7 @@ public class DcPublishInfoController extends BaseController
* 修改 信息发布记录 * 修改 信息发布记录
*/ */
@ApiOperation("修改 信息发布记录") @ApiOperation("修改 信息发布记录")
@PreAuthorize("@ss.hasPermi('business:dcPublishInfo:edit')") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:edit')")
@Log(title = " 信息发布记录", businessType = BusinessType.UPDATE) @Log(title = " 信息发布记录", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody DcPublishInfo dcPublishInfo) public AjaxResult edit(@RequestBody DcPublishInfo dcPublishInfo)
@ -105,7 +105,7 @@ public class DcPublishInfoController extends BaseController
* 删除 信息发布记录 * 删除 信息发布记录
*/ */
@ApiOperation("删除 信息发布记录") @ApiOperation("删除 信息发布记录")
@PreAuthorize("@ss.hasPermi('business:dcPublishInfo:remove')") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:remove')")
@Log(title = " 信息发布记录", businessType = BusinessType.DELETE) @Log(title = " 信息发布记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable @ApiParam(name = "id", value = "id", required = true) Long id) public AjaxResult remove(@PathVariable @ApiParam(name = "id", value = "id", required = true) Long id)

109
zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java

@ -0,0 +1,109 @@
package com.zc.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.zc.business.domain.DcRoadSection;
import com.zc.business.service.IDcRoadSectionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 辖区路段Controller
*
* @author ruoyi
* @date 2024-01-11
*/
@RestController
@RequestMapping("/business/roadSection")
public class DcRoadSectionController extends BaseController
{
@Autowired
private IDcRoadSectionService dcRoadSectionService;
/**
* 查询辖区路段列表
*/
@PreAuthorize("@ss.hasPermi('business:roadSection:list')")
@GetMapping("/list")
public TableDataInfo list(DcRoadSection dcRoadSection)
{
startPage();
List<DcRoadSection> list = dcRoadSectionService.selectDcRoadSectionList(dcRoadSection);
return getDataTable(list);
}
/**
* 导出辖区路段列表
*/
@PreAuthorize("@ss.hasPermi('business:roadSection:export')")
@Log(title = "辖区路段", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcRoadSection dcRoadSection)
{
List<DcRoadSection> list = dcRoadSectionService.selectDcRoadSectionList(dcRoadSection);
ExcelUtil<DcRoadSection> util = new ExcelUtil<>(DcRoadSection.class);
util.exportExcel(response, list, "辖区路段数据");
}
/**
* 获取辖区路段详细信息
*/
@PreAuthorize("@ss.hasPermi('business:roadSection:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(dcRoadSectionService.selectDcRoadSectionById(id));
}
/**
* 新增辖区路段
*/
@PreAuthorize("@ss.hasPermi('business:roadSection:add')")
@Log(title = "辖区路段", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcRoadSection dcRoadSection)
{
return toAjax(dcRoadSectionService.insertDcRoadSection(dcRoadSection));
}
/**
* 修改辖区路段
*/
@PreAuthorize("@ss.hasPermi('business:roadSection:edit')")
@Log(title = "辖区路段", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcRoadSection dcRoadSection)
{
return toAjax(dcRoadSectionService.updateDcRoadSection(dcRoadSection));
}
/**
* 删除辖区路段
*/
@PreAuthorize("@ss.hasPermi('business:roadSection:remove')")
@Log(title = "辖区路段", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcRoadSectionService.deleteDcRoadSectionByIds(ids));
}
//查询路线id与名称
@PostMapping("/roadList")
public AjaxResult roadList(){
return AjaxResult.success(dcRoadSectionService.selectRoadList());
}
}

4
zc-business/src/main/java/com/zc/business/domain/DcDevice.java

@ -22,8 +22,8 @@ public class DcDevice {
private Long productId; private Long productId;
@ApiModelProperty("桩号") @ApiModelProperty("桩号")
private String stakeMarkId; private String stakeMarkId;
@ApiModelProperty("道路标识") @ApiModelProperty("方向1-上行(菏泽方向),2-中,3-下行(济南方向)")
private Long roadId; private String direction;
@ApiModelProperty("设备名称") @ApiModelProperty("设备名称")
private String deviceName; private String deviceName;
@ApiModelProperty("设备类型") @ApiModelProperty("设备类型")

13
zc-business/src/main/java/com/zc/business/domain/DcOrganization.java

@ -41,8 +41,19 @@ public class DcOrganization extends TreeEntity
/** 描述 */ /** 描述 */
@Excel(name = "描述") @Excel(name = "描述")
private String description; private String description;
/** 方向 */
@Excel(name = "方向")
private String direction;
public void setId(Long id) public String getDirection() {
return direction;
}
public void setDirection(String direction) {
this.direction = direction;
}
public void setId(Long id)
{ {
this.id = id; this.id = id;
} }

159
zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java

@ -0,0 +1,159 @@
package com.zc.business.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 辖区路段对象 dc_road_section
*
* @author ruoyi
* @date 2024-01-11
*/
public class DcRoadSection extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 所属部门 */
@Excel(name = "所属部门")
private Long deptId;
/** 所属路线 */
@Excel(name = "所属路线")
private Long roadId;
/** 开始桩号 */
@Excel(name = "开始桩号")
private String startStakeMark;
/** 结束桩号 */
@Excel(name = "结束桩号")
private String endStakeMark;
/** 辖区路线名称 */
@Excel(name = "辖区路线名称")
private String sectionName;
/** 辖区路线编号 */
@Excel(name = "辖区路线编号")
private String roadCode;
/** 里程 */
@Excel(name = "里程")
private String mileage;
/** 部门名称 */
@Excel(name = "部门名称")
private String deptName;
/** 道路名称 */
@Excel(name = "道路名称")
private String roadName;
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getRoadName() {
return roadName;
}
public void setRoadName(String roadName) {
this.roadName = roadName;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public void setRoadId(Long roadId)
{
this.roadId = roadId;
}
public Long getRoadId()
{
return roadId;
}
public void setStartStakeMark(String startStakeMark)
{
this.startStakeMark = startStakeMark;
}
public String getStartStakeMark()
{
return startStakeMark;
}
public void setEndStakeMark(String endStakeMark)
{
this.endStakeMark = endStakeMark;
}
public String getEndStakeMark()
{
return endStakeMark;
}
public void setSectionName(String sectionName)
{
this.sectionName = sectionName;
}
public String getSectionName()
{
return sectionName;
}
public void setRoadCode(String roadCode)
{
this.roadCode = roadCode;
}
public String getRoadCode()
{
return roadCode;
}
public void setMileage(String mileage)
{
this.mileage = mileage;
}
public String getMileage()
{
return mileage;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deptId", getDeptId())
.append("roadId", getRoadId())
.append("startStakeMark", getStartStakeMark())
.append("endStakeMark", getEndStakeMark())
.append("sectionName", getSectionName())
.append("roadCode", getRoadCode())
.append("mileage", getMileage())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

64
zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java

@ -0,0 +1,64 @@
package com.zc.business.mapper;
import java.util.HashMap;
import java.util.List;
import com.zc.business.domain.DcRoadSection;
/**
* 辖区路段Mapper接口
*
* @author ruoyi
* @date 2024-01-11
*/
public interface DcRoadSectionMapper
{
/**
* 查询辖区路段
*
* @param id 辖区路段主键
* @return 辖区路段
*/
public DcRoadSection selectDcRoadSectionById(Long id);
/**
* 查询辖区路段列表
*
* @param dcRoadSection 辖区路段
* @return 辖区路段集合
*/
List<DcRoadSection> selectDcRoadSectionList(DcRoadSection dcRoadSection);
/**
* 新增辖区路段
*
* @param dcRoadSection 辖区路段
* @return 结果
*/
int insertDcRoadSection(DcRoadSection dcRoadSection);
/**
* 修改辖区路段
*
* @param dcRoadSection 辖区路段
* @return 结果
*/
int updateDcRoadSection(DcRoadSection dcRoadSection);
/**
* 删除辖区路段
*
* @param id 辖区路段主键
* @return 结果
*/
int deleteDcRoadSectionById(Long id);
/**
* 批量删除辖区路段
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteDcRoadSectionByIds(Long[] ids);
//查询路线id与名称
List<HashMap<String,Object>> selectRoadList();
}

64
zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java

@ -0,0 +1,64 @@
package com.zc.business.service;
import java.util.HashMap;
import java.util.List;
import com.zc.business.domain.DcRoadSection;
/**
* 辖区路段Service接口
*
* @author ruoyi
* @date 2024-01-11
*/
public interface IDcRoadSectionService
{
/**
* 查询辖区路段
*
* @param id 辖区路段主键
* @return 辖区路段
*/
public DcRoadSection selectDcRoadSectionById(Long id);
/**
* 查询辖区路段列表
*
* @param dcRoadSection 辖区路段
* @return 辖区路段集合
*/
List<DcRoadSection> selectDcRoadSectionList(DcRoadSection dcRoadSection);
/**
* 新增辖区路段
*
* @param dcRoadSection 辖区路段
* @return 结果
*/
int insertDcRoadSection(DcRoadSection dcRoadSection);
/**
* 修改辖区路段
*
* @param dcRoadSection 辖区路段
* @return 结果
*/
int updateDcRoadSection(DcRoadSection dcRoadSection);
/**
* 批量删除辖区路段
*
* @param ids 需要删除的辖区路段主键集合
* @return 结果
*/
int deleteDcRoadSectionByIds(Long[] ids);
/**
* 删除辖区路段信息
*
* @param id 辖区路段主键
* @return 结果
*/
int deleteDcRoadSectionById(Long id);
//查询路线id与名称
List<HashMap<String,Object>> selectRoadList();
}

7
zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java

@ -59,7 +59,7 @@ public class DcBoardServiceImpl implements IDcBoardService {
try{ try{
//下发文件名 //下发文件名
Map<String,Object> param = new HashMap<>(); HashMap<String,Object> param = new HashMap<>();
param.put("size","65535"); param.put("size","65535");
param.put("fileName","play010.lst"); param.put("fileName","play010.lst");
ajaxResult = deviceController.invokedFunction(deviceId,"11",param); ajaxResult = deviceController.invokedFunction(deviceId,"11",param);
@ -95,6 +95,7 @@ public class DcBoardServiceImpl implements IDcBoardService {
releaseLog.setReleaseUserId(loginUser.getUsername()); releaseLog.setReleaseUserId(loginUser.getUsername());
releaseLog.setReleaseUserName(loginUser.getUser().getNickName()); releaseLog.setReleaseUserName(loginUser.getUser().getNickName());
releaseLog.setReleaseDeptId(loginUser.getDeptId().toString()); releaseLog.setReleaseDeptId(loginUser.getDeptId().toString());
releaseLog.setPlatform(loginUser.getUser().getUserType());
dcBoardReleaseLogMapper.insertDcBoardReleaseLog(releaseLog); dcBoardReleaseLogMapper.insertDcBoardReleaseLog(releaseLog);
} }
}catch (Exception e){ }catch (Exception e){
@ -115,9 +116,9 @@ public class DcBoardServiceImpl implements IDcBoardService {
AjaxResult ajaxResult = new AjaxResult(); AjaxResult ajaxResult = new AjaxResult();
try { try {
Map<String,Object> param = new HashMap<>(); HashMap<String,Object> param = new HashMap<>();
param.put("async",false); param.put("async",false);
ajaxResult = deviceController.invokedFunction(deviceId,"3A",param); ajaxResult = deviceController.getDeviceRealtimeProperty(deviceId,"3A",param);
} catch (Exception e){ } catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }

10
zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java

@ -58,11 +58,6 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
queryWrapper.eq(DcDevice::getStakeMarkId, dcDevice.getStakeMarkId()); queryWrapper.eq(DcDevice::getStakeMarkId, dcDevice.getStakeMarkId());
} }
// 道路标识
if (Objects.nonNull(dcDevice.getRoadId())) {
queryWrapper.eq(DcDevice::getRoadId, dcDevice.getRoadId());
}
// 设备名称 // 设备名称
if (StringUtils.hasText(dcDevice.getDeviceName())) { if (StringUtils.hasText(dcDevice.getDeviceName())) {
queryWrapper.like(DcDevice::getDeviceName, dcDevice.getDeviceName()); queryWrapper.like(DcDevice::getDeviceName, dcDevice.getDeviceName());
@ -74,6 +69,11 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
queryWrapper.eq(DcDevice::getDeviceType, dcDevice.getDeviceType()); queryWrapper.eq(DcDevice::getDeviceType, dcDevice.getDeviceType());
} }
// 方向
if (Objects.nonNull(dcDevice.getDirection())) {
queryWrapper.eq(DcDevice::getDirection, dcDevice.getDirection());
}
// 安装日期 // 安装日期
if (Objects.nonNull(dcDevice.getInstallationDate())) { if (Objects.nonNull(dcDevice.getInstallationDate())) {
queryWrapper.eq(DcDevice::getInstallationDate, dcDevice.getInstallationDate()); queryWrapper.eq(DcDevice::getInstallationDate, dcDevice.getInstallationDate());

102
zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java

@ -0,0 +1,102 @@
package com.zc.business.service.impl;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zc.business.mapper.DcRoadSectionMapper;
import com.zc.business.domain.DcRoadSection;
import com.zc.business.service.IDcRoadSectionService;
/**
* 辖区路段Service业务层处理
*
* @author ruoyi
* @date 2024-01-11
*/
@Service
public class DcRoadSectionServiceImpl implements IDcRoadSectionService
{
@Autowired
private DcRoadSectionMapper dcRoadSectionMapper;
/**
* 查询辖区路段
*
* @param id 辖区路段主键
* @return 辖区路段
*/
@Override
public DcRoadSection selectDcRoadSectionById(Long id)
{
return dcRoadSectionMapper.selectDcRoadSectionById(id);
}
/**
* 查询辖区路段列表
*
* @param dcRoadSection 辖区路段
* @return 辖区路段
*/
@Override
public List<DcRoadSection> selectDcRoadSectionList(DcRoadSection dcRoadSection)
{
return dcRoadSectionMapper.selectDcRoadSectionList(dcRoadSection);
}
/**
* 新增辖区路段
*
* @param dcRoadSection 辖区路段
* @return 结果
*/
@Override
public int insertDcRoadSection(DcRoadSection dcRoadSection)
{
dcRoadSection.setCreateTime(DateUtils.getNowDate());
return dcRoadSectionMapper.insertDcRoadSection(dcRoadSection);
}
/**
* 修改辖区路段
*
* @param dcRoadSection 辖区路段
* @return 结果
*/
@Override
public int updateDcRoadSection(DcRoadSection dcRoadSection)
{
dcRoadSection.setUpdateTime(DateUtils.getNowDate());
return dcRoadSectionMapper.updateDcRoadSection(dcRoadSection);
}
/**
* 批量删除辖区路段
*
* @param ids 需要删除的辖区路段主键
* @return 结果
*/
@Override
public int deleteDcRoadSectionByIds(Long[] ids)
{
return dcRoadSectionMapper.deleteDcRoadSectionByIds(ids);
}
/**
* 删除辖区路段信息
*
* @param id 辖区路段主键
* @return 结果
*/
@Override
public int deleteDcRoadSectionById(Long id)
{
return dcRoadSectionMapper.deleteDcRoadSectionById(id);
}
//查询路线id与名称
@Override
public List<HashMap<String, Object>> selectRoadList() {
return dcRoadSectionMapper.selectRoadList();
}
}

6
zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml

@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="description" column="description" /> <result property="description" column="description" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="direction" column="direction" />
</resultMap> </resultMap>
<sql id="selectDcOrganizationVo"> <sql id="selectDcOrganizationVo">
select id, parent_id, organization_type, organization_name, organization_address, stake_mark_id, rescue_unit, description, create_time, update_time from dc_organization select id,direction, parent_id, organization_type, organization_name, organization_address, stake_mark_id, rescue_unit, description, create_time, update_time from dc_organization
</sql> </sql>
<select id="selectDcOrganizationList" parameterType="DcOrganization" resultMap="DcOrganizationResult"> <select id="selectDcOrganizationList" parameterType="DcOrganization" resultMap="DcOrganizationResult">
@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into dc_organization insert into dc_organization
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if> <if test="id != null">id,</if>
<if test="direction != null">direction,</if>
<if test="parentId != null">parent_id,</if> <if test="parentId != null">parent_id,</if>
<if test="organizationType != null">organization_type,</if> <if test="organizationType != null">organization_type,</if>
<if test="organizationName != null and organizationName != ''">organization_name,</if> <if test="organizationName != null and organizationName != ''">organization_name,</if>
@ -54,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
<if test="direction != null">#{direction},</if>
<if test="parentId != null">#{parentId},</if> <if test="parentId != null">#{parentId},</if>
<if test="organizationType != null">#{organizationType},</if> <if test="organizationType != null">#{organizationType},</if>
<if test="organizationName != null and organizationName != ''">#{organizationName},</if> <if test="organizationName != null and organizationName != ''">#{organizationName},</if>
@ -69,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateDcOrganization" parameterType="DcOrganization"> <update id="updateDcOrganization" parameterType="DcOrganization">
update dc_organization update dc_organization
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="direction != null">direction = #{direction},</if>
<if test="parentId != null">parent_id = #{parentId},</if> <if test="parentId != null">parent_id = #{parentId},</if>
<if test="organizationType != null">organization_type = #{organizationType},</if> <if test="organizationType != null">organization_type = #{organizationType},</if>
<if test="organizationName != null and organizationName != ''">organization_name = #{organizationName},</if> <if test="organizationName != null and organizationName != ''">organization_name = #{organizationName},</if>

106
zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcRoadSectionMapper">
<resultMap type="DcRoadSection" id="DcRoadSectionResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="roadId" column="road_id" />
<result property="startStakeMark" column="start_stake_mark" />
<result property="endStakeMark" column="end_stake_mark" />
<result property="sectionName" column="section_name" />
<result property="roadCode" column="road_code" />
<result property="mileage" column="mileage" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="deptName" column="dept_name" />
<result property="roadName" column="road_name" />
</resultMap>
<sql id="selectDcRoadSectionVo">
select section.id, section.dept_id, section.road_id,
dept.dept_name,road.road_name,
section.start_stake_mark, section.end_stake_mark,
section.section_name, section.road_code, section.mileage,
section.create_time, section.update_time from dc_road_section as section
left join sys_dept as dept on section.dept_id=dept.dept_id
left join dc_road as road on section.road_id=road.id
</sql>
<select id="selectDcRoadSectionList" parameterType="DcRoadSection" resultMap="DcRoadSectionResult">
<include refid="selectDcRoadSectionVo"/>
<where>
<if test="deptId != null "> and section.dept_id = #{deptId}</if>
<if test="roadId != null "> and section.road_id = #{roadId}</if>
<if test="startStakeMark != null and startStakeMark != ''"> and section.start_stake_mark = #{startStakeMark}</if>
<if test="endStakeMark != null and endStakeMark != ''"> and section.end_stake_mark = #{endStakeMark}</if>
<if test="sectionName != null and sectionName != ''"> and section.section_name like concat('%', #{sectionName}, '%')</if>
<if test="roadCode != null and roadCode != ''"> and section.road_code = #{roadCode}</if>
</where>
</select>
<select id="selectDcRoadSectionById" parameterType="Long" resultMap="DcRoadSectionResult">
<include refid="selectDcRoadSectionVo"/>
where section.id = #{id}
</select>
<select id="selectRoadList" resultType="java.util.HashMap">
select id,road_name roadName from dc_road
</select>
<insert id="insertDcRoadSection" parameterType="DcRoadSection">
insert into dc_road_section
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deptId != null">dept_id,</if>
<if test="roadId != null">road_id,</if>
<if test="startStakeMark != null">start_stake_mark,</if>
<if test="endStakeMark != null">end_stake_mark,</if>
<if test="sectionName != null and sectionName != ''">section_name,</if>
<if test="roadCode != null">road_code,</if>
<if test="mileage != null">mileage,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deptId != null">#{deptId},</if>
<if test="roadId != null">#{roadId},</if>
<if test="startStakeMark != null">#{startStakeMark},</if>
<if test="endStakeMark != null">#{endStakeMark},</if>
<if test="sectionName != null and sectionName != ''">#{sectionName},</if>
<if test="roadCode != null">#{roadCode},</if>
<if test="mileage != null">#{mileage},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDcRoadSection" parameterType="DcRoadSection">
update dc_road_section
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="roadId != null">road_id = #{roadId},</if>
<if test="startStakeMark != null">start_stake_mark = #{startStakeMark},</if>
<if test="endStakeMark != null">end_stake_mark = #{endStakeMark},</if>
<if test="sectionName != null and sectionName != ''">section_name = #{sectionName},</if>
<if test="roadCode != null">road_code = #{roadCode},</if>
<if test="mileage != null">mileage = #{mileage},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcRoadSectionById" parameterType="Long">
delete from dc_road_section where id = #{id}
</delete>
<delete id="deleteDcRoadSectionByIds" parameterType="String">
delete from dc_road_section where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save