|
@@ -281,19 +281,52 @@ public class OperatorAdGroupController extends SimpleController{
|
|
Campaign campaign = campaignService.findById(adGroup.getCampaignId());
|
|
Campaign campaign = campaignService.findById(adGroup.getCampaignId());
|
|
model.addAttribute("budget", campaign.getTotalBudget());
|
|
model.addAttribute("budget", campaign.getTotalBudget());
|
|
|
|
|
|
- //找到所有的大场景场景,并且显示出来
|
|
|
|
- List<PlaceClassInformation> placeList = placeClassInformationService.findAll();
|
|
|
|
|
|
+ Integer placeStatus = -1;//场景状态 1表示场景,2表示分组
|
|
|
|
+ String placeIdStr = "";
|
|
|
|
+ int len = 0;
|
|
|
|
+ /**
|
|
|
|
+ * 处理场景
|
|
|
|
+ */
|
|
//找到已选场景,拼接ID字符串
|
|
//找到已选场景,拼接ID字符串
|
|
List<PlaceClassInformation> selectedPlaceList = this.placeClassInformationService.queryPlaceClassInformationByAdgroupId(id);
|
|
List<PlaceClassInformation> selectedPlaceList = this.placeClassInformationService.queryPlaceClassInformationByAdgroupId(id);
|
|
- String placeIdStr = "";
|
|
|
|
- for(PlaceClassInformation pci:selectedPlaceList){
|
|
|
|
- placeIdStr = placeIdStr + pci.getId()+",";
|
|
|
|
|
|
+ if(null != selectedPlaceList && selectedPlaceList.size()>0){
|
|
|
|
+ placeStatus = 1;
|
|
|
|
+ //找到所有的大场景场景,并且显示出来
|
|
|
|
+ List<PlaceClassInformation> placeList = placeClassInformationService.findAll();
|
|
|
|
+ len = selectedPlaceList.size();
|
|
|
|
+ for(int i=0;i<len;i++){
|
|
|
|
+ if(i<len-1){
|
|
|
|
+ placeIdStr = placeIdStr + selectedPlaceList.get(i).getId()+",";
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ placeIdStr = placeIdStr + selectedPlaceList.get(i).getId();
|
|
|
|
+ }
|
|
|
|
+ model.addAttribute("placeStatus", placeStatus);
|
|
|
|
+ model.addAttribute("placeIdStr", placeIdStr);
|
|
|
|
+ model.addAttribute("placeList", placeList);
|
|
}
|
|
}
|
|
- if(null != placeIdStr && !"".equals(placeIdStr)){
|
|
|
|
- placeIdStr = placeIdStr.substring(0, placeIdStr.length()-1);
|
|
|
|
|
|
+
|
|
|
|
+ //已选分组,字符串拼接
|
|
|
|
+ List<WifiGroupInfo> selectGroupList = this.wifiGroupInfoService.queryWifiGroupInfoByadgroupId(id);
|
|
|
|
+ if(selectGroupList != null && selectGroupList.size()>0){
|
|
|
|
+ placeStatus = 2;
|
|
|
|
+ //全部分组
|
|
|
|
+ Map<String,Object>condition = new HashMap<String,Object>();
|
|
|
|
+ condition.put("operatorId", getLoginUser().getOperatorId());
|
|
|
|
+ List<WifiGroupInfo> allWifiGroupInfoList = this.wifiGroupInfoService.queryWifiGroupInfoByCondition(condition);
|
|
|
|
+ len = selectGroupList.size();
|
|
|
|
+ for(int i=0;i<len;i++){
|
|
|
|
+ if(i<len-1){
|
|
|
|
+ placeIdStr = placeIdStr + selectGroupList.get(i).getId() + ",";
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ placeIdStr = placeIdStr + selectGroupList.get(i).getId();
|
|
|
|
+ }
|
|
|
|
+ model.addAttribute("placeStatus", placeStatus);
|
|
|
|
+ model.addAttribute("placeIdStr", placeIdStr);
|
|
|
|
+ model.addAttribute("placeList", allWifiGroupInfoList);
|
|
}
|
|
}
|
|
- model.addAttribute("placeIdStr", placeIdStr);
|
|
|
|
- model.addAttribute("placeList", placeList);
|
|
|
|
|
|
+
|
|
|
|
|
|
//已选广告位
|
|
//已选广告位
|
|
List<Zone> selectZoneList = this.zoneService.queryZoneByAdgroupId(id);
|
|
List<Zone> selectZoneList = this.zoneService.queryZoneByAdgroupId(id);
|
|
@@ -302,21 +335,7 @@ public class OperatorAdGroupController extends SimpleController{
|
|
model.addAttribute("selectZoneList", selectZoneList);
|
|
model.addAttribute("selectZoneList", selectZoneList);
|
|
model.addAttribute("unselectZoneList", unselectZoneList);
|
|
model.addAttribute("unselectZoneList", unselectZoneList);
|
|
|
|
|
|
- //全部分组
|
|
|
|
- Map<String,Object>condition = new HashMap<String,Object>();
|
|
|
|
- condition.put("operatorId", getLoginUser().getOperatorId());
|
|
|
|
- List<WifiGroupInfo> allWifiGroupInfoList = this.wifiGroupInfoService.queryWifiGroupInfoByCondition(condition);
|
|
|
|
- //已选分组,字符串拼接
|
|
|
|
- List<WifiGroupInfo> selectGroupList = this.wifiGroupInfoService.queryWifiGroupInfoByadgroupId(id);
|
|
|
|
- String groupIdStr = "";
|
|
|
|
- for(WifiGroupInfo group:selectGroupList){
|
|
|
|
- groupIdStr = groupIdStr + group.getId() + ",";
|
|
|
|
- }
|
|
|
|
- if(null != groupIdStr && !"".equals(groupIdStr)){
|
|
|
|
- groupIdStr = groupIdStr.substring(0,groupIdStr.length()-1);
|
|
|
|
- }
|
|
|
|
- model.addAttribute("groupIdStr", groupIdStr);
|
|
|
|
- model.addAttribute("allWifiGroupInfoList", allWifiGroupInfoList);
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
// 千次转换
|
|
// 千次转换
|
|
@@ -375,7 +394,13 @@ public class OperatorAdGroupController extends SimpleController{
|
|
model.addAttribute("time", tmpDirect.getBackShow());
|
|
model.addAttribute("time", tmpDirect.getBackShow());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ model.addAttribute("campaignId", campaignId);
|
|
|
|
+ model.addAttribute("advertiserId", campaign.getAdvertiserId());
|
|
|
|
+ model.addAttribute("orderId", campaign.getOrderId());
|
|
|
|
+ model.addAttribute("agentId", campaign.getAgentId());
|
|
|
|
+
|
|
model.addAttribute("areas", areas);
|
|
model.addAttribute("areas", areas);
|
|
model.addAttribute("selectedwifi", selectedWifi);
|
|
model.addAttribute("selectedwifi", selectedWifi);
|
|
model.addAttribute("cacheSelected", cacheSelected);
|
|
model.addAttribute("cacheSelected", cacheSelected);
|
|
@@ -390,12 +415,27 @@ public class OperatorAdGroupController extends SimpleController{
|
|
* @param select 已选广告位
|
|
* @param select 已选广告位
|
|
* @return 未选广告位
|
|
* @return 未选广告位
|
|
*/
|
|
*/
|
|
- List<Zone> getUnSelectZoneList(List<Zone> select){
|
|
|
|
|
|
+ private List<Zone> getUnSelectZoneList(List<Zone> select){
|
|
Map<String,Object> condition = new HashMap<String,Object>();
|
|
Map<String,Object> condition = new HashMap<String,Object>();
|
|
condition.put("operatorId", getLoginUser().getOperatorId());
|
|
condition.put("operatorId", getLoginUser().getOperatorId());
|
|
//全部广告位
|
|
//全部广告位
|
|
List<Zone> allZoneList = zoneService.queryZoneByCondition(condition);
|
|
List<Zone> allZoneList = zoneService.queryZoneByCondition(condition);
|
|
- allZoneList.removeAll(select);
|
|
|
|
|
|
+
|
|
|
|
+ if(select != null && select.size()>0){
|
|
|
|
+ int selectLen = select.size();
|
|
|
|
+ int allLen = allZoneList.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();
|
|
|
|
+ if(selectId.equals(allId)){
|
|
|
|
+ allZoneList.remove(j);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
return allZoneList;
|
|
return allZoneList;
|
|
}
|
|
}
|
|
|
|
|