Browse Source

中间计量申请自定义getSet影响保存修改

qianxb 1 năm trước cách đây
mục cha
commit
a24102e6d3

+ 8 - 2
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/InventoryFormApply.java

@@ -116,10 +116,16 @@ public class InventoryFormApply extends BaseEntity {
     private BigDecimal PayMoney;
 
     public BigDecimal getCurrentMeterTotal() {
-        return new BigDecimal(currentMeterTotal.stripTrailingZeros().toPlainString());
+        if (currentMeterTotal == null){
+            return null;
+        }else {
+            return new BigDecimal(currentMeterTotal.stripTrailingZeros().toPlainString());
+        }
     }
 
     public void setCurrentMeterTotal(BigDecimal currentMeterTotal) {
-        this.currentMeterTotal = new BigDecimal(currentMeterTotal.stripTrailingZeros().toPlainString());
+        if (currentMeterTotal != null) {
+            this.currentMeterTotal = new BigDecimal(currentMeterTotal.stripTrailingZeros().toPlainString());
+        }
     }
 }