|
|
|
@ -687,24 +687,26 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(s); |
|
|
|
Long id = Long.valueOf(jsonObject.getString("id")); |
|
|
|
if (Long.compare(parentMt.getOldId(), id) == 0) { |
|
|
|
jsonObject.put("spread", true); |
|
|
|
stringObjectMap.put("spread", true); |
|
|
|
|
|
|
|
if (mtLevel == 1) { |
|
|
|
redisTemplate.opsForList().leftPop("wms_materialTree_result"); |
|
|
|
redisTemplate.opsForList().leftPush("wms_materialTree_result",JSONObject.toJSONString(jsonObject)); |
|
|
|
redisTemplate.opsForList().set("wms_materialTree_result",i,JSONObject.toJSONString(jsonObject)); |
|
|
|
// redisTemplate.opsForList().leftPop("wms_materialTree_result");
|
|
|
|
// redisTemplate.opsForList().leftPush("wms_materialTree_result",JSONObject.toJSONString(jsonObject));
|
|
|
|
jsonObject.put("spread", true); |
|
|
|
stringObjectMap.put("spread", true); |
|
|
|
result.add(stringObjectMap); |
|
|
|
continue; |
|
|
|
} else { |
|
|
|
List<Object> childList = (List<Object>) jsonObject.get("children"); |
|
|
|
List<Object> objectList1 = rewriteTree(childList, stringObjectMap, mtLevel - 1, mt); |
|
|
|
jsonObject.put("children", objectList1); |
|
|
|
redisTemplate.opsForList().leftPop("wms_materialTree_result"); |
|
|
|
redisTemplate.opsForList().leftPush("wms_materialTree_result",JSONObject.toJSONString(jsonObject)); |
|
|
|
redisTemplate.opsForList().set("wms_materialTree_result",i,JSONObject.toJSONString(jsonObject)); |
|
|
|
jsonObject.put("spread", true); |
|
|
|
stringObjectMap.put("spread", true); |
|
|
|
result.add(jsonObject); |
|
|
|
} |
|
|
|
} else { |
|
|
|
redisTemplate.opsForList().leftPop("wms_materialTree_result"); |
|
|
|
redisTemplate.opsForList().leftPush("wms_materialTree_result",JSONObject.toJSONString(jsonObject)); |
|
|
|
redisTemplate.opsForList().set("wms_materialTree_result",i,JSONObject.toJSONString(jsonObject)); |
|
|
|
result.add(jsonObject); |
|
|
|
} |
|
|
|
} |
|
|
|
|