Explorar o código

配分事项表

chenshudong hai 1 semana
pai
achega
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
 import com.sundot.airport.common.core.domain.AjaxResult;
9
 import com.sundot.airport.common.core.domain.AjaxResult;
10
 import com.sundot.airport.common.core.page.TableDataInfo;
10
 import com.sundot.airport.common.core.page.TableDataInfo;
11
 import com.sundot.airport.common.enums.BusinessType;
11
 import com.sundot.airport.common.enums.BusinessType;
12
+import com.sundot.airport.common.enums.ScoreTypeEnum;
12
 import com.sundot.airport.common.utils.DateUtils;
13
 import com.sundot.airport.common.utils.DateUtils;
13
 import com.sundot.airport.common.utils.poi.ExcelUtil;
14
 import com.sundot.airport.common.utils.poi.ExcelUtil;
14
 import com.sundot.airport.ledger.domain.ScoreEvent;
15
 import com.sundot.airport.ledger.domain.ScoreEvent;
@@ -82,6 +83,13 @@ public class ScoreEventController extends BaseController {
82
         BigDecimal score = entity.getScoreValue() != null ? entity.getScoreValue() : BigDecimal.ZERO;
83
         BigDecimal score = entity.getScoreValue() != null ? entity.getScoreValue() : BigDecimal.ZERO;
83
         BigDecimal cascade = entity.getCascadeScore() != null ? entity.getCascadeScore() : BigDecimal.ZERO;
84
         BigDecimal cascade = entity.getCascadeScore() != null ? entity.getCascadeScore() : BigDecimal.ZERO;
84
         entity.setTotalScore(score.add(cascade));
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
         return toAjax(service.save(entity));
93
         return toAjax(service.save(entity));
86
     }
94
     }
87
 
95
 
@@ -98,6 +106,13 @@ public class ScoreEventController extends BaseController {
98
         BigDecimal score = entity.getScoreValue() != null ? entity.getScoreValue() : BigDecimal.ZERO;
106
         BigDecimal score = entity.getScoreValue() != null ? entity.getScoreValue() : BigDecimal.ZERO;
99
         BigDecimal cascade = entity.getCascadeScore() != null ? entity.getCascadeScore() : BigDecimal.ZERO;
107
         BigDecimal cascade = entity.getCascadeScore() != null ? entity.getCascadeScore() : BigDecimal.ZERO;
100
         entity.setTotalScore(score.add(cascade));
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
         return toAjax(service.updateById(entity));
116
         return toAjax(service.updateById(entity));
102
     }
117
     }
103
 
118