医院,仓库查询代码
This commit is contained in:
parent
36b0878659
commit
afd861e39d
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.hivekion.scenario.entity.Vehicle;
|
import com.hivekion.scenario.entity.Vehicle;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -18,6 +19,8 @@ public interface IResourceService extends IService<Resource> {
|
||||||
|
|
||||||
public List<Resource> listAllBuildResourceByType(Integer type);
|
public List<Resource> listAllBuildResourceByType(Integer type);
|
||||||
|
|
||||||
|
public Map<Integer,Resource> listBuildResourceByType(Integer type);
|
||||||
|
|
||||||
public List<Vehicle> listAllVehiclesByType(Integer type,Integer resourceId);
|
public List<Vehicle> listAllVehiclesByType(Integer type,Integer resourceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,6 +44,15 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
|
||||||
return this.resourceMapper.selectList(queryWrapper);
|
return this.resourceMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Integer, Resource> listBuildResourceByType(Integer type) {
|
||||||
|
QueryWrapper<Resource> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(type != null,"resource_type",type);
|
||||||
|
List<Resource> resources = this.resourceMapper.selectList(queryWrapper);
|
||||||
|
Map<Integer,Resource> resourceMap = resources.stream().collect(Collectors.toMap(Resource::getId,resource -> resource));
|
||||||
|
return resourceMap;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Vehicle> listAllVehiclesByType(Integer type, Integer resourceId) {
|
public List<Vehicle> listAllVehiclesByType(Integer type, Integer resourceId) {
|
||||||
List<ResourceVehicleRela> rVRela = this.resourceVehicleRelaService.list(new QueryWrapper<ResourceVehicleRela>().eq("resource_id",resourceId));
|
List<ResourceVehicleRela> rVRela = this.resourceVehicleRelaService.list(new QueryWrapper<ResourceVehicleRela>().eq("resource_id",resourceId));
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.hivekion.baseData.service.ITblEntityService;
|
||||||
import com.hivekion.icon.service.IconService;
|
import com.hivekion.icon.service.IconService;
|
||||||
import com.hivekion.scenario.entity.ScenarioResource;
|
import com.hivekion.scenario.entity.ScenarioResource;
|
||||||
import com.hivekion.scenario.mapper.ScenarioResourceMapper;
|
import com.hivekion.scenario.mapper.ScenarioResourceMapper;
|
||||||
|
import com.hivekion.scenario.service.IResourceService;
|
||||||
import com.hivekion.scenario.service.ScenarioResourceService;
|
import com.hivekion.scenario.service.ScenarioResourceService;
|
||||||
import com.hivekion.team.entity.Teaminfo;
|
import com.hivekion.team.entity.Teaminfo;
|
||||||
import com.hivekion.team.service.ITeaminfoService;
|
import com.hivekion.team.service.ITeaminfoService;
|
||||||
|
@ -35,6 +36,9 @@ public class ScenarioResourceServiceImpl extends
|
||||||
@Resource
|
@Resource
|
||||||
private ITeaminfoService teamInfoService;
|
private ITeaminfoService teamInfoService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IResourceService resourceService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ScenarioResource> getResourceList(ScenarioResource resource) {
|
public List<ScenarioResource> getResourceList(ScenarioResource resource) {
|
||||||
//图标Map
|
//图标Map
|
||||||
|
@ -43,6 +47,8 @@ public class ScenarioResourceServiceImpl extends
|
||||||
Map<Integer, TblEntity> entityMap = iTblEntityService.entityMap();
|
Map<Integer, TblEntity> entityMap = iTblEntityService.entityMap();
|
||||||
//分队Map
|
//分队Map
|
||||||
Map<Integer, Teaminfo> teamInfoMap = teamInfoService.teamInfoMap();
|
Map<Integer, Teaminfo> teamInfoMap = teamInfoService.teamInfoMap();
|
||||||
|
Map<Integer,com.hivekion.scenario.entity.Resource> hResourceMap = resourceService.listBuildResourceByType(7);
|
||||||
|
Map<Integer,com.hivekion.scenario.entity.Resource> wResourceMap = resourceService.listBuildResourceByType(8);
|
||||||
QueryWrapper<ScenarioResource> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ScenarioResource> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("scenario_id", resource.getScenarioId());
|
queryWrapper.eq("scenario_id", resource.getScenarioId());
|
||||||
if (resource.getType() != null) {
|
if (resource.getType() != null) {
|
||||||
|
@ -72,6 +78,22 @@ public class ScenarioResourceServiceImpl extends
|
||||||
iconMap.get(teaminfo.getIconId()) == null ? "" : iconMap.get(teaminfo.getIconId()));
|
iconMap.get(teaminfo.getIconId()) == null ? "" : iconMap.get(teaminfo.getIconId()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
if(hResourceMap.get(scenarioResource.getResourceId()) != null){
|
||||||
|
com.hivekion.scenario.entity.Resource resource1 = hResourceMap.get(scenarioResource.getResourceId());
|
||||||
|
scenarioResource.setTitle(resource1.getResourceName());
|
||||||
|
scenarioResource.setImgBase64(
|
||||||
|
iconMap.get(resource1.getIcon()) == null ? "" : iconMap.get(resource1.getIcon()));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
if(wResourceMap.get(scenarioResource.getResourceId()) != null){
|
||||||
|
com.hivekion.scenario.entity.Resource resource1 = wResourceMap.get(scenarioResource.getResourceId());
|
||||||
|
scenarioResource.setTitle(resource1.getResourceName());
|
||||||
|
scenarioResource.setImgBase64(
|
||||||
|
iconMap.get(resource1.getIcon()) == null ? "" : iconMap.get(resource1.getIcon()));
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return scenarioResourceList;
|
return scenarioResourceList;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user