|
@@ -36,7 +36,7 @@ class BreedSubmitApi {
|
|
|
}).toList();
|
|
}).toList();
|
|
|
ResultModel result = ResultModel.offline();
|
|
ResultModel result = ResultModel.offline();
|
|
|
if (!AppConfig.isOffline &&
|
|
if (!AppConfig.isOffline &&
|
|
|
- await _breedingDataService.queryCount(TableConfig.chicken) == 0) {
|
|
|
|
|
|
|
+ await _breedingDataService.queryTotalCount() == 0) {
|
|
|
result = await ApiService().post(
|
|
result = await ApiService().post(
|
|
|
bindChickenUrl,
|
|
bindChickenUrl,
|
|
|
data: list,
|
|
data: list,
|
|
@@ -69,7 +69,7 @@ class BreedSubmitApi {
|
|
|
}).toList();
|
|
}).toList();
|
|
|
ResultModel result = ResultModel.offline();
|
|
ResultModel result = ResultModel.offline();
|
|
|
if (!AppConfig.isOffline &&
|
|
if (!AppConfig.isOffline &&
|
|
|
- await _breedingDataService.queryCount(TableConfig.chicken) == 0) {
|
|
|
|
|
|
|
+ await _breedingDataService.queryTotalCount() == 0) {
|
|
|
result = await ApiService().post(
|
|
result = await ApiService().post(
|
|
|
cageChangeUrl,
|
|
cageChangeUrl,
|
|
|
data: list,
|
|
data: list,
|
|
@@ -100,7 +100,7 @@ class BreedSubmitApi {
|
|
|
List<Map<String, dynamic>> list = [weightData].toList();
|
|
List<Map<String, dynamic>> list = [weightData].toList();
|
|
|
ResultModel result = ResultModel.offline();
|
|
ResultModel result = ResultModel.offline();
|
|
|
if (!AppConfig.isOffline &&
|
|
if (!AppConfig.isOffline &&
|
|
|
- await _breedingDataService.queryCount(TableConfig.chicken) == 0) {
|
|
|
|
|
|
|
+ await _breedingDataService.queryTotalCount() == 0) {
|
|
|
result = await ApiService().post(
|
|
result = await ApiService().post(
|
|
|
weightUrl,
|
|
weightUrl,
|
|
|
data: list,
|
|
data: list,
|
|
@@ -130,7 +130,7 @@ class BreedSubmitApi {
|
|
|
];
|
|
];
|
|
|
ResultModel result = ResultModel.offline();
|
|
ResultModel result = ResultModel.offline();
|
|
|
if (!AppConfig.isOffline &&
|
|
if (!AppConfig.isOffline &&
|
|
|
- await _breedingDataService.queryCount(TableConfig.chicken) == 0) {
|
|
|
|
|
|
|
+ await _breedingDataService.queryTotalCount() == 0) {
|
|
|
result = await ApiService().post(
|
|
result = await ApiService().post(
|
|
|
cullUrl,
|
|
cullUrl,
|
|
|
data: list,
|
|
data: list,
|
|
@@ -161,7 +161,7 @@ class BreedSubmitApi {
|
|
|
}).toList();
|
|
}).toList();
|
|
|
ResultModel result = ResultModel.offline();
|
|
ResultModel result = ResultModel.offline();
|
|
|
if (!AppConfig.isOffline &&
|
|
if (!AppConfig.isOffline &&
|
|
|
- await _breedingDataService.queryCount(TableConfig.chicken) == 0) {
|
|
|
|
|
|
|
+ await _breedingDataService.queryTotalCount() == 0) {
|
|
|
result = await ApiService().post(
|
|
result = await ApiService().post(
|
|
|
cullUrl,
|
|
cullUrl,
|
|
|
data: list,
|
|
data: list,
|
|
@@ -200,13 +200,13 @@ class BreedSubmitApi {
|
|
|
String getUrl(String type) {
|
|
String getUrl(String type) {
|
|
|
switch (type) {
|
|
switch (type) {
|
|
|
case BreedConfig.chicken:
|
|
case BreedConfig.chicken:
|
|
|
- return '$apiPrefix/bindChicken';
|
|
|
|
|
|
|
+ return '$apiPrefix/addChicken';
|
|
|
case BreedConfig.cageChange:
|
|
case BreedConfig.cageChange:
|
|
|
- return '$apiPrefix/cageChange';
|
|
|
|
|
|
|
+ return '$apiPrefix/changeCage';
|
|
|
case BreedConfig.weight:
|
|
case BreedConfig.weight:
|
|
|
- return '$apiPrefix/weight';
|
|
|
|
|
|
|
+ return '$apiPrefix/chickenWeight';
|
|
|
case BreedConfig.cull:
|
|
case BreedConfig.cull:
|
|
|
- return '$apiPrefix/cull';
|
|
|
|
|
|
|
+ return '$apiPrefix/cullChicken';
|
|
|
default:
|
|
default:
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|