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
50287ea2
Commit
50287ea2
authored
Apr 02, 2021
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改一些bug
parent
825466bc
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
40 additions
and
22 deletions
+40
-22
Configs.java
app/src/main/java/com/phlx/wool/Configs.java
+1
-0
DbUtil.java
app/src/main/java/com/phlx/wool/db/DbUtil.java
+1
-1
Label.java
app/src/main/java/com/phlx/wool/entity/Label.java
+1
-1
RetrofitClient.java
app/src/main/java/com/phlx/wool/net/RetrofitClient.java
+1
-1
InventoryVM.java
...src/main/java/com/phlx/wool/ui/inventory/InventoryVM.java
+2
-1
LoginActivity.java
app/src/main/java/com/phlx/wool/ui/login/LoginActivity.java
+1
-1
LoginVM.java
app/src/main/java/com/phlx/wool/ui/login/LoginVM.java
+2
-0
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
UploadVM.java
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
+2
-2
VillusBuyVM.java
...src/main/java/com/phlx/wool/ui/villus/vm/VillusBuyVM.java
+11
-4
VillusGaugeVM.java
...c/main/java/com/phlx/wool/ui/villus/vm/VillusGaugeVM.java
+4
-1
HarmlessVM.java
.../main/java/com/phlx/wool/ui/work/harmless/HarmlessVM.java
+6
-6
MarkingVM.java
app/src/main/java/com/phlx/wool/ui/work/mark/MarkingVM.java
+3
-1
QuarantineVM.java
...n/java/com/phlx/wool/ui/work/quarantine/QuarantineVM.java
+3
-1
No files found.
app/src/main/java/com/phlx/wool/Configs.java
View file @
50287ea2
...
...
@@ -39,6 +39,7 @@ public class Configs {
public
static
final
String
SP_USER_NAME
=
"sp_user_name"
;
public
static
final
String
SP_ID
=
"sp_id"
;
public
static
final
String
SP_NAME
=
"sp_name"
;
public
static
final
String
SP_FREQUENCY
=
"sp_frequency"
;
public
static
final
String
SP_USER_PASSWORD
=
"sp_user_password"
;
public
static
final
String
SP_USER_EMAIL
=
"sp_user_email"
;
public
static
final
String
SP_FREQUENCY_CONFIG
=
"sp_frequency_config"
;
...
...
app/src/main/java/com/phlx/wool/db/DbUtil.java
View file @
50287ea2
...
...
@@ -32,7 +32,7 @@ import java.util.List;
*/
public
class
DbUtil
{
private
static
final
String
DEFAULT_DATABASE_NAME
=
"
Cattle
Manager.db"
;
private
static
final
String
DEFAULT_DATABASE_NAME
=
"
Wool
Manager.db"
;
private
static
final
String
DEFAULT_DATABASE_PASSWORD
=
"phx123456"
;
private
DaoSession
mDaoSession
;
private
DaoMaster
mDaoMaster
;
...
...
app/src/main/java/com/phlx/wool/entity/Label.java
View file @
50287ea2
...
...
@@ -50,7 +50,7 @@ public class Label extends BaseObservable implements Parcelable {
/**
* 耳标tid
*/
@Index
(
name
=
"LabelTid"
,
unique
=
tru
e
)
@Index
(
name
=
"LabelTid"
,
unique
=
fals
e
)
@SerializedName
(
"innercode"
)
private
String
Tid
;
...
...
app/src/main/java/com/phlx/wool/net/RetrofitClient.java
View file @
50287ea2
...
...
@@ -47,7 +47,7 @@ public class RetrofitClient {
//缓存时间
private
static
final
int
CACHE_TIMEOUT
=
10
*
1024
*
1024
;
//服务端根路径
public
static
String
baseUrl
=
"192.168.8.18
2
"
;
public
static
String
baseUrl
=
"192.168.8.18
9
"
;
public
static
String
port
=
"80"
;
private
static
Context
mContext
=
Utils
.
getContext
();
...
...
app/src/main/java/com/phlx/wool/ui/inventory/InventoryVM.java
View file @
50287ea2
...
...
@@ -208,9 +208,10 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis
legalCount
=
0
;
KLog
.
e
(
mList
.
toString
());
for
(
int
i
=
0
;
i
<
mList
.
size
();
i
++)
{
List
<
Label
>
allLablel
=
DbUtil
.
getInstance
().
queryAll
(
Label
.
class
);
QueryBuilder
<
Label
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
Label
.
class
)
.
where
(
LabelDao
.
Properties
.
Tid
.
eq
(
mList
.
get
(
i
).
getTid
()));
.
where
(
LabelDao
.
Properties
.
Epc
.
eq
(
mList
.
get
(
i
).
getEpc
()));
List
<
Label
>
labels
=
DbUtil
.
getInstance
().
queryAll
(
Label
.
class
,
builder
);
//合法状态 0 非法 1 合法
if
(
labels
.
size
()
==
0
)
{
...
...
app/src/main/java/com/phlx/wool/ui/login/LoginActivity.java
View file @
50287ea2
...
...
@@ -127,7 +127,7 @@ public class LoginActivity extends BaseActivity<ActivityLoginBinding, LoginVM> {
//设置强制更新
.
setForcedUpgrade
(
true
);
DownloadManager
manager
=
DownloadManager
.
getInstance
(
this
);
manager
.
setApkName
(
"
Cattle
Manager.apk"
)
manager
.
setApkName
(
"
Wool
Manager.apk"
)
.
setApkUrl
(
downloadUrl
)
.
setSmallIcon
(
R
.
mipmap
.
ic_launcher
)
.
setShowNewerToast
(
true
)
...
...
app/src/main/java/com/phlx/wool/ui/login/LoginVM.java
View file @
50287ea2
...
...
@@ -141,6 +141,7 @@ public class LoginVM extends BackBarVM<Repository> {
model
.
saveBreed
(
response
.
getData
().
getUser
().
getDept
().
getDeptName
());
SPUtils
.
getInstance
().
put
(
Configs
.
SP_ID
,
response
.
getData
().
getUser
().
getUserId
());
SPUtils
.
getInstance
().
put
(
Configs
.
SP_NAME
,
response
.
getData
().
getUser
().
getUserName
());
SPUtils
.
getInstance
().
put
(
Configs
.
SP_FREQUENCY
,
response
.
getData
().
getUser
().
getFrequencyConfig
());
}
VMFactory
.
getInstance
(
getApplication
()).
refreshRepository
();
if
(
SPUtils
.
getInstance
().
getBoolean
(
"isFirst"
,
true
))
{
...
...
@@ -191,6 +192,7 @@ public class LoginVM extends BackBarVM<Repository> {
ToastUtils
.
showShort
(
"密码错误"
);
return
;
}
Configs
.
FREQUENCY_CONFIG
=
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_FREQUENCY
);
startActivity
(
MainActivity
.
class
);
finish
();
}
else
{
...
...
app/src/main/java/com/phlx/wool/ui/splash/SplashActivity.java
View file @
50287ea2
...
...
@@ -53,7 +53,7 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
inputTime
=
result
.
get
(
0
).
getTimestamp
();
}
viewModel
.
requestLabel
(
0
,
inputTime
,
100000
);
viewModel
.
requestLabel
(
1
,
inputTime
,
100000
);
}
@Override
...
...
app/src/main/java/com/phlx/wool/ui/splash/SplashVM.java
View file @
50287ea2
...
...
@@ -38,7 +38,7 @@ public class SplashVM extends MainBarVM<Repository> {
public
SingleLiveEvent
<
String
>
errorEvent
=
new
SingleLiveEvent
<>();
private
int
labelPageIndex
=
0
;
private
int
labelPageIndex
=
1
;
private
int
unitPageIndex
=
0
;
public
SplashVM
(
@NonNull
Application
application
,
Repository
repository
)
{
...
...
app/src/main/java/com/phlx/wool/ui/sync/vm/UploadVM.java
View file @
50287ea2
...
...
@@ -145,9 +145,9 @@ public class UploadVM extends BackBarVM<Repository> {
uploadHarmless
();
}
else
if
(
isUploadQuarantine
.
get
()
&&
!
isQuarantineUpload
)
{
uploadQuarantine
();
}
else
if
(
isUpload
Marking
.
get
()
&&
!
isVillusBuyUpload
)
{
}
else
if
(
isUpload
VillusBuy
.
get
()
&&
!
isVillusBuyUpload
)
{
uploadVillusBuy
();
}
else
if
(
isUpload
Marking
.
get
()
&&
!
isVillusGaugeUpload
)
{
}
else
if
(
isUpload
VillusGauge
.
get
()
&&
!
isVillusGaugeUpload
)
{
uploadVillusGauge
();
}
else
{
ToastUtils
.
showShort
(
"请选择上传的项目"
);
...
...
app/src/main/java/com/phlx/wool/ui/villus/vm/VillusBuyVM.java
View file @
50287ea2
...
...
@@ -5,6 +5,7 @@ import android.os.Bundle;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.ArrayAdapter
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
...
...
@@ -58,7 +59,7 @@ public class VillusBuyVM extends BackBarVM<Repository> {
public
VillusBuyEntity
entity
;
public
List
<
IKeyAndValue
>
superiorPertainItemData
;
public
List
<
IKeyAndValue
>
pertainItemData
;
private
List
<
String
>
lists
;
private
List
<
String
>
lists
;
private
List
<
VillusBuyEntity
>
uploadData
;
...
...
@@ -71,10 +72,14 @@ public class VillusBuyVM extends BackBarVM<Repository> {
private
ArrayAdapter
<
String
>
spinnerAdapter
;
private
Long
id
;
public
VillusBuyVM
(
@NonNull
Application
application
,
Repository
model
)
{
super
(
application
,
model
);
id
=
IdUtil
.
createSnowflake
(
3
,
1
).
nextId
();
if
(
entity
==
null
)
{
entity
=
new
VillusBuyEntity
();
}
...
...
@@ -144,7 +149,7 @@ public class VillusBuyVM extends BackBarVM<Repository> {
}
});
public
ArrayAdapter
getAdapter
(
VillusBuyActivity
cls
){
public
ArrayAdapter
getAdapter
(
VillusBuyActivity
cls
)
{
spinnerAdapter
=
new
ArrayAdapter
<>(
cls
,
R
.
layout
.
simple_spinner_item
,
lists
);
spinnerAdapter
.
setDropDownViewResource
(
R
.
layout
.
simple_spinner_dropdown_item
);
return
spinnerAdapter
;
...
...
@@ -178,7 +183,7 @@ public class VillusBuyVM extends BackBarVM<Repository> {
}
uploadData
=
new
ArrayList
<>();
entity
.
setId
(
IdUtil
.
createSnowflake
(
3
,
1
).
nextId
()
);
entity
.
setId
(
id
);
entity
.
setCreateBy
(
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_NAME
));
entity
.
setCreateTime
(
dateFormat
.
format
(
new
Date
()));
entity
.
setStatus
(
1
);
...
...
@@ -199,6 +204,7 @@ public class VillusBuyVM extends BackBarVM<Repository> {
if
(
Configs
.
isOnLine
)
{
uploadVillusBuy
();
}
else
{
ToastUtils
.
showShort
(
"绒毛购买保存成功"
);
backMain
();
}
}
...
...
@@ -230,13 +236,14 @@ public class VillusBuyVM extends BackBarVM<Repository> {
public
void
onNotification
(
boolean
result
)
{
if
(
result
)
{
dismissDialog
();
ToastUtils
.
showShort
(
"绒毛购买上传成功"
);
printEvent
.
call
();
}
}
}).
insertAsyncBatch
(
VillusBuyEntity
.
class
,
uploadData
);
}
else
{
dismissDialog
();
ToastUtils
.
showShort
(
"上传失败"
);
ToastUtils
.
showShort
(
"
绒毛购买
上传失败"
);
}
},
(
Consumer
<
ResponseThrowable
>)
throwable
->
{
dismissDialog
();
...
...
app/src/main/java/com/phlx/wool/ui/villus/vm/VillusGaugeVM.java
View file @
50287ea2
...
...
@@ -48,10 +48,13 @@ public class VillusGaugeVM extends BackBarVM<Repository> {
private
List
<
VillusGaugeEntity
>
uploadData
;
private
Long
id
;
public
VillusGaugeVM
(
@NonNull
Application
application
,
Repository
model
)
{
super
(
application
,
model
);
id
=
IdUtil
.
createSnowflake
(
3
,
1
).
nextId
();
if
(
entity
==
null
)
{
entity
=
new
VillusGaugeEntity
();
}
...
...
@@ -123,7 +126,7 @@ public class VillusGaugeVM extends BackBarVM<Repository> {
}
uploadData
=
new
ArrayList
<>();
entity
.
setId
(
IdUtil
.
createSnowflake
(
3
,
1
).
nextId
()
);
entity
.
setId
(
id
);
entity
.
setCreateBy
(
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_NAME
));
entity
.
setCreateTime
(
dateFormat
.
format
(
new
Date
()));
entity
.
setStatus
(
1
);
...
...
app/src/main/java/com/phlx/wool/ui/work/harmless/HarmlessVM.java
View file @
50287ea2
...
...
@@ -52,7 +52,7 @@ public class HarmlessVM extends BackBarVM<Repository> {
public
SingleLiveEvent
<
Boolean
>
showSearch
=
new
SingleLiveEvent
<>();
private
ArrayList
<
Label
>
labels
;
private
SimpleDateFormat
dateFormat
;
private
long
parentId
;
private
long
parentId
=
-
1
;
public
HarmlessVM
(
@NonNull
Application
application
,
Repository
repository
)
{
super
(
application
,
repository
);
...
...
@@ -184,13 +184,13 @@ public class HarmlessVM extends BackBarVM<Repository> {
QueryBuilder
<
HarmlessDetail
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
HarmlessDetail
.
class
).
where
(
HarmlessDetailDao
.
Properties
.
HarmlessId
.
eq
(
parentId
));
List
<
HarmlessDetail
>
harmlessDetails
=
DbUtil
.
getInstance
().
queryAll
(
HarmlessDetail
.
class
,
builder
);
List
<
HarmlessDetail
>
harmlessDetails
=
DbUtil
.
getInstance
().
queryAll
(
HarmlessDetail
.
class
,
builder
);
harmless
.
setList
(
harmlessDetails
);
String
postInfoStr
=
new
GsonBuilder
().
serializeNulls
().
excludeFieldsWithoutExposeAnnotation
().
create
().
toJson
(
new
UploadParams
<
Harmless
>(
harmless
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
postInfoStr
);
new
GsonBuilder
().
serializeNulls
()
// .excludeFieldsWithoutExposeAnnotation()
.
create
().
toJson
(
new
UploadParams
<
Harmless
>(
harmless
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
postInfoStr
);
KLog
.
e
(
postInfoStr
);
addSubscribe
(
model
.
submitHarmless
(
body
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
...
...
app/src/main/java/com/phlx/wool/ui/work/mark/MarkingVM.java
View file @
50287ea2
...
...
@@ -206,7 +206,9 @@ public class MarkingVM extends BackBarVM<Repository> {
*/
private
void
uploadMarking
()
{
String
postInfoStr
=
new
GsonBuilder
().
serializeNulls
().
excludeFieldsWithoutExposeAnnotation
().
create
().
toJson
(
new
UploadParams
<
List
<
Marking
>>(
uploadData
));
new
GsonBuilder
().
serializeNulls
()
// .excludeFieldsWithoutExposeAnnotation()
.
create
().
toJson
(
new
UploadParams
<
List
<
Marking
>>(
uploadData
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
postInfoStr
);
KLog
.
e
(
postInfoStr
);
...
...
app/src/main/java/com/phlx/wool/ui/work/quarantine/QuarantineVM.java
View file @
50287ea2
...
...
@@ -185,7 +185,9 @@ public class QuarantineVM extends BackBarVM<Repository> {
DbUtil
.
getInstance
().
queryAll
(
QuarantineDetail
.
class
,
builder
);
quarantine
.
setList
(
quarantineDetails
);
String
postInfoStr
=
new
GsonBuilder
().
serializeNulls
().
excludeFieldsWithoutExposeAnnotation
().
create
().
toJson
(
new
UploadParams
<
Quarantine
>(
quarantine
));
new
GsonBuilder
().
serializeNulls
()
// .excludeFieldsWithoutExposeAnnotation()
.
create
().
toJson
(
new
UploadParams
<
Quarantine
>(
quarantine
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
postInfoStr
);
KLog
.
e
(
postInfoStr
);
...
...
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