Browse Source

.封装基本对话框
.新增输入对话框
.新增粮情检查列表页
.新增粮情检查新增页

mq 5 years ago
parent
commit
e90f31d720
29 changed files with 1779 additions and 21 deletions
  1. 175 0
      app/src/main/java/com/unis/sxzcl/ui/grain_check/DetailItemBean.java
  2. 28 0
      app/src/main/java/com/unis/sxzcl/ui/grain_check/DetailItemType.java
  3. 216 0
      app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckDetailAdapter.java
  4. 138 0
      app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckDetailFragment.java
  5. 92 0
      app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckHomeFragment.java
  6. 61 0
      app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckListAdapter.java
  7. 101 0
      app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckListFragment.java
  8. 20 13
      app/src/main/java/com/unis/sxzcl/ui/work_module/WorkModuleAdapter.java
  9. 1 2
      app/src/main/java/com/unis/sxzcl/ui/work_module/WorkModuleFragment.java
  10. 4 0
      app/src/main/java/com/unis/sxzcl/widget/BottomMultipleAdapter.java
  11. 10 0
      app/src/main/java/com/unis/sxzcl/widget/BottomMultipleListDialog.java
  12. 121 0
      app/src/main/java/com/unis/sxzcl/widget/dialog/InputDialog.java
  13. 255 0
      app/src/main/java/com/unis/sxzcl/widget/dialog/SystemDialog.java
  14. 44 0
      app/src/main/res/layout/dialog_input.xml
  15. 113 0
      app/src/main/res/layout/dialog_system.xml
  16. 63 0
      app/src/main/res/layout/fragment_add.xml
  17. 51 0
      app/src/main/res/layout/item_detail_input.xml
  18. 36 0
      app/src/main/res/layout/item_detail_radio.xml
  19. 62 0
      app/src/main/res/layout/item_list_grain_check.xml
  20. 17 2
      app/src/main/res/navigation/nav_graph.xml
  21. 17 0
      app/src/main/res/values/styles.xml
  22. 10 0
      icon/src/main/res/drawable/ic_clear_white.xml
  23. 10 0
      icon/src/main/res/drawable/ic_finish_accent.xml
  24. 10 0
      icon/src/main/res/drawable/ic_wait_blue.xml
  25. 2 0
      model/src/main/java/com/unis/model/Constant.java
  26. 49 0
      model/src/main/java/com/unis/model/HouseModel.java
  27. 4 1
      model/src/main/java/com/unis/model/UrlPath.java
  28. 60 0
      model/src/main/java/com/unis/model/bean/GrainCheckBean.java
  29. 9 3
      mylibrary/src/main/java/com/xyxsbj/mylibrary/tool/ETTool.java

+ 175 - 0
app/src/main/java/com/unis/sxzcl/ui/grain_check/DetailItemBean.java

@@ -0,0 +1,175 @@
1
+package com.unis.sxzcl.ui.grain_check;
2
+
3
+/**
4
+ * 包名: com.unis.sxzcl.ui.grain_check
5
+ * 类名: DetailItemBean
6
+ * 作用描述:
7
+ * 创建人: mQ
8
+ * 创建时间: 2020/12/11 10:44
9
+ * 更新人:
10
+ * 更新时间: 2020/12/11 10:44
11
+ * 更新说明:
12
+ * 版本号: 1.0
13
+ */
14
+public class DetailItemBean {
15
+
16
+    /******************* 属性 *********************/
17
+
18
+    // 样式类型
19
+    private int itemType;
20
+    // 索引
21
+    private Integer index;
22
+    // id
23
+    private long id;
24
+    // 流程id
25
+    private long flowId;
26
+    // 标题
27
+    private String title;
28
+    // 时间
29
+    private String time;
30
+    // 选项集合
31
+    private String[] option;
32
+    // 选中项
33
+    private Integer selectIndex;
34
+    // 输入内容
35
+    private String inputData;
36
+    // 是否显示
37
+    private boolean show = true;
38
+    // 父选项id
39
+    private Long parentId;
40
+    // 子选项id集合 根据逗号分割
41
+    private long[] childIds;
42
+    // 必填
43
+    private boolean must;
44
+
45
+    /******************* 函数 *********************/
46
+
47
+    public DetailItemBean(@DetailItemType int itemType, long id, long flowId, String title) {
48
+        this.itemType = itemType;
49
+        this.id = id;
50
+        this.flowId = flowId;
51
+        this.title = title;
52
+    }
53
+
54
+
55
+    /******************* set方法 *********************/
56
+    public DetailItemBean setFlowId(long flowId) {
57
+        this.flowId = flowId;
58
+        return this;
59
+    }
60
+
61
+    public DetailItemBean setMust(boolean must) {
62
+        this.must = must;
63
+        return this;
64
+    }
65
+
66
+    public DetailItemBean setIndex(Integer index) {
67
+        this.index = index;
68
+        return this;
69
+    }
70
+
71
+    public DetailItemBean setItemType(int itemType) {
72
+        this.itemType = itemType;
73
+        return this;
74
+    }
75
+
76
+    public DetailItemBean setId(long id) {
77
+        this.id = id;
78
+        return this;
79
+    }
80
+
81
+    public DetailItemBean setTitle(String title) {
82
+        this.title = title;
83
+        return this;
84
+    }
85
+
86
+    public DetailItemBean setTime(String time) {
87
+        this.time = time;
88
+        return this;
89
+    }
90
+
91
+    public DetailItemBean setOption(String[] option) {
92
+        this.option = option;
93
+        return this;
94
+    }
95
+
96
+    public DetailItemBean setSelectIndex(Integer selectIndex) {
97
+        this.selectIndex = selectIndex;
98
+        return this;
99
+    }
100
+
101
+    public DetailItemBean setInputData(String inputData) {
102
+        this.inputData = inputData;
103
+        return this;
104
+    }
105
+
106
+    public DetailItemBean setShow(boolean show) {
107
+        this.show = show;
108
+        return this;
109
+    }
110
+
111
+    public DetailItemBean setParentId(Long parentId) {
112
+        this.parentId = parentId;
113
+        return this;
114
+    }
115
+
116
+    public DetailItemBean setChildIds(long[] childIds) {
117
+        this.childIds = childIds;
118
+        return this;
119
+    }
120
+
121
+
122
+    /******************* get方法 *********************/
123
+
124
+    public Integer getIndex() {
125
+        return index;
126
+    }
127
+
128
+    public int getItemType() {
129
+        return itemType;
130
+    }
131
+
132
+    public long getId() {
133
+        return id;
134
+    }
135
+
136
+    public String getTitle() {
137
+        return title;
138
+    }
139
+
140
+    public String getTime() {
141
+        return time;
142
+    }
143
+
144
+    public String[] getOption() {
145
+        return option;
146
+    }
147
+
148
+    public Integer getSelectIndex() {
149
+        return selectIndex;
150
+    }
151
+
152
+    public String getInputData() {
153
+        return inputData;
154
+    }
155
+
156
+    public boolean isShow() {
157
+        return show;
158
+    }
159
+
160
+    public Long getParentId() {
161
+        return parentId;
162
+    }
163
+
164
+    public long[] getChildIds() {
165
+        return childIds;
166
+    }
167
+
168
+    public long getFlowId() {
169
+        return flowId;
170
+    }
171
+
172
+    public boolean isMust() {
173
+        return must;
174
+    }
175
+}

+ 28 - 0
app/src/main/java/com/unis/sxzcl/ui/grain_check/DetailItemType.java

@@ -0,0 +1,28 @@
1
+package com.unis.sxzcl.ui.grain_check;
2
+
3
+import androidx.annotation.IntDef;
4
+
5
+/**
6
+ * 包名: com.unis.sxzcl.ui.grain_check
7
+ * 类名: DetailItemType
8
+ * 作用描述:
9
+ * 创建人: mQ
10
+ * 创建时间: 2020/12/11 16:42
11
+ * 更新人:
12
+ * 更新时间: 2020/12/11 16:42
13
+ * 更新说明:
14
+ * 版本号: 1.0
15
+ */
16
+@IntDef({
17
+        DetailItemType.radio,
18
+        DetailItemType.input,
19
+})
20
+public @interface DetailItemType {
21
+
22
+    /******** 选项样式类型 *******/
23
+
24
+    // 单选
25
+    int radio = 1;
26
+    // 输入
27
+    int input = 2;
28
+}

+ 216 - 0
app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckDetailAdapter.java

@@ -0,0 +1,216 @@
1
+package com.unis.sxzcl.ui.grain_check;
2
+
3
+import android.graphics.drawable.Drawable;
4
+import android.view.Gravity;
5
+import android.view.LayoutInflater;
6
+import android.view.View;
7
+import android.widget.LinearLayout;
8
+import android.widget.TextView;
9
+
10
+import com.chad.library.adapter.base.BaseProviderMultiAdapter;
11
+import com.chad.library.adapter.base.module.LoadMoreModule;
12
+import com.chad.library.adapter.base.provider.BaseItemProvider;
13
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
14
+import com.unis.sxzcl.R;
15
+import com.unis.sxzcl.databinding.TemplateTvBinding;
16
+import com.unis.sxzcl.widget.dialog.InputDialog;
17
+import com.xyxsbj.mylibrary.tool.DateTool;
18
+
19
+import org.jetbrains.annotations.NotNull;
20
+
21
+import java.util.Date;
22
+import java.util.List;
23
+
24
+/**
25
+ * 包名: com.unis.sxzcl.ui.grain_check
26
+ * 类名: GrainCheckDetailAdapter
27
+ * 作用描述:
28
+ * 创建人: mQ
29
+ * 创建时间: 2020/12/11 10:30
30
+ * 更新人:
31
+ * 更新时间: 2020/12/11 10:30
32
+ * 更新说明:
33
+ * 版本号: 1.0
34
+ */
35
+public class GrainCheckDetailAdapter extends BaseProviderMultiAdapter<DetailItemBean> implements LoadMoreModule {
36
+
37
+    private String pageType = "add";
38
+
39
+    public GrainCheckDetailAdapter() {
40
+        super();
41
+        //添加多布局
42
+        addItemProvider(new RadioProvider());
43
+        addItemProvider(new InputProvider());
44
+    }
45
+
46
+    @Override
47
+    protected int getItemType(@NotNull List<? extends DetailItemBean> list, int i) {
48
+        return list.get(i).getItemType();
49
+    }
50
+
51
+    public void setPageType(String pageType) {
52
+        if (pageType == null) return;
53
+        this.pageType = pageType;
54
+    }
55
+
56
+    /**
57
+     * 单选提供者
58
+     */
59
+    public class RadioProvider extends BaseItemProvider<DetailItemBean> {
60
+
61
+        private DetailItemBean currentItem;
62
+
63
+        @Override
64
+        public int getItemViewType() {
65
+            return DetailItemType.radio;
66
+        }
67
+
68
+        @Override
69
+        public int getLayoutId() {
70
+            return R.layout.item_detail_radio;
71
+        }
72
+
73
+        @Override
74
+        public void convert(@NotNull BaseViewHolder holder, DetailItemBean item) {
75
+            holder.getView(R.id.layout_container).setVisibility(item.isShow() ? View.VISIBLE : View.GONE);
76
+
77
+            // 标题
78
+            holder.setText(R.id.tv_title, item.getIndex() == null ? item.getTitle() : (item.getIndex() + "." + item.getTitle()));
79
+
80
+            // 选项创建
81
+            LinearLayout layoutOption = holder.getView(R.id.layout_option);
82
+            layoutOption.removeAllViews();
83
+            for (int i = 0; i < item.getOption().length; i++) {
84
+                layoutOption.addView(createdTextView(item, i));
85
+            }
86
+
87
+        }
88
+
89
+        /**
90
+         * 创建单选按钮
91
+         */
92
+        private TextView createdTextView(DetailItemBean item, int optionIndex) {
93
+            // 初始化 单选按钮
94
+            TextView textView = TemplateTvBinding.inflate(LayoutInflater.from(getContext())).getRoot();
95
+            textView.setText(item.getOption()[optionIndex]);
96
+            textView.setGravity(Gravity.CENTER_VERTICAL);
97
+            // 选中项一致 改变图标
98
+            if (item.getSelectIndex() != null && item.getSelectIndex() == optionIndex) {
99
+                Drawable dra = getContext().getResources().getDrawable(R.drawable.template_tv_left_sel_enable);
100
+                textView.setCompoundDrawablesWithIntrinsicBounds(dra, null, null, null);
101
+            } else {
102
+                Drawable dra = getContext().getResources().getDrawable(R.drawable.template_tv_left_enable);
103
+                textView.setCompoundDrawablesWithIntrinsicBounds(dra, null, null, null);
104
+            }
105
+            // 详情时禁用按钮和事件
106
+            if (pageType.equals("detail")) {
107
+                textView.setEnabled(true);
108
+                return textView;
109
+            }
110
+
111
+            textView.setTag(item);
112
+            textView.setOnClickListener(v -> {
113
+                // 单选点击事件
114
+                TextView tv = (TextView) v;
115
+                currentItem = (DetailItemBean) v.getTag();
116
+
117
+                // 得到所选值index
118
+                String[] option = currentItem.getOption();
119
+                int index = -1;
120
+                for (int i = 0; i < option.length; i++) {
121
+                    if (tv.getText().toString().equals(option[i])) {
122
+                        index = i;
123
+                        break;
124
+                    }
125
+                }
126
+                // 选中和历史一致不做任何操作
127
+                if (currentItem.getSelectIndex() != null && currentItem.getSelectIndex() == index)
128
+                    return;
129
+                // 存储选中index
130
+                currentItem.setSelectIndex(index);
131
+                // 存储选中时间
132
+                currentItem.setTime(DateTool.formatDate(new Date(), DateTool.YTDTD_DATE));
133
+
134
+                // 刷新当前项
135
+                notifyItemChanged(getItemPosition(currentItem));
136
+
137
+                // 处理其他业务
138
+                childShow();
139
+//                if (mCallback != null)
140
+//                    mCallback.onChangesListener(bean, index);
141
+            });
142
+            return textView;
143
+        }
144
+
145
+        private void childShow() {
146
+            // 关联子选项是否显示
147
+            long[] childIds = currentItem.getChildIds();
148
+            if (childIds == null) return;
149
+            boolean show = currentItem.getSelectIndex() == 0;
150
+            for (long cId : childIds) {
151
+                for (DetailItemBean item : getData()) {
152
+                    if (item.getId() == cId) {
153
+                        item.setShow(show);
154
+                        notifyItemChanged(getItemPosition(item));
155
+                        break;
156
+                    }
157
+                }
158
+            }
159
+        }
160
+    }
161
+
162
+    /**
163
+     * 输入提供者
164
+     */
165
+    public class InputProvider extends BaseItemProvider<DetailItemBean> {
166
+
167
+        private DetailItemBean currentItem;
168
+        private InputDialog mInputDialog;
169
+
170
+        @Override
171
+        public int getItemViewType() {
172
+            return DetailItemType.input;
173
+        }
174
+
175
+        @Override
176
+        public int getLayoutId() {
177
+            return R.layout.item_detail_input;
178
+        }
179
+
180
+        @Override
181
+        public void convert(@NotNull BaseViewHolder holder, DetailItemBean item) {
182
+            holder.getView(R.id.layout_container).setVisibility(item.isShow() ? View.VISIBLE : View.GONE);
183
+            holder.getView(R.id.tv_must).setVisibility(item.isMust() ? View.VISIBLE : View.GONE);
184
+
185
+            // 标题
186
+            holder.setText(R.id.tv_title, item.getIndex() == null ? item.getTitle() : (item.getIndex() + "." + item.getTitle()))
187
+                    .setText(R.id.tv_input, item.getInputData());
188
+
189
+
190
+            // 输入框点击事件
191
+            TextView tvContent = holder.getView(R.id.tv_input);
192
+            if (pageType.equals("detail")) {
193
+                tvContent.setHint("");
194
+                return;
195
+            }
196
+            tvContent.setOnClickListener(v -> {
197
+                currentItem = item;
198
+                showInputDialog();
199
+            });
200
+        }
201
+
202
+        private void showInputDialog() {
203
+            if (mInputDialog == null) {
204
+                mInputDialog = new InputDialog(getContext()).setCallBack((dialog, data) -> {
205
+                    dialog.dismiss();
206
+                    currentItem.setInputData(data);
207
+                    notifyItemChanged(getItemPosition(currentItem));
208
+                });
209
+            }
210
+            mInputDialog.show();
211
+            mInputDialog.getDialog().setTitle(currentItem.getTitle());
212
+            mInputDialog.setContent(currentItem.getInputData());
213
+        }
214
+    }
215
+
216
+}

+ 138 - 0
app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckDetailFragment.java

@@ -0,0 +1,138 @@
1
+package com.unis.sxzcl.ui.grain_check;
2
+
3
+import android.os.Bundle;
4
+import android.view.LayoutInflater;
5
+import android.view.View;
6
+import android.view.ViewGroup;
7
+import android.widget.TextView;
8
+
9
+import com.unis.sxzcl.base.BaseListFragment;
10
+import com.unis.sxzcl.databinding.FragmentAddBinding;
11
+import com.xyxsbj.mylibrary.tool.DPTool;
12
+import com.xyxsbj.mylibrary.tool.ToastTool;
13
+
14
+/**
15
+ * 包名: com.unis.sxzcl.ui.grain_check
16
+ * 类名: GrainCheckDetailFragment
17
+ * 作用描述:
18
+ * 创建人: mQ
19
+ * 创建时间: 2020/12/11 9:55
20
+ * 更新人:
21
+ * 更新时间: 2020/12/11 9:55
22
+ * 更新说明:
23
+ * 版本号: 1.0
24
+ */
25
+public class GrainCheckDetailFragment extends BaseListFragment<FragmentAddBinding> {
26
+
27
+
28
+    private String mTab;
29
+    private String mPageType;
30
+    private GrainCheckDetailAdapter mAdapter;
31
+
32
+    @Override
33
+    protected FragmentAddBinding getViewBinding(LayoutInflater inflater, ViewGroup container) {
34
+        return FragmentAddBinding.inflate(inflater, container, false);
35
+    }
36
+
37
+    @Override
38
+    protected void init() {
39
+        Bundle bundle = getArguments();
40
+        if (bundle == null) {
41
+            ToastTool.showLong("没有参数");
42
+            onBack();
43
+            return;
44
+        }
45
+        mTab = bundle.getString("tab");
46
+        if (mTab == null) {
47
+            ToastTool.showLong("没有参数");
48
+            onBack();
49
+            return;
50
+        }
51
+        mBinding.bar.setTitle(mTab);
52
+
53
+        mPageType = bundle.getString("pageType", "add");
54
+        switch (mPageType) {
55
+            case "add":
56
+                // 新增
57
+                break;
58
+            case "edit":
59
+                // 修改
60
+                break;
61
+            case "detail":
62
+                // 详情
63
+                mBinding.tvSave.setVisibility(View.GONE);
64
+                mBinding.tvSubmit.setVisibility(View.GONE);
65
+                break;
66
+        }
67
+        mBinding.bar.setLeftClickListener(v -> onBack());
68
+
69
+        mAdapter = new GrainCheckDetailAdapter();
70
+        mAdapter.setPageType(mPageType);
71
+        TextView view = new TextView(getContext());
72
+        view.setHeight(DPTool.dp2px(getContext(), 200));
73
+        mAdapter.setFooterView(view);
74
+        initBaseListView(mBinding.refreshLayout, mBinding.recyclerView, mAdapter, false);
75
+    }
76
+
77
+    @Override
78
+    protected void onFirstShow() {
79
+        int flowId = 1;
80
+
81
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 1, flowId, "打印粮温检测结果")
82
+                .setIndex(1)
83
+                .setOption(new String[]{"是", "否"}));
84
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 2, flowId, "开灯")
85
+                .setIndex(2)
86
+                .setOption(new String[]{"是", "否"}));
87
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 3, flowId, "双人进仓")
88
+                .setIndex(3)
89
+                .setOption(new String[]{"是", "否"}));
90
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 4, flowId, "气体浓度是否达标(氧气、磷化氢)")
91
+                .setIndex(4)
92
+                .setOption(new String[]{"是", "否"}));
93
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 5, flowId, "照明灯是否正常")
94
+                .setIndex(5)
95
+                .setOption(new String[]{"是", "否"}));
96
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 6, flowId, "色泽、气味是否正常")
97
+                .setIndex(6)
98
+                .setOption(new String[]{"是", "否"}));
99
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 7, flowId, "虫害情况")
100
+                .setIndex(7)
101
+                .setChildIds(new long[]{8, 9, 10, 11})
102
+                .setOption(new String[]{"是", "否"}));
103
+        mAdapter.addData(new DetailItemBean(DetailItemType.input, 8, flowId, "虫害密度").setShow(false).setMust(true));
104
+        mAdapter.addData(new DetailItemBean(DetailItemType.input, 9, flowId, "发生部位").setShow(false).setMust(true));
105
+        mAdapter.addData(new DetailItemBean(DetailItemType.input, 10, flowId, "虫害面积").setShow(false).setMust(true));
106
+        mAdapter.addData(new DetailItemBean(DetailItemType.input, 11, flowId, "虫害种类").setShow(false).setMust(true));
107
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 12, flowId, "水分检测是否正常")
108
+                .setIndex(8)
109
+                .setOption(new String[]{"是", "否"}));
110
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 13, flowId, "异常粮情")
111
+                .setIndex(9)
112
+                .setChildIds(new long[]{14})
113
+                .setOption(new String[]{"是", "否"}));
114
+        mAdapter.addData(new DetailItemBean(DetailItemType.input, 14, flowId, "异常情况描述").setShow(false));
115
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 15, flowId, "锁门")
116
+                .setIndex(10)
117
+                .setOption(new String[]{"是", "否"}));
118
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 16, flowId, "关灯")
119
+                .setIndex(11)
120
+                .setOption(new String[]{"是", "否"}));
121
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 17, flowId, "粮情作业簿填写")
122
+                .setIndex(12)
123
+                .setOption(new String[]{"是", "否"}));
124
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 18, flowId, "保管员日志填写")
125
+                .setIndex(13)
126
+                .setOption(new String[]{"是", "否"}));
127
+        mAdapter.addData(new DetailItemBean(DetailItemType.radio, 19, flowId, "粮情分析会")
128
+                .setIndex(14)
129
+                .setOption(new String[]{"是", "否"}));
130
+
131
+
132
+    }
133
+
134
+    @Override
135
+    public void onRefreshData() {
136
+        loadComplete();
137
+    }
138
+}

+ 92 - 0
app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckHomeFragment.java

@@ -0,0 +1,92 @@
1
+package com.unis.sxzcl.ui.grain_check;
2
+
3
+import android.os.Bundle;
4
+import android.view.LayoutInflater;
5
+import android.view.ViewGroup;
6
+
7
+import androidx.fragment.app.Fragment;
8
+
9
+import com.google.android.material.tabs.TabLayout;
10
+import com.unis.model.HouseModel;
11
+import com.unis.model.bean.HouseBean;
12
+import com.unis.sxzcl.R;
13
+import com.unis.sxzcl.base.BaseFragment;
14
+import com.unis.sxzcl.databinding.FragmentBaseTabPagerBinding;
15
+import com.unis.sxzcl.widget.TabFragmentPagerAdapter;
16
+import com.xyxsbj.mylibrary.tool.ToastTool;
17
+
18
+import java.util.ArrayList;
19
+import java.util.Arrays;
20
+import java.util.List;
21
+
22
+/**
23
+ * 包名: com.unis.sxzcl.ui.grain_check
24
+ * 类名: GrainCheckFragment
25
+ * 作用描述:
26
+ * 创建人: mQ
27
+ * 创建时间: 2020/12/10 17:52
28
+ * 更新人:
29
+ * 更新时间: 2020/12/10 17:52
30
+ * 更新说明:
31
+ * 版本号: 1.0
32
+ */
33
+public class GrainCheckHomeFragment extends BaseFragment<FragmentBaseTabPagerBinding> {
34
+
35
+    public static final String BGY = "保管员每周检查粮情";
36
+    public static final String KZ = "主管科长每2周检查粮情";
37
+    public static final String FZJL = "分管副总每月检查粮情";
38
+    public static final String ZJL = "总经理每季检查粮情";
39
+
40
+    private List<String> mTabs = Arrays.asList(BGY, KZ, FZJL, ZJL);
41
+    private List<Fragment> mFragments;
42
+
43
+    @Override
44
+    protected FragmentBaseTabPagerBinding getViewBinding(LayoutInflater inflater, ViewGroup container) {
45
+        return FragmentBaseTabPagerBinding.inflate(inflater, container, false);
46
+    }
47
+
48
+    @Override
49
+    protected void init() {
50
+        HouseBean house = HouseModel.get().getSelectHouse();
51
+        if (house == null) {
52
+            ToastTool.showLong("未选择仓房");
53
+            onBack();
54
+            return;
55
+        }
56
+
57
+        mBinding.bar.setTitle("粮情检查(" + house.houseName + ")")
58
+                .setLeftClickListener(v -> onBack())
59
+                .setRightVisible(true).setRightText("新增")
60
+                .setRightClickListener(v -> goAdd());
61
+
62
+        initFragment();
63
+        mBinding.tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
64
+        mBinding.tabLayout.setupWithViewPager(mBinding.viewPager);
65
+        TabFragmentPagerAdapter adapter = new TabFragmentPagerAdapter(
66
+                getChildFragmentManager(), mTabs, mFragments);
67
+        mBinding.viewPager.setAdapter(adapter);
68
+        mBinding.viewPager.setOffscreenPageLimit(mFragments.size());
69
+    }
70
+
71
+    private void initFragment() {
72
+        mFragments = new ArrayList<>();
73
+        for (String tab : mTabs) {
74
+            mFragments.add(GrainCheckListFragment.newFragment(tab));
75
+        }
76
+    }
77
+
78
+    @Override
79
+    protected void onFirstShow() {
80
+
81
+    }
82
+
83
+    /**
84
+     * 新增
85
+     */
86
+    private void goAdd() {
87
+        Bundle bundle = new Bundle();
88
+        bundle.putString("tab", mTabs.get(mBinding.viewPager.getCurrentItem()));
89
+        bundle.putString("pageType", "add");
90
+        navigation(R.id.grainCheckDetailFragment, bundle);
91
+    }
92
+}

+ 61 - 0
app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckListAdapter.java

@@ -0,0 +1,61 @@
1
+package com.unis.sxzcl.ui.grain_check;
2
+
3
+import android.widget.ImageView;
4
+import android.widget.TextView;
5
+
6
+import com.chad.library.adapter.base.BaseQuickAdapter;
7
+import com.chad.library.adapter.base.module.LoadMoreModule;
8
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
9
+import com.unis.model.bean.GrainCheckBean;
10
+import com.unis.sxzcl.R;
11
+
12
+import org.jetbrains.annotations.NotNull;
13
+
14
+/**
15
+ * 包名: com.unis.sxzcl.ui.grain_check
16
+ * 类名: GrainCheckListAdapter
17
+ * 作用描述:
18
+ * 创建人: mQ
19
+ * 创建时间: 2020/12/10 19:22
20
+ * 更新人:
21
+ * 更新时间: 2020/12/10 19:22
22
+ * 更新说明:
23
+ * 版本号: 1.0
24
+ */
25
+public class GrainCheckListAdapter extends BaseQuickAdapter<GrainCheckBean, BaseViewHolder>
26
+        implements LoadMoreModule {
27
+
28
+    public GrainCheckListAdapter() {
29
+        super(R.layout.item_list_grain_check);
30
+    }
31
+
32
+    @Override
33
+    protected void convert(@NotNull BaseViewHolder holder, GrainCheckBean item) {
34
+
35
+        holder.setText(R.id.tv_time, item.getTime());
36
+
37
+        ImageView imageView = holder.getView(R.id.iv_show);
38
+        TextView tvStatus = holder.getView(R.id.tv_status);
39
+        switch (item.getStatus()) {
40
+            case GrainCheckBean.STATUS
41
+                    .examine:
42
+                // 待审批
43
+                imageView.setImageResource(R.drawable.ic_wait_blue);
44
+                tvStatus.setText("待审批");
45
+                break;
46
+            case GrainCheckBean.STATUS
47
+                    .underway:
48
+                // 进行中
49
+                imageView.setImageResource(R.drawable.ic_wait_blue);
50
+                tvStatus.setText("进行中");
51
+                break;
52
+            case GrainCheckBean.STATUS
53
+                    .finish:
54
+                // 已完成
55
+                imageView.setImageResource(R.drawable.ic_finish_accent);
56
+                tvStatus.setText("已完成");
57
+                break;
58
+        }
59
+    }
60
+
61
+}

+ 101 - 0
app/src/main/java/com/unis/sxzcl/ui/grain_check/GrainCheckListFragment.java

@@ -0,0 +1,101 @@
1
+package com.unis.sxzcl.ui.grain_check;
2
+
3
+import android.os.Bundle;
4
+import android.os.Handler;
5
+import android.view.LayoutInflater;
6
+import android.view.View;
7
+import android.view.ViewGroup;
8
+
9
+import androidx.annotation.NonNull;
10
+
11
+import com.chad.library.adapter.base.BaseQuickAdapter;
12
+import com.chad.library.adapter.base.listener.OnItemClickListener;
13
+import com.unis.model.bean.GrainCheckBean;
14
+import com.unis.sxzcl.R;
15
+import com.unis.sxzcl.base.BaseListFragment;
16
+import com.unis.sxzcl.databinding.FragmentBaseListBinding;
17
+
18
+/**
19
+ * 包名: com.unis.sxzcl.ui.grain_check
20
+ * 类名: GrainCheckListFragment
21
+ * 作用描述:
22
+ * 创建人: mQ
23
+ * 创建时间: 2020/12/10 18:37
24
+ * 更新人:
25
+ * 更新时间: 2020/12/10 18:37
26
+ * 更新说明:
27
+ * 版本号: 1.0
28
+ */
29
+public class GrainCheckListFragment extends BaseListFragment<FragmentBaseListBinding> implements OnItemClickListener {
30
+
31
+    private GrainCheckListAdapter mAdapter;
32
+    private String mTab;
33
+
34
+    public static GrainCheckListFragment newFragment(String tab) {
35
+        Bundle bundle = new Bundle();
36
+        bundle.putString("tab", tab);
37
+        GrainCheckListFragment fragment = new GrainCheckListFragment();
38
+        fragment.setArguments(bundle);
39
+        return fragment;
40
+    }
41
+
42
+    @Override
43
+    protected FragmentBaseListBinding getViewBinding(LayoutInflater inflater, ViewGroup container) {
44
+        return FragmentBaseListBinding.inflate(inflater, container, false);
45
+    }
46
+
47
+    @Override
48
+    protected void init() {
49
+        Bundle bundle = getArguments();
50
+        mTab = bundle.getString("tab");
51
+
52
+        mAdapter = new GrainCheckListAdapter();
53
+        mAdapter.setOnItemClickListener(this);
54
+        initBaseListView(mBinding.refreshLayout, mBinding.recyclerView, mAdapter, true);
55
+    }
56
+
57
+    @Override
58
+    protected void onFirstShow() {
59
+        onRefresh();
60
+    }
61
+
62
+    @Override
63
+    public void onRefreshData() {
64
+        getData(true);
65
+    }
66
+
67
+    @Override
68
+    public void onMoreData() {
69
+        super.onMoreData();
70
+        getData(false);
71
+    }
72
+
73
+    public void getData(boolean refresh) {
74
+        new Handler().postDelayed(() -> {
75
+//            //大于30到结尾
76
+//            if (mAdapter.getData().size() == 20) {
77
+//                loadEnd();
78
+//                return;
79
+//            }
80
+            if (refresh) {
81
+                mAdapter.getData().clear();
82
+                mAdapter.notifyDataSetChanged();
83
+            }
84
+
85
+            //模拟数据
86
+            mAdapter.addData(new GrainCheckBean(GrainCheckBean.STATUS.underway, "2020-12-15 10:11"));
87
+            mAdapter.addData(new GrainCheckBean(GrainCheckBean.STATUS.finish, "2020-12-25 14:00"));
88
+
89
+            loadEnd();
90
+        }, 500);
91
+    }
92
+
93
+
94
+    @Override
95
+    public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
96
+        Bundle bundle = new Bundle();
97
+        bundle.putString("tab", mTab);
98
+        bundle.putString("pageType", "detail");
99
+        navigation(R.id.grainCheckDetailFragment, bundle);
100
+    }
101
+}

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

@@ -8,6 +8,7 @@ import com.chad.library.adapter.base.module.LoadMoreModule;
8 8
 import com.chad.library.adapter.base.viewholder.BaseViewHolder;
9 9
 import com.unis.model.BasicModel;
10 10
 import com.unis.model.DataCallBack;
11
+import com.unis.model.HouseModel;
11 12
 import com.unis.model.WorkbenchModel;
12 13
 import com.unis.model.bean.HouseBean;
13 14
 import com.unis.model.bean.WorkModule;
@@ -36,7 +37,8 @@ public class WorkModuleAdapter extends BaseQuickAdapter<WorkModule, BaseViewHold
36 37
     private ClickCallback mCallback;
37 38
     private BottomMultipleListDialog mListDialog;
38 39
     private List<MultipleBean> mMultipleList = new ArrayList<>();
39
-    private String currentHouseId;
40
+    private List<HouseBean> mHouseList = new ArrayList<>();
41
+
40 42
     private int currentFragmentId;
41 43
     private WorkModule currentWork;
42 44
 
@@ -46,8 +48,9 @@ public class WorkModuleAdapter extends BaseQuickAdapter<WorkModule, BaseViewHold
46 48
         BasicModel.get().getHouseList(new DataCallBack<List<HouseBean>>() {
47 49
             @Override
48 50
             public void onSuccess(List<HouseBean> data) {
51
+                mHouseList = data;
49 52
                 for (HouseBean bean : data) {
50
-                    mMultipleList.add(new MultipleBean(bean.houseName, bean.id + ""));
53
+                    mMultipleList.add(new MultipleBean(bean.houseName));
51 54
                 }
52 55
             }
53 56
         });
@@ -102,10 +105,11 @@ public class WorkModuleAdapter extends BaseQuickAdapter<WorkModule, BaseViewHold
102 105
                 break;
103 106
             case WorkbenchModel.TYPE_LQJC:
104 107
                 // 粮情检查
108
+                showHouseSelect(R.id.grainCheckHomeFragment);
105 109
                 break;
106 110
             case WorkbenchModel.TYPE_JXTF:
107 111
                 // 机械通风
108
-                showHouseSelect();
112
+                showHouseSelect(0);
109 113
                 break;
110 114
             case WorkbenchModel.TYPE_XZGL:
111 115
                 // 熏蒸管理
@@ -175,23 +179,27 @@ public class WorkModuleAdapter extends BaseQuickAdapter<WorkModule, BaseViewHold
175 179
     /**
176 180
      * 选择仓房
177 181
      */
178
-    private void showHouseSelect() {
182
+    private void showHouseSelect(int fragmentId) {
179 183
         if (mListDialog == null) {
180 184
             mListDialog = new BottomMultipleListDialog(getContext())
181 185
                     .hideTwoList()
182 186
                     .hideThreeList()
183 187
                     .hideRightEnter()
184 188
                     .setTitle("选择仓房")
185
-                    .setOneCallback((v, b1) -> {
186
-                        currentHouseId = b1.getExtras();
187
-                        next();
188
-
189
-                        return true;
190
-                    })
191 189
             ;
192 190
         }
193 191
         mListDialog.setListOne(mMultipleList)
194 192
                 .setSelectOne(-1)
193
+                .setOneCallback((v, b1) -> {
194
+                    currentFragmentId = fragmentId;
195
+                    //仓房点击事件
196
+                    int oneSelect = mListDialog.getOneSelect();
197
+                    if (oneSelect != -1)
198
+                        HouseModel.get().setSelectHouse(mHouseList.get(oneSelect));
199
+                    next();
200
+
201
+                    return true;
202
+                })
195 203
                 .show();
196 204
     }
197 205
 
@@ -203,12 +211,11 @@ public class WorkModuleAdapter extends BaseQuickAdapter<WorkModule, BaseViewHold
203 211
 
204 212
         // 回调给监听者
205 213
         if (mCallback != null)
206
-            mCallback.onClickListener(currentWork, currentFragmentId, currentHouseId);
214
+            mCallback.onClickListener(currentWork, currentFragmentId);
207 215
 
208 216
         // 清空存储内容
209 217
         currentWork = null;
210 218
         currentFragmentId = 0;
211
-        currentHouseId = null;
212 219
     }
213 220
 
214 221
     public void setCallback(ClickCallback callback) {
@@ -216,6 +223,6 @@ public class WorkModuleAdapter extends BaseQuickAdapter<WorkModule, BaseViewHold
216 223
     }
217 224
 
218 225
     public interface ClickCallback {
219
-        void onClickListener(WorkModule item, int fragmentId, String houseId);
226
+        void onClickListener(WorkModule item, int fragmentId);
220 227
     }
221 228
 }

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

@@ -148,10 +148,9 @@ public class WorkModuleFragment extends BaseListFragment<FragmentWorkModuleBindi
148 148
     }
149 149
 
150 150
     @Override
151
-    public void onClickListener(WorkModule item, int fragmentId, String houseId) {
151
+    public void onClickListener(WorkModule item, int fragmentId) {
152 152
         Bundle bundle = new Bundle();
153 153
         bundle.putString("data", getGson().toJson(item));
154
-        bundle.putString("houseId", houseId);
155 154
         navigation(fragmentId, bundle);
156 155
     }
157 156
 

+ 4 - 0
app/src/main/java/com/unis/sxzcl/widget/BottomMultipleAdapter.java

@@ -73,6 +73,10 @@ public class BottomMultipleAdapter extends BaseQuickAdapter<MultipleBean, BaseVi
73 73
         if (mSelIndex >= 0) notifyItemChanged(mSelIndex);
74 74
     }
75 75
 
76
+    public int getSelIndex(){
77
+        return mSelIndex;
78
+    }
79
+
76 80
     /**
77 81
      * 获取已选中值
78 82
      *

+ 10 - 0
app/src/main/java/com/unis/sxzcl/widget/BottomMultipleListDialog.java

@@ -188,6 +188,10 @@ public class BottomMultipleListDialog {
188 188
         return this;
189 189
     }
190 190
 
191
+    public int getOneSelect() {
192
+        return mAdapter1.getSelIndex();
193
+    }
194
+
191 195
     /**
192 196
      * 设置第二列选中项
193 197
      *
@@ -197,6 +201,9 @@ public class BottomMultipleListDialog {
197 201
         mAdapter2.setSelIndex(index);
198 202
         return this;
199 203
     }
204
+    public int getTwoSelect() {
205
+        return mAdapter2.getSelIndex();
206
+    }
200 207
 
201 208
     /**
202 209
      * 设置第三列选中项
@@ -207,6 +214,9 @@ public class BottomMultipleListDialog {
207 214
         mAdapter3.setSelIndex(index);
208 215
         return this;
209 216
     }
217
+    public int getThreeSelect() {
218
+        return mAdapter3.getSelIndex();
219
+    }
210 220
 
211 221
     public BottomMultipleListDialog hideTwoList() {
212 222
         mBinding.recyclerView2.setVisibility(View.GONE);

+ 121 - 0
app/src/main/java/com/unis/sxzcl/widget/dialog/InputDialog.java

@@ -0,0 +1,121 @@
1
+package com.unis.sxzcl.widget.dialog;
2
+
3
+import android.content.Context;
4
+import android.view.LayoutInflater;
5
+import android.view.View;
6
+import android.widget.EditText;
7
+import android.widget.TextView;
8
+
9
+import androidx.annotation.NonNull;
10
+
11
+import com.unis.sxzcl.R;
12
+import com.xyxsbj.mylibrary.tool.ETTool;
13
+import com.xyxsbj.mylibrary.tool.StringTool;
14
+
15
+/**
16
+ * 包名: com.unis.sxzcl.widget.dialog
17
+ * 类名: InputDialog
18
+ * 作用描述:
19
+ * 创建人: mQ
20
+ * 创建时间: 2020/12/11 14:12
21
+ * 更新人:
22
+ * 更新时间: 2020/12/11 14:12
23
+ * 更新说明:
24
+ * 版本号: 1.0
25
+ */
26
+public class InputDialog {
27
+
28
+    Context mContext;
29
+    private SystemDialog mDialog;
30
+    private EditText mEtContent;
31
+    private TextView mBtnSubmit;
32
+
33
+    private CallBack mCallBack;
34
+
35
+    public InputDialog(@NonNull Context context) {
36
+        mContext = context;
37
+        initDialog();
38
+    }
39
+
40
+    /**
41
+     * 初始化对话框
42
+     */
43
+    private void initDialog() {
44
+        mDialog = new SystemDialog(mContext)
45
+                .setTitle("请输入内容")
46
+                .setContentView(getView())
47
+                .setOnShowListener(dialog -> {
48
+                    // 弹出软键盘
49
+                    ETTool.showSoftKeyboard(mEtContent);
50
+                })
51
+                .setDismissListener(dialog -> {
52
+                    // 隐藏软键盘
53
+                    ETTool.closeSoftKeybord(mEtContent);
54
+                });
55
+
56
+    }
57
+
58
+    /**
59
+     * 获取自定义布局
60
+     */
61
+    private View getView() {
62
+        View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_input, null, false);
63
+        mEtContent = view.findViewById(R.id.et_content);
64
+
65
+        mBtnSubmit = view.findViewById(R.id.btn_submit);
66
+        mBtnSubmit.setOnClickListener(v -> {
67
+
68
+            String phone = ETTool.getData(mEtContent);
69
+            if (StringTool.isEmpty(phone)) {
70
+                mEtContent.setError("请输入内容");
71
+                return;
72
+            }
73
+            if (mCallBack != null)
74
+                mCallBack.onSubmitListener(mDialog, phone);
75
+        });
76
+        return view;
77
+    }
78
+
79
+
80
+    public InputDialog setContent(String content) {
81
+        mEtContent.setText(content);
82
+        return this;
83
+    }
84
+
85
+    /**
86
+     * 设置提交监听事件
87
+     */
88
+    public InputDialog setCallBack(CallBack callBack) {
89
+        mCallBack = callBack;
90
+        return this;
91
+    }
92
+
93
+    /**
94
+     * 显示对话框
95
+     */
96
+    public InputDialog show() {
97
+        mDialog.show();
98
+        return this;
99
+    }
100
+
101
+    /**
102
+     * 隐藏对话框
103
+     */
104
+    public InputDialog dismiss() {
105
+        mDialog.dismiss();
106
+        return this;
107
+    }
108
+
109
+    /**
110
+     * 获取对话框
111
+     *
112
+     * @return
113
+     */
114
+    public SystemDialog getDialog() {
115
+        return mDialog;
116
+    }
117
+
118
+    public interface CallBack {
119
+        public void onSubmitListener(SystemDialog dialog, String data);
120
+    }
121
+}

+ 255 - 0
app/src/main/java/com/unis/sxzcl/widget/dialog/SystemDialog.java

@@ -0,0 +1,255 @@
1
+package com.unis.sxzcl.widget.dialog;
2
+
3
+import android.content.Context;
4
+import android.content.DialogInterface;
5
+import android.view.LayoutInflater;
6
+import android.view.View;
7
+import android.view.WindowManager;
8
+import android.widget.FrameLayout;
9
+import android.widget.ImageView;
10
+import android.widget.LinearLayout;
11
+import android.widget.TextView;
12
+
13
+import androidx.appcompat.app.AlertDialog;
14
+
15
+import com.unis.sxzcl.R;
16
+
17
+
18
+/**
19
+ * 创建人 mQ
20
+ * 创建时间 2019/7/23 0023 20:22
21
+ * 文件名称 SystemDialog
22
+ * 说明:  系统提示对话框
23
+ **/
24
+public class SystemDialog {
25
+
26
+    AlertDialog mDialog;
27
+
28
+    private TextView mTvTitle;
29
+    private ImageView mBtnClose;
30
+    private TextView mTvMsg;
31
+    private FrameLayout mContentLayout;
32
+    private View mViewBottomLine;
33
+    private TextView mBtnLeft;
34
+    private TextView mBtnCenter;
35
+    private TextView mBtnRight;
36
+    private LinearLayout mRootLayout;
37
+
38
+    private LeftCallBack mLeftCallBack;
39
+    private CenterCallBack mCenterCallBack;
40
+    private RightCallBack mRightCallBack;
41
+
42
+
43
+    public SystemDialog(Context context) {
44
+        initDialog(context);
45
+    }
46
+
47
+
48
+    private void initDialog(Context context) {
49
+        mDialog = new AlertDialog.Builder(context, R.style.MyDialog).create();
50
+        View view = LayoutInflater.from(context).inflate(R.layout.dialog_system, null, false);
51
+        mDialog.setView(view);
52
+        mDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
53
+        mDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
54
+        initView(view);
55
+    }
56
+
57
+    private void initView(View view) {
58
+        mTvTitle = view.findViewById(R.id.tv_title);
59
+        mTvTitle.setText("");
60
+
61
+        mBtnClose = view.findViewById(R.id.btn_close);
62
+        mBtnClose.setOnClickListener(mClickListener);
63
+
64
+        mTvMsg = view.findViewById(R.id.tv_msg);
65
+        mTvMsg.setVisibility(View.GONE);
66
+
67
+        mContentLayout = view.findViewById(R.id.content_layout);
68
+        mContentLayout.setVisibility(View.GONE);
69
+
70
+        mViewBottomLine = view.findViewById(R.id.view_bottom_line);
71
+        mViewBottomLine.setVisibility(View.GONE);
72
+
73
+
74
+        mBtnLeft = view.findViewById(R.id.btn_left);
75
+        mBtnLeft.setOnClickListener(mClickListener);
76
+        mBtnLeft.setVisibility(View.GONE);
77
+
78
+        mBtnCenter = view.findViewById(R.id.btn_center);
79
+        mBtnCenter.setOnClickListener(mClickListener);
80
+        mBtnCenter.setVisibility(View.GONE);
81
+
82
+        mBtnRight = view.findViewById(R.id.btn_right);
83
+        mBtnRight.setOnClickListener(mClickListener);
84
+        mBtnRight.setVisibility(View.GONE);
85
+
86
+        mRootLayout = view.findViewById(R.id.root_layout);
87
+        mRootLayout.setOnClickListener(mClickListener);
88
+    }
89
+
90
+    private View.OnClickListener mClickListener = new View.OnClickListener() {
91
+        @Override
92
+        public void onClick(View v) {
93
+            switch (v.getId()) {
94
+                case R.id.btn_close:
95
+                    //关闭
96
+                    dismiss();
97
+                    break;
98
+                case R.id.btn_left:
99
+                    //左侧按钮点击
100
+                    if (mLeftCallBack == null)
101
+                        dismiss();
102
+                    else
103
+                        mLeftCallBack.onLeftListener(SystemDialog.this);
104
+                    break;
105
+                case R.id.btn_center:
106
+                    //中间按钮点击
107
+                    if (mCenterCallBack == null)
108
+                        dismiss();
109
+                    else
110
+                        mCenterCallBack.onCenterListener(SystemDialog.this);
111
+                    break;
112
+                case R.id.btn_right:
113
+                    //右侧按钮点击
114
+                    if (mRightCallBack == null)
115
+                        dismiss();
116
+                    else
117
+                        mRightCallBack.onRightListener(SystemDialog.this);
118
+                    break;
119
+                case R.id.root_layout:
120
+                    //空白处点击
121
+//                    if (mBtnClose.getVisibility() == View.VISIBLE) {
122
+//                        dismiss();
123
+//                    }
124
+                    break;
125
+            }
126
+        }
127
+    };
128
+
129
+    /**
130
+     * 设置标题
131
+     *
132
+     * @param title
133
+     * @return
134
+     */
135
+    public SystemDialog setTitle(String title) {
136
+        mTvTitle.setText(title);
137
+        return this;
138
+    }
139
+
140
+    /**
141
+     * 设置内容
142
+     *
143
+     * @param msg
144
+     */
145
+    public SystemDialog setMsg(String msg) {
146
+        mTvMsg.setVisibility(View.VISIBLE);
147
+        mTvMsg.setText(msg);
148
+        return this;
149
+    }
150
+
151
+    /**
152
+     * 设置左侧按钮
153
+     *
154
+     * @param left
155
+     * @param leftCallBack
156
+     * @return
157
+     */
158
+    public SystemDialog setLeftButton(String left, LeftCallBack leftCallBack) {
159
+        mViewBottomLine.setVisibility(View.VISIBLE);
160
+        mBtnLeft.setVisibility(View.VISIBLE);
161
+        mBtnLeft.setText(left);
162
+        mLeftCallBack = leftCallBack;
163
+        return this;
164
+    }
165
+
166
+    /**
167
+     * 设置中间按钮
168
+     *
169
+     * @param center
170
+     * @param centerCallBack
171
+     * @return
172
+     */
173
+    public SystemDialog setCenterButton(String center, CenterCallBack centerCallBack) {
174
+        mBtnCenter.setVisibility(View.VISIBLE);
175
+        mBtnCenter.setText(center);
176
+        mCenterCallBack = centerCallBack;
177
+        return this;
178
+    }
179
+
180
+    /**
181
+     * 设置右侧按钮
182
+     *
183
+     * @param right
184
+     * @param rightCallBack
185
+     * @return
186
+     */
187
+    public SystemDialog setRightButton(String right, RightCallBack rightCallBack) {
188
+        mBtnRight.setVisibility(View.VISIBLE);
189
+        mBtnRight.setText(right);
190
+        mRightCallBack = rightCallBack;
191
+        return this;
192
+    }
193
+
194
+    /**
195
+     * 设置内容布局
196
+     *
197
+     * @param contentView
198
+     * @return
199
+     */
200
+    public SystemDialog setContentView(View contentView) {
201
+        mContentLayout.setVisibility(View.VISIBLE);
202
+        mContentLayout.addView(contentView);
203
+        return this;
204
+    }
205
+
206
+    public SystemDialog setCancelable(boolean cancelable) {
207
+        mDialog.setCancelable(cancelable);
208
+        return this;
209
+    }
210
+
211
+    public SystemDialog setHideClose() {
212
+        mBtnClose.setVisibility(View.GONE);
213
+        return this;
214
+    }
215
+
216
+    public SystemDialog setHideTitle() {
217
+        mTvTitle.setVisibility(View.GONE);
218
+        return this;
219
+    }
220
+
221
+    public SystemDialog setDismissListener(DialogInterface.OnDismissListener dismissListener) {
222
+        mDialog.setOnDismissListener(dismissListener);
223
+        return this;
224
+    }
225
+
226
+    public SystemDialog setOnShowListener(DialogInterface.OnShowListener listener) {
227
+        mDialog.setOnShowListener(listener);
228
+        return this;
229
+    }
230
+
231
+    public void show() {
232
+        mDialog.show();
233
+    }
234
+
235
+
236
+    public void dismiss() {
237
+        mDialog.dismiss();
238
+    }
239
+
240
+    public AlertDialog getDialog() {
241
+        return mDialog;
242
+    }
243
+
244
+    public interface LeftCallBack {
245
+        public void onLeftListener(SystemDialog dialog);
246
+    }
247
+
248
+    public interface CenterCallBack {
249
+        public void onCenterListener(SystemDialog dialog);
250
+    }
251
+
252
+    public interface RightCallBack {
253
+        public void onRightListener(SystemDialog dialog);
254
+    }
255
+}

+ 44 - 0
app/src/main/res/layout/dialog_input.xml

@@ -0,0 +1,44 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:layout_width="match_parent"
4
+    android:layout_height="wrap_content"
5
+    android:layout_gravity="center"
6
+    android:background="@color/colorWhite"
7
+    android:minWidth="800dp"
8
+    android:orientation="vertical">
9
+
10
+
11
+    <EditText
12
+        android:id="@+id/et_content"
13
+        android:layout_width="match_parent"
14
+        android:layout_height="wrap_content"
15
+        android:layout_marginLeft="8dp"
16
+        android:layout_marginTop="16dp"
17
+        android:layout_marginRight="8dp"
18
+        android:background="@drawable/gray_radius_bg"
19
+        android:gravity="center_vertical"
20
+        android:hint="请输入"
21
+        android:paddingLeft="8dp"
22
+        android:paddingTop="8dp"
23
+        android:paddingRight="8dp"
24
+        android:paddingBottom="8dp"
25
+        android:textColor="@color/colorTextBlack"
26
+        android:textSize="?attr/textSizeXXX" />
27
+
28
+    <TextView
29
+        android:id="@+id/btn_submit"
30
+        android:layout_width="wrap_content"
31
+        android:layout_height="wrap_content"
32
+        android:layout_gravity="center"
33
+        android:layout_marginTop="16dp"
34
+        android:layout_marginBottom="24dp"
35
+        android:background="@drawable/accent_radius_bg"
36
+        android:paddingLeft="24dp"
37
+        android:paddingTop="8dp"
38
+        android:paddingRight="24dp"
39
+        android:paddingBottom="8dp"
40
+        android:text="确定"
41
+        android:textColor="@color/colorWhite"
42
+        android:textSize="?attr/textSizeXXX" />
43
+
44
+</LinearLayout>

+ 113 - 0
app/src/main/res/layout/dialog_system.xml

@@ -0,0 +1,113 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    android:id="@+id/root_layout"
5
+    android:layout_width="wrap_content"
6
+    android:layout_height="wrap_content"
7
+    android:layout_gravity="center"
8
+    android:orientation="vertical">
9
+
10
+    <androidx.cardview.widget.CardView
11
+        android:layout_width="wrap_content"
12
+        android:layout_height="wrap_content"
13
+        android:layout_margin="8dp"
14
+        app:cardCornerRadius="8dp"
15
+        app:cardElevation="8dp">
16
+
17
+        <LinearLayout
18
+            android:layout_width="wrap_content"
19
+            android:layout_height="wrap_content"
20
+            android:layout_gravity="center"
21
+            android:orientation="vertical">
22
+
23
+            <RelativeLayout
24
+                android:layout_width="match_parent"
25
+                android:layout_height="wrap_content">
26
+
27
+                <TextView
28
+                    android:id="@+id/tv_title"
29
+                    android:layout_width="match_parent"
30
+                    android:layout_height="48dp"
31
+                    android:background="@drawable/window_background"
32
+                    android:gravity="center"
33
+                    android:text="标题"
34
+                    android:textColor="@color/colorWhite"
35
+                    android:textSize="?attr/textSizeXXX" />
36
+
37
+                <ImageView
38
+                    android:id="@+id/btn_close"
39
+                    android:layout_width="wrap_content"
40
+                    android:layout_height="wrap_content"
41
+                    android:layout_alignParentRight="true"
42
+                    android:layout_centerVertical="true"
43
+                    android:layout_marginRight="8dp"
44
+                    android:foreground="?android:selectableItemBackground"
45
+                    android:src="@drawable/ic_clear_white" />
46
+            </RelativeLayout>
47
+
48
+            <TextView
49
+                android:id="@+id/tv_msg"
50
+                android:layout_width="wrap_content"
51
+                android:layout_height="wrap_content"
52
+                android:layout_gravity="center"
53
+                android:gravity="center"
54
+                android:minWidth="250dp"
55
+                android:minHeight="88dp"
56
+                android:paddingLeft="16dp"
57
+                android:paddingRight="16dp"
58
+                android:text="文字内容"
59
+                android:textColor="@color/colorTextBlack" />
60
+
61
+            <FrameLayout
62
+                android:id="@+id/content_layout"
63
+                android:layout_width="wrap_content"
64
+                android:layout_height="wrap_content"
65
+                android:minWidth="250dp" />
66
+
67
+            <View
68
+                android:id="@+id/view_bottom_line"
69
+                android:layout_width="match_parent"
70
+                android:layout_height="1px"
71
+                android:background="@color/colorLine" />
72
+
73
+            <LinearLayout
74
+                android:layout_width="match_parent"
75
+                android:layout_height="wrap_content">
76
+
77
+                <TextView
78
+                    android:id="@+id/btn_left"
79
+                    android:layout_width="0dp"
80
+                    android:layout_height="40dp"
81
+                    android:layout_weight="1"
82
+                    android:foreground="?android:selectableItemBackground"
83
+                    android:gravity="center"
84
+                    android:text="左按钮"
85
+                    android:textColor="@color/colorText1" />
86
+
87
+                <TextView
88
+                    android:id="@+id/btn_center"
89
+                    android:layout_width="0dp"
90
+                    android:layout_height="40dp"
91
+                    android:layout_weight="1"
92
+                    android:background="@color/colorBlue"
93
+                    android:foreground="?android:selectableItemBackground"
94
+                    android:gravity="center"
95
+                    android:text="中按钮"
96
+                    android:textColor="@color/colorWhite" />
97
+
98
+                <TextView
99
+                    android:id="@+id/btn_right"
100
+                    android:layout_width="0dp"
101
+                    android:layout_height="40dp"
102
+                    android:layout_weight="1"
103
+                    android:background="@color/colorTheme"
104
+                    android:foreground="?android:selectableItemBackground"
105
+                    android:gravity="center"
106
+                    android:text="右按钮"
107
+                    android:textColor="@color/colorWhite" />
108
+            </LinearLayout>
109
+
110
+        </LinearLayout>
111
+    </androidx.cardview.widget.CardView>
112
+
113
+</LinearLayout>

+ 63 - 0
app/src/main/res/layout/fragment_add.xml

@@ -0,0 +1,63 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    android:layout_width="match_parent"
5
+    android:layout_height="match_parent">
6
+
7
+    <com.unis.sxzcl.widget.BaseTitleBar
8
+        android:id="@+id/bar"
9
+        android:layout_width="match_parent"
10
+        android:layout_height="wrap_content"
11
+        app:barTitle="列表" />
12
+
13
+    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
14
+        android:id="@+id/refresh_layout"
15
+        android:layout_width="match_parent"
16
+        android:layout_height="match_parent"
17
+        android:layout_below="@id/bar">
18
+
19
+        <androidx.recyclerview.widget.RecyclerView
20
+            android:id="@+id/recycler_view"
21
+            android:layout_width="match_parent"
22
+            android:layout_height="match_parent"
23
+            android:scrollbars="vertical" />
24
+    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
25
+
26
+    <LinearLayout
27
+        android:id="@+id/layout_bottom"
28
+        android:layout_width="match_parent"
29
+        android:layout_height="wrap_content"
30
+        android:layout_alignParentBottom="true"
31
+        android:orientation="vertical">
32
+
33
+        <TextView
34
+            android:id="@+id/tv_save"
35
+            android:layout_width="match_parent"
36
+            android:layout_height="wrap_content"
37
+            android:layout_margin="24dp"
38
+            android:background="@drawable/accent_circle_bg"
39
+            android:gravity="center"
40
+            android:minHeight="48dp"
41
+            android:paddingTop="8dp"
42
+            android:paddingBottom="8dp"
43
+            android:text="暂存"
44
+            android:textColor="@color/colorWhite"
45
+            android:textSize="?attr/textSizeXXX" />
46
+
47
+        <TextView
48
+            android:id="@+id/tv_submit"
49
+            android:layout_width="match_parent"
50
+            android:layout_height="wrap_content"
51
+            android:layout_margin="24dp"
52
+            android:background="@drawable/accent_circle_bg"
53
+            android:gravity="center"
54
+            android:minHeight="48dp"
55
+            android:paddingTop="8dp"
56
+            android:paddingBottom="8dp"
57
+            android:text="提交"
58
+            android:visibility="gone"
59
+            android:textColor="@color/colorWhite"
60
+            android:textSize="?attr/textSizeXXX" />
61
+    </LinearLayout>
62
+
63
+</RelativeLayout>

+ 51 - 0
app/src/main/res/layout/item_detail_input.xml

@@ -0,0 +1,51 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:layout_width="match_parent"
4
+    android:layout_height="wrap_content">
5
+
6
+    <LinearLayout
7
+        android:id="@+id/layout_container"
8
+        android:layout_width="match_parent"
9
+        android:layout_height="wrap_content"
10
+        android:background="@color/colorWhite"
11
+        android:orientation="horizontal"
12
+        android:paddingLeft="16dp"
13
+        android:paddingRight="16dp">
14
+
15
+        <TextView
16
+            android:id="@+id/tv_must"
17
+            android:layout_width="wrap_content"
18
+            android:layout_height="wrap_content"
19
+            android:layout_marginTop="16dp"
20
+            android:layout_marginRight="4dp"
21
+            android:layout_marginBottom="16dp"
22
+            android:text="*"
23
+            android:textColor="@color/colorRed"
24
+            android:textSize="?attr/textSizeXXX" />
25
+
26
+        <TextView
27
+            android:id="@+id/tv_title"
28
+            android:layout_width="wrap_content"
29
+            android:layout_height="wrap_content"
30
+            android:layout_marginTop="16dp"
31
+            android:layout_marginRight="8dp"
32
+            android:layout_marginBottom="16dp"
33
+            android:text="标题文本"
34
+            android:textColor="@color/colorTextBlack"
35
+            android:textSize="?attr/textSizeXXX" />
36
+
37
+        <TextView
38
+            android:id="@+id/tv_input"
39
+            android:layout_width="match_parent"
40
+            android:layout_height="wrap_content"
41
+            android:layout_marginTop="16dp"
42
+            android:layout_marginBottom="16dp"
43
+            android:background="@drawable/accent_radius_stroke_bg"
44
+            android:hint="请输入"
45
+            android:padding="8dp"
46
+            android:textColor="@color/colorTheme"
47
+            android:textSize="?attr/textSizeXXX" />
48
+    </LinearLayout>
49
+
50
+
51
+</FrameLayout>

+ 36 - 0
app/src/main/res/layout/item_detail_radio.xml

@@ -0,0 +1,36 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:layout_width="match_parent"
4
+    android:layout_height="wrap_content">
5
+
6
+    <LinearLayout
7
+        android:id="@+id/layout_container"
8
+        android:layout_width="match_parent"
9
+        android:layout_height="wrap_content"
10
+        android:background="@color/colorWhite"
11
+        android:orientation="vertical">
12
+
13
+        <TextView
14
+            android:id="@+id/tv_title"
15
+            android:layout_width="match_parent"
16
+            android:layout_height="wrap_content"
17
+            android:layout_marginLeft="16dp"
18
+            android:layout_marginTop="16dp"
19
+            android:layout_marginRight="16dp"
20
+            android:text="1.标题文本:"
21
+            android:textColor="@color/colorTextBlack"
22
+            android:textSize="?attr/textSizeXXX" />
23
+
24
+        <LinearLayout
25
+            android:id="@+id/layout_option"
26
+            android:layout_width="wrap_content"
27
+            android:layout_height="wrap_content"
28
+            android:layout_marginLeft="16dp"
29
+            android:layout_marginTop="8dp"
30
+            android:orientation="vertical">
31
+
32
+        </LinearLayout>
33
+    </LinearLayout>
34
+
35
+
36
+</FrameLayout>

+ 62 - 0
app/src/main/res/layout/item_list_grain_check.xml

@@ -0,0 +1,62 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    android:layout_width="match_parent"
5
+    android:layout_height="wrap_content"
6
+    android:background="@color/colorWhite"
7
+    android:foreground="?android:selectableItemBackground"
8
+    android:orientation="vertical">
9
+
10
+    <LinearLayout
11
+        android:layout_width="match_parent"
12
+        android:layout_height="wrap_content"
13
+        android:gravity="center_vertical"
14
+        android:paddingLeft="16dp"
15
+        android:paddingTop="16dp"
16
+        android:paddingRight="16dp"
17
+        android:paddingBottom="16dp">
18
+
19
+        <ImageView
20
+            android:id="@+id/iv_show"
21
+            android:layout_width="wrap_content"
22
+            android:layout_height="wrap_content"
23
+            android:layout_marginRight="8dp"
24
+            android:src="@drawable/ic_finish_accent" />
25
+
26
+        <LinearLayout
27
+            android:layout_width="0dp"
28
+            android:layout_height="wrap_content"
29
+            android:layout_weight="1"
30
+            android:orientation="vertical">
31
+
32
+            <TextView
33
+                android:id="@+id/tv_status"
34
+                android:layout_width="wrap_content"
35
+                android:layout_height="wrap_content"
36
+                android:text="进行中"
37
+                android:textColor="@color/colorTextBlack"
38
+                android:textSize="?attr/textSizeXXX" />
39
+
40
+            <TextView
41
+                android:id="@+id/tv_time"
42
+                android:layout_width="wrap_content"
43
+                android:layout_height="wrap_content"
44
+                android:layout_marginTop="8dp"
45
+                android:text="2020-12-12 12:12"
46
+                android:textColor="@color/colorTextAccent"
47
+                android:textSize="?attr/textSizeXX" />
48
+        </LinearLayout>
49
+
50
+        <ImageView
51
+            android:layout_width="wrap_content"
52
+            android:layout_height="wrap_content"
53
+            android:layout_marginLeft="8dp"
54
+            android:src="@drawable/ic_next_normal" />
55
+    </LinearLayout>
56
+
57
+
58
+    <View
59
+        android:layout_width="match_parent"
60
+        android:layout_height="1px"
61
+        android:background="@color/colorLine" />
62
+</LinearLayout>

+ 17 - 2
app/src/main/res/navigation/nav_graph.xml

@@ -7,7 +7,7 @@
7 7
     <fragment
8 8
         android:id="@+id/mainFragment"
9 9
         android:name="com.unis.sxzcl.ui.home.MainFragment"
10
-        android:label="MainFragment" >
10
+        android:label="首页">
11 11
         <action
12 12
             android:id="@+id/action_mainFragment_to_companyStatsFragment"
13 13
             app:destination="@id/companyStatsFragment" />
@@ -119,6 +119,9 @@
119 119
         <action
120 120
             android:id="@+id/action_workModuleFragment_to_houseHomeFragment"
121 121
             app:destination="@id/houseHomeFragment" />
122
+        <action
123
+            android:id="@+id/action_workModuleFragment_to_grainCheckFragment"
124
+            app:destination="@id/grainCheckHomeFragment" />
122 125
     </fragment>
123 126
     <fragment
124 127
         android:id="@+id/exampleFragment"
@@ -139,7 +142,19 @@
139 142
     <fragment
140 143
         android:id="@+id/houseHomeFragment"
141 144
         android:name="com.unis.sxzcl.ui.house.HouseHomeFragment"
142
-        android:label="HouseHomeFragment" />
145
+        android:label="仓房信息" />
146
+    <fragment
147
+        android:id="@+id/grainCheckHomeFragment"
148
+        android:name="com.unis.sxzcl.ui.grain_check.GrainCheckHomeFragment"
149
+        android:label="粮情检查" >
150
+        <action
151
+            android:id="@+id/action_grainCheckHomeFragment_to_grainCheckDetailFragment"
152
+            app:destination="@id/grainCheckDetailFragment" />
153
+    </fragment>
154
+    <fragment
155
+        android:id="@+id/grainCheckDetailFragment"
156
+        android:name="com.unis.sxzcl.ui.grain_check.GrainCheckDetailFragment"
157
+        android:label="GrainCheckDetailFragment" />
143 158
 
144 159
 
145 160
 </navigation>

+ 17 - 0
app/src/main/res/values/styles.xml

@@ -1,5 +1,22 @@
1 1
 <resources>
2 2
 
3
+    <style name="MyDialog" parent="Theme.AppCompat.Dialog">
4
+        <!--背景颜色和透明程度-->
5
+        <item name="android:windowBackground">@android:color/transparent</item>
6
+        <item name="android:windowFullscreen">true</item>
7
+        <item name="android:windowIsTranslucent">true</item>
8
+        <!--是否去除标题-->
9
+        <item name="android:windowNoTitle">true</item>
10
+        <!--是否去除边框-->
11
+        <item name="android:windowFrame">@null</item>
12
+        <!--是否浮现在activity之上-->
13
+        <item name="android:windowIsFloating">true</item>
14
+        <!--是否模糊-->
15
+        <item name="android:backgroundDimEnabled">true</item>
16
+        <item name="android:windowContentOverlay">@null</item>
17
+
18
+    </style>
19
+
3 20
     <style name="main_tab_layout">
4 21
         <item name="android:layout_width">0dp</item>
5 22
         <item name="android:layout_height">match_parent</item>

+ 10 - 0
icon/src/main/res/drawable/ic_clear_white.xml

@@ -0,0 +1,10 @@
1
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+    android:width="24dp"
3
+    android:height="24dp"
4
+    android:tint="@color/colorWhite"
5
+    android:viewportWidth="24"
6
+    android:viewportHeight="24">
7
+    <path
8
+        android:fillColor="@android:color/white"
9
+        android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
10
+</vector>

+ 10 - 0
icon/src/main/res/drawable/ic_finish_accent.xml

@@ -0,0 +1,10 @@
1
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+    android:width="48dp"
3
+    android:height="48dp"
4
+    android:tint="@color/colorAccent"
5
+    android:viewportWidth="24"
6
+    android:viewportHeight="24">
7
+    <path
8
+        android:fillColor="@android:color/white"
9
+        android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z" />
10
+</vector>

+ 10 - 0
icon/src/main/res/drawable/ic_wait_blue.xml

@@ -0,0 +1,10 @@
1
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+    android:width="48dp"
3
+    android:height="48dp"
4
+    android:tint="@color/colorBlue"
5
+    android:viewportWidth="24"
6
+    android:viewportHeight="24">
7
+    <path
8
+        android:fillColor="@android:color/white"
9
+        android:pathData="M12,2C6.5,2 2,6.5 2,12s4.5,10 10,10s10,-4.5 10,-10S17.5,2 12,2zM15.55,15.8l-4.08,-2.51c-0.3,-0.18 -0.48,-0.5 -0.48,-0.85V7.75C11,7.34 11.34,7 11.75,7s0.75,0.34 0.75,0.75v4.45l3.84,2.31c0.36,0.22 0.48,0.69 0.26,1.05C16.38,15.91 15.91,16.02 15.55,15.8z" />
10
+</vector>

+ 2 - 0
model/src/main/java/com/unis/model/Constant.java

@@ -41,5 +41,7 @@ public class Constant {
41 41
 
42 42
     //所选公司
43 43
     public static final String KEY_SELECT_COMPANY = "select_company";
44
+    //所选仓房
45
+    public static final String KEY_SELECT_HOUSE = "select_house";
44 46
 
45 47
 }

+ 49 - 0
model/src/main/java/com/unis/model/HouseModel.java

@@ -0,0 +1,49 @@
1
+package com.unis.model;
2
+
3
+import com.google.gson.Gson;
4
+import com.unis.model.bean.HouseBean;
5
+import com.xyxsbj.mylibrary.tool.SPTool;
6
+
7
+/**
8
+ * 包名: com.unis.model
9
+ * 类名: UserModel
10
+ * 作用描述:
11
+ * 创建人: mQ
12
+ * 创建时间: 2020/11/25 15:55
13
+ * 更新人:
14
+ * 更新时间: 2020/11/25 15:55
15
+ * 更新说明:
16
+ * 版本号: 1.0
17
+ */
18
+public class HouseModel {
19
+    private HouseModel() {
20
+    }
21
+
22
+    private static class SingleHolder {
23
+        private static final HouseModel INSTANCE = new HouseModel();
24
+    }
25
+
26
+    public static HouseModel get() {
27
+        return SingleHolder.INSTANCE;
28
+    }
29
+
30
+
31
+    /**
32
+     * 存储选择的仓房
33
+     */
34
+    public void setSelectHouse(HouseBean bean) {
35
+        String houseJson = new Gson().toJson(bean);
36
+        SPTool.saveString(Constant.KEY_SELECT_HOUSE, houseJson);
37
+    }
38
+
39
+    /**
40
+     * 获取选择的仓房
41
+     */
42
+    public HouseBean getSelectHouse() {
43
+        String houseJson = SPTool.getString(Constant.KEY_SELECT_HOUSE, null);
44
+        if (houseJson == null)
45
+            return null;
46
+        return new Gson().fromJson(houseJson, HouseBean.class);
47
+    }
48
+
49
+}

+ 4 - 1
model/src/main/java/com/unis/model/UrlPath.java

@@ -14,7 +14,10 @@ package com.unis.model;
14 14
 public class UrlPath {
15 15
 
16 16
     //服务器地址
17
-    public static final String host = "http://10.10.1.25:9099/";
17
+    public static final String host = "http://10.10.1.25:9066/";
18
+    // vpn
19
+//    public static final String host = "http://172.16.0.46:9603/";
20
+
18 21
     //图片地址
19 22
     public static final String image_host = host + "csc-szls-system-manage/minio/preViewPicture/";
20 23
 

+ 60 - 0
model/src/main/java/com/unis/model/bean/GrainCheckBean.java

@@ -0,0 +1,60 @@
1
+package com.unis.model.bean;
2
+
3
+import androidx.annotation.IntDef;
4
+
5
+import java.lang.annotation.Retention;
6
+import java.lang.annotation.RetentionPolicy;
7
+
8
+/**
9
+ * 包名: com.unis.model.bean
10
+ * 类名: GrainCheckBean
11
+ * 作用描述:
12
+ * 创建人: mQ
13
+ * 创建时间: 2020/12/10 19:21
14
+ * 更新人:
15
+ * 更新时间: 2020/12/10 19:21
16
+ * 更新说明:
17
+ * 版本号: 1.0
18
+ */
19
+public class GrainCheckBean {
20
+
21
+    @IntDef({
22
+            STATUS.examine,
23
+            STATUS.underway,
24
+            STATUS.finish,
25
+    })
26
+    @Retention(RetentionPolicy.SOURCE)
27
+    public @interface STATUS {
28
+        // 审批中
29
+        int examine = 0;
30
+        // 进行中
31
+        int underway = 1;
32
+        // 已完成
33
+        int finish = 2;
34
+    }
35
+
36
+
37
+    private int status;
38
+    private String time;
39
+
40
+    public GrainCheckBean(@STATUS int status, String time) {
41
+        this.status = status;
42
+        this.time = time;
43
+    }
44
+
45
+    public int getStatus() {
46
+        return status;
47
+    }
48
+
49
+    public void setStatus(int status) {
50
+        this.status = status;
51
+    }
52
+
53
+    public String getTime() {
54
+        return time;
55
+    }
56
+
57
+    public void setTime(String time) {
58
+        this.time = time;
59
+    }
60
+}

+ 9 - 3
mylibrary/src/main/java/com/xyxsbj/mylibrary/tool/ETTool.java

@@ -128,10 +128,16 @@ public class ETTool {
128 128
      */
129 129
     public static void showSoftKeyboard(EditText view) {
130 130
         try {
131
-            if (view.requestFocus()) {
131
+            // 设置可获得焦点
132
+            view.setFocusable(true);
133
+            view.setFocusableInTouchMode(true);
134
+            // 请求获得焦点
135
+            view.requestFocus();
136
+//            if (view.requestFocus()) {
137
+                // 调用系统输入法
132 138
                 InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
133
-                imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
134
-            }
139
+                imm.showSoftInput(view, 0);
140
+//            }
135 141
         } catch (Exception e) {
136 142
 
137 143
         }