知识库部门黄页

This commit is contained in:
高健 2021-11-10 09:30:37 +08:00
parent 36bb5cfd8a
commit d777a73776
51 changed files with 1617 additions and 468 deletions

View File

@ -99,5 +99,6 @@ dependencies {
// api 'com.github.promeg:tinypinyin-lexicons-android-cncity:2.0.3' // Android的中国地区词典
// api 'com.github.promeg:tinypinyin-lexicons-java-cncity:2.0.3' // Java的中国地区词典
api "com.github.hackware1993:MagicIndicator:${rootProject.ext.magicIndicator}" // for androidx
api 'com.google.android:flexbox:1.0.0'//flexbox
}

View File

@ -141,6 +141,8 @@ public class PathConfig {
public static final String DIC_DANGER_TYPE = "c15f10cf-0e92-46b9-b5ba-98f6ebc1701e";//安全隐患类型
public static final String DIC_ENTERPRISE_TYPE = "5b50ab4c-70b1-47e8-a3a7-ab279f73b87d";//企业类型
public static final String DIC_CAR_TYPE = "8e696099-0bda-4f29-9c60-9449a8c89bf5";//车辆类型
public static final String DIC_KNOW_LIB_TYPE = "f4e6212e-55d1-41a8-a217-1a2874fe2cb1";//知识库
//=============================主页按钮模块类型===========================
public static final String MODULE_CALL = "call";
public static final String MODULE_PRISON = "prison";
@ -314,7 +316,7 @@ public class PathConfig {
public static final String PATH_MODULE_PLAYER_SIMPLE_VIDEO = "/moduleplayer/activity/simpleplayer";//单纯播放器
/*============================公共模块=============================*/
public static final String PATH_MODULE_COMMON_ACTIVITY_CHECK_WORK = "/modulecommon/activity/checkwork";//考勤
public static final String PATH_MODULE_COMMON_ACTIVITY_ATTENDANCE = "/modulecommon/activity/attendance";//考勤
public static final String PATH_MODULE_COMMON_DEMO = "/modulecommon/activity/mapdemo";//地图测试
public static final String PATH_MODULE_COMMON_ACTIVITY_USER_CENTER = "/modulecommon/activity/userCenter";//用户中心activity
public static final String PATH_MODULE_COMMON_FRAGMENT_USER_CENTER = "/modulecommon/fragment/userCenter";//用户中心fragment
@ -337,7 +339,9 @@ public class PathConfig {
public static final String PATH_MODULE_COMMON_ACTIVITY_INCIDENT_CHECK_DETAIL = "/modulecommon/activity/incidentCheckDetail";//事件核查详情
public static final String PATH_MODULE_COMMON_ACTIVITY_STATISTICS = "/modulecommon/activity/statistics";//统计分析
public static final String PATH_MODULE_COMMON_ACTIVITY_GRID_STATISTICS = "/modulecommon/activity/gridStatistics";//统计分析
public static final String PATH_MODULE_COMMON_ACTIVITY_DEPT_STATISTICS = "/modulecommon/activity/deptStatistics";//统计分析
public static final String PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS = "/modulecommon/activity/commandStatistics";//统计分析
public static final String PATH_MODULE_COMMON_ACTIVITY_KNOWLEDGE_LIBRARY_LIST = "/modulecommon/activity/knowledgeList";//知识库列表
public static final String PATH_MODULE_COMMON_ACTIVITY_KNOWLEDGE_LIBRARY_DETAIL = "/modulecommon/activity/knowledgeDetail";//知识详情
@ -349,6 +353,8 @@ public class PathConfig {
public static final String PATH_MODULE_COMMON_ACTIVITY_INCIDENT_RETURN_RECORD_ADD = "/modulecommon/activity/returnRecordIncidentAdd";//添加回访记录
public static final String PATH_MODULE_COMMON_ACTIVITY_SEL_GRID = "/modulecommon/activity/chooseGrid";//网格选取
public static final String PATH_MODULE_COMMON_FRAGMENT_KNOW_LEDGE_LIST = "/modulecommon/fragment/knowLedgeList";//知识库列表
public static final String PATH_MODULE_COMMON_FRAGMENT_KNOW_LEDGE_LIST_BY_DEPT = "/modulecommon/fragment/knowLedgeListByDept";//部门黄页
/*======================网格员==================================================*/
//小区

View File

@ -9,7 +9,7 @@ import com.tenlionsoft.baselib.constant.PathConfig;
*/
public class BaseUrlApi {
public static final String IP = "http://192.168.0.103:7011/";/* 测试IP */
public static final String IP = "http://49.233.36.36:58091/";/* 测试IP */
public static final String SYS_USERCENTER = "usercenter/";
public static final String SYS_POPULATION = "population/";/*人口系统*/
public static final String SYS_CASE = "case/";/*事件部件*/
@ -17,7 +17,7 @@ public class BaseUrlApi {
public static final String SYS_SECURITY = "systembase/";/*社会治安*/
public static final String SYS_TASK = "systemtask/";/*任务系统*/
public static final String SYS_LIBRARY = "library/";/*知识库系统*/
public static final String TEMP_IP = "http://192.168.0.103:8080/";
public static final String TEMP_IP = "http://192.168.0.109:9000/";
public static final String BASE_MAIN_IP = IP + SYS_USERCENTER;
public static final String BASE_CASE_IP = IP + SYS_CASE;

View File

@ -111,7 +111,7 @@ public abstract class BaseActivity extends AppCompatActivity {
private AnimatorSet mAnimatorSet = new AnimatorSet();
protected ImageView mIvClearSearch;
protected TextView mTvOptions;
private AfxTextView mTvSearchBack;
protected AfxTextView mTvSearchBack;
private boolean mIsExpand;//搜索框是否展开
@Override

View File

@ -23,6 +23,7 @@ public abstract class BaseFragment extends Fragment {
public static final int STATE_ERROR = 1235;//加载失败
public static final int STATE_SUCCESS = 1236;//加载成功
public static final int STATE_EMPTY = 1237;//无数据
public static final int STATE_SEARCH_EMPTY = 1238;//没有搜索到数据
FrameLayout mFlContent;
TextView mTvFragmentErrorHint;
ProgressBar mPbFragmentLoading;
@ -130,6 +131,16 @@ public abstract class BaseFragment extends Fragment {
mTvFragmentErrorHint.setText("加载中...");
mSrlView.setEnableLoadMore(false);
mSrlView.setEnableRefresh(false);
break;
case STATE_SEARCH_EMPTY:
mLlHintView.setVisibility(View.VISIBLE);
mPbFragmentLoading.setVisibility(View.GONE);
mIvFragmentEmptyData.setVisibility(View.VISIBLE);
mTvFragmentErrorHint.setText("未搜索到数据");
mDataView.setVisibility(View.GONE);
mSrlView.setEnableLoadMore(true);
mSrlView.setEnableRefresh(true);
break;
default:
break;
}
@ -142,7 +153,7 @@ public abstract class BaseFragment extends Fragment {
/**
* 刷新视图
*/
public void refreshContentView(String data) {
public void refreshContentView(String... data) {
}

View File

@ -0,0 +1,55 @@
package com.tenlionsoft.baselib.core.widget.base;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tenlionsoft.baselib.R;
import com.tenlionsoft.baselib.core.beans.ConditionBean;
import com.tenlionsoft.baselib.core.beans.DicBean;
import java.util.ArrayList;
import java.util.List;
/**
* 作者: adam
* 日期: 2021/10/20 - 11:18 上午
* 邮箱: itgaojian@163.com
* 描述:
*/
public class ConditionDicAdapter extends BaseRecyclerAdapter<DicBean, ConditionHolder> {
public List<DicBean> mSelBeans = new ArrayList<>();
public ConditionDicAdapter(Context ctx, List<DicBean> list) {
super(ctx, list);
}
@Override
public ConditionHolder createHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.item_condition_dic_sel, parent, false);
return new ConditionHolder(view);
}
@Override
public void bindHolder(ConditionHolder holder, int i) {
DicBean bean = mData.get(i);
holder.mTvName.setText(bean.getDataName());
holder.mCbCheck.setOnCheckedChangeListener(null);
holder.mTvName.setTextColor(bean.isCheck() ? Color.parseColor("#1296db") : Color.BLACK);
holder.mCbCheck.setChecked(bean.isCheck());
holder.mCbCheck.setOnCheckedChangeListener((buttonView, isChecked) -> mLis.onItemCheckChange(bean, isChecked, i));
holder.itemView.setOnClickListener(v -> mLis.onItemCheckChange(bean, !bean.isCheck(), i));
}
private OnItemCheckChange mLis;
public void addOnitemCheckChange(OnItemCheckChange lis) {
this.mLis = lis;
}
public interface OnItemCheckChange {
void onItemCheckChange(DicBean bean, boolean isCheck, int pos);
}
}

View File

@ -39,7 +39,7 @@ public class ViewPageNavigatorAdapter extends CommonNavigatorAdapter {
public IPagerTitleView getTitleView(Context context, int index) {
ColorTransitionPagerTitleView cView = new ColorTransitionPagerTitleView(context);
cView.setNormalColor(Color.GRAY);
cView.setSelectedColor(Color.BLUE);
cView.setSelectedColor(Color.parseColor("#1189FF"));
cView.setText(mTitles.get(index));
cView.setOnClickListener(v -> mVp.setCurrentItem(index));
return cView;
@ -49,7 +49,7 @@ public class ViewPageNavigatorAdapter extends CommonNavigatorAdapter {
public IPagerIndicator getIndicator(Context context) {
LinePagerIndicator indicator = new LinePagerIndicator(context);
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
indicator.setColors(Color.BLUE);
indicator.setColors(Color.parseColor("#1189FF"));
return indicator;
}
}

View File

@ -0,0 +1,110 @@
package com.tenlionsoft.baselib.core.widget.views;
import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.TranslateAnimation;
import com.google.android.flexbox.FlexDirection;
import com.google.android.flexbox.FlexWrap;
import com.google.android.flexbox.FlexboxLayoutManager;
import com.tenlionsoft.baselib.R;
import com.tenlionsoft.baselib.core.beans.ConditionBean;
import com.tenlionsoft.baselib.core.beans.DicBean;
import com.tenlionsoft.baselib.core.widget.base.ConditionAdapter;
import com.tenlionsoft.baselib.core.widget.base.ConditionDicAdapter;
import java.util.ArrayList;
import java.util.List;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import razerdp.basepopup.BasePopupWindow;
import razerdp.util.animation.AnimationHelper;
import razerdp.util.animation.TranslationConfig;
/**
* 作者: adam
* 日期: 2021/9/30 - 2:58 下午
* 邮箱: itgaojian@163.com
* 描述: 条件选择
*/
public class ConditionDicPopup extends BasePopupWindow {
private ConditionDicAdapter mAdapter;
private List<DicBean> mDatas;
public ConditionDicPopup(Context context, List<DicBean> datas) {
super(context);
View view = createPopupById(R.layout.popup_condition_match_layout);
RecyclerView rlvCondition = view.findViewById(R.id.rlv_conditions);
if (datas == null) {
mDatas = new ArrayList<>();
} else {
mDatas = datas;
}
mAdapter = new ConditionDicAdapter(context, mDatas);
FlexboxLayoutManager manage = new FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP) {
@Override
public boolean canScrollHorizontally() {
return false;
}
};
rlvCondition.setLayoutManager(manage);
rlvCondition.setAdapter(mAdapter);
setContentView(view);
setShowAnimation(createShowAnim());
setDismissAnimation(createDismissAnim());
setBackgroundColor(Color.parseColor("#11000000"));
setPopupGravity(Gravity.BOTTOM | Gravity.CENTER);
mAdapter.addOnitemCheckChange((bean, isCheck, pos) -> {
if (isCheck) {
mAdapter.mSelBeans.clear();
mAdapter.mSelBeans.add(bean);
} else {
mAdapter.mSelBeans.remove(bean);
}
bean.setCheck(isCheck);
mChangeListener.onChecked(bean, isCheck);
if (isCheck) {
if (true) {
for (int i = 0; i < mAdapter.getData().size(); i++) {
if (!mAdapter.getData().get(i).getDataId().equals(bean.getDataId())) {
mAdapter.getData().get(i).setCheck(false);
}
}
}
}
mAdapter.notifyDataSetChanged();
});
}
private Animation createDismissAnim() {
Animation animation = AnimationHelper.asAnimation().withTranslation(TranslationConfig.TO_TOP).toDismiss();
animation.setDuration(300);
animation.setInterpolator(new DecelerateInterpolator());
return animation;
}
private Animation createShowAnim() {
Animation animation = AnimationHelper.asAnimation()
.withTranslation(TranslationConfig.FROM_TOP)
.toShow();
animation.setDuration(300);
animation.setInterpolator(new DecelerateInterpolator());
return animation;
}
private OnCheckChangeListener mChangeListener;
public void addOnCheckChange(OnCheckChangeListener listener) {
this.mChangeListener = listener;
}
public interface OnCheckChangeListener {
void onChecked(DicBean bean, boolean ischeck);
}
}

View File

@ -52,10 +52,15 @@ public class UIUtil {
return dialog;
}
public interface ViewPageSelectListener {
void onPageSelect();
}
/**
* viewPage2与magicIn绑定
*/
public static void bindViewPager2(MagicIndicator mi, ViewPager2 vp) {
public static void bindViewPager2(MagicIndicator mi, ViewPager2 vp, ViewPageSelectListener listener) {
vp.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
@ -67,6 +72,9 @@ public class UIUtil {
public void onPageSelected(int position) {
super.onPageSelected(position);
mi.onPageSelected(position);
if (listener != null) {
listener.onPageSelect();
}
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/gray_df"
android:dashWidth="5dp"
android:dashGap="5dp" />
</shape>

View File

@ -4,6 +4,6 @@
<corners android:radius="5dp" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:width="2dp"
android:color="@color/gray_line" />
</shape>

View File

@ -63,7 +63,7 @@
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:visibility="gone">
tools:visibility="visible">
<RelativeLayout
android:layout_width="wrap_content"
@ -77,7 +77,7 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_cir_down_white"
android:drawableRight="@drawable/ic_arrow_cir_down_white_16"
android:drawablePadding="5dp"
android:focusable="true"
android:maxLength="8"

View File

@ -0,0 +1,33 @@
<?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="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rectangle_gray_border"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black"
android:textSize="15sp"
tools:text="测试" />
<CheckBox
android:id="@+id/cb_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:button="@drawable/sel_check_item_hook"
tools:checked="true" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,14 @@
<?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="150dp"
android:background="@drawable/shp_bottom_shadow_white"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_conditions"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp" />
</LinearLayout>

View File

@ -80,7 +80,7 @@ public class AddressListActivity extends BaseActivity {
commonNavigator.setAdapter(new ViewPageNavigatorAdapter(this, mTitles, mVpContent));
commonNavigator.setAdjustMode(true);
mMiTabs.setNavigator(commonNavigator);
UIUtil.bindViewPager2(mMiTabs, mVpContent);
UIUtil.bindViewPager2(mMiTabs, mVpContent,null);
}
@Override

View File

@ -3,6 +3,8 @@
package="com.tengshisoft.commonmodule">
<application>
<activity android:name=".activitys.logs.StatisticsCommandActivity"></activity>
<activity android:name=".activitys.logs.StatisticsDeptActivity" />
<activity
android:name=".activitys.department.ChooseGridActivity"
android:launchMode="singleTop"
@ -56,7 +58,7 @@
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".activitys.logs.StatisticsActivity"
android:name=".activitys.logs.StatisticsGridActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
@ -81,7 +83,7 @@
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".activitys.checkwork.CheckWorkActivity"
android:name=".activitys.checkwork.AttendanceActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />

View File

@ -86,7 +86,7 @@ public class MineCollectActivity extends BaseActivity {
commonNavigator.setAdapter(new ViewPageNavigatorAdapter(this, mTitles, mVpContent));
commonNavigator.setAdjustMode(true);
mMiTabs.setNavigator(commonNavigator);
UIUtil.bindViewPager2(mMiTabs, mVpContent);
UIUtil.bindViewPager2(mMiTabs, mVpContent,null);
}
private class VpRecordAdapter extends FragmentStateAdapter {

View File

@ -27,12 +27,17 @@ import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.MyLocationData;
import com.baidu.mapapi.map.TextureMapView;
import com.baidu.mapapi.model.LatLng;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.tenlionsoft.baselib.constant.PathConfig;
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
import com.tenlionsoft.baselib.utils.GpsUtils;
import com.tenlionsoft.baselib.utils.TimeUtils;
import com.tengshisoft.commonmodule.R;
import com.tengshisoft.commonmodule.R2;
import com.tenlionsoft.baselib.utils.UserLgUtils;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -54,8 +59,8 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
* 邮箱: itgaojian@163.com
* 描述: 考勤打卡
*/
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_CHECK_WORK)
public class CheckWorkActivity extends BaseActivity {
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_ATTENDANCE)
public class AttendanceActivity extends BaseActivity {
@BindView(R2.id.nsv_content)
NestedScrollView mNsvContent;
@BindView(R2.id.tmv_map)
@ -86,7 +91,7 @@ public class CheckWorkActivity extends BaseActivity {
@Override
protected int setLayoutId() {
return R.layout.activity_check_work;
return R.layout.activity_attendance;
}
@Override
@ -113,6 +118,15 @@ public class CheckWorkActivity extends BaseActivity {
setCurrentTime();
initMap();
mTvCurLocation.setText("正在定位中...");
mTvUserName.setText(UserLgUtils.getName());
mTvDepartment.setText(UserLgUtils.getUserName());
Glide.with(mActivity)
.load(BaseUrlApi.BASE_IMG_URL + UserLgUtils.getAvatar())
.apply(RequestOptions.bitmapTransform(new CircleCrop())
.error(R.drawable.ic_user_default)
.placeholder(R.drawable.ic_user_default))
.into(mIvUserIcon);
//判断GPS是否打开
boolean oPen = GpsUtils.isOPen(mActivity);
if (!oPen) {
@ -125,16 +139,16 @@ public class CheckWorkActivity extends BaseActivity {
*/
private void showGPSOpen() {
new AlertDialog.Builder(mActivity)
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle("提示")
.setMessage("签到需要定位信息,请前往设置打开系统定位开关")
.setNegativeButton(R.string.cancel, null)
.setPositiveButton("确定", (dialogInterface, i) -> {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
dialogInterface.dismiss();
})
.show();
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle("提示")
.setMessage("签到需要定位信息,请前往设置打开系统定位开关")
.setNegativeButton(R.string.cancel, null)
.setPositiveButton("确定", (dialogInterface, i) -> {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
dialogInterface.dismiss();
})
.show();
}
/**
@ -180,32 +194,32 @@ public class CheckWorkActivity extends BaseActivity {
*/
private void setCurrentTime() {
Observable.interval(1000, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Long>() {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Long>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
mTimeDisposable = d;
}
@Override
public void onSubscribe(@NonNull Disposable d) {
mTimeDisposable = d;
}
@Override
public void onNext(@NonNull Long aLong) {
String curTime = TimeUtils.getCurTime();
mTvCurTime.setText(curTime);
}
@Override
public void onNext(@NonNull Long aLong) {
String curTime = TimeUtils.getCurTime();
mTvCurTime.setText(curTime);
}
@Override
public void onError(@NonNull Throwable e) {
@Override
public void onError(@NonNull Throwable e) {
}
}
@Override
public void onComplete() {
@Override
public void onComplete() {
}
});
}
});
}
private void registerLocationReceiver() {
@ -237,10 +251,10 @@ public class CheckWorkActivity extends BaseActivity {
mBitMap = BitmapDescriptorFactory.fromResource(R.drawable.ic_map_location_marker);
}
MarkerOptions markerOptions = new MarkerOptions()
.position(new LatLng(mCurLocation.getLatitude(), mCurLocation.getLongitude()))//mark出现的位置
.icon(mBitMap) //mark图标
.draggable(false)//mark可拖拽
.animateType(MarkerOptions.MarkerAnimateType.none);
.position(new LatLng(mCurLocation.getLatitude(), mCurLocation.getLongitude()))//mark出现的位置
.icon(mBitMap) //mark图标
.draggable(false)//mark可拖拽
.animateType(MarkerOptions.MarkerAnimateType.none);
mBaiduMap.addOverlay(markerOptions);
}
@ -256,11 +270,11 @@ public class CheckWorkActivity extends BaseActivity {
String addrStr = mCurLocation.getAddrStr();
mTvCurLocation.setText(addrStr);
MyLocationData locData = new MyLocationData.Builder()
.accuracy(mCurLocation.getRadius())
.direction(mCurLocation.getDirection())
.latitude(mCurLocation.getLatitude())
.longitude(mCurLocation.getLongitude())
.build();
.accuracy(mCurLocation.getRadius())
.direction(mCurLocation.getDirection())
.latitude(mCurLocation.getLatitude())
.longitude(mCurLocation.getLongitude())
.build();
mBaiduMap.setMyLocationData(locData);
}
@ -274,10 +288,10 @@ public class CheckWorkActivity extends BaseActivity {
mBitMap = BitmapDescriptorFactory.fromResource(R.drawable.ic_map_location_marker);
}
MarkerOptions markerOptions = new MarkerOptions()
.position(new LatLng(mCurLocation.getLatitude(), mCurLocation.getLongitude()))//mark出现的位置
.icon(mBitMap) //mark图标
.draggable(false)//mark可拖拽
.animateType(MarkerOptions.MarkerAnimateType.none);
.position(new LatLng(mCurLocation.getLatitude(), mCurLocation.getLongitude()))//mark出现的位置
.icon(mBitMap) //mark图标
.draggable(false)//mark可拖拽
.animateType(MarkerOptions.MarkerAnimateType.none);
mBaiduMap.addOverlay(markerOptions);
// View view = View.inflate(this, R.layout.item_mark_user, null);
// BitmapDescriptor markIcon = BitmapDescriptorFactory.fromView(view);

View File

@ -0,0 +1,36 @@
package com.tengshisoft.commonmodule.activitys.logs;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.tengshisoft.commonmodule.R;
import com.tenlionsoft.baselib.constant.PathConfig;
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
/**
* 作者: Adam
* 日期: 2021年11月09日16:55:44
* 邮箱: itgaojian@163.com
* 描述: 统计---中心端
*/
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS)
public class StatisticsCommandActivity extends BaseActivity {
@Override
protected int setLayoutId() {
return R.layout.activity_statistics_command;
}
@Override
public void initData() {
}
@Override
protected void doSearchByTitle() {
}
@Override
protected void clearSearch() {
}
}

View File

@ -0,0 +1,37 @@
package com.tengshisoft.commonmodule.activitys.logs;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.tengshisoft.commonmodule.R;
import com.tenlionsoft.baselib.constant.PathConfig;
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
/**
* 作者: Adam
* 日期: 2021年11月09日16:57:00
* 邮箱: itgaojian@163.com
* 描述: 统计---部门端
*/
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_DEPT_STATISTICS)
public class StatisticsDeptActivity extends BaseActivity {
@Override
protected int setLayoutId() {
return R.layout.activity_statistics_dept;
}
@Override
public void initData() {
}
@Override
protected void doSearchByTitle() {
}
@Override
protected void clearSearch() {
}
}

View File

@ -12,17 +12,17 @@ import butterknife.Unbinder;
* 作者: Adam
* 日期: 2021年10月29日16:43:03
* 邮箱: itgaojian@163.com
* 描述: 统计分析
* 描述: 统计分析---网格员
*/
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_STATISTICS)
public class StatisticsActivity extends BaseActivity {
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_GRID_STATISTICS)
public class StatisticsGridActivity extends BaseActivity {
private Unbinder mBind;
@Override
protected int setLayoutId() {
return R.layout.activity_statistics;
return R.layout.activity_statistics_grid;
}
@Override

View File

@ -123,33 +123,33 @@ public class KnowLedgeDetailActivity extends BaseActivity {
private void getDetailById() {
RetrofitManager.getInstance()
.create(GridApis.class)
.getKnowLedgeDetailById(mId, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<KnowLedgeDetailBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
.create(GridApis.class)
.getKnowLedgeDetailById(mId, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<KnowLedgeDetailBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
}
@Override
public void onNext(@NonNull KnowLedgeDetailBean knowLedgeDetailBean) {
mDetailBean = knowLedgeDetailBean;
setDataToView();
}
@Override
public void onNext(@NonNull KnowLedgeDetailBean knowLedgeDetailBean) {
mDetailBean = knowLedgeDetailBean;
setDataToView();
}
@Override
public void onError(@NonNull Throwable e) {
refreshView(STATE_LOAD_ERROR);
ExceptionHandler.handleException(e);
}
@Override
public void onError(@NonNull Throwable e) {
refreshView(STATE_LOAD_ERROR);
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
@Override
public void onComplete() {
}
});
}
});
}
/**
@ -197,34 +197,34 @@ public class KnowLedgeDetailActivity extends BaseActivity {
String obj = gson.toJson(bean);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
RetrofitManager.getInstance()
.create(GridApis.class)
.doSaveKnowLedgeCorrection(mId, requestBody, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<SuccessBean>() {
@Override
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
.create(GridApis.class)
.doSaveKnowLedgeCorrection(mId, requestBody, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<SuccessBean>() {
@Override
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
}
}
@Override
public void onNext(@io.reactivex.rxjava3.annotations.NonNull SuccessBean successBean) {
dialog.dismiss();
ToastUtils.show("感谢您提出的错误内容,我们会尽快进行核实并修改.");
doRefresh();
}
@Override
public void onNext(@io.reactivex.rxjava3.annotations.NonNull SuccessBean successBean) {
dialog.dismiss();
ToastUtils.show("感谢您提出的错误内容,我们会尽快进行核实并修改.");
doRefresh();
}
@Override
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
@Override
public void onComplete() {
}
});
}
});
}
/**
@ -257,34 +257,34 @@ public class KnowLedgeDetailActivity extends BaseActivity {
String obj = gson.toJson(bean);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
RetrofitManager.getInstance()
.create(GridApis.class)
.doSaveKnowLedgeLevel(mId, requestBody, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<SuccessBean>() {
@Override
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
.create(GridApis.class)
.doSaveKnowLedgeLevel(mId, requestBody, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<SuccessBean>() {
@Override
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
}
}
@Override
public void onNext(@io.reactivex.rxjava3.annotations.NonNull SuccessBean successBean) {
dialog.dismiss();
ToastUtils.show("评价成功");
doRefresh();
}
@Override
public void onNext(@io.reactivex.rxjava3.annotations.NonNull SuccessBean successBean) {
dialog.dismiss();
ToastUtils.show("评价成功");
doRefresh();
}
@Override
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
@Override
public void onComplete() {
}
});
}
});
}
//加载更多
@ -306,65 +306,67 @@ public class KnowLedgeDetailActivity extends BaseActivity {
private void getAppraiseList(int currentPage) {
mCurrentPage = currentPage;
RetrofitManager.getInstance()
.create(GridApis.class)
.getKnowLedgeAppraiseList(mId, currentPage + "", UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<KnowLedgeAppraiseListBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
.create(GridApis.class)
.getKnowLedgeAppraiseList(mId, currentPage + "", UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<KnowLedgeAppraiseListBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
}
@Override
public void onNext(@NonNull KnowLedgeAppraiseListBean communityListBean) {
if (communityListBean.getRows() != null && communityListBean.getRows().size() > 0) {
++mCurrentPage;
if (currentPage == 1) {
mDatas.clear();
mDatas.addAll(communityListBean.getRows());
} else {
mDatas.addAll(communityListBean.getRows());
}
setStateView(14);
mAdapter.notifyDataSetChanged();
mSrlContent.finishRefresh();
if (mDatas.size() >= communityListBean.getTotal()) {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(true);
} else {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(false);
}
@Override
public void onNext(@NonNull KnowLedgeAppraiseListBean communityListBean) {
if (communityListBean.getRows() != null && communityListBean.getRows().size() > 0) {
++mCurrentPage;
if (currentPage == 1) {
mDatas.clear();
mDatas.addAll(communityListBean.getRows());
} else {
mDatas.addAll(communityListBean.getRows());
}
setStateView(14);
mAdapter.notifyDataSetChanged();
mSrlContent.finishRefresh();
if (mDatas.size() >= communityListBean.getTotal()) {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(true);
if (currentPage > 1) {
setStateView(14);
} else {
setStateView(15);
}
} else {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(false);
}
} else {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(true);
if (currentPage > 1) {
setStateView(14);
} else {
setStateView(15);
}
}
}
@Override
public void onError(@NonNull Throwable e) {
mSrlContent.finishLoadMore();
mSrlContent.finishRefresh();
ExceptionHandler.handleException(e);
mSrlContent.setNoMoreData(true);
setStateView(16);
}
@Override
public void onError(@NonNull Throwable e) {
mSrlContent.finishLoadMore();
mSrlContent.finishRefresh();
ExceptionHandler.handleException(e);
mSrlContent.setNoMoreData(true);
setStateView(16);
}
@Override
public void onComplete() {
@Override
public void onComplete() {
}
});
}
});
}
private void initWebView() {
mWvContent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
mWvContent.setHorizontalScrollBarEnabled(false);
mWvContent.setVerticalScrollBarEnabled(false);
WebSettings settings = mWvContent.getSettings();
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
settings.setAppCacheEnabled(true);

View File

@ -1,39 +1,38 @@
package com.tengshisoft.commonmodule.activitys.repository;
import android.app.ProgressDialog;
import android.content.Intent;
import android.text.TextUtils;
import android.util.CloseGuard;
import android.view.View;
import android.widget.Button;
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.tengshisoft.commonmodule.R;
import com.tengshisoft.commonmodule.R2;
import com.tengshisoft.commonmodule.adapters.KnowLedgeListAdapter;
import com.tengshisoft.commonmodule.beans.KnowLedgeListBean;
import com.tengshisoft.commonmodule.fragments.KnowLedgeListFragment;
import com.tengshisoft.commonmodule.nets.GridApis;
import com.tenlionsoft.baselib.constant.PathConfig;
import com.tenlionsoft.baselib.core.beans.DicBean;
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
import com.tenlionsoft.baselib.core.widget.base.BaseViewPage2Adapter;
import com.tenlionsoft.baselib.core.widget.base.ViewPageNavigatorAdapter;
import com.tenlionsoft.baselib.core.widget.views.ConditionDicPopup;
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 net.lucode.hackware.magicindicator.MagicIndicator;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
@ -53,133 +52,63 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
public class KnowLedgeListActivity extends BaseActivity {
@BindView(R2.id.rlv_components)
RecyclerView mRlvComponents;
@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.mi_tabs)
MagicIndicator mMiTabs;
@BindView(R2.id.vp_content)
ViewPager2 mVpContent;
private Unbinder mBind;
private List<KnowLedgeListBean.RowsBean> mDatas;
private KnowLedgeListAdapter mAdapter;
private int mCurrentPage = 1;
private String mKeywords = "";
private List<BaseFragment> mFragments;
private List<String> mTitles = Arrays.asList("全部", "部门黄页");
private ProgressDialog dialog = null;
private List<DicBean> mOptions;
private String mSelCondition;//筛选条件
@Override
protected int setLayoutId() {
return R.layout.activity_know_ledge_list;
}
@Override
protected void doShowOptions() {
}
@Override
protected void clearSearch() {
mKeywords = "";
doRefresh();
}
@Override
protected void doSearchByTitle() {
doSearch();
}
@Override
public void initData() {
mBind = ButterKnife.bind(this);
refreshView(STATE_LOAD_SUCCESS);
mTvBaseTitle.setText("知识库");
mEtAppSearchContent.setHint("请输入要查询的内容");
mTvOptions.setVisibility(View.VISIBLE);
mTvSearchBack.setVisibility(View.GONE);
mIvAppSearchIcon.setVisibility(View.VISIBLE);
refreshView(STATE_LOAD_SUCCESS);
mDatas = new ArrayList<>();
mAdapter = new KnowLedgeListAdapter(mActivity, mDatas);
mRlvComponents.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvComponents.setAdapter(mAdapter);
mSrlContent.setOnRefreshListener(v -> doRefresh());
mSrlContent.setOnLoadMoreListener(v -> doLoadMore());
setStateView(13);
getKnowLedgeList(mCurrentPage);
mAdapter.addOnItemClickListener(v -> ARouter.getInstance()
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_KNOWLEDGE_LIBRARY_DETAIL)
.withString("id", v.getKnowledgeId())
.navigation());
initViews();
}
/**
* 获取知识库列表
* 初始化视图
*/
private void getKnowLedgeList(int currentPage) {
mCurrentPage = currentPage;
RetrofitManager.getInstance()
.create(GridApis.class)
.getLibraryList(mKeywords, mCurrentPage + "", "1", UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<KnowLedgeListBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
private void initViews() {
mFragments = new ArrayList<>();
BaseFragment listFragment = (BaseFragment) ARouter.getInstance().build(PathConfig.PATH_MODULE_COMMON_FRAGMENT_KNOW_LEDGE_LIST).navigation();
BaseFragment byDeptFragment = (BaseFragment) ARouter.getInstance().build(PathConfig.PATH_MODULE_COMMON_FRAGMENT_KNOW_LEDGE_LIST_BY_DEPT).navigation();
mFragments.add(listFragment);
mFragments.add(byDeptFragment);
mVpContent.setAdapter(new BaseViewPage2Adapter(this, mFragments));
mVpContent.setUserInputEnabled(false);
CommonNavigator commonNavigator = new CommonNavigator(this);
commonNavigator.setAdapter(new ViewPageNavigatorAdapter(this, mTitles, mVpContent));
commonNavigator.setAdjustMode(true);
mMiTabs.setNavigator(commonNavigator);
UIUtil.bindViewPager2(mMiTabs, mVpContent, () -> {
//页面切换清空搜索条件
if (mOptions != null && mOptions.size() > 0) {
for (int i = 0; i < mOptions.size(); i++) {
mOptions.get(i).setCheck(false);
}
}
mEtAppSearchContent.setText("");
mSelCondition = "";
});
@Override
public void onNext(@NonNull KnowLedgeListBean communityListBean) {
if (communityListBean.getRows() != null && communityListBean.getRows().size() > 0) {
++mCurrentPage;
if (currentPage == 1) {
mDatas.clear();
mDatas.addAll(communityListBean.getRows());
} else {
mDatas.addAll(communityListBean.getRows());
}
setStateView(14);
mAdapter.notifyDataSetChanged();
mSrlContent.finishRefresh();
if (mDatas.size() >= communityListBean.getTotal()) {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(true);
} else {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(false);
}
} else {
if (currentPage > 1) {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(true);
setStateView(14);
} else {
if (TextUtils.isEmpty(mKeywords)) {
//无数据
setStateView(15);
} else {
setStateView(15);
ToastUtils.show("未查询到相关内容");
}
}
}
}
@Override
public void onError(@NonNull Throwable e) {
mSrlContent.finishLoadMore();
mSrlContent.finishRefresh();
ExceptionHandler.handleException(e);
setStateView(16);
}
@Override
public void onComplete() {
}
});
getDicListByType(PathConfig.DIC_KNOW_LIB_TYPE, 2);
}
@Override
@ -187,81 +116,111 @@ public class KnowLedgeListActivity extends BaseActivity {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 12) {
if (resultCode == 13) {
doRefresh();
int currentItem = mVpContent.getCurrentItem();
BaseFragment fragment = mFragments.get(currentItem);
fragment.refreshContentView("", "");
}
}
}
//加载更多
private void doLoadMore() {
getKnowLedgeList(mCurrentPage);
private void getDicListByType(String pId, int i) {
if (i == 1) {
dialog = UIUtil.initDialog(mActivity, "获取中...");
dialog.show();
}
RetrofitManager.getInstance()
.create(GridApis.class)
.getDictListAllByPid(pId, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<List<DicBean>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull List<DicBean> beans) {
if (i == 1 && dialog != null) {
dialog.dismiss();
}
if (beans.size() > 0) {
mOptions = beans;
if (i == 1) {
doShowOptions();
}
} else {
if (i == 1) {
ToastUtils.show("暂无筛选条件");
}
}
}
@Override
public void onError(@NonNull Throwable e) {
if (i == 1) {
dialog.dismiss();
}
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
}
});
}
//刷新
private void doRefresh() {
mDatas.clear();
mAdapter.setData(mDatas);
getKnowLedgeList(1);
@Override
protected void doShowOptions() {
if (mOptions != null && mOptions.size() > 0) {
ConditionDicPopup popup = new ConditionDicPopup(mActivity, mOptions);
popup.addOnCheckChange((bean, ischeck) -> {
if (ischeck) {
mSelCondition = bean.getDataId();
} else {
mSelCondition = "";
}
doSearch();
popup.dismiss();
});
popup.showPopupWindow(mLlAppSearchContent);
} else {
getDicListByType(PathConfig.DIC_KNOW_LIB_TYPE, 1);
}
}
@Override
protected void clearSearch() {
if (mOptions != null && mOptions.size() > 0) {
for (int i = 0; i < mOptions.size(); i++) {
mOptions.get(i).setCheck(false);
}
}
mEtAppSearchContent.setText("");
mSelCondition = "";
int currentItem = mVpContent.getCurrentItem();
BaseFragment baseFragment = mFragments.get(currentItem);
baseFragment.refreshContentView("", "");
}
/**
*
*/
private void doSearch() {
int currentItem = mVpContent.getCurrentItem();
BaseFragment fragment = mFragments.get(currentItem);
fragment.refreshContentView(mSelCondition, mEtAppSearchContent.getText().toString().trim());
}
@Override
protected void doSearchByTitle() {
String searchContent = mEtAppSearchContent.getText().toString().trim();
if (!TextUtils.isEmpty(searchContent)) {
hideSoftKeyboard();
setStateView(13);
mKeywords = searchContent;
mCurrentPage = 1;
getKnowLedgeList(mCurrentPage);
doSearch();
} else {
ToastUtils.show("请输入要查询的内容");
}
}
/**
* 根据状态显示
* 12 默认
* 13 搜索中
* 14 搜索完成有数据
* 15 搜索完成没有数据
* 16 搜索失败
*
* @param state
*/
private void setStateView(int state) {
switch (state) {
case 12://默认
case 15:
mPbLoading.setVisibility(View.GONE);
mSrlContent.setVisibility(View.GONE);
mIvEmptyData.setVisibility(View.VISIBLE);
mTvErrorHint.setVisibility(View.VISIBLE);
mTvErrorHint.setText("暂无数据");
break;
case 13://搜索中
mPbLoading.setVisibility(View.VISIBLE);
mSrlContent.setVisibility(View.GONE);
mIvEmptyData.setVisibility(View.GONE);
mTvErrorHint.setVisibility(View.VISIBLE);
mTvErrorHint.setText("加载中...");
break;
case 14://搜索完成有数据
mPbLoading.setVisibility(View.GONE);
mSrlContent.setVisibility(View.VISIBLE);
mIvEmptyData.setVisibility(View.GONE);
mTvErrorHint.setVisibility(View.GONE);
break;
case 16://搜索失败
mPbLoading.setVisibility(View.GONE);
mSrlContent.setVisibility(View.GONE);
mIvEmptyData.setVisibility(View.VISIBLE);
mTvErrorHint.setVisibility(View.VISIBLE);
mTvErrorHint.setText("加载失败,请稍后重试");
break;
}
}
}

View File

@ -0,0 +1,56 @@
package com.tengshisoft.commonmodule.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tengshisoft.commonmodule.R;
import com.tengshisoft.commonmodule.beans.DeptBean;
import com.tengshisoft.commonmodule.holders.DeptChooseKnowLedgeHolder;
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
import java.util.List;
/**
* 作者: adam
* 日期: 2021/10/28 - 1:56 下午
* 邮箱: itgaojian@163.com
* 描述: 选择部门
*/
public class DeptChooseKnowLedgeAdapter extends BaseRecyclerAdapter<DeptBean, DeptChooseKnowLedgeHolder> {
public DeptChooseKnowLedgeAdapter(Context ctx, List<DeptBean> list) {
super(ctx, list);
}
@Override
public DeptChooseKnowLedgeHolder createHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_know_ledge_choose_dept_layout, parent, false);
return new DeptChooseKnowLedgeHolder(itemView);
}
@Override
public void bindHolder(DeptChooseKnowLedgeHolder holder, int i) {
DeptBean bean = mData.get(i);
holder.mTvName.setText(bean.getDepartmentName());
if (i == (mData.size() - 1)) {
holder.mIvArrow.setVisibility(View.GONE);
} else {
holder.mIvArrow.setVisibility(View.VISIBLE);
}
if (mOnItemChoose != null) {
holder.itemView.setOnClickListener(v -> mOnItemChoose.onItemChoose(bean, i));
}
}
private OnItemChoose mOnItemChoose;
public void setOnItemChoose(OnItemChoose onItemChoose) {
this.mOnItemChoose = onItemChoose;
}
public interface OnItemChoose {
void onItemChoose(DeptBean bean, int pos);
}
}

View File

@ -0,0 +1,52 @@
package com.tengshisoft.commonmodule.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tengshisoft.commonmodule.R;
import com.tengshisoft.commonmodule.beans.DeptBean;
import com.tengshisoft.commonmodule.holders.DeptChooseKnowLedgeHolder;
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
import java.util.List;
/**
* 作者: adam
* 日期: 2021/10/28 - 1:56 下午
* 邮箱: itgaojian@163.com
* 描述: 选择部门
*/
public class DeptKnowLedgeAdapter extends BaseRecyclerAdapter<DeptBean, DeptChooseKnowLedgeHolder> {
public DeptKnowLedgeAdapter(Context ctx, List<DeptBean> list) {
super(ctx, list);
}
@Override
public DeptChooseKnowLedgeHolder createHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_know_ledge_dept_layout, parent, false);
return new DeptChooseKnowLedgeHolder(itemView);
}
@Override
public void bindHolder(DeptChooseKnowLedgeHolder holder, int i) {
DeptBean bean = mData.get(i);
holder.mTvName.setText(bean.getDepartmentName());
holder.mIvArrow.setVisibility(View.GONE);
if (mOnItemChoose != null) {
holder.itemView.setOnClickListener(v -> mOnItemChoose.onItemChoose(bean, i));
}
}
private OnItemChoose mOnItemChoose;
public void setOnItemChoose(OnItemChoose onItemChoose) {
this.mOnItemChoose = onItemChoose;
}
public interface OnItemChoose {
void onItemChoose(DeptBean bean, int pos);
}
}

View File

@ -38,7 +38,8 @@ public class KnowLedgeListAdapter extends BaseRecyclerAdapter<KnowLedgeListBean.
KnowLedgeListBean.RowsBean bean = mData.get(i);
holder.mTvTitle.setText(bean.getTitle());
holder.mTvAnswer.setText(bean.getSummary());
holder.mTvType.setText(bean.getCategoryDict());
holder.mTvTime.setText("发布单位:" + bean.getSourceDeptNames());
}
}

View File

@ -40,6 +40,7 @@ public class KnowLedgeListBean {
public static class RowsBean {
private String category;
private String categoryDict;
private String collectType;
private String commitPass;
private String creator;
@ -60,6 +61,8 @@ public class KnowLedgeListBean {
private String richContent;
private String source;
private String sourceDept;
private String sourceDeptName;
private String sourceDeptNames;
private String sourceOrg;
private String sourceUser;
private String sourceUserName;
@ -76,6 +79,14 @@ public class KnowLedgeListBean {
this.category = category;
}
public String getCategoryDict() {
return categoryDict;
}
public void setCategoryDict(String categoryDict) {
this.categoryDict = categoryDict;
}
public String getCollectType() {
return collectType;
}
@ -236,6 +247,22 @@ public class KnowLedgeListBean {
this.sourceDept = sourceDept;
}
public String getSourceDeptName() {
return sourceDeptName;
}
public void setSourceDeptName(String sourceDeptName) {
this.sourceDeptName = sourceDeptName;
}
public String getSourceDeptNames() {
return sourceDeptNames;
}
public void setSourceDeptNames(String sourceDeptNames) {
this.sourceDeptNames = sourceDeptNames;
}
public String getSourceOrg() {
return sourceOrg;
}

View File

@ -0,0 +1,325 @@
package com.tengshisoft.commonmodule.fragments;
import android.app.ProgressDialog;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
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.tengshisoft.commonmodule.R;
import com.tengshisoft.commonmodule.R2;
import com.tengshisoft.commonmodule.adapters.DeptChooseKnowLedgeAdapter;
import com.tengshisoft.commonmodule.adapters.DeptKnowLedgeAdapter;
import com.tengshisoft.commonmodule.adapters.KnowLedgeListAdapter;
import com.tengshisoft.commonmodule.beans.DeptBean;
import com.tengshisoft.commonmodule.beans.KnowLedgeListBean;
import com.tengshisoft.commonmodule.nets.GridApis;
import com.tenlionsoft.baselib.constant.PathConfig;
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
import com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView;
import com.tenlionsoft.baselib.utils.ExceptionHandler;
import com.tenlionsoft.baselib.utils.UIUtil;
import com.tenlionsoft.baselib.utils.UserLgUtils;
import java.util.ArrayList;
import java.util.List;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
/**
* 作者: adam
* 日期: 2021/11/9 - 9:50 上午
* 邮箱: itgaojian@163.com
* 描述:
*/
@Route(path = PathConfig.PATH_MODULE_COMMON_FRAGMENT_KNOW_LEDGE_LIST_BY_DEPT)
public class KnowLedgeListByDeptFragment extends BaseFragment {
@BindView(R2.id.rlv_know)
RecyclerView mRlvKnow;
@BindView(R2.id.rlv_sel_dept)
RecyclerView mRlvSelDept;
@BindView(R2.id.pb_loading)
ProgressBar mPbLoading;
@BindView(R2.id.iv_empty_data)
ImageView mIvEmptyData;
@BindView(R2.id.tv_error_hint)
TypeFaceTextView mTvErrorHint;
@BindView(R2.id.ll_hint_view)
LinearLayout mLlHintView;
@BindView(R2.id.rlv_depts)
RecyclerView mRlvDepts;
@BindView(R2.id.srl_content)
SmartRefreshLayout mSrlContent;
@BindView(R2.id.ll_dept_hint)
LinearLayout mLlDeptHint;
private Unbinder mBind;
private List<KnowLedgeListBean.RowsBean> mDatas;
private List<DeptBean> mSelDepts;
private List<DeptBean> mDeptBeans;
private DeptChooseKnowLedgeAdapter mSelAdapter;
private DeptKnowLedgeAdapter mDeptAdapter;
private KnowLedgeListAdapter mAdapter;
private int mCurrentPage = 1;
private String mKeywords = "";
private String mSelDeptId = "0";
private String mSelCategory = "";
@Override
protected void setDataToView(View dataView) {
mBind = ButterKnife.bind(this, dataView);
initViews();
setStateView(STATE_SUCCESS);
mSrlView.setEnableRefresh(false);
mSrlView.setEnableLoadMore(false);
//获取部门
getDeptListByPid(mSelDeptId);
mAdapter.addOnItemClickListener(v -> ARouter.getInstance()
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_KNOWLEDGE_LIBRARY_DETAIL)
.withString("id", v.getKnowledgeId())
.navigation());
}
/**
* 初始化视图
*/
private void initViews() {
//当前选中的部门列表
DeptBean bean1 = new DeptBean();
bean1.setDepartmentName("组织部门");
bean1.setDepartmentId("0");
mSelDepts = new ArrayList<>();
mSelDepts.add(bean1);
mSelAdapter = new DeptChooseKnowLedgeAdapter(mActivity, mSelDepts);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mActivity);
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
mRlvSelDept.setLayoutManager(linearLayoutManager);
mRlvSelDept.setAdapter(mSelAdapter);
mSelAdapter.setOnItemChoose((bean12, pos) -> {
mSelDepts = mSelDepts.subList(0, pos + 1);
mSelAdapter.setData(mSelDepts);
mRlvSelDept.scrollToPosition(mSelDepts.size() - 1);
mSelDeptId = bean12.getDepartmentId();
getDeptListByPid(mSelDeptId);
});
//部门列表
mDeptBeans = new ArrayList<>();
mDeptAdapter = new DeptKnowLedgeAdapter(mActivity, mDeptBeans);
mRlvDepts.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvDepts.setAdapter(mDeptAdapter);
mDeptAdapter.addOnItemClickListener(o -> {
mSelDepts.add(o);
mSelAdapter.setData(mSelDepts);
mRlvSelDept.scrollToPosition(mSelDepts.size() - 1);
mSelDeptId = o.getDepartmentId();
getDeptListByPid(mSelDeptId);
});
//知识列表
mDatas = new ArrayList<>();
mAdapter = new KnowLedgeListAdapter(mActivity, mDatas);
mRlvKnow.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvKnow.setAdapter(mAdapter);
mSrlContent.setOnLoadMoreListener(refreshLayout -> getKnowLedgeList(mCurrentPage));
mSrlContent.setOnRefreshListener(refreshLayout -> doRefreshKnowList());
}
/**
* 获取下级部门
*/
private void getDeptListByPid(String selDeptId) {
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中....");
dialog.show();
RetrofitManager.getInstance()
.create(GridApis.class)
.getKnowLedgeDeptList(selDeptId, UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<List<DeptBean>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull List<DeptBean> deptBeans) {
dialog.dismiss();
if (deptBeans.size() > 0) {
mLlDeptHint.setVisibility(View.GONE);
} else {
mLlDeptHint.setVisibility(View.VISIBLE);
}
mDeptBeans = deptBeans;
mDeptAdapter.setData(mDeptBeans);
//获取知识列表
doRefreshKnowList();
}
@Override
public void onError(@NonNull Throwable e) {
dialog.dismiss();
ExceptionHandler.handleException(e);
}
@Override
public void onComplete() {
}
});
}
/**
* 刷新知识列表
*/
private void doRefreshKnowList() {
mDatas.clear();
mAdapter.setData(mDatas);
getKnowLedgeList(1);
}
/**
* 获取知识库列表
*/
private void getKnowLedgeList(int currentPage) {
mCurrentPage = currentPage;
RetrofitManager.getInstance()
.create(GridApis.class)
.getLibraryListByDept(mSelCategory, mSelDeptId, mKeywords, mCurrentPage + "", "1", UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<KnowLedgeListBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull KnowLedgeListBean communityListBean) {
if (communityListBean.getRows() != null && communityListBean.getRows().size() > 0) {
++mCurrentPage;
if (currentPage == 1) {
mDatas.clear();
mDatas.addAll(communityListBean.getRows());
} else {
mDatas.addAll(communityListBean.getRows());
}
refreshStateView(STATE_SUCCESS);
mAdapter.notifyDataSetChanged();
mSrlContent.finishRefresh();
if (mDatas.size() >= communityListBean.getTotal()) {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(true);
} else {
mSrlContent.finishLoadMore();
mSrlContent.setNoMoreData(false);
}
} else {
mSrlContent.finishLoadMore();
mSrlContent.finishRefresh();
if (currentPage > 1) {
mSrlContent.setNoMoreData(true);
refreshStateView(STATE_SUCCESS);
} else {
if (TextUtils.isEmpty(mKeywords)) {
//无数据
refreshStateView(STATE_EMPTY);
} else {
refreshStateView(STATE_SEARCH_EMPTY);
ToastUtils.show("未查询到相关内容");
}
}
}
}
@Override
public void onError(@NonNull Throwable e) {
mSrlContent.finishLoadMore();
mSrlContent.finishRefresh();
ExceptionHandler.handleException(e);
refreshStateView(STATE_ERROR);
}
@Override
public void onComplete() {
}
});
}
/**
* 刷新
*/
@Override
public void refreshContentView(String... data) {
mSelCategory = data[0];
mKeywords = data[1];
refreshView();
}
@Override
protected void refreshView() {
}
@Override
protected void loadMoreData() {
}
@Override
protected int getContentViewId() {
return R.layout.fragment_know_ledge_list_by_dept;
}
/**
* 刷新视图
*
* @param state
*/
private void refreshStateView(int state) {
switch (state) {
case STATE_EMPTY:
mLlHintView.setVisibility(View.VISIBLE);
mPbLoading.setVisibility(View.GONE);
mIvEmptyData.setVisibility(View.VISIBLE);
mTvErrorHint.setText("暂无数据");
mRlvKnow.setVisibility(View.GONE);
break;
case STATE_SUCCESS:
mLlHintView.setVisibility(View.GONE);
mRlvKnow.setVisibility(View.VISIBLE);
break;
case STATE_ERROR:
mLlHintView.setVisibility(View.VISIBLE);
mRlvKnow.setVisibility(View.GONE);
mPbLoading.setVisibility(View.GONE);
mIvEmptyData.setVisibility(View.VISIBLE);
mTvErrorHint.setText("加载失败,请稍后重试");
break;
case STATE_LOAD:
mLlHintView.setVisibility(View.VISIBLE);
mPbLoading.setVisibility(View.VISIBLE);
mRlvKnow.setVisibility(View.GONE);
mIvEmptyData.setVisibility(View.GONE);
mTvErrorHint.setText("加载中...");
default:
break;
}
}
}

