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
bf8ea70f
Commit
bf8ea70f
authored
May 10, 2021
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复清除数据卡死bug;
2.修复羊绒购买无法上传完成的bug; 3.增加同步数据页面本地数量。
parent
c112a7f3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
34 deletions
+117
-34
build.gradle
app/build.gradle
+2
-2
Configs.java
app/src/main/java/com/phlx/wool/Configs.java
+1
-1
ClearVM.java
app/src/main/java/com/phlx/wool/ui/sync/vm/ClearVM.java
+47
-8
DownloadVM.java
app/src/main/java/com/phlx/wool/ui/sync/vm/DownloadVM.java
+33
-7
UploadVM.java
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
+24
-6
activity_clear.xml
app/src/main/res/layout/activity_clear.xml
+5
-5
activity_download.xml
app/src/main/res/layout/activity_download.xml
+5
-5
No files found.
app/build.gradle
View file @
bf8ea70f
...
@@ -8,8 +8,8 @@ android {
...
@@ -8,8 +8,8 @@ android {
applicationId
"com.phlx.wool"
applicationId
"com.phlx.wool"
minSdkVersion
21
minSdkVersion
21
targetSdkVersion
29
targetSdkVersion
29
versionCode
1
8
versionCode
1
9
versionName
"1.1.
8
"
versionName
"1.1.
9
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
}
...
...
app/src/main/java/com/phlx/wool/Configs.java
View file @
bf8ea70f
...
@@ -59,7 +59,7 @@ public class Configs {
...
@@ -59,7 +59,7 @@ public class Configs {
public
static
final
String
WORK_TYPE_H
=
"work_type_harmless"
;
public
static
final
String
WORK_TYPE_H
=
"work_type_harmless"
;
//0 高频,1低频
//0 高频,1低频
public
static
String
FREQUENCY_CONFIG
=
"
0
"
;
public
static
String
FREQUENCY_CONFIG
=
"
1
"
;
/** 蓝牙 */
/** 蓝牙 */
public
static
boolean
isConnected
=
false
;
// 蓝牙连接状态
public
static
boolean
isConnected
=
false
;
// 蓝牙连接状态
...
...
app/src/main/java/com/phlx/wool/ui/sync/vm/ClearVM.java
View file @
bf8ea70f
...
@@ -44,6 +44,14 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -44,6 +44,14 @@ public class ClearVM extends BackBarVM<Repository> {
public
ObservableField
<
Boolean
>
isClearAll
=
new
ObservableField
<
Boolean
>(
false
);
public
ObservableField
<
Boolean
>
isClearAll
=
new
ObservableField
<
Boolean
>(
false
);
public
ObservableInt
clearDataVisibility
=
new
ObservableInt
();
public
ObservableInt
clearDataVisibility
=
new
ObservableInt
();
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
<>(
"绒毛测量"
);
private
String
toastStr
;
private
boolean
isMarkingClear
,
isHarmlessClear
,
isQuarantineClear
,
isVillusBuyClear
,
isVillusGaugeClear
;
private
boolean
isMarkingClear
,
isHarmlessClear
,
isQuarantineClear
,
isVillusBuyClear
,
isVillusGaugeClear
;
public
ClearVM
(
@NonNull
Application
application
,
Repository
repository
)
{
public
ClearVM
(
@NonNull
Application
application
,
Repository
repository
)
{
...
@@ -124,31 +132,52 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -124,31 +132,52 @@ public class ClearVM extends BackBarVM<Repository> {
isQuarantineClear
=
false
;
isQuarantineClear
=
false
;
isVillusBuyClear
=
false
;
isVillusBuyClear
=
false
;
isVillusGaugeClear
=
false
;
isVillusGaugeClear
=
false
;
toastStr
=
""
;
clearNext
();
clearNext
();
});
});
private
void
clearNext
()
{
private
void
clearNext
()
{
if
(
isClearMarking
.
get
()
&&
!
isMarkingClear
)
{
if
(
isClearMarking
.
get
()
&&
!
isMarkingClear
)
{
deleteAllMarking
();
deleteAllMarking
();
}
else
if
(
isClearQuarantine
.
get
()
&&
!
is
Harmless
Clear
)
{
}
else
if
(
isClearQuarantine
.
get
()
&&
!
is
Quarantine
Clear
)
{
deleteAllQuarantine
();
deleteAllQuarantine
();
}
else
if
(
isClearHarmless
.
get
()
&&
!
is
Quarantine
Clear
)
{
}
else
if
(
isClearHarmless
.
get
()
&&
!
is
Harmless
Clear
)
{
deleteAllHarmless
();
deleteAllHarmless
();
}
else
if
(
isClearVillusBuy
.
get
()
&&
!
isVillusBuyClear
)
{
}
else
if
(
isClearVillusBuy
.
get
()
&&
!
isVillusBuyClear
)
{
deleteAllVillusBuy
();
deleteAllVillusBuy
();
}
else
if
(
isClearVillusGauge
.
get
()
&&
!
isVillusGaugeClear
)
{
}
else
if
(
isClearVillusGauge
.
get
()
&&
!
isVillusGaugeClear
)
{
deleteAllVillusGauge
();
deleteAllVillusGauge
();
}
else
{
refreshUploadCount
();
if
(
""
.
equals
(
toastStr
))
{
ToastUtils
.
showShort
(
"清除数据成功"
);
}
else
{
ToastUtils
.
showShort
(
toastStr
);
}
}
}
}
}
//查询每项记录数量
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
deleteAllMarking
()
{
private
void
deleteAllMarking
()
{
showDialog
(
"正在清除数据,请勿关闭屏幕或退出程序"
);
showDialog
(
"正在清除
标签
数据,请勿关闭屏幕或退出程序"
);
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
@Override
@Override
public
void
onNotification
(
boolean
result
)
{
public
void
onNotification
(
boolean
result
)
{
isMarkingClear
=
true
;
isMarkingClear
=
true
;
if
(
result
)
{
if
(
result
)
{
dismissDialog
();
dismissDialog
();
}
else
{
toastStr
+=
"清除标签数据失败;"
;
}
}
clearNext
();
clearNext
();
}
}
...
@@ -156,7 +185,7 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -156,7 +185,7 @@ public class ClearVM extends BackBarVM<Repository> {
}
}
private
void
deleteAllQuarantine
()
{
private
void
deleteAllQuarantine
()
{
showDialog
(
"正在清除数据,请勿关闭屏幕或退出程序"
);
showDialog
(
"正在清除
检疫
数据,请勿关闭屏幕或退出程序"
);
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
@Override
@Override
public
void
onNotification
(
boolean
result
)
{
public
void
onNotification
(
boolean
result
)
{
...
@@ -164,6 +193,8 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -164,6 +193,8 @@ public class ClearVM extends BackBarVM<Repository> {
if
(
result
)
{
if
(
result
)
{
dismissDialog
();
dismissDialog
();
DbUtil
.
getInstance
().
deleteAsyncAll
(
QuarantineDetail
.
class
);
DbUtil
.
getInstance
().
deleteAsyncAll
(
QuarantineDetail
.
class
);
}
else
{
toastStr
+=
"清除检疫数据失败;"
;
}
}
clearNext
();
clearNext
();
}
}
...
@@ -171,7 +202,7 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -171,7 +202,7 @@ public class ClearVM extends BackBarVM<Repository> {
}
}
private
void
deleteAllHarmless
()
{
private
void
deleteAllHarmless
()
{
showDialog
(
"正在清除数据,请勿关闭屏幕或退出程序"
);
showDialog
(
"正在清除
无害化
数据,请勿关闭屏幕或退出程序"
);
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
@Override
@Override
public
void
onNotification
(
boolean
result
)
{
public
void
onNotification
(
boolean
result
)
{
...
@@ -179,6 +210,8 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -179,6 +210,8 @@ public class ClearVM extends BackBarVM<Repository> {
if
(
result
)
{
if
(
result
)
{
dismissDialog
();
dismissDialog
();
DbUtil
.
getInstance
().
deleteAsyncAll
(
HarmlessDetail
.
class
);
DbUtil
.
getInstance
().
deleteAsyncAll
(
HarmlessDetail
.
class
);
}
else
{
toastStr
+=
"清除无害化数据失败;"
;
}
}
clearNext
();
clearNext
();
}
}
...
@@ -193,7 +226,8 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -193,7 +226,8 @@ public class ClearVM extends BackBarVM<Repository> {
isVillusBuyClear
=
true
;
isVillusBuyClear
=
true
;
if
(
result
)
{
if
(
result
)
{
dismissDialog
();
dismissDialog
();
DbUtil
.
getInstance
().
deleteAsyncAll
(
VillusBuyEntity
.
class
);
}
else
{
toastStr
+=
"清除绒毛购买数据失败;"
;
}
}
clearNext
();
clearNext
();
}
}
...
@@ -208,12 +242,17 @@ public class ClearVM extends BackBarVM<Repository> {
...
@@ -208,12 +242,17 @@ public class ClearVM extends BackBarVM<Repository> {
isVillusGaugeClear
=
true
;
isVillusGaugeClear
=
true
;
if
(
result
)
{
if
(
result
)
{
dismissDialog
();
dismissDialog
();
DbUtil
.
getInstance
().
deleteAsyncAll
(
VillusGaugeEntity
.
class
);
}
else
{
toastStr
+=
"清除绒毛测量数据失败;"
;
}
}
clearNext
();
clearNext
();
}
}
}).
deleteAsyncAll
(
VillusGaugeEntity
.
class
);
}).
deleteAsyncAll
(
VillusGaugeEntity
.
class
);
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
refreshUploadCount
();
}
}
}
app/src/main/java/com/phlx/wool/ui/sync/vm/DownloadVM.java
View file @
bf8ea70f
...
@@ -13,16 +13,24 @@ import com.phlx.wool.data.Repository;
...
@@ -13,16 +13,24 @@ import com.phlx.wool.data.Repository;
import
com.phlx.wool.db.DbUtil
;
import
com.phlx.wool.db.DbUtil
;
import
com.phlx.wool.db.interf.DbIDUCallBack
;
import
com.phlx.wool.db.interf.DbIDUCallBack
;
import
com.phlx.wool.db.interf.DbQueryCallBack
;
import
com.phlx.wool.db.interf.DbQueryCallBack
;
import
com.phlx.wool.entity.Harmless
;
import
com.phlx.wool.entity.Label
;
import
com.phlx.wool.entity.Label
;
import
com.phlx.wool.entity.Marking
;
import
com.phlx.wool.entity.Quarantine
;
import
com.phlx.wool.entity.TreatmentMethod
;
import
com.phlx.wool.entity.Unit
;
import
com.phlx.wool.entity.Unit
;
import
com.phlx.wool.entity.Variety
;
import
com.phlx.wool.entity.Veterinary
;
import
com.phlx.wool.entity.Veterinary
;
import
com.phlx.wool.entity.VillusBuyEntity
;
import
com.phlx.wool.entity.VillusBuyEntity
;
import
com.phlx.wool.entity.VillusBuyEntityDao
;
import
com.phlx.wool.entity.VillusGaugeEntity
;
import
com.phlx.wool.params.BasicParams
;
import
com.phlx.wool.params.BasicParams
;
import
com.phlx.wool.params.CattleResponse
;
import
com.phlx.wool.params.CattleResponse
;
import
com.phlx.wool.params.PostParams
;
import
com.phlx.wool.params.PostParams
;
import
com.phlx.wool.ui.base.BackBarVM
;
import
com.phlx.wool.ui.base.BackBarVM
;
import
com.phlx.wool.ui.main.MainActivity
;
import
com.phlx.wool.ui.main.MainActivity
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
org.greenrobot.greendao.query.WhereCondition
;
import
org.greenrobot.greendao.query.WhereCondition
;
import
java.text.ParseException
;
import
java.text.ParseException
;
...
@@ -68,6 +76,12 @@ public class DownloadVM extends BackBarVM<Repository> {
...
@@ -68,6 +76,12 @@ public class DownloadVM extends BackBarVM<Repository> {
public
ObservableField
<
Boolean
>
isDownloadAll
=
new
ObservableField
<
Boolean
>(
false
);
public
ObservableField
<
Boolean
>
isDownloadAll
=
new
ObservableField
<
Boolean
>(
false
);
public
ObservableInt
downloadDataVisibility
=
new
ObservableInt
();
public
ObservableInt
downloadDataVisibility
=
new
ObservableInt
();
public
ObservableField
<
String
>
markingLabelNum
=
new
ObservableField
<>(
"发标记录"
);
public
ObservableField
<
String
>
unitNum
=
new
ObservableField
<>(
"养殖单位"
);
public
ObservableField
<
String
>
basicNum
=
new
ObservableField
<>(
"基础信息"
);
public
ObservableField
<
String
>
veterinaryNum
=
new
ObservableField
<>(
"兽医"
);
public
ObservableField
<
String
>
villusBuyNum
=
new
ObservableField
<>(
"绒毛购买"
);
private
boolean
isLabelDownload
,
isBasicDownload
,
isUnitDownload
,
isVeterinaryDownload
,
isVillusBuyDownload
;
private
boolean
isLabelDownload
,
isBasicDownload
,
isUnitDownload
,
isVeterinaryDownload
,
isVillusBuyDownload
;
public
DownloadVM
(
@NonNull
Application
application
,
Repository
repository
)
{
public
DownloadVM
(
@NonNull
Application
application
,
Repository
repository
)
{
...
@@ -122,7 +136,7 @@ public class DownloadVM extends BackBarVM<Repository> {
...
@@ -122,7 +136,7 @@ public class DownloadVM extends BackBarVM<Repository> {
new
BindingCommand
<>(
new
BindingConsumer
<
Boolean
>()
{
new
BindingCommand
<>(
new
BindingConsumer
<
Boolean
>()
{
@Override
@Override
public
void
call
(
Boolean
isChecked
)
{
public
void
call
(
Boolean
isChecked
)
{
isDownloadV
eterinar
y
.
set
(
isChecked
);
isDownloadV
illusBu
y
.
set
(
isChecked
);
}
}
});
});
...
@@ -167,18 +181,27 @@ public class DownloadVM extends BackBarVM<Repository> {
...
@@ -167,18 +181,27 @@ public class DownloadVM extends BackBarVM<Repository> {
}
else
if
(
isDownloadVillusBuy
.
get
()
&&
!
isVillusBuyDownload
)
{
}
else
if
(
isDownloadVillusBuy
.
get
()
&&
!
isVillusBuyDownload
)
{
requestVillusBuy
();
requestVillusBuy
();
}
else
{
}
else
{
refreshUploadCount
();
startActivity
(
MainActivity
.
class
);
startActivity
(
MainActivity
.
class
);
finish
();
finish
();
}
}
}
}
//查询每项记录数量
public
void
refreshUploadCount
()
{
markingLabelNum
.
set
(
"发标记录 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Label
.
class
)
+
")"
);
unitNum
.
set
(
"养殖单位 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Unit
.
class
)
+
")"
);
basicNum
.
set
(
"基础信息 "
+
"("
+
DbUtil
.
getInstance
().
count
(
TreatmentMethod
.
class
)
+
"-"
+
DbUtil
.
getInstance
().
count
(
Variety
.
class
)
+
")"
);
veterinaryNum
.
set
(
"兽医 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Veterinary
.
class
)
+
")"
);
villusBuyNum
.
set
(
"绒毛购买 "
+
"("
+
DbUtil
.
getInstance
().
count
(
VillusBuyEntity
.
class
)
+
")"
);
}
private
void
baseDateUpload
()
{
private
void
baseDateUpload
()
{
showDialog
(
"正在同步数据,请勿关闭屏幕或退出程序!"
);
showDialog
(
"正在同步数据,请勿关闭屏幕或退出程序!"
);
String
sql
=
"TIMESTAMP IN "
+
"(SELECT MAX(TIMESTAMP) FROM LABEL)"
;
String
sql
=
"TIMESTAMP IN "
+
"(SELECT MAX(TIMESTAMP) FROM LABEL)"
;
WhereCondition
.
StringCondition
stringCondition
=
WhereCondition
.
StringCondition
stringCondition
=
new
WhereCondition
.
StringCondition
(
sql
);
new
WhereCondition
.
StringCondition
(
sql
);
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Label
>()
{
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Label
>()
{
@Override
@Override
public
void
onSuccess
(
List
<
Label
>
result
)
{
public
void
onSuccess
(
List
<
Label
>
result
)
{
...
@@ -391,8 +414,7 @@ public class DownloadVM extends BackBarVM<Repository> {
...
@@ -391,8 +414,7 @@ public class DownloadVM extends BackBarVM<Repository> {
postParams
.
setPageNum
(
1
);
postParams
.
setPageNum
(
1
);
postParams
.
setPageSize
(
200
);
postParams
.
setPageSize
(
200
);
// postParams.setYears("2018");
// postParams.setYears("2018");
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
new
Gson
().
toJson
(
postParams
));
new
Gson
().
toJson
(
postParams
));
addSubscribe
(
model
.
getVillusBuyList
(
body
)
addSubscribe
(
model
.
getVillusBuyList
(
body
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
schedulersTransformer
())
...
@@ -442,8 +464,7 @@ public class DownloadVM extends BackBarVM<Repository> {
...
@@ -442,8 +464,7 @@ public class DownloadVM extends BackBarVM<Repository> {
postParams
.
setPageNum
(
1
);
postParams
.
setPageNum
(
1
);
postParams
.
setPageSize
(
200
);
postParams
.
setPageSize
(
200
);
postParams
.
setYears
(
""
);
postParams
.
setYears
(
""
);
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
new
Gson
().
toJson
(
postParams
));
new
Gson
().
toJson
(
postParams
));
addSubscribe
(
model
.
getBasicInfo
(
body
)
addSubscribe
(
model
.
getBasicInfo
(
body
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
schedulersTransformer
())
...
@@ -474,4 +495,9 @@ public class DownloadVM extends BackBarVM<Repository> {
...
@@ -474,4 +495,9 @@ public class DownloadVM extends BackBarVM<Repository> {
);
);
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
refreshUploadCount
();
}
}
}
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
View file @
bf8ea70f
...
@@ -151,7 +151,25 @@ public class UploadVM extends BackBarVM<Repository> {
...
@@ -151,7 +151,25 @@ public class UploadVM extends BackBarVM<Repository> {
markingLabelNum
.
set
(
"打标记录 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Marking
.
class
)
+
")"
);
markingLabelNum
.
set
(
"打标记录 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Marking
.
class
)
+
")"
);
harmlessLabelNum
.
set
(
"无害化处理 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Harmless
.
class
)
+
")"
);
harmlessLabelNum
.
set
(
"无害化处理 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Harmless
.
class
)
+
")"
);
quarantineLabelNum
.
set
(
"检疫记录 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Quarantine
.
class
)
+
")"
);
quarantineLabelNum
.
set
(
"检疫记录 "
+
"("
+
DbUtil
.
getInstance
().
count
(
Quarantine
.
class
)
+
")"
);
villusBuyLabelNum
.
set
(
"绒毛购买 "
+
"("
+
DbUtil
.
getInstance
().
count
(
VillusBuyEntity
.
class
)
+
")"
);
QueryBuilder
<
VillusBuyEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
VillusBuyEntity
.
class
)
.
where
(
VillusBuyEntityDao
.
Properties
.
Status
.
eq
(
1
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
VillusBuyEntity
>()
{
@Override
public
void
onSuccess
(
List
<
VillusBuyEntity
>
result
)
{
if
(
result
!=
null
)
{
villusBuyLabelNum
.
set
(
"绒毛购买 "
+
"("
+
result
.
size
()
+
")"
);
}
else
{
villusBuyLabelNum
.
set
(
"绒毛购买 "
+
"(0)"
);
}
}
@Override
public
void
onFailed
()
{
villusBuyLabelNum
.
set
(
"绒毛购买 "
+
"("
+
"-"
+
")"
);
}
}).
queryAsyncAll
(
VillusBuyEntity
.
class
,
builder
);
villusgaugelabelnum
.
set
(
"绒毛测量 "
+
"("
+
DbUtil
.
getInstance
().
count
(
VillusGaugeEntity
.
class
)
+
")"
);
villusgaugelabelnum
.
set
(
"绒毛测量 "
+
"("
+
DbUtil
.
getInstance
().
count
(
VillusGaugeEntity
.
class
)
+
")"
);
;
;
}
}
...
@@ -199,7 +217,7 @@ public class UploadVM extends BackBarVM<Repository> {
...
@@ -199,7 +217,7 @@ public class UploadVM extends BackBarVM<Repository> {
QueryBuilder
<
Marking
>
builder
=
QueryBuilder
<
Marking
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
Marking
.
class
).
DbUtil
.
getInstance
().
getQueryBuilder
(
Marking
.
class
).
where
(
MarkingDao
.
Properties
.
Status
.
eq
(
"1"
));
where
(
MarkingDao
.
Properties
.
Status
.
eq
(
1
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Marking
>()
{
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Marking
>()
{
@Override
@Override
public
void
onSuccess
(
List
<
Marking
>
result
)
{
public
void
onSuccess
(
List
<
Marking
>
result
)
{
...
@@ -267,7 +285,7 @@ public class UploadVM extends BackBarVM<Repository> {
...
@@ -267,7 +285,7 @@ public class UploadVM extends BackBarVM<Repository> {
private
void
uploadQuarantine
()
{
private
void
uploadQuarantine
()
{
QueryBuilder
<
Quarantine
>
builder
=
QueryBuilder
<
Quarantine
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
Quarantine
.
class
).
DbUtil
.
getInstance
().
getQueryBuilder
(
Quarantine
.
class
).
where
(
QuarantineDao
.
Properties
.
Status
.
eq
(
"1"
));
where
(
QuarantineDao
.
Properties
.
Status
.
eq
(
1
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Quarantine
>()
{
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Quarantine
>()
{
@Override
@Override
public
void
onSuccess
(
List
<
Quarantine
>
result
)
{
public
void
onSuccess
(
List
<
Quarantine
>
result
)
{
...
@@ -342,7 +360,7 @@ public class UploadVM extends BackBarVM<Repository> {
...
@@ -342,7 +360,7 @@ public class UploadVM extends BackBarVM<Repository> {
private
void
uploadHarmless
()
{
private
void
uploadHarmless
()
{
QueryBuilder
<
Harmless
>
builder
=
QueryBuilder
<
Harmless
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
Harmless
.
class
).
DbUtil
.
getInstance
().
getQueryBuilder
(
Harmless
.
class
).
where
(
HarmlessDao
.
Properties
.
Status
.
eq
(
"1"
));
where
(
HarmlessDao
.
Properties
.
Status
.
eq
(
1
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Harmless
>()
{
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
Harmless
>()
{
@Override
@Override
public
void
onSuccess
(
List
<
Harmless
>
result
)
{
public
void
onSuccess
(
List
<
Harmless
>
result
)
{
...
@@ -417,7 +435,7 @@ public class UploadVM extends BackBarVM<Repository> {
...
@@ -417,7 +435,7 @@ public class UploadVM extends BackBarVM<Repository> {
QueryBuilder
<
VillusBuyEntity
>
builder
=
QueryBuilder
<
VillusBuyEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
VillusBuyEntity
.
class
).
DbUtil
.
getInstance
().
getQueryBuilder
(
VillusBuyEntity
.
class
).
where
(
VillusBuyEntityDao
.
Properties
.
Status
.
eq
(
"1"
));
where
(
VillusBuyEntityDao
.
Properties
.
Status
.
eq
(
1
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
VillusBuyEntity
>()
{
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
VillusBuyEntity
>()
{
@Override
@Override
public
void
onSuccess
(
List
<
VillusBuyEntity
>
result
)
{
public
void
onSuccess
(
List
<
VillusBuyEntity
>
result
)
{
...
@@ -481,7 +499,7 @@ public class UploadVM extends BackBarVM<Repository> {
...
@@ -481,7 +499,7 @@ public class UploadVM extends BackBarVM<Repository> {
private
void
uploadVillusGauge
()
{
private
void
uploadVillusGauge
()
{
QueryBuilder
<
VillusGaugeEntity
>
builder
=
QueryBuilder
<
VillusGaugeEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
VillusGaugeEntity
.
class
).
DbUtil
.
getInstance
().
getQueryBuilder
(
VillusGaugeEntity
.
class
).
where
(
VillusGaugeEntityDao
.
Properties
.
Status
.
eq
(
"1"
));
where
(
VillusGaugeEntityDao
.
Properties
.
Status
.
eq
(
1
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
VillusGaugeEntity
>()
{
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
VillusGaugeEntity
>()
{
@Override
@Override
public
void
onSuccess
(
List
<
VillusGaugeEntity
>
result
)
{
public
void
onSuccess
(
List
<
VillusGaugeEntity
>
result
)
{
...
...
app/src/main/res/layout/activity_clear.xml
View file @
bf8ea70f
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
android:layout_marginStart=
"@dimen/dp_20"
android:layout_marginStart=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isClearMarking}"
android:checked=
"@{viewModel.isClearMarking}"
android:text=
"
打标记录
"
android:text=
"
@{viewModel.markingLabelNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
binding:layout_constraintStart_toStartOf=
"parent"
binding:layout_constraintStart_toStartOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:checked=
"@{viewModel.isClearHarmless}"
android:checked=
"@{viewModel.isClearHarmless}"
android:text=
"
无害化处理
"
android:text=
"
@{viewModel.harmlessLabelNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintEnd_toEndOf=
"parent"
binding:layout_constraintEnd_toEndOf=
"parent"
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isClearQuarantine}"
android:checked=
"@{viewModel.isClearQuarantine}"
android:text=
"
检疫记录
"
android:text=
"
@{viewModel.quarantineLabelNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintStart_toStartOf=
"@id/marking_info_desc"
binding:layout_constraintStart_toStartOf=
"@id/marking_info_desc"
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isClearVillusBuy}"
android:checked=
"@{viewModel.isClearVillusBuy}"
android:text=
"
绒毛购买
"
android:text=
"
@{viewModel.villusBuyLabelNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintStart_toStartOf=
"@id/harmless_info_desc"
binding:layout_constraintStart_toStartOf=
"@id/harmless_info_desc"
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isClearVillusGauge}"
android:checked=
"@{viewModel.isClearVillusGauge}"
android:text=
"
绒毛测量
"
android:text=
"
@{viewModel.villusgaugelabelNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintStart_toStartOf=
"@id/quarantine_info_desc"
binding:layout_constraintStart_toStartOf=
"@id/quarantine_info_desc"
...
...
app/src/main/res/layout/activity_download.xml
View file @
bf8ea70f
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:checked=
"@{viewModel.isDownloadLabel}"
android:checked=
"@{viewModel.isDownloadLabel}"
binding:onCheckedChangedCommand=
"@{viewModel.onDownloadLabelCommand}"
binding:onCheckedChangedCommand=
"@{viewModel.onDownloadLabelCommand}"
android:text=
"
发标记录
"
android:text=
"
@{viewModel.markingLabelNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
binding:layout_constraintStart_toStartOf=
"parent"
binding:layout_constraintStart_toStartOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
/>
binding:layout_constraintTop_toTopOf=
"parent"
/>
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:text=
"
养殖单位
"
android:text=
"
@{viewModel.unitNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
android:checked=
"@{viewModel.isDownloadUnit}"
android:checked=
"@{viewModel.isDownloadUnit}"
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"
基础信息
"
android:text=
"
@{viewModel.basicNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
binding:layout_constraintStart_toStartOf=
"@id/label_info_desc"
binding:layout_constraintStart_toStartOf=
"@id/label_info_desc"
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:text=
"
兽医
"
android:text=
"
@{viewModel.veterinaryNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
android:checked=
"@{viewModel.isDownloadVeterinary}"
android:checked=
"@{viewModel.isDownloadVeterinary}"
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:text=
"
绒毛购买
"
android:text=
"
@{viewModel.villusBuyNum}
"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"@dimen/desc_text_size"
android:textSize=
"@dimen/desc_text_size"
android:checked=
"@{viewModel.isDownloadVillusBuy}"
android:checked=
"@{viewModel.isDownloadVillusBuy}"
...
...
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