Commit 774a0595891161857b5a6269c918a1626e96d452
1 parent
0baa5d11
Exists in
yxb_dev
and in
2 other branches
no message
Showing
11 changed files
with
107 additions
and
19 deletions
Show diff stats
app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/api/ApplyReplaceCardApi.java
0 → 100644
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +package com.shunzhi.parent.api; | ||
2 | + | ||
3 | +import com.google.gson.JsonObject; | ||
4 | + | ||
5 | +import io.reactivex.Observable; | ||
6 | +import retrofit2.http.GET; | ||
7 | +import retrofit2.http.Query; | ||
8 | + | ||
9 | +/** | ||
10 | + * Created by Administrator on 2018/4/18 0018. | ||
11 | + */ | ||
12 | + | ||
13 | +public interface ApplyReplaceCardApi { | ||
14 | + | ||
15 | + @GET("/api/OneCard/AddStuCard") | ||
16 | + Observable<JsonObject> getApplyReplaceCard(@Query("studentId,cardId") int studentId,String cardId); | ||
17 | +} |
app/src/main/java/com/shunzhi/parent/bean/apply/ApplyReplaceCardBean.java
0 → 100644
app/src/main/java/com/shunzhi/parent/contract/apply/ApplyReplaceCardContract.java
1 | package com.shunzhi.parent.contract.apply; | 1 | package com.shunzhi.parent.contract.apply; |
2 | 2 | ||
3 | +import com.google.gson.JsonObject; | ||
3 | import com.share.mvpsdk.base.BasePresenter; | 4 | import com.share.mvpsdk.base.BasePresenter; |
4 | import com.share.mvpsdk.base.IBaseActivity; | 5 | import com.share.mvpsdk.base.IBaseActivity; |
6 | +import com.share.mvpsdk.base.IBaseModel; | ||
7 | +import com.shunzhi.parent.bean.apply.ApplyReplaceCardBean; | ||
8 | + | ||
9 | +import java.util.List; | ||
5 | 10 | ||
6 | /** | 11 | /** |
7 | * Created by Administrator on 2018/4/18 0018. | 12 | * Created by Administrator on 2018/4/18 0018. |
@@ -11,12 +16,13 @@ public interface ApplyReplaceCardContract { | @@ -11,12 +16,13 @@ public interface ApplyReplaceCardContract { | ||
11 | 16 | ||
12 | //IOrderDetailModel,IOrderDetailView | 17 | //IOrderDetailModel,IOrderDetailView |
13 | abstract class ApplyReplaceCardPreenter extends BasePresenter<IApplyReplaceCardModel,IApplyReplaceCardView>{ | 18 | abstract class ApplyReplaceCardPreenter extends BasePresenter<IApplyReplaceCardModel,IApplyReplaceCardView>{ |
14 | - public abstract void showReplaceCardDetail(); | 19 | + public abstract void showReplaceCardDetail(int studentId,String cardId); |
15 | } | 20 | } |
16 | - | ||
17 | - interface IApplyReplaceCardModel { | 21 | + interface IApplyReplaceCardModel extends IBaseModel { |
22 | + io.reactivex.Observable<JsonObject> getReplaceCardDetailResult(int studentId, String cardId); | ||
18 | } | 23 | } |
19 | 24 | ||
20 | interface IApplyReplaceCardView extends IBaseActivity{ | 25 | interface IApplyReplaceCardView extends IBaseActivity{ |
26 | + void showReplaceCardDetail(List<ApplyReplaceCardBean> applyReplaceCardBean); | ||
21 | } | 27 | } |
22 | } | 28 | } |
app/src/main/java/com/shunzhi/parent/model/apply/ApplyReplaceCardModel.java
0 → 100644
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +package com.shunzhi.parent.model.apply; | ||
2 | + | ||
3 | +import com.google.gson.JsonObject; | ||
4 | +import com.share.mvpsdk.base.BaseModel; | ||
5 | +import com.share.mvpsdk.helper.RetrofitCreateHelper; | ||
6 | +import com.shunzhi.parent.AppConfig; | ||
7 | +import com.shunzhi.parent.AppContext; | ||
8 | +import com.shunzhi.parent.api.ApplyReplaceCardApi; | ||
9 | +import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; | ||
10 | + | ||
11 | +import io.reactivex.Observable; | ||
12 | + | ||
13 | +/** | ||
14 | + * Created by Administrator on 2018/4/18 0018. | ||
15 | + */ | ||
16 | +//BaseModel implements OrderDetailContract.IOrderDetailModel | ||
17 | +public class ApplyReplaceCardModel extends BaseModel implements ApplyReplaceCardContract.IApplyReplaceCardModel{ | ||
18 | + public static ApplyReplaceCardContract.IApplyReplaceCardModel newInstance() { | ||
19 | + return new ApplyReplaceCardModel(); | ||
20 | + } | ||
21 | + | ||
22 | + @Override | ||
23 | + public Observable<JsonObject> getReplaceCardDetailResult(int studentId, String cardId) { | ||
24 | + String user_id = AppConfig.getAppConfig(AppContext.getContext()).get(AppConfig.USER_ID); | ||
25 | + return RetrofitCreateHelper.getInstance().createApi(ApplyReplaceCardApi.class,AppConfig.BASE_URL).getApplyReplaceCard(studentId,cardId); | ||
26 | + } | ||
27 | +} |
app/src/main/java/com/shunzhi/parent/presenter/apply/ApplyReplaceCardPresenter.java
1 | package com.shunzhi.parent.presenter.apply; | 1 | package com.shunzhi.parent.presenter.apply; |
2 | 2 | ||
3 | +import com.google.gson.JsonObject; | ||
3 | import com.share.mvpsdk.base.BasePresenter; | 4 | import com.share.mvpsdk.base.BasePresenter; |
5 | +import com.share.mvpsdk.utils.ToastUtils; | ||
4 | import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; | 6 | import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; |
7 | +import com.shunzhi.parent.model.apply.ApplyReplaceCardModel; | ||
8 | + | ||
9 | +import io.reactivex.functions.Consumer; | ||
5 | 10 | ||
6 | /** | 11 | /** |
7 | * Created by Administrator on 2018/4/18 0018. | 12 | * Created by Administrator on 2018/4/18 0018. |
8 | */ | 13 | */ |
9 | -//OrderDetailContract.OrderDetailPreenter | ||
10 | public class ApplyReplaceCardPresenter extends ApplyReplaceCardContract.ApplyReplaceCardPreenter { | 14 | public class ApplyReplaceCardPresenter extends ApplyReplaceCardContract.ApplyReplaceCardPreenter { |
11 | @Override | 15 | @Override |
12 | public ApplyReplaceCardContract.IApplyReplaceCardModel getModel() { | 16 | public ApplyReplaceCardContract.IApplyReplaceCardModel getModel() { |
13 | - return null; | 17 | + return ApplyReplaceCardModel.newInstance(); |
14 | } | 18 | } |
15 | 19 | ||
16 | @Override | 20 | @Override |
17 | public void onStart() { | 21 | public void onStart() { |
18 | 22 | ||
19 | } | 23 | } |
24 | + | ||
25 | + @Override | ||
26 | + public void showReplaceCardDetail(int studentId, String cardId) { | ||
27 | + mRxManager.register(mIModel.getReplaceCardDetailResult(studentId,cardId).subscribe(new Consumer<JsonObject>() { | ||
28 | + @Override | ||
29 | + public void accept(JsonObject jsonObject) throws Exception { | ||
30 | + ToastUtils.showToast(jsonObject.toString()); | ||
31 | + //接收到的json | ||
32 | + | ||
33 | + } | ||
34 | + }, new Consumer<Throwable>() { | ||
35 | + @Override | ||
36 | + public void accept(Throwable throwable) throws Exception { | ||
37 | + | ||
38 | + } | ||
39 | + })); | ||
40 | + | ||
41 | + } | ||
20 | } | 42 | } |
app/src/main/java/com/shunzhi/parent/presenter/report/ReportDetialPresenter.java
@@ -61,8 +61,6 @@ public class ReportDetialPresenter extends ReportDetialContract.ReportDetialPres | @@ -61,8 +61,6 @@ public class ReportDetialPresenter extends ReportDetialContract.ReportDetialPres | ||
61 | mIView.showDetialList(list,pointNow,pointPast,sceneName); | 61 | mIView.showDetialList(list,pointNow,pointPast,sceneName); |
62 | mIView.showDetialInfo(ranking, pscore, risePoint, pointUpAverage, riseRanking, averageRanking, evaluationDescripe); | 62 | mIView.showDetialInfo(ranking, pscore, risePoint, pointUpAverage, riseRanking, averageRanking, evaluationDescripe); |
63 | 63 | ||
64 | - | ||
65 | - | ||
66 | } | 64 | } |
67 | }, new Consumer<Throwable>() { | 65 | }, new Consumer<Throwable>() { |
68 | @Override | 66 | @Override |
app/src/main/java/com/shunzhi/parent/ui/activity/apply/ApplyReplaceCardActivity.java
@@ -13,6 +13,7 @@ import android.widget.TextView; | @@ -13,6 +13,7 @@ import android.widget.TextView; | ||
13 | import com.share.mvpsdk.base.BasePresenter; | 13 | import com.share.mvpsdk.base.BasePresenter; |
14 | import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | 14 | import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; |
15 | import com.shunzhi.parent.R; | 15 | import com.shunzhi.parent.R; |
16 | +import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; | ||
16 | import com.shunzhi.parent.presenter.apply.ApplyReplaceCardPresenter; | 17 | import com.shunzhi.parent.presenter.apply.ApplyReplaceCardPresenter; |
17 | import com.shunzhi.parent.ui.fragment.apply.ApplyReplaceCardFragment; | 18 | import com.shunzhi.parent.ui.fragment.apply.ApplyReplaceCardFragment; |
18 | import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment; | 19 | import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment; |
@@ -22,6 +23,7 @@ import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment; | @@ -22,6 +23,7 @@ import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment; | ||
22 | * 补卡界面 | 23 | * 补卡界面 |
23 | */ | 24 | */ |
24 | 25 | ||
26 | +//OrderDetailContract.OrderDetailPreenter,OrderDetailContract.IOrderDetailModel | ||
25 | public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements View.OnClickListener{ | 27 | public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements View.OnClickListener{ |
26 | ApplyReplaceCardFragment applyReplaceCardFragment = null; | 28 | ApplyReplaceCardFragment applyReplaceCardFragment = null; |
27 | ImageView ivBack; | 29 | ImageView ivBack; |
@@ -45,7 +47,6 @@ public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements V | @@ -45,7 +47,6 @@ public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements V | ||
45 | center_title = findViewById(R.id.center_title); | 47 | center_title = findViewById(R.id.center_title); |
46 | frame_replacecard = findViewById(R.id.frame_replacecard); | 48 | frame_replacecard = findViewById(R.id.frame_replacecard); |
47 | center_title.setText("补卡"); | 49 | center_title.setText("补卡"); |
48 | - | ||
49 | ivBack.setOnClickListener(this); | 50 | ivBack.setOnClickListener(this); |
50 | 51 | ||
51 | fragmentTransaction = getSupportFragmentManager().beginTransaction(); | 52 | fragmentTransaction = getSupportFragmentManager().beginTransaction(); |
@@ -65,4 +66,6 @@ public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements V | @@ -65,4 +66,6 @@ public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements V | ||
65 | public BasePresenter initPresenter() { | 66 | public BasePresenter initPresenter() { |
66 | return new ApplyReplaceCardPresenter(); | 67 | return new ApplyReplaceCardPresenter(); |
67 | } | 68 | } |
69 | + | ||
68 | } | 70 | } |
71 | + |
app/src/main/java/com/shunzhi/parent/ui/fragment/apply/ApplyReplaceCardFragment.java
@@ -11,19 +11,22 @@ import android.widget.Toast; | @@ -11,19 +11,22 @@ import android.widget.Toast; | ||
11 | 11 | ||
12 | import com.share.mvpsdk.base.BasePresenter; | 12 | import com.share.mvpsdk.base.BasePresenter; |
13 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 13 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
14 | +import com.share.mvpsdk.utils.ToastUtils; | ||
14 | import com.shunzhi.parent.R; | 15 | import com.shunzhi.parent.R; |
16 | +import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; | ||
15 | import com.shunzhi.parent.views.ReplaceCardDialog; | 17 | import com.shunzhi.parent.views.ReplaceCardDialog; |
16 | 18 | ||
17 | /** | 19 | /** |
18 | * Created by Administrator on 2018/4/10 0010. | 20 | * Created by Administrator on 2018/4/10 0010. |
19 | */ | 21 | */ |
20 | 22 | ||
21 | -public class ApplyReplaceCardFragment extends BaseMVPCompatFragment implements View.OnClickListener{ | 23 | +public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplaceCardContract.ApplyReplaceCardPreenter,ApplyReplaceCardContract.IApplyReplaceCardModel> implements View.OnClickListener{ |
22 | private Button bt_sure; | 24 | private Button bt_sure; |
23 | private Button bt_cancel; | 25 | private Button bt_cancel; |
24 | ReplaceCardDialog replaceCardDialog=null; | 26 | ReplaceCardDialog replaceCardDialog=null; |
25 | private EditText et_cardnum; | 27 | private EditText et_cardnum; |
26 | private String cardnum; | 28 | private String cardnum; |
29 | + private String cardid; | ||
27 | 30 | ||
28 | @NonNull | 31 | @NonNull |
29 | @Override | 32 | @Override |
@@ -44,6 +47,14 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment implements V | @@ -44,6 +47,14 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment implements V | ||
44 | et_cardnum = view.findViewById(R.id.et_cardnum); | 47 | et_cardnum = view.findViewById(R.id.et_cardnum); |
45 | 48 | ||
46 | bt_sure.setOnClickListener(this); | 49 | bt_sure.setOnClickListener(this); |
50 | + | ||
51 | + cardid = et_cardnum.getText().toString().trim(); | ||
52 | + if (TextUtils.isEmpty(cardid)) { | ||
53 | + ToastUtils.showToast("请输入新卡卡号!"); | ||
54 | + }else { | ||
55 | + //studentid 从成长界面获取 此处设置为“123” | ||
56 | + mPresenter.showReplaceCardDetail(123, cardid); | ||
57 | + } | ||
47 | } | 58 | } |
48 | 59 | ||
49 | @Override | 60 | @Override |
app/src/main/res/layout/fragment_report.xml
@@ -68,13 +68,7 @@ | @@ -68,13 +68,7 @@ | ||
68 | android:layout_width="match_parent" | 68 | android:layout_width="match_parent" |
69 | android:layout_height="match_parent" | 69 | android:layout_height="match_parent" |
70 | android:background="@color/white" | 70 | android:background="@color/white" |
71 | -<<<<<<< HEAD | ||
72 | android:visibility="visible"> | 71 | android:visibility="visible"> |
73 | -======= | ||
74 | - android:visibility="gone" | ||
75 | - | ||
76 | - > | ||
77 | ->>>>>>> eda704dec86974be81437b97aa949c3570bb8be0 | ||
78 | 72 | ||
79 | <TextView | 73 | <TextView |
80 | android:id="@+id/tvNoData" | 74 | android:id="@+id/tvNoData" |
app/src/main/res/layout/fragment_report_detial.xml
@@ -171,7 +171,7 @@ | @@ -171,7 +171,7 @@ | ||
171 | android:layout_height="0dp" | 171 | android:layout_height="0dp" |
172 | android:layout_weight="1.5"> | 172 | android:layout_weight="1.5"> |
173 | 173 | ||
174 | -<<<<<<< HEAD | 174 | + |
175 | <com.share.mvpsdk.view.chartview.ChartView | 175 | <com.share.mvpsdk.view.chartview.ChartView |
176 | android:id="@+id/chartView" | 176 | android:id="@+id/chartView" |
177 | android:layout_width="match_parent" | 177 | android:layout_width="match_parent" |
@@ -186,7 +186,6 @@ | @@ -186,7 +186,6 @@ | ||
186 | android:text="图表控件" | 186 | android:text="图表控件" |
187 | android:textColor="@color/md_red_500" | 187 | android:textColor="@color/md_red_500" |
188 | android:visibility="gone" /> | 188 | android:visibility="gone" /> |
189 | -======= | ||
190 | <LinearLayout | 189 | <LinearLayout |
191 | android:layout_width="match_parent" | 190 | android:layout_width="match_parent" |
192 | android:layout_height="match_parent" | 191 | android:layout_height="match_parent" |
@@ -206,7 +205,6 @@ | @@ -206,7 +205,6 @@ | ||
206 | android:layout_height="@dimen/size_dp_16" | 205 | android:layout_height="@dimen/size_dp_16" |
207 | android:background="@drawable/shape_blue_8" | 206 | android:background="@drawable/shape_blue_8" |
208 | /> | 207 | /> |
209 | ->>>>>>> eda704dec86974be81437b97aa949c3570bb8be0 | ||
210 | 208 | ||
211 | <TextView | 209 | <TextView |
212 | android:layout_marginLeft="@dimen/size_dp_5" | 210 | android:layout_marginLeft="@dimen/size_dp_5" |
@@ -244,7 +242,8 @@ | @@ -244,7 +242,8 @@ | ||
244 | <com.share.mvpsdk.view.chartview.ChartView | 242 | <com.share.mvpsdk.view.chartview.ChartView |
245 | android:id="@+id/chartView" | 243 | android:id="@+id/chartView" |
246 | android:layout_width="match_parent" | 244 | android:layout_width="match_parent" |
247 | - android:layout_height="match_parent" /> | 245 | + android:layout_height="match_parent" |
246 | + tools:ignore="DuplicateIds" /> | ||
248 | 247 | ||
249 | <TextView | 248 | <TextView |
250 | android:layout_width="match_parent" | 249 | android:layout_width="match_parent" |