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
199e5b54
Commit
199e5b54
authored
Jan 26, 2022
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加基础信息功能
parent
5754d75f
Pipeline
#267
failed with stages
Changes
45
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
2404 additions
and
688 deletions
+2404
-688
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
App.java
app/src/main/java/com/phlx/anchorcollect/App.java
+70
-70
Configs.java
app/src/main/java/com/phlx/anchorcollect/Configs.java
+12
-6
Repository.java
...src/main/java/com/phlx/anchorcollect/data/Repository.java
+24
-1
VMFactory.java
app/src/main/java/com/phlx/anchorcollect/data/VMFactory.java
+7
-3
ApiService.java
...ain/java/com/phlx/anchorcollect/data/http/ApiService.java
+33
-0
HttpDataSource.java
...java/com/phlx/anchorcollect/data/http/HttpDataSource.java
+24
-0
HttpDataSourceImpl.java
.../com/phlx/anchorcollect/data/http/HttpDataSourceImpl.java
+20
-1
LocalDataSource.java
...va/com/phlx/anchorcollect/data/local/LocalDataSource.java
+0
-1
LocalDataSourceImpl.java
...om/phlx/anchorcollect/data/local/LocalDataSourceImpl.java
+0
-1
CattleResumeEntityDao.java
.../com/phlx/anchorcollect/db/gen/CattleResumeEntityDao.java
+58
-30
DaoMaster.java
...rc/main/java/com/phlx/anchorcollect/db/gen/DaoMaster.java
+3
-0
DaoSession.java
...c/main/java/com/phlx/anchorcollect/db/gen/DaoSession.java
+14
-0
PerformanceEntityDao.java
...a/com/phlx/anchorcollect/db/gen/PerformanceEntityDao.java
+180
-175
CattleResumeEntity.java
...ava/com/phlx/anchorcollect/entity/CattleResumeEntity.java
+37
-7
DictEntity.java
...c/main/java/com/phlx/anchorcollect/entity/DictEntity.java
+213
-34
PerformanceEntity.java
...java/com/phlx/anchorcollect/entity/PerformanceEntity.java
+134
-132
RetrofitClient.java
.../main/java/com/phlx/anchorcollect/net/RetrofitClient.java
+4
-0
BasicsCollectFragment.java
...phlx/anchorcollect/ui/fragment/BasicsCollectFragment.java
+27
-3
CollectFragment.java
...a/com/phlx/anchorcollect/ui/fragment/CollectFragment.java
+5
-6
PerformanceFragment.java
...m/phlx/anchorcollect/ui/fragment/PerformanceFragment.java
+55
-0
CollectGridItem.java
.../phlx/anchorcollect/ui/fragment/list/CollectGridItem.java
+26
-1
BasicsCollectVM.java
...om/phlx/anchorcollect/ui/fragment/vm/BasicsCollectVM.java
+148
-15
CollectListVM.java
.../com/phlx/anchorcollect/ui/fragment/vm/CollectListVM.java
+10
-11
CollectVM.java
...java/com/phlx/anchorcollect/ui/fragment/vm/CollectVM.java
+10
-13
PerformanceVM.java
.../com/phlx/anchorcollect/ui/fragment/vm/PerformanceVM.java
+127
-0
HomeVM.java
app/src/main/java/com/phlx/anchorcollect/ui/home/HomeVM.java
+7
-7
LoginVM.java
...rc/main/java/com/phlx/anchorcollect/ui/login/LoginVM.java
+76
-2
MainActivity.java
...ain/java/com/phlx/anchorcollect/ui/main/MainActivity.java
+3
-0
MainVM.java
app/src/main/java/com/phlx/anchorcollect/ui/main/MainVM.java
+2
-58
BLEItem.java
.../main/java/com/phlx/anchorcollect/ui/setting/BLEItem.java
+2
-2
SettingActivity.java
...va/com/phlx/anchorcollect/ui/setting/SettingActivity.java
+29
-5
SettingVM.java
...ain/java/com/phlx/anchorcollect/ui/setting/SettingVM.java
+151
-11
SplashActivity.java
...java/com/phlx/anchorcollect/ui/splash/SplashActivity.java
+2
-2
SplashVM.java
.../main/java/com/phlx/anchorcollect/ui/splash/SplashVM.java
+126
-5
DeviceIdUtils.java
.../main/java/com/phlx/anchorcollect/util/DeviceIdUtils.java
+209
-0
DictUtils.java
app/src/main/java/com/phlx/anchorcollect/util/DictUtils.java
+3
-3
EntityUtils.java
...rc/main/java/com/phlx/anchorcollect/util/EntityUtils.java
+65
-0
StringUtil.java
...src/main/java/com/phlx/anchorcollect/util/StringUtil.java
+10
-0
SpaceItemDecoration.java
...va/com/phlx/anchorcollect/widget/SpaceItemDecoration.java
+27
-0
activity_bt_setting.xml
app/src/main/res/layout/activity_bt_setting.xml
+0
-67
activity_setting.xml
app/src/main/res/layout/activity_setting.xml
+288
-0
fragment_basics_collect.xml
app/src/main/res/layout/fragment_basics_collect.xml
+45
-14
fragment_performance.xml
app/src/main/res/layout/fragment_performance.xml
+112
-0
item_collect_grid.xml
app/src/main/res/layout/item_collect_grid.xml
+5
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
199e5b54
...
...
@@ -81,7 +81,7 @@
android:screenOrientation=
"landscape"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.setting.
Bt
SettingActivity"
android:name=
".ui.setting.SettingActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:launchMode=
"singleTask"
android:screenOrientation=
"landscape"
...
...
app/src/main/java/com/phlx/anchorcollect/App.java
View file @
199e5b54
...
...
@@ -74,76 +74,76 @@ public class App extends BaseApplication {
private
void
initDict
(){
DictEntity
de1
=
new
DictEntity
(
"001"
,
"安格斯牛"
,
"001"
,
"card_varieties"
);
Configs
.
dictList
.
add
(
de1
);
DictEntity
de2
=
new
DictEntity
(
"002"
,
"鲁西黄牛"
,
"002"
,
"card_varieties"
);
Configs
.
dictList
.
add
(
de2
);
DictEntity
de3
=
new
DictEntity
(
"003"
,
"公"
,
"003"
,
"card_sex"
);
Configs
.
dictList
.
add
(
de3
);
DictEntity
de4
=
new
DictEntity
(
"004"
,
"母"
,
"004"
,
"card_sex"
);
Configs
.
dictList
.
add
(
de4
);
DictEntity
de5
=
new
DictEntity
(
"005"
,
"其他"
,
"005"
,
"card_sex"
);
Configs
.
dictList
.
add
(
de5
);
DictEntity
de6
=
new
DictEntity
(
"006"
,
"圈舍1"
,
"006"
,
"card_circleNo"
);
Configs
.
dictList
.
add
(
de6
);
DictEntity
de7
=
new
DictEntity
(
"007"
,
"圈舍2"
,
"007"
,
"card_circleNo"
);
Configs
.
dictList
.
add
(
de7
);
DictEntity
de8
=
new
DictEntity
(
"008"
,
"圈舍3"
,
"008"
,
"card_circleNo"
);
Configs
.
dictList
.
add
(
de8
);
DictEntity
de9
=
new
DictEntity
(
"009"
,
"是"
,
"009"
,
"card_isTwins"
);
Configs
.
dictList
.
add
(
de9
);
DictEntity
de10
=
new
DictEntity
(
"010"
,
"否"
,
"010"
,
"card_isTwins"
);
Configs
.
dictList
.
add
(
de10
);
DictEntity
de11
=
new
DictEntity
(
"011"
,
"张三"
,
"011"
,
"weight_principal"
);
Configs
.
dictList
.
add
(
de11
);
DictEntity
de12
=
new
DictEntity
(
"012"
,
"李四"
,
"012"
,
"weight_principal"
);
Configs
.
dictList
.
add
(
de12
);
DictEntity
de13
=
new
DictEntity
(
"013"
,
"药品一"
,
"013"
,
"health_drug_name"
);
Configs
.
dictList
.
add
(
de13
);
DictEntity
de14
=
new
DictEntity
(
"014"
,
"药品二"
,
"014"
,
"health_drug_name"
);
Configs
.
dictList
.
add
(
de14
);
DictEntity
de15
=
new
DictEntity
(
"015"
,
"药品三"
,
"015"
,
"health_drug_name"
);
Configs
.
dictList
.
add
(
de15
);
DictEntity
de16
=
new
DictEntity
(
"016"
,
"药品四"
,
"016"
,
"health_drug_name"
);
Configs
.
dictList
.
add
(
de16
);
DictEntity
de17
=
new
DictEntity
(
"017"
,
"20ml/瓶"
,
"017"
,
"health_specifications"
);
Configs
.
dictList
.
add
(
de17
);
DictEntity
de18
=
new
DictEntity
(
"018"
,
"50ml/瓶"
,
"018"
,
"health_specifications"
);
Configs
.
dictList
.
add
(
de18
);
DictEntity
de19
=
new
DictEntity
(
"019"
,
"100ml/瓶"
,
"019"
,
"health_specifications"
);
Configs
.
dictList
.
add
(
de19
);
DictEntity
de20
=
new
DictEntity
(
"020"
,
"口服"
,
"020"
,
"health_methods"
);
Configs
.
dictList
.
add
(
de20
);
DictEntity
de21
=
new
DictEntity
(
"021"
,
"注射"
,
"021"
,
"health_methods"
);
Configs
.
dictList
.
add
(
de21
);
DictEntity
de22
=
new
DictEntity
(
"022"
,
"外用"
,
"022"
,
"health_methods"
);
Configs
.
dictList
.
add
(
de22
);
DictEntity
de23
=
new
DictEntity
(
"023"
,
"疫苗一"
,
"023"
,
"immun_name"
);
Configs
.
dictList
.
add
(
de23
);
DictEntity
de24
=
new
DictEntity
(
"024"
,
"疫苗二"
,
"024"
,
"immun_name"
);
Configs
.
dictList
.
add
(
de24
);
DictEntity
de25
=
new
DictEntity
(
"025"
,
"0058716654"
,
"025"
,
"immun_batch"
);
Configs
.
dictList
.
add
(
de25
);
DictEntity
de26
=
new
DictEntity
(
"026"
,
"0058895548"
,
"026"
,
"immun_batch"
);
Configs
.
dictList
.
add
(
de26
);
DictEntity
de27
=
new
DictEntity
(
"027"
,
"0058991568"
,
"027"
,
"immun_batch"
);
Configs
.
dictList
.
add
(
de27
);
DictEntity
de28
=
new
DictEntity
(
"028"
,
"顺产"
,
"028"
,
"ease_birth"
);
Configs
.
dictList
.
add
(
de28
);
DictEntity
de29
=
new
DictEntity
(
"029"
,
"难产"
,
"029"
,
"ease_birth"
);
Configs
.
dictList
.
add
(
de29
);
DictEntity
de30
=
new
DictEntity
(
"030"
,
"剖腹产"
,
"030"
,
"ease_birth"
);
Configs
.
dictList
.
add
(
de30
);
//
DictEntity de1 = new DictEntity("001", "安格斯牛", "001", "card_varieties");
//
Configs.dictList.add(de1);
//
DictEntity de2 = new DictEntity("002", "鲁西黄牛", "002", "card_varieties");
//
Configs.dictList.add(de2);
//
//
DictEntity de3 = new DictEntity("003", "公", "003", "card_sex");
//
Configs.dictList.add(de3);
//
DictEntity de4 = new DictEntity("004", "母", "004", "card_sex");
//
Configs.dictList.add(de4);
//
DictEntity de5 = new DictEntity("005", "其他", "005", "card_sex");
//
Configs.dictList.add(de5);
//
//
DictEntity de6 = new DictEntity("006", "圈舍1", "006", "card_circleNo");
//
Configs.dictList.add(de6);
//
DictEntity de7 = new DictEntity("007", "圈舍2", "007", "card_circleNo");
//
Configs.dictList.add(de7);
//
DictEntity de8 = new DictEntity("008", "圈舍3", "008", "card_circleNo");
//
Configs.dictList.add(de8);
//
//
DictEntity de9 = new DictEntity("009", "是", "009", "card_isTwins");
//
Configs.dictList.add(de9);
//
DictEntity de10 = new DictEntity("010", "否", "010", "card_isTwins");
//
Configs.dictList.add(de10);
//
//
DictEntity de11 = new DictEntity("011", "张三", "011", "weight_principal");
//
Configs.dictList.add(de11);
//
DictEntity de12 = new DictEntity("012", "李四", "012", "weight_principal");
//
Configs.dictList.add(de12);
//
//
DictEntity de13 = new DictEntity("013", "药品一", "013", "health_drug_name");
//
Configs.dictList.add(de13);
//
DictEntity de14 = new DictEntity("014", "药品二", "014", "health_drug_name");
//
Configs.dictList.add(de14);
//
DictEntity de15 = new DictEntity("015", "药品三", "015", "health_drug_name");
//
Configs.dictList.add(de15);
//
DictEntity de16 = new DictEntity("016", "药品四", "016", "health_drug_name");
//
Configs.dictList.add(de16);
//
//
DictEntity de17 = new DictEntity("017", "20ml/瓶", "017", "health_specifications");
//
Configs.dictList.add(de17);
//
DictEntity de18 = new DictEntity("018", "50ml/瓶", "018", "health_specifications");
//
Configs.dictList.add(de18);
//
DictEntity de19 = new DictEntity("019", "100ml/瓶", "019", "health_specifications");
//
Configs.dictList.add(de19);
//
//
DictEntity de20 = new DictEntity("020", "口服", "020", "health_methods");
//
Configs.dictList.add(de20);
//
DictEntity de21 = new DictEntity("021", "注射", "021", "health_methods");
//
Configs.dictList.add(de21);
//
DictEntity de22 = new DictEntity("022", "外用", "022", "health_methods");
//
Configs.dictList.add(de22);
//
//
DictEntity de23 = new DictEntity("023", "疫苗一", "023", "immun_name");
//
Configs.dictList.add(de23);
//
DictEntity de24 = new DictEntity("024", "疫苗二", "024", "immun_name");
//
Configs.dictList.add(de24);
//
//
DictEntity de25 = new DictEntity("025", "0058716654", "025", "immun_batch");
//
Configs.dictList.add(de25);
//
DictEntity de26 = new DictEntity("026", "0058895548", "026", "immun_batch");
//
Configs.dictList.add(de26);
//
DictEntity de27 = new DictEntity("027", "0058991568", "027", "immun_batch");
//
Configs.dictList.add(de27);
//
//
DictEntity de28 = new DictEntity("028", "顺产", "028", "ease_birth");
//
Configs.dictList.add(de28);
//
DictEntity de29 = new DictEntity("029", "难产", "029", "ease_birth");
//
Configs.dictList.add(de29);
//
DictEntity de30 = new DictEntity("030", "剖腹产", "030", "ease_birth");
//
Configs.dictList.add(de30);
}
...
...
app/src/main/java/com/phlx/anchorcollect/Configs.java
View file @
199e5b54
...
...
@@ -49,6 +49,7 @@ public class Configs {
public
static
final
String
SP_ROLE_ID
=
"sp_role_id"
;
public
static
final
String
SP_NAME
=
"sp_name"
;
public
static
final
String
SP_LOGIN_NAME
=
"sp_login_name"
;
public
static
final
String
SP_DEPT_ID
=
"sp_dept_id"
;
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"
;
...
...
@@ -63,12 +64,13 @@ public class Configs {
public
static
final
String
SP_UNIT_VILLAGE_NAME
=
"sp_unit_villag_name"
;
public
static
final
String
SP_UNIT_REVISION
=
"sp_unit_revision"
;
//type home页面加载fragment类型
public
static
final
String
FAMILY_ARCHIVES
=
"family_archives"
;
public
static
final
String
WEIGHTING_MANAGE
=
"weighting_manage"
;
public
static
final
String
HEALTH_MANAGE
=
"health_manage"
;
//type 加载fragment类型
public
static
final
String
BASE_ARCHIVES
=
"base_archives"
;
public
static
final
String
SIGN_MEASURE
=
"sign_measure"
;
public
static
final
String
IMMUN_MANAGE
=
"immun_manage"
;
public
static
final
String
WEIGHTING_MANAGE
=
"weighting_manage"
;
public
static
final
String
TREATMENT_RECORD
=
"treatment_record"
;
public
static
final
String
IMMUN_RECORD
=
"immun_record"
;
public
static
final
String
BREEDING_RECORD
=
"breeding_record"
;
//0 高频,1低频
public
static
String
FREQUENCY_CONFIG
=
"1"
;
...
...
@@ -93,8 +95,12 @@ public class Configs {
//字典项
public
static
List
<
DictEntity
>
dictList
=
new
ArrayList
<>();
//临时存放列表查询
tag
//临时存放列表查询
可视耳标
public
static
String
tempTag
=
""
;
//临时存放列表查询电子耳标
public
static
String
tempRfid
=
""
;
//临时存放列表查询unid
public
static
String
tempUnid
=
""
;
// public static boolean ISCONNECTED;
...
...
app/src/main/java/com/phlx/anchorcollect/data/Repository.java
View file @
199e5b54
...
...
@@ -5,14 +5,20 @@ import androidx.annotation.NonNull;
import
com.phlx.anchorcollect.data.http.HttpDataSource
;
import
com.phlx.anchorcollect.data.local.LocalDataSource
;
import
com.phlx.anchorcollect.entity.CattleResumeEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenData
;
import
com.phlx.anchorcollect.entity.LoginData
;
import
com.phlx.anchorcollect.params.CollectResponse
;
import
com.phlx.anchorcollect.params.ListResponse
;
import
java.util.List
;
import
java.util.Map
;
import
io.reactivex.Observable
;
import
me.goldze.mvvmhabit.base.BaseModel
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.FieldMap
;
/**
...
...
@@ -48,7 +54,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
@Override
public
Observable
<
CollectResponse
<
LoginData
>>
loginPost
(
@FieldMap
Map
<
String
,
String
>
map
)
{
public
Observable
<
CollectResponse
<
LoginData
>>
loginPost
(
Map
<
String
,
String
>
map
)
{
return
mHttpDataSource
.
loginPost
(
map
);
}
...
...
@@ -57,6 +63,23 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
return
mHttpDataSource
.
genGet
();
}
@Override
public
Observable
<
ListResponse
<
CattleResumeEntity
>>
downloadCattleList
(
Map
<
String
,
String
>
map
)
{
return
mHttpDataSource
.
downloadCattleList
(
map
);
}
@Override
public
Observable
<
CollectResponse
>
downloadCattleListSync
(
RequestBody
body
)
{
return
mHttpDataSource
.
downloadCattleListSync
(
body
);
}
@Override
public
Observable
<
ListResponse
<
DictEntity
>>
downloadDict
()
{
return
mHttpDataSource
.
downloadDict
();
}
/****************************************************************************/
...
...
app/src/main/java/com/phlx/anchorcollect/data/VMFactory.java
View file @
199e5b54
...
...
@@ -11,11 +11,12 @@ import androidx.lifecycle.ViewModelProvider;
import
com.phlx.anchorcollect.ui.fragment.vm.BasicsCollectVM
;
import
com.phlx.anchorcollect.ui.fragment.vm.CollectListVM
;
import
com.phlx.anchorcollect.ui.fragment.vm.CollectVM
;
import
com.phlx.anchorcollect.ui.fragment.vm.PerformanceVM
;
import
com.phlx.anchorcollect.ui.home.HomeVM
;
import
com.phlx.anchorcollect.ui.info.CattleVM
;
import
com.phlx.anchorcollect.ui.login.LoginVM
;
import
com.phlx.anchorcollect.ui.main.MainVM
;
import
com.phlx.anchorcollect.ui.setting.
Bt
SettingVM
;
import
com.phlx.anchorcollect.ui.setting.SettingVM
;
import
com.phlx.anchorcollect.ui.splash.SplashVM
;
...
...
@@ -76,6 +77,9 @@ public class VMFactory extends ViewModelProvider.NewInstanceFactory {
}
else
if
(
modelClass
.
isAssignableFrom
(
BasicsCollectVM
.
class
))
{
return
(
T
)
new
BasicsCollectVM
(
mApplication
,
repository
);
}
else
if
(
modelClass
.
isAssignableFrom
(
PerformanceVM
.
class
))
{
return
(
T
)
new
PerformanceVM
(
mApplication
,
repository
);
}
else
if
(
modelClass
.
isAssignableFrom
(
CollectVM
.
class
))
{
...
...
@@ -84,8 +88,8 @@ public class VMFactory extends ViewModelProvider.NewInstanceFactory {
return
(
T
)
new
CollectListVM
(
mApplication
,
repository
);
}
else
if
(
modelClass
.
isAssignableFrom
(
CattleVM
.
class
))
{
return
(
T
)
new
CattleVM
(
mApplication
,
repository
);
}
else
if
(
modelClass
.
isAssignableFrom
(
Bt
SettingVM
.
class
))
{
return
(
T
)
new
Bt
SettingVM
(
mApplication
,
repository
);
}
else
if
(
modelClass
.
isAssignableFrom
(
SettingVM
.
class
))
{
return
(
T
)
new
SettingVM
(
mApplication
,
repository
);
}
throw
new
IllegalArgumentException
(
"Unknown ViewModel class: "
+
modelClass
.
getName
());
}
...
...
app/src/main/java/com/phlx/anchorcollect/data/http/ApiService.java
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
data
.
http
;
import
com.phlx.anchorcollect.entity.CattleResumeEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenData
;
import
com.phlx.anchorcollect.entity.LoginData
;
import
com.phlx.anchorcollect.params.CollectResponse
;
import
com.phlx.anchorcollect.params.ListResponse
;
import
java.util.List
;
import
java.util.Map
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.FieldMap
;
import
retrofit2.http.FormUrlEncoded
;
import
retrofit2.http.GET
;
import
retrofit2.http.Headers
;
import
retrofit2.http.POST
;
/**
...
...
@@ -32,6 +39,7 @@ public interface ApiService {
// Observable<CattleResponse> DownloadApp();
// @Headers({"Content-Type: application/json", "Accept: application/json"})
/**
* 登录
*/
...
...
@@ -45,6 +53,31 @@ public interface ApiService {
@GET
(
"/api/gen/list"
)
Observable
<
CollectResponse
<
GenData
>>
genGet
();
/**
* 获取基础信息列表
* SyncState 0根据记录更新,1重新更新
*/
@FormUrlEncoded
@POST
(
"/api/cattleresume/list"
)
Observable
<
ListResponse
<
CattleResumeEntity
>>
downloadCattleList
(
@FieldMap
Map
<
String
,
String
>
map
);
/**
* 获取基础信息列表-返回
*/
// @Headers({"Content-Type: application/json", "Accept: application/x-www-form-urlencoded;charset=UTF-8"})
@Headers
({
"Content-Type: application/json"
,
"Accept: application/json"
})
@POST
(
"/api/cattleresume/sync/add"
)
Observable
<
CollectResponse
>
downloadCattleListSync
(
@Body
RequestBody
body
);
/**
* 获取字典项列表
*/
@POST
(
"/api/dict/data/list"
)
Observable
<
ListResponse
<
DictEntity
>>
downloadDict
();
}
...
...
app/src/main/java/com/phlx/anchorcollect/data/http/HttpDataSource.java
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
data
.
http
;
import
com.phlx.anchorcollect.entity.CattleResumeEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenData
;
import
com.phlx.anchorcollect.entity.LoginData
;
import
com.phlx.anchorcollect.params.CollectResponse
;
import
com.phlx.anchorcollect.params.ListResponse
;
import
java.util.List
;
import
java.util.Map
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.FieldMap
;
import
retrofit2.http.FormUrlEncoded
;
import
retrofit2.http.POST
;
/**
* Created by goldze on 2019/3/26.
...
...
@@ -37,5 +45,21 @@ public interface HttpDataSource {
*/
Observable
<
CollectResponse
<
GenData
>>
genGet
();
/**
* 获取基础信息列表
*/
Observable
<
ListResponse
<
CattleResumeEntity
>>
downloadCattleList
(
@FieldMap
Map
<
String
,
String
>
map
);
/**
* 获取基础信息列表-返回
*/
Observable
<
CollectResponse
>
downloadCattleListSync
(
@Body
RequestBody
body
);
/**
* 获取字典项列表
*/
Observable
<
ListResponse
<
DictEntity
>>
downloadDict
();
}
app/src/main/java/com/phlx/anchorcollect/data/http/HttpDataSourceImpl.java
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
data
.
http
;
import
com.phlx.anchorcollect.entity.CattleResumeEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenData
;
import
com.phlx.anchorcollect.entity.LoginData
;
import
com.phlx.anchorcollect.params.CollectResponse
;
import
com.phlx.anchorcollect.params.ListResponse
;
import
java.util.List
;
import
java.util.Map
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.FieldMap
;
/**
...
...
@@ -38,7 +44,7 @@ public class HttpDataSourceImpl implements HttpDataSource {
@Override
public
Observable
<
CollectResponse
<
LoginData
>>
loginPost
(
@FieldMap
Map
<
String
,
String
>
map
)
{
public
Observable
<
CollectResponse
<
LoginData
>>
loginPost
(
@FieldMap
Map
<
String
,
String
>
map
)
{
return
apiService
.
loginPost
(
map
);
}
...
...
@@ -47,5 +53,18 @@ public class HttpDataSourceImpl implements HttpDataSource {
return
apiService
.
genGet
();
}
@Override
public
Observable
<
ListResponse
<
CattleResumeEntity
>>
downloadCattleList
(
@FieldMap
Map
<
String
,
String
>
map
)
{
return
apiService
.
downloadCattleList
(
map
);
}
@Override
public
Observable
<
CollectResponse
>
downloadCattleListSync
(
@Body
RequestBody
body
)
{
return
apiService
.
downloadCattleListSync
(
body
);
}
@Override
public
Observable
<
ListResponse
<
DictEntity
>>
downloadDict
()
{
return
apiService
.
downloadDict
();
}
}
app/src/main/java/com/phlx/anchorcollect/data/local/LocalDataSource.java
View file @
199e5b54
...
...
@@ -66,7 +66,6 @@ public interface LocalDataSource {
*/
String
getFrequencyConfig
();
/**
* 获取Token
*/
...
...
app/src/main/java/com/phlx/anchorcollect/data/local/LocalDataSourceImpl.java
View file @
199e5b54
...
...
@@ -85,5 +85,4 @@ public class LocalDataSourceImpl implements LocalDataSource {
return
SPUtils
.
getInstance
().
getString
(
"token"
,
""
);
}
}
app/src/main/java/com/phlx/anchorcollect/db/gen/CattleResumeEntityDao.java
View file @
199e5b54
...
...
@@ -48,11 +48,13 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Strin
public
final
static
Property
IsOut
=
new
Property
(
21
,
String
.
class
,
"isOut"
,
false
,
"IS_OUT"
);
public
final
static
Property
InputTime
=
new
Property
(
22
,
String
.
class
,
"inputTime"
,
false
,
"INPUT_TIME"
);
public
final
static
Property
DeptId
=
new
Property
(
23
,
String
.
class
,
"deptId"
,
false
,
"DEPT_ID"
);
public
final
static
Property
CreateBy
=
new
Property
(
24
,
String
.
class
,
"createBy"
,
false
,
"CREATE_BY"
);
public
final
static
Property
CreateTime
=
new
Property
(
25
,
String
.
class
,
"createTime"
,
false
,
"CREATE_TIME"
);
public
final
static
Property
UpdateBy
=
new
Property
(
26
,
String
.
class
,
"updateBy"
,
false
,
"UPDATE_BY"
);
public
final
static
Property
UpdateTime
=
new
Property
(
27
,
String
.
class
,
"updateTime"
,
false
,
"UPDATE_TIME"
);
public
final
static
Property
Remark
=
new
Property
(
28
,
String
.
class
,
"remark"
,
false
,
"REMARK"
);
public
final
static
Property
UploadStatus
=
new
Property
(
24
,
String
.
class
,
"uploadStatus"
,
false
,
"UPLOAD_STATUS"
);
public
final
static
Property
UploadTime
=
new
Property
(
25
,
String
.
class
,
"uploadTime"
,
false
,
"UPLOAD_TIME"
);
public
final
static
Property
CreateBy
=
new
Property
(
26
,
String
.
class
,
"createBy"
,
false
,
"CREATE_BY"
);
public
final
static
Property
CreateTime
=
new
Property
(
27
,
String
.
class
,
"createTime"
,
false
,
"CREATE_TIME"
);
public
final
static
Property
UpdateBy
=
new
Property
(
28
,
String
.
class
,
"updateBy"
,
false
,
"UPDATE_BY"
);
public
final
static
Property
UpdateTime
=
new
Property
(
29
,
String
.
class
,
"updateTime"
,
false
,
"UPDATE_TIME"
);
public
final
static
Property
Remark
=
new
Property
(
30
,
String
.
class
,
"remark"
,
false
,
"REMARK"
);
}
...
...
@@ -92,11 +94,13 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Strin
"\"IS_OUT\" TEXT,"
+
// 21: isOut
"\"INPUT_TIME\" TEXT,"
+
// 22: inputTime
"\"DEPT_ID\" TEXT,"
+
// 23: deptId
"\"CREATE_BY\" TEXT,"
+
// 24: createBy
"\"CREATE_TIME\" TEXT,"
+
// 25: createTime
"\"UPDATE_BY\" TEXT,"
+
// 26: updateBy
"\"UPDATE_TIME\" TEXT,"
+
// 27: updateTime
"\"REMARK\" TEXT);"
);
// 28: remark
"\"UPLOAD_STATUS\" TEXT,"
+
// 24: uploadStatus
"\"UPLOAD_TIME\" TEXT,"
+
// 25: uploadTime
"\"CREATE_BY\" TEXT,"
+
// 26: createBy
"\"CREATE_TIME\" TEXT,"
+
// 27: createTime
"\"UPDATE_BY\" TEXT,"
+
// 28: updateBy
"\"UPDATE_TIME\" TEXT,"
+
// 29: updateTime
"\"REMARK\" TEXT);"
);
// 30: remark
}
/** Drops the underlying database table. */
...
...
@@ -229,29 +233,39 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Strin
stmt
.
bindString
(
24
,
deptId
);
}
String
uploadStatus
=
entity
.
getUploadStatus
();
if
(
uploadStatus
!=
null
)
{
stmt
.
bindString
(
25
,
uploadStatus
);
}
String
uploadTime
=
entity
.
getUploadTime
();
if
(
uploadTime
!=
null
)
{
stmt
.
bindString
(
26
,
uploadTime
);
}
String
createBy
=
entity
.
getCreateBy
();
if
(
createBy
!=
null
)
{
stmt
.
bindString
(
2
5
,
createBy
);
stmt
.
bindString
(
2
7
,
createBy
);
}
String
createTime
=
entity
.
getCreateTime
();
if
(
createTime
!=
null
)
{
stmt
.
bindString
(
2
6
,
createTime
);
stmt
.
bindString
(
2
8
,
createTime
);
}
String
updateBy
=
entity
.
getUpdateBy
();
if
(
updateBy
!=
null
)
{
stmt
.
bindString
(
2
7
,
updateBy
);
stmt
.
bindString
(
2
9
,
updateBy
);
}
String
updateTime
=
entity
.
getUpdateTime
();
if
(
updateTime
!=
null
)
{
stmt
.
bindString
(
28
,
updateTime
);
stmt
.
bindString
(
30
,
updateTime
);
}
String
remark
=
entity
.
getRemark
();
if
(
remark
!=
null
)
{
stmt
.
bindString
(
29
,
remark
);
stmt
.
bindString
(
31
,
remark
);
}
}
...
...
@@ -379,29 +393,39 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Strin
stmt
.
bindString
(
24
,
deptId
);
}
String
uploadStatus
=
entity
.
getUploadStatus
();
if
(
uploadStatus
!=
null
)
{
stmt
.
bindString
(
25
,
uploadStatus
);
}
String
uploadTime
=
entity
.
getUploadTime
();
if
(
uploadTime
!=
null
)
{
stmt
.
bindString
(
26
,
uploadTime
);
}
String
createBy
=
entity
.
getCreateBy
();
if
(
createBy
!=
null
)
{
stmt
.
bindString
(
2
5
,
createBy
);
stmt
.
bindString
(
2
7
,
createBy
);
}
String
createTime
=
entity
.
getCreateTime
();
if
(
createTime
!=
null
)
{
stmt
.
bindString
(
2
6
,
createTime
);
stmt
.
bindString
(
2
8
,
createTime
);
}
String
updateBy
=
entity
.
getUpdateBy
();
if
(
updateBy
!=
null
)
{
stmt
.
bindString
(
2
7
,
updateBy
);
stmt
.
bindString
(
2
9
,
updateBy
);
}
String
updateTime
=
entity
.
getUpdateTime
();
if
(
updateTime
!=
null
)
{
stmt
.
bindString
(
28
,
updateTime
);
stmt
.
bindString
(
30
,
updateTime
);
}
String
remark
=
entity
.
getRemark
();
if
(
remark
!=
null
)
{
stmt
.
bindString
(
29
,
remark
);
stmt
.
bindString
(
31
,
remark
);
}
}
...
...
@@ -437,11 +461,13 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Strin
cursor
.
isNull
(
offset
+
21
)
?
null
:
cursor
.
getString
(
offset
+
21
),
// isOut
cursor
.
isNull
(
offset
+
22
)
?
null
:
cursor
.
getString
(
offset
+
22
),
// inputTime
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
),
// deptId
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
),
// createBy
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
),
// createTime
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
),
// updateBy
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
),
// updateTime
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
)
// remark
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
),
// uploadStatus
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
),
// uploadTime
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
),
// createBy
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
),
// createTime
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
),
// updateBy
cursor
.
isNull
(
offset
+
29
)
?
null
:
cursor
.
getString
(
offset
+
29
),
// updateTime
cursor
.
isNull
(
offset
+
30
)
?
null
:
cursor
.
getString
(
offset
+
30
)
// remark
);
return
entity
;
}
...
...
@@ -472,11 +498,13 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Strin
entity
.
setIsOut
(
cursor
.
isNull
(
offset
+
21
)
?
null
:
cursor
.
getString
(
offset
+
21
));
entity
.
setInputTime
(
cursor
.
isNull
(
offset
+
22
)
?
null
:
cursor
.
getString
(
offset
+
22
));
entity
.
setDeptId
(
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
));
entity
.
setCreateBy
(
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
));
entity
.
setCreateTime
(
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
));
entity
.
setUpdateBy
(
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
));
entity
.
setUpdateTime
(
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
));
entity
.
setRemark
(
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
));
entity
.
setUploadStatus
(
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
));
entity
.
setUploadTime
(
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
));
entity
.
setCreateBy
(
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
));
entity
.
setCreateTime
(
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
));
entity
.
setUpdateBy
(
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
));
entity
.
setUpdateTime
(
cursor
.
isNull
(
offset
+
29
)
?
null
:
cursor
.
getString
(
offset
+
29
));
entity
.
setRemark
(
cursor
.
isNull
(
offset
+
30
)
?
null
:
cursor
.
getString
(
offset
+
30
));
}
@Override
...
...
app/src/main/java/com/phlx/anchorcollect/db/gen/DaoMaster.java
View file @
199e5b54
...
...
@@ -31,6 +31,7 @@ public class DaoMaster extends AbstractDaoMaster {
PerformanceEntityDao
.
createTable
(
db
,
ifNotExists
);
UserRoleEntityDao
.
createTable
(
db
,
ifNotExists
);
WeightingEntityDao
.
createTable
(
db
,
ifNotExists
);
DictEntityDao
.
createTable
(
db
,
ifNotExists
);
}
/** Drops underlying database table using DAOs. */
...
...
@@ -45,6 +46,7 @@ public class DaoMaster extends AbstractDaoMaster {
PerformanceEntityDao
.
dropTable
(
db
,
ifExists
);
UserRoleEntityDao
.
dropTable
(
db
,
ifExists
);
WeightingEntityDao
.
dropTable
(
db
,
ifExists
);
DictEntityDao
.
dropTable
(
db
,
ifExists
);
}
/**
...
...
@@ -73,6 +75,7 @@ public class DaoMaster extends AbstractDaoMaster {
registerDaoClass
(
PerformanceEntityDao
.
class
);
registerDaoClass
(
UserRoleEntityDao
.
class
);
registerDaoClass
(
WeightingEntityDao
.
class
);
registerDaoClass
(
DictEntityDao
.
class
);
}
public
DaoSession
newSession
()
{
...
...
app/src/main/java/com/phlx/anchorcollect/db/gen/DaoSession.java
View file @
199e5b54
...
...
@@ -18,6 +18,7 @@ import com.phlx.anchorcollect.entity.MedicalEntity;
import
com.phlx.anchorcollect.entity.PerformanceEntity
;
import
com.phlx.anchorcollect.entity.UserRoleEntity
;
import
com.phlx.anchorcollect.entity.WeightingEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.db.gen.AncestryinfoEntityDao
;
import
com.phlx.anchorcollect.db.gen.CardEntityDao
;
...
...
@@ -29,6 +30,7 @@ import com.phlx.anchorcollect.db.gen.MedicalEntityDao;
import
com.phlx.anchorcollect.db.gen.PerformanceEntityDao
;
import
com.phlx.anchorcollect.db.gen.UserRoleEntityDao
;
import
com.phlx.anchorcollect.db.gen.WeightingEntityDao
;
import
com.phlx.anchorcollect.db.gen.DictEntityDao
;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
...
...
@@ -49,6 +51,7 @@ public class DaoSession extends AbstractDaoSession {
private
final
DaoConfig
performanceEntityDaoConfig
;
private
final
DaoConfig
userRoleEntityDaoConfig
;
private
final
DaoConfig
weightingEntityDaoConfig
;
private
final
DaoConfig
dictEntityDaoConfig
;
private
final
AncestryinfoEntityDao
ancestryinfoEntityDao
;
private
final
CardEntityDao
cardEntityDao
;
...
...
@@ -60,6 +63,7 @@ public class DaoSession extends AbstractDaoSession {
private
final
PerformanceEntityDao
performanceEntityDao
;
private
final
UserRoleEntityDao
userRoleEntityDao
;
private
final
WeightingEntityDao
weightingEntityDao
;
private
final
DictEntityDao
dictEntityDao
;
public
DaoSession
(
Database
db
,
IdentityScopeType
type
,
Map
<
Class
<?
extends
AbstractDao
<?,
?>>,
DaoConfig
>
daoConfigMap
)
{
...
...
@@ -95,6 +99,9 @@ public class DaoSession extends AbstractDaoSession {
weightingEntityDaoConfig
=
daoConfigMap
.
get
(
WeightingEntityDao
.
class
).
clone
();
weightingEntityDaoConfig
.
initIdentityScope
(
type
);
dictEntityDaoConfig
=
daoConfigMap
.
get
(
DictEntityDao
.
class
).
clone
();
dictEntityDaoConfig
.
initIdentityScope
(
type
);
ancestryinfoEntityDao
=
new
AncestryinfoEntityDao
(
ancestryinfoEntityDaoConfig
,
this
);
cardEntityDao
=
new
CardEntityDao
(
cardEntityDaoConfig
,
this
);
cattleResumeEntityDao
=
new
CattleResumeEntityDao
(
cattleResumeEntityDaoConfig
,
this
);
...
...
@@ -105,6 +112,7 @@ public class DaoSession extends AbstractDaoSession {
performanceEntityDao
=
new
PerformanceEntityDao
(
performanceEntityDaoConfig
,
this
);
userRoleEntityDao
=
new
UserRoleEntityDao
(
userRoleEntityDaoConfig
,
this
);
weightingEntityDao
=
new
WeightingEntityDao
(
weightingEntityDaoConfig
,
this
);
dictEntityDao
=
new
DictEntityDao
(
dictEntityDaoConfig
,
this
);
registerDao
(
AncestryinfoEntity
.
class
,
ancestryinfoEntityDao
);
registerDao
(
CardEntity
.
class
,
cardEntityDao
);
...
...
@@ -116,6 +124,7 @@ public class DaoSession extends AbstractDaoSession {
registerDao
(
PerformanceEntity
.
class
,
performanceEntityDao
);
registerDao
(
UserRoleEntity
.
class
,
userRoleEntityDao
);
registerDao
(
WeightingEntity
.
class
,
weightingEntityDao
);
registerDao
(
DictEntity
.
class
,
dictEntityDao
);
}
public
void
clear
()
{
...
...
@@ -129,6 +138,7 @@ public class DaoSession extends AbstractDaoSession {
performanceEntityDaoConfig
.
clearIdentityScope
();
userRoleEntityDaoConfig
.
clearIdentityScope
();
weightingEntityDaoConfig
.
clearIdentityScope
();
dictEntityDaoConfig
.
clearIdentityScope
();
}
public
AncestryinfoEntityDao
getAncestryinfoEntityDao
()
{
...
...
@@ -171,4 +181,8 @@ public class DaoSession extends AbstractDaoSession {
return
weightingEntityDao
;
}
public
DictEntityDao
getDictEntityDao
()
{
return
dictEntityDao
;
}
}
app/src/main/java/com/phlx/anchorcollect/db/gen/PerformanceEntityDao.java
View file @
199e5b54
...
...
@@ -15,7 +15,7 @@ import com.phlx.anchorcollect.entity.PerformanceEntity;
/**
* DAO for table "PERFORMANCE_ENTITY".
*/
public
class
PerformanceEntityDao
extends
AbstractDao
<
PerformanceEntity
,
Long
>
{
public
class
PerformanceEntityDao
extends
AbstractDao
<
PerformanceEntity
,
Void
>
{
public
static
final
String
TABLENAME
=
"PERFORMANCE_ENTITY"
;
...
...
@@ -24,35 +24,35 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
* Can be used for QueryBuilder and for referencing column names.
*/
public
static
class
Properties
{
public
final
static
Property
Id
=
new
Property
(
0
,
Long
.
class
,
"id"
,
false
,
"
ID"
);
public
final
static
Property
Unid
=
new
Property
(
1
,
long
.
class
,
"unid"
,
true
,
"_id
"
);
public
final
static
Property
RegistrationNo
=
new
Property
(
2
,
String
.
class
,
"registrationNo"
,
false
,
"REGISTRATION_NO
"
);
public
final
static
Property
Age
=
new
Property
(
3
,
String
.
class
,
"age"
,
false
,
"AG
E"
);
public
final
static
Property
MeasureDate
=
new
Property
(
4
,
String
.
class
,
"measureDate"
,
false
,
"MEASURE_DATE
"
);
public
final
static
Property
Height
=
new
Property
(
5
,
String
.
class
,
"height"
,
false
,
"HEIGHT
"
);
public
final
static
Property
Length
=
new
Property
(
6
,
String
.
class
,
"length"
,
false
,
"LENGTH
"
);
public
final
static
Property
Bust
=
new
Property
(
7
,
String
.
class
,
"bust"
,
false
,
"BUS
T"
);
public
final
static
Property
Unid
=
new
Property
(
0
,
String
.
class
,
"unid"
,
false
,
"UN
ID"
);
public
final
static
Property
CattleresumeId
=
new
Property
(
1
,
String
.
class
,
"cattleresumeId"
,
false
,
"CATTLERESUME_ID
"
);
public
final
static
Property
Age
=
new
Property
(
2
,
String
.
class
,
"age"
,
false
,
"AGE
"
);
public
final
static
Property
MeasureDate
=
new
Property
(
3
,
String
.
class
,
"measureDate"
,
false
,
"MEASURE_DAT
E"
);
public
final
static
Property
Height
=
new
Property
(
4
,
String
.
class
,
"height"
,
false
,
"HEIGHT
"
);
public
final
static
Property
Length
=
new
Property
(
5
,
String
.
class
,
"length"
,
false
,
"LENGTH
"
);
public
final
static
Property
Bust
=
new
Property
(
6
,
String
.
class
,
"bust"
,
false
,
"BUST
"
);
public
final
static
Property
Weight
=
new
Property
(
7
,
String
.
class
,
"weight"
,
false
,
"WEIGH
T"
);
public
final
static
Property
ChestWidth
=
new
Property
(
8
,
String
.
class
,
"chestWidth"
,
false
,
"CHEST_WIDTH"
);
public
final
static
Property
ChestDeep
=
new
Property
(
9
,
String
.
class
,
"chestDeep"
,
false
,
"CHEST_DEEP"
);
public
final
static
Property
WaistWidth
=
new
Property
(
10
,
String
.
class
,
"waistWidth"
,
false
,
"WAIST_WIDTH"
);
public
final
static
Property
CrossWidth
=
new
Property
(
11
,
String
.
class
,
"crossWidth"
,
false
,
"CROSS_WIDTH"
);
public
final
static
Property
GuanWei
=
new
Property
(
12
,
String
.
class
,
"guanWei"
,
false
,
"GUAN_WEI"
);
public
final
static
Property
Weight
=
new
Property
(
13
,
String
.
class
,
"weight"
,
false
,
"WEIGHT
"
);
public
final
static
Property
HairLength
=
new
Property
(
14
,
String
.
class
,
"hairLength"
,
false
,
"HAIR_LENGTH
"
);
public
final
static
Property
Hair
Fineness
=
new
Property
(
15
,
String
.
class
,
"hairFineness"
,
false
,
"HAIR_FINENESS
"
);
public
final
static
Property
Shearing
=
new
Property
(
16
,
String
.
class
,
"shearing"
,
false
,
"SHEARING
"
);
public
final
static
Property
BackWidth
=
new
Property
(
17
,
String
.
class
,
"backWidth"
,
false
,
"BACK_WIDTH
"
);
public
final
static
Property
EyeMuscleArea
=
new
Property
(
18
,
String
.
class
,
"eyeMuscleArea"
,
false
,
"EYE_MUSCLE_AREA
"
);
public
final
static
Property
EyeMuscleArea
=
new
Property
(
13
,
String
.
class
,
"eyeMuscleArea"
,
false
,
"EYE_MUSCLE_AREA
"
);
public
final
static
Property
Grade
=
new
Property
(
14
,
String
.
class
,
"grade"
,
false
,
"GRADE
"
);
public
final
static
Property
Hair
Length
=
new
Property
(
15
,
String
.
class
,
"hairLength"
,
false
,
"HAIR_LENGTH
"
);
public
final
static
Property
HairFineness
=
new
Property
(
16
,
String
.
class
,
"hairFineness"
,
false
,
"HAIR_FINENESS
"
);
public
final
static
Property
Shearing
=
new
Property
(
17
,
String
.
class
,
"shearing"
,
false
,
"SHEARING
"
);
public
final
static
Property
BackWidth
=
new
Property
(
18
,
String
.
class
,
"backWidth"
,
false
,
"BACK_WIDTH
"
);
public
final
static
Property
BreedRes
=
new
Property
(
19
,
String
.
class
,
"breedRes"
,
false
,
"BREED_RES"
);
public
final
static
Property
Health
=
new
Property
(
20
,
String
.
class
,
"health"
,
false
,
"HEALTH"
);
public
final
static
Property
Immune
=
new
Property
(
21
,
String
.
class
,
"immune"
,
false
,
"IMMUNE"
);
public
final
static
Property
UpdateId
=
new
Property
(
22
,
String
.
class
,
"updateId"
,
false
,
"UPDATE
_ID"
);
public
final
static
Property
CreateBy
=
new
Property
(
23
,
String
.
class
,
"createBy"
,
false
,
"CREATE_BY
"
);
public
final
static
Property
Create
Time
=
new
Property
(
24
,
String
.
class
,
"createTime"
,
false
,
"CREATE_TIME
"
);
public
final
static
Property
UpdateBy
=
new
Property
(
25
,
String
.
class
,
"updateBy"
,
false
,
"UPDATE_BY
"
);
public
final
static
Property
Update
Time
=
new
Property
(
26
,
String
.
class
,
"updateTime"
,
false
,
"UPDATE_TIME
"
);
public
final
static
Property
Permissions
=
new
Property
(
27
,
String
.
class
,
"permissions"
,
false
,
"PERMISSIONS
"
);
public
final
static
Property
InputTime
=
new
Property
(
28
,
String
.
class
,
"inputTime"
,
false
,
"INPUT_TIME
"
);
public
final
static
Property
DeptId
=
new
Property
(
22
,
String
.
class
,
"deptId"
,
false
,
"DEPT
_ID"
);
public
final
static
Property
SearchValue
=
new
Property
(
23
,
String
.
class
,
"searchValue"
,
false
,
"SEARCH_VALUE
"
);
public
final
static
Property
Create
By
=
new
Property
(
24
,
String
.
class
,
"createBy"
,
false
,
"CREATE_BY
"
);
public
final
static
Property
CreateTime
=
new
Property
(
25
,
String
.
class
,
"createTime"
,
false
,
"CREATE_TIME
"
);
public
final
static
Property
Update
By
=
new
Property
(
26
,
String
.
class
,
"updateBy"
,
false
,
"UPDATE_BY
"
);
public
final
static
Property
UpdateTime
=
new
Property
(
27
,
String
.
class
,
"updateTime"
,
false
,
"UPDATE_TIME
"
);
public
final
static
Property
Remark
=
new
Property
(
28
,
String
.
class
,
"remark"
,
false
,
"REMARK
"
);
}
...
...
@@ -68,35 +68,35 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
public
static
void
createTable
(
Database
db
,
boolean
ifNotExists
)
{
String
constraint
=
ifNotExists
?
"IF NOT EXISTS "
:
""
;
db
.
execSQL
(
"CREATE TABLE "
+
constraint
+
"\"PERFORMANCE_ENTITY\" ("
+
//
"\"
ID\" INTEGER,"
+
// 0:
id
"\"
_id\" INTEGER PRIMARY KEY NOT NULL ,"
+
// 1: uni
d
"\"
REGISTRATION_NO\" TEXT,"
+
// 2: registrationNo
"\"
AGE\" TEXT,"
+
// 3: ag
e
"\"
MEASURE_DATE\" TEXT,"
+
// 4: measureDate
"\"
HEIGHT\" TEXT,"
+
// 5: height
"\"
LENGTH\" TEXT,"
+
// 6: length
"\"
BUST\" TEXT,"
+
// 7: bus
t
"\"
UNID\" TEXT,"
+
// 0: un
id
"\"
CATTLERESUME_ID\" TEXT,"
+
// 1: cattleresumeI
d
"\"
AGE\" TEXT,"
+
// 2: age
"\"
MEASURE_DATE\" TEXT,"
+
// 3: measureDat
e
"\"
HEIGHT\" TEXT,"
+
// 4: height
"\"
LENGTH\" TEXT,"
+
// 5: length
"\"
BUST\" TEXT,"
+
// 6: bust
"\"
WEIGHT\" TEXT,"
+
// 7: weigh
t
"\"CHEST_WIDTH\" TEXT,"
+
// 8: chestWidth
"\"CHEST_DEEP\" TEXT,"
+
// 9: chestDeep
"\"WAIST_WIDTH\" TEXT,"
+
// 10: waistWidth
"\"CROSS_WIDTH\" TEXT,"
+
// 11: crossWidth
"\"GUAN_WEI\" TEXT,"
+
// 12: guanWei
"\"
WEIGHT\" TEXT,"
+
// 13: weight
"\"
HAIR_LENGTH\" TEXT,"
+
// 14: hairLength
"\"HAIR_
FINENESS\" TEXT,"
+
// 15: hairFineness
"\"
SHEARING\" TEXT,"
+
// 16: shearing
"\"
BACK_WIDTH\" TEXT,"
+
// 17: backWidth
"\"
EYE_MUSCLE_AREA\" TEXT,"
+
// 18: eyeMuscleArea
"\"
EYE_MUSCLE_AREA\" TEXT,"
+
// 13: eyeMuscleArea
"\"
GRADE\" TEXT,"
+
// 14: grade
"\"HAIR_
LENGTH\" TEXT,"
+
// 15: hairLength
"\"
HAIR_FINENESS\" TEXT,"
+
// 16: hairFineness
"\"
SHEARING\" TEXT,"
+
// 17: shearing
"\"
BACK_WIDTH\" TEXT,"
+
// 18: backWidth
"\"BREED_RES\" TEXT,"
+
// 19: breedRes
"\"HEALTH\" TEXT,"
+
// 20: health
"\"IMMUNE\" TEXT,"
+
// 21: immune
"\"
UPDATE_ID\" TEXT,"
+
// 22: update
Id
"\"
CREATE_BY\" TEXT,"
+
// 23: createBy
"\"CREATE_
TIME\" TEXT,"
+
// 24: createTime
"\"
UPDATE_BY\" TEXT,"
+
// 25: updateBy
"\"UPDATE_
TIME\" TEXT,"
+
// 26: updateTime
"\"
PERMISSIONS\" TEXT,"
+
// 27: permissions
"\"
INPUT_TIME\" TEXT);"
);
// 28: inputTime
"\"
DEPT_ID\" TEXT,"
+
// 22: dept
Id
"\"
SEARCH_VALUE\" TEXT,"
+
// 23: searchValue
"\"CREATE_
BY\" TEXT,"
+
// 24: createBy
"\"
CREATE_TIME\" TEXT,"
+
// 25: createTime
"\"UPDATE_
BY\" TEXT,"
+
// 26: updateBy
"\"
UPDATE_TIME\" TEXT,"
+
// 27: updateTime
"\"
REMARK\" TEXT);"
);
// 28: remark
}
/** Drops the underlying database table. */
...
...
@@ -109,40 +109,44 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
protected
final
void
bindValues
(
DatabaseStatement
stmt
,
PerformanceEntity
entity
)
{
stmt
.
clearBindings
();
Long
id
=
entity
.
getI
d
();
if
(
id
!=
null
)
{
stmt
.
bind
Long
(
1
,
id
);
String
unid
=
entity
.
getUni
d
();
if
(
un
id
!=
null
)
{
stmt
.
bind
String
(
1
,
un
id
);
}
stmt
.
bindLong
(
2
,
entity
.
getUnid
());
String
registrationNo
=
entity
.
getRegistrationNo
();
if
(
registrationNo
!=
null
)
{
stmt
.
bindString
(
3
,
registrationNo
);
String
cattleresumeId
=
entity
.
getCattleresumeId
();
if
(
cattleresumeId
!=
null
)
{
stmt
.
bindString
(
2
,
cattleresumeId
);
}
String
age
=
entity
.
getAge
();
if
(
age
!=
null
)
{
stmt
.
bindString
(
4
,
age
);
stmt
.
bindString
(
3
,
age
);
}
String
measureDate
=
entity
.
getMeasureDate
();
if
(
measureDate
!=
null
)
{
stmt
.
bindString
(
5
,
measureDate
);
stmt
.
bindString
(
4
,
measureDate
);
}
String
height
=
entity
.
getHeight
();
if
(
height
!=
null
)
{
stmt
.
bindString
(
6
,
height
);
stmt
.
bindString
(
5
,
height
);
}
String
length
=
entity
.
getLength
();
if
(
length
!=
null
)
{
stmt
.
bindString
(
7
,
length
);
stmt
.
bindString
(
6
,
length
);
}
String
bust
=
entity
.
getBust
();
if
(
bust
!=
null
)
{
stmt
.
bindString
(
8
,
bust
);
stmt
.
bindString
(
7
,
bust
);
}
String
weight
=
entity
.
getWeight
();
if
(
weight
!=
null
)
{
stmt
.
bindString
(
8
,
weight
);
}
String
chestWidth
=
entity
.
getChestWidth
();
...
...
@@ -170,34 +174,34 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
stmt
.
bindString
(
13
,
guanWei
);
}
String
weight
=
entity
.
getWeight
();
if
(
weight
!=
null
)
{
stmt
.
bindString
(
14
,
weight
);
String
eyeMuscleArea
=
entity
.
getEyeMuscleArea
();
if
(
eyeMuscleArea
!=
null
)
{
stmt
.
bindString
(
14
,
eyeMuscleArea
);
}
String
grade
=
entity
.
getGrade
();
if
(
grade
!=
null
)
{
stmt
.
bindString
(
15
,
grade
);
}
String
hairLength
=
entity
.
getHairLength
();
if
(
hairLength
!=
null
)
{
stmt
.
bindString
(
1
5
,
hairLength
);
stmt
.
bindString
(
1
6
,
hairLength
);
}
String
hairFineness
=
entity
.
getHairFineness
();
if
(
hairFineness
!=
null
)
{
stmt
.
bindString
(
1
6
,
hairFineness
);
stmt
.
bindString
(
1
7
,
hairFineness
);
}
String
shearing
=
entity
.
getShearing
();
if
(
shearing
!=
null
)
{
stmt
.
bindString
(
1
7
,
shearing
);
stmt
.
bindString
(
1
8
,
shearing
);
}
String
backWidth
=
entity
.
getBackWidth
();
if
(
backWidth
!=
null
)
{
stmt
.
bindString
(
18
,
backWidth
);
}
String
eyeMuscleArea
=
entity
.
getEyeMuscleArea
();
if
(
eyeMuscleArea
!=
null
)
{
stmt
.
bindString
(
19
,
eyeMuscleArea
);
stmt
.
bindString
(
19
,
backWidth
);
}
String
breedRes
=
entity
.
getBreedRes
();
...
...
@@ -215,39 +219,39 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
stmt
.
bindString
(
22
,
immune
);
}
String
updateId
=
entity
.
getUpdateId
();
if
(
updateId
!=
null
)
{
stmt
.
bindString
(
23
,
updateId
);
String
deptId
=
entity
.
getDeptId
();
if
(
deptId
!=
null
)
{
stmt
.
bindString
(
23
,
deptId
);
}
String
searchValue
=
entity
.
getSearchValue
();
if
(
searchValue
!=
null
)
{
stmt
.
bindString
(
24
,
searchValue
);
}
String
createBy
=
entity
.
getCreateBy
();
if
(
createBy
!=
null
)
{
stmt
.
bindString
(
2
4
,
createBy
);
stmt
.
bindString
(
2
5
,
createBy
);
}
String
createTime
=
entity
.
getCreateTime
();
if
(
createTime
!=
null
)
{
stmt
.
bindString
(
2
5
,
createTime
);
stmt
.
bindString
(
2
6
,
createTime
);
}
String
updateBy
=
entity
.
getUpdateBy
();
if
(
updateBy
!=
null
)
{
stmt
.
bindString
(
2
6
,
updateBy
);
stmt
.
bindString
(
2
7
,
updateBy
);
}
String
updateTime
=
entity
.
getUpdateTime
();
if
(
updateTime
!=
null
)
{
stmt
.
bindString
(
27
,
updateTime
);
}
String
permissions
=
entity
.
getPermissions
();
if
(
permissions
!=
null
)
{
stmt
.
bindString
(
28
,
permissions
);
stmt
.
bindString
(
28
,
updateTime
);
}
String
inputTime
=
entity
.
getInputTime
();
if
(
inputTime
!=
null
)
{
stmt
.
bindString
(
29
,
inputTime
);
String
remark
=
entity
.
getRemark
();
if
(
remark
!=
null
)
{
stmt
.
bindString
(
29
,
remark
);
}
}
...
...
@@ -255,40 +259,44 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
protected
final
void
bindValues
(
SQLiteStatement
stmt
,
PerformanceEntity
entity
)
{
stmt
.
clearBindings
();
Long
id
=
entity
.
getI
d
();
if
(
id
!=
null
)
{
stmt
.
bind
Long
(
1
,
id
);
String
unid
=
entity
.
getUni
d
();
if
(
un
id
!=
null
)
{
stmt
.
bind
String
(
1
,
un
id
);
}
stmt
.
bindLong
(
2
,
entity
.
getUnid
());
String
registrationNo
=
entity
.
getRegistrationNo
();
if
(
registrationNo
!=
null
)
{
stmt
.
bindString
(
3
,
registrationNo
);
String
cattleresumeId
=
entity
.
getCattleresumeId
();
if
(
cattleresumeId
!=
null
)
{
stmt
.
bindString
(
2
,
cattleresumeId
);
}
String
age
=
entity
.
getAge
();
if
(
age
!=
null
)
{
stmt
.
bindString
(
4
,
age
);
stmt
.
bindString
(
3
,
age
);
}
String
measureDate
=
entity
.
getMeasureDate
();
if
(
measureDate
!=
null
)
{
stmt
.
bindString
(
5
,
measureDate
);
stmt
.
bindString
(
4
,
measureDate
);
}
String
height
=
entity
.
getHeight
();
if
(
height
!=
null
)
{
stmt
.
bindString
(
6
,
height
);
stmt
.
bindString
(
5
,
height
);
}
String
length
=
entity
.
getLength
();
if
(
length
!=
null
)
{
stmt
.
bindString
(
7
,
length
);
stmt
.
bindString
(
6
,
length
);
}
String
bust
=
entity
.
getBust
();
if
(
bust
!=
null
)
{
stmt
.
bindString
(
8
,
bust
);
stmt
.
bindString
(
7
,
bust
);
}
String
weight
=
entity
.
getWeight
();
if
(
weight
!=
null
)
{
stmt
.
bindString
(
8
,
weight
);
}
String
chestWidth
=
entity
.
getChestWidth
();
...
...
@@ -316,34 +324,34 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
stmt
.
bindString
(
13
,
guanWei
);
}
String
weight
=
entity
.
getWeight
();
if
(
weight
!=
null
)
{
stmt
.
bindString
(
14
,
weight
);
String
eyeMuscleArea
=
entity
.
getEyeMuscleArea
();
if
(
eyeMuscleArea
!=
null
)
{
stmt
.
bindString
(
14
,
eyeMuscleArea
);
}
String
grade
=
entity
.
getGrade
();
if
(
grade
!=
null
)
{
stmt
.
bindString
(
15
,
grade
);
}
String
hairLength
=
entity
.
getHairLength
();
if
(
hairLength
!=
null
)
{
stmt
.
bindString
(
1
5
,
hairLength
);
stmt
.
bindString
(
1
6
,
hairLength
);
}
String
hairFineness
=
entity
.
getHairFineness
();
if
(
hairFineness
!=
null
)
{
stmt
.
bindString
(
1
6
,
hairFineness
);
stmt
.
bindString
(
1
7
,
hairFineness
);
}
String
shearing
=
entity
.
getShearing
();
if
(
shearing
!=
null
)
{
stmt
.
bindString
(
1
7
,
shearing
);
stmt
.
bindString
(
1
8
,
shearing
);
}
String
backWidth
=
entity
.
getBackWidth
();
if
(
backWidth
!=
null
)
{
stmt
.
bindString
(
18
,
backWidth
);
}
String
eyeMuscleArea
=
entity
.
getEyeMuscleArea
();
if
(
eyeMuscleArea
!=
null
)
{
stmt
.
bindString
(
19
,
eyeMuscleArea
);
stmt
.
bindString
(
19
,
backWidth
);
}
String
breedRes
=
entity
.
getBreedRes
();
...
...
@@ -361,134 +369,131 @@ public class PerformanceEntityDao extends AbstractDao<PerformanceEntity, Long> {
stmt
.
bindString
(
22
,
immune
);
}
String
updateId
=
entity
.
getUpdateId
();
if
(
updateId
!=
null
)
{
stmt
.
bindString
(
23
,
updateId
);
String
deptId
=
entity
.
getDeptId
();
if
(
deptId
!=
null
)
{
stmt
.
bindString
(
23
,
deptId
);
}
String
searchValue
=
entity
.
getSearchValue
();
if
(
searchValue
!=
null
)
{
stmt
.
bindString
(
24
,
searchValue
);
}
String
createBy
=
entity
.
getCreateBy
();
if
(
createBy
!=
null
)
{
stmt
.
bindString
(
2
4
,
createBy
);
stmt
.
bindString
(
2
5
,
createBy
);
}
String
createTime
=
entity
.
getCreateTime
();
if
(
createTime
!=
null
)
{
stmt
.
bindString
(
2
5
,
createTime
);
stmt
.
bindString
(
2
6
,
createTime
);
}
String
updateBy
=
entity
.
getUpdateBy
();
if
(
updateBy
!=
null
)
{
stmt
.
bindString
(
2
6
,
updateBy
);
stmt
.
bindString
(
2
7
,
updateBy
);
}
String
updateTime
=
entity
.
getUpdateTime
();
if
(
updateTime
!=
null
)
{
stmt
.
bindString
(
2
7
,
updateTime
);
stmt
.
bindString
(
2
8
,
updateTime
);
}
String
permissions
=
entity
.
getPermissions
();
if
(
permissions
!=
null
)
{
stmt
.
bindString
(
28
,
permissions
);
}
String
inputTime
=
entity
.
getInputTime
();
if
(
inputTime
!=
null
)
{
stmt
.
bindString
(
29
,
inputTime
);
String
remark
=
entity
.
getRemark
();
if
(
remark
!=
null
)
{
stmt
.
bindString
(
29
,
remark
);
}
}
@Override
public
Long
readKey
(
Cursor
cursor
,
int
offset
)
{
return
cursor
.
getLong
(
offset
+
1
)
;
public
Void
readKey
(
Cursor
cursor
,
int
offset
)
{
return
null
;
}
@Override
public
PerformanceEntity
readEntity
(
Cursor
cursor
,
int
offset
)
{
PerformanceEntity
entity
=
new
PerformanceEntity
(
//
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
get
Long
(
offset
+
0
),
//
id
cursor
.
getLong
(
offset
+
1
),
// uni
d
cursor
.
isNull
(
offset
+
2
)
?
null
:
cursor
.
getString
(
offset
+
2
),
//
registrationNo
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getString
(
offset
+
3
),
//
ag
e
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
),
//
measureDate
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
),
//
height
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
),
//
length
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
),
//
bus
t
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
get
String
(
offset
+
0
),
// un
id
cursor
.
isNull
(
offset
+
1
)
?
null
:
cursor
.
getString
(
offset
+
1
),
// cattleresumeI
d
cursor
.
isNull
(
offset
+
2
)
?
null
:
cursor
.
getString
(
offset
+
2
),
//
age
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getString
(
offset
+
3
),
//
measureDat
e
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
),
//
height
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
),
//
length
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
),
//
bust
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
),
//
weigh
t
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
),
// chestWidth
cursor
.
isNull
(
offset
+
9
)
?
null
:
cursor
.
getString
(
offset
+
9
),
// chestDeep
cursor
.
isNull
(
offset
+
10
)
?
null
:
cursor
.
getString
(
offset
+
10
),
// waistWidth
cursor
.
isNull
(
offset
+
11
)
?
null
:
cursor
.
getString
(
offset
+
11
),
// crossWidth
cursor
.
isNull
(
offset
+
12
)
?
null
:
cursor
.
getString
(
offset
+
12
),
// guanWei
cursor
.
isNull
(
offset
+
13
)
?
null
:
cursor
.
getString
(
offset
+
13
),
//
weight
cursor
.
isNull
(
offset
+
14
)
?
null
:
cursor
.
getString
(
offset
+
14
),
//
hairLength
cursor
.
isNull
(
offset
+
15
)
?
null
:
cursor
.
getString
(
offset
+
15
),
// hair
Fineness
cursor
.
isNull
(
offset
+
16
)
?
null
:
cursor
.
getString
(
offset
+
16
),
//
shearing
cursor
.
isNull
(
offset
+
17
)
?
null
:
cursor
.
getString
(
offset
+
17
),
//
backWidth
cursor
.
isNull
(
offset
+
18
)
?
null
:
cursor
.
getString
(
offset
+
18
),
//
eyeMuscleArea
cursor
.
isNull
(
offset
+
13
)
?
null
:
cursor
.
getString
(
offset
+
13
),
//
eyeMuscleArea
cursor
.
isNull
(
offset
+
14
)
?
null
:
cursor
.
getString
(
offset
+
14
),
//
grade
cursor
.
isNull
(
offset
+
15
)
?
null
:
cursor
.
getString
(
offset
+
15
),
// hair
Length
cursor
.
isNull
(
offset
+
16
)
?
null
:
cursor
.
getString
(
offset
+
16
),
//
hairFineness
cursor
.
isNull
(
offset
+
17
)
?
null
:
cursor
.
getString
(
offset
+
17
),
//
shearing
cursor
.
isNull
(
offset
+
18
)
?
null
:
cursor
.
getString
(
offset
+
18
),
//
backWidth
cursor
.
isNull
(
offset
+
19
)
?
null
:
cursor
.
getString
(
offset
+
19
),
// breedRes
cursor
.
isNull
(
offset
+
20
)
?
null
:
cursor
.
getString
(
offset
+
20
),
// health
cursor
.
isNull
(
offset
+
21
)
?
null
:
cursor
.
getString
(
offset
+
21
),
// immune
cursor
.
isNull
(
offset
+
22
)
?
null
:
cursor
.
getString
(
offset
+
22
),
//
update
Id
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
),
//
createBy
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
),
// create
Time
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
),
//
updateBy
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
),
// update
Time
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
),
//
permissions
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
)
//
inputTime
cursor
.
isNull
(
offset
+
22
)
?
null
:
cursor
.
getString
(
offset
+
22
),
//
dept
Id
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
),
//
searchValue
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
),
// create
By
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
),
//
createTime
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
),
// update
By
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
),
//
updateTime
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
)
//
remark
);
return
entity
;
}
@Override
public
void
readEntity
(
Cursor
cursor
,
PerformanceEntity
entity
,
int
offset
)
{
entity
.
set
Id
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLo
ng
(
offset
+
0
));
entity
.
set
Unid
(
cursor
.
getLo
ng
(
offset
+
1
));
entity
.
set
RegistrationNo
(
cursor
.
isNull
(
offset
+
2
)
?
null
:
cursor
.
getString
(
offset
+
2
));
entity
.
set
Ag
e
(
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getString
(
offset
+
3
));
entity
.
set
MeasureDate
(
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
));
entity
.
set
Height
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
));
entity
.
set
Length
(
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
));
entity
.
set
Bus
t
(
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
));
entity
.
set
Unid
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getStri
ng
(
offset
+
0
));
entity
.
set
CattleresumeId
(
cursor
.
isNull
(
offset
+
1
)
?
null
:
cursor
.
getStri
ng
(
offset
+
1
));
entity
.
set
Age
(
cursor
.
isNull
(
offset
+
2
)
?
null
:
cursor
.
getString
(
offset
+
2
));
entity
.
set
MeasureDat
e
(
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getString
(
offset
+
3
));
entity
.
set
Height
(
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
));
entity
.
set
Length
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
));
entity
.
set
Bust
(
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
));
entity
.
set
Weigh
t
(
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
));
entity
.
setChestWidth
(
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
));
entity
.
setChestDeep
(
cursor
.
isNull
(
offset
+
9
)
?
null
:
cursor
.
getString
(
offset
+
9
));
entity
.
setWaistWidth
(
cursor
.
isNull
(
offset
+
10
)
?
null
:
cursor
.
getString
(
offset
+
10
));
entity
.
setCrossWidth
(
cursor
.
isNull
(
offset
+
11
)
?
null
:
cursor
.
getString
(
offset
+
11
));
entity
.
setGuanWei
(
cursor
.
isNull
(
offset
+
12
)
?
null
:
cursor
.
getString
(
offset
+
12
));
entity
.
set
Weight
(
cursor
.
isNull
(
offset
+
13
)
?
null
:
cursor
.
getString
(
offset
+
13
));
entity
.
set
HairLength
(
cursor
.
isNull
(
offset
+
14
)
?
null
:
cursor
.
getString
(
offset
+
14
));
entity
.
setHair
Fineness
(
cursor
.
isNull
(
offset
+
15
)
?
null
:
cursor
.
getString
(
offset
+
15
));
entity
.
set
Shearing
(
cursor
.
isNull
(
offset
+
16
)
?
null
:
cursor
.
getString
(
offset
+
16
));
entity
.
set
BackWidth
(
cursor
.
isNull
(
offset
+
17
)
?
null
:
cursor
.
getString
(
offset
+
17
));
entity
.
set
EyeMuscleArea
(
cursor
.
isNull
(
offset
+
18
)
?
null
:
cursor
.
getString
(
offset
+
18
));
entity
.
set
EyeMuscleArea
(
cursor
.
isNull
(
offset
+
13
)
?
null
:
cursor
.
getString
(
offset
+
13
));
entity
.
set
Grade
(
cursor
.
isNull
(
offset
+
14
)
?
null
:
cursor
.
getString
(
offset
+
14
));
entity
.
setHair
Length
(
cursor
.
isNull
(
offset
+
15
)
?
null
:
cursor
.
getString
(
offset
+
15
));
entity
.
set
HairFineness
(
cursor
.
isNull
(
offset
+
16
)
?
null
:
cursor
.
getString
(
offset
+
16
));
entity
.
set
Shearing
(
cursor
.
isNull
(
offset
+
17
)
?
null
:
cursor
.
getString
(
offset
+
17
));
entity
.
set
BackWidth
(
cursor
.
isNull
(
offset
+
18
)
?
null
:
cursor
.
getString
(
offset
+
18
));
entity
.
setBreedRes
(
cursor
.
isNull
(
offset
+
19
)
?
null
:
cursor
.
getString
(
offset
+
19
));
entity
.
setHealth
(
cursor
.
isNull
(
offset
+
20
)
?
null
:
cursor
.
getString
(
offset
+
20
));
entity
.
setImmune
(
cursor
.
isNull
(
offset
+
21
)
?
null
:
cursor
.
getString
(
offset
+
21
));
entity
.
set
Update
Id
(
cursor
.
isNull
(
offset
+
22
)
?
null
:
cursor
.
getString
(
offset
+
22
));
entity
.
set
CreateBy
(
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
));
entity
.
setCreate
Time
(
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
));
entity
.
set
UpdateBy
(
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
));
entity
.
setUpdate
Time
(
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
));
entity
.
set
Permissions
(
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
));
entity
.
set
InputTime
(
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
));
entity
.
set
Dept
Id
(
cursor
.
isNull
(
offset
+
22
)
?
null
:
cursor
.
getString
(
offset
+
22
));
entity
.
set
SearchValue
(
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
));
entity
.
setCreate
By
(
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
));
entity
.
set
CreateTime
(
cursor
.
isNull
(
offset
+
25
)
?
null
:
cursor
.
getString
(
offset
+
25
));
entity
.
setUpdate
By
(
cursor
.
isNull
(
offset
+
26
)
?
null
:
cursor
.
getString
(
offset
+
26
));
entity
.
set
UpdateTime
(
cursor
.
isNull
(
offset
+
27
)
?
null
:
cursor
.
getString
(
offset
+
27
));
entity
.
set
Remark
(
cursor
.
isNull
(
offset
+
28
)
?
null
:
cursor
.
getString
(
offset
+
28
));
}
@Override
protected
final
Long
updateKeyAfterInsert
(
PerformanceEntity
entity
,
long
rowId
)
{
entity
.
setUnid
(
rowId
);
return
rowId
;
protected
final
Void
updateKeyAfterInsert
(
PerformanceEntity
entity
,
long
rowId
)
{
// Unsupported or missing PK type
return
null
;
}
@Override
public
Long
getKey
(
PerformanceEntity
entity
)
{
if
(
entity
!=
null
)
{
return
entity
.
getUnid
();
}
else
{
public
Void
getKey
(
PerformanceEntity
entity
)
{
return
null
;
}
}
@Override
public
boolean
hasKey
(
PerformanceEntity
entity
)
{
throw
new
UnsupportedOperationException
(
"Unsupported for entities with a non-null key"
);
// TODO
return
false
;
}
@Override
...
...
app/src/main/java/com/phlx/anchorcollect/entity/CattleResumeEntity.java
View file @
199e5b54
...
...
@@ -93,6 +93,12 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
/** 部门id */
private
String
deptId
;
/** 是否上传 0未上传,1已上传 */
private
String
uploadStatus
;
/** 更新时间 */
private
String
uploadTime
;
/** 创建者 */
private
String
createBy
;
...
...
@@ -109,6 +115,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
/** 备注 */
private
String
remark
;
public
CattleResumeEntity
()
{
}
protected
CattleResumeEntity
(
Parcel
in
)
{
unid
=
in
.
readString
();
registrationNo
=
in
.
readString
();
...
...
@@ -134,6 +143,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
isOut
=
in
.
readString
();
inputTime
=
in
.
readString
();
deptId
=
in
.
readString
();
uploadStatus
=
in
.
readString
();
uploadTime
=
in
.
readString
();
createBy
=
in
.
readString
();
createTime
=
in
.
readString
();
updateBy
=
in
.
readString
();
...
...
@@ -141,13 +152,14 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
remark
=
in
.
readString
();
}
@Generated
(
hash
=
7663625
0
)
@Generated
(
hash
=
182316720
0
)
public
CattleResumeEntity
(
String
unid
,
String
registrationNo
,
String
individualNo
,
String
circleNo
,
String
raiseType
,
String
raiseVarieties
,
String
birthdate
,
String
birthHeavy
,
String
sex
,
String
birthDifficulty
,
String
isTwins
,
String
childTime
,
String
grade
,
String
fatherReg
,
String
motherReg
,
String
fromMilkHeavy
,
String
health
,
String
junHeavy
,
String
decAppScore
,
String
photo
,
String
status
,
String
isOut
,
String
inputTime
,
String
deptId
,
String
createBy
,
String
createTime
,
String
updateBy
,
String
updateTime
,
String
remark
)
{
String
photo
,
String
status
,
String
isOut
,
String
inputTime
,
String
deptId
,
String
uploadStatus
,
String
uploadTime
,
String
createBy
,
String
createTime
,
String
updateBy
,
String
updateTime
,
String
remark
)
{
this
.
unid
=
unid
;
this
.
registrationNo
=
registrationNo
;
this
.
individualNo
=
individualNo
;
...
...
@@ -172,6 +184,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this
.
isOut
=
isOut
;
this
.
inputTime
=
inputTime
;
this
.
deptId
=
deptId
;
this
.
uploadStatus
=
uploadStatus
;
this
.
uploadTime
=
uploadTime
;
this
.
createBy
=
createBy
;
this
.
createTime
=
createTime
;
this
.
updateBy
=
updateBy
;
...
...
@@ -179,10 +193,6 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this
.
remark
=
remark
;
}
@Generated
(
hash
=
927352725
)
public
CattleResumeEntity
()
{
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
unid
);
...
...
@@ -209,6 +219,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
dest
.
writeString
(
isOut
);
dest
.
writeString
(
inputTime
);
dest
.
writeString
(
deptId
);
dest
.
writeString
(
uploadStatus
);
dest
.
writeString
(
uploadTime
);
dest
.
writeString
(
createBy
);
dest
.
writeString
(
createTime
);
dest
.
writeString
(
updateBy
);
...
...
@@ -425,6 +437,22 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this
.
deptId
=
deptId
;
}
public
String
getUploadStatus
()
{
return
uploadStatus
;
}
public
void
setUploadStatus
(
String
uploadStatus
)
{
this
.
uploadStatus
=
uploadStatus
;
}
public
String
getUploadTime
()
{
return
uploadTime
;
}
public
void
setUploadTime
(
String
uploadTime
)
{
this
.
uploadTime
=
uploadTime
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
...
...
@@ -492,6 +520,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
", isOut='"
+
isOut
+
'\''
+
", inputTime='"
+
inputTime
+
'\''
+
", deptId='"
+
deptId
+
'\''
+
", uploadStatus='"
+
uploadStatus
+
'\''
+
", uploadTime='"
+
uploadTime
+
'\''
+
", createBy='"
+
createBy
+
'\''
+
", createTime='"
+
createTime
+
'\''
+
", updateBy='"
+
updateBy
+
'\''
+
...
...
app/src/main/java/com/phlx/anchorcollect/entity/DictEntity.java
View file @
199e5b54
...
...
@@ -5,39 +5,118 @@ import android.os.Parcelable;
import
androidx.databinding.BaseObservable
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Id
;
import
org.greenrobot.greendao.annotation.Generated
;
/**
* 字典项
*/
@Entity
public
class
DictEntity
extends
BaseObservable
implements
Parcelable
{
private
String
id
;
private
String
name
;
private
String
value
;
private
String
type
;
private
static
final
long
serialVersionUID
=
1L
;
/** 字典编码 */
@Id
(
autoincrement
=
false
)
private
String
dictCode
;
/** 字典排序 */
private
String
dictSort
;
/** 字典标签 */
private
String
dictLabel
;
/** 字典键值 */
private
String
dictValue
;
/** 字典类型 */
private
String
dictType
;
/** 样式属性(其他样式扩展) */
private
String
cssClass
;
/** 表格字典样式 */
private
String
listClass
;
/** 是否默认(Y是 N否) */
private
String
isDefault
;
/** 状态(0正常 1停用) */
private
String
status
;
/** 创建者 */
private
String
createBy
;
/** 创建时间 */
private
String
createTime
;
/** 更新者 */
private
String
updateBy
;
/** 更新时间 */
private
String
updateTime
;
/** 备注 */
private
String
remark
;
public
DictEntity
()
{
}
public
DictEntity
(
String
id
,
String
name
,
String
value
,
String
type
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
value
=
value
;
this
.
type
=
type
;
protected
DictEntity
(
Parcel
in
)
{
dictCode
=
in
.
readString
();
dictSort
=
in
.
readString
();
dictLabel
=
in
.
readString
();
dictValue
=
in
.
readString
();
dictType
=
in
.
readString
();
cssClass
=
in
.
readString
();
listClass
=
in
.
readString
();
isDefault
=
in
.
readString
();
status
=
in
.
readString
();
createBy
=
in
.
readString
();
createTime
=
in
.
readString
();
updateBy
=
in
.
readString
();
updateTime
=
in
.
readString
();
remark
=
in
.
readString
();
}
protected
DictEntity
(
Parcel
in
)
{
id
=
in
.
readString
();
name
=
in
.
readString
();
value
=
in
.
readString
();
type
=
in
.
readString
();
@Generated
(
hash
=
517044936
)
public
DictEntity
(
String
dictCode
,
String
dictSort
,
String
dictLabel
,
String
dictValue
,
String
dictType
,
String
cssClass
,
String
listClass
,
String
isDefault
,
String
status
,
String
createBy
,
String
createTime
,
String
updateBy
,
String
updateTime
,
String
remark
)
{
this
.
dictCode
=
dictCode
;
this
.
dictSort
=
dictSort
;
this
.
dictLabel
=
dictLabel
;
this
.
dictValue
=
dictValue
;
this
.
dictType
=
dictType
;
this
.
cssClass
=
cssClass
;
this
.
listClass
=
listClass
;
this
.
isDefault
=
isDefault
;
this
.
status
=
status
;
this
.
createBy
=
createBy
;
this
.
createTime
=
createTime
;
this
.
updateBy
=
updateBy
;
this
.
updateTime
=
updateTime
;
this
.
remark
=
remark
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
id
);
dest
.
writeString
(
name
);
dest
.
writeString
(
value
);
dest
.
writeString
(
type
);
dest
.
writeString
(
dictCode
);
dest
.
writeString
(
dictSort
);
dest
.
writeString
(
dictLabel
);
dest
.
writeString
(
dictValue
);
dest
.
writeString
(
dictType
);
dest
.
writeString
(
cssClass
);
dest
.
writeString
(
listClass
);
dest
.
writeString
(
isDefault
);
dest
.
writeString
(
status
);
dest
.
writeString
(
createBy
);
dest
.
writeString
(
createTime
);
dest
.
writeString
(
updateBy
);
dest
.
writeString
(
updateTime
);
dest
.
writeString
(
remark
);
}
@Override
...
...
@@ -57,35 +136,135 @@ public class DictEntity extends BaseObservable implements Parcelable {
}
};
public
String
getId
()
{
return
id
;
public
String
getDictCode
()
{
return
dictCode
;
}
public
void
setDictCode
(
String
dictCode
)
{
this
.
dictCode
=
dictCode
;
}
public
String
getDictSort
()
{
return
dictSort
;
}
public
void
setDictSort
(
String
dictSort
)
{
this
.
dictSort
=
dictSort
;
}
public
String
getDictLabel
()
{
return
dictLabel
;
}
public
void
setDictLabel
(
String
dictLabel
)
{
this
.
dictLabel
=
dictLabel
;
}
public
String
getDictValue
()
{
return
dictValue
;
}
public
void
setDictValue
(
String
dictValue
)
{
this
.
dictValue
=
dictValue
;
}
public
String
getDictType
()
{
return
dictType
;
}
public
void
setDictType
(
String
dictType
)
{
this
.
dictType
=
dictType
;
}
public
String
getCssClass
()
{
return
cssClass
;
}
public
void
setCssClass
(
String
cssClass
)
{
this
.
cssClass
=
cssClass
;
}
public
String
getListClass
()
{
return
listClass
;
}
public
void
setListClass
(
String
listClass
)
{
this
.
listClass
=
listClass
;
}
public
String
getIsDefault
()
{
return
isDefault
;
}
public
void
setI
d
(
String
id
)
{
this
.
i
d
=
id
;
public
void
setI
sDefault
(
String
isDefault
)
{
this
.
i
sDefault
=
isDefault
;
}
public
String
get
Name
()
{
return
name
;
public
String
get
Status
()
{
return
status
;
}
public
void
set
Name
(
String
name
)
{
this
.
name
=
name
;
public
void
set
Status
(
String
status
)
{
this
.
status
=
status
;
}
public
String
get
Value
()
{
return
value
;
public
String
get
CreateBy
()
{
return
createBy
;
}
public
void
set
Value
(
String
value
)
{
this
.
value
=
value
;
public
void
set
CreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
String
get
Typ
e
()
{
return
typ
e
;
public
String
get
CreateTim
e
()
{
return
createTim
e
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
public
void
setCreateTime
(
String
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
public
String
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
String
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
@Override
public
String
toString
()
{
return
"DictEntity{"
+
"dictCode='"
+
dictCode
+
'\''
+
", dictSort='"
+
dictSort
+
'\''
+
", dictLabel='"
+
dictLabel
+
'\''
+
", dictValue='"
+
dictValue
+
'\''
+
", dictType='"
+
dictType
+
'\''
+
", cssClass='"
+
cssClass
+
'\''
+
", listClass='"
+
listClass
+
'\''
+
", isDefault='"
+
isDefault
+
'\''
+
", status='"
+
status
+
'\''
+
", createBy='"
+
createBy
+
'\''
+
", createTime='"
+
createTime
+
'\''
+
", updateBy='"
+
updateBy
+
'\''
+
", updateTime='"
+
updateTime
+
'\''
+
", remark='"
+
remark
+
'\''
+
'}'
;
}
}
app/src/main/java/com/phlx/anchorcollect/entity/PerformanceEntity.java
View file @
199e5b54
...
...
@@ -15,243 +15,246 @@ import org.greenrobot.greendao.annotation.Id;
* 时间 : 2018/12/3 12 : 05
*/
@Entity
public
class
PerformanceEntity
extends
BaseObservable
implements
Parcelable
{
//主键
private
Long
id
;
public
class
PerformanceEntity
extends
BaseObservable
implements
Parcelable
{
/**
* unid
*/
@Id
(
autoincrement
=
false
)
private
long
unid
;
private
String
unid
;
/**
*
登记号
*
基本信息ID
*/
private
String
registrationNo
;
private
String
cattleresumeId
;
/**
* 年龄
*/
private
String
age
;
/**
* 测量日期
*/
private
String
measureDate
;
/**
* 体高(cm)
*/
private
String
height
;
/**
* 体长(cm)
*/
private
String
length
;
/**
* 胸围(cm)
*/
private
String
bust
;
/**
* 体重
*/
private
String
weight
;
/**
* 胸宽(cm)
*/
private
String
chestWidth
;
/**
* 胸深(cm)
*/
private
String
chestDeep
;
/**
* 腰角宽(cm)
*/
private
String
waistWidth
;
/**
* 十字部宽(cm)
*/
private
String
crossWidth
;
/**
* 管维(cm)
*/
private
String
guanWei
;
/**
*
体重
*
眼肌面积
*/
private
String
weight
;
private
String
eyeMuscleArea
;
/**
* 等级
*/
private
String
grade
;
/**
* 羊毛长度(cm)
*/
private
String
hairLength
;
/**
* 羊毛细度(微米)
*/
private
String
hairFineness
;
/**
* 剪毛量(kg)
*/
private
String
shearing
;
/**
* 背腰宽
*/
private
String
backWidth
;
/**
* 眼肌面积
*/
private
String
eyeMuscleArea
;
/**
* 繁殖成绩
*/
private
String
breedRes
;
/**
* 健康状况
*/
private
String
health
;
/**
* 免疫情况
*/
private
String
immune
;
/**
* 更新状态
*/
private
String
updateId
;
/**
* 创建者
* 部门id
*/
private
String
deptId
;
/** 搜索值 */
private
String
searchValue
;
/** 创建者 */
private
String
createBy
;
/**
* 创建时间
*/
/** 创建时间 */
private
String
createTime
;
/**
* 更新者
*/
/** 更新者 */
private
String
updateBy
;
/**
* 更新时间
*/
/** 更新时间 */
private
String
updateTime
;
/**
* 权限标识
*/
private
String
permissions
;
/**
* 从服务器接收,时间戳,终端需要上传给服务器,
*/
private
String
inputTime
;
/** 备注 */
private
String
remark
;
public
PerformanceEntity
()
{
public
PerformanceEntity
()
{
}
protected
PerformanceEntity
(
Parcel
in
)
{
if
(
in
.
readByte
()
==
0
)
{
id
=
null
;
}
else
{
id
=
in
.
readLong
();
}
unid
=
in
.
readLong
();
registrationNo
=
in
.
readString
();
unid
=
in
.
readString
();
cattleresumeId
=
in
.
readString
();
age
=
in
.
readString
();
measureDate
=
in
.
readString
();
height
=
in
.
readString
();
length
=
in
.
readString
();
bust
=
in
.
readString
();
weight
=
in
.
readString
();
chestWidth
=
in
.
readString
();
chestDeep
=
in
.
readString
();
waistWidth
=
in
.
readString
();
crossWidth
=
in
.
readString
();
guanWei
=
in
.
readString
();
weight
=
in
.
readString
();
eyeMuscleArea
=
in
.
readString
();
grade
=
in
.
readString
();
hairLength
=
in
.
readString
();
hairFineness
=
in
.
readString
();
shearing
=
in
.
readString
();
backWidth
=
in
.
readString
();
eyeMuscleArea
=
in
.
readString
();
breedRes
=
in
.
readString
();
health
=
in
.
readString
();
immune
=
in
.
readString
();
updateId
=
in
.
readString
();
deptId
=
in
.
readString
();
searchValue
=
in
.
readString
();
createBy
=
in
.
readString
();
createTime
=
in
.
readString
();
updateBy
=
in
.
readString
();
updateTime
=
in
.
readString
();
permissions
=
in
.
readString
();
inputTime
=
in
.
readString
();
}
@Generated
(
hash
=
341047096
)
public
PerformanceEntity
(
Long
id
,
long
unid
,
String
registrationNo
,
String
age
,
String
measureDate
,
String
height
,
String
length
,
String
bust
,
String
chestWidth
,
String
chestDeep
,
String
waistWidth
,
String
crossWidth
,
String
guanWei
,
String
weight
,
String
hairLength
,
String
hairFineness
,
String
shearing
,
String
backWidth
,
String
eyeMuscleArea
,
String
breedRes
,
String
health
,
String
immune
,
String
updateId
,
String
createBy
,
String
createTime
,
String
updateBy
,
String
updateTime
,
String
permissions
,
String
inputTime
)
{
this
.
id
=
id
;
remark
=
in
.
readString
();
}
@Generated
(
hash
=
717472496
)
public
PerformanceEntity
(
String
unid
,
String
cattleresumeId
,
String
age
,
String
measureDate
,
String
height
,
String
length
,
String
bust
,
String
weight
,
String
chestWidth
,
String
chestDeep
,
String
waistWidth
,
String
crossWidth
,
String
guanWei
,
String
eyeMuscleArea
,
String
grade
,
String
hairLength
,
String
hairFineness
,
String
shearing
,
String
backWidth
,
String
breedRes
,
String
health
,
String
immune
,
String
deptId
,
String
searchValue
,
String
createBy
,
String
createTime
,
String
updateBy
,
String
updateTime
,
String
remark
)
{
this
.
unid
=
unid
;
this
.
registrationNo
=
registrationNo
;
this
.
cattleresumeId
=
cattleresumeId
;
this
.
age
=
age
;
this
.
measureDate
=
measureDate
;
this
.
height
=
height
;
this
.
length
=
length
;
this
.
bust
=
bust
;
this
.
weight
=
weight
;
this
.
chestWidth
=
chestWidth
;
this
.
chestDeep
=
chestDeep
;
this
.
waistWidth
=
waistWidth
;
this
.
crossWidth
=
crossWidth
;
this
.
guanWei
=
guanWei
;
this
.
weight
=
weight
;
this
.
eyeMuscleArea
=
eyeMuscleArea
;
this
.
grade
=
grade
;
this
.
hairLength
=
hairLength
;
this
.
hairFineness
=
hairFineness
;
this
.
shearing
=
shearing
;
this
.
backWidth
=
backWidth
;
this
.
eyeMuscleArea
=
eyeMuscleArea
;
this
.
breedRes
=
breedRes
;
this
.
health
=
health
;
this
.
immune
=
immune
;
this
.
updateId
=
updateId
;
this
.
deptId
=
deptId
;
this
.
searchValue
=
searchValue
;
this
.
createBy
=
createBy
;
this
.
createTime
=
createTime
;
this
.
updateBy
=
updateBy
;
this
.
updateTime
=
updateTime
;
this
.
permissions
=
permissions
;
this
.
inputTime
=
inputTime
;
this
.
remark
=
remark
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
if
(
id
==
null
)
{
dest
.
writeByte
((
byte
)
0
);
}
else
{
dest
.
writeByte
((
byte
)
1
);
dest
.
writeLong
(
id
);
}
dest
.
writeLong
(
unid
);
dest
.
writeString
(
registrationNo
);
dest
.
writeString
(
unid
);
dest
.
writeString
(
cattleresumeId
);
dest
.
writeString
(
age
);
dest
.
writeString
(
measureDate
);
dest
.
writeString
(
height
);
dest
.
writeString
(
length
);
dest
.
writeString
(
bust
);
dest
.
writeString
(
weight
);
dest
.
writeString
(
chestWidth
);
dest
.
writeString
(
chestDeep
);
dest
.
writeString
(
waistWidth
);
dest
.
writeString
(
crossWidth
);
dest
.
writeString
(
guanWei
);
dest
.
writeString
(
weight
);
dest
.
writeString
(
eyeMuscleArea
);
dest
.
writeString
(
grade
);
dest
.
writeString
(
hairLength
);
dest
.
writeString
(
hairFineness
);
dest
.
writeString
(
shearing
);
dest
.
writeString
(
backWidth
);
dest
.
writeString
(
eyeMuscleArea
);
dest
.
writeString
(
breedRes
);
dest
.
writeString
(
health
);
dest
.
writeString
(
immune
);
dest
.
writeString
(
updateId
);
dest
.
writeString
(
deptId
);
dest
.
writeString
(
searchValue
);
dest
.
writeString
(
createBy
);
dest
.
writeString
(
createTime
);
dest
.
writeString
(
updateBy
);
dest
.
writeString
(
updateTime
);
dest
.
writeString
(
permissions
);
dest
.
writeString
(
inputTime
);
dest
.
writeString
(
remark
);
}
@Override
...
...
@@ -271,28 +274,20 @@ public class PerformanceEntity extends BaseObservable implements Parcelable
}
};
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
long
getUnid
()
{
public
String
getUnid
()
{
return
unid
;
}
public
void
setUnid
(
lo
ng
unid
)
{
public
void
setUnid
(
Stri
ng
unid
)
{
this
.
unid
=
unid
;
}
public
String
get
RegistrationNo
()
{
return
registrationNo
;
public
String
get
CattleresumeId
()
{
return
cattleresumeId
;
}
public
void
set
RegistrationNo
(
String
registrationNo
)
{
this
.
registrationNo
=
registrationNo
;
public
void
set
CattleresumeId
(
String
cattleresumeId
)
{
this
.
cattleresumeId
=
cattleresumeId
;
}
public
String
getAge
()
{
...
...
@@ -335,6 +330,14 @@ public class PerformanceEntity extends BaseObservable implements Parcelable
this
.
bust
=
bust
;
}
public
String
getWeight
()
{
return
weight
;
}
public
void
setWeight
(
String
weight
)
{
this
.
weight
=
weight
;
}
public
String
getChestWidth
()
{
return
chestWidth
;
}
...
...
@@ -375,12 +378,20 @@ public class PerformanceEntity extends BaseObservable implements Parcelable
this
.
guanWei
=
guanWei
;
}
public
String
get
Weight
()
{
return
weight
;
public
String
get
EyeMuscleArea
()
{
return
eyeMuscleArea
;
}
public
void
setWeight
(
String
weight
)
{
this
.
weight
=
weight
;
public
void
setEyeMuscleArea
(
String
eyeMuscleArea
)
{
this
.
eyeMuscleArea
=
eyeMuscleArea
;
}
public
String
getGrade
()
{
return
grade
;
}
public
void
setGrade
(
String
grade
)
{
this
.
grade
=
grade
;
}
public
String
getHairLength
()
{
...
...
@@ -415,14 +426,6 @@ public class PerformanceEntity extends BaseObservable implements Parcelable
this
.
backWidth
=
backWidth
;
}
public
String
getEyeMuscleArea
()
{
return
eyeMuscleArea
;
}
public
void
setEyeMuscleArea
(
String
eyeMuscleArea
)
{
this
.
eyeMuscleArea
=
eyeMuscleArea
;
}
public
String
getBreedRes
()
{
return
breedRes
;
}
...
...
@@ -447,12 +450,20 @@ public class PerformanceEntity extends BaseObservable implements Parcelable
this
.
immune
=
immune
;
}
public
String
getUpdateId
()
{
return
updateId
;
public
String
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
String
deptId
)
{
this
.
deptId
=
deptId
;
}
public
void
setUpdateId
(
String
updateId
)
{
this
.
updateId
=
updateId
;
public
String
getSearchValue
()
{
return
searchValue
;
}
public
void
setSearchValue
(
String
searchValue
)
{
this
.
searchValue
=
searchValue
;
}
public
String
getCreateBy
()
{
...
...
@@ -487,55 +498,46 @@ public class PerformanceEntity extends BaseObservable implements Parcelable
this
.
updateTime
=
updateTime
;
}
public
String
getPermissions
()
{
return
permissions
;
}
public
void
setPermissions
(
String
permissions
)
{
this
.
permissions
=
permissions
;
public
String
getRemark
()
{
return
remark
;
}
public
String
getInputTime
()
{
return
inputTime
;
}
public
void
setInputTime
(
String
inputTime
)
{
this
.
inputTime
=
inputTime
;
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"PerformanceEntity{"
+
"id="
+
id
+
", unid='"
+
unid
+
'\''
+
", registrationNo='"
+
registrationNo
+
'\''
+
"unid='"
+
unid
+
'\''
+
", cattleresumeId='"
+
cattleresumeId
+
'\''
+
", age='"
+
age
+
'\''
+
", measureDate='"
+
measureDate
+
'\''
+
", height='"
+
height
+
'\''
+
", length='"
+
length
+
'\''
+
", bust='"
+
bust
+
'\''
+
", weight='"
+
weight
+
'\''
+
", chestWidth='"
+
chestWidth
+
'\''
+
", chestDeep='"
+
chestDeep
+
'\''
+
", waistWidth='"
+
waistWidth
+
'\''
+
", crossWidth='"
+
crossWidth
+
'\''
+
", guanWei='"
+
guanWei
+
'\''
+
", weight='"
+
weight
+
'\''
+
", eyeMuscleArea='"
+
eyeMuscleArea
+
'\''
+
", grade='"
+
grade
+
'\''
+
", hairLength='"
+
hairLength
+
'\''
+
", hairFineness='"
+
hairFineness
+
'\''
+
", shearing='"
+
shearing
+
'\''
+
", backWidth='"
+
backWidth
+
'\''
+
", eyeMuscleArea='"
+
eyeMuscleArea
+
'\''
+
", breedRes='"
+
breedRes
+
'\''
+
", health='"
+
health
+
'\''
+
", immune='"
+
immune
+
'\''
+
", updateId='"
+
updateId
+
'\''
+
", deptId='"
+
deptId
+
'\''
+
", searchValue='"
+
searchValue
+
'\''
+
", createBy='"
+
createBy
+
'\''
+
", createTime='"
+
createTime
+
'\''
+
", updateBy='"
+
updateBy
+
'\''
+
", updateTime='"
+
updateTime
+
'\''
+
", permissions='"
+
permissions
+
'\''
+
", inputTime='"
+
inputTime
+
'\''
+
", remark='"
+
remark
+
'\''
+
'}'
;
}
}
app/src/main/java/com/phlx/anchorcollect/net/RetrofitClient.java
View file @
199e5b54
...
...
@@ -7,6 +7,7 @@ import androidx.databinding.library.baseAdapters.BuildConfig;
import
com.phlx.anchorcollect.Configs
;
import
com.phlx.anchorcollect.util.DeviceIdUtils
;
import
java.io.File
;
import
java.io.IOException
;
...
...
@@ -28,6 +29,7 @@ import me.goldze.mvvmhabit.utils.SPUtils;
import
me.goldze.mvvmhabit.utils.Utils
;
import
okhttp3.Cache
;
import
okhttp3.ConnectionPool
;
import
okhttp3.Headers
;
import
okhttp3.Interceptor
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
...
...
@@ -112,6 +114,8 @@ public class RetrofitClient {
Request
originalRequest
=
chain
.
request
();
Request
authorised
=
originalRequest
.
newBuilder
()
.
header
(
"token"
,
SPUtils
.
getInstance
().
getString
(
"token"
))
.
header
(
"imei"
,
DeviceIdUtils
.
getDeviceId
(
Utils
.
getContext
()))
.
header
(
"deptid"
,
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_DEPT_ID
))
.
build
();
return
chain
.
proceed
(
authorised
);
}
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/BasicsCollectFragment.java
View file @
199e5b54
...
...
@@ -37,6 +37,7 @@ import com.phlx.anchorcollect.Configs;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.data.VMFactory
;
import
com.phlx.anchorcollect.databinding.FragmentBasicsCollectBinding
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.entity.UIParamEntity
;
import
com.phlx.anchorcollect.ui.fragment.vm.BasicsCollectVM
;
...
...
@@ -45,11 +46,13 @@ import com.phlx.anchorcollect.ui.info.CattleActivity;
import
com.phlx.anchorcollect.util.DictUtils
;
import
com.phlx.anchorcollect.util.ImagePicker
;
import
com.phlx.anchorcollect.util.TextUtil
;
import
com.phlx.anchorcollect.widget.SpaceItemDecoration
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
io.reactivex.functions.Consumer
;
import
me.goldze.mvvmhabit.base.BaseFragment
;
...
...
@@ -100,6 +103,8 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
binding
.
tvWeighAdg
.
setTypeface
(
Configs
.
typeface
);
binding
.
tvWeighBwg
.
setTypeface
(
Configs
.
typeface
);
binding
.
rvCollect
.
addItemDecoration
(
new
SpaceItemDecoration
(
16
));
initTimePicker
();
}
...
...
@@ -112,9 +117,10 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
if
(
viewModel
.
currentParamEntity
!=
null
)
{
switch
(
viewModel
.
currentParamEntity
.
getHtmlType
())
{
case
"checkbox"
:
//TODO
//TODO
多选
break
;
case
"input"
:
case
"textarea"
:
showInputDialog
(
viewModel
.
currentParamEntity
);
break
;
case
"datetime"
:
...
...
@@ -166,6 +172,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
viewModel
.
onCattleClickEvent
.
observe
(
getActivity
(),
new
Observer
<
Boolean
>()
{
@Override
public
void
onChanged
(
Boolean
aBoolean
)
{
//TODO 修改验证方式
if
(
TextUtil
.
isSpace
(
viewModel
.
tag
.
get
()))
{
ToastUtils
.
showShort
(
"请先输入可视耳标号"
);
}
else
{
...
...
@@ -176,6 +183,20 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
}
});
viewModel
.
onNotifyAllEvent
.
observe
(
getActivity
(),
new
Observer
<
Boolean
>()
{
@Override
public
void
onChanged
(
Boolean
aBoolean
)
{
if
(
aBoolean
)
viewModel
.
clearParamList
();
for
(
GenTableColumn
gtc
:
viewModel
.
uiList
)
{
gtc
.
notifyChange
();
}
viewModel
.
remarkParamEntity
.
notifyChange
();
binding
.
rvCollect
.
getAdapter
().
notifyDataSetChanged
();
}
});
}
//选择框
...
...
@@ -191,7 +212,8 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
public
void
onSelection
(
MaterialDialog
dialog
,
View
view
,
int
which
,
CharSequence
text
)
{
Toast
.
makeText
(
getActivity
(),
which
+
":"
+
text
.
toString
(),
Toast
.
LENGTH_SHORT
).
show
();
viewModel
.
currentParamEntity
.
setShowName
(
text
.
toString
());
viewModel
.
currentParamEntity
.
setContent
(
text
.
toString
());
List
<
DictEntity
>
distTypeList
=
DictUtils
.
getDistList
(
uiParamEntity
.
getDictType
());
viewModel
.
currentParamEntity
.
setContent
(
distTypeList
.
get
(
which
).
getDictValue
());
viewModel
.
currentParamEntity
.
notifyChange
();
}
})
...
...
@@ -205,7 +227,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
if
(
uiParamEntity
.
getJavaType
().
equals
(
"Long"
)
||
uiParamEntity
.
getJavaType
().
equals
(
"Integer"
))
{
inputType
=
InputType
.
TYPE_CLASS_NUMBER
;
}
else
if
(
uiParamEntity
.
getJavaType
().
equals
(
"BigDecimal"
)
||
uiParamEntity
.
getJavaType
().
equals
(
"Duoble"
))
{
inputType
=
InputType
.
TYPE_
NUMBER_FLAG_DECIMAL
;
inputType
=
InputType
.
TYPE_
CLASS_NUMBER
|
InputType
.
TYPE_NUMBER_FLAG_DECIMAL
|
InputType
.
TYPE_NUMBER_FLAG_SIGNED
;
;
}
else
if
(
uiParamEntity
.
getJavaType
().
equals
(
"String"
))
{
inputType
=
InputType
.
TYPE_CLASS_TEXT
;
}
...
...
@@ -309,4 +331,6 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
}
}
}
}
app/src/main/java/com/phlx/anchorcollect/ui/fragment/CollectFragment.java
View file @
199e5b54
...
...
@@ -23,7 +23,6 @@ import com.bigkoo.pickerview.view.TimePickerView;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.kongzue.dialogx.DialogX
;
import
com.kongzue.dialogx.datepicker.DatePickerDialog
;
import
com.kongzue.dialogx.datepicker.interfaces.OnDateSelected
;
import
com.kongzue.dialogx.dialogs.BottomMenu
;
...
...
@@ -120,19 +119,19 @@ public class CollectFragment extends BaseFragment<FragmentColletBinding, Collect
viewModel
.
setCollectType
(
collectType
);
//根据不同的功能初始化右边控件列表
switch
(
collectType
)
{
case
Configs
.
FAMILY
_ARCHIVES
:
case
Configs
.
BASE
_ARCHIVES
:
initCardParamList
();
break
;
case
Configs
.
WEIGHTING_MANAG
E
:
case
Configs
.
SIGN_MEASUR
E
:
initWeightingParamList
();
break
;
case
Configs
.
SIGN_MEASURE
:
case
Configs
.
TREATMENT_RECORD
:
initSignParamList
();
break
;
case
Configs
.
HEALTH
_MANAGE
:
case
Configs
.
WEIGHTING
_MANAGE
:
initHealthParamList
();
break
;
case
Configs
.
IMMUN_
MANAGE
:
case
Configs
.
IMMUN_
RECORD
:
initImmunParamList
();
break
;
}
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/PerformanceFragment.java
0 → 100644
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
ui
.
fragment
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.ViewGroup
;
import
androidx.annotation.Nullable
;
import
androidx.lifecycle.ViewModelProviders
;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.data.VMFactory
;
import
com.phlx.anchorcollect.databinding.FragmentPerformanceBinding
;
import
com.phlx.anchorcollect.ui.fragment.vm.BasicsCollectVM
;
import
com.phlx.anchorcollect.ui.fragment.vm.PerformanceVM
;
import
com.phlx.anchorcollect.widget.SpaceItemDecoration
;
import
me.goldze.mvvmhabit.base.BaseFragment
;
import
me.tatarka.bindingcollectionadapter2.BR
;
public
class
PerformanceFragment
extends
BaseFragment
<
FragmentPerformanceBinding
,
PerformanceVM
>
{
@Override
public
int
initContentView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
return
R
.
layout
.
fragment_performance
;
}
@Override
public
int
initVariableId
()
{
return
BR
.
viewModel
;
}
@Override
public
void
initParam
()
{
super
.
initParam
();
}
@Override
public
PerformanceVM
initViewModel
()
{
VMFactory
factory
=
VMFactory
.
getInstance
(
getActivity
().
getApplication
());
return
ViewModelProviders
.
of
(
this
,
factory
).
get
(
PerformanceVM
.
class
);
}
@Override
public
void
initData
()
{
super
.
initData
();
viewModel
.
initGen
();
binding
.
rvCollect
.
addItemDecoration
(
new
SpaceItemDecoration
(
16
));
}
@Override
public
void
initViewObservable
()
{
super
.
initViewObservable
();
}
}
app/src/main/java/com/phlx/anchorcollect/ui/fragment/list/CollectGridItem.java
View file @
199e5b54
...
...
@@ -5,26 +5,51 @@ import androidx.databinding.ObservableField;
import
com.phlx.anchorcollect.Configs
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.ui.fragment.vm.BasicsCollectVM
;
import
me.goldze.mvvmhabit.base.BaseViewModel
;
import
me.goldze.mvvmhabit.base.ItemViewModel
;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
import
me.goldze.mvvmhabit.utils.StringUtils
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
public
class
CollectGridItem
extends
ItemViewModel
<
BaseViewModel
>
{
public
ObservableField
<
GenTableColumn
>
entity
=
new
ObservableField
<>();
public
CollectGridItem
(
@NonNull
BaseViewModel
viewModel
,
GenTableColumn
entity
)
{
private
String
fragmentType
;
public
CollectGridItem
(
@NonNull
BaseViewModel
viewModel
,
GenTableColumn
entity
,
String
fragmentType
)
{
super
(
viewModel
);
this
.
entity
.
set
(
entity
);
this
.
fragmentType
=
fragmentType
;
}
public
BindingCommand
onItemClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
switch
(
fragmentType
){
case
Configs
.
BASE_ARCHIVES
:
((
BasicsCollectVM
)
viewModel
).
onItemClick
(
entity
.
get
());
break
;
case
Configs
.
SIGN_MEASURE
:
break
;
case
Configs
.
WEIGHTING_MANAGE
:
break
;
case
Configs
.
TREATMENT_RECORD
:
break
;
case
Configs
.
IMMUN_RECORD
:
break
;
case
Configs
.
BREEDING_RECORD
:
break
;
}
}
});
}
app/src/main/java/com/phlx/anchorcollect/ui/fragment/vm/BasicsCollectVM.java
View file @
199e5b54
...
...
@@ -3,6 +3,7 @@ package com.phlx.anchorcollect.ui.fragment.vm;
import
android.app.Application
;
import
android.graphics.drawable.Drawable
;
import
android.os.Environment
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
androidx.core.content.ContextCompat
;
...
...
@@ -14,19 +15,32 @@ import com.phlx.anchorcollect.BR;
import
com.phlx.anchorcollect.Configs
;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.gen.CardEntityDao
;
import
com.phlx.anchorcollect.db.gen.CattleResumeEntityDao
;
import
com.phlx.anchorcollect.db.gen.DictEntityDao
;
import
com.phlx.anchorcollect.db.interf.DbQueryCallBack
;
import
com.phlx.anchorcollect.entity.CardEntity
;
import
com.phlx.anchorcollect.entity.CattleResumeEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.entity.UIParamEntity
;
import
com.phlx.anchorcollect.ui.fragment.list.CollectGridItem
;
import
com.phlx.anchorcollect.ui.setting.SettingActivity
;
import
com.phlx.anchorcollect.util.EntityUtils
;
import
com.phlx.anchorcollect.util.StringUtil
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
me.goldze.mvvmhabit.base.BaseViewModel
;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
import
me.goldze.mvvmhabit.bus.event.SingleLiveEvent
;
import
me.goldze.mvvmhabit.utils.StringUtils
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
import
me.tatarka.bindingcollectionadapter2.ItemBinding
;
public
class
BasicsCollectVM
extends
BaseViewModel
<
Repository
>
{
...
...
@@ -36,8 +50,10 @@ public class BasicsCollectVM extends BaseViewModel<Repository> {
private
String
imgUrl
;
private
File
imgFile
;
//存放非list控件
public
List
<
GenTableColumn
>
uiList
=
new
ArrayList
<>();
public
GenTableColumn
currentParamEntity
;
public
GenTableColumn
remarkParamEntity
=
new
GenTableColumn
();
//给RecyclerView添加ObservableList
public
ObservableList
<
CollectGridItem
>
observableList
=
new
ObservableArrayList
<>();
...
...
@@ -52,10 +68,6 @@ public class BasicsCollectVM extends BaseViewModel<Repository> {
public
ObservableField
<
String
>
tag
=
new
ObservableField
<>(
""
);
public
ObservableField
<
String
>
weight
=
new
ObservableField
<>(
"125.5"
);
public
ObservableField
<
String
>
remark
=
new
ObservableField
<>(
""
);
public
int
currentId
=
-
1
;
public
BasicsCollectVM
(
@NonNull
Application
application
,
Repository
model
)
{
super
(
application
,
model
);
...
...
@@ -75,21 +87,44 @@ public class BasicsCollectVM extends BaseViewModel<Repository> {
if
(
i
<
4
)
{
uiList
.
add
(
gtc
);
}
else
{
CollectGridItem
cgi
=
new
CollectGridItem
(
this
,
gtc
);
CollectGridItem
cgi
=
new
CollectGridItem
(
this
,
gtc
,
Configs
.
BASE_ARCHIVES
);
observableList
.
add
(
cgi
);
}
i
++;
}
//初始化一下备注
remarkParamEntity
.
setColumnName
(
"备注"
);
remarkParamEntity
.
setContent
(
""
);
remarkParamEntity
.
setShowName
(
""
);
remarkParamEntity
.
setColumnComment
(
"备注"
);
remarkParamEntity
.
setHtmlType
(
"input"
);
remarkParamEntity
.
setJavaType
(
"String"
);
}
public
void
initData
(
String
tag
)
{
imgUrl
=
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
()
+
"/collect/picture/"
+
"anchorCiq"
+
tag
+
".jpg"
;
imgFile
=
new
File
(
imgUrl
);
queryCattleResume
(
tag
);
}
p
rivate
void
onItemClick
(
GenTableColumn
entity
)
{
p
ublic
void
onItemClick
(
GenTableColumn
entity
)
{
if
(
StringUtils
.
isEmpty
(
Configs
.
tempUnid
))
{
ToastUtils
.
showShort
(
"请扫描耳标或者输入耳标信息"
);
return
;
}
if
(!
"1"
.
equals
(
entity
.
getIsEdit
()))
return
;
currentParamEntity
=
entity
;
onCardClickEvent
.
call
();
}
public
String
getImgUrl
()
{
...
...
@@ -104,6 +139,14 @@ public class BasicsCollectVM extends BaseViewModel<Repository> {
}
});
//设置
public
BindingCommand
onSettingClick
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
startActivity
(
SettingActivity
.
class
);
}
});
//当前牛信息展示
public
BindingCommand
onCattleInfoClick
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
...
...
@@ -114,16 +157,106 @@ public class BasicsCollectVM extends BaseViewModel<Repository> {
public
void
click
(
int
id
)
{
int
i
=
0
;
for
(
GenTableColumn
gtc
:
uiList
)
{
if
(
id
==
i
)
{
currentParamEntity
=
gtc
;
break
;
if
(
StringUtils
.
isEmpty
(
Configs
.
tempUnid
))
{
ToastUtils
.
showShort
(
"请扫描耳标或者输入耳标信息"
);
return
;
}
//99备注,100照片
if
(
id
==
99
)
{
currentParamEntity
=
remarkParamEntity
;
}
else
{
currentParamEntity
=
uiList
.
get
(
id
);
}
currentId
=
id
;
if
(!
"1"
.
equals
(
currentParamEntity
.
getIsEdit
()))
return
;
onCardClickEvent
.
call
();
}
private
void
queryCattleResume
(
String
tag
)
{
QueryBuilder
<
CattleResumeEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
CattleResumeEntity
.
class
)
.
where
(
CattleResumeEntityDao
.
Properties
.
RegistrationNo
.
eq
(
tag
));
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
CattleResumeEntity
>()
{
@Override
public
void
onSuccess
(
List
<
CattleResumeEntity
>
result
)
{
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
Configs
.
tempTag
=
result
.
get
(
0
).
getIndividualNo
();
Configs
.
tempRfid
=
result
.
get
(
0
).
getRegistrationNo
();
Configs
.
tempUnid
=
result
.
get
(
0
).
getUnid
();
String
[]
filedName
=
EntityUtils
.
getFiledName
(
result
.
get
(
0
));
for
(
String
name
:
filedName
)
{
for
(
GenTableColumn
gtc
:
Configs
.
cattleresume
)
{
if
(
name
.
equals
(
gtc
.
getJavaField
()))
{
try
{
Log
.
e
(
"key:"
,
name
);
Object
fieldValueByName
=
EntityUtils
.
getFieldValueByName
(
name
,
result
.
get
(
0
));
String
value
=
fieldValueByName
==
null
?
""
:
fieldValueByName
.
toString
();
Log
.
e
(
"value:"
,
value
);
gtc
.
setContent
(
value
);
String
showName
=
value
;
// 如果是选择的,查字典项
if
(!
StringUtils
.
isEmpty
(
gtc
.
getDictType
()))
{
QueryBuilder
<
DictEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
DictEntity
.
class
)
.
where
(
DictEntityDao
.
Properties
.
DictType
.
eq
(
gtc
.
getDictType
())
,
DictEntityDao
.
Properties
.
DictValue
.
eq
(
value
));
List
<
DictEntity
>
dictEntities
=
DbUtil
.
getInstance
().
queryAll
(
DictEntity
.
class
,
builder
);
if
(
dictEntities
!=
null
&&
dictEntities
.
size
()
>
0
)
{
showName
=
dictEntities
.
get
(
0
).
getDictLabel
();
}
}
gtc
.
setShowName
(
showName
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
}
}
onNotifyAllEvent
.
setValue
(
false
);
}
else
{
onNotifyAllEvent
.
setValue
(
true
);
clearTempInfo
();
}
}
@Override
public
void
onFailed
()
{
clearTempInfo
();
onNotifyAllEvent
.
setValue
(
true
);
ToastUtils
.
showShort
(
"基础档案数据库查询失败"
);
}
}).
queryAsyncAll
(
CattleResumeEntity
.
class
,
builder
);
}
private
void
clearTempInfo
()
{
Configs
.
tempTag
=
""
;
Configs
.
tempUnid
=
""
;
Configs
.
tempRfid
=
""
;
}
//清空数据源
public
void
clearParamList
()
{
//备注清除数据
remarkParamEntity
.
setContent
(
""
);
remarkParamEntity
.
setShowName
(
""
);
currentParamEntity
=
new
GenTableColumn
();
for
(
GenTableColumn
gtc
:
Configs
.
cattleresume
)
{
gtc
.
setShowName
(
""
);
gtc
.
setContent
(
""
);
}
}
}
app/src/main/java/com/phlx/anchorcollect/ui/fragment/vm/CollectListVM.java
View file @
199e5b54
...
...
@@ -12,7 +12,6 @@ import com.phlx.anchorcollect.Configs;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.gen.CardEntityDao
;
import
com.phlx.anchorcollect.db.interf.DbQueryCallBack
;
import
com.phlx.anchorcollect.entity.CardEntity
;
import
com.phlx.anchorcollect.entity.ImmuneEntity
;
...
...
@@ -58,27 +57,27 @@ public class CollectListVM extends BaseViewModel<Repository> {
public
void
setCollectType
(
String
collectType
)
{
this
.
collectType
=
collectType
;
switch
(
collectType
)
{
case
Configs
.
FAMILY
_ARCHIVES
:
case
Configs
.
BASE
_ARCHIVES
:
title2
.
set
(
"品种"
);
title3
.
set
(
"出生难易度"
);
title4
.
set
(
"出生日期"
);
break
;
case
Configs
.
WEIGHTING_MANAG
E
:
case
Configs
.
SIGN_MEASUR
E
:
title2
.
set
(
"事件名称"
);
title3
.
set
(
"圈号"
);
title4
.
set
(
"称重日期"
);
break
;
case
Configs
.
SIGN_MEASURE
:
case
Configs
.
TREATMENT_RECORD
:
title2
.
set
(
"几牙"
);
title3
.
set
(
"体重"
);
title4
.
set
(
"测量日期"
);
break
;
case
Configs
.
HEALTH
_MANAGE
:
case
Configs
.
WEIGHTING
_MANAGE
:
title2
.
set
(
"病因"
);
title3
.
set
(
"用药"
);
title4
.
set
(
"诊疗日期"
);
break
;
case
Configs
.
IMMUN_
MANAGE
:
case
Configs
.
IMMUN_
RECORD
:
title2
.
set
(
"免疫有效期"
);
title3
.
set
(
"疫苗名称"
);
title4
.
set
(
"免疫日期"
);
...
...
@@ -94,19 +93,19 @@ public class CollectListVM extends BaseViewModel<Repository> {
public
void
refreshList
()
{
switch
(
collectType
)
{
case
Configs
.
FAMILY
_ARCHIVES
:
case
Configs
.
BASE
_ARCHIVES
:
refreshCard
();
break
;
case
Configs
.
WEIGHTING_MANAG
E
:
case
Configs
.
SIGN_MEASUR
E
:
refreshWeight
();
break
;
case
Configs
.
SIGN_MEASURE
:
case
Configs
.
TREATMENT_RECORD
:
refreshSign
();
break
;
case
Configs
.
HEALTH
_MANAGE
:
case
Configs
.
WEIGHTING
_MANAGE
:
refreshHealth
();
break
;
case
Configs
.
IMMUN_
MANAGE
:
case
Configs
.
IMMUN_
RECORD
:
refreshImmun
();
break
;
}
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/vm/CollectVM.java
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
ui
.
fragment
.
vm
;
import
android.app.Application
;
import
android.graphics.Bitmap
;
import
android.graphics.drawable.Drawable
;
import
android.os.Environment
;
...
...
@@ -29,7 +28,6 @@ import com.phlx.anchorcollect.entity.WeightingEntity;
import
com.phlx.anchorcollect.util.TextUtil
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
org.greenrobot.greendao.query.WhereCondition
;
import
java.io.File
;
import
java.util.ArrayList
;
...
...
@@ -38,7 +36,6 @@ import java.util.List;
import
me.goldze.mvvmhabit.base.BaseViewModel
;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
import
me.goldze.mvvmhabit.binding.command.BindingConsumer
;
import
me.goldze.mvvmhabit.bus.event.SingleLiveEvent
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
...
...
@@ -79,19 +76,19 @@ public class CollectVM extends BaseViewModel<Repository> {
imgFile
=
new
File
(
imgUrl
);
switch
(
collectType
)
{
case
Configs
.
FAMILY
_ARCHIVES
:
case
Configs
.
BASE
_ARCHIVES
:
queryCard
(
tag
);
break
;
case
Configs
.
WEIGHTING_MANAG
E
:
case
Configs
.
SIGN_MEASUR
E
:
queryWeight
(
tag
);
break
;
case
Configs
.
SIGN_MEASURE
:
case
Configs
.
TREATMENT_RECORD
:
querySign
(
tag
);
break
;
case
Configs
.
HEALTH
_MANAGE
:
case
Configs
.
WEIGHTING
_MANAGE
:
queryHealth
(
tag
);
break
;
case
Configs
.
IMMUN_
MANAGE
:
case
Configs
.
IMMUN_
RECORD
:
queryImmun
(
tag
);
break
;
}
...
...
@@ -131,19 +128,19 @@ public class CollectVM extends BaseViewModel<Repository> {
}
switch
(
collectType
)
{
case
Configs
.
FAMILY
_ARCHIVES
:
case
Configs
.
BASE
_ARCHIVES
:
saveCard
();
break
;
case
Configs
.
WEIGHTING_MANAG
E
:
case
Configs
.
SIGN_MEASUR
E
:
saveWeight
();
break
;
case
Configs
.
SIGN_MEASURE
:
case
Configs
.
TREATMENT_RECORD
:
saveSign
();
break
;
case
Configs
.
HEALTH
_MANAGE
:
case
Configs
.
WEIGHTING
_MANAGE
:
saveHealth
();
break
;
case
Configs
.
IMMUN_
MANAGE
:
case
Configs
.
IMMUN_
RECORD
:
saveImmun
();
break
;
}
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/vm/PerformanceVM.java
0 → 100644
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
ui
.
fragment
.
vm
;
import
android.app.Application
;
import
android.graphics.drawable.Drawable
;
import
android.os.Environment
;
import
androidx.annotation.NonNull
;
import
androidx.databinding.ObservableArrayList
;
import
androidx.databinding.ObservableField
;
import
androidx.databinding.ObservableList
;
import
com.phlx.anchorcollect.BR
;
import
com.phlx.anchorcollect.Configs
;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.ui.fragment.list.CollectGridItem
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.List
;
import
me.goldze.mvvmhabit.base.BaseViewModel
;
import
me.goldze.mvvmhabit.bus.event.SingleLiveEvent
;
import
me.goldze.mvvmhabit.utils.StringUtils
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
import
me.tatarka.bindingcollectionadapter2.ItemBinding
;
public
class
PerformanceVM
extends
BaseViewModel
<
Repository
>
{
public
Drawable
drawableImg
;
//照片路径
private
String
imgUrl
;
private
File
imgFile
;
//存放非list控件
public
List
<
GenTableColumn
>
uiList
=
new
ArrayList
<>();
public
GenTableColumn
currentParamEntity
;
public
GenTableColumn
remarkParamEntity
=
new
GenTableColumn
();
//给RecyclerView添加ObservableList
public
ObservableList
<
CollectGridItem
>
observableList
=
new
ObservableArrayList
<>();
//给RecyclerView添加ItemBinding
public
ItemBinding
<
CollectGridItem
>
itemBinding
=
ItemBinding
.
of
(
BR
.
viewModel
,
R
.
layout
.
item_collect_grid
);
public
SingleLiveEvent
<
Boolean
>
onCattleClickEvent
=
new
SingleLiveEvent
<>();
public
SingleLiveEvent
<
Boolean
>
onCardClickEvent
=
new
SingleLiveEvent
<>();
public
SingleLiveEvent
<
Boolean
>
onTagClickEvent
=
new
SingleLiveEvent
<>();
public
SingleLiveEvent
<
Boolean
>
onNotifyAllEvent
=
new
SingleLiveEvent
<>();
//true是清空页面
public
ObservableField
<
String
>
tag
=
new
ObservableField
<>(
""
);
public
ObservableField
<
String
>
weight
=
new
ObservableField
<>(
"125.5"
);
public
PerformanceVM
(
@NonNull
Application
application
,
Repository
model
)
{
super
(
application
,
model
);
}
public
void
initGen
()
{
imgUrl
=
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
()
+
"/collect/picture/"
+
"anchorCiq"
+
tag
+
".jpg"
;
imgFile
=
new
File
(
imgUrl
);
for
(
GenTableColumn
gtc
:
Configs
.
performance
)
{
CollectGridItem
cgi
=
new
CollectGridItem
(
this
,
gtc
,
Configs
.
BASE_ARCHIVES
);
observableList
.
add
(
cgi
);
}
//初始化一下备注
remarkParamEntity
.
setColumnName
(
"备注"
);
remarkParamEntity
.
setContent
(
""
);
remarkParamEntity
.
setShowName
(
""
);
remarkParamEntity
.
setColumnComment
(
"备注"
);
remarkParamEntity
.
setHtmlType
(
"input"
);
remarkParamEntity
.
setJavaType
(
"String"
);
}
public
void
initData
(
String
tag
)
{
imgUrl
=
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
()
+
"/collect/picture/"
+
"anchorCiq"
+
tag
+
".jpg"
;
imgFile
=
new
File
(
imgUrl
);
queryPerformance
(
tag
);
}
public
void
onItemClick
(
GenTableColumn
entity
)
{
if
(
StringUtils
.
isEmpty
(
Configs
.
tempUnid
))
{
ToastUtils
.
showShort
(
"请扫描耳标或者输入耳标信息"
);
return
;
}
if
(!
"1"
.
equals
(
entity
.
getIsEdit
()))
return
;
currentParamEntity
=
entity
;
onCardClickEvent
.
call
();
}
public
void
click
(
int
id
)
{
if
(
StringUtils
.
isEmpty
(
Configs
.
tempUnid
))
{
ToastUtils
.
showShort
(
"请扫描耳标或者输入耳标信息"
);
return
;
}
//99备注,100照片
if
(
id
==
99
)
{
currentParamEntity
=
remarkParamEntity
;
}
else
{
currentParamEntity
=
uiList
.
get
(
id
);
}
if
(!
"1"
.
equals
(
currentParamEntity
.
getIsEdit
()))
return
;
onCardClickEvent
.
call
();
}
private
void
queryPerformance
(
String
tag
)
{
}
}
app/src/main/java/com/phlx/anchorcollect/ui/home/HomeVM.java
View file @
199e5b54
...
...
@@ -9,7 +9,7 @@ import com.phlx.anchorcollect.Configs;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.ui.base.MainBarVM
;
import
com.phlx.anchorcollect.ui.main.MainActivity
;
import
com.phlx.anchorcollect.ui.setting.
Bt
SettingActivity
;
import
com.phlx.anchorcollect.ui.setting.SettingActivity
;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
...
...
@@ -26,7 +26,7 @@ public class HomeVM extends MainBarVM<Repository> {
@Override
public
void
call
()
{
Bundle
mBundle
=
new
Bundle
();
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
FAMILY
_ARCHIVES
);
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
BASE
_ARCHIVES
);
startActivity
(
MainActivity
.
class
,
mBundle
);
}
});
...
...
@@ -37,7 +37,7 @@ public class HomeVM extends MainBarVM<Repository> {
public
void
call
()
{
Bundle
mBundle
=
new
Bundle
();
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
WEIGHTING_MANAG
E
);
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
SIGN_MEASUR
E
);
startActivity
(
MainActivity
.
class
,
mBundle
);
}
});
...
...
@@ -48,7 +48,7 @@ public class HomeVM extends MainBarVM<Repository> {
public
void
call
()
{
Bundle
mBundle
=
new
Bundle
();
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
SIGN_MEASURE
);
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
TREATMENT_RECORD
);
startActivity
(
MainActivity
.
class
,
mBundle
);
}
});
...
...
@@ -59,7 +59,7 @@ public class HomeVM extends MainBarVM<Repository> {
public
void
call
()
{
Bundle
mBundle
=
new
Bundle
();
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
HEALTH
_MANAGE
);
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
WEIGHTING
_MANAGE
);
startActivity
(
MainActivity
.
class
,
mBundle
);
}
});
...
...
@@ -70,8 +70,8 @@ public class HomeVM extends MainBarVM<Repository> {
public
void
call
()
{
Bundle
mBundle
=
new
Bundle
();
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
IMMUN_
MANAGE
);
startActivity
(
Bt
SettingActivity
.
class
,
mBundle
);
mBundle
.
putString
(
"COLLECT_TYPT"
,
Configs
.
IMMUN_
RECORD
);
startActivity
(
SettingActivity
.
class
,
mBundle
);
}
});
...
...
app/src/main/java/com/phlx/anchorcollect/ui/login/LoginVM.java
View file @
199e5b54
...
...
@@ -11,6 +11,11 @@ import androidx.databinding.ObservableInt;
import
com.phlx.anchorcollect.Configs
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.data.VMFactory
;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.gen.GenTableColumnDao
;
import
com.phlx.anchorcollect.db.gen.GenTableDao
;
import
com.phlx.anchorcollect.entity.GenTable
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.entity.LoginData
;
import
com.phlx.anchorcollect.entity.UserRoleEntity
;
import
com.phlx.anchorcollect.net.NetworkUtils
;
...
...
@@ -21,10 +26,15 @@ import com.phlx.anchorcollect.ui.splash.SplashActivity;
import
com.phlx.anchorcollect.util.StringUtil
;
import
com.phlx.anchorcollect.util.TextUtil
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
io.reactivex.functions.Consumer
;
import
me.goldze.mvvmhabit.base.BaseViewModel
;
...
...
@@ -138,6 +148,7 @@ public class LoginVM extends BaseViewModel<Repository> {
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_LOGIN_NAME
,
response
.
getData
().
getUser
().
getLoginName
());
SPUtils
.
getInstance
().
put
(
Configs
.
SP_DEPT_ID
,
response
.
getData
().
getUser
().
getDeptId
());
String
roleIds
=
""
;
List
<
UserRoleEntity
>
roles
=
response
.
getData
().
getUser
().
getRoles
();
...
...
@@ -194,14 +205,77 @@ public class LoginVM extends BaseViewModel<Repository> {
return
;
}
Configs
.
FREQUENCY_CONFIG
=
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_FREQUENCY
);
startActivity
(
MainActivity
.
class
);
finish
();
getGen
();
}
else
{
ToastUtils
.
showShort
(
"请先联机登录"
);
}
}
private
void
getGen
()
{
String
roles
=
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_ROLE_ID
,
""
);
QueryBuilder
<
GenTable
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTable
.
class
)
.
where
(
GenTableDao
.
Properties
.
RoleId
.
in
(
StringUtil
.
strToList
(
roles
.
split
(
","
))));
Set
<
GenTable
>
genList
=
new
HashSet
<>();
genList
.
addAll
(
DbUtil
.
getInstance
().
queryAll
(
GenTable
.
class
,
builder
));
for
(
GenTable
gt
:
genList
)
{
switch
(
gt
.
getBusinessName
())
{
case
"cattleresume"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile0
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
cattleresume
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile0
);
break
;
case
"performance"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile1
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
performance
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile1
);
break
;
case
"weightMan"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile2
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
weightMan
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile2
);
break
;
case
"medicalrecords"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile3
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
medicalrecords
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile3
);
break
;
case
"immunebatch"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile4
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
immunebatch
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile4
);
break
;
case
"cattlematingMaster"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile5
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
cattlematingMaster
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile5
);
break
;
case
"cattlematingDetaill"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile6
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
cattlematingDetaill
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile6
);
break
;
}
}
dismissDialog
();
ToastUtils
.
showShort
(
"页面配置详情数据读取完成!"
);
startActivity
(
MainActivity
.
class
);
finish
();
}
/**
* 判断网络,网络可用时连接服务器获取版本,不可用则忽略
...
...
app/src/main/java/com/phlx/anchorcollect/ui/main/MainActivity.java
View file @
199e5b54
...
...
@@ -15,6 +15,7 @@ import com.phlx.anchorcollect.ui.base.BaseActivity;
import
com.phlx.anchorcollect.ui.fragment.BasicsCollectFragment
;
import
com.phlx.anchorcollect.ui.fragment.CollectFragment
;
import
com.phlx.anchorcollect.ui.fragment.CollectListFragment
;
import
com.phlx.anchorcollect.ui.fragment.PerformanceFragment
;
public
class
MainActivity
extends
BaseActivity
<
ActivityMainBinding
,
MainVM
>
{
...
...
@@ -23,6 +24,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
private
FragmentTransaction
transaction
;
private
BasicsCollectFragment
_basicsCollectFragment
;
private
PerformanceFragment
_performanceFragment
;
private
CollectListFragment
_collectListFragment
;
@Override
...
...
app/src/main/java/com/phlx/anchorcollect/ui/main/MainVM.java
View file @
199e5b54
...
...
@@ -10,6 +10,7 @@ import com.phlx.anchorcollect.data.Repository;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.gen.GenTableColumnDao
;
import
com.phlx.anchorcollect.db.gen.GenTableDao
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenTable
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.ui.base.BackBarVM
;
...
...
@@ -38,7 +39,7 @@ public class MainVM extends MainBarVM<Repository> {
public
void
init
()
{
getGen
(
);
Configs
.
dictList
=
DbUtil
.
getInstance
().
queryAll
(
DictEntity
.
class
);
}
...
...
@@ -49,64 +50,7 @@ public class MainVM extends MainBarVM<Repository> {
}
private
void
getGen
()
{
String
roles
=
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_ROLE_ID
,
""
);
QueryBuilder
<
GenTable
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTable
.
class
)
.
where
(
GenTableDao
.
Properties
.
RoleId
.
in
(
roles
.
split
(
","
)));
Set
<
GenTable
>
genList
=
new
HashSet
<>();
genList
.
addAll
(
DbUtil
.
getInstance
().
queryAll
(
GenTable
.
class
,
builder
));
for
(
GenTable
gt
:
genList
)
{
switch
(
gt
.
getBusinessName
())
{
case
"cattleresume"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile0
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
cattleresume
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile0
);
break
;
case
"performance"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile1
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
performance
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile1
);
break
;
case
"weightMan"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile2
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
weightMan
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile2
);
break
;
case
"medicalrecords"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile3
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
medicalrecords
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile3
);
break
;
case
"immunebatch"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile4
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
immunebatch
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile4
);
break
;
case
"cattlematingMaster"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile5
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
cattlematingMaster
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile5
);
break
;
case
"cattlematingDetaill"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile6
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()));
Configs
.
cattlematingDetaill
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile6
);
break
;
}
}
}
//基础信息
...
...
app/src/main/java/com/phlx/anchorcollect/ui/setting/BLEItem.java
View file @
199e5b54
...
...
@@ -9,11 +9,11 @@ import me.goldze.mvvmhabit.base.ItemViewModel;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
public
class
BLEItem
extends
ItemViewModel
<
Bt
SettingVM
>
{
public
class
BLEItem
extends
ItemViewModel
<
SettingVM
>
{
public
ObservableField
<
BluetoothEntity
>
entity
=
new
ObservableField
<>();
public
BLEItem
(
@NonNull
Bt
SettingVM
viewModel
,
BluetoothEntity
entity
)
{
public
BLEItem
(
@NonNull
SettingVM
viewModel
,
BluetoothEntity
entity
)
{
super
(
viewModel
);
this
.
entity
.
set
(
entity
);
}
...
...
app/src/main/java/com/phlx/anchorcollect/ui/setting/
Bt
SettingActivity.java
→
app/src/main/java/com/phlx/anchorcollect/ui/setting/SettingActivity.java
View file @
199e5b54
...
...
@@ -6,14 +6,17 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.os.Handler
;
import
androidx.annotation.NonNull
;
import
androidx.lifecycle.Observer
;
import
androidx.lifecycle.ViewModelProviders
;
import
com.afollestad.materialdialogs.DialogAction
;
import
com.afollestad.materialdialogs.MaterialDialog
;
import
com.phlx.anchorcollect.App
;
import
com.phlx.anchorcollect.BR
;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.data.VMFactory
;
import
com.phlx.anchorcollect.databinding.Activity
Bt
SettingBinding
;
import
com.phlx.anchorcollect.databinding.ActivitySettingBinding
;
import
com.phlx.anchorcollect.rfid.NetModuleManager
;
import
com.phlx.anchorcollect.ui.base.BaseActivity
;
import
com.phlx.anchorcollect.util.ConstantUtil
;
...
...
@@ -25,10 +28,10 @@ import java.util.List;
import
cn.wandersnail.commons.util.ToastUtils
;
import
io.reactivex.functions.Consumer
;
public
class
BtSettingActivity
extends
BaseActivity
<
ActivityBtSettingBinding
,
Bt
SettingVM
>
{
public
class
SettingActivity
extends
BaseActivity
<
ActivitySettingBinding
,
SettingVM
>
{
@Override
public
int
initContentView
(
Bundle
savedInstanceState
)
{
return
R
.
layout
.
activity_
bt_
setting
;
return
R
.
layout
.
activity_setting
;
}
@Override
...
...
@@ -42,9 +45,9 @@ public class BtSettingActivity extends BaseActivity<ActivityBtSettingBinding, Bt
}
@Override
public
Bt
SettingVM
initViewModel
()
{
public
SettingVM
initViewModel
()
{
VMFactory
factory
=
VMFactory
.
getInstance
(
getApplication
());
return
ViewModelProviders
.
of
(
this
,
factory
).
get
(
Bt
SettingVM
.
class
);
return
ViewModelProviders
.
of
(
this
,
factory
).
get
(
SettingVM
.
class
);
}
@Override
...
...
@@ -72,6 +75,13 @@ public class BtSettingActivity extends BaseActivity<ActivityBtSettingBinding, Bt
initialize
();
}
});
viewModel
.
errorEvent
.
observe
(
this
,
new
Observer
<
String
>()
{
@Override
public
void
onChanged
(
String
s
)
{
showTip
(
s
);
}
});
}
private
void
initNet
()
{
...
...
@@ -134,4 +144,18 @@ public class BtSettingActivity extends BaseActivity<ActivityBtSettingBinding, Bt
// }
return
list
;
}
private
void
showTip
(
String
content
)
{
new
MaterialDialog
.
Builder
(
this
).
title
(
"系统信息"
).
content
(
content
)
.
cancelable
(
false
).
canceledOnTouchOutside
(
false
)
.
positiveText
(
"退出"
).
onPositive
(
new
MaterialDialog
.
SingleButtonCallback
()
{
@Override
public
void
onClick
(
@NonNull
MaterialDialog
dialog
,
@NonNull
DialogAction
which
)
{
if
(
which
==
DialogAction
.
POSITIVE
)
{
dialog
.
dismiss
();
finish
();
}
}
}).
show
();
}
}
app/src/main/java/com/phlx/anchorcollect/ui/setting/
Bt
SettingVM.java
→
app/src/main/java/com/phlx/anchorcollect/ui/setting/SettingVM.java
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
ui
.
setting
;
import
android.Manifest
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.app.ActivityManager
;
import
android.app.Application
;
import
android.bluetooth.BluetoothAdapter
;
import
android.bluetooth.BluetoothDevice
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.media.AudioManager
;
import
android.media.SoundPool
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.text.TextUtils
;
...
...
@@ -21,19 +17,28 @@ import android.util.SparseIntArray;
import
androidx.annotation.NonNull
;
import
androidx.databinding.ObservableArrayList
;
import
androidx.databinding.ObservableList
;
import
androidx.lifecycle.LiveData
;
import
com.google.gson.Gson
;
import
com.phlx.anchorcollect.App
;
import
com.phlx.anchorcollect.BR
;
import
com.phlx.anchorcollect.Configs
;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.ble.BleDialog
;
import
com.phlx.anchorcollect.ble.BleService
;
import
com.phlx.anchorcollect.ble.BluetoothEntity
;
import
com.phlx.anchorcollect.bt.BtService
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.data.VMFactory
;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.interf.DbIDUCallBack
;
import
com.phlx.anchorcollect.entity.CattleResumeEntity
;
import
com.phlx.anchorcollect.entity.LoginData
;
import
com.phlx.anchorcollect.entity.UserRoleEntity
;
import
com.phlx.anchorcollect.params.CollectResponse
;
import
com.phlx.anchorcollect.params.ListResponse
;
import
com.phlx.anchorcollect.params.PostParams
;
import
com.phlx.anchorcollect.rfid.InventoryManger
;
import
com.phlx.anchorcollect.ui.splash.SplashActivity
;
import
com.phlx.anchorcollect.util.EntityUtils
;
import
com.phlx.anchorcollect.util.TextUtil
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.uhf.structures.InventoryData
;
import
com.uhf.structures.InventoryParams
;
import
com.uhf.structures.OnInventoryListener
;
...
...
@@ -52,9 +57,15 @@ import me.goldze.mvvmhabit.base.BaseViewModel;
import
me.goldze.mvvmhabit.binding.command.BindingAction
;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
import
me.goldze.mvvmhabit.bus.event.SingleLiveEvent
;
import
me.goldze.mvvmhabit.http.ResponseThrowable
;
import
me.goldze.mvvmhabit.utils.KLog
;
import
me.goldze.mvvmhabit.utils.RxUtils
;
import
me.goldze.mvvmhabit.utils.SPUtils
;
import
me.tatarka.bindingcollectionadapter2.ItemBinding
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
public
class
Bt
SettingVM
extends
BaseViewModel
<
Repository
>
implements
DiscoveryListener
,
OnInventoryListener
{
public
class
SettingVM
extends
BaseViewModel
<
Repository
>
implements
DiscoveryListener
,
OnInventoryListener
{
private
SoundPool
soundPool
;
//盘点到标签时的提示音
private
SparseIntArray
musicId
;
...
...
@@ -80,7 +91,10 @@ public class BtSettingVM extends BaseViewModel<Repository> implements DiscoveryL
public
SingleLiveEvent
<
Integer
>
btRequestEvent
=
new
SingleLiveEvent
<>();
public
SingleLiveEvent
<
Boolean
>
btParamEvent
=
new
SingleLiveEvent
<>();
public
BtSettingVM
(
@NonNull
Application
application
,
Repository
model
)
{
//错误提示
public
SingleLiveEvent
<
String
>
errorEvent
=
new
SingleLiveEvent
<>();
public
SettingVM
(
@NonNull
Application
application
,
Repository
model
)
{
super
(
application
,
model
);
initInventory
();
...
...
@@ -171,6 +185,48 @@ public class BtSettingVM extends BaseViewModel<Repository> implements DiscoveryL
}
});
public
BindingCommand
OnBaseArchivesSyncClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
requestBaseArchives
();
}
});
public
BindingCommand
OnSignMeasureSyncClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
}
});
public
BindingCommand
OnWeightingManageSyncClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
}
});
public
BindingCommand
OnTreatmentRecordSyncClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
}
});
public
BindingCommand
OnImmunRecordSyncClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
}
});
public
BindingCommand
OnBreedingRecordSyncClickCommand
=
new
BindingCommand
(
new
BindingAction
()
{
@Override
public
void
call
()
{
}
});
public
void
itemOnClick
(
BluetoothEntity
btEntity
)
{
BTManager
.
getInstance
().
stopDiscovery
();
stopBtService
();
...
...
@@ -313,7 +369,7 @@ public class BtSettingVM extends BaseViewModel<Repository> implements DiscoveryL
BluetoothEntity
entity
=
new
BluetoothEntity
();
entity
.
setName
(
tag
);
entity
.
setAddress
(
""
);
BLEItem
bleItem
=
new
BLEItem
(
Bt
SettingVM
.
this
,
entity
);
BLEItem
bleItem
=
new
BLEItem
(
SettingVM
.
this
,
entity
);
mList
.
add
(
entity
);
observableList
.
add
(
bleItem
);
soundPool
.
play
(
musicId
.
get
(
1
),
1
,
1
,
0
,
0
,
1
);
...
...
@@ -322,4 +378,88 @@ public class BtSettingVM extends BaseViewModel<Repository> implements DiscoveryL
}
}
};
private
void
requestBaseArchives
()
{
//SyncState 0根据记录更新,1重新更新
Map
<
String
,
String
>
requestParam
=
new
HashMap
<>();
List
<
CattleResumeEntity
>
queryList
=
DbUtil
.
getInstance
().
queryAll
(
CattleResumeEntity
.
class
);
if
(
queryList
==
null
||
queryList
.
size
()
==
0
)
requestParam
.
put
(
"SyncState"
,
"1"
);
else
requestParam
.
put
(
"SyncState"
,
"0"
);
addSubscribe
(
model
.
downloadCattleList
(
requestParam
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
exceptionTransformer
())
.
doOnSubscribe
(
disposable
->
showDialog
(
"正在同步基础数据..."
))
.
subscribe
((
Consumer
<
ListResponse
<
CattleResumeEntity
>>)
response
->
{
if
(
response
.
getCode
()
==
0
)
{
if
(
response
.
getData
()
!=
null
&&
response
.
getData
().
size
()
>
0
)
{
KLog
.
e
(
"--CattleResumeEntity--"
+
response
.
getData
().
size
());
List
<
String
>
ids
=
new
ArrayList
<>();
for
(
CattleResumeEntity
cre
:
response
.
getData
())
{
cre
.
setUploadStatus
(
"1"
);
ids
.
add
(
cre
.
getUnid
());
}
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
@Override
public
void
onNotification
(
boolean
result
)
{
if
(
result
)
{
requestBaseArchivesSync
(
ids
);
}
else
{
dismissDialog
();
errorEvent
.
setValue
(
"保存基础数据失败!"
);
}
}
}).
insertAsyncBatch
(
CattleResumeEntity
.
class
,
response
.
getData
());
}
else
{
dismissDialog
();
}
}
else
{
errorEvent
.
setValue
(
"服务器 :"
+
response
.
getMsg
());
}
},
(
Consumer
<
ResponseThrowable
>)
throwable
->
{
dismissDialog
();
KLog
.
e
(
throwable
.
message
);
})
);
}
private
void
requestBaseArchivesSync
(
List
<
String
>
ids
)
{
// Map<String, String> syncParam = new HashMap<>();
// syncParam.put("ids", new Gson().toJson(ids).toString());
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
new
Gson
().
toJson
(
ids
));
// KLog.e("label", postParams.toString());
addSubscribe
(
model
.
downloadCattleListSync
(
body
)
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
exceptionTransformer
())
// .doOnSubscribe(disposable -> showDialog("正在同步基础数据..."))
.
subscribe
((
Consumer
<
CollectResponse
>)
response
->
{
dismissDialog
();
KLog
.
e
(
"requestBaseArchivesSync"
,
response
.
toString
());
if
(
response
.
getCode
()
==
0
)
{
me
.
goldze
.
mvvmhabit
.
utils
.
ToastUtils
.
showShort
(
"同步基础数据成功!"
);
}
else
{
me
.
goldze
.
mvvmhabit
.
utils
.
ToastUtils
.
showShort
(
"服务器:"
+
response
.
getMsg
());
}
},
(
Consumer
<
ResponseThrowable
>)
throwable
->
{
dismissDialog
();
me
.
goldze
.
mvvmhabit
.
utils
.
ToastUtils
.
showShort
(
throwable
.
message
);
})
);
}
}
app/src/main/java/com/phlx/anchorcollect/ui/splash/SplashActivity.java
View file @
199e5b54
...
...
@@ -40,8 +40,8 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM
@Override
public
void
initData
()
{
super
.
initData
();
showDialog
(
"正在同步
页面配置
数据,请稍后"
);
viewModel
.
request
Gen
();
showDialog
(
"正在同步
基础
数据,请稍后"
);
viewModel
.
request
Dict
();
}
@Override
...
...
app/src/main/java/com/phlx/anchorcollect/ui/splash/SplashVM.java
View file @
199e5b54
...
...
@@ -5,17 +5,29 @@ import android.app.Application;
import
androidx.annotation.NonNull
;
import
com.google.gson.Gson
;
import
com.phlx.anchorcollect.Configs
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.gen.GenTableColumnDao
;
import
com.phlx.anchorcollect.db.gen.GenTableDao
;
import
com.phlx.anchorcollect.db.interf.DbIDUCallBack
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenData
;
import
com.phlx.anchorcollect.entity.GenTable
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.params.CollectResponse
;
import
com.phlx.anchorcollect.params.ListResponse
;
import
com.phlx.anchorcollect.params.PostParams
;
import
com.phlx.anchorcollect.ui.base.MainBarVM
;
import
com.phlx.anchorcollect.ui.home.HomeActivity
;
import
com.phlx.anchorcollect.ui.main.MainActivity
;
import
com.phlx.anchorcollect.util.StringUtil
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
io.reactivex.functions.Consumer
;
import
me.goldze.mvvmhabit.bus.event.SingleLiveEvent
;
...
...
@@ -39,6 +51,48 @@ public class SplashVM extends MainBarVM<Repository> {
}
public
void
requestDict
()
{
addSubscribe
(
model
.
downloadDict
()
.
compose
(
RxUtils
.
bindToLifecycle
(
getLifecycleProvider
()))
.
compose
(
RxUtils
.
schedulersTransformer
())
.
compose
(
RxUtils
.
exceptionTransformer
())
.
doOnSubscribe
(
disposable
->
{
})
.
subscribe
((
Consumer
<
ListResponse
<
DictEntity
>>)
response
->
{
if
(
response
.
getCode
()
==
0
)
{
//清除之前的页面配置
DbUtil
.
getInstance
().
deleteAll
(
DictEntity
.
class
);
if
(
response
.
getData
()
!=
null
&&
response
.
getData
().
size
()
>
0
)
{
KLog
.
e
(
response
.
getData
().
size
());
DbUtil
.
getInstance
().
setDbIDUCallBack
(
new
DbIDUCallBack
()
{
@Override
public
void
onNotification
(
boolean
result
)
{
if
(
result
)
{
ToastUtils
.
showShort
(
"字典项数据同步完成!"
);
}
else
{
errorEvent
.
setValue
(
"保存字典项数据失败"
);
}
}
}).
insertAsyncBatch
(
DictEntity
.
class
,
response
.
getData
());
}
else
{
}
requestGen
();
}
else
{
errorEvent
.
setValue
(
"同步字典项数据错误 :"
+
response
.
getMsg
());
}
},
(
Consumer
<
ResponseThrowable
>)
throwable
->
{
dismissDialog
();
KLog
.
e
(
throwable
.
message
);
errorEvent
.
setValue
(
"同步字典项数据失败"
);
})
);
}
public
void
requestGen
()
{
PostParams
postParams
=
new
PostParams
();
...
...
@@ -68,11 +122,7 @@ public class SplashVM extends MainBarVM<Repository> {
@Override
public
void
onNotification
(
boolean
result
)
{
if
(
result
)
{
dismissDialog
();
ToastUtils
.
showShort
(
"页面配置详情数据更新完成!"
);
SPUtils
.
getInstance
().
put
(
"isFirst"
,
false
);
startActivity
(
MainActivity
.
class
);
finish
();
getGen
();
}
else
{
errorEvent
.
setValue
(
"保存页面配置详情数据失败"
);
}
...
...
@@ -97,5 +147,76 @@ public class SplashVM extends MainBarVM<Repository> {
);
}
private
void
getGen
()
{
String
roles
=
SPUtils
.
getInstance
().
getString
(
Configs
.
SP_ROLE_ID
,
""
);
QueryBuilder
<
GenTable
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTable
.
class
)
.
where
(
GenTableDao
.
Properties
.
RoleId
.
in
(
StringUtil
.
strToList
(
roles
.
split
(
","
))));
Set
<
GenTable
>
genList
=
new
HashSet
<>();
genList
.
addAll
(
DbUtil
.
getInstance
().
queryAll
(
GenTable
.
class
,
builder
));
for
(
GenTable
gt
:
genList
)
{
switch
(
gt
.
getBusinessName
())
{
case
"cattleresume"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile0
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()))
.
orderDesc
(
GenTableColumnDao
.
Properties
.
Sort
);
Configs
.
cattleresume
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile0
);
break
;
case
"performance"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile1
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()))
.
orderDesc
(
GenTableColumnDao
.
Properties
.
Sort
);
Configs
.
performance
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile1
);
break
;
case
"weightMan"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile2
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()))
.
orderDesc
(
GenTableColumnDao
.
Properties
.
Sort
);
Configs
.
weightMan
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile2
);
break
;
case
"medicalrecords"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile3
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()))
.
orderDesc
(
GenTableColumnDao
.
Properties
.
Sort
);
Configs
.
medicalrecords
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile3
);
break
;
case
"immunebatch"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile4
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()))
.
orderDesc
(
GenTableColumnDao
.
Properties
.
Sort
);
Configs
.
immunebatch
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile4
);
break
;
case
"cattlematingMaster"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile5
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()))
.
orderDesc
(
GenTableColumnDao
.
Properties
.
Sort
);
Configs
.
cattlematingMaster
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile5
);
break
;
case
"cattlematingDetaill"
:
QueryBuilder
<
GenTableColumn
>
builderDetaile6
=
DbUtil
.
getInstance
().
getQueryBuilder
(
GenTableColumn
.
class
)
.
where
(
GenTableColumnDao
.
Properties
.
TableId
.
eq
(
gt
.
getTableId
()))
.
orderDesc
(
GenTableColumnDao
.
Properties
.
Sort
);
Configs
.
cattlematingDetaill
=
DbUtil
.
getInstance
().
queryAll
(
GenTableColumn
.
class
,
builderDetaile6
);
break
;
}
}
dismissDialog
();
ToastUtils
.
showShort
(
"页面配置详情数据更新完成!"
);
SPUtils
.
getInstance
().
put
(
"isFirst"
,
false
);
startActivity
(
MainActivity
.
class
);
finish
();
}
}
app/src/main/java/com/phlx/anchorcollect/util/DeviceIdUtils.java
0 → 100644
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
util
;
import
android.annotation.SuppressLint
;
import
android.content.ContentResolver
;
import
android.content.ContentUris
;
import
android.content.ContentValues
;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.database.Cursor
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Environment
;
import
android.provider.MediaStore
;
import
android.telephony.TelephonyManager
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.util.UUID
;
import
cn.hutool.core.util.IdUtil
;
public
class
DeviceIdUtils
{
private
static
final
String
TAG
=
DeviceIdUtils
.
class
.
getSimpleName
();
private
static
final
String
TEMP_DIR
=
"system_config"
;
private
static
final
String
TEMP_FILE_NAME
=
"system_file"
;
private
static
final
String
TEMP_FILE_NAME_MIME_TYPE
=
"application/octet-stream"
;
private
static
final
String
SP_NAME
=
"device_info"
;
private
static
final
String
SP_KEY_DEVICE_ID
=
"device_id"
;
public
static
String
getDeviceId
(
Context
context
)
{
SharedPreferences
sharedPreferences
=
context
.
getSharedPreferences
(
SP_NAME
,
Context
.
MODE_PRIVATE
);
String
deviceId
=
sharedPreferences
.
getString
(
SP_KEY_DEVICE_ID
,
null
);
if
(!
TextUtils
.
isEmpty
(
deviceId
))
{
return
deviceId
;
}
deviceId
=
getIMEI
(
context
);
if
(
TextUtils
.
isEmpty
(
deviceId
))
{
deviceId
=
createUUID
(
context
);
}
sharedPreferences
.
edit
()
.
putString
(
SP_KEY_DEVICE_ID
,
deviceId
)
.
apply
();
return
deviceId
;
}
private
static
String
createUUID
(
Context
context
)
{
// String uuid = UUID.randomUUID().toString().replace("-", "");
String
uuid
=
IdUtil
.
createSnowflake
(
3
,
1
).
nextId
()
+
""
;
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
Q
)
{
Uri
externalContentUri
=
MediaStore
.
Downloads
.
EXTERNAL_CONTENT_URI
;
ContentResolver
contentResolver
=
context
.
getContentResolver
();
String
[]
projection
=
new
String
[]{
MediaStore
.
Downloads
.
_ID
};
String
selection
=
MediaStore
.
Downloads
.
TITLE
+
"=?"
;
String
[]
args
=
new
String
[]{
TEMP_FILE_NAME
};
Cursor
query
=
contentResolver
.
query
(
externalContentUri
,
projection
,
selection
,
args
,
null
);
if
(
query
!=
null
&&
query
.
moveToFirst
())
{
Uri
uri
=
ContentUris
.
withAppendedId
(
externalContentUri
,
query
.
getLong
(
0
));
query
.
close
();
InputStream
inputStream
=
null
;
BufferedReader
bufferedReader
=
null
;
try
{
inputStream
=
contentResolver
.
openInputStream
(
uri
);
if
(
inputStream
!=
null
)
{
bufferedReader
=
new
BufferedReader
(
new
InputStreamReader
(
inputStream
));
uuid
=
bufferedReader
.
readLine
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
bufferedReader
!=
null
)
{
try
{
bufferedReader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
if
(
inputStream
!=
null
)
{
try
{
inputStream
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
else
{
ContentValues
contentValues
=
new
ContentValues
();
contentValues
.
put
(
MediaStore
.
Downloads
.
TITLE
,
TEMP_FILE_NAME
);
contentValues
.
put
(
MediaStore
.
Downloads
.
MIME_TYPE
,
TEMP_FILE_NAME_MIME_TYPE
);
contentValues
.
put
(
MediaStore
.
Downloads
.
DISPLAY_NAME
,
TEMP_FILE_NAME
);
contentValues
.
put
(
MediaStore
.
Downloads
.
RELATIVE_PATH
,
Environment
.
DIRECTORY_DOWNLOADS
+
File
.
separator
+
TEMP_DIR
);
Uri
insert
=
contentResolver
.
insert
(
externalContentUri
,
contentValues
);
if
(
insert
!=
null
)
{
OutputStream
outputStream
=
null
;
try
{
outputStream
=
contentResolver
.
openOutputStream
(
insert
);
if
(
outputStream
==
null
)
{
return
uuid
;
}
outputStream
.
write
(
uuid
.
getBytes
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
outputStream
!=
null
)
{
try
{
outputStream
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
else
{
File
externalDownloadsDir
=
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DOWNLOADS
);
File
applicationFileDir
=
new
File
(
externalDownloadsDir
,
TEMP_DIR
);
if
(!
applicationFileDir
.
exists
())
{
if
(!
applicationFileDir
.
mkdirs
())
{
Log
.
e
(
TAG
,
"文件夹创建失败: "
+
applicationFileDir
.
getPath
());
}
}
File
file
=
new
File
(
applicationFileDir
,
TEMP_FILE_NAME
);
if
(!
file
.
exists
())
{
FileWriter
fileWriter
=
null
;
try
{
if
(
file
.
createNewFile
())
{
fileWriter
=
new
FileWriter
(
file
,
false
);
fileWriter
.
write
(
uuid
);
}
else
{
Log
.
e
(
TAG
,
"文件创建失败:"
+
file
.
getPath
());
}
}
catch
(
IOException
e
)
{
Log
.
e
(
TAG
,
"文件创建失败:"
+
file
.
getPath
());
e
.
printStackTrace
();
}
finally
{
if
(
fileWriter
!=
null
)
{
try
{
fileWriter
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
else
{
FileReader
fileReader
=
null
;
BufferedReader
bufferedReader
=
null
;
try
{
fileReader
=
new
FileReader
(
file
);
bufferedReader
=
new
BufferedReader
(
fileReader
);
uuid
=
bufferedReader
.
readLine
();
bufferedReader
.
close
();
fileReader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
bufferedReader
!=
null
)
{
try
{
bufferedReader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
if
(
fileReader
!=
null
)
{
try
{
fileReader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
return
uuid
;
}
private
static
String
getIMEI
(
Context
context
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
return
null
;
}
try
{
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
context
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
if
(
telephonyManager
==
null
)
{
return
null
;
}
@SuppressLint
({
"MissingPermission"
,
"HardwareIds"
})
String
imei
=
telephonyManager
.
getDeviceId
();
return
imei
;
}
catch
(
Exception
e
)
{
return
null
;
}
}
}
app/src/main/java/com/phlx/anchorcollect/util/DictUtils.java
View file @
199e5b54
...
...
@@ -12,8 +12,8 @@ public class DictUtils {
List
<
String
>
distNames
=
new
ArrayList
<>();
for
(
DictEntity
de:
Configs
.
dictList
)
{
if
(
type
.
equals
(
de
.
getType
())){
distNames
.
add
(
de
.
get
Name
());
if
(
type
.
equals
(
de
.
get
Dict
Type
())){
distNames
.
add
(
de
.
get
DictLabel
());
}
}
...
...
@@ -24,7 +24,7 @@ public class DictUtils {
List
<
DictEntity
>
dists
=
new
ArrayList
<>();
for
(
DictEntity
de:
Configs
.
dictList
)
{
if
(
type
.
equals
(
de
.
getType
())){
if
(
type
.
equals
(
de
.
get
Dict
Type
())){
dists
.
add
(
de
);
}
}
...
...
app/src/main/java/com/phlx/anchorcollect/util/EntityUtils.java
0 → 100644
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
util
;
import
com.phlx.anchorcollect.entity.CattleResumeEntity
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
public
class
EntityUtils
{
/**
* * 获取属性名数组
*
* @param
* @return
*/
public
static
String
[]
getFiledName
(
Object
user
)
{
Field
[]
fields
=
user
.
getClass
().
getDeclaredFields
();
String
[]
fieldNamStrings
=
new
String
[
fields
.
length
];
for
(
int
i
=
0
;
i
<
fieldNamStrings
.
length
;
i
++)
{
fieldNamStrings
[
i
]
=
fields
[
i
].
getName
();
}
return
fieldNamStrings
;
}
/**
*
* @Description 根据属性名 获取值(value)
* @param name
* @param user
* @return
* @throws IllegalAccessException
*/
public
static
Object
getFieldValueByName
(
String
name
,
Object
user
)
throws
IllegalAccessException
{
String
firstletter
=
name
.
substring
(
0
,
1
).
toUpperCase
();
String
getter
=
"get"
+
firstletter
+
name
.
substring
(
1
);
Method
method
;
Object
value
;
try
{
method
=
user
.
getClass
().
getMethod
(
getter
,
new
Class
[]
{});
value
=
method
.
invoke
(
user
,
new
CattleResumeEntity
[]
{});
return
value
;
}
catch
(
NoSuchMethodException
e
)
{
e
.
printStackTrace
();
}
catch
(
SecurityException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalArgumentException
e
)
{
}
catch
(
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
app/src/main/java/com/phlx/anchorcollect/util/StringUtil.java
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
util
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <pre>
...
...
@@ -78,4 +80,12 @@ public class StringUtil {
}
return
byteArray
;
}
public
static
List
<
String
>
strToList
(
String
[]
strings
){
List
<
String
>
stringArrayList
=
new
ArrayList
<>();
for
(
String
str:
strings
)
{
stringArrayList
.
add
(
str
);
}
return
stringArrayList
;
}
}
app/src/main/java/com/phlx/anchorcollect/widget/SpaceItemDecoration.java
0 → 100644
View file @
199e5b54
package
com
.
phlx
.
anchorcollect
.
widget
;
import
android.graphics.Rect
;
import
android.view.View
;
import
androidx.recyclerview.widget.RecyclerView
;
public
class
SpaceItemDecoration
extends
RecyclerView
.
ItemDecoration
{
private
int
space
;
public
SpaceItemDecoration
(
int
space
)
{
this
.
space
=
space
;
}
@Override
public
void
getItemOffsets
(
Rect
outRect
,
View
view
,
RecyclerView
parent
,
RecyclerView
.
State
state
)
{
//不是第一个的格子都设一个左边和底部的间距
outRect
.
left
=
space
;
outRect
.
bottom
=
space
;
//由于每行都只有3个,所以第一个都是3的倍数,把左边距设为0
// if (parent.getChildLayoutPosition(view) %3==0) {
// outRect.left = 0;
// }
}
}
\ No newline at end of file
app/src/main/res/layout/activity_bt_setting.xml
deleted
100644 → 0
View file @
5754d75f
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:binding=
"http://schemas.android.com/apk/res-auto"
>
<data>
<import
type=
"me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter"
/>
<import
type=
"me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LayoutManagers"
/>
<variable
name=
"viewModel"
type=
"com.phlx.anchorcollect.ui.setting.BtSettingVM"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@mipmap/home_bg"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/ll_button"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:orientation=
"horizontal"
android:layout_marginTop=
"15dp"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"刷新"
binding:onClickCommand=
"@{viewModel.OnRefreshClickCommand}"
/>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"停止"
binding:onClickCommand=
"@{viewModel.OnStopClickCommand}"
/>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"连接"
binding:onClickCommand=
"@{viewModel.OnConnectionClickCommand}"
/>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"断开"
binding:onClickCommand=
"@{viewModel.OnDisconnectionClickCommand}"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_0"
binding:layout_constraintTop_toBottomOf=
"@+id/ll_button"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintBottom_toBottomOf=
"parent"
binding:itemBinding=
"@{viewModel.itemBinding}"
binding:items=
"@{viewModel.observableList}"
binding:layoutManager=
"@{LayoutManagers.linear()}"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/activity_setting.xml
0 → 100644
View file @
199e5b54
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:binding=
"http://schemas.android.com/apk/res-auto"
>
<data>
<import
type=
"me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter"
/>
<import
type=
"me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LayoutManagers"
/>
<variable
name=
"viewModel"
type=
"com.phlx.anchorcollect.ui.setting.SettingVM"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@mipmap/home_bg"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/guideline_vertical"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
binding:layout_constraintGuide_percent=
"0.60"
/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/ll_button"
android:layout_width=
"0dp"
android:layout_height=
"50dp"
android:layout_marginTop=
"15dp"
android:orientation=
"horizontal"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toLeftOf=
"@+id/guideline_vertical"
binding:layout_constraintTop_toTopOf=
"parent"
>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"刷新"
binding:onClickCommand=
"@{viewModel.OnRefreshClickCommand}"
/>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"停止"
binding:onClickCommand=
"@{viewModel.OnStopClickCommand}"
/>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"连接"
binding:onClickCommand=
"@{viewModel.OnConnectionClickCommand}"
/>
<androidx.appcompat.widget.AppCompatButton
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"断开"
binding:onClickCommand=
"@{viewModel.OnDisconnectionClickCommand}"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_0"
binding:itemBinding=
"@{viewModel.itemBinding}"
binding:items=
"@{viewModel.observableList}"
binding:layoutManager=
"@{LayoutManagers.linear()}"
binding:layout_constraintBottom_toBottomOf=
"parent"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toLeftOf=
"@+id/guideline_vertical"
binding:layout_constraintTop_toBottomOf=
"@+id/ll_button"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
binding:layout_constraintLeft_toRightOf=
"@+id/guideline_vertical"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
binding:layout_constraintBottom_toBottomOf=
"parent"
>
<!-- base_archives -->
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_base_archives_sync"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
android:text=
"@string/base_archives"
binding:layout_constraintTop_toTopOf=
"parent"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintBottom_toTopOf=
"@+id/btn_sign_measure_sync"
binding:onClickCommand=
"@{viewModel.OnBaseArchivesSyncClickCommand}"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_base_archives_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
android:text=
"(0)"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/btn_base_archives_sync"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_base_archives_sync"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_base_archives_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:text=
"111111111"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/tv_base_archives_count"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_base_archives_sync"
/>
<!-- sign_measure -->
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_sign_measure_sync"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/sign_measure"
binding:layout_constraintTop_toBottomOf=
"@+id/btn_base_archives_sync"
binding:layout_constraintLeft_toLeftOf=
"@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toTopOf=
"@+id/btn_weighting_manage_sync"
binding:onClickCommand=
"@{viewModel.OnSignMeasureSyncClickCommand}"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_sign_measure_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
android:text=
"(0)"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/btn_sign_measure_sync"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_sign_measure_sync"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_sign_measure_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:text=
"11111111"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/tv_sign_measure_count"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_sign_measure_sync"
/>
<!-- weighting_manage -->
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_weighting_manage_sync"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/weighting_manage"
binding:layout_constraintTop_toBottomOf=
"@+id/btn_sign_measure_sync"
binding:layout_constraintLeft_toLeftOf=
"@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toTopOf=
"@+id/btn_treatment_record_sync"
binding:onClickCommand=
"@{viewModel.OnWeightingManageSyncClickCommand}"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_weighting_manage_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
android:text=
"(0)"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/btn_weighting_manage_sync"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_weighting_manage_sync"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_weighting_manage_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:text=
"11111"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/tv_weighting_manage_count"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_weighting_manage_sync"
/>
<!-- treatment_record -->
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_treatment_record_sync"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/treatment_record"
binding:layout_constraintTop_toBottomOf=
"@+id/btn_weighting_manage_sync"
binding:layout_constraintLeft_toLeftOf=
"@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toTopOf=
"@+id/btn_immun_record_sync"
binding:onClickCommand=
"@{viewModel.OnTreatmentRecordSyncClickCommand}"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_treatment_record_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
android:text=
"(0)"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/btn_treatment_record_sync"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_treatment_record_sync"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_treatment_record_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:text=
"1111111111111111"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/tv_treatment_record_count"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_treatment_record_sync"
/>
<!-- immun_record -->
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_immun_record_sync"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/immun_record"
binding:layout_constraintTop_toBottomOf=
"@+id/btn_treatment_record_sync"
binding:layout_constraintLeft_toLeftOf=
"@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toTopOf=
"@+id/btn_breeding_record_sync"
binding:onClickCommand=
"@{viewModel.OnImmunRecordSyncClickCommand}"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_immun_record_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
android:text=
"(0)"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/btn_immun_record_sync"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_immun_record_sync"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_immun_record_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:text=
"111"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/tv_immun_record_count"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_immun_record_sync"
/>
<!-- breeding_record -->
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/btn_breeding_record_sync"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/breeding_record"
binding:layout_constraintTop_toBottomOf=
"@+id/btn_immun_record_sync"
binding:layout_constraintLeft_toLeftOf=
"@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toBottomOf=
"parent"
binding:onClickCommand=
"@{viewModel.OnBreedingRecordSyncClickCommand}"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_breeding_record_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"5dp"
android:text=
"(0)"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/btn_breeding_record_sync"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_breeding_record_sync"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_breeding_record_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:text=
"222"
android:textColor=
"@color/white"
binding:layout_constraintLeft_toRightOf=
"@+id/tv_breeding_record_count"
binding:layout_constraintBaseline_toBaselineOf=
"@+id/btn_breeding_record_sync"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/fragment_basics_collect.xml
View file @
199e5b54
...
...
@@ -319,26 +319,38 @@
binding:layout_constraintLeft_toLeftOf=
"@+id/tv_title_bwg"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!--右侧设置按钮-->
<ImageView
android:id=
"@+id/iv_setting"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_set"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
binding:onClickCommand=
"@{viewModel.onSettingClick}"
/>
<!--右侧表格区-->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_margin
Left
=
"5dp"
android:layout_margin
Top
=
"5dp"
binding:layout_constraintBottom_toBottomOf=
"parent"
binding:layout_constraintLeft_toLeftOf=
"@+id/guideline_vertical"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_to
TopOf=
"parent
"
>
binding:layout_constraintTop_to
BottomOf=
"@+id/iv_setting
"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/card_100"
android:layout_width=
"0dp"
android:layout_height=
"80dp"
android:layout_height=
"97dp"
android:layout_marginLeft=
"@dimen/dp_5"
android:background=
"@drawable/bg_radius_white_5"
app:layout_constraintDimensionRatio=
"1:1"
binding:layout_constraintHorizontal_chainStyle=
"spread"
binding:layout_constraintHorizontal_chainStyle=
"spread_inside"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toLeftOf=
"@+id/card_0"
binding:layout_constraintTop_toTopOf=
"parent"
>
<!-- app:layout_constraintDimensionRatio="1:1"-->
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/iv_cattle_photo"
...
...
@@ -367,6 +379,8 @@
android:id=
"@+id/tv_title_0"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(0).columnComment}"
android:textColor=
"@color/color_font_null"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -375,6 +389,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1dp"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(0).showName}"
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -398,6 +414,8 @@
android:id=
"@+id/tv_title_1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(1).columnComment}"
android:textColor=
"@color/color_font_null"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -406,6 +424,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1dp"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(1).showName}"
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -430,6 +450,8 @@
android:id=
"@+id/tv_title_2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(2).columnComment}"
android:textColor=
"@color/color_font_null"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -438,6 +460,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1dp"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(2).showName}"
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -462,6 +486,8 @@
android:id=
"@+id/tv_title_3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(3).columnComment}"
android:textColor=
"@color/color_font_null"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -470,34 +496,39 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1dp"
android:maxLines=
"1"
android:singleLine=
"true"
android:text=
"@{viewModel.uiList.get(3).showName}"
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp_8"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_collect"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginTop=
"5dp"
binding:adapter=
"@{adapter}"
binding:itemBinding=
"@{viewModel.itemBinding}"
binding:items=
"@{viewModel.observableList}"
binding:layoutManager=
"@{LayoutManagers.grid(3)}"
binding:adapter=
"@{adapter}"
binding:layout_constraintBottom_toTopOf=
"@+id/card_16"
binding:layout_constraintBottom_toTopOf=
"@+id/card_99"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_toBottomOf=
"@+id/card_100"
/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/card_
16
"
android:id=
"@+id/card_
99
"
android:layout_width=
"0dp"
android:layout_height=
"37dp"
android:background=
"@drawable/bg_radius_white_5"
android:onClick=
"@{() ->viewModel.click(
16
)}"
android:onClick=
"@{() ->viewModel.click(
99
)}"
android:orientation=
"vertical"
android:padding=
"5dp"
binding:layout_constraintLeft_toLeftOf=
"@+id/card_100"
binding:layout_constraintRight_toRightOf=
"@+id/card_0"
binding:layout_constraintTop_toTopOf=
"@+id/card_save"
>
binding:layout_constraintBottom_toBottomOf=
"parent"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_title_16"
...
...
@@ -511,7 +542,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1dp"
android:text=
"@{viewModel.remark}"
android:text=
"@{viewModel.remark
ParamEntity.showName
}"
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp_8"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
...
...
@@ -519,13 +550,13 @@
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/card_save"
android:layout_width=
"
98
dp"
android:layout_width=
"
100
dp"
android:layout_height=
"37dp"
android:layout_marginLeft=
"5dp"
android:background=
"@drawable/bg_radius_white_5"
binding:layout_constraintBottom_toBottomOf=
"parent"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_toBottomOf=
"@+id/card_15"
binding:layout_constraintVertical_chainStyle=
"spread_inside"
>
>
<!-- binding:onClickCommand="@{viewModel.onCardSaveClick}"-->
<androidx.appcompat.widget.AppCompatTextView
...
...
app/src/main/res/layout/fragment_performance.xml
0 → 100644
View file @
199e5b54
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/tools"
xmlns:binding=
"http://schemas.android.com/apk/res-auto"
app:ignore=
"NamespaceTypo"
>
<data>
<import
type=
"me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter"
/>
<import
type=
"me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LayoutManagers"
/>
<import
type=
"me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LineManagers"
/>
<variable
name=
"viewModel"
type=
"com.phlx.anchorcollect.ui.fragment.vm.PerformanceVM"
/>
<variable
name=
"spinnerAdapter"
type=
"android.widget.ArrayAdapter"
/>
<variable
name=
"adapter"
type=
"BindingRecyclerViewAdapter"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_bg"
android:padding=
"5dp"
>
<TextView
android:id=
"@+id/tv_rfid_text"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_32"
android:background=
"@drawable/bg_radius_stroke_white_5"
android:gravity=
"center"
android:hint=
"未扫到电子耳标"
android:text=
""
android:textColor=
"@color/white"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_collect"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginTop=
"5dp"
binding:adapter=
"@{adapter}"
binding:itemBinding=
"@{viewModel.itemBinding}"
binding:items=
"@{viewModel.observableList}"
binding:layoutManager=
"@{LayoutManagers.grid(5)}"
binding:layout_constraintBottom_toTopOf=
"@+id/card_99"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toRightOf=
"parent"
binding:layout_constraintTop_toBottomOf=
"@+id/tv_rfid_text"
/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/card_99"
android:layout_width=
"0dp"
android:layout_height=
"37dp"
android:background=
"@drawable/bg_radius_white_5"
android:onClick=
"@{() ->viewModel.click(99)}"
android:orientation=
"vertical"
android:padding=
"5dp"
binding:layout_constraintLeft_toLeftOf=
"parent"
binding:layout_constraintRight_toLeftOf=
"@+id/card_save"
binding:layout_constraintBottom_toBottomOf=
"parent"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_title_16"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"备注"
android:textColor=
"@color/colorPrimary"
android:textSize=
"@dimen/sp_8"
/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1dp"
android:text=
"@{viewModel.remarkParamEntity.showName}"
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp_8"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/card_save"
android:layout_width=
"100dp"
android:layout_height=
"37dp"
android:layout_marginLeft=
"5dp"
android:background=
"@drawable/bg_radius_white_5"
binding:layout_constraintBottom_toBottomOf=
"parent"
binding:layout_constraintRight_toRightOf=
"parent"
>
<!-- binding:onClickCommand="@{viewModel.onCardSaveClick}"-->
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/bg_button_orange_gradient"
android:gravity=
"center"
android:text=
"保存"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_12"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/item_collect_grid.xml
View file @
199e5b54
...
...
@@ -13,7 +13,7 @@
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/card_0"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
46dp
"
android:background=
"@drawable/bg_radius_white_5"
android:orientation=
"vertical"
android:padding=
"5dp"
...
...
@@ -24,6 +24,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{viewModel.entity.columnComment}"
android:singleLine=
"true"
android:maxLines=
"1"
android:textColor=
"@color/color_font_null"
android:textSize=
"@dimen/sp_8"
/>
...
...
@@ -32,6 +34,8 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1dp"
android:text=
"@{viewModel.entity.showName}"
android:singleLine=
"true"
android:maxLines=
"1"
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp_8"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
...
...
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