基础业务代码
parent
5ce5d44cb7
commit
d92f3c4c4f
|
|
@ -39,7 +39,7 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>com.zcloud.risk.Application</mainClass>
|
||||
<mainClass>com.zcloud.iotalarm.IotAlarmApplication</mainClass>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
|
|
|||
|
|
@ -2,5 +2,7 @@ spring:
|
|||
config:
|
||||
import:
|
||||
- classpath:nacos.yml
|
||||
# - classpath:prodnacos.yml
|
||||
- classpath:sdk.yml
|
||||
# - classpath:prodsdk.yml
|
||||
- classpath:swagger.yml
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ nacos:
|
|||
url: 192.168.20.100:30290
|
||||
namespace: jjb-dragon
|
||||
application:
|
||||
name: jjb-saas-zcloud-risk
|
||||
name: jjb-saas-zcloud-iotalarm
|
||||
version:
|
||||
gateway: risk
|
||||
cn-name: 风险中心
|
||||
gateway: iotalarm
|
||||
cn-name: 物联网消防报警
|
||||
spring:
|
||||
application:
|
||||
name: ${application.name}${application.version}
|
||||
|
|
|
|||
|
|
@ -15,4 +15,13 @@ springfox:
|
|||
base-url: ${application.gateway}
|
||||
swagger:
|
||||
v2:
|
||||
path: /${application.gateway}/v2/api-docs
|
||||
path: /${application.gateway}/v2/api-docs
|
||||
|
||||
# 报警消息模板配置
|
||||
alarm:
|
||||
message:
|
||||
template:
|
||||
# 报警自动推送模板编码(由开放平台配置)
|
||||
auto-push: IOT_ALARM_AUTO_PUSH
|
||||
# 报警处置推送模板编码(由开放平台配置)
|
||||
dispose-push: IOT_ALARM_DISPOSE_PUSH
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
nacos:
|
||||
url: prod-nacos:8848
|
||||
namespace: jjb-dragon
|
||||
application:
|
||||
name: jjb-saas-zcloud-iotalarm
|
||||
version:
|
||||
gateway: iotalarm
|
||||
cn-name: 物联网消防报警
|
||||
spring:
|
||||
application:
|
||||
name: ${application.name}${application.version}
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: prod
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
namespace: ${nacos.namespace}
|
||||
server-addr: ${nacos.url}
|
||||
username: nacos
|
||||
password: u9Hc7tLFBY
|
||||
file-extension: yml
|
||||
shared-configs:
|
||||
- config-common.yml
|
||||
- config-port.yml
|
||||
- config-mq.yml
|
||||
- config-log.yml
|
||||
- config-sdk-server.yml
|
||||
- config-actuator.yml
|
||||
- config-job.yml
|
||||
- config-mysql.yml
|
||||
- config-redis.yml
|
||||
- config-cache.yml
|
||||
- config-spring.yml
|
||||
- config-mybatis.yml
|
||||
- config-sdk.yml
|
||||
- config-flyway.yml
|
||||
discovery:
|
||||
server-addr: ${spring.cloud.nacos.config.server-addr}
|
||||
namespace: ${spring.cloud.nacos.config.namespace}
|
||||
username: nacos
|
||||
password: u9Hc7tLFBY
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
sdk:
|
||||
server:
|
||||
# 线上环境
|
||||
app-key: 0fde29723e51420d82b7047feaad98c9
|
||||
# 港务局环境
|
||||
# app-key: 7aa164ddb87a450fbcd902b38a49e36e
|
||||
client:
|
||||
gateway:
|
||||
url: ${common.gateway.network.http.external}
|
||||
route:
|
||||
- client:
|
||||
system-code: ${application.name}
|
||||
name: ${application.cn-name}-后端
|
||||
group-code: public_api
|
||||
service:
|
||||
system-code: ${application.name}
|
||||
name: ${application.cn-name}-后端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://${application.name}
|
||||
path: /${application.gateway}/**
|
||||
- client:
|
||||
system-code: ${application.name}-container
|
||||
name: ${application.cn-name}-前端
|
||||
group-code: public_api
|
||||
service:
|
||||
system-code: ${application.name}-container
|
||||
name: ${application.cn-name}-前端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://jjb-saas-base
|
||||
path: /${application.gateway}/container/**
|
||||
order: -2
|
||||
openapi:
|
||||
appId: 1871106785124999168
|
||||
appKey: 7314ecfc11ff4d5fad1ac19284ed2ac3
|
||||
appSecret: 7565ab15-a2ae-4830-9b4d-fb382cd5fb30
|
||||
appPublicKey: 3059301306072a8648ce3d020106082a811ccf5501822d03420004f339671110a06681fcfd968ad9247bd3cd0d2ec6b2159d1d4b775e7ed5566b3297d82cf14b626ef11fdd6bc7ecb6bcfb3ea94ccd1f381f4116f43367be4b360f
|
||||
appPrivateKey: 308193020100301306072a8648ce3d020106082a811ccf5501822d0479307702010104206b6abc8e717b7d042f1e8531190a7c18113e4a701417f2770d2150d33ba97779a00a06082a811ccf5501822da14403420004f339671110a06681fcfd968ad9247bd3cd0d2ec6b2159d1d4b775e7ed5566b3297d82cf14b626ef11fdd6bc7ecb6bcfb3ea94ccd1f381f4116f43367be4b360f
|
||||
encryptType: SM2
|
||||
platform:
|
||||
- name: default
|
||||
openPublicKey: 3059301306072a8648ce3d020106082a811ccf5501822d034200045b5d8fcad91e113910406db4caf0f5c6688048e0f46742d55f872a25855316803ddb177cc9bb5906ff0b2ad4d6b1f1378a49109104613e79b5b5512e3710e88f
|
||||
url: ${common.gateway.network.http.intranet}
|
||||
protocol: HTTP
|
||||
defaultPlatform: true
|
||||
##ciphertext plaintext
|
||||
type: plaintext
|
||||
apiPlatform:
|
||||
- name: default
|
||||
#多个可以逗号隔开
|
||||
apiCode: test:01
|
||||
#多个可以逗号隔开,可以为空
|
||||
tenantIds: 1838408702262321152
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
sdk:
|
||||
server:
|
||||
app-key: 722091ff53dd4abba078c2a00efd4a42
|
||||
app-key: d8328fe2605f4f92848fef116472241d
|
||||
client:
|
||||
gateway:
|
||||
url: ${common.gateway.network.http.external}
|
||||
|
|
@ -14,7 +14,7 @@ sdk:
|
|||
name: ${application.cn-name}-后端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: lb://${application.name}
|
||||
uri: http://${application.name}
|
||||
path: /${application.gateway}/**
|
||||
- client:
|
||||
system-code: ${application.name}-container
|
||||
|
|
@ -25,7 +25,7 @@ sdk:
|
|||
name: ${application.cn-name}-前端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: lb://jjb-saas-base
|
||||
uri: http://jjb-saas-base
|
||||
path: /${application.gateway}/container/**
|
||||
order: -2
|
||||
openapi:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.api.AlarmDisposeServiceI;
|
||||
import com.zcloud.dto.AlarmDisposeAssignCmd;
|
||||
import com.zcloud.dto.AlarmDisposeBatchAssignCmd;
|
||||
import com.zcloud.dto.AlarmDisposeInvalidCmd;
|
||||
import com.zcloud.dto.AlarmDisposePageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* AlarmDisposeController - 报警处置控制器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Api(tags = "报警处置分配")
|
||||
@RequestMapping("/${application.gateway}/alarmDispose")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AlarmDisposeController {
|
||||
private final AlarmDisposeServiceI alarmDisposeService;
|
||||
|
||||
@ApiOperation("待处置列表")
|
||||
@PostMapping("/assignList")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-alarmdispose-assignlist')")
|
||||
public PageResponse<AlarmDisposeCO> assignList(@RequestBody AlarmDisposePageQry qry) {
|
||||
if (qry.getTenantId() == null) {
|
||||
qry.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return alarmDisposeService.assignList(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("单条处置分配")
|
||||
@PostMapping("/assign")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-alarmdispose-assign')")
|
||||
public SingleResponse assign(@Validated @RequestBody AlarmDisposeAssignCmd cmd) {
|
||||
if (cmd.getTenantId() == null) {
|
||||
cmd.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return alarmDisposeService.assign(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("批量处置分配")
|
||||
@PostMapping("/batchAssign")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-alarmdispose-batchassign')")
|
||||
public SingleResponse batchAssign(@Validated @RequestBody AlarmDisposeBatchAssignCmd cmd) {
|
||||
if (cmd.getTenantId() == null) {
|
||||
cmd.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return alarmDisposeService.batchAssign(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("无效报警处理")
|
||||
@PostMapping("/invalid")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-alarmdispose-invalid')")
|
||||
public SingleResponse invalid(@Validated @RequestBody AlarmDisposeInvalidCmd cmd) {
|
||||
if (cmd.getTenantId() == null) {
|
||||
cmd.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return alarmDisposeService.invalid(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("报警详情")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-alarmdispose-assignlist')")
|
||||
public SingleResponse<AlarmDisposeCO> info(@PathVariable("id") Long id) {
|
||||
return alarmDisposeService.info(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.api.AlarmRecordServiceI;
|
||||
import com.zcloud.dto.AlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* AlarmRecordController - 报警记录控制器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Api(tags = "报警记录管理")
|
||||
@RequestMapping("/${application.gateway}/alarmRecord")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AlarmRecordController {
|
||||
private final AlarmRecordServiceI alarmRecordService;
|
||||
|
||||
@ApiOperation("报警记录列表")
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-alarmrecord-list')")
|
||||
public PageResponse<AlarmRecordCO> list(@RequestBody AlarmRecordPageQry qry) {
|
||||
if (qry.getTenantId() == null) {
|
||||
qry.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return alarmRecordService.list(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("报警详情")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-alarmrecord-info')")
|
||||
public SingleResponse<AlarmRecordCO> info(@PathVariable("id") Long id) {
|
||||
return alarmRecordService.info(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.api.AlarmDisposeServiceI;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposeSubmitCmd;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* AppAlarmDisposeController - APP报警处置控制器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Api(tags = "手机端报警处置")
|
||||
@RequestMapping("/${application.gateway}/app/alarmDispose")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AppAlarmDisposeController {
|
||||
|
||||
private final AlarmDisposeServiceI alarmDisposeService;
|
||||
|
||||
@ApiOperation("手机端待处置列表")
|
||||
@PostMapping("/todoList")
|
||||
public PageResponse<AlarmDisposeCO> todoList(@RequestBody AppAlarmDisposePageQry qry) {
|
||||
// 自动填充当前用户ID和租户ID
|
||||
qry.setCurrentUserId(AuthContext.getUserId());
|
||||
if (qry.getTenantId() == null) {
|
||||
qry.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return alarmDisposeService.appTodoList(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("手机端报警详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<AlarmDisposeCO> info(@PathVariable("id") Long id) {
|
||||
return alarmDisposeService.appInfo(id);
|
||||
}
|
||||
|
||||
@ApiOperation("手机端提交处置结果")
|
||||
@PostMapping("/submit")
|
||||
public SingleResponse submit(@Validated @RequestBody AppAlarmDisposeSubmitCmd cmd) {
|
||||
// 自动填充租户ID和组织ID
|
||||
if (cmd.getTenantId() == null) {
|
||||
cmd.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
if (cmd.getOrgId() == null) {
|
||||
cmd.setOrgId(AuthContext.getOrgId());
|
||||
}
|
||||
return alarmDisposeService.appSubmit(cmd);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.AlarmRecordServiceI;
|
||||
import com.zcloud.dto.AppAlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* AppAlarmRecordController - APP报警记录控制器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Api(tags = "手机端处置记录")
|
||||
@RequestMapping("/${application.gateway}/app/alarmRecord")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AppAlarmRecordController {
|
||||
|
||||
private final AlarmRecordServiceI alarmRecordService;
|
||||
|
||||
@ApiOperation("处置记录列表(按当前用户过滤)")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<AlarmRecordCO> list(@RequestBody AppAlarmRecordPageQry qry) {
|
||||
return alarmRecordService.appList(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("处置记录详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<AlarmRecordCO> info(@PathVariable("id") Long id) {
|
||||
return alarmRecordService.appInfo(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.api.DeviceRegionServiceI;
|
||||
import com.zcloud.dto.DeviceRegionAddCmd;
|
||||
import com.zcloud.dto.DeviceRegionPageQry;
|
||||
import com.zcloud.dto.BindSensorCmd;
|
||||
import com.zcloud.dto.UnbindSensorCmd;
|
||||
import com.zcloud.dto.ManagerCmd;
|
||||
import com.zcloud.dto.clientobject.DeviceRegionCO;
|
||||
import com.zcloud.dto.clientobject.FireRegionCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* DeviceRegionController - 设备区域控制器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Api(tags = "设备区域管理")
|
||||
@RequestMapping("/${application.gateway}/deviceRegion")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class DeviceRegionController {
|
||||
private final DeviceRegionServiceI deviceRegionService;
|
||||
|
||||
@ApiOperation("分页列表")
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-list')")
|
||||
public PageResponse<DeviceRegionCO> list(@RequestBody DeviceRegionPageQry qry) {
|
||||
if (qry.getTenantId() == null) {
|
||||
qry.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return deviceRegionService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("新增或修改")
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-add')")
|
||||
public SingleResponse<String> saveOrUpdate(@Validated @RequestBody DeviceRegionAddCmd cmd) {
|
||||
return deviceRegionService.saveOrUpdate(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("绑定传感器")
|
||||
@PostMapping("/bindSensor")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-edit')")
|
||||
public SingleResponse bindSensor(@Validated @RequestBody BindSensorCmd cmd) {
|
||||
return deviceRegionService.bindSensor(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("解绑传感器")
|
||||
@PostMapping("/unbindSensor")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-edit')")
|
||||
public SingleResponse unbindSensor(@Validated @RequestBody UnbindSensorCmd cmd) {
|
||||
return deviceRegionService.unbindSensor(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("负责人配置")
|
||||
@PutMapping("/manager")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-edit')")
|
||||
public SingleResponse manager(@Validated @RequestBody ManagerCmd cmd) {
|
||||
return deviceRegionService.manager(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("消防区域列表")
|
||||
@GetMapping("/fireRegionList")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-list')")
|
||||
public SingleResponse<FireRegionCO> fireRegionList() {
|
||||
Long tenantId = AuthContext.getTenantId();
|
||||
return deviceRegionService.fireRegionList(tenantId);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-delete')")
|
||||
public SingleResponse remove(@PathVariable("id") Long id) {
|
||||
deviceRegionService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-deviceregion-list')")
|
||||
public SingleResponse<DeviceRegionCO> info(@PathVariable("id") Long id) {
|
||||
return deviceRegionService.info(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.RiskPointServiceI;
|
||||
import com.zcloud.dto.RiskPointAddCmd;
|
||||
import com.zcloud.dto.RiskPointPageQry;
|
||||
import com.zcloud.dto.RiskPointUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.RiskPointCo;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
@Api(tags = "风险点管理")
|
||||
@RequestMapping("/risk/riskPoint")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class RiskPointController {
|
||||
private final RiskPointServiceI riskPointService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<RiskPointCo> add(@Validated @RequestBody RiskPointAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return riskPointService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<RiskPointCo> page(@RequestBody RiskPointPageQry qry) {
|
||||
return riskPointService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
public MultiResponse<RiskPointCo> listAll() {
|
||||
return MultiResponse.of(new ArrayList<RiskPointCo>());
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<RiskPointCo> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new RiskPointCo());
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public Response remove(@PathVariable("id") Long id) {
|
||||
riskPointService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@DeleteMapping("/ids")
|
||||
public Response removeBatch(@RequestParam Long[] ids) {
|
||||
riskPointService.removeBatch(ids);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody RiskPointUpdateCmd riskPointUpdateCmd) {
|
||||
riskPointService.edit(riskPointUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.api.SensorDeviceServiceI;
|
||||
import com.zcloud.dto.SensorDeviceAddCmd;
|
||||
import com.zcloud.dto.SensorDevicePageQry;
|
||||
import com.zcloud.dto.SensorDeviceThresholdCmd;
|
||||
import com.zcloud.dto.SensorDeviceUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.SensorDeviceCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* SensorDeviceController - 传感器设备控制器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Api(tags = "传感器设备管理")
|
||||
@RequestMapping("/${application.gateway}/sensorDevice")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class SensorDeviceController {
|
||||
private final SensorDeviceServiceI sensorDeviceService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensordevice-add')")
|
||||
public SingleResponse<String> save(@Validated @RequestBody SensorDeviceAddCmd cmd) {
|
||||
return sensorDeviceService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页列表")
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensordevice-list')")
|
||||
public PageResponse<SensorDeviceCO> list(@RequestBody SensorDevicePageQry qry) {
|
||||
if (qry.getTenantId() == null) {
|
||||
qry.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return sensorDeviceService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensordevice-edit')")
|
||||
public SingleResponse edit(@Validated @RequestBody SensorDeviceUpdateCmd cmd) {
|
||||
sensorDeviceService.edit(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("状态切换")
|
||||
@PutMapping("/status")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensordevice-edit')")
|
||||
public SingleResponse updateStatus(@RequestParam Long id, @RequestParam String status) {
|
||||
sensorDeviceService.updateStatus(id, status);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("阈值配置")
|
||||
@PutMapping("/threshold")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensordevice-edit')")
|
||||
public SingleResponse updateThreshold(@Validated @RequestBody SensorDeviceThresholdCmd cmd) {
|
||||
sensorDeviceService.updateThreshold(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensordevice-delete')")
|
||||
public SingleResponse remove(@PathVariable("id") Long id) {
|
||||
sensorDeviceService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<SensorDeviceCO> info(@PathVariable("id") Long id) {
|
||||
return sensorDeviceService.info(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.zcloud.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.api.SensorTypeServiceI;
|
||||
import com.zcloud.dto.SensorTypeAddCmd;
|
||||
import com.zcloud.dto.SensorTypePageQry;
|
||||
import com.zcloud.dto.SensorTypeUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.SensorTypeCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* SensorTypeController - 传感器类型控制器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Api(tags = "传感器类型管理")
|
||||
@RequestMapping("/${application.gateway}/sensorType")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class SensorTypeController {
|
||||
private final SensorTypeServiceI sensorTypeService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-add')")
|
||||
public SingleResponse<String> save(@Validated @RequestBody SensorTypeAddCmd cmd) {
|
||||
return sensorTypeService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页列表")
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-list')")
|
||||
public PageResponse<SensorTypeCO> list(@RequestBody SensorTypePageQry qry) {
|
||||
if (qry.getTenantId() == null) {
|
||||
qry.setTenantId(AuthContext.getTenantId());
|
||||
}
|
||||
return sensorTypeService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-edit')")
|
||||
public SingleResponse edit(@Validated @RequestBody SensorTypeUpdateCmd cmd) {
|
||||
sensorTypeService.edit(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-delete')")
|
||||
public SingleResponse remove(@PathVariable("id") Long id) {
|
||||
sensorTypeService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<SensorTypeCO> info(@PathVariable("id") Long id) {
|
||||
return sensorTypeService.info(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -13,6 +13,24 @@
|
|||
<name>web-app</name>
|
||||
|
||||
<dependencies>
|
||||
<!-- RocketMQ -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rocketmq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Redis -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Caffeine Cache -->
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zcloud</groupId>
|
||||
<artifactId>web-client</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.AlarmRecordGateway;
|
||||
import com.zcloud.domain.gateway.AlarmDisposeLogGateway;
|
||||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import com.zcloud.domain.model.AlarmDisposeLogE;
|
||||
import com.zcloud.dto.AlarmDisposeAssignCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.service.AlarmMessageService;
|
||||
import com.zcloud.service.AlarmTodoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* AlarmDisposeAssignExe - 报警处置执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class AlarmDisposeAssignExe {
|
||||
|
||||
private final AlarmRecordGateway alarmRecordGateway;
|
||||
private final AlarmDisposeLogGateway alarmDisposeLogGateway;
|
||||
private final AlarmMessageService alarmMessageService;
|
||||
private final AlarmTodoService alarmTodoService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(AlarmDisposeAssignCmd cmd) {
|
||||
// 查询报警记录
|
||||
AlarmRecordE alarmRecord = alarmRecordGateway.getById(cmd.getId());
|
||||
if (Tools.isEmpty(alarmRecord)) {
|
||||
throw new BizException("报警记录不存在");
|
||||
}
|
||||
|
||||
// 检查状态:只有待研判(10)状态可以分配
|
||||
if (alarmRecord.getStatus() != 10) {
|
||||
throw new BizException("该报警已分配或已处置,无法再次分配");
|
||||
}
|
||||
|
||||
// 更新报警记录状态和处置人
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
BeanUtils.copyProperties(cmd, updateEntity);
|
||||
updateEntity.setId(cmd.getId());
|
||||
updateEntity.setStatus(20); // 待处置
|
||||
updateEntity.setManagerId(cmd.getDisposeUserId());
|
||||
updateEntity.setAssignTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
if (StrUtil.isNotBlank(cmd.getAlarmLevel())) {
|
||||
updateEntity.setAlarmLevel(cmd.getAlarmLevel());
|
||||
}
|
||||
if (StrUtil.isNotBlank(cmd.getAlarmType())) {
|
||||
updateEntity.setAlarmType(cmd.getAlarmType());
|
||||
}
|
||||
|
||||
Boolean res = alarmRecordGateway.update(updateEntity);
|
||||
if (!res) {
|
||||
throw new BizException("分配失败");
|
||||
}
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
log.setAlarmId(cmd.getId());
|
||||
log.setAlarmNo(alarmRecord.getAlarmNo());
|
||||
log.setActionType("MANUAL_ASSIGN");
|
||||
log.setBeforeStatus(10);
|
||||
log.setAfterStatus(20);
|
||||
log.setOperatorId(cmd.getDisposeUserId());
|
||||
log.setActionDesc("手动分配处置");
|
||||
log.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
// 发送报警处置推送消息给处置人
|
||||
// 更新后的报警记录包含分配时间和处置说明
|
||||
alarmMessageService.sendDisposePushMessage(updateEntity, cmd.getDisposeUserId());
|
||||
|
||||
// 新增处置人待办
|
||||
alarmTodoService.addDisposeTodo(updateEntity, cmd.getDisposeUserId());
|
||||
|
||||
// 完成负责人待办(原来负责人是 alarmRecord.getManagerId())
|
||||
alarmTodoService.completeTodo(cmd.getId());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.AlarmRecordGateway;
|
||||
import com.zcloud.domain.gateway.AlarmDisposeLogGateway;
|
||||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import com.zcloud.domain.model.AlarmDisposeLogE;
|
||||
import com.zcloud.dto.AlarmDisposeBatchAssignCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.service.AlarmMessageService;
|
||||
import com.zcloud.service.AlarmTodoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AlarmDisposeBatchAssignExe - 报警处置执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class AlarmDisposeBatchAssignExe {
|
||||
|
||||
private final AlarmRecordGateway alarmRecordGateway;
|
||||
private final AlarmDisposeLogGateway alarmDisposeLogGateway;
|
||||
private final AlarmMessageService alarmMessageService;
|
||||
private final AlarmTodoService alarmTodoService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(AlarmDisposeBatchAssignCmd cmd) {
|
||||
List<Long> ids = cmd.getIds();
|
||||
if (Tools.isEmpty(ids)) {
|
||||
throw new BizException("请选择要分配的报警记录");
|
||||
}
|
||||
|
||||
String assignTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
for (Long id : ids) {
|
||||
// 查询报警记录
|
||||
AlarmRecordE alarmRecord = alarmRecordGateway.getById(id);
|
||||
if (Tools.isEmpty(alarmRecord)) {
|
||||
continue; // 跳过不存在的记录
|
||||
}
|
||||
|
||||
// 检查状态:只有待研判(10)状态可以分配
|
||||
if (alarmRecord.getStatus() != 10) {
|
||||
continue; // 跳过非待研判状态的记录
|
||||
}
|
||||
|
||||
// 更新报警记录状态和处置人
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
updateEntity.setId(id);
|
||||
updateEntity.setStatus(20); // 待处置
|
||||
updateEntity.setManagerId(cmd.getDisposeUserId());
|
||||
updateEntity.setAssignTime(assignTime);
|
||||
updateEntity.setTenantId(cmd.getTenantId());
|
||||
updateEntity.setOrgId(cmd.getOrgId());
|
||||
|
||||
alarmRecordGateway.update(updateEntity);
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
log.setAlarmId(id);
|
||||
log.setAlarmNo(alarmRecord.getAlarmNo());
|
||||
log.setActionType("MANUAL_ASSIGN");
|
||||
log.setBeforeStatus(10);
|
||||
log.setAfterStatus(20);
|
||||
log.setOperatorId(cmd.getDisposeUserId());
|
||||
log.setActionDesc("批量分配处置");
|
||||
log.setActionTime(assignTime);
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
// 发送报警处置推送消息给处置人
|
||||
alarmMessageService.sendDisposePushMessage(updateEntity, cmd.getDisposeUserId());
|
||||
|
||||
// 新增处置人待办
|
||||
alarmTodoService.addDisposeTodo(updateEntity, cmd.getDisposeUserId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.AlarmRecordGateway;
|
||||
import com.zcloud.domain.gateway.AlarmDisposeLogGateway;
|
||||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import com.zcloud.domain.model.AlarmDisposeLogE;
|
||||
import com.zcloud.dto.AlarmDisposeInvalidCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.service.AlarmTodoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* AlarmDisposeInvalidExe - 报警处置执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class AlarmDisposeInvalidExe {
|
||||
|
||||
private final AlarmRecordGateway alarmRecordGateway;
|
||||
private final AlarmDisposeLogGateway alarmDisposeLogGateway;
|
||||
private final AlarmTodoService alarmTodoService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(AlarmDisposeInvalidCmd cmd) {
|
||||
// 查询报警记录
|
||||
AlarmRecordE alarmRecord = alarmRecordGateway.getById(cmd.getId());
|
||||
if (Tools.isEmpty(alarmRecord)) {
|
||||
throw new BizException("报警记录不存在");
|
||||
}
|
||||
|
||||
// 检查状态:只有待研判(10)或待处置(20)状态可以标记为无效
|
||||
if (alarmRecord.getStatus() != 10 && alarmRecord.getStatus() != 20) {
|
||||
throw new BizException("该报警已处置或已消警,无法标记为无效");
|
||||
}
|
||||
|
||||
Integer beforeStatus = alarmRecord.getStatus();
|
||||
|
||||
// 更新报警记录状态
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
updateEntity.setId(cmd.getId());
|
||||
updateEntity.setStatus(40); // 误报
|
||||
updateEntity.setDisposeTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
updateEntity.setDisposeResult("误报");
|
||||
if (StrUtil.isNotBlank(cmd.getInvalidReason())) {
|
||||
updateEntity.setDisposeRemark(cmd.getInvalidReason());
|
||||
}
|
||||
updateEntity.setTenantId(cmd.getTenantId());
|
||||
updateEntity.setOrgId(cmd.getOrgId());
|
||||
|
||||
Boolean res = alarmRecordGateway.update(updateEntity);
|
||||
if (!res) {
|
||||
throw new BizException("标记无效失败");
|
||||
}
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
log.setAlarmId(cmd.getId());
|
||||
log.setAlarmNo(alarmRecord.getAlarmNo());
|
||||
log.setActionType("INVALID");
|
||||
log.setBeforeStatus(beforeStatus);
|
||||
log.setAfterStatus(40);
|
||||
log.setActionDesc("标记为无效报警");
|
||||
if (StrUtil.isNotBlank(cmd.getInvalidReason())) {
|
||||
log.setResultText(cmd.getInvalidReason());
|
||||
}
|
||||
log.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
// 删除待办(误报时删除所有相关待办)
|
||||
alarmTodoService.deleteTodo(cmd.getId());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.AlarmRecordGateway;
|
||||
import com.zcloud.domain.gateway.AlarmDisposeLogGateway;
|
||||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import com.zcloud.domain.model.AlarmDisposeLogE;
|
||||
import com.zcloud.dto.AppAlarmDisposeSubmitCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.service.AlarmTodoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* AppAlarmDisposeSubmitExe - APP报警处置执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class AppAlarmDisposeSubmitExe {
|
||||
|
||||
private final AlarmRecordGateway alarmRecordGateway;
|
||||
private final AlarmDisposeLogGateway alarmDisposeLogGateway;
|
||||
private final AlarmTodoService alarmTodoService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(AppAlarmDisposeSubmitCmd cmd) {
|
||||
// 查询报警记录
|
||||
AlarmRecordE alarmRecord = alarmRecordGateway.getById(cmd.getAlarmId());
|
||||
if (Tools.isEmpty(alarmRecord)) {
|
||||
throw new BizException("报警记录不存在");
|
||||
}
|
||||
|
||||
// 检查状态:只有待处置(20)状态可以提交处置
|
||||
if (alarmRecord.getStatus() != 20) {
|
||||
throw new BizException("该报警已处置或状态异常,无法提交处置结果");
|
||||
}
|
||||
|
||||
// 确定目标状态
|
||||
Integer afterStatus;
|
||||
String actionDesc;
|
||||
if ("误报".equals(cmd.getDisposeResult())) {
|
||||
afterStatus = 40; // 误报
|
||||
actionDesc = "手机端处置:误报判定";
|
||||
} else {
|
||||
afterStatus = 30; // 已消警
|
||||
actionDesc = "手机端处置:已消警";
|
||||
}
|
||||
|
||||
// 更新报警记录
|
||||
AlarmRecordE updateEntity = new AlarmRecordE();
|
||||
updateEntity.setId(cmd.getAlarmId());
|
||||
updateEntity.setStatus(afterStatus);
|
||||
updateEntity.setDisposeTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
updateEntity.setDisposeResult(cmd.getDisposeResult());
|
||||
if (StrUtil.isNotBlank(cmd.getDisposeRemark())) {
|
||||
updateEntity.setDisposeRemark(cmd.getDisposeRemark());
|
||||
}
|
||||
if (StrUtil.isNotBlank(cmd.getPictureUrls())) {
|
||||
updateEntity.setPictureUrls(cmd.getPictureUrls());
|
||||
}
|
||||
updateEntity.setTenantId(cmd.getTenantId());
|
||||
updateEntity.setOrgId(cmd.getOrgId());
|
||||
|
||||
Boolean res = alarmRecordGateway.update(updateEntity);
|
||||
if (!res) {
|
||||
throw new BizException("处置提交失败");
|
||||
}
|
||||
|
||||
// 记录处置日志
|
||||
AlarmDisposeLogE log = new AlarmDisposeLogE();
|
||||
log.setAlarmDisposalLogId(UuidUtil.get32UUID());
|
||||
log.setAlarmId(cmd.getAlarmId());
|
||||
log.setAlarmNo(alarmRecord.getAlarmNo());
|
||||
log.setActionType("DISPOSE");
|
||||
log.setBeforeStatus(20);
|
||||
log.setAfterStatus(afterStatus);
|
||||
log.setActionDesc(actionDesc);
|
||||
log.setResultText(cmd.getDisposeResult());
|
||||
if (StrUtil.isNotBlank(cmd.getDisposeRemark())) {
|
||||
log.setResultText(cmd.getDisposeRemark());
|
||||
}
|
||||
if (StrUtil.isNotBlank(cmd.getPictureUrls())) {
|
||||
log.setPictureUrls(cmd.getPictureUrls());
|
||||
}
|
||||
log.setActionTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
log.setTenantId(cmd.getTenantId());
|
||||
log.setOrgId(cmd.getOrgId());
|
||||
log.setDeleteEnum("FALSE");
|
||||
|
||||
alarmDisposeLogGateway.add(log);
|
||||
|
||||
// 根据处置结果处理待办
|
||||
if ("误报".equals(cmd.getDisposeResult())) {
|
||||
// 误报时删除待办
|
||||
alarmTodoService.deleteTodo(cmd.getAlarmId());
|
||||
} else {
|
||||
// 已消警时完成待办
|
||||
alarmTodoService.completeTodo(cmd.getAlarmId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.DeviceRegionGateway;
|
||||
import com.zcloud.domain.gateway.RegionSensorRelGateway;
|
||||
import com.zcloud.domain.model.DeviceRegionE;
|
||||
import com.zcloud.domain.model.RegionSensorRelE;
|
||||
import com.zcloud.dto.BindSensorCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* BindSensorExe - 绑定传感器执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class BindSensorExe {
|
||||
|
||||
private final RegionSensorRelGateway regionSensorRelGateway;
|
||||
private final DeviceRegionGateway deviceRegionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(BindSensorCmd cmd) {
|
||||
// 检查传感器是否已绑定到其他区域
|
||||
Boolean isBound = regionSensorRelGateway.isSensorBound(cmd.getSensorId());
|
||||
if (isBound) {
|
||||
throw new BizException("该传感器已绑定到其他区域,请先解绑");
|
||||
}
|
||||
|
||||
// 检查区域配置是否存在
|
||||
DeviceRegionE region = deviceRegionGateway.getById(cmd.getRegionConfigId());
|
||||
if (Tools.isEmpty(region)) {
|
||||
throw new BizException("区域配置不存在");
|
||||
}
|
||||
|
||||
RegionSensorRelE entity = new RegionSensorRelE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
entity.setRegionSensorRelId(UuidUtil.get32UUID());
|
||||
entity.setFireRegionId(region.getFireRegionId());
|
||||
// 设置默认值
|
||||
entity.setDeleteEnum("FALSE");
|
||||
|
||||
Long res = regionSensorRelGateway.add(entity);
|
||||
if (Tools.isEmpty(res)) {
|
||||
throw new BizException("绑定失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.domain.gateway.DeviceRegionGateway;
|
||||
import com.zcloud.domain.model.DeviceRegionE;
|
||||
import com.zcloud.dto.DeviceRegionAddCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* DeviceRegionAddExe - 设备区域执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class DeviceRegionAddExe {
|
||||
|
||||
private final DeviceRegionGateway deviceRegionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SingleResponse<String> execute(DeviceRegionAddCmd cmd) {
|
||||
// 检查消防区域是否已存在配置
|
||||
DeviceRegionE existingRegion = deviceRegionGateway.getByFireRegionId(cmd.getFireRegionId());
|
||||
if (existingRegion != null) {
|
||||
throw new BizException("该消防区域已存在配置,请直接修改");
|
||||
}
|
||||
|
||||
DeviceRegionE entity = new DeviceRegionE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
entity.setRegionConfigId(UuidUtil.get32UUID());
|
||||
// 设置默认值
|
||||
entity.setDeleteEnum("FALSE");
|
||||
// 设置状态默认值
|
||||
if (entity.getStatus() == null) {
|
||||
entity.setStatus(1);
|
||||
}
|
||||
|
||||
Long res = deviceRegionGateway.add(entity);
|
||||
if (Tools.isEmpty(res)) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return SingleResponse.of(entity.getRegionConfigId());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.DeviceRegionGateway;
|
||||
import com.zcloud.domain.model.DeviceRegionE;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* DeviceRegionRemoveExe - 设备区域执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class DeviceRegionRemoveExe {
|
||||
|
||||
private final DeviceRegionGateway deviceRegionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(Long id) {
|
||||
DeviceRegionE existingRegion = deviceRegionGateway.getById(id);
|
||||
if (Tools.isEmpty(existingRegion)) {
|
||||
throw new BizException("区域配置不存在");
|
||||
}
|
||||
|
||||
Boolean res = deviceRegionGateway.deleteById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.DeviceRegionGateway;
|
||||
import com.zcloud.domain.model.DeviceRegionE;
|
||||
import com.zcloud.dto.DeviceRegionAddCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* DeviceRegionUpdateExe - 设备区域执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class DeviceRegionUpdateExe {
|
||||
|
||||
private final DeviceRegionGateway deviceRegionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(DeviceRegionAddCmd cmd) {
|
||||
DeviceRegionE existingRegion = deviceRegionGateway.getById(cmd.getId());
|
||||
if (Tools.isEmpty(existingRegion)) {
|
||||
throw new BizException("区域配置不存在");
|
||||
}
|
||||
|
||||
DeviceRegionE entity = new DeviceRegionE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
|
||||
Boolean res = deviceRegionGateway.update(entity);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.DeviceRegionGateway;
|
||||
import com.zcloud.domain.gateway.RegionSensorRelGateway;
|
||||
import com.zcloud.domain.model.DeviceRegionE;
|
||||
import com.zcloud.dto.ManagerCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* ManagerExe - 管理员执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class ManagerExe {
|
||||
|
||||
private final DeviceRegionGateway deviceRegionGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(ManagerCmd cmd) {
|
||||
DeviceRegionE existingRegion = deviceRegionGateway.getById(cmd.getId());
|
||||
if (Tools.isEmpty(existingRegion)) {
|
||||
throw new BizException("区域配置不存在");
|
||||
}
|
||||
|
||||
Boolean res = deviceRegionGateway.updateManager(cmd.getId(), cmd.getManagerId(), cmd.getDepartmentId());
|
||||
if (!res) {
|
||||
throw new BizException("负责人配置失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.RiskPointGateway;
|
||||
import com.zcloud.domain.model.RiskPointE;
|
||||
import com.zcloud.dto.RiskPointAddCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 风险点新增执行器
|
||||
*
|
||||
* @author lin
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RiskPointAddExe {
|
||||
private final RiskPointGateway riskPointGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(RiskPointAddCmd cmd) {
|
||||
RiskPointE examTypeE = new RiskPointE();
|
||||
BeanUtils.copyProperties(cmd, examTypeE);
|
||||
boolean res = false;
|
||||
try {
|
||||
res = riskPointGateway.add(examTypeE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.RiskPointGateway;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 风险点新增执行器
|
||||
* @author lin
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RiskPointRemoveExe {
|
||||
private final RiskPointGateway riskPointGateway;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean res = riskPointGateway.deletedRiskPointById(id);
|
||||
if(!res){
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
boolean res = riskPointGateway.deletedRiskPointByIds(ids);
|
||||
if(!res){
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.RiskPointGateway;
|
||||
import com.zcloud.domain.model.RiskPointE;
|
||||
import com.zcloud.dto.RiskPointUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 风险点修改执行器
|
||||
*
|
||||
* @author lin
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RiskPointUpdateExe {
|
||||
private final RiskPointGateway riskPointGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(RiskPointUpdateCmd riskPointUpdateCmd) {
|
||||
RiskPointE riskPointE = new RiskPointE();
|
||||
BeanUtils.copyProperties(riskPointUpdateCmd, riskPointE);
|
||||
boolean res = riskPointGateway.update(riskPointE);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorDeviceGateway;
|
||||
import com.zcloud.domain.model.SensorDeviceE;
|
||||
import com.zcloud.dto.SensorDeviceAddCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorDeviceAddExe - 传感器设备执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorDeviceAddExe {
|
||||
|
||||
private final SensorDeviceGateway sensorDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(SensorDeviceAddCmd cmd) {
|
||||
SensorDeviceE entity = new SensorDeviceE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
entity.setSensorDeviceId(UuidUtil.get32UUID());
|
||||
// 设置默认值
|
||||
entity.setDeleteEnum("FALSE");
|
||||
// 设置报警开关默认值
|
||||
if (entity.getAlarmSwitch() == null) {
|
||||
entity.setAlarmSwitch(1);
|
||||
}
|
||||
// 设置连续报警确认次数默认值
|
||||
if (entity.getContinuousAlarmCount() == null) {
|
||||
entity.setContinuousAlarmCount(3);
|
||||
}
|
||||
|
||||
Long res = sensorDeviceGateway.add(entity);
|
||||
if (Tools.isEmpty(res)) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorDeviceGateway;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorDeviceRemoveExe - 传感器设备执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorDeviceRemoveExe {
|
||||
|
||||
private final SensorDeviceGateway sensorDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean res = sensorDeviceGateway.deleteById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorDeviceGateway;
|
||||
import com.zcloud.domain.model.SensorDeviceE;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorDeviceStatusExe - 传感器设备执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorDeviceStatusExe {
|
||||
|
||||
private final SensorDeviceGateway sensorDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id, String status) {
|
||||
SensorDeviceE entity = sensorDeviceGateway.getById(id);
|
||||
if (entity == null) {
|
||||
throw new BizException("传感器设备不存在");
|
||||
}
|
||||
|
||||
entity.setSensorStatus(status);
|
||||
boolean res = sensorDeviceGateway.update(entity);
|
||||
if (!res) {
|
||||
throw new BizException("状态修改失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorDeviceGateway;
|
||||
import com.zcloud.domain.model.SensorDeviceE;
|
||||
import com.zcloud.dto.SensorDeviceThresholdCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorDeviceThresholdExe - 传感器设备执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorDeviceThresholdExe {
|
||||
|
||||
private final SensorDeviceGateway sensorDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(SensorDeviceThresholdCmd cmd) {
|
||||
SensorDeviceE entity = sensorDeviceGateway.getById(cmd.getId());
|
||||
if (entity == null) {
|
||||
throw new BizException("传感器设备不存在");
|
||||
}
|
||||
|
||||
// 校验:只有数值类传感器才允许配置阈值
|
||||
if (!"NUMBER".equals(entity.getSensorAttr())) {
|
||||
throw new BizException("开关类传感器不支持阈值配置");
|
||||
}
|
||||
|
||||
// 校验:只有阈值设定为是的才允许配置
|
||||
if (entity.getThresholdFlag() == null || entity.getThresholdFlag() != 1) {
|
||||
throw new BizException("该传感器未开启阈值设定,不允许配置阈值");
|
||||
}
|
||||
|
||||
// 更新阈值相关字段
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
|
||||
boolean res = sensorDeviceGateway.update(entity);
|
||||
if (!res) {
|
||||
throw new BizException("阈值配置失败");
|
||||
}
|
||||
|
||||
// TODO: 发送 MQ 事件 ThresholdConfigChangedEvent(一期预留)
|
||||
// thresholdEventPublisher.publish(entity);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorDeviceGateway;
|
||||
import com.zcloud.domain.model.SensorDeviceE;
|
||||
import com.zcloud.dto.SensorDeviceUpdateCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorDeviceUpdateExe - 传感器设备执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorDeviceUpdateExe {
|
||||
|
||||
private final SensorDeviceGateway sensorDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(SensorDeviceUpdateCmd cmd) {
|
||||
SensorDeviceE entity = new SensorDeviceE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
|
||||
boolean res = sensorDeviceGateway.update(entity);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorTypeGateway;
|
||||
import com.zcloud.domain.model.SensorTypeE;
|
||||
import com.zcloud.dto.SensorTypeAddCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorTypeAddExe - 传感器类型执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorTypeAddExe {
|
||||
|
||||
private final SensorTypeGateway sensorTypeGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(SensorTypeAddCmd cmd) {
|
||||
SensorTypeE entity = new SensorTypeE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
entity.setSensorTypeId(UuidUtil.get32UUID());
|
||||
// 设置默认值
|
||||
entity.setDeleteEnum("FALSE");
|
||||
|
||||
Long res = sensorTypeGateway.add(entity);
|
||||
if (Tools.isEmpty(res)) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorTypeGateway;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorTypeRemoveExe - 传感器类型执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorTypeRemoveExe {
|
||||
|
||||
private final SensorTypeGateway sensorTypeGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
// TODO: 检查是否有传感器设备引用该类型(T7 SensorDevice 完成后补充)
|
||||
// LambdaQueryWrapper<SensorDeviceDO> deviceWrapper = new LambdaQueryWrapper<>();
|
||||
// deviceWrapper.eq(SensorDeviceDO::getSensorTypeId, sensorType.getSensorTypeId())
|
||||
// .eq(SensorDeviceDO::getDeleteEnum, "FALSE");
|
||||
// if (sensorDeviceGateway.exists(deviceWrapper)) {
|
||||
// throw new BizException("该类型已被传感器使用,不可删除");
|
||||
// }
|
||||
|
||||
boolean res = sensorTypeGateway.deleteById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.SensorTypeGateway;
|
||||
import com.zcloud.domain.model.SensorTypeE;
|
||||
import com.zcloud.dto.SensorTypeUpdateCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* SensorTypeUpdateExe - 传感器类型执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class SensorTypeUpdateExe {
|
||||
|
||||
private final SensorTypeGateway sensorTypeGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(SensorTypeUpdateCmd cmd) {
|
||||
SensorTypeE entity = new SensorTypeE();
|
||||
BeanUtils.copyProperties(cmd, entity);
|
||||
|
||||
boolean res = sensorTypeGateway.update(entity);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.domain.gateway.RegionSensorRelGateway;
|
||||
import com.zcloud.domain.model.RegionSensorRelE;
|
||||
import com.zcloud.dto.UnbindSensorCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* UnbindSensorExe - 解绑传感器执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class UnbindSensorExe {
|
||||
|
||||
private final RegionSensorRelGateway regionSensorRelGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(UnbindSensorCmd cmd) {
|
||||
// 检查传感器是否已绑定
|
||||
RegionSensorRelE rel = regionSensorRelGateway.getBySensorId(cmd.getSensorId());
|
||||
if (Tools.isEmpty(rel)) {
|
||||
throw new BizException("该传感器未绑定到任何区域");
|
||||
}
|
||||
|
||||
Boolean res = regionSensorRelGateway.deleteBySensorId(cmd.getSensorId());
|
||||
if (!res) {
|
||||
throw new BizException("解绑失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.zcloud.command.convertor;
|
||||
|
||||
import com.zcloud.dto.clientobject.RiskPointCo;
|
||||
import com.zcloud.persistence.dataobject.RiskPointDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface RiskPointCoConvertor {
|
||||
/**
|
||||
* @param riskPointE
|
||||
* @return
|
||||
*/
|
||||
List<RiskPointCo> converDOsToCOs(List<RiskPointDO> riskPointE);
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zcloud.dto.AlarmDisposePageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import com.zcloud.persistence.repository.AlarmRecordRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AlarmDisposeQueryExe - 报警处置执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AlarmDisposeQueryExe {
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
|
||||
public PageResponse<AlarmDisposeCO> execute(AlarmDisposePageQry qry) {
|
||||
LambdaQueryWrapper<AlarmRecordDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(qry.getTenantId()), AlarmRecordDO::getTenantId, qry.getTenantId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getOrgId()), AlarmRecordDO::getOrgId, qry.getOrgId())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getAlarmNo()), AlarmRecordDO::getAlarmNo, qry.getAlarmNo())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmSource()), AlarmRecordDO::getAlarmSource, qry.getAlarmSource())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getSensorCode()), AlarmRecordDO::getSensorCode, qry.getSensorCode())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getFireRegionId()), AlarmRecordDO::getFireRegionId, qry.getFireRegionId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getDepartmentId()), AlarmRecordDO::getDepartmentId, qry.getDepartmentId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getDisposeUserId()), AlarmRecordDO::getManagerId, qry.getDisposeUserId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmLevel()), AlarmRecordDO::getAlarmLevel, qry.getAlarmLevel())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmType()), AlarmRecordDO::getAlarmType, qry.getAlarmType())
|
||||
// 查询待研判(10)或待处置(20)的报警
|
||||
.in(AlarmRecordDO::getStatus, 10, 20)
|
||||
.eq(AlarmRecordDO::getActiveFlag, 1)
|
||||
.orderByDesc(AlarmRecordDO::getAlarmTime);
|
||||
|
||||
// 处理报警时间范围
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeStart())) {
|
||||
wrapper.ge(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeStart());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeEnd())) {
|
||||
wrapper.le(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeEnd());
|
||||
}
|
||||
|
||||
List<AlarmRecordDO> results = alarmRecordRepository.list(wrapper);
|
||||
int total = results.size();
|
||||
|
||||
// Convert to CO
|
||||
List<AlarmDisposeCO> alarmDisposeCOs = BeanUtil.copyToList(results, AlarmDisposeCO.class);
|
||||
|
||||
return PageResponse.of(alarmDisposeCOs, total, qry.getPageSize(), qry.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<AlarmDisposeCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.getById(id);
|
||||
if (d == null) {
|
||||
return SingleResponse.buildFailure("报警记录不存在");
|
||||
}
|
||||
|
||||
AlarmDisposeCO co = new AlarmDisposeCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zcloud.dto.AlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import com.zcloud.persistence.repository.AlarmRecordRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AlarmRecordQueryExe - 报警记录执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AlarmRecordQueryExe {
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
|
||||
public PageResponse<AlarmRecordCO> execute(AlarmRecordPageQry qry) {
|
||||
LambdaQueryWrapper<AlarmRecordDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(qry.getTenantId()), AlarmRecordDO::getTenantId, qry.getTenantId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getOrgId()), AlarmRecordDO::getOrgId, qry.getOrgId())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getAlarmNo()), AlarmRecordDO::getAlarmNo, qry.getAlarmNo())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmSource()), AlarmRecordDO::getAlarmSource, qry.getAlarmSource())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getSensorCode()), AlarmRecordDO::getSensorCode, qry.getSensorCode())
|
||||
// 支持按状态筛选(不指定则查询所有状态)
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getStatus()), AlarmRecordDO::getStatus, qry.getStatus())
|
||||
.eq(AlarmRecordDO::getDeleteEnum, "FALSE")
|
||||
.orderByDesc(AlarmRecordDO::getAlarmTime);
|
||||
|
||||
// 处理报警时间范围
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeStart())) {
|
||||
wrapper.ge(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeStart());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeEnd())) {
|
||||
wrapper.le(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeEnd());
|
||||
}
|
||||
|
||||
List<AlarmRecordDO> results = alarmRecordRepository.list(wrapper);
|
||||
int total = results.size();
|
||||
|
||||
// Convert to CO
|
||||
List<AlarmRecordCO> alarmRecordCOs = BeanUtil.copyToList(results, AlarmRecordCO.class);
|
||||
|
||||
return PageResponse.of(alarmRecordCOs, total, qry.getPageSize(), qry.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<AlarmRecordCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.getById(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
return SingleResponse.buildFailure("报警记录不存在");
|
||||
}
|
||||
|
||||
AlarmRecordCO co = new AlarmRecordCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import com.zcloud.persistence.repository.AlarmRecordRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AppAlarmDisposeQueryExe - APP报警处置执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AppAlarmDisposeQueryExe {
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
|
||||
/**
|
||||
* 手机端待处置列表(按当前用户过滤)
|
||||
*/
|
||||
public PageResponse<AlarmDisposeCO> execute(AppAlarmDisposePageQry qry) {
|
||||
LambdaQueryWrapper<AlarmRecordDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(qry.getTenantId()), AlarmRecordDO::getTenantId, qry.getTenantId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getOrgId()), AlarmRecordDO::getOrgId, qry.getOrgId())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getAlarmNo()), AlarmRecordDO::getAlarmNo, qry.getAlarmNo())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmSource()), AlarmRecordDO::getAlarmSource, qry.getAlarmSource())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getSensorCode()), AlarmRecordDO::getSensorCode, qry.getSensorCode())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getFireRegionId()), AlarmRecordDO::getFireRegionId, qry.getFireRegionId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmLevel()), AlarmRecordDO::getAlarmLevel, qry.getAlarmLevel())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmType()), AlarmRecordDO::getAlarmType, qry.getAlarmType())
|
||||
// 关键:按当前用户过滤(managerId = 当前用户ID)
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getCurrentUserId()), AlarmRecordDO::getManagerId, qry.getCurrentUserId())
|
||||
// 只查询待处置(20)状态的报警
|
||||
.eq(AlarmRecordDO::getStatus, 20)
|
||||
.eq(AlarmRecordDO::getActiveFlag, 1)
|
||||
.orderByDesc(AlarmRecordDO::getAlarmTime);
|
||||
|
||||
// 处理报警时间范围
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeStart())) {
|
||||
wrapper.ge(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeStart());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeEnd())) {
|
||||
wrapper.le(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeEnd());
|
||||
}
|
||||
|
||||
List<AlarmRecordDO> results = alarmRecordRepository.list(wrapper);
|
||||
int total = results.size();
|
||||
|
||||
// Convert to CO
|
||||
List<AlarmDisposeCO> alarmDisposeCOs = BeanUtil.copyToList(results, AlarmDisposeCO.class);
|
||||
|
||||
return PageResponse.of(alarmDisposeCOs, total, qry.getPageSize(), qry.getPageIndex());
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机端报警详情
|
||||
*/
|
||||
public SingleResponse<AlarmDisposeCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.getById(id);
|
||||
if (d == null) {
|
||||
return SingleResponse.buildFailure("报警记录不存在");
|
||||
}
|
||||
|
||||
AlarmDisposeCO co = new AlarmDisposeCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.dto.AppAlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import com.zcloud.persistence.dataobject.AlarmRecordDO;
|
||||
import com.zcloud.persistence.repository.AlarmRecordRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AppAlarmRecordQueryExe - APP报警记录执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AppAlarmRecordQueryExe {
|
||||
|
||||
private final AlarmRecordRepository alarmRecordRepository;
|
||||
|
||||
public PageResponse<AlarmRecordCO> execute(AppAlarmRecordPageQry qry) {
|
||||
LambdaQueryWrapper<AlarmRecordDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 按当前用户过滤(处置人ID)
|
||||
Long userId = AuthContext.getUserId();
|
||||
wrapper.eq(userId != null, AlarmRecordDO::getDisposeUserId, userId);
|
||||
// 支持按状态筛选(30已消警/40误报)
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(qry.getStatus()), AlarmRecordDO::getStatus, qry.getStatus())
|
||||
.eq(AlarmRecordDO::getDeleteEnum, "FALSE")
|
||||
.orderByDesc(AlarmRecordDO::getAlarmTime);
|
||||
|
||||
// 处理报警时间范围
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeStart())) {
|
||||
wrapper.ge(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeStart());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(qry.getAlarmTimeEnd())) {
|
||||
wrapper.le(AlarmRecordDO::getAlarmTime, qry.getAlarmTimeEnd());
|
||||
}
|
||||
|
||||
List<AlarmRecordDO> results = alarmRecordRepository.list(wrapper);
|
||||
int total = results.size();
|
||||
|
||||
// Convert to CO
|
||||
List<AlarmRecordCO> alarmRecordCOs = BeanUtil.copyToList(results, AlarmRecordCO.class);
|
||||
|
||||
return PageResponse.of(alarmRecordCOs, total, qry.getPageSize(), qry.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<AlarmRecordCO> getById(Long id) {
|
||||
AlarmRecordDO d = alarmRecordRepository.getById(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
return SingleResponse.buildFailure("报警记录不存在");
|
||||
}
|
||||
|
||||
// 验证是否为当前用户的记录
|
||||
Long userId = AuthContext.getUserId();
|
||||
if (userId != null && d.getDisposeUserId() != null && !userId.equals(d.getDisposeUserId())) {
|
||||
return SingleResponse.buildFailure("无权限查看该报警记录");
|
||||
}
|
||||
|
||||
AlarmRecordCO co = new AlarmRecordCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zcloud.dto.DeviceRegionPageQry;
|
||||
import com.zcloud.dto.clientobject.DeviceRegionCO;
|
||||
import com.zcloud.dto.clientobject.FireRegionCO;
|
||||
import com.zcloud.persistence.dataobject.DeviceRegionDO;
|
||||
import com.zcloud.persistence.repository.DeviceRegionRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DeviceRegionQueryExe - 设备区域执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceRegionQueryExe {
|
||||
|
||||
private final DeviceRegionRepository deviceRegionRepository;
|
||||
|
||||
public PageResponse<DeviceRegionCO> execute(DeviceRegionPageQry qry) {
|
||||
LambdaQueryWrapper<DeviceRegionDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(qry.getTenantId()), DeviceRegionDO::getTenantId, qry.getTenantId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getOrgId()), DeviceRegionDO::getOrgId, qry.getOrgId())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getFireRegionCode()), DeviceRegionDO::getFireRegionCode, qry.getFireRegionCode())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getDepartmentId()), DeviceRegionDO::getDepartmentId, qry.getDepartmentId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getManagerId()), DeviceRegionDO::getManagerId, qry.getManagerId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getStatus()), DeviceRegionDO::getStatus, qry.getStatus())
|
||||
.eq(DeviceRegionDO::getDeleteEnum, "FALSE")
|
||||
.orderByDesc(DeviceRegionDO::getCreateTime);
|
||||
|
||||
List<DeviceRegionDO> results = deviceRegionRepository.list(wrapper);
|
||||
int total = results.size();
|
||||
|
||||
// Convert to CO
|
||||
List<DeviceRegionCO> deviceRegionCOs = BeanUtil.copyToList(results, DeviceRegionCO.class);
|
||||
|
||||
return PageResponse.of(deviceRegionCOs, total, qry.getPageSize(), qry.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<DeviceRegionCO> getById(Long id) {
|
||||
DeviceRegionDO d = deviceRegionRepository.getById(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
return SingleResponse.buildFailure("记录不存在或已被删除");
|
||||
}
|
||||
|
||||
DeviceRegionCO co = new DeviceRegionCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
|
||||
public SingleResponse<FireRegionCO> fireRegionList(Long tenantId) {
|
||||
LambdaQueryWrapper<DeviceRegionDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(tenantId), DeviceRegionDO::getTenantId, tenantId)
|
||||
.eq(DeviceRegionDO::getDeleteEnum, "FALSE")
|
||||
.orderByDesc(DeviceRegionDO::getCreateTime);
|
||||
|
||||
List<DeviceRegionDO> results = deviceRegionRepository.list(wrapper);
|
||||
|
||||
// Convert to FireRegionCO
|
||||
List<FireRegionCO> fireRegionCOs = BeanUtil.copyToList(results, FireRegionCO.class);
|
||||
|
||||
return SingleResponse.of(fireRegionCOs.isEmpty() ? null : fireRegionCOs.get(0));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.command.convertor.RiskPointCoConvertor;
|
||||
import com.zcloud.dto.RiskPointPageQry;
|
||||
import com.zcloud.dto.clientobject.RiskPointCo;
|
||||
import com.zcloud.persistence.dataobject.RiskPointDO;
|
||||
import com.zcloud.persistence.repository.RiskPointRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 风险点新增执行器
|
||||
*
|
||||
* @author lin
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RiskPointQueryExe {
|
||||
private final RiskPointRepository riskPointRepository;
|
||||
private final RiskPointCoConvertor riskPointCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param riskPointPageQry
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<RiskPointCo> execute(RiskPointPageQry riskPointPageQry) {
|
||||
PageResponse<RiskPointDO> pageResponse = riskPointRepository.listRiskPointPage(riskPointPageQry.toHashMap());
|
||||
List<RiskPointCo> examCenterCOS = riskPointCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zcloud.dto.SensorDevicePageQry;
|
||||
import com.zcloud.dto.clientobject.SensorDeviceCO;
|
||||
import com.zcloud.persistence.dataobject.SensorDeviceDO;
|
||||
import com.zcloud.persistence.repository.SensorDeviceRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* SensorDeviceQueryExe - 传感器设备执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SensorDeviceQueryExe {
|
||||
|
||||
private final SensorDeviceRepository sensorDeviceRepository;
|
||||
|
||||
public PageResponse<SensorDeviceCO> execute(SensorDevicePageQry qry) {
|
||||
LambdaQueryWrapper<SensorDeviceDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(qry.getTenantId()), SensorDeviceDO::getTenantId, qry.getTenantId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getOrgId()), SensorDeviceDO::getOrgId, qry.getOrgId())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getSensorCode()), SensorDeviceDO::getSensorCode, qry.getSensorCode())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getSensorName()), SensorDeviceDO::getSensorName, qry.getSensorName())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getSensorTypeId()), SensorDeviceDO::getSensorTypeId, qry.getSensorTypeId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getSensorAttr()), SensorDeviceDO::getSensorAttr, qry.getSensorAttr())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getSensorStatus()), SensorDeviceDO::getSensorStatus, qry.getSensorStatus())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getAlarmSwitch()), SensorDeviceDO::getAlarmSwitch, qry.getAlarmSwitch())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getThresholdFlag()), SensorDeviceDO::getThresholdFlag, qry.getThresholdFlag())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getInstallPosition()), SensorDeviceDO::getInstallPosition, qry.getInstallPosition())
|
||||
.eq(SensorDeviceDO::getDeleteEnum, "FALSE")
|
||||
.orderByDesc(SensorDeviceDO::getCreateTime);
|
||||
|
||||
List<SensorDeviceDO> results = sensorDeviceRepository.list(wrapper);
|
||||
int total = results.size();
|
||||
|
||||
// Convert to CO
|
||||
List<SensorDeviceCO> sensorDeviceCOs = BeanUtil.copyToList(results, SensorDeviceCO.class);
|
||||
|
||||
return PageResponse.of(sensorDeviceCOs, total, qry.getPageSize(), qry.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<SensorDeviceCO> getById(Long id) {
|
||||
SensorDeviceDO d = sensorDeviceRepository.getById(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
return SingleResponse.buildFailure("记录不存在或已被删除");
|
||||
}
|
||||
|
||||
SensorDeviceCO co = new SensorDeviceCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.command.query;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zcloud.dto.SensorTypePageQry;
|
||||
import com.zcloud.dto.clientobject.SensorTypeCO;
|
||||
import com.zcloud.persistence.dataobject.SensorTypeDO;
|
||||
import com.zcloud.persistence.repository.SensorTypeRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* SensorTypeQueryExe - 传感器类型执行器
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SensorTypeQueryExe {
|
||||
|
||||
private final SensorTypeRepository sensorTypeRepository;
|
||||
|
||||
public PageResponse<SensorTypeCO> execute(SensorTypePageQry qry) {
|
||||
LambdaQueryWrapper<SensorTypeDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
wrapper.eq(ObjectUtil.isNotEmpty(qry.getTenantId()), SensorTypeDO::getTenantId, qry.getTenantId())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getOrgId()), SensorTypeDO::getOrgId, qry.getOrgId())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getTypeCode()), SensorTypeDO::getTypeCode, qry.getTypeCode())
|
||||
.like(ObjectUtil.isNotEmpty(qry.getTypeName()), SensorTypeDO::getTypeName, qry.getTypeName())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getSensorAttr()), SensorTypeDO::getSensorAttr, qry.getSensorAttr())
|
||||
.eq(ObjectUtil.isNotEmpty(qry.getStatus()), SensorTypeDO::getStatus, qry.getStatus())
|
||||
.eq(SensorTypeDO::getDeleteEnum, "FALSE")
|
||||
.orderByDesc(SensorTypeDO::getCreateTime);
|
||||
|
||||
List<SensorTypeDO> results = sensorTypeRepository.list(wrapper);
|
||||
int total = results.size();
|
||||
|
||||
// Convert to CO
|
||||
List<SensorTypeCO> sensorTypeCOs = BeanUtil.copyToList(results, SensorTypeCO.class);
|
||||
|
||||
return PageResponse.of(sensorTypeCOs, total, qry.getPageSize(), qry.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<SensorTypeCO> getById(Long id) {
|
||||
SensorTypeDO d = sensorTypeRepository.getById(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
return SingleResponse.buildFailure("记录不存在或已被删除");
|
||||
}
|
||||
|
||||
SensorTypeCO co = new SensorTypeCO();
|
||||
BeanUtils.copyProperties(d, co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.AlarmDisposeServiceI;
|
||||
import com.zcloud.command.AlarmDisposeAssignExe;
|
||||
import com.zcloud.command.AlarmDisposeBatchAssignExe;
|
||||
import com.zcloud.command.AlarmDisposeInvalidExe;
|
||||
import com.zcloud.command.AppAlarmDisposeSubmitExe;
|
||||
import com.zcloud.command.query.AlarmDisposeQueryExe;
|
||||
import com.zcloud.command.query.AppAlarmDisposeQueryExe;
|
||||
import com.zcloud.dto.AlarmDisposeAssignCmd;
|
||||
import com.zcloud.dto.AlarmDisposeBatchAssignCmd;
|
||||
import com.zcloud.dto.AlarmDisposeInvalidCmd;
|
||||
import com.zcloud.dto.AlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposeSubmitCmd;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AlarmDisposeServiceImpl implements AlarmDisposeServiceI {
|
||||
|
||||
private final AlarmDisposeAssignExe alarmDisposeAssignExe;
|
||||
private final AlarmDisposeBatchAssignExe alarmDisposeBatchAssignExe;
|
||||
private final AlarmDisposeInvalidExe alarmDisposeInvalidExe;
|
||||
private final AlarmDisposeQueryExe alarmDisposeQueryExe;
|
||||
private final AppAlarmDisposeQueryExe appAlarmDisposeQueryExe;
|
||||
private final AppAlarmDisposeSubmitExe appAlarmDisposeSubmitExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<AlarmDisposeCO> assignList(AlarmDisposePageQry qry) {
|
||||
return alarmDisposeQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse assign(AlarmDisposeAssignCmd cmd) {
|
||||
alarmDisposeAssignExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse batchAssign(AlarmDisposeBatchAssignCmd cmd) {
|
||||
alarmDisposeBatchAssignExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse invalid(AlarmDisposeInvalidCmd cmd) {
|
||||
alarmDisposeInvalidExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<AlarmDisposeCO> info(Long id) {
|
||||
return alarmDisposeQueryExe.getById(id);
|
||||
}
|
||||
|
||||
// ==================== 手机端接口实现 ====================
|
||||
|
||||
@Override
|
||||
public PageResponse<AlarmDisposeCO> appTodoList(AppAlarmDisposePageQry qry) {
|
||||
return appAlarmDisposeQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<AlarmDisposeCO> appInfo(Long id) {
|
||||
return appAlarmDisposeQueryExe.getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse appSubmit(AppAlarmDisposeSubmitCmd cmd) {
|
||||
appAlarmDisposeSubmitExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.jjb.saas.message.client.message.facede.MessageFacade;
|
||||
import com.jjb.saas.message.client.message.request.MessageSendCmd;
|
||||
import com.jjb.saas.message.client.message.request.MessageTargetCmd;
|
||||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* AlarmMessageService - 报警消息服务
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class AlarmMessageService {
|
||||
|
||||
@DubboReference
|
||||
private MessageFacade messageFacade;
|
||||
|
||||
@Value("${alarm.message.template.auto-push:}")
|
||||
private String autoPushTemplateCode;
|
||||
|
||||
@Value("${alarm.message.template.dispose-push:}")
|
||||
private String disposePushTemplateCode;
|
||||
|
||||
/**
|
||||
* 发送报警自动推送消息
|
||||
* @param alarmRecord 报警记录
|
||||
* @param managerId 区域负责人ID
|
||||
*/
|
||||
public void sendAutoPushMessage(AlarmRecordE alarmRecord, Long managerId) {
|
||||
if (alarmRecord == null || managerId == null) {
|
||||
log.warn("报警自动推送消息参数不完整,跳过发送");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
MessageSendCmd messageSendCmd = new MessageSendCmd();
|
||||
messageSendCmd.setBusinessId(UuidUtil.get32UUID());
|
||||
|
||||
MessageTargetCmd messageTargetCmd = new MessageTargetCmd();
|
||||
messageTargetCmd.setUserId(managerId);
|
||||
messageSendCmd.setTargetCmd(messageTargetCmd);
|
||||
|
||||
messageSendCmd.setSourceCode(autoPushTemplateCode);
|
||||
messageSendCmd.setNeedTokenEnum(false);
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("deviceSourceDesc", alarmRecord.getDeviceSourceDesc());
|
||||
params.put("alarmLevel", alarmRecord.getAlarmLevel());
|
||||
params.put("alarmTime", alarmRecord.getAlarmTime());
|
||||
params.put("alarmDesc", alarmRecord.getAlarmDesc());
|
||||
messageSendCmd.setParams(params);
|
||||
|
||||
messageFacade.send(messageSendCmd);
|
||||
log.info("报警自动推送消息发送成功,报警ID: {}, 接收人ID: {}", alarmRecord.getId(), managerId);
|
||||
} catch (Exception e) {
|
||||
log.error("报警自动推送消息发送失败,报警ID: {}, 接收人ID: {}, 错误: {}",
|
||||
alarmRecord.getId(), managerId, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送报警处置推送消息
|
||||
* @param alarmRecord 报警记录
|
||||
* @param disposeUserId 处置人ID
|
||||
*/
|
||||
public void sendDisposePushMessage(AlarmRecordE alarmRecord, Long disposeUserId) {
|
||||
if (alarmRecord == null || disposeUserId == null) {
|
||||
log.warn("报警处置推送消息参数不完整,跳过发送");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
MessageSendCmd messageSendCmd = new MessageSendCmd();
|
||||
messageSendCmd.setBusinessId(UuidUtil.get32UUID());
|
||||
|
||||
MessageTargetCmd messageTargetCmd = new MessageTargetCmd();
|
||||
messageTargetCmd.setUserId(disposeUserId);
|
||||
messageSendCmd.setTargetCmd(messageTargetCmd);
|
||||
|
||||
messageSendCmd.setSourceCode(disposePushTemplateCode);
|
||||
messageSendCmd.setNeedTokenEnum(false);
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("deviceSourceDesc", alarmRecord.getDeviceSourceDesc());
|
||||
params.put("alarmLevel", alarmRecord.getAlarmLevel());
|
||||
params.put("assignTime", alarmRecord.getAssignTime());
|
||||
params.put("disposeRemark", alarmRecord.getDisposeRemark());
|
||||
messageSendCmd.setParams(params);
|
||||
|
||||
messageFacade.send(messageSendCmd);
|
||||
log.info("报警处置推送消息发送成功,报警ID: {}, 接收人ID: {}", alarmRecord.getId(), disposeUserId);
|
||||
} catch (Exception e) {
|
||||
log.error("报警处置推送消息发送失败,报警ID: {}, 接收人ID: {}, 错误: {}",
|
||||
alarmRecord.getId(), disposeUserId, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.AlarmRecordServiceI;
|
||||
import com.zcloud.command.query.AlarmRecordQueryExe;
|
||||
import com.zcloud.command.query.AppAlarmRecordQueryExe;
|
||||
import com.zcloud.dto.AlarmRecordPageQry;
|
||||
import com.zcloud.dto.AppAlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AlarmRecordServiceImpl implements AlarmRecordServiceI {
|
||||
|
||||
private final AlarmRecordQueryExe alarmRecordQueryExe;
|
||||
private final AppAlarmRecordQueryExe appAlarmRecordQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<AlarmRecordCO> list(AlarmRecordPageQry qry) {
|
||||
return alarmRecordQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<AlarmRecordCO> info(Long id) {
|
||||
return alarmRecordQueryExe.getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<AlarmRecordCO> appList(AppAlarmRecordPageQry qry) {
|
||||
return appAlarmRecordQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<AlarmRecordCO> appInfo(Long id) {
|
||||
return appAlarmRecordQueryExe.getById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import com.zcloud.gbscommon.todolistmq.TodoListEventPusherUtil;
|
||||
import com.zcloud.gbscommon.todolistmq.event.TodoListAddEvent;
|
||||
import com.zcloud.gbscommon.todolistmq.event.TodoListDeleteEvent;
|
||||
import com.zcloud.gbscommon.todolistmq.event.TodoListCompleteEvent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* AlarmTodoService - 报警待办服务
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@RefreshScope
|
||||
public class AlarmTodoService {
|
||||
|
||||
private final TodoListEventPusherUtil todoListEventPusherUtil;
|
||||
|
||||
/**
|
||||
* 新增负责人待办(PC端)
|
||||
* @param alarmRecord 报警记录
|
||||
* @param managerId 负责人ID
|
||||
*/
|
||||
public void addManagerTodo(AlarmRecordE alarmRecord, Long managerId) {
|
||||
if (alarmRecord == null || managerId == null) {
|
||||
log.warn("新增负责人待办参数不完整,跳过发送");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TodoListAddEvent event = new TodoListAddEvent();
|
||||
event.setTitle("您有一条【IoT报警】待研判");
|
||||
event.setContent("设备来源:" + alarmRecord.getDeviceSourceDesc());
|
||||
event.setForeignKey(alarmRecord.getId()); // 报警主表ID
|
||||
event.setForeignSubsidiaryKey(alarmRecord.getId()); // 没有附表时为alarmId
|
||||
event.setReceiveUser(managerId);
|
||||
event.setPcFlag(1); // PC端待办
|
||||
event.setAppFlag(0); // APP端待办
|
||||
event.setOtherParams(new JSONObject());
|
||||
|
||||
todoListEventPusherUtil.sendMessageAddEvent(event);
|
||||
log.info("负责人待办发送成功,报警ID: {}, 负责人ID: {}", alarmRecord.getId(), managerId);
|
||||
} catch (Exception e) {
|
||||
log.error("负责人待办发送失败,报警ID: {}, 负责人ID: {}, 错误: {}",
|
||||
alarmRecord.getId(), managerId, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增处置人待办(APP端)
|
||||
* @param alarmRecord 报警记录
|
||||
* @param disposeUserId 处置人ID
|
||||
*/
|
||||
public void addDisposeTodo(AlarmRecordE alarmRecord, Long disposeUserId) {
|
||||
if (alarmRecord == null || disposeUserId == null) {
|
||||
log.warn("新增处置人待办参数不完整,跳过发送");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TodoListAddEvent event = new TodoListAddEvent();
|
||||
event.setTitle("您有一条【IoT报警】待处置");
|
||||
event.setContent("设备来源:" + alarmRecord.getDeviceSourceDesc());
|
||||
event.setForeignKey(alarmRecord.getId()); // 报警主表ID
|
||||
event.setForeignSubsidiaryKey(alarmRecord.getId()); // 没有附表时为alarmId
|
||||
event.setReceiveUser(disposeUserId);
|
||||
event.setPcFlag(0); // PC端待办
|
||||
event.setAppFlag(1); // APP端待办
|
||||
event.setOtherParams(new JSONObject());
|
||||
|
||||
todoListEventPusherUtil.sendMessageAddEvent(event);
|
||||
log.info("处置人待办发送成功,报警ID: {}, 处置人ID: {}", alarmRecord.getId(), disposeUserId);
|
||||
} catch (Exception e) {
|
||||
log.error("处置人待办发送失败,报警ID: {}, 处置人ID: {}, 错误: {}",
|
||||
alarmRecord.getId(), disposeUserId, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成待办
|
||||
* @param alarmId 报警主表ID
|
||||
*/
|
||||
public void completeTodo(Long alarmId) {
|
||||
if (alarmId == null) {
|
||||
log.warn("完成待办参数不完整,跳过发送");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TodoListCompleteEvent event = new TodoListCompleteEvent(alarmId, String.valueOf(alarmId));
|
||||
todoListEventPusherUtil.sendMessageCompleteEvent(event);
|
||||
log.info("待办完成发送成功,报警ID: {}", alarmId);
|
||||
} catch (Exception e) {
|
||||
log.error("待办完成发送失败,报警ID: {}, 错误: {}", alarmId, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除待办
|
||||
* @param alarmId 报警主表ID
|
||||
*/
|
||||
public void deleteTodo(Long alarmId) {
|
||||
if (alarmId == null) {
|
||||
log.warn("删除待办参数不完整,跳过发送");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TodoListDeleteEvent event = new TodoListDeleteEvent(alarmId, alarmId);
|
||||
todoListEventPusherUtil.sendMessageDeleteEvent(event);
|
||||
log.info("待办删除发送成功,报警ID: {}", alarmId);
|
||||
} catch (Exception e) {
|
||||
log.error("待办删除发送失败,报警ID: {}, 错误: {}", alarmId, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.DeviceRegionServiceI;
|
||||
import com.zcloud.command.DeviceRegionAddExe;
|
||||
import com.zcloud.command.DeviceRegionUpdateExe;
|
||||
import com.zcloud.command.DeviceRegionRemoveExe;
|
||||
import com.zcloud.command.BindSensorExe;
|
||||
import com.zcloud.command.UnbindSensorExe;
|
||||
import com.zcloud.command.ManagerExe;
|
||||
import com.zcloud.command.query.DeviceRegionQueryExe;
|
||||
import com.zcloud.dto.DeviceRegionAddCmd;
|
||||
import com.zcloud.dto.DeviceRegionPageQry;
|
||||
import com.zcloud.dto.BindSensorCmd;
|
||||
import com.zcloud.dto.UnbindSensorCmd;
|
||||
import com.zcloud.dto.ManagerCmd;
|
||||
import com.zcloud.dto.clientobject.DeviceRegionCO;
|
||||
import com.zcloud.dto.clientobject.FireRegionCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class DeviceRegionServiceImpl implements DeviceRegionServiceI {
|
||||
|
||||
private final DeviceRegionAddExe deviceRegionAddExe;
|
||||
private final DeviceRegionUpdateExe deviceRegionUpdateExe;
|
||||
private final DeviceRegionQueryExe deviceRegionQueryExe;
|
||||
private final DeviceRegionRemoveExe deviceRegionRemoveExe;
|
||||
private final BindSensorExe bindSensorExe;
|
||||
private final UnbindSensorExe unbindSensorExe;
|
||||
private final ManagerExe managerExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<DeviceRegionCO> listPage(DeviceRegionPageQry qry) {
|
||||
return deviceRegionQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<String> saveOrUpdate(DeviceRegionAddCmd cmd) {
|
||||
// 判断是新增还是修改
|
||||
if (cmd.getId() != null) {
|
||||
deviceRegionUpdateExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
} else {
|
||||
return deviceRegionAddExe.execute(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse bindSensor(BindSensorCmd cmd) {
|
||||
bindSensorExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse unbindSensor(UnbindSensorCmd cmd) {
|
||||
unbindSensorExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse manager(ManagerCmd cmd) {
|
||||
managerExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<FireRegionCO> fireRegionList(Long tenantId) {
|
||||
return deviceRegionQueryExe.fireRegionList(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
deviceRegionRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<DeviceRegionCO> info(Long id) {
|
||||
return deviceRegionQueryExe.getById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.RiskPointServiceI;
|
||||
import com.zcloud.command.RiskPointAddExe;
|
||||
import com.zcloud.command.RiskPointRemoveExe;
|
||||
import com.zcloud.command.RiskPointUpdateExe;
|
||||
import com.zcloud.command.query.RiskPointQueryExe;
|
||||
import com.zcloud.dto.RiskPointAddCmd;
|
||||
import com.zcloud.dto.RiskPointPageQry;
|
||||
import com.zcloud.dto.RiskPointUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.RiskPointCo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class RiskPointServiceImpl implements RiskPointServiceI {
|
||||
private final RiskPointAddExe riskPointAddExe;
|
||||
private final RiskPointUpdateExe riskPointUpdateExe;
|
||||
private final RiskPointRemoveExe riskPointRemoveExe;
|
||||
private final RiskPointQueryExe riskPointQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<RiskPointCo> listPage(RiskPointPageQry qry){
|
||||
|
||||
return riskPointQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(RiskPointAddCmd cmd) {
|
||||
|
||||
riskPointAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(RiskPointUpdateCmd riskPointUpdateCmd) {
|
||||
riskPointUpdateExe.execute(riskPointUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
riskPointRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBatch(Long[] ids) {
|
||||
riskPointRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.SensorDeviceServiceI;
|
||||
import com.zcloud.command.SensorDeviceRemoveExe;
|
||||
import com.zcloud.command.SensorDeviceStatusExe;
|
||||
import com.zcloud.command.SensorDeviceThresholdExe;
|
||||
import com.zcloud.command.SensorDeviceUpdateExe;
|
||||
import com.zcloud.command.query.SensorDeviceQueryExe;
|
||||
import com.zcloud.command.SensorDeviceAddExe;
|
||||
import com.zcloud.dto.SensorDeviceAddCmd;
|
||||
import com.zcloud.dto.SensorDevicePageQry;
|
||||
import com.zcloud.dto.SensorDeviceThresholdCmd;
|
||||
import com.zcloud.dto.SensorDeviceUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.SensorDeviceCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SensorDeviceServiceImpl implements SensorDeviceServiceI {
|
||||
|
||||
private final SensorDeviceAddExe sensorDeviceAddExe;
|
||||
private final SensorDeviceUpdateExe sensorDeviceUpdateExe;
|
||||
private final SensorDeviceQueryExe sensorDeviceQueryExe;
|
||||
private final SensorDeviceRemoveExe sensorDeviceRemoveExe;
|
||||
private final SensorDeviceStatusExe sensorDeviceStatusExe;
|
||||
private final SensorDeviceThresholdExe sensorDeviceThresholdExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<SensorDeviceCO> listPage(SensorDevicePageQry qry) {
|
||||
return sensorDeviceQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(SensorDeviceAddCmd cmd) {
|
||||
sensorDeviceAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(SensorDeviceUpdateCmd cmd) {
|
||||
sensorDeviceUpdateExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(Long id, String status) {
|
||||
sensorDeviceStatusExe.execute(id, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateThreshold(SensorDeviceThresholdCmd cmd) {
|
||||
sensorDeviceThresholdExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
sensorDeviceRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<SensorDeviceCO> info(Long id) {
|
||||
return sensorDeviceQueryExe.getById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.zcloud.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.api.SensorTypeServiceI;
|
||||
import com.zcloud.command.SensorTypeRemoveExe;
|
||||
import com.zcloud.command.SensorTypeUpdateExe;
|
||||
import com.zcloud.command.query.SensorTypeQueryExe;
|
||||
import com.zcloud.command.SensorTypeAddExe;
|
||||
import com.zcloud.dto.SensorTypeAddCmd;
|
||||
import com.zcloud.dto.SensorTypePageQry;
|
||||
import com.zcloud.dto.SensorTypeUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.SensorTypeCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SensorTypeServiceImpl implements SensorTypeServiceI {
|
||||
|
||||
private final SensorTypeAddExe sensorTypeAddExe;
|
||||
private final SensorTypeUpdateExe sensorTypeUpdateExe;
|
||||
private final SensorTypeQueryExe sensorTypeQueryExe;
|
||||
private final SensorTypeRemoveExe sensorTypeRemoveExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<SensorTypeCO> listPage(SensorTypePageQry qry) {
|
||||
return sensorTypeQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(SensorTypeAddCmd cmd) {
|
||||
sensorTypeAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(SensorTypeUpdateCmd cmd) {
|
||||
sensorTypeUpdateExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
sensorTypeRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<SensorTypeCO> info(Long id) {
|
||||
return sensorTypeQueryExe.getById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.zcloud.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.dto.AlarmDisposeAssignCmd;
|
||||
import com.zcloud.dto.AlarmDisposeBatchAssignCmd;
|
||||
import com.zcloud.dto.AlarmDisposeInvalidCmd;
|
||||
import com.zcloud.dto.AlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposePageQry;
|
||||
import com.zcloud.dto.AppAlarmDisposeSubmitCmd;
|
||||
import com.zcloud.dto.clientobject.AlarmDisposeCO;
|
||||
|
||||
/**
|
||||
* AlarmDisposeServiceI - 报警处置服务接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface AlarmDisposeServiceI {
|
||||
|
||||
/**
|
||||
* 待处置列表查询
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<AlarmDisposeCO> assignList(AlarmDisposePageQry qry);
|
||||
|
||||
/**
|
||||
* 单条处置分配
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse assign(AlarmDisposeAssignCmd cmd);
|
||||
|
||||
/**
|
||||
* 批量处置分配
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse batchAssign(AlarmDisposeBatchAssignCmd cmd);
|
||||
|
||||
/**
|
||||
* 无效报警处理
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse invalid(AlarmDisposeInvalidCmd cmd);
|
||||
|
||||
/**
|
||||
* 报警详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<AlarmDisposeCO> info(Long id);
|
||||
|
||||
// ==================== 手机端接口 ====================
|
||||
|
||||
/**
|
||||
* 手机端待处置列表(按当前用户过滤)
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<AlarmDisposeCO> appTodoList(AppAlarmDisposePageQry qry);
|
||||
|
||||
/**
|
||||
* 手机端报警详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<AlarmDisposeCO> appInfo(Long id);
|
||||
|
||||
/**
|
||||
* 手机端提交处置结果
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse appSubmit(AppAlarmDisposeSubmitCmd cmd);
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.zcloud.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.dto.AlarmRecordPageQry;
|
||||
import com.zcloud.dto.AppAlarmRecordPageQry;
|
||||
import com.zcloud.dto.clientobject.AlarmRecordCO;
|
||||
|
||||
/**
|
||||
* AlarmRecordServiceI - 报警记录服务接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface AlarmRecordServiceI {
|
||||
|
||||
/**
|
||||
* 报警记录列表查询
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<AlarmRecordCO> list(AlarmRecordPageQry qry);
|
||||
|
||||
/**
|
||||
* 报警详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<AlarmRecordCO> info(Long id);
|
||||
|
||||
/**
|
||||
* 手机端报警记录列表查询(按当前用户过滤)
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<AlarmRecordCO> appList(AppAlarmRecordPageQry qry);
|
||||
|
||||
/**
|
||||
* 手机端报警详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<AlarmRecordCO> appInfo(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package com.zcloud.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.dto.DeviceRegionAddCmd;
|
||||
import com.zcloud.dto.DeviceRegionUpdateCmd;
|
||||
import com.zcloud.dto.DeviceRegionPageQry;
|
||||
import com.zcloud.dto.BindSensorCmd;
|
||||
import com.zcloud.dto.UnbindSensorCmd;
|
||||
import com.zcloud.dto.ManagerCmd;
|
||||
import com.zcloud.dto.clientobject.DeviceRegionCO;
|
||||
import com.zcloud.dto.clientobject.FireRegionCO;
|
||||
|
||||
/**
|
||||
* DeviceRegionServiceI - 设备区域服务接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface DeviceRegionServiceI {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<DeviceRegionCO> listPage(DeviceRegionPageQry qry);
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<String> saveOrUpdate(DeviceRegionAddCmd cmd);
|
||||
|
||||
/**
|
||||
* 绑定传感器
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse bindSensor(BindSensorCmd cmd);
|
||||
|
||||
/**
|
||||
* 解绑传感器
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse unbindSensor(UnbindSensorCmd cmd);
|
||||
|
||||
/**
|
||||
* 负责人配置
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse manager(ManagerCmd cmd);
|
||||
|
||||
/**
|
||||
* 消防区域列表(连表查询)
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<FireRegionCO> fireRegionList(Long tenantId);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
void remove(Long id);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<DeviceRegionCO> info(Long id);
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.zcloud.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.dto.RiskPointAddCmd;
|
||||
import com.zcloud.dto.RiskPointPageQry;
|
||||
import com.zcloud.dto.RiskPointUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.RiskPointCo;
|
||||
|
||||
public interface RiskPointServiceI {
|
||||
PageResponse<RiskPointCo> listPage(RiskPointPageQry qry);
|
||||
SingleResponse<RiskPointCo> add(RiskPointAddCmd cmd);
|
||||
|
||||
void edit(RiskPointUpdateCmd riskPointUpdateCmd);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.zcloud.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.dto.SensorDeviceAddCmd;
|
||||
import com.zcloud.dto.SensorDevicePageQry;
|
||||
import com.zcloud.dto.SensorDeviceUpdateCmd;
|
||||
import com.zcloud.dto.SensorDeviceThresholdCmd;
|
||||
import com.zcloud.dto.clientobject.SensorDeviceCO;
|
||||
|
||||
/**
|
||||
* SensorDeviceServiceI - 传感器设备服务接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface SensorDeviceServiceI {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<SensorDeviceCO> listPage(SensorDevicePageQry qry);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<String> add(SensorDeviceAddCmd cmd);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param cmd
|
||||
*/
|
||||
void edit(SensorDeviceUpdateCmd cmd);
|
||||
|
||||
/**
|
||||
* 状态切换
|
||||
* @param id
|
||||
* @param status
|
||||
*/
|
||||
void updateStatus(Long id, String status);
|
||||
|
||||
/**
|
||||
* 阈值配置
|
||||
* @param cmd
|
||||
*/
|
||||
void updateThreshold(SensorDeviceThresholdCmd cmd);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
void remove(Long id);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<SensorDeviceCO> info(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.zcloud.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.dto.SensorTypeAddCmd;
|
||||
import com.zcloud.dto.SensorTypePageQry;
|
||||
import com.zcloud.dto.SensorTypeUpdateCmd;
|
||||
import com.zcloud.dto.clientobject.SensorTypeCO;
|
||||
|
||||
/**
|
||||
* SensorTypeServiceI - 传感器类型服务接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface SensorTypeServiceI {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<SensorTypeCO> listPage(SensorTypePageQry qry);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param cmd
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<String> add(SensorTypeAddCmd cmd);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param cmd
|
||||
*/
|
||||
void edit(SensorTypeUpdateCmd cmd);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
void remove(Long id);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SingleResponse<SensorTypeCO> info(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* AlarmDisposeAssignCmd - 报警处置命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmDisposeAssignCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "报警主键ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "处置人ID", name = "disposeUserId", required = true)
|
||||
private Long disposeUserId;
|
||||
|
||||
@ApiModelProperty(value = "报警级别", name = "alarmLevel")
|
||||
private String alarmLevel;
|
||||
|
||||
@ApiModelProperty(value = "报警类型", name = "alarmType")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID", name = "orgId")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AlarmDisposeBatchAssignCmd - 报警处置命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmDisposeBatchAssignCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "报警主键ID列表", name = "ids", required = true)
|
||||
private List<Long> ids;
|
||||
|
||||
@ApiModelProperty(value = "处置人ID", name = "disposeUserId", required = true)
|
||||
private Long disposeUserId;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID", name = "orgId")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* AlarmDisposeInvalidCmd - 报警处置命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmDisposeInvalidCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "报警主键ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "无效原因", name = "invalidReason")
|
||||
private String invalidReason;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID", name = "orgId")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* AlarmDisposePageQry - 报警处置查询
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class AlarmDisposePageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "报警编号")
|
||||
private String alarmNo;
|
||||
|
||||
@ApiModelProperty(value = "报警来源")
|
||||
private String alarmSource;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "处置人ID")
|
||||
private Long disposeUserId;
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty(value = "报警时间开始")
|
||||
private String alarmTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "报警时间结束")
|
||||
private String alarmTimeEnd;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* AlarmRecordPageQry - 报警记录查询
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class AlarmRecordPageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "报警编号")
|
||||
private String alarmNo;
|
||||
|
||||
@ApiModelProperty(value = "报警来源 THRESHOLD/DCS")
|
||||
private String alarmSource;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "当前状态 10待研判/20待处置/30已消警/40误报")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "报警时间开始")
|
||||
private String alarmTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "报警时间结束")
|
||||
private String alarmTimeEnd;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* AppAlarmDisposePageQry - APP报警处置查询
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class AppAlarmDisposePageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "报警编号")
|
||||
private String alarmNo;
|
||||
|
||||
@ApiModelProperty(value = "报警来源")
|
||||
private String alarmSource;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty(value = "报警时间开始")
|
||||
private String alarmTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "报警时间结束")
|
||||
private String alarmTimeEnd;
|
||||
|
||||
@ApiModelProperty(value = "当前用户ID(手机端自动填充)")
|
||||
private Long currentUserId;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* AppAlarmDisposeSubmitCmd - APP报警处置命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppAlarmDisposeSubmitCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "报警ID", name = "alarmId", required = true)
|
||||
private Long alarmId;
|
||||
|
||||
@ApiModelProperty(value = "处置结果(已消警/误报)", name = "disposeResult", required = true)
|
||||
private String disposeResult;
|
||||
|
||||
@ApiModelProperty(value = "处置说明", name = "disposeRemark")
|
||||
private String disposeRemark;
|
||||
|
||||
@ApiModelProperty(value = "图片地址(多个URL用逗号分隔)", name = "pictureUrls")
|
||||
private String pictureUrls;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID", name = "orgId")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* AppAlarmRecordPageQry - APP报警记录查询
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class AppAlarmRecordPageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "当前状态 30已消警/40误报")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "报警时间开始")
|
||||
private String alarmTimeStart;
|
||||
|
||||
@ApiModelProperty(value = "报警时间结束")
|
||||
private String alarmTimeEnd;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* BindSensorCmd - 绑定传感器命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BindSensorCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "区域配置主键ID", name = "regionConfigId", required = true)
|
||||
private Long regionConfigId;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域ID", name = "fireRegionId")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID", name = "sensorId", required = true)
|
||||
private Long sensorId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码快照", name = "sensorCode")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID", name = "orgId")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* DeviceRegionAddCmd - 设备区域命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeviceRegionAddCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键ID(修改时必填)", name = "id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域主键", name = "fireRegionId", required = true)
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域编码", name = "fireRegionCode")
|
||||
private String fireRegionCode;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID", name = "departmentId")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "负责人ID", name = "managerId")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "状态 1启用0停用", name = "status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID", name = "orgId")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* DeviceRegionPageQry - 设备区域查询
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class DeviceRegionPageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "消防区域编码")
|
||||
private String fireRegionCode;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "状态 1启用0停用")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* DeviceRegionUpdateCmd - 设备区域命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeviceRegionUpdateCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域编码", name = "fireRegionCode")
|
||||
private String fireRegionCode;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID", name = "departmentId")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "负责人ID", name = "managerId")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "状态 1启用0停用", name = "status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* ManagerCmd - 管理员命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ManagerCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "区域配置主键ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "负责人ID", name = "managerId", required = true)
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID", name = "departmentId")
|
||||
private Long departmentId;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lin
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RiskPointAddCmd extends Command {
|
||||
@ApiModelProperty(value = "风险点名字", name = "riskPointName", required = true)
|
||||
@NotEmpty(message = "风险点名字不能为空")
|
||||
private String riskPointName;
|
||||
// @ApiModelProperty(value = "部门Id", name = "deptId", required = true)
|
||||
// @NotEmpty
|
||||
// private String deptId;
|
||||
@NotEmpty(message = "部门名字不能为空")
|
||||
@ApiModelProperty(value = "部门名字", name = "deptName", required = true)
|
||||
private String deptName;
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class RiskPointPageQry extends PageQuery {
|
||||
@ApiModelProperty(value = "风险点名称")
|
||||
private String likeRiskPointName;
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String eqDeptName;
|
||||
|
||||
public Map<String, Object> toHashMap() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Class<?> clazz = this.getClass();
|
||||
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
map.put(field.getName(), field.get(this));
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Class<?> superClass = clazz.getSuperclass();
|
||||
if (superClass != null) {
|
||||
Field[] superFields = superClass.getDeclaredFields();
|
||||
for (Field field : superFields) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
map.put(field.getName(), field.get(this));
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lin
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RiskPointUpdateCmd extends Command {
|
||||
@ApiModelProperty(value = "风险点id", name = "id", required = true)
|
||||
@NotEmpty
|
||||
private String id;
|
||||
@ApiModelProperty(value = "风险点名字", name = "riskPointName", required = true)
|
||||
@NotEmpty
|
||||
private String riskPointName;
|
||||
|
||||
@NotEmpty
|
||||
@ApiModelProperty(value = "部门名字", name = "deptName", required = true)
|
||||
private String deptName;
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* SensorDeviceAddCmd - 传感器设备命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SensorDeviceAddCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "传感器编码", name = "sensorCode", required = true)
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "传感器名称", name = "sensorName", required = true)
|
||||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型主键ID", name = "sensorTypeId", required = true)
|
||||
private Long sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性快照(NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "安装位置", name = "installPosition")
|
||||
private String installPosition;
|
||||
|
||||
@ApiModelProperty(value = "传感器状态", name = "sensorStatus")
|
||||
private String sensorStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否定位(0否1是)", name = "positioningFlag")
|
||||
private Integer positioningFlag;
|
||||
|
||||
@ApiModelProperty(value = "报警开关(1开0关)", name = "alarmSwitch")
|
||||
private Integer alarmSwitch;
|
||||
|
||||
@ApiModelProperty(value = "是否阈值设定(0否1是)", name = "thresholdFlag")
|
||||
private Integer thresholdFlag;
|
||||
|
||||
@ApiModelProperty(value = "单位", name = "unitName")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "量程下限", name = "rangeMin")
|
||||
private String rangeMin;
|
||||
|
||||
@ApiModelProperty(value = "量程上限", name = "rangeMax")
|
||||
private String rangeMax;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
||||
private String thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
||||
private String thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
||||
private String thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
||||
private String thresholdHighHigh;
|
||||
|
||||
@ApiModelProperty(value = "连续报警确认次数(默认3次)", name = "continuousAlarmCount")
|
||||
private Integer continuousAlarmCount;
|
||||
|
||||
@ApiModelProperty(value = "出厂日期", name = "factoryDate")
|
||||
private String factoryDate;
|
||||
|
||||
@ApiModelProperty(value = "企业侧源编码", name = "enterpriseSourceCode")
|
||||
private String enterpriseSourceCode;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* SensorDevicePageQry - 传感器设备查询
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class SensorDevicePageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "传感器名称")
|
||||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型ID")
|
||||
private Long sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)")
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "传感器状态")
|
||||
private String sensorStatus;
|
||||
|
||||
@ApiModelProperty(value = "报警开关(1开0关)")
|
||||
private Integer alarmSwitch;
|
||||
|
||||
@ApiModelProperty(value = "是否阈值设定(0否1是)")
|
||||
private Integer thresholdFlag;
|
||||
|
||||
@ApiModelProperty(value = "安装位置")
|
||||
private String installPosition;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* SensorDeviceThresholdCmd - 传感器设备命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SensorDeviceThresholdCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "单位", name = "unitName")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "量程下限", name = "rangeMin")
|
||||
private String rangeMin;
|
||||
|
||||
@ApiModelProperty(value = "量程上限", name = "rangeMax")
|
||||
private String rangeMax;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
||||
private String thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
||||
private String thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
||||
private String thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
||||
private String thresholdHighHigh;
|
||||
|
||||
@ApiModelProperty(value = "连续报警确认次数", name = "continuousAlarmCount")
|
||||
private Integer continuousAlarmCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* SensorDeviceUpdateCmd - 传感器设备命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SensorDeviceUpdateCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码", name = "sensorCode")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "传感器名称", name = "sensorName")
|
||||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型主键ID", name = "sensorTypeId")
|
||||
private Long sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性快照(NUMBER/SWITCH)", name = "sensorAttr")
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "安装位置", name = "installPosition")
|
||||
private String installPosition;
|
||||
|
||||
@ApiModelProperty(value = "传感器状态", name = "sensorStatus")
|
||||
private String sensorStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否定位(0否1是)", name = "positioningFlag")
|
||||
private Integer positioningFlag;
|
||||
|
||||
@ApiModelProperty(value = "报警开关(1开0关)", name = "alarmSwitch")
|
||||
private Integer alarmSwitch;
|
||||
|
||||
@ApiModelProperty(value = "是否阈值设定(0否1是)", name = "thresholdFlag")
|
||||
private Integer thresholdFlag;
|
||||
|
||||
@ApiModelProperty(value = "单位", name = "unitName")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "量程下限", name = "rangeMin")
|
||||
private String rangeMin;
|
||||
|
||||
@ApiModelProperty(value = "量程上限", name = "rangeMax")
|
||||
private String rangeMax;
|
||||
|
||||
@ApiModelProperty(value = "连续报警确认次数(默认3次)", name = "continuousAlarmCount")
|
||||
private Integer continuousAlarmCount;
|
||||
|
||||
@ApiModelProperty(value = "出厂日期", name = "factoryDate")
|
||||
private String factoryDate;
|
||||
|
||||
@ApiModelProperty(value = "企业侧源编码", name = "enterpriseSourceCode")
|
||||
private String enterpriseSourceCode;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* SensorTypeAddCmd - 传感器类型命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SensorTypeAddCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "类型编码", name = "typeCode", required = true)
|
||||
private String typeCode;
|
||||
|
||||
@ApiModelProperty(value = "类型名称", name = "typeName", required = true)
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(STRING/NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "排序", name = "sortNo")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)", name = "status", required = true)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* SensorTypePageQry - 传感器类型查询
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class SensorTypePageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "类型编码")
|
||||
private String typeCode;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(STRING/NUMBER/SWITCH)")
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* SensorTypeUpdateCmd - 传感器类型命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SensorTypeUpdateCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键ID", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "类型编码", name = "typeCode", required = false)
|
||||
private String typeCode;
|
||||
|
||||
@ApiModelProperty(value = "类型名称", name = "typeName", required = false)
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(STRING/NUMBER/SWITCH)", name = "sensorAttr", required = false)
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "排序", name = "sortNo")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)", name = "status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.zcloud.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* UnbindSensorCmd - 解绑传感器命令
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UnbindSensorCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "传感器ID", name = "sensorId", required = true)
|
||||
private Long sensorId;
|
||||
|
||||
@ApiModelProperty(value = "租户ID", name = "tenantId")
|
||||
private Long tenantId;
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* AlarmDisposeCO - 报警处置客户端对象
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class AlarmDisposeCO extends ClientObject {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String alarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "报警编号(32位)")
|
||||
private String alarmNo;
|
||||
|
||||
@ApiModelProperty(value = "报警来源 THRESHOLD/DCS")
|
||||
private String alarmSource;
|
||||
|
||||
@ApiModelProperty(value = "设备来源描述快照")
|
||||
private String deviceSourceDesc;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID")
|
||||
private Long sensorId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "当前负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty(value = "阈值类型 HIGH/HIGH_HIGH/LOW/LOW_LOW")
|
||||
private String thresholdType;
|
||||
|
||||
@ApiModelProperty(value = "告警值")
|
||||
private BigDecimal currentValue;
|
||||
|
||||
@ApiModelProperty(value = "比较方向 UP/DOWN")
|
||||
private String compareFlag;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "报警描述")
|
||||
private String alarmDesc;
|
||||
|
||||
@ApiModelProperty(value = "报警时间")
|
||||
private String alarmTime;
|
||||
|
||||
@ApiModelProperty(value = "当前状态 10待研判/20待处置/30已消警/40误报")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "分配时间")
|
||||
private String assignTime;
|
||||
|
||||
@ApiModelProperty(value = "处置时间")
|
||||
private String disposeTime;
|
||||
|
||||
@ApiModelProperty(value = "处置人ID")
|
||||
private Long disposeUserId;
|
||||
|
||||
@ApiModelProperty(value = "当前处置结果快照")
|
||||
private String disposeResult;
|
||||
|
||||
@ApiModelProperty(value = "当前处置说明快照")
|
||||
private String disposeRemark;
|
||||
|
||||
@ApiModelProperty(value = "图片地址")
|
||||
private String pictureUrls;
|
||||
|
||||
@ApiModelProperty(value = "是否活跃告警")
|
||||
private Integer activeFlag;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private Long createId;
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人ID")
|
||||
private Long updateId;
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* AlarmRecordCO - 报警记录客户端对象
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class AlarmRecordCO extends ClientObject {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String alarmRecordId;
|
||||
|
||||
@ApiModelProperty(value = "报警编号(32位)")
|
||||
private String alarmNo;
|
||||
|
||||
@ApiModelProperty(value = "报警来源 THRESHOLD/DCS")
|
||||
private String alarmSource;
|
||||
|
||||
@ApiModelProperty(value = "设备来源描述快照")
|
||||
private String deviceSourceDesc;
|
||||
|
||||
@ApiModelProperty(value = "传感器ID")
|
||||
private Long sensorId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "消防区域ID")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "当前负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "报警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty(value = "阈值类型 HIGH/HIGH_HIGH/LOW/LOW_LOW")
|
||||
private String thresholdType;
|
||||
|
||||
@ApiModelProperty(value = "告警值")
|
||||
private BigDecimal currentValue;
|
||||
|
||||
@ApiModelProperty(value = "比较方向 UP/DOWN")
|
||||
private String compareFlag;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "报警描述")
|
||||
private String alarmDesc;
|
||||
|
||||
@ApiModelProperty(value = "报警时间")
|
||||
private String alarmTime;
|
||||
|
||||
@ApiModelProperty(value = "当前状态 10待研判/20待处置/30已消警/40误报")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "分配时间")
|
||||
private String assignTime;
|
||||
|
||||
@ApiModelProperty(value = "处置时间")
|
||||
private String disposeTime;
|
||||
|
||||
@ApiModelProperty(value = "处置人ID")
|
||||
private Long disposeUserId;
|
||||
|
||||
@ApiModelProperty(value = "当前处置结果快照")
|
||||
private String disposeResult;
|
||||
|
||||
@ApiModelProperty(value = "当前处置说明快照")
|
||||
private String disposeRemark;
|
||||
|
||||
@ApiModelProperty(value = "图片地址")
|
||||
private String pictureUrls;
|
||||
|
||||
@ApiModelProperty(value = "外部记录唯一键")
|
||||
private String sourceRecordKey;
|
||||
|
||||
@ApiModelProperty(value = "是否活跃告警")
|
||||
private Integer activeFlag;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private Long createId;
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人ID")
|
||||
private Long updateId;
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* DeviceRegionCO - 设备区域客户端对象
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class DeviceRegionCO extends ClientObject {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String regionConfigId;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域主键")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域编码")
|
||||
private String fireRegionCode;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "状态 1启用0停用")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private Long createId;
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人ID")
|
||||
private Long updateId;
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* FireRegionCO - 火灾区域客户端对象
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class FireRegionCO extends ClientObject {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "业务ID(32位)")
|
||||
private String regionConfigId;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域主键")
|
||||
private Long fireRegionId;
|
||||
|
||||
@ApiModelProperty(value = "外部消防区域编码")
|
||||
private String fireRegionCode;
|
||||
|
||||
@ApiModelProperty(value = "负责部门ID")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "负责人ID")
|
||||
private Long managerId;
|
||||
|
||||
@ApiModelProperty(value = "状态 1启用0停用")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RiskPointCo extends ClientObject {
|
||||
@ApiModelProperty(value = "id")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "风险点名称")
|
||||
private String riskPointName;
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createName;
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* SensorDeviceCO - 传感器设备客户端对象
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class SensorDeviceCO extends ClientObject {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "传感器设备业务ID")
|
||||
private String sensorDeviceId;
|
||||
|
||||
@ApiModelProperty(value = "传感器编码")
|
||||
private String sensorCode;
|
||||
|
||||
@ApiModelProperty(value = "传感器名称")
|
||||
private String sensorName;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型主键ID")
|
||||
private Long sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性快照(NUMBER/SWITCH)")
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "安装位置")
|
||||
private String installPosition;
|
||||
|
||||
@ApiModelProperty(value = "传感器状态")
|
||||
private String sensorStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否定位(0否1是)")
|
||||
private Integer positioningFlag;
|
||||
|
||||
@ApiModelProperty(value = "报警开关(1开0关)")
|
||||
private Integer alarmSwitch;
|
||||
|
||||
@ApiModelProperty(value = "是否阈值设定(0否1是)")
|
||||
private Integer thresholdFlag;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "量程下限")
|
||||
private String rangeMin;
|
||||
|
||||
@ApiModelProperty(value = "量程上限")
|
||||
private String rangeMax;
|
||||
|
||||
@ApiModelProperty(value = "低低报阈值")
|
||||
private String thresholdLowLow;
|
||||
|
||||
@ApiModelProperty(value = "低报阈值")
|
||||
private String thresholdLow;
|
||||
|
||||
@ApiModelProperty(value = "高报阈值")
|
||||
private String thresholdHigh;
|
||||
|
||||
@ApiModelProperty(value = "高高报阈值")
|
||||
private String thresholdHighHigh;
|
||||
|
||||
@ApiModelProperty(value = "连续报警确认次数")
|
||||
private Integer continuousAlarmCount;
|
||||
|
||||
@ApiModelProperty(value = "出厂日期")
|
||||
private String factoryDate;
|
||||
|
||||
@ApiModelProperty(value = "企业侧源编码")
|
||||
private String enterpriseSourceCode;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private Long createId;
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人ID")
|
||||
private Long updateId;
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.zcloud.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* SensorTypeCO - 传感器类型客户端对象
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
public class SensorTypeCO extends ClientObject {
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "传感器类型业务ID")
|
||||
private String sensorTypeId;
|
||||
|
||||
@ApiModelProperty(value = "类型编码")
|
||||
private String typeCode;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "传感器属性(STRING/NUMBER/SWITCH)")
|
||||
private String sensorAttr;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "状态(1:启用 0:停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "创建人ID")
|
||||
private Long createId;
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人ID")
|
||||
private Long updateId;
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
@ApiModelProperty(value = "组织ID")
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.zcloud.domain.gateway;
|
||||
|
||||
import com.zcloud.domain.model.AlarmDisposeLogE;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AlarmDisposeLogGateway - 报警处置日志网关接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface AlarmDisposeLogGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long add(AlarmDisposeLogE alarmDisposeLogE);
|
||||
|
||||
/**
|
||||
* 根据ID获取
|
||||
*/
|
||||
AlarmDisposeLogE getById(Long id);
|
||||
|
||||
/**
|
||||
* 根据报警ID获取处置日志列表
|
||||
*/
|
||||
List<AlarmDisposeLogE> listByAlarmId(Long alarmId);
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.zcloud.domain.gateway;
|
||||
|
||||
import com.zcloud.domain.model.AlarmRecordE;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AlarmRecordGateway - 报警记录网关接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface AlarmRecordGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long add(AlarmRecordE alarmRecordE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(AlarmRecordE alarmRecordE);
|
||||
|
||||
/**
|
||||
* 根据ID获取
|
||||
*/
|
||||
AlarmRecordE getById(Long id);
|
||||
|
||||
/**
|
||||
* 根据报警编号获取
|
||||
*/
|
||||
AlarmRecordE getByAlarmNo(String alarmNo);
|
||||
|
||||
/**
|
||||
* 根据租户ID获取所有报警记录
|
||||
*/
|
||||
List<AlarmRecordE> listByTenantId(Long tenantId);
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
Boolean updateStatus(Long id, Integer status, String assignTime);
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.zcloud.domain.gateway;
|
||||
|
||||
import com.zcloud.domain.model.DeviceRegionE;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DeviceRegionGateway - 设备区域网关接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface DeviceRegionGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long add(DeviceRegionE deviceRegionE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(DeviceRegionE deviceRegionE);
|
||||
|
||||
/**
|
||||
* 根据ID删除(软删除)
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据ID获取
|
||||
*/
|
||||
DeviceRegionE getById(Long id);
|
||||
|
||||
/**
|
||||
* 根据消防区域ID获取
|
||||
*/
|
||||
DeviceRegionE getByFireRegionId(Long fireRegionId);
|
||||
|
||||
/**
|
||||
* 根据租户ID获取所有区域配置
|
||||
*/
|
||||
List<DeviceRegionE> listByTenantId(Long tenantId);
|
||||
|
||||
/**
|
||||
* 更新负责人
|
||||
*/
|
||||
Boolean updateManager(Long id, Long managerId, Long departmentId);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.zcloud.domain.gateway;
|
||||
|
||||
import com.zcloud.domain.model.RegionSensorRelE;
|
||||
|
||||
/**
|
||||
* RegionSensorRelGateway - 区域传感器关系网关接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface RegionSensorRelGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long add(RegionSensorRelE regionSensorRelE);
|
||||
|
||||
/**
|
||||
* 根据传感器ID删除(软删除)
|
||||
*/
|
||||
Boolean deleteBySensorId(Long sensorId);
|
||||
|
||||
/**
|
||||
* 根据传感器ID获取
|
||||
*/
|
||||
RegionSensorRelE getBySensorId(Long sensorId);
|
||||
|
||||
/**
|
||||
* 检查传感器是否已绑定
|
||||
*/
|
||||
Boolean isSensorBound(Long sensorId);
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package com.zcloud.domain.gateway;
|
||||
|
||||
|
||||
import com.zcloud.domain.model.RiskPointE;
|
||||
|
||||
/**
|
||||
* 领域getway
|
||||
* @author lin
|
||||
*/
|
||||
public interface RiskPointGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param riskPointE 准考证管理
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean add(RiskPointE riskPointE) ;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param riskPointE 准考证管理
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean update(RiskPointE riskPointE);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean deletedRiskPointById(Long id);
|
||||
Boolean deletedRiskPointByIds(Long[] id);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.zcloud.domain.gateway;
|
||||
|
||||
import com.zcloud.domain.model.SensorDeviceE;
|
||||
|
||||
/**
|
||||
* SensorDeviceGateway - 传感器设备网关接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface SensorDeviceGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long add(SensorDeviceE sensorDeviceE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(SensorDeviceE sensorDeviceE);
|
||||
|
||||
/**
|
||||
* 根据ID删除(软删除)
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据ID获取
|
||||
*/
|
||||
SensorDeviceE getById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.zcloud.domain.gateway;
|
||||
|
||||
import com.zcloud.domain.model.SensorTypeE;
|
||||
|
||||
/**
|
||||
* SensorTypeGateway - 传感器类型网关接口
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
public interface SensorTypeGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long add(SensorTypeE sensorTypeE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(SensorTypeE sensorTypeE);
|
||||
|
||||
/**
|
||||
* 根据ID删除(软删除)
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据ID获取
|
||||
*/
|
||||
SensorTypeE getById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.zcloud.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* AlarmDisposeLogE - 报警处置日志实体
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmDisposeLogE extends BaseE {
|
||||
|
||||
/**
|
||||
* 业务ID(32位)
|
||||
*/
|
||||
private String alarmDisposalLogId;
|
||||
|
||||
/**
|
||||
* 报警主键ID
|
||||
*/
|
||||
private Long alarmId;
|
||||
|
||||
/**
|
||||
* 报警编号(32位)
|
||||
*/
|
||||
private String alarmNo;
|
||||
|
||||
/**
|
||||
* 操作类型 AUTO_ASSIGN/MANUAL_ASSIGN/DISPOSE/INVALID
|
||||
*/
|
||||
private String actionType;
|
||||
|
||||
/**
|
||||
* 变更前状态
|
||||
*/
|
||||
private Integer beforeStatus;
|
||||
|
||||
/**
|
||||
* 变更后状态
|
||||
*/
|
||||
private Integer afterStatus;
|
||||
|
||||
/**
|
||||
* 操作人ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 操作说明
|
||||
*/
|
||||
private String actionDesc;
|
||||
|
||||
/**
|
||||
* 处置结果
|
||||
*/
|
||||
private String resultText;
|
||||
|
||||
/**
|
||||
* 附件图片
|
||||
*/
|
||||
private String pictureUrls;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private String actionTime;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private String deleteEnum;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 组织ID
|
||||
*/
|
||||
private Long orgId;
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
package com.zcloud.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* AlarmRecordE - 报警记录实体
|
||||
* @Author wangyan
|
||||
* @Date 2026-04-03 00:00:00
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AlarmRecordE extends BaseE {
|
||||
|
||||
/**
|
||||
* 业务ID(32位)
|
||||
*/
|
||||
private String alarmRecordId;
|
||||
|
||||
/**
|
||||
* 报警编号(32位)
|
||||
*/
|
||||
private String alarmNo;
|
||||
|
||||
/**
|
||||
* 报警来源 THRESHOLD/DCS
|
||||
*/
|
||||
private String alarmSource;
|
||||
|
||||
/**
|
||||
* 设备来源描述快照
|
||||
*/
|
||||
private String deviceSourceDesc;
|
||||
|
||||
/**
|
||||
* 传感器ID
|
||||
*/
|
||||
private Long sensorId;
|
||||
|
||||
/**
|
||||
* 传感器编码
|
||||
*/
|
||||
private String sensorCode;
|
||||
|
||||
/**
|
||||
* 消防区域ID
|
||||
*/
|
||||
private Long fireRegionId;
|
||||
|
||||
/**
|
||||
* 负责部门ID
|
||||
*/
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
* 当前负责人ID
|
||||
*/
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
* 报警级别
|
||||
*/
|
||||
private String alarmLevel;
|
||||
|
||||
/**
|
||||
* 报警类型
|
||||
*/
|
||||
private String alarmType;
|
||||
|
||||
/**
|
||||
* 阈值类型 HIGH/HIGH_HIGH/LOW/LOW_LOW
|
||||
*/
|
||||
private String thresholdType;
|
||||
|
||||
/**
|
||||
* 告警值
|
||||
*/
|
||||
private BigDecimal currentValue;
|
||||
|
||||
/**
|
||||
* 比较方向 UP/DOWN
|
||||
*/
|
||||
private String compareFlag;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 报警描述
|
||||
*/
|
||||
private String alarmDesc;
|
||||
|
||||
/**
|
||||
* 报警时间
|
||||
*/
|
||||
private String alarmTime;
|
||||
|
||||
/**
|
||||
* 当前状态 10待研判/20待处置/30已消警/40误报
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
private String assignTime;
|
||||
|
||||
/**
|
||||
* 处置时间
|
||||
*/
|
||||
private String disposeTime;
|
||||
|
||||
/**
|
||||
* 处置人ID
|
||||
*/
|
||||
private Long disposeUserId;
|
||||
|
||||
/**
|
||||
* 当前处置结果快照
|
||||
*/
|
||||
private String disposeResult;
|
||||
|
||||
/**
|
||||
* 当前处置说明快照
|
||||
*/
|
||||
private String disposeRemark;
|
||||
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String pictureUrls;
|
||||
|
||||
/**
|
||||
* 外部记录唯一键
|
||||
*/
|
||||
private String sourceRecordKey;
|
||||
|
||||
/**
|
||||
* 是否活跃告警
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private String deleteEnum;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 组织ID
|
||||
*/
|
||||
private Long orgId;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue