# Conflicts:
#	cmkg/pom.xml
#	cmkg/src/main/java/com/cmkg/cmkg/CmkgApplication.java
#	cmkg/src/main/java/com/cmkg/cmkg/Controller/QuestionController.java
#	cmkg/src/main/java/com/cmkg/cmkg/database/ReturnData.java
#	cmkg/src/main/java/com/cmkg/cmkg/node/medicine.java
#	cmkg/src/main/java/com/cmkg/cmkg/process/ModelProcess.java
#	cmkg/src/main/java/com/cmkg/cmkg/repository/MedicineRespository.java
#	cmkg/src/main/java/com/cmkg/cmkg/repository/QuestionRespository.java
#	cmkg/src/main/java/com/cmkg/cmkg/server/QuestionService.java
#	cmkg/src/main/java/com/cmkg/cmkg/server/impl/QuestionServiceImpl.java
#	cmkg/src/main/resources/application.properties
master
hanxueqing 5 years ago
parent 488c308cf2
commit 92ea9462b0

@ -103,6 +103,7 @@
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:core:1.1.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:monitor:1.1.1@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test.espresso:espresso-idling-resource:3.1.1@aar" level="project" />
<orderEntry type="library" name="Gradle: __local_aars__:D.\我的大学\中医\userlib\commons-beanutils-1.7.0.jar:unspecified@jar" level="project" />
<orderEntry type="library" name="Gradle: __local_aars__:D.\我的大学\中医\userlib\commons-collections-3.1.jar:unspecified@jar" level="project" />
<orderEntry type="library" name="Gradle: __local_aars__:D.\我的大学\中医\userlib\commons-lang-2.5.jar:unspecified@jar" level="project" />
<orderEntry type="library" name="Gradle: __local_aars__:D.\我的大学\中医\userlib\commons-logging.jar:unspecified@jar" level="project" />

