Commit 774a0595891161857b5a6269c918a1626e96d452

Authored by wwx
1 parent 0baa5d11

no message

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 @@
  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
... ... @@ -0,0 +1,11 @@
  1 +package com.shunzhi.parent.bean.apply;
  2 +
  3 +/**
  4 + * Created by Administrator on 2018/4/18 0018.
  5 + */
  6 +
  7 +public class ApplyReplaceCardBean {
  8 +
  9 + public String StudentID;
  10 + public String CardID;
  11 +}
... ...
app/src/main/java/com/shunzhi/parent/contract/apply/ApplyReplaceCardContract.java
1 1 package com.shunzhi.parent.contract.apply;
2 2  
  3 +import com.google.gson.JsonObject;
3 4 import com.share.mvpsdk.base.BasePresenter;
4 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 12 * Created by Administrator on 2018/4/18 0018.
... ... @@ -11,12 +16,13 @@ public interface ApplyReplaceCardContract {
11 16  
12 17 //IOrderDetailModel,IOrderDetailView
13 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 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 @@
  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 1 package com.shunzhi.parent.presenter.apply;
2 2  
  3 +import com.google.gson.JsonObject;
3 4 import com.share.mvpsdk.base.BasePresenter;
  5 +import com.share.mvpsdk.utils.ToastUtils;
4 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 12 * Created by Administrator on 2018/4/18 0018.
8 13 */
9   -//OrderDetailContract.OrderDetailPreenter
10 14 public class ApplyReplaceCardPresenter extends ApplyReplaceCardContract.ApplyReplaceCardPreenter {
11 15 @Override
12 16 public ApplyReplaceCardContract.IApplyReplaceCardModel getModel() {
13   - return null;
  17 + return ApplyReplaceCardModel.newInstance();
14 18 }
15 19  
16 20 @Override
17 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 61 mIView.showDetialList(list,pointNow,pointPast,sceneName);
62 62 mIView.showDetialInfo(ranking, pscore, risePoint, pointUpAverage, riseRanking, averageRanking, evaluationDescripe);
63 63  
64   -
65   -
66 64 }
67 65 }, new Consumer<Throwable>() {
68 66 @Override
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/apply/ApplyReplaceCardActivity.java
... ... @@ -13,6 +13,7 @@ import android.widget.TextView;
13 13 import com.share.mvpsdk.base.BasePresenter;
14 14 import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
15 15 import com.shunzhi.parent.R;
  16 +import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract;
16 17 import com.shunzhi.parent.presenter.apply.ApplyReplaceCardPresenter;
17 18 import com.shunzhi.parent.ui.fragment.apply.ApplyReplaceCardFragment;
18 19 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 27 public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements View.OnClickListener{
26 28 ApplyReplaceCardFragment applyReplaceCardFragment = null;
27 29 ImageView ivBack;
... ... @@ -45,7 +47,6 @@ public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements V
45 47 center_title = findViewById(R.id.center_title);
46 48 frame_replacecard = findViewById(R.id.frame_replacecard);
47 49 center_title.setText("补卡");
48   -
49 50 ivBack.setOnClickListener(this);
50 51  
51 52 fragmentTransaction = getSupportFragmentManager().beginTransaction();
... ... @@ -65,4 +66,6 @@ public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements V
65 66 public BasePresenter initPresenter() {
66 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 11  
12 12 import com.share.mvpsdk.base.BasePresenter;
13 13 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  14 +import com.share.mvpsdk.utils.ToastUtils;
14 15 import com.shunzhi.parent.R;
  16 +import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract;
15 17 import com.shunzhi.parent.views.ReplaceCardDialog;
16 18  
17 19 /**
18 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 24 private Button bt_sure;
23 25 private Button bt_cancel;
24 26 ReplaceCardDialog replaceCardDialog=null;
25 27 private EditText et_cardnum;
26 28 private String cardnum;
  29 + private String cardid;
27 30  
28 31 @NonNull
29 32 @Override
... ... @@ -44,6 +47,14 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment implements V
44 47 et_cardnum = view.findViewById(R.id.et_cardnum);
45 48  
46 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 60 @Override
... ...
app/src/main/res/layout/fragment_report.xml
... ... @@ -68,13 +68,7 @@
68 68 android:layout_width="match_parent"
69 69 android:layout_height="match_parent"
70 70 android:background="@color/white"
71   -<<<<<<< HEAD
72 71 android:visibility="visible">
73   -=======
74   - android:visibility="gone"
75   -
76   - >
77   ->>>>>>> eda704dec86974be81437b97aa949c3570bb8be0
78 72  
79 73 <TextView
80 74 android:id="@+id/tvNoData"
... ...
app/src/main/res/layout/fragment_report_detial.xml
... ... @@ -171,7 +171,7 @@
171 171 android:layout_height="0dp"
172 172 android:layout_weight="1.5">
173 173  
174   -<<<<<<< HEAD
  174 +
175 175 <com.share.mvpsdk.view.chartview.ChartView
176 176 android:id="@+id/chartView"
177 177 android:layout_width="match_parent"
... ... @@ -186,7 +186,6 @@
186 186 android:text="图表控件"
187 187 android:textColor="@color/md_red_500"
188 188 android:visibility="gone" />
189   -=======
190 189 <LinearLayout
191 190 android:layout_width="match_parent"
192 191 android:layout_height="match_parent"
... ... @@ -206,7 +205,6 @@
206 205 android:layout_height="@dimen/size_dp_16"
207 206 android:background="@drawable/shape_blue_8"
208 207 />
209   ->>>>>>> eda704dec86974be81437b97aa949c3570bb8be0
210 208  
211 209 <TextView
212 210 android:layout_marginLeft="@dimen/size_dp_5"
... ... @@ -244,7 +242,8 @@
244 242 <com.share.mvpsdk.view.chartview.ChartView
245 243 android:id="@+id/chartView"
246 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 248 <TextView
250 249 android:layout_width="match_parent"
... ...