Commit 28433d17 authored by hywang's avatar hywang

1.配种记录-公牛无法配种

parent 8f861aa3
......@@ -91,7 +91,7 @@ dependencies {
//dialog
//添加对应的包文件,可根据需要选择,请将 dialogx_version 的版本号与您正在使用的 DialogX 主库保持一致
implementation "com.github.kongzue.DialogX:DialogXKongzueStyle:0.0.43.beta19"
implementation "com.github.kongzue.DialogX:DialogX:0.0.43.beta19"
implementation "com.github.kongzue.DialogX:DialogX:0.0.43.beta18"
//日期选择对话框
implementation 'com.github.kongzue.DialogXSample:DatePicker:0.0.1.alpha7'
......
......@@ -9,9 +9,16 @@ import androidx.annotation.NonNull;
import com.phlx.anchorcollect_p.Configs;
import com.phlx.anchorcollect_p.data.Repository;
import com.phlx.anchorcollect_p.db.DbUtil;
import com.phlx.anchorcollect_p.db.gen.CattleResumeEntityDao;
import com.phlx.anchorcollect_p.db.interf.DbQueryCallBack;
import com.phlx.anchorcollect_p.entity.CattleResumeEntity;
import com.phlx.anchorcollect_p.entity.DictEntity;
import com.phlx.anchorcollect_p.ui.base.MainBarVM;
import org.greenrobot.greendao.query.QueryBuilder;
import java.util.List;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;
......@@ -104,7 +111,29 @@ public class MainVM extends MainBarVM<Repository> {
ToastUtils.showShort("请先扫描耳标");
return;
}
onTabClickEvent.setValue(5);
QueryBuilder<CattleResumeEntity> builder =
DbUtil.getInstance().getQueryBuilder(CattleResumeEntity.class)
.where(CattleResumeEntityDao.Properties.Unid.eq(Configs.tempUnid));
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CattleResumeEntity>() {
@Override
public void onSuccess(List<CattleResumeEntity> result) {
if (result != null && result.size() > 0) {
if (result.get(0).getSex().equals("2")) {
onTabClickEvent.setValue(5);
}else{
ToastUtils.showShort("公牛无法配种!");
}
}
}
@Override
public void onFailed() {
ToastUtils.showShort("基础档案数据库查询失败");
}
}).queryAsyncAll(CattleResumeEntity.class, builder);
}
});
......
......@@ -4,6 +4,14 @@ buildscript {
repositories {
google()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
......@@ -21,6 +29,13 @@ buildscript {
allprojects {
repositories {
google()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
......
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