传感器类型管理功能重构
parent
730657c0ef
commit
a0b140ae8f
|
|
@ -2,6 +2,7 @@ package com.zcloud.web;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.jjb.saas.framework.sdk.http.annotation.request.Post;
|
||||||
import com.zcloud.api.SensorTypeServiceI;
|
import com.zcloud.api.SensorTypeServiceI;
|
||||||
import com.zcloud.dto.SensorTypeAddCmd;
|
import com.zcloud.dto.SensorTypeAddCmd;
|
||||||
import com.zcloud.dto.SensorTypePageQry;
|
import com.zcloud.dto.SensorTypePageQry;
|
||||||
|
|
@ -41,7 +42,7 @@ public class SensorTypeController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改")
|
@ApiOperation("修改")
|
||||||
@PutMapping("/edit")
|
@PostMapping("/edit")
|
||||||
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-edit')")
|
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-edit')")
|
||||||
public SingleResponse edit(@Validated @RequestBody SensorTypeUpdateCmd cmd) {
|
public SingleResponse edit(@Validated @RequestBody SensorTypeUpdateCmd cmd) {
|
||||||
sensorTypeService.edit(cmd);
|
sensorTypeService.edit(cmd);
|
||||||
|
|
@ -49,7 +50,7 @@ public class SensorTypeController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除")
|
@ApiOperation("删除")
|
||||||
@DeleteMapping("/{id}")
|
@PostMapping("/{id}")
|
||||||
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-delete')")
|
// @PreAuthorize("@pms.hasAnyPermission('iotalarm-sensortype-delete')")
|
||||||
public SingleResponse remove(@PathVariable("id") Long id) {
|
public SingleResponse remove(@PathVariable("id") Long id) {
|
||||||
sensorTypeService.remove(id);
|
sensorTypeService.remove(id);
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,6 @@ public class SensorTypeAddExe {
|
||||||
SensorTypeE entity = new SensorTypeE();
|
SensorTypeE entity = new SensorTypeE();
|
||||||
BeanUtils.copyProperties(cmd, entity);
|
BeanUtils.copyProperties(cmd, entity);
|
||||||
entity.setSensorTypeId(UuidUtil.get32UUID());
|
entity.setSensorTypeId(UuidUtil.get32UUID());
|
||||||
// 设置默认值
|
|
||||||
entity.setDeleteEnum("FALSE");
|
|
||||||
|
|
||||||
Long res = sensorTypeGateway.add(entity);
|
Long res = sensorTypeGateway.add(entity);
|
||||||
if (Tools.isEmpty(res)) {
|
if (Tools.isEmpty(res)) {
|
||||||
throw new BizException("保存失败");
|
throw new BizException("保存失败");
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -18,31 +20,43 @@ import java.math.BigDecimal;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SensorTypeAddCmd extends Command {
|
public class SensorTypeAddCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型编码", name = "typeCode", required = true)
|
|
||||||
private String typeCode;
|
@ApiModelProperty(value = "传感器类型业务ID")
|
||||||
|
private String sensorTypeId;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型名称", name = "typeName", required = true)
|
@ApiModelProperty(value = "类型名称", name = "typeName", required = true)
|
||||||
|
@NotEmpty(message = "传感器属性不能为空")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
||||||
|
@NotEmpty(message = "传感器属性不能为空")
|
||||||
private String sensorAttr;
|
private String sensorAttr;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注", name = "remarks")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "环境", name = "env")
|
|
||||||
private String env;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
||||||
private BigDecimal thresholdLowLow;
|
private BigDecimal thresholdLowLow;
|
||||||
|
|
||||||
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
||||||
private BigDecimal thresholdLow;
|
private BigDecimal thresholdLow;
|
||||||
|
|
||||||
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
||||||
private BigDecimal thresholdHigh;
|
private BigDecimal thresholdHigh;
|
||||||
|
|
||||||
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
||||||
private BigDecimal thresholdHighHigh;
|
private BigDecimal thresholdHighHigh;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "量程上限")
|
||||||
|
private BigDecimal rangeMax;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "量程下限")
|
||||||
|
private BigDecimal rangeMin;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -18,34 +20,43 @@ import java.math.BigDecimal;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SensorTypeUpdateCmd extends Command {
|
public class SensorTypeUpdateCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键ID", name = "id", required = true)
|
@ApiModelProperty(value = "主键ID", name = "id", required = true)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型编码", name = "typeCode", required = false)
|
@ApiModelProperty(value = "传感器类型业务ID")
|
||||||
private String typeCode;
|
private String sensorTypeId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型名称", name = "typeName", required = false)
|
|
||||||
|
@ApiModelProperty(value = "类型名称", name = "typeName", required = true)
|
||||||
|
@NotEmpty(message = "传感器属性不能为空")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)", name = "sensorAttr", required = false)
|
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)", name = "sensorAttr", required = true)
|
||||||
|
@NotEmpty(message = "传感器属性不能为空")
|
||||||
private String sensorAttr;
|
private String sensorAttr;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注", name = "remarks")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "环境", name = "env")
|
|
||||||
private String env;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
@ApiModelProperty(value = "低低报阈值", name = "thresholdLowLow")
|
||||||
private BigDecimal thresholdLowLow;
|
private BigDecimal thresholdLowLow;
|
||||||
|
|
||||||
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
@ApiModelProperty(value = "低报阈值", name = "thresholdLow")
|
||||||
private BigDecimal thresholdLow;
|
private BigDecimal thresholdLow;
|
||||||
|
|
||||||
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
@ApiModelProperty(value = "高报阈值", name = "thresholdHigh")
|
||||||
private BigDecimal thresholdHigh;
|
private BigDecimal thresholdHigh;
|
||||||
|
|
||||||
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
@ApiModelProperty(value = "高高报阈值", name = "thresholdHighHigh")
|
||||||
private BigDecimal thresholdHighHigh;
|
private BigDecimal thresholdHighHigh;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "量程上限")
|
||||||
|
private BigDecimal rangeMax;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "量程下限")
|
||||||
|
private BigDecimal rangeMin;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,63 +15,74 @@ import java.util.Date;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class SensorTypeCO extends ClientObject {
|
public class SensorTypeCO extends ClientObject {
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键ID")
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "传感器类型业务ID")
|
@ApiModelProperty(value = "传感器类型业务ID")
|
||||||
private String sensorTypeId;
|
private String sensorTypeId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型编码")
|
|
||||||
private String typeCode;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型名称")
|
@ApiModelProperty(value = "类型名称")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)")
|
@ApiModelProperty(value = "传感器属性(NUMBER/SWITCH)")
|
||||||
private String sensorAttr;
|
private String sensorAttr;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "量程上限")
|
||||||
|
private BigDecimal rangeMax;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "量程下限")
|
||||||
|
private BigDecimal rangeMin;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "高高报阈值")
|
||||||
|
private BigDecimal thresholdHighHigh;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "高报阈值")
|
||||||
|
private BigDecimal thresholdHigh;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "低低报阈值")
|
||||||
|
private BigDecimal thresholdLowLow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "低报阈值")
|
||||||
|
private BigDecimal thresholdLow;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建人ID")
|
@ApiModelProperty(value = "创建人ID")
|
||||||
private Long createId;
|
private Long createId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建人姓名")
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
private String createName;
|
private String createName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "更新人ID")
|
@ApiModelProperty(value = "更新人ID")
|
||||||
private Long updateId;
|
private Long updateId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "更新人姓名")
|
@ApiModelProperty(value = "更新人姓名")
|
||||||
private String updateName;
|
private String updateName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "更新时间")
|
@ApiModelProperty(value = "更新时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租户ID")
|
@ApiModelProperty(value = "租户ID")
|
||||||
private Long tenantId;
|
private Long tenantId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "组织ID")
|
@ApiModelProperty(value = "组织ID")
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "环境")
|
@ApiModelProperty(value = "环境")
|
||||||
private String env;
|
private String env;
|
||||||
|
|
||||||
@ApiModelProperty(value = "低低报阈值")
|
}
|
||||||
private BigDecimal thresholdLowLow;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "低报阈值")
|
|
||||||
private BigDecimal thresholdLow;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "高报阈值")
|
|
||||||
private BigDecimal thresholdHigh;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "高高报阈值")
|
|
||||||
private BigDecimal thresholdHighHigh;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -14,64 +14,69 @@ import java.math.BigDecimal;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SensorTypeE extends BaseE {
|
public class SensorTypeE extends BaseE {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 传感器类型业务ID (生成32位UUID)
|
* 传感器类型业务ID (生成32位UUID)
|
||||||
*/
|
*/
|
||||||
private String sensorTypeId;
|
private String sensorTypeId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型编码
|
|
||||||
*/
|
|
||||||
private String typeCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型名称
|
* 类型名称
|
||||||
*/
|
*/
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 传感器属性(NUMBER/SWITCH)
|
* 传感器属性(NUMBER/SWITCH)
|
||||||
*/
|
*/
|
||||||
private String sensorAttr;
|
private String sensorAttr;
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 租户ID
|
|
||||||
*/
|
|
||||||
private Long tenantId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织ID
|
|
||||||
*/
|
|
||||||
private Long orgId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 环境
|
|
||||||
*/
|
|
||||||
private String env;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 低低报阈值
|
* 低低报阈值
|
||||||
*/
|
*/
|
||||||
private BigDecimal thresholdLowLow;
|
private BigDecimal thresholdLowLow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 低报阈值
|
* 低报阈值
|
||||||
*/
|
*/
|
||||||
private BigDecimal thresholdLow;
|
private BigDecimal thresholdLow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高报阈值
|
* 高报阈值
|
||||||
*/
|
*/
|
||||||
private BigDecimal thresholdHigh;
|
private BigDecimal thresholdHigh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高高报阈值
|
* 高高报阈值
|
||||||
*/
|
*/
|
||||||
private BigDecimal thresholdHighHigh;
|
private BigDecimal thresholdHighHigh;
|
||||||
}
|
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
private BigDecimal rangeMax;
|
||||||
|
|
||||||
|
private BigDecimal rangeMin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户ID
|
||||||
|
*/
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织ID
|
||||||
|
*/
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境
|
||||||
|
*/
|
||||||
|
private String env;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,12 @@ import java.math.BigDecimal;
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SensorTypeDO extends BaseDO {
|
public class SensorTypeDO extends BaseDO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "传感器类型业务ID")
|
@ApiModelProperty(value = "传感器类型业务ID")
|
||||||
private String sensorTypeId;
|
private String sensorTypeId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型编码")
|
|
||||||
private String typeCode;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型名称")
|
@ApiModelProperty(value = "类型名称")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
@ -51,8 +52,6 @@ public class SensorTypeDO extends BaseDO {
|
||||||
@ApiModelProperty(value = "低报阈值")
|
@ApiModelProperty(value = "低报阈值")
|
||||||
private BigDecimal thresholdLow;
|
private BigDecimal thresholdLow;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue