|
@@ -230,7 +230,7 @@ public class OperatorAdGroupController extends SimpleController{
|
|
|
*/
|
|
|
@RequestMapping("/zonelist")
|
|
|
@ResponseBody
|
|
|
- public List<Zone> queryZoneByPosition(String position){
|
|
|
+ public List<Zone> queryZoneByPosition(String position,Long adgroupId){
|
|
|
Map<String,Object>condition = new HashMap<String,Object>();
|
|
|
List<Integer> positionList = new ArrayList<Integer>();
|
|
|
if(position != null && position != ""){
|
|
@@ -240,7 +240,11 @@ public class OperatorAdGroupController extends SimpleController{
|
|
|
}
|
|
|
condition.put("positionList", positionList);
|
|
|
condition.put("operatorId", getLoginUser().getOperatorId());
|
|
|
- return this.zoneService.queryZoneByCondition(condition);
|
|
|
+ //所有满足条件的广告位
|
|
|
+ List<Zone>all = this.zoneService.queryZoneByCondition(condition);
|
|
|
+ //已选广告位
|
|
|
+ List<Zone> selectZoneList = this.zoneService.queryZoneByAdgroupId(adgroupId);
|
|
|
+ return getUnSelectZoneList(selectZoneList,all);
|
|
|
}
|
|
|
return new ArrayList<Zone>();
|
|
|
}
|
|
@@ -301,7 +305,6 @@ public class OperatorAdGroupController extends SimpleController{
|
|
|
}
|
|
|
placeIdStr = placeIdStr + selectedPlaceList.get(i).getId();
|
|
|
}
|
|
|
- model.addAttribute("placeStatus", placeStatus);
|
|
|
model.addAttribute("placeIdStr", placeIdStr);
|
|
|
model.addAttribute("placeList", placeList);
|
|
|
}
|
|
@@ -321,17 +324,20 @@ public class OperatorAdGroupController extends SimpleController{
|
|
|
continue;
|
|
|
}
|
|
|
placeIdStr = placeIdStr + selectGroupList.get(i).getId();
|
|
|
- }
|
|
|
- model.addAttribute("placeStatus", placeStatus);
|
|
|
+ }
|
|
|
model.addAttribute("placeIdStr", placeIdStr);
|
|
|
model.addAttribute("placeList", allWifiGroupInfoList);
|
|
|
}
|
|
|
-
|
|
|
+ model.addAttribute("placeStatus", placeStatus);
|
|
|
|
|
|
//已选广告位
|
|
|
List<Zone> selectZoneList = this.zoneService.queryZoneByAdgroupId(id);
|
|
|
+ Map<String,Object> condition = new HashMap<String,Object>();
|
|
|
+ condition.put("operatorId", getLoginUser().getOperatorId());
|
|
|
+ //全部广告位
|
|
|
+ List<Zone> allZoneList = zoneService.queryZoneByCondition(condition);
|
|
|
//未选广告位
|
|
|
- List<Zone> unselectZoneList = getUnSelectZoneList(selectZoneList);
|
|
|
+ List<Zone> unselectZoneList = getUnSelectZoneList(selectZoneList,allZoneList);
|
|
|
model.addAttribute("selectZoneList", selectZoneList);
|
|
|
model.addAttribute("unselectZoneList", unselectZoneList);
|
|
|
|
|
@@ -415,28 +421,23 @@ public class OperatorAdGroupController extends SimpleController{
|
|
|
* @param select 已选广告位
|
|
|
* @return 未选广告位
|
|
|
*/
|
|
|
- private List<Zone> getUnSelectZoneList(List<Zone> select){
|
|
|
- Map<String,Object> condition = new HashMap<String,Object>();
|
|
|
- condition.put("operatorId", getLoginUser().getOperatorId());
|
|
|
- //全部广告位
|
|
|
- List<Zone> allZoneList = zoneService.queryZoneByCondition(condition);
|
|
|
-
|
|
|
- if(select != null && select.size()>0){
|
|
|
+ private List<Zone> getUnSelectZoneList(List<Zone> select,List<Zone>all){
|
|
|
+ if(select != null && select.size()>0 &&all != null && all.size()>0){
|
|
|
int selectLen = select.size();
|
|
|
- int allLen = allZoneList.size();
|
|
|
+ int allLen = all.size();
|
|
|
for(int i=0;i<selectLen;i++){
|
|
|
Long selectId = select.get(i).getId();
|
|
|
for(int j=0;j<allLen;j++){
|
|
|
- Long allId = allZoneList.get(j).getId();
|
|
|
+ Long allId = all.get(j).getId();
|
|
|
if(selectId.equals(allId)){
|
|
|
- allZoneList.remove(j);
|
|
|
+ all.remove(j);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- return allZoneList;
|
|
|
+ return all;
|
|
|
}
|
|
|
|
|
|
/**
|