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
ac95bc6d
Commit
ac95bc6d
authored
Apr 14, 2022
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改上传数据为多次上传
parent
920acb04
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
128 additions
and
104 deletions
+128
-104
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+7
-6
App.java
app/src/main/java/com/phlx/wool/App.java
+4
-0
Configs.java
app/src/main/java/com/phlx/wool/Configs.java
+2
-2
VMFactory.java
app/src/main/java/com/phlx/wool/data/VMFactory.java
+1
-1
RetrofitClient.java
app/src/main/java/com/phlx/wool/net/RetrofitClient.java
+4
-4
CattleMainVM.java
...rc/main/java/com/phlx/wool/ui/cattle/vm/CattleMainVM.java
+2
-2
CattleMarkVM.java
...rc/main/java/com/phlx/wool/ui/cattle/vm/CattleMarkVM.java
+3
-0
CattleUploadVM.java
.../main/java/com/phlx/wool/ui/cattle/vm/CattleUploadVM.java
+28
-27
InventoryVM.java
...src/main/java/com/phlx/wool/ui/inventory/InventoryVM.java
+0
-4
UploadVM.java
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
+72
-58
activity_cattle_mark.xml
app/src/main/res/layout/activity_cattle_mark.xml
+5
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
ac95bc6d
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
android:resource=
"@xml/file_paths"
/>
android:resource=
"@xml/file_paths"
/>
</provider>
</provider>
<!-- android:name=".ui.cattle.activity.CattleMainActivity"-->
<activity
<activity
android:name=
".ui.login.LoginActivity"
android:name=
".ui.login.LoginActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:configChanges=
"keyboardHidden|orientation|screenSize"
...
@@ -122,12 +123,12 @@
...
@@ -122,12 +123,12 @@
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
<!-- <activity-->
android:name=
".ui.cattle.activity.CattleMainActivity"
<!-- android:name=".ui.cattle.activity.CattleMainActivity"-->
android:configChanges=
"keyboardHidden|orientation|screenSize"
<!-- android:configChanges="keyboardHidden|orientation|screenSize"-->
android:launchMode=
"singleTask"
<!-- android:launchMode="singleTask"-->
android:screenOrientation=
"portrait"
<!-- android:screenOrientation="portrait"-->
android:windowSoftInputMode=
"stateHidden|adjustResize"
/
>
<!-- android:windowSoftInputMode="stateHidden|adjustResize" />--
>
<activity
<activity
android:name=
".ui.cattle.activity.CattleMarkActivity"
android:name=
".ui.cattle.activity.CattleMarkActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:configChanges=
"keyboardHidden|orientation|screenSize"
...
...
app/src/main/java/com/phlx/wool/App.java
View file @
ac95bc6d
...
@@ -3,6 +3,8 @@ package com.phlx.wool;
...
@@ -3,6 +3,8 @@ package com.phlx.wool;
import
com.uhf.linkage.Linkage
;
import
com.uhf.linkage.Linkage
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
me.goldze.mvvmhabit.base.BaseApplication
;
import
me.goldze.mvvmhabit.base.BaseApplication
;
import
me.goldze.mvvmhabit.crash.CaocConfig
;
import
me.goldze.mvvmhabit.crash.CaocConfig
;
import
me.goldze.mvvmhabit.utils.KLog
;
import
me.goldze.mvvmhabit.utils.KLog
;
...
@@ -20,6 +22,8 @@ public class App extends BaseApplication {
...
@@ -20,6 +22,8 @@ public class App extends BaseApplication {
instance
=
this
;
instance
=
this
;
//是否开启打印日志
//是否开启打印日志
KLog
.
init
(
true
);
KLog
.
init
(
true
);
QueryBuilder
.
LOG_SQL
=
true
;
QueryBuilder
.
LOG_VALUES
=
true
;
//初始化全局异常崩溃
//初始化全局异常崩溃
initCrash
();
initCrash
();
link
=
new
Linkage
();
link
=
new
Linkage
();
...
...
app/src/main/java/com/phlx/wool/Configs.java
View file @
ac95bc6d
...
@@ -69,8 +69,8 @@ public class Configs {
...
@@ -69,8 +69,8 @@ public class Configs {
public
static
PrinterInstance
myPrinter
;
public
static
PrinterInstance
myPrinter
;
//是否是
锡盟
临时项目
//是否是
毛登牧场
临时项目
public
static
boolean
isCattle
=
tru
e
;
public
static
boolean
isCattle
=
fals
e
;
// public static boolean ISCONNECTED;
// public static boolean ISCONNECTED;
...
...
app/src/main/java/com/phlx/wool/data/VMFactory.java
View file @
ac95bc6d
...
@@ -99,7 +99,7 @@ public class VMFactory extends ViewModelProvider.NewInstanceFactory {
...
@@ -99,7 +99,7 @@ public class VMFactory extends ViewModelProvider.NewInstanceFactory {
return
(
T
)
new
SlaughterEntryVM
(
mApplication
,
repository
);
return
(
T
)
new
SlaughterEntryVM
(
mApplication
,
repository
);
//
锡盟
临时项目
//
毛登牧场
临时项目
}
else
if
(
modelClass
.
isAssignableFrom
(
CattleMainVM
.
class
))
{
}
else
if
(
modelClass
.
isAssignableFrom
(
CattleMainVM
.
class
))
{
return
(
T
)
new
CattleMainVM
(
mApplication
,
repository
);
return
(
T
)
new
CattleMainVM
(
mApplication
,
repository
);
}
else
if
(
modelClass
.
isAssignableFrom
(
CattleMarkVM
.
class
))
{
}
else
if
(
modelClass
.
isAssignableFrom
(
CattleMarkVM
.
class
))
{
...
...
app/src/main/java/com/phlx/wool/net/RetrofitClient.java
View file @
ac95bc6d
...
@@ -48,14 +48,14 @@ public class RetrofitClient {
...
@@ -48,14 +48,14 @@ public class RetrofitClient {
private
static
final
int
CACHE_TIMEOUT
=
10
*
1024
*
1024
;
private
static
final
int
CACHE_TIMEOUT
=
10
*
1024
*
1024
;
//服务端根路径
//服务端根路径
public
static
String
baseUrl
=
public
static
String
baseUrl
=
//
"58.18.92.126"//阿拉善正式
"58.18.92.126"
//阿拉善正式
"39.101.170.186"
//锡盟正式
//
"39.101.170.186"//锡盟正式
// "192.168.12.105"//锡盟张敏测试
// "192.168.12.105"//锡盟张敏测试
// "192.168.8.189"//张敏
// "192.168.8.189"//张敏
;
;
public
static
String
port
=
public
static
String
port
=
//
"899"//阿拉善正式
"899"
//阿拉善正式
"8999"
//锡盟正式/ 张敏
//
"8999"//锡盟正式/ 张敏
// "80"
// "80"
;
;
...
...
app/src/main/java/com/phlx/wool/ui/cattle/vm/CattleMainVM.java
View file @
ac95bc6d
...
@@ -94,11 +94,11 @@ public class CattleMainVM extends BackBarVM<Repository> {
...
@@ -94,11 +94,11 @@ public class CattleMainVM extends BackBarVM<Repository> {
public
BindingCommand
onDownloadClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
public
BindingCommand
onDownloadClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
@Override
public
void
call
()
{
public
void
call
()
{
if
(
Configs
.
isOnLine
)
{
//
if (Configs.isOnLine) {
DbUtil
.
getInstance
().
deleteAll
(
Unit
.
class
);
DbUtil
.
getInstance
().
deleteAll
(
Unit
.
class
);
farmerPageIndex
=
0
;
farmerPageIndex
=
0
;
queryFarmerInputTime
(
farmerPageIndex
,
10000
);
queryFarmerInputTime
(
farmerPageIndex
,
10000
);
}
//
}
}
}
});
});
...
...
app/src/main/java/com/phlx/wool/ui/cattle/vm/CattleMarkVM.java
View file @
ac95bc6d
...
@@ -92,6 +92,9 @@ public class CattleMarkVM extends BackBarVM<Repository> {
...
@@ -92,6 +92,9 @@ public class CattleMarkVM extends BackBarVM<Repository> {
long
idNo
=
IdUtil
.
createSnowflake
(
3
,
1
).
nextId
();
long
idNo
=
IdUtil
.
createSnowflake
(
3
,
1
).
nextId
();
entity
.
setId
(
idNo
+
""
);
entity
.
setId
(
idNo
+
""
);
entity
.
setPastureUnitId
(
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_UNIT_CODE
,
""
));
entity
.
setPastureUnitId
(
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_UNIT_CODE
,
""
));
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
entity
.
setBirthdate
(
dateFormat
.
format
(
new
Date
()));
entity
.
setWeight
(
100
+
""
);
markeImgUrl
=
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
()
+
markeImgUrl
=
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
()
+
"/tracing/picture/"
"/tracing/picture/"
...
...
app/src/main/java/com/phlx/wool/ui/cattle/vm/CattleUploadVM.java
View file @
ac95bc6d
...
@@ -54,7 +54,7 @@ public class CattleUploadVM extends BackBarVM<Repository> {
...
@@ -54,7 +54,7 @@ public class CattleUploadVM extends BackBarVM<Repository> {
private
void
uploadMarking
()
{
private
void
uploadMarking
()
{
QueryBuilder
<
CattleLabelEntity
>
builder
=
QueryBuilder
<
CattleLabelEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
CattleLabelEntity
.
class
);
DbUtil
.
getInstance
().
getQueryBuilder
(
CattleLabelEntity
.
class
)
.
limit
(
20
)
;
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
CattleLabelEntity
>()
{
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
CattleLabelEntity
>()
{
@Override
@Override
public
void
onSuccess
(
List
<
CattleLabelEntity
>
result
)
{
public
void
onSuccess
(
List
<
CattleLabelEntity
>
result
)
{
...
@@ -67,35 +67,36 @@ public class CattleUploadVM extends BackBarVM<Repository> {
...
@@ -67,35 +67,36 @@ public class CattleUploadVM extends BackBarVM<Repository> {
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
postInfoStr
);
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
postInfoStr
);
KLog
.
e
(
postInfoStr
);
KLog
.
e
(
postInfoStr
);
addSubscribe
(
model
.
uploadCattleMark
(
body
)
addSubscribe
(
model
.
uploadCattleMark
(
body
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
exceptionTransformer
())
.
compose
(
RxUtils
.
exceptionTransformer
())
.
doOnSubscribe
(
disposable
->
showDialog
(
"正在上传基础数据..."
))
.
doOnSubscribe
(
disposable
->
showDialog
(
"正在上传基础数据..."
))
.
subscribe
((
Consumer
<
CattleResponse
<
List
<
CattleLabelEntity
>>>)
response
->
{
.
subscribe
((
Consumer
<
CattleResponse
<
List
<
CattleLabelEntity
>>>)
response
->
{
KLog
.
e
(
response
.
getCode
()
+
response
.
getMsg
());
KLog
.
e
(
response
.
getCode
()
+
response
.
getMsg
());
if
(
response
.
getCode
()
==
0
)
{
if
(
response
.
getCode
()
==
0
)
{
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
@Override
@Override
public
void
onNotification
(
boolean
result
)
{
public
void
onNotification
(
boolean
result
)
{
if
(
result
)
{
if
(
result
)
{
dismissDialog
();
dismissDialog
();
uploadMarking
();
refreshUploadCount
();
}
else
{
}
else
{
ToastUtils
.
showShort
(
"删除基础数据失败"
);
ToastUtils
.
showShort
(
"删除基础数据失败"
);
}
}
}
}).
deleteAsyncAll
(
CattleLabelEntity
.
class
);
}
}
else
{
}).
deleteAsyncBatch
(
CattleLabelEntity
.
class
,
result
);
dismissDialog
();
}
else
{
ToastUtils
.
showShort
(
"基础数据上传失败"
);
dismissDialog
();
}
ToastUtils
.
showShort
(
"基础数据上传失败"
);
},
(
Consumer
<
ResponseThrowable
>)
throwable
->
{
}
dismissDialog
();
},
(
Consumer
<
ResponseThrowable
>)
throwable
->
{
ToastUtils
.
showShort
(
throwable
.
message
);
dismissDialog
();
})
ToastUtils
.
showShort
(
throwable
.
message
);
})
);
);
}
else
{
}
else
{
dismissDialog
();
refreshUploadCount
();
}
}
}
}
...
...
app/src/main/java/com/phlx/wool/ui/inventory/InventoryVM.java
View file @
ac95bc6d
...
@@ -25,10 +25,7 @@ import com.phlx.wool.db.gen.LabelDao;
...
@@ -25,10 +25,7 @@ import com.phlx.wool.db.gen.LabelDao;
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.CacheLabel
;
import
com.phlx.wool.entity.CacheLabel
;
import
com.phlx.wool.entity.EntryRegistrationEntity
;
import
com.phlx.wool.entity.Label
;
import
com.phlx.wool.entity.Label
;
import
com.phlx.wool.entity.Marking
;
import
com.phlx.wool.entity.VillusBuyEntity
;
import
com.phlx.wool.event.EventMsg
;
import
com.phlx.wool.event.EventMsg
;
import
com.phlx.wool.event.EventTag
;
import
com.phlx.wool.event.EventTag
;
import
com.phlx.wool.rfid.ModuleManager
;
import
com.phlx.wool.rfid.ModuleManager
;
...
@@ -400,7 +397,6 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis
...
@@ -400,7 +397,6 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis
ToastUtils
.
showShort
(
"请扫描耳标"
);
ToastUtils
.
showShort
(
"请扫描耳标"
);
}
}
}
}
/**
/**
...
...
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
View file @
ac95bc6d
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_cattle_mark.xml
View file @
ac95bc6d
...
@@ -205,6 +205,7 @@
...
@@ -205,6 +205,7 @@
android:hint=
"请输入体重"
android:hint=
"请输入体重"
android:inputType=
"numberDecimal"
android:inputType=
"numberDecimal"
android:maxLines=
"1"
android:maxLines=
"1"
android:maxLength=
"10"
android:text=
"@={viewModel.entity.weight}"
android:text=
"@={viewModel.entity.weight}"
android:textSize=
"@dimen/edit_size"
android:textSize=
"@dimen/edit_size"
binding:layout_constraintBottom_toTopOf=
"@+id/weight_edit"
binding:layout_constraintBottom_toTopOf=
"@+id/weight_edit"
...
@@ -232,6 +233,7 @@
...
@@ -232,6 +233,7 @@
android:background=
"@drawable/input_frame_bg"
android:background=
"@drawable/input_frame_bg"
android:hint=
"请输入胸围"
android:hint=
"请输入胸围"
android:maxLines=
"1"
android:maxLines=
"1"
android:maxLength=
"10"
android:inputType=
"numberDecimal"
android:inputType=
"numberDecimal"
android:text=
"@={viewModel.entity.bust}"
android:text=
"@={viewModel.entity.bust}"
android:textSize=
"@dimen/edit_size"
android:textSize=
"@dimen/edit_size"
...
@@ -260,6 +262,7 @@
...
@@ -260,6 +262,7 @@
android:background=
"@drawable/input_frame_bg"
android:background=
"@drawable/input_frame_bg"
android:hint=
"请输入管维"
android:hint=
"请输入管维"
android:maxLines=
"1"
android:maxLines=
"1"
android:maxLength=
"10"
android:inputType=
"numberDecimal"
android:inputType=
"numberDecimal"
android:text=
"@={viewModel.entity.tubeCircumference}"
android:text=
"@={viewModel.entity.tubeCircumference}"
android:textSize=
"@dimen/edit_size"
android:textSize=
"@dimen/edit_size"
...
@@ -289,6 +292,7 @@
...
@@ -289,6 +292,7 @@
android:background=
"@drawable/input_frame_bg"
android:background=
"@drawable/input_frame_bg"
android:hint=
"请输入体高"
android:hint=
"请输入体高"
android:maxLines=
"1"
android:maxLines=
"1"
android:maxLength=
"10"
android:inputType=
"numberDecimal"
android:inputType=
"numberDecimal"
android:text=
"@={viewModel.entity.bodyHeight}"
android:text=
"@={viewModel.entity.bodyHeight}"
android:textSize=
"@dimen/edit_size"
android:textSize=
"@dimen/edit_size"
...
@@ -319,6 +323,7 @@
...
@@ -319,6 +323,7 @@
android:hint=
"请输入体斜长"
android:hint=
"请输入体斜长"
android:maxLines=
"1"
android:maxLines=
"1"
android:inputType=
"numberDecimal"
android:inputType=
"numberDecimal"
android:maxLength=
"10"
android:text=
"@={viewModel.entity.bodyObliqueLength}"
android:text=
"@={viewModel.entity.bodyObliqueLength}"
android:textSize=
"@dimen/edit_size"
android:textSize=
"@dimen/edit_size"
binding:layout_constraintBottom_toTopOf=
"@+id/twin_sheep_cb"
binding:layout_constraintBottom_toTopOf=
"@+id/twin_sheep_cb"
...
...
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