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
beed5e0a
Commit
beed5e0a
authored
Mar 26, 2023
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.性能测定带实时重量;
2.输入框点其他位置不取消
parent
15b33a45
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
145 additions
and
111 deletions
+145
-111
BtService.java
app/src/main/java/com/phlx/anchorcollect/bt/BtService.java
+1
-1
BreedingRecordDetailEntity.java
...phlx/anchorcollect/entity/BreedingRecordDetailEntity.java
+1
-1
RetrofitClient.java
.../main/java/com/phlx/anchorcollect/net/RetrofitClient.java
+4
-4
BasicsCollectFragment.java
...phlx/anchorcollect/ui/fragment/BasicsCollectFragment.java
+2
-0
BreedingRecordFragment.java
...hlx/anchorcollect/ui/fragment/BreedingRecordFragment.java
+2
-1
ImmunRecordFragment.java
...m/phlx/anchorcollect/ui/fragment/ImmunRecordFragment.java
+1
-0
MedicalRecordFragment.java
...phlx/anchorcollect/ui/fragment/MedicalRecordFragment.java
+1
-0
PerformanceFragment.java
...m/phlx/anchorcollect/ui/fragment/PerformanceFragment.java
+1
-0
WeightManFragment.java
...com/phlx/anchorcollect/ui/fragment/WeightManFragment.java
+1
-0
BasicsCollectVM.java
...om/phlx/anchorcollect/ui/fragment/vm/BasicsCollectVM.java
+2
-2
WeightManVM.java
...va/com/phlx/anchorcollect/ui/fragment/vm/WeightManVM.java
+2
-2
CattleActivity.java
...n/java/com/phlx/anchorcollect/ui/info/CattleActivity.java
+28
-25
CattleVM.java
...rc/main/java/com/phlx/anchorcollect/ui/info/CattleVM.java
+98
-69
ic_launcher.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+0
-5
ic_launcher_round.xml
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+1
-1
ic_launcher.png
app/src/main/res/mipmap-hdpi/ic_launcher.png
+0
-0
ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
+0
-0
ic_launcher.png
app/src/main/res/mipmap-xhdpi/ic_launcher.png
+0
-0
ic_launcher.png
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+0
-0
ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+0
-0
No files found.
app/src/main/java/com/phlx/anchorcollect/bt/BtService.java
View file @
beed5e0a
...
@@ -69,7 +69,7 @@ public class BtService extends Service implements EventObserver {
...
@@ -69,7 +69,7 @@ public class BtService extends Service implements EventObserver {
public
void
onRead
(
@NonNull
BluetoothDevice
device
,
@NonNull
byte
[]
value
)
{
public
void
onRead
(
@NonNull
BluetoothDevice
device
,
@NonNull
byte
[]
value
)
{
String
data
=
new
String
(
value
);
String
data
=
new
String
(
value
);
Log
.
e
(
TAG
,
"onRead: "
+
data
);
//
Log.e(TAG, "onRead: " + data);
// ToastUtils.showShort("onRead: " + data);
// ToastUtils.showShort("onRead: " + data);
String
weightData
=
data
.
substring
(
data
.
indexOf
(
"wn"
)
+
3
,
data
.
indexOf
(
"kg"
));
String
weightData
=
data
.
substring
(
data
.
indexOf
(
"wn"
)
+
3
,
data
.
indexOf
(
"kg"
));
...
...
app/src/main/java/com/phlx/anchorcollect/entity/BreedingRecordDetailEntity.java
View file @
beed5e0a
...
@@ -37,7 +37,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
...
@@ -37,7 +37,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
private
String
matingStyle
;
private
String
matingStyle
;
/**
/**
*
种畜耳标
号
*
本交公牛种畜主键
号
*/
*/
private
Long
cattleresumeId
;
private
Long
cattleresumeId
;
...
...
app/src/main/java/com/phlx/anchorcollect/net/RetrofitClient.java
View file @
beed5e0a
...
@@ -50,15 +50,15 @@ public class RetrofitClient {
...
@@ -50,15 +50,15 @@ public class RetrofitClient {
private
static
final
int
CACHE_TIMEOUT
=
10
*
1024
*
1024
;
private
static
final
int
CACHE_TIMEOUT
=
10
*
1024
*
1024
;
//服务端根路径
//服务端根路径
public
static
String
baseUrl
=
public
static
String
baseUrl
=
//
"serve.xlglmnmyzspt.org.cn"//正式
"serve.xlglmnmyzspt.org.cn"
//正式
// "39.101.170.186"//阿里云测试
// "39.101.170.186"//阿里云测试
"192.168.8.135"
//董
//
"192.168.8.135"//董
// "192.168.43.154"//张敏
// "192.168.43.154"//张敏
;
;
public
static
String
port
=
public
static
String
port
=
//
""//正式
""
//正式
// "9000"//阿里云测试
// "9000"//阿里云测试
"9000"
//董
//
"9000"//董
;
;
private
static
Context
mContext
=
Utils
.
getContext
();
private
static
Context
mContext
=
Utils
.
getContext
();
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/BasicsCollectFragment.java
View file @
beed5e0a
...
@@ -126,6 +126,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
...
@@ -126,6 +126,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
viewModel
.
initDataForUnid
(
Configs
.
tempUnid
);
viewModel
.
initDataForUnid
(
Configs
.
tempUnid
);
Configs
.
currentEvent
=
EventTag
.
EVENT_WEIGHT_DATA_BASICS
;
Configs
.
currentEvent
=
EventTag
.
EVENT_WEIGHT_DATA_BASICS
;
}
else
{
}
else
{
Configs
.
currentEvent
=
EventTag
.
EVENT_WEIGHT_DATA_BASICS
;
viewModel
.
removeInventoryListener
();
viewModel
.
removeInventoryListener
();
Configs
.
currentEvent
=
""
;
Configs
.
currentEvent
=
""
;
App
.
getInstance
().
getLinkage
().
stopInventory
();
App
.
getInstance
().
getLinkage
().
stopInventory
();
...
@@ -355,6 +356,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
...
@@ -355,6 +356,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
new
MaterialDialog
.
Builder
(
getActivity
())
new
MaterialDialog
.
Builder
(
getActivity
())
.
title
(
uiParamEntity
.
getColumnComment
())
.
title
(
uiParamEntity
.
getColumnComment
())
// .iconRes(R.drawable.ic_logo)
// .iconRes(R.drawable.ic_logo)
.
canceledOnTouchOutside
(
false
)
.
content
(
"请输入"
)
.
content
(
"请输入"
)
// .widgetColor(Color.BLUE)//输入框光标的颜色
// .widgetColor(Color.BLUE)//输入框光标的颜色
.
inputType
(
inputType
)
//可以输入的类型
.
inputType
(
inputType
)
//可以输入的类型
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/BreedingRecordFragment.java
View file @
beed5e0a
...
@@ -205,7 +205,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
...
@@ -205,7 +205,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
private
void
showCheckboxDialog
(
GenTableColumn
uiParamEntity
)
{
private
void
showCheckboxDialog
(
GenTableColumn
uiParamEntity
)
{
new
MaterialDialog
.
Builder
(
getActivity
()).
title
(
"系统信息"
).
content
(
"请选择!!!"
)
new
MaterialDialog
.
Builder
(
getActivity
()).
title
(
"系统信息"
).
content
(
"请选择!!!"
)
.
cancelable
(
false
).
canceledOnTouchOutside
(
false
)
//
.cancelable(false).canceledOnTouchOutside(false)
.
positiveText
(
"确定"
)
.
positiveText
(
"确定"
)
.
items
(
DictUtils
.
getDistNameList
(
uiParamEntity
.
getDictType
()))
.
items
(
DictUtils
.
getDistNameList
(
uiParamEntity
.
getDictType
()))
.
itemsCallbackMultiChoice
(
null
,
new
MaterialDialog
.
ListCallbackMultiChoice
()
{
.
itemsCallbackMultiChoice
(
null
,
new
MaterialDialog
.
ListCallbackMultiChoice
()
{
...
@@ -270,6 +270,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
...
@@ -270,6 +270,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
new
MaterialDialog
.
Builder
(
getActivity
())
new
MaterialDialog
.
Builder
(
getActivity
())
.
title
(
uiParamEntity
.
getColumnComment
())
.
title
(
uiParamEntity
.
getColumnComment
())
// .iconRes(R.drawable.ic_logo)
// .iconRes(R.drawable.ic_logo)
.
canceledOnTouchOutside
(
false
)
.
content
(
"请输入"
)
.
content
(
"请输入"
)
// .widgetColor(Color.BLUE)//输入框光标的颜色
// .widgetColor(Color.BLUE)//输入框光标的颜色
.
inputType
(
inputType
)
//可以输入的类型
.
inputType
(
inputType
)
//可以输入的类型
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/ImmunRecordFragment.java
View file @
beed5e0a
...
@@ -255,6 +255,7 @@ public class ImmunRecordFragment extends BaseFragment<FragmentImmunRecordBinding
...
@@ -255,6 +255,7 @@ public class ImmunRecordFragment extends BaseFragment<FragmentImmunRecordBinding
new
MaterialDialog
.
Builder
(
getActivity
())
new
MaterialDialog
.
Builder
(
getActivity
())
.
title
(
uiParamEntity
.
getColumnComment
())
.
title
(
uiParamEntity
.
getColumnComment
())
// .iconRes(R.drawable.ic_logo)
// .iconRes(R.drawable.ic_logo)
.
canceledOnTouchOutside
(
false
)
.
content
(
"请输入"
)
.
content
(
"请输入"
)
// .widgetColor(Color.BLUE)//输入框光标的颜色
// .widgetColor(Color.BLUE)//输入框光标的颜色
.
inputType
(
inputType
)
//可以输入的类型
.
inputType
(
inputType
)
//可以输入的类型
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/MedicalRecordFragment.java
View file @
beed5e0a
...
@@ -253,6 +253,7 @@ public class MedicalRecordFragment extends BaseFragment<FragmentMedicalRecordBin
...
@@ -253,6 +253,7 @@ public class MedicalRecordFragment extends BaseFragment<FragmentMedicalRecordBin
new
MaterialDialog
.
Builder
(
getActivity
())
new
MaterialDialog
.
Builder
(
getActivity
())
.
title
(
uiParamEntity
.
getColumnComment
())
.
title
(
uiParamEntity
.
getColumnComment
())
// .iconRes(R.drawable.ic_logo)
// .iconRes(R.drawable.ic_logo)
.
canceledOnTouchOutside
(
false
)
.
content
(
"请输入"
)
.
content
(
"请输入"
)
// .widgetColor(Color.BLUE)//输入框光标的颜色
// .widgetColor(Color.BLUE)//输入框光标的颜色
.
inputType
(
inputType
)
//可以输入的类型
.
inputType
(
inputType
)
//可以输入的类型
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/PerformanceFragment.java
View file @
beed5e0a
...
@@ -256,6 +256,7 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
...
@@ -256,6 +256,7 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
new
MaterialDialog
.
Builder
(
getActivity
())
new
MaterialDialog
.
Builder
(
getActivity
())
.
title
(
uiParamEntity
.
getColumnComment
())
.
title
(
uiParamEntity
.
getColumnComment
())
// .iconRes(R.drawable.ic_logo)
// .iconRes(R.drawable.ic_logo)
.
canceledOnTouchOutside
(
false
)
.
content
(
"请输入"
)
.
content
(
"请输入"
)
// .widgetColor(Color.BLUE)//输入框光标的颜色
// .widgetColor(Color.BLUE)//输入框光标的颜色
.
inputType
(
inputType
)
//可以输入的类型
.
inputType
(
inputType
)
//可以输入的类型
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/WeightManFragment.java
View file @
beed5e0a
...
@@ -393,6 +393,7 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
...
@@ -393,6 +393,7 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
new
MaterialDialog
.
Builder
(
getActivity
())
new
MaterialDialog
.
Builder
(
getActivity
())
.
title
(
uiParamEntity
.
getColumnComment
())
.
title
(
uiParamEntity
.
getColumnComment
())
// .iconRes(R.drawable.ic_logo)
// .iconRes(R.drawable.ic_logo)
.
canceledOnTouchOutside
(
false
)
.
content
(
"请输入"
)
.
content
(
"请输入"
)
// .widgetColor(Color.BLUE)//输入框光标的颜色
// .widgetColor(Color.BLUE)//输入框光标的颜色
.
inputType
(
inputType
)
//可以输入的类型
.
inputType
(
inputType
)
//可以输入的类型
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/vm/BasicsCollectVM.java
View file @
beed5e0a
...
@@ -575,7 +575,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
...
@@ -575,7 +575,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
Double
weightNum
=
Double
.
parseDouble
(
eventType
.
getObj
().
toString
().
trim
());
Double
weightNum
=
Double
.
parseDouble
(
eventType
.
getObj
().
toString
().
trim
());
if
(
weightNum
>
25
)
{
if
(
weightNum
>
25
)
{
scanRfid
();
scanRfid
();
if
(
isWeightScan
)
//
if (isWeightScan)
Configs
.
tempWeight
=
weightNum
;
Configs
.
tempWeight
=
weightNum
;
isWeightScan
=
false
;
isWeightScan
=
false
;
}
else
{
}
else
{
...
@@ -608,7 +608,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
...
@@ -608,7 +608,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
Configs
.
tempUnid
=
null
;
Configs
.
tempUnid
=
null
;
Configs
.
tempRfid
=
""
;
Configs
.
tempRfid
=
""
;
Configs
.
tempCattleResume
=
null
;
Configs
.
tempCattleResume
=
null
;
Configs
.
tempWeight
=
0.0
;
//
Configs.tempWeight = 0.0;
tag
.
set
(
""
);
tag
.
set
(
""
);
rfid
.
set
(
""
);
rfid
.
set
(
""
);
rfidTag
=
""
;
rfidTag
=
""
;
...
...
app/src/main/java/com/phlx/anchorcollect/ui/fragment/vm/WeightManVM.java
View file @
beed5e0a
...
@@ -657,7 +657,7 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
...
@@ -657,7 +657,7 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
Double
weightNum
=
Double
.
parseDouble
(
eventType
.
getObj
().
toString
().
trim
());
Double
weightNum
=
Double
.
parseDouble
(
eventType
.
getObj
().
toString
().
trim
());
if
(
weightNum
>
25
)
{
if
(
weightNum
>
25
)
{
scanRfid
();
scanRfid
();
if
(
isWeightScan
)
//
if (isWeightScan)
Configs
.
tempWeight
=
weightNum
;
Configs
.
tempWeight
=
weightNum
;
isWeightScan
=
false
;
isWeightScan
=
false
;
}
else
{
}
else
{
...
@@ -700,7 +700,7 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
...
@@ -700,7 +700,7 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
Configs
.
tempUnid
=
null
;
Configs
.
tempUnid
=
null
;
Configs
.
tempRfid
=
""
;
Configs
.
tempRfid
=
""
;
Configs
.
tempCattleResume
=
null
;
Configs
.
tempCattleResume
=
null
;
Configs
.
tempWeight
=
0.0
;
//
Configs.tempWeight = 0.0;
tag
.
set
(
""
);
tag
.
set
(
""
);
rfid
.
set
(
""
);
rfid
.
set
(
""
);
rfidTag
=
""
;
rfidTag
=
""
;
...
...
app/src/main/java/com/phlx/anchorcollect/ui/info/CattleActivity.java
View file @
beed5e0a
...
@@ -303,7 +303,7 @@ public class CattleActivity extends BaseActivity<AvtivityCattleBinding, CattleVM
...
@@ -303,7 +303,7 @@ public class CattleActivity extends BaseActivity<AvtivityCattleBinding, CattleVM
//初始化表头
//初始化表头
List
<
String
>
headerStr
=
new
ArrayList
<>();
List
<
String
>
headerStr
=
new
ArrayList
<>();
List
<
String
>
fieldNameStr
=
new
ArrayList
<>();
List
<
String
>
fieldNameStr
=
new
ArrayList
<>();
for
(
GenTableColumn
gtc
:
Configs
.
cattlemating
Master
)
{
for
(
GenTableColumn
gtc
:
Configs
.
cattlemating
DetaillList
)
{
if
(
"1"
.
equals
(
gtc
.
getIsList
()))
{
if
(
"1"
.
equals
(
gtc
.
getIsList
()))
{
headerStr
.
add
(
gtc
.
getColumnComment
());
headerStr
.
add
(
gtc
.
getColumnComment
());
fieldNameStr
.
add
(
gtc
.
getJavaField
());
fieldNameStr
.
add
(
gtc
.
getJavaField
());
...
@@ -336,30 +336,33 @@ public class CattleActivity extends BaseActivity<AvtivityCattleBinding, CattleVM
...
@@ -336,30 +336,33 @@ public class CattleActivity extends BaseActivity<AvtivityCattleBinding, CattleVM
// 初始化表格
// 初始化表格
mDataGridView
.
initDataGridView
();
mDataGridView
.
initDataGridView
();
// mDataGridView.setOnItemCellClickListener(new RecyclerviewAdapter.OnItemCellClickListener() {
mDataGridView
.
setOnItemCellClickListener
(
new
RecyclerviewAdapter
.
OnItemCellClickListener
()
{
// @Override
@Override
// public void onClick(View v, int row, int column) {
public
void
onClick
(
View
v
,
int
row
,
int
column
)
{
//// ToastUtils.showShort("row:" + row + " column:" + column);
// ToastUtils.showShort("row:" + row + " column:" + column);
// BreedingRecordEntity rowData = (BreedingRecordEntity) (mDataGridView.getRowData(row));
BreedingRecordDetailEntity
rowData
=
(
BreedingRecordDetailEntity
)
(
mDataGridView
.
getRowData
(
row
));
//
// new MaterialDialog
new
MaterialDialog
// .Builder(CattleActivity.this)
.
Builder
(
CattleActivity
.
this
)
// .title("替换提示")
.
title
(
"替换提示"
)
// .content("要跳转配种数据详情吗?")
.
content
(
"要跳转配种数据详情吗?"
)
// .positiveText("确定")
.
positiveText
(
"确定"
)
// .negativeText("取消")
.
negativeText
(
"取消"
)
// .onPositive(new MaterialDialog.SingleButtonCallback() {
.
onPositive
(
new
MaterialDialog
.
SingleButtonCallback
()
{
// @Override
@Override
// public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
public
void
onClick
(
@NonNull
MaterialDialog
dialog
,
@NonNull
DialogAction
which
)
{
// if (which == DialogAction.POSITIVE) {
if
(
which
==
DialogAction
.
POSITIVE
)
{
//
Configs
.
mainPosition
=
5
;
// }
Configs
.
resumeId
=
rowData
.
getFUnid
();
// }
startActivity
(
MainActivity
.
class
);
// }).show();
finish
();
// }
}
// });
}
}).
show
();
viewModel
.
queryBreedingRecordList
();
}
});
viewModel
.
queryBreedingRecordDetailList
();
}
}
...
...
app/src/main/java/com/phlx/anchorcollect/ui/info/CattleVM.java
View file @
beed5e0a
...
@@ -12,6 +12,7 @@ import com.phlx.anchorcollect.Configs;
...
@@ -12,6 +12,7 @@ import com.phlx.anchorcollect.Configs;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.R
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.data.Repository
;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.DbUtil
;
import
com.phlx.anchorcollect.db.gen.BreedingRecordDetailEntityDao
;
import
com.phlx.anchorcollect.db.gen.BreedingRecordEntityDao
;
import
com.phlx.anchorcollect.db.gen.BreedingRecordEntityDao
;
import
com.phlx.anchorcollect.db.gen.DictEntityDao
;
import
com.phlx.anchorcollect.db.gen.DictEntityDao
;
import
com.phlx.anchorcollect.db.gen.ImmuneBatchDetailEntityDao
;
import
com.phlx.anchorcollect.db.gen.ImmuneBatchDetailEntityDao
;
...
@@ -19,6 +20,7 @@ import com.phlx.anchorcollect.db.gen.ImmuneBatchEntityDao;
...
@@ -19,6 +20,7 @@ import com.phlx.anchorcollect.db.gen.ImmuneBatchEntityDao;
import
com.phlx.anchorcollect.db.gen.MedicalRecordEntityDao
;
import
com.phlx.anchorcollect.db.gen.MedicalRecordEntityDao
;
import
com.phlx.anchorcollect.db.gen.PerformanceEntityDao
;
import
com.phlx.anchorcollect.db.gen.PerformanceEntityDao
;
import
com.phlx.anchorcollect.db.interf.DbQueryCallBack
;
import
com.phlx.anchorcollect.db.interf.DbQueryCallBack
;
import
com.phlx.anchorcollect.entity.BreedingRecordDetailEntity
;
import
com.phlx.anchorcollect.entity.BreedingRecordEntity
;
import
com.phlx.anchorcollect.entity.BreedingRecordEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.DictEntity
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
import
com.phlx.anchorcollect.entity.GenTableColumn
;
...
@@ -27,6 +29,7 @@ import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
...
@@ -27,6 +29,7 @@ import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import
com.phlx.anchorcollect.entity.MedicalRecordEntity
;
import
com.phlx.anchorcollect.entity.MedicalRecordEntity
;
import
com.phlx.anchorcollect.entity.PerformanceEntity
;
import
com.phlx.anchorcollect.entity.PerformanceEntity
;
import
com.phlx.anchorcollect.ui.base.BackBarVM
;
import
com.phlx.anchorcollect.ui.base.BackBarVM
;
import
com.phlx.anchorcollect.util.DateUtils
;
import
com.phlx.anchorcollect.util.EntityUtils
;
import
com.phlx.anchorcollect.util.EntityUtils
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
org.greenrobot.greendao.query.QueryBuilder
;
...
@@ -53,6 +56,7 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -53,6 +56,7 @@ public class CattleVM extends BackBarVM<Repository> {
private
List
<
ImmuneBatchEntity
>
immuneBatchEntityList
;
private
List
<
ImmuneBatchEntity
>
immuneBatchEntityList
;
// private List<ImmuneBatchDetailEntity> immuneBatchDetailEntityList;
// private List<ImmuneBatchDetailEntity> immuneBatchDetailEntityList;
private
List
<
BreedingRecordEntity
>
breedingRecordEntityList
;
private
List
<
BreedingRecordEntity
>
breedingRecordEntityList
;
private
List
<
BreedingRecordDetailEntity
>
breedingRecordDetailEntityList
;
//给RecyclerView添加ItemBinding
//给RecyclerView添加ItemBinding
public
ItemBinding
<
CattleItem
>
itemBinding
=
ItemBinding
.
of
(
BR
.
viewModel
,
R
.
layout
.
item_cattle_rv
);
public
ItemBinding
<
CattleItem
>
itemBinding
=
ItemBinding
.
of
(
BR
.
viewModel
,
R
.
layout
.
item_cattle_rv
);
...
@@ -154,7 +158,7 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -154,7 +158,7 @@ public class CattleVM extends BackBarVM<Repository> {
}
}
}).
queryAsyncAll
(
ImmuneBatchEntity
.
class
,
builder
);
}).
queryAsyncAll
(
ImmuneBatchEntity
.
class
,
builder
);
}
}
}
else
{
}
else
{
observableRefreshList
.
setValue
(
2
);
observableRefreshList
.
setValue
(
2
);
}
}
}
}
...
@@ -192,6 +196,32 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -192,6 +196,32 @@ public class CattleVM extends BackBarVM<Repository> {
}
}
public
void
queryBreedingRecordDetailList
()
{
QueryBuilder
<
BreedingRecordDetailEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
BreedingRecordDetailEntity
.
class
)
.
where
(
BreedingRecordDetailEntityDao
.
Properties
.
CaId
.
eq
(
Configs
.
tempUnid
)
,
BreedingRecordDetailEntityDao
.
Properties
.
CreateTime
.
like
(
DateUtils
.
getYear
()
+
"%"
)
)
.
orderDesc
(
BreedingRecordDetailEntityDao
.
Properties
.
CreateTime
);
DbUtil
.
getInstance
().
setDbQueryCallBack
(
new
DbQueryCallBack
<
BreedingRecordDetailEntity
>()
{
@Override
public
void
onSuccess
(
List
<
BreedingRecordDetailEntity
>
result
)
{
breedingRecordDetailEntityList
=
new
ArrayList
<>();
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
breedingRecordDetailEntityList
=
result
;
}
observableRefreshList
.
setValue
(
3
);
}
@Override
public
void
onFailed
()
{
ToastUtils
.
showShort
(
"配种记录子表-数据库查询失败"
);
}
}).
queryAsyncAll
(
BreedingRecordDetailEntity
.
class
,
builder
);
}
public
List
<
PerformanceEntity
>
getPerformanceEntityList
()
{
public
List
<
PerformanceEntity
>
getPerformanceEntityList
()
{
List
<
PerformanceEntity
>
resultList
=
new
ArrayList
<>();
List
<
PerformanceEntity
>
resultList
=
new
ArrayList
<>();
...
@@ -241,8 +271,8 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -241,8 +271,8 @@ public class CattleVM extends BackBarVM<Repository> {
JsonObject
jsonObject
=
new
JsonObject
();
JsonObject
jsonObject
=
new
JsonObject
();
for
(
GenTableColumn
gtc
:
Configs
.
performance
)
{
for
(
GenTableColumn
gtc
:
Configs
.
performance
)
{
//防止转json类型错误
//防止转json类型错误
if
(
""
.
equals
(
gtc
.
getContent
()))
{
if
(
""
.
equals
(
gtc
.
getContent
()))
{
switch
(
gtc
.
getJavaType
()){
switch
(
gtc
.
getJavaType
())
{
case
"Long"
:
case
"Long"
:
case
"Double"
:
case
"Double"
:
case
"Integer"
:
case
"Integer"
:
...
@@ -255,7 +285,7 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -255,7 +285,7 @@ public class CattleVM extends BackBarVM<Repository> {
}
}
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
Long
unidTemp
=
pe
.
getUnid
();
Long
unidTemp
=
pe
.
getUnid
();
pe
=
gson
.
fromJson
(
jsonObject
,
PerformanceEntity
.
class
);
pe
=
gson
.
fromJson
(
jsonObject
,
PerformanceEntity
.
class
);
pe
.
setUnid
(
unidTemp
);
pe
.
setUnid
(
unidTemp
);
resultList
.
add
(
pe
);
resultList
.
add
(
pe
);
...
@@ -270,77 +300,77 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -270,77 +300,77 @@ public class CattleVM extends BackBarVM<Repository> {
public
List
<
MedicalRecordEntity
>
getMedicalRecordEntityList
()
{
public
List
<
MedicalRecordEntity
>
getMedicalRecordEntityList
()
{
List
<
MedicalRecordEntity
>
resultList
=
new
ArrayList
<>();
List
<
MedicalRecordEntity
>
resultList
=
new
ArrayList
<>();
if
(
medicalRecordEntityList
==
null
)
{
if
(
medicalRecordEntityList
==
null
)
{
return
resultList
;
return
resultList
;
}
}
for
(
MedicalRecordEntity
pe
:
medicalRecordEntityList
)
{
for
(
MedicalRecordEntity
pe
:
medicalRecordEntityList
)
{
String
[]
filedName
=
EntityUtils
.
getFiledName
(
pe
);
String
[]
filedName
=
EntityUtils
.
getFiledName
(
pe
);
for
(
String
name
:
filedName
)
{
for
(
String
name
:
filedName
)
{
for
(
GenTableColumn
gtc
:
Configs
.
medicalrecords
)
{
for
(
GenTableColumn
gtc
:
Configs
.
medicalrecords
)
{
if
(
name
.
equals
(
gtc
.
getJavaField
()))
{
if
(
name
.
equals
(
gtc
.
getJavaField
()))
{
try
{
try
{
// Log.e("key:", name);
// Log.e("key:", name);
Object
fieldValueByName
=
EntityUtils
.
getFieldValueByName
(
name
,
pe
);
Object
fieldValueByName
=
EntityUtils
.
getFieldValueByName
(
name
,
pe
);
String
value
=
fieldValueByName
==
null
?
""
:
fieldValueByName
.
toString
();
String
value
=
fieldValueByName
==
null
?
""
:
fieldValueByName
.
toString
();
// Log.e("value:", value);
// Log.e("value:", value);
gtc
.
setContent
(
value
);
gtc
.
setContent
(
value
);
String
showName
=
value
;
String
showName
=
value
;
// 如果是选择的,查字典项
// 如果是选择的,查字典项
if
(!
StringUtils
.
isEmpty
(
gtc
.
getDictType
()))
{
if
(!
StringUtils
.
isEmpty
(
gtc
.
getDictType
()))
{
QueryBuilder
<
DictEntity
>
builder
=
QueryBuilder
<
DictEntity
>
builder
=
DbUtil
.
getInstance
().
getQueryBuilder
(
DictEntity
.
class
)
DbUtil
.
getInstance
().
getQueryBuilder
(
DictEntity
.
class
)
.
where
(
DictEntityDao
.
Properties
.
DictType
.
eq
(
gtc
.
getDictType
())
.
where
(
DictEntityDao
.
Properties
.
DictType
.
eq
(
gtc
.
getDictType
())
,
DictEntityDao
.
Properties
.
DictValue
.
eq
(
value
));
,
DictEntityDao
.
Properties
.
DictValue
.
eq
(
value
));
List
<
DictEntity
>
dictEntities
=
DbUtil
.
getInstance
().
queryAll
(
DictEntity
.
class
,
builder
);
List
<
DictEntity
>
dictEntities
=
DbUtil
.
getInstance
().
queryAll
(
DictEntity
.
class
,
builder
);
if
(
dictEntities
!=
null
&&
dictEntities
.
size
()
>
0
)
{
if
(
dictEntities
!=
null
&&
dictEntities
.
size
()
>
0
)
{
showName
=
dictEntities
.
get
(
0
).
getDictLabel
();
showName
=
dictEntities
.
get
(
0
).
getDictLabel
();
}
}
}
gtc
.
setShowName
(
showName
);
gtc
.
setContent
(
showName
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
gtc
.
setShowName
(
showName
);
gtc
.
setContent
(
showName
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
//再把格式bean里的数据转换为数据bean
}
JsonObject
jsonObject
=
new
JsonObject
();
for
(
GenTableColumn
gtc
:
Configs
.
medicalrecords
)
{
//再把格式bean里的数据转换为数据bean
//防止转json类型错误
JsonObject
jsonObject
=
new
JsonObject
();
if
(
""
.
equals
(
gtc
.
getContent
())){
for
(
GenTableColumn
gtc
:
Configs
.
medicalrecords
)
{
switch
(
gtc
.
getJavaType
()){
//防止转json类型错误
case
"Long"
:
if
(
""
.
equals
(
gtc
.
getContent
()))
{
case
"Double"
:
switch
(
gtc
.
getJavaType
())
{
case
"Integer"
:
case
"Long"
:
case
"BigDecimal"
:
case
"Double"
:
gtc
.
setContent
(
"0"
);
case
"Integer"
:
break
;
case
"BigDecimal"
:
}
gtc
.
setContent
(
"0"
);
break
;
}
}
jsonObject
.
addProperty
(
gtc
.
getJavaField
(),
gtc
.
getContent
());
}
}
jsonObject
.
addProperty
(
gtc
.
getJavaField
(),
gtc
.
getContent
());
}
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
Long
unidTemp
=
pe
.
getUnid
();
Long
unidTemp
=
pe
.
getUnid
();
pe
=
gson
.
fromJson
(
jsonObject
,
MedicalRecordEntity
.
class
);
pe
=
gson
.
fromJson
(
jsonObject
,
MedicalRecordEntity
.
class
);
pe
.
setUnid
(
unidTemp
);
pe
.
setUnid
(
unidTemp
);
resultList
.
add
(
pe
);
resultList
.
add
(
pe
);
}
}
// resultList.clear();
// resultList.clear();
// Arrays.copyOf()
// Arrays.copyOf()
// System.arraycopy(performanceEntityList, 0, resultList, 0 , performanceEntityList.size());
// System.arraycopy(performanceEntityList, 0, resultList, 0 , performanceEntityList.size());
return
resultList
;
return
resultList
;
}
}
public
List
<
ImmuneBatchEntity
>
getImmuneBatchEntityList
()
{
public
List
<
ImmuneBatchEntity
>
getImmuneBatchEntityList
()
{
...
@@ -392,8 +422,8 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -392,8 +422,8 @@ public class CattleVM extends BackBarVM<Repository> {
JsonObject
jsonObject
=
new
JsonObject
();
JsonObject
jsonObject
=
new
JsonObject
();
for
(
GenTableColumn
gtc
:
Configs
.
immunebatch
)
{
for
(
GenTableColumn
gtc
:
Configs
.
immunebatch
)
{
//防止转json类型错误
//防止转json类型错误
if
(
""
.
equals
(
gtc
.
getContent
()))
{
if
(
""
.
equals
(
gtc
.
getContent
()))
{
switch
(
gtc
.
getJavaType
()){
switch
(
gtc
.
getJavaType
())
{
case
"Long"
:
case
"Long"
:
case
"Double"
:
case
"Double"
:
case
"Integer"
:
case
"Integer"
:
...
@@ -406,7 +436,7 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -406,7 +436,7 @@ public class CattleVM extends BackBarVM<Repository> {
}
}
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
Long
unidTemp
=
pe
.
getUnid
();
Long
unidTemp
=
pe
.
getUnid
();
pe
=
gson
.
fromJson
(
jsonObject
,
ImmuneBatchEntity
.
class
);
pe
=
gson
.
fromJson
(
jsonObject
,
ImmuneBatchEntity
.
class
);
pe
.
setUnid
(
unidTemp
);
pe
.
setUnid
(
unidTemp
);
resultList
.
add
(
pe
);
resultList
.
add
(
pe
);
...
@@ -419,22 +449,21 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -419,22 +449,21 @@ public class CattleVM extends BackBarVM<Repository> {
}
}
public
List
<
BreedingRecordEntity
>
getBreedingRecordEntityList
()
{
public
List
<
BreedingRecordDetailEntity
>
getBreedingRecordEntityList
()
{
List
<
BreedingRecordEntity
>
resultList
=
new
ArrayList
<>();
List
<
BreedingRecord
Detail
Entity
>
resultList
=
new
ArrayList
<>();
if
(
breedingRecordEntityList
==
null
)
{
if
(
breedingRecord
Detail
EntityList
==
null
)
{
return
resultList
;
return
resultList
;
}
}
for
(
BreedingRecord
Entity
pe
:
breedingRecord
EntityList
)
{
for
(
BreedingRecord
DetailEntity
pe
:
breedingRecordDetail
EntityList
)
{
String
[]
filedName
=
EntityUtils
.
getFiledName
(
pe
);
String
[]
filedName
=
EntityUtils
.
getFiledName
(
pe
);
for
(
String
name
:
filedName
)
{
for
(
String
name
:
filedName
)
{
for
(
GenTableColumn
gtc
:
Configs
.
cattlemating
Master
)
{
for
(
GenTableColumn
gtc
:
Configs
.
cattlemating
DetaillList
)
{
if
(
name
.
equals
(
gtc
.
getJavaField
()))
{
if
(
name
.
equals
(
gtc
.
getJavaField
()))
{
try
{
try
{
...
@@ -468,10 +497,10 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -468,10 +497,10 @@ public class CattleVM extends BackBarVM<Repository> {
//再把格式bean里的数据转换为数据bean
//再把格式bean里的数据转换为数据bean
JsonObject
jsonObject
=
new
JsonObject
();
JsonObject
jsonObject
=
new
JsonObject
();
for
(
GenTableColumn
gtc
:
Configs
.
cattlemating
Master
)
{
for
(
GenTableColumn
gtc
:
Configs
.
cattlemating
DetaillList
)
{
//防止转json类型错误
//防止转json类型错误
if
(
""
.
equals
(
gtc
.
getContent
()))
{
if
(
""
.
equals
(
gtc
.
getContent
()))
{
switch
(
gtc
.
getJavaType
()){
switch
(
gtc
.
getJavaType
())
{
case
"Long"
:
case
"Long"
:
case
"Double"
:
case
"Double"
:
case
"Integer"
:
case
"Integer"
:
...
@@ -484,8 +513,8 @@ public class CattleVM extends BackBarVM<Repository> {
...
@@ -484,8 +513,8 @@ public class CattleVM extends BackBarVM<Repository> {
}
}
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
Long
unidTemp
=
pe
.
getUnid
();
Long
unidTemp
=
pe
.
getUnid
();
pe
=
gson
.
fromJson
(
jsonObject
,
BreedingRecordEntity
.
class
);
pe
=
gson
.
fromJson
(
jsonObject
,
BreedingRecord
Detail
Entity
.
class
);
pe
.
setUnid
(
unidTemp
);
pe
.
setUnid
(
unidTemp
);
resultList
.
add
(
pe
);
resultList
.
add
(
pe
);
...
...
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted
100644 → 0
View file @
15b33a45
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@drawable/ic_launcher_background"
/>
<foreground
android:drawable=
"@drawable/ic_launcher"
/>
</adaptive-icon>
\ No newline at end of file
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
View file @
beed5e0a
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<adaptive-icon
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<background
android:drawable=
"@drawable/ic_launcher_background"
/>
<background
android:drawable=
"@drawable/ic_launcher_background"
/>
<foreground
android:drawable=
"@
drawable
/ic_launcher"
/>
<foreground
android:drawable=
"@
mipmap
/ic_launcher"
/>
</adaptive-icon>
</adaptive-icon>
\ No newline at end of file
app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted
100644 → 0
View file @
15b33a45
6.82 KB
app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted
100644 → 0
View file @
15b33a45
2.16 KB
app/src/main/res/mipmap-xhdpi/ic_launcher.png
View replaced file @
15b33a45
View file @
beed5e0a
3.44 KB
|
W:
|
H:
6.82 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
15b33a45
4.81 KB
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
15b33a45
6.14 KB
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