首页数量
This commit is contained in:
parent
1714c9fe9e
commit
45de603ec4
@ -0,0 +1,19 @@
|
||||
package com.tenlionsoft.oamodule.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/5/31 - 14:41
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class ToDoCountBean {
|
||||
private String data;
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.tenlionsoft.oamodule.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/5/31 - 14:41
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class UnReadCountBean {
|
||||
private String data;
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
@ -12,6 +12,7 @@ import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -46,7 +47,10 @@ import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.adapter.NoticeShowAdapter;
|
||||
import com.tenlionsoft.oamodule.beans.BySuperviseListBean;
|
||||
import com.tenlionsoft.oamodule.beans.NoticeListBean;
|
||||
import com.tenlionsoft.oamodule.beans.ToDoCountBean;
|
||||
import com.tenlionsoft.oamodule.beans.UnReadCountBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -65,6 +69,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
@ -122,6 +127,18 @@ public class OaMainFragment extends BaseFragment {
|
||||
CustomStateView mCsvFuncs;
|
||||
@BindView(R2.id.csv_notice)
|
||||
CustomStateView mCsvNotice;
|
||||
@BindView(R2.id.tv_todo_count)
|
||||
TextView mTvTodoCount;
|
||||
@BindView(R2.id.tv_unread_count)
|
||||
TextView mTvUnreadCount;
|
||||
@BindView(R2.id.tv_supervise_count)
|
||||
TextView mTvSuperviseCount;
|
||||
@BindView(R2.id.ll_todo_count)
|
||||
LinearLayout mLlTodoCount;
|
||||
@BindView(R2.id.ll_unread_count)
|
||||
LinearLayout mLlUnreadCount;
|
||||
@BindView(R2.id.ll_supervise_count)
|
||||
LinearLayout mLlSuperviseCount;
|
||||
private List<FuncBean> mFuncBeans;
|
||||
private FunctionTitleNumAdapter mAdapter;
|
||||
private ActivityResultLauncher<Intent> mLauncher;
|
||||
@ -349,6 +366,97 @@ public class OaMainFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
//获取各个类型个数
|
||||
getHintCount();
|
||||
}
|
||||
|
||||
private void getHintCount() {
|
||||
//待办
|
||||
Observable<ToDoCountBean> countBeanObservable = RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getMineToDoCount()
|
||||
.compose(RxTransformer.getTransformer());
|
||||
//待阅
|
||||
Observable<UnReadCountBean> compose = RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getMineUnReadCount()
|
||||
.compose(RxTransformer.getTransformer());
|
||||
//督办
|
||||
Observable<BySuperviseListBean> superviseCount = RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getBySuperviseList("", "", "", "1")
|
||||
.compose(RxTransformer.getTransformer());
|
||||
Observable.mergeDelayError(countBeanObservable, compose, superviseCount)
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<Object>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull Object o) {
|
||||
if (o instanceof ToDoCountBean) {
|
||||
ToDoCountBean bean = (ToDoCountBean) o;
|
||||
if (!TextUtils.isEmpty(bean.getData())) {
|
||||
mLlTodoCount.setVisibility(View.VISIBLE);
|
||||
int i = Integer.parseInt(bean.getData());
|
||||
if (i > 99) {
|
||||
mTvTodoCount.setText("99+");
|
||||
} else {
|
||||
if (i > 0) {
|
||||
mLlTodoCount.setVisibility(View.VISIBLE);
|
||||
mTvTodoCount.setText(bean.getData());
|
||||
} else {
|
||||
mLlTodoCount.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mLlTodoCount.setVisibility(View.GONE);
|
||||
}
|
||||
} else if (o instanceof UnReadCountBean) {
|
||||
UnReadCountBean bean = (UnReadCountBean) o;
|
||||
if (!TextUtils.isEmpty(bean.getData())) {
|
||||
mLlUnreadCount.setVisibility(View.VISIBLE);
|
||||
int i = Integer.parseInt(bean.getData());
|
||||
if (i > 99) {
|
||||
mTvUnreadCount.setText("99+");
|
||||
} else {
|
||||
if (i > 0) {
|
||||
mLlUnreadCount.setVisibility(View.VISIBLE);
|
||||
mTvUnreadCount.setText(bean.getData());
|
||||
} else {
|
||||
mLlUnreadCount.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mLlUnreadCount.setVisibility(View.GONE);
|
||||
}
|
||||
} else if (o instanceof BySuperviseListBean) {
|
||||
BySuperviseListBean bean = (BySuperviseListBean) o;
|
||||
mLlSuperviseCount.setVisibility(View.VISIBLE);
|
||||
if (bean.getTotal() > 99) {
|
||||
mTvSuperviseCount.setText("99+");
|
||||
} else {
|
||||
if (bean.getTotal() > 0) {
|
||||
mLlSuperviseCount.setVisibility(View.VISIBLE);
|
||||
mTvSuperviseCount.setText(bean.getTotal() + "");
|
||||
} else {
|
||||
mLlSuperviseCount.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,6 +47,8 @@ import com.tenlionsoft.oamodule.beans.SuperviseListBean;
|
||||
import com.tenlionsoft.oamodule.beans.SuperviseRelevanceOptionsListBean;
|
||||
import com.tenlionsoft.oamodule.beans.SuperviseRepectBean;
|
||||
import com.tenlionsoft.oamodule.beans.SuperviseTypeBean;
|
||||
import com.tenlionsoft.oamodule.beans.ToDoCountBean;
|
||||
import com.tenlionsoft.oamodule.beans.UnReadCountBean;
|
||||
import com.tenlionsoft.oamodule.beans.UserRecordDetailBean;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportDetailBean;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportListBean;
|
||||
@ -870,4 +872,18 @@ public interface OAApi {
|
||||
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/oa/list-process-log/process-instance-id/{processInstanceId}")
|
||||
Observable<List<OaFlowLogBean>> getOaFlowLogList(@Path("processInstanceId") String id);
|
||||
|
||||
/**
|
||||
* 我的待办数量
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/oa/count-task-of-mine")
|
||||
Observable<ToDoCountBean> getMineToDoCount();
|
||||
|
||||
/**
|
||||
* 我的待阅数量
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/oa/count-unread-of-mine")
|
||||
Observable<UnReadCountBean> getMineUnReadCount();
|
||||
}
|
||||
|
@ -66,7 +66,7 @@
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="我的待阅"
|
||||
android:textStyle="bold" />
|
||||
android:textColor="@color/col_gray_black" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_mine"
|
||||
@ -81,7 +81,7 @@
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="我的已阅"
|
||||
android:textStyle="bold" />
|
||||
android:textColor="@color/col_gray_black" />
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
|
@ -55,7 +55,7 @@
|
||||
<RadioButton
|
||||
android:id="@+id/rb_apply"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/switch_custom_gray_white_left"
|
||||
android:button="@null"
|
||||
@ -66,12 +66,12 @@
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="我的待办"
|
||||
android:textStyle="bold" />
|
||||
android:textColor="@color/col_gray_black" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_mine"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/switch_custom_gray_white_right"
|
||||
android:button="@null"
|
||||
@ -81,7 +81,7 @@
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="我的已办"
|
||||
android:textStyle="bold" />
|
||||
android:textColor="@color/col_gray_black" />
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
|
@ -55,7 +55,7 @@
|
||||
android:id="@+id/tv_user_dept"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/text_14"
|
||||
tools:text="部门" />
|
||||
@ -103,6 +103,7 @@
|
||||
android:textSize="@dimen/text_14" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_todo_count"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginLeft="-5dp"
|
||||
@ -111,12 +112,13 @@
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_todo_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="99+"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/text_12" />
|
||||
android:textSize="@dimen/text_12"
|
||||
tools:text="99+" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@ -141,6 +143,7 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_unread_count"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginLeft="-5dp"
|
||||
@ -149,12 +152,13 @@
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unread_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="99+"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/text_12" />
|
||||
android:textSize="@dimen/text_12"
|
||||
tools:text="99+" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@ -178,6 +182,7 @@
|
||||
android:textSize="@dimen/text_14" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_supervise_count"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginLeft="-5dp"
|
||||
@ -186,6 +191,7 @@
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_supervise_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
@ -220,9 +226,9 @@
|
||||
android:background="@color/blue_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp">
|
||||
android:paddingBottom="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="17dp"
|
||||
|
Loading…
Reference in New Issue
Block a user