Commit 8e9c580cb4eb231e85f6f527436622dd42e1f9af

Authored by wwx
1 parent faf9f809

no message

Showing 30 changed files with 304 additions and 99 deletions   Show diff stats
app/libs/processor.jar
No preview for this file type
app/src/main/AndroidManifest.xml
@@ -208,6 +208,10 @@ @@ -208,6 +208,10 @@
208 android:name=".ui.activity.apply.ApplyReplaceCardActivity" 208 android:name=".ui.activity.apply.ApplyReplaceCardActivity"
209 android:launchMode="singleInstance" /> 209 android:launchMode="singleInstance" />
210 210
  211 + <activity
  212 + android:name=".ui.activity.apply.ApplySigninActivity"
  213 + android:launchMode="singleInstance" />
  214 +
211 <service 215 <service
212 android:name=".ui.service.BadgeIntentService" 216 android:name=".ui.service.BadgeIntentService"
213 android:exported="false"></service> 217 android:exported="false"></service>
app/src/main/java/com/shunzhi/parent/adapter/AttendanceAdapter.java
@@ -3,10 +3,15 @@ package com.shunzhi.parent.adapter; @@ -3,10 +3,15 @@ package com.shunzhi.parent.adapter;
3 import android.content.Context; 3 import android.content.Context;
4 import android.content.Intent; 4 import android.content.Intent;
5 import android.support.v4.app.FragmentActivity; 5 import android.support.v4.app.FragmentActivity;
  6 +import android.text.TextUtils;
  7 +import android.util.Log;
6 import android.view.LayoutInflater; 8 import android.view.LayoutInflater;
7 import android.view.View; 9 import android.view.View;
8 import android.view.ViewGroup; 10 import android.view.ViewGroup;
  11 +import android.widget.ImageView;
  12 +import android.widget.TextView;
9 13
  14 +import com.bumptech.glide.Glide;
10 import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; 15 import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter;
11 import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; 16 import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder;
12 import com.shunzhi.parent.R; 17 import com.shunzhi.parent.R;
@@ -21,8 +26,6 @@ import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment; @@ -21,8 +26,6 @@ import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment;
21 */ 26 */
22 27
23 public class AttendanceAdapter extends BaseRecyclerViewAdapter<AttendanceBean> { 28 public class AttendanceAdapter extends BaseRecyclerViewAdapter<AttendanceBean> {
24 -  
25 -  
26 private Context mContext = null; 29 private Context mContext = null;
27 30
28 public AttendanceAdapter(Context context) { 31 public AttendanceAdapter(Context context) {
@@ -36,18 +39,33 @@ public class AttendanceAdapter extends BaseRecyclerViewAdapter&lt;AttendanceBean&gt; { @@ -36,18 +39,33 @@ public class AttendanceAdapter extends BaseRecyclerViewAdapter&lt;AttendanceBean&gt; {
36 } 39 }
37 40
38 public class AttendanceViewHolder extends BaseRecyclerViewHolder<AttendanceBean> { 41 public class AttendanceViewHolder extends BaseRecyclerViewHolder<AttendanceBean> {
  42 + TextView tv_parent_name,tv_attendance;
  43 + ImageView iv_photo;
  44 +
39 public AttendanceViewHolder(View itemView) { 45 public AttendanceViewHolder(View itemView) {
40 super(itemView); 46 super(itemView);
  47 +
  48 + tv_parent_name = itemView.findViewById(R.id.tv_parent_name);
  49 + tv_attendance = itemView.findViewById(R.id.tv_attendance);
  50 + iv_photo = itemView.findViewById(R.id.iv_photo);
41 } 51 }
42 52
43 @Override 53 @Override
44 public void onBindViewHolder(AttendanceBean object, int position) { 54 public void onBindViewHolder(AttendanceBean object, int position) {
  55 + Log.i("AttendanceAdapter:",object.getSituation());
  56 + tv_attendance.setText(object.getSituation());
  57 + if (TextUtils.isEmpty(object.getHead_image())){
  58 + iv_photo.setImageResource(R.drawable.photo);
  59 + }else {
  60 + Glide.with(mContext).load(object.getHead_image()).asBitmap().centerCrop().into(iv_photo);
  61 + }
  62 +
45 itemView.setOnClickListener(new View.OnClickListener() { 63 itemView.setOnClickListener(new View.OnClickListener() {
46 @Override 64 @Override
47 public void onClick(View view) { 65 public void onClick(View view) {
48 - // mContext.startActivity(new Intent().setClass(mContext, ApplySigninActivity.class));  
49 } 66 }
50 }); 67 });
51 } 68 }
52 } 69 }
  70 +
53 } 71 }
app/src/main/java/com/shunzhi/parent/api/ApplyReplaceCardApi.java
@@ -13,5 +13,5 @@ import retrofit2.http.Query; @@ -13,5 +13,5 @@ import retrofit2.http.Query;
13 public interface ApplyReplaceCardApi { 13 public interface ApplyReplaceCardApi {
14 14
15 @GET("/api/OneCard/AddStuCard") 15 @GET("/api/OneCard/AddStuCard")
16 - Observable<JsonObject> getApplyReplaceCard(@Query("studentId") int studentId,@Query("onecard") String cardId); 16 + Observable<JsonObject> getApplyReplaceCard(@Query("studentid") int studentId,@Query("onecard") String cardId);
17 } 17 }
app/src/main/java/com/shunzhi/parent/api/ApplySigninApi.java 0 → 100644
@@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
  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/19 0019.
  11 + */
  12 +
  13 +public interface ApplySigninApi {
  14 + @GET("/api/ParentService/GetAttendanceList")
  15 + Observable<JsonObject> getApplySignin(@Query("studentid") int studentId, @Query("schoolid") int schoolId,@Query("starttime") String date);
  16 +}
app/src/main/java/com/shunzhi/parent/bean/apply/AttendanceBean.java
@@ -5,18 +5,130 @@ package com.shunzhi.parent.bean.apply; @@ -5,18 +5,130 @@ package com.shunzhi.parent.bean.apply;
5 */ 5 */
6 6
7 public class AttendanceBean { 7 public class AttendanceBean {
8 - String studentId;  
9 - String imgUrl;  
10 - String kaoQinNum;  
11 - String kaoQinDate; 8 + String user_id;
  9 + int school_id;
  10 + int customerId;
  11 + int usertype;
  12 + String card_num;
  13 + int card_type;
  14 + int outof;
  15 + String intime;
  16 + String cid;
  17 + int func_no;
  18 + String head_image;
  19 + String situation;
  20 +
  21 + public String getUser_id() {
  22 + return user_id;
  23 + }
  24 +
  25 + public void setUser_id(String user_id) {
  26 + this.user_id = user_id;
  27 + }
  28 +
  29 + public int getSchool_id() {
  30 + return school_id;
  31 + }
  32 +
  33 + public void setSchool_id(int school_id) {
  34 + this.school_id = school_id;
  35 + }
  36 +
  37 + public int getCustomerId() {
  38 + return customerId;
  39 + }
  40 +
  41 + public void setCustomerId(int customerId) {
  42 + this.customerId = customerId;
  43 + }
  44 +
  45 + public int getUsertype() {
  46 + return usertype;
  47 + }
  48 +
  49 + public void setUsertype(int usertype) {
  50 + this.usertype = usertype;
  51 + }
  52 +
  53 + public String getCard_num() {
  54 + return card_num;
  55 + }
  56 +
  57 + public void setCard_num(String card_num) {
  58 + this.card_num = card_num;
  59 + }
  60 +
  61 + public int getCard_type() {
  62 + return card_type;
  63 + }
  64 +
  65 + public void setCard_type(int card_type) {
  66 + this.card_type = card_type;
  67 + }
  68 +
  69 + public int getOutof() {
  70 + return outof;
  71 + }
  72 +
  73 + public void setOutof(int outof) {
  74 + this.outof = outof;
  75 + }
  76 +
  77 + public String getIntime() {
  78 + return intime;
  79 + }
  80 +
  81 + public void setIntime(String intime) {
  82 + this.intime = intime;
  83 + }
  84 +
  85 + public String getCid() {
  86 + return cid;
  87 + }
  88 +
  89 + public void setCid(String cid) {
  90 + this.cid = cid;
  91 + }
  92 +
  93 + public int getFunc_no() {
  94 + return func_no;
  95 + }
  96 +
  97 + public void setFunc_no(int func_no) {
  98 + this.func_no = func_no;
  99 + }
  100 +
  101 + public String getHead_image() {
  102 + return head_image;
  103 + }
  104 +
  105 + public void setHead_image(String head_image) {
  106 + this.head_image = head_image;
  107 + }
  108 +
  109 + public String getSituation() {
  110 + return situation;
  111 + }
  112 +
  113 + public void setSituation(String situation) {
  114 + this.situation = situation;
  115 + }
12 116
13 @Override 117 @Override
14 public String toString() { 118 public String toString() {
15 return "AttendanceBean{" + 119 return "AttendanceBean{" +
16 - "studentId='" + studentId + '\'' +  
17 - ", imgUrl='" + imgUrl + '\'' +  
18 - ", kaoQinNum='" + kaoQinNum + '\'' +  
19 - ", kaoQinDate='" + kaoQinDate + '\'' + 120 + "user_id='" + user_id + '\'' +
  121 + ", school_id=" + school_id +
  122 + ", customerId=" + customerId +
  123 + ", usertype=" + usertype +
  124 + ", card_num='" + card_num + '\'' +
  125 + ", card_type=" + card_type +
  126 + ", outof=" + outof +
  127 + ", intime='" + intime + '\'' +
  128 + ", cid='" + cid + '\'' +
  129 + ", func_no=" + func_no +
  130 + ", head_image='" + head_image + '\'' +
  131 + ", situation='" + situation + '\'' +
20 '}'; 132 '}';
21 } 133 }
22 } 134 }
app/src/main/java/com/shunzhi/parent/contract/apply/ApplySigninContract.java
@@ -7,7 +7,9 @@ import com.share.mvpsdk.base.BasePresenter; @@ -7,7 +7,9 @@ import com.share.mvpsdk.base.BasePresenter;
7 import com.share.mvpsdk.base.IBaseFragment; 7 import com.share.mvpsdk.base.IBaseFragment;
8 import com.share.mvpsdk.base.IBaseModel; 8 import com.share.mvpsdk.base.IBaseModel;
9 import com.shunzhi.parent.bean.ToolBean; 9 import com.shunzhi.parent.bean.ToolBean;
  10 +import com.shunzhi.parent.bean.apply.AttendanceBean;
10 11
  12 +import java.util.Date;
11 import java.util.List; 13 import java.util.List;
12 14
13 import io.reactivex.Observable; 15 import io.reactivex.Observable;
@@ -15,23 +17,22 @@ import io.reactivex.Observable; @@ -15,23 +17,22 @@ import io.reactivex.Observable;
15 /** 17 /**
16 * Created by ToaHanDong on 2018/3/14. 18 * Created by ToaHanDong on 2018/3/14.
17 */ 19 */
18 -  
19 public interface ApplySigninContract { 20 public interface ApplySigninContract {
20 21
21 abstract class ApplySigninPresenter extends BasePresenter<IApplySigninModel,IApplySigninView>{ 22 abstract class ApplySigninPresenter extends BasePresenter<IApplySigninModel,IApplySigninView>{
22 - public abstract void getTools(LinearLayout linearLayout,String areaName); 23 + public abstract void SigninDetail(int studentId, int schoolId, String date);
23 } 24 }
24 25
25 26
26 interface IApplySigninModel extends IBaseModel{ 27 interface IApplySigninModel extends IBaseModel{
27 - Observable<JsonObject> getTools(String areaName); 28 + Observable<JsonObject> getSigninDetailResult(int studentId, int schoolId, String date);
28 } 29 }
29 30
30 31
31 interface IApplySigninView extends IBaseFragment{ 32 interface IApplySigninView extends IBaseFragment{
32 33
33 - void showTools(List<ToolBean> toolBeanList);  
34 - 34 + void showDetialList(List<AttendanceBean> list);
  35 + void showDetialInfo(List<AttendanceBean> list);
35 } 36 }
36 37
37 } 38 }
app/src/main/java/com/shunzhi/parent/model/apply/ApplyReplaceCardModel.java
@@ -14,7 +14,6 @@ import io.reactivex.Observable; @@ -14,7 +14,6 @@ import io.reactivex.Observable;
14 /** 14 /**
15 * Created by Administrator on 2018/4/18 0018. 15 * Created by Administrator on 2018/4/18 0018.
16 */ 16 */
17 -//BaseModel implements OrderDetailContract.IOrderDetailModel  
18 public class ApplyReplaceCardModel extends BaseModel implements ApplyReplaceCardContract.IApplyReplaceCardModel{ 17 public class ApplyReplaceCardModel extends BaseModel implements ApplyReplaceCardContract.IApplyReplaceCardModel{
19 public static ApplyReplaceCardContract.IApplyReplaceCardModel newInstance() { 18 public static ApplyReplaceCardContract.IApplyReplaceCardModel newInstance() {
20 return new ApplyReplaceCardModel(); 19 return new ApplyReplaceCardModel();
@@ -22,7 +21,6 @@ public class ApplyReplaceCardModel extends BaseModel implements ApplyReplaceCard @@ -22,7 +21,6 @@ public class ApplyReplaceCardModel extends BaseModel implements ApplyReplaceCard
22 21
23 @Override 22 @Override
24 public Observable<JsonObject> getReplaceCardDetailResult(int studentId, String cardId) { 23 public Observable<JsonObject> getReplaceCardDetailResult(int studentId, String cardId) {
25 - String user_id = AppConfig.getAppConfig(AppContext.getContext()).get(AppConfig.USER_ID);  
26 return RetrofitCreateHelper.getInstance().createApi(ApplyReplaceCardApi.class,AppConfig.BASE_URL).getApplyReplaceCard(studentId,cardId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); 24 return RetrofitCreateHelper.getInstance().createApi(ApplyReplaceCardApi.class,AppConfig.BASE_URL).getApplyReplaceCard(studentId,cardId).compose(RxHelper.<JsonObject>rxSchedulerHelper());
27 } 25 }
28 } 26 }
app/src/main/java/com/shunzhi/parent/model/apply/ApplySigninModel.java
@@ -2,9 +2,15 @@ package com.shunzhi.parent.model.apply; @@ -2,9 +2,15 @@ package com.shunzhi.parent.model.apply;
2 2
3 import com.google.gson.JsonObject; 3 import com.google.gson.JsonObject;
4 import com.share.mvpsdk.base.BaseModel; 4 import com.share.mvpsdk.base.BaseModel;
  5 +import com.share.mvpsdk.helper.RetrofitCreateHelper;
  6 +import com.share.mvpsdk.helper.RxHelper;
  7 +import com.shunzhi.parent.AppConfig;
  8 +import com.shunzhi.parent.api.ApplySigninApi;
5 import com.shunzhi.parent.contract.apply.ApplySigninContract; 9 import com.shunzhi.parent.contract.apply.ApplySigninContract;
6 import com.shunzhi.parent.contract.ceping.CepingContract; 10 import com.shunzhi.parent.contract.ceping.CepingContract;
7 11
  12 +import java.util.Date;
  13 +
8 import io.reactivex.Observable; 14 import io.reactivex.Observable;
9 15
10 /** 16 /**
@@ -12,12 +18,13 @@ import io.reactivex.Observable; @@ -12,12 +18,13 @@ import io.reactivex.Observable;
12 */ 18 */
13 19
14 public class ApplySigninModel extends BaseModel implements ApplySigninContract.IApplySigninModel{ 20 public class ApplySigninModel extends BaseModel implements ApplySigninContract.IApplySigninModel{
15 - @Override  
16 - public Observable<JsonObject> getTools(String areaName) {  
17 - return null;  
18 - }  
19 21
20 public static ApplySigninContract.IApplySigninModel newInstance() { 22 public static ApplySigninContract.IApplySigninModel newInstance() {
21 return new ApplySigninModel(); 23 return new ApplySigninModel();
22 } 24 }
  25 +
  26 + @Override
  27 + public Observable<JsonObject> getSigninDetailResult(int studentId, int schoolId, String date) {
  28 + return RetrofitCreateHelper.getInstance().createApi(ApplySigninApi.class, AppConfig.BASE_URL).getApplySignin(studentId,schoolId,date).compose(RxHelper.<JsonObject>rxSchedulerHelper());
  29 + }
23 } 30 }
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 android.annotation.SuppressLint; 3 import android.annotation.SuppressLint;
4 -import android.text.TextUtils;  
5 import android.util.Log; 4 import android.util.Log;
6 5
7 -import com.google.gson.JsonArray;  
8 import com.google.gson.JsonObject; 6 import com.google.gson.JsonObject;
9 -import com.share.mvpsdk.base.BasePresenter;  
10 import com.share.mvpsdk.utils.ToastUtils; 7 import com.share.mvpsdk.utils.ToastUtils;
11 import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract; 8 import com.shunzhi.parent.contract.apply.ApplyReplaceCardContract;
12 import com.shunzhi.parent.model.apply.ApplyReplaceCardModel; 9 import com.shunzhi.parent.model.apply.ApplyReplaceCardModel;
13 -import com.shunzhi.parent.views.ReplaceCardDialog;  
14 10
15 import org.json.JSONObject; 11 import org.json.JSONObject;
16 12
@@ -39,9 +35,7 @@ public class ApplyReplaceCardPresenter extends ApplyReplaceCardContract.ApplyRep @@ -39,9 +35,7 @@ public class ApplyReplaceCardPresenter extends ApplyReplaceCardContract.ApplyRep
39 @Override 35 @Override
40 public void accept(JsonObject jsonObject) throws Exception { 36 public void accept(JsonObject jsonObject) throws Exception {
41 ToastUtils.showToast("data:" + jsonObject.toString()); 37 ToastUtils.showToast("data:" + jsonObject.toString());
42 -  
43 String isShowTipsDialog = jsonObject.get("data").getAsString(); 38 String isShowTipsDialog = jsonObject.get("data").getAsString();
44 - Log.i("ApplyReplaceCard:", String.valueOf(isShowTipsDialog));  
45 mIView.showTipsDialog(isShowTipsDialog); 39 mIView.showTipsDialog(isShowTipsDialog);
46 } 40 }
47 }, new Consumer<Throwable>() { 41 }, new Consumer<Throwable>() {
app/src/main/java/com/shunzhi/parent/presenter/apply/ApplySigninPresenter.java
1 package com.shunzhi.parent.presenter.apply; 1 package com.shunzhi.parent.presenter.apply;
2 2
3 -import android.widget.LinearLayout; 3 +import android.annotation.SuppressLint;
  4 +import android.text.TextUtils;
  5 +import android.util.Log;
4 6
  7 +import com.google.gson.Gson;
  8 +import com.google.gson.JsonArray;
  9 +import com.google.gson.JsonObject;
  10 +import com.share.mvpsdk.utils.ToastUtils;
  11 +import com.shunzhi.parent.bean.apply.AttendanceBean;
5 import com.shunzhi.parent.contract.apply.ApplySigninContract; 12 import com.shunzhi.parent.contract.apply.ApplySigninContract;
6 import com.shunzhi.parent.model.apply.ApplySigninModel; 13 import com.shunzhi.parent.model.apply.ApplySigninModel;
7 14
  15 +import org.json.JSONArray;
  16 +import org.json.JSONObject;
  17 +
  18 +import java.util.ArrayList;
  19 +import java.util.Iterator;
  20 +import java.util.List;
  21 +
  22 +import io.reactivex.functions.Consumer;
  23 +
8 /** 24 /**
9 * Created by Administrator on 2018/4/17 0017. 25 * Created by Administrator on 2018/4/17 0017.
10 */ 26 */
@@ -21,7 +37,34 @@ public class ApplySigninPresenter extends ApplySigninContract.ApplySigninPresent @@ -21,7 +37,34 @@ public class ApplySigninPresenter extends ApplySigninContract.ApplySigninPresent
21 } 37 }
22 38
23 @Override 39 @Override
24 - public void getTools(LinearLayout linearLayout, String areaName) { 40 + public void SigninDetail(int studentId, int schoolId, String date) {
  41 + mRxManager.register(mIModel.getSigninDetailResult(studentId, schoolId,date).subscribe(new Consumer<JsonObject>() {
  42 + @SuppressLint("LongLogTag")
  43 + @Override
  44 + public void accept(JsonObject jsonObject) throws Exception {
  45 + //ToastUtils.showToast("data:" + jsonObject.toString());
  46 + Log.i("ApplySignin:",jsonObject.toString());
  47 + if (jsonObject.get("status").getAsString().equals("1")){
  48 + JsonArray jsonArray = jsonObject.get("data").getAsJsonArray();
  49 + List<AttendanceBean> attendanceBeanlist = new ArrayList<>();
  50 + Log.i("ApplySignin:size", String.valueOf(jsonArray.size()));
  51 + for (int i = 0;i< jsonArray.size();i++){
  52 + JsonObject attendanceDetailObj = jsonArray.get(i).getAsJsonObject();
  53 + AttendanceBean attendanceBean = new Gson().fromJson(attendanceDetailObj,AttendanceBean.class);
  54 + attendanceBeanlist.add(attendanceBean);
  55 + }
  56 + mIView.showDetialList(attendanceBeanlist);
  57 + mIView.showDetialInfo(attendanceBeanlist);
  58 + }else {
  59 + ToastUtils.showToast(jsonObject.get("message").getAsString());
  60 + }
  61 +
  62 + }
  63 + }, new Consumer<Throwable>() {
  64 + @Override
  65 + public void accept(Throwable throwable) throws Exception {
25 66
  67 + }
  68 + }));
26 } 69 }
27 } 70 }
app/src/main/java/com/shunzhi/parent/ui/activity/apply/ApplySigninActivity.java
@@ -18,6 +18,7 @@ import com.bigkoo.pickerview.listener.OnTimeSelectListener; @@ -18,6 +18,7 @@ import com.bigkoo.pickerview.listener.OnTimeSelectListener;
18 import com.share.mvpsdk.base.BasePresenter; 18 import com.share.mvpsdk.base.BasePresenter;
19 import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; 19 import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
20 import com.shunzhi.parent.R; 20 import com.shunzhi.parent.R;
  21 +import com.shunzhi.parent.presenter.apply.ApplySigninPresenter;
21 import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment; 22 import com.shunzhi.parent.ui.fragment.apply.ApplySigninFragment;
22 23
23 import java.util.Calendar; 24 import java.util.Calendar;
@@ -74,7 +75,7 @@ public class ApplySigninActivity extends BaseMVPCompatActivity implements View.O @@ -74,7 +75,7 @@ public class ApplySigninActivity extends BaseMVPCompatActivity implements View.O
74 @NonNull 75 @NonNull
75 @Override 76 @Override
76 public BasePresenter initPresenter() { 77 public BasePresenter initPresenter() {
77 - return null; 78 + return new ApplySigninPresenter();
78 } 79 }
79 80
80 } 81 }
app/src/main/java/com/shunzhi/parent/ui/fragment/apply/ApplyReplaceCardFragment.java
@@ -23,7 +23,8 @@ import com.shunzhi.parent.views.ReplaceCardDialog; @@ -23,7 +23,8 @@ import com.shunzhi.parent.views.ReplaceCardDialog;
23 * Created by Administrator on 2018/4/10 0010. 23 * Created by Administrator on 2018/4/10 0010.
24 */ 24 */
25 25
26 -public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplaceCardContract.ApplyReplaceCardPreenter, ApplyReplaceCardContract.IApplyReplaceCardModel> implements View.OnClickListener, ApplyReplaceCardContract.IApplyReplaceCardView { 26 +public class ApplyReplaceCardFragment extends BaseMVPCompatFragment<ApplyReplaceCardContract.ApplyReplaceCardPreenter, ApplyReplaceCardContract.IApplyReplaceCardModel> implements View.OnClickListener,
  27 + ApplyReplaceCardContract.IApplyReplaceCardView {
27 private Button bt_sure; 28 private Button bt_sure;
28 private Button bt_cancel; 29 private Button bt_cancel;
29 ReplaceCardDialog replaceCardDialog = null; 30 ReplaceCardDialog replaceCardDialog = null;
app/src/main/java/com/shunzhi/parent/ui/fragment/apply/ApplySigninFragment.java
@@ -7,6 +7,7 @@ import android.support.annotation.Nullable; @@ -7,6 +7,7 @@ import android.support.annotation.Nullable;
7 import android.support.annotation.RequiresApi; 7 import android.support.annotation.RequiresApi;
8 import android.support.v7.widget.LinearLayoutManager; 8 import android.support.v7.widget.LinearLayoutManager;
9 import android.support.v7.widget.RecyclerView; 9 import android.support.v7.widget.RecyclerView;
  10 +import android.text.TextUtils;
10 import android.util.Log; 11 import android.util.Log;
11 import android.view.View; 12 import android.view.View;
12 import android.widget.CheckBox; 13 import android.widget.CheckBox;
@@ -27,6 +28,7 @@ import com.share.mvpsdk.utils.ToastUtils; @@ -27,6 +28,7 @@ import com.share.mvpsdk.utils.ToastUtils;
27 import com.shunzhi.parent.AppContext; 28 import com.shunzhi.parent.AppContext;
28 import com.shunzhi.parent.R; 29 import com.shunzhi.parent.R;
29 import com.shunzhi.parent.adapter.AttendanceAdapter; 30 import com.shunzhi.parent.adapter.AttendanceAdapter;
  31 +import com.shunzhi.parent.bean.ToolBean;
30 import com.shunzhi.parent.bean.apply.AttendanceBean; 32 import com.shunzhi.parent.bean.apply.AttendanceBean;
31 import com.shunzhi.parent.contract.apply.ApplySigninContract; 33 import com.shunzhi.parent.contract.apply.ApplySigninContract;
32 import com.shunzhi.parent.presenter.apply.ApplySigninPresenter; 34 import com.shunzhi.parent.presenter.apply.ApplySigninPresenter;
@@ -42,7 +44,8 @@ import java.util.List; @@ -42,7 +44,8 @@ import java.util.List;
42 * Created by Administrator on 2018/4/10 0010. 44 * Created by Administrator on 2018/4/10 0010.
43 */ 45 */
44 46
45 -public class ApplySigninFragment extends BaseMVPCompatFragment<ApplySigninContract.ApplySigninPresenter, ApplySigninContract.IApplySigninModel> implements View.OnClickListener{ 47 +public class ApplySigninFragment extends BaseMVPCompatFragment<ApplySigninContract.ApplySigninPresenter, ApplySigninContract.IApplySigninModel> implements View.OnClickListener,
  48 + ApplySigninContract.IApplySigninView{
46 private RecyclerView recycle_attendance; 49 private RecyclerView recycle_attendance;
47 private AttendanceAdapter attendanceAdapter; 50 private AttendanceAdapter attendanceAdapter;
48 List<AttendanceBean> list=new ArrayList<>(); 51 List<AttendanceBean> list=new ArrayList<>();
@@ -50,6 +53,8 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra @@ -50,6 +53,8 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra
50 private LinearLayout layout_tv; 53 private LinearLayout layout_tv;
51 private ImageView iv_calendar; 54 private ImageView iv_calendar;
52 private TimePickerView pvCustomLunar; 55 private TimePickerView pvCustomLunar;
  56 + private String date="";
  57 + List<AttendanceBean> signinlist = new ArrayList<>();
53 58
54 59
55 public BasePresenter initPresenter() { 60 public BasePresenter initPresenter() {
@@ -70,24 +75,29 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra @@ -70,24 +75,29 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra
70 tv_kaoqin_num = view.findViewById(R.id.tv_kaoqin_num); 75 tv_kaoqin_num = view.findViewById(R.id.tv_kaoqin_num);
71 iv_calendar = view.findViewById(R.id.iv_calendar); 76 iv_calendar = view.findViewById(R.id.iv_calendar);
72 77
  78 + initLunarPicker();
73 iv_calendar .setOnClickListener(this); 79 iv_calendar .setOnClickListener(this);
74 80
  81 + date = "2017-07-19";//date = getNowTime();
  82 + tv_kaoqin_date.setText(getNowTime());
75 recycle_attendance = view.findViewById(R.id.recycle_attendance); 83 recycle_attendance = view.findViewById(R.id.recycle_attendance);
  84 +
76 recycle_attendance.setLayoutManager(new LinearLayoutManager(getActivity())); 85 recycle_attendance.setLayoutManager(new LinearLayoutManager(getActivity()));
77 attendanceAdapter = new AttendanceAdapter(getActivity()); 86 attendanceAdapter = new AttendanceAdapter(getActivity());
78 - AttendanceBean attendanceBean = new AttendanceBean();  
79 - if (list.size()!=0){  
80 - layout_tv.setVisibility(View.VISIBLE);  
81 - tv_tips.setVisibility(View.VISIBLE);  
82 - }else {  
83 - list.add(attendanceBean);  
84 - list.add(attendanceBean);  
85 - list.add(attendanceBean);  
86 - list.add(attendanceBean);  
87 - attendanceAdapter.addAll(list);  
88 - recycle_attendance.setAdapter(attendanceAdapter);  
89 - }  
90 - initLunarPicker(); 87 + recycle_attendance.setAdapter(attendanceAdapter);
  88 +
  89 + mPresenter.SigninDetail(185,1,date);
  90 +
  91 + }
  92 +
  93 + /**
  94 + * 获取当前时间
  95 + * @return
  96 + */
  97 + public static String getNowTime(){
  98 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
  99 + Date date = new Date(System.currentTimeMillis());
  100 + return simpleDateFormat.format(date);
91 } 101 }
92 102
93 @RequiresApi(api = Build.VERSION_CODES.N) 103 @RequiresApi(api = Build.VERSION_CODES.N)
@@ -112,6 +122,7 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra @@ -112,6 +122,7 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra
112 @Override 122 @Override
113 public void onTimeSelect(Date date, View v) { 123 public void onTimeSelect(Date date, View v) {
114 ToastUtils.showToast(getTime(date)); 124 ToastUtils.showToast(getTime(date));
  125 + Log.i("getTime:",getTime(date));
115 tv_kaoqin_date.setText(getTime(date)); 126 tv_kaoqin_date.setText(getTime(date));
116 } 127 }
117 }) 128 })
@@ -146,4 +157,23 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra @@ -146,4 +157,23 @@ public class ApplySigninFragment extends BaseMVPCompatFragment&lt;ApplySigninContra
146 return format.format(date); 157 return format.format(date);
147 } 158 }
148 159
  160 + @Override
  161 + public void showDetialList(List<AttendanceBean> list) {
  162 +
  163 + if (list.size() == 0){
  164 + layout_tv.setVisibility(View.VISIBLE);
  165 + }else {
  166 + recycle_attendance.setVisibility(View.VISIBLE);
  167 + signinlist.clear();
  168 + signinlist.addAll(list);
  169 + attendanceAdapter.addAll(signinlist);
  170 + attendanceAdapter.notifyDataSetChanged();
  171 + }
  172 + }
  173 +
  174 + @Override
  175 + public void showDetialInfo(List<AttendanceBean> list) {
  176 + String num = String.valueOf(list.size());
  177 + tv_kaoqin_num.setText(num);
  178 + }
149 } 179 }
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
@@ -21,6 +21,7 @@ import com.shunzhi.parent.bean.ReportBean; @@ -21,6 +21,7 @@ import com.shunzhi.parent.bean.ReportBean;
21 import com.shunzhi.parent.contract.report.ReportContract; 21 import com.shunzhi.parent.contract.report.ReportContract;
22 import com.shunzhi.parent.presenter.report.ReportPresenter; 22 import com.shunzhi.parent.presenter.report.ReportPresenter;
23 import com.shunzhi.parent.ui.activity.apply.ApplyReplaceCardActivity; 23 import com.shunzhi.parent.ui.activity.apply.ApplyReplaceCardActivity;
  24 +import com.shunzhi.parent.ui.activity.apply.ApplySigninActivity;
24 import com.shunzhi.parent.ui.activity.report.ReportDetialActivity; 25 import com.shunzhi.parent.ui.activity.report.ReportDetialActivity;
25 import com.shunzhi.parent.ui.activity.report.ReportSceneActivity; 26 import com.shunzhi.parent.ui.activity.report.ReportSceneActivity;
26 import com.shunzhi.parent.ui.fragment.apply.ApplyReplaceCardFragment; 27 import com.shunzhi.parent.ui.fragment.apply.ApplyReplaceCardFragment;
@@ -33,7 +34,6 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep @@ -33,7 +34,6 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep
33 implements ReportContract.IReportView, View.OnClickListener { 34 implements ReportContract.IReportView, View.OnClickListener {
34 35
35 public static String TYPE_CHENGZHANG = "chengzhang", TYPE_REPORT = "report"; 36 public static String TYPE_CHENGZHANG = "chengzhang", TYPE_REPORT = "report";
36 - ApplyReplaceCardFragment applyReplaceCardFragment = null;  
37 37
38 public static ChengZhangFragment newInstance(String type) { 38 public static ChengZhangFragment newInstance(String type) {
39 Bundle bundle = new Bundle(); 39 Bundle bundle = new Bundle();
@@ -150,7 +150,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep @@ -150,7 +150,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep
150 public void onClick(View view) { 150 public void onClick(View view) {
151 switch (view.getId()) { 151 switch (view.getId()) {
152 case R.id.layout_kaoqin: 152 case R.id.layout_kaoqin:
153 - ReportDetialActivity.getInstance(getActivity(),"2018-04-11",2,"34345"); 153 + ApplySigninActivity.getInstance(getActivity());
154 break; 154 break;
155 case R.id.layout_buka: 155 case R.id.layout_buka:
156 ApplyReplaceCardActivity.getInstance(getActivity()); 156 ApplyReplaceCardActivity.getInstance(getActivity());
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ReportDetialFragment.java
@@ -145,7 +145,6 @@ public class ReportDetialFragment extends BaseMVPCompatFragment&lt;ReportDetialCont @@ -145,7 +145,6 @@ public class ReportDetialFragment extends BaseMVPCompatFragment&lt;ReportDetialCont
145 } catch (Exception e) { 145 } catch (Exception e) {
146 e.printStackTrace(); 146 e.printStackTrace();
147 } 147 }
148 -  
149 } 148 }
150 149
151 @Override 150 @Override
app/src/main/res/drawable-hdpi/date.png 0 → 100644

4.28 KB

app/src/main/res/drawable-hdpi/photo.png 0 → 100644

4.37 KB

app/src/main/res/drawable-v24/date.png 0 → 100644

4.28 KB

app/src/main/res/drawable-v24/photo.png 0 → 100644

4.37 KB

app/src/main/res/drawable-xhdpi/date.png 0 → 100644

4.28 KB

app/src/main/res/drawable-xhdpi/photo.jpg

6.03 KB

app/src/main/res/drawable-xhdpi/photo.png 0 → 100644

4.37 KB

app/src/main/res/drawable/date.png 0 → 100644

4.28 KB

app/src/main/res/drawable/photo.png 0 → 100644

4.37 KB

app/src/main/res/drwable-xxhdpi/photo.png 0 → 100644

4.37 KB

app/src/main/res/layout/fragment_apply_replacecard.xml
@@ -25,11 +25,13 @@ @@ -25,11 +25,13 @@
25 25
26 26
27 <LinearLayout 27 <LinearLayout
  28 + android:layout_marginTop="@dimen/margin_tiny"
  29 + android:layout_marginLeft="@dimen/margin_24"
  30 + android:layout_marginRight="@dimen/margin_24"
28 android:layout_width="match_parent" 31 android:layout_width="match_parent"
29 android:layout_height="170dp" 32 android:layout_height="170dp"
30 android:background="@drawable/report_white" 33 android:background="@drawable/report_white"
31 - android:orientation="vertical"  
32 - android:layout_margin="@dimen/margin_large"> 34 + android:orientation="vertical">
33 35
34 <LinearLayout 36 <LinearLayout
35 android:layout_width="match_parent" 37 android:layout_width="match_parent"
app/src/main/res/layout/fragment_apply_signin.xml
@@ -28,7 +28,9 @@ @@ -28,7 +28,9 @@
28 <LinearLayout 28 <LinearLayout
29 android:layout_width="match_parent" 29 android:layout_width="match_parent"
30 android:layout_height="170dp" 30 android:layout_height="170dp"
31 - android:layout_margin="@dimen/margin_medium" 31 + android:layout_marginTop="@dimen/margin_tiny"
  32 + android:layout_marginLeft="@dimen/margin_24"
  33 + android:layout_marginRight="@dimen/margin_24"
32 android:background="@drawable/report_white" 34 android:background="@drawable/report_white"
33 android:orientation="vertical"> 35 android:orientation="vertical">
34 36
@@ -43,7 +45,7 @@ @@ -43,7 +45,7 @@
43 android:id="@+id/tv_attendancer" 45 android:id="@+id/tv_attendancer"
44 android:layout_width="0dp" 46 android:layout_width="0dp"
45 android:layout_height="wrap_content" 47 android:layout_height="wrap_content"
46 - android:layout_weight="1" 48 + android:layout_weight="1.2"
47 android:paddingLeft="@dimen/margin_small" 49 android:paddingLeft="@dimen/margin_small"
48 android:text="考核对象:" 50 android:text="考核对象:"
49 android:textColor="@color/hintTextColor" 51 android:textColor="@color/hintTextColor"
@@ -53,7 +55,7 @@ @@ -53,7 +55,7 @@
53 android:id="@+id/tv_kaoqin_user" 55 android:id="@+id/tv_kaoqin_user"
54 android:layout_width="0dp" 56 android:layout_width="0dp"
55 android:layout_height="wrap_content" 57 android:layout_height="wrap_content"
56 - android:layout_weight="3" 58 + android:layout_weight="2.8"
57 android:gravity="center" 59 android:gravity="center"
58 android:text="张三" 60 android:text="张三"
59 android:textColor="@color/hintTextColor" 61 android:textColor="@color/hintTextColor"
@@ -71,7 +73,7 @@ @@ -71,7 +73,7 @@
71 android:id="@+id/tv_date" 73 android:id="@+id/tv_date"
72 android:layout_width="0dp" 74 android:layout_width="0dp"
73 android:layout_height="wrap_content" 75 android:layout_height="wrap_content"
74 - android:layout_weight="1" 76 + android:layout_weight="1.2"
75 android:paddingLeft="@dimen/margin_small" 77 android:paddingLeft="@dimen/margin_small"
76 android:text="考勤日期:" 78 android:text="考勤日期:"
77 android:textColor="@color/hintTextColor" 79 android:textColor="@color/hintTextColor"
@@ -79,7 +81,7 @@ @@ -79,7 +81,7 @@
79 <LinearLayout 81 <LinearLayout
80 android:layout_width="0dp" 82 android:layout_width="0dp"
81 android:layout_height="wrap_content" 83 android:layout_height="wrap_content"
82 - android:layout_weight="3" 84 + android:layout_weight="2.8"
83 android:gravity="center" 85 android:gravity="center"
84 android:orientation="horizontal"> 86 android:orientation="horizontal">
85 <TextView 87 <TextView
@@ -88,16 +90,15 @@ @@ -88,16 +90,15 @@
88 android:layout_height="wrap_content" 90 android:layout_height="wrap_content"
89 android:layout_weight="2" 91 android:layout_weight="2"
90 android:gravity="right" 92 android:gravity="right"
91 - android:text="2018-04-10"  
92 android:textColor="@color/hintTextColor" 93 android:textColor="@color/hintTextColor"
93 android:textSize="@dimen/textSize16" /> 94 android:textSize="@dimen/textSize16" />
94 <ImageView 95 <ImageView
95 android:id="@+id/iv_calendar" 96 android:id="@+id/iv_calendar"
96 android:layout_width="0dp" 97 android:layout_width="0dp"
97 - android:layout_height="wrap_content" 98 + android:layout_height="20dp"
98 android:layout_weight="1" 99 android:layout_weight="1"
99 android:gravity="left" 100 android:gravity="left"
100 - android:src="@drawable/kaoqin" /> 101 + android:src="@drawable/date" />
101 </LinearLayout> 102 </LinearLayout>
102 </LinearLayout> 103 </LinearLayout>
103 104
@@ -111,7 +112,7 @@ @@ -111,7 +112,7 @@
111 android:id="@+id/tv_number" 112 android:id="@+id/tv_number"
112 android:layout_width="0dp" 113 android:layout_width="0dp"
113 android:layout_height="wrap_content" 114 android:layout_height="wrap_content"
114 - android:layout_weight="1" 115 + android:layout_weight="1.2"
115 android:paddingLeft="@dimen/margin_small" 116 android:paddingLeft="@dimen/margin_small"
116 android:text="考勤次数:" 117 android:text="考勤次数:"
117 android:textColor="@color/hintTextColor" 118 android:textColor="@color/hintTextColor"
@@ -120,19 +121,13 @@ @@ -120,19 +121,13 @@
120 android:id="@+id/tv_kaoqin_num" 121 android:id="@+id/tv_kaoqin_num"
121 android:layout_width="0dp" 122 android:layout_width="0dp"
122 android:layout_height="wrap_content" 123 android:layout_height="wrap_content"
123 - android:layout_weight="3" 124 + android:layout_weight="2.8"
124 android:gravity="center" 125 android:gravity="center"
125 android:text="5" 126 android:text="5"
126 android:textColor="@color/hintTextColor" 127 android:textColor="@color/hintTextColor"
127 android:textSize="@dimen/textSize16" /> 128 android:textSize="@dimen/textSize16" />
128 </LinearLayout> 129 </LinearLayout>
129 130
130 - <TextView  
131 - android:id="@+id/tv2"  
132 - android:layout_width="fill_parent"  
133 - android:layout_height="1dp"  
134 - android:background="@color/line_color" />  
135 -  
136 <LinearLayout 131 <LinearLayout
137 android:id="@+id/layout_tv" 132 android:id="@+id/layout_tv"
138 android:layout_width="match_parent" 133 android:layout_width="match_parent"
@@ -140,7 +135,7 @@ @@ -140,7 +135,7 @@
140 android:layout_weight="2" 135 android:layout_weight="2"
141 android:gravity="center" 136 android:gravity="center"
142 android:orientation="horizontal" 137 android:orientation="horizontal"
143 - android:visibility="visible"> 138 + android:visibility="gone">
144 139
145 <TextView 140 <TextView
146 android:id="@+id/tv_tips" 141 android:id="@+id/tv_tips"
@@ -157,9 +152,8 @@ @@ -157,9 +152,8 @@
157 android:id="@+id/recycle_attendance" 152 android:id="@+id/recycle_attendance"
158 android:layout_width="match_parent" 153 android:layout_width="match_parent"
159 android:layout_height="wrap_content" 154 android:layout_height="wrap_content"
160 - android:layout_marginTop="@dimen/size_dp_10"  
161 android:background="@color/bgColor" 155 android:background="@color/bgColor"
162 - android:visibility="gone"> 156 + android:visibility="visible">
163 157
164 </android.support.v7.widget.RecyclerView> 158 </android.support.v7.widget.RecyclerView>
165 </LinearLayout> 159 </LinearLayout>
166 \ No newline at end of file 160 \ No newline at end of file
app/src/main/res/layout/item_apply_signin.xml
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 android:textSize="@dimen/size_dp_18" /> 53 android:textSize="@dimen/size_dp_18" />
54 54
55 <TextView 55 <TextView
56 - android:id="@+id/tv_call" 56 + android:id="@+id/tv_parent_name"
57 android:layout_width="wrap_content" 57 android:layout_width="wrap_content"
58 android:layout_height="wrap_content" 58 android:layout_height="wrap_content"
59 android:text="张三" 59 android:text="张三"
@@ -68,39 +68,22 @@ @@ -68,39 +68,22 @@
68 android:textSize="@dimen/size_dp_18" /> 68 android:textSize="@dimen/size_dp_18" />
69 </LinearLayout> 69 </LinearLayout>
70 70
71 - <LinearLayout  
72 - android:layout_width="match_parent" 71 + <TextView
  72 + android:id="@+id/tv_attendance"
  73 + android:layout_width="wrap_content"
73 android:layout_height="0dp" 74 android:layout_height="0dp"
74 - android:layout_weight="1">  
75 -  
76 - <TextView  
77 - android:layout_width="wrap_content"  
78 - android:layout_height="wrap_content"  
79 - android:text="您的孩子已与 "  
80 - android:textColor="@color/hintTextColor"  
81 - android:textSize="@dimen/size_dp_16" />  
82 - <TextView  
83 - android:id="@+id/tv_attendance_date"  
84 - android:layout_width="wrap_content"  
85 - android:layout_height="wrap_content"  
86 - android:textColor="@color/hintTextColor"  
87 - android:textSize="@dimen/size_dp_16"  
88 - android:text="10:00:15"/>  
89 - <TextView  
90 - android:layout_width="wrap_content"  
91 - android:layout_height="wrap_content"  
92 - android:textSize="@dimen/size_dp_16"  
93 - android:textColor="@color/hintTextColor"  
94 - android:text=" 进校!"/>  
95 - </LinearLayout> 75 + android:layout_weight="1"
  76 + android:text="您的孩子已与10:00:15进校!"
  77 + android:textColor="@color/hintTextColor"
  78 + android:textSize="@dimen/size_dp_16" />
96 79
97 <ImageView 80 <ImageView
98 android:id="@+id/iv_photo" 81 android:id="@+id/iv_photo"
99 - android:layout_weight="2"  
100 - android:scaleType="fitCenter"  
101 android:layout_width="wrap_content" 82 android:layout_width="wrap_content"
102 android:layout_height="0dp" 83 android:layout_height="0dp"
103 - android:background="@drawable/photo" /> 84 + android:layout_weight="2"
  85 + android:background="@drawable/photo"
  86 + android:scaleType="fitCenter" />
104 </LinearLayout> 87 </LinearLayout>
105 </LinearLayout> 88 </LinearLayout>
106 89
mvpsdk/src/main/res/values/dimens.xml
@@ -8,6 +8,8 @@ @@ -8,6 +8,8 @@
8 <dimen name="margin_tiny">4dp</dimen> 8 <dimen name="margin_tiny">4dp</dimen>
9 <dimen name="margin_small">8dp</dimen> 9 <dimen name="margin_small">8dp</dimen>
10 <dimen name="margin_medium">16dp</dimen> 10 <dimen name="margin_medium">16dp</dimen>
  11 + <dimen name="margin_20">20dp</dimen>
  12 + <dimen name="margin_24">24dp</dimen>
11 <dimen name="margin_large">32dp</dimen> 13 <dimen name="margin_large">32dp</dimen>
12 <dimen name="margin_huge">64dp</dimen> 14 <dimen name="margin_huge">64dp</dimen>
13 <dimen name="margin_only_txt">48dp</dimen> 15 <dimen name="margin_only_txt">48dp</dimen>