Commit 1fed98b3 authored by “yiyousong”'s avatar “yiyousong”
parents 528a22ed ce2c084c
......@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -261,14 +262,23 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
String busiDesc = "查询" + this.getModuleDesc();
int code = 1;
try {
if (CollectionUtils.isNotEmpty(query.getAreaCodeList())) {
List<SiteEntity> siteEntityList = query.getAreaCodeList().parallelStream().flatMap(areaId ->
this.service.getFlatSitesByAreaCode(areaId, getContext()).stream()
).distinct().collect(Collectors.toList());
if(this.getCurUser().getId()==1){
List<SiteEntity> siteEntityList = new ArrayList<>();
SiteEntity siteEntity = new SiteEntity();
siteEntity.setId(0l);
siteEntity.setSiteName("无站点");
siteEntityList.add(siteEntity);
model.put("data", siteEntityList);
} else {
List<SiteEntity> result = this.getService().find(query, context);
model.put("data", result);
}else {
if (CollectionUtils.isNotEmpty(query.getAreaCodeList())) {
List<SiteEntity> siteEntityList = query.getAreaCodeList().parallelStream().flatMap(areaId ->
this.service.getFlatSitesByAreaCode(areaId, getContext()).stream()
).distinct().collect(Collectors.toList());
model.put("data", siteEntityList);
} else {
List<SiteEntity> result = this.getService().find(query, context);
model.put("data", result);
}
}
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment