Commit a4c6ad67 authored by hywang's avatar hywang

增加称重、诊疗、免疫接口

parent 429a4804
......@@ -10,19 +10,19 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.WeightManEntity;
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;
/**
*
......@@ -126,6 +126,51 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
return mHttpDataSource.uploadBreedingRecordDetailList(body);
}
@Override
public Observable<ListResponse<WeightManEntity>> downloadWeightManList(Map<String, String> map) {
return mHttpDataSource.downloadWeightManList(map);
}
@Override
public Observable<CollectResponse> downloadWeightManListSync(RequestBody body) {
return mHttpDataSource.downloadWeightManListSync(body);
}
@Override
public Observable<CollectResponse> uploadWeightManList(RequestBody body) {
return mHttpDataSource.uploadWeightManList(body);
}
@Override
public Observable<ListResponse<MedicalRecordEntity>> downloadMedicalRecordList(Map<String, String> map) {
return mHttpDataSource.downloadMedicalRecordList(map);
}
@Override
public Observable<CollectResponse> downloadMedicalRecordListSync(RequestBody body) {
return mHttpDataSource.downloadMedicalRecordListSync(body);
}
@Override
public Observable<CollectResponse> uploadMedicalRecordList(RequestBody body) {
return mHttpDataSource.uploadMedicalRecordList(body);
}
@Override
public Observable<ListResponse<ImmuneBatchEntity>> downloadImmuneBatchList(Map<String, String> map) {
return mHttpDataSource.downloadImmuneBatchList(map);
}
@Override
public Observable<CollectResponse> downloadImmuneBatchListSync(RequestBody body) {
return mHttpDataSource.downloadImmuneBatchListSync(body);
}
@Override
public Observable<CollectResponse> uploadImmuneBatchList(RequestBody body) {
return mHttpDataSource.uploadImmuneBatchList(body);
}
/****************************************************************************/
@Override
......
......@@ -6,12 +6,14 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.WeightManEntity;
import com.phlx.anchorcollect.params.CollectResponse;
import com.phlx.anchorcollect.params.ListResponse;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
......@@ -144,6 +146,72 @@ public interface ApiService {
@POST("/api/cattlematingDetaill/add")
Observable<CollectResponse> uploadBreedingRecordDetailList(@Body RequestBody body);
/**
* 获取-称重管理-列表
* SyncState 0根据记录更新,1重新更新
*/
@FormUrlEncoded
@POST("/api/weightMan/list")
Observable<ListResponse<WeightManEntity>> downloadWeightManList(@FieldMap Map<String, String> map);
/**
* 获取-称重管理-列表-返回
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/weightMan/sync/add")
Observable<CollectResponse> downloadWeightManListSync(@Body RequestBody body);
/**
* 上传-称重管理-列表
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/weightMan/add")
Observable<CollectResponse> uploadWeightManList(@Body RequestBody body);
/**
* 获取-诊疗记录-列表
* SyncState 0根据记录更新,1重新更新
*/
@FormUrlEncoded
@POST("/api/medicalrecords/list")
Observable<ListResponse<MedicalRecordEntity>> downloadMedicalRecordList(@FieldMap Map<String, String> map);
/**
* 获取-诊疗记录-列表-返回
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/medicalrecords/sync/add")
Observable<CollectResponse> downloadMedicalRecordListSync(@Body RequestBody body);
/**
* 上传-诊疗记录-列表
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/medicalrecords/add")
Observable<CollectResponse> uploadMedicalRecordList(@Body RequestBody body);
/**
* 获取-免疫记录-列表
* SyncState 0根据记录更新,1重新更新
*/
@FormUrlEncoded
@POST("/api/immunebatch/list")
Observable<ListResponse<ImmuneBatchEntity>> downloadImmuneBatchList(@FieldMap Map<String, String> map);
/**
* 获取-免疫记录-列表-返回
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/immunebatch/sync/add")
Observable<CollectResponse> downloadImmuneBatchListSync(@Body RequestBody body);
/**
* 上传-免疫记录-列表
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/immunebatch/add")
Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body);
......
......@@ -6,12 +6,14 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.WeightManEntity;
import com.phlx.anchorcollect.params.CollectResponse;
import com.phlx.anchorcollect.params.ListResponse;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
......@@ -112,4 +114,51 @@ public interface HttpDataSource {
*/
Observable<CollectResponse> uploadBreedingRecordDetailList(@Body RequestBody body);
/**
* 获取-称重管理-列表
* SyncState 0根据记录更新,1重新更新
*/
Observable<ListResponse<WeightManEntity>> downloadWeightManList(@FieldMap Map<String, String> map);
/**
* 获取-称重管理-列表-返回
*/
Observable<CollectResponse> downloadWeightManListSync(@Body RequestBody body);
/**
* 上传-称重管理-列表
*/
Observable<CollectResponse> uploadWeightManList(@Body RequestBody body);
/**
* 获取-诊疗记录-列表
* SyncState 0根据记录更新,1重新更新
*/
Observable<ListResponse<MedicalRecordEntity>> downloadMedicalRecordList(@FieldMap Map<String, String> map);
/**
* 获取-诊疗记录-列表-返回
*/
Observable<CollectResponse> downloadMedicalRecordListSync(@Body RequestBody body);
/**
* 上传-诊疗记录-列表
*/
Observable<CollectResponse> uploadMedicalRecordList(@Body RequestBody body);
/**
* 获取-免疫记录-列表
* SyncState 0根据记录更新,1重新更新
*/
Observable<ListResponse<ImmuneBatchEntity>> downloadImmuneBatchList(@FieldMap Map<String, String> map);
/**
* 获取-免疫记录-列表-返回
*/
Observable<CollectResponse> downloadImmuneBatchListSync(@Body RequestBody body);
/**
* 上传-免疫记录-列表
*/
Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body);
}
......@@ -6,12 +6,14 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.WeightManEntity;
import com.phlx.anchorcollect.params.CollectResponse;
import com.phlx.anchorcollect.params.ListResponse;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
......@@ -115,4 +117,49 @@ public class HttpDataSourceImpl implements HttpDataSource {
public Observable<CollectResponse> uploadBreedingRecordDetailList(RequestBody body) {
return apiService.uploadBreedingRecordDetailList(body);
}
@Override
public Observable<ListResponse<WeightManEntity>> downloadWeightManList(Map<String, String> map) {
return apiService.downloadWeightManList(map);
}
@Override
public Observable<CollectResponse> downloadWeightManListSync(RequestBody body) {
return apiService.downloadWeightManListSync(body);
}
@Override
public Observable<CollectResponse> uploadWeightManList(RequestBody body) {
return apiService.uploadWeightManList(body);
}
@Override
public Observable<ListResponse<MedicalRecordEntity>> downloadMedicalRecordList(Map<String, String> map) {
return apiService.downloadMedicalRecordList(map);
}
@Override
public Observable<CollectResponse> downloadMedicalRecordListSync(RequestBody body) {
return apiService.downloadMedicalRecordListSync(body);
}
@Override
public Observable<CollectResponse> uploadMedicalRecordList(RequestBody body) {
return apiService.uploadMedicalRecordList(body);
}
@Override
public Observable<ListResponse<ImmuneBatchEntity>> downloadImmuneBatchList(Map<String, String> map) {
return apiService.downloadImmuneBatchList(map);
}
@Override
public Observable<CollectResponse> downloadImmuneBatchListSync(RequestBody body) {
return apiService.downloadImmuneBatchListSync(body);
}
@Override
public Observable<CollectResponse> uploadImmuneBatchList(RequestBody body) {
return apiService.uploadImmuneBatchList(body);
}
}
......@@ -29,11 +29,11 @@ public class DaoMaster extends AbstractDaoMaster {
DictEntityDao.createTable(db, ifNotExists);
GenTableDao.createTable(db, ifNotExists);
GenTableColumnDao.createTable(db, ifNotExists);
ImmuneEntityDao.createTable(db, ifNotExists);
MedicalEntityDao.createTable(db, ifNotExists);
PerformanceEntityDao.createTable(db, ifNotExists);
UserRoleEntityDao.createTable(db, ifNotExists);
WeightingEntityDao.createTable(db, ifNotExists);
WeightManEntityDao.createTable(db, ifNotExists);
ImmuneBatchEntityDao.createTable(db, ifNotExists);
MedicalRecordEntityDao.createTable(db, ifNotExists);
}
/** Drops underlying database table using DAOs. */
......@@ -46,11 +46,11 @@ public class DaoMaster extends AbstractDaoMaster {
DictEntityDao.dropTable(db, ifExists);
GenTableDao.dropTable(db, ifExists);
GenTableColumnDao.dropTable(db, ifExists);
ImmuneEntityDao.dropTable(db, ifExists);
MedicalEntityDao.dropTable(db, ifExists);
PerformanceEntityDao.dropTable(db, ifExists);
UserRoleEntityDao.dropTable(db, ifExists);
WeightingEntityDao.dropTable(db, ifExists);
WeightManEntityDao.dropTable(db, ifExists);
ImmuneBatchEntityDao.dropTable(db, ifExists);
MedicalRecordEntityDao.dropTable(db, ifExists);
}
/**
......@@ -77,11 +77,11 @@ public class DaoMaster extends AbstractDaoMaster {
registerDaoClass(DictEntityDao.class);
registerDaoClass(GenTableDao.class);
registerDaoClass(GenTableColumnDao.class);
registerDaoClass(ImmuneEntityDao.class);
registerDaoClass(MedicalEntityDao.class);
registerDaoClass(PerformanceEntityDao.class);
registerDaoClass(UserRoleEntityDao.class);
registerDaoClass(WeightingEntityDao.class);
registerDaoClass(WeightManEntityDao.class);
registerDaoClass(ImmuneBatchEntityDao.class);
registerDaoClass(MedicalRecordEntityDao.class);
}
public DaoSession newSession() {
......
......@@ -16,11 +16,11 @@ import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenTable;
import com.phlx.anchorcollect.entity.GenTableColumn;
import com.phlx.anchorcollect.entity.ImmuneEntity;
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.WeightManEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.db.gen.AncestryinfoEntityDao;
import com.phlx.anchorcollect.db.gen.BreedingRecordDetailEntityDao;
......@@ -30,11 +30,11 @@ import com.phlx.anchorcollect.db.gen.CattleResumeEntityDao;
import com.phlx.anchorcollect.db.gen.DictEntityDao;
import com.phlx.anchorcollect.db.gen.GenTableDao;
import com.phlx.anchorcollect.db.gen.GenTableColumnDao;
import com.phlx.anchorcollect.db.gen.ImmuneEntityDao;
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.WeightManEntityDao;
import com.phlx.anchorcollect.db.gen.ImmuneBatchEntityDao;
import com.phlx.anchorcollect.db.gen.MedicalRecordEntityDao;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
......@@ -53,11 +53,11 @@ public class DaoSession extends AbstractDaoSession {
private final DaoConfig dictEntityDaoConfig;
private final DaoConfig genTableDaoConfig;
private final DaoConfig genTableColumnDaoConfig;
private final DaoConfig immuneEntityDaoConfig;
private final DaoConfig medicalEntityDaoConfig;
private final DaoConfig performanceEntityDaoConfig;
private final DaoConfig userRoleEntityDaoConfig;
private final DaoConfig weightingEntityDaoConfig;
private final DaoConfig weightManEntityDaoConfig;
private final DaoConfig immuneBatchEntityDaoConfig;
private final DaoConfig medicalRecordEntityDaoConfig;
private final AncestryinfoEntityDao ancestryinfoEntityDao;
private final BreedingRecordDetailEntityDao breedingRecordDetailEntityDao;
......@@ -67,11 +67,11 @@ public class DaoSession extends AbstractDaoSession {
private final DictEntityDao dictEntityDao;
private final GenTableDao genTableDao;
private final GenTableColumnDao genTableColumnDao;
private final ImmuneEntityDao immuneEntityDao;
private final MedicalEntityDao medicalEntityDao;
private final PerformanceEntityDao performanceEntityDao;
private final UserRoleEntityDao userRoleEntityDao;
private final WeightingEntityDao weightingEntityDao;
private final WeightManEntityDao weightManEntityDao;
private final ImmuneBatchEntityDao immuneBatchEntityDao;
private final MedicalRecordEntityDao medicalRecordEntityDao;
public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
daoConfigMap) {
......@@ -101,20 +101,20 @@ public class DaoSession extends AbstractDaoSession {
genTableColumnDaoConfig = daoConfigMap.get(GenTableColumnDao.class).clone();
genTableColumnDaoConfig.initIdentityScope(type);
immuneEntityDaoConfig = daoConfigMap.get(ImmuneEntityDao.class).clone();
immuneEntityDaoConfig.initIdentityScope(type);
medicalEntityDaoConfig = daoConfigMap.get(MedicalEntityDao.class).clone();
medicalEntityDaoConfig.initIdentityScope(type);
performanceEntityDaoConfig = daoConfigMap.get(PerformanceEntityDao.class).clone();
performanceEntityDaoConfig.initIdentityScope(type);
userRoleEntityDaoConfig = daoConfigMap.get(UserRoleEntityDao.class).clone();
userRoleEntityDaoConfig.initIdentityScope(type);
weightingEntityDaoConfig = daoConfigMap.get(WeightingEntityDao.class).clone();
weightingEntityDaoConfig.initIdentityScope(type);
weightManEntityDaoConfig = daoConfigMap.get(WeightManEntityDao.class).clone();
weightManEntityDaoConfig.initIdentityScope(type);
immuneBatchEntityDaoConfig = daoConfigMap.get(ImmuneBatchEntityDao.class).clone();
immuneBatchEntityDaoConfig.initIdentityScope(type);
medicalRecordEntityDaoConfig = daoConfigMap.get(MedicalRecordEntityDao.class).clone();
medicalRecordEntityDaoConfig.initIdentityScope(type);
ancestryinfoEntityDao = new AncestryinfoEntityDao(ancestryinfoEntityDaoConfig, this);
breedingRecordDetailEntityDao = new BreedingRecordDetailEntityDao(breedingRecordDetailEntityDaoConfig, this);
......@@ -124,11 +124,11 @@ public class DaoSession extends AbstractDaoSession {
dictEntityDao = new DictEntityDao(dictEntityDaoConfig, this);
genTableDao = new GenTableDao(genTableDaoConfig, this);
genTableColumnDao = new GenTableColumnDao(genTableColumnDaoConfig, this);
immuneEntityDao = new ImmuneEntityDao(immuneEntityDaoConfig, this);
medicalEntityDao = new MedicalEntityDao(medicalEntityDaoConfig, this);
performanceEntityDao = new PerformanceEntityDao(performanceEntityDaoConfig, this);
userRoleEntityDao = new UserRoleEntityDao(userRoleEntityDaoConfig, this);
weightingEntityDao = new WeightingEntityDao(weightingEntityDaoConfig, this);
weightManEntityDao = new WeightManEntityDao(weightManEntityDaoConfig, this);
immuneBatchEntityDao = new ImmuneBatchEntityDao(immuneBatchEntityDaoConfig, this);
medicalRecordEntityDao = new MedicalRecordEntityDao(medicalRecordEntityDaoConfig, this);
registerDao(AncestryinfoEntity.class, ancestryinfoEntityDao);
registerDao(BreedingRecordDetailEntity.class, breedingRecordDetailEntityDao);
......@@ -138,11 +138,11 @@ public class DaoSession extends AbstractDaoSession {
registerDao(DictEntity.class, dictEntityDao);
registerDao(GenTable.class, genTableDao);
registerDao(GenTableColumn.class, genTableColumnDao);
registerDao(ImmuneEntity.class, immuneEntityDao);
registerDao(MedicalEntity.class, medicalEntityDao);
registerDao(PerformanceEntity.class, performanceEntityDao);
registerDao(UserRoleEntity.class, userRoleEntityDao);
registerDao(WeightingEntity.class, weightingEntityDao);
registerDao(WeightManEntity.class, weightManEntityDao);
registerDao(ImmuneBatchEntity.class, immuneBatchEntityDao);
registerDao(MedicalRecordEntity.class, medicalRecordEntityDao);
}
public void clear() {
......@@ -154,11 +154,11 @@ public class DaoSession extends AbstractDaoSession {
dictEntityDaoConfig.clearIdentityScope();
genTableDaoConfig.clearIdentityScope();
genTableColumnDaoConfig.clearIdentityScope();
immuneEntityDaoConfig.clearIdentityScope();
medicalEntityDaoConfig.clearIdentityScope();
performanceEntityDaoConfig.clearIdentityScope();
userRoleEntityDaoConfig.clearIdentityScope();
weightingEntityDaoConfig.clearIdentityScope();
weightManEntityDaoConfig.clearIdentityScope();
immuneBatchEntityDaoConfig.clearIdentityScope();
medicalRecordEntityDaoConfig.clearIdentityScope();
}
public AncestryinfoEntityDao getAncestryinfoEntityDao() {
......@@ -193,14 +193,6 @@ public class DaoSession extends AbstractDaoSession {
return genTableColumnDao;
}
public ImmuneEntityDao getImmuneEntityDao() {
return immuneEntityDao;
}
public MedicalEntityDao getMedicalEntityDao() {
return medicalEntityDao;
}
public PerformanceEntityDao getPerformanceEntityDao() {
return performanceEntityDao;
}
......@@ -209,8 +201,16 @@ public class DaoSession extends AbstractDaoSession {
return userRoleEntityDao;
}
public WeightingEntityDao getWeightingEntityDao() {
return weightingEntityDao;
public WeightManEntityDao getWeightManEntityDao() {
return weightManEntityDao;
}
public ImmuneBatchEntityDao getImmuneBatchEntityDao() {
return immuneBatchEntityDao;
}
public MedicalRecordEntityDao getMedicalRecordEntityDao() {
return medicalRecordEntityDao;
}
}
package com.phlx.anchorcollect.db.gen;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.phlx.anchorcollect.entity.WeightingEntity;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "WEIGHTING_ENTITY".
*/
public class WeightingEntityDao extends AbstractDao<WeightingEntity, String> {
public static final String TABLENAME = "WEIGHTING_ENTITY";
/**
* Properties of entity WeightingEntity.<br/>
* 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, String.class, "unid", true, "UNID");
public final static Property RegistrationNo = new Property(2, String.class, "RegistrationNo", false, "REGISTRATION_NO");
public final static Property WeightName = new Property(3, String.class, "weightName", false, "WEIGHT_NAME");
public final static Property Weight = new Property(4, String.class, "weight", false, "WEIGHT");
public final static Property WeightingDate = new Property(5, String.class, "weightingDate", false, "WEIGHTING_DATE");
public final static Property PrincipalName = new Property(6, String.class, "principalName", false, "PRINCIPAL_NAME");
public final static Property PrincipalId = new Property(7, String.class, "principalId", false, "PRINCIPAL_ID");
public final static Property WeightCount = new Property(8, String.class, "weightCount", false, "WEIGHT_COUNT");
public final static Property CircleNo = new Property(9, String.class, "circleNo", false, "CIRCLE_NO");
}
public WeightingEntityDao(DaoConfig config) {
super(config);
}
public WeightingEntityDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"WEIGHTING_ENTITY\" (" + //
"\"ID\" INTEGER NOT NULL ," + // 0: id
"\"UNID\" TEXT PRIMARY KEY NOT NULL ," + // 1: unid
"\"REGISTRATION_NO\" TEXT," + // 2: RegistrationNo
"\"WEIGHT_NAME\" TEXT," + // 3: weightName
"\"WEIGHT\" TEXT," + // 4: weight
"\"WEIGHTING_DATE\" TEXT," + // 5: weightingDate
"\"PRINCIPAL_NAME\" TEXT," + // 6: principalName
"\"PRINCIPAL_ID\" TEXT," + // 7: principalId
"\"WEIGHT_COUNT\" TEXT," + // 8: weightCount
"\"CIRCLE_NO\" TEXT);"); // 9: circleNo
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"WEIGHTING_ENTITY\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, WeightingEntity entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getId());
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(2, unid);
}
String RegistrationNo = entity.getRegistrationNo();
if (RegistrationNo != null) {
stmt.bindString(3, RegistrationNo);
}
String weightName = entity.getWeightName();
if (weightName != null) {
stmt.bindString(4, weightName);
}
String weight = entity.getWeight();
if (weight != null) {
stmt.bindString(5, weight);
}
String weightingDate = entity.getWeightingDate();
if (weightingDate != null) {
stmt.bindString(6, weightingDate);
}
String principalName = entity.getPrincipalName();
if (principalName != null) {
stmt.bindString(7, principalName);
}
String principalId = entity.getPrincipalId();
if (principalId != null) {
stmt.bindString(8, principalId);
}
String weightCount = entity.getWeightCount();
if (weightCount != null) {
stmt.bindString(9, weightCount);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(10, circleNo);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, WeightingEntity entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getId());
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(2, unid);
}
String RegistrationNo = entity.getRegistrationNo();
if (RegistrationNo != null) {
stmt.bindString(3, RegistrationNo);
}
String weightName = entity.getWeightName();
if (weightName != null) {
stmt.bindString(4, weightName);
}
String weight = entity.getWeight();
if (weight != null) {
stmt.bindString(5, weight);
}
String weightingDate = entity.getWeightingDate();
if (weightingDate != null) {
stmt.bindString(6, weightingDate);
}
String principalName = entity.getPrincipalName();
if (principalName != null) {
stmt.bindString(7, principalName);
}
String principalId = entity.getPrincipalId();
if (principalId != null) {
stmt.bindString(8, principalId);
}
String weightCount = entity.getWeightCount();
if (weightCount != null) {
stmt.bindString(9, weightCount);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(10, circleNo);
}
}
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1);
}
@Override
public WeightingEntity readEntity(Cursor cursor, int offset) {
WeightingEntity entity = new WeightingEntity( //
cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // unid
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // RegistrationNo
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // weightName
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // weight
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // weightingDate
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // principalName
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // principalId
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // weightCount
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // circleNo
);
return entity;
}
@Override
public void readEntity(Cursor cursor, WeightingEntity entity, int offset) {
entity.setId(cursor.getLong(offset + 0));
entity.setUnid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setRegistrationNo(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setWeightName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setWeight(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setWeightingDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setPrincipalName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setPrincipalId(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setWeightCount(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setCircleNo(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
}
@Override
protected final String updateKeyAfterInsert(WeightingEntity entity, long rowId) {
return entity.getUnid();
}
@Override
public String getKey(WeightingEntity entity) {
if(entity != null) {
return entity.getUnid();
} else {
return null;
}
}
@Override
public boolean hasKey(WeightingEntity entity) {
return entity.getUnid() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.phlx.anchorcollect.entity;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.databinding.BaseObservable;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
/**
* 称重管理类
*/
@Entity
public class WeightManEntity extends BaseObservable implements Parcelable {
/**
* unid
*/
private String unid;
/**
* 基本信息ID
*/
private String cattleresumeId;
/**
* 体重
*/
private String weight;
/** 是否上传 0未上传,1已上传 */
private String uploadStatus;
/**
* 部门id
*/
private String deptId;
/** 搜索值 */
private String searchValue;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private String updateTime;
/** 备注 */
private String remark;
public WeightManEntity() {
}
protected WeightManEntity(Parcel in) {
unid = in.readString();
cattleresumeId = in.readString();
weight = in.readString();
uploadStatus = in.readString();
deptId = in.readString();
searchValue = in.readString();
createBy = in.readString();
createTime = in.readString();
updateBy = in.readString();
updateTime = in.readString();
remark = in.readString();
}
@Generated(hash = 445089683)
public WeightManEntity(String unid, String cattleresumeId, String weight,
String uploadStatus, String deptId, String searchValue, String createBy,
String createTime, String updateBy, String updateTime, String remark) {
this.unid = unid;
this.cattleresumeId = cattleresumeId;
this.weight = weight;
this.uploadStatus = uploadStatus;
this.deptId = deptId;
this.searchValue = searchValue;
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(unid);
dest.writeString(cattleresumeId);
dest.writeString(weight);
dest.writeString(uploadStatus);
dest.writeString(deptId);
dest.writeString(searchValue);
dest.writeString(createBy);
dest.writeString(createTime);
dest.writeString(updateBy);
dest.writeString(updateTime);
dest.writeString(remark);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<WeightManEntity> CREATOR = new Creator<WeightManEntity>() {
@Override
public WeightManEntity createFromParcel(Parcel in) {
return new WeightManEntity(in);
}
@Override
public WeightManEntity[] newArray(int size) {
return new WeightManEntity[size];
}
};
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
public String getCattleresumeId() {
return cattleresumeId;
}
public void setCattleresumeId(String cattleresumeId) {
this.cattleresumeId = cattleresumeId;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
public String getUploadStatus() {
return uploadStatus;
}
public void setUploadStatus(String uploadStatus) {
this.uploadStatus = uploadStatus;
}
public String getDeptId() {
return deptId;
}
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getCreateTime() {
return createTime;
}
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 "WeightingEntity{" +
"unid='" + unid + '\'' +
", cattleresumeId='" + cattleresumeId + '\'' +
", weight='" + weight + '\'' +
", uploadStatus='" + uploadStatus + '\'' +
", deptId='" + deptId + '\'' +
", searchValue='" + searchValue + '\'' +
", createBy='" + createBy + '\'' +
", createTime='" + createTime + '\'' +
", updateBy='" + updateBy + '\'' +
", updateTime='" + updateTime + '\'' +
", remark='" + remark + '\'' +
'}';
}
}
package com.phlx.anchorcollect.entity;
import android.os.Parcel;
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 WeightingEntity extends BaseObservable implements Parcelable {
private long id;
/**
* unid主键
*/
@Id(autoincrement = false)
private String unid;
/**
* 登记号
*/
private String RegistrationNo;
/**
* 称重名称
*/
private String weightName;
/**
* 重量
*/
private String weight;
/**
* 称重日期
*/
private String weightingDate;
/**
* 负责人
*/
private String principalName;
/**
* 负责人id
*/
private String principalId;
/**
* 圈号
*/
private String weightCount;
/**
* 圈号
*/
private String circleNo;
public WeightingEntity() {
}
protected WeightingEntity(Parcel in) {
id = in.readLong();
unid = in.readString();
RegistrationNo = in.readString();
weightName = in.readString();
weight = in.readString();
weightingDate = in.readString();
principalName = in.readString();
principalId = in.readString();
weightCount = in.readString();
circleNo = in.readString();
}
@Generated(hash = 1553460234)
public WeightingEntity(long id, String unid, String RegistrationNo, String weightName,
String weight, String weightingDate, String principalName, String principalId,
String weightCount, String circleNo) {
this.id = id;
this.unid = unid;
this.RegistrationNo = RegistrationNo;
this.weightName = weightName;
this.weight = weight;
this.weightingDate = weightingDate;
this.principalName = principalName;
this.principalId = principalId;
this.weightCount = weightCount;
this.circleNo = circleNo;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(id);
dest.writeString(unid);
dest.writeString(RegistrationNo);
dest.writeString(weightName);
dest.writeString(weight);
dest.writeString(weightingDate);
dest.writeString(principalName);
dest.writeString(principalId);
dest.writeString(weightCount);
dest.writeString(circleNo);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<WeightingEntity> CREATOR = new Creator<WeightingEntity>() {
@Override
public WeightingEntity createFromParcel(Parcel in) {
return new WeightingEntity(in);
}
@Override
public WeightingEntity[] newArray(int size) {
return new WeightingEntity[size];
}
};
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
public String getRegistrationNo() {
return RegistrationNo;
}
public void setRegistrationNo(String registrationNo) {
RegistrationNo = registrationNo;
}
public String getWeightName() {
return weightName;
}
public void setWeightName(String weightName) {
this.weightName = weightName;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
public String getWeightingDate() {
return weightingDate;
}
public void setWeightingDate(String weightingDate) {
this.weightingDate = weightingDate;
}
public String getPrincipalName() {
return principalName;
}
public void setPrincipalName(String principalName) {
this.principalName = principalName;
}
public String getPrincipalId() {
return principalId;
}
public void setPrincipalId(String principalId) {
this.principalId = principalId;
}
public String getWeightCount() {
return weightCount;
}
public void setWeightCount(String weightCount) {
this.weightCount = weightCount;
}
public String getCircleNo() {
return circleNo;
}
public void setCircleNo(String circleNo) {
this.circleNo = circleNo;
}
@Override
public String toString() {
return "WeightingEntity{" +
"id=" + id +
", unid='" + unid + '\'' +
", RegistrationNo='" + RegistrationNo + '\'' +
", weightName='" + weightName + '\'' +
", weight='" + weight + '\'' +
", weightingDate='" + weightingDate + '\'' +
", principalName='" + principalName + '\'' +
", principalId='" + principalId + '\'' +
", weightCount='" + weightCount + '\'' +
", circleNo='" + circleNo + '\'' +
'}';
}
}
......@@ -109,7 +109,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
binding.tvWeighAdg.setTypeface(Configs.typeface);
binding.tvWeighBwg.setTypeface(Configs.typeface);
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(16));
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(10));
initTimePicker();
}
......
......@@ -96,8 +96,8 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
viewModel.initGen();
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(16));
binding.rvCollectDetail.addItemDecoration(new SpaceItemDecoration(16));
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(10));
binding.rvCollectDetail.addItemDecoration(new SpaceItemDecoration(10));
initTimePicker();
......
......@@ -90,7 +90,7 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
viewModel.initGen();
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(16));
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(10));
initTimePicker();
}
......
......@@ -14,10 +14,8 @@ import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil;
import com.phlx.anchorcollect.db.interf.DbQueryCallBack;
import com.phlx.anchorcollect.entity.CardEntity;
import com.phlx.anchorcollect.entity.ImmuneEntity;
import com.phlx.anchorcollect.entity.MedicalEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.WeightingEntity;
import com.phlx.anchorcollect.entity.WeightManEntity;
import com.phlx.anchorcollect.ui.fragment.list.CollectItem;
import org.greenrobot.greendao.query.QueryBuilder;
......@@ -133,16 +131,16 @@ public class CollectListVM extends BaseViewModel<Repository> {
}
private void refreshWeight() {
QueryBuilder<WeightingEntity> builder =
DbUtil.getInstance().getQueryBuilder(WeightingEntity.class);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<WeightingEntity>() {
QueryBuilder<WeightManEntity> builder =
DbUtil.getInstance().getQueryBuilder(WeightManEntity.class);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<WeightManEntity>() {
@Override
public void onSuccess(List<WeightingEntity> result) {
public void onSuccess(List<WeightManEntity> result) {
observableList.clear();
for (WeightingEntity ce : result) {
CollectItem ci = new CollectItem(CollectListVM.this, ce.getUnid() + ""
, ce.getWeightName(), ce.getCircleNo(), ce.getWeightingDate());
observableList.add(ci);
for (WeightManEntity ce : result) {
// CollectItem ci = new CollectItem(CollectListVM.this, ce.getUnid() + ""
// , ce.getWeightName(), ce.getCircleNo(), ce.getWeightingDate());
// observableList.add(ci);
}
}
......@@ -150,7 +148,7 @@ public class CollectListVM extends BaseViewModel<Repository> {
public void onFailed() {
ToastUtils.showShort("称重管理数据库查询失败");
}
}).queryAsyncAll(WeightingEntity.class, builder);
}).queryAsyncAll(WeightManEntity.class, builder);
}
private void refreshSign() {
......@@ -175,44 +173,44 @@ public class CollectListVM extends BaseViewModel<Repository> {
}
private void refreshHealth() {
QueryBuilder<MedicalEntity> builder =
DbUtil.getInstance().getQueryBuilder(MedicalEntity.class);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalEntity>() {
@Override
public void onSuccess(List<MedicalEntity> result) {
observableList.clear();
for (MedicalEntity ce : result) {
CollectItem ci = new CollectItem(CollectListVM.this, ce.getUnid() + ""
, ce.getCauseOf(), ce.getDrugName(), ce.getTreatDate());
observableList.add(ci);
}
}
@Override
public void onFailed() {
ToastUtils.showShort("健康管理数据库查询失败");
}
}).queryAsyncAll(MedicalEntity.class, builder);
// QueryBuilder<MedicalEntity> builder =
// DbUtil.getInstance().getQueryBuilder(MedicalEntity.class);
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalEntity>() {
// @Override
// public void onSuccess(List<MedicalEntity> result) {
// observableList.clear();
// for (MedicalEntity ce : result) {
// CollectItem ci = new CollectItem(CollectListVM.this, ce.getUnid() + ""
// , ce.getCauseOf(), ce.getDrugName(), ce.getTreatDate());
// observableList.add(ci);
// }
// }
//
// @Override
// public void onFailed() {
// ToastUtils.showShort("健康管理数据库查询失败");
// }
// }).queryAsyncAll(MedicalEntity.class, builder);
}
private void refreshImmun() {
QueryBuilder<ImmuneEntity> builder =
DbUtil.getInstance().getQueryBuilder(ImmuneEntity.class);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneEntity>() {
@Override
public void onSuccess(List<ImmuneEntity> result) {
observableList.clear();
for (ImmuneEntity ce : result) {
CollectItem ci = new CollectItem(CollectListVM.this, ce.getUnid() + ""
, ce.getVaccineName(), ce.getProductName(), ce.getImmuneDate());
observableList.add(ci);
}
}
@Override
public void onFailed() {
ToastUtils.showShort("免疫管理数据库查询失败");
}
}).queryAsyncAll(ImmuneEntity.class, builder);
// QueryBuilder<ImmuneEntity> builder =
// DbUtil.getInstance().getQueryBuilder(ImmuneEntity.class);
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneEntity>() {
// @Override
// public void onSuccess(List<ImmuneEntity> result) {
// observableList.clear();
// for (ImmuneEntity ce : result) {
// CollectItem ci = new CollectItem(CollectListVM.this, ce.getUnid() + ""
// , ce.getVaccineName(), ce.getProductName(), ce.getImmuneDate());
// observableList.add(ci);
// }
// }
//
// @Override
// public void onFailed() {
// ToastUtils.showShort("免疫管理数据库查询失败");
// }
// }).queryAsyncAll(ImmuneEntity.class, builder);
}
}
......@@ -3,16 +3,7 @@ package com.phlx.anchorcollect.ui.info;
import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;
import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.entity.CardEntity;
import com.phlx.anchorcollect.entity.ImmuneEntity;
import com.phlx.anchorcollect.entity.MedicalEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.ui.fragment.vm.CollectListVM;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;
public class CattleItem extends ItemViewModel<CattleVM> {
......
......@@ -5,30 +5,21 @@ import android.view.View;
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.db.DbUtil;
import com.phlx.anchorcollect.db.interf.DbQueryCallBack;
import com.phlx.anchorcollect.entity.CardEntity;
import com.phlx.anchorcollect.entity.ImmuneEntity;
import com.phlx.anchorcollect.entity.MedicalEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.WeightingEntity;
import com.phlx.anchorcollect.ui.base.BackBarVM;
import com.phlx.anchorcollect.ui.fragment.list.CollectItem;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
import java.util.List;
import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;
import me.goldze.mvvmhabit.utils.ToastUtils;
import me.tatarka.bindingcollectionadapter2.ItemBinding;
......@@ -124,54 +115,54 @@ public class CattleVM extends BackBarVM<Repository> {
}
private void refreshHealth() {
String sql = ("REGISTRATION_NO IN " +
"(SELECT REGISTRATION_NO FROM MEDICAL_ENTITY WHERE REGISTRATION_NO =" + registrationNo + " )");
WhereCondition.StringCondition stringCondition = new WhereCondition.StringCondition(sql);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalEntity>() {
@Override
public void onSuccess(List<MedicalEntity> result) {
observableHealthyList.clear();
if (result.size() > 0) {
MedicalEntity medicalEntity = result.get(0);
observableHealthyList.add(new CattleItem(CattleVM.this, "日期", medicalEntity.getTreatDate()));
observableHealthyList.add(new CattleItem(CattleVM.this, "病因", medicalEntity.getCauseOf()));
observableHealthyList.add(new CattleItem(CattleVM.this, "用药", medicalEntity.getDrugName()));
observableHealthyList.add(new CattleItem(CattleVM.this, "方法", medicalEntity.getDrugMethods()));
observableHealthyList.add(new CattleItem(CattleVM.this, "兽医", medicalEntity.getTreatPersonnel()));
}
refreshImmunity();
}
@Override
public void onFailed() {
ToastUtils.showShort("健康管理数据库查询失败");
refreshImmunity();
}
}).queryAsync(MedicalEntity.class, stringCondition);
// String sql = ("REGISTRATION_NO IN " +
// "(SELECT REGISTRATION_NO FROM MEDICAL_ENTITY WHERE REGISTRATION_NO =" + registrationNo + " )");
// WhereCondition.StringCondition stringCondition = new WhereCondition.StringCondition(sql);
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalEntity>() {
// @Override
// public void onSuccess(List<MedicalEntity> result) {
// observableHealthyList.clear();
// if (result.size() > 0) {
// MedicalEntity medicalEntity = result.get(0);
// observableHealthyList.add(new CattleItem(CattleVM.this, "日期", medicalEntity.getTreatDate()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "病因", medicalEntity.getCauseOf()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "用药", medicalEntity.getDrugName()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "方法", medicalEntity.getDrugMethods()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "兽医", medicalEntity.getTreatPersonnel()));
// }
// refreshImmunity();
// }
//
// @Override
// public void onFailed() {
// ToastUtils.showShort("健康管理数据库查询失败");
// refreshImmunity();
// }
// }).queryAsync(MedicalEntity.class, stringCondition);
}
private void refreshImmunity() {
String sql = ("REGISTRATION_NO IN " +
"(SELECT REGISTRATION_NO FROM IMMUNE_ENTITY WHERE REGISTRATION_NO =" + registrationNo + " )");
WhereCondition.StringCondition stringCondition = new WhereCondition.StringCondition(sql);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneEntity>() {
@Override
public void onSuccess(List<ImmuneEntity> result) {
observableImmunityList.clear();
if (result.size() > 0) {
ImmuneEntity immuneEntity = result.get(0);
observableImmunityList.add(new CattleItem(CattleVM.this, "日期", immuneEntity.getImmuneDate()));
observableImmunityList.add(new CattleItem(CattleVM.this, "名称", immuneEntity.getImmuneDosage()));
observableImmunityList.add(new CattleItem(CattleVM.this, "批号", immuneEntity.getLotnumber()));
observableImmunityList.add(new CattleItem(CattleVM.this, "兽医", immuneEntity.getImmunePerson()));
}
}
@Override
public void onFailed() {
ToastUtils.showShort("免疫管理数据库查询失败");
}
}).queryAsync(ImmuneEntity.class, stringCondition);
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneEntity>() {
// @Override
// public void onSuccess(List<ImmuneEntity> result) {
// observableImmunityList.clear();
// if (result.size() > 0) {
// ImmuneEntity immuneEntity = result.get(0);
// observableImmunityList.add(new CattleItem(CattleVM.this, "日期", immuneEntity.getImmuneDate()));
// observableImmunityList.add(new CattleItem(CattleVM.this, "名称", immuneEntity.getImmuneDosage()));
// observableImmunityList.add(new CattleItem(CattleVM.this, "批号", immuneEntity.getLotnumber()));
// observableImmunityList.add(new CattleItem(CattleVM.this, "兽医", immuneEntity.getImmunePerson()));
// }
// }
//
// @Override
// public void onFailed() {
// ToastUtils.showShort("免疫管理数据库查询失败");
// }
// }).queryAsync(ImmuneEntity.class, stringCondition);
}
......
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