|
@@ -2,12 +2,17 @@ package com.fdkankan.fusion.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.fusion.entity.CaseSettings;
|
|
|
+import com.fdkankan.fusion.entity.MapConfig;
|
|
|
import com.fdkankan.fusion.mapper.ICaseSettingsMapper;
|
|
|
import com.fdkankan.fusion.service.ICaseSettingsService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fdkankan.fusion.service.IMapConfigService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -20,10 +25,25 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class CaseSettingsServiceImpl extends ServiceImpl<ICaseSettingsMapper, CaseSettings> implements ICaseSettingsService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ IMapConfigService mapConfigService;
|
|
|
@Override
|
|
|
public List<CaseSettings> getByCaseId(Integer caseId) {
|
|
|
LambdaQueryWrapper<CaseSettings> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(CaseSettings::getCaseId,caseId);
|
|
|
- return this.list(wrapper);
|
|
|
+ List<CaseSettings> list = this.list(wrapper);
|
|
|
+ List<Integer> mapIds = list.stream().map(CaseSettings::getMapId).collect(Collectors.toList());
|
|
|
+ if(!mapIds.isEmpty()){
|
|
|
+ HashMap<Integer,MapConfig> map = mapConfigService.getMapByIds(mapIds);
|
|
|
+ for (CaseSettings caseSettings : list) {
|
|
|
+ if(caseSettings.getMapId() != null && map.get(caseSettings.getMapId()) != null){
|
|
|
+ MapConfig mapConfig = map.get(caseSettings.getMapId());
|
|
|
+ caseSettings.setMapConfig(mapConfig);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
}
|
|
|
}
|