Commit de43803e by 李小龙
parents 8973945f 13fc277d
......@@ -49,17 +49,30 @@ public class PlatAlarmConfigController {
return ApiResponseUtils.success();
}
@ApiOperation("编辑")
@ApiOperation("编辑(审核)")
@PostMapping("editAudit")
public ApiResponseEntity<?> editAudit(PlatAlarmConfigDTOVO dto) {
platAlarmConfigService.editAudit(dto);
return ApiResponseUtils.success();
}
@ApiOperation("编辑(不审核)")
@PostMapping("edit")
public ApiResponseEntity<?> edit(PlatAlarmConfigDTOVO dto) {
platAlarmConfigService.edit(dto);
return ApiResponseUtils.success();
}
@ApiOperation("详情")
@PostMapping("editView")
public ApiResponseEntity<PlatAlarmConfigDTOVO> editView(@RequestBody BaseIdDTO baseIdDTO) {
return ApiResponseUtils.success(platAlarmConfigService.editView(baseIdDTO.getId()));
@ApiOperation("详情(审核)")
@PostMapping("viewAudit")
public ApiResponseEntity<PlatAlarmConfigDTOVO> viewAudit(@RequestBody BaseIdDTO baseIdDTO) {
return ApiResponseUtils.success(platAlarmConfigService.viewAudit(baseIdDTO.getId()));
}
@ApiOperation("详情(不审核)")
@PostMapping("view")
public ApiResponseEntity<PlatAlarmConfigDTOVO> view(@RequestBody BaseIdDTO baseIdDTO) {
return ApiResponseUtils.success(platAlarmConfigService.view(baseIdDTO.getId()));
}
@ApiOperation("改变状态")
......
package com.makeit.dto.platform.alarm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 告警配置
* </p>
*
* @author eugene young
* @since 2023-09-04
*/
@Data
@EqualsAndHashCode
@ApiModel(value = "PlatAlarmConfig对象", description = "告警配置")
public class PlatAlarmConfigBehaviorDTOVO {
@ApiModelProperty("心率正常范围开始")
private Integer heartRateStart;
@ApiModelProperty("心率正常范围结束")
private Integer heartRateEnd;
@ApiModelProperty("异常持续时间")
private Integer duration;
}
......@@ -21,11 +21,11 @@ import javax.validation.constraints.NotBlank;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="PlatAlarmConfig对象", description="告警配置")
@ApiModel(value = "PlatAlarmConfig对象", description = "告警配置")
public class PlatAlarmConfigDTOVO extends BaseTenantDTO {
@NotBlank(message = "告警类型不能为空")
@DictEnum(em = PlatAlarmConfigEnum.AlarmTypeEnum.class,message = "告警类型可选值为{m}")
@DictEnum(em = PlatAlarmConfigEnum.AlarmTypeEnum.class, message = "告警类型可选值为{m}")
@ApiModelProperty(value = "告警类型 数据字典 1 长者跌倒 2 呼吸异常 3 心率异常 4 行为异常")
private String alarmType;
......@@ -47,6 +47,15 @@ public class PlatAlarmConfigDTOVO extends BaseTenantDTO {
@ApiModelProperty(value = "规则配置")
private String ruleConfig;
@ApiModelProperty(value = "心率异常")
private PlatAlarmConfigRespiratoryDTOVO respiratory;
@ApiModelProperty(value = "心率异常")
private PlatAlarmConfigHeartDTOVO heart;
@ApiModelProperty(value = "心率异常")
private PlatAlarmConfigBehaviorDTOVO behavior;
@ApiModelProperty(value = "内容")
private String content;
......
package com.makeit.dto.platform.alarm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 告警配置
* </p>
*
* @author eugene young
* @since 2023-09-04
*/
@Data
@EqualsAndHashCode
@ApiModel(value = "PlatAlarmConfig对象", description = "告警配置")
public class PlatAlarmConfigHeartDTOVO {
@ApiModelProperty("心率正常范围开始")
private Integer heartRateStart;
@ApiModelProperty("心率正常范围结束")
private Integer heartRateeEnd;
@ApiModelProperty("异常持续时间")
private Integer duration;
}
package com.makeit.dto.platform.alarm;
import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 告警配置
* </p>
*
* @author eugene young
* @since 2023-09-04
*/
@Data
@EqualsAndHashCode
@ApiModel(value = "PlatAlarmConfig对象", description = "告警配置")
public class PlatAlarmConfigRespiratoryDTOVO {
@ApiModelProperty("呼吸率正常范围开始")
private Integer respiratoryRateStart;
@ApiModelProperty("呼吸率正常范围结束")
private Integer respiratoryRateEnd;
@ApiModelProperty("异常持续时间")
private Integer duration;
}
......@@ -23,9 +23,13 @@ public interface PlatAlarmConfigService extends IService<PlatAlarmConfig> {
void add(PlatAlarmConfigDTOVO dto);
void editAudit(PlatAlarmConfigDTOVO dto);
void edit(PlatAlarmConfigDTOVO dto);
PlatAlarmConfigDTOVO editView(String id);
PlatAlarmConfigDTOVO viewAudit(String id);
PlatAlarmConfigDTOVO view(String id);
void changeStatus(StatusDTO dto);
......
......@@ -69,7 +69,7 @@ public class PlatAlarmConfigServiceImpl extends ServiceImpl<PlatAlarmConfigMappe
@Override
@Transactional
public void edit(PlatAlarmConfigDTOVO dto) {
public void editAudit(PlatAlarmConfigDTOVO dto) {
PlatAlarmConfig db = getById(dto.getId());
if (StringUtils.isNotBlank(db.getContentAudit())) {
throw new RuntimeException();
......@@ -83,7 +83,13 @@ public class PlatAlarmConfigServiceImpl extends ServiceImpl<PlatAlarmConfigMappe
}
@Override
public PlatAlarmConfigDTOVO editView(String id) {
@Transactional
public void edit(PlatAlarmConfigDTOVO dto) {
updateById(BeanDtoVoUtils.convert(dto,PlatAlarmConfig.class));
}
@Override
public PlatAlarmConfigDTOVO viewAudit(String id) {
PlatAlarmConfig alarmConfig = getById(id);
PlatAlarmConfigDTOVO vo = BeanDtoVoUtils.convert(alarmConfig, PlatAlarmConfigDTOVO.class);
......@@ -99,6 +105,20 @@ public class PlatAlarmConfigServiceImpl extends ServiceImpl<PlatAlarmConfigMappe
}
@Override
public PlatAlarmConfigDTOVO view(String id) {
PlatAlarmConfig alarmConfig = getById(id);
PlatAlarmConfigDTOVO vo = BeanDtoVoUtils.convert(alarmConfig, PlatAlarmConfigDTOVO.class);
JoinUtil.joinSplit(Arrays.asList(vo), platUserService, PlatAlarmConfigDTOVO::getNotifyUser, PlatUser::getId, (c, u) -> {
c.setNotifyUserName(StreamUtil.join(u, PlatUser::getUsername));
});
return vo;
}
@Transactional
@Override
public void changeStatus(StatusDTO dto) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment