Selaa lähdekoodia

配分事项表

chenshudong 1 viikko sitten
vanhempi
commit
d83026492b

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

@@ -16,6 +16,8 @@ import com.sundot.airport.ledger.domain.ScoreIndicator;
16 16
 import com.sundot.airport.ledger.mapper.ScoreIndicatorMapper;
17 17
 import com.sundot.airport.ledger.service.IScoreEventService;
18 18
 import com.sundot.airport.ledger.service.IScoreIndicatorService;
19
+import com.sundot.airport.system.domain.BasePosition;
20
+import com.sundot.airport.system.service.IBasePositionService;
19 21
 import org.springframework.beans.factory.annotation.Autowired;
20 22
 import org.springframework.security.access.prepost.PreAuthorize;
21 23
 import org.springframework.validation.annotation.Validated;
@@ -41,6 +43,9 @@ public class ScoreEventController extends BaseController {
41 43
     @Autowired
42 44
     private IScoreIndicatorService indicatorService;
43 45
 
46
+    @Autowired
47
+    private IBasePositionService basePositionService;
48
+
44 49
     @PreAuthorize("@ss.hasPermi('score:event:list')")
45 50
     @GetMapping("/list")
46 51
     public TableDataInfo list(ScoreEvent query) {
@@ -152,6 +157,16 @@ public class ScoreEventController extends BaseController {
152 157
                 entity.setLevel4Id(level4Id);
153 158
             }
154 159
         }
160
+
161
+        // 通过区域查找航站楼
162
+        BasePosition terminl = findTerminlByRegionalId(entity.getRegionalId());
163
+        if (terminl != null) {
164
+            entity.setTerminlId(terminl.getId());
165
+            entity.setTerminlName(terminl.getName());
166
+        } else {
167
+            entity.setTerminlId(null);
168
+            entity.setTerminlName(null);
169
+        }
155 170
     }
156 171
 
157 172
     /**
@@ -166,4 +181,18 @@ public class ScoreEventController extends BaseController {
166 181
         ScoreIndicator indicator = indicatorService.getOne(wrapper);
167 182
         return indicator != null ? indicator.getId() : null;
168 183
     }
184
+
185
+    /**
186
+     * 通过区域查找航站楼
187
+     */
188
+    private BasePosition findTerminlByRegionalId(Long regionalId) {
189
+        if (regionalId == null) {
190
+            return null;
191
+        }
192
+        BasePosition regional = basePositionService.selectBasePositionById(regionalId);
193
+        if (regional == null) {
194
+            return null;
195
+        }
196
+        return basePositionService.selectBasePositionById(regional.getParentId());
197
+    }
169 198
 }

+ 1 - 1
airport-ledger/src/main/resources/mapper/ledger/ScoreEventMapper.xml

@@ -81,7 +81,7 @@
81 81
         <if test="channelName != null and channelName != ''">AND channel_name LIKE CONCAT('%', #{channelName}, '%')</if>
82 82
         <if test="postId != null">AND post_id = #{postId}</if>
83 83
         <if test="postName != null and postName != ''">AND post_name LIKE CONCAT('%', #{postName}, '%')</if>
84
-        <if test="scoreType != null and scoreType != ''">AND score_type = #{scoreType}</if>
84
+        <if test="scoreType != null and scoreType != '' and scoreType != '0'">AND score_type = #{scoreType}</if>
85 85
         <if test="personName != null and personName != ''">AND person_name LIKE CONCAT('%', #{personName}, '%')</if>
86 86
         <if test="deptName != null and deptName != ''">AND dept_name LIKE CONCAT('%', #{deptName}, '%')</if>
87 87
         <if test="teamName != null and teamName != ''">AND team_name LIKE CONCAT('%', #{teamName}, '%')</if>