|
@@ -7,6 +7,7 @@ import com.diagbot.dto.TreeDTO;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.KgServiceImpl;
|
|
|
+import com.diagbot.util.FastJsonUtils;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.KgQueryVO;
|
|
|
import com.diagbot.vo.KgTreeVO;
|
|
@@ -48,14 +49,49 @@ public class KgFacade extends KgServiceImpl {
|
|
|
public TreeDTO getTreeFac(KgTreeVO kgTreeVO) {
|
|
|
TreeDTO treeDTO = new TreeDTO();
|
|
|
if (kgTreeVO.getType() == 1 && kgTreeVO.getSubType() == 1) {
|
|
|
- addNode(treeDTO);
|
|
|
+ treeDTO = FastJsonUtils.getJsonToBean(jsonStr, TreeDTO.class);
|
|
|
} else {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_ERROR);
|
|
|
}
|
|
|
return treeDTO;
|
|
|
}
|
|
|
|
|
|
- private void addNode(TreeDTO treeDTO) {
|
|
|
-
|
|
|
- }
|
|
|
+ private static final String jsonStr = "{\n" +
|
|
|
+ " \"icdCode\": \"1\",\n" +
|
|
|
+ " \"label\": null,\n" +
|
|
|
+ " \"name\": \"疾病\",\n" +
|
|
|
+ " \"snode\": [\n" +
|
|
|
+ " {\n" +
|
|
|
+ "\t\t\"icdCode\": \"A\",\n" +
|
|
|
+ "\t\t\"label\": \"\",\n" +
|
|
|
+ "\t\t\"name\": \"A\",\n" +
|
|
|
+ "\t\t\"snode\": [\n" +
|
|
|
+ "\t\t {\n" +
|
|
|
+ "\t\t\t\"icdCode\": \"A1\",\n" +
|
|
|
+ "\t\t\t\"label\": \"\",\n" +
|
|
|
+ "\t\t\t\"name\": \"A1\",\n" +
|
|
|
+ "\t\t\t\"snode\": [\n" +
|
|
|
+ "\t\t\t null\n" +
|
|
|
+ "\t\t\t]\n" +
|
|
|
+ "\t\t },\n" +
|
|
|
+ "\t\t {\n" +
|
|
|
+ "\t\t\t\"icdCode\": \"A2\",\n" +
|
|
|
+ "\t\t\t\"label\": \"\",\n" +
|
|
|
+ "\t\t\t\"name\": \"A2\",\n" +
|
|
|
+ "\t\t\t\"snode\": [\n" +
|
|
|
+ "\t\t\t null\n" +
|
|
|
+ "\t\t\t]\n" +
|
|
|
+ "\t\t }\n" +
|
|
|
+ "\t\t]\n" +
|
|
|
+ "\t },\n" +
|
|
|
+ "\t {\n" +
|
|
|
+ "\t\t\"icdCode\": \"B\",\n" +
|
|
|
+ "\t\t\"label\": \"\",\n" +
|
|
|
+ "\t\t\"name\": \"B\",\n" +
|
|
|
+ "\t\t\"snode\": [\n" +
|
|
|
+ "\t\t null\n" +
|
|
|
+ "\t\t]\n" +
|
|
|
+ "\t }\n" +
|
|
|
+ " ]\n" +
|
|
|
+ "}";
|
|
|
}
|