|
@@ -23,6 +23,7 @@ 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.listener.InitData;
|
|
|
import com.cloudcross.ssp.model.Account;
|
|
|
import com.cloudcross.ssp.base.utils.freemarker.FreemarkerTemplateProcessor;
|
|
|
import com.cloudcross.ssp.base.web.SimpleController;
|
|
@@ -39,6 +40,7 @@ import com.cloudcross.ssp.model.pojo.PlaceNamePojo;
|
|
|
import com.cloudcross.ssp.service.ILocationService;
|
|
|
import com.cloudcross.ssp.service.ILogService;
|
|
|
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;
|
|
@@ -65,7 +67,7 @@ public class ApmacController extends SimpleController {
|
|
|
@Autowired
|
|
|
private FreemarkerTemplateProcessor templateProcessor;
|
|
|
@Autowired
|
|
|
- private IPlaceService placeService;
|
|
|
+ private IPlaceClassInformationService placeClassInformationService;
|
|
|
@Autowired
|
|
|
private IOperatorService operatorService;
|
|
|
|
|
@@ -90,9 +92,12 @@ public class ApmacController extends SimpleController {
|
|
|
String cn = null;
|
|
|
String cnCity = null;
|
|
|
String place = null;
|
|
|
- Long placeId = null;
|
|
|
+ Long placeClassId = null;
|
|
|
String placeName = null;
|
|
|
String searchValue = null;
|
|
|
+ String location = null;
|
|
|
+ List<Long> placeIdList = null;
|
|
|
+
|
|
|
/**
|
|
|
* 下面对传递过来的几个参数进行处理
|
|
|
*/
|
|
@@ -104,17 +109,35 @@ public class ApmacController extends SimpleController {
|
|
|
cnCity = String.valueOf(paramMap.get("cnCity"));
|
|
|
}
|
|
|
|
|
|
+ // 根据cn和cnCity得到它的location
|
|
|
+ if (null != cn || null != cnCity) {
|
|
|
+ if (null != cn && null != cnCity) {
|
|
|
+ location = InitData.getLocation(cn, cnCity);
|
|
|
+ }
|
|
|
+
|
|
|
+ //如果cn不空,cnCity为空则表明应该是选该省下的所有的市
|
|
|
+ if (null != cn) {
|
|
|
+ location = InitData.getLocation(cn);
|
|
|
+ location = location.substring(0, (location.length() - 2)) + "%";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(null != paramMap.get("placeId") && !"".equals(paramMap.get("placeId"))) {
|
|
|
- placeId = Long.parseLong(String.valueOf(paramMap.get("placeId")));
|
|
|
+ placeClassId = Long.parseLong(String.valueOf(paramMap.get("placeId")));
|
|
|
}
|
|
|
|
|
|
+ // 通过数聚场景id得到数聚子场景的id的集合
|
|
|
+ if (null != placeClassId) {
|
|
|
+ placeIdList = InitData.placeClassMap.get(placeClassId.intValue());
|
|
|
+ }
|
|
|
+
|
|
|
if(null != paramMap.get("place") && !"".equals(paramMap.get("place"))) {
|
|
|
place = String.valueOf(paramMap.get("place")).trim();
|
|
|
}
|
|
|
|
|
|
- paramMap.put("cn", cn);
|
|
|
paramMap.put("cnCity", cnCity);
|
|
|
- paramMap.put("placeId", placeId);
|
|
|
+ paramMap.put("location", location);
|
|
|
+ paramMap.put("placeIdList", placeIdList);
|
|
|
paramMap.put("place", place);
|
|
|
|
|
|
//按热点名称和详细地址搜索
|
|
@@ -136,6 +159,25 @@ public class ApmacController extends SimpleController {
|
|
|
|
|
|
List<Wifi> wifiList = wifiService.findByParamsOperator(paramMap, pager);
|
|
|
|
|
|
+ for(Wifi w : wifiList) {
|
|
|
+ //根据location设置它的省和市
|
|
|
+ //注:这里因为如果location是以“00”结尾的话,那它的省份可以确认,但是市的话就不能够直接从内存加载的信息里取
|
|
|
+ if(w.getLocation().endsWith("00")) {
|
|
|
+ Location l = locationService.findByLocation(w.getLocation());
|
|
|
+ w.setCn(l.getCn());
|
|
|
+ w.setCnCity(l.getCnCity());
|
|
|
+ } else {
|
|
|
+ if(null != InitData.locationMap.get(w.getLocation())) {
|
|
|
+ w.setCn(InitData.locationMap.get(w.getLocation()).split(",")[0]);
|
|
|
+ w.setCnCity(InitData.locationMap.get(w.getLocation()).split(",")[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据数聚子场景的id设置数聚场景的名称和数聚子场景的名称
|
|
|
+ w.setPlaceName(InitData.placeMap.get(w.getPlaceId().intValue()));
|
|
|
+ w.setPlaceClassName(InitData.getPlaceClassName(w.getPlaceId()));
|
|
|
+ }
|
|
|
+
|
|
|
//如果下拉框传的是默认值,则回传一个对应的值给前端
|
|
|
if(null == cn) {
|
|
|
cn = "省";
|
|
@@ -149,10 +191,10 @@ public class ApmacController extends SimpleController {
|
|
|
place = "场景";
|
|
|
}
|
|
|
|
|
|
- if(null == placeId) {
|
|
|
+ if(null == placeClassId) {
|
|
|
placeName = "数聚场景";
|
|
|
} else {
|
|
|
- placeName = placeService.findById(placeId).getName();
|
|
|
+ placeName = placeClassInformationService.findById(placeClassId).getName();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -711,8 +753,10 @@ public class ApmacController extends SimpleController {
|
|
|
|
|
|
String cn = null;
|
|
|
String cnCity = null;
|
|
|
- Long placeId = null;
|
|
|
+ Long placeClassId = null;
|
|
|
String place = null;
|
|
|
+ String location = null;
|
|
|
+ List<Long> placeIdList = null;
|
|
|
|
|
|
/**
|
|
|
* 下面对传递过来的几个参数进行处理
|
|
@@ -733,26 +777,44 @@ public class ApmacController extends SimpleController {
|
|
|
paramMap.put("cnCityName", "全部");
|
|
|
}
|
|
|
|
|
|
+ // 根据cn和cnCity得到它的location
|
|
|
+ if (null != cn || null != cnCity) {
|
|
|
+ if (null != cn && null != cnCity) {
|
|
|
+ location = InitData.getLocation(cn, cnCity);
|
|
|
+ }
|
|
|
+
|
|
|
+ //如果cn不空,cnCity为空则表明应该是选该省下的所有的市
|
|
|
+ if (null != cn) {
|
|
|
+ location = InitData.getLocation(cn);
|
|
|
+ location = location.substring(0, (location.length() - 2)) + "%";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (null != paramMap.get("placeId")
|
|
|
&& !"".equals(paramMap.get("placeId"))) {
|
|
|
- placeId = Long.parseLong(String.valueOf(paramMap.get("placeId")));
|
|
|
+ placeClassId = Long.parseLong(String.valueOf(paramMap.get("placeId")));
|
|
|
}
|
|
|
|
|
|
+ // 通过数聚场景id得到数聚子场景的id的集合
|
|
|
+ if (null != placeClassId) {
|
|
|
+ placeIdList = InitData.placeClassMap.get(placeClassId.intValue());
|
|
|
+ }
|
|
|
+
|
|
|
if(null != paramMap.get("place") && !"".equals(paramMap.get("place"))) {
|
|
|
place = new String(String.valueOf(paramMap.get("place")).trim().getBytes("ISO-8859-1"),"UTF-8");
|
|
|
paramMap.put("placeNameDefinedByOperator", place);
|
|
|
} else {
|
|
|
paramMap.put("placeNameDefinedByOperator", "全部");
|
|
|
}
|
|
|
-
|
|
|
- paramMap.put("cn", cn);
|
|
|
+
|
|
|
paramMap.put("cnCity", cnCity);
|
|
|
- paramMap.put("placeId", placeId);
|
|
|
+ paramMap.put("location", location);
|
|
|
+ paramMap.put("placeClassId", placeClassId);
|
|
|
paramMap.put("place", place);
|
|
|
|
|
|
//如果数聚场景id不为空则根据场景id找对应的名称
|
|
|
- if(null != placeId) {
|
|
|
- paramMap.put("placeName", placeService.findById(placeId).getName());
|
|
|
+ if(null != placeClassId) {
|
|
|
+ paramMap.put("placeName", placeClassInformationService.findById(placeClassId).getName());
|
|
|
} else {
|
|
|
paramMap.put("placeName", "全部");
|
|
|
}
|
|
@@ -771,6 +833,25 @@ public class ApmacController extends SimpleController {
|
|
|
}
|
|
|
List<Wifi> wifiList = wifiService.findByParams(paramMap);
|
|
|
|
|
|
+ for(Wifi w : wifiList) {
|
|
|
+ //根据location设置它的省和市
|
|
|
+ //注:这里因为如果location是以“00”结尾的话,那它的省份可以确认,但是市的话就不能够直接从内存加载的信息里取
|
|
|
+ if(w.getLocation().endsWith("00")) {
|
|
|
+ Location l = locationService.findByLocation(w.getLocation());
|
|
|
+ w.setCn(l.getCn());
|
|
|
+ w.setCnCity(l.getCnCity());
|
|
|
+ } else {
|
|
|
+ if(null != InitData.locationMap.get(w.getLocation())) {
|
|
|
+ w.setCn(InitData.locationMap.get(w.getLocation()).split(",")[0]);
|
|
|
+ w.setCnCity(InitData.locationMap.get(w.getLocation()).split(",")[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据数聚子场景的id设置数聚场景的名称和数聚子场景的名称
|
|
|
+ w.setPlaceName(InitData.placeMap.get(w.getPlaceId().intValue()));
|
|
|
+ w.setPlaceClassName(InitData.getPlaceClassName(w.getPlaceId()));
|
|
|
+ }
|
|
|
+
|
|
|
paramMap.put("dataList", wifiList);
|
|
|
response.reset();
|
|
|
// Content-Type:application/vnd.ms-excel;charset=utf8或者text/xml;charset=utf8
|
|
@@ -781,7 +862,7 @@ public class ApmacController extends SimpleController {
|
|
|
response.setHeader("Content-Disposition", "attachment;filename="
|
|
|
+ fileName + ".xls");
|
|
|
// 需要对excel的列的总数进行指定
|
|
|
- int column = 13;
|
|
|
+ int column = 14;
|
|
|
paramMap.put("dataSize", (wifiList.size() + 100));
|
|
|
paramMap.put("column", column);
|
|
|
|