|
|
|
@@ -25,7 +25,6 @@ import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author gongbiao |
|
|
|
@@ -59,16 +58,13 @@ public class UserDataRuleAspect { |
|
|
|
} |
|
|
|
String buildingFloor = byUserId.getBuildingFloor(); |
|
|
|
if (StringUtils.isNotEmpty(buildingFloor)) { |
|
|
|
buildingFloor = JSONObject.parseObject(buildingFloor).getJSONArray("data").stream() |
|
|
|
.map(m -> { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(String.valueOf(m)); |
|
|
|
return jsonObject.getString("floor"); |
|
|
|
}).collect(Collectors.joining(",")); |
|
|
|
Object[] data = JSONArray.parseArray(buildingFloor).toArray(); |
|
|
|
buildingFloor = StringUtils.join(data, ","); |
|
|
|
} |
|
|
|
|
|
|
|
String businessForRule = byUserId.getBusinessForRule(); |
|
|
|
if (StringUtils.isNotEmpty(businessForRule)) { |
|
|
|
Object[] data = JSONObject.parseObject(businessForRule).getJSONArray("data").toArray(); |
|
|
|
Object[] data = JSONArray.parseArray(businessForRule).toArray(); |
|
|
|
businessForRule = StringUtils.join(data, ","); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -78,10 +74,7 @@ public class UserDataRuleAspect { |
|
|
|
JSONArray objects = JSONArray.parseArray(target); |
|
|
|
for (int i = 0; i < objects.size(); i++) { |
|
|
|
JSONObject jsonObject = objects.getJSONObject(i); |
|
|
|
JSONArray children = jsonObject.getJSONArray("children"); |
|
|
|
for (int j = 0; j < children.size(); j++) { |
|
|
|
targetSet.add(children.getJSONObject(i).getString("tag")); |
|
|
|
} |
|
|
|
targetSet.add(jsonObject.getString("tag")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|