From 3d6fbb93f56d5221661f7899a00c5a70072e5ee5 Mon Sep 17 00:00:00 2001 From: wugh <328043740@qq.com> Date: 星期一, 22 三月 2021 09:32:49 +0800 Subject: [PATCH] !11 [功能] 拆分出Vo,QueryBo,AddBo,EditBo等领域对象 * [修改] 错误引入的无用导包删除 * [新增] 增加Vo,QueryBo,AddBo,EditBo等视图,并调整controller,service的调用代码 * [新增] 增加CreateAndUpdateMetaObjectHandler,配合fill注解,实现创建和修改人的自动设置,减少重复代码 --- ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java | 189 ++++++++++++++++++++++------------------------- 1 files changed, 88 insertions(+), 101 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java index cf7b46e..4295f6e 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java @@ -1,101 +1,88 @@ -package com.ruoyi.framework.web.domain.server; - -import com.ruoyi.common.utils.Arith; - -/** - * CPU鐩稿叧淇℃伅 - * - * @author ruoyi - */ -public class Cpu -{ - /** - * 鏍稿績鏁� - */ - private int cpuNum; - - /** - * CPU鎬荤殑浣跨敤鐜� - */ - private double total; - - /** - * CPU绯荤粺浣跨敤鐜� - */ - private double sys; - - /** - * CPU鐢ㄦ埛浣跨敤鐜� - */ - private double used; - - /** - * CPU褰撳墠绛夊緟鐜� - */ - private double wait; - - /** - * CPU褰撳墠绌洪棽鐜� - */ - private double free; - - public int getCpuNum() - { - return cpuNum; - } - - public void setCpuNum(int cpuNum) - { - this.cpuNum = cpuNum; - } - - public double getTotal() - { - return Arith.round(Arith.mul(total, 100), 2); - } - - public void setTotal(double total) - { - this.total = total; - } - - public double getSys() - { - return Arith.round(Arith.mul(sys / total, 100), 2); - } - - public void setSys(double sys) - { - this.sys = sys; - } - - public double getUsed() - { - return Arith.round(Arith.mul(used / total, 100), 2); - } - - public void setUsed(double used) - { - this.used = used; - } - - public double getWait() - { - return Arith.round(Arith.mul(wait / total, 100), 2); - } - - public void setWait(double wait) - { - this.wait = wait; - } - - public double getFree() - { - return Arith.round(Arith.mul(free / total, 100), 2); - } - - public void setFree(double free) - { - this.free = free; - } -} +package com.ruoyi.framework.web.domain.server; + +import cn.hutool.core.util.NumberUtil; + +/** + * CPU鐩稿叧淇℃伅 + * + * @author ruoyi + */ +public class Cpu { + /** + * 鏍稿績鏁� + */ + private int cpuNum; + + /** + * CPU鎬荤殑浣跨敤鐜� + */ + private double total; + + /** + * CPU绯荤粺浣跨敤鐜� + */ + private double sys; + + /** + * CPU鐢ㄦ埛浣跨敤鐜� + */ + private double used; + + /** + * CPU褰撳墠绛夊緟鐜� + */ + private double wait; + + /** + * CPU褰撳墠绌洪棽鐜� + */ + private double free; + + public int getCpuNum() { + return cpuNum; + } + + public void setCpuNum(int cpuNum) { + this.cpuNum = cpuNum; + } + + public double getTotal() { + return NumberUtil.round(NumberUtil.mul(total, 100), 2).doubleValue(); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getSys() { + return NumberUtil.round(NumberUtil.mul(sys / total, 100), 2).doubleValue(); + } + + public void setSys(double sys) { + this.sys = sys; + } + + public double getUsed() { + return NumberUtil.round(NumberUtil.mul(used / total, 100), 2).doubleValue(); + } + + public void setUsed(double used) { + this.used = used; + } + + public double getWait() { + return NumberUtil.round(NumberUtil.mul(wait / total, 100), 2).doubleValue(); + } + + public void setWait(double wait) { + this.wait = wait; + } + + public double getFree() { + return NumberUtil.round(NumberUtil.mul(free / total, 100), 2).doubleValue(); + } + + public void setFree(double free) { + this.free = free; + } +} -- Gitblit v1.9.3