Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
W
WoolTrace
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hywang
WoolTrace
Commits
c112a7f3
Commit
c112a7f3
authored
May 06, 2021
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.限制盘点页面的输入框软键盘弹出;
2.低频标签位数限制为15位; 3.修复同步数据报错一直请问的bug; 4.增加上传页面的未上传数量。
parent
c1b40bdf
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
268 additions
and
90 deletions
+268
-90
build.gradle
app/build.gradle
+2
-2
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+46
-32
InventoryActivity.java
...in/java/com/phlx/wool/ui/inventory/InventoryActivity.java
+83
-0
InventoryVM.java
...src/main/java/com/phlx/wool/ui/inventory/InventoryVM.java
+21
-0
SearchVeterinaryFragment.java
...ava/com/phlx/wool/ui/search/SearchVeterinaryFragment.java
+6
-6
SplashActivity.java
...src/main/java/com/phlx/wool/ui/splash/SplashActivity.java
+1
-1
SplashVM.java
app/src/main/java/com/phlx/wool/ui/splash/SplashVM.java
+1
-1
UploadActivity.java
...n/java/com/phlx/wool/ui/sync/activity/UploadActivity.java
+7
-0
DownloadVM.java
app/src/main/java/com/phlx/wool/ui/sync/vm/DownloadVM.java
+40
-37
UploadVM.java
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
+23
-5
activity_inventory.xml
app/src/main/res/layout/activity_inventory.xml
+33
-1
activity_upload.xml
app/src/main/res/layout/activity_upload.xml
+5
-5
No files found.
app/build.gradle
View file @
c112a7f3
...
...
@@ -8,8 +8,8 @@ android {
applicationId
"com.phlx.wool"
minSdkVersion
21
targetSdkVersion
29
versionCode
1
4
versionName
"1.1.
4
"
versionCode
1
8
versionName
"1.1.
8
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
...
...
app/src/main/AndroidManifest.xml
View file @
c112a7f3
...
...
@@ -17,18 +17,18 @@
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION "
/>
<application
android:name=
"App"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:networkSecurityConfig=
"@xml/network_security_config"
android:requestLegacyExternalStorage=
"true"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
android:requestLegacyExternalStorage=
"true"
android:networkSecurityConfig=
"@xml/network_security_config"
>
<activity
android:name=
".ui.login.LoginActivity"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".ui.login.LoginActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
>
...
...
@@ -38,59 +38,73 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.main.MainActivity"
<activity
android:name=
".ui.main.MainActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.mark.MarkingActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.mark.MarkingActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.harmless.HarmlessActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.harmless.HarmlessActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.quarantine.QuarantineActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.quarantine.QuarantineActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.inventory.InventoryActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.inventory.InventoryActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.setting.SettingActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.setting.SettingActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.unit.UnitActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.work.unit.UnitActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.sync.activity.ClearActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.sync.activity.ClearActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.sync.activity.UploadActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.sync.activity.UploadActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.sync.activity.DownloadActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.sync.activity.DownloadActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.splash.SplashActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.splash.SplashActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.villus.VillusBuyActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.villus.VillusBuyActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.villus.VillusGaugeActivity"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.villus.VillusGaugeActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.villus.BluetoothDeviceList"
/>
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.villus.BluetoothDeviceList"
/>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/com/phlx/wool/ui/inventory/InventoryActivity.java
View file @
c112a7f3
...
...
@@ -3,7 +3,15 @@ package com.phlx.wool.ui.inventory;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.text.method.BaseKeyListener
;
import
android.text.method.DigitsKeyListener
;
import
android.text.method.KeyListener
;
import
android.text.method.TextKeyListener
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.inputmethod.InputConnection
;
import
android.widget.EditText
;
import
androidx.annotation.NonNull
;
import
androidx.lifecycle.Observer
;
...
...
@@ -22,6 +30,8 @@ import com.phlx.wool.rfid.ModuleManager;
import
com.phlx.wool.ui.base.BaseActivity
;
import
com.uhf.structures.InventoryParams
;
import
java.lang.reflect.Method
;
import
me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter
;
/**
...
...
@@ -40,6 +50,8 @@ public class InventoryActivity extends BaseActivity<ActivityInventoryBinding, In
private
String
labelStr
=
""
;
private
int
tempCount
,
temp2Count
,
temp3Count
;
@Override
public
void
initParam
()
{
super
.
initParam
();
...
...
@@ -69,6 +81,8 @@ public class InventoryActivity extends BaseActivity<ActivityInventoryBinding, In
public
void
initData
()
{
super
.
initData
();
setSupportActionBar
(
binding
.
include
.
toolbar
);
disableShowSoftInput
(
binding
.
etInvDesc
);
viewModel
.
initToolbar
(
type
);
binding
.
setAdapter
(
new
BindingRecyclerViewAdapter
());
if
(
"0"
.
equals
(
Configs
.
FREQUENCY_CONFIG
))
{
...
...
@@ -99,6 +113,52 @@ public class InventoryActivity extends BaseActivity<ActivityInventoryBinding, In
public
void
initViewObservable
()
{
super
.
initViewObservable
();
// InputConnection ic = binding.etInvDesc.getContentDescription()
//
binding
.
etInvDesc
.
setOnKeyListener
(
new
View
.
OnKeyListener
()
{
@Override
public
boolean
onKey
(
View
view
,
int
i
,
KeyEvent
keyEvent
)
{
if
(
keyEvent
.
getAction
()
==
KeyEvent
.
ACTION_DOWN
&&
keyEvent
.
getKeyCode
()
!=
KeyEvent
.
KEYCODE_ENTER
)
{
tempCount
++;
viewModel
.
setTest
(
tempCount
+
""
);
Log
.
e
(
"why"
,
"tempCount++"
+
tempCount
+
"-"
+
keyEvent
);
}
else
if
(
keyEvent
.
getAction
()
==
KeyEvent
.
ACTION_UP
)
{
temp2Count
++;
viewModel
.
setTest2
(
temp2Count
+
""
);
Log
.
e
(
"why"
,
"temp2Count--"
+
temp2Count
+
"-"
+
keyEvent
);
}
else
if
(
keyEvent
.
getAction
()
==
KeyEvent
.
FLAG_LONG_PRESS
){
temp3Count
++;
viewModel
.
setTest3
(
temp3Count
+
""
);
Log
.
e
(
"why"
,
"temp3Count=="
+
temp3Count
+
"-"
+
keyEvent
);
}
// if (tempCount > 1) {
// tempCount = 0;
//
// binding.etInvDesc.dispatchKeyEvent(KeyEvent.changeAction(keyEvent, KeyEvent.ACTION_UP));
// }
return
false
;
}
});
// binding.etInvDesc.setKeyListener(new DigitsKeyListener(){
// @Override
// public boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event) {
// Log.e("why", "onKeyDown:" + event);
// return super.onKeyDown(view, content, keyCode, event);
// }
//
// @Override
// public boolean onKeyUp(View view, Editable content, int keyCode, KeyEvent event) {
// Log.e("why", "onKeyUp:" + event);
// return super.onKeyUp(view, content, keyCode, event);
// }
// });
binding
.
etInvDesc
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
charSequence
,
int
i
,
int
i1
,
int
i2
)
{
...
...
@@ -114,10 +174,17 @@ public class InventoryActivity extends BaseActivity<ActivityInventoryBinding, In
public
void
afterTextChanged
(
Editable
editable
)
{
binding
.
etInvDesc
.
removeTextChangedListener
(
this
);
viewModel
.
trim
();
// binding.etInvDesc.setFocusable(true);
// binding.etInvDesc.setFocusableInTouchMode(true);
binding
.
etInvDesc
.
requestFocus
();
binding
.
etInvDesc
.
requestFocusFromTouch
();
binding
.
etInvDesc
.
setSelection
(
editable
.
length
());
binding
.
etInvDesc
.
addTextChangedListener
(
this
);
}
});
viewModel
.
inventoryBtnEvent
.
observe
(
this
,
aBoolean
->
{
if
(
binding
.
inventory
.
getText
().
equals
(
"盘点"
))
{
binding
.
inventory
.
setText
(
"停止"
);
...
...
@@ -153,4 +220,20 @@ public class InventoryActivity extends BaseActivity<ActivityInventoryBinding, In
}
/**
* 禁止Edittext弹出软件盘,光标依然正常显示。
*/
public
static
void
disableShowSoftInput
(
EditText
editText
)
{
Class
<
EditText
>
cls
=
EditText
.
class
;
Method
method
;
try
{
method
=
cls
.
getMethod
(
"setShowSoftInputOnFocus"
,
boolean
.
class
);
method
.
setAccessible
(
true
);
method
.
invoke
(
editText
,
false
);
}
catch
(
Exception
e
)
{
// TODO: 2018/8/27 处理错误
}
}
}
app/src/main/java/com/phlx/wool/ui/inventory/InventoryVM.java
View file @
c112a7f3
...
...
@@ -64,6 +64,9 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis
private
SparseIntArray
musicId
;
public
ObservableField
<
String
>
unitName
=
new
ObservableField
<>(
""
);
public
ObservableField
<
String
>
labelNum
=
new
ObservableField
<>(
""
);
public
ObservableField
<
String
>
testlNum
=
new
ObservableField
<>(
"-"
);
public
ObservableField
<
String
>
testpNum
=
new
ObservableField
<>(
"-"
);
public
ObservableField
<
String
>
testyNum
=
new
ObservableField
<>(
"-"
);
public
ObservableField
<
String
>
tipDesc
=
new
ObservableField
<>(
""
);
public
ObservableField
<
Integer
>
tipDescVis
=
new
ObservableField
<>(
View
.
VISIBLE
);
public
ObservableField
<
Integer
>
invBtnVis
=
new
ObservableField
<>(
View
.
GONE
);
...
...
@@ -165,6 +168,12 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis
@Override
public
void
call
()
{
if
(
tipDesc
.
get
().
length
()
!=
15
)
{
tipDesc
.
set
(
""
);
ToastUtils
.
showShort
(
"标签错误,请重新扫描标签"
);
return
;
}
if
(
""
.
equals
(
tipDesc
.
get
().
trim
()))
{
ToastUtils
.
showShort
(
"请扫描标签"
);
return
;
...
...
@@ -261,6 +270,18 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis
map
.
put
(
tag
,
mList
.
size
()
-
1
);
}
public
void
setTest
(
String
testcount
){
testlNum
.
set
(
testcount
);
}
public
void
setTest2
(
String
testcount
){
testpNum
.
set
(
testcount
);
}
public
void
setTest3
(
String
testcount
){
testyNum
.
set
(
testcount
);
}
public
void
jumpToActivity
()
{
if
(
mList
!=
null
&&
mList
.
size
()
>
0
)
{
Bundle
mBundle
=
new
Bundle
();
...
...
app/src/main/java/com/phlx/wool/ui/search/SearchVeterinaryFragment.java
View file @
c112a7f3
...
...
@@ -82,8 +82,7 @@ public class SearchVeterinaryFragment extends DialogFragment implements DialogIn
}
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
view
=
inflater
.
inflate
(
R
.
layout
.
dialog_search
,
container
,
false
);
init
();
//实例化
...
...
@@ -265,8 +264,8 @@ public class SearchVeterinaryFragment extends DialogFragment implements DialogIn
VeterinaryDao
.
Properties
.
VeterinaryPhone
.
eq
(
searchKey
));
List
<
Veterinary
>
veterinaries
=
DbUtil
.
getInstance
().
queryAll
(
Veterinary
.
class
,
builder
);
if
(
veterinaries
==
null
||
veterinaries
.
size
()
==
0
)
{
ToastUtils
.
showShort
(
"未找到符合 "
+
searchKey
+
" 的搜索结果"
);
}
else
{
ToastUtils
.
showShort
(
"未找到符合 "
+
searchKey
+
" 的搜索结果"
);
}
else
{
onSearchVeterinaryClickListener
.
OnSelectedClick
(
veterinaries
.
get
(
0
));
hideAnim
();
}
...
...
@@ -285,18 +284,19 @@ public class SearchVeterinaryFragment extends DialogFragment implements DialogIn
QueryBuilder
<
Veterinary
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
Veterinary
.
class
)
.
whereOr
(
VeterinaryDao
.
Properties
.
VeterinaryName
.
like
(
"%"
+
keyword
+
"%"
),
VeterinaryDao
.
Properties
.
VeterinaryPhone
.
like
(
keyword
+
"%"
));
VeterinaryDao
.
Properties
.
VeterinaryPhone
.
like
(
keyword
+
"%"
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Veterinary
>()
{
@Override
public
void
onSuccess
(
List
<
Veterinary
>
result
)
{
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
Veterinaries
.
addAll
(
result
);
veterinaryAdapter
.
notifyDataSetChanged
();
}
else
{
}
else
{
Veterinaries
.
clear
();
veterinaryAdapter
.
notifyDataSetChanged
();
}
}
@Override
public
void
onFailed
()
{
...
...
app/src/main/java/com/phlx/wool/ui/splash/SplashActivity.java
View file @
c112a7f3
...
...
@@ -53,7 +53,7 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
inputTime
=
result
.
get
(
0
).
getTimestamp
();
}
viewModel
.
requestLabel
(
1
,
inputTime
,
10
0000
);
viewModel
.
requestLabel
(
1
,
inputTime
,
5
0000
);
}
@Override
...
...
app/src/main/java/com/phlx/wool/ui/splash/SplashVM.java
View file @
c112a7f3
...
...
@@ -82,7 +82,7 @@ public class SplashVM extends MainBarVM<Repository> {
}
else
{
dismissDialog
();
showDialog
(
"正在同步数据,请勿关闭屏幕或退出程序!"
);
queryUnitInputTime
(
unitPageIndex
,
10
0000
);
queryUnitInputTime
(
unitPageIndex
,
5
0000
);
}
}
else
{
...
...
app/src/main/java/com/phlx/wool/ui/sync/activity/UploadActivity.java
View file @
c112a7f3
...
...
@@ -45,4 +45,11 @@ public class UploadActivity extends BaseActivity<ActivityUploadBinding, UploadVM
setSupportActionBar
(
binding
.
include
.
toolbar
);
viewModel
.
initToolbar
();
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
viewModel
.
refreshUploadCount
();
}
}
app/src/main/java/com/phlx/wool/ui/sync/vm/DownloadVM.java
View file @
c112a7f3
...
...
@@ -255,13 +255,13 @@ public class DownloadVM extends BackBarVM<Repository> {
private
void
requestUnit
(
int
index
,
long
inputTime
,
int
count
)
{
isUnitDownload
=
true
;
PostParams
postParams
=
new
PostParams
();
postParams
.
setInputTime
(
inputTime
);
postParams
.
setPageNum
(
index
);
postParams
.
setPageSize
(
count
);
postParams
.
setYears
(
""
);
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
new
Gson
().
toJson
(
postParams
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
new
Gson
().
toJson
(
postParams
));
KLog
.
e
(
"--Unit--"
+
postParams
.
toString
());
addSubscribe
(
model
.
getUnitList
(
body
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
...
...
@@ -280,7 +280,7 @@ public class DownloadVM extends BackBarVM<Repository> {
if
(
result
)
{
unitPageIndex
++;
requestUnit
(
unitPageIndex
,
inputTime
,
count
);
}
else
{
}
else
{
downloadNext
();
}
}
...
...
@@ -327,13 +327,13 @@ public class DownloadVM extends BackBarVM<Repository> {
}
private
void
requestVeterinary
()
{
isVeterinaryDownload
=
true
;
PostParams
postParams
=
new
PostParams
();
postParams
.
setInputTime
(
0
);
postParams
.
setPageNum
(
1
);
postParams
.
setPageSize
(
200
);
postParams
.
setYears
(
""
);
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
new
Gson
().
toJson
(
postParams
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
new
Gson
().
toJson
(
postParams
));
addSubscribe
(
model
.
getVeterinaryList
(
body
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
schedulersTransformer
())
...
...
@@ -376,6 +376,7 @@ public class DownloadVM extends BackBarVM<Repository> {
}
private
void
requestVillusBuy
()
{
isVillusBuyDownload
=
true
;
List
<
VillusBuyEntity
>
villusBuy
=
model
.
getVillusBuy
();
PostParams
postParams
=
new
PostParams
();
Date
_date
=
null
;
...
...
@@ -434,6 +435,8 @@ public class DownloadVM extends BackBarVM<Repository> {
}
private
void
requestBasicInfo
()
{
isBasicDownload
=
true
;
PostParams
postParams
=
new
PostParams
();
postParams
.
setInputTime
(
0
);
postParams
.
setPageNum
(
1
);
...
...
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
View file @
c112a7f3
...
...
@@ -58,6 +58,12 @@ public class UploadVM extends BackBarVM<Repository> {
private
String
toastStr
=
""
;
public
ObservableField
<
String
>
markingLabelNum
=
new
ObservableField
<>(
"打标记录"
);
public
ObservableField
<
String
>
harmlessLabelNum
=
new
ObservableField
<>(
"无害化处理"
);
public
ObservableField
<
String
>
quarantineLabelNum
=
new
ObservableField
<>(
"检疫记录"
);
public
ObservableField
<
String
>
villusBuyLabelNum
=
new
ObservableField
<>(
"绒毛购买"
);
public
ObservableField
<
String
>
villusgaugelabelnum
=
new
ObservableField
<>(
"绒毛测量"
);
public
ObservableField
<
Boolean
>
isUploadMarking
=
new
ObservableField
<
Boolean
>(
false
);
public
ObservableField
<
Boolean
>
isUploadHarmless
=
new
ObservableField
<
Boolean
>(
false
);
public
ObservableField
<
Boolean
>
isUploadQuarantine
=
new
ObservableField
<
Boolean
>(
false
);
...
...
@@ -139,6 +145,17 @@ public class UploadVM extends BackBarVM<Repository> {
isUploadVillusGauge
.
set
(
isSelected
);
}
//查询每项未上传记录数量
public
void
refreshUploadCount
()
{
markingLabelNum
.
set
(
"打标记录 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Marking
.
class
)
+
")"
);
harmlessLabelNum
.
set
(
"无害化处理 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Harmless
.
class
)
+
")"
);
quarantineLabelNum
.
set
(
"检疫记录 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Quarantine
.
class
)
+
")"
);
villusBuyLabelNum
.
set
(
"绒毛购买 "
+
"("
+
DbUtil
.
getInstance
().
count
(
VillusBuyEntity
.
class
)
+
")"
);
villusgaugelabelnum
.
set
(
"绒毛测量 "
+
"("
+
DbUtil
.
getInstance
().
count
(
VillusGaugeEntity
.
class
)
+
")"
);
;
}
private
void
uploadNext
()
{
if
(
isUploadMarking
.
get
()
&&
!
isMarkingUpload
)
{
...
...
@@ -152,6 +169,7 @@ public class UploadVM extends BackBarVM<Repository> {
}
else
if
(
isUploadVillusGauge
.
get
()
&&
!
isVillusGaugeUpload
)
{
uploadVillusGauge
();
}
else
{
refreshUploadCount
();
if
(!
isUploadMarking
.
get
()
&&
!
isUploadHarmless
.
get
()
&&
!
isUploadQuarantine
.
get
()
&&
!
isUploadVillusBuy
.
get
()
&&
!
isUploadVillusGauge
.
get
())
{
ToastUtils
.
showShort
(
"请选择上传的项目"
);
}
else
if
(!
""
.
equals
(
toastStr
))
{
...
...
@@ -218,7 +236,7 @@ public class UploadVM extends BackBarVM<Repository> {
}).
deleteAsyncBatch
(
Marking
.
class
,
result
);
}
else
{
dismissDialog
();
toastStr
+=
"marking上传失败;"
;
toastStr
+=
"marking上传失败;"
;
ToastUtils
.
showShort
(
"marking上传失败"
);
uploadNext
();
}
...
...
@@ -295,7 +313,7 @@ public class UploadVM extends BackBarVM<Repository> {
}
}).
deleteAsyncBatch
(
Quarantine
.
class
,
result
);
}
else
{
toastStr
+=
"上传检疫数据失败;"
;
toastStr
+=
"上传检疫数据失败;"
;
ToastUtils
.
showShort
(
"上传检疫数据失败"
);
uploadNext
();
}
...
...
@@ -370,7 +388,7 @@ public class UploadVM extends BackBarVM<Repository> {
}
}).
deleteAsyncBatch
(
Harmless
.
class
,
result
);
}
else
{
toastStr
+=
"上传无害化失败;"
;
toastStr
+=
"上传无害化失败;"
;
ToastUtils
.
showShort
(
"上传无害化失败"
);
uploadNext
();
}
...
...
@@ -435,7 +453,7 @@ public class UploadVM extends BackBarVM<Repository> {
}
}).
updateAsyncBatch
(
VillusBuyEntity
.
class
,
result
);
}
else
{
toastStr
+=
"上传绒毛购买数据失败;"
;
toastStr
+=
"上传绒毛购买数据失败;"
;
ToastUtils
.
showShort
(
"上传绒毛购买数据失败"
);
uploadNext
();
}
...
...
@@ -500,7 +518,7 @@ public class UploadVM extends BackBarVM<Repository> {
}
}).
updateAsyncBatch
(
VillusGaugeEntity
.
class
,
result
);
}
else
{
toastStr
+=
"上传绒毛测量数据失败;"
;
toastStr
+=
"上传绒毛测量数据失败;"
;
ToastUtils
.
showShort
(
"上传绒毛测量数据失败"
);
uploadNext
();
}
...
...
app/src/main/res/layout/activity_inventory.xml
View file @
c112a7f3
...
...
@@ -83,7 +83,7 @@
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/inventory_num"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
@dimen/dp_70
"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_20"
android:text=
"@={viewModel.labelNum}"
...
...
@@ -92,6 +92,38 @@
binding:layout_constraintBaseline_toBaselineOf=
"@id/inventory_num_desc"
binding:layout_constraintStart_toEndOf=
"@+id/inventory_num_desc"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/testl_num"
android:layout_width=
"@dimen/dp_30"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:text=
"@={viewModel.testlNum}"
android:textColor=
"#2d2f33"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintBaseline_toBaselineOf=
"@id/inventory_num_desc"
binding:layout_constraintLeft_toRightOf=
"@+id/inventory_num"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/testp_num"
android:layout_width=
"@dimen/dp_30"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:text=
"@={viewModel.testpNum}"
android:textColor=
"#2d2f33"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintBaseline_toBaselineOf=
"@id/inventory_num_desc"
binding:layout_constraintLeft_toRightOf=
"@+id/testl_num"
/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"@dimen/dp_30"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:text=
"@={viewModel.testyNum}"
android:textColor=
"#2d2f33"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintBaseline_toBaselineOf=
"@id/inventory_num_desc"
binding:layout_constraintLeft_toRightOf=
"@+id/testp_num"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
...
...
app/src/main/res/layout/activity_upload.xml
View file @
c112a7f3
...
...
@@ -35,7 +35,7 @@
android:layout_marginStart=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isUploadMarking}"
android:text=
"
打标记录
"
android:text=
"
@{viewModel.markingLabelNum}
"
android:textColor=
"@color/black"
binding:layout_constraintStart_toStartOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
...
...
@@ -48,7 +48,7 @@
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:checked=
"@{viewModel.isUploadHarmless}"
android:text=
"
无害化处理
"
android:text=
"
@{viewModel.harmlessLabelNum}
"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintEnd_toEndOf=
"parent"
...
...
@@ -61,7 +61,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isUploadQuarantine}"
android:text=
"
检疫记录
"
android:text=
"
@{viewModel.quarantineLabelNum}
"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintStart_toStartOf=
"@id/marking_info_desc"
...
...
@@ -75,7 +75,7 @@
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:checked=
"@{viewModel.isUploadVillusBuy}"
android:text=
"
绒毛购买
"
android:text=
"
@{viewModel.villusBuyLabelNum}
"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintStart_toStartOf=
"@id/harmless_info_desc"
...
...
@@ -88,7 +88,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isUploadVillusGauge}"
android:text=
"
绒毛测量
"
android:text=
"
@{viewModel.villusgaugelabelnum}
"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintStart_toStartOf=
"@id/marking_info_desc"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment