完成督办,工作报告
This commit is contained in:
parent
230e606a38
commit
1f130d1f0d
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="delegatedBuild" value="true" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
|
@ -175,6 +175,9 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_ROUTINE_WORK_MINE_LAUNCH_EDIT = "/oamodule/activity/mineLaunchRoutineWorkEdit";//我发起的日常工作编辑
|
||||
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_WORK_REPORT = "/oamodule/activity/workReport";//工作报告
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_WORK_REPORT_ADD = "/oamodule/activity/workReportAdd";//新增工作报告
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_WORK_REPORT_EDIT = "/oamodule/activity/workReportEdit";//编辑工作报告
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_WORK_REPORT_DETAIL = "/oamodule/activity/workReportDetail";//工作报告详情
|
||||
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_SUPERVISE = "/oamodule/activity/supervise";//督办事项
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_APPLY_SUPERVISE = "/oamodule/activity/applySupervise";//发起督办
|
||||
|
@ -3,7 +3,11 @@
|
||||
package="com.tenlionsoft.oamodule">
|
||||
|
||||
<application>
|
||||
<activity android:name=".activity.supervise.SuperviseTransactActivity"></activity>
|
||||
<activity android:name=".activity.workreports.EditWorkReportActivity"></activity>
|
||||
<activity android:name=".activity.workreports.WorkReportDetailActivity" />
|
||||
<activity android:name=".activity.workreports.AddWorkReportsActivity" />
|
||||
<activity android:name=".activity.workreports.WorkReportsActivity" />
|
||||
<activity android:name=".activity.supervise.SuperviseTransactActivity" />
|
||||
<activity android:name=".activity.supervise.SuperviseDetailActivity" />
|
||||
<activity android:name=".activity.supervise.SelRelevanceOptionActivity" />
|
||||
<activity android:name=".activity.supervise.ApplySuperviseActivity" />
|
||||
|
@ -104,12 +104,13 @@ public class MeetingApplyActivity extends BaseActivity {
|
||||
private List<AddFileBean> mFileBeans = new ArrayList<>();
|
||||
private AddFileAdapter mAddFileAdapter;
|
||||
private String[] fileFilter = new String[]{".doc", ".docx", ".xls", ".xlsx", ".pptx", ".ppt", ".txt", ".pdf"};
|
||||
private int mFileMax = 9;
|
||||
|
||||
private OptionsPickerView<DicBean> mTypePicker;
|
||||
private List<DicBean> mTyps;
|
||||
private DicBean mSelType;
|
||||
|
||||
private int mFileMax = 9;
|
||||
|
||||
private ChoosePersonListBean mSelEmcee;
|
||||
private MeetingRoomBean mSelRoom;
|
||||
private List<PersonShowBean> mJoinPerson;
|
||||
|
@ -8,6 +8,7 @@ import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
@ -19,6 +20,7 @@ import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.beans.SaveRepectSuperviseBean;
|
||||
import com.tenlionsoft.oamodule.beans.SuperviseBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
@ -27,6 +29,7 @@ import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
@ -134,9 +137,13 @@ public class SuperviseTransactActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private RequestBody buildParams() {
|
||||
SaveRepectSuperviseBean bean = new SaveRepectSuperviseBean();
|
||||
String content = mEtRepectContent.getText().toString().trim();
|
||||
|
||||
return null;
|
||||
bean.setContent(content);
|
||||
bean.setOverseeId(mId);
|
||||
bean.setUserId(UserLgUtils.getUserId());
|
||||
bean.setUserName(UserLgUtils.getName());
|
||||
return RequestBody.create(new Gson().toJson(bean), MediaType.parse("application/json; charset=utf-8"));
|
||||
}
|
||||
|
||||
private void getDetailData() {
|
||||
|
@ -0,0 +1,380 @@
|
||||
package com.tenlionsoft.oamodule.activity.workreports;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.leon.lfilepickerlibrary.LFilePicker;
|
||||
import com.leon.lfilepickerlibrary.utils.Constant;
|
||||
import com.tenlionsoft.baselib.constant.LionActions;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddFileBean;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.beans.DicBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.AddFileAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.beans.ChoosePersonListBean;
|
||||
import com.tenlionsoft.oamodule.beans.PersonShowBean;
|
||||
import com.tenlionsoft.oamodule.beans.SaveWorkReportBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2022年04月19日14:30:22
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 新增工作报告
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT_ADD)
|
||||
public class AddWorkReportsActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R2.id.et_name)
|
||||
EditText mEtName;
|
||||
@BindView(R2.id.tv_type)
|
||||
TextView mTvType;
|
||||
@BindView(R2.id.et_out)
|
||||
EditText mEtOut;
|
||||
@BindView(R2.id.et_content)
|
||||
EditText mEtContent;
|
||||
@BindView(R2.id.rlv_files)
|
||||
RecyclerView mRlvFiles;
|
||||
@BindView(R2.id.btn_confirm)
|
||||
Button mBtnConfirm;
|
||||
private List<AddFileBean> mFileBeans = new ArrayList<>();
|
||||
private AddFileAdapter mAddFileAdapter;
|
||||
private String[] fileFilter = new String[]{".doc", ".docx", ".xls", ".xlsx", ".pptx", ".ppt", ".txt", ".pdf"};
|
||||
private int mFileMax = 9;
|
||||
|
||||
|
||||
private OptionsPickerView<DicBean> mTypePicker;
|
||||
private List<DicBean> mTyps;
|
||||
private DicBean mSelType;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_add_work_reports;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("工作报告新增");
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
initViews();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
mTyps = new ArrayList<>();
|
||||
// 工作日报 1
|
||||
// 工作月报 2
|
||||
// 工作年报 3
|
||||
DicBean type1 = new DicBean();
|
||||
type1.setDataId("1");
|
||||
type1.setDataName("工作日报");
|
||||
|
||||
DicBean type2 = new DicBean();
|
||||
type2.setDataId("2");
|
||||
type2.setDataName("工作月报");
|
||||
|
||||
DicBean type3 = new DicBean();
|
||||
type3.setDataId("3");
|
||||
type3.setDataName("工作年报");
|
||||
|
||||
mTyps.add(type1);
|
||||
mTyps.add(type2);
|
||||
mTyps.add(type3);
|
||||
|
||||
mTvType.setOnClickListener(v -> onShowType());
|
||||
mFileBeans.add(new AddFileBean());
|
||||
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
||||
LogUtils.e("添加文件");
|
||||
if (TextUtils.isEmpty(addFileBean.getId())) {
|
||||
//选择
|
||||
if (mFileMax == 0) {
|
||||
ToastUtils.show("超过最大上传数量限制");
|
||||
} else {
|
||||
//TODO 校验是否有权限
|
||||
new LFilePicker()
|
||||
.withActivity(this)
|
||||
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
||||
.withTitle("文件选择")
|
||||
.withMaxNum(mFileMax)
|
||||
.withFileFilter(fileFilter)
|
||||
.start();
|
||||
}
|
||||
} else {
|
||||
//预览
|
||||
//判断文件类型
|
||||
}
|
||||
});
|
||||
//删除上传的文件
|
||||
mAddFileAdapter.addOnDeleteListener((bean, i) -> {
|
||||
//删除list中的某个数据
|
||||
mFileBeans.remove(i);
|
||||
mAddFileAdapter.notifyDataSetChanged();
|
||||
++mFileMax;
|
||||
});
|
||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示类型
|
||||
*/
|
||||
private void onShowType() {
|
||||
hideSoftKeyboard();
|
||||
if (mTyps != null && mTyps.size() > 0) {
|
||||
if (mTypePicker == null) {
|
||||
mTypePicker = new OptionsPickerBuilder(mActivity, (o1, o2, o3, v) -> {
|
||||
mSelType = mTyps.get(o1);
|
||||
mTvType.setText(mSelType.getDataName());
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTypePicker.setPicker(mTyps);
|
||||
}
|
||||
mTypePicker.show();
|
||||
} else {
|
||||
ToastUtils.show("数据有误,请重新打开页面");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (requestCode == LionActions.REQUEST_CODE_AC) {
|
||||
//文件
|
||||
if (data != null) {
|
||||
ArrayList<String> paths = data.getStringArrayListExtra(Constant.RESULT_INFO);
|
||||
if (paths != null && paths.size() > 0) {
|
||||
doUploadFiles(paths);
|
||||
} else {
|
||||
ToastUtils.show("未选择文件");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.show("路径有误,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param paths
|
||||
*/
|
||||
private int mUploadCount = 0;
|
||||
|
||||
private void doUploadFiles(ArrayList<String> paths) {
|
||||
LogUtils.e(paths);
|
||||
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "上传中...");
|
||||
progressDialog.show();
|
||||
List<Observable> requests = new ArrayList<>();
|
||||
List<String> fileNames = new ArrayList<>();
|
||||
for (int i = 0; i < paths.size(); i++) {
|
||||
File file = new File(paths.get(i));
|
||||
Observable observable = createObservable(file);
|
||||
fileNames.add(file.getName());
|
||||
if (observable == null) return;
|
||||
requests.add(observable);
|
||||
}
|
||||
Observable[] observables1 = requests.toArray(new Observable[requests.size()]);
|
||||
|
||||
Observable.mergeArrayDelayError(observables1)
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull Object o) {
|
||||
++mUploadCount;
|
||||
if (o instanceof BaseSuccessBean) {
|
||||
--mFileMax;
|
||||
//刷新文件
|
||||
BaseSuccessBean bean = (BaseSuccessBean) o;
|
||||
AddFileBean fileBean = new AddFileBean();
|
||||
fileBean.setId(bean.getData());
|
||||
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + bean.getData());
|
||||
fileBean.setFileType(1);
|
||||
fileBean.setFileName(fileNames.get(mUploadCount - 1));
|
||||
mFileBeans.add(0, fileBean);
|
||||
}
|
||||
mAddFileAdapter.notifyDataSetChanged();
|
||||
if (mUploadCount == paths.size()) {
|
||||
mUploadCount = 0;
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
e.printStackTrace();
|
||||
mUploadCount = 0;
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传失败,请稍后重试.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Observable createObservable(File file) {
|
||||
LogUtils.e(file.exists());
|
||||
RequestBody requestFile = RequestBody.create(file, MediaType.parse("multipart/form-data"));
|
||||
MultipartBody.Part body;
|
||||
body = MultipartBody.Part.createFormData("file", file.getName(), requestFile);
|
||||
return RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadFile(body, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer());
|
||||
}
|
||||
|
||||
|
||||
private RequestBody buildParams() {
|
||||
SaveWorkReportBean bean = new SaveWorkReportBean();
|
||||
String name = mEtName.getText().toString().trim();
|
||||
bean.setReportTitle(name);
|
||||
String out = mEtOut.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(out)) {
|
||||
bean.setReportEgress(out);
|
||||
}
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
bean.setReportContent(content);
|
||||
bean.setReportType(mSelType.getDataId());
|
||||
if (mFileBeans.size() >= 2) {
|
||||
StringBuilder fileId = new StringBuilder();
|
||||
for (AddFileBean fileBean : mFileBeans) {
|
||||
if (!TextUtils.isEmpty(fileBean.getId())) {
|
||||
fileId.append(fileBean.getId()).append(",");
|
||||
}
|
||||
}
|
||||
if (fileId.toString().endsWith(",")) {
|
||||
fileId = new StringBuilder(fileId.substring(0, fileId.length() - 1));
|
||||
}
|
||||
bean.setReportFiles(fileId.toString().trim());
|
||||
}
|
||||
return RequestBody.create(new Gson().toJson(bean), MediaType.parse("application/json; charset=utf-8"));
|
||||
}
|
||||
|
||||
private boolean checkParams() {
|
||||
String name = mEtName.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
ToastUtils.show("请输入上报标题");
|
||||
return false;
|
||||
}
|
||||
if (mSelType == null) {
|
||||
ToastUtils.show("请选择上报类型");
|
||||
return false;
|
||||
}
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtils.show("请输入工作内容");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void doConfirm() {
|
||||
if (checkParams()) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
|
||||
dialog.show();
|
||||
RequestBody body = buildParams();
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.doSaveWorkReport(body, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
ToastUtils.show("保存成功");
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,439 @@
|
||||
package com.tenlionsoft.oamodule.activity.workreports;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.leon.lfilepickerlibrary.LFilePicker;
|
||||
import com.leon.lfilepickerlibrary.utils.Constant;
|
||||
import com.tenlionsoft.baselib.constant.LionActions;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddFileBean;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.beans.DicBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.AddFileAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.beans.SaveWorkReportBean;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportDetailBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2022年04月19日15:37:36
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 编辑工作报告
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT_EDIT)
|
||||
public class EditWorkReportActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R2.id.et_name)
|
||||
EditText mEtName;
|
||||
@BindView(R2.id.tv_type)
|
||||
TextView mTvType;
|
||||
@BindView(R2.id.et_out)
|
||||
EditText mEtOut;
|
||||
@BindView(R2.id.et_content)
|
||||
EditText mEtContent;
|
||||
@BindView(R2.id.rlv_files)
|
||||
RecyclerView mRlvFiles;
|
||||
@BindView(R2.id.btn_confirm)
|
||||
Button mBtnConfirm;
|
||||
private List<AddFileBean> mFileBeans = new ArrayList<>();
|
||||
private AddFileAdapter mAddFileAdapter;
|
||||
private String[] fileFilter = new String[]{".doc", ".docx", ".xls", ".xlsx", ".pptx", ".ppt", ".txt", ".pdf"};
|
||||
private int mFileMax = 9;
|
||||
|
||||
|
||||
private OptionsPickerView<DicBean> mTypePicker;
|
||||
private List<DicBean> mTyps;
|
||||
private DicBean mSelType;
|
||||
private String mId;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_edit_work_report;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("工作报告编辑");
|
||||
initViews();
|
||||
mId = getIntent().getStringExtra("id");
|
||||
if (TextUtils.isEmpty(mId)) {
|
||||
ToastUtils.show("数据有误");
|
||||
finish();
|
||||
} else {
|
||||
getDetailById();
|
||||
}
|
||||
}
|
||||
|
||||
private void getDetailById() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getWorkReportDetail(mId, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<WorkReportDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull WorkReportDetailBean workReportDetailBean) {
|
||||
setDataToView(workReportDetailBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setDataToView(WorkReportDetailBean bean) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mEtName.setText(bean.getReportTitle());
|
||||
for (DicBean typ : mTyps) {
|
||||
if (typ.getDataId().equals(bean.getReportType())) {
|
||||
mSelType = typ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mTvType.setText(mSelType.getDataName());
|
||||
mEtOut.setText(Html.fromHtml(bean.getReportEgress()));
|
||||
mEtContent.setText(Html.fromHtml(bean.getReportContent()));
|
||||
if (!TextUtils.isEmpty(bean.getReportFiles())) {
|
||||
mFileBeans.clear();
|
||||
String[] split = bean.getReportFiles().split(",");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
AddFileBean fileBean = new AddFileBean();
|
||||
fileBean.setId(split[i]);
|
||||
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + split[i]);
|
||||
fileBean.setFileType(1);
|
||||
mFileBeans.add(0, fileBean);
|
||||
--mFileMax;
|
||||
}
|
||||
mFileBeans.add(new AddFileBean());
|
||||
mAddFileAdapter.setData(mFileBeans);
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
mTyps = new ArrayList<>();
|
||||
DicBean type1 = new DicBean();
|
||||
type1.setDataId("1");
|
||||
type1.setDataName("工作日报");
|
||||
|
||||
DicBean type2 = new DicBean();
|
||||
type2.setDataId("2");
|
||||
type2.setDataName("工作月报");
|
||||
|
||||
DicBean type3 = new DicBean();
|
||||
type3.setDataId("3");
|
||||
type3.setDataName("工作年报");
|
||||
|
||||
mTyps.add(type1);
|
||||
mTyps.add(type2);
|
||||
mTyps.add(type3);
|
||||
|
||||
mTvType.setOnClickListener(v -> onShowType());
|
||||
mFileBeans.add(new AddFileBean());
|
||||
mAddFileAdapter = new AddFileAdapter(mActivity, mFileBeans);
|
||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
||||
LogUtils.e("添加文件");
|
||||
if (TextUtils.isEmpty(addFileBean.getId())) {
|
||||
//选择
|
||||
if (mFileMax == 0) {
|
||||
ToastUtils.show("超过最大上传数量限制");
|
||||
} else {
|
||||
//TODO 校验是否有权限
|
||||
new LFilePicker()
|
||||
.withActivity(this)
|
||||
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
||||
.withTitle("文件选择")
|
||||
.withMaxNum(mFileMax)
|
||||
.withFileFilter(fileFilter)
|
||||
.start();
|
||||
}
|
||||
} else {
|
||||
//预览
|
||||
//判断文件类型
|
||||
}
|
||||
});
|
||||
//删除上传的文件
|
||||
mAddFileAdapter.addOnDeleteListener((bean, i) -> {
|
||||
//删除list中的某个数据
|
||||
mFileBeans.remove(i);
|
||||
mAddFileAdapter.notifyDataSetChanged();
|
||||
++mFileMax;
|
||||
});
|
||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示类型
|
||||
*/
|
||||
private void onShowType() {
|
||||
hideSoftKeyboard();
|
||||
if (mTyps != null && mTyps.size() > 0) {
|
||||
if (mTypePicker == null) {
|
||||
mTypePicker = new OptionsPickerBuilder(mActivity, (o1, o2, o3, v) -> {
|
||||
mSelType = mTyps.get(o1);
|
||||
mTvType.setText(mSelType.getDataName());
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTypePicker.setPicker(mTyps);
|
||||
}
|
||||
mTypePicker.show();
|
||||
} else {
|
||||
ToastUtils.show("数据有误,请重新打开页面");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (requestCode == LionActions.REQUEST_CODE_AC) {
|
||||
//文件
|
||||
if (data != null) {
|
||||
ArrayList<String> paths = data.getStringArrayListExtra(Constant.RESULT_INFO);
|
||||
if (paths != null && paths.size() > 0) {
|
||||
doUploadFiles(paths);
|
||||
} else {
|
||||
ToastUtils.show("未选择文件");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.show("路径有误,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param paths
|
||||
*/
|
||||
private int mUploadCount = 0;
|
||||
|
||||
private void doUploadFiles(ArrayList<String> paths) {
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "上传中...");
|
||||
progressDialog.show();
|
||||
List<Observable<BaseSuccessBean>> requests = new ArrayList<>();
|
||||
List<String> fileNames = new ArrayList<>();
|
||||
for (int i = 0; i < paths.size(); i++) {
|
||||
File file = new File(paths.get(i));
|
||||
Observable<BaseSuccessBean> observable = createObservable(file);
|
||||
fileNames.add(file.getName());
|
||||
if (observable == null) return;
|
||||
requests.add(observable);
|
||||
}
|
||||
Observable<BaseSuccessBean>[] observables1 = requests.toArray(new Observable[requests.size()]);
|
||||
|
||||
Observable.mergeArrayDelayError(observables1)
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull Object o) {
|
||||
++mUploadCount;
|
||||
if (o instanceof BaseSuccessBean) {
|
||||
--mFileMax;
|
||||
//刷新文件
|
||||
BaseSuccessBean bean = (BaseSuccessBean) o;
|
||||
AddFileBean fileBean = new AddFileBean();
|
||||
fileBean.setId(bean.getData());
|
||||
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + bean.getData());
|
||||
fileBean.setFileType(1);
|
||||
fileBean.setFileName(fileNames.get(mUploadCount - 1));
|
||||
mFileBeans.add(0, fileBean);
|
||||
}
|
||||
mAddFileAdapter.notifyDataSetChanged();
|
||||
if (mUploadCount == paths.size()) {
|
||||
mUploadCount = 0;
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
e.printStackTrace();
|
||||
mUploadCount = 0;
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.show("上传失败,请稍后重试.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Observable<BaseSuccessBean> createObservable(File file) {
|
||||
LogUtils.e(file.exists());
|
||||
RequestBody requestFile = RequestBody.create(file, MediaType.parse("multipart/form-data"));
|
||||
MultipartBody.Part body;
|
||||
body = MultipartBody.Part.createFormData("file", file.getName(), requestFile);
|
||||
return RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.uploadFile(body, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer());
|
||||
}
|
||||
|
||||
|
||||
private RequestBody buildParams() {
|
||||
SaveWorkReportBean bean = new SaveWorkReportBean();
|
||||
String name = mEtName.getText().toString().trim();
|
||||
bean.setReportTitle(name);
|
||||
String out = mEtOut.getText().toString().trim();
|
||||
bean.setReportEgress(out);
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
bean.setReportContent(content);
|
||||
bean.setReportType(mSelType.getDataId());
|
||||
if (mFileBeans.size() >= 2) {
|
||||
StringBuilder fileId = new StringBuilder();
|
||||
for (AddFileBean fileBean : mFileBeans) {
|
||||
if (!TextUtils.isEmpty(fileBean.getId())) {
|
||||
fileId.append(fileBean.getId()).append(",");
|
||||
}
|
||||
}
|
||||
if (fileId.toString().endsWith(",")) {
|
||||
fileId = new StringBuilder(fileId.substring(0, fileId.length() - 1));
|
||||
}
|
||||
bean.setReportFiles(fileId.toString().trim());
|
||||
} else {
|
||||
bean.setReportFiles("");
|
||||
}
|
||||
return RequestBody.create(new Gson().toJson(bean), MediaType.parse("application/json; charset=utf-8"));
|
||||
}
|
||||
|
||||
private boolean checkParams() {
|
||||
String name = mEtName.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
ToastUtils.show("请输入上报标题");
|
||||
return false;
|
||||
}
|
||||
if (mSelType == null) {
|
||||
ToastUtils.show("请选择上报类型");
|
||||
return false;
|
||||
}
|
||||
String content = mEtContent.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtils.show("请输入工作内容");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void doConfirm() {
|
||||
if (checkParams()) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
|
||||
dialog.show();
|
||||
RequestBody body = buildParams();
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.doEditWorkReport(mId, body, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
ToastUtils.show("保存成功");
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,228 @@
|
||||
package com.tenlionsoft.oamodule.activity.workreports;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddFileBean;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.base.ShowFileAdapter;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportDetailBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2022年04月19日15:21:37
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 工作报告详情
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT_DETAIL)
|
||||
public class WorkReportDetailActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R2.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R2.id.tv_type)
|
||||
TextView mTvType;
|
||||
@BindView(R2.id.et_out)
|
||||
TextView mEtOut;
|
||||
@BindView(R2.id.tv_content)
|
||||
TextView mTvContent;
|
||||
@BindView(R2.id.rlv_files)
|
||||
RecyclerView mRlvFiles;
|
||||
@BindView(R2.id.btn_del)
|
||||
Button mBtnDel;
|
||||
@BindView(R2.id.btn_edit)
|
||||
Button mBtnEdit;
|
||||
@BindView(R2.id.tv_file_hint)
|
||||
TextView mTvFileHint;
|
||||
private String mId;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_work_report_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("工作报告");
|
||||
mId = getIntent().getStringExtra("id");
|
||||
if (TextUtils.isEmpty(mId)) {
|
||||
ToastUtils.show("数据有误");
|
||||
finish();
|
||||
} else {
|
||||
getDetailById();
|
||||
}
|
||||
mBtnDel.setOnClickListener(v -> showDelConfirm());
|
||||
mBtnEdit.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT_EDIT)
|
||||
.withString("id", mId)
|
||||
.navigation(mActivity, 12));
|
||||
}
|
||||
|
||||
private void showDelConfirm() {
|
||||
new AlertDialog.Builder(mActivity)
|
||||
.setTitle("提示")
|
||||
.setMessage("确定要删除该报告吗?")
|
||||
.setPositiveButton("确定", (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
doDel();
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
|
||||
private void doDel() {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "删除中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.doDelWorkReport(mId, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseSuccessBean baseSuccessBean) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
ToastUtils.show("删除成功");
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getDetailById() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getWorkReportDetail(mId, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<WorkReportDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull WorkReportDetailBean workReportDetailBean) {
|
||||
setDataToView(workReportDetailBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setDataToView(WorkReportDetailBean bean) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvName.setText(bean.getReportTitle());
|
||||
switch (bean.getReportType()) {
|
||||
case "1":
|
||||
mTvType.setText("工作日报");
|
||||
break;
|
||||
case "2":
|
||||
mTvType.setText("工作周报");
|
||||
break;
|
||||
case "3":
|
||||
mTvType.setText("工作月报");
|
||||
break;
|
||||
}
|
||||
mEtOut.setText(Html.fromHtml(bean.getReportEgress()));
|
||||
mTvContent.setText(Html.fromHtml(bean.getReportContent()));
|
||||
//文件
|
||||
if (!TextUtils.isEmpty(bean.getReportFiles())) {
|
||||
mRlvFiles.setVisibility(View.VISIBLE);
|
||||
mTvFileHint.setVisibility(View.GONE);
|
||||
List<AddFileBean> files = new ArrayList<>();
|
||||
String[] split = bean.getReportFiles().split(",");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
AddFileBean fileBean = new AddFileBean();
|
||||
fileBean.setId(split[i]);
|
||||
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + split[i]);
|
||||
fileBean.setFileType(1);
|
||||
files.add(fileBean);
|
||||
}
|
||||
ShowFileAdapter adapter = new ShowFileAdapter(mActivity, files);
|
||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvFiles.setAdapter(adapter);
|
||||
} else {
|
||||
mRlvFiles.setVisibility(View.GONE);
|
||||
mTvFileHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (RESULT_OK == resultCode) {
|
||||
if (requestCode == 12) {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
getDetailById();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,233 @@
|
||||
package com.tenlionsoft.oamodule.activity.workreports;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tenlionsoft.baselib.constant.LionActions;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.adapter.WorkReportAdapter;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportDetailBean;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportListBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2022年04月19日14:24:07
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 工作报告
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT)
|
||||
public class WorkReportsActivity extends BaseActivity {
|
||||
|
||||
@BindView(R2.id.et_base_search_cancel)
|
||||
EditText mEtBaseSearchCancel;
|
||||
@BindView(R2.id.tv_base_search_cancel)
|
||||
TextView mTvBaseSearchCancel;
|
||||
@BindView(R2.id.ll_base_search_cancel)
|
||||
LinearLayout mLlBaseSearchCancel;
|
||||
@BindView(R2.id.rlv_content)
|
||||
RecyclerView mRlvContent;
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mSrlContent;
|
||||
@BindView(R2.id.pb_loading)
|
||||
ProgressBar mPbLoading;
|
||||
@BindView(R2.id.iv_empty_data)
|
||||
ImageView mIvEmptyData;
|
||||
@BindView(R2.id.tv_error_hint)
|
||||
TextView mTvErrorHint;
|
||||
@BindView(R2.id.ll_hint)
|
||||
LinearLayout mLlHint;
|
||||
|
||||
private List<WorkReportDetailBean> mDatas;
|
||||
private WorkReportAdapter mAdapter;
|
||||
private int mCurrentPage = 1;
|
||||
private String mKeywords = "";
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_work_reports;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("我的报告");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("新增报告");
|
||||
mTvPublish.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT_ADD)
|
||||
.navigation(mActivity, 12));
|
||||
mSrlContent.setOnRefreshListener(v -> doRefresh());
|
||||
mSrlContent.setOnLoadMoreListener(v -> doLoadMore());
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
refreshStateView(LionActions.STATE_LOAD);
|
||||
mDatas = new ArrayList<>();
|
||||
mAdapter = new WorkReportAdapter(mActivity, mDatas);
|
||||
mRlvContent.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvContent.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(workReportDetailBean -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT_DETAIL)
|
||||
.withString("id", workReportDetailBean.getWorkReportId())
|
||||
.navigation(mActivity, 12));
|
||||
doRefresh();
|
||||
}
|
||||
|
||||
private void doLoadMore() {
|
||||
getWorkReportList(mCurrentPage);
|
||||
}
|
||||
|
||||
private void doRefresh() {
|
||||
mDatas.clear();
|
||||
mAdapter.setData(mDatas);
|
||||
getWorkReportList(1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (RESULT_OK == resultCode) {
|
||||
if (requestCode == 12) {
|
||||
doRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getWorkReportList(int currentPage) {
|
||||
mCurrentPage = currentPage;
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getWorkReportList(mKeywords, mCurrentPage + "", UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<WorkReportListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull WorkReportListBean listBean) {
|
||||
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(listBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(listBean.getRows());
|
||||
}
|
||||
refreshStateView(LionActions.STATE_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mSrlContent.finishRefresh();
|
||||
if (mDatas.size() >= listBean.getTotal()) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
}
|
||||
} else {
|
||||
mSrlContent.finishRefresh();
|
||||
mSrlContent.finishLoadMore();
|
||||
if (currentPage > 1) {
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mKeywords)) {
|
||||
//无数据
|
||||
refreshStateView(LionActions.STATE_EMPTY);
|
||||
} else {
|
||||
refreshStateView(LionActions.STATE_EMPTY);
|
||||
ToastUtils.show("未查询到相关内容");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
refreshStateView(LionActions.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshStateView(int state) {
|
||||
switch (state) {
|
||||
case LionActions.STATE_LOAD:
|
||||
mRlvContent.setVisibility(View.GONE);
|
||||
mLlHint.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
mIvEmptyData.setVisibility(View.GONE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("加载中...");
|
||||
break;
|
||||
case LionActions.STATE_EMPTY:
|
||||
mRlvContent.setVisibility(View.GONE);
|
||||
mLlHint.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.VISIBLE);
|
||||
mIvEmptyData.setImageResource(R.drawable.ic_empty_data);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("暂无数据");
|
||||
break;
|
||||
case LionActions.STATE_ERROR:
|
||||
mRlvContent.setVisibility(View.GONE);
|
||||
mLlHint.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.VISIBLE);
|
||||
mIvEmptyData.setImageResource(R.drawable.ic_load_error);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("加载失败,请稍后重试");
|
||||
break;
|
||||
case LionActions.STATE_SUCCESS:
|
||||
mRlvContent.setVisibility(View.VISIBLE);
|
||||
mLlHint.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.tenlionsoft.oamodule.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportDetailBean;
|
||||
import com.tenlionsoft.oamodule.holder.WorkReportHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/19 - 15:12
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class WorkReportAdapter extends BaseRecyclerAdapter<WorkReportDetailBean, WorkReportHolder> {
|
||||
|
||||
public WorkReportAdapter(Context ctx, List<WorkReportDetailBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkReportHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_work_report, parent, false);
|
||||
return new WorkReportHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(WorkReportHolder h, int i) {
|
||||
h.mTvTitle.setText(mData.get(i).getReportTitle());
|
||||
h.mTvContent.setText(mData.get(i).getReportContent());
|
||||
h.mTvEgress.setText(mData.get(i).getReportEgress());
|
||||
switch (mData.get(i).getReportType()) {
|
||||
case "1":
|
||||
h.mTvType.setText("工作日报");
|
||||
break;
|
||||
case "2":
|
||||
h.mTvType.setText("工作周报");
|
||||
break;
|
||||
case "3":
|
||||
h.mTvType.setText("工作月报");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.tenlionsoft.oamodule.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/19 - 14:13
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class SaveRepectSuperviseBean {
|
||||
|
||||
private String content;
|
||||
private String overseeId;
|
||||
private String userId;
|
||||
private String userName;
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getOverseeId() {
|
||||
return overseeId;
|
||||
}
|
||||
|
||||
public void setOverseeId(String overseeId) {
|
||||
this.overseeId = overseeId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.tenlionsoft.oamodule.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/19 - 14:48
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class SaveWorkReportBean {
|
||||
|
||||
private String reportContent;
|
||||
private String reportEgress;
|
||||
private String reportFiles;
|
||||
private String reportTitle;
|
||||
private String reportType;
|
||||
|
||||
public String getReportContent() {
|
||||
return reportContent;
|
||||
}
|
||||
|
||||
public void setReportContent(String reportContent) {
|
||||
this.reportContent = reportContent;
|
||||
}
|
||||
|
||||
public String getReportEgress() {
|
||||
return reportEgress;
|
||||
}
|
||||
|
||||
public void setReportEgress(String reportEgress) {
|
||||
this.reportEgress = reportEgress;
|
||||
}
|
||||
|
||||
public String getReportFiles() {
|
||||
return reportFiles;
|
||||
}
|
||||
|
||||
public void setReportFiles(String reportFiles) {
|
||||
this.reportFiles = reportFiles;
|
||||
}
|
||||
|
||||
public String getReportTitle() {
|
||||
return reportTitle;
|
||||
}
|
||||
|
||||
public void setReportTitle(String reportTitle) {
|
||||
this.reportTitle = reportTitle;
|
||||
}
|
||||
|
||||
public String getReportType() {
|
||||
return reportType;
|
||||
}
|
||||
|
||||
public void setReportType(String reportType) {
|
||||
this.reportType = reportType;
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.tenlionsoft.oamodule.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/19 - 14:50
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class WorkReportDetailBean {
|
||||
|
||||
private String reportContent;
|
||||
private String reportEgress;
|
||||
private String reportFiles;
|
||||
private String reportTitle;
|
||||
private String reportType;
|
||||
private String workReportId;
|
||||
|
||||
public String getReportContent() {
|
||||
return reportContent;
|
||||
}
|
||||
|
||||
public void setReportContent(String reportContent) {
|
||||
this.reportContent = reportContent;
|
||||
}
|
||||
|
||||
public String getReportEgress() {
|
||||
return reportEgress;
|
||||
}
|
||||
|
||||
public void setReportEgress(String reportEgress) {
|
||||
this.reportEgress = reportEgress;
|
||||
}
|
||||
|
||||
public String getReportFiles() {
|
||||
return reportFiles;
|
||||
}
|
||||
|
||||
public void setReportFiles(String reportFiles) {
|
||||
this.reportFiles = reportFiles;
|
||||
}
|
||||
|
||||
public String getReportTitle() {
|
||||
return reportTitle;
|
||||
}
|
||||
|
||||
public void setReportTitle(String reportTitle) {
|
||||
this.reportTitle = reportTitle;
|
||||
}
|
||||
|
||||
public String getReportType() {
|
||||
return reportType;
|
||||
}
|
||||
|
||||
public void setReportType(String reportType) {
|
||||
this.reportType = reportType;
|
||||
}
|
||||
|
||||
public String getWorkReportId() {
|
||||
return workReportId;
|
||||
}
|
||||
|
||||
public void setWorkReportId(String workReportId) {
|
||||
this.workReportId = workReportId;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.tenlionsoft.oamodule.beans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/19 - 14:50
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class WorkReportListBean {
|
||||
|
||||
private int page;
|
||||
private int total;
|
||||
private List<WorkReportDetailBean> rows;
|
||||
|
||||
public int getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(int page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<WorkReportDetailBean> getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(List<WorkReportDetailBean> rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -2,17 +2,14 @@ package com.tenlionsoft.oamodule.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.provider.Settings;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
@ -85,7 +82,7 @@ public class OaMainFragment extends BaseFragment {
|
||||
|
||||
private List<FuncBean> mFuncBeans;
|
||||
private FunctionNumAdapter mAdapter;
|
||||
private ActivityResultLauncher<Intent> mLauncher;
|
||||
// private ActivityResultLauncher<Intent> mLauncher;
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
@ -100,6 +97,7 @@ public class OaMainFragment extends BaseFragment {
|
||||
setStateView(STATE_SUCCESS);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
|
||||
initContentView();
|
||||
|
||||
}
|
||||
@ -120,6 +118,8 @@ public class OaMainFragment extends BaseFragment {
|
||||
mRlvFuncs.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvFuncs.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::choosePage);
|
||||
mSrlContent.setEnableLoadMore(false);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -159,21 +159,6 @@ public class OaMainFragment extends BaseFragment {
|
||||
ARouter.getInstance()
|
||||
.build(path)
|
||||
.navigation();
|
||||
// TODO if ("文档中心".equals(funcBean.getText()) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
// if (Environment.isExternalStorageManager()) {
|
||||
// ARouter.getInstance()
|
||||
// .build(path)
|
||||
// .navigation();
|
||||
// } else {
|
||||
// ToastUtils.show("该功能需要SD卡管理权限,请授权");
|
||||
// Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
||||
// intent.setData(Uri.parse("package:" + mActivity.getPackageName()));
|
||||
// mLauncher.launch(intent);
|
||||
// }
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -181,19 +166,19 @@ public class OaMainFragment extends BaseFragment {
|
||||
public void onAttach(@NonNull @NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
mActivity = (BaseActivity) getActivity();
|
||||
mLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
|
||||
result -> {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
if (!Environment.isExternalStorageManager()) {
|
||||
//没有授权
|
||||
ToastUtils.show("该功能需要SD卡的管理权限,请前往设置进行授权.");
|
||||
} else {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_DOCUMENT)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
// mLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
|
||||
// result -> {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
// if (!Environment.isExternalStorageManager()) {
|
||||
// //没有授权
|
||||
// ToastUtils.show("该功能需要SD卡的管理权限,请前往设置进行授权.");
|
||||
// } else {
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_OA_ACTIVITY_DOCUMENT)
|
||||
// .navigation();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,35 @@
|
||||
package com.tenlionsoft.oamodule.holder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/19 - 15:10
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class WorkReportHolder extends RecyclerView.ViewHolder {
|
||||
@BindView(R2.id.tv_title)
|
||||
public TextView mTvTitle;
|
||||
@BindView(R2.id.tv_type)
|
||||
public TextView mTvType;
|
||||
@BindView(R2.id.tv_egress)
|
||||
public TextView mTvEgress;
|
||||
@BindView(R2.id.tv_content)
|
||||
public TextView mTvContent;
|
||||
|
||||
public WorkReportHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
ButterKnife.bind(this, itemView);
|
||||
}
|
||||
}
|
@ -23,6 +23,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.WorkReportDetailBean;
|
||||
import com.tenlionsoft.oamodule.beans.WorkReportListBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -349,9 +351,44 @@ public interface OAApi {
|
||||
* doSaveRepectSupervise
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "Content-Type: application/json", "Accept: application/json"})
|
||||
@PUT("app/routineworkuser/update/{routineWorkUserId}")
|
||||
Observable<BaseSuccessBean> doSaveRepectSupervise(@Path("routineWorkUserId") String id, @Body RequestBody body, @Header("token") String token);
|
||||
@PUT("app/overseeuser/update/{overseeUserId}")
|
||||
Observable<BaseSuccessBean> doSaveRepectSupervise(@Path("overseeUserId") String id, @Body RequestBody body, @Header("token") String token);
|
||||
|
||||
/*===========工作报告===========*/
|
||||
|
||||
/**
|
||||
* 新增工作报告
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "Content-Type: application/json", "Accept: application/json"})
|
||||
@POST("app/workreport/save")
|
||||
Observable<BaseSuccessBean> doSaveWorkReport(@Body RequestBody body, @Header("token") String token);
|
||||
|
||||
|
||||
/**
|
||||
* 工作报告列表
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/workreport/listpage-me")
|
||||
Observable<WorkReportListBean> getWorkReportList(@Query("keywords") String key, @Query("page") String page, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 工作报告详情
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/workreport/get/{workReportId}")
|
||||
Observable<WorkReportDetailBean> getWorkReportDetail(@Path("workReportId") String id, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 修改工作报告
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "Content-Type: application/json", "Accept: application/json"})
|
||||
@PUT("app/workreport/update/{workReportId}")
|
||||
Observable<BaseSuccessBean> doEditWorkReport(@Path("workReportId") String id, @Body RequestBody body, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 删除工作报告
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "Content-Type: application/json", "Accept: application/json"})
|
||||
@DELETE("app/workreport/remove/{ids}")
|
||||
Observable<BaseSuccessBean> doDelWorkReport(@Path("ids") String id, @Header("token") String token);
|
||||
}
|
||||
|
207
oamodule/src/main/res/layout/activity_add_work_reports.xml
Normal file
207
oamodule/src/main/res/layout/activity_add_work_reports.xml
Normal file
@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.car.ByCarAddActivity">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_f0"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报标题"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="请输入上报标题"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报类型"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_right"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="请选择上报类型"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="外出情况"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_out"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="left"
|
||||
android:hint="请输入外出情况"
|
||||
android:minLines="3"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="工作内容"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="left"
|
||||
android:hint="请输入工作内容"
|
||||
android:minLines="3"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报附件"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_files"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:itemCount="3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="保存" />
|
||||
</RelativeLayout>
|
207
oamodule/src/main/res/layout/activity_edit_work_report.xml
Normal file
207
oamodule/src/main/res/layout/activity_edit_work_report.xml
Normal file
@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.car.ByCarAddActivity">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_f0"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报标题"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="请输入上报标题"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报类型"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_right"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="请选择上报类型"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="外出情况"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_out"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="left"
|
||||
android:hint="请输入外出情况"
|
||||
android:minLines="3"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="工作内容"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="left"
|
||||
android:hint="请输入工作内容"
|
||||
android:minLines="3"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报附件"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_files"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:itemCount="3" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="保存" />
|
||||
</RelativeLayout>
|
228
oamodule/src/main/res/layout/activity_work_report_detail.xml
Normal file
228
oamodule/src/main/res/layout/activity_work_report_detail.xml
Normal file
@ -0,0 +1,228 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.car.ByCarAddActivity">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_f0"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报标题"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报类型"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="外出情况"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_out"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="left"
|
||||
android:hint="无"
|
||||
android:minLines="3"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="工作内容"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="left"
|
||||
android:hint="未录入"
|
||||
android:minLines="3"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout style="@style/item_ver">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="上报附件"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_files"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:itemCount="3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_file_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="20dp"
|
||||
android:text="未上传" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_del"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="删除" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_edit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="编辑" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
58
oamodule/src/main/res/layout/activity_work_reports.xml
Normal file
58
oamodule/src/main/res/layout/activity_work_reports.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_bg"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.meeting.MeetingCenterActivity">
|
||||
|
||||
<include layout="@layout/layout_base_search_cancel" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty_data"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_error_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/black"
|
||||
tools:text="加载数据失败" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
31
oamodule/src/main/res/layout/item_work_report.xml
Normal file
31
oamodule/src/main/res/layout/item_work_report.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="3dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:padding="3dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="上报标题" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_egress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user