个人文档目录增删改
This commit is contained in:
parent
c7c537404b
commit
7d7c2b8223
@ -10,8 +10,8 @@
|
|||||||
{
|
{
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"versionCode": 7,
|
"versionCode": 9,
|
||||||
"versionName": "1.0.7",
|
"versionName": "1.0.9",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -8,8 +8,8 @@ package com.tenlionsoft.baselib.core.retrofit_net;
|
|||||||
public class BaseUrlApi {
|
public class BaseUrlApi {
|
||||||
|
|
||||||
// public static final String IP = "http://192.168.0.120:8082/";/* 测试IP */
|
// public static final String IP = "http://192.168.0.120:8082/";/* 测试IP */
|
||||||
public static final String IP = "http://121.36.71.250/";/* 测试IP */
|
// public static final String IP = "http://121.36.71.250/";/* 测试IP */
|
||||||
// public static final String IP = "http://106.12.218.237:8002/";/* 公司IP */
|
public static final String IP = "http://106.12.218.237:8002/";/* 公司IP */
|
||||||
// public static final String IP = "https://www.xzszwhy.cn/";/* 公司IP */
|
// public static final String IP = "https://www.xzszwhy.cn/";/* 公司IP */
|
||||||
// public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
// public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
||||||
// public static final String SYS_USERCENTER = "xzszwhy/";//西藏统一用户
|
// public static final String SYS_USERCENTER = "xzszwhy/";//西藏统一用户
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
style="@style/item_title"
|
style="@style/item_title"
|
||||||
android:text="目录名称" />
|
android:text="目录名称" />
|
||||||
|
|
||||||
<View style="@style/vertical_line" />
|
|
||||||
|
|
||||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText
|
<com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText
|
||||||
android:id="@+id/et_name"
|
android:id="@+id/et_name"
|
||||||
@ -42,7 +41,6 @@
|
|||||||
style="@style/item_title"
|
style="@style/item_title"
|
||||||
android:text="排序编号" />
|
android:text="排序编号" />
|
||||||
|
|
||||||
<View style="@style/vertical_line" />
|
|
||||||
|
|
||||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText
|
<com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText
|
||||||
android:id="@+id/et_order"
|
android:id="@+id/et_order"
|
||||||
@ -55,13 +53,12 @@
|
|||||||
|
|
||||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||||
style="@style/item_title_vertical"
|
style="@style/item_title_vertical"
|
||||||
android:drawableLeft="@drawable/ic_start_hint"
|
|
||||||
android:text="备注" />
|
android:text="备注" />
|
||||||
|
|
||||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText
|
<com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText
|
||||||
android:id="@+id/et_remark"
|
android:id="@+id/et_remark"
|
||||||
style="@style/item_content_edit"
|
style="@style/item_content_edit"
|
||||||
android:hint="请输入内容"
|
android:hint="请输入备注"
|
||||||
android:minLines="5" />
|
android:minLines="5" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -490,7 +490,7 @@
|
|||||||
<style name="item_title">
|
<style name="item_title">
|
||||||
<item name="android:layout_width">0dp</item>
|
<item name="android:layout_width">0dp</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_weight">0.4</item>
|
<item name="android:layout_weight">0.3</item>
|
||||||
<item name="android:padding">2dp</item>
|
<item name="android:padding">2dp</item>
|
||||||
<item name="android:textColor">@color/black</item>
|
<item name="android:textColor">@color/black</item>
|
||||||
<item name="android:layout_gravity">center_vertical</item>
|
<item name="android:layout_gravity">center_vertical</item>
|
||||||
|
@ -59,8 +59,8 @@ ext {
|
|||||||
gCompileSdkVersion = 30
|
gCompileSdkVersion = 30
|
||||||
gMinSdkVersion = 19
|
gMinSdkVersion = 19
|
||||||
gTargetSdkVersion = 30
|
gTargetSdkVersion = 30
|
||||||
gVersionCode = 7
|
gVersionCode = 9
|
||||||
gVersionName = '1.0.7'
|
gVersionName = '1.0.9'
|
||||||
gBuildToolsVersion = "29.0.2"
|
gBuildToolsVersion = "29.0.2"
|
||||||
// gVersionCode=26
|
// gVersionCode=26
|
||||||
// gVersionName='1.3.0'
|
// gVersionName='1.3.0'
|
||||||
|
@ -1,26 +1,36 @@
|
|||||||
package com.tenlionsoft.oamodule.activity.document;
|
package com.tenlionsoft.oamodule.activity.document;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.ProgressDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.google.android.flexbox.FlexDirection;
|
import com.google.android.flexbox.FlexDirection;
|
||||||
import com.google.android.flexbox.FlexWrap;
|
import com.google.android.flexbox.FlexWrap;
|
||||||
import com.google.android.flexbox.FlexboxLayoutManager;
|
import com.google.android.flexbox.FlexboxLayoutManager;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||||
|
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||||
|
import com.tenlionsoft.baselib.core.widget.views.ItemSplitDivider;
|
||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
import com.tenlionsoft.oamodule.adapter.ChooseDocTypeAdapter;
|
import com.tenlionsoft.oamodule.adapter.ChooseDocTypeAdapter;
|
||||||
import com.tenlionsoft.oamodule.adapter.SelDocTypeAdapter;
|
import com.tenlionsoft.oamodule.adapter.SelDocTypeAdapter;
|
||||||
import com.tenlionsoft.oamodule.adapter.SelectedDocTypeAdapter;
|
import com.tenlionsoft.oamodule.adapter.SelectedDocTypeAdapter;
|
||||||
import com.tenlionsoft.oamodule.beans.DocumentTypeList;
|
import com.tenlionsoft.oamodule.beans.DocumentTypeList;
|
||||||
|
import com.tenlionsoft.oamodule.beans.SaveDocumentTypeBean;
|
||||||
import com.tenlionsoft.oamodule.net.OAApi;
|
import com.tenlionsoft.oamodule.net.OAApi;
|
||||||
|
import com.tenlionsoft.oamodule.widget.CenterDocTypeView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -33,6 +43,8 @@ import butterknife.ButterKnife;
|
|||||||
import io.reactivex.rxjava3.annotations.NonNull;
|
import io.reactivex.rxjava3.annotations.NonNull;
|
||||||
import io.reactivex.rxjava3.core.Observer;
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者: Adam
|
* 作者: Adam
|
||||||
@ -52,6 +64,10 @@ public class ChooseDocTypeActivity extends BaseActivity {
|
|||||||
CustomStateView mCsvState;
|
CustomStateView mCsvState;
|
||||||
@BindView(R2.id.rlv_selected)
|
@BindView(R2.id.rlv_selected)
|
||||||
RecyclerView mRlvSelected;
|
RecyclerView mRlvSelected;
|
||||||
|
@BindView(R2.id.btn_edit_type)
|
||||||
|
Button mBtnEditType;
|
||||||
|
@BindView(R2.id.btn_add_type)
|
||||||
|
Button mBtnAddType;
|
||||||
|
|
||||||
private List<Object> mSelCatalog = new ArrayList<>();
|
private List<Object> mSelCatalog = new ArrayList<>();
|
||||||
private SelDocTypeAdapter mTypeAdapter;
|
private SelDocTypeAdapter mTypeAdapter;
|
||||||
@ -91,8 +107,9 @@ public class ChooseDocTypeActivity extends BaseActivity {
|
|||||||
mRlvSel.setLayoutManager(manager);
|
mRlvSel.setLayoutManager(manager);
|
||||||
mTypeAdapter = new SelDocTypeAdapter(mActivity, mSelCatalog);
|
mTypeAdapter = new SelDocTypeAdapter(mActivity, mSelCatalog);
|
||||||
mRlvSel.setAdapter(mTypeAdapter);
|
mRlvSel.setAdapter(mTypeAdapter);
|
||||||
mAdapter = new ChooseDocTypeAdapter(mActivity, mDatas);
|
mAdapter = new ChooseDocTypeAdapter(mActivity, mDatas, 1);
|
||||||
mRlvContent.setLayoutManager(new LinearLayoutManager(mActivity));
|
mRlvContent.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
|
mRlvContent.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#F4F4F4")));
|
||||||
mRlvContent.setAdapter(mAdapter);
|
mRlvContent.setAdapter(mAdapter);
|
||||||
mCsvState.setState(CustomStateView.STATE_LOAD);
|
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||||
mTvPublish.setVisibility(View.VISIBLE);
|
mTvPublish.setVisibility(View.VISIBLE);
|
||||||
@ -175,6 +192,207 @@ public class ChooseDocTypeActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
mAdapter.setData(mDatas);
|
mAdapter.setData(mDatas);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mBtnAddType.setOnClickListener(v -> {
|
||||||
|
showAddTypeDialog();
|
||||||
|
});
|
||||||
|
|
||||||
|
mBtnEditType.setOnClickListener(v -> {
|
||||||
|
int type = mAdapter.getType();
|
||||||
|
if (type == 1) {
|
||||||
|
mAdapter.setType(2);
|
||||||
|
mBtnEditType.setText("取消");
|
||||||
|
} else {
|
||||||
|
mAdapter.setType(1);
|
||||||
|
mBtnEditType.setText("编辑");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//编辑或删除
|
||||||
|
mAdapter.addOnControlListener(new ChooseDocTypeAdapter.OnControlListener() {
|
||||||
|
@Override
|
||||||
|
public void doEdit(DocumentTypeList bean, int pos) {
|
||||||
|
showEditDialog(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doDel(DocumentTypeList bean, int pos) {
|
||||||
|
new AlertDialog.Builder(mActivity)
|
||||||
|
.setTitle("提示")
|
||||||
|
.setMessage("删除后该目录下所有文件将被删除,确定要删除该目录吗?")
|
||||||
|
.setPositiveButton("删除", (dialog, which) -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
doDelType(bean);
|
||||||
|
})
|
||||||
|
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
|
||||||
|
.create()
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showEditDialog(DocumentTypeList bean) {
|
||||||
|
CenterDocTypeView typeDialog = new CenterDocTypeView.DialogBuilder(mActivity)
|
||||||
|
.setBean(bean)
|
||||||
|
.build();
|
||||||
|
typeDialog.addOnChoseListener((name, order, remark) -> {
|
||||||
|
//当前选中的目录
|
||||||
|
typeDialog.dismiss();
|
||||||
|
typeDialog.hideSoftKeyBoardDialog(mActivity);
|
||||||
|
doEditType(name, order, remark, bean);
|
||||||
|
});
|
||||||
|
typeDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
private void doEditType(String name, String order, String remark, DocumentTypeList bean) {
|
||||||
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
|
||||||
|
dialog.show();
|
||||||
|
RequestBody body = buildTypeEditParams(name, order, remark, bean);
|
||||||
|
RetrofitManager.getInstance()
|
||||||
|
.create(OAApi.class)
|
||||||
|
.doEditDocumentType(bean.getFileCatalogueId(), body)
|
||||||
|
.compose(RxTransformer.getTransformer())
|
||||||
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
||||||
|
dialog.dismiss();
|
||||||
|
ToastUtils.show("修改成功");
|
||||||
|
getCataLogList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
dialog.dismiss();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param bean
|
||||||
|
*/
|
||||||
|
private void doDelType(DocumentTypeList bean) {
|
||||||
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "删除中...");
|
||||||
|
dialog.show();
|
||||||
|
RetrofitManager.getInstance()
|
||||||
|
.create(OAApi.class)
|
||||||
|
.doDelDocumentType(bean.getFileCatalogueId())
|
||||||
|
.compose(RxTransformer.getTransformer())
|
||||||
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
||||||
|
dialog.dismiss();
|
||||||
|
ToastUtils.show("删除成功");
|
||||||
|
getCataLogList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
dialog.dismiss();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示目录添加
|
||||||
|
*/
|
||||||
|
private void showAddTypeDialog() {
|
||||||
|
CenterDocTypeView typeDialog = new CenterDocTypeView.DialogBuilder(mActivity)
|
||||||
|
.build();
|
||||||
|
typeDialog.addOnChoseListener((name, order, remark) -> {
|
||||||
|
//当前选中的目录
|
||||||
|
typeDialog.dismiss();
|
||||||
|
typeDialog.hideSoftKeyBoardDialog(mActivity);
|
||||||
|
doSaveType(name, order, remark);
|
||||||
|
});
|
||||||
|
typeDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存目录
|
||||||
|
*/
|
||||||
|
private void doSaveType(String name, String order, String remark) {
|
||||||
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
|
||||||
|
dialog.show();
|
||||||
|
RequestBody body = buildTypeParams(name, order, remark);
|
||||||
|
RetrofitManager.getInstance()
|
||||||
|
.create(OAApi.class)
|
||||||
|
.doSaveDocumentType(body)
|
||||||
|
.compose(RxTransformer.getTransformer())
|
||||||
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
||||||
|
dialog.dismiss();
|
||||||
|
ToastUtils.show("保存成功");
|
||||||
|
//刷新
|
||||||
|
getCataLogList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
dialog.dismiss();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private RequestBody buildTypeParams(String name, String order, String remark) {
|
||||||
|
SaveDocumentTypeBean bean = new SaveDocumentTypeBean();
|
||||||
|
bean.setName(name);
|
||||||
|
bean.setSortNum(Integer.parseInt(order));
|
||||||
|
bean.setRemake(remark);
|
||||||
|
bean.setType("0");
|
||||||
|
bean.setViewRange("0");
|
||||||
|
Object o = mSelCatalog.get(mSelCatalog.size() - 1);
|
||||||
|
DocumentTypeList b = (DocumentTypeList) o;
|
||||||
|
bean.setParentId(b.getFileCatalogueId());
|
||||||
|
return RequestBody.create(new Gson().toJson(bean), MediaType.parse("application/json; charset=utf-8"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private RequestBody buildTypeEditParams(String name, String order, String remark, DocumentTypeList b) {
|
||||||
|
SaveDocumentTypeBean bean = new SaveDocumentTypeBean();
|
||||||
|
bean.setName(name);
|
||||||
|
bean.setSortNum(Integer.parseInt(order));
|
||||||
|
bean.setRemake(remark);
|
||||||
|
bean.setType("0");
|
||||||
|
bean.setViewRange("0");
|
||||||
|
bean.setParentId(b.getParentId());
|
||||||
|
return RequestBody.create(new Gson().toJson(bean), MediaType.parse("application/json; charset=utf-8"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -213,50 +431,51 @@ public class ChooseDocTypeActivity extends BaseActivity {
|
|||||||
* 获取目录列表
|
* 获取目录列表
|
||||||
*/
|
*/
|
||||||
private void getCataLogList() {
|
private void getCataLogList() {
|
||||||
|
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||||
mDatas.clear();
|
mDatas.clear();
|
||||||
mAdapter.setData(mDatas);
|
mAdapter.setData(mDatas);
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getDocumentTypeListByPid(mSelCatalogId, "0")
|
.getDocumentTypeListByPid(mSelCatalogId, "0")
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<List<DocumentTypeList>>() {
|
.subscribe(new Observer<List<DocumentTypeList>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull List<DocumentTypeList> documentTypeLists) {
|
public void onNext(@NonNull List<DocumentTypeList> documentTypeLists) {
|
||||||
if (documentTypeLists.size() > 0) {
|
if (documentTypeLists.size() > 0) {
|
||||||
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
||||||
mDatas.addAll(documentTypeLists);
|
mDatas.addAll(documentTypeLists);
|
||||||
for (int i = 0; i < mSelectedCatalog.size(); i++) {
|
for (int i = 0; i < mSelectedCatalog.size(); i++) {
|
||||||
DocumentTypeList selBean = mSelectedCatalog.get(i);
|
DocumentTypeList selBean = mSelectedCatalog.get(i);
|
||||||
for (int j = 0; j < mDatas.size(); j++) {
|
for (int j = 0; j < mDatas.size(); j++) {
|
||||||
DocumentTypeList bean = mDatas.get(j);
|
DocumentTypeList bean = mDatas.get(j);
|
||||||
if (selBean.getFileCatalogueId().equals(bean.getFileCatalogueId())) {
|
if (selBean.getFileCatalogueId().equals(bean.getFileCatalogueId())) {
|
||||||
bean.setChecked(true);
|
bean.setChecked(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||||
}
|
}
|
||||||
} else {
|
mAdapter.setData(mDatas);
|
||||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
|
||||||
}
|
}
|
||||||
mAdapter.setData(mDatas);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
mAdapter.setData(mDatas);
|
mAdapter.setData(mDatas);
|
||||||
mCsvState.setState(CustomStateView.STATE_ERROR);
|
mCsvState.setState(CustomStateView.STATE_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -22,9 +22,11 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ChooseDocTypeAdapter extends BaseRecyclerAdapter<DocumentTypeList, ChooseDocTypeHolder> {
|
public class ChooseDocTypeAdapter extends BaseRecyclerAdapter<DocumentTypeList, ChooseDocTypeHolder> {
|
||||||
public List<DeptBean> mSelBeans = new ArrayList<>();
|
public List<DeptBean> mSelBeans = new ArrayList<>();
|
||||||
|
public int mType = 1;
|
||||||
|
|
||||||
public ChooseDocTypeAdapter(Context ctx, List<DocumentTypeList> list) {
|
public ChooseDocTypeAdapter(Context ctx, List<DocumentTypeList> list, int type) {
|
||||||
super(ctx, list);
|
super(ctx, list);
|
||||||
|
this.mType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -33,6 +35,15 @@ public class ChooseDocTypeAdapter extends BaseRecyclerAdapter<DocumentTypeList,
|
|||||||
return new ChooseDocTypeHolder(itemView);
|
return new ChooseDocTypeHolder(itemView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.mType = type;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return mType;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindHolder(ChooseDocTypeHolder holder, int i) {
|
public void bindHolder(ChooseDocTypeHolder holder, int i) {
|
||||||
DocumentTypeList bean = mData.get(i);
|
DocumentTypeList bean = mData.get(i);
|
||||||
@ -41,6 +52,21 @@ public class ChooseDocTypeAdapter extends BaseRecyclerAdapter<DocumentTypeList,
|
|||||||
holder.mCbCheck.setChecked(bean.isChecked());
|
holder.mCbCheck.setChecked(bean.isChecked());
|
||||||
holder.mCbCheck.setOnCheckedChangeListener((buttonView, isChecked) -> mLis.onItemCheckChange(bean, isChecked, i));
|
holder.mCbCheck.setOnCheckedChangeListener((buttonView, isChecked) -> mLis.onItemCheckChange(bean, isChecked, i));
|
||||||
holder.mTvName.setOnClickListener(v -> mLis.onLowerDept(bean, i));
|
holder.mTvName.setOnClickListener(v -> mLis.onLowerDept(bean, i));
|
||||||
|
if (mType == 1) {
|
||||||
|
//默认选择
|
||||||
|
holder.mLlBtns.setVisibility(View.GONE);
|
||||||
|
holder.mIvArrow.setVisibility(View.VISIBLE);
|
||||||
|
holder.mCbCheck.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
//编辑
|
||||||
|
holder.mCbCheck.setVisibility(View.GONE);
|
||||||
|
holder.mLlBtns.setVisibility(View.VISIBLE);
|
||||||
|
holder.mIvArrow.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if (mControlListener != null) {
|
||||||
|
holder.mBtnDel.setOnClickListener(v -> mControlListener.doDel(bean, i));
|
||||||
|
holder.mBtnEdit.setOnClickListener(v -> mControlListener.doEdit(bean, i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private OnItemCheckChange mLis;
|
private OnItemCheckChange mLis;
|
||||||
@ -54,4 +80,17 @@ public class ChooseDocTypeAdapter extends BaseRecyclerAdapter<DocumentTypeList,
|
|||||||
|
|
||||||
void onLowerDept(DocumentTypeList bean, int pos);
|
void onLowerDept(DocumentTypeList bean, int pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private OnControlListener mControlListener;
|
||||||
|
|
||||||
|
public void addOnControlListener(OnControlListener listener) {
|
||||||
|
this.mControlListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnControlListener {
|
||||||
|
void doEdit(DocumentTypeList bean, int pos);
|
||||||
|
|
||||||
|
void doDel(DocumentTypeList bean, int pos);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -151,14 +151,17 @@ public class DocFragment extends BaseFragment {
|
|||||||
mSelCatalog.add(mRootPersonBean);
|
mSelCatalog.add(mRootPersonBean);
|
||||||
mSelCatalogId = "0";
|
mSelCatalogId = "0";
|
||||||
mRlvSel.setVisibility(View.VISIBLE);
|
mRlvSel.setVisibility(View.VISIBLE);
|
||||||
|
mIvAdd.setVisibility(View.VISIBLE);
|
||||||
} else if (checkedId == R.id.rb_share) {
|
} else if (checkedId == R.id.rb_share) {
|
||||||
mType = "共享文档";//共享
|
mType = "共享文档";//共享
|
||||||
mRlvSel.setVisibility(View.GONE);
|
mRlvSel.setVisibility(View.GONE);
|
||||||
|
mIvAdd.setVisibility(View.GONE);
|
||||||
} else if (checkedId == R.id.rb_pub) {
|
} else if (checkedId == R.id.rb_pub) {
|
||||||
mType = "公共文档";//公共
|
mType = "公共文档";//公共
|
||||||
mSelCatalog.add(mRootPublicbean);
|
mSelCatalog.add(mRootPublicbean);
|
||||||
mSelCatalogId = "0";
|
mSelCatalogId = "0";
|
||||||
mRlvSel.setVisibility(View.VISIBLE);
|
mRlvSel.setVisibility(View.VISIBLE);
|
||||||
|
mIvAdd.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
mSelCatalogAdapter.setData(mSelCatalog);
|
mSelCatalogAdapter.setData(mSelCatalog);
|
||||||
doRefresh();
|
doRefresh();
|
||||||
@ -280,11 +283,11 @@ public class DocFragment extends BaseFragment {
|
|||||||
mTvTitleType.setText(mSelType == null ? "文档类型" : mSelType.getTypeName());
|
mTvTitleType.setText(mSelType == null ? "文档类型" : mSelType.getTypeName());
|
||||||
doRefresh();
|
doRefresh();
|
||||||
})
|
})
|
||||||
.setTitleText("请选择")
|
.setTitleText("请选择")
|
||||||
.setCancelColor(Color.parseColor("#1189FF"))
|
.setCancelColor(Color.parseColor("#1189FF"))
|
||||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||||
.setTitleColor(Color.parseColor("#1189FF"))
|
.setTitleColor(Color.parseColor("#1189FF"))
|
||||||
.build();
|
.build();
|
||||||
mDataSourcePicker.setPicker(mDocTypes);
|
mDataSourcePicker.setPicker(mDocTypes);
|
||||||
}
|
}
|
||||||
mDataSourcePicker.show();
|
mDataSourcePicker.show();
|
||||||
@ -300,40 +303,40 @@ public class DocFragment extends BaseFragment {
|
|||||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "加载中...");
|
||||||
dialog.show();
|
dialog.show();
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getDocTypes()
|
.getDocTypes()
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<List<DocTypeBean>>() {
|
.subscribe(new Observer<List<DocTypeBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@NonNull List<DocTypeBean> docTypeBeans) {
|
|
||||||
dialog.dismiss();
|
|
||||||
if (docTypeBeans.size() > 0) {
|
|
||||||
mDocTypes = docTypeBeans;
|
|
||||||
DocTypeBean allBean = new DocTypeBean();
|
|
||||||
allBean.setTypeName("全部");
|
|
||||||
mDocTypes.add(0, allBean);
|
|
||||||
onShowDocType();
|
|
||||||
} else {
|
|
||||||
ToastUtils.show("暂无数据");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onNext(@NonNull List<DocTypeBean> docTypeBeans) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
ExceptionHandler.handleException(e);
|
if (docTypeBeans.size() > 0) {
|
||||||
}
|
mDocTypes = docTypeBeans;
|
||||||
|
DocTypeBean allBean = new DocTypeBean();
|
||||||
|
allBean.setTypeName("全部");
|
||||||
|
mDocTypes.add(0, allBean);
|
||||||
|
onShowDocType();
|
||||||
|
} else {
|
||||||
|
ToastUtils.show("暂无数据");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
dialog.dismiss();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -363,64 +366,64 @@ public class DocFragment extends BaseFragment {
|
|||||||
private void getDocumentList(int currentPage) {
|
private void getDocumentList(int currentPage) {
|
||||||
mCurrentPage = currentPage;
|
mCurrentPage = currentPage;
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getDocumentList(mKeywords, mType, mSelCatalogId, mCurrentPage + "")
|
.getDocumentList(mKeywords, mType, mSelCatalogId, mCurrentPage + "")
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<DocumentListBean>() {
|
.subscribe(new Observer<DocumentListBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull DocumentListBean listBean) {
|
public void onNext(@NonNull DocumentListBean listBean) {
|
||||||
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
||||||
++mCurrentPage;
|
++mCurrentPage;
|
||||||
if (currentPage == 1) {
|
if (currentPage == 1) {
|
||||||
mDatas.addAll(listBean.getRows());
|
mDatas.addAll(listBean.getRows());
|
||||||
} else {
|
} else {
|
||||||
mDatas.addAll(listBean.getRows());
|
mDatas.addAll(listBean.getRows());
|
||||||
}
|
}
|
||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.notifyDataSetChanged();
|
||||||
mSrlContent.finishRefresh();
|
mSrlContent.finishRefresh();
|
||||||
if (mDatas.size() >= listBean.getTotal()) {
|
if (mDatas.size() >= listBean.getTotal()) {
|
||||||
mSrlContent.finishLoadMore();
|
mSrlContent.finishLoadMore();
|
||||||
mSrlContent.setNoMoreData(true);
|
mSrlContent.setNoMoreData(true);
|
||||||
|
} else {
|
||||||
|
mSrlContent.finishLoadMore();
|
||||||
|
mSrlContent.setNoMoreData(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mSrlContent.finishLoadMore();
|
mSrlContent.finishLoadMore();
|
||||||
mSrlContent.setNoMoreData(false);
|
mSrlContent.finishRefresh();
|
||||||
}
|
if (currentPage > 1) {
|
||||||
} else {
|
mSrlContent.setNoMoreData(true);
|
||||||
mSrlContent.finishLoadMore();
|
} else {
|
||||||
mSrlContent.finishRefresh();
|
if (!TextUtils.isEmpty(mKeywords)) {
|
||||||
if (currentPage > 1) {
|
ToastUtils.show("未查询到相关内容");
|
||||||
mSrlContent.setNoMoreData(true);
|
}
|
||||||
} else {
|
|
||||||
if (!TextUtils.isEmpty(mKeywords)) {
|
|
||||||
ToastUtils.show("未查询到相关内容");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mDatas.size() > 0) {
|
||||||
|
refreshStateView(LionActions.STATE_SUCCESS);
|
||||||
|
} else {
|
||||||
|
refreshStateView(LionActions.STATE_EMPTY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mDatas.size() > 0) {
|
|
||||||
refreshStateView(LionActions.STATE_SUCCESS);
|
@Override
|
||||||
} else {
|
public void onError(@NonNull Throwable e) {
|
||||||
refreshStateView(LionActions.STATE_EMPTY);
|
mSrlContent.finishLoadMore();
|
||||||
|
mSrlContent.finishRefresh();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
refreshStateView(LionActions.STATE_ERROR);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onComplete() {
|
||||||
mSrlContent.finishLoadMore();
|
|
||||||
mSrlContent.finishRefresh();
|
|
||||||
ExceptionHandler.handleException(e);
|
|
||||||
refreshStateView(LionActions.STATE_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void onComplete() {
|
});
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -430,64 +433,64 @@ public class DocFragment extends BaseFragment {
|
|||||||
private void getShareList(int currentPage) {
|
private void getShareList(int currentPage) {
|
||||||
mCurrentPage = currentPage;
|
mCurrentPage = currentPage;
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getShareDocList(mKeywords, mCurrentPage + "")
|
.getShareDocList(mKeywords, mCurrentPage + "")
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<DocumentListBean>() {
|
.subscribe(new Observer<DocumentListBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull DocumentListBean listBean) {
|
public void onNext(@NonNull DocumentListBean listBean) {
|
||||||
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
||||||
++mCurrentPage;
|
++mCurrentPage;
|
||||||
if (currentPage == 1) {
|
if (currentPage == 1) {
|
||||||
mDatas.addAll(listBean.getRows());
|
mDatas.addAll(listBean.getRows());
|
||||||
} else {
|
} else {
|
||||||
mDatas.addAll(listBean.getRows());
|
mDatas.addAll(listBean.getRows());
|
||||||
}
|
}
|
||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.notifyDataSetChanged();
|
||||||
mSrlContent.finishRefresh();
|
mSrlContent.finishRefresh();
|
||||||
if (mDatas.size() >= listBean.getTotal()) {
|
if (mDatas.size() >= listBean.getTotal()) {
|
||||||
mSrlContent.finishLoadMore();
|
mSrlContent.finishLoadMore();
|
||||||
mSrlContent.setNoMoreData(true);
|
mSrlContent.setNoMoreData(true);
|
||||||
|
} else {
|
||||||
|
mSrlContent.finishLoadMore();
|
||||||
|
mSrlContent.setNoMoreData(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mSrlContent.finishLoadMore();
|
mSrlContent.finishLoadMore();
|
||||||
mSrlContent.setNoMoreData(false);
|
mSrlContent.finishRefresh();
|
||||||
}
|
if (currentPage > 1) {
|
||||||
} else {
|
mSrlContent.setNoMoreData(true);
|
||||||
mSrlContent.finishLoadMore();
|
} else {
|
||||||
mSrlContent.finishRefresh();
|
if (!TextUtils.isEmpty(mKeywords)) {
|
||||||
if (currentPage > 1) {
|
ToastUtils.show("未查询到相关内容");
|
||||||
mSrlContent.setNoMoreData(true);
|
}
|
||||||
} else {
|
|
||||||
if (!TextUtils.isEmpty(mKeywords)) {
|
|
||||||
ToastUtils.show("未查询到相关内容");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mDatas.size() > 0) {
|
||||||
|
refreshStateView(LionActions.STATE_SUCCESS);
|
||||||
|
} else {
|
||||||
|
refreshStateView(LionActions.STATE_EMPTY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mDatas.size() > 0) {
|
|
||||||
refreshStateView(LionActions.STATE_SUCCESS);
|
@Override
|
||||||
} else {
|
public void onError(@NonNull Throwable e) {
|
||||||
refreshStateView(LionActions.STATE_EMPTY);
|
mSrlContent.finishLoadMore();
|
||||||
|
mSrlContent.finishRefresh();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
refreshStateView(LionActions.STATE_ERROR);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onComplete() {
|
||||||
mSrlContent.finishLoadMore();
|
|
||||||
mSrlContent.finishRefresh();
|
|
||||||
ExceptionHandler.handleException(e);
|
|
||||||
refreshStateView(LionActions.STATE_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void onComplete() {
|
});
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshStateView(int state) {
|
private void refreshStateView(int state) {
|
||||||
@ -530,38 +533,38 @@ public class DocFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void getPersonCatalog() {
|
private void getPersonCatalog() {
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getDocumentTypeListByPid(mSelCatalogId, "0")
|
.getDocumentTypeListByPid(mSelCatalogId, "0")
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<List<DocumentTypeList>>() {
|
.subscribe(new Observer<List<DocumentTypeList>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@NonNull List<DocumentTypeList> documentTypeLists) {
|
|
||||||
mDatas.clear();
|
|
||||||
if (documentTypeLists.size() > 0) {
|
|
||||||
mDatas.addAll(documentTypeLists);
|
|
||||||
}
|
}
|
||||||
mAdapter.setData(mDatas);
|
|
||||||
getDocumentList(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onNext(@NonNull List<DocumentTypeList> documentTypeLists) {
|
||||||
mSrlContent.finishLoadMore();
|
mDatas.clear();
|
||||||
mSrlContent.finishRefresh();
|
if (documentTypeLists.size() > 0) {
|
||||||
refreshStateView(LionActions.STATE_ERROR);
|
mDatas.addAll(documentTypeLists);
|
||||||
ExceptionHandler.handleException(e);
|
}
|
||||||
}
|
mAdapter.setData(mDatas);
|
||||||
|
getDocumentList(1);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
mSrlContent.finishLoadMore();
|
||||||
|
mSrlContent.finishRefresh();
|
||||||
|
refreshStateView(LionActions.STATE_ERROR);
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -569,38 +572,38 @@ public class DocFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void getPublicCatalog() {
|
private void getPublicCatalog() {
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getPublicDocTypeList(mSelCatalogId, "1")
|
.getPublicDocTypeList(mSelCatalogId, "1")
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<List<DocTypeTreeListBean>>() {
|
.subscribe(new Observer<List<DocTypeTreeListBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@NonNull List<DocTypeTreeListBean> docTypeTreeListBeans) {
|
|
||||||
mDatas.clear();
|
|
||||||
if (docTypeTreeListBeans.size() > 0) {
|
|
||||||
mDatas.addAll(docTypeTreeListBeans);
|
|
||||||
}
|
}
|
||||||
mAdapter.setData(mDatas);
|
|
||||||
getDocumentList(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onNext(@NonNull List<DocTypeTreeListBean> docTypeTreeListBeans) {
|
||||||
mSrlContent.finishLoadMore();
|
mDatas.clear();
|
||||||
mSrlContent.finishRefresh();
|
if (docTypeTreeListBeans.size() > 0) {
|
||||||
refreshStateView(LionActions.STATE_ERROR);
|
mDatas.addAll(docTypeTreeListBeans);
|
||||||
ExceptionHandler.handleException(e);
|
}
|
||||||
}
|
mAdapter.setData(mDatas);
|
||||||
|
getDocumentList(1);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
mSrlContent.finishLoadMore();
|
||||||
|
mSrlContent.finishRefresh();
|
||||||
|
refreshStateView(LionActions.STATE_ERROR);
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tenlionsoft.oamodule.fragments;
|
package com.tenlionsoft.oamodule.fragments;
|
||||||
|
|
||||||
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -12,6 +14,14 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
@ -54,21 +64,12 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
import io.reactivex.rxjava3.core.Observer;
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者: adam
|
* 作者: adam
|
||||||
* 日期: 2022/4/11 - 11:13 上午
|
* 日期: 2022/4/11 - 11:13 上午
|
||||||
@ -153,21 +154,21 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
initContentView();
|
initContentView();
|
||||||
doRefresh();
|
doRefresh();
|
||||||
Glide.with(mActivity)
|
Glide.with(mActivity)
|
||||||
.load(R.drawable.ic_main_title_bg)
|
.load(R.drawable.ic_main_title_bg)
|
||||||
.apply(new RequestOptions()
|
.apply(new RequestOptions()
|
||||||
.error(R.drawable.ic_user_default)
|
.error(R.drawable.ic_user_default)
|
||||||
.placeholder(R.drawable.ic_user_info_bg))
|
.placeholder(R.drawable.ic_user_info_bg))
|
||||||
.into(new CustomTarget<Drawable>() {
|
.into(new CustomTarget<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
mRlTitleBg.setBackground(resource);
|
mRlTitleBg.setBackground(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -188,26 +189,26 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
mRlvNotice.setLayoutManager(new LinearLayoutManager(mActivity));
|
mRlvNotice.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvNotice.setAdapter(mNoticeShowAdapter);
|
mRlvNotice.setAdapter(mNoticeShowAdapter);
|
||||||
mNoticeShowAdapter.addOnItemClickListener(rowsBean -> ARouter.getInstance()
|
mNoticeShowAdapter.addOnItemClickListener(rowsBean -> ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_NOTICE_DETAIL)
|
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_NOTICE_DETAIL)
|
||||||
.withString("id", rowsBean.getNoticeId())
|
.withString("id", rowsBean.getNoticeId())
|
||||||
.navigation());
|
.navigation());
|
||||||
|
|
||||||
mTvNoticeMore.setOnClickListener(v -> ARouter.getInstance()
|
mTvNoticeMore.setOnClickListener(v -> ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_NOTICE)
|
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_NOTICE)
|
||||||
.navigation());//通知公告更多
|
.navigation());//通知公告更多
|
||||||
mIvScan.setOnClickListener(v -> {
|
mIvScan.setOnClickListener(v -> {
|
||||||
Intent intent = new Intent(mActivity, CaptureActivity.class);
|
Intent intent = new Intent(mActivity, CaptureActivity.class);
|
||||||
mLauncher.launch(intent);
|
mLauncher.launch(intent);
|
||||||
});//扫码
|
});//扫码
|
||||||
mRlTodo.setOnClickListener(v -> ARouter.getInstance()
|
mRlTodo.setOnClickListener(v -> ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_OAFLOW_MINE_TODO)
|
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_OAFLOW_MINE_TODO)
|
||||||
.navigation());//我的待办
|
.navigation());//我的待办
|
||||||
mRlToRead.setOnClickListener(v -> ARouter.getInstance()
|
mRlToRead.setOnClickListener(v -> ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_OAFLOW_MINE_READ)
|
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_OAFLOW_MINE_READ)
|
||||||
.navigation());//我的待阅
|
.navigation());//我的待阅
|
||||||
mRlSupervise.setOnClickListener(v -> ARouter.getInstance()
|
mRlSupervise.setOnClickListener(v -> ARouter.getInstance()
|
||||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_SUPERVISE)
|
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_SUPERVISE)
|
||||||
.navigation());//我的督办
|
.navigation());//我的督办
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doRefresh() {
|
private void doRefresh() {
|
||||||
@ -231,77 +232,82 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void getMainMenuList() {
|
private void getMainMenuList() {
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getHomeMenuList()
|
.getHomeMenuList()
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<List<FuncBean>>() {
|
.subscribe(new Observer<List<FuncBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@NonNull List<FuncBean> docTypeBeans) {
|
|
||||||
if (docTypeBeans.size() > 0) {
|
|
||||||
mFuncBeans = docTypeBeans;
|
|
||||||
mAdapter.setData(mFuncBeans);
|
|
||||||
mCsvFuncs.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
mCsvFuncs.setVisibility(View.VISIBLE);
|
|
||||||
mCsvFuncs.setState(CustomStateView.STATE_EMPTY);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onNext(@NonNull List<FuncBean> docTypeBeans) {
|
||||||
mCsvFuncs.setState(CustomStateView.STATE_ERROR);
|
if (docTypeBeans.size() > 0) {
|
||||||
ExceptionHandler.handleException(e);
|
mFuncBeans = docTypeBeans;
|
||||||
}
|
if (mFuncBeans.size() > 4) {
|
||||||
|
mRlvFuncs.setLayoutManager(new GridLayoutManager(mActivity, 2, LinearLayoutManager.HORIZONTAL, false));
|
||||||
|
} else {
|
||||||
|
mRlvFuncs.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.HORIZONTAL, false));
|
||||||
|
}
|
||||||
|
mAdapter.setData(mFuncBeans);
|
||||||
|
mCsvFuncs.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
mCsvFuncs.setVisibility(View.VISIBLE);
|
||||||
|
mCsvFuncs.setState(CustomStateView.STATE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
mCsvFuncs.setState(CustomStateView.STATE_ERROR);
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getNoticeList() {
|
private void getNoticeList() {
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getNoticeList("2",PathConfig.NOTICE_CONFIG_ID,"", "", "", "1", "15")
|
.getNoticeList("2", PathConfig.NOTICE_CONFIG_ID, "", "", "", "1", "15")
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<NoticeListBean>() {
|
.subscribe(new Observer<NoticeListBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@NonNull NoticeListBean noticeListBean) {
|
|
||||||
if (noticeListBean.getRows().size() > 0) {
|
|
||||||
mRlvNotice.setVisibility(View.VISIBLE);
|
|
||||||
mCsvNotice.setVisibility(View.GONE);
|
|
||||||
mNoticeListBeanRows = noticeListBean.getRows();
|
|
||||||
mNoticeShowAdapter.setData(mNoticeListBeanRows);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
mRlvNotice.setVisibility(View.GONE);
|
|
||||||
mCsvNotice.setVisibility(View.VISIBLE);
|
|
||||||
mCsvNotice.setState(CustomStateView.STATE_EMPTY);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onNext(@NonNull NoticeListBean noticeListBean) {
|
||||||
mRlvNotice.setVisibility(View.GONE);
|
if (noticeListBean.getRows().size() > 0) {
|
||||||
mCsvNotice.setState(CustomStateView.STATE_ERROR);
|
mRlvNotice.setVisibility(View.VISIBLE);
|
||||||
}
|
mCsvNotice.setVisibility(View.GONE);
|
||||||
|
mNoticeListBeanRows = noticeListBean.getRows();
|
||||||
|
mNoticeShowAdapter.setData(mNoticeListBeanRows);
|
||||||
|
|
||||||
@Override
|
} else {
|
||||||
public void onComplete() {
|
mRlvNotice.setVisibility(View.GONE);
|
||||||
|
mCsvNotice.setVisibility(View.VISIBLE);
|
||||||
|
mCsvNotice.setState(CustomStateView.STATE_EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onError(@NonNull Throwable e) {
|
||||||
|
mRlvNotice.setVisibility(View.GONE);
|
||||||
|
mCsvNotice.setState(CustomStateView.STATE_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -309,11 +315,11 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
//获取焦点
|
//获取焦点
|
||||||
Glide.with(mActivity)
|
Glide.with(mActivity)
|
||||||
.load(BaseUrlApi.BASE_IMG_URL + UserLgUtils.getAvatar())
|
.load(BaseUrlApi.BASE_IMG_URL + UserLgUtils.getAvatar())
|
||||||
.apply(RequestOptions.bitmapTransform(new CircleCrop())
|
.apply(RequestOptions.bitmapTransform(new CircleCrop())
|
||||||
.error(R.drawable.ic_user_default)
|
.error(R.drawable.ic_user_default)
|
||||||
.placeholder(R.drawable.ic_user_default))
|
.placeholder(R.drawable.ic_user_default))
|
||||||
.into(mIvUserIcon);
|
.into(mIvUserIcon);
|
||||||
mTvUserName.setText("Hello! " + UserLgUtils.getName());
|
mTvUserName.setText("Hello! " + UserLgUtils.getName());
|
||||||
String userDeptId = UserLgUtils.getUserDeptId();
|
String userDeptId = UserLgUtils.getUserDeptId();
|
||||||
if (!TextUtils.isEmpty(userDeptId)) {
|
if (!TextUtils.isEmpty(userDeptId)) {
|
||||||
@ -331,91 +337,91 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
private void getHintCount() {
|
private void getHintCount() {
|
||||||
//待办
|
//待办
|
||||||
Observable<ToDoCountBean> countBeanObservable = RetrofitManager.getInstance()
|
Observable<ToDoCountBean> countBeanObservable = RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getMineToDoCount()
|
.getMineToDoCount()
|
||||||
.compose(RxTransformer.getTransformer());
|
.compose(RxTransformer.getTransformer());
|
||||||
//待阅
|
//待阅
|
||||||
Observable<UnReadCountBean> compose = RetrofitManager.getInstance()
|
Observable<UnReadCountBean> compose = RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getMineUnReadCount()
|
.getMineUnReadCount()
|
||||||
.compose(RxTransformer.getTransformer());
|
.compose(RxTransformer.getTransformer());
|
||||||
//督办
|
//督办
|
||||||
Observable<BySuperviseListBean> superviseCount = RetrofitManager.getInstance()
|
Observable<BySuperviseListBean> superviseCount = RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.getBySuperviseList("", "", "", "1")
|
.getBySuperviseList("", "", "", "1")
|
||||||
.compose(RxTransformer.getTransformer());
|
.compose(RxTransformer.getTransformer());
|
||||||
Observable.mergeDelayError(countBeanObservable, compose, superviseCount)
|
Observable.mergeDelayError(countBeanObservable, compose, superviseCount)
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<Object>() {
|
.subscribe(new Observer<Object>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull Object o) {
|
public void onNext(@NonNull Object o) {
|
||||||
if (o instanceof ToDoCountBean) {
|
if (o instanceof ToDoCountBean) {
|
||||||
ToDoCountBean bean = (ToDoCountBean) o;
|
ToDoCountBean bean = (ToDoCountBean) o;
|
||||||
if (!TextUtils.isEmpty(bean.getData())) {
|
if (!TextUtils.isEmpty(bean.getData())) {
|
||||||
mLlTodoCount.setVisibility(View.VISIBLE);
|
mLlTodoCount.setVisibility(View.VISIBLE);
|
||||||
int i = Integer.parseInt(bean.getData());
|
int i = Integer.parseInt(bean.getData());
|
||||||
if (i > 99) {
|
if (i > 99) {
|
||||||
mTvTodoCount.setText("99+");
|
mTvTodoCount.setText("99+");
|
||||||
} else {
|
|
||||||
if (i > 0) {
|
|
||||||
mLlTodoCount.setVisibility(View.VISIBLE);
|
|
||||||
mTvTodoCount.setText(bean.getData());
|
|
||||||
} else {
|
} else {
|
||||||
mLlTodoCount.setVisibility(View.GONE);
|
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 {
|
} else {
|
||||||
if (i > 0) {
|
mLlTodoCount.setVisibility(View.GONE);
|
||||||
mLlUnreadCount.setVisibility(View.VISIBLE);
|
}
|
||||||
mTvUnreadCount.setText(bean.getData());
|
} 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 {
|
} else {
|
||||||
mLlUnreadCount.setVisibility(View.GONE);
|
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 {
|
} else {
|
||||||
mLlSuperviseCount.setVisibility(View.GONE);
|
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
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -423,10 +429,10 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void choosePage(FuncBean funcBean) {
|
private void choosePage(FuncBean funcBean) {
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(funcBean.getAppFunctionPath())
|
.build(funcBean.getAppFunctionPath())
|
||||||
.withString("title", funcBean.getAppFunctionName())
|
.withString("title", funcBean.getAppFunctionName())
|
||||||
.withString("id", funcBean.getAppFunctionId())
|
.withString("id", funcBean.getAppFunctionId())
|
||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -463,32 +469,32 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "签到中...");
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "签到中...");
|
||||||
dialog.show();
|
dialog.show();
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(OAApi.class)
|
.create(OAApi.class)
|
||||||
.doSignMeeting(s)
|
.doSignMeeting(s)
|
||||||
.compose(RxTransformer.getTransformer())
|
.compose(RxTransformer.getTransformer())
|
||||||
.subscribe(new Observer<BaseSuccessBean>() {
|
.subscribe(new Observer<BaseSuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
||||||
if (dialog.isShowing()) dialog.dismiss();
|
if (dialog.isShowing()) dialog.dismiss();
|
||||||
ToastUtils.show("签到成功");
|
ToastUtils.show("签到成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
if (dialog.isShowing()) dialog.dismiss();
|
if (dialog.isShowing()) dialog.dismiss();
|
||||||
ExceptionHandler.handleException(e);
|
ExceptionHandler.handleException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package com.tenlionsoft.oamodule.holder;
|
package com.tenlionsoft.oamodule.holder;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.tenlionsoft.baselib.core.widget.base.BaseViewHolder;
|
import com.tenlionsoft.baselib.core.widget.base.BaseViewHolder;
|
||||||
@ -21,6 +24,14 @@ public class ChooseDocTypeHolder extends BaseViewHolder {
|
|||||||
public TextView mTvName;
|
public TextView mTvName;
|
||||||
@BindView(R2.id.cb_check)
|
@BindView(R2.id.cb_check)
|
||||||
public CheckBox mCbCheck;
|
public CheckBox mCbCheck;
|
||||||
|
@BindView(R2.id.iv_arrow)
|
||||||
|
public ImageView mIvArrow;
|
||||||
|
@BindView(R2.id.ll_btns)
|
||||||
|
public LinearLayout mLlBtns;
|
||||||
|
@BindView(R2.id.btn_edit)
|
||||||
|
public Button mBtnEdit;
|
||||||
|
@BindView(R2.id.btn_del)
|
||||||
|
public Button mBtnDel;
|
||||||
|
|
||||||
public ChooseDocTypeHolder(@NonNull View itemView) {
|
public ChooseDocTypeHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
@ -214,7 +214,7 @@ public interface OAApi {
|
|||||||
*/
|
*/
|
||||||
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||||
@PUT("app/filecatalogue/updatefilecatalogue/{fileCatalogueId}")
|
@PUT("app/filecatalogue/updatefilecatalogue/{fileCatalogueId}")
|
||||||
Observable<BaseSuccessBean> doEditDocumentType(@Path("fileTypeId") String id, @Body RequestBody body);
|
Observable<BaseSuccessBean> doEditDocumentType(@Path("fileCatalogueId") String id, @Body RequestBody body);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文档类型
|
* 删除文档类型
|
||||||
@ -979,6 +979,20 @@ public interface OAApi {
|
|||||||
@GET("app/oa/listpage-procdef")
|
@GET("app/oa/listpage-procdef")
|
||||||
Observable<OaFlowApplyBean> getOaFLowList(@Query("keywords") String key, @Query("page") String page);
|
Observable<OaFlowApplyBean> getOaFLowList(@Query("keywords") String key, @Query("page") String page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发文待办
|
||||||
|
*/
|
||||||
|
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||||
|
@GET("app/oataskbase/listpage/task/publish")
|
||||||
|
Observable<MineTodoBean> getOaPublishFileList(@Query("keywords") String key, @Query("page") String page, @Query("rows") String rows);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取收文待办
|
||||||
|
*/
|
||||||
|
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||||
|
@GET("app/oataskbase/listpage/task/receive")
|
||||||
|
Observable<MineTodoBean> getOaReceiveFileList(@Query("keywords") String key, @Query("page") String page, @Query("rows") String rows);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的待阅
|
* 我的待阅
|
||||||
*/
|
*/
|
||||||
|
@ -14,6 +14,7 @@ import android.view.View;
|
|||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
|||||||
import com.bigkoo.pickerview.view.TimePickerView;
|
import com.bigkoo.pickerview.view.TimePickerView;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.tenlionsoft.baselib.R;
|
import com.tenlionsoft.baselib.R;
|
||||||
|
import com.tenlionsoft.oamodule.beans.DocumentTypeList;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,13 +40,15 @@ public class CenterDocTypeView extends Dialog {
|
|||||||
private OnChoseListener mListener;
|
private OnChoseListener mListener;
|
||||||
private boolean mIsShow;
|
private boolean mIsShow;
|
||||||
private boolean mIsShowOther;
|
private boolean mIsShowOther;
|
||||||
private TextView mTvTime;
|
private EditText mEtName;
|
||||||
private TimePickerView mTimePicker;
|
private EditText mEtOrder;
|
||||||
private EditText mEtContent;
|
private EditText mEtRemark;
|
||||||
|
private DocumentTypeList bean;
|
||||||
|
|
||||||
private CenterDocTypeView(Context context) {
|
private CenterDocTypeView(Context context, DocumentTypeList b) {
|
||||||
super(context, R.style.dialog_center_alpha);
|
super(context, R.style.dialog_center_alpha);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
this.bean = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -54,11 +58,20 @@ public class CenterDocTypeView extends Dialog {
|
|||||||
setContentView(view);
|
setContentView(view);
|
||||||
setCancelable(iscancelable);
|
setCancelable(iscancelable);
|
||||||
setCanceledOnTouchOutside(isBackCancelable);
|
setCanceledOnTouchOutside(isBackCancelable);
|
||||||
mTvTime = view.findViewById(R.id.tv_time);
|
mEtName = view.findViewById(R.id.et_name);
|
||||||
mEtContent = view.findViewById(R.id.et_content);
|
mEtOrder = view.findViewById(R.id.et_order);
|
||||||
mTvTime.setOnClickListener(v -> onShowTimePicker());
|
mEtRemark = view.findViewById(R.id.et_remark);
|
||||||
|
Button btnConfirm = view.findViewById(R.id.btn_confirm);
|
||||||
|
if (bean != null) {
|
||||||
|
mEtName.setText(bean.getName());
|
||||||
|
mEtRemark.setText(bean.getRemake());
|
||||||
|
mEtOrder.setText(bean.getSortNum() + "");
|
||||||
|
btnConfirm.setText("保存");
|
||||||
|
} else {
|
||||||
|
btnConfirm.setText("添加");
|
||||||
|
}
|
||||||
view.findViewById(R.id.btn_cancel).setOnClickListener(v -> this.dismiss());
|
view.findViewById(R.id.btn_cancel).setOnClickListener(v -> this.dismiss());
|
||||||
view.findViewById(R.id.btn_confirm).setOnClickListener(v -> doConfirm());
|
btnConfirm.setOnClickListener(v -> doConfirm());
|
||||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||||
Window window = this.getWindow();
|
Window window = this.getWindow();
|
||||||
window.setGravity(Gravity.CENTER);
|
window.setGravity(Gravity.CENTER);
|
||||||
@ -70,37 +83,36 @@ public class CenterDocTypeView extends Dialog {
|
|||||||
window.setBackgroundDrawable(new ColorDrawable());
|
window.setBackgroundDrawable(new ColorDrawable());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onShowTimePicker() {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doConfirm() {
|
private void doConfirm() {
|
||||||
if (checkParams()) {
|
if (checkParams()) {
|
||||||
String time = mTvTime.getText().toString().trim();
|
String name = mEtName.getText().toString().trim();
|
||||||
String content = mEtContent.getText().toString().trim();
|
String order = mEtOrder.getText().toString().trim();
|
||||||
mListener.doConfirm(time, content);
|
String remark = mEtRemark.getText().toString().trim();
|
||||||
|
mListener.doConfirm(name, order, remark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideSoftKeyBoardDialog(Activity activity) {
|
public void hideSoftKeyBoardDialog(Activity activity) {
|
||||||
try {
|
try {
|
||||||
InputMethodManager imm = (InputMethodManager) activity.getSystemService(activity.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) activity.getSystemService(activity.INPUT_METHOD_SERVICE);
|
||||||
imm.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0);
|
imm.toggleSoftInput(InputMethodManager.HIDE_NOT_ALWAYS, 0);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数
|
* 校验参数
|
||||||
*/
|
*/
|
||||||
private boolean checkParams() {
|
private boolean checkParams() {
|
||||||
String time = mTvTime.getText().toString().trim();
|
String name = mEtName.getText().toString().trim();
|
||||||
if (TextUtils.isEmpty(time)) {
|
if (TextUtils.isEmpty(name)) {
|
||||||
ToastUtils.show("请选择时间");
|
ToastUtils.show("请输入目录名称");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String content = mEtContent.getText().toString().trim();
|
String order = mEtOrder.getText().toString().trim();
|
||||||
if (TextUtils.isEmpty(content)) {
|
if (TextUtils.isEmpty(order)) {
|
||||||
ToastUtils.show("请输入原由");
|
ToastUtils.show("请输入排序编号");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -121,7 +133,7 @@ public class CenterDocTypeView extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface OnChoseListener {
|
public interface OnChoseListener {
|
||||||
void doConfirm(String list, String ids);
|
void doConfirm(String name, String order, String remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DialogBuilder {
|
public static class DialogBuilder {
|
||||||
@ -163,12 +175,16 @@ public class CenterDocTypeView extends Dialog {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DocumentTypeList b;
|
||||||
|
|
||||||
|
public DialogBuilder setBean(DocumentTypeList b) {
|
||||||
|
this.b = b;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public CenterDocTypeView build() {
|
public CenterDocTypeView build() {
|
||||||
return new CenterDocTypeView(this.mContext);
|
return new CenterDocTypeView(this.mContext, this.b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -37,7 +37,10 @@
|
|||||||
android:id="@+id/rlv_content"
|
android:id="@+id/rlv_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginBottom="65dp"
|
||||||
android:background="@color/gray_f8"
|
android:background="@color/gray_f8"
|
||||||
tools:listitem="@layout/item_choose_doc_type" />
|
tools:listitem="@layout/item_choose_doc_type" />
|
||||||
|
|
||||||
@ -46,5 +49,32 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true" />
|
android:layout_centerInParent="true" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_add_type"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/sel_btn_blue_gray_cir"
|
||||||
|
android:text="新增"
|
||||||
|
android:textColor="@color/col_white_gray_press" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_edit_type"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/sel_btn_activity_sign_up"
|
||||||
|
android:text="编辑"
|
||||||
|
android:textColor="@color/col_white_gray_press" />
|
||||||
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -4,6 +4,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
@ -24,11 +25,11 @@
|
|||||||
|
|
||||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:drawableLeft="@drawable/ic_folder_icon"
|
android:drawableLeft="@drawable/ic_folder_icon"
|
||||||
android:drawableRight="@drawable/ic_arrow_cir"
|
|
||||||
android:drawablePadding="10dp"
|
android:drawablePadding="10dp"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
@ -37,7 +38,44 @@
|
|||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
tools:text="测试" />
|
tools:text="测试" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_arrow"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_arrow_cir" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_btns"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_del"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/sel_btn_red_gray_re_5"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="删除"
|
||||||
|
android:textColor="@color/col_white_gray_press"
|
||||||
|
android:textSize="@dimen/text_12" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_edit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="@drawable/sel_btn_blue_gray_re_5"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="编辑"
|
||||||
|
android:textColor="@color/col_white_gray_press"
|
||||||
|
android:textSize="@dimen/text_12" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user