浏览代码

· 修复没有版本信息时闪退的问题
· 修改功能列表UI
· 编写全面流程页面demo

mq 5 年之前
父节点
当前提交
c82b1182be

+ 11 - 2
app/src/main/java/com/unis/sxzcl/MyApp.java

@@ -4,6 +4,8 @@ import android.content.Context;
4 4
 
5 5
 import androidx.multidex.MultiDex;
6 6
 
7
+import com.lzy.okgo.OkGo;
8
+import com.lzy.okgo.model.HttpHeaders;
7 9
 import com.xyxsbj.mylibrary.BaseApp;
8 10
 
9 11
 
@@ -35,6 +37,15 @@ public class MyApp extends BaseApp {
35 37
     public void onCreate() {
36 38
         super.onCreate();
37 39
         MultiDex.install(this);
40
+
41
+        //初始化全局请求头
42
+        HttpHeaders headers = new HttpHeaders();
43
+        // app类型
44
+        headers.put("App", "Android");
45
+        // app版本
46
+        headers.put("AppVersion", BuildConfig.VERSION_NAME);
47
+        OkGo.getInstance().init(this)
48
+                .addCommonHeaders(headers);                       //全局公共参数
38 49
     }
39 50
 
40 51
     @Override
@@ -44,6 +55,4 @@ public class MyApp extends BaseApp {
44 55
     }
45 56
 
46 57
 
47
-
48
-
49 58
 }

+ 2 - 1
app/src/main/java/com/unis/sxzcl/ui/aeration/AerationDetailFragment.java

@@ -14,7 +14,6 @@ import com.unis.model.DepotModel;
14 14
 import com.unis.model.HouseModel;
15 15
 import com.unis.model.ProcessModel;
16 16
 import com.unis.model.UserModel;
17
-import com.unis.model.bean.user.UserBean;
18 17
 import com.unis.model.bean.aeration.AerationBean;
19 18
 import com.unis.model.bean.detail.DetailApproveBean;
20 19
 import com.unis.model.bean.detail.DetailItemBean;
@@ -23,6 +22,7 @@ import com.unis.model.bean.process.ProcessDetailBean;
23 22
 import com.unis.model.bean.process.ProcessItemBean;
24 23
 import com.unis.model.bean.process.ProcessListBean;
25 24
 import com.unis.model.bean.process.ProcessStepBean;
25
+import com.unis.model.bean.user.UserBean;
26 26
 import com.unis.model.event.AerationEvent;
27 27
 import com.unis.sxzcl.R;
28 28
 import com.unis.sxzcl.base.BaseListFragment;
@@ -76,6 +76,7 @@ public class AerationDetailFragment extends BaseListFragment<FragmentAerationDet
76 76
         mBean = getGson().fromJson(data, AerationBean.class);
77 77
 
78 78
         if (mBean != null) {
79
+            mPageType  = "edit";
79 80
             // 不是申请人 只能查看
80 81
             String uid = UserModel.get().getUser().getUid().toString();
81 82
             if (!uid.equals(mBean.getApplyPeople())) {

+ 31 - 0
app/src/main/java/com/unis/sxzcl/ui/allround/AllRoundFragment.java

@@ -0,0 +1,31 @@
1
+package com.unis.sxzcl.ui.allround;
2
+
3
+import android.view.LayoutInflater;
4
+import android.view.ViewGroup;
5
+
6
+import com.unis.sxzcl.base.BaseFragment;
7
+import com.unis.sxzcl.databinding.FragmentAllroundBinding;
8
+
9
+/**
10
+ * 全面流程Fragment
11
+ * 创建人: mQ
12
+ * 创建时间: 2021/1/26 14:28
13
+ */
14
+public class AllRoundFragment extends BaseFragment<FragmentAllroundBinding> {
15
+
16
+
17
+    @Override
18
+    protected FragmentAllroundBinding getViewBinding(LayoutInflater inflater, ViewGroup container) {
19
+        return FragmentAllroundBinding.inflate(inflater, container, false);
20
+    }
21
+
22
+    @Override
23
+    protected void init() {
24
+
25
+    }
26
+
27
+    @Override
28
+    protected void onFirstShow() {
29
+
30
+    }
31
+}

+ 0 - 0
app/src/main/java/com/unis/sxzcl/ui/allround/全面流程.txt


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

@@ -154,12 +154,15 @@ public class WorkModuleAdapter extends BaseNodeAdapter implements LoadMoreModule
154 154
 
155 155
             case WorkbenchModel.TYPE_YJCG:
156 156
                 // 药剂采购
157
+                currentFragmentId = R.id.allRoundFragment;
157 158
                 break;
158 159
             case WorkbenchModel.TYPE_YJBG:
159 160
                 // 药剂保管
161
+                currentFragmentId = R.id.allRoundFragment;
160 162
                 break;
161 163
             case WorkbenchModel.TYPE_YJLY:
162 164
                 // 药剂领用
165
+                currentFragmentId = R.id.allRoundFragment;
163 166
                 break;
164 167
 
165 168
             case WorkbenchModel.TYPE_SSGL:

+ 16 - 10
app/src/main/java/com/unis/sxzcl/ui/work_module/WorkModuleFragment.java

@@ -57,9 +57,7 @@ public class WorkModuleFragment extends BaseListFragment<FragmentWorkModuleBindi
57 57
         });
58 58
 
59 59
         //下拉刷新
60
-        initRefreshView(mBinding.refreshLayout, () -> {
61
-            onRefresh();
62
-        });
60
+        initRefreshView(mBinding.refreshLayout, this::onRefresh);
63 61
 
64 62
         mAdapter = new WorkModuleAdapter();
65 63
         mAdapter.setCallback((item, fragmentId) -> {
@@ -126,6 +124,8 @@ public class WorkModuleFragment extends BaseListFragment<FragmentWorkModuleBindi
126 124
             }
127 125
             mBinding.barCompany.setText(bean.depotName);
128 126
         }
127
+
128
+        // 刷新功能列表
129 129
         onRefresh();
130 130
     }
131 131
 
@@ -133,14 +133,15 @@ public class WorkModuleFragment extends BaseListFragment<FragmentWorkModuleBindi
133 133
     @Override
134 134
     protected void onShowFragment() {
135 135
         super.onShowFragment();
136
-        // 作业功能列表时 未选库弹出提示
137
-        MultiDepotBean selectDepot = DepotModel.get().getSelectDepot();
138
-        if (selectDepot == null) {
136
+        // 页面显示时 未选库弹出提示
137
+        if (DepotModel.get().getSelectDepot() == null) {
139 138
             showSelectDepotDialog();
140 139
         }
141 140
     }
142 141
 
143
-    // 弹出选择粮库对话框
142
+    /**
143
+     * 粮库选择提示框
144
+     */
144 145
     public void showSelectDepotDialog() {
145 146
         if (mSelectDepotDialog == null)
146 147
             mSelectDepotDialog = new SystemDialog(getContext())
@@ -155,22 +156,27 @@ public class WorkModuleFragment extends BaseListFragment<FragmentWorkModuleBindi
155 156
         mSelectDepotDialog.show();
156 157
     }
157 158
 
159
+
160
+    /**
161
+     * 获取功能列表
162
+     */
158 163
     public void onRefreshData() {
159 164
 
160
-        MultiDepotBean selectDepot = DepotModel.get().getSelectDepot();
161
-        if (selectDepot == null) {
165
+        // 未选库时 提示用户
166
+        if (DepotModel.get().getSelectDepot() == null) {
162 167
             showSelectDepotDialog();
163 168
             loadEnd();
164 169
             return;
165 170
         }
166 171
 
172
+        // 获取功能列表
167 173
         mAdapter.setList(WorkbenchModel.get().getModuleList());
168 174
         loadComplete();
169 175
     }
170 176
 
171 177
 
172 178
     /**
173
-     * 监听选库的事件 刷新作业功能
179
+     * 监听粮库选中事件 刷新功能列表
174 180
      *
175 181
      * @param bean
176 182
      */

+ 5 - 5
app/src/main/java/com/unis/sxzcl/ui/work_module/WorkbenchModel.java

@@ -92,11 +92,11 @@ public class WorkbenchModel {
92 92
 //                new WorkModuleBean(TYPE_XZGL, R.drawable.ic_model_xzgl)
93 93
         )));
94 94
 
95
-//        list.add(new WorkModuleBean(TYPE_YJGL, Arrays.asList(
96
-//                new WorkModuleBean(TYPE_YJCG, R.drawable.ic_model_yjcg),
97
-//                new WorkModuleBean(TYPE_YJBG, R.drawable.ic_model_yjbg),
98
-//                new WorkModuleBean(TYPE_YJLY, R.drawable.ic_model_yjly)
99
-//        )));
95
+        list.add(new WorkModuleBean(TYPE_YJGL, Arrays.asList(
96
+                new WorkModuleBean(TYPE_YJCG, R.drawable.ic_model_yjcg),
97
+                new WorkModuleBean(TYPE_YJBG, R.drawable.ic_model_yjbg),
98
+                new WorkModuleBean(TYPE_YJLY, R.drawable.ic_model_yjly)
99
+        )));
100 100
 
101 101
 //        list.add(new WorkModuleBean(TYPE_SSSB, Arrays.asList(
102 102
 //                new WorkModuleBean(TYPE_SSGL, R.drawable.ic_model_ssgl),

+ 2 - 1
app/src/main/java/com/unis/sxzcl/util/VersionCheckTool.java

@@ -96,7 +96,8 @@ public class VersionCheckTool {
96 96
             @Override
97 97
             public void onError(String error) {
98 98
                 super.onError(error);
99
-                mError.onError(error);
99
+                if (mError != null)
100
+                    mError.onError(error);
100 101
             }
101 102
         });
102 103
     }

+ 59 - 0
app/src/main/res/layout/fragment_allround.xml

@@ -0,0 +1,59 @@
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="match_parent"
6
+    android:orientation="vertical">
7
+
8
+    <androidx.coordinatorlayout.widget.CoordinatorLayout
9
+        android:layout_width="match_parent"
10
+        android:layout_height="match_parent">
11
+
12
+        <com.google.android.material.appbar.AppBarLayout
13
+            android:layout_width="match_parent"
14
+            android:layout_height="wrap_content"
15
+            android:background="@null">
16
+
17
+            <com.unis.sxzcl.widget.BaseTitleBar
18
+                android:id="@+id/bar"
19
+                android:layout_width="match_parent"
20
+                android:layout_height="wrap_content"
21
+                app:barTitle="全面流程"
22
+                app:layout_scrollFlags="scroll|enterAlways" />
23
+
24
+            <TextView
25
+                android:layout_width="match_parent"
26
+                android:layout_height="200dp"
27
+                android:background="@color/colorBlue"
28
+                android:gravity="center"
29
+                android:text="流程节点"
30
+                android:textColor="@color/colorWhite"
31
+                android:textSize="?attr/textSizeXXX" />
32
+
33
+        </com.google.android.material.appbar.AppBarLayout>
34
+
35
+        <androidx.core.widget.NestedScrollView
36
+            android:layout_width="match_parent"
37
+            android:layout_height="match_parent"
38
+            app:layout_behavior="@string/appbar_scrolling_view_behavior">
39
+
40
+            <LinearLayout
41
+                android:layout_width="match_parent"
42
+                android:layout_height="match_parent">
43
+
44
+                <TextView
45
+                    android:layout_width="match_parent"
46
+                    android:layout_height="700dp"
47
+                    android:background="@color/colorGreen"
48
+                    android:gravity="center"
49
+                    android:text="节点内容"
50
+                    android:textColor="@color/colorWhite"
51
+                    android:textSize="?attr/textSizeXXX" />
52
+
53
+            </LinearLayout>
54
+
55
+        </androidx.core.widget.NestedScrollView>
56
+
57
+    </androidx.coordinatorlayout.widget.CoordinatorLayout>
58
+
59
+</LinearLayout>

+ 10 - 3
app/src/main/res/layout/item_work_module_title_list.xml

@@ -3,6 +3,7 @@
3 3
     xmlns:app="http://schemas.android.com/apk/res-auto"
4 4
     android:layout_width="match_parent"
5 5
     android:layout_height="wrap_content"
6
+    android:layout_marginTop="8dp"
6 7
     android:background="@color/colorWhite"
7 8
     android:foreground="?android:selectableItemBackground"
8 9
     android:orientation="vertical">
@@ -15,15 +16,21 @@
15 16
         android:gravity="center_vertical"
16 17
         android:orientation="horizontal">
17 18
 
19
+        <View
20
+            android:layout_width="8dp"
21
+            android:layout_height="8dp"
22
+            android:layout_marginLeft="16dp"
23
+            android:layout_marginRight="8dp"
24
+            android:background="@drawable/accent_circle_bg" />
25
+
18 26
         <TextView
19 27
             android:id="@+id/tv_name"
20 28
             android:layout_width="0dp"
21 29
             android:layout_height="wrap_content"
22
-            android:layout_marginLeft="16dp"
23 30
             android:layout_weight="1"
24 31
             android:text="标题"
25
-            android:textColor="@color/colorText33"
26
-            android:textSize="?attr/textSizeXXX" />
32
+            android:textColor="@color/colorTheme"
33
+            android:textSize="?attr/textSizeXXX"/>
27 34
 
28 35
         <ImageView
29 36
             android:id="@+id/iv_flag"

+ 7 - 0
app/src/main/res/navigation/nav_graph.xml

@@ -128,6 +128,9 @@
128 128
         <action
129 129
             android:id="@+id/action_workModuleFragment_to_aerationListFragment"
130 130
             app:destination="@id/aerationListFragment" />
131
+        <action
132
+            android:id="@+id/action_workModuleFragment_to_allRoundFragment"
133
+            app:destination="@id/allRoundFragment" />
131 134
     </fragment>
132 135
     <fragment
133 136
         android:id="@+id/exampleFragment"
@@ -193,6 +196,10 @@
193 196
             android:id="@+id/action_versionFragment_to_versionRecordFragment"
194 197
             app:destination="@id/versionRecordFragment" />
195 198
     </fragment>
199
+    <fragment
200
+        android:id="@+id/allRoundFragment"
201
+        android:name="com.unis.sxzcl.ui.allround.AllRoundFragment"
202
+        android:label="全面流程" />
196 203
 
197 204
 
198 205
 </navigation>

+ 3 - 2
model/src/main/java/com/unis/model/UrlPath.java

@@ -15,7 +15,8 @@ public class UrlPath {
15 15
 
16 16
     //服务器地址
17 17
 //    public static final String host = "http://10.10.1.25:9066/";
18
-    public static final String host = "http://101.36.160.140:21021"; // 02服务器
18
+//    public static final String host = "http://101.36.160.140:21021"; // 02服务器
19
+    public static final String host = "http://101.36.160.140:21061"; // 02服务器
19 20
 
20 21
     //图片地址
21 22
     public static final String image_host = host + "/api/csc-szls-system-manage/minio/preViewPicture/";
@@ -81,7 +82,7 @@ public class UrlPath {
81 82
     /****************** 粮情检查 ******************/
82 83
     // 粮情检查记录
83 84
     public static final String grain_check_list = host + "/api/csc-szls-business/grainConditionRecord/authority/getPage";
84
-    // 粮情检查字典
85
+    // 粮情检查选项字典
85 86
     public static final String grain_check_dictionary = host + "/api/csc-szls-business/grainManageDictionary/authority/getPage";
86 87
     // 粮情检查新增
87 88
     public static final String grain_check_add = host + "/api/csc-szls-business/grainConditionRecord/authority_button/add";

+ 1 - 1
model/src/main/java/com/unis/model/VersionModel.java

@@ -59,7 +59,7 @@ public class VersionModel {
59 59
                     @Override
60 60
                     public void onError(Response<String> response) {
61 61
                         super.onError(response);
62
-                        callBack.onError(getErrorMsg(response));
62
+                        callBack.onError(null);
63 63
                     }
64 64
                 });
65 65
     }

+ 4 - 0
model/src/main/java/com/unis/model/bean/detail/DetailItemType.java

@@ -2,6 +2,9 @@ package com.unis.model.bean.detail;
2 2
 
3 3
 import androidx.annotation.IntDef;
4 4
 
5
+import java.lang.annotation.Retention;
6
+import java.lang.annotation.RetentionPolicy;
7
+
5 8
 /**
6 9
  * 包名: com.unis.sxzcl.ui.grain_check
7 10
  * 类名: DetailItemType
@@ -18,6 +21,7 @@ import androidx.annotation.IntDef;
18 21
         DetailItemType.input,
19 22
         DetailItemType.approve,
20 23
 })
24
+@Retention(value = RetentionPolicy.SOURCE)
21 25
 public @interface DetailItemType {
22 26
 
23 27
     /******** 选项样式类型 *******/