Commit 55f0d839b94524774cee5f302f6a60062cb68ab1
1 parent
774a0595
Exists in
yxb_dev
and in
2 other branches
no message
Showing
14 changed files
with
89 additions
and
52 deletions
 
Show diff stats
app/libs/processor.jar
No preview for this file type
app/src/main/AndroidManifest.xml
| ... | ... | @@ -204,6 +204,10 @@ | 
| 204 | 204 | android:name=".ui.activity.report.ReportSceneActivity" | 
| 205 | 205 | android:launchMode="singleInstance" /> | 
| 206 | 206 | |
| 207 | + <activity | |
| 208 | + android:name=".ui.activity.apply.ApplyReplaceCardActivity" | |
| 209 | + android:launchMode="singleInstance" /> | |
| 210 | + | |
| 207 | 211 | <service | 
| 208 | 212 | android:name=".ui.service.BadgeIntentService" | 
| 209 | 213 | android:exported="false"></service> | ... | ... | 
app/src/main/java/com/shunzhi/parent/AppConfig.java
| ... | ... | @@ -38,15 +38,15 @@ public class AppConfig { | 
| 38 | 38 | public static String APP_IS_START = "app_is_start"; | 
| 39 | 39 | |
| 40 | 40 | //http://campus.myjxt.com/ | 
| 41 | -// public static String BASE_URL="http://60.190.202.57:1000/"; | |
| 42 | -// public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | |
| 43 | -// public static String BASE_URL_FILE="http://60.190.202.57:8196"; | |
| 41 | + public static String BASE_URL="http://60.190.202.57:1000/"; | |
| 42 | + public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | |
| 43 | + public static String BASE_URL_FILE="http://60.190.202.57:8196"; | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | //正式 | 
| 47 | - public static String BASE_URL="http://campus.myjxt.com/"; | |
| 48 | - public static String BASE_URL_ORDER="http://parent.myjxt.com/"; | |
| 49 | - public static String BASE_URL_FILE="http://manage.myjxt.com"; | |
| 47 | +// public static String BASE_URL="http://campus.myjxt.com/"; | |
| 48 | +// public static String BASE_URL_ORDER="http://parent.myjxt.com/"; | |
| 49 | +// public static String BASE_URL_FILE="http://manage.myjxt.com"; | |
| 50 | 50 | // public static final String url_version = BASE_URL + "api/Common/AppVersion?appType=3"; | 
| 51 | 51 | |
| 52 | 52 | ... | ... | 
app/src/main/java/com/shunzhi/parent/adapter/ReportAdapter.java
| ... | ... | @@ -13,6 +13,7 @@ import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | 
| 13 | 13 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 
| 14 | 14 | import com.shunzhi.parent.R; | 
| 15 | 15 | import com.shunzhi.parent.bean.ReportBean; | 
| 16 | +import com.shunzhi.parent.ui.activity.apply.ApplyReplaceCardActivity; | |
| 16 | 17 | import com.shunzhi.parent.ui.activity.report.ReportDetialActivity; | 
| 17 | 18 | import com.shunzhi.parent.views.CustomLinearLayoutManager; | 
| 18 | 19 | ... | ... | 
app/src/main/java/com/shunzhi/parent/api/ApplyReplaceCardApi.java
| ... | ... | @@ -13,5 +13,5 @@ import retrofit2.http.Query; | 
| 13 | 13 | public interface ApplyReplaceCardApi { | 
| 14 | 14 | |
| 15 | 15 | @GET("/api/OneCard/AddStuCard") | 
| 16 | - Observable<JsonObject> getApplyReplaceCard(@Query("studentId,cardId") int studentId,String cardId); | |
| 16 | + Observable<JsonObject> getApplyReplaceCard(@Query("studentId") int studentId,@Query("onecard") String cardId); | |
| 17 | 17 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/contract/apply/ApplyReplaceCardContract.java
| 1 | 1 | package com.shunzhi.parent.contract.apply; | 
| 2 | 2 | |
| 3 | + | |
| 4 | + | |
| 5 | +import android.util.Log; | |
| 6 | + | |
| 3 | 7 | import com.google.gson.JsonObject; | 
| 4 | 8 | import com.share.mvpsdk.base.BasePresenter; | 
| 5 | 9 | import com.share.mvpsdk.base.IBaseActivity; | 
| 6 | 10 | import com.share.mvpsdk.base.IBaseModel; | 
| 7 | -import com.shunzhi.parent.bean.apply.ApplyReplaceCardBean; | |
| 11 | +import com.share.mvpsdk.base.IBaseView; | |
| 12 | +import com.share.mvpsdk.utils.ToastUtils; | |
| 8 | 13 | |
| 9 | -import java.util.List; | |
| 10 | 14 | |
| 11 | 15 | /** | 
| 12 | 16 | * Created by Administrator on 2018/4/18 0018. | 
| ... | ... | @@ -14,15 +18,14 @@ import java.util.List; | 
| 14 | 18 | |
| 15 | 19 | public interface ApplyReplaceCardContract { | 
| 16 | 20 | |
| 17 | - //IOrderDetailModel,IOrderDetailView | |
| 18 | 21 | abstract class ApplyReplaceCardPreenter extends BasePresenter<IApplyReplaceCardModel,IApplyReplaceCardView>{ | 
| 19 | - public abstract void showReplaceCardDetail(int studentId,String cardId); | |
| 22 | + public abstract void ReplaceCardDetail(int studentId,String cardId); | |
| 20 | 23 | } | 
| 21 | 24 | interface IApplyReplaceCardModel extends IBaseModel { | 
| 22 | 25 | io.reactivex.Observable<JsonObject> getReplaceCardDetailResult(int studentId, String cardId); | 
| 23 | 26 | } | 
| 24 | 27 | |
| 25 | - interface IApplyReplaceCardView extends IBaseActivity{ | |
| 26 | - void showReplaceCardDetail(List<ApplyReplaceCardBean> applyReplaceCardBean); | |
| 28 | + interface IApplyReplaceCardView extends IBaseView{ | |
| 29 | + void showTipsDialog(); | |
| 27 | 30 | } | 
| 28 | 31 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/model/apply/ApplyReplaceCardModel.java
| ... | ... | @@ -3,6 +3,7 @@ package com.shunzhi.parent.model.apply; | 
| 3 | 3 | import com.google.gson.JsonObject; | 
| 4 | 4 | import com.share.mvpsdk.base.BaseModel; | 
| 5 | 5 | import com.share.mvpsdk.helper.RetrofitCreateHelper; | 
| 6 | +import com.share.mvpsdk.helper.RxHelper; | |
| 6 | 7 | import com.shunzhi.parent.AppConfig; | 
| 7 | 8 | import com.shunzhi.parent.AppContext; | 
| 8 | 9 | import com.shunzhi.parent.api.ApplyReplaceCardApi; | 
| ... | ... | @@ -22,6 +23,6 @@ public class ApplyReplaceCardModel extends BaseModel implements ApplyReplaceCard | 
| 22 | 23 | @Override | 
| 23 | 24 | public Observable<JsonObject> getReplaceCardDetailResult(int studentId, String cardId) { | 
| 24 | 25 | 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 | + return RetrofitCreateHelper.getInstance().createApi(ApplyReplaceCardApi.class,AppConfig.BASE_URL).getApplyReplaceCard(studentId,cardId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | |
| 26 | 27 | } | 
| 27 | 28 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/presenter/apply/ApplyReplaceCardPresenter.java
| 1 | 1 | package com.shunzhi.parent.presenter.apply; | 
| 2 | 2 | |
| 3 | +import android.annotation.SuppressLint; | |
| 4 | +import android.text.TextUtils; | |
| 5 | +import android.util.Log; | |
| 6 | + | |
| 3 | 7 | import com.google.gson.JsonObject; | 
| 4 | 8 | import com.share.mvpsdk.base.BasePresenter; | 
| 5 | 9 | import com.share.mvpsdk.utils.ToastUtils; | 
| 6 | 10 | import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; | 
| 7 | 11 | import com.shunzhi.parent.model.apply.ApplyReplaceCardModel; | 
| 12 | +import com.shunzhi.parent.views.ReplaceCardDialog; | |
| 8 | 13 | |
| 9 | 14 | import io.reactivex.functions.Consumer; | 
| 10 | 15 | |
| ... | ... | @@ -12,6 +17,10 @@ import io.reactivex.functions.Consumer; | 
| 12 | 17 | * Created by Administrator on 2018/4/18 0018. | 
| 13 | 18 | */ | 
| 14 | 19 | public class ApplyReplaceCardPresenter extends ApplyReplaceCardContract.ApplyReplaceCardPreenter { | 
| 20 | + | |
| 21 | + private JsonObject json; | |
| 22 | + private ReplaceCardDialog replaceCardDialog=null; | |
| 23 | + | |
| 15 | 24 | @Override | 
| 16 | 25 | public ApplyReplaceCardContract.IApplyReplaceCardModel getModel() { | 
| 17 | 26 | return ApplyReplaceCardModel.newInstance(); | 
| ... | ... | @@ -23,12 +32,21 @@ public class ApplyReplaceCardPresenter extends ApplyReplaceCardContract.ApplyRep | 
| 23 | 32 | } | 
| 24 | 33 | |
| 25 | 34 | @Override | 
| 26 | - public void showReplaceCardDetail(int studentId, String cardId) { | |
| 27 | - mRxManager.register(mIModel.getReplaceCardDetailResult(studentId,cardId).subscribe(new Consumer<JsonObject>() { | |
| 35 | + public void ReplaceCardDetail(int studentId, String cardId) { | |
| 36 | + mRxManager.register(mIModel.getReplaceCardDetailResult(studentId, cardId).subscribe(new Consumer<JsonObject>() { | |
| 37 | + @SuppressLint("LongLogTag") | |
| 28 | 38 | @Override | 
| 29 | 39 | public void accept(JsonObject jsonObject) throws Exception { | 
| 30 | - ToastUtils.showToast(jsonObject.toString()); | |
| 31 | - //接收到的json | |
| 40 | + ToastUtils.showToast("data:" + jsonObject.toString()); | |
| 41 | + | |
| 42 | + json = jsonObject.getAsJsonObject("data"); | |
| 43 | + String isShowTipDialog = json.get("data").getAsString(); | |
| 44 | + if (isShowTipDialog.equals("true")) { | |
| 45 | + //mIView.showTipsDialog(); | |
| 46 | + replaceCardDialog.setTitle("补卡提示"); | |
| 47 | + replaceCardDialog.setText("您已补卡成功!"); | |
| 48 | + replaceCardDialog.show(); | |
| 49 | + } | |
| 32 | 50 | |
| 33 | 51 | } | 
| 34 | 52 | }, new Consumer<Throwable>() { | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/activity/apply/ApplyReplaceCardActivity.java
| ... | ... | @@ -23,7 +23,6 @@ import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment; | 
| 23 | 23 | * 补卡界面 | 
| 24 | 24 | */ | 
| 25 | 25 | |
| 26 | -//OrderDetailContract.OrderDetailPreenter,OrderDetailContract.IOrderDetailModel | |
| 27 | 26 | public class ApplyReplaceCardActivity extends BaseMVPCompatActivity implements View.OnClickListener{ | 
| 28 | 27 | ApplyReplaceCardFragment applyReplaceCardFragment = null; | 
| 29 | 28 | ImageView ivBack; | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/fragment/apply/ApplyReplaceCardFragment.java
| 1 | 1 | package com.shunzhi.parent.ui.fragment.apply; | 
| 2 | 2 | |
| 3 | +import android.annotation.SuppressLint; | |
| 3 | 4 | import android.os.Bundle; | 
| 4 | 5 | import android.support.annotation.NonNull; | 
| 5 | 6 | import android.support.annotation.Nullable; | 
| 6 | 7 | import android.text.TextUtils; | 
| 8 | +import android.util.Log; | |
| 7 | 9 | import android.view.View; | 
| 8 | 10 | import android.widget.Button; | 
| 9 | 11 | import android.widget.EditText; | 
| ... | ... | @@ -14,24 +16,24 @@ import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; | 
| 14 | 16 | import com.share.mvpsdk.utils.ToastUtils; | 
| 15 | 17 | import com.shunzhi.parent.R; | 
| 16 | 18 | import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; | 
| 19 | +import com.shunzhi.parent.presenter.apply.ApplyReplaceCardPresenter; | |
| 17 | 20 | import com.shunzhi.parent.views.ReplaceCardDialog; | 
| 18 | 21 | |
| 19 | 22 | /** | 
| 20 | 23 | * Created by Administrator on 2018/4/10 0010. | 
| 21 | 24 | */ | 
| 22 | 25 | |
| 23 | -public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplaceCardContract.ApplyReplaceCardPreenter,ApplyReplaceCardContract.IApplyReplaceCardModel> implements View.OnClickListener{ | |
| 26 | +public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplaceCardContract.ApplyReplaceCardPreenter, ApplyReplaceCardContract.IApplyReplaceCardModel> implements View.OnClickListener { | |
| 24 | 27 | private Button bt_sure; | 
| 25 | 28 | private Button bt_cancel; | 
| 26 | - ReplaceCardDialog replaceCardDialog=null; | |
| 29 | + ReplaceCardDialog replaceCardDialog = null; | |
| 27 | 30 | private EditText et_cardnum; | 
| 28 | - private String cardnum; | |
| 29 | - private String cardid; | |
| 31 | + private String cardnum =""; | |
| 30 | 32 | |
| 31 | 33 | @NonNull | 
| 32 | 34 | @Override | 
| 33 | 35 | public BasePresenter initPresenter() { | 
| 34 | - return null; | |
| 36 | + return new ApplyReplaceCardPresenter(); | |
| 35 | 37 | } | 
| 36 | 38 | |
| 37 | 39 | @Override | 
| ... | ... | @@ -41,35 +43,38 @@ public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplace | 
| 41 | 43 | |
| 42 | 44 | @Override | 
| 43 | 45 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 
| 44 | - replaceCardDialog = new ReplaceCardDialog(getActivity()); | |
| 45 | - bt_sure = view.findViewById(R.id.bt_sure); | |
| 46 | - bt_cancel = view.findViewById(R.id.bt_cancle); | |
| 47 | - et_cardnum = view.findViewById(R.id.et_cardnum); | |
| 46 | + replaceCardDialog = new ReplaceCardDialog(getActivity()); | |
| 47 | + bt_sure = view.findViewById(R.id.bt_sure); | |
| 48 | + bt_cancel = view.findViewById(R.id.bt_cancle); | |
| 49 | + et_cardnum = view.findViewById(R.id.et_cardnum); | |
| 48 | 50 | |
| 49 | - bt_sure.setOnClickListener(this); | |
| 51 | + bt_sure.setOnClickListener(this); | |
| 50 | 52 | |
| 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 | - } | |
| 58 | 53 | } | 
| 59 | 54 | |
| 55 | + @SuppressLint("LongLogTag") | |
| 60 | 56 | @Override | 
| 61 | 57 | public void onClick(View view) { | 
| 62 | - switch (view.getId()){ | |
| 58 | + switch (view.getId()) { | |
| 63 | 59 | case R.id.bt_sure: | 
| 64 | 60 | cardnum = et_cardnum.getText().toString().trim(); | 
| 65 | - if (TextUtils.isEmpty(cardnum)){ | |
| 66 | - Toast.makeText(getActivity(),"卡号不能为空,请重新输入",Toast.LENGTH_SHORT).show(); | |
| 67 | - } | |
| 68 | - else { | |
| 69 | - replaceCardDialog.setTitle("补卡提示"); | |
| 70 | - replaceCardDialog.setText("您已补卡成功!"); | |
| 71 | - replaceCardDialog.show(); | |
| 61 | + ToastUtils.showToast("cardnum:" + cardnum); | |
| 62 | + Log.i("ApplyReplaceCardFragment:data", cardnum); | |
| 63 | + if (TextUtils.isEmpty(cardnum)) { | |
| 64 | + ToastUtils.showToast("卡号不能为空,请重新输入!"); | |
| 65 | + } else { | |
| 66 | + //studentid 从成长界面获取 此处设置为“123” | |
| 67 | + mPresenter.ReplaceCardDetail(12, cardnum); | |
| 72 | 68 | } | 
| 69 | + | |
| 70 | +// cardnum = et_cardnum.getText().toString().trim(); | |
| 71 | +// if (TextUtils.isEmpty(cardnum)) { | |
| 72 | +// Toast.makeText(getActivity(), "卡号不能为空,请重新输入", Toast.LENGTH_SHORT).show(); | |
| 73 | +// } else { | |
| 74 | +// replaceCardDialog.setTitle("补卡提示"); | |
| 75 | +// replaceCardDialog.setText("您已补卡成功!"); | |
| 76 | +// replaceCardDialog.show(); | |
| 77 | +// } | |
| 73 | 78 | break; | 
| 74 | 79 | } | 
| 75 | 80 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
| 1 | 1 | package com.shunzhi.parent.ui.fragment.report; | 
| 2 | 2 | |
| 3 | +import android.content.Intent; | |
| 3 | 4 | import android.os.Bundle; | 
| 4 | 5 | import android.os.Handler; | 
| 5 | 6 | import android.os.Message; | 
| ... | ... | @@ -19,6 +20,10 @@ import com.shunzhi.parent.adapter.ReportAdapter; | 
| 19 | 20 | import com.shunzhi.parent.bean.ReportBean; | 
| 20 | 21 | import com.shunzhi.parent.contract.report.ReportContract; | 
| 21 | 22 | import com.shunzhi.parent.presenter.report.ReportPresenter; | 
| 23 | +import com.shunzhi.parent.ui.activity.apply.ApplyReplaceCardActivity; | |
| 24 | +import com.shunzhi.parent.ui.activity.report.ReportDetialActivity; | |
| 25 | +import com.shunzhi.parent.ui.activity.report.ReportSceneActivity; | |
| 26 | +import com.shunzhi.parent.ui.fragment.apply.ApplyReplaceCardFragment; | |
| 22 | 27 | |
| 23 | 28 | import java.util.List; | 
| 24 | 29 | |
| ... | ... | @@ -28,6 +33,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | 
| 28 | 33 | implements ReportContract.IReportView, View.OnClickListener { | 
| 29 | 34 | |
| 30 | 35 | public static String TYPE_CHENGZHANG = "chengzhang", TYPE_REPORT = "report"; | 
| 36 | + ApplyReplaceCardFragment applyReplaceCardFragment = null; | |
| 31 | 37 | |
| 32 | 38 | public static ChengZhangFragment newInstance(String type) { | 
| 33 | 39 | Bundle bundle = new Bundle(); | 
| ... | ... | @@ -144,13 +150,12 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | 
| 144 | 150 | public void onClick(View view) { | 
| 145 | 151 | switch (view.getId()) { | 
| 146 | 152 | case R.id.layout_kaoqin: | 
| 147 | - | |
| 153 | + ReportDetialActivity.getInstance(getActivity(),"2018-04-11",2,"34345"); | |
| 148 | 154 | break; | 
| 149 | 155 | case R.id.layout_buka: | 
| 150 | - | |
| 156 | + ApplyReplaceCardActivity.getInstance(getActivity()); | |
| 151 | 157 | break; | 
| 152 | 158 | case R.id.layout_qingjia: | 
| 153 | - | |
| 154 | 159 | break; | 
| 155 | 160 | } | 
| 156 | 161 | } | ... | ... | 
app/src/main/res/layout/fragment_apply_replacecard.xml
| ... | ... | @@ -29,7 +29,7 @@ | 
| 29 | 29 | android:layout_height="170dp" | 
| 30 | 30 | android:background="@drawable/report_white" | 
| 31 | 31 | android:orientation="vertical" | 
| 32 | - android:layout_margin="@dimen/margin_medium"> | |
| 32 | + android:layout_margin="@dimen/margin_large"> | |
| 33 | 33 | |
| 34 | 34 | <LinearLayout | 
| 35 | 35 | android:layout_width="match_parent" | 
| ... | ... | @@ -41,7 +41,7 @@ | 
| 41 | 41 | <TextView | 
| 42 | 42 | android:layout_weight="1" | 
| 43 | 43 | android:id="@+id/tv_carduser" | 
| 44 | - android:paddingLeft="@dimen/margin_small" | |
| 44 | + android:layout_margin="@dimen/dp_8" | |
| 45 | 45 | android:layout_width="0dp" | 
| 46 | 46 | android:layout_height="wrap_content" | 
| 47 | 47 | android:text="补卡人:" | 
| ... | ... | @@ -70,7 +70,7 @@ | 
| 70 | 70 | android:layout_weight="1" | 
| 71 | 71 | android:layout_width="0dp" | 
| 72 | 72 | android:layout_height="wrap_content" | 
| 73 | - android:paddingLeft="@dimen/margin_small" | |
| 73 | + android:layout_margin="@dimen/dp_8" | |
| 74 | 74 | android:text="卡号:" | 
| 75 | 75 | android:textColor="@color/hintTextColor" | 
| 76 | 76 | android:textSize="@dimen/textSize16" /> | 
| ... | ... | @@ -100,7 +100,7 @@ | 
| 100 | 100 | android:id="@+id/tv_cardnumber" | 
| 101 | 101 | android:layout_width="0dp" | 
| 102 | 102 | android:layout_height="wrap_content" | 
| 103 | - android:paddingLeft="@dimen/margin_small" | |
| 103 | + android:layout_margin="@dimen/dp_8" | |
| 104 | 104 | android:layout_weight="1" | 
| 105 | 105 | android:text="考勤次数:" | 
| 106 | 106 | android:textColor="@color/hintTextColor" | ... | ... | 
app/src/main/res/layout/fragment_report.xml
mvpsdk/src/main/res/values/dimens.xml
| ... | ... | @@ -31,6 +31,7 @@ | 
| 31 | 31 | <dimen name="dp_066">0.66dp</dimen> | 
| 32 | 32 | <dimen name="dp_4">4dp</dimen> | 
| 33 | 33 | <dimen name="dp_5">5dp</dimen> | 
| 34 | + <dimen name="dp_8">8dp</dimen> | |
| 34 | 35 | <dimen name="dp_10">10dp</dimen> | 
| 35 | 36 | <dimen name="dp_14">14dp</dimen> | 
| 36 | 37 | <dimen name="dp_22">22dp</dimen> | ... | ... |