提交 6dbbeef7 authored 作者: lgd's avatar lgd

1.消息

2.//TODO erp用户是否选择新部门为空,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,权限,坩埚下单,mes,刷新token
上级 5a06e8c6
......@@ -1151,6 +1151,22 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.NoticeActivity"
android:configChanges="keyboardHidden|orientation"
android:label="通知"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.NoticeDetailActivity"
android:configChanges="keyboardHidden|orientation"
android:label="通知详情"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......
......@@ -4,6 +4,7 @@ import android.app.Application;
import com.scwang.smartrefresh.header.BezierCircleHeader;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.tencent.bugly.crashreport.CrashReport;
import com.wd.workoffice.R;
import com.wd.workoffice.retrofit.ApiService;
import com.wd.workoffice.util.UserKeeper;
......@@ -28,7 +29,7 @@ public class WorkApp extends BaseApp {
public void onCreate() {
super.onCreate();
instance = this;
// CrashReport.initCrashReport(getApplicationContext(), "30556bd145", false);
CrashReport.initCrashReport(getApplicationContext(), "8081eafad1", false);
Utils.init(this);
// daoInit();
AutoSizeConfig.getInstance().setCustomFragment(true);
......
......@@ -1581,4 +1581,22 @@ public interface ApiService {
*/
@GET("/biz-approval/by-me")
Observable<BaseBean> bizMeApproval(@QueryMap Map<String, Object> param);
/**
* 分页查询公告信息
*
* @return
*/
@GET("/back/noticeAnnounce/page")
Observable<BaseBean> notice(@QueryMap Map<String, Object> param);
/**
* 获取单条公告内容
*
* @return
*/
@GET("/back/noticeAnnounce/{id}")
Observable<BaseBean> noticeDetail(@Path("id") String id);
}
package com.wd.workoffice.ui.activity;
import android.view.View;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.MsgBean;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.NoticeAdapter;
import com.wd.workoffice.ui.adapter.WorkProPriceAdapter;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class NoticeActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private Map<String, Object> param;
private List<MsgBean.RecordsBean> dataList;
private NoticeAdapter dataAdapter;
private int page = 1;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new NoticeAdapter(R.layout.item_notice, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content,rvData);
param = WorkUtils.pageKey();
// param.put("productId", getIntent().getStringExtra("id"));
param.put("current", page);
getData();
}
private void getData() {
RtfUtils.getRtf().notice(param).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
List<MsgBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), MsgBean.class).getRecords();
if (page == 1) {
srlRefresh.finishRefresh();
dataList.clear();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
dataAdapter.loadMoreComplete();
} else {
dataAdapter.loadMoreComplete();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
}
if (getList.size() == 0) {
dataAdapter.loadMoreEnd();
} else {
page++;
}
}
});
}
@Override
protected void initEvent() {
srlRefresh.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
param.put("current", page);
getData();
}
});
dataAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvData);
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(NoticeDetailActivity.class,"id",dataList.get(position).getId()+"");
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_pro_price;
}
}
package com.wd.workoffice.ui.activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.Config;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.MsgBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.UserKeeper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import flexible.xd.android_base.utils.LogUtils;
import io.reactivex.disposables.Disposable;
/**
* Created by flexible on 2016/8/21 0021.
*/
public class NoticeDetailActivity extends WorkToolBarActivity {
@BindView(R.id.wv_content)
WebView wvContent;
private boolean loadingFinished;
private boolean redirect;
@Override
protected void initView() {
ButterKnife.bind(this);
WebSettings wSet = wvContent.getSettings();
wSet.setJavaScriptEnabled(true);
wSet.setDomStorageEnabled(true);
// wSet.setAllowFileAccess(true);
// wSet.setAppCacheEnabled(true);
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// WebView.setWebContentsDebuggingEnabled(true);
//
// android.webkit.WebView.setWebContentsDebuggingEnabled(true);
//
// }
// wvContent.setWebChromeClient(new WebChromeClient() {
//
// @Override
// public void onProgressChanged(WebView webView, int i) {
//
// if (i == 100) {
// Map<String, Object> param = new HashMap<>();
// param.put("token", UserKeeper.getInstance().getToken());
// wvContent.loadUrl("javascript:postToken(" + JSON.toJSONString(param) + ")");
// }
// super.onProgressChanged(webView, i);
// }
// });
wvContent.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String urlNewString) {
if (!loadingFinished) {
redirect = true;
}
loadingFinished = false;
LogUtils.LOGE("bb", urlNewString);
String tag="tel";
if (urlNewString.contains(tag)) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(urlNewString));
startActivity(intent);
//这个超连接,java已经处理了,webview不要处理了
return true;
}
wvContent.loadUrl(urlNewString);
return true;
}
@Override
public void onPageStarted(WebView webView, String s, Bitmap bitmap) {
super.onPageStarted(webView, s, bitmap);
loadingFinished = false;
}
@Override
public void onPageFinished(WebView view, String url) {
// wvContent.addJavascriptInterface(this, "android");
if (!redirect) {
loadingFinished = true;
}
if (loadingFinished && !redirect) {
//HIDE LOADING IT HAS FINISHED
Map<String, Object> param = new HashMap<>();
param.put("token", UserKeeper.getInstance().getToken());
wvContent.loadUrl("javascript:postToken(" + JSON.toJSONString(param) + ")");
} else {
redirect = false;
}
}
});
// wvContent.setWebViewClient(new WebViewClient() {
// public boolean shouldOverrideUrlLoading(WebView view, String url) { // 重写此方法表明点击网页里面的链接还是在当前的webview里跳转,不跳到浏览器那边
// view.loadUrl(url);
// return true;
// }
//
// @Override
// public void onPageFinished(WebView view, String url) {
// Map<String, Object> param = new HashMap<>();
// param.put("token", UserKeeper.getInstance().getToken());
// wvContent.loadUrl("javascript:postToken(" + JSON.toJSONString(param) + ")");
// super.onPageFinished(view, url);
// }
// });
}
private void getData() {
RtfUtils.getRtf().noticeDetail(getIntent().getStringExtra("id")).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
JSONObject dataBean = JSON.parseObject(data.getData().toString());
wvContent.loadData(dataBean.getString("content"), "text/html", "utf-8");
}
});
}
@Override
protected void initData() {
getData();
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_webview;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if (wvContent.canGoBack()) {
wvContent.goBack();
return true;
}
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
//这是一个监听用的按键的方法,keyCode 监听用户的动作,如果是按了返回键,同时Webview要返回的话,WebView执行回退操作,因为mWebView.canGoBack()返回的是一个Boolean类型,所以我们把它返回为true
if (keyCode == KeyEvent.KEYCODE_BACK && wvContent.canGoBack()) {
wvContent.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.MsgBean;
import com.wd.workoffice.bean.ProPriceBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class NoticeAdapter extends BaseQuickAdapter<MsgBean.RecordsBean, BaseViewHolder> {
public NoticeAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, MsgBean.RecordsBean item) {
helper.setText(R.id.tv_name,item.getTitle());
}
}
......@@ -3,37 +3,40 @@ package com.wd.workoffice.ui.fg;
import android.view.View;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.MsgBean;
import com.wd.workoffice.bean.vo.BatLayoutVo;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.NoticeActivity;
import com.wd.workoffice.ui.activity.bat.approval.ApprovalFromMeActivity;
import com.wd.workoffice.ui.activity.bat.approval.ApprovalToMeActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleCrucibleOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleProductOrderActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreFinancialActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkInStockActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreCrucibleActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreOutsourcingActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreSupplierActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreTradingActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductInsideOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductOutOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductSaleOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductSupplierOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleCrucibleOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleInsideOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleOutOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleProductOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleSaleOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleSupplierOrderActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreCrucibleActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreFinancialActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreOutsourcingActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreSupplierActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreTradingActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkAccountActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkContactsActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkDepActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkFinancialActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkInStockActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkProActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkWarehouseActivity;
import com.wd.workoffice.ui.adapter.BatLayoutAdapter;
......@@ -42,11 +45,13 @@ import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
......@@ -88,6 +93,10 @@ public class MainFragment extends WorkBaseFg {
String[] workName = new String[]{"产品", "往来", "部门账户", "仓库", "部门", "财务中心", "设备", "报表", "库存类别"};
int[] productImg = new int[]{R.mipmap.bat_product1, R.mipmap.bat_product2, R.mipmap.bat_product3, R.mipmap.bat_product4, R.mipmap.bat_product5, R.mipmap.bat_product6};
String[] productName = new String[]{"销售订单", "外采购订单", "供应订单", "内部订单", "组装订单", "坩埚订单"};
@BindView(R.id.tv_more)
TextView tvMore;
@BindView(R.id.tv_notice)
TextView tvNotice;
@Override
protected void initView() {
......@@ -131,6 +140,33 @@ public class MainFragment extends WorkBaseFg {
UserKeeper.getInstance().keepUserInfo(data.getData().toString());
}
});
Map<String, Object> param = WorkUtils.pageKey();
RtfUtils.getRtf().notice(param).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
List<MsgBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), MsgBean.class).getRecords();
if (getList != null && getList.size() != 0) {
MsgBean.RecordsBean recordsBean = getList.get(0);
tvNotice.setText(recordsBean.getTitle());
}
}
});
}
......@@ -294,7 +330,7 @@ public class MainFragment extends WorkBaseFg {
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch (position) {
case 0:
startActivity(ApprovalToMeActivity .class);
startActivity(ApprovalToMeActivity.class);
break;
case 1:
startActivity(ApprovalFromMeActivity.class);
......@@ -305,4 +341,9 @@ public class MainFragment extends WorkBaseFg {
break;
}
}
@OnClick(R.id.tv_more)
public void onViewClicked() {
startActivity(NoticeActivity.class);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/ll_web"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/wv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
\ No newline at end of file
......@@ -62,6 +62,7 @@
android:textStyle="bold" />
<TextView
android:id="@+id/tv_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
......@@ -94,10 +95,10 @@
android:background="@drawable/shape_circle" />
<TextView
android:id="@+id/tv_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="36mm"
android:text="关于元旦假期安排的通知。"
android:textColor="#333333" />
</RelativeLayout>
......
<?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:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="部门名称"
android:textSize="14sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
<View style="@style/dividerX" />
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论