View File

@ -0,0 +1,160 @@
package com.tengshisoft.commonmodule.fragments;
import android.text.TextUtils;
import android.view.View;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.hjq.toast.ToastUtils;
import com.tengshisoft.commonmodule.R;
import com.tengshisoft.commonmodule.R2;
import com.tengshisoft.commonmodule.adapters.KnowLedgeListAdapter;
import com.tengshisoft.commonmodule.beans.KnowLedgeListBean;
import com.tengshisoft.commonmodule.nets.GridApis;
import com.tenlionsoft.baselib.constant.PathConfig;
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
import com.tenlionsoft.baselib.utils.ExceptionHandler;
import com.tenlionsoft.baselib.utils.UserLgUtils;
import java.util.ArrayList;
import java.util.List;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
/**
* 作者: adam
* 日期: 2021/11/9 - 9:50 上午
* 邮箱: itgaojian@163.com
* 描述:
*/
@Route(path = PathConfig.PATH_MODULE_COMMON_FRAGMENT_KNOW_LEDGE_LIST)
public class KnowLedgeListFragment extends BaseFragment {
@BindView(R2.id.rlv_know)
RecyclerView mRlvKnow;
private Unbinder mBind;
private List<KnowLedgeListBean.RowsBean> mDatas;
private KnowLedgeListAdapter mAdapter;
private int mCurrentPage = 1;
private String mKeywords = "";
private String mSelCategory;
@Override
protected void setDataToView(View dataView) {
mBind = ButterKnife.bind(this, dataView);
mDatas = new ArrayList<>();
mAdapter = new KnowLedgeListAdapter(mActivity, mDatas);
mRlvKnow.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvKnow.setAdapter(mAdapter);
getKnowLedgeList(mCurrentPage);
mAdapter.addOnItemClickListener(v -> ARouter.getInstance()
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_KNOWLEDGE_LIBRARY_DETAIL)
.withString("id", v.getKnowledgeId())
.navigation());
}
/**
* 获取知识库列表
*/
private void getKnowLedgeList(int currentPage) {
mCurrentPage = currentPage;
RetrofitManager.getInstance()
.create(GridApis.class)
.getLibraryList(mSelCategory, mKeywords, mCurrentPage + "", "1", UserLgUtils.getToken())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<KnowLedgeListBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull KnowLedgeListBean communityListBean) {
if (communityListBean.getRows() != null && communityListBean.getRows().size() > 0) {
++mCurrentPage;
if (currentPage == 1) {
mDatas.clear();
mDatas.addAll(communityListBean.getRows());
} else {
mDatas.addAll(communityListBean.getRows());
}
setStateView(STATE_SUCCESS);
mAdapter.notifyDataSetChanged();
mSrlView.finishRefresh();
if (mDatas.size() >= communityListBean.getTotal()) {
mSrlView.finishLoadMore();
mSrlView.setNoMoreData(true);
} else {
mSrlView.finishLoadMore();
mSrlView.setNoMoreData(false);
}
} else {
if (currentPage > 1) {
mSrlView.finishLoadMore();
mSrlView.setNoMoreData(true);
setStateView(STATE_SUCCESS);
} else {
if (TextUtils.isEmpty(mKeywords)) {
//无数据
setStateView(STATE_EMPTY);
} else {
setStateView(STATE_SEARCH_EMPTY);
ToastUtils.show("未查询到相关内容");
}
}
}
}
@Override
public void onError(@NonNull Throwable e) {
mSrlView.finishLoadMore();
mSrlView.finishRefresh();
ExceptionHandler.handleException(e);
setStateView(STATE_ERROR);
}
@Override
public void onComplete() {
}
});
}
/**
* 刷新
*/
@Override
public void refreshContentView(String... data) {
mSelCategory = data[0];
mKeywords = data[1];
refreshView();
}
@Override
protected void refreshView() {
mDatas.clear();
mAdapter.setData(mDatas);
getKnowLedgeList(1);
}
@Override
protected void loadMoreData() {
getKnowLedgeList(mCurrentPage);
}
@Override
protected int getContentViewId() {
return R.layout.fragment_know_ledge_list;
}
}

