From 959f49b6335a3461935067cd24e66de4d382c384 Mon Sep 17 00:00:00 2001 From: TanYibin <5491541@qq.com> Date: Fri, 10 Nov 2023 14:56:45 +0800 Subject: [PATCH] 告警显示内容格式化 --- huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryAge/entity/InventoryAgeAlarm.java | 31 ++++++++++++++++--------------- huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryLevel/entity/InventoryLevelAlarm.java | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryAge/entity/InventoryAgeAlarm.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryAge/entity/InventoryAgeAlarm.java index ccffde5..5c21e0b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryAge/entity/InventoryAgeAlarm.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryAge/entity/InventoryAgeAlarm.java @@ -1,27 +1,26 @@ package org.jeecg.modules.wms.inventory.inventoryAge.entity; -import lombok.Data; import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; -@Data public class InventoryAgeAlarm extends InventoryDetail { + + private static final long serialVersionUID = -4357432402431852770L; + private int days; - /**保质期**/ - private int daystoexpire; - /**预警期**/ - private int expiringdays; - public InventoryAgeAlarm(){ + /** 保质期 **/ + private int daystoexpire; - } + /** 预警期 **/ + private int expiringdays; - /**库龄到达预警期,但未过保质期**/ - public boolean inExpiring(){ - return days >= expiringdays && days <daystoexpire; + /** 库龄到达预警期,但未过保质期 **/ + public boolean inExpiring() { + return days >= expiringdays && days < daystoexpire; } - /**库龄超过保质期**/ - public boolean inExpired(){ + /** 库龄超过保质期 **/ + public boolean inExpired() { return days >= daystoexpire; } @@ -29,9 +28,11 @@ public class InventoryAgeAlarm extends InventoryDetail { public String toString() { String str = "<ul>"; if (inExpiring()) { - str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + ": " + getMaterialName() + "</b> " + getMaterialCode() + " 库存数 <b>" + getQty() + "</b> 即将过期<b> </b></li>"; + str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + " : " + getMaterialName() + " " + getMaterialCode() + + "</b> 库存量 <b>" + getQty() + "</b> 即将过期<b> </b></li>"; } else if (inExpired()) { - str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + ": " + getMaterialName() + "</b> " + getMaterialCode() + " 库存数 <b>" + getQty() + "</b> 已经过期<b> </b></li>"; + str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + " : " + getMaterialName() + " " + getMaterialCode() + + "</b> 库存量 <b>" + getQty() + "</b> 已经过期<b> </b></li>"; } return str + "</ul>"; } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryLevel/entity/InventoryLevelAlarm.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryLevel/entity/InventoryLevelAlarm.java index 3304b98..f5b0c66 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryLevel/entity/InventoryLevelAlarm.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryLevel/entity/InventoryLevelAlarm.java @@ -1,40 +1,37 @@ package org.jeecg.modules.wms.inventory.inventoryLevel.entity; -import lombok.Data; import org.jeecg.modules.wms.config.materialWarning.entity.MaterialWarning; -import java.math.BigDecimal; +import lombok.Data; -@Data public class InventoryLevelAlarm extends MaterialWarning { - private int qtySum; - public InventoryLevelAlarm(){ + private static final long serialVersionUID = -8514054287288392481L; - } + private int qtySum; /** * 判断是否低于下限 **/ public boolean inLower() { - return this.qtySum <= getLower(); + return this.getQtySum() <= getLower(); } /** * 判断是否高于上限 **/ - public boolean inUpper(){ - return this.qtySum >= getUpper(); + public boolean inUpper() { + return this.getQtySum() >= getUpper(); } /** 判断是否低于最小值 **/ - public boolean inMin(){ - return this.qtySum <= getMin(); + public boolean inMin() { + return this.getQtySum() <= getMin(); } /** 判断是否高于最大值 **/ - public boolean inMax(){ - return this.qtySum >= getMax(); + public boolean inMax() { + return this.getQtySum() >= getMax(); } /** @@ -48,14 +45,26 @@ public class InventoryLevelAlarm extends MaterialWarning { public String toString() { String str = "<ul>"; if (inLower()) { - str = str + "<li><b>" + getMaterialName() + "</b> " + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b> 低于下限预警值<b> " + getLower() + "</b></li>"; + str = str + "<li><b>" + getMaterialName() + " " + getMaterialCode() + "</b> 库存数 <b>" + getQtySum() + "</b> 低于下限预警值 <b>" + + getLower() + "</b></li>"; } else if (inUpper()) { - str = str + "<li><b>" + getMaterialName() + "</b> " + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b> 高于上限预警值<b> " + getUpper() + "</b></li>"; + str = str + "<li><b>" + getMaterialName() + " " + getMaterialCode() + "</b> 库存数 <b>" + getQtySum() + "</b> 高于上限预警值 <b>" + + getUpper() + "</b></li>"; } else if (inMin()) { - str = str + "<li><b>" + getMaterialName() + "</b> " + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b> 低于最低值<b> " + getMin() + "</b></li>"; + str = str + "<li><b>" + getMaterialName() + " " + getMaterialCode() + "</b> 库存数 <b>" + getQtySum() + "</b> 低于最低值 <b>" + + getMin() + "</b></li>"; } else if (inMax()) { - str = str + "<li><b>" + getMaterialName() + "</b> " + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b> 超过最高值<b> " + getMax() + "</b></li>"; + str = str + "<li><b>" + getMaterialName() + " " + getMaterialCode() + "</b> 库存数 <b>" + getQtySum() + "</b> 超过最高值 <b>" + + getMax() + "</b></li>"; } return str + "</ul>"; } + + public int getQtySum() { + return qtySum; + } + + public void setQtySum(int qtySum) { + this.qtySum = qtySum; + } } -- libgit2 0.22.2