Commit 959f49b6335a3461935067cd24e66de4d382c384

Authored by 谭毅彬
1 parent 010af9be

告警显示内容格式化

Signed-off-by: TanYibin <5491541@qq.com>
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryAge/entity/InventoryAgeAlarm.java
1 1 package org.jeecg.modules.wms.inventory.inventoryAge.entity;
2 2  
3   -import lombok.Data;
4 3 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
5 4  
6   -@Data
7 5 public class InventoryAgeAlarm extends InventoryDetail {
  6 +
  7 + private static final long serialVersionUID = -4357432402431852770L;
  8 +
8 9 private int days;
9   - /**保质期**/
10   - private int daystoexpire;
11   - /**预警期**/
12   - private int expiringdays;
13 10  
14   - public InventoryAgeAlarm(){
  11 + /** 保质期 **/
  12 + private int daystoexpire;
15 13  
16   - }
  14 + /** 预警期 **/
  15 + private int expiringdays;
17 16  
18   - /**库龄到达预警期,但未过保质期**/
19   - public boolean inExpiring(){
20   - return days >= expiringdays && days <daystoexpire;
  17 + /** 库龄到达预警期,但未过保质期 **/
  18 + public boolean inExpiring() {
  19 + return days >= expiringdays && days < daystoexpire;
21 20 }
22 21  
23   - /**库龄超过保质期**/
24   - public boolean inExpired(){
  22 + /** 库龄超过保质期 **/
  23 + public boolean inExpired() {
25 24 return days >= daystoexpire;
26 25 }
27 26  
... ... @@ -29,9 +28,11 @@ public class InventoryAgeAlarm extends InventoryDetail {
29 28 public String toString() {
30 29 String str = "<ul>";
31 30 if (inExpiring()) {
32   - str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + ": " + getMaterialName() + "</b> &nbsp;&nbsp;" + getMaterialCode() + " 库存数 <b>" + getQty() + "</b>&nbsp;&nbsp;即将过期<b> </b></li>";
  31 + str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + "&nbsp;:&nbsp;" + getMaterialName() + "&nbsp;" + getMaterialCode()
  32 + + "</b>&nbsp;&nbsp;库存量&nbsp;<b>" + getQty() + "</b>&nbsp;&nbsp;即将过期<b> </b></li>";
33 33 } else if (inExpired()) {
34   - str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + ": " + getMaterialName() + "</b> &nbsp;&nbsp;" + getMaterialCode() + " 库存数 <b>" + getQty() + "</b>&nbsp;&nbsp;已经过期<b> </b></li>";
  34 + str = str + "<li><b>" + getLocationCode() + " - " + getContainerCode() + "&nbsp;:&nbsp;" + getMaterialName() + "&nbsp;" + getMaterialCode()
  35 + + "</b>&nbsp;&nbsp;库存量&nbsp;<b>" + getQty() + "</b>&nbsp;&nbsp;已经过期<b> </b></li>";
35 36 }
36 37 return str + "</ul>";
37 38 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryLevel/entity/InventoryLevelAlarm.java
1 1 package org.jeecg.modules.wms.inventory.inventoryLevel.entity;
2 2  
3   -import lombok.Data;
4 3 import org.jeecg.modules.wms.config.materialWarning.entity.MaterialWarning;
5 4  
6   -import java.math.BigDecimal;
  5 +import lombok.Data;
7 6  
8   -@Data
9 7 public class InventoryLevelAlarm extends MaterialWarning {
10   - private int qtySum;
11 8  
12   - public InventoryLevelAlarm(){
  9 + private static final long serialVersionUID = -8514054287288392481L;
13 10  
14   - }
  11 + private int qtySum;
15 12  
16 13 /**
17 14 * 判断是否低于下限
18 15 **/
19 16 public boolean inLower() {
20   - return this.qtySum <= getLower();
  17 + return this.getQtySum() <= getLower();
21 18 }
22 19  
23 20 /**
24 21 * 判断是否高于上限
25 22 **/
26   - public boolean inUpper(){
27   - return this.qtySum >= getUpper();
  23 + public boolean inUpper() {
  24 + return this.getQtySum() >= getUpper();
28 25 }
29 26  
30 27 /** 判断是否低于最小值 **/
31   - public boolean inMin(){
32   - return this.qtySum <= getMin();
  28 + public boolean inMin() {
  29 + return this.getQtySum() <= getMin();
33 30 }
34 31  
35 32 /** 判断是否高于最大值 **/
36   - public boolean inMax(){
37   - return this.qtySum >= getMax();
  33 + public boolean inMax() {
  34 + return this.getQtySum() >= getMax();
38 35 }
39 36  
40 37 /**
... ... @@ -48,14 +45,26 @@ public class InventoryLevelAlarm extends MaterialWarning {
48 45 public String toString() {
49 46 String str = "<ul>";
50 47 if (inLower()) {
51   - str = str + "<li><b>" + getMaterialName() + "</b> &nbsp;&nbsp;" + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b>&nbsp;&nbsp;低于下限预警值<b> " + getLower() + "</b></li>";
  48 + str = str + "<li><b>" + getMaterialName() + "&nbsp;" + getMaterialCode() + "</b>&nbsp;&nbsp;库存数&nbsp;<b>" + getQtySum() + "</b>&nbsp;&nbsp;低于下限预警值&nbsp;<b>"
  49 + + getLower() + "</b></li>";
52 50 } else if (inUpper()) {
53   - str = str + "<li><b>" + getMaterialName() + "</b> &nbsp;&nbsp;" + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b>&nbsp;&nbsp;高于上限预警值<b> " + getUpper() + "</b></li>";
  51 + str = str + "<li><b>" + getMaterialName() + "&nbsp;" + getMaterialCode() + "</b>&nbsp;&nbsp;库存数&nbsp;<b>" + getQtySum() + "</b>&nbsp;&nbsp;高于上限预警值&nbsp;<b>"
  52 + + getUpper() + "</b></li>";
54 53 } else if (inMin()) {
55   - str = str + "<li><b>" + getMaterialName() + "</b> &nbsp;&nbsp;" + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b>&nbsp;&nbsp;低于最低值<b> " + getMin() + "</b></li>";
  54 + str = str + "<li><b>" + getMaterialName() + "&nbsp;" + getMaterialCode() + "</b>&nbsp;&nbsp;库存数&nbsp;<b>" + getQtySum() + "</b>&nbsp;&nbsp;低于最低值&nbsp;<b>"
  55 + + getMin() + "</b></li>";
56 56 } else if (inMax()) {
57   - str = str + "<li><b>" + getMaterialName() + "</b> &nbsp;&nbsp;" + getMaterialCode() + " 库存数 <b>" + getQtySum() + "</b>&nbsp;&nbsp;超过最高值<b> " + getMax() + "</b></li>";
  57 + str = str + "<li><b>" + getMaterialName() + "&nbsp;" + getMaterialCode() + "</b>&nbsp;&nbsp;库存数&nbsp;<b>" + getQtySum() + "</b>&nbsp;&nbsp;超过最高值&nbsp;<b>"
  58 + + getMax() + "</b></li>";
58 59 }
59 60 return str + "</ul>";
60 61 }
  62 +
  63 + public int getQtySum() {
  64 + return qtySum;
  65 + }
  66 +
  67 + public void setQtySum(int qtySum) {
  68 + this.qtySum = qtySum;
  69 + }
61 70 }
... ...