Commit ac95bc6d authored by hywang's avatar hywang

1.修改上传数据为多次上传

parent 920acb04
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
android:resource="@xml/file_paths" /> android:resource="@xml/file_paths" />
</provider> </provider>
<!-- android:name=".ui.cattle.activity.CattleMainActivity"-->
<activity <activity
android:name=".ui.login.LoginActivity" android:name=".ui.login.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
...@@ -122,12 +123,12 @@ ...@@ -122,12 +123,12 @@
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" /> android:windowSoftInputMode="stateHidden|adjustResize" />
<activity <!-- <activity-->
android:name=".ui.cattle.activity.CattleMainActivity" <!-- android:name=".ui.cattle.activity.CattleMainActivity"-->
android:configChanges="keyboardHidden|orientation|screenSize" <!-- android:configChanges="keyboardHidden|orientation|screenSize"-->
android:launchMode="singleTask" <!-- android:launchMode="singleTask"-->
android:screenOrientation="portrait" <!-- android:screenOrientation="portrait"-->
android:windowSoftInputMode="stateHidden|adjustResize" /> <!-- android:windowSoftInputMode="stateHidden|adjustResize" />-->
<activity <activity
android:name=".ui.cattle.activity.CattleMarkActivity" android:name=".ui.cattle.activity.CattleMarkActivity"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
......
...@@ -3,6 +3,8 @@ package com.phlx.wool; ...@@ -3,6 +3,8 @@ package com.phlx.wool;
import com.uhf.linkage.Linkage; import com.uhf.linkage.Linkage;
import org.greenrobot.greendao.query.QueryBuilder;
import me.goldze.mvvmhabit.base.BaseApplication; import me.goldze.mvvmhabit.base.BaseApplication;
import me.goldze.mvvmhabit.crash.CaocConfig; import me.goldze.mvvmhabit.crash.CaocConfig;
import me.goldze.mvvmhabit.utils.KLog; import me.goldze.mvvmhabit.utils.KLog;
...@@ -20,6 +22,8 @@ public class App extends BaseApplication { ...@@ -20,6 +22,8 @@ public class App extends BaseApplication {
instance = this; instance = this;
//是否开启打印日志 //是否开启打印日志
KLog.init(true); KLog.init(true);
QueryBuilder.LOG_SQL = true;
QueryBuilder.LOG_VALUES = true;
//初始化全局异常崩溃 //初始化全局异常崩溃
initCrash(); initCrash();
link = new Linkage(); link = new Linkage();
......
...@@ -69,8 +69,8 @@ public class Configs { ...@@ -69,8 +69,8 @@ public class Configs {
public static PrinterInstance myPrinter; public static PrinterInstance myPrinter;
//是否是锡盟临时项目 //是否是毛登牧场临时项目
public static boolean isCattle = true; public static boolean isCattle = false;
// public static boolean ISCONNECTED; // public static boolean ISCONNECTED;
......
...@@ -99,7 +99,7 @@ public class VMFactory extends ViewModelProvider.NewInstanceFactory { ...@@ -99,7 +99,7 @@ public class VMFactory extends ViewModelProvider.NewInstanceFactory {
return (T) new SlaughterEntryVM(mApplication, repository); return (T) new SlaughterEntryVM(mApplication, repository);
//锡盟临时项目 //毛登牧场临时项目
}else if (modelClass.isAssignableFrom(CattleMainVM.class)) { }else if (modelClass.isAssignableFrom(CattleMainVM.class)) {
return (T) new CattleMainVM(mApplication, repository); return (T) new CattleMainVM(mApplication, repository);
}else if (modelClass.isAssignableFrom(CattleMarkVM.class)) { }else if (modelClass.isAssignableFrom(CattleMarkVM.class)) {
......
...@@ -48,14 +48,14 @@ public class RetrofitClient { ...@@ -48,14 +48,14 @@ public class RetrofitClient {
private static final int CACHE_TIMEOUT = 10 * 1024 * 1024; private static final int CACHE_TIMEOUT = 10 * 1024 * 1024;
//服务端根路径 //服务端根路径
public static String baseUrl = public static String baseUrl =
// "58.18.92.126"//阿拉善正式 "58.18.92.126"//阿拉善正式
"39.101.170.186"//锡盟正式 // "39.101.170.186"//锡盟正式
// "192.168.12.105"//锡盟张敏测试 // "192.168.12.105"//锡盟张敏测试
// "192.168.8.189"//张敏 // "192.168.8.189"//张敏
; ;
public static String port = public static String port =
// "899"//阿拉善正式 "899"//阿拉善正式
"8999"//锡盟正式/ 张敏 // "8999"//锡盟正式/ 张敏
// "80" // "80"
; ;
......
...@@ -94,11 +94,11 @@ public class CattleMainVM extends BackBarVM<Repository> { ...@@ -94,11 +94,11 @@ public class CattleMainVM extends BackBarVM<Repository> {
public BindingCommand onDownloadClickCommand = new BindingCommand(new BindingAction() { public BindingCommand onDownloadClickCommand = new BindingCommand(new BindingAction() {
@Override @Override
public void call() { public void call() {
if (Configs.isOnLine) { // if (Configs.isOnLine) {
DbUtil.getInstance().deleteAll(Unit.class); DbUtil.getInstance().deleteAll(Unit.class);
farmerPageIndex = 0; farmerPageIndex = 0;
queryFarmerInputTime(farmerPageIndex, 10000); queryFarmerInputTime(farmerPageIndex, 10000);
} // }
} }
}); });
......
...@@ -92,6 +92,9 @@ public class CattleMarkVM extends BackBarVM<Repository> { ...@@ -92,6 +92,9 @@ public class CattleMarkVM extends BackBarVM<Repository> {
long idNo = IdUtil.createSnowflake(3, 1).nextId(); long idNo = IdUtil.createSnowflake(3, 1).nextId();
entity.setId(idNo + ""); entity.setId(idNo + "");
entity.setPastureUnitId(SPUtils.getInstance().getString(Configs.SP_UNIT_CODE, "")); entity.setPastureUnitId(SPUtils.getInstance().getString(Configs.SP_UNIT_CODE, ""));
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
entity.setBirthdate(dateFormat.format(new Date()));
entity.setWeight(100 + "");
markeImgUrl = Environment.getExternalStorageDirectory().getAbsolutePath() + markeImgUrl = Environment.getExternalStorageDirectory().getAbsolutePath() +
"/tracing/picture/" "/tracing/picture/"
......
...@@ -54,7 +54,7 @@ public class CattleUploadVM extends BackBarVM<Repository> { ...@@ -54,7 +54,7 @@ public class CattleUploadVM extends BackBarVM<Repository> {
private void uploadMarking() { private void uploadMarking() {
QueryBuilder<CattleLabelEntity> builder = QueryBuilder<CattleLabelEntity> builder =
DbUtil.getInstance().getQueryBuilder(CattleLabelEntity.class); DbUtil.getInstance().getQueryBuilder(CattleLabelEntity.class).limit(20);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CattleLabelEntity>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CattleLabelEntity>() {
@Override @Override
public void onSuccess(List<CattleLabelEntity> result) { public void onSuccess(List<CattleLabelEntity> result) {
...@@ -74,18 +74,17 @@ public class CattleUploadVM extends BackBarVM<Repository> { ...@@ -74,18 +74,17 @@ public class CattleUploadVM extends BackBarVM<Repository> {
.subscribe((Consumer<CattleResponse<List<CattleLabelEntity>>>) response -> { .subscribe((Consumer<CattleResponse<List<CattleLabelEntity>>>) response -> {
KLog.e(response.getCode() + response.getMsg()); KLog.e(response.getCode() + response.getMsg());
if (response.getCode() == 0) { if (response.getCode() == 0) {
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() { DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override @Override
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
dismissDialog(); dismissDialog();
refreshUploadCount(); uploadMarking();
}else{ } else {
ToastUtils.showShort("删除基础数据失败"); ToastUtils.showShort("删除基础数据失败");
} }
} }
}).deleteAsyncAll(CattleLabelEntity.class); }).deleteAsyncBatch(CattleLabelEntity.class, result);
} else { } else {
dismissDialog(); dismissDialog();
ToastUtils.showShort("基础数据上传失败"); ToastUtils.showShort("基础数据上传失败");
...@@ -96,6 +95,8 @@ public class CattleUploadVM extends BackBarVM<Repository> { ...@@ -96,6 +95,8 @@ public class CattleUploadVM extends BackBarVM<Repository> {
}) })
); );
} else { } else {
dismissDialog();
refreshUploadCount();
} }
} }
......
...@@ -25,10 +25,7 @@ import com.phlx.wool.db.gen.LabelDao; ...@@ -25,10 +25,7 @@ import com.phlx.wool.db.gen.LabelDao;
import com.phlx.wool.db.interf.DbIDUCallBack; import com.phlx.wool.db.interf.DbIDUCallBack;
import com.phlx.wool.db.interf.DbQueryCallBack; import com.phlx.wool.db.interf.DbQueryCallBack;
import com.phlx.wool.entity.CacheLabel; import com.phlx.wool.entity.CacheLabel;
import com.phlx.wool.entity.EntryRegistrationEntity;
import com.phlx.wool.entity.Label; import com.phlx.wool.entity.Label;
import com.phlx.wool.entity.Marking;
import com.phlx.wool.entity.VillusBuyEntity;
import com.phlx.wool.event.EventMsg; import com.phlx.wool.event.EventMsg;
import com.phlx.wool.event.EventTag; import com.phlx.wool.event.EventTag;
import com.phlx.wool.rfid.ModuleManager; import com.phlx.wool.rfid.ModuleManager;
...@@ -400,7 +397,6 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis ...@@ -400,7 +397,6 @@ public class InventoryVM extends BackBarVM<Repository> implements OnInventoryLis
ToastUtils.showShort("请扫描耳标"); ToastUtils.showShort("请扫描耳标");
} }
} }
/** /**
......
...@@ -35,6 +35,7 @@ import com.phlx.wool.ui.base.BackBarVM; ...@@ -35,6 +35,7 @@ import com.phlx.wool.ui.base.BackBarVM;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
...@@ -175,7 +176,7 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -175,7 +176,7 @@ public class UploadVM extends BackBarVM<Repository> {
public void onSuccess(List<VillusBuyEntity> result) { public void onSuccess(List<VillusBuyEntity> result) {
if (result != null) { if (result != null) {
villusBuyLabelNum.set("绒毛购买 " + "(" + result.size() + ")"); villusBuyLabelNum.set("绒毛购买 " + "(" + result.size() + ")");
}else{ } else {
villusBuyLabelNum.set("绒毛购买 " + "(0)"); villusBuyLabelNum.set("绒毛购买 " + "(0)");
} }
} }
...@@ -238,7 +239,7 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -238,7 +239,7 @@ public class UploadVM extends BackBarVM<Repository> {
QueryBuilder<Marking> builder = QueryBuilder<Marking> builder =
DbUtil.getInstance().getQueryBuilder(Marking.class). DbUtil.getInstance().getQueryBuilder(Marking.class).
where(MarkingDao.Properties.Status.eq(1)); where(MarkingDao.Properties.Status.eq(1)).limit(100);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<Marking>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<Marking>() {
@Override @Override
public void onSuccess(List<Marking> result) { public void onSuccess(List<Marking> result) {
...@@ -278,13 +279,14 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -278,13 +279,14 @@ public class UploadVM extends BackBarVM<Repository> {
@Override @Override
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
uploadMarking();
} else {
dismissDialog(); dismissDialog();
}else{
toastStr += "删除标签数据失败;"; toastStr += "删除标签数据失败;";
}
uploadNext(); uploadNext();
} }
}).deleteAsyncAll(Marking.class); }
}).deleteAsyncBatch(Marking.class, result);
} else { } else {
dismissDialog(); dismissDialog();
toastStr += "marking上传失败;"; toastStr += "marking上传失败;";
...@@ -298,6 +300,7 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -298,6 +300,7 @@ public class UploadVM extends BackBarVM<Repository> {
}) })
); );
} else { } else {
dismissDialog();
uploadNext(); uploadNext();
} }
} }
...@@ -318,12 +321,13 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -318,12 +321,13 @@ public class UploadVM extends BackBarVM<Repository> {
private void uploadQuarantine() { private void uploadQuarantine() {
QueryBuilder<Quarantine> builder = QueryBuilder<Quarantine> builder =
DbUtil.getInstance().getQueryBuilder(Quarantine.class). DbUtil.getInstance().getQueryBuilder(Quarantine.class).
where(QuarantineDao.Properties.Status.eq(1)); where(QuarantineDao.Properties.Status.eq(1)).limit(20);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<Quarantine>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<Quarantine>() {
@Override @Override
public void onSuccess(List<Quarantine> result) { public void onSuccess(List<Quarantine> result) {
isQuarantineUpload = true; isQuarantineUpload = true;
if (result != null && result.size() > 0) { if (result != null && result.size() > 0) {
List<QuarantineDetail> quarantineDetails = new ArrayList<>();
KLog.e(result.toString()); KLog.e(result.toString());
for (Quarantine quarantine : result) { for (Quarantine quarantine : result) {
if (quarantine.getList() != null && quarantine.getList().size() > 0) { if (quarantine.getList() != null && quarantine.getList().size() > 0) {
...@@ -332,8 +336,8 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -332,8 +336,8 @@ public class UploadVM extends BackBarVM<Repository> {
QueryBuilder<QuarantineDetail> builder = QueryBuilder<QuarantineDetail> builder =
DbUtil.getInstance().getQueryBuilder(QuarantineDetail.class). DbUtil.getInstance().getQueryBuilder(QuarantineDetail.class).
where(QuarantineDetailDao.Properties.QuarantineId.eq(quarantine.getId())); where(QuarantineDetailDao.Properties.QuarantineId.eq(quarantine.getId()));
List<QuarantineDetail> quarantineDetails = ;
DbUtil.getInstance().queryAll(QuarantineDetail.class, builder); quarantineDetails.addAll(DbUtil.getInstance().queryAll(QuarantineDetail.class, builder));
quarantine.setList(quarantineDetails); quarantine.setList(quarantineDetails);
} }
KLog.e(result.toString()); KLog.e(result.toString());
...@@ -356,12 +360,15 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -356,12 +360,15 @@ public class UploadVM extends BackBarVM<Repository> {
@Override @Override
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
DbUtil.getInstance().deleteAll(QuarantineDetail.class); if (quarantineDetails != null && quarantineDetails.size() > 0) {
DbUtil.getInstance().deleteList(quarantineDetails);
uploadQuarantine();
}
} else { } else {
ToastUtils.showShort("删除检疫数据失败"); ToastUtils.showShort("删除检疫数据失败");
}
uploadNext(); uploadNext();
} }
}
}).deleteAsyncBatch(Quarantine.class, result); }).deleteAsyncBatch(Quarantine.class, result);
} else { } else {
toastStr += "上传检疫数据失败;"; toastStr += "上传检疫数据失败;";
...@@ -393,13 +400,14 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -393,13 +400,14 @@ public class UploadVM extends BackBarVM<Repository> {
private void uploadHarmless() { private void uploadHarmless() {
QueryBuilder<Harmless> builder = QueryBuilder<Harmless> builder =
DbUtil.getInstance().getQueryBuilder(Harmless.class). DbUtil.getInstance().getQueryBuilder(Harmless.class).
where(HarmlessDao.Properties.Status.eq(1)); where(HarmlessDao.Properties.Status.eq(1)).limit(20);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<Harmless>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<Harmless>() {
@Override @Override
public void onSuccess(List<Harmless> result) { public void onSuccess(List<Harmless> result) {
isHarmlessUpload = true; isHarmlessUpload = true;
if (result != null && result.size() > 0) { if (result != null && result.size() > 0) {
KLog.e(result.toString()); KLog.e(result.toString());
List<HarmlessDetail> harmlessDetails = new ArrayList<>();
for (Harmless harmless : result) { for (Harmless harmless : result) {
if (harmless.getList() != null && harmless.getList().size() > 0) { if (harmless.getList() != null && harmless.getList().size() > 0) {
harmless.setList(null); harmless.setList(null);
...@@ -407,8 +415,8 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -407,8 +415,8 @@ public class UploadVM extends BackBarVM<Repository> {
QueryBuilder<HarmlessDetail> builder = QueryBuilder<HarmlessDetail> builder =
DbUtil.getInstance().getQueryBuilder(HarmlessDetail.class). DbUtil.getInstance().getQueryBuilder(HarmlessDetail.class).
where(HarmlessDetailDao.Properties.HarmlessId.eq(harmless.getId())); where(HarmlessDetailDao.Properties.HarmlessId.eq(harmless.getId()));
List<HarmlessDetail> harmlessDetails = harmlessDetails.addAll(
DbUtil.getInstance().queryAll(HarmlessDetail.class, builder); DbUtil.getInstance().queryAll(HarmlessDetail.class, builder));
harmless.setList(harmlessDetails); harmless.setList(harmlessDetails);
} }
KLog.e(result.toString()); KLog.e(result.toString());
...@@ -431,14 +439,19 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -431,14 +439,19 @@ public class UploadVM extends BackBarVM<Repository> {
@Override @Override
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
DbUtil.getInstance().deleteAll(HarmlessDetail.class); if (harmlessDetails != null && harmlessDetails.size() > 0) {
DbUtil.getInstance().deleteList(harmlessDetails);
uploadHarmless();
}
} else { } else {
dismissDialog();
ToastUtils.showShort("删除无害化数据失败"); ToastUtils.showShort("删除无害化数据失败");
}
uploadNext(); uploadNext();
} }
}
}).deleteAsyncBatch(Harmless.class, result); }).deleteAsyncBatch(Harmless.class, result);
} else { } else {
dismissDialog();
toastStr += "上传无害化失败;"; toastStr += "上传无害化失败;";
ToastUtils.showShort("上传无害化失败"); ToastUtils.showShort("上传无害化失败");
uploadNext(); uploadNext();
...@@ -468,7 +481,7 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -468,7 +481,7 @@ public class UploadVM extends BackBarVM<Repository> {
QueryBuilder<VillusBuyEntity> builder = QueryBuilder<VillusBuyEntity> builder =
DbUtil.getInstance().getQueryBuilder(VillusBuyEntity.class). DbUtil.getInstance().getQueryBuilder(VillusBuyEntity.class).
where(VillusBuyEntityDao.Properties.Status.eq(1)); where(VillusBuyEntityDao.Properties.Status.eq(1)).limit(100);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<VillusBuyEntity>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<VillusBuyEntity>() {
@Override @Override
public void onSuccess(List<VillusBuyEntity> result) { public void onSuccess(List<VillusBuyEntity> result) {
...@@ -497,11 +510,12 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -497,11 +510,12 @@ public class UploadVM extends BackBarVM<Repository> {
@Override @Override
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
uploadVillusBuy();
} else { } else {
ToastUtils.showShort("更新绒毛购买数据失败"); ToastUtils.showShort("更新绒毛购买数据失败");
}
uploadNext(); uploadNext();
} }
}
}).updateAsyncBatch(VillusBuyEntity.class, result); }).updateAsyncBatch(VillusBuyEntity.class, result);
} else { } else {
toastStr += "上传绒毛购买数据失败;"; toastStr += "上传绒毛购买数据失败;";
...@@ -532,7 +546,7 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -532,7 +546,7 @@ public class UploadVM extends BackBarVM<Repository> {
private void uploadVillusGauge() { private void uploadVillusGauge() {
QueryBuilder<VillusGaugeEntity> builder = QueryBuilder<VillusGaugeEntity> builder =
DbUtil.getInstance().getQueryBuilder(VillusGaugeEntity.class). DbUtil.getInstance().getQueryBuilder(VillusGaugeEntity.class).
where(VillusGaugeEntityDao.Properties.Status.eq(1)); where(VillusGaugeEntityDao.Properties.Status.eq(1)).limit(100);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<VillusGaugeEntity>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<VillusGaugeEntity>() {
@Override @Override
public void onSuccess(List<VillusGaugeEntity> result) { public void onSuccess(List<VillusGaugeEntity> result) {
...@@ -554,20 +568,20 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -554,20 +568,20 @@ public class UploadVM extends BackBarVM<Repository> {
KLog.e(response.getCode() + response.getMsg()); KLog.e(response.getCode() + response.getMsg());
dismissDialog(); dismissDialog();
if (response.getCode() == 0) { if (response.getCode() == 0) {
for (VillusGaugeEntity villusGaugeEntity : result) { // for (VillusGaugeEntity villusGaugeEntity : result) {
villusGaugeEntity.setStatus(0); // villusGaugeEntity.setStatus(0);
} // }
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() { DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override @Override
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
DbUtil.getInstance().deleteAll(VillusGaugeEntity.class); uploadVillusGauge();
} else { } else {
ToastUtils.showShort("删除绒毛测量数据失败"); ToastUtils.showShort("删除绒毛测量数据失败");
}
uploadNext(); uploadNext();
} }
}).updateAsyncBatch(VillusGaugeEntity.class, result); }
}).deleteAsyncBatch(VillusGaugeEntity.class, result);
} else { } else {
toastStr += "上传绒毛测量数据失败;"; toastStr += "上传绒毛测量数据失败;";
ToastUtils.showShort("上传绒毛测量数据失败"); ToastUtils.showShort("上传绒毛测量数据失败");
...@@ -597,7 +611,7 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -597,7 +611,7 @@ public class UploadVM extends BackBarVM<Repository> {
private void uploadSlaughterEntry() { private void uploadSlaughterEntry() {
QueryBuilder<EntryRegistrationEntity> builder = QueryBuilder<EntryRegistrationEntity> builder =
DbUtil.getInstance().getQueryBuilder(EntryRegistrationEntity.class). DbUtil.getInstance().getQueryBuilder(EntryRegistrationEntity.class).
where(EntryRegistrationEntityDao.Properties.Status.eq(1)); where(EntryRegistrationEntityDao.Properties.Status.eq(1)).limit(100);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<EntryRegistrationEntity>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<EntryRegistrationEntity>() {
@Override @Override
public void onSuccess(List<EntryRegistrationEntity> result) { public void onSuccess(List<EntryRegistrationEntity> result) {
...@@ -619,20 +633,20 @@ public class UploadVM extends BackBarVM<Repository> { ...@@ -619,20 +633,20 @@ public class UploadVM extends BackBarVM<Repository> {
KLog.e(response.getCode() + response.getMsg()); KLog.e(response.getCode() + response.getMsg());
dismissDialog(); dismissDialog();
if (response.getCode() == 0) { if (response.getCode() == 0) {
for (EntryRegistrationEntity entryRegistrationEntity : result) { // for (EntryRegistrationEntity entryRegistrationEntity : result) {
entryRegistrationEntity.setStatus(0); // entryRegistrationEntity.setStatus(0);
} // }
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() { DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override @Override
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
DbUtil.getInstance().deleteAll(EntryRegistrationEntity.class); uploadSlaughterEntry();
} else { } else {
ToastUtils.showShort("删除屠宰进场数据失败"); ToastUtils.showShort("删除屠宰进场数据失败");
}
uploadNext(); uploadNext();
} }
}).updateAsyncBatch(EntryRegistrationEntity.class, result); }
}).deleteAsyncBatch(EntryRegistrationEntity.class, result);
} else { } else {
toastStr += "上传屠宰进场数据失败;"; toastStr += "上传屠宰进场数据失败;";
ToastUtils.showShort("上传屠宰进场数据失败"); ToastUtils.showShort("上传屠宰进场数据失败");
......
...@@ -205,6 +205,7 @@ ...@@ -205,6 +205,7 @@
android:hint="请输入体重" android:hint="请输入体重"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:maxLines="1" android:maxLines="1"
android:maxLength="10"
android:text="@={viewModel.entity.weight}" android:text="@={viewModel.entity.weight}"
android:textSize="@dimen/edit_size" android:textSize="@dimen/edit_size"
binding:layout_constraintBottom_toTopOf="@+id/weight_edit" binding:layout_constraintBottom_toTopOf="@+id/weight_edit"
...@@ -232,6 +233,7 @@ ...@@ -232,6 +233,7 @@
android:background="@drawable/input_frame_bg" android:background="@drawable/input_frame_bg"
android:hint="请输入胸围" android:hint="请输入胸围"
android:maxLines="1" android:maxLines="1"
android:maxLength="10"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:text="@={viewModel.entity.bust}" android:text="@={viewModel.entity.bust}"
android:textSize="@dimen/edit_size" android:textSize="@dimen/edit_size"
...@@ -260,6 +262,7 @@ ...@@ -260,6 +262,7 @@
android:background="@drawable/input_frame_bg" android:background="@drawable/input_frame_bg"
android:hint="请输入管维" android:hint="请输入管维"
android:maxLines="1" android:maxLines="1"
android:maxLength="10"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:text="@={viewModel.entity.tubeCircumference}" android:text="@={viewModel.entity.tubeCircumference}"
android:textSize="@dimen/edit_size" android:textSize="@dimen/edit_size"
...@@ -289,6 +292,7 @@ ...@@ -289,6 +292,7 @@
android:background="@drawable/input_frame_bg" android:background="@drawable/input_frame_bg"
android:hint="请输入体高" android:hint="请输入体高"
android:maxLines="1" android:maxLines="1"
android:maxLength="10"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:text="@={viewModel.entity.bodyHeight}" android:text="@={viewModel.entity.bodyHeight}"
android:textSize="@dimen/edit_size" android:textSize="@dimen/edit_size"
...@@ -319,6 +323,7 @@ ...@@ -319,6 +323,7 @@
android:hint="请输入体斜长" android:hint="请输入体斜长"
android:maxLines="1" android:maxLines="1"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:maxLength="10"
android:text="@={viewModel.entity.bodyObliqueLength}" android:text="@={viewModel.entity.bodyObliqueLength}"
android:textSize="@dimen/edit_size" android:textSize="@dimen/edit_size"
binding:layout_constraintBottom_toTopOf="@+id/twin_sheep_cb" binding:layout_constraintBottom_toTopOf="@+id/twin_sheep_cb"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment