|
@@ -0,0 +1,108 @@
|
|
|
+package com.cloudcross.ssp.web.advertiser.main.ad.target;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.LinkedHashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.Model;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+
|
|
|
+import com.cloudcross.ssp.base.web.SimpleController;
|
|
|
+import com.cloudcross.ssp.common.utils.Pager;
|
|
|
+import com.cloudcross.ssp.model.Account;
|
|
|
+import com.cloudcross.ssp.model.Location;
|
|
|
+import com.cloudcross.ssp.model.Operator;
|
|
|
+import com.cloudcross.ssp.model.PlaceOperator;
|
|
|
+import com.cloudcross.ssp.model.pojo.CampaignPojo;
|
|
|
+import com.cloudcross.ssp.service.ICampaignService;
|
|
|
+import com.cloudcross.ssp.service.ILocationService;
|
|
|
+import com.cloudcross.ssp.service.IOperatorService;
|
|
|
+import com.cloudcross.ssp.service.IPlaceOperatorService;
|
|
|
+
|
|
|
+@Controller
|
|
|
+@RequestMapping("/advertiser/main/ad/target/ad-group-alloperator")
|
|
|
+public class AdGroupAlloperatorController extends SimpleController{
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICampaignService campaignService;
|
|
|
+ @Autowired
|
|
|
+ private ILocationService locationService;
|
|
|
+ @Autowired
|
|
|
+ private IOperatorService operatorService;
|
|
|
+ @Autowired
|
|
|
+ private IPlaceOperatorService placeOperatorService;
|
|
|
+
|
|
|
+ @RequestMapping("create")
|
|
|
+ public String create(Model model, @RequestParam Long campaignId) {
|
|
|
+ Account account = getLoginUser();
|
|
|
+ Long operatorId = account.getOperatorId();
|
|
|
+
|
|
|
+ Map<String,Object> condition = new HashMap<String,Object>();
|
|
|
+ condition.put("operatorId", operatorId);
|
|
|
+ List<Integer> positionList = new ArrayList<Integer>();
|
|
|
+ positionList.add(1);
|
|
|
+ condition.put("positionList", positionList);
|
|
|
+ //List<Zone> zoneList = zoneService.queryZoneByCondition(condition);//获取广告位
|
|
|
+ CampaignPojo campaign = campaignService.findCampaignById(campaignId);
|
|
|
+ //找到所有的场景,并且显示出来
|
|
|
+ //List<PlaceClassInformation> placeList = placeClassInformationService.findAll();
|
|
|
+
|
|
|
+
|
|
|
+ model.addAttribute("campaignId", campaignId);
|
|
|
+ model.addAttribute("advertiserId", campaign.getAdvertiserId());
|
|
|
+ model.addAttribute("orderId", campaign.getOrderId());
|
|
|
+ model.addAttribute("agentId", campaign.getAgentId());
|
|
|
+ model.addAttribute("budget", campaign.getTotalBudget());
|
|
|
+ //model.addAttribute("placeList",placeList);
|
|
|
+ //model.addAttribute("zoneList",zoneList);
|
|
|
+ return page("create");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 到选择媒体弹窗
|
|
|
+ * 创建人:周俊
|
|
|
+ * 创建时间:2015.12.11 17:00
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("chooseOperator")
|
|
|
+ public String chooseOperatorWindow(Model model,@RequestParam(defaultValue = "1") int page){
|
|
|
+ Integer count = this.operatorService.queryAllOperatorCount();
|
|
|
+ Pager pager = new Pager();
|
|
|
+ pager.setPage(page);
|
|
|
+ pager.setTotalRow(count);
|
|
|
+
|
|
|
+ Map<String,Object> condition = new HashMap<String,Object>();
|
|
|
+ condition.put("pager", pager);
|
|
|
+ List<Operator> list = this.operatorService.queryAllOperator(condition);
|
|
|
+ model.addAttribute("pager", pager);
|
|
|
+ model.addAttribute("list", list);
|
|
|
+ return page("operatorwindow");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 选择媒体场景
|
|
|
+ * 创建人:周俊
|
|
|
+ * 创建时间:2015.12.11 17:52
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("chooseOperatorPlace")
|
|
|
+ public String chooseOperatorPlaceWindow(Model model,@RequestParam(defaultValue = "1") int page){
|
|
|
+ Integer count = this.placeOperatorService.queryOperatorPlaceCount();
|
|
|
+ Pager pager = new Pager();
|
|
|
+ pager.setPage(page);
|
|
|
+ pager.setTotalRow(count);
|
|
|
+
|
|
|
+ Map<String,Object> condition = new HashMap<String,Object>();
|
|
|
+ condition.put("pager", pager);
|
|
|
+ List<PlaceOperator> list = this.placeOperatorService.queryOperatorPlace(condition);
|
|
|
+ model.addAttribute("pager", pager);
|
|
|
+ model.addAttribute("list", list);
|
|
|
+ return page("operatorPlaceWindow");
|
|
|
+ }
|
|
|
+}
|