feat:是否警告接口
parent
4686fc17fe
commit
bf235658fb
|
@ -1,5 +1,7 @@
|
||||||
package com.muyu.breakdown.controller;
|
package com.muyu.breakdown.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.muyu.breakdown.domain.SysCarFault;
|
import com.muyu.breakdown.domain.SysCarFault;
|
||||||
import com.muyu.breakdown.service.SysCarFaultService;
|
import com.muyu.breakdown.service.SysCarFaultService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
|
@ -104,4 +106,28 @@ public class SysCarFaultController extends BaseController
|
||||||
sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
|
sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用告警
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
@PutMapping("/enableWarningsById/{id}")
|
||||||
|
public void enableWarningsById(@PathVariable("id")Long id){
|
||||||
|
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
|
||||||
|
wrapper.eq("id",id);
|
||||||
|
wrapper.set("warn_status",0);
|
||||||
|
sysCarFaultService.update(wrapper);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 禁用告警
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
@PutMapping("/disableWarningsById/{id}")
|
||||||
|
public void disableWarningsById(@PathVariable("id")Long id){
|
||||||
|
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
|
||||||
|
wrapper.eq("id",id);
|
||||||
|
wrapper.set("warn_status",1);
|
||||||
|
sysCarFaultService.update(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,11 +80,11 @@ public class SysCarFault extends BaseEntity{
|
||||||
|
|
||||||
/** 启用状态(1.待处理 2.处理中 3.已处理 4.忽略) */
|
/** 启用状态(1.待处理 2.处理中 3.已处理 4.忽略) */
|
||||||
@Excel(name = "启用状态(1.待处理 2.处理中 3.已处理 4.忽略)")
|
@Excel(name = "启用状态(1.待处理 2.处理中 3.已处理 4.忽略)")
|
||||||
private Long status;
|
private Integer status;
|
||||||
|
|
||||||
/** 是否警告(0.开启 1.禁止) */
|
/** 是否警告(0.开启 1.禁止) */
|
||||||
@Excel(name = "是否警告(0.开启 1.禁止)")
|
@Excel(name = "是否警告(0.开启 1.禁止)")
|
||||||
private Long warnStatus;
|
private Integer warnStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,4 +35,6 @@ public interface SysCarFaultService extends IService<SysCarFault> {
|
||||||
*/
|
*/
|
||||||
Boolean checkIdUnique(SysCarFault sysCarFault);
|
Boolean checkIdUnique(SysCarFault sysCarFault);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,6 @@ public class SysCarFaultServiceImpl
|
||||||
return this.count(queryWrapper) > 0;
|
return this.count(queryWrapper) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,4 +127,11 @@
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="enableWarningsById" parameterType="Long">
|
||||||
|
update sys_car_fault set warn_status = 0 where id = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="disableWarningsById" parameterType="Long">
|
||||||
|
update sys_car_fault set warn_status = 1 where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue