Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
A
AnchorCollect
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
AnchorCollect
Commits
6e618c21
Commit
6e618c21
authored
Apr 16, 2024
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改换绑标签弹出窗,不能扫描高频标签bug。
parent
61e506ef
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
11 deletions
+93
-11
build.gradle
app/build.gradle
+3
-3
BasicsCollectFragment.java
...phlx/anchorcollect/ui/fragment/BasicsCollectFragment.java
+58
-0
BasicsCollectVM.java
...om/phlx/anchorcollect/ui/fragment/vm/BasicsCollectVM.java
+31
-7
build.gradle
build.gradle
+1
-1
No files found.
app/build.gradle
View file @
6e618c21
...
@@ -9,8 +9,8 @@ android {
...
@@ -9,8 +9,8 @@ android {
applicationId
"com.phlx.anchorcollect"
applicationId
"com.phlx.anchorcollect"
minSdkVersion
21
minSdkVersion
21
targetSdkVersion
29
targetSdkVersion
29
versionCode
1
3
versionCode
1
4
versionName
"2.1.
1
"
versionName
"2.1.
2
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
...
@@ -64,7 +64,7 @@ dependencies {
...
@@ -64,7 +64,7 @@ dependencies {
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
//EventBus's
//EventBus's
implementation
'org.greenrobot:eventbus:3.2.0'
implementation
'org.greenrobot:eventbus:3.2.0'
implementation
'org.greenrobot:greendao:3.
2.2
'
implementation
'org.greenrobot:greendao:3.
3.0
'
implementation
'io.github.yuweiguocn:GreenDaoUpgradeHelper:v2.2.1'
implementation
'io.github.yuweiguocn:GreenDaoUpgradeHelper:v2.2.1'
// TinyPinyin核心包,约80KB
// TinyPinyin核心包,约80KB
implementation
'com.github.promeg:tinypinyin:2.0.3'
implementation
'com.github.promeg:tinypinyin:2.0.3'
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/BasicsCollectFragment.java
View file @
6e618c21
...
@@ -172,6 +172,9 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
...
@@ -172,6 +172,9 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
showPhotoDialog
(
viewModel
.
currentParamEntity
);
showPhotoDialog
(
viewModel
.
currentParamEntity
);
}
}
break
;
break
;
case
"inventory"
:
showInventoryDialog
(
viewModel
.
currentParamEntity
);
break
;
}
}
}
}
...
@@ -318,6 +321,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
...
@@ -318,6 +321,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
@Override
@Override
public
void
onClick
(
@NonNull
MaterialDialog
dialog
,
@NonNull
DialogAction
which
)
{
public
void
onClick
(
@NonNull
MaterialDialog
dialog
,
@NonNull
DialogAction
which
)
{
viewModel
.
scanFunction
=
2
;
viewModel
.
scanFunction
=
2
;
viewModel
.
isWeightScan
=
true
;
viewModel
.
scanRfid
();
viewModel
.
scanRfid
();
}
}
})
})
...
@@ -354,6 +358,13 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
...
@@ -354,6 +358,13 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
.
show
();
.
show
();
}
}
});
});
viewModel
.
setChangeLabelRfidValueEvent
.
observe
(
getActivity
(),
new
Observer
<
String
>()
{
@Override
public
void
onChanged
(
String
s
)
{
scanChangeLabelDialog
.
setContent
(
s
);
}
});
}
}
//选择框
//选择框
...
@@ -510,6 +521,53 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
...
@@ -510,6 +521,53 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
});
});
}
}
//盘点
private
void
showInventoryDialog
(
GenTableColumn
uiParamEntity
)
{
scanRfidDialog
=
new
MaterialDialog
.
Builder
(
getActivity
())
.
title
(
"牲畜耳标"
)
// .iconRes(R.drawable.ic_logo)
.
content
(
""
)
// .widgetColor(Color.BLUE)//输入框光标的颜色
// .inputType(inputType)//可以输入的类型
// .inputRangeRes(0, columnSize, android.R.color.black)
//前2个一个是hint一个是预输入的文字
// .input("低频耳标", "", new MaterialDialog.InputCallback() {
// @Override
// public void onInput(@NonNull MaterialDialog dialog, CharSequence input) {
// Log.i("scan", "输入的是:" + input);
// }
// })
.
negativeText
(
"取消"
)
.
neutralText
(
"扫描"
)
.
positiveText
(
"确定"
)
.
autoDismiss
(
false
)
.
onPositive
(
new
MaterialDialog
.
SingleButtonCallback
()
{
@Override
public
void
onClick
(
@NonNull
MaterialDialog
dialog
,
@NonNull
DialogAction
which
)
{
viewModel
.
currentParamEntity
.
setShowName
(
dialog
.
getContentView
().
getText
().
toString
());
viewModel
.
currentParamEntity
.
setContent
(
dialog
.
getContentView
().
getText
().
toString
());
viewModel
.
currentParamEntity
.
notifyChange
();
dialog
.
dismiss
();
}
})
.
onNeutral
(
new
MaterialDialog
.
SingleButtonCallback
()
{
@Override
public
void
onClick
(
@NonNull
MaterialDialog
dialog
,
@NonNull
DialogAction
which
)
{
viewModel
.
scanFunction
=
1
;
viewModel
.
scanRfid
();
}
})
.
onNegative
(
new
MaterialDialog
.
SingleButtonCallback
()
{
@Override
public
void
onClick
(
@NonNull
MaterialDialog
dialog
,
@NonNull
DialogAction
which
)
{
dialog
.
dismiss
();
}
})
.
show
();
}
//时间选择
//时间选择
private
void
showSelectDateDialog
(
GenTableColumn
uiParamEntity
)
{
private
void
showSelectDateDialog
(
GenTableColumn
uiParamEntity
)
{
pvTime
.
show
(
binding
.
card0
);
pvTime
.
show
(
binding
.
card0
);
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/vm/BasicsCollectVM.java
View file @
6e618c21
...
@@ -112,6 +112,10 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
...
@@ -112,6 +112,10 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
public
ObservableField
<
String
>
adgGainDate
=
new
ObservableField
<>(
""
);
//日增重日期
public
ObservableField
<
String
>
adgGainDate
=
new
ObservableField
<>(
""
);
//日增重日期
public
ObservableField
<
String
>
totalGainDate
=
new
ObservableField
<>(
""
);
//总增重日期
public
ObservableField
<
String
>
totalGainDate
=
new
ObservableField
<>(
""
);
//总增重日期
public
SingleLiveEvent
<
String
>
setRfidValueEvent
=
new
SingleLiveEvent
<>();
//设置弹窗的扫到的标签epc
public
SingleLiveEvent
<
String
>
setChangeLabelRfidValueEvent
=
new
SingleLiveEvent
<>();
//设置换绑标签弹窗的扫到的标签epc
private
SoundPool
soundPool
;
//盘点到标签时的提示音
private
SoundPool
soundPool
;
//盘点到标签时的提示音
private
SparseIntArray
musicId
;
private
SparseIntArray
musicId
;
...
@@ -131,7 +135,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
...
@@ -131,7 +135,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
private
Disposable
weightBus
;
private
Disposable
weightBus
;
p
rivate
boolean
isWeightScan
=
false
;
p
ublic
boolean
isWeightScan
=
false
;
public
int
scanFunction
=
0
;
//0 是普通扫描耳标,1 是弹出窗的扫描耳标, 2 是换绑耳标的扫描耳标
public
int
scanFunction
=
0
;
//0 是普通扫描耳标,1 是弹出窗的扫描耳标, 2 是换绑耳标的扫描耳标
...
@@ -709,11 +713,12 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
...
@@ -709,11 +713,12 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
private
void
checkEpc
(
String
epc
,
String
tid
)
{
private
void
checkEpc
(
String
epc
,
String
tid
)
{
rfidTag
=
epc
+
tid
;
rfidTag
=
epc
+
tid
;
if
(
Configs
.
inventoryStatus
)
{
if
(
Configs
.
inventoryStatus
)
{
if
(!
map
.
containsKey
(
rfidTag
))
{
switch
(
scanFunction
)
{
case
0
:
if
(!
map
.
containsKey
(
rfidTag
))
{
epcList
.
add
(
epc
);
epcList
.
add
(
epc
);
map
.
put
(
rfidTag
,
epcList
.
size
()
-
1
);
map
.
put
(
rfidTag
,
epcList
.
size
()
-
1
);
//查数据库
//查数据库
// addSubscribe(Observable.create((ObservableOnSubscribe<CattleResumeEntity>) emitter -> {
// addSubscribe(Observable.create((ObservableOnSubscribe<CattleResumeEntity>) emitter -> {
// try {
// try {
...
@@ -749,9 +754,28 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
...
@@ -749,9 +754,28 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
// ToastUtils.showShort(throwable.message);
// ToastUtils.showShort(throwable.message);
// }));
// }));
}
}
break
;
case
1
:
setRfidValueEvent
.
setValue
(
epc
);
break
;
case
2
:
setChangeLabelRfidValueEvent
.
setValue
(
epc
);
break
;
}
}
else
{
}
else
{
ToastUtils
.
showShort
(
"盘点到标签:"
+
epc
+
"|停止盘点"
);
ToastUtils
.
showShort
(
"盘点到标签:"
+
epc
+
"|停止盘点"
);
// initDataForRfid(epc);
switch
(
scanFunction
)
{
case
0
:
initDataForRfid
(
epc
);
initDataForRfid
(
epc
);
break
;
case
1
:
setRfidValueEvent
.
setValue
(
epc
);
break
;
case
2
:
setChangeLabelRfidValueEvent
.
setValue
(
epc
);
break
;
}
}
}
}
}
...
...
build.gradle
View file @
6e618c21
...
@@ -24,7 +24,7 @@ buildscript {
...
@@ -24,7 +24,7 @@ buildscript {
}
}
dependencies
{
dependencies
{
classpath
"com.android.tools.build:gradle:$agp_version"
classpath
"com.android.tools.build:gradle:$agp_version"
classpath
'org.greenrobot:greendao-gradle-plugin:3.3.
0
'
classpath
'org.greenrobot:greendao-gradle-plugin:3.3.
1
'
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
...
...
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