Browse Source

新投放

jun.zhou 9 years ago
parent
commit
da5594cbc5

+ 8 - 0
src/main/java/com/cloudcross/ssp/model/mapper/place.sql.xml

@@ -62,4 +62,12 @@
 	<select id="queryPlaceNameByClassId" parameterType="java.lang.Long" resultType="java.lang.String">
 		select tp.name name from t_place tp,t_place_class tpc where tp.id = tpc.place_id and tpc.class_id = #{classId}
 	</select>
+	
+	<select id="queryPlace" resultType="com.cloudcross.ssp.model.Place">
+		select id,name from t_place
+	</select>
+	
+	<select id="queryPlaceCount" resultType="java.lang.Integer">
+		select count(id) from t_place
+	</select>
 </mapper>

+ 8 - 0
src/main/java/com/cloudcross/ssp/model/mapper/placeclass-information.sql.xml

@@ -25,4 +25,12 @@
 	<select id="queryClassIdByAdgroupId" parameterType="java.lang.Long" resultType="java.lang.Long">
 		select DISTINCT(class_id) classId from t_place_class where place_id in (select place_id from t_adgroup_place where adgroup_id = #{adgroupId})
 	</select>
+	
+	<select id="queryPlaceClass" resultType="com.cloudcross.ssp.model.PlaceClassInformation">
+		select id,name from t_place_class_info
+	</select>
+	
+	<select id="queryPlaceClassCount" resultType="java.lang.Integer">
+		select count(id) from t_place_class_info
+	</select>
 </mapper>

+ 40 - 0
src/main/java/com/cloudcross/ssp/model/mapper/wifi.sql.xml

@@ -440,4 +440,44 @@
 		select name from t_wifi where id = #{id}
 	</select>
 	
+	<select id="queryWifi" parameterType="java.util.Map" resultType="com.cloudcross.ssp.model.Wifi">
+		SELECT
+			tw.id id,
+			tw. NAME NAME,
+			tw.SSID SSID,
+			tl.cn cn,
+			tl.cn_city CnCity,
+			tw.longitude longitude,
+			tw.latitude latitude,
+			tw.address address,
+			tw.apmac apmac
+		FROM
+			t_wifi tw,
+			t_location tl
+		WHERE
+			tw.location = tl.location
+			and tw.status != -1
+			<if test="cn != null and cn != ''">
+				and cn = #{cn}
+			</if>
+			<if test="cnCity != null and cnCity != ''">
+				and cn_city = #{cnCity}
+			</if>
+	</select>
+	
+	<select id="queryWifiCount" parameterType="java.util.Map" resultType="java.lang.Integer">
+		SELECT count(tw.id)
+		FROM
+			t_wifi tw,
+			t_location tl
+		WHERE
+			tw.location = tl.location
+			and tw.status != -1
+			<if test="cn != null and cn != ''">
+				and cn = #{cn}
+			</if>
+			<if test="cnCity != null and cnCity != ''">
+				and cn_city = #{cnCity}
+			</if>
+	</select>
 </mapper>

+ 4 - 0
src/main/java/com/cloudcross/ssp/service/IPlaceClassInformationService.java

@@ -31,4 +31,8 @@ public interface IPlaceClassInformationService extends IGenericService<PlaceClas
 	List<PlaceClassInformation> queryPlaceClassInformationByAdgroupId(Long adgroupId);
 	
 	public List<Long>queryPlaceClassIndfoIdByAdgroupId(Long adgroupId);
+	
+	public Integer queryPlaceClassCount();
+	
+	public List<PlaceClassInformation> queryPlaceClass(Map<String,Object>condition);
 }

+ 6 - 0
src/main/java/com/cloudcross/ssp/service/IPlaceService.java

@@ -1,6 +1,7 @@
 package com.cloudcross.ssp.service;
 
 import java.util.List;
+import java.util.Map;
 
 import com.cloudcross.ssp.model.Place;
 import com.cloudcross.ssp.base.service.IGenericService;
@@ -36,4 +37,9 @@ public interface IPlaceService extends IGenericService<Place> {
 	List<Place> findPlaceByPlaceClassId(Long placeClassId);
 	
 	List<String>queryPlaceNameByClassId(Long classId);
+	
+	public Integer queryPlaceCount();
+	
+	public List<Place> queryPlace(Map<String,Object>condition);
+	
 }

