Explorar el Código

.对接人员结构树接口
.对接人员详情接口

mq hace 5 años
padre
commit
2f5539906a

+ 4 - 1
app/src/main/java/com/unis/sxzcl/ui/aeration/AerationListFragment.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.sxzcl.ui.aeration;
2 2
 
3
+import android.os.Bundle;
3 4
 import android.view.LayoutInflater;
4 5
 import android.view.ViewGroup;
5 6
 
@@ -90,7 +91,9 @@ public class AerationListFragment extends BaseListFragment<FragmentBaseListTitle
90 91
     }
91 92
 
92 93
     private void goAdd() {
93
-
94
+        Bundle bundle = new Bundle();
95
+        bundle.putString("pageType", "add");
96
+        navigation(R.id.aerationDetailFragment, bundle);
94 97
     }
95 98
 
96 99
 

+ 45 - 19
app/src/main/java/com/unis/sxzcl/ui/basic/PersonDetailFragment.java

@@ -6,12 +6,16 @@ import android.view.View;
6 6
 import android.view.ViewGroup;
7 7
 
8 8
 import com.bumptech.glide.Glide;
9
-import com.unis.model.bean.PersonBean;
9
+import com.unis.model.DataCallBack;
10
+import com.unis.model.UrlPath;
11
+import com.unis.model.UserModel;
12
+import com.unis.model.bean.person.PersonBean;
10 13
 import com.unis.sxzcl.R;
11 14
 import com.unis.sxzcl.base.BaseFragment;
12 15
 import com.unis.sxzcl.databinding.FragmentPersonDetailBinding;
13 16
 import com.xyxsbj.mylibrary.tool.CallUtils;
14 17
 import com.xyxsbj.mylibrary.tool.ETTool;
18
+import com.xyxsbj.mylibrary.tool.ToastTool;
15 19
 
16 20
 /**
17 21
  * 包名: com.unis.sxzcl.ui.basic
@@ -26,10 +30,12 @@ import com.xyxsbj.mylibrary.tool.ETTool;
26 30
  */
27 31
 public class PersonDetailFragment extends BaseFragment<FragmentPersonDetailBinding> {
28 32
 
29
-    public static PersonDetailFragment newFragment(boolean showTitle, String data) {
33
+    private String mId;
34
+
35
+    public static PersonDetailFragment newFragment(boolean showTitle, String id) {
30 36
         Bundle bundle = new Bundle();
31 37
         bundle.putBoolean("showTitle", showTitle);
32
-        bundle.putString("data", data);
38
+        bundle.putString("id", id);
33 39
         PersonDetailFragment fragment = new PersonDetailFragment();
34 40
         fragment.setArguments(bundle);
35 41
         return fragment;
@@ -48,11 +54,7 @@ public class PersonDetailFragment extends BaseFragment<FragmentPersonDetailBindi
48 54
         boolean showTitle = bundle.getBoolean("showTitle", true);
49 55
         mBinding.bar.setVisibility(showTitle ? View.VISIBLE : View.GONE);
50 56
 
51
-        String data = bundle.getString("data");
52
-        PersonBean bean = getGson().fromJson(data, PersonBean.class);
53
-        if (bean == null) mBinding.bar.setTitle("");
54
-        else mBinding.bar.setTitle(bean.name);
55
-
57
+        mBinding.bar.setTitle("");
56 58
         mBinding.bar.setLeftClickListener(v -> onBack());
57 59
 
58 60
         mBinding.tvCall.setOnClickListener(v -> {
@@ -64,17 +66,41 @@ public class PersonDetailFragment extends BaseFragment<FragmentPersonDetailBindi
64 66
 
65 67
     @Override
66 68
     protected void onFirstShow() {
67
-        Glide.with(getContext())
68
-                .load(R.drawable.no_banner)
69
-                .placeholder(R.drawable.ic_img_loading)
70
-                .error(R.drawable.no_banner)
71
-                .into(mBinding.ivShow);
72
-        mBinding.tvName.setText("王全德");
73
-        mBinding.tvSex.setText("男");
74
-        mBinding.tvCompany.setText("中储粮XX直属库有限公司");
75
-        mBinding.tvDeportment.setText("仓储科");
76
-        mBinding.tvPost.setText("保管员");
77
-        mBinding.tvPhone.setText("13000000000");
69
+
70
+        mId = getArguments().getString("id");
71
+        if (mId == null) {
72
+            ToastTool.showLong("没有id参数");
73
+            onBack();
74
+            return;
75
+        }
76
+        showProgress("正在加载...", false);
77
+        UserModel.get().getPersonDetail(mId, new DataCallBack<PersonBean>() {
78
+            @Override
79
+            public void onSuccess(PersonBean data) {
80
+                if (!isActive()) return;
81
+                hideProgress();
82
+                mBinding.bar.setTitle(data.getUname());
83
+
84
+                Glide.with(getContext())
85
+                        .load(UrlPath.image_host + data.getPheadPortrait())
86
+                        .placeholder(R.drawable.ic_img_loading)
87
+                        .error(R.drawable.no_banner)
88
+                        .into(mBinding.ivShow);
89
+                mBinding.tvName.setText(data.getUname());
90
+                mBinding.tvSex.setText(data.getUsex());
91
+                mBinding.tvCompany.setText(data.getDepotName());
92
+                mBinding.tvDeportment.setText(data.getDepartmentName());
93
+                mBinding.tvPost.setText(data.getPpost());
94
+                mBinding.tvPhone.setText(data.getUphone());
95
+            }
96
+
97
+            @Override
98
+            public void onError(String error) {
99
+                super.onError(error);
100
+                if (!isActive()) return;
101
+                hideProgress();
102
+            }
103
+        });
78 104
     }
79 105
 
80 106
 

+ 77 - 22
app/src/main/java/com/unis/sxzcl/ui/basic/PersonFrameFragment.java

@@ -1,14 +1,21 @@
1 1
 package com.unis.sxzcl.ui.basic;
2 2
 
3
+import android.os.Bundle;
3 4
 import android.view.LayoutInflater;
4 5
 import android.view.ViewGroup;
5 6
 
6 7
 import com.chad.library.adapter.base.entity.node.BaseNode;
8
+import com.unis.model.DataCallBack;
9
+import com.unis.model.DepotModel;
10
+import com.unis.model.UserModel;
11
+import com.unis.model.bean.MultiDepotBean;
12
+import com.unis.model.bean.person.PersonTreeBean;
7 13
 import com.unis.sxzcl.R;
8 14
 import com.unis.sxzcl.base.BaseListFragment;
9 15
 import com.unis.sxzcl.databinding.FragmentBaseListBinding;
10 16
 import com.unis.sxzcl.widget.multi_list.BaseMultiBean;
11 17
 import com.unis.sxzcl.widget.multi_list.MultiListAdapter;
18
+import com.xyxsbj.mylibrary.tool.ToastTool;
12 19
 
13 20
 import java.util.ArrayList;
14 21
 import java.util.List;
@@ -28,24 +35,6 @@ public class PersonFrameFragment extends BaseListFragment<FragmentBaseListBindin
28 35
 
29 36
     private MultiListAdapter mAdapter;
30 37
 
31
-    @Override
32
-    public void onRefreshData() {
33
-        List<BaseMultiBean> list = new ArrayList<>();
34
-        BaseMultiBean oneBean = new BaseMultiBean("仓储部");
35
-        oneBean.level = 1;
36
-        oneBean.addChildNode(new BaseMultiBean("王建国").setIcon("http://").setContent("仓储科科长").setLevel(2));
37
-        oneBean.addChildNode(new BaseMultiBean("王全得").setIcon("http://").setContent("保管员").setLevel(2));
38
-        list.add(oneBean);
39
-
40
-        BaseMultiBean oneBean2 = new BaseMultiBean("财务部");
41
-        oneBean2.level = 1;
42
-        oneBean2.addChildNode(new BaseMultiBean("王建国").setIcon("http://").setContent("仓储科科长").setLevel(2));
43
-        oneBean2.addChildNode(new BaseMultiBean("王全得").setIcon("http://").setContent("保管员").setLevel(2));
44
-        list.add(oneBean2);
45
-
46
-        mAdapter.setList(list);
47
-        loadComplete();
48
-    }
49 38
 
50 39
     @Override
51 40
     protected FragmentBaseListBinding getViewBinding(LayoutInflater inflater, ViewGroup container) {
@@ -67,11 +56,77 @@ public class PersonFrameFragment extends BaseListFragment<FragmentBaseListBindin
67 56
 
68 57
     @Override
69 58
     public void onItemClickListener(BaseNode data) {
70
-        if (!(data instanceof BaseMultiBean)) {
59
+        BaseMultiBean item = ((BaseMultiBean) data);
60
+        if (item.level == 2) {
61
+            PersonTreeBean personTreeBean = getGson().fromJson(item.extra, PersonTreeBean.class);
62
+            Bundle bundle = new Bundle();
63
+            bundle.putString("id", personTreeBean.personnelId);
64
+            navigation(R.id.personDetailFragment,bundle);
65
+        }
66
+    }
67
+
68
+
69
+    @Override
70
+    public void onRefreshData() {
71
+
72
+        getData();
73
+    }
74
+
75
+    public void getData() {
76
+        MultiDepotBean depot = DepotModel.get().getSelectDepot();
77
+        if (depot == null) {
78
+            ToastTool.showLong("请先选择库");
79
+            onBack();
71 80
             return;
72 81
         }
73
-        int level = ((BaseMultiBean) data).getLevel();
74
-        if (level == 2)
75
-            navigation(R.id.personDetailFragment);
82
+        showProgress("正在加载...", false);
83
+        UserModel.get().getPersonTree("1", new DataCallBack<List<PersonTreeBean>>() {
84
+            @Override
85
+            public void onSuccess(List<PersonTreeBean> data) {
86
+                if (!isActive()) return;
87
+                hideProgress();
88
+
89
+                List<BaseNode> list = new ArrayList<>();
90
+                int index = 0;
91
+                initListData(index, list, data);
92
+                mAdapter.setList(list);
93
+
94
+                loadComplete();
95
+            }
96
+
97
+            @Override
98
+            public void onError(String error) {
99
+                super.onError(error);
100
+                if (!isActive()) return;
101
+                hideProgress();
102
+                loadError();
103
+            }
104
+        });
76 105
     }
106
+
107
+    private void initListData(int level, List<BaseNode> list, List<PersonTreeBean> data) {
108
+        level++;
109
+        for (PersonTreeBean bean : data) {
110
+            BaseMultiBean item = new BaseMultiBean(bean.departmentStaffName);
111
+            item.level = level;
112
+            // 将数据源加入实体中
113
+            PersonTreeBean personTreeBean = new PersonTreeBean();
114
+            personTreeBean.departmentStaffId = bean.departmentStaffId;
115
+            personTreeBean.departmentStaffName = bean.departmentStaffName;
116
+            personTreeBean.isDepartmentStaff = bean.isDepartmentStaff;
117
+            personTreeBean.personnelId = bean.personnelId;
118
+            item.extra = getGson().toJson(personTreeBean);
119
+
120
+            //如果有子级 递归
121
+            if (bean.children != null) {
122
+                List<BaseNode> childList = new ArrayList<>();
123
+                initListData(level, childList, bean.children);
124
+                item.addChildNode(childList);
125
+            }
126
+
127
+            list.add(item);
128
+        }
129
+
130
+    }
131
+
77 132
 }

+ 0 - 4
app/src/main/java/com/unis/sxzcl/ui/company/CompanyListFragment.java

@@ -56,10 +56,6 @@ public class CompanyListFragment extends BaseListFragment<FragmentBaseListTitleB
56 56
 
57 57
     @Override
58 58
     public void onRefreshData() {
59
-        if (mAdapter.getData() != null && mAdapter.getData().size() > 0) {
60
-            loadComplete();
61
-            return;
62
-        }
63 59
 
64 60
         DepotModel.get().getMultiList(new DataCallBack<List<MultiDepotBean>>() {
65 61
             @Override

+ 3 - 0
app/src/main/java/com/unis/sxzcl/ui/home/MainActivity.java

@@ -7,6 +7,7 @@ import androidx.navigation.NavBackStackEntry;
7 7
 import androidx.navigation.NavController;
8 8
 import androidx.navigation.Navigation;
9 9
 
10
+import com.unis.model.UserModel;
10 11
 import com.unis.model.event.LoginOutEvent;
11 12
 import com.unis.model.event.TextSizeEvent;
12 13
 import com.unis.sxzcl.R;
@@ -85,6 +86,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> {
85 86
      */
86 87
     @Subscribe(threadMode = ThreadMode.MAIN)
87 88
     public void onLoginOut(LoginOutEvent event) {
89
+        // 删除用户信息
90
+        UserModel.get().removeUser();
88 91
         // 重启当前页 弹出其他页面
89 92
         ActivityTool.startActivity(getContext(), this.getClass());
90 93
         // 跳转登录

+ 3 - 3
app/src/main/java/com/unis/sxzcl/ui/person/PersonListAdapter.java

@@ -6,7 +6,7 @@ import com.bumptech.glide.Glide;
6 6
 import com.chad.library.adapter.base.BaseQuickAdapter;
7 7
 import com.chad.library.adapter.base.module.LoadMoreModule;
8 8
 import com.chad.library.adapter.base.viewholder.BaseViewHolder;
9
-import com.unis.model.bean.PersonBean;
9
+import com.unis.model.bean.person.PersonBean;
10 10
 import com.unis.sxzcl.R;
11 11
 
12 12
 import org.jetbrains.annotations.NotNull;
@@ -38,7 +38,7 @@ public class PersonListAdapter extends BaseQuickAdapter<PersonBean, BaseViewHold
38 38
                 .error(R.drawable.no_banner)
39 39
                 .into(imageView);
40 40
 
41
-        holder.setText(R.id.tv_name, item.name)
42
-                .setText(R.id.tv_post, item.post);
41
+        holder.setText(R.id.tv_name, item.getUname())
42
+                .setText(R.id.tv_post, item.getPpost());
43 43
     }
44 44
 }

+ 6 - 6
app/src/main/java/com/unis/sxzcl/ui/person/PersonListFragment.java

@@ -12,7 +12,7 @@ import androidx.annotation.NonNull;
12 12
 
13 13
 import com.chad.library.adapter.base.BaseQuickAdapter;
14 14
 import com.chad.library.adapter.base.listener.OnItemClickListener;
15
-import com.unis.model.bean.PersonBean;
15
+import com.unis.model.bean.person.PersonBean;
16 16
 import com.unis.sxzcl.R;
17 17
 import com.unis.sxzcl.base.BaseListFragment;
18 18
 import com.unis.sxzcl.databinding.FragmentPersonListBinding;
@@ -134,11 +134,11 @@ public class PersonListFragment extends BaseListFragment<FragmentPersonListBindi
134 134
                 mAdapter.getData().clear();
135 135
                 mAdapter.notifyDataSetChanged();
136 136
             }
137
-            mAdapter.addData(new PersonBean("陈晓军", "", "主任"));
138
-            mAdapter.addData(new PersonBean("Cherry", "", "仓储科科长"));
139
-            mAdapter.addData(new PersonBean("常道", "", "保管员"));
140
-            mAdapter.addData(new PersonBean("大鹏", "", "保管员"));
141
-            mAdapter.addData(new PersonBean("大大熊", "", "保管员"));
137
+//            mAdapter.addData(new PersonBean("陈晓军", "", "主任"));
138
+//            mAdapter.addData(new PersonBean("Cherry", "", "仓储科科长"));
139
+//            mAdapter.addData(new PersonBean("常道", "", "保管员"));
140
+//            mAdapter.addData(new PersonBean("大鹏", "", "保管员"));
141
+//            mAdapter.addData(new PersonBean("大大熊", "", "保管员"));
142 142
             loadEnd();
143 143
         }, 500);
144 144
     }

+ 1 - 1
app/src/main/java/com/unis/sxzcl/ui/person/person_work/PersonWorkListAdapter.java

@@ -3,7 +3,7 @@ package com.unis.sxzcl.ui.person.person_work;
3 3
 import com.chad.library.adapter.base.BaseQuickAdapter;
4 4
 import com.chad.library.adapter.base.module.LoadMoreModule;
5 5
 import com.chad.library.adapter.base.viewholder.BaseViewHolder;
6
-import com.unis.model.bean.PersonWorkBean;
6
+import com.unis.model.bean.person.PersonWorkBean;
7 7
 import com.unis.sxzcl.R;
8 8
 
9 9
 import org.jetbrains.annotations.NotNull;

+ 1 - 1
app/src/main/java/com/unis/sxzcl/ui/person/person_work/PersonWorkListFragment.java

@@ -5,7 +5,7 @@ import android.os.Handler;
5 5
 import android.view.LayoutInflater;
6 6
 import android.view.ViewGroup;
7 7
 
8
-import com.unis.model.bean.PersonWorkBean;
8
+import com.unis.model.bean.person.PersonWorkBean;
9 9
 import com.unis.sxzcl.base.BaseListFragment;
10 10
 import com.unis.sxzcl.databinding.FragmentBaseListBinding;
11 11
 

+ 2 - 2
app/src/main/java/com/unis/sxzcl/ui/work_module/WorkModuleAdapter.java

@@ -99,8 +99,8 @@ public class WorkModuleAdapter extends BaseQuickAdapter<WorkModule, BaseViewHold
99 99
                 break;
100 100
             case WorkbenchModel.TYPE_LQJC:
101 101
                 // 粮情检查
102
-                currentFragmentId = R.id.grainCheckHomeFragment;
103
-//                showHouseSelect(R.id.grainCheckHomeFragment);
102
+//                currentFragmentId = R.id.grainCheckHomeFragment;
103
+                showHouseSelect(R.id.grainCheckHomeFragment);
104 104
                 break;
105 105
             case WorkbenchModel.TYPE_JXTF:
106 106
                 // 机械通风

+ 2 - 2
app/src/main/java/com/unis/sxzcl/widget/multi_list/MultiListAdapter.java

@@ -110,7 +110,7 @@ public class MultiListAdapter extends BaseNodeAdapter implements LoadMoreModule
110 110
 
111 111
             // 箭头标记
112 112
             holder.getView(R.id.iv_flag).setSelected(item.isExpanded());
113
-            if (item.getChildNode() == null) {
113
+            if (item.getChildNode() == null || item.getChildNode().size() == 0) {
114 114
                 holder.setGone(R.id.iv_flag, true);
115 115
             } else {
116 116
                 holder.setGone(R.id.iv_flag, false);
@@ -129,7 +129,7 @@ public class MultiListAdapter extends BaseNodeAdapter implements LoadMoreModule
129 129
             BaseMultiBean item = (BaseMultiBean) data;
130 130
             helper.getView(R.id.iv_flag).setSelected(!item.isExpanded());
131 131
             getAdapter().expandOrCollapse(position);
132
-            if (mCallback != null && item.getChildNode() == null)
132
+            if (mCallback != null && (item.getChildNode() == null || item.getChildNode().size() == 0))
133 133
                 mCallback.onItemClickListener(data);
134 134
         }
135 135
 

+ 6 - 6
app/src/main/res/layout/fragment_person_detail.xml

@@ -45,7 +45,7 @@
45 45
                 android:layout_width="wrap_content"
46 46
                 android:layout_height="wrap_content"
47 47
                 android:layout_gravity="center_horizontal"
48
-                android:text="王全德"
48
+                android:text=""
49 49
                 android:textColor="@color/colorTextBlack"
50 50
                 android:textSize="?attr/textSizeXXX"
51 51
                 android:textStyle="bold" />
@@ -64,7 +64,7 @@
64 64
                 android:layout_width="wrap_content"
65 65
                 android:layout_height="wrap_content"
66 66
                 android:layout_marginLeft="16dp"
67
-                android:text=""
67
+                android:text=""
68 68
                 android:textColor="@color/colorTheme"
69 69
                 android:textSize="?attr/textSizeXXX" />
70 70
 
@@ -82,7 +82,7 @@
82 82
                 android:layout_width="wrap_content"
83 83
                 android:layout_height="wrap_content"
84 84
                 android:layout_marginLeft="16dp"
85
-                android:text="中储粮XX直属库有限公司"
85
+                android:text=""
86 86
                 android:textColor="@color/colorTheme"
87 87
                 android:textSize="?attr/textSizeXXX" />
88 88
 
@@ -100,7 +100,7 @@
100 100
                 android:layout_width="wrap_content"
101 101
                 android:layout_height="wrap_content"
102 102
                 android:layout_marginLeft="16dp"
103
-                android:text="仓储科"
103
+                android:text=""
104 104
                 android:textColor="@color/colorTheme"
105 105
                 android:textSize="?attr/textSizeXXX" />
106 106
 
@@ -118,7 +118,7 @@
118 118
                 android:layout_width="wrap_content"
119 119
                 android:layout_height="wrap_content"
120 120
                 android:layout_marginLeft="16dp"
121
-                android:text="保管员"
121
+                android:text=""
122 122
                 android:textColor="@color/colorTheme"
123 123
                 android:textSize="?attr/textSizeXXX" />
124 124
 
@@ -142,7 +142,7 @@
142 142
                     android:layout_width="0dp"
143 143
                     android:layout_height="wrap_content"
144 144
                     android:layout_weight="1"
145
-                    android:text="13000000000"
145
+                    android:text=""
146 146
                     android:textColor="@color/colorTheme"
147 147
                     android:textSize="?attr/textSizeXXX" />
148 148
 

+ 12 - 6
model/src/main/java/com/unis/model/UrlPath.java

@@ -14,26 +14,32 @@ package com.unis.model;
14 14
 public class UrlPath {
15 15
 
16 16
     //服务器地址
17
-    public static final String host = "http://10.10.1.25:9066/";
17
+//    public static final String host = "http://10.10.1.25:9066/";
18
+    public static final String host = "http://101.36.160.140:21021/api"; // 02服务器
18 19
     // vpn
19
-//    public static final String host = "http://172.16.0.46:9603/";
20
+//    public static final String host = "http://172.16.0.46:9603";
20 21
     public static final String host1 = "http://10.100.1.63:9605";
21 22
 
22 23
     //图片地址
23
-    public static final String image_host = host + "csc-szls-system-manage/minio/preViewPicture/";
24
+    public static final String image_host = host + "/csc-szls-system-manage/minio/preViewPicture/";
24 25
 
25 26
     // 登录
26
-    public static final String login = host + "csc-szls-system-manage/public/login";
27
+    public static final String login = host + "/csc-szls-system-manage/public/login";
27 28
     // 注销登录
28
-    public static final String logout = host + "csc-szls-system-manage/public/logout";
29
+    public static final String logout = host + "/csc-szls-system-manage/public/logout";
29 30
 
30 31
 
31 32
     // 多级库列表
32
-    public static final String depot_multi_list = host + "csc-szls-system-manage/basicsDepot/authority/getAll";
33
+    public static final String depot_multi_list = host + "/csc-szls-system-manage/basicsDepot/authority/getAll";
33 34
 
34 35
     // 仓房列表
35 36
     public static final String house_list = host + "/csc-szls-system-manage/basicsWarehouse/authority/getDepotAll";
36 37
 
38
+    // 人员树
39
+    public static final String person_tree = host + "/csc-szls-system-manage/sysPersonnel/authority/getByDepotId";
40
+    // 人员详情
41
+    public static final String person_detail = host + "/csc-szls-system-manage/sysPersonnel/authority/getById";
42
+
37 43
 
38 44
     // 粮情检查记录
39 45
 //    public static final String grain_check_list = host + "/csc-szls-business/grainConditionRecord/authority/getPage";

+ 53 - 1
model/src/main/java/com/unis/model/UserModel.java

@@ -3,10 +3,13 @@ package com.unis.model;
3 3
 import androidx.annotation.StringDef;
4 4
 
5 5
 import com.google.gson.Gson;
6
+import com.google.gson.reflect.TypeToken;
6 7
 import com.lzy.okgo.OkGo;
7 8
 import com.lzy.okgo.model.Response;
8 9
 import com.unis.model.bean.LoginBean;
9 10
 import com.unis.model.bean.UserBean;
11
+import com.unis.model.bean.person.PersonBean;
12
+import com.unis.model.bean.person.PersonTreeBean;
10 13
 import com.xyxsbj.mylibrary.tool.SPTool;
11 14
 
12 15
 import org.json.JSONException;
@@ -14,6 +17,7 @@ import org.json.JSONException;
14 17
 import java.lang.annotation.Retention;
15 18
 import java.lang.annotation.RetentionPolicy;
16 19
 import java.util.HashMap;
20
+import java.util.List;
17 21
 import java.util.Map;
18 22
 
19 23
 /**
@@ -139,7 +143,6 @@ public class UserModel {
139 143
                 .execute(new MyStringCallback() {
140 144
                     @Override
141 145
                     protected void onSuccessResult(Response<String> response) throws JSONException {
142
-                        removeUser();
143 146
                         callBack.onSuccess(response.body());
144 147
                     }
145 148
 
@@ -161,5 +164,54 @@ public class UserModel {
161 164
         SPTool.remove(Constant.KEY_HEAD_TOKEN);
162 165
     }
163 166
 
167
+    /**
168
+     * 获取人员树
169
+     */
170
+    public void getPersonTree(String depotId, final DataCallBack<List<PersonTreeBean>> callBack) {
171
+        OkGo.<String>get(UrlPath.person_tree)
172
+                .params("depotId", depotId)
173
+                .execute(new MyStringCallback() {
174
+                    @Override
175
+                    protected void onSuccessResult(Response<String> response) throws JSONException {
176
+                        String json = getDataJson(response);
177
+                        List<PersonTreeBean> list =
178
+                                new Gson().fromJson(json, new TypeToken<List<PersonTreeBean>>() {
179
+                                }.getType());
180
+                        callBack.onSuccess(list);
181
+                    }
182
+
183
+                    @Override
184
+                    public void onError(Response<String> response) {
185
+                        super.onError(response);
186
+                        callBack.onError(getErrorMsg(response));
187
+                    }
188
+                });
189
+    }
190
+
191
+    /**
192
+     * 获取人员详情
193
+     *
194
+     * @param id
195
+     * @param callBack
196
+     */
197
+    public void getPersonDetail(String id, final DataCallBack<PersonBean> callBack) {
198
+        OkGo.<String>get(UrlPath.person_detail + "/" + id)
199
+                .execute(new MyStringCallback() {
200
+                    @Override
201
+                    protected void onSuccessResult(Response<String> response) throws JSONException {
202
+                        String json = getDataJson(response);
203
+                        PersonBean personBean = new Gson().fromJson(json, PersonBean.class);
204
+                        callBack.onSuccess(personBean);
205
+                    }
206
+
207
+                    @Override
208
+                    public void onError(Response<String> response) {
209
+                        super.onError(response);
210
+                        callBack.onError(getErrorMsg(response));
211
+                    }
212
+                });
213
+
214
+    }
215
+
164 216
 
165 217
 }

+ 0 - 24
model/src/main/java/com/unis/model/bean/PersonBean.java

@@ -1,24 +0,0 @@
1
-package com.unis.model.bean;
2
-
3
-/**
4
- * 包名: com.unis.model.bean
5
- * 类名: PersonBean
6
- * 作用描述:
7
- * 创建人: mQ
8
- * 创建时间: 2020/11/30 19:58
9
- * 更新人:
10
- * 更新时间: 2020/11/30 19:58
11
- * 更新说明:
12
- * 版本号: 1.0
13
- */
14
-public class PersonBean {
15
-    public String name;
16
-    public String portrait;
17
-    public String post;
18
-
19
-    public PersonBean(String name, String portrait, String post) {
20
-        this.name = name;
21
-        this.portrait = portrait;
22
-        this.post = post;
23
-    }
24
-}

+ 419 - 0
model/src/main/java/com/unis/model/bean/person/PersonBean.java

@@ -0,0 +1,419 @@
1
+package com.unis.model.bean.person;
2
+
3
+/**
4
+ * 包名: com.unis.model.bean
5
+ * 类名: PersonBean
6
+ * 作用描述:
7
+ * 创建人: mQ
8
+ * 创建时间: 2020/11/30 19:58
9
+ * 更新人:
10
+ * 更新时间: 2020/11/30 19:58
11
+ * 更新说明:
12
+ * 版本号: 1.0
13
+ */
14
+public class PersonBean {
15
+
16
+    /**
17
+     * uStatus : 1
18
+     * departmentId : 3
19
+     * departmentName : 人事部
20
+     * depotId : 1
21
+     * depotName : bbbb
22
+     * storehouseIds : null
23
+     * storehouseNames : null
24
+     * companyId : null
25
+     * companyName :
26
+     * createTime : 2020-12-01 14:33:08
27
+     * createPeople : 3
28
+     * alternateFieldsOne : 3
29
+     * alternateFieldsTwo : 3
30
+     * pid : 3
31
+     * uname : 刘邦
32
+     * pheadPortrait : 3
33
+     * usex : 3
34
+     * ubirthday : null
35
+     * umail : 3
36
+     * pworkYears : 3
37
+     * ppoliticalOutlook : 3
38
+     * ppartyTime : null
39
+     * pdepartment : 3
40
+     * pfirstDegree : 3
41
+     * puniversityGraduated : 3
42
+     * pmajor : 3
43
+     * pformEducation : 3
44
+     * pacademicDegree : 3
45
+     * phighestEducation : 3
46
+     * puniversityGraduatedTwo : 3
47
+     * uphone : 3
48
+     * ppost : 3
49
+     * pmajorTwo : 3
50
+     * pformEducationTwo : 3
51
+     * pacademicDegreeTwo : 3
52
+     * pmajorThree : 3
53
+     * pgrade : 3
54
+     * plicensingAgency : 3
55
+     * plicensingTime : null
56
+     * pcertificateAddress : 3
57
+     */
58
+
59
+    private String uStatus;
60
+    private String departmentId;
61
+    private String departmentName;
62
+    private String depotId;
63
+    private String depotName;
64
+    private String storehouseIds;
65
+    private String storehouseNames;
66
+    private String companyId;
67
+    private String companyName;
68
+    private String createTime;
69
+    private String createPeople;
70
+    private String alternateFieldsOne;
71
+    private String alternateFieldsTwo;
72
+    private String pid;
73
+    private String uname;
74
+    private String pheadPortrait;
75
+    private String usex;
76
+    private String ubirthday;
77
+    private String umail;
78
+    private String pworkYears;
79
+    private String ppoliticalOutlook;
80
+    private String ppartyTime;
81
+    private String pdepartment;
82
+    private String pfirstDegree;
83
+    private String puniversityGraduated;
84
+    private String pmajor;
85
+    private String pformEducation;
86
+    private String pacademicDegree;
87
+    private String phighestEducation;
88
+    private String puniversityGraduatedTwo;
89
+    private String uphone;
90
+    private String ppost;
91
+    private String pmajorTwo;
92
+    private String pformEducationTwo;
93
+    private String pacademicDegreeTwo;
94
+    private String pmajorThree;
95
+    private String pgrade;
96
+    private String plicensingAgency;
97
+    private String plicensingTime;
98
+    private String pcertificateAddress;
99
+
100
+    public String getuStatus() {
101
+        return uStatus;
102
+    }
103
+
104
+    public void setuStatus(String uStatus) {
105
+        this.uStatus = uStatus;
106
+    }
107
+
108
+    public String getDepartmentId() {
109
+        return departmentId;
110
+    }
111
+
112
+    public void setDepartmentId(String departmentId) {
113
+        this.departmentId = departmentId;
114
+    }
115
+
116
+    public String getDepartmentName() {
117
+        return departmentName;
118
+    }
119
+
120
+    public void setDepartmentName(String departmentName) {
121
+        this.departmentName = departmentName;
122
+    }
123
+
124
+    public String getDepotId() {
125
+        return depotId;
126
+    }
127
+
128
+    public void setDepotId(String depotId) {
129
+        this.depotId = depotId;
130
+    }
131
+
132
+    public String getDepotName() {
133
+        return depotName;
134
+    }
135
+
136
+    public void setDepotName(String depotName) {
137
+        this.depotName = depotName;
138
+    }
139
+
140
+    public String getStorehouseIds() {
141
+        return storehouseIds;
142
+    }
143
+
144
+    public void setStorehouseIds(String storehouseIds) {
145
+        this.storehouseIds = storehouseIds;
146
+    }
147
+
148
+    public String getStorehouseNames() {
149
+        return storehouseNames;
150
+    }
151
+
152
+    public void setStorehouseNames(String storehouseNames) {
153
+        this.storehouseNames = storehouseNames;
154
+    }
155
+
156
+    public String getCompanyId() {
157
+        return companyId;
158
+    }
159
+
160
+    public void setCompanyId(String companyId) {
161
+        this.companyId = companyId;
162
+    }
163
+
164
+    public String getCompanyName() {
165
+        return companyName;
166
+    }
167
+
168
+    public void setCompanyName(String companyName) {
169
+        this.companyName = companyName;
170
+    }
171
+
172
+    public String getCreateTime() {
173
+        return createTime;
174
+    }
175
+
176
+    public void setCreateTime(String createTime) {
177
+        this.createTime = createTime;
178
+    }
179
+
180
+    public String getCreatePeople() {
181
+        return createPeople;
182
+    }
183
+
184
+    public void setCreatePeople(String createPeople) {
185
+        this.createPeople = createPeople;
186
+    }
187
+
188
+    public String getAlternateFieldsOne() {
189
+        return alternateFieldsOne;
190
+    }
191
+
192
+    public void setAlternateFieldsOne(String alternateFieldsOne) {
193
+        this.alternateFieldsOne = alternateFieldsOne;
194
+    }
195
+
196
+    public String getAlternateFieldsTwo() {
197
+        return alternateFieldsTwo;
198
+    }
199
+
200
+    public void setAlternateFieldsTwo(String alternateFieldsTwo) {
201
+        this.alternateFieldsTwo = alternateFieldsTwo;
202
+    }
203
+
204
+    public String getPid() {
205
+        return pid;
206
+    }
207
+
208
+    public void setPid(String pid) {
209
+        this.pid = pid;
210
+    }
211
+
212
+    public String getUname() {
213
+        return uname;
214
+    }
215
+
216
+    public void setUname(String uname) {
217
+        this.uname = uname;
218
+    }
219
+
220
+    public String getPheadPortrait() {
221
+        return pheadPortrait;
222
+    }
223
+
224
+    public void setPheadPortrait(String pheadPortrait) {
225
+        this.pheadPortrait = pheadPortrait;
226
+    }
227
+
228
+    public String getUsex() {
229
+        return usex;
230
+    }
231
+
232
+    public void setUsex(String usex) {
233
+        this.usex = usex;
234
+    }
235
+
236
+    public String getUbirthday() {
237
+        return ubirthday;
238
+    }
239
+
240
+    public void setUbirthday(String ubirthday) {
241
+        this.ubirthday = ubirthday;
242
+    }
243
+
244
+    public String getUmail() {
245
+        return umail;
246
+    }
247
+
248
+    public void setUmail(String umail) {
249
+        this.umail = umail;
250
+    }
251
+
252
+    public String getPworkYears() {
253
+        return pworkYears;
254
+    }
255
+
256
+    public void setPworkYears(String pworkYears) {
257
+        this.pworkYears = pworkYears;
258
+    }
259
+
260
+    public String getPpoliticalOutlook() {
261
+        return ppoliticalOutlook;
262
+    }
263
+
264
+    public void setPpoliticalOutlook(String ppoliticalOutlook) {
265
+        this.ppoliticalOutlook = ppoliticalOutlook;
266
+    }
267
+
268
+    public String getPpartyTime() {
269
+        return ppartyTime;
270
+    }
271
+
272
+    public void setPpartyTime(String ppartyTime) {
273
+        this.ppartyTime = ppartyTime;
274
+    }
275
+
276
+    public String getPdepartment() {
277
+        return pdepartment;
278
+    }
279
+
280
+    public void setPdepartment(String pdepartment) {
281
+        this.pdepartment = pdepartment;
282
+    }
283
+
284
+    public String getPfirstDegree() {
285
+        return pfirstDegree;
286
+    }
287
+
288
+    public void setPfirstDegree(String pfirstDegree) {
289
+        this.pfirstDegree = pfirstDegree;
290
+    }
291
+
292
+    public String getPuniversityGraduated() {
293
+        return puniversityGraduated;
294
+    }
295
+
296
+    public void setPuniversityGraduated(String puniversityGraduated) {
297
+        this.puniversityGraduated = puniversityGraduated;
298
+    }
299
+
300
+    public String getPmajor() {
301
+        return pmajor;
302
+    }
303
+
304
+    public void setPmajor(String pmajor) {
305
+        this.pmajor = pmajor;
306
+    }
307
+
308
+    public String getPformEducation() {
309
+        return pformEducation;
310
+    }
311
+
312
+    public void setPformEducation(String pformEducation) {
313
+        this.pformEducation = pformEducation;
314
+    }
315
+
316
+    public String getPacademicDegree() {
317
+        return pacademicDegree;
318
+    }
319
+
320
+    public void setPacademicDegree(String pacademicDegree) {
321
+        this.pacademicDegree = pacademicDegree;
322
+    }
323
+
324
+    public String getPhighestEducation() {
325
+        return phighestEducation;
326
+    }
327
+
328
+    public void setPhighestEducation(String phighestEducation) {
329
+        this.phighestEducation = phighestEducation;
330
+    }
331
+
332
+    public String getPuniversityGraduatedTwo() {
333
+        return puniversityGraduatedTwo;
334
+    }
335
+
336
+    public void setPuniversityGraduatedTwo(String puniversityGraduatedTwo) {
337
+        this.puniversityGraduatedTwo = puniversityGraduatedTwo;
338
+    }
339
+
340
+    public String getUphone() {
341
+        return uphone;
342
+    }
343
+
344
+    public void setUphone(String uphone) {
345
+        this.uphone = uphone;
346
+    }
347
+
348
+    public String getPpost() {
349
+        return ppost;
350
+    }
351
+
352
+    public void setPpost(String ppost) {
353
+        this.ppost = ppost;
354
+    }
355
+
356
+    public String getPmajorTwo() {
357
+        return pmajorTwo;
358
+    }
359
+
360
+    public void setPmajorTwo(String pmajorTwo) {
361
+        this.pmajorTwo = pmajorTwo;
362
+    }
363
+
364
+    public String getPformEducationTwo() {
365
+        return pformEducationTwo;
366
+    }
367
+
368
+    public void setPformEducationTwo(String pformEducationTwo) {
369
+        this.pformEducationTwo = pformEducationTwo;
370
+    }
371
+
372
+    public String getPacademicDegreeTwo() {
373
+        return pacademicDegreeTwo;
374
+    }
375
+
376
+    public void setPacademicDegreeTwo(String pacademicDegreeTwo) {
377
+        this.pacademicDegreeTwo = pacademicDegreeTwo;
378
+    }
379
+
380
+    public String getPmajorThree() {
381
+        return pmajorThree;
382
+    }
383
+
384
+    public void setPmajorThree(String pmajorThree) {
385
+        this.pmajorThree = pmajorThree;
386
+    }
387
+
388
+    public String getPgrade() {
389
+        return pgrade;
390
+    }
391
+
392
+    public void setPgrade(String pgrade) {
393
+        this.pgrade = pgrade;
394
+    }
395
+
396
+    public String getPlicensingAgency() {
397
+        return plicensingAgency;
398
+    }
399
+
400
+    public void setPlicensingAgency(String plicensingAgency) {
401
+        this.plicensingAgency = plicensingAgency;
402
+    }
403
+
404
+    public String getPlicensingTime() {
405
+        return plicensingTime;
406
+    }
407
+
408
+    public void setPlicensingTime(String plicensingTime) {
409
+        this.plicensingTime = plicensingTime;
410
+    }
411
+
412
+    public String getPcertificateAddress() {
413
+        return pcertificateAddress;
414
+    }
415
+
416
+    public void setPcertificateAddress(String pcertificateAddress) {
417
+        this.pcertificateAddress = pcertificateAddress;
418
+    }
419
+}

+ 28 - 0
model/src/main/java/com/unis/model/bean/person/PersonTreeBean.java

@@ -0,0 +1,28 @@
1
+package com.unis.model.bean.person;
2
+
3
+import java.util.List;
4
+
5
+/**
6
+ * 包名: com.unis.model.bean.person
7
+ * 类名: PersonTreeBean
8
+ * 作用描述:
9
+ * 创建人: mQ
10
+ * 创建时间: 2020/12/15 15:06
11
+ * 更新人:
12
+ * 更新时间: 2020/12/15 15:06
13
+ * 更新说明:
14
+ * 版本号: 1.0
15
+ */
16
+public class PersonTreeBean {
17
+
18
+    // 部门id
19
+    public Integer departmentStaffId;
20
+    // 人员id
21
+    public String personnelId;
22
+    // 名称
23
+    public String departmentStaffName;
24
+    // 0部门 1人员
25
+    public Integer isDepartmentStaff;
26
+
27
+    public List<PersonTreeBean> children;
28
+}

+ 1 - 1
model/src/main/java/com/unis/model/bean/PersonWorkBean.java

@@ -1,4 +1,4 @@
1
-package com.unis.model.bean;
1
+package com.unis.model.bean.person;
2 2
 
3 3
 /**
4 4
  * 包名: com.unis.model.bean

+ 0 - 0
model/src/main/java/com/unis/model/bean/person/人员.txt