@ -1,8 +1,11 @@
package com.example.PersonalCenter;
import android.util.Log;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@ -26,7 +29,7 @@ public class SearchServiceGet {
String address="/rest/cmkg/question/hello";
String Url = "http://114.116.199.154:5000"+address;
String Url = "http://114.116.199.154:5000/cmkg"+address;
String path = Url + "?name="+name;
URL url = null;
try {
@ -50,19 +53,53 @@ public class SearchServiceGet {
System.out.println(response.toString());
//开始解析返回的数据
JSONObject jo=JSONObject.fromObject(response.toString());
code=jo.getInt("code");
System.out.println("code==@@@@@@@@@@20"+code);
// JSONObject jo=JSONObject.fromObject(response.toString());
org.json.JSONObject jo = null;
try {
jo = new org.json.JSONObject(response.toString());
} catch (JSONException e) {
e.printStackTrace();
}
try {
code=jo.getInt("code");
} catch (JSONException e) {
e.printStackTrace();
}
System.out.println("code="+code);
if(code!=0){ //查询成功,在开始解析数据
System.out.println("code==@@@@@@@@@@20"+code);
name_back=jo.getString("message");//查询的主语
try {
name_back=jo.getString("message");//查询的主语
} catch (JSONException e) {
e.printStackTrace();
}
//把data看作一个JSONObject无论里面由多少元素都转换为JSONArray存在数组里
JSONObject jo_data=jo.getJSONObject("data");
JSONArray data_arr=null;
jo_data.toJSONArray(data_arr);
JSONObject jo_data= null;
try {
jo_data = jo.getJSONObject("data");
if(jo_data==null) System.out.println(("jo_data==null"));
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray data_arr=new JSONArray();
ArrayList<String> datas=new ArrayList<String>();
try {
// jo_data.toJSONArray(data_arr);
datas.add(jo_data.toString());
data_arr=jo.getJSONArray("data");
System.out.println("data_arr======"+data_arr.length());
} catch (JSONException e) {
e.printStackTrace();
}
//遍历data_arr把里面的数据放入ArrayList<String> content里
for(int i=0;i<data_arr.size();i++){
content.add(data_arr.get(i).toString());
for(int i=0;i<datas.size();i++){
try {
content.add(datas.get(i));
} catch (Exception e) {
e.printStackTrace();
}
}
SearchSuccess=true;//查找成功标志
}
@ -91,11 +128,10 @@ public class SearchServiceGet {
public static void exxcuteTest(String name){
code=100;
name_back="糖尿病";
content.add("jjfkdjfkjklfjdklsjfklasjflksjflsjfdlsjfdklsjfklsjfklsjfkldjsafl;das"
+"FJDKSLDJFKLDSKLFJDSKLAJFKLDSAJFKLDASJFKLDSAJFKLDSAJFKLDASJFKLDASJFKLDASJFKLDASJFL"
+"FNDFJDJFKLDSJFKLDSJFIOWUIORUEJGKLDKLGDKSLFJKDLSAJFKLD;SA");
content.add("dddddddd反馈i惹我给i偶i哦好v考虑的设计规范房价的快速了解法拉盛覅柔儿一个可能"
+"fdighreioghi飞机迪斯科飞机俄欧分工i热i购房贷款了JFK逻辑非我");
content.add("莲子粥");
content.add("推拿法");
content.add("大蒜蒸西瓜");
content.add("红枣糕");
}

@ -8,8 +8,8 @@ public interface ConditionCode {
* MedicineToOperation
* MedicineToSympton
*/
public final int DiseaseToSymptom=200;
public final int DiseaseToMedicines=100;
public final int DiseaseToSymptom=100;
public final int DiseaseToMedicines=200;
public final int MedicineToOperation=300;
public final int MedicineToSymptom=400;

@ -39,7 +39,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
new Thread(new Runnable() {
@Override
public void run() {
SearchServiceGet.executeSearchGet(inputContent);
// SearchServiceGet.executeSearchGet(inputContent);
SearchServiceGet.exxcuteTest(inputContent);
Intent intent = new Intent();
intent.setClass(getActivity(), SearchEntryActivity.class);
startActivity(intent);

@ -20,9 +20,17 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
Integer[] color = {
R.color.holo_blue_bright,
R.color.holo_orange_light,
// R.color.holo_purple,
// R.color.holo_red_light
R.color.holo_purple,
R.color.holo_red_light,
// R.color.holo_blue_dark,
// R.color.holo_orange_dark,
// R.color.holo_blue_dark,
// R.color.holo_gray_bright,
// R.color.holo_orange_light,
// R.color.holo_red_dark
};
String[] name = {"数据结构","计算机网络","编译原理","C语言","算法设计","FPGA编程"};
String[] scores = {"77","87","65","98","74","80"};
@Override
@ -54,18 +62,21 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
*
*/
List<List<ContentData>> lists=new LinkedList<>();
Integer[] new_color;
if(SearchServiceGet.code==DiseaseToSymptom){
/**
* //返回的是病症
* listslist
*/
System.out.println("size="+SearchServiceGet.content.size());
for(int i=0;i<SearchServiceGet.content.size();i++){
System.out.println("content="+SearchServiceGet.content.get(i));
List<ContentData> list=new LinkedList<>();
list.add(new ContentData(SearchServiceGet.content.get(i)));
lists.add(list);
}
new_color=new Integer[1];
}else if(SearchServiceGet.code==DiseaseToMedicines){
/**
* //返回的是结解决的多种药品方法
@ -73,10 +84,10 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
*/
List<ContentData> list=new LinkedList<>();
for(int i=0;i<SearchServiceGet.content.size();i++){
list.add(new ContentData("我是您的用法哦~请您看看我嘞"));
list.add(new ContentData("我是您的用法哦~请您看看我嘞\n我无比的期待您的光临嘞\n我们没有连数据呢马上就有嘞"));
lists.add(list);
}
new_color=new Integer[SearchServiceGet.content.size()];
}else if(SearchServiceGet.code==MedicineToOperation) {
/**
* //返回的是药的用法
@ -87,7 +98,7 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
list.add(new ContentData(SearchServiceGet.content.get(i)));
lists.add(list);
}
new_color=new Integer[1];
}else{
/**
* //返回的是药的主治症状
@ -98,10 +109,14 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
list.add(new ContentData(SearchServiceGet.content.get(i)));
lists.add(list);
}
new_color=new Integer[1];
}
for(int i=0;i<new_color.length;i++){
new_color[i]=color[i];
}
// adapter.updateData(Arrays.asList(new_color),lists);
adapter.updateData(Arrays.asList(color),lists);
mCardStack.setAnimatorAdapter(new AllMoveDownAnimatorAdapter(mCardStack));
mCardStack.setAnimatorAdapter(new UpDownAnimatorAdapter(mCardStack));

Loading…
Cancel
Save