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.ImmuneEntity;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "IMMUNE_ENTITY".
*/
public class ImmuneEntityDao extends AbstractDao<ImmuneEntity, String> {
public static final String TABLENAME = "IMMUNE_ENTITY";
/**
* Properties of entity ImmuneEntity.<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 CircleNo = new Property(3, String.class, "circleNo", false, "CIRCLE_NO");
public final static Property VaccineName = new Property(4, String.class, "vaccineName", false, "VACCINE_NAME");
public final static Property Lotnumber = new Property(5, String.class, "lotnumber", false, "LOTNUMBER");
public final static Property Manufacturer = new Property(6, String.class, "manufacturer", false, "MANUFACTURER");
public final static Property ProductName = new Property(7, String.class, "productName", false, "PRODUCT_NAME");
public final static Property Specifications = new Property(8, String.class, "specifications", false, "SPECIFICATIONS");
public final static Property RemainingNumber = new Property(9, String.class, "remainingNumber", false, "REMAINING_NUMBER");
public final static Property ImmuneMethod = new Property(10, String.class, "immuneMethod", false, "IMMUNE_METHOD");
public final static Property ImmuneDosage = new Property(11, String.class, "immuneDosage", false, "IMMUNE_DOSAGE");
public final static Property ImmuneDate = new Property(12, String.class, "immuneDate", false, "IMMUNE_DATE");
public final static Property ImmunePerson = new Property(13, String.class, "immunePerson", false, "IMMUNE_PERSON");
public final static Property Note = new Property(14, String.class, "note", false, "NOTE");
public final static Property UpdateId = new Property(15, String.class, "updateId", false, "UPDATE_ID");
public final static Property CreateBy = new Property(16, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(17, String.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(18, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(19, String.class, "updateTime", false, "UPDATE_TIME");
public final static Property Permissions = new Property(20, String.class, "permissions", false, "PERMISSIONS");
public final static Property InputTime = new Property(21, String.class, "inputTime", false, "INPUT_TIME");
}
public ImmuneEntityDao(DaoConfig config) {
super(config);
}
public ImmuneEntityDao(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 + "\"IMMUNE_ENTITY\" (" + //
"\"ID\" INTEGER," + // 0: id
"\"UNID\" TEXT PRIMARY KEY NOT NULL ," + // 1: unid
"\"REGISTRATION_NO\" TEXT," + // 2: registrationNo
"\"CIRCLE_NO\" TEXT," + // 3: circleNo
"\"VACCINE_NAME\" TEXT," + // 4: vaccineName
"\"LOTNUMBER\" TEXT," + // 5: lotnumber
"\"MANUFACTURER\" TEXT," + // 6: manufacturer
"\"PRODUCT_NAME\" TEXT," + // 7: productName
"\"SPECIFICATIONS\" TEXT," + // 8: specifications
"\"REMAINING_NUMBER\" TEXT," + // 9: remainingNumber
"\"IMMUNE_METHOD\" TEXT," + // 10: immuneMethod
"\"IMMUNE_DOSAGE\" TEXT," + // 11: immuneDosage
"\"IMMUNE_DATE\" TEXT," + // 12: immuneDate
"\"IMMUNE_PERSON\" TEXT," + // 13: immunePerson
"\"NOTE\" TEXT," + // 14: note
"\"UPDATE_ID\" TEXT," + // 15: updateId
"\"CREATE_BY\" TEXT," + // 16: createBy
"\"CREATE_TIME\" TEXT," + // 17: createTime
"\"UPDATE_BY\" TEXT," + // 18: updateBy
"\"UPDATE_TIME\" TEXT," + // 19: updateTime
"\"PERMISSIONS\" TEXT," + // 20: permissions
"\"INPUT_TIME\" TEXT);"); // 21: inputTime
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"IMMUNE_ENTITY\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, ImmuneEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(2, unid);
}
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(3, registrationNo);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(4, circleNo);
}
String vaccineName = entity.getVaccineName();
if (vaccineName != null) {
stmt.bindString(5, vaccineName);
}
String lotnumber = entity.getLotnumber();
if (lotnumber != null) {
stmt.bindString(6, lotnumber);
}
String manufacturer = entity.getManufacturer();
if (manufacturer != null) {
stmt.bindString(7, manufacturer);
}
String productName = entity.getProductName();
if (productName != null) {
stmt.bindString(8, productName);
}
String specifications = entity.getSpecifications();
if (specifications != null) {
stmt.bindString(9, specifications);
}
String remainingNumber = entity.getRemainingNumber();
if (remainingNumber != null) {
stmt.bindString(10, remainingNumber);
}
String immuneMethod = entity.getImmuneMethod();
if (immuneMethod != null) {
stmt.bindString(11, immuneMethod);
}
String immuneDosage = entity.getImmuneDosage();
if (immuneDosage != null) {
stmt.bindString(12, immuneDosage);
}
String immuneDate = entity.getImmuneDate();
if (immuneDate != null) {
stmt.bindString(13, immuneDate);
}
String immunePerson = entity.getImmunePerson();
if (immunePerson != null) {
stmt.bindString(14, immunePerson);
}
String note = entity.getNote();
if (note != null) {
stmt.bindString(15, note);
}
String updateId = entity.getUpdateId();
if (updateId != null) {
stmt.bindString(16, updateId);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(17, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(18, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(19, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(20, updateTime);
}
String permissions = entity.getPermissions();
if (permissions != null) {
stmt.bindString(21, permissions);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(22, inputTime);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, ImmuneEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(2, unid);
}
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(3, registrationNo);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(4, circleNo);
}
String vaccineName = entity.getVaccineName();
if (vaccineName != null) {
stmt.bindString(5, vaccineName);
}
String lotnumber = entity.getLotnumber();
if (lotnumber != null) {
stmt.bindString(6, lotnumber);
}
String manufacturer = entity.getManufacturer();
if (manufacturer != null) {
stmt.bindString(7, manufacturer);
}
String productName = entity.getProductName();
if (productName != null) {
stmt.bindString(8, productName);
}
String specifications = entity.getSpecifications();
if (specifications != null) {
stmt.bindString(9, specifications);
}
String remainingNumber = entity.getRemainingNumber();
if (remainingNumber != null) {
stmt.bindString(10, remainingNumber);
}
String immuneMethod = entity.getImmuneMethod();
if (immuneMethod != null) {
stmt.bindString(11, immuneMethod);
}
String immuneDosage = entity.getImmuneDosage();
if (immuneDosage != null) {
stmt.bindString(12, immuneDosage);
}
String immuneDate = entity.getImmuneDate();
if (immuneDate != null) {
stmt.bindString(13, immuneDate);
}
String immunePerson = entity.getImmunePerson();
if (immunePerson != null) {
stmt.bindString(14, immunePerson);
}
String note = entity.getNote();
if (note != null) {
stmt.bindString(15, note);
}
String updateId = entity.getUpdateId();
if (updateId != null) {
stmt.bindString(16, updateId);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(17, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(18, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(19, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(20, updateTime);
}
String permissions = entity.getPermissions();
if (permissions != null) {
stmt.bindString(21, permissions);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(22, inputTime);
}
}
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1);
}
@Override
public ImmuneEntity readEntity(Cursor cursor, int offset) {
ImmuneEntity entity = new ImmuneEntity( //
cursor.isNull(offset + 0) ? null : 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), // circleNo
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // vaccineName
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // lotnumber
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // manufacturer
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // productName
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // specifications
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // remainingNumber
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // immuneMethod
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // immuneDosage
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // immuneDate
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // immunePerson
cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // note
cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // updateId
cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // createBy
cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // createTime
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateBy
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // updateTime
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // permissions
cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21) // inputTime
);
return entity;
}
@Override
public void readEntity(Cursor cursor, ImmuneEntity entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : 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.setCircleNo(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setVaccineName(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setLotnumber(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setManufacturer(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setProductName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setSpecifications(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setRemainingNumber(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setImmuneMethod(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setImmuneDosage(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setImmuneDate(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setImmunePerson(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setNote(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
entity.setUpdateId(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
entity.setCreateBy(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
entity.setCreateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
entity.setUpdateBy(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setUpdateTime(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
entity.setPermissions(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
entity.setInputTime(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
}
@Override
protected final String updateKeyAfterInsert(ImmuneEntity entity, long rowId) {
return entity.getUnid();
}
@Override
public String getKey(ImmuneEntity entity) {
if(entity != null) {
return entity.getUnid();
} else {
return null;
}
}
@Override
public boolean hasKey(ImmuneEntity entity) {
return entity.getUnid() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
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.MedicalEntity;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "MEDICAL_ENTITY".
*/
public class MedicalEntityDao extends AbstractDao<MedicalEntity, Long> {
public static final String TABLENAME = "MEDICAL_ENTITY";
/**
* Properties of entity MedicalEntity.<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", true, "_id");
public final static Property Unid = new Property(1, String.class, "unid", false, "UNID");
public final static Property RegistrationNo = new Property(2, String.class, "registrationNo", false, "REGISTRATION_NO");
public final static Property TreatDate = new Property(3, String.class, "treatDate", false, "TREAT_DATE");
public final static Property TreatPersonnel = new Property(4, String.class, "treatPersonnel", false, "TREAT_PERSONNEL");
public final static Property CauseOf = new Property(5, String.class, "causeOf", false, "CAUSE_OF");
public final static Property BatchNo = new Property(6, String.class, "batchNo", false, "BATCH_NO");
public final static Property DrugName = new Property(7, String.class, "drugName", false, "DRUG_NAME");
public final static Property ProductName = new Property(8, String.class, "productName", false, "PRODUCT_NAME");
public final static Property Specifications = new Property(9, String.class, "specifications", false, "SPECIFICATIONS");
public final static Property RemainingNumber = new Property(10, String.class, "remainingNumber", false, "REMAINING_NUMBER");
public final static Property Number = new Property(11, String.class, "number", false, "NUMBER");
public final static Property DrugMethods = new Property(12, String.class, "drugMethods", false, "DRUG_METHODS");
public final static Property HoofDisease = new Property(13, String.class, "hoofDisease", false, "HOOF_DISEASE");
public final static Property Insecticide = new Property(14, String.class, "insecticide", false, "INSECTICIDE");
public final static Property Results = new Property(15, String.class, "results", false, "RESULTS");
public final static Property UpdateId = new Property(16, String.class, "updateId", false, "UPDATE_ID");
public final static Property CreateBy = new Property(17, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(18, String.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(19, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(20, String.class, "updateTime", false, "UPDATE_TIME");
public final static Property Permissions = new Property(21, String.class, "permissions", false, "PERMISSIONS");
public final static Property InputTime = new Property(22, String.class, "inputTime", false, "INPUT_TIME");
}
public MedicalEntityDao(DaoConfig config) {
super(config);
}
public MedicalEntityDao(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 + "\"MEDICAL_ENTITY\" (" + //
"\"_id\" INTEGER PRIMARY KEY ," + // 0: id
"\"UNID\" TEXT," + // 1: unid
"\"REGISTRATION_NO\" TEXT," + // 2: registrationNo
"\"TREAT_DATE\" TEXT," + // 3: treatDate
"\"TREAT_PERSONNEL\" TEXT," + // 4: treatPersonnel
"\"CAUSE_OF\" TEXT," + // 5: causeOf
"\"BATCH_NO\" TEXT," + // 6: batchNo
"\"DRUG_NAME\" TEXT," + // 7: drugName
"\"PRODUCT_NAME\" TEXT," + // 8: productName
"\"SPECIFICATIONS\" TEXT," + // 9: specifications
"\"REMAINING_NUMBER\" TEXT," + // 10: remainingNumber
"\"NUMBER\" TEXT," + // 11: number
"\"DRUG_METHODS\" TEXT," + // 12: drugMethods
"\"HOOF_DISEASE\" TEXT," + // 13: hoofDisease
"\"INSECTICIDE\" TEXT," + // 14: insecticide
"\"RESULTS\" TEXT," + // 15: results
"\"UPDATE_ID\" TEXT," + // 16: updateId
"\"CREATE_BY\" TEXT," + // 17: createBy
"\"CREATE_TIME\" TEXT," + // 18: createTime
"\"UPDATE_BY\" TEXT," + // 19: updateBy
"\"UPDATE_TIME\" TEXT," + // 20: updateTime
"\"PERMISSIONS\" TEXT," + // 21: permissions
"\"INPUT_TIME\" TEXT);"); // 22: inputTime
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MEDICAL_ENTITY\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, MedicalEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(2, unid);
}
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(3, registrationNo);
}
String treatDate = entity.getTreatDate();
if (treatDate != null) {
stmt.bindString(4, treatDate);
}
String treatPersonnel = entity.getTreatPersonnel();
if (treatPersonnel != null) {
stmt.bindString(5, treatPersonnel);
}
String causeOf = entity.getCauseOf();
if (causeOf != null) {
stmt.bindString(6, causeOf);
}
String batchNo = entity.getBatchNo();
if (batchNo != null) {
stmt.bindString(7, batchNo);
}
String drugName = entity.getDrugName();
if (drugName != null) {
stmt.bindString(8, drugName);
}
String productName = entity.getProductName();
if (productName != null) {
stmt.bindString(9, productName);
}
String specifications = entity.getSpecifications();
if (specifications != null) {
stmt.bindString(10, specifications);
}
String remainingNumber = entity.getRemainingNumber();
if (remainingNumber != null) {
stmt.bindString(11, remainingNumber);
}
String number = entity.getNumber();
if (number != null) {
stmt.bindString(12, number);
}
String drugMethods = entity.getDrugMethods();
if (drugMethods != null) {
stmt.bindString(13, drugMethods);
}
String hoofDisease = entity.getHoofDisease();
if (hoofDisease != null) {
stmt.bindString(14, hoofDisease);
}
String insecticide = entity.getInsecticide();
if (insecticide != null) {
stmt.bindString(15, insecticide);
}
String results = entity.getResults();
if (results != null) {
stmt.bindString(16, results);
}
String updateId = entity.getUpdateId();
if (updateId != null) {
stmt.bindString(17, updateId);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(18, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(19, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(20, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(21, updateTime);
}
String permissions = entity.getPermissions();
if (permissions != null) {
stmt.bindString(22, permissions);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(23, inputTime);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, MedicalEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(2, unid);
}
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(3, registrationNo);
}
String treatDate = entity.getTreatDate();
if (treatDate != null) {
stmt.bindString(4, treatDate);
}
String treatPersonnel = entity.getTreatPersonnel();
if (treatPersonnel != null) {
stmt.bindString(5, treatPersonnel);
}
String causeOf = entity.getCauseOf();
if (causeOf != null) {
stmt.bindString(6, causeOf);
}
String batchNo = entity.getBatchNo();
if (batchNo != null) {
stmt.bindString(7, batchNo);
}
String drugName = entity.getDrugName();
if (drugName != null) {
stmt.bindString(8, drugName);
}
String productName = entity.getProductName();
if (productName != null) {
stmt.bindString(9, productName);
}
String specifications = entity.getSpecifications();
if (specifications != null) {
stmt.bindString(10, specifications);
}
String remainingNumber = entity.getRemainingNumber();
if (remainingNumber != null) {
stmt.bindString(11, remainingNumber);
}
String number = entity.getNumber();
if (number != null) {
stmt.bindString(12, number);
}
String drugMethods = entity.getDrugMethods();
if (drugMethods != null) {
stmt.bindString(13, drugMethods);
}
String hoofDisease = entity.getHoofDisease();
if (hoofDisease != null) {
stmt.bindString(14, hoofDisease);
}
String insecticide = entity.getInsecticide();
if (insecticide != null) {
stmt.bindString(15, insecticide);
}
String results = entity.getResults();
if (results != null) {
stmt.bindString(16, results);
}
String updateId = entity.getUpdateId();
if (updateId != null) {
stmt.bindString(17, updateId);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(18, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(19, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(20, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(21, updateTime);
}
String permissions = entity.getPermissions();
if (permissions != null) {
stmt.bindString(22, permissions);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(23, inputTime);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public MedicalEntity readEntity(Cursor cursor, int offset) {
MedicalEntity entity = new MedicalEntity( //
cursor.isNull(offset + 0) ? null : 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), // treatDate
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // treatPersonnel
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // causeOf
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // batchNo
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // drugName
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // productName
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // specifications
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // remainingNumber
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // number
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // drugMethods
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // hoofDisease
cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // insecticide
cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // results
cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // updateId
cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // createBy
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // createTime
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // updateBy
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // updateTime
cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // permissions
cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22) // inputTime
);
return entity;
}
@Override
public void readEntity(Cursor cursor, MedicalEntity entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : 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.setTreatDate(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setTreatPersonnel(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setCauseOf(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setBatchNo(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setDrugName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setProductName(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setSpecifications(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setRemainingNumber(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setNumber(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setDrugMethods(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setHoofDisease(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setInsecticide(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
entity.setResults(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
entity.setUpdateId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
entity.setCreateBy(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
entity.setCreateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setUpdateBy(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
entity.setUpdateTime(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
entity.setPermissions(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
entity.setInputTime(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
}
@Override
protected final Long updateKeyAfterInsert(MedicalEntity entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(MedicalEntity entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(MedicalEntity entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
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;
}
}
......@@ -5,204 +5,186 @@ import android.os.Parcelable;
import androidx.databinding.BaseObservable;
import org.greenrobot.greendao.annotation.Entity;
import java.util.Date;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
/**
* 免疫记录
* 作者 : lei
* 时间 : 2018/12/3 11 : 04
* 免疫记录对象 zxgl_immunebatch
*
* @author phlx
* @date 2022-01-10
*/
@Entity
public class ImmuneEntity extends BaseObservable implements Parcelable {
//主键
private Long id;
public class ImmuneBatchEntity extends BaseObservable implements Parcelable {
/**
* 主键
*/
@Id
@Id(autoincrement = false)
private String unid;
/**
* 登记号
*/
private String registrationNo;
/**
* 圈舍号
*/
private String circleNo;
/**
* 疫苗品种
*/
private String vaccineName;
/**
* 疫苗批号
*/
private String lotnumber;
/**
* 生产厂家
*/
private String manufacturer;
/**
* 商品名
*/
private String productName;
/**
* 规格
*/
private String specifications;
/**
* 库存
*/
private String remainingNumber;
/**
* 免疫方法(滴鼻,注射,口服,刺种,气雾)
* 免疫有效期(月)
*/
private String immuneMethod;
/**
* 免疫剂量
*/
private String immuneDosage;
private String immuneExp;
/**
* 免疫日期
*/
private String immuneDate;
/**
* 免疫人员
*/
private String immunePerson;
/**
* 备注
* 围药期(月)
*/
private String note;
private String perinatalPeriod;
/**
* 更新状态
* 疫苗名称
*/
private String updateId;
private String vaccineName;
/**
* 创建者
* 疫苗批号
*/
private String createBy;
private String lotnumber;
/**
* 创建时间
* 生产厂家
*/
private String createTime;
private String manufacturer;
/**
* 更新者
* 规格
*/
private String updateBy;
private String specifications;
/**
* 更新时间
* 免疫剂量
*/
private String updateTime;
private String immuneDosage;
/**
* 权限标识
* 免疫方法;(滴鼻,注射,口服,刺种,气雾)
*/
private String permissions;
private String immuneMethod;
/** 是否上传 0未上传,1已上传 */
private String uploadStatus;
/**
* 从服务器接收,时间戳,终端需要上传给服务器,
* 部门id
*/
private String inputTime;
private String deptId;
/** 搜索值 */
private String searchValue;
/** 创建者 */
private String createBy;
/** 创建时间 */
private String createTime;
/** 更新者 */
private String updateBy;
public ImmuneEntity() {
/** 更新时间 */
private String updateTime;
/** 备注 */
private String remark;
public ImmuneBatchEntity() {
}
protected ImmuneEntity(Parcel in) {
if (in.readByte() == 0) {
id = null;
} else {
id = in.readLong();
}
protected ImmuneBatchEntity(Parcel in) {
unid = in.readString();
registrationNo = in.readString();
circleNo = in.readString();
immuneExp = in.readString();
immuneDate = in.readString();
immunePerson = in.readString();
perinatalPeriod = in.readString();
vaccineName = in.readString();
lotnumber = in.readString();
manufacturer = in.readString();
productName = in.readString();
specifications = in.readString();
remainingNumber = in.readString();
immuneMethod = in.readString();
immuneDosage = in.readString();
immuneDate = in.readString();
immunePerson = in.readString();
note = in.readString();
updateId = in.readString();
immuneMethod = in.readString();
uploadStatus = in.readString();
deptId = in.readString();
searchValue = in.readString();
createBy = in.readString();
createTime = in.readString();
updateBy = in.readString();
updateTime = in.readString();
permissions = in.readString();
inputTime = in.readString();
}
@Generated(hash = 986685803)
public ImmuneEntity(Long id, String unid, String registrationNo, String circleNo,
String vaccineName, String lotnumber, String manufacturer, String productName,
String specifications, String remainingNumber, String immuneMethod,
String immuneDosage, String immuneDate, String immunePerson, String note,
String updateId, String createBy, String createTime, String updateBy,
String updateTime, String permissions, String inputTime) {
this.id = id;
remark = in.readString();
}
@Generated(hash = 520368057)
public ImmuneBatchEntity(String unid, String circleNo, String immuneExp, String immuneDate,
String immunePerson, String perinatalPeriod, String vaccineName, String lotnumber,
String manufacturer, String specifications, String immuneDosage, String immuneMethod,
String uploadStatus, String deptId, String searchValue, String createBy, String createTime,
String updateBy, String updateTime, String remark) {
this.unid = unid;
this.registrationNo = registrationNo;
this.circleNo = circleNo;
this.immuneExp = immuneExp;
this.immuneDate = immuneDate;
this.immunePerson = immunePerson;
this.perinatalPeriod = perinatalPeriod;
this.vaccineName = vaccineName;
this.lotnumber = lotnumber;
this.manufacturer = manufacturer;
this.productName = productName;
this.specifications = specifications;
this.remainingNumber = remainingNumber;
this.immuneMethod = immuneMethod;
this.immuneDosage = immuneDosage;
this.immuneDate = immuneDate;
this.immunePerson = immunePerson;
this.note = note;
this.updateId = updateId;
this.immuneMethod = immuneMethod;
this.uploadStatus = uploadStatus;
this.deptId = deptId;
this.searchValue = searchValue;
this.createBy = createBy;
this.createTime = createTime;
this.updateBy = updateBy;
this.updateTime = updateTime;
this.permissions = permissions;
this.inputTime = inputTime;
this.remark = remark;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
if (id == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(id);
}
dest.writeString(unid);
dest.writeString(registrationNo);
dest.writeString(circleNo);
dest.writeString(immuneExp);
dest.writeString(immuneDate);
dest.writeString(immunePerson);
dest.writeString(perinatalPeriod);
dest.writeString(vaccineName);
dest.writeString(lotnumber);
dest.writeString(manufacturer);
dest.writeString(productName);
dest.writeString(specifications);
dest.writeString(remainingNumber);
dest.writeString(immuneMethod);
dest.writeString(immuneDosage);
dest.writeString(immuneDate);
dest.writeString(immunePerson);
dest.writeString(note);
dest.writeString(updateId);
dest.writeString(immuneMethod);
dest.writeString(uploadStatus);
dest.writeString(deptId);
dest.writeString(searchValue);
dest.writeString(createBy);
dest.writeString(createTime);
dest.writeString(updateBy);
dest.writeString(updateTime);
dest.writeString(permissions);
dest.writeString(inputTime);
dest.writeString(remark);
}
@Override
......@@ -210,26 +192,18 @@ public class ImmuneEntity extends BaseObservable implements Parcelable {
return 0;
}
public static final Creator<ImmuneEntity> CREATOR = new Creator<ImmuneEntity>() {
public static final Creator<ImmuneBatchEntity> CREATOR = new Creator<ImmuneBatchEntity>() {
@Override
public ImmuneEntity createFromParcel(Parcel in) {
return new ImmuneEntity(in);
public ImmuneBatchEntity createFromParcel(Parcel in) {
return new ImmuneBatchEntity(in);
}
@Override
public ImmuneEntity[] newArray(int size) {
return new ImmuneEntity[size];
public ImmuneBatchEntity[] newArray(int size) {
return new ImmuneBatchEntity[size];
}
};
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUnid() {
return unid;
}
......@@ -238,14 +212,6 @@ public class ImmuneEntity extends BaseObservable implements Parcelable {
this.unid = unid;
}
public String getRegistrationNo() {
return registrationNo;
}
public void setRegistrationNo(String registrationNo) {
this.registrationNo = registrationNo;
}
public String getCircleNo() {
return circleNo;
}
......@@ -254,6 +220,38 @@ public class ImmuneEntity extends BaseObservable implements Parcelable {
this.circleNo = circleNo;
}
public String getImmuneExp() {
return immuneExp;
}
public void setImmuneExp(String immuneExp) {
this.immuneExp = immuneExp;
}
public String getImmuneDate() {
return immuneDate;
}
public void setImmuneDate(String immuneDate) {
this.immuneDate = immuneDate;
}
public String getImmunePerson() {
return immunePerson;
}
public void setImmunePerson(String immunePerson) {
this.immunePerson = immunePerson;
}
public String getPerinatalPeriod() {
return perinatalPeriod;
}
public void setPerinatalPeriod(String perinatalPeriod) {
this.perinatalPeriod = perinatalPeriod;
}
public String getVaccineName() {
return vaccineName;
}
......@@ -278,14 +276,6 @@ public class ImmuneEntity extends BaseObservable implements Parcelable {
this.manufacturer = manufacturer;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getSpecifications() {
return specifications;
}
......@@ -294,22 +284,6 @@ public class ImmuneEntity extends BaseObservable implements Parcelable {
this.specifications = specifications;
}
public String getRemainingNumber() {
return remainingNumber;
}
public void setRemainingNumber(String remainingNumber) {
this.remainingNumber = remainingNumber;
}
public String getImmuneMethod() {
return immuneMethod;
}
public void setImmuneMethod(String immuneMethod) {
this.immuneMethod = immuneMethod;
}
public String getImmuneDosage() {
return immuneDosage;
}
......@@ -318,36 +292,36 @@ public class ImmuneEntity extends BaseObservable implements Parcelable {
this.immuneDosage = immuneDosage;
}
public String getImmuneDate() {
return immuneDate;
public String getImmuneMethod() {
return immuneMethod;
}
public void setImmuneDate(String immuneDate) {
this.immuneDate = immuneDate;
public void setImmuneMethod(String immuneMethod) {
this.immuneMethod = immuneMethod;
}
public String getImmunePerson() {
return immunePerson;
public String getUploadStatus() {
return uploadStatus;
}
public void setImmunePerson(String immunePerson) {
this.immunePerson = immunePerson;
public void setUploadStatus(String uploadStatus) {
this.uploadStatus = uploadStatus;
}
public String getNote() {
return note;
public String getDeptId() {
return deptId;
}
public void setNote(String note) {
this.note = note;
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public String getUpdateId() {
return updateId;
public String getSearchValue() {
return searchValue;
}
public void setUpdateId(String updateId) {
this.updateId = updateId;
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public String getCreateBy() {
......@@ -382,47 +356,37 @@ public class ImmuneEntity extends BaseObservable implements Parcelable {
this.updateTime = updateTime;
}
public String getPermissions() {
return permissions;
public String getRemark() {
return remark;
}
public void setPermissions(String permissions) {
this.permissions = permissions;
}
public String getInputTime() {
return inputTime;
}
public void setInputTime(String inputTime) {
this.inputTime = inputTime;
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "ImmuneEntity{" +
"id=" + id +
", unid='" + unid + '\'' +
", registrationNo='" + registrationNo + '\'' +
return "ImmuneBatchEntity{" +
"unid='" + unid + '\'' +
", circleNo='" + circleNo + '\'' +
", immuneExp='" + immuneExp + '\'' +
", immuneDate='" + immuneDate + '\'' +
", immunePerson='" + immunePerson + '\'' +
", perinatalPeriod='" + perinatalPeriod + '\'' +
", vaccineName='" + vaccineName + '\'' +
", lotnumber='" + lotnumber + '\'' +
", manufacturer='" + manufacturer + '\'' +
", productName='" + productName + '\'' +
", specifications='" + specifications + '\'' +
", remainingNumber='" + remainingNumber + '\'' +
", immuneMethod='" + immuneMethod + '\'' +
", immuneDosage='" + immuneDosage + '\'' +
", immuneDate='" + immuneDate + '\'' +
", immunePerson='" + immunePerson + '\'' +
", note='" + note + '\'' +
", updateId='" + updateId + '\'' +
", immuneMethod='" + immuneMethod + '\'' +
", uploadStatus='" + uploadStatus + '\'' +
", deptId='" + deptId + '\'' +
", searchValue='" + searchValue + '\'' +
", createBy='" + createBy + '\'' +
", createTime='" + createTime + '\'' +
", updateBy='" + updateBy + '\'' +
", updateTime='" + updateTime + '\'' +
", permissions='" + permissions + '\'' +
", inputTime='" + inputTime + '\'' +
", remark='" + remark + '\'' +
'}';
}
}
......@@ -5,210 +5,169 @@ import android.os.Parcelable;
import androidx.databinding.BaseObservable;
import org.greenrobot.greendao.annotation.Entity;
import java.util.Date;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
/**
* 病例档案表
* 作者 : lei
* 时间 : 2018/12/3 11 : 57
* 诊疗记录对象 zxgl_medicalrecords
*
* @author phlx
* @date 2022-01-10
*/
@Entity
public class MedicalEntity extends BaseObservable implements Parcelable {
//主键
@Id
private Long id;
public class MedicalRecordEntity extends BaseObservable implements Parcelable {
/**
* 自增列
*/
@Id(autoincrement = false)
private String unid;
/**
* 登记号
* 基本信息ID
*/
private String registrationNo;
private String cattleresumeId;
/**
* 诊疗日期
*/
private String treatDate;
/**
* 治疗人员
*/
private String treatPersonnel;
/**
* 病因
*/
private String causeOf;
/**
* 批次
*/
private String batchNo;
/**
* 用药名称
*/
private String drugName;
/**
* 商品名
*/
private String productName;
/**
* 规格
*/
private String specifications;
/**
* 库存
*/
private String remainingNumber;
/**
* 用药数量
*/
private String number;
/**
* 用药方法
*/
private String drugMethods;
/**
* 蹄病处理
*/
private String hoofDisease;
/**
* 驱虫
* 用药数量
*/
private String insecticide;
private String drugNumber;
/**
* 结果
* 诊疗结果
*/
private String results;
/** 是否上传 0未上传,1已上传 */
private String uploadStatus;
/**
* 更新状态
*/
private String updateId;
/**
* 创建者
* 部门id
*/
private String deptId;
/** 搜索值 */
private String searchValue;
/** 创建者 */
private String createBy;
/**
* 创建时间
*/
/** 创建时间 */
private String createTime;
/**
* 更新者
*/
/** 更新者 */
private String updateBy;
/**
* 更新时间
*/
/** 更新时间 */
private String updateTime;
/**
* 权限标识
*/
private String permissions;
/**
* 从服务器接收,时间戳,终端需要上传给服务器,
*/
private String inputTime;
/** 备注 */
private String remark;
public MedicalEntity() {
public MedicalRecordEntity() {
}
protected MedicalEntity(Parcel in) {
if (in.readByte() == 0) {
id = null;
} else {
id = in.readLong();
}
protected MedicalRecordEntity(Parcel in) {
unid = in.readString();
registrationNo = in.readString();
cattleresumeId = in.readString();
treatDate = in.readString();
treatPersonnel = in.readString();
causeOf = in.readString();
batchNo = in.readString();
drugName = in.readString();
productName = in.readString();
specifications = in.readString();
remainingNumber = in.readString();
number = in.readString();
drugMethods = in.readString();
hoofDisease = in.readString();
insecticide = in.readString();
drugNumber = in.readString();
results = in.readString();
updateId = in.readString();
uploadStatus = in.readString();
deptId = in.readString();
searchValue = in.readString();
createBy = in.readString();
createTime = in.readString();
updateBy = in.readString();
updateTime = in.readString();
permissions = in.readString();
inputTime = in.readString();
}
@Generated(hash = 479849452)
public MedicalEntity(Long id, String unid, String registrationNo, String treatDate,
String treatPersonnel, String causeOf, String batchNo, String drugName,
String productName, String specifications, String remainingNumber, String number,
String drugMethods, String hoofDisease, String insecticide, String results,
String updateId, String createBy, String createTime, String updateBy,
String updateTime, String permissions, String inputTime) {
this.id = id;
remark = in.readString();
}
@Generated(hash = 1678677230)
public MedicalRecordEntity(String unid, String cattleresumeId, String treatDate,
String treatPersonnel, String causeOf, String drugName, String specifications,
String drugMethods, String drugNumber, String results, String uploadStatus, String deptId,
String searchValue, String createBy, String createTime, String updateBy, String updateTime,
String remark) {
this.unid = unid;
this.registrationNo = registrationNo;
this.cattleresumeId = cattleresumeId;
this.treatDate = treatDate;
this.treatPersonnel = treatPersonnel;
this.causeOf = causeOf;
this.batchNo = batchNo;
this.drugName = drugName;
this.productName = productName;
this.specifications = specifications;
this.remainingNumber = remainingNumber;
this.number = number;
this.drugMethods = drugMethods;
this.hoofDisease = hoofDisease;
this.insecticide = insecticide;
this.drugNumber = drugNumber;
this.results = results;
this.updateId = updateId;
this.uploadStatus = uploadStatus;
this.deptId = deptId;
this.searchValue = searchValue;
this.createBy = createBy;
this.createTime = createTime;
this.updateBy = updateBy;
this.updateTime = updateTime;
this.permissions = permissions;
this.inputTime = inputTime;
this.remark = remark;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
if (id == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(id);
}
dest.writeString(unid);
dest.writeString(registrationNo);
dest.writeString(cattleresumeId);
dest.writeString(treatDate);
dest.writeString(treatPersonnel);
dest.writeString(causeOf);
dest.writeString(batchNo);
dest.writeString(drugName);
dest.writeString(productName);
dest.writeString(specifications);
dest.writeString(remainingNumber);
dest.writeString(number);
dest.writeString(drugMethods);
dest.writeString(hoofDisease);
dest.writeString(insecticide);
dest.writeString(drugNumber);
dest.writeString(results);
dest.writeString(updateId);
dest.writeString(uploadStatus);
dest.writeString(deptId);
dest.writeString(searchValue);
dest.writeString(createBy);
dest.writeString(createTime);
dest.writeString(updateBy);
dest.writeString(updateTime);
dest.writeString(permissions);
dest.writeString(inputTime);
dest.writeString(remark);
}
@Override
......@@ -216,26 +175,18 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
return 0;
}
public static final Creator<MedicalEntity> CREATOR = new Creator<MedicalEntity>() {
public static final Creator<MedicalRecordEntity> CREATOR = new Creator<MedicalRecordEntity>() {
@Override
public MedicalEntity createFromParcel(Parcel in) {
return new MedicalEntity(in);
public MedicalRecordEntity createFromParcel(Parcel in) {
return new MedicalRecordEntity(in);
}
@Override
public MedicalEntity[] newArray(int size) {
return new MedicalEntity[size];
public MedicalRecordEntity[] newArray(int size) {
return new MedicalRecordEntity[size];
}
};
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUnid() {
return unid;
}
......@@ -244,12 +195,12 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
this.unid = unid;
}
public String getRegistrationNo() {
return registrationNo;
public String getCattleresumeId() {
return cattleresumeId;
}
public void setRegistrationNo(String registrationNo) {
this.registrationNo = registrationNo;
public void setCattleresumeId(String cattleresumeId) {
this.cattleresumeId = cattleresumeId;
}
public String getTreatDate() {
......@@ -276,14 +227,6 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
this.causeOf = causeOf;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getDrugName() {
return drugName;
}
......@@ -292,14 +235,6 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
this.drugName = drugName;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getSpecifications() {
return specifications;
}
......@@ -308,22 +243,6 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
this.specifications = specifications;
}
public String getRemainingNumber() {
return remainingNumber;
}
public void setRemainingNumber(String remainingNumber) {
this.remainingNumber = remainingNumber;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getDrugMethods() {
return drugMethods;
}
......@@ -332,20 +251,12 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
this.drugMethods = drugMethods;
}
public String getHoofDisease() {
return hoofDisease;
}
public void setHoofDisease(String hoofDisease) {
this.hoofDisease = hoofDisease;
}
public String getInsecticide() {
return insecticide;
public String getDrugNumber() {
return drugNumber;
}
public void setInsecticide(String insecticide) {
this.insecticide = insecticide;
public void setDrugNumber(String drugNumber) {
this.drugNumber = drugNumber;
}
public String getResults() {
......@@ -356,12 +267,28 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
this.results = results;
}
public String getUpdateId() {
return updateId;
public String getUploadStatus() {
return uploadStatus;
}
public void setUploadStatus(String uploadStatus) {
this.uploadStatus = uploadStatus;
}
public void setUpdateId(String updateId) {
this.updateId = updateId;
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() {
......@@ -396,48 +323,35 @@ public class MedicalEntity extends BaseObservable implements Parcelable {
this.updateTime = updateTime;
}
public String getPermissions() {
return permissions;
}
public void setPermissions(String permissions) {
this.permissions = permissions;
}
public String getInputTime() {
return inputTime;
public String getRemark() {
return remark;
}
public void setInputTime(String inputTime) {
this.inputTime = inputTime;
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "MedicalEntity{" +
"id=" + id +
", unid='" + unid + '\'' +
", registrationNo='" + registrationNo + '\'' +
return "MedicalRecordEntity{" +
"unid='" + unid + '\'' +
", cattleresumeId='" + cattleresumeId + '\'' +
", treatDate='" + treatDate + '\'' +
", treatPersonnel='" + treatPersonnel + '\'' +
", causeOf='" + causeOf + '\'' +
", batchNo='" + batchNo + '\'' +
", drugName='" + drugName + '\'' +
", productName='" + productName + '\'' +
", specifications='" + specifications + '\'' +
", remainingNumber='" + remainingNumber + '\'' +
", number='" + number + '\'' +
", drugMethods='" + drugMethods + '\'' +
", hoofDisease='" + hoofDisease + '\'' +
", insecticide='" + insecticide + '\'' +
", drugNumber='" + drugNumber + '\'' +
", results='" + results + '\'' +
", updateId='" + updateId + '\'' +
", uploadStatus='" + uploadStatus + '\'' +
", deptId='" + deptId + '\'' +
", searchValue='" + searchValue + '\'' +
", createBy='" + createBy + '\'' +
", createTime='" + createTime + '\'' +
", updateBy='" + updateBy + '\'' +
", updateTime='" + updateTime + '\'' +
", permissions='" + permissions + '\'' +
", inputTime='" + inputTime + '\'' +
", 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.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);
}
}
......@@ -13,17 +13,12 @@ import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil;
import com.phlx.anchorcollect.db.gen.CardEntityDao;
import com.phlx.anchorcollect.db.gen.ImmuneEntityDao;
import com.phlx.anchorcollect.db.gen.MedicalEntityDao;
import com.phlx.anchorcollect.db.gen.WeightingEntityDao;
import com.phlx.anchorcollect.db.interf.DbIDUCallBack;
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.UIParamEntity;
import com.phlx.anchorcollect.entity.WeightingEntity;
import com.phlx.anchorcollect.entity.WeightManEntity;
import com.phlx.anchorcollect.util.TextUtil;
import org.greenrobot.greendao.query.QueryBuilder;
......@@ -219,37 +214,37 @@ public class CollectVM extends BaseViewModel<Repository> {
* 称重管理-查询数据库
*/
private void queryWeight(String tag) {
QueryBuilder<WeightingEntity> builder =
DbUtil.getInstance().getQueryBuilder(WeightingEntity.class).where(WeightingEntityDao.Properties.RegistrationNo.eq(tag));
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<WeightingEntity>() {
@Override
public void onSuccess(List<WeightingEntity> result) {
if (result != null && result.size() > 0) {
uiList.get(0).setValue(result.get(0).getWeightName());
uiList.get(0).setName(result.get(0).getWeightName());
uiList.get(1).setValue(result.get(0).getWeightingDate());
uiList.get(1).setName(result.get(0).getWeightingDate());
uiList.get(2).setValue(result.get(0).getPrincipalName());
uiList.get(2).setName(result.get(0).getPrincipalName());
uiList.get(3).setValue(result.get(0).getWeightCount());
uiList.get(3).setName(result.get(0).getWeightCount());
uiList.get(4).setValue(result.get(0).getCircleNo());
uiList.get(4).setName(result.get(0).getCircleNo());
onNotifyAllEvent.setValue(false);
} else {
onNotifyAllEvent.setValue(true);
}
Configs.tempTag = "";
}
@Override
public void onFailed() {
Configs.tempTag = "";
ToastUtils.showShort("称重管理数据库查询失败");
}
}).queryAsyncAll(WeightingEntity.class, builder);
// QueryBuilder<WeightManEntity> builder =
// DbUtil.getInstance().getQueryBuilder(WeightManEntity.class).where(WeightingEntityDao.Properties.RegistrationNo.eq(tag));
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<WeightManEntity>() {
// @Override
// public void onSuccess(List<WeightManEntity> result) {
//
// if (result != null && result.size() > 0) {
// uiList.get(0).setValue(result.get(0).getWeightName());
// uiList.get(0).setName(result.get(0).getWeightName());
// uiList.get(1).setValue(result.get(0).getWeightingDate());
// uiList.get(1).setName(result.get(0).getWeightingDate());
// uiList.get(2).setValue(result.get(0).getPrincipalName());
// uiList.get(2).setName(result.get(0).getPrincipalName());
// uiList.get(3).setValue(result.get(0).getWeightCount());
// uiList.get(3).setName(result.get(0).getWeightCount());
// uiList.get(4).setValue(result.get(0).getCircleNo());
// uiList.get(4).setName(result.get(0).getCircleNo());
// onNotifyAllEvent.setValue(false);
// } else {
// onNotifyAllEvent.setValue(true);
// }
//
// Configs.tempTag = "";
// }
//
// @Override
// public void onFailed() {
// Configs.tempTag = "";
// ToastUtils.showShort("称重管理数据库查询失败");
// }
// }).queryAsyncAll(WeightManEntity.class, builder);
}
/**
......@@ -309,90 +304,90 @@ public class CollectVM extends BaseViewModel<Repository> {
* 健康管理-查询数据库
*/
private void queryHealth(String tag) {
QueryBuilder<MedicalEntity> builder =
DbUtil.getInstance().getQueryBuilder(MedicalEntity.class).where(MedicalEntityDao.Properties.RegistrationNo.eq(tag));
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalEntity>() {
@Override
public void onSuccess(List<MedicalEntity> result) {
if (result != null && result.size() > 0) {
uiList.get(0).setValue(result.get(0).getTreatDate());
uiList.get(0).setName(result.get(0).getTreatDate());
uiList.get(1).setValue(result.get(0).getTreatPersonnel());
uiList.get(1).setName(result.get(0).getTreatPersonnel());
uiList.get(2).setValue(result.get(0).getCauseOf());
uiList.get(2).setName(result.get(0).getCauseOf());
uiList.get(3).setValue(result.get(0).getDrugName());
uiList.get(3).setName(result.get(0).getDrugName());
uiList.get(4).setValue(result.get(0).getSpecifications());
uiList.get(4).setName(result.get(0).getSpecifications());
uiList.get(5).setValue(result.get(0).getDrugMethods());
uiList.get(5).setName(result.get(0).getDrugMethods());
uiList.get(6).setValue(result.get(0).getNumber());
uiList.get(6).setName(result.get(0).getNumber());
uiList.get(7).setValue(result.get(0).getHoofDisease());
uiList.get(7).setName(result.get(0).getHoofDisease());
uiList.get(8).setValue(result.get(0).getInsecticide());
uiList.get(8).setName(result.get(0).getInsecticide());
onNotifyAllEvent.setValue(false);
} else {
onNotifyAllEvent.setValue(true);
}
Configs.tempTag = "";
}
@Override
public void onFailed() {
Configs.tempTag = "";
ToastUtils.showShort("健康管理数据库查询失败");
}
}).queryAsyncAll(MedicalEntity.class, builder);
// QueryBuilder<MedicalEntity> builder =
// DbUtil.getInstance().getQueryBuilder(MedicalEntity.class).where(MedicalEntityDao.Properties.RegistrationNo.eq(tag));
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalEntity>() {
// @Override
// public void onSuccess(List<MedicalEntity> result) {
//
// if (result != null && result.size() > 0) {
// uiList.get(0).setValue(result.get(0).getTreatDate());
// uiList.get(0).setName(result.get(0).getTreatDate());
// uiList.get(1).setValue(result.get(0).getTreatPersonnel());
// uiList.get(1).setName(result.get(0).getTreatPersonnel());
// uiList.get(2).setValue(result.get(0).getCauseOf());
// uiList.get(2).setName(result.get(0).getCauseOf());
// uiList.get(3).setValue(result.get(0).getDrugName());
// uiList.get(3).setName(result.get(0).getDrugName());
// uiList.get(4).setValue(result.get(0).getSpecifications());
// uiList.get(4).setName(result.get(0).getSpecifications());
// uiList.get(5).setValue(result.get(0).getDrugMethods());
// uiList.get(5).setName(result.get(0).getDrugMethods());
// uiList.get(6).setValue(result.get(0).getNumber());
// uiList.get(6).setName(result.get(0).getNumber());
// uiList.get(7).setValue(result.get(0).getHoofDisease());
// uiList.get(7).setName(result.get(0).getHoofDisease());
// uiList.get(8).setValue(result.get(0).getInsecticide());
// uiList.get(8).setName(result.get(0).getInsecticide());
// onNotifyAllEvent.setValue(false);
// } else {
// onNotifyAllEvent.setValue(true);
// }
//
// Configs.tempTag = "";
// }
//
// @Override
// public void onFailed() {
// Configs.tempTag = "";
// ToastUtils.showShort("健康管理数据库查询失败");
// }
// }).queryAsyncAll(MedicalEntity.class, builder);
}
/**
* 免疫管理-查询数据库
*/
private void queryImmun(String tag) {
QueryBuilder<ImmuneEntity> builder =
DbUtil.getInstance().getQueryBuilder(ImmuneEntity.class).where(ImmuneEntityDao.Properties.RegistrationNo.eq(tag));
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneEntity>() {
@Override
public void onSuccess(List<ImmuneEntity> result) {
if (result != null && result.size() > 0) {
uiList.get(0).setValue(result.get(0).getImmuneDate());
uiList.get(0).setName(result.get(0).getImmuneDate());
uiList.get(1).setValue(result.get(0).getVaccineName());
uiList.get(1).setName(result.get(0).getVaccineName());
uiList.get(2).setValue(result.get(0).getImmunePerson());
uiList.get(2).setName(result.get(0).getImmunePerson());
uiList.get(3).setValue(result.get(0).getCircleNo());
uiList.get(3).setName(result.get(0).getCircleNo());
uiList.get(4).setValue(result.get(0).getProductName());
uiList.get(4).setName(result.get(0).getProductName());
uiList.get(5).setValue(result.get(0).getLotnumber());
uiList.get(5).setName(result.get(0).getLotnumber());
uiList.get(6).setValue(result.get(0).getSpecifications());
uiList.get(6).setName(result.get(0).getSpecifications());
uiList.get(7).setValue(result.get(0).getImmuneDosage());
uiList.get(7).setName(result.get(0).getImmuneDosage());
uiList.get(8).setValue(result.get(0).getImmuneMethod());
uiList.get(8).setName(result.get(0).getImmuneMethod());
onNotifyAllEvent.setValue(false);
} else {
onNotifyAllEvent.setValue(true);
}
Configs.tempTag = "";
}
@Override
public void onFailed() {
Configs.tempTag = "";
ToastUtils.showShort("免疫管理数据库查询失败");
}
}).queryAsyncAll(ImmuneEntity.class, builder);
// QueryBuilder<ImmuneEntity> builder =
// DbUtil.getInstance().getQueryBuilder(ImmuneEntity.class).where(ImmuneEntityDao.Properties.RegistrationNo.eq(tag));
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneEntity>() {
// @Override
// public void onSuccess(List<ImmuneEntity> result) {
//
// if (result != null && result.size() > 0) {
// uiList.get(0).setValue(result.get(0).getImmuneDate());
// uiList.get(0).setName(result.get(0).getImmuneDate());
// uiList.get(1).setValue(result.get(0).getVaccineName());
// uiList.get(1).setName(result.get(0).getVaccineName());
// uiList.get(2).setValue(result.get(0).getImmunePerson());
// uiList.get(2).setName(result.get(0).getImmunePerson());
// uiList.get(3).setValue(result.get(0).getCircleNo());
// uiList.get(3).setName(result.get(0).getCircleNo());
// uiList.get(4).setValue(result.get(0).getProductName());
// uiList.get(4).setName(result.get(0).getProductName());
// uiList.get(5).setValue(result.get(0).getLotnumber());
// uiList.get(5).setName(result.get(0).getLotnumber());
// uiList.get(6).setValue(result.get(0).getSpecifications());
// uiList.get(6).setName(result.get(0).getSpecifications());
// uiList.get(7).setValue(result.get(0).getImmuneDosage());
// uiList.get(7).setName(result.get(0).getImmuneDosage());
// uiList.get(8).setValue(result.get(0).getImmuneMethod());
// uiList.get(8).setName(result.get(0).getImmuneMethod());
// onNotifyAllEvent.setValue(false);
// } else {
// onNotifyAllEvent.setValue(true);
// }
//
// Configs.tempTag = "";
// }
//
// @Override
// public void onFailed() {
// Configs.tempTag = "";
// ToastUtils.showShort("免疫管理数据库查询失败");
// }
// }).queryAsyncAll(ImmuneEntity.class, builder);
}
/* ===========================查询数据库 页面赋值结束================================= */
......@@ -459,17 +454,17 @@ public class CollectVM extends BaseViewModel<Repository> {
*/
private void saveWeight() {
List<WeightingEntity> uploadData = new ArrayList<>();
List<WeightManEntity> uploadData = new ArrayList<>();
WeightingEntity _entity = new WeightingEntity();
_entity.setUnid(tag.get());
_entity.setRegistrationNo(tag.get());
_entity.setWeight("125.5");
_entity.setWeightName(uiList.get(0).getValue());
_entity.setWeightingDate(uiList.get(1).getValue());
_entity.setPrincipalName(uiList.get(2).getValue());
_entity.setWeightCount(uiList.get(3).getValue());
_entity.setCircleNo(uiList.get(4).getValue());
WeightManEntity _entity = new WeightManEntity();
// _entity.setUnid(tag.get());
// _entity.setRegistrationNo(tag.get());
// _entity.setWeight("125.5");
// _entity.setWeightName(uiList.get(0).getValue());
// _entity.setWeightingDate(uiList.get(1).getValue());
// _entity.setPrincipalName(uiList.get(2).getValue());
// _entity.setWeightCount(uiList.get(3).getValue());
// _entity.setCircleNo(uiList.get(4).getValue());
uploadData.add(_entity);
......@@ -486,7 +481,7 @@ public class CollectVM extends BaseViewModel<Repository> {
ToastUtils.showShort("称重管理保存失败");
}
}
}).insertAsyncBatch(WeightingEntity.class, uploadData);
}).insertAsyncBatch(WeightManEntity.class, uploadData);
}
......@@ -539,38 +534,38 @@ public class CollectVM extends BaseViewModel<Repository> {
*/
private void saveHealth() {
List<MedicalEntity> uploadData = new ArrayList<>();
MedicalEntity _entity = new MedicalEntity();
_entity.setUnid(tag.get());
_entity.setRegistrationNo(tag.get());
// _entity.setBirthHeavy(weight.get());
_entity.setTreatDate(uiList.get(0).getValue());
_entity.setTreatPersonnel(uiList.get(1).getValue());
_entity.setCauseOf(uiList.get(2).getValue());
_entity.setDrugName(uiList.get(3).getValue());
_entity.setSpecifications(uiList.get(4).getValue());
_entity.setDrugMethods(uiList.get(5).getValue());
_entity.setNumber(uiList.get(6).getValue());
_entity.setHoofDisease(uiList.get(7).getValue());
_entity.setInsecticide(uiList.get(8).getValue());
uploadData.add(_entity);
showDialog("正在保存本地...");
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
dismissDialog();
if (result) {
ToastUtils.showShort("健康管理保存成功");
tag.set("");
onNotifyAllEvent.setValue(true);
} else {
ToastUtils.showShort("健康管理保存失败");
}
}
}).insertAsyncBatch(MedicalEntity.class, uploadData);
// List<MedicalEntity> uploadData = new ArrayList<>();
//
// MedicalEntity _entity = new MedicalEntity();
// _entity.setUnid(tag.get());
// _entity.setRegistrationNo(tag.get());
//// _entity.setBirthHeavy(weight.get());
// _entity.setTreatDate(uiList.get(0).getValue());
// _entity.setTreatPersonnel(uiList.get(1).getValue());
// _entity.setCauseOf(uiList.get(2).getValue());
// _entity.setDrugName(uiList.get(3).getValue());
// _entity.setSpecifications(uiList.get(4).getValue());
// _entity.setDrugMethods(uiList.get(5).getValue());
// _entity.setNumber(uiList.get(6).getValue());
// _entity.setHoofDisease(uiList.get(7).getValue());
// _entity.setInsecticide(uiList.get(8).getValue());
//
// uploadData.add(_entity);
//
// showDialog("正在保存本地...");
// DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
// @Override
// public void onNotification(boolean result) {
// dismissDialog();
// if (result) {
// ToastUtils.showShort("健康管理保存成功");
// tag.set("");
// onNotifyAllEvent.setValue(true);
// } else {
// ToastUtils.showShort("健康管理保存失败");
// }
// }
// }).insertAsyncBatch(MedicalEntity.class, uploadData);
}
......@@ -579,38 +574,38 @@ public class CollectVM extends BaseViewModel<Repository> {
*/
private void saveImmun() {
List<ImmuneEntity> uploadData = new ArrayList<>();
ImmuneEntity _entity = new ImmuneEntity();
_entity.setUnid(tag.get());
_entity.setRegistrationNo(tag.get());
// _cardEntity.setBirthHeavy(weight.get());
_entity.setImmuneDate(uiList.get(0).getValue());
_entity.setVaccineName(uiList.get(1).getValue());
_entity.setImmunePerson(uiList.get(2).getValue());
_entity.setCircleNo(uiList.get(3).getValue());
_entity.setProductName(uiList.get(4).getValue());
_entity.setLotnumber(uiList.get(5).getValue());
_entity.setSpecifications(uiList.get(6).getValue());
_entity.setImmuneDosage(uiList.get(7).getValue());
_entity.setImmuneMethod(uiList.get(8).getValue());
uploadData.add(_entity);
showDialog("正在保存本地...");
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
dismissDialog();
if (result) {
ToastUtils.showShort("免疫管理保存成功");
tag.set("");
onNotifyAllEvent.setValue(true);
} else {
ToastUtils.showShort("免疫管理保存失败");
}
}
}).insertAsyncBatch(ImmuneEntity.class, uploadData);
// List<ImmuneEntity> uploadData = new ArrayList<>();
//
// ImmuneEntity _entity = new ImmuneEntity();
// _entity.setUnid(tag.get());
// _entity.setRegistrationNo(tag.get());
//// _cardEntity.setBirthHeavy(weight.get());
// _entity.setImmuneDate(uiList.get(0).getValue());
// _entity.setVaccineName(uiList.get(1).getValue());
// _entity.setImmunePerson(uiList.get(2).getValue());
// _entity.setCircleNo(uiList.get(3).getValue());
// _entity.setProductName(uiList.get(4).getValue());
// _entity.setLotnumber(uiList.get(5).getValue());
// _entity.setSpecifications(uiList.get(6).getValue());
// _entity.setImmuneDosage(uiList.get(7).getValue());
// _entity.setImmuneMethod(uiList.get(8).getValue());
//
// uploadData.add(_entity);
//
// showDialog("正在保存本地...");
// DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
// @Override
// public void onNotification(boolean result) {
// dismissDialog();
// if (result) {
// ToastUtils.showShort("免疫管理保存成功");
// tag.set("");
// onNotifyAllEvent.setValue(true);
// } else {
// ToastUtils.showShort("免疫管理保存失败");
// }
// }
// }).insertAsyncBatch(ImmuneEntity.class, uploadData);
}
......
......@@ -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);
}
......
......@@ -29,13 +29,19 @@ import com.phlx.anchorcollect.data.Repository;
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.ImmuneBatchEntityDao;
import com.phlx.anchorcollect.db.gen.MedicalRecordEntityDao;
import com.phlx.anchorcollect.db.gen.PerformanceEntityDao;
import com.phlx.anchorcollect.db.gen.WeightManEntityDao;
import com.phlx.anchorcollect.db.interf.DbIDUCallBack;
import com.phlx.anchorcollect.db.interf.DbQueryCallBack;
import com.phlx.anchorcollect.entity.BreedingRecordDetailEntity;
import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
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 com.phlx.anchorcollect.rfid.InventoryManger;
......@@ -236,21 +242,21 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
public BindingCommand OnWeightingManageSyncClickCommand = new BindingCommand(new BindingAction() {
@Override
public void call() {
queryWeightMan();
}
});
public BindingCommand OnTreatmentRecordSyncClickCommand = new BindingCommand(new BindingAction() {
@Override
public void call() {
queryMedicalRecord();
}
});
public BindingCommand OnImmunRecordSyncClickCommand = new BindingCommand(new BindingAction() {
@Override
public void call() {
queryImmuneBatch();
}
});
......@@ -1001,4 +1007,496 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
}
/**===========================================称重管理================================================= */
/**
* 下载-称重管理-
*/
private void requestWeightMan() {
//SyncState 0根据记录更新,1重新更新
Map<String, String> requestParam = new HashMap<>();
List<WeightManEntity> queryList = DbUtil.getInstance().queryAll(WeightManEntity.class);
if (queryList == null || queryList.size() == 0)
requestParam.put("SyncState", "1");
else
requestParam.put("SyncState", "0");
addSubscribe(model.downloadWeightManList(requestParam)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步称重管理数据..."))
.subscribe((Consumer<ListResponse<WeightManEntity>>) response -> {
if (response.getCode() == 0) {
if (response.getData() != null && response.getData().size() > 0) {
KLog.e("--requestWeightManDetail--" + response.getData().size());
List<String> ids = new ArrayList<>();
for (WeightManEntity cre : response.getData()) {
cre.setUploadStatus("1");
ids.add(cre.getUnid());
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
requestWeightManSync(ids);
} else {
dismissDialog();
errorEvent.setValue("保存称重管理数据失败!");
}
}
}).insertAsyncBatch(WeightManEntity.class, response.getData());
} else {
dismissDialog();
}
} else {
errorEvent.setValue("服务器 :" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
KLog.e(throwable.message);
})
);
}
/**
* 上传-称重管理-成功
*/
private void requestWeightManSync(List<String> ids) {
// Map<String, String> syncParam = new HashMap<>();
// syncParam.put("ids", new Gson().toJson(ids).toString());
RequestBody body = RequestBody.create(MediaType.parse("application/json"), new Gson().toJson(ids));
// KLog.e("label", postParams.toString());
addSubscribe(model.downloadWeightManListSync(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步称重管理数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
dismissDialog();
KLog.e("requestWeightManSync", response.toString());
if (response.getCode() == 0) {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("同步称重管理数据成功!");
queryWeightMan();
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
/**
* 查询-称重管理-
*/
private void queryWeightMan() {
QueryBuilder<WeightManEntity> builder =
DbUtil.getInstance().getQueryBuilder(WeightManEntity.class)
.where(WeightManEntityDao.Properties.UploadStatus.eq("0"))
.limit(10);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<WeightManEntity>() {
@Override
public void onSuccess(List<WeightManEntity> result) {
if (result != null && result.size() > 0) {
uploadWeightMan(result);
} else {
requestWeightMan();
}
}
@Override
public void onFailed() {
ToastUtils.showShort("查询-称重管理-失败!");
dismissDialog();
}
}).queryAsyncAll(WeightManEntity.class, builder);
}
/**
* 上传-称重管理-
*/
private void uploadWeightMan(List<WeightManEntity> weightManEntities) {
RequestBody body = RequestBody.create(MediaType.parse("application/json"), new Gson().toJson(weightManEntities));
// KLog.e("label", postParams.toString());
addSubscribe(model.uploadWeightManList(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
.doOnSubscribe(disposable -> showDialog("正在同步-称重管理-数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
if (response.getCode() == 0) {
KLog.e("uploadWeightMan", response.toString());
for (WeightManEntity pe : weightManEntities) {
pe.setUploadStatus("1");
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
queryWeightMan();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("上传-称重管理-数据成功!");
} else {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("修改-称重管理-数据失败");
}
}
}).updateAsyncBatch(WeightManEntity.class, weightManEntities);
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
requestWeightMan();
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
/**===========================================诊疗记录================================================= */
/**
* 下载-诊疗记录-
*/
private void requestMedicalRecord() {
//SyncState 0根据记录更新,1重新更新
Map<String, String> requestParam = new HashMap<>();
List<MedicalRecordEntity> queryList = DbUtil.getInstance().queryAll(MedicalRecordEntity.class);
if (queryList == null || queryList.size() == 0)
requestParam.put("SyncState", "1");
else
requestParam.put("SyncState", "0");
addSubscribe(model.downloadMedicalRecordList(requestParam)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步诊疗记录数据..."))
.subscribe((Consumer<ListResponse<MedicalRecordEntity>>) response -> {
if (response.getCode() == 0) {
if (response.getData() != null && response.getData().size() > 0) {
KLog.e("--requestMedicalRecord--" + response.getData().size());
List<String> ids = new ArrayList<>();
for (MedicalRecordEntity cre : response.getData()) {
cre.setUploadStatus("1");
ids.add(cre.getUnid());
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
requestMedicalRecordSync(ids);
} else {
dismissDialog();
errorEvent.setValue("保存诊疗记录数据失败!");
}
}
}).insertAsyncBatch(MedicalRecordEntity.class, response.getData());
} else {
dismissDialog();
}
} else {
errorEvent.setValue("服务器 :" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
KLog.e(throwable.message);
})
);
}
/**
* 上传-诊疗记录-成功
*/
private void requestMedicalRecordSync(List<String> ids) {
// Map<String, String> syncParam = new HashMap<>();
// syncParam.put("ids", new Gson().toJson(ids).toString());
RequestBody body = RequestBody.create(MediaType.parse("application/json"), new Gson().toJson(ids));
// KLog.e("label", postParams.toString());
addSubscribe(model.downloadMedicalRecordListSync(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步称重管理数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
dismissDialog();
KLog.e("requestMedicalRecordSync", response.toString());
if (response.getCode() == 0) {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("同步诊疗记录数据成功!");
queryMedicalRecord();
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
/**
* 查询-诊疗记录-
*/
private void queryMedicalRecord() {
QueryBuilder<MedicalRecordEntity> builder =
DbUtil.getInstance().getQueryBuilder(MedicalRecordEntity.class)
.where(MedicalRecordEntityDao.Properties.UploadStatus.eq("0"))
.limit(10);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalRecordEntity>() {
@Override
public void onSuccess(List<MedicalRecordEntity> result) {
if (result != null && result.size() > 0) {
uploadMedicalRecord(result);
} else {
requestMedicalRecord();
}
}
@Override
public void onFailed() {
ToastUtils.showShort("查询-诊疗记录-失败!");
dismissDialog();
}
}).queryAsyncAll(MedicalRecordEntity.class, builder);
}
/**
* 上传-诊疗记录-
*/
private void uploadMedicalRecord(List<MedicalRecordEntity> medicalRecordEntities) {
RequestBody body = RequestBody.create(MediaType.parse("application/json"), new Gson().toJson(medicalRecordEntities));
// KLog.e("label", postParams.toString());
addSubscribe(model.uploadMedicalRecordList(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
.doOnSubscribe(disposable -> showDialog("正在同步-诊疗记录-数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
if (response.getCode() == 0) {
KLog.e("uploadMedicalRecord", response.toString());
for (MedicalRecordEntity pe : medicalRecordEntities) {
pe.setUploadStatus("1");
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
queryMedicalRecord();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("上传-诊疗记录-数据成功!");
} else {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("修改-诊疗记录-数据失败");
}
}
}).updateAsyncBatch(MedicalRecordEntity.class, medicalRecordEntities);
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
requestMedicalRecord();
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
/**===========================================免疫记录================================================= */
/**
* 下载-免疫记录-
*/
private void requestImmuneBatch() {
//SyncState 0根据记录更新,1重新更新
Map<String, String> requestParam = new HashMap<>();
List<ImmuneBatchEntity> queryList = DbUtil.getInstance().queryAll(ImmuneBatchEntity.class);
if (queryList == null || queryList.size() == 0)
requestParam.put("SyncState", "1");
else
requestParam.put("SyncState", "0");
addSubscribe(model.downloadImmuneBatchList(requestParam)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步免疫记录数据..."))
.subscribe((Consumer<ListResponse<ImmuneBatchEntity>>) response -> {
if (response.getCode() == 0) {
if (response.getData() != null && response.getData().size() > 0) {
KLog.e("--requestImmuneBatch--" + response.getData().size());
List<String> ids = new ArrayList<>();
for (ImmuneBatchEntity cre : response.getData()) {
cre.setUploadStatus("1");
ids.add(cre.getUnid());
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
requestImmuneBatchSync(ids);
} else {
dismissDialog();
errorEvent.setValue("保存免疫记录数据失败!");
}
}
}).insertAsyncBatch(ImmuneBatchEntity.class, response.getData());
} else {
dismissDialog();
}
} else {
errorEvent.setValue("服务器 :" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
KLog.e(throwable.message);
})
);
}
/**
* 上传-免疫记录-成功
*/
private void requestImmuneBatchSync(List<String> ids) {
// Map<String, String> syncParam = new HashMap<>();
// syncParam.put("ids", new Gson().toJson(ids).toString());
RequestBody body = RequestBody.create(MediaType.parse("application/json"), new Gson().toJson(ids));
// KLog.e("label", postParams.toString());
addSubscribe(model.downloadImmuneBatchListSync(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步称重管理数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
dismissDialog();
KLog.e("requestImmuneBatchSync", response.toString());
if (response.getCode() == 0) {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("同步免疫记录数据成功!");
queryImmuneBatch();
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
/**
* 查询-免疫记录-
*/
private void queryImmuneBatch() {
QueryBuilder<ImmuneBatchEntity> builder =
DbUtil.getInstance().getQueryBuilder(ImmuneBatchEntity.class)
.where(ImmuneBatchEntityDao.Properties.UploadStatus.eq("0"))
.limit(10);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneBatchEntity>() {
@Override
public void onSuccess(List<ImmuneBatchEntity> result) {
if (result != null && result.size() > 0) {
uploadImmuneBatch(result);
} else {
requestImmuneBatch();
}
}
@Override
public void onFailed() {
ToastUtils.showShort("查询-免疫记录-失败!");
dismissDialog();
}
}).queryAsyncAll(ImmuneBatchEntity.class, builder);
}
/**
* 上传-诊疗记录-
*/
private void uploadImmuneBatch(List<ImmuneBatchEntity> immuneBatchEntities) {
RequestBody body = RequestBody.create(MediaType.parse("application/json"), new Gson().toJson(immuneBatchEntities));
// KLog.e("label", postParams.toString());
addSubscribe(model.uploadImmuneBatchList(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
.doOnSubscribe(disposable -> showDialog("正在同步-免疫记录-数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
if (response.getCode() == 0) {
KLog.e("uploadImmuneBatch", response.toString());
for (ImmuneBatchEntity pe : immuneBatchEntities) {
pe.setUploadStatus("1");
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
queryImmuneBatch();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("上传-免疫记录-数据成功!");
} else {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("修改-免疫记录-数据失败");
}
}
}).updateAsyncBatch(ImmuneBatchEntity.class, immuneBatchEntities);
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
requestImmuneBatch();
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
}
......@@ -331,204 +331,217 @@
binding:onClickCommand="@{viewModel.onSettingClick}" />
<!--右侧表格区-->
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.core.widget.NestedScrollView
android:id="@+id/nsv_right_content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="5dp"
binding:layout_constraintBottom_toBottomOf="parent"
binding:layout_constraintBottom_toTopOf="@+id/ll_save"
binding:layout_constraintLeft_toLeftOf="@+id/guideline_vertical"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/iv_setting">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_100"
android:layout_width="0dp"
android:layout_height="97dp"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
binding:layout_constraintHorizontal_chainStyle="spread_inside"
binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toLeftOf="@+id/card_0"
binding:layout_constraintTop_toTopOf="parent">
<!-- app:layout_constraintDimensionRatio="1:1"-->
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_cattle_photo"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_100"
android:layout_width="0dp"
android:layout_height="97dp"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
binding:layout_constraintHorizontal_chainStyle="spread_inside"
binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toLeftOf="@+id/card_0"
binding:layout_constraintTop_toTopOf="parent">
<!-- app:layout_constraintDimensionRatio="1:1"-->
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_cattle_photo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@{viewModel.drawableImg}" />
<!-- android:onClick="@{() ->viewModel.click(100)}"-->
<!-- binding:url="@{viewModel.uiList.get(17).value}"-->
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_0"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(0)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toTopOf="@+id/card_2"
binding:layout_constraintLeft_toRightOf="@+id/card_100"
binding:layout_constraintRight_toLeftOf="@+id/card_1"
binding:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(0).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(0).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_1"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(1)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toTopOf="@+id/card_3"
binding:layout_constraintLeft_toRightOf="@+id/card_0"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(1).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(1).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_2"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(2)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toBottomOf="@+id/card_100"
binding:layout_constraintLeft_toRightOf="@+id/card_100"
binding:layout_constraintRight_toLeftOf="@+id/card_3"
binding:layout_constraintTop_toBottomOf="@+id/card_0">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(2).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(2).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_3"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(3)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toBottomOf="@+id/card_100"
binding:layout_constraintLeft_toRightOf="@+id/card_2"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/card_1">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(3).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(3).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_collect"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@{viewModel.drawableImg}" />
<!-- android:onClick="@{() ->viewModel.click(100)}"-->
<!-- binding:url="@{viewModel.uiList.get(17).value}"-->
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_0"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(0)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toTopOf="@+id/card_2"
binding:layout_constraintLeft_toRightOf="@+id/card_100"
binding:layout_constraintRight_toLeftOf="@+id/card_1"
binding:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(0).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(0).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_1"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(1)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toTopOf="@+id/card_3"
binding:layout_constraintLeft_toRightOf="@+id/card_0"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(1).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(1).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_2"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(2)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toBottomOf="@+id/card_100"
binding:layout_constraintLeft_toRightOf="@+id/card_100"
binding:layout_constraintRight_toLeftOf="@+id/card_3"
binding:layout_constraintTop_toBottomOf="@+id/card_0">
android:layout_marginTop="5dp"
binding:adapter="@{adapter}"
binding:itemBinding="@{viewModel.itemBinding}"
binding:items="@{viewModel.observableList}"
binding:layoutManager="@{LayoutManagers.grid(3)}"
binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/card_100" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(2).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(2).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_3"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(3)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintBottom_toBottomOf="@+id/card_100"
binding:layout_constraintLeft_toRightOf="@+id/card_2"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/card_1">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(3).columnComment}"
android:textColor="@color/color_font_null"
android:textSize="@dimen/sp_8" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:maxLines="1"
android:singleLine="true"
android:text="@{viewModel.uiList.get(3).showName}"
android:textColor="@color/black"
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_collect"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="5dp"
binding:adapter="@{adapter}"
binding:itemBinding="@{viewModel.itemBinding}"
binding:items="@{viewModel.observableList}"
binding:layoutManager="@{LayoutManagers.grid(3)}"
binding:layout_constraintBottom_toTopOf="@+id/card_99"
binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/card_100" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll_save"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="5dp"
binding:layout_constraintBottom_toBottomOf="parent"
binding:layout_constraintLeft_toRightOf="@+id/guideline_vertical"
binding:layout_constraintRight_toRightOf="parent"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_99"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="@drawable/bg_radius_white_5"
android:onClick="@{() ->viewModel.click(99)}"
android:orientation="vertical"
android:padding="5dp"
binding:layout_constraintLeft_toLeftOf="@+id/card_100"
binding:layout_constraintRight_toRightOf="@+id/card_0"
binding:layout_constraintBottom_toBottomOf="parent"
>
android:padding="5dp">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title_16"
......@@ -547,16 +560,13 @@
android:textSize="@dimen/sp_8" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/card_save"
android:layout_width="100dp"
android:layout_height="37dp"
android:layout_marginLeft="5dp"
android:background="@drawable/bg_radius_white_5"
binding:layout_constraintBottom_toBottomOf="parent"
binding:layout_constraintRight_toRightOf="parent"
>
android:visibility="gone"
android:background="@drawable/bg_radius_white_5">
<!-- binding:onClickCommand="@{viewModel.onCardSaveClick}"-->
<androidx.appcompat.widget.AppCompatTextView
......@@ -568,7 +578,7 @@
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
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