+ 3 - 0
src/main/java/com/cloudcross/ssp/service/IWifiService.java

@@ -37,4 +37,7 @@ public interface IWifiService extends IGenericService<Wifi> {
 	public List<Wifi>findWifiByCondition(Map<String,Object>condition,Pager pager);
 	
 	public String queryWifiNameById(Long id);
+	
+	public Integer queryWifiCount(Map<String,Object>condition);
+	public List<Wifi> queryWifi(Map<String,Object>condition);
 }

+ 10 - 0
src/main/java/com/cloudcross/ssp/service/impl/PlaceClassInformationService.java

@@ -98,4 +98,14 @@ public class PlaceClassInformationService implements IPlaceClassInformationServi
 		return myBatisDao.getList("placeClassInformationSqlMapper.queryClassIdByAdgroupId", adgroupId);
 	}
 
+	@Override
+	public Integer queryPlaceClassCount() {
+		return myBatisDao.get("placeClassInformationSqlMapper.queryPlaceClassCount", null);
+	}
+
+	@Override
+	public List<PlaceClassInformation> queryPlaceClass(Map<String, Object> condition) {
+		return myBatisDao.getList("placeClassInformationSqlMapper.queryPlaceClass", condition);
+	}
+
 }

+ 8 - 0
src/main/java/com/cloudcross/ssp/service/impl/PlaceService.java

@@ -74,6 +74,14 @@ public class PlaceService implements IPlaceService {
 	public List<String> queryPlaceNameByClassId(Long classId) {
 		return ibatisDao.getList("placeSqlMapper.queryPlaceNameByClassId", classId);
 	}
+	@Override
+	public Integer queryPlaceCount() {
+		return ibatisDao.get("placeSqlMapper.queryPlaceCount", null);
+	}
+	@Override
+	public List<Place> queryPlace(Map<String, Object> condition) {
+		return ibatisDao.getList("placeSqlMapper.queryPlace", condition);
+	}
 
 
 }

+ 8 - 0
src/main/java/com/cloudcross/ssp/service/impl/WifiService.java

@@ -270,6 +270,14 @@ public class WifiService implements IWifiService{
 	public String queryWifiNameById(Long id){
 		return myBatisDao.get("wifiSqlMapper.queryWifiNameById", id);
 	}
+	@Override
+	public Integer queryWifiCount(Map<String, Object> condition) {
+		return myBatisDao.get("wifiSqlMapper.queryWifiCount", condition);
+	}
+	@Override
+	public List<Wifi> queryWifi(Map<String, Object> condition) {
+		return myBatisDao.getList("wifiSqlMapper.queryWifi", condition);
+	}
 	
 	
 }

+ 94 - 4
src/main/java/com/cloudcross/ssp/web/advertiser/main/ad/target/AdGroupAlloperatorController.java

@@ -11,18 +11,25 @@ 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 org.springframework.web.bind.annotation.ResponseBody;
 
 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.Place;
+import com.cloudcross.ssp.model.PlaceClassInformation;
 import com.cloudcross.ssp.model.PlaceOperator;
+import com.cloudcross.ssp.model.Wifi;
 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.IPlaceClassInformationService;
 import com.cloudcross.ssp.service.IPlaceOperatorService;
+import com.cloudcross.ssp.service.IPlaceService;
+import com.cloudcross.ssp.service.IWifiService;
 
 @Controller
 @RequestMapping("/advertiser/main/ad/target/ad-group-alloperator")
@@ -36,6 +43,12 @@ public class AdGroupAlloperatorController extends SimpleController{
 	private IOperatorService operatorService;
 	@Autowired
 	private IPlaceOperatorService placeOperatorService;
+	@Autowired
+	private IPlaceClassInformationService placeClassInformationService;
+	@Autowired
+	private IPlaceService placeService;
+	@Autowired
+	private IWifiService wifiService;
 	
 	@RequestMapping("create")
 	public String create(Model model, @RequestParam Long campaignId) {
@@ -70,7 +83,8 @@ public class AdGroupAlloperatorController extends SimpleController{
 	 * @return
 	 */
 	@RequestMapping("chooseOperator")
-	public String chooseOperatorWindow(Model model,@RequestParam(defaultValue = "1") int page){
+	@ResponseBody
+	public List<Operator> chooseOperatorWindow(Model model,@RequestParam(defaultValue = "1") int page){
 		Integer count = this.operatorService.queryAllOperatorCount();
 		Pager pager = new Pager();
 		pager.setPage(page);
@@ -79,9 +93,8 @@ public class AdGroupAlloperatorController extends SimpleController{
 		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");
+
+		return list;
 	}
 	
 	
@@ -89,6 +102,7 @@ public class AdGroupAlloperatorController extends SimpleController{
 	 * 选择媒体场景
 	 * 创建人:周俊
 	 * 创建时间:2015.12.11 17:52
+	 * 每个运营商场景显示:{场景ID,运营商名+运营商场景,数聚小场景}即:{id,getOperatorShowName(),placeId}其中placeId要传到后台
 	 * @return
 	 */
 	@RequestMapping("chooseOperatorPlace")
@@ -105,4 +119,80 @@ public class AdGroupAlloperatorController extends SimpleController{
 		model.addAttribute("list", list);
 		return page("operatorPlaceWindow");
 	}
+	
+	/**
+	 * 选择大场景
+	 * 创建人:周俊
+	 * 创建时间:2015-12-14 11.30
+	 * @param model
+	 * @param page
+	 * @return
+	 */
+	@RequestMapping("choosePlaceClass")
+	public String choosePlaceClassWindow(Model model,@RequestParam(defaultValue = "1") int page){
+		Integer count = this.placeClassInformationService.queryPlaceClassCount();
+		Pager pager = new Pager();
+		pager.setPage(page);
+		pager.setTotalRow(count);
+		
+		Map<String,Object> condition = new HashMap<String,Object>();
+		condition.put("pager", pager);
+		List<PlaceClassInformation> list = this.placeClassInformationService.queryPlaceClass(condition);
+		model.addAttribute("pager", pager);
+		model.addAttribute("list", list);
+		return page("placeClassWindow");
+	}
+	
+	/**
+	 * 选择小场景
+	 * @param model
+	 * @param page
+	 * @return
+	 */
+	@RequestMapping("choosePlace")
+	public String choosePlaceWindow(Model model,@RequestParam(defaultValue = "1") int page){
+		Integer count = this.placeService.queryPlaceCount();
+		Pager pager = new Pager();
+		pager.setPage(page);
+		pager.setTotalRow(count);
+		
+		Map<String,Object> condition = new HashMap<String,Object>();
+		condition.put("pager", pager);
+		List<Place> list = this.placeService.queryPlace(condition);
+		model.addAttribute("pager", pager);
+		model.addAttribute("list", list);
+		return page("placeWindow");
+	}
+	
+	/**
+	 * 选择终端
+	 * @param model
+	 * @param page
+	 * @param cnCity
+	 * @param cn
+	 * @return
+	 */
+	@RequestMapping("chooseWifi")
+	public String chooseWifiWindow(Model model,@RequestParam(defaultValue = "1") int page,String cnCity,String cn){
+		Map<String,Object> condition = new HashMap<String,Object>();
+		if( null != cnCity && !"".equals(cnCity)){
+			condition.put("cnCity", cnCity);
+		}
+		if( null != cn && !"".equals(cn)){
+			condition.put("cn", cn);
+		}
+		
+		Integer count = this.wifiService.queryWifiCount(condition);
+		Pager pager = new Pager();
+		pager.setPage(page);
+		pager.setTotalRow(count);
+		
+		
+		condition.put("pager", pager);
+		List<Wifi> list = this.wifiService.queryWifi(condition);
+		model.addAttribute("pager", pager);
+		model.addAttribute("list", list);
+		return page("wifiWindow");
+	}
+	
 }

+ 0 - 0
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/chooseWifi.ftl


+ 0 - 0
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/create.ftl


+ 0 - 0
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/operatorPlaceWindow.ftl


+ 0 - 0
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/placeClassWindow.ftl


+ 0 - 0
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/placeWindow.ftl


+ 1 - 0
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/operator-ad-group/list.ftl

@@ -69,6 +69,7 @@
 						<a class="btn2" id="all-btn-enable">批量开启</a>
 						<a class="btn2" id="all-btn-disable">批量停用</a>
 						<a class="btn2" id="all-btn-delete">批量删除</a>
+						<a href="${ctx}/advertiser/main/ad/target/ad-group-alloperator/create?campaignId=${campaignId!}" class="btn2" id="btn-create">投放</a>
 					</div>
 					<div id="searchValueDiv">
 						<input type="hidden" id="page" name="page" value="${pager.page}"/>