chenshudong пре 1 недеља
родитељ
комит
00d1f8707e

+ 15 - 0
airport-admin/src/main/java/com/sundot/airport/web/controller/score/ScoreEventController.java

@@ -9,6 +9,7 @@ import com.sundot.airport.common.core.controller.BaseController;
9 9
 import com.sundot.airport.common.core.domain.AjaxResult;
10 10
 import com.sundot.airport.common.core.page.TableDataInfo;
11 11
 import com.sundot.airport.common.enums.BusinessType;
12
+import com.sundot.airport.common.enums.ScoreTypeEnum;
12 13
 import com.sundot.airport.common.utils.DateUtils;
13 14
 import com.sundot.airport.common.utils.poi.ExcelUtil;
14 15
 import com.sundot.airport.ledger.domain.ScoreEvent;
@@ -82,6 +83,13 @@ public class ScoreEventController extends BaseController {
82 83
         BigDecimal score = entity.getScoreValue() != null ? entity.getScoreValue() : BigDecimal.ZERO;
83 84
         BigDecimal cascade = entity.getCascadeScore() != null ? entity.getCascadeScore() : BigDecimal.ZERO;
84 85
         entity.setTotalScore(score.add(cascade));
86
+        if (entity.getTotalScore().compareTo(BigDecimal.ZERO) > 0) {
87
+            entity.setScoreType(ScoreTypeEnum.PLUS.getCode());
88
+        } else if (entity.getTotalScore().compareTo(BigDecimal.ZERO) < 0) {
89
+            entity.setScoreType(ScoreTypeEnum.REDUCE.getCode());
90
+        } else {
91
+            entity.setScoreType(null);
92
+        }
85 93
         return toAjax(service.save(entity));
86 94
     }
87 95
 
@@ -98,6 +106,13 @@ public class ScoreEventController extends BaseController {
98 106
         BigDecimal score = entity.getScoreValue() != null ? entity.getScoreValue() : BigDecimal.ZERO;
99 107
         BigDecimal cascade = entity.getCascadeScore() != null ? entity.getCascadeScore() : BigDecimal.ZERO;
100 108
         entity.setTotalScore(score.add(cascade));
109
+        if (entity.getTotalScore().compareTo(BigDecimal.ZERO) > 0) {
110
+            entity.setScoreType(ScoreTypeEnum.PLUS.getCode());
111
+        } else if (entity.getTotalScore().compareTo(BigDecimal.ZERO) < 0) {
112
+            entity.setScoreType(ScoreTypeEnum.REDUCE.getCode());
113
+        } else {
114
+            entity.setScoreType(null);
115
+        }
101 116
         return toAjax(service.updateById(entity));
102 117
     }
103 118