View File

@ -0,0 +1,31 @@
package com.tengshisoft.commonmodule.holders;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.tengshisoft.commonmodule.R;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
/**
* 作者: adam
* 日期: 2021/10/28 - 11:18 上午
* 邮箱: itgaojian@163.com
* 描述: 部门列表
*/
public class DeptChooseKnowLedgeHolder extends RecyclerView.ViewHolder {
public TextView mTvName;
public ImageView mIvArrow;
public DeptChooseKnowLedgeHolder(@NonNull @NotNull View itemView) {
super(itemView);
mTvName = itemView.findViewById(R.id.tv_name);
mIvArrow = itemView.findViewById(R.id.iv_arrow);
}
}

View File

@ -21,11 +21,13 @@ public class KnowLedgeListHolder extends RecyclerView.ViewHolder {
public TextView mTvTitle;
public TextView mTvAnswer;
public TextView mTvType;
public TextView mTvTime;
public KnowLedgeListHolder(@NonNull @NotNull View itemView) {
super(itemView);
mTvTitle = itemView.findViewById(R.id.tv_title);
mTvAnswer = itemView.findViewById(R.id.tv_answer);
mTvType = itemView.findViewById(R.id.tv_type);
mTvTime = itemView.findViewById(R.id.tv_time);
}
}

View File

@ -35,6 +35,7 @@ import com.tengshisoft.commonmodule.beans.CorrectDetailBean;
import com.tengshisoft.commonmodule.beans.DeferRecordListBean;
import com.tengshisoft.commonmodule.beans.DepartmentBean;
import com.tengshisoft.commonmodule.beans.DepartmentListBean;
import com.tengshisoft.commonmodule.beans.DeptBean;
import com.tengshisoft.commonmodule.beans.DispatchDetailBean;
import com.tengshisoft.commonmodule.beans.DistributionDeptBean;
import com.tengshisoft.commonmodule.beans.DrugDetailBean;
@ -132,7 +133,7 @@ public interface GridApis {
* @param token
* @return
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@Headers({"base_url_name:library", "Content-Type: application/json", "Accept: application/json"})
@GET("app/data/listbyparentid/{dictionaryParentId}")
Observable<List<DicBean>> getDictListAllByPid(@Path("dictionaryParentId") String pId, @Header("token") String token);
@ -1639,7 +1640,7 @@ public interface GridApis {
*/
@Headers({"base_url_name:library", "Content-Type: application/json", "Accept: application/json"})
@GET("app/knowledge-lib/list-page-knowledge-lib")
Observable<KnowLedgeListBean> getLibraryList(@Query("keywords") String key, @Query("page") String page, @Query("publishType") String pType, @Header("token") String token);
Observable<KnowLedgeListBean> getLibraryList(@Query("category") String category, @Query("keywords") String key, @Query("page") String page, @Query("publishType") String pType, @Header("token") String token);
/**
* 获取知识详情
@ -1668,6 +1669,20 @@ public interface GridApis {
@Headers({"base_url_name:library", "Content-Type: application/json", "Accept: application/json"})
@GET("app/knowledge-appraise/list-page-knowledge-appraise")
Observable<KnowLedgeAppraiseListBean> getKnowLedgeAppraiseList(@Query("knowledgeId") String id, @Query("page") String page, @Header("token") String token);
/**
* 获取部门黄页部门列表
*/
@Headers({"base_url_name:library", "Content-Type: application/json", "Accept: application/json"})
@GET("app/dept-yellow-page/release/list-dept-pid")
Observable<List<DeptBean>> getKnowLedgeDeptList(@Query("departmentParentId") String pid, @Header("token") String token);
/**
* 根据部门获取知识库列表
*/
@Headers({"base_url_name:library", "Content-Type: application/json", "Accept: application/json"})
@GET("app/dept-yellow-page/list-page-knowledge-lib")
Observable<KnowLedgeListBean> getLibraryListByDept(@Query("category") String category, @Query("sourceDept") String deptId, @Query("keywords") String key, @Query("page") String page, @Query("publishType") String pType, @Header("token") String token);
/*==========================================俩新组织====================================================*/
/*==非公有制经济组织===*/

View File

@ -8,7 +8,7 @@
android:background="@color/gray_bg"
android:orientation="vertical"
android:padding="10dp"
tools:context=".activitys.checkwork.CheckWorkActivity">
tools:context=".activitys.checkwork.AttendanceActivity">
<LinearLayout

View File

@ -8,8 +8,7 @@
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="55dp">
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
@ -34,11 +33,17 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
style="@style/issue_report_title"
android:padding="8dp"
android:text="知识信息"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
style="@style/issue_report_title"
android:padding="8dp"
android:text="知识信息"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
style="@style/item_gray_vertical"
@ -78,10 +83,30 @@
android:padding="5dp">
<TextView
style="@style/item_title_vertical"
android:text="知识内容"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
style="@style/item_title_vertical"
android:text="知识内容"
android:textStyle="bold" />
<Button
android:id="@+id/btn_correction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@null"
android:minWidth="0dp"
android:minHeight="0dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="知识纠错"
android:textColor="@color/red_ff"
android:textSize="12sp" />
</RelativeLayout>
<com.tenlionsoft.baselib.core.widget.views.NestedScrollWebView
android:id="@+id/wv_content"
@ -105,11 +130,32 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
style="@style/issue_report_title"
android:padding="8dp"
android:text="评价"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
style="@style/issue_report_title"
android:padding="8dp"
android:text="评价"
android:textStyle="bold" />
<Button
android:id="@+id/btn_appraise"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:background="@null"
android:minWidth="0dp"
android:minHeight="0dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="发表评价"
android:textColor="@color/text_blue"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
@ -164,35 +210,5 @@
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<Button
android:id="@+id/btn_appraise"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_weight="1"
android:background="@drawable/sel_btn_submit"
android:text="评价"
android:textColor="@color/white"
android:textSize="18sp" />
<Button
android:id="@+id/btn_correction"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/sel_btn_submit"
android:text="纠错"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
</RelativeLayout>

View File

@ -7,51 +7,21 @@
android:background="@color/gray_bg"
android:orientation="vertical">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp">
android:layout_height="wrap_content"
android:background="@drawable/shp_bottom_shadow_white_no_radius"
android:orientation="horizontal">
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl_content"
<net.lucode.hackware.magicindicator.MagicIndicator
android:id="@+id/mi_tabs"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="40dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_components"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
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="wrap_content"
android:layout_height="wrap_content"
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"
android:background="@drawable/ic_empty_data" />
<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>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activitys.logs.StatisticsCommandActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -4,6 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activitys.logs.StatisticsActivity">
tools:context=".activitys.logs.StatisticsDeptActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activitys.logs.StatisticsGridActivity">
</LinearLayout>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlv_know"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</androidx.recyclerview.widget.RecyclerView>

View File

@ -0,0 +1,105 @@
<?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:background="@color/gray_bg"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_sel_dept"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/rlv_sel_dept"
android:layout_marginTop="3dp"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="@drawable/shp_rectangle_white">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_depts"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/ll_dept_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_empty_data" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="15dp"
android:text="暂无数据"
android:textSize="12sp" />
</LinearLayout>
</RelativeLayout>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/srl_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_know"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/ll_hint_view"
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="80dp"
android:layout_height="80dp"
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"
android:background="@drawable/ic_empty_data" />
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
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>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,28 @@
<?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="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rectangle_white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="2dp">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:textColor="#ff353535"
android:textSize="16sp"
tools:text="部门名称" />
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="15dp"
android:layout_height="15dp"
android:src="@drawable/ic_arrow_cir" />
</LinearLayout>

View File

@ -0,0 +1,36 @@
<?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="@drawable/shape_rectangle_white"
android:gravity="center"
android:orientation="vertical"
android:padding="2dp">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:textColor="#ff353535"
android:drawableRight="@drawable/ic_arrow_cir"
android:textSize="16sp"
tools:text="部门名称" />
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="15dp"
android:layout_height="15dp"
android:src="@drawable/ic_arrow_cir" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="5dp"
android:background="@drawable/shp_line_dotted"
android:layerType="software" />
</LinearLayout>

View File

@ -54,7 +54,7 @@
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:textColor="@color/text_blue"
tools:text="类别" />
tools:text="户籍办理" />
</LinearLayout>
@ -72,7 +72,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:drawableLeft="@drawable/ic_clock_blue"
android:drawableLeft="@drawable/ic_dept_icon"
android:drawablePadding="5dp"
android:ellipsize="end"
android:maxLines="2"

View File

@ -91,7 +91,6 @@ public class CommunityManageActivity extends BaseActivity {
@Override
public void initData() {
mBind = ButterKnife.bind(this);
refreshView(STATE_LOAD_LOADING);
mTvPublish.setVisibility(View.VISIBLE);
mIvAppSearchIcon.setVisibility(View.VISIBLE);
mType = getIntent().getIntExtra("type", 1);
@ -216,6 +215,7 @@ public class CommunityManageActivity extends BaseActivity {
@Override
public void onError(@NonNull Throwable e) {
setStateView(16);
mSrlContent.finishLoadMore();
mSrlContent.finishRefresh();
ExceptionHandler.handleException(e);

View File

@ -61,8 +61,6 @@ public class HouseListActivity extends BaseActivity {
ImageView mIvEmptyData;
@BindView(R2.id.tv_error_hint)
TextView mTvErrorHint;
@BindView(R2.id.tv_search_type)
TextView mTvSearchType;
private Unbinder mBind;
private int mCurrentPage = 1;//当前页数
private int mTotalSize;//总数
@ -100,6 +98,8 @@ public class HouseListActivity extends BaseActivity {
mTvBaseTitle.setText("房屋管理");
mDatas = new ArrayList<>();
mIvAppSearchIcon.setVisibility(View.VISIBLE);
mTvOptions.setVisibility(View.VISIBLE);
mTvSearchBack.setVisibility(View.GONE);
initViews();
mAdapter = new HouseListAdapter(mActivity, mDatas, 1);
mSrlContent.setOnLoadMoreListener(refreshLayout -> loadMore());
@ -144,15 +144,13 @@ public class HouseListActivity extends BaseActivity {
popup.addOnCheckChange((bean, ischeck) -> {
if (ischeck) {
mSelCondition = bean.getName();
mTvSearchType.setText(mSelCondition);
} else {
mSelCondition = "";
mTvSearchType.setText("筛选");
}
doRefresh();
popup.dismiss();
});
popup.showPopupWindow(mTvSearchType);
popup.showPopupWindow(mLlAppSearchContent);
}
/**

View File

@ -134,7 +134,7 @@ public class TaskManageActivity extends BaseActivity {
commonNavigator.setAdapter(new ViewPageNavigatorAdapter(this, mTitles, mVpContent));
commonNavigator.setAdjustMode(true);
mMiTabs.setNavigator(commonNavigator);
UIUtil.bindViewPager2(mMiTabs, mVpContent);
UIUtil.bindViewPager2(mMiTabs, mVpContent, null);
mConditionBeans = new ArrayList<>();
for (int i = 0; i < 10; i++) {
ConditionBean bean = new ConditionBean();

View File

@ -184,7 +184,7 @@
android:id="@+id/rlv_buildings"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/item_express_list" />
tools:listitem="@layout/item_patrol_key_area_list" />
<LinearLayout
android:layout_width="match_parent"

View File

@ -174,7 +174,7 @@ public class GridMainFragment extends BaseFragment {
break;
case "打卡签到":
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_CHECK_WORK)
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_ATTENDANCE)
.navigation();
break;
case "通讯录":
@ -418,9 +418,9 @@ public class GridMainFragment extends BaseFragment {
* @param data
*/
@Override
public void refreshContentView(String data) {
public void refreshContentView(String... data) {
try {
JSONArray array = new JSONArray(data);
JSONArray array = new JSONArray(data[0]);
if (array != null && array.length() > 0) {
for (int i = 0; i < array.length(); i++) {
JSONObject jObj = array.getJSONObject(i);

View File

@ -205,9 +205,9 @@ public class LeaderMainFragment extends BaseFragment {
* @param data
*/
@Override
public void refreshContentView(String data) {
public void refreshContentView(String... data) {
try {
JSONArray array = new JSONArray(data);
JSONArray array = new JSONArray(data[0]);
if (array != null && array.length() > 0) {
for (int i = 0; i < array.length(); i++) {
JSONObject jObj = array.getJSONObject(i);

View File

@ -205,9 +205,9 @@ public class SupervisionMainFragment extends BaseFragment {
* @param data
*/
@Override
public void refreshContentView(String data) {
public void refreshContentView(String... data) {
try {
JSONArray array = new JSONArray(data);
JSONArray array = new JSONArray(data[0]);
if (array != null && array.length() > 0) {
for (int i = 0; i < array.length(); i++) {
JSONObject jObj = array.getJSONObject(i);