|
@@ -1,6 +1,7 @@
|
|
package com.cloudcross.ssp.web.back.main.ap;
|
|
package com.cloudcross.ssp.web.back.main.ap;
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -66,15 +67,13 @@ public class PlaceController extends SimpleController {
|
|
//查找所有的数聚场景
|
|
//查找所有的数聚场景
|
|
List<PlaceClassInformation> placeClassInformationList = placeClassInformationService.findAll();
|
|
List<PlaceClassInformation> placeClassInformationList = placeClassInformationService.findAll();
|
|
|
|
|
|
- //所有的数聚子场景
|
|
|
|
- List<Place> allplaceList = placeService.findAll();
|
|
|
|
-
|
|
|
|
|
|
+ model.addAttribute("pager", pager);
|
|
model.addAttribute("placeList", placeList);
|
|
model.addAttribute("placeList", placeList);
|
|
model.addAttribute("placeClassInformationList", placeClassInformationList);
|
|
model.addAttribute("placeClassInformationList", placeClassInformationList);
|
|
- model.addAttribute("allplaceList", allplaceList);
|
|
|
|
return page("unclassfiedPlaceName");
|
|
return page("unclassfiedPlaceName");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 将待分类数聚子场景添加到数聚场景里面
|
|
* 将待分类数聚子场景添加到数聚场景里面
|
|
* @param placeId 数聚子场景的id组成的字符串,格式为"1-2-3"
|
|
* @param placeId 数聚子场景的id组成的字符串,格式为"1-2-3"
|
|
@@ -86,6 +85,7 @@ public class PlaceController extends SimpleController {
|
|
//判断传递过来的参数是不是为空
|
|
//判断传递过来的参数是不是为空
|
|
if(null == placeId || "".equals(placeId) || null == placeClassId) {
|
|
if(null == placeId || "".equals(placeId) || null == placeClassId) {
|
|
System.out.println("传入的参数有错");
|
|
System.out.println("传入的参数有错");
|
|
|
|
+ return redirect(page("unclassfiedPlaceName"));
|
|
} else {
|
|
} else {
|
|
String[] placeIdString = placeId.split("-");
|
|
String[] placeIdString = placeId.split("-");
|
|
|
|
|
|
@@ -97,13 +97,11 @@ public class PlaceController extends SimpleController {
|
|
placeClassService.add(placeClass);
|
|
placeClassService.add(placeClass);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ return redirect(page("unclassfiedPlaceName"));
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- return redirect(page("unclassfiedPlaceName"));
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 得到所有的数聚子场景
|
|
* 得到所有的数聚子场景
|
|
* @param placeId
|
|
* @param placeId
|
|
@@ -146,7 +144,7 @@ public class PlaceController extends SimpleController {
|
|
* @param page
|
|
* @param page
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @RequestMapping("place-sort")
|
|
|
|
|
|
+ @RequestMapping("/place-sort")
|
|
public String placeSort(Model model, @RequestParam HashMap<String, Object> paramMap,
|
|
public String placeSort(Model model, @RequestParam HashMap<String, Object> paramMap,
|
|
@RequestParam(defaultValue = "1") int page) {
|
|
@RequestParam(defaultValue = "1") int page) {
|
|
String place = null;
|
|
String place = null;
|
|
@@ -171,11 +169,14 @@ public class PlaceController extends SimpleController {
|
|
|
|
|
|
paramMap.put("pager", pager1);
|
|
paramMap.put("pager", pager1);
|
|
List<PlaceOperator> placeOperatorList = placeOperatorService.findUnclassfiedPlace(paramMap);
|
|
List<PlaceOperator> placeOperatorList = placeOperatorService.findUnclassfiedPlace(paramMap);
|
|
|
|
+ List<Place> placeList = placeService.findAll();
|
|
|
|
|
|
//将传递过来的搜索参数回传
|
|
//将传递过来的搜索参数回传
|
|
if(null != place) {
|
|
if(null != place) {
|
|
model.addAttribute("place", place1);
|
|
model.addAttribute("place", place1);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ model.addAttribute("placeList", placeList);
|
|
model.addAttribute("placeOperatorList", placeOperatorList);
|
|
model.addAttribute("placeOperatorList", placeOperatorList);
|
|
model.addAllAttributes(paramMap);
|
|
model.addAllAttributes(paramMap);
|
|
return page("place-sort");
|
|
return page("place-sort");
|
|
@@ -194,33 +195,25 @@ public class PlaceController extends SimpleController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 用户场景分类的保存
|
|
* 用户场景分类的保存
|
|
- * 这里要传递两个变量,一个是t_place_operator的id字符串(变量名为id),另一个就是数聚场景id(变量名叫placeId)
|
|
|
|
- * 注:字符串格式像"1-4-5",就是id以-号划分,当有多个id的时候;
|
|
|
|
|
|
+ * 这里要传递两个变量,一个是t_place_operator的id数组,另一个就是数聚场景id(变量名叫placeId)
|
|
* @param model
|
|
* @param model
|
|
- * @param paramMap
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping("/save")
|
|
@RequestMapping("/save")
|
|
- public String placeSort(Model model, @RequestParam HashMap<String, Object> paramMap) {
|
|
|
|
- Long[] id = null;
|
|
|
|
- Long placeId = null;
|
|
|
|
|
|
+ public String placeSort(Model model, @RequestParam Long[] id, @RequestParam Long placeId) {
|
|
|
|
+ List<Long> idList = new ArrayList<Long>();
|
|
//当传递过来的是空值或者是空字符串时,则什么也不做
|
|
//当传递过来的是空值或者是空字符串时,则什么也不做
|
|
- if(null == paramMap.get("id") || "".equals(paramMap.get("id"))
|
|
|
|
- || null == paramMap.get("placeId") || "".equals(paramMap.get("placeId"))) {
|
|
|
|
|
|
+ if(null == id || id.length == 0
|
|
|
|
+ || null == placeId ) {
|
|
return redirect(page("place-sort"));
|
|
return redirect(page("place-sort"));
|
|
- } else {
|
|
|
|
- String idString = String.valueOf(paramMap.get("id"));
|
|
|
|
- String[] idArray = idString.split("-");
|
|
|
|
- placeId = Long.parseLong(String.valueOf(paramMap.get("placeId")));
|
|
|
|
- id = new Long[idArray.length];
|
|
|
|
-
|
|
|
|
- for(int i = 0; i < id.length; i++) {
|
|
|
|
- id[i] = Long.parseLong(idArray[i]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < id.length; i++) {
|
|
|
|
+ idList.add(id[i]);
|
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
- map.put("idList", id);
|
|
|
|
|
|
+ map.put("idList", idList);
|
|
map.put("placeId", placeId);
|
|
map.put("placeId", placeId);
|
|
placeOperatorService.update(map);
|
|
placeOperatorService.update(map);
|
|
|
|
|