Commit 910b156e authored by 鲁鸿波's avatar 鲁鸿波

维护管理调整

parent b3639208
......@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
* 设备告警参数限制 控制器
*
* @author cyz
* @since 2022-02-14
* @since 2022-02-15
*/
@Slf4j
@RestController
......
package com.hongxinhui.entity;
import java.math.BigDecimal;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
......@@ -21,7 +22,7 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update;
* 设备告警参数限制
*
* @author cyz
* @since 2022-02-14
* @since 2022-02-15
*/
@Data
@Accessors(chain = true)
......@@ -30,7 +31,7 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update;
public class MmsAlarm extends BaseEntity {
private static final long serialVersionUID = 1L;
@NotNull(message = "不能为空")
@NotNull(message = "id不能为空", groups = {Update.class})
@TableId(value = "id", type = IdType.AUTO)
private Long id;
......@@ -43,17 +44,17 @@ public class MmsAlarm extends BaseEntity {
@TableField("modelId")
private Long modelId;
@NotBlank(message = "一般告警门限不能为空")
@NotNull(message = "一般告警门限不能为空")
@ApiModelProperty("一般告警门限")
private String general;
private BigDecimal general;
@NotBlank(message = "重要告警门限不能为空")
@NotNull(message = "重要告警门限不能为空")
@ApiModelProperty("重要告警门限")
private String importance;
private BigDecimal importance;
@NotBlank(message = "紧急告警门限不能为空")
@NotNull(message = "紧急告警门限不能为空")
@ApiModelProperty("紧急告警门限")
private String urgency;
private BigDecimal urgency;
@NotNull(message = "是否删除(0: 未删除, 1: 已删除)不能为空")
@ApiModelProperty("是否删除(0: 未删除, 1: 已删除)")
......@@ -84,4 +85,49 @@ public class MmsAlarm extends BaseEntity {
private Date updateTime;
public enum FieldEnum implements BaseEnum {
model("model", "漏缆型号"),
modelId("modelId", "漏缆型号id"),
general("general", "一般告警门限"),
importance("importance", "重要告警门限"),
urgency("urgency", "紧急告警门限"),
deleted("deleted", "是否删除(0: 未删除, 1: 已删除)"),
deletedBy("deletedBy", "删除者"),
deletedTime("deletedTime", "删除时间"),
createBy("createBy", "创建者"),
createTime("createTime", "创建时间"),
updateBy("updateBy", "更新者"),
updateTime("updateTime", "更新时间"),
id("id", "编号");
/**
* name
*/
@Getter
private final String name;
/**
* desc
*/
@Getter
private final String desc;
FieldEnum(String name, String desc) {
this.name = name;
this.desc = desc;
}
@Override
public Integer getCode() {
return null;
}
@Override
public String getDesc() {
return null;
}
}
}
......@@ -15,7 +15,7 @@ import java.io.Serializable;
* 设备告警参数限制 Mapper 接口
*
* @author cyz
* @since 2022-02-14
* @since 2022-02-15
*/
@Repository
public interface MmsAlarmMapper extends BaseMapper<MmsAlarm> {
......
......@@ -12,7 +12,7 @@ import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
* </pre>
*
* @author cyz
* @date 2022-02-14
* @date 2022-02-15
*/
@Data
@Accessors(chain = true)
......
......@@ -9,7 +9,7 @@ import io.geekidea.springbootplus.framework.core.pagination.Paging;
* 设备告警参数限制 服务类
*
* @author cyz
* @since 2022-02-14
* @since 2022-02-15
*/
public interface MmsAlarmService extends BaseService<MmsAlarm> {
......
......@@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
* 设备告警参数限制 服务实现类
*
* @author cyz
* @since 2022-02-14
* @since 2022-02-15
*/
@Slf4j
@Service
......@@ -36,8 +36,9 @@ public class MmsAlarmServiceImpl extends BaseServiceImpl<MmsAlarmMapper, MmsAlar
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveMmsAlarm(MmsAlarm mmsAlarm) throws Exception {
//前端传或者应该获取漏缆型号(如果获取的对象信息较多的话需要建立表,否则在字典表中加数据)
//前端传或者应该获取漏缆型号信息(如果获取的对象信息较多的话需要建立表,否则在字典表中加数据)
//一些公用的属性赋值(删除状态,创建人,创建时间)
CommonAttributeSet commonAttributeSet = new CommonAttributeSet().builderInsert();
BeanUtils.copyProperties(commonAttributeSet,mmsAlarm);
return super.save(mmsAlarm);
......@@ -46,6 +47,8 @@ public class MmsAlarmServiceImpl extends BaseServiceImpl<MmsAlarmMapper, MmsAlar
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateMmsAlarm(MmsAlarm mmsAlarm) throws Exception {
//前端传或者应该获取漏缆型号信息(如果获取的对象信息较多的话需要建立表,否则在字典表中加数据)
//一些公用的属性赋值(修改人,修改时间)
BeanUtils.copyProperties(new CommonAttributeSet().builderUpdate(),mmsAlarm);
return super.updateById(mmsAlarm);
......@@ -54,8 +57,7 @@ public class MmsAlarmServiceImpl extends BaseServiceImpl<MmsAlarmMapper, MmsAlar
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteMmsAlarm(Long id) throws Exception {
//删除设备告警参数限制时是否同步删除包含使用到它的地方信息
//删除设备本身维护数据时是否同步删除包含使用到它的地方信息
MmsAlarm mmsAlarm = mmsAlarmMapper.selectById(id);
//一些公用的属性赋值(删除标识,删除人,删除时间)
BeanUtils.copyProperties(new CommonAttributeSet().builderDeleted(),mmsAlarm);
......
......@@ -25,6 +25,7 @@ public class CommonAttributeSet extends BaseEntity {
private Date createTime;
private String updateBy;
private Date updateTime;
private Date uploadTime;
/**
* 当前登陆用户
......@@ -47,6 +48,7 @@ public class CommonAttributeSet extends BaseEntity {
CommonAttributeSet commonAttributeSet = new CommonAttributeSet();
commonAttributeSet.setDeleted(CommonEnums.DELETED0.getCode());
commonAttributeSet.setCreateTime(DateUtils.getNowDate());
commonAttributeSet.setUploadTime(DateUtils.getNowDate());
User user = getUser();
if (null != user) {
......
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 to comment