Commit 3baff11b authored by hywang's avatar hywang

增加列表详情页面

parent a4c6ad67
...@@ -103,6 +103,10 @@ public class Configs { ...@@ -103,6 +103,10 @@ public class Configs {
//临时存放列表查询unid //临时存放列表查询unid
public static String tempUnid = ""; public static String tempUnid = "";
//首页fragment标签
public static int mainPosition;
public static String resumeId;
// public static boolean ISCONNECTED; // public static boolean ISCONNECTED;
public static String packageName(Context context) { public static String packageName(Context context) {
......
...@@ -10,6 +10,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity; ...@@ -10,6 +10,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity; import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity; import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData; import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity; import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.LoginData; import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity; import com.phlx.anchorcollect.entity.MedicalRecordEntity;
...@@ -171,6 +172,21 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -171,6 +172,21 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
return mHttpDataSource.uploadImmuneBatchList(body); return mHttpDataSource.uploadImmuneBatchList(body);
} }
@Override
public Observable<ListResponse<ImmuneBatchDetailEntity>> downloadImmuneBatchDetailList(Map<String, String> map) {
return mHttpDataSource.downloadImmuneBatchDetailList(map);
}
@Override
public Observable<CollectResponse> downloadImmuneBatchDetailListSync(RequestBody body) {
return mHttpDataSource.downloadImmuneBatchDetailListSync(body);
}
@Override
public Observable<CollectResponse> uploadImmuneBatchDetailList(RequestBody body) {
return mHttpDataSource.uploadImmuneBatchDetailList(body);
}
/****************************************************************************/ /****************************************************************************/
@Override @Override
......
...@@ -7,6 +7,7 @@ import com.phlx.anchorcollect.entity.CattleResumeEntity; ...@@ -7,6 +7,7 @@ import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity; import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData; import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity; import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect.entity.LoginData; import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity; import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity; import com.phlx.anchorcollect.entity.PerformanceEntity;
...@@ -212,6 +213,28 @@ public interface ApiService { ...@@ -212,6 +213,28 @@ public interface ApiService {
@POST("/api/immunebatch/add") @POST("/api/immunebatch/add")
Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body); Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body);
/**
* 获取-免疫记录-子表-列表
* SyncState 0根据记录更新,1重新更新
*/
@FormUrlEncoded
@POST("/api/immunebatchDetail/list")
Observable<ListResponse<ImmuneBatchDetailEntity>> downloadImmuneBatchDetailList(@FieldMap Map<String, String> map);
/**
* 获取-免疫记录-子表-列表-返回
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/immunebatchDetail/sync/add")
Observable<CollectResponse> downloadImmuneBatchDetailListSync(@Body RequestBody body);
/**
* 上传-免疫记录-子表-列表
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/immunebatchDetail/add")
Observable<CollectResponse> uploadImmuneBatchDetailList(@Body RequestBody body);
......
...@@ -6,6 +6,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity; ...@@ -6,6 +6,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity; import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity; import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData; import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity; import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.LoginData; import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity; import com.phlx.anchorcollect.entity.MedicalRecordEntity;
...@@ -161,4 +162,20 @@ public interface HttpDataSource { ...@@ -161,4 +162,20 @@ public interface HttpDataSource {
* 上传-免疫记录-列表 * 上传-免疫记录-列表
*/ */
Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body); Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body);
/**
* 获取-免疫记录-子表-列表
* SyncState 0根据记录更新,1重新更新
*/
Observable<ListResponse<ImmuneBatchDetailEntity>> downloadImmuneBatchDetailList(@FieldMap Map<String, String> map);
/**
* 获取-免疫记录-子表-列表-返回
*/
Observable<CollectResponse> downloadImmuneBatchDetailListSync(@Body RequestBody body);
/**
* 上传-免疫记录-子表-列表
*/
Observable<CollectResponse> uploadImmuneBatchDetailList(@Body RequestBody body);
} }
...@@ -6,6 +6,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity; ...@@ -6,6 +6,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity; import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity; import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenData; import com.phlx.anchorcollect.entity.GenData;
import com.phlx.anchorcollect.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity; import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.LoginData; import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.MedicalRecordEntity; import com.phlx.anchorcollect.entity.MedicalRecordEntity;
...@@ -162,4 +163,19 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -162,4 +163,19 @@ public class HttpDataSourceImpl implements HttpDataSource {
public Observable<CollectResponse> uploadImmuneBatchList(RequestBody body) { public Observable<CollectResponse> uploadImmuneBatchList(RequestBody body) {
return apiService.uploadImmuneBatchList(body); return apiService.uploadImmuneBatchList(body);
} }
@Override
public Observable<ListResponse<ImmuneBatchDetailEntity>> downloadImmuneBatchDetailList(Map<String, String> map) {
return apiService.downloadImmuneBatchDetailList(map);
}
@Override
public Observable<CollectResponse> downloadImmuneBatchDetailListSync(RequestBody body) {
return apiService.downloadImmuneBatchDetailListSync(body);
}
@Override
public Observable<CollectResponse> uploadImmuneBatchDetailList(RequestBody body) {
return apiService.uploadImmuneBatchDetailList(body);
}
} }
...@@ -6,7 +6,6 @@ import android.database.sqlite.SQLiteDatabase; ...@@ -6,7 +6,6 @@ import android.database.sqlite.SQLiteDatabase;
import com.github.yuweiguocn.library.greendao.MigrationHelper; import com.github.yuweiguocn.library.greendao.MigrationHelper;
import com.phlx.anchorcollect.db.gen.CardEntityDao; import com.phlx.anchorcollect.db.gen.CardEntityDao;
import com.phlx.anchorcollect.db.gen.DaoMaster; import com.phlx.anchorcollect.db.gen.DaoMaster;
import com.phlx.anchorcollect.entity.CardEntity;
import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.Database;
......
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.AncestryinfoEntity;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "ANCESTRYINFO_ENTITY".
*/
public class AncestryinfoEntityDao extends AbstractDao<AncestryinfoEntity, Long> {
public static final String TABLENAME = "ANCESTRYINFO_ENTITY";
/**
* Properties of entity AncestryinfoEntity.<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 Ancestryid = new Property(1, String.class, "ancestryid", false, "ANCESTRYID");
public final static Property Ancestryname = new Property(2, String.class, "ancestryname", false, "ANCESTRYNAME");
public final static Property Remark = new Property(3, String.class, "remark", false, "REMARK");
public final static Property Timestamp = new Property(4, long.class, "timestamp", false, "TIMESTAMP");
}
public AncestryinfoEntityDao(DaoConfig config) {
super(config);
}
public AncestryinfoEntityDao(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 + "\"ANCESTRYINFO_ENTITY\" (" + //
"\"_id\" INTEGER PRIMARY KEY ," + // 0: id
"\"ANCESTRYID\" TEXT," + // 1: ancestryid
"\"ANCESTRYNAME\" TEXT," + // 2: ancestryname
"\"REMARK\" TEXT," + // 3: remark
"\"TIMESTAMP\" INTEGER NOT NULL );"); // 4: timestamp
// Add Indexes
db.execSQL("CREATE INDEX " + constraint + "ancestryTime ON \"ANCESTRYINFO_ENTITY\"" +
" (\"TIMESTAMP\" ASC);");
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"ANCESTRYINFO_ENTITY\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, AncestryinfoEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String ancestryid = entity.getAncestryid();
if (ancestryid != null) {
stmt.bindString(2, ancestryid);
}
String ancestryname = entity.getAncestryname();
if (ancestryname != null) {
stmt.bindString(3, ancestryname);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(4, remark);
}
stmt.bindLong(5, entity.getTimestamp());
}
@Override
protected final void bindValues(SQLiteStatement stmt, AncestryinfoEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String ancestryid = entity.getAncestryid();
if (ancestryid != null) {
stmt.bindString(2, ancestryid);
}
String ancestryname = entity.getAncestryname();
if (ancestryname != null) {
stmt.bindString(3, ancestryname);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(4, remark);
}
stmt.bindLong(5, entity.getTimestamp());
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public AncestryinfoEntity readEntity(Cursor cursor, int offset) {
AncestryinfoEntity entity = new AncestryinfoEntity( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // ancestryid
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // ancestryname
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // remark
cursor.getLong(offset + 4) // timestamp
);
return entity;
}
@Override
public void readEntity(Cursor cursor, AncestryinfoEntity entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setAncestryid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setAncestryname(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setRemark(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setTimestamp(cursor.getLong(offset + 4));
}
@Override
protected final Long updateKeyAfterInsert(AncestryinfoEntity entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(AncestryinfoEntity entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(AncestryinfoEntity 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.CardEntity;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "CARD_ENTITY".
*/
public class CardEntityDao extends AbstractDao<CardEntity, Long> {
public static final String TABLENAME = "CARD_ENTITY";
/**
* Properties of entity CardEntity.<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, long.class, "unid", true, "_id");
public final static Property RegistrationNo = new Property(2, String.class, "registrationNo", false, "REGISTRATION_NO");
public final static Property IndividualNo = new Property(3, String.class, "individualNo", false, "INDIVIDUAL_NO");
public final static Property Type = new Property(4, String.class, "type", false, "TYPE");
public final static Property CircleNo = new Property(5, String.class, "circleNo", false, "CIRCLE_NO");
public final static Property Varieties = new Property(6, String.class, "varieties", false, "VARIETIES");
public final static Property Subtypes = new Property(7, String.class, "subtypes", false, "SUBTYPES");
public final static Property Birthdate = new Property(8, String.class, "birthdate", false, "BIRTHDATE");
public final static Property Sex = new Property(9, String.class, "sex", false, "SEX");
public final static Property Grade = new Property(10, String.class, "grade", false, "GRADE");
public final static Property FatherReg = new Property(11, String.class, "fatherReg", false, "FATHER_REG");
public final static Property MotherReg = new Property(12, String.class, "motherReg", false, "MOTHER_REG");
public final static Property ChildTime = new Property(13, String.class, "childTime", false, "CHILD_TIME");
public final static Property IsTwins = new Property(14, String.class, "isTwins", false, "IS_TWINS");
public final static Property IsOut = new Property(15, String.class, "isOut", false, "IS_OUT");
public final static Property BirthHeavy = new Property(16, String.class, "birthHeavy", false, "BIRTH_HEAVY");
public final static Property FromMilkHeavy = new Property(17, String.class, "fromMilkHeavy", false, "FROM_MILK_HEAVY");
public final static Property JunHeavy = new Property(18, String.class, "junHeavy", false, "JUN_HEAVY");
public final static Property DecAppScore = new Property(19, String.class, "decAppScore", false, "DEC_APP_SCORE");
public final static Property EaseBirth = new Property(20, String.class, "easeBirth", false, "EASE_BIRTH");
public final static Property IsColostrum = new Property(21, String.class, "isColostrum", false, "IS_COLOSTRUM");
public final static Property IsDehorning = new Property(22, String.class, "isDehorning", false, "IS_DEHORNING");
public final static Property Status = new Property(23, String.class, "status", false, "STATUS");
public final static Property Path = new Property(24, String.class, "path", false, "PATH");
public final static Property ImgStr = new Property(25, String.class, "imgStr", false, "IMG_STR");
public final static Property UpdateId = new Property(26, String.class, "updateId", false, "UPDATE_ID");
public final static Property DataId = new Property(27, String.class, "dataId", false, "DATA_ID");
public final static Property CreateBy = new Property(28, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(29, String.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(30, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(31, String.class, "updateTime", false, "UPDATE_TIME");
public final static Property Permissions = new Property(32, String.class, "permissions", false, "PERMISSIONS");
public final static Property InputTime = new Property(33, String.class, "inputTime", false, "INPUT_TIME");
}
public CardEntityDao(DaoConfig config) {
super(config);
}
public CardEntityDao(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 + "\"CARD_ENTITY\" (" + //
"\"ID\" INTEGER," + // 0: id
"\"_id\" INTEGER PRIMARY KEY NOT NULL ," + // 1: unid
"\"REGISTRATION_NO\" TEXT," + // 2: registrationNo
"\"INDIVIDUAL_NO\" TEXT," + // 3: individualNo
"\"TYPE\" TEXT," + // 4: type
"\"CIRCLE_NO\" TEXT," + // 5: circleNo
"\"VARIETIES\" TEXT," + // 6: varieties
"\"SUBTYPES\" TEXT," + // 7: subtypes
"\"BIRTHDATE\" TEXT," + // 8: birthdate
"\"SEX\" TEXT," + // 9: sex
"\"GRADE\" TEXT," + // 10: grade
"\"FATHER_REG\" TEXT," + // 11: fatherReg
"\"MOTHER_REG\" TEXT," + // 12: motherReg
"\"CHILD_TIME\" TEXT," + // 13: childTime
"\"IS_TWINS\" TEXT," + // 14: isTwins
"\"IS_OUT\" TEXT," + // 15: isOut
"\"BIRTH_HEAVY\" TEXT," + // 16: birthHeavy
"\"FROM_MILK_HEAVY\" TEXT," + // 17: fromMilkHeavy
"\"JUN_HEAVY\" TEXT," + // 18: junHeavy
"\"DEC_APP_SCORE\" TEXT," + // 19: decAppScore
"\"EASE_BIRTH\" TEXT," + // 20: easeBirth
"\"IS_COLOSTRUM\" TEXT," + // 21: isColostrum
"\"IS_DEHORNING\" TEXT," + // 22: isDehorning
"\"STATUS\" TEXT," + // 23: status
"\"PATH\" TEXT," + // 24: path
"\"IMG_STR\" TEXT," + // 25: imgStr
"\"UPDATE_ID\" TEXT," + // 26: updateId
"\"DATA_ID\" TEXT," + // 27: dataId
"\"CREATE_BY\" TEXT," + // 28: createBy
"\"CREATE_TIME\" TEXT," + // 29: createTime
"\"UPDATE_BY\" TEXT," + // 30: updateBy
"\"UPDATE_TIME\" TEXT," + // 31: updateTime
"\"PERMISSIONS\" TEXT," + // 32: permissions
"\"INPUT_TIME\" TEXT);"); // 33: inputTime
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CARD_ENTITY\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, CardEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getUnid());
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(3, registrationNo);
}
String individualNo = entity.getIndividualNo();
if (individualNo != null) {
stmt.bindString(4, individualNo);
}
String type = entity.getType();
if (type != null) {
stmt.bindString(5, type);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(6, circleNo);
}
String varieties = entity.getVarieties();
if (varieties != null) {
stmt.bindString(7, varieties);
}
String subtypes = entity.getSubtypes();
if (subtypes != null) {
stmt.bindString(8, subtypes);
}
String birthdate = entity.getBirthdate();
if (birthdate != null) {
stmt.bindString(9, birthdate);
}
String sex = entity.getSex();
if (sex != null) {
stmt.bindString(10, sex);
}
String grade = entity.getGrade();
if (grade != null) {
stmt.bindString(11, grade);
}
String fatherReg = entity.getFatherReg();
if (fatherReg != null) {
stmt.bindString(12, fatherReg);
}
String motherReg = entity.getMotherReg();
if (motherReg != null) {
stmt.bindString(13, motherReg);
}
String childTime = entity.getChildTime();
if (childTime != null) {
stmt.bindString(14, childTime);
}
String isTwins = entity.getIsTwins();
if (isTwins != null) {
stmt.bindString(15, isTwins);
}
String isOut = entity.getIsOut();
if (isOut != null) {
stmt.bindString(16, isOut);
}
String birthHeavy = entity.getBirthHeavy();
if (birthHeavy != null) {
stmt.bindString(17, birthHeavy);
}
String fromMilkHeavy = entity.getFromMilkHeavy();
if (fromMilkHeavy != null) {
stmt.bindString(18, fromMilkHeavy);
}
String junHeavy = entity.getJunHeavy();
if (junHeavy != null) {
stmt.bindString(19, junHeavy);
}
String decAppScore = entity.getDecAppScore();
if (decAppScore != null) {
stmt.bindString(20, decAppScore);
}
String easeBirth = entity.getEaseBirth();
if (easeBirth != null) {
stmt.bindString(21, easeBirth);
}
String isColostrum = entity.getIsColostrum();
if (isColostrum != null) {
stmt.bindString(22, isColostrum);
}
String isDehorning = entity.getIsDehorning();
if (isDehorning != null) {
stmt.bindString(23, isDehorning);
}
String status = entity.getStatus();
if (status != null) {
stmt.bindString(24, status);
}
String path = entity.getPath();
if (path != null) {
stmt.bindString(25, path);
}
String imgStr = entity.getImgStr();
if (imgStr != null) {
stmt.bindString(26, imgStr);
}
String updateId = entity.getUpdateId();
if (updateId != null) {
stmt.bindString(27, updateId);
}
String dataId = entity.getDataId();
if (dataId != null) {
stmt.bindString(28, dataId);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(29, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(30, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(31, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(32, updateTime);
}
String permissions = entity.getPermissions();
if (permissions != null) {
stmt.bindString(33, permissions);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(34, inputTime);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, CardEntity entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getUnid());
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(3, registrationNo);
}
String individualNo = entity.getIndividualNo();
if (individualNo != null) {
stmt.bindString(4, individualNo);
}
String type = entity.getType();
if (type != null) {
stmt.bindString(5, type);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(6, circleNo);
}
String varieties = entity.getVarieties();
if (varieties != null) {
stmt.bindString(7, varieties);
}
String subtypes = entity.getSubtypes();
if (subtypes != null) {
stmt.bindString(8, subtypes);
}
String birthdate = entity.getBirthdate();
if (birthdate != null) {
stmt.bindString(9, birthdate);
}
String sex = entity.getSex();
if (sex != null) {
stmt.bindString(10, sex);
}
String grade = entity.getGrade();
if (grade != null) {
stmt.bindString(11, grade);
}
String fatherReg = entity.getFatherReg();
if (fatherReg != null) {
stmt.bindString(12, fatherReg);
}
String motherReg = entity.getMotherReg();
if (motherReg != null) {
stmt.bindString(13, motherReg);
}
String childTime = entity.getChildTime();
if (childTime != null) {
stmt.bindString(14, childTime);
}
String isTwins = entity.getIsTwins();
if (isTwins != null) {
stmt.bindString(15, isTwins);
}
String isOut = entity.getIsOut();
if (isOut != null) {
stmt.bindString(16, isOut);
}
String birthHeavy = entity.getBirthHeavy();
if (birthHeavy != null) {
stmt.bindString(17, birthHeavy);
}
String fromMilkHeavy = entity.getFromMilkHeavy();
if (fromMilkHeavy != null) {
stmt.bindString(18, fromMilkHeavy);
}
String junHeavy = entity.getJunHeavy();
if (junHeavy != null) {
stmt.bindString(19, junHeavy);
}
String decAppScore = entity.getDecAppScore();
if (decAppScore != null) {
stmt.bindString(20, decAppScore);
}
String easeBirth = entity.getEaseBirth();
if (easeBirth != null) {
stmt.bindString(21, easeBirth);
}
String isColostrum = entity.getIsColostrum();
if (isColostrum != null) {
stmt.bindString(22, isColostrum);
}
String isDehorning = entity.getIsDehorning();
if (isDehorning != null) {
stmt.bindString(23, isDehorning);
}
String status = entity.getStatus();
if (status != null) {
stmt.bindString(24, status);
}
String path = entity.getPath();
if (path != null) {
stmt.bindString(25, path);
}
String imgStr = entity.getImgStr();
if (imgStr != null) {
stmt.bindString(26, imgStr);
}
String updateId = entity.getUpdateId();
if (updateId != null) {
stmt.bindString(27, updateId);
}
String dataId = entity.getDataId();
if (dataId != null) {
stmt.bindString(28, dataId);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(29, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(30, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(31, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(32, updateTime);
}
String permissions = entity.getPermissions();
if (permissions != null) {
stmt.bindString(33, permissions);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(34, inputTime);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.getLong(offset + 1);
}
@Override
public CardEntity readEntity(Cursor cursor, int offset) {
CardEntity entity = new CardEntity( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.getLong(offset + 1), // unid
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // registrationNo
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // individualNo
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // type
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // circleNo
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // varieties
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // subtypes
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // birthdate
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // sex
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // grade
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // fatherReg
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // motherReg
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // childTime
cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // isTwins
cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // isOut
cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // birthHeavy
cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // fromMilkHeavy
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // junHeavy
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // decAppScore
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // easeBirth
cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // isColostrum
cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // isDehorning
cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // status
cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // path
cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // imgStr
cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26), // updateId
cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27), // dataId
cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28), // createBy
cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // createTime
cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30), // updateBy
cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31), // updateTime
cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32), // permissions
cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33) // inputTime
);
return entity;
}
@Override
public void readEntity(Cursor cursor, CardEntity entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setUnid(cursor.getLong(offset + 1));
entity.setRegistrationNo(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setIndividualNo(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setType(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setCircleNo(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setVarieties(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setSubtypes(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setBirthdate(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setSex(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setGrade(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setFatherReg(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setMotherReg(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setChildTime(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setIsTwins(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
entity.setIsOut(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
entity.setBirthHeavy(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
entity.setFromMilkHeavy(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
entity.setJunHeavy(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setDecAppScore(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
entity.setEaseBirth(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
entity.setIsColostrum(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
entity.setIsDehorning(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
entity.setStatus(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
entity.setPath(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
entity.setImgStr(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25));
entity.setUpdateId(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26));
entity.setDataId(cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27));
entity.setCreateBy(cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28));
entity.setCreateTime(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
entity.setUpdateBy(cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30));
entity.setUpdateTime(cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31));
entity.setPermissions(cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32));
entity.setInputTime(cursor.isNull(offset + 33) ? null : cursor.getString(offset + 33));
}
@Override
protected final Long updateKeyAfterInsert(CardEntity entity, long rowId) {
entity.setUnid(rowId);
return rowId;
}
@Override
public Long getKey(CardEntity entity) {
if(entity != null) {
return entity.getUnid();
} else {
return null;
}
}
@Override
public boolean hasKey(CardEntity entity) {
throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
}
@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.CattleResumeEntity;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "CATTLE_RESUME_ENTITY".
*/
public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, String> {
public static final String TABLENAME = "CATTLE_RESUME_ENTITY";
/**
* Properties of entity CattleResumeEntity.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Unid = new Property(0, String.class, "unid", true, "UNID");
public final static Property RegistrationNo = new Property(1, String.class, "registrationNo", false, "REGISTRATION_NO");
public final static Property IndividualNo = new Property(2, String.class, "individualNo", false, "INDIVIDUAL_NO");
public final static Property CircleNo = new Property(3, String.class, "circleNo", false, "CIRCLE_NO");
public final static Property RaiseType = new Property(4, String.class, "raiseType", false, "RAISE_TYPE");
public final static Property RaiseVarieties = new Property(5, String.class, "raiseVarieties", false, "RAISE_VARIETIES");
public final static Property Birthdate = new Property(6, String.class, "birthdate", false, "BIRTHDATE");
public final static Property BirthHeavy = new Property(7, String.class, "birthHeavy", false, "BIRTH_HEAVY");
public final static Property Sex = new Property(8, String.class, "sex", false, "SEX");
public final static Property BirthDifficulty = new Property(9, String.class, "birthDifficulty", false, "BIRTH_DIFFICULTY");
public final static Property IsTwins = new Property(10, String.class, "isTwins", false, "IS_TWINS");
public final static Property ChildTime = new Property(11, String.class, "childTime", false, "CHILD_TIME");
public final static Property Grade = new Property(12, String.class, "grade", false, "GRADE");
public final static Property FatherReg = new Property(13, String.class, "fatherReg", false, "FATHER_REG");
public final static Property MotherReg = new Property(14, String.class, "motherReg", false, "MOTHER_REG");
public final static Property FromMilkHeavy = new Property(15, String.class, "fromMilkHeavy", false, "FROM_MILK_HEAVY");
public final static Property Health = new Property(16, String.class, "health", false, "HEALTH");
public final static Property JunHeavy = new Property(17, String.class, "junHeavy", false, "JUN_HEAVY");
public final static Property DecAppScore = new Property(18, String.class, "decAppScore", false, "DEC_APP_SCORE");
public final static Property Photo = new Property(19, String.class, "photo", false, "PHOTO");
public final static Property Status = new Property(20, String.class, "status", false, "STATUS");
public final static Property IsOut = new Property(21, String.class, "isOut", false, "IS_OUT");
public final static Property InputTime = new Property(22, String.class, "inputTime", false, "INPUT_TIME");
public final static Property DeptId = new Property(23, String.class, "deptId", false, "DEPT_ID");
public final static Property UploadStatus = new Property(24, String.class, "uploadStatus", false, "UPLOAD_STATUS");
public final static Property UploadTime = new Property(25, String.class, "uploadTime", false, "UPLOAD_TIME");
public final static Property CreateBy = new Property(26, String.class, "createBy", false, "CREATE_BY");
public final static Property CreateTime = new Property(27, String.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(28, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(29, String.class, "updateTime", false, "UPDATE_TIME");
public final static Property Remark = new Property(30, String.class, "remark", false, "REMARK");
}
public CattleResumeEntityDao(DaoConfig config) {
super(config);
}
public CattleResumeEntityDao(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 + "\"CATTLE_RESUME_ENTITY\" (" + //
"\"UNID\" TEXT PRIMARY KEY NOT NULL ," + // 0: unid
"\"REGISTRATION_NO\" TEXT," + // 1: registrationNo
"\"INDIVIDUAL_NO\" TEXT," + // 2: individualNo
"\"CIRCLE_NO\" TEXT," + // 3: circleNo
"\"RAISE_TYPE\" TEXT," + // 4: raiseType
"\"RAISE_VARIETIES\" TEXT," + // 5: raiseVarieties
"\"BIRTHDATE\" TEXT," + // 6: birthdate
"\"BIRTH_HEAVY\" TEXT," + // 7: birthHeavy
"\"SEX\" TEXT," + // 8: sex
"\"BIRTH_DIFFICULTY\" TEXT," + // 9: birthDifficulty
"\"IS_TWINS\" TEXT," + // 10: isTwins
"\"CHILD_TIME\" TEXT," + // 11: childTime
"\"GRADE\" TEXT," + // 12: grade
"\"FATHER_REG\" TEXT," + // 13: fatherReg
"\"MOTHER_REG\" TEXT," + // 14: motherReg
"\"FROM_MILK_HEAVY\" TEXT," + // 15: fromMilkHeavy
"\"HEALTH\" TEXT," + // 16: health
"\"JUN_HEAVY\" TEXT," + // 17: junHeavy
"\"DEC_APP_SCORE\" TEXT," + // 18: decAppScore
"\"PHOTO\" TEXT," + // 19: photo
"\"STATUS\" TEXT," + // 20: status
"\"IS_OUT\" TEXT," + // 21: isOut
"\"INPUT_TIME\" TEXT," + // 22: inputTime
"\"DEPT_ID\" TEXT," + // 23: deptId
"\"UPLOAD_STATUS\" TEXT," + // 24: uploadStatus
"\"UPLOAD_TIME\" TEXT," + // 25: uploadTime
"\"CREATE_BY\" TEXT," + // 26: createBy
"\"CREATE_TIME\" TEXT," + // 27: createTime
"\"UPDATE_BY\" TEXT," + // 28: updateBy
"\"UPDATE_TIME\" TEXT," + // 29: updateTime
"\"REMARK\" TEXT);"); // 30: remark
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CATTLE_RESUME_ENTITY\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, CattleResumeEntity entity) {
stmt.clearBindings();
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(1, unid);
}
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(2, registrationNo);
}
String individualNo = entity.getIndividualNo();
if (individualNo != null) {
stmt.bindString(3, individualNo);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(4, circleNo);
}
String raiseType = entity.getRaiseType();
if (raiseType != null) {
stmt.bindString(5, raiseType);
}
String raiseVarieties = entity.getRaiseVarieties();
if (raiseVarieties != null) {
stmt.bindString(6, raiseVarieties);
}
String birthdate = entity.getBirthdate();
if (birthdate != null) {
stmt.bindString(7, birthdate);
}
String birthHeavy = entity.getBirthHeavy();
if (birthHeavy != null) {
stmt.bindString(8, birthHeavy);
}
String sex = entity.getSex();
if (sex != null) {
stmt.bindString(9, sex);
}
String birthDifficulty = entity.getBirthDifficulty();
if (birthDifficulty != null) {
stmt.bindString(10, birthDifficulty);
}
String isTwins = entity.getIsTwins();
if (isTwins != null) {
stmt.bindString(11, isTwins);
}
String childTime = entity.getChildTime();
if (childTime != null) {
stmt.bindString(12, childTime);
}
String grade = entity.getGrade();
if (grade != null) {
stmt.bindString(13, grade);
}
String fatherReg = entity.getFatherReg();
if (fatherReg != null) {
stmt.bindString(14, fatherReg);
}
String motherReg = entity.getMotherReg();
if (motherReg != null) {
stmt.bindString(15, motherReg);
}
String fromMilkHeavy = entity.getFromMilkHeavy();
if (fromMilkHeavy != null) {
stmt.bindString(16, fromMilkHeavy);
}
String health = entity.getHealth();
if (health != null) {
stmt.bindString(17, health);
}
String junHeavy = entity.getJunHeavy();
if (junHeavy != null) {
stmt.bindString(18, junHeavy);
}
String decAppScore = entity.getDecAppScore();
if (decAppScore != null) {
stmt.bindString(19, decAppScore);
}
String photo = entity.getPhoto();
if (photo != null) {
stmt.bindString(20, photo);
}
String status = entity.getStatus();
if (status != null) {
stmt.bindString(21, status);
}
String isOut = entity.getIsOut();
if (isOut != null) {
stmt.bindString(22, isOut);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(23, inputTime);
}
String deptId = entity.getDeptId();
if (deptId != null) {
stmt.bindString(24, deptId);
}
String uploadStatus = entity.getUploadStatus();
if (uploadStatus != null) {
stmt.bindString(25, uploadStatus);
}
String uploadTime = entity.getUploadTime();
if (uploadTime != null) {
stmt.bindString(26, uploadTime);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(27, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(28, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(29, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(30, updateTime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(31, remark);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, CattleResumeEntity entity) {
stmt.clearBindings();
String unid = entity.getUnid();
if (unid != null) {
stmt.bindString(1, unid);
}
String registrationNo = entity.getRegistrationNo();
if (registrationNo != null) {
stmt.bindString(2, registrationNo);
}
String individualNo = entity.getIndividualNo();
if (individualNo != null) {
stmt.bindString(3, individualNo);
}
String circleNo = entity.getCircleNo();
if (circleNo != null) {
stmt.bindString(4, circleNo);
}
String raiseType = entity.getRaiseType();
if (raiseType != null) {
stmt.bindString(5, raiseType);
}
String raiseVarieties = entity.getRaiseVarieties();
if (raiseVarieties != null) {
stmt.bindString(6, raiseVarieties);
}
String birthdate = entity.getBirthdate();
if (birthdate != null) {
stmt.bindString(7, birthdate);
}
String birthHeavy = entity.getBirthHeavy();
if (birthHeavy != null) {
stmt.bindString(8, birthHeavy);
}
String sex = entity.getSex();
if (sex != null) {
stmt.bindString(9, sex);
}
String birthDifficulty = entity.getBirthDifficulty();
if (birthDifficulty != null) {
stmt.bindString(10, birthDifficulty);
}
String isTwins = entity.getIsTwins();
if (isTwins != null) {
stmt.bindString(11, isTwins);
}
String childTime = entity.getChildTime();
if (childTime != null) {
stmt.bindString(12, childTime);
}
String grade = entity.getGrade();
if (grade != null) {
stmt.bindString(13, grade);
}
String fatherReg = entity.getFatherReg();
if (fatherReg != null) {
stmt.bindString(14, fatherReg);
}
String motherReg = entity.getMotherReg();
if (motherReg != null) {
stmt.bindString(15, motherReg);
}
String fromMilkHeavy = entity.getFromMilkHeavy();
if (fromMilkHeavy != null) {
stmt.bindString(16, fromMilkHeavy);
}
String health = entity.getHealth();
if (health != null) {
stmt.bindString(17, health);
}
String junHeavy = entity.getJunHeavy();
if (junHeavy != null) {
stmt.bindString(18, junHeavy);
}
String decAppScore = entity.getDecAppScore();
if (decAppScore != null) {
stmt.bindString(19, decAppScore);
}
String photo = entity.getPhoto();
if (photo != null) {
stmt.bindString(20, photo);
}
String status = entity.getStatus();
if (status != null) {
stmt.bindString(21, status);
}
String isOut = entity.getIsOut();
if (isOut != null) {
stmt.bindString(22, isOut);
}
String inputTime = entity.getInputTime();
if (inputTime != null) {
stmt.bindString(23, inputTime);
}
String deptId = entity.getDeptId();
if (deptId != null) {
stmt.bindString(24, deptId);
}
String uploadStatus = entity.getUploadStatus();
if (uploadStatus != null) {
stmt.bindString(25, uploadStatus);
}
String uploadTime = entity.getUploadTime();
if (uploadTime != null) {
stmt.bindString(26, uploadTime);
}
String createBy = entity.getCreateBy();
if (createBy != null) {
stmt.bindString(27, createBy);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(28, createTime);
}
String updateBy = entity.getUpdateBy();
if (updateBy != null) {
stmt.bindString(29, updateBy);
}
String updateTime = entity.getUpdateTime();
if (updateTime != null) {
stmt.bindString(30, updateTime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(31, remark);
}
}
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
}
@Override
public CattleResumeEntity readEntity(Cursor cursor, int offset) {
CattleResumeEntity entity = new CattleResumeEntity( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // unid
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // registrationNo
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // individualNo
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // circleNo
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // raiseType
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // raiseVarieties
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // birthdate
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // birthHeavy
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // sex
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // birthDifficulty
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isTwins
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // childTime
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // grade
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // fatherReg
cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // motherReg
cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // fromMilkHeavy
cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // health
cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // junHeavy
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // decAppScore
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // photo
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // status
cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // isOut
cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // inputTime
cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // deptId
cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // uploadStatus
cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // uploadTime
cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26), // createBy
cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27), // createTime
cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28), // updateBy
cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // updateTime
cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30) // remark
);
return entity;
}
@Override
public void readEntity(Cursor cursor, CattleResumeEntity entity, int offset) {
entity.setUnid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setRegistrationNo(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setIndividualNo(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setCircleNo(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setRaiseType(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setRaiseVarieties(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setBirthdate(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setBirthHeavy(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setSex(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setBirthDifficulty(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setIsTwins(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setChildTime(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setGrade(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setFatherReg(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setMotherReg(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
entity.setFromMilkHeavy(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
entity.setHealth(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
entity.setJunHeavy(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
entity.setDecAppScore(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setPhoto(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
entity.setStatus(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
entity.setIsOut(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
entity.setInputTime(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
entity.setDeptId(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
entity.setUploadStatus(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
entity.setUploadTime(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25));
entity.setCreateBy(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26));
entity.setCreateTime(cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27));
entity.setUpdateBy(cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28));
entity.setUpdateTime(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
entity.setRemark(cursor.isNull(offset + 30) ? null : cursor.getString(offset + 30));
}
@Override
protected final String updateKeyAfterInsert(CattleResumeEntity entity, long rowId) {
return entity.getUnid();
}
@Override
public String getKey(CattleResumeEntity entity) {
if(entity != null) {
return entity.getUnid();
} else {
return null;
}
}
@Override
public boolean hasKey(CattleResumeEntity entity) {
return entity.getUnid() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
...@@ -29,11 +29,12 @@ public class DaoMaster extends AbstractDaoMaster { ...@@ -29,11 +29,12 @@ public class DaoMaster extends AbstractDaoMaster {
DictEntityDao.createTable(db, ifNotExists); DictEntityDao.createTable(db, ifNotExists);
GenTableDao.createTable(db, ifNotExists); GenTableDao.createTable(db, ifNotExists);
GenTableColumnDao.createTable(db, ifNotExists); GenTableColumnDao.createTable(db, ifNotExists);
ImmuneBatchDetailEntityDao.createTable(db, ifNotExists);
ImmuneBatchEntityDao.createTable(db, ifNotExists);
MedicalRecordEntityDao.createTable(db, ifNotExists);
PerformanceEntityDao.createTable(db, ifNotExists); PerformanceEntityDao.createTable(db, ifNotExists);
UserRoleEntityDao.createTable(db, ifNotExists); UserRoleEntityDao.createTable(db, ifNotExists);
WeightManEntityDao.createTable(db, ifNotExists); WeightManEntityDao.createTable(db, ifNotExists);
ImmuneBatchEntityDao.createTable(db, ifNotExists);
MedicalRecordEntityDao.createTable(db, ifNotExists);
} }
/** Drops underlying database table using DAOs. */ /** Drops underlying database table using DAOs. */
...@@ -46,11 +47,12 @@ public class DaoMaster extends AbstractDaoMaster { ...@@ -46,11 +47,12 @@ public class DaoMaster extends AbstractDaoMaster {
DictEntityDao.dropTable(db, ifExists); DictEntityDao.dropTable(db, ifExists);
GenTableDao.dropTable(db, ifExists); GenTableDao.dropTable(db, ifExists);
GenTableColumnDao.dropTable(db, ifExists); GenTableColumnDao.dropTable(db, ifExists);
ImmuneBatchDetailEntityDao.dropTable(db, ifExists);
ImmuneBatchEntityDao.dropTable(db, ifExists);
MedicalRecordEntityDao.dropTable(db, ifExists);
PerformanceEntityDao.dropTable(db, ifExists); PerformanceEntityDao.dropTable(db, ifExists);
UserRoleEntityDao.dropTable(db, ifExists); UserRoleEntityDao.dropTable(db, ifExists);
WeightManEntityDao.dropTable(db, ifExists); WeightManEntityDao.dropTable(db, ifExists);
ImmuneBatchEntityDao.dropTable(db, ifExists);
MedicalRecordEntityDao.dropTable(db, ifExists);
} }
/** /**
...@@ -77,11 +79,12 @@ public class DaoMaster extends AbstractDaoMaster { ...@@ -77,11 +79,12 @@ public class DaoMaster extends AbstractDaoMaster {
registerDaoClass(DictEntityDao.class); registerDaoClass(DictEntityDao.class);
registerDaoClass(GenTableDao.class); registerDaoClass(GenTableDao.class);
registerDaoClass(GenTableColumnDao.class); registerDaoClass(GenTableColumnDao.class);
registerDaoClass(ImmuneBatchDetailEntityDao.class);
registerDaoClass(ImmuneBatchEntityDao.class);
registerDaoClass(MedicalRecordEntityDao.class);
registerDaoClass(PerformanceEntityDao.class); registerDaoClass(PerformanceEntityDao.class);
registerDaoClass(UserRoleEntityDao.class); registerDaoClass(UserRoleEntityDao.class);
registerDaoClass(WeightManEntityDao.class); registerDaoClass(WeightManEntityDao.class);
registerDaoClass(ImmuneBatchEntityDao.class);
registerDaoClass(MedicalRecordEntityDao.class);
} }
public DaoSession newSession() { public DaoSession newSession() {
......
...@@ -16,11 +16,12 @@ import com.phlx.anchorcollect.entity.CattleResumeEntity; ...@@ -16,11 +16,12 @@ import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity; import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenTable; import com.phlx.anchorcollect.entity.GenTable;
import com.phlx.anchorcollect.entity.GenTableColumn; import com.phlx.anchorcollect.entity.GenTableColumn;
import com.phlx.anchorcollect.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity; import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.UserRoleEntity; import com.phlx.anchorcollect.entity.UserRoleEntity;
import com.phlx.anchorcollect.entity.WeightManEntity; 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.AncestryinfoEntityDao;
import com.phlx.anchorcollect.db.gen.BreedingRecordDetailEntityDao; import com.phlx.anchorcollect.db.gen.BreedingRecordDetailEntityDao;
...@@ -30,11 +31,12 @@ import com.phlx.anchorcollect.db.gen.CattleResumeEntityDao; ...@@ -30,11 +31,12 @@ import com.phlx.anchorcollect.db.gen.CattleResumeEntityDao;
import com.phlx.anchorcollect.db.gen.DictEntityDao; import com.phlx.anchorcollect.db.gen.DictEntityDao;
import com.phlx.anchorcollect.db.gen.GenTableDao; import com.phlx.anchorcollect.db.gen.GenTableDao;
import com.phlx.anchorcollect.db.gen.GenTableColumnDao; import com.phlx.anchorcollect.db.gen.GenTableColumnDao;
import com.phlx.anchorcollect.db.gen.ImmuneBatchDetailEntityDao;
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.PerformanceEntityDao;
import com.phlx.anchorcollect.db.gen.UserRoleEntityDao; import com.phlx.anchorcollect.db.gen.UserRoleEntityDao;
import com.phlx.anchorcollect.db.gen.WeightManEntityDao; 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. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
...@@ -53,11 +55,12 @@ public class DaoSession extends AbstractDaoSession { ...@@ -53,11 +55,12 @@ public class DaoSession extends AbstractDaoSession {
private final DaoConfig dictEntityDaoConfig; private final DaoConfig dictEntityDaoConfig;
private final DaoConfig genTableDaoConfig; private final DaoConfig genTableDaoConfig;
private final DaoConfig genTableColumnDaoConfig; private final DaoConfig genTableColumnDaoConfig;
private final DaoConfig immuneBatchDetailEntityDaoConfig;
private final DaoConfig immuneBatchEntityDaoConfig;
private final DaoConfig medicalRecordEntityDaoConfig;
private final DaoConfig performanceEntityDaoConfig; private final DaoConfig performanceEntityDaoConfig;
private final DaoConfig userRoleEntityDaoConfig; private final DaoConfig userRoleEntityDaoConfig;
private final DaoConfig weightManEntityDaoConfig; private final DaoConfig weightManEntityDaoConfig;
private final DaoConfig immuneBatchEntityDaoConfig;
private final DaoConfig medicalRecordEntityDaoConfig;
private final AncestryinfoEntityDao ancestryinfoEntityDao; private final AncestryinfoEntityDao ancestryinfoEntityDao;
private final BreedingRecordDetailEntityDao breedingRecordDetailEntityDao; private final BreedingRecordDetailEntityDao breedingRecordDetailEntityDao;
...@@ -67,11 +70,12 @@ public class DaoSession extends AbstractDaoSession { ...@@ -67,11 +70,12 @@ public class DaoSession extends AbstractDaoSession {
private final DictEntityDao dictEntityDao; private final DictEntityDao dictEntityDao;
private final GenTableDao genTableDao; private final GenTableDao genTableDao;
private final GenTableColumnDao genTableColumnDao; private final GenTableColumnDao genTableColumnDao;
private final ImmuneBatchDetailEntityDao immuneBatchDetailEntityDao;
private final ImmuneBatchEntityDao immuneBatchEntityDao;
private final MedicalRecordEntityDao medicalRecordEntityDao;
private final PerformanceEntityDao performanceEntityDao; private final PerformanceEntityDao performanceEntityDao;
private final UserRoleEntityDao userRoleEntityDao; private final UserRoleEntityDao userRoleEntityDao;
private final WeightManEntityDao weightManEntityDao; private final WeightManEntityDao weightManEntityDao;
private final ImmuneBatchEntityDao immuneBatchEntityDao;
private final MedicalRecordEntityDao medicalRecordEntityDao;
public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
daoConfigMap) { daoConfigMap) {
...@@ -101,6 +105,15 @@ public class DaoSession extends AbstractDaoSession { ...@@ -101,6 +105,15 @@ public class DaoSession extends AbstractDaoSession {
genTableColumnDaoConfig = daoConfigMap.get(GenTableColumnDao.class).clone(); genTableColumnDaoConfig = daoConfigMap.get(GenTableColumnDao.class).clone();
genTableColumnDaoConfig.initIdentityScope(type); genTableColumnDaoConfig.initIdentityScope(type);
immuneBatchDetailEntityDaoConfig = daoConfigMap.get(ImmuneBatchDetailEntityDao.class).clone();
immuneBatchDetailEntityDaoConfig.initIdentityScope(type);
immuneBatchEntityDaoConfig = daoConfigMap.get(ImmuneBatchEntityDao.class).clone();
immuneBatchEntityDaoConfig.initIdentityScope(type);
medicalRecordEntityDaoConfig = daoConfigMap.get(MedicalRecordEntityDao.class).clone();
medicalRecordEntityDaoConfig.initIdentityScope(type);
performanceEntityDaoConfig = daoConfigMap.get(PerformanceEntityDao.class).clone(); performanceEntityDaoConfig = daoConfigMap.get(PerformanceEntityDao.class).clone();
performanceEntityDaoConfig.initIdentityScope(type); performanceEntityDaoConfig.initIdentityScope(type);
...@@ -110,12 +123,6 @@ public class DaoSession extends AbstractDaoSession { ...@@ -110,12 +123,6 @@ public class DaoSession extends AbstractDaoSession {
weightManEntityDaoConfig = daoConfigMap.get(WeightManEntityDao.class).clone(); weightManEntityDaoConfig = daoConfigMap.get(WeightManEntityDao.class).clone();
weightManEntityDaoConfig.initIdentityScope(type); 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); ancestryinfoEntityDao = new AncestryinfoEntityDao(ancestryinfoEntityDaoConfig, this);
breedingRecordDetailEntityDao = new BreedingRecordDetailEntityDao(breedingRecordDetailEntityDaoConfig, this); breedingRecordDetailEntityDao = new BreedingRecordDetailEntityDao(breedingRecordDetailEntityDaoConfig, this);
breedingRecordEntityDao = new BreedingRecordEntityDao(breedingRecordEntityDaoConfig, this); breedingRecordEntityDao = new BreedingRecordEntityDao(breedingRecordEntityDaoConfig, this);
...@@ -124,11 +131,12 @@ public class DaoSession extends AbstractDaoSession { ...@@ -124,11 +131,12 @@ public class DaoSession extends AbstractDaoSession {
dictEntityDao = new DictEntityDao(dictEntityDaoConfig, this); dictEntityDao = new DictEntityDao(dictEntityDaoConfig, this);
genTableDao = new GenTableDao(genTableDaoConfig, this); genTableDao = new GenTableDao(genTableDaoConfig, this);
genTableColumnDao = new GenTableColumnDao(genTableColumnDaoConfig, this); genTableColumnDao = new GenTableColumnDao(genTableColumnDaoConfig, this);
immuneBatchDetailEntityDao = new ImmuneBatchDetailEntityDao(immuneBatchDetailEntityDaoConfig, this);
immuneBatchEntityDao = new ImmuneBatchEntityDao(immuneBatchEntityDaoConfig, this);
medicalRecordEntityDao = new MedicalRecordEntityDao(medicalRecordEntityDaoConfig, this);
performanceEntityDao = new PerformanceEntityDao(performanceEntityDaoConfig, this); performanceEntityDao = new PerformanceEntityDao(performanceEntityDaoConfig, this);
userRoleEntityDao = new UserRoleEntityDao(userRoleEntityDaoConfig, this); userRoleEntityDao = new UserRoleEntityDao(userRoleEntityDaoConfig, this);
weightManEntityDao = new WeightManEntityDao(weightManEntityDaoConfig, this); weightManEntityDao = new WeightManEntityDao(weightManEntityDaoConfig, this);
immuneBatchEntityDao = new ImmuneBatchEntityDao(immuneBatchEntityDaoConfig, this);
medicalRecordEntityDao = new MedicalRecordEntityDao(medicalRecordEntityDaoConfig, this);
registerDao(AncestryinfoEntity.class, ancestryinfoEntityDao); registerDao(AncestryinfoEntity.class, ancestryinfoEntityDao);
registerDao(BreedingRecordDetailEntity.class, breedingRecordDetailEntityDao); registerDao(BreedingRecordDetailEntity.class, breedingRecordDetailEntityDao);
...@@ -138,11 +146,12 @@ public class DaoSession extends AbstractDaoSession { ...@@ -138,11 +146,12 @@ public class DaoSession extends AbstractDaoSession {
registerDao(DictEntity.class, dictEntityDao); registerDao(DictEntity.class, dictEntityDao);
registerDao(GenTable.class, genTableDao); registerDao(GenTable.class, genTableDao);
registerDao(GenTableColumn.class, genTableColumnDao); registerDao(GenTableColumn.class, genTableColumnDao);
registerDao(ImmuneBatchDetailEntity.class, immuneBatchDetailEntityDao);
registerDao(ImmuneBatchEntity.class, immuneBatchEntityDao);
registerDao(MedicalRecordEntity.class, medicalRecordEntityDao);
registerDao(PerformanceEntity.class, performanceEntityDao); registerDao(PerformanceEntity.class, performanceEntityDao);
registerDao(UserRoleEntity.class, userRoleEntityDao); registerDao(UserRoleEntity.class, userRoleEntityDao);
registerDao(WeightManEntity.class, weightManEntityDao); registerDao(WeightManEntity.class, weightManEntityDao);
registerDao(ImmuneBatchEntity.class, immuneBatchEntityDao);
registerDao(MedicalRecordEntity.class, medicalRecordEntityDao);
} }
public void clear() { public void clear() {
...@@ -154,11 +163,12 @@ public class DaoSession extends AbstractDaoSession { ...@@ -154,11 +163,12 @@ public class DaoSession extends AbstractDaoSession {
dictEntityDaoConfig.clearIdentityScope(); dictEntityDaoConfig.clearIdentityScope();
genTableDaoConfig.clearIdentityScope(); genTableDaoConfig.clearIdentityScope();
genTableColumnDaoConfig.clearIdentityScope(); genTableColumnDaoConfig.clearIdentityScope();
immuneBatchDetailEntityDaoConfig.clearIdentityScope();
immuneBatchEntityDaoConfig.clearIdentityScope();
medicalRecordEntityDaoConfig.clearIdentityScope();
performanceEntityDaoConfig.clearIdentityScope(); performanceEntityDaoConfig.clearIdentityScope();
userRoleEntityDaoConfig.clearIdentityScope(); userRoleEntityDaoConfig.clearIdentityScope();
weightManEntityDaoConfig.clearIdentityScope(); weightManEntityDaoConfig.clearIdentityScope();
immuneBatchEntityDaoConfig.clearIdentityScope();
medicalRecordEntityDaoConfig.clearIdentityScope();
} }
public AncestryinfoEntityDao getAncestryinfoEntityDao() { public AncestryinfoEntityDao getAncestryinfoEntityDao() {
...@@ -193,6 +203,18 @@ public class DaoSession extends AbstractDaoSession { ...@@ -193,6 +203,18 @@ public class DaoSession extends AbstractDaoSession {
return genTableColumnDao; return genTableColumnDao;
} }
public ImmuneBatchDetailEntityDao getImmuneBatchDetailEntityDao() {
return immuneBatchDetailEntityDao;
}
public ImmuneBatchEntityDao getImmuneBatchEntityDao() {
return immuneBatchEntityDao;
}
public MedicalRecordEntityDao getMedicalRecordEntityDao() {
return medicalRecordEntityDao;
}
public PerformanceEntityDao getPerformanceEntityDao() { public PerformanceEntityDao getPerformanceEntityDao() {
return performanceEntityDao; return performanceEntityDao;
} }
...@@ -205,12 +227,4 @@ public class DaoSession extends AbstractDaoSession { ...@@ -205,12 +227,4 @@ public class DaoSession extends AbstractDaoSession {
return weightManEntityDao; 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.GenTableColumn;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "GEN_TABLE_COLUMN".
*/
public class GenTableColumnDao extends AbstractDao<GenTableColumn, String> {
public static final String TABLENAME = "GEN_TABLE_COLUMN";
/**
* Properties of entity GenTableColumn.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property ColumnId = new Property(0, String.class, "columnId", true, "COLUMN_ID");
public final static Property TableId = new Property(1, String.class, "tableId", false, "TABLE_ID");
public final static Property ColumnName = new Property(2, String.class, "columnName", false, "COLUMN_NAME");
public final static Property ColumnComment = new Property(3, String.class, "columnComment", false, "COLUMN_COMMENT");
public final static Property ColumnType = new Property(4, String.class, "columnType", false, "COLUMN_TYPE");
public final static Property JavaType = new Property(5, String.class, "javaType", false, "JAVA_TYPE");
public final static Property JavaField = new Property(6, String.class, "javaField", false, "JAVA_FIELD");
public final static Property IsPk = new Property(7, String.class, "isPk", false, "IS_PK");
public final static Property IsIncrement = new Property(8, String.class, "isIncrement", false, "IS_INCREMENT");
public final static Property IsRequired = new Property(9, String.class, "isRequired", false, "IS_REQUIRED");
public final static Property IsInsert = new Property(10, String.class, "isInsert", false, "IS_INSERT");
public final static Property IsEdit = new Property(11, String.class, "isEdit", false, "IS_EDIT");
public final static Property IsList = new Property(12, String.class, "isList", false, "IS_LIST");
public final static Property IsQuery = new Property(13, String.class, "isQuery", false, "IS_QUERY");
public final static Property QueryType = new Property(14, String.class, "queryType", false, "QUERY_TYPE");
public final static Property HtmlType = new Property(15, String.class, "htmlType", false, "HTML_TYPE");
public final static Property DictType = new Property(16, String.class, "dictType", false, "DICT_TYPE");
public final static Property Sort = new Property(17, Integer.class, "sort", false, "SORT");
public final static Property Content = new Property(18, String.class, "content", false, "CONTENT");
public final static Property ShowName = new Property(19, String.class, "showName", false, "SHOW_NAME");
}
public GenTableColumnDao(DaoConfig config) {
super(config);
}
public GenTableColumnDao(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 + "\"GEN_TABLE_COLUMN\" (" + //
"\"COLUMN_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: columnId
"\"TABLE_ID\" TEXT," + // 1: tableId
"\"COLUMN_NAME\" TEXT," + // 2: columnName
"\"COLUMN_COMMENT\" TEXT," + // 3: columnComment
"\"COLUMN_TYPE\" TEXT," + // 4: columnType
"\"JAVA_TYPE\" TEXT," + // 5: javaType
"\"JAVA_FIELD\" TEXT," + // 6: javaField
"\"IS_PK\" TEXT," + // 7: isPk
"\"IS_INCREMENT\" TEXT," + // 8: isIncrement
"\"IS_REQUIRED\" TEXT," + // 9: isRequired
"\"IS_INSERT\" TEXT," + // 10: isInsert
"\"IS_EDIT\" TEXT," + // 11: isEdit
"\"IS_LIST\" TEXT," + // 12: isList
"\"IS_QUERY\" TEXT," + // 13: isQuery
"\"QUERY_TYPE\" TEXT," + // 14: queryType
"\"HTML_TYPE\" TEXT," + // 15: htmlType
"\"DICT_TYPE\" TEXT," + // 16: dictType
"\"SORT\" INTEGER," + // 17: sort
"\"CONTENT\" TEXT," + // 18: content
"\"SHOW_NAME\" TEXT);"); // 19: showName
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"GEN_TABLE_COLUMN\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, GenTableColumn entity) {
stmt.clearBindings();
String columnId = entity.getColumnId();
if (columnId != null) {
stmt.bindString(1, columnId);
}
String tableId = entity.getTableId();
if (tableId != null) {
stmt.bindString(2, tableId);
}
String columnName = entity.getColumnName();
if (columnName != null) {
stmt.bindString(3, columnName);
}
String columnComment = entity.getColumnComment();
if (columnComment != null) {
stmt.bindString(4, columnComment);
}
String columnType = entity.getColumnType();
if (columnType != null) {
stmt.bindString(5, columnType);
}
String javaType = entity.getJavaType();
if (javaType != null) {
stmt.bindString(6, javaType);
}
String javaField = entity.getJavaField();
if (javaField != null) {
stmt.bindString(7, javaField);
}
String isPk = entity.getIsPk();
if (isPk != null) {
stmt.bindString(8, isPk);
}
String isIncrement = entity.getIsIncrement();
if (isIncrement != null) {
stmt.bindString(9, isIncrement);
}
String isRequired = entity.getIsRequired();
if (isRequired != null) {
stmt.bindString(10, isRequired);
}
String isInsert = entity.getIsInsert();
if (isInsert != null) {
stmt.bindString(11, isInsert);
}
String isEdit = entity.getIsEdit();
if (isEdit != null) {
stmt.bindString(12, isEdit);
}
String isList = entity.getIsList();
if (isList != null) {
stmt.bindString(13, isList);
}
String isQuery = entity.getIsQuery();
if (isQuery != null) {
stmt.bindString(14, isQuery);
}
String queryType = entity.getQueryType();
if (queryType != null) {
stmt.bindString(15, queryType);
}
String htmlType = entity.getHtmlType();
if (htmlType != null) {
stmt.bindString(16, htmlType);
}
String dictType = entity.getDictType();
if (dictType != null) {
stmt.bindString(17, dictType);
}
Integer sort = entity.getSort();
if (sort != null) {
stmt.bindLong(18, sort);
}
String content = entity.getContent();
if (content != null) {
stmt.bindString(19, content);
}
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(20, showName);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, GenTableColumn entity) {
stmt.clearBindings();
String columnId = entity.getColumnId();
if (columnId != null) {
stmt.bindString(1, columnId);
}
String tableId = entity.getTableId();
if (tableId != null) {
stmt.bindString(2, tableId);
}
String columnName = entity.getColumnName();
if (columnName != null) {
stmt.bindString(3, columnName);
}
String columnComment = entity.getColumnComment();
if (columnComment != null) {
stmt.bindString(4, columnComment);
}
String columnType = entity.getColumnType();
if (columnType != null) {
stmt.bindString(5, columnType);
}
String javaType = entity.getJavaType();
if (javaType != null) {
stmt.bindString(6, javaType);
}
String javaField = entity.getJavaField();
if (javaField != null) {
stmt.bindString(7, javaField);
}
String isPk = entity.getIsPk();
if (isPk != null) {
stmt.bindString(8, isPk);
}
String isIncrement = entity.getIsIncrement();
if (isIncrement != null) {
stmt.bindString(9, isIncrement);
}
String isRequired = entity.getIsRequired();
if (isRequired != null) {
stmt.bindString(10, isRequired);
}
String isInsert = entity.getIsInsert();
if (isInsert != null) {
stmt.bindString(11, isInsert);
}
String isEdit = entity.getIsEdit();
if (isEdit != null) {
stmt.bindString(12, isEdit);
}
String isList = entity.getIsList();
if (isList != null) {
stmt.bindString(13, isList);
}
String isQuery = entity.getIsQuery();
if (isQuery != null) {
stmt.bindString(14, isQuery);
}
String queryType = entity.getQueryType();
if (queryType != null) {
stmt.bindString(15, queryType);
}
String htmlType = entity.getHtmlType();
if (htmlType != null) {
stmt.bindString(16, htmlType);
}
String dictType = entity.getDictType();
if (dictType != null) {
stmt.bindString(17, dictType);
}
Integer sort = entity.getSort();
if (sort != null) {
stmt.bindLong(18, sort);
}
String content = entity.getContent();
if (content != null) {
stmt.bindString(19, content);
}
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(20, showName);
}
}
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
}
@Override
public GenTableColumn readEntity(Cursor cursor, int offset) {
GenTableColumn entity = new GenTableColumn( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // columnId
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // tableId
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // columnName
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // columnComment
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // columnType
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // javaType
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // javaField
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // isPk
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // isIncrement
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRequired
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // isInsert
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // isEdit
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // isList
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // isQuery
cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // queryType
cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // htmlType
cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // dictType
cursor.isNull(offset + 17) ? null : cursor.getInt(offset + 17), // sort
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // content
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19) // showName
);
return entity;
}
@Override
public void readEntity(Cursor cursor, GenTableColumn entity, int offset) {
entity.setColumnId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setTableId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setColumnName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setColumnComment(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setColumnType(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setJavaType(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setJavaField(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setIsPk(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setIsIncrement(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setIsRequired(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setIsInsert(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setIsEdit(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setIsList(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setIsQuery(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setQueryType(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
entity.setHtmlType(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
entity.setDictType(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
entity.setSort(cursor.isNull(offset + 17) ? null : cursor.getInt(offset + 17));
entity.setContent(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setShowName(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
}
@Override
protected final String updateKeyAfterInsert(GenTableColumn entity, long rowId) {
return entity.getColumnId();
}
@Override
public String getKey(GenTableColumn entity) {
if(entity != null) {
return entity.getColumnId();
} else {
return null;
}
}
@Override
public boolean hasKey(GenTableColumn entity) {
return entity.getColumnId() != 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.GenTable;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "GEN_TABLE".
*/
public class GenTableDao extends AbstractDao<GenTable, String> {
public static final String TABLENAME = "GEN_TABLE";
/**
* Properties of entity GenTable.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property TableId = new Property(0, String.class, "tableId", true, "TABLE_ID");
public final static Property TableName = new Property(1, String.class, "tableName", false, "TABLE_NAME");
public final static Property TableComment = new Property(2, String.class, "tableComment", false, "TABLE_COMMENT");
public final static Property SubTableName = new Property(3, String.class, "subTableName", false, "SUB_TABLE_NAME");
public final static Property SubTableFkName = new Property(4, String.class, "subTableFkName", false, "SUB_TABLE_FK_NAME");
public final static Property ClassName = new Property(5, String.class, "className", false, "CLASS_NAME");
public final static Property TplCategory = new Property(6, String.class, "tplCategory", false, "TPL_CATEGORY");
public final static Property PackageName = new Property(7, String.class, "packageName", false, "PACKAGE_NAME");
public final static Property ModuleName = new Property(8, String.class, "moduleName", false, "MODULE_NAME");
public final static Property BusinessName = new Property(9, String.class, "businessName", false, "BUSINESS_NAME");
public final static Property FunctionName = new Property(10, String.class, "functionName", false, "FUNCTION_NAME");
public final static Property FunctionAuthor = new Property(11, String.class, "functionAuthor", false, "FUNCTION_AUTHOR");
public final static Property GenType = new Property(12, String.class, "genType", false, "GEN_TYPE");
public final static Property GenPath = new Property(13, String.class, "genPath", false, "GEN_PATH");
public final static Property Options = new Property(14, String.class, "options", false, "OPTIONS");
public final static Property TreeCode = new Property(15, String.class, "treeCode", false, "TREE_CODE");
public final static Property TreeParentCode = new Property(16, String.class, "treeParentCode", false, "TREE_PARENT_CODE");
public final static Property TreeName = new Property(17, String.class, "treeName", false, "TREE_NAME");
public final static Property ParentMenuId = new Property(18, String.class, "parentMenuId", false, "PARENT_MENU_ID");
public final static Property ParentMenuName = new Property(19, String.class, "parentMenuName", false, "PARENT_MENU_NAME");
public final static Property RoleId = new Property(20, String.class, "roleId", false, "ROLE_ID");
}
public GenTableDao(DaoConfig config) {
super(config);
}
public GenTableDao(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 + "\"GEN_TABLE\" (" + //
"\"TABLE_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: tableId
"\"TABLE_NAME\" TEXT," + // 1: tableName
"\"TABLE_COMMENT\" TEXT," + // 2: tableComment
"\"SUB_TABLE_NAME\" TEXT," + // 3: subTableName
"\"SUB_TABLE_FK_NAME\" TEXT," + // 4: subTableFkName
"\"CLASS_NAME\" TEXT," + // 5: className
"\"TPL_CATEGORY\" TEXT," + // 6: tplCategory
"\"PACKAGE_NAME\" TEXT," + // 7: packageName
"\"MODULE_NAME\" TEXT," + // 8: moduleName
"\"BUSINESS_NAME\" TEXT," + // 9: businessName
"\"FUNCTION_NAME\" TEXT," + // 10: functionName
"\"FUNCTION_AUTHOR\" TEXT," + // 11: functionAuthor
"\"GEN_TYPE\" TEXT," + // 12: genType
"\"GEN_PATH\" TEXT," + // 13: genPath
"\"OPTIONS\" TEXT," + // 14: options
"\"TREE_CODE\" TEXT," + // 15: treeCode
"\"TREE_PARENT_CODE\" TEXT," + // 16: treeParentCode
"\"TREE_NAME\" TEXT," + // 17: treeName
"\"PARENT_MENU_ID\" TEXT," + // 18: parentMenuId
"\"PARENT_MENU_NAME\" TEXT," + // 19: parentMenuName
"\"ROLE_ID\" TEXT);"); // 20: roleId
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"GEN_TABLE\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, GenTable entity) {
stmt.clearBindings();
String tableId = entity.getTableId();
if (tableId != null) {
stmt.bindString(1, tableId);
}
String tableName = entity.getTableName();
if (tableName != null) {
stmt.bindString(2, tableName);
}
String tableComment = entity.getTableComment();
if (tableComment != null) {
stmt.bindString(3, tableComment);
}
String subTableName = entity.getSubTableName();
if (subTableName != null) {
stmt.bindString(4, subTableName);
}
String subTableFkName = entity.getSubTableFkName();
if (subTableFkName != null) {
stmt.bindString(5, subTableFkName);
}
String className = entity.getClassName();
if (className != null) {
stmt.bindString(6, className);
}
String tplCategory = entity.getTplCategory();
if (tplCategory != null) {
stmt.bindString(7, tplCategory);
}
String packageName = entity.getPackageName();
if (packageName != null) {
stmt.bindString(8, packageName);
}
String moduleName = entity.getModuleName();
if (moduleName != null) {
stmt.bindString(9, moduleName);
}
String businessName = entity.getBusinessName();
if (businessName != null) {
stmt.bindString(10, businessName);
}
String functionName = entity.getFunctionName();
if (functionName != null) {
stmt.bindString(11, functionName);
}
String functionAuthor = entity.getFunctionAuthor();
if (functionAuthor != null) {
stmt.bindString(12, functionAuthor);
}
String genType = entity.getGenType();
if (genType != null) {
stmt.bindString(13, genType);
}
String genPath = entity.getGenPath();
if (genPath != null) {
stmt.bindString(14, genPath);
}
String options = entity.getOptions();
if (options != null) {
stmt.bindString(15, options);
}
String treeCode = entity.getTreeCode();
if (treeCode != null) {
stmt.bindString(16, treeCode);
}
String treeParentCode = entity.getTreeParentCode();
if (treeParentCode != null) {
stmt.bindString(17, treeParentCode);
}
String treeName = entity.getTreeName();
if (treeName != null) {
stmt.bindString(18, treeName);
}
String parentMenuId = entity.getParentMenuId();
if (parentMenuId != null) {
stmt.bindString(19, parentMenuId);
}
String parentMenuName = entity.getParentMenuName();
if (parentMenuName != null) {
stmt.bindString(20, parentMenuName);
}
String roleId = entity.getRoleId();
if (roleId != null) {
stmt.bindString(21, roleId);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, GenTable entity) {
stmt.clearBindings();
String tableId = entity.getTableId();
if (tableId != null) {
stmt.bindString(1, tableId);
}
String tableName = entity.getTableName();
if (tableName != null) {
stmt.bindString(2, tableName);
}
String tableComment = entity.getTableComment();
if (tableComment != null) {
stmt.bindString(3, tableComment);
}
String subTableName = entity.getSubTableName();
if (subTableName != null) {
stmt.bindString(4, subTableName);
}
String subTableFkName = entity.getSubTableFkName();
if (subTableFkName != null) {
stmt.bindString(5, subTableFkName);
}
String className = entity.getClassName();
if (className != null) {
stmt.bindString(6, className);
}
String tplCategory = entity.getTplCategory();
if (tplCategory != null) {
stmt.bindString(7, tplCategory);
}
String packageName = entity.getPackageName();
if (packageName != null) {
stmt.bindString(8, packageName);
}
String moduleName = entity.getModuleName();
if (moduleName != null) {
stmt.bindString(9, moduleName);
}
String businessName = entity.getBusinessName();
if (businessName != null) {
stmt.bindString(10, businessName);
}
String functionName = entity.getFunctionName();
if (functionName != null) {
stmt.bindString(11, functionName);
}
String functionAuthor = entity.getFunctionAuthor();
if (functionAuthor != null) {
stmt.bindString(12, functionAuthor);
}
String genType = entity.getGenType();
if (genType != null) {
stmt.bindString(13, genType);
}
String genPath = entity.getGenPath();
if (genPath != null) {
stmt.bindString(14, genPath);
}
String options = entity.getOptions();
if (options != null) {
stmt.bindString(15, options);
}
String treeCode = entity.getTreeCode();
if (treeCode != null) {
stmt.bindString(16, treeCode);
}
String treeParentCode = entity.getTreeParentCode();
if (treeParentCode != null) {
stmt.bindString(17, treeParentCode);
}
String treeName = entity.getTreeName();
if (treeName != null) {
stmt.bindString(18, treeName);
}
String parentMenuId = entity.getParentMenuId();
if (parentMenuId != null) {
stmt.bindString(19, parentMenuId);
}
String parentMenuName = entity.getParentMenuName();
if (parentMenuName != null) {
stmt.bindString(20, parentMenuName);
}
String roleId = entity.getRoleId();
if (roleId != null) {
stmt.bindString(21, roleId);
}
}
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
}
@Override
public GenTable readEntity(Cursor cursor, int offset) {
GenTable entity = new GenTable( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // tableId
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // tableName
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // tableComment
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // subTableName
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // subTableFkName
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // className
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // tplCategory
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // packageName
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // moduleName
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // businessName
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // functionName
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // functionAuthor
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // genType
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // genPath
cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // options
cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // treeCode
cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // treeParentCode
cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // treeName
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // parentMenuId
cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // parentMenuName
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20) // roleId
);
return entity;
}
@Override
public void readEntity(Cursor cursor, GenTable entity, int offset) {
entity.setTableId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setTableName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setTableComment(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setSubTableName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setSubTableFkName(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setClassName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setTplCategory(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setPackageName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setModuleName(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setBusinessName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setFunctionName(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setFunctionAuthor(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setGenType(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setGenPath(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setOptions(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
entity.setTreeCode(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
entity.setTreeParentCode(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
entity.setTreeName(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
entity.setParentMenuId(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setParentMenuName(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
entity.setRoleId(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
}
@Override
protected final String updateKeyAfterInsert(GenTable entity, long rowId) {
return entity.getTableId();
}
@Override
public String getKey(GenTable entity) {
if(entity != null) {
return entity.getTableId();
} else {
return null;
}
}
@Override
public boolean hasKey(GenTable entity) {
return entity.getTableId() != 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.UserRoleEntity;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "USER_ROLE_ENTITY".
*/
public class UserRoleEntityDao extends AbstractDao<UserRoleEntity, Void> {
public static final String TABLENAME = "USER_ROLE_ENTITY";
/**
* Properties of entity UserRoleEntity.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property RoleId = new Property(0, String.class, "roleId", false, "ROLE_ID");
public final static Property RoleName = new Property(1, String.class, "roleName", false, "ROLE_NAME");
public final static Property RoleKey = new Property(2, String.class, "roleKey", false, "ROLE_KEY");
public final static Property RoleSort = new Property(3, String.class, "roleSort", false, "ROLE_SORT");
public final static Property DataScope = new Property(4, String.class, "dataScope", false, "DATA_SCOPE");
public final static Property Status = new Property(5, String.class, "status", false, "STATUS");
public final static Property DelFlag = new Property(6, String.class, "delFlag", false, "DEL_FLAG");
public final static Property Flag = new Property(7, boolean.class, "flag", false, "FLAG");
}
public UserRoleEntityDao(DaoConfig config) {
super(config);
}
public UserRoleEntityDao(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 + "\"USER_ROLE_ENTITY\" (" + //
"\"ROLE_ID\" TEXT," + // 0: roleId
"\"ROLE_NAME\" TEXT," + // 1: roleName
"\"ROLE_KEY\" TEXT," + // 2: roleKey
"\"ROLE_SORT\" TEXT," + // 3: roleSort
"\"DATA_SCOPE\" TEXT," + // 4: dataScope
"\"STATUS\" TEXT," + // 5: status
"\"DEL_FLAG\" TEXT," + // 6: delFlag
"\"FLAG\" INTEGER NOT NULL );"); // 7: flag
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"USER_ROLE_ENTITY\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, UserRoleEntity entity) {
stmt.clearBindings();
String roleId = entity.getRoleId();
if (roleId != null) {
stmt.bindString(1, roleId);
}
String roleName = entity.getRoleName();
if (roleName != null) {
stmt.bindString(2, roleName);
}
String roleKey = entity.getRoleKey();
if (roleKey != null) {
stmt.bindString(3, roleKey);
}
String roleSort = entity.getRoleSort();
if (roleSort != null) {
stmt.bindString(4, roleSort);
}
String dataScope = entity.getDataScope();
if (dataScope != null) {
stmt.bindString(5, dataScope);
}
String status = entity.getStatus();
if (status != null) {
stmt.bindString(6, status);
}
String delFlag = entity.getDelFlag();
if (delFlag != null) {
stmt.bindString(7, delFlag);
}
stmt.bindLong(8, entity.getFlag() ? 1L: 0L);
}
@Override
protected final void bindValues(SQLiteStatement stmt, UserRoleEntity entity) {
stmt.clearBindings();
String roleId = entity.getRoleId();
if (roleId != null) {
stmt.bindString(1, roleId);
}
String roleName = entity.getRoleName();
if (roleName != null) {
stmt.bindString(2, roleName);
}
String roleKey = entity.getRoleKey();
if (roleKey != null) {
stmt.bindString(3, roleKey);
}
String roleSort = entity.getRoleSort();
if (roleSort != null) {
stmt.bindString(4, roleSort);
}
String dataScope = entity.getDataScope();
if (dataScope != null) {
stmt.bindString(5, dataScope);
}
String status = entity.getStatus();
if (status != null) {
stmt.bindString(6, status);
}
String delFlag = entity.getDelFlag();
if (delFlag != null) {
stmt.bindString(7, delFlag);
}
stmt.bindLong(8, entity.getFlag() ? 1L: 0L);
}
@Override
public Void readKey(Cursor cursor, int offset) {
return null;
}
@Override
public UserRoleEntity readEntity(Cursor cursor, int offset) {
UserRoleEntity entity = new UserRoleEntity( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // roleId
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // roleName
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // roleKey
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // roleSort
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // dataScope
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // status
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // delFlag
cursor.getShort(offset + 7) != 0 // flag
);
return entity;
}
@Override
public void readEntity(Cursor cursor, UserRoleEntity entity, int offset) {
entity.setRoleId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setRoleName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setRoleKey(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setRoleSort(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setDataScope(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setStatus(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setDelFlag(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setFlag(cursor.getShort(offset + 7) != 0);
}
@Override
protected final Void updateKeyAfterInsert(UserRoleEntity entity, long rowId) {
// Unsupported or missing PK type
return null;
}
@Override
public Void getKey(UserRoleEntity entity) {
return null;
}
@Override
public boolean hasKey(UserRoleEntity entity) {
// TODO
return false;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.phlx.anchorcollect.entity;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.databinding.BaseObservable;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;
/**
* 免疫记录字对象 zxgl_immunebatch_detail
*
* @author phlx
* @date 2022-03-01
*/
@Entity
public class ImmuneBatchDetailEntity extends BaseObservable implements Parcelable {
/**
* unid
*/
@Id(autoincrement = false)
private String unid;
/**
* 基础信息unid
*/
private String cattleresumeUnid;
/**
* 免疫记录unid
*/
private String immunebatchUnid;
/**
* 部门id
*/
private String deptId;
/** 是否上传 0未上传,1已上传 */
private String uploadStatus;
public ImmuneBatchDetailEntity() {
}
protected ImmuneBatchDetailEntity(Parcel in) {
unid = in.readString();
cattleresumeUnid = in.readString();
immunebatchUnid = in.readString();
deptId = in.readString();
uploadStatus = in.readString();
}
@Generated(hash = 1625164961)
public ImmuneBatchDetailEntity(String unid, String cattleresumeUnid, String immunebatchUnid, String deptId,
String uploadStatus) {
this.unid = unid;
this.cattleresumeUnid = cattleresumeUnid;
this.immunebatchUnid = immunebatchUnid;
this.deptId = deptId;
this.uploadStatus = uploadStatus;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(unid);
dest.writeString(cattleresumeUnid);
dest.writeString(immunebatchUnid);
dest.writeString(deptId);
dest.writeString(uploadStatus);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<ImmuneBatchDetailEntity> CREATOR = new Creator<ImmuneBatchDetailEntity>() {
@Override
public ImmuneBatchDetailEntity createFromParcel(Parcel in) {
return new ImmuneBatchDetailEntity(in);
}
@Override
public ImmuneBatchDetailEntity[] newArray(int size) {
return new ImmuneBatchDetailEntity[size];
}
};
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
public String getCattleresumeUnid() {
return cattleresumeUnid;
}
public void setCattleresumeUnid(String cattleresumeUnid) {
this.cattleresumeUnid = cattleresumeUnid;
}
public String getImmunebatchUnid() {
return immunebatchUnid;
}
public void setImmunebatchUnid(String immunebatchUnid) {
this.immunebatchUnid = immunebatchUnid;
}
public String getDeptId() {
return deptId;
}
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public String getUploadStatus() {
return uploadStatus;
}
public void setUploadStatus(String uploadStatus) {
this.uploadStatus = uploadStatus;
}
@Override
public String toString() {
return "ImmuneBatchDetailEntity{" +
"unid='" + unid + '\'' +
", cattleresumeUnid='" + cattleresumeUnid + '\'' +
", immunebatchUnid='" + immunebatchUnid + '\'' +
", deptId='" + deptId + '\'' +
", uploadStatus='" + uploadStatus + '\'' +
'}';
}
}
...@@ -109,7 +109,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin ...@@ -109,7 +109,7 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
binding.tvWeighAdg.setTypeface(Configs.typeface); binding.tvWeighAdg.setTypeface(Configs.typeface);
binding.tvWeighBwg.setTypeface(Configs.typeface); binding.tvWeighBwg.setTypeface(Configs.typeface);
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(10)); binding.rvCollect.addItemDecoration(new SpaceItemDecoration(16));
initTimePicker(); initTimePicker();
} }
......
...@@ -24,6 +24,7 @@ import com.bigkoo.pickerview.builder.TimePickerBuilder; ...@@ -24,6 +24,7 @@ import com.bigkoo.pickerview.builder.TimePickerBuilder;
import com.bigkoo.pickerview.listener.OnTimeSelectChangeListener; import com.bigkoo.pickerview.listener.OnTimeSelectChangeListener;
import com.bigkoo.pickerview.listener.OnTimeSelectListener; import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.bigkoo.pickerview.view.TimePickerView; import com.bigkoo.pickerview.view.TimePickerView;
import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.R; import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.VMFactory; import com.phlx.anchorcollect.data.VMFactory;
import com.phlx.anchorcollect.databinding.FragmentPerformanceBinding; import com.phlx.anchorcollect.databinding.FragmentPerformanceBinding;
...@@ -43,6 +44,7 @@ import java.util.List; ...@@ -43,6 +44,7 @@ import java.util.List;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
import me.goldze.mvvmhabit.base.BaseFragment; import me.goldze.mvvmhabit.base.BaseFragment;
import me.goldze.mvvmhabit.utils.StringUtils;
import me.goldze.mvvmhabit.utils.ToastUtils; import me.goldze.mvvmhabit.utils.ToastUtils;
import me.tatarka.bindingcollectionadapter2.BR; import me.tatarka.bindingcollectionadapter2.BR;
...@@ -328,4 +330,22 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding ...@@ -328,4 +330,22 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
} }
} }
} }
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (this != null && !hidden) {
viewModel.clearParamList();
//说明是列表跳转的
if(!StringUtils.isEmpty(Configs.resumeId)){
viewModel.queryPerformance();
}else{
//清除一下数据
binding.rvCollect.getAdapter().notifyDataSetChanged();
}
}
}
} }
...@@ -16,18 +16,15 @@ import com.phlx.anchorcollect.Configs; ...@@ -16,18 +16,15 @@ import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.R; import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.Repository; import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil; import com.phlx.anchorcollect.db.DbUtil;
import com.phlx.anchorcollect.db.gen.CardEntityDao;
import com.phlx.anchorcollect.db.gen.CattleResumeEntityDao; import com.phlx.anchorcollect.db.gen.CattleResumeEntityDao;
import com.phlx.anchorcollect.db.gen.DictEntityDao; import com.phlx.anchorcollect.db.gen.DictEntityDao;
import com.phlx.anchorcollect.db.interf.DbQueryCallBack; import com.phlx.anchorcollect.db.interf.DbQueryCallBack;
import com.phlx.anchorcollect.entity.CardEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity; import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.DictEntity; import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenTableColumn; import com.phlx.anchorcollect.entity.GenTableColumn;
import com.phlx.anchorcollect.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect.ui.fragment.list.CollectGridItem;
import com.phlx.anchorcollect.ui.setting.SettingActivity; import com.phlx.anchorcollect.ui.setting.SettingActivity;
import com.phlx.anchorcollect.util.EntityUtils; import com.phlx.anchorcollect.util.EntityUtils;
import com.phlx.anchorcollect.util.StringUtil;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
......
...@@ -16,12 +16,20 @@ import com.phlx.anchorcollect.Configs; ...@@ -16,12 +16,20 @@ import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.R; import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.Repository; import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil; import com.phlx.anchorcollect.db.DbUtil;
import com.phlx.anchorcollect.db.gen.BreedingRecordDetailEntityDao;
import com.phlx.anchorcollect.db.gen.DictEntityDao;
import com.phlx.anchorcollect.db.gen.PerformanceEntityDao;
import com.phlx.anchorcollect.db.interf.DbIDUCallBack; 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.DictEntity;
import com.phlx.anchorcollect.entity.GenTableColumn; import com.phlx.anchorcollect.entity.GenTableColumn;
import com.phlx.anchorcollect.entity.PerformanceEntity; import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect.ui.fragment.list.CollectGridItem;
import com.phlx.anchorcollect.util.EntityUtils; import com.phlx.anchorcollect.util.EntityUtils;
import org.greenrobot.greendao.query.QueryBuilder;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -96,18 +104,74 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -96,18 +104,74 @@ public class PerformanceVM extends BaseViewModel<Repository> {
remarkParamEntity.setHtmlType("input"); remarkParamEntity.setHtmlType("input");
remarkParamEntity.setJavaType("String"); remarkParamEntity.setJavaType("String");
}
uuid = IdUtil.createSnowflake(3, 1).nextId(); private void initData(PerformanceEntity performanceEntity) {
//清除选中unid
Configs.resumeId = "";
String[] filedName = EntityUtils.getFiledName(performanceEntity);
for (String name : filedName) {
for (GenTableColumn gtc : Configs.performance) {
if (name.equals(gtc.getJavaField())) {
try {
Object fieldValueByName = EntityUtils.getFieldValueByName(name, performanceEntity);
String value = fieldValueByName == null ? "" : fieldValueByName.toString();
// Log.e("fieldValue:", "key:" + name + " | value:" + value);
gtc.setContent(value);
String showName = value;
// 如果是选择的,查字典项
if (!StringUtils.isEmpty(gtc.getDictType())) {
QueryBuilder<DictEntity> builder =
DbUtil.getInstance().getQueryBuilder(DictEntity.class)
.where(DictEntityDao.Properties.DictType.eq(gtc.getDictType())
, DictEntityDao.Properties.DictValue.eq(value));
List<DictEntity> dictEntities = DbUtil.getInstance().queryAll(DictEntity.class, builder);
if (dictEntities != null && dictEntities.size() > 0) {
showName = dictEntities.get(0).getDictLabel();
} }
}
gtc.setShowName(showName);
public void initData(String tag) { } catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
uuid = IdUtil.createSnowflake(3, 1).nextId(); onNotifyAllEvent.setValue(false);
}
}
public void queryPerformance() {
QueryBuilder<PerformanceEntity> builder =
DbUtil.getInstance().getQueryBuilder(PerformanceEntity.class)
.where(PerformanceEntityDao.Properties.Unid.eq(Configs.resumeId));
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<PerformanceEntity>() {
@Override
public void onSuccess(List<PerformanceEntity> result) {
queryPerformance(tag); if (result != null && result.size() > 0) {
initData(result.get(0));
}
} }
@Override
public void onFailed() {
//清除选中unid
Configs.resumeId = "";
onNotifyAllEvent.setValue(true);
ToastUtils.showShort("性能测定-数据库查询失败");
}
}).queryAsyncAll(PerformanceEntity.class, builder);
}
public void onItemClick(GenTableColumn entity) { public void onItemClick(GenTableColumn entity) {
...@@ -140,9 +204,6 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -140,9 +204,6 @@ public class PerformanceVM extends BaseViewModel<Repository> {
onCardClickEvent.call(); onCardClickEvent.call();
} }
private void queryPerformance(String tag) {
}
public BindingCommand onSaveClick = new BindingCommand(new BindingAction() { public BindingCommand onSaveClick = new BindingCommand(new BindingAction() {
@Override @Override
...@@ -160,13 +221,20 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -160,13 +221,20 @@ public class PerformanceVM extends BaseViewModel<Repository> {
Gson gson = new Gson(); Gson gson = new Gson();
PerformanceEntity performanceEntity = gson.fromJson(jsonObject, PerformanceEntity.class); PerformanceEntity performanceEntity = gson.fromJson(jsonObject, PerformanceEntity.class);
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (uuid == 0) {//新增
uuid = IdUtil.createSnowflake(3, 1).nextId();
performanceEntity.setUnid(uuid + ""); performanceEntity.setUnid(uuid + "");
performanceEntity.setUploadStatus("0");
performanceEntity.setDeptId(SPUtils.getInstance().getString(Configs.SP_DEPT_ID)); performanceEntity.setDeptId(SPUtils.getInstance().getString(Configs.SP_DEPT_ID));
performanceEntity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME)); performanceEntity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
performanceEntity.setCreateTime(dateFormat.format(new Date())); performanceEntity.setCreateTime(dateFormat.format(new Date()));
}else{
performanceEntity.setUpdateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
performanceEntity.setUpdateTime(dateFormat.format(new Date()));
}
performanceEntity.setUploadStatus("0");
uploadData = new ArrayList<>(); uploadData = new ArrayList<>();
uploadData.add(performanceEntity); uploadData.add(performanceEntity);
...@@ -195,7 +263,7 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -195,7 +263,7 @@ public class PerformanceVM extends BaseViewModel<Repository> {
remarkParamEntity.setShowName(""); remarkParamEntity.setShowName("");
currentParamEntity = new GenTableColumn(); currentParamEntity = new GenTableColumn();
uuid = IdUtil.createSnowflake(3, 1).nextId(); uuid = IdUtil.createSnowflake(3, 1).nextId();
for (GenTableColumn gtc : Configs.cattleresume) { for (GenTableColumn gtc : Configs.performance) {
gtc.setShowName(""); gtc.setShowName("");
gtc.setContent(""); gtc.setContent("");
} }
......
package com.phlx.anchorcollect.ui.info; package com.phlx.anchorcollect.ui.info;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders; import androidx.lifecycle.ViewModelProviders;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.lingber.mycontrol.datagridview.DataGridView;
import com.lingber.mycontrol.datagridview.RecyclerviewAdapter;
import com.phlx.anchorcollect.BR; import com.phlx.anchorcollect.BR;
import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.R; import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.VMFactory; import com.phlx.anchorcollect.data.VMFactory;
import com.phlx.anchorcollect.databinding.AvtivityCattleBinding; import com.phlx.anchorcollect.databinding.AvtivityCattleBinding;
import com.phlx.anchorcollect.entity.BreedingRecordDetailEntity;
import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.GenTableColumn;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.ui.base.BaseActivity; import com.phlx.anchorcollect.ui.base.BaseActivity;
import com.phlx.anchorcollect.ui.main.MainActivity;
import com.phlx.anchorcollect.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class CattleActivity extends BaseActivity<AvtivityCattleBinding,CattleVM> {
public class CattleActivity extends BaseActivity<AvtivityCattleBinding, CattleVM> {
private String tag; private String tag;
private DataGridView refreshDataGridView;
@Override @Override
public int initContentView(Bundle savedInstanceState) { public int initContentView(Bundle savedInstanceState) {
...@@ -48,5 +70,326 @@ public class CattleActivity extends BaseActivity<AvtivityCattleBinding,CattleVM> ...@@ -48,5 +70,326 @@ public class CattleActivity extends BaseActivity<AvtivityCattleBinding,CattleVM>
//初始化标题 //初始化标题
viewModel.initToolbar(); viewModel.initToolbar();
viewModel.setTag(tag); viewModel.setTag(tag);
initSignMeasureGrid();
}
@Override
public void initViewObservable() {
super.initViewObservable();
viewModel.observableRefreshList.observe(this, new Observer<Integer>() {
@Override
public void onChanged(Integer integer) {
updateRecordData(integer);
}
});
}
//性能测定
private void initSignMeasureGrid() {
DataGridView mDataGridView = binding.dgvSignMeasure;
//初始化表头
List<String> headerStr = new ArrayList<>();
List<String> fieldNameStr = new ArrayList<>();
for (GenTableColumn gtc : Configs.performance) {
if ("1".equals(gtc.getIsList())) {
headerStr.add(gtc.getColumnComment());
fieldNameStr.add(gtc.getJavaField());
}
}
// // 设置列数
mDataGridView.setColunms(headerStr.size());
// // 设置表头内容
// mDataGridView.setHeaderHeight(30);
mDataGridView.setHeaderContent(StringUtil.listToStr(headerStr));
// // 绑定字段
mDataGridView.setFieldNames(StringUtil.listToStr(fieldNameStr));
// // 每个column占比
mDataGridView.setColunmWeight(StringUtil.getFloats(headerStr.size()));
// // 每个单元格包含控件
mDataGridView.setCellContentView(StringUtil.getClasses(headerStr.size()));
// 单行选中模式
mDataGridView.setSelectedMode(1);
// 设置列数
// mDataGridView.setColunms(3);
// 设置行高
mDataGridView.setRowHeight(100);
// 启用翻页
// mDataGridView.setFlipOverEnable(true, 9, getFragmentManager());
// 初始化表格
mDataGridView.initDataGridView();
mDataGridView.setOnItemCellClickListener(new RecyclerviewAdapter.OnItemCellClickListener() {
@Override
public void onClick(View v, int row, int column) {
// ToastUtils.showShort("row:" + row + " column:" + column);
PerformanceEntity rowData = (PerformanceEntity) (mDataGridView.getRowData(row));
new MaterialDialog
.Builder(CattleActivity.this)
.title("替换提示")
.content("要跳转性能测定详情吗?")
.positiveText("确定")
.negativeText("取消")
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if (which == DialogAction.POSITIVE) {
Configs.mainPosition = 1;
Configs.resumeId = rowData.getUnid();
startActivity(MainActivity.class);
finish();
}
}
}).show();
}
});
viewModel.querySignMeasureList();
}
//诊疗记录
private void initTreatmentRecordGrid() {
DataGridView mDataGridView = binding.dgvTreatmentRecord;
//初始化表头
List<String> headerStr = new ArrayList<>();
List<String> fieldNameStr = new ArrayList<>();
for (GenTableColumn gtc : Configs.medicalrecords) {
if ("1".equals(gtc.getIsList())) {
headerStr.add(gtc.getColumnComment());
fieldNameStr.add(gtc.getJavaField());
}
}
// // 设置列数
mDataGridView.setColunms(headerStr.size());
// // 设置表头内容
// mDataGridView.setHeaderHeight(30);
mDataGridView.setHeaderContent(StringUtil.listToStr(headerStr));
// // 绑定字段
mDataGridView.setFieldNames(StringUtil.listToStr(fieldNameStr));
// // 每个column占比
mDataGridView.setColunmWeight(StringUtil.getFloats(headerStr.size()));
// // 每个单元格包含控件
mDataGridView.setCellContentView(StringUtil.getClasses(headerStr.size()));
// 单行选中模式
mDataGridView.setSelectedMode(1);
// 设置列数
// mDataGridView.setColunms(3);
// 设置行高
mDataGridView.setRowHeight(100);
// 启用翻页
// mDataGridView.setFlipOverEnable(true, 9, getFragmentManager());
// 初始化表格
mDataGridView.initDataGridView();
mDataGridView.setOnItemCellClickListener(new RecyclerviewAdapter.OnItemCellClickListener() {
@Override
public void onClick(View v, int row, int column) {
// ToastUtils.showShort("row:" + row + " column:" + column);
MedicalRecordEntity rowData = (MedicalRecordEntity) (mDataGridView.getRowData(row));
new MaterialDialog
.Builder(CattleActivity.this)
.title("替换提示")
.content("要跳转诊疗记录详情吗?")
.positiveText("确定")
.negativeText("取消")
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if (which == DialogAction.POSITIVE) {
//TODO 跳转详情页
}
}
}).show();
} }
});
viewModel.queryTreatmentRecordList();
}
//免疫记录
private void initImmunRecordGrid() {
DataGridView mDataGridView = binding.dgvImmunRecord;
//初始化表头
List<String> headerStr = new ArrayList<>();
List<String> fieldNameStr = new ArrayList<>();
for (GenTableColumn gtc : Configs.immunebatch) {
if ("1".equals(gtc.getIsList())) {
headerStr.add(gtc.getColumnComment());
fieldNameStr.add(gtc.getJavaField());
}
}
// // 设置列数
mDataGridView.setColunms(headerStr.size());
// // 设置表头内容
// mDataGridView.setHeaderHeight(30);
mDataGridView.setHeaderContent(StringUtil.listToStr(headerStr));
// // 绑定字段
mDataGridView.setFieldNames(StringUtil.listToStr(fieldNameStr));
// // 每个column占比
mDataGridView.setColunmWeight(StringUtil.getFloats(headerStr.size()));
// // 每个单元格包含控件
mDataGridView.setCellContentView(StringUtil.getClasses(headerStr.size()));
// 单行选中模式
mDataGridView.setSelectedMode(1);
// 设置列数
// mDataGridView.setColunms(3);
// 设置行高
mDataGridView.setRowHeight(100);
// 启用翻页
// mDataGridView.setFlipOverEnable(true, 9, getFragmentManager());
// 初始化表格
mDataGridView.initDataGridView();
mDataGridView.setOnItemCellClickListener(new RecyclerviewAdapter.OnItemCellClickListener() {
@Override
public void onClick(View v, int row, int column) {
// ToastUtils.showShort("row:" + row + " column:" + column);
ImmuneBatchEntity rowData = (ImmuneBatchEntity) (mDataGridView.getRowData(row));
new MaterialDialog
.Builder(CattleActivity.this)
.title("替换提示")
.content("要跳转免疫记录详情吗?")
.positiveText("确定")
.negativeText("取消")
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if (which == DialogAction.POSITIVE) {
//TODO 跳转详情页
}
}
}).show();
}
});
viewModel.queryImmunRecordList();
}
//配种记录
private void initBreedingRecordGrid() {
DataGridView mDataGridView = binding.dgvBreedingRecord;
//初始化表头
List<String> headerStr = new ArrayList<>();
List<String> fieldNameStr = new ArrayList<>();
for (GenTableColumn gtc : Configs.cattlematingMaster) {
if ("1".equals(gtc.getIsList())) {
headerStr.add(gtc.getColumnComment());
fieldNameStr.add(gtc.getJavaField());
}
}
// // 设置列数
mDataGridView.setColunms(headerStr.size());
// // 设置表头内容
// mDataGridView.setHeaderHeight(30);
mDataGridView.setHeaderContent(StringUtil.listToStr(headerStr));
// // 绑定字段
mDataGridView.setFieldNames(StringUtil.listToStr(fieldNameStr));
// // 每个column占比
mDataGridView.setColunmWeight(StringUtil.getFloats(headerStr.size()));
// // 每个单元格包含控件
mDataGridView.setCellContentView(StringUtil.getClasses(headerStr.size()));
// 单行选中模式
mDataGridView.setSelectedMode(0);
// 设置列数
// mDataGridView.setColunms(3);
// 设置行高
mDataGridView.setRowHeight(100);
// 启用翻页
// mDataGridView.setFlipOverEnable(true, 9, getFragmentManager());
// 初始化表格
mDataGridView.initDataGridView();
// mDataGridView.setOnItemCellClickListener(new RecyclerviewAdapter.OnItemCellClickListener() {
// @Override
// public void onClick(View v, int row, int column) {
//// ToastUtils.showShort("row:" + row + " column:" + column);
// BreedingRecordEntity rowData = (BreedingRecordEntity) (mDataGridView.getRowData(row));
//
// new MaterialDialog
// .Builder(CattleActivity.this)
// .title("替换提示")
// .content("要跳转配种数据详情吗?")
// .positiveText("确定")
// .negativeText("取消")
// .onPositive(new MaterialDialog.SingleButtonCallback() {
// @Override
// public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
// if (which == DialogAction.POSITIVE) {
//
// }
// }
// }).show();
// }
// });
viewModel.queryBreedingRecordList();
}
//刷新数据
private void updateRecordData(int type) {
List<BreedingRecordDetailEntity> dataSource = new ArrayList<>();
int refreshType = 0;
switch (type) {
case 0:
refreshDataGridView = binding.dgvSignMeasure;
refreshDataGridView.setDataSource(viewModel.getPerformanceEntityList());
initTreatmentRecordGrid();
break;
case 1:
refreshDataGridView = binding.dgvTreatmentRecord;
refreshDataGridView.setDataSource(viewModel.getMedicalRecordEntityList());
initImmunRecordGrid();
break;
case 2:
refreshDataGridView = binding.dgvImmunRecord;
refreshDataGridView.setDataSource(viewModel.getImmuneBatchEntityList());
initBreedingRecordGrid();
break;
case 3:
refreshDataGridView = binding.dgvBreedingRecord;
refreshDataGridView.setDataSource(viewModel.getBreedingRecordEntityList());
break;
}
refreshDataGridView.updateAll();
}
} }
...@@ -4,38 +4,48 @@ import android.app.Application; ...@@ -4,38 +4,48 @@ import android.app.Application;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableList;
import com.phlx.anchorcollect.BR; import com.phlx.anchorcollect.BR;
import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.R; import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.Repository; import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil; import com.phlx.anchorcollect.db.DbUtil;
import com.phlx.anchorcollect.db.gen.BreedingRecordEntityDao;
import com.phlx.anchorcollect.db.gen.ImmuneBatchDetailEntityDao;
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.interf.DbQueryCallBack; import com.phlx.anchorcollect.db.interf.DbQueryCallBack;
import com.phlx.anchorcollect.entity.CardEntity; import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity; import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.ui.base.BackBarVM; import com.phlx.anchorcollect.ui.base.BackBarVM;
import org.greenrobot.greendao.query.WhereCondition; import org.greenrobot.greendao.query.QueryBuilder;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;
import me.goldze.mvvmhabit.utils.ToastUtils; import me.goldze.mvvmhabit.utils.ToastUtils;
import me.tatarka.bindingcollectionadapter2.ItemBinding; import me.tatarka.bindingcollectionadapter2.ItemBinding;
public class CattleVM extends BackBarVM<Repository> { public class CattleVM extends BackBarVM<Repository> {
//谱系管理的list //刷新list
public ObservableList<CattleItem> observablePedigreeList = new ObservableArrayList<>();
//体征测定的list public SingleLiveEvent<Integer> observableRefreshList = new SingleLiveEvent<>();
public ObservableList<CattleItem> observableSignsList = new ObservableArrayList<>();
//健康管理的list
public ObservableList<CattleItem> observableHealthyList = new ObservableArrayList<>();
//免疫管理的list
public ObservableList<CattleItem> observableImmunityList = new ObservableArrayList<>();
private static String registrationNo; private static String registrationNo;
private List<PerformanceEntity> performanceEntityList;
private List<MedicalRecordEntity> medicalRecordEntityList;
private List<ImmuneBatchEntity> immuneBatchEntityList;
// private List<ImmuneBatchDetailEntity> immuneBatchDetailEntityList;
private List<BreedingRecordEntity> breedingRecordEntityList;
//给RecyclerView添加ItemBinding //给RecyclerView添加ItemBinding
public ItemBinding<CattleItem> itemBinding = ItemBinding.of(BR.viewModel, R.layout.item_cattle_rv); public ItemBinding<CattleItem> itemBinding = ItemBinding.of(BR.viewModel, R.layout.item_cattle_rv);
...@@ -52,119 +62,174 @@ public class CattleVM extends BackBarVM<Repository> { ...@@ -52,119 +62,174 @@ public class CattleVM extends BackBarVM<Repository> {
public void setTag(String tag) { public void setTag(String tag) {
registrationNo = tag; registrationNo = tag;
refreshCard();
} }
public void querySignMeasureList() {
QueryBuilder<PerformanceEntity> builder =
DbUtil.getInstance().getQueryBuilder(PerformanceEntity.class)
.where(PerformanceEntityDao.Properties.CattleresumeId.eq(Configs.tempUnid))
.orderDesc(PerformanceEntityDao.Properties.CreateTime);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<PerformanceEntity>() {
@Override
public void onSuccess(List<PerformanceEntity> result) {
performanceEntityList = new ArrayList<>();
if (result != null && result.size() > 0) {
performanceEntityList = result;
}
observableRefreshList.setValue(0);
}
@Override
public void onFailed() {
ToastUtils.showShort("性能测定-数据库查询失败");
}
}).queryAsyncAll(PerformanceEntity.class, builder);
}
private void refreshCard() { public void queryTreatmentRecordList() {
String sql = ("REGISTRATION_NO IN " + QueryBuilder<MedicalRecordEntity> builder =
"(SELECT REGISTRATION_NO FROM CARD_ENTITY WHERE REGISTRATION_NO =" + registrationNo + " )"); DbUtil.getInstance().getQueryBuilder(MedicalRecordEntity.class)
WhereCondition.StringCondition stringCondition = new WhereCondition.StringCondition(sql); .where(MedicalRecordEntityDao.Properties.CattleresumeId.eq(Configs.tempUnid))
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CardEntity>() { .orderDesc(MedicalRecordEntityDao.Properties.CreateTime);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalRecordEntity>() {
@Override @Override
public void onSuccess(List<CardEntity> result) { public void onSuccess(List<MedicalRecordEntity> result) {
observablePedigreeList.clear();
if (result.size() > 0) { medicalRecordEntityList = new ArrayList<>();
CardEntity cardEntity = result.get(0); if (result != null && result.size() > 0) {
observablePedigreeList.add(new CattleItem(CattleVM.this, "耳标", cardEntity.getRegistrationNo())); medicalRecordEntityList = result;
observablePedigreeList.add(new CattleItem(CattleVM.this, "出生", cardEntity.getEaseBirth()));
observablePedigreeList.add(new CattleItem(CattleVM.this, "性别", cardEntity.getSex()));
observablePedigreeList.add(new CattleItem(CattleVM.this, "品种", cardEntity.getVarieties()));
observablePedigreeList.add(new CattleItem(CattleVM.this, "生日", cardEntity.getBirthdate()));
observablePedigreeList.add(new CattleItem(CattleVM.this, "胎次", cardEntity.getChildTime()));
} }
refreshSign(); observableRefreshList.setValue(1);
} }
@Override @Override
public void onFailed() { public void onFailed() {
ToastUtils.showShort("基础档案数据库查询失败"); ToastUtils.showShort("诊疗记录-数据库查询失败");
refreshSign();
} }
}).queryAsync(CardEntity.class, stringCondition); }).queryAsyncAll(MedicalRecordEntity.class, builder);
} }
public void queryImmunRecordList() {
private void refreshSign() { QueryBuilder<ImmuneBatchDetailEntity> detailBuilder =
String sql = ("REGISTRATION_NO IN " + DbUtil.getInstance().getQueryBuilder(ImmuneBatchDetailEntity.class)
"(SELECT REGISTRATION_NO FROM PERFORMANCE_ENTITY WHERE REGISTRATION_NO =" + registrationNo + " )"); .where(ImmuneBatchDetailEntityDao.Properties.CattleresumeUnid.eq(Configs.tempUnid));
WhereCondition.StringCondition stringCondition = new WhereCondition.StringCondition(sql); DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneBatchDetailEntity>() {
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<PerformanceEntity>() {
@Override @Override
public void onSuccess(List<PerformanceEntity> result) { public void onSuccess(List<ImmuneBatchDetailEntity> result) {
observableSignsList.clear();
if (result.size() > 0) { if (result != null && result.size() > 0) {
PerformanceEntity performanceEntity = result.get(0);
observableSignsList.add(new CattleItem(CattleVM.this, "日期", performanceEntity.getMeasureDate())); List<String> immuneIds = new ArrayList<>();
observableSignsList.add(new CattleItem(CattleVM.this, "年龄", performanceEntity.getAge())); for (ImmuneBatchDetailEntity ibde : result) {
observableSignsList.add(new CattleItem(CattleVM.this, "体高", performanceEntity.getHeight())); immuneIds.add(ibde.getImmunebatchUnid());
observableSignsList.add(new CattleItem(CattleVM.this, "体长", performanceEntity.getLength())); }
observableSignsList.add(new CattleItem(CattleVM.this, "胸围", performanceEntity.getChestDeep()));
observableSignsList.add(new CattleItem(CattleVM.this, "体重", performanceEntity.getWeight())); if (immuneIds.size() > 0) {
QueryBuilder<ImmuneBatchEntity> builder =
DbUtil.getInstance().getQueryBuilder(ImmuneBatchEntity.class)
.where(ImmuneBatchEntityDao.Properties.Unid.in(immuneIds))
.orderDesc(ImmuneBatchEntityDao.Properties.CreateTime);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneBatchEntity>() {
@Override
public void onSuccess(List<ImmuneBatchEntity> result) {
immuneBatchEntityList = new ArrayList<>();
if (result != null && result.size() > 0) {
immuneBatchEntityList = result;
}
observableRefreshList.setValue(2);
}
@Override
public void onFailed() {
ToastUtils.showShort("免疫记录-数据库查询失败");
}
}).queryAsyncAll(ImmuneBatchEntity.class, builder);
}
} }
refreshHealth();
} }
@Override @Override
public void onFailed() { public void onFailed() {
ToastUtils.showShort("体征测定数据库查询失败"); ToastUtils.showShort("免疫记录-子表-数据库查询失败");
refreshHealth();
} }
}).queryAsync(PerformanceEntity.class, stringCondition); }).queryAsyncAll(ImmuneBatchDetailEntity.class, detailBuilder);
} }
private void refreshHealth() { public void queryBreedingRecordList() {
QueryBuilder<BreedingRecordEntity> builder =
DbUtil.getInstance().getQueryBuilder(BreedingRecordEntity.class)
.where(BreedingRecordEntityDao.Properties.CattleresumeId.eq(Configs.tempUnid))
.orderDesc(BreedingRecordEntityDao.Properties.CreateTime);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<BreedingRecordEntity>() {
@Override
public void onSuccess(List<BreedingRecordEntity> result) {
breedingRecordEntityList = new ArrayList<>();
if (result != null && result.size() > 0) {
breedingRecordEntityList = result;
}
observableRefreshList.setValue(3);
}
@Override
public void onFailed() {
ToastUtils.showShort("配种记录主表-数据库查询失败");
}
}).queryAsyncAll(BreedingRecordEntity.class, builder);
}
public List<PerformanceEntity> getPerformanceEntityList() {
return performanceEntityList;
}
public List<MedicalRecordEntity> getMedicalRecordEntityList() {
return medicalRecordEntityList;
}
public List<ImmuneBatchEntity> getImmuneBatchEntityList() {
return immuneBatchEntityList;
}
public List<BreedingRecordEntity> getBreedingRecordEntityList() {
return breedingRecordEntityList;
}
// private void refreshCard() {
//
// String sql = ("REGISTRATION_NO IN " + // String sql = ("REGISTRATION_NO IN " +
// "(SELECT REGISTRATION_NO FROM MEDICAL_ENTITY WHERE REGISTRATION_NO =" + registrationNo + " )"); // "(SELECT REGISTRATION_NO FROM CARD_ENTITY WHERE REGISTRATION_NO =" + registrationNo + " )");
// WhereCondition.StringCondition stringCondition = new WhereCondition.StringCondition(sql); // WhereCondition.StringCondition stringCondition = new WhereCondition.StringCondition(sql);
// DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<MedicalEntity>() { // DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CardEntity>() {
// @Override // @Override
// public void onSuccess(List<MedicalEntity> result) { // public void onSuccess(List<CardEntity> result) {
// observableHealthyList.clear(); // observablePedigreeList.clear();
// if (result.size() > 0) { // if (result.size() > 0) {
// MedicalEntity medicalEntity = result.get(0); // CardEntity cardEntity = result.get(0);
// observableHealthyList.add(new CattleItem(CattleVM.this, "日期", medicalEntity.getTreatDate())); // observablePedigreeList.add(new CattleItem(CattleVM.this, "耳标", cardEntity.getRegistrationNo()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "病因", medicalEntity.getCauseOf())); // observablePedigreeList.add(new CattleItem(CattleVM.this, "出生", cardEntity.getEaseBirth()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "用药", medicalEntity.getDrugName())); // observablePedigreeList.add(new CattleItem(CattleVM.this, "性别", cardEntity.getSex()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "方法", medicalEntity.getDrugMethods())); // observablePedigreeList.add(new CattleItem(CattleVM.this, "品种", cardEntity.getVarieties()));
// observableHealthyList.add(new CattleItem(CattleVM.this, "兽医", medicalEntity.getTreatPersonnel())); // observablePedigreeList.add(new CattleItem(CattleVM.this, "生日", cardEntity.getBirthdate()));
// observablePedigreeList.add(new CattleItem(CattleVM.this, "胎次", cardEntity.getChildTime()));
// } // }
// refreshImmunity(); // refreshSign();
// } // }
// //
// @Override // @Override
// public void onFailed() { // public void onFailed() {
// ToastUtils.showShort("健康管理数据库查询失败"); // ToastUtils.showShort("基础档案数据库查询失败");
// refreshImmunity(); // refreshSign();
// } // }
// }).queryAsync(MedicalEntity.class, stringCondition); // }).queryAsync(CardEntity.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);
}
} }
...@@ -20,7 +20,6 @@ import com.phlx.anchorcollect.entity.LoginData; ...@@ -20,7 +20,6 @@ import com.phlx.anchorcollect.entity.LoginData;
import com.phlx.anchorcollect.entity.UserRoleEntity; import com.phlx.anchorcollect.entity.UserRoleEntity;
import com.phlx.anchorcollect.net.NetworkUtils; import com.phlx.anchorcollect.net.NetworkUtils;
import com.phlx.anchorcollect.params.CollectResponse; import com.phlx.anchorcollect.params.CollectResponse;
import com.phlx.anchorcollect.ui.home.HomeActivity;
import com.phlx.anchorcollect.ui.main.MainActivity; import com.phlx.anchorcollect.ui.main.MainActivity;
import com.phlx.anchorcollect.ui.splash.SplashActivity; import com.phlx.anchorcollect.ui.splash.SplashActivity;
import com.phlx.anchorcollect.util.StringUtil; import com.phlx.anchorcollect.util.StringUtil;
...@@ -28,8 +27,6 @@ import com.phlx.anchorcollect.util.TextUtil; ...@@ -28,8 +27,6 @@ import com.phlx.anchorcollect.util.TextUtil;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
......
...@@ -33,7 +33,6 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> { ...@@ -33,7 +33,6 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
private PerformanceFragment _performanceFragment; private PerformanceFragment _performanceFragment;
private BreedingRecordFragment _breedingRecordFragment; private BreedingRecordFragment _breedingRecordFragment;
@Override @Override
public int initContentView(Bundle savedInstanceState) { public int initContentView(Bundle savedInstanceState) {
return R.layout.activity_main; return R.layout.activity_main;
...@@ -47,12 +46,20 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> { ...@@ -47,12 +46,20 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
@Override @Override
public void initParam() { public void initParam() {
super.initParam(); super.initParam();
Bundle mBundle = getIntent().getExtras(); Bundle mBundle = getIntent().getExtras();
if (mBundle != null) { if (mBundle != null) {
collectType = mBundle.getString("COLLECT_TYPT"); collectType = mBundle.getString("COLLECT_TYPT");
} }
} }
@Override
protected void onResume() {
super.onResume();
labelSwitching(Configs.mainPosition);
}
@Override @Override
public MainVM initViewModel() { public MainVM initViewModel() {
VMFactory factory = VMFactory.getInstance(getApplication()); VMFactory factory = VMFactory.getInstance(getApplication());
...@@ -79,6 +86,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> { ...@@ -79,6 +86,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
@Override @Override
public void onChanged(Integer integer) { public void onChanged(Integer integer) {
labelSwitching(integer); labelSwitching(integer);
Configs.mainPosition = integer;
} }
}); });
} }
...@@ -94,7 +103,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> { ...@@ -94,7 +103,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
transaction.add(R.id.frameLayout, _performanceFragment); transaction.add(R.id.frameLayout, _performanceFragment);
transaction.add(R.id.frameLayout, _breedingRecordFragment); transaction.add(R.id.frameLayout, _breedingRecordFragment);
transaction.commit(); transaction.commit();
labelSwitching(0); labelSwitching(Configs.mainPosition);
} }
public void labelSwitching(int position) { public void labelSwitching(int position) {
...@@ -112,6 +121,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> { ...@@ -112,6 +121,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
binding.tvTab0.setTextColor(getResources().getColor(R.color.colorPrimary)); binding.tvTab0.setTextColor(getResources().getColor(R.color.colorPrimary));
break; break;
case 1: case 1:
Bundle args = new Bundle();
args.putString("id", "-1");
transaction.show(_performanceFragment); transaction.show(_performanceFragment);
binding.tvTab1.setTextColor(getResources().getColor(R.color.colorPrimary)); binding.tvTab1.setTextColor(getResources().getColor(R.color.colorPrimary));
break; break;
......
...@@ -8,25 +8,12 @@ import androidx.annotation.NonNull; ...@@ -8,25 +8,12 @@ import androidx.annotation.NonNull;
import com.phlx.anchorcollect.Configs; import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.data.Repository; import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil; import com.phlx.anchorcollect.db.DbUtil;
import com.phlx.anchorcollect.db.gen.GenTableColumnDao;
import com.phlx.anchorcollect.db.gen.GenTableDao;
import com.phlx.anchorcollect.entity.DictEntity; import com.phlx.anchorcollect.entity.DictEntity;
import com.phlx.anchorcollect.entity.GenTable;
import com.phlx.anchorcollect.entity.GenTableColumn;
import com.phlx.anchorcollect.ui.base.BackBarVM;
import com.phlx.anchorcollect.ui.base.MainBarVM; import com.phlx.anchorcollect.ui.base.MainBarVM;
import com.phlx.anchorcollect.ui.fragment.CollectFragment;
import org.greenrobot.greendao.query.QueryBuilder;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import me.goldze.mvvmhabit.binding.command.BindingAction; import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand; import me.goldze.mvvmhabit.binding.command.BindingCommand;
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent; import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;
import me.goldze.mvvmhabit.utils.SPUtils;
import me.goldze.mvvmhabit.utils.StringUtils; import me.goldze.mvvmhabit.utils.StringUtils;
import me.goldze.mvvmhabit.utils.ToastUtils; import me.goldze.mvvmhabit.utils.ToastUtils;
...@@ -122,4 +109,5 @@ public class MainVM extends MainBarVM<Repository> { ...@@ -122,4 +109,5 @@ public class MainVM extends MainBarVM<Repository> {
onTabClickEvent.setValue(5); onTabClickEvent.setValue(5);
} }
}); });
} }
...@@ -29,6 +29,7 @@ import com.phlx.anchorcollect.data.Repository; ...@@ -29,6 +29,7 @@ import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil; import com.phlx.anchorcollect.db.DbUtil;
import com.phlx.anchorcollect.db.gen.BreedingRecordDetailEntityDao; import com.phlx.anchorcollect.db.gen.BreedingRecordDetailEntityDao;
import com.phlx.anchorcollect.db.gen.BreedingRecordEntityDao; import com.phlx.anchorcollect.db.gen.BreedingRecordEntityDao;
import com.phlx.anchorcollect.db.gen.ImmuneBatchDetailEntityDao;
import com.phlx.anchorcollect.db.gen.ImmuneBatchEntityDao; import com.phlx.anchorcollect.db.gen.ImmuneBatchEntityDao;
import com.phlx.anchorcollect.db.gen.MedicalRecordEntityDao; import com.phlx.anchorcollect.db.gen.MedicalRecordEntityDao;
import com.phlx.anchorcollect.db.gen.PerformanceEntityDao; import com.phlx.anchorcollect.db.gen.PerformanceEntityDao;
...@@ -39,6 +40,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordDetailEntity; ...@@ -39,6 +40,7 @@ import com.phlx.anchorcollect.entity.BreedingRecordDetailEntity;
import com.phlx.anchorcollect.entity.BreedingRecordEntity; import com.phlx.anchorcollect.entity.BreedingRecordEntity;
import com.phlx.anchorcollect.entity.CattleResumeEntity; import com.phlx.anchorcollect.entity.CattleResumeEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchEntity; import com.phlx.anchorcollect.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect.entity.MedicalRecordEntity; import com.phlx.anchorcollect.entity.MedicalRecordEntity;
import com.phlx.anchorcollect.entity.PerformanceEntity; import com.phlx.anchorcollect.entity.PerformanceEntity;
import com.phlx.anchorcollect.entity.WeightManEntity; import com.phlx.anchorcollect.entity.WeightManEntity;
...@@ -260,6 +262,13 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -260,6 +262,13 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
} }
}); });
public BindingCommand OnImmunRecordDetailSyncClickCommand = new BindingCommand(new BindingAction() {
@Override
public void call() {
queryImmuneBatchDetail();
}
});
public BindingCommand OnBreedingRecordSyncClickCommand = new BindingCommand(new BindingAction() { public BindingCommand OnBreedingRecordSyncClickCommand = new BindingCommand(new BindingAction() {
@Override @Override
public void call() { public void call() {
...@@ -1159,7 +1168,6 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1159,7 +1168,6 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
} }
}).updateAsyncBatch(WeightManEntity.class, weightManEntities); }).updateAsyncBatch(WeightManEntity.class, weightManEntities);
} else { } else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg()); me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
requestWeightMan(); requestWeightMan();
} }
...@@ -1336,10 +1344,10 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1336,10 +1344,10 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
} }
/**===========================================免疫记录================================================= */ /**===========================================免疫记录-主表================================================= */
/** /**
* 下载-免疫记录- * 下载-免疫记录-主表
*/ */
private void requestImmuneBatch() { private void requestImmuneBatch() {
...@@ -1356,7 +1364,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1356,7 +1364,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
.compose(RxUtils.bindToLifecycle(getLifecycleProvider())) .compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer()) .compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer()) .compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步免疫记录数据...")) // .doOnSubscribe(disposable -> showDialog("正在同步免疫记录-主表数据..."))
.subscribe((Consumer<ListResponse<ImmuneBatchEntity>>) response -> { .subscribe((Consumer<ListResponse<ImmuneBatchEntity>>) response -> {
if (response.getCode() == 0) { if (response.getCode() == 0) {
...@@ -1376,7 +1384,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1376,7 +1384,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
requestImmuneBatchSync(ids); requestImmuneBatchSync(ids);
} else { } else {
dismissDialog(); dismissDialog();
errorEvent.setValue("保存免疫记录数据失败!"); errorEvent.setValue("保存免疫记录-主表数据失败!");
} }
} }
}).insertAsyncBatch(ImmuneBatchEntity.class, response.getData()); }).insertAsyncBatch(ImmuneBatchEntity.class, response.getData());
...@@ -1395,7 +1403,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1395,7 +1403,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
} }
/** /**
* 上传-免疫记录-成功 * 上传-免疫记录-主表-成功
*/ */
private void requestImmuneBatchSync(List<String> ids) { private void requestImmuneBatchSync(List<String> ids) {
...@@ -1409,13 +1417,13 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1409,13 +1417,13 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
.compose(RxUtils.bindToLifecycle(getLifecycleProvider())) .compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer()) .compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer()) .compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步称重管理数据...")) // .doOnSubscribe(disposable -> showDialog("正在同步免疫记录-主表数据..."))
.subscribe((Consumer<CollectResponse>) response -> { .subscribe((Consumer<CollectResponse>) response -> {
dismissDialog(); dismissDialog();
KLog.e("requestImmuneBatchSync", response.toString()); KLog.e("requestImmuneBatchSync", response.toString());
if (response.getCode() == 0) { if (response.getCode() == 0) {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("同步免疫记录数据成功!"); me.goldze.mvvmhabit.utils.ToastUtils.showShort("同步免疫记录-主表数据成功!");
queryImmuneBatch(); queryImmuneBatch();
} else { } else {
dismissDialog(); dismissDialog();
...@@ -1429,7 +1437,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1429,7 +1437,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
} }
/** /**
* 查询-免疫记录- * 查询-免疫记录-主表
*/ */
private void queryImmuneBatch() { private void queryImmuneBatch() {
...@@ -1449,14 +1457,14 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1449,14 +1457,14 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
@Override @Override
public void onFailed() { public void onFailed() {
ToastUtils.showShort("查询-免疫记录-失败!"); ToastUtils.showShort("查询-免疫记录-主表-失败!");
dismissDialog(); dismissDialog();
} }
}).queryAsyncAll(ImmuneBatchEntity.class, builder); }).queryAsyncAll(ImmuneBatchEntity.class, builder);
} }
/** /**
* 上传-诊疗记录- * 上传-免疫记录-主表
*/ */
private void uploadImmuneBatch(List<ImmuneBatchEntity> immuneBatchEntities) { private void uploadImmuneBatch(List<ImmuneBatchEntity> immuneBatchEntities) {
...@@ -1467,7 +1475,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1467,7 +1475,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
.compose(RxUtils.bindToLifecycle(getLifecycleProvider())) .compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer()) .compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer()) .compose(RxUtils.exceptionTransformer())
.doOnSubscribe(disposable -> showDialog("正在同步-免疫记录-数据...")) .doOnSubscribe(disposable -> showDialog("正在同步-免疫记录-主表-数据..."))
.subscribe((Consumer<CollectResponse>) response -> { .subscribe((Consumer<CollectResponse>) response -> {
if (response.getCode() == 0) { if (response.getCode() == 0) {
...@@ -1480,9 +1488,9 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1480,9 +1488,9 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
public void onNotification(boolean result) { public void onNotification(boolean result) {
if (result) { if (result) {
queryImmuneBatch(); queryImmuneBatch();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("上传-免疫记录-数据成功!"); me.goldze.mvvmhabit.utils.ToastUtils.showShort("上传-免疫记录-主表-数据成功!");
} else { } else {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("修改-免疫记录-数据失败"); me.goldze.mvvmhabit.utils.ToastUtils.showShort("修改-免疫记录-主表-数据失败");
} }
} }
}).updateAsyncBatch(ImmuneBatchEntity.class, immuneBatchEntities); }).updateAsyncBatch(ImmuneBatchEntity.class, immuneBatchEntities);
...@@ -1499,4 +1507,168 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -1499,4 +1507,168 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
} }
/**===========================================免疫记录-子表================================================= */
/**
* 下载-免疫记录-子表
*/
private void requestImmuneBatchDetail() {
//SyncState 0根据记录更新,1重新更新
Map<String, String> requestParam = new HashMap<>();
List<ImmuneBatchDetailEntity> queryList = DbUtil.getInstance().queryAll(ImmuneBatchDetailEntity.class);
if (queryList == null || queryList.size() == 0)
requestParam.put("SyncState", "1");
else
requestParam.put("SyncState", "0");
addSubscribe(model.downloadImmuneBatchDetailList(requestParam)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步免疫记录数据..."))
.subscribe((Consumer<ListResponse<ImmuneBatchDetailEntity>>) response -> {
if (response.getCode() == 0) {
if (response.getData() != null && response.getData().size() > 0) {
KLog.e("--requestImmuneBatchDetail--" + response.getData().size());
List<String> ids = new ArrayList<>();
for (ImmuneBatchDetailEntity cre : response.getData()) {
cre.setUploadStatus("1");
ids.add(cre.getUnid());
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
requestImmuneBatchDetailSync(ids);
} else {
dismissDialog();
errorEvent.setValue("保存免疫记录-子表数据失败!");
}
}
}).insertAsyncBatch(ImmuneBatchDetailEntity.class, response.getData());
} else {
dismissDialog();
}
} else {
errorEvent.setValue("服务器 :" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
KLog.e(throwable.message);
})
);
}
/**
* 上传-免疫记录-子表-成功
*/
private void requestImmuneBatchDetailSync(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.downloadImmuneBatchDetailListSync(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
// .doOnSubscribe(disposable -> showDialog("正在同步免疫记录-子表数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
dismissDialog();
KLog.e("requestImmuneBatchDetailSync", response.toString());
if (response.getCode() == 0) {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("同步免疫记录-子表数据成功!");
queryImmuneBatchDetail();
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
/**
* 查询-免疫记录-子表
*/
private void queryImmuneBatchDetail() {
QueryBuilder<ImmuneBatchDetailEntity> builder =
DbUtil.getInstance().getQueryBuilder(ImmuneBatchDetailEntity.class)
.where(ImmuneBatchDetailEntityDao.Properties.UploadStatus.eq("0"))
.limit(10);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<ImmuneBatchDetailEntity>() {
@Override
public void onSuccess(List<ImmuneBatchDetailEntity> result) {
if (result != null && result.size() > 0) {
uploadImmuneBatchDetail(result);
} else {
requestImmuneBatchDetail();
}
}
@Override
public void onFailed() {
ToastUtils.showShort("查询-免疫记录-子表-失败!");
dismissDialog();
}
}).queryAsyncAll(ImmuneBatchDetailEntity.class, builder);
}
/**
* 上传-免疫记录-子表
*/
private void uploadImmuneBatchDetail(List<ImmuneBatchDetailEntity> immuneBatchEntities) {
RequestBody body = RequestBody.create(MediaType.parse("application/json"), new Gson().toJson(immuneBatchEntities));
// KLog.e("label", postParams.toString());
addSubscribe(model.uploadImmuneBatchDetailList(body)
.compose(RxUtils.bindToLifecycle(getLifecycleProvider()))
.compose(RxUtils.schedulersTransformer())
.compose(RxUtils.exceptionTransformer())
.doOnSubscribe(disposable -> showDialog("正在同步-免疫记录-子表-数据..."))
.subscribe((Consumer<CollectResponse>) response -> {
if (response.getCode() == 0) {
KLog.e("uploadImmuneBatchDetail", response.toString());
for (ImmuneBatchDetailEntity pe : immuneBatchEntities) {
pe.setUploadStatus("1");
}
DbUtil.getInstance().setDbIDUCallBack(new DbIDUCallBack() {
@Override
public void onNotification(boolean result) {
if (result) {
queryImmuneBatchDetail();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("上传-免疫记录-子表-数据成功!");
} else {
me.goldze.mvvmhabit.utils.ToastUtils.showShort("修改-免疫记录-子表-数据失败");
}
}
}).updateAsyncBatch(ImmuneBatchDetailEntity.class, immuneBatchEntities);
} else {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort("服务器:" + response.getMsg());
requestImmuneBatchDetail();
}
}, (Consumer<ResponseThrowable>) throwable -> {
dismissDialog();
me.goldze.mvvmhabit.utils.ToastUtils.showShort(throwable.message);
})
);
}
} }
...@@ -19,14 +19,12 @@ import com.phlx.anchorcollect.params.CollectResponse; ...@@ -19,14 +19,12 @@ import com.phlx.anchorcollect.params.CollectResponse;
import com.phlx.anchorcollect.params.ListResponse; import com.phlx.anchorcollect.params.ListResponse;
import com.phlx.anchorcollect.params.PostParams; import com.phlx.anchorcollect.params.PostParams;
import com.phlx.anchorcollect.ui.base.MainBarVM; import com.phlx.anchorcollect.ui.base.MainBarVM;
import com.phlx.anchorcollect.ui.home.HomeActivity;
import com.phlx.anchorcollect.ui.main.MainActivity; import com.phlx.anchorcollect.ui.main.MainActivity;
import com.phlx.anchorcollect.util.StringUtil; import com.phlx.anchorcollect.util.StringUtil;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Set; import java.util.Set;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
......
...@@ -26,12 +26,11 @@ public class EntityUtils { ...@@ -26,12 +26,11 @@ public class EntityUtils {
} }
/** /**
*
* @Description 根据属性名 获取值(value)
* @param name * @param name
* @param user * @param user
* @return * @return
* @throws IllegalAccessException * @throws IllegalAccessException
* @Description 根据属性名 获取值(value)
*/ */
public static Object getFieldValueByName(String name, Object user) throws IllegalAccessException { public static Object getFieldValueByName(String name, Object user) throws IllegalAccessException {
...@@ -42,9 +41,9 @@ public class EntityUtils { ...@@ -42,9 +41,9 @@ public class EntityUtils {
Method method; Method method;
Object value; Object value;
try { try {
method = user.getClass().getMethod(getter, new Class[] {}); method = user.getClass().getMethod(getter, new Class[]{});
value = method.invoke(user, new CattleResumeEntity[] {}); value = method.invoke(user, new CattleResumeEntity[]{});
return value; return value;
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
android:text="@string/immun_record" android:text="@string/immun_record"
binding:layout_constraintTop_toBottomOf="@+id/btn_treatment_record_sync" binding:layout_constraintTop_toBottomOf="@+id/btn_treatment_record_sync"
binding:layout_constraintLeft_toLeftOf="@+id/btn_base_archives_sync" binding:layout_constraintLeft_toLeftOf="@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toTopOf="@+id/btn_breeding_record_sync" binding:layout_constraintBottom_toTopOf="@+id/btn_immun_record_detail_sync"
binding:onClickCommand="@{viewModel.OnImmunRecordSyncClickCommand}" binding:onClickCommand="@{viewModel.OnImmunRecordSyncClickCommand}"
/> />
...@@ -250,13 +250,47 @@ ...@@ -250,13 +250,47 @@
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_immun_record_sync" binding:layout_constraintBaseline_toBaselineOf="@+id/btn_immun_record_sync"
/> />
<!-- immun_record_detail -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_immun_record_detail_sync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/immun_record_detail"
binding:layout_constraintTop_toBottomOf="@+id/btn_immun_record_sync"
binding:layout_constraintLeft_toLeftOf="@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toTopOf="@+id/btn_breeding_record_sync"
binding:onClickCommand="@{viewModel.OnImmunRecordDetailSyncClickCommand}"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_immun_record_detail_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="(0)"
android:textColor="@color/white"
binding:layout_constraintLeft_toRightOf="@+id/btn_immun_record_detail_sync"
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_immun_record_detail_sync"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_immun_record_detail_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="111"
android:textColor="@color/white"
binding:layout_constraintLeft_toRightOf="@+id/tv_immun_record_detail_count"
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_immun_record_detail_sync"
/>
<!-- breeding_record --> <!-- breeding_record -->
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_breeding_record_sync" android:id="@+id/btn_breeding_record_sync"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/breeding_record" android:text="@string/breeding_record"
binding:layout_constraintTop_toBottomOf="@+id/btn_immun_record_sync" binding:layout_constraintTop_toBottomOf="@+id/btn_immun_record_detail_sync"
binding:layout_constraintLeft_toLeftOf="@+id/btn_base_archives_sync" binding:layout_constraintLeft_toLeftOf="@+id/btn_base_archives_sync"
binding:layout_constraintBottom_toTopOf="@+id/btn_breeding_record_detail_sync" binding:layout_constraintBottom_toTopOf="@+id/btn_breeding_record_detail_sync"
binding:onClickCommand="@{viewModel.OnBreedingRecordSyncClickCommand}" binding:onClickCommand="@{viewModel.OnBreedingRecordSyncClickCommand}"
......
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:binding="http://schemas.android.com/apk/res-auto"> xmlns:binding="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/tools"
app:ignore="NamespaceTypo">
<data> <data>
...@@ -21,135 +23,113 @@ ...@@ -21,135 +23,113 @@
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:background="@color/color_bg"
android:background="@color/color_bg"> android:orientation="vertical">
<include <include
android:id="@+id/include" android:id="@+id/include"
layout="@layout/layout_back_bar" layout="@layout/layout_back_bar"
binding:backBarVM="@{viewModel.backBarVM}" /> binding:backBarVM="@{viewModel.backBarVM}" />
<androidx.appcompat.widget.LinearLayoutCompat <androidx.core.widget.NestedScrollView
android:id="@+id/nsv_right_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_bg" android:layout_marginTop="5dp"
android:orientation="horizontal" binding:layout_constraintBottom_toTopOf="@+id/ll_save"
android:padding="10dp"> binding:layout_constraintLeft_toLeftOf="@+id/guideline_vertical"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/iv_setting">
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:background="@color/color_bg"
android:background="@drawable/bg_radius_white_5"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/cattle_linearlayout_padding"> android:padding="10dp">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@mipmap/cattle_color" android:drawableLeft="@mipmap/cattle_color"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:text="基础信息" android:text="@string/sign_measure"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<androidx.recyclerview.widget.RecyclerView <com.lingber.mycontrol.datagridview.DataGridView
android:id="@+id/dgv_sign_measure"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cattle_margin_top" app:dividerSize="1"
binding:adapter="@{adapter}" app:row_height="50"
binding:itemBinding="@{viewModel.itemBinding}" app:show_header="true"
binding:items="@{viewModel.observablePedigreeList}" binding:layout_constraintLeft_toLeftOf="parent"
binding:layoutManager="@{LayoutManagers.linear()}" /> binding:layout_constraintRight_toRightOf="parent"
</androidx.appcompat.widget.LinearLayoutCompat> binding:layout_constraintTop_toBottomOf="@+id/rv_collect"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/cl_title"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/cattle_margin_left"
android:layout_weight="1"
android:background="@drawable/bg_radius_white_5"
android:orientation="vertical"
android:padding="@dimen/cattle_linearlayout_padding">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@mipmap/cattle_color" android:drawableLeft="@mipmap/cattle_color"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:text="体征测定" android:text="@string/treatment_record"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<androidx.recyclerview.widget.RecyclerView <com.lingber.mycontrol.datagridview.DataGridView
android:id="@+id/dgv_treatment_record"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cattle_margin_top" app:dividerSize="1"
binding:adapter="@{adapter}" app:row_height="50"
binding:itemBinding="@{viewModel.itemBinding}" app:show_header="true"
binding:items="@{viewModel.observableSignsList}" binding:layout_constraintLeft_toLeftOf="parent"
binding:layoutManager="@{LayoutManagers.linear()}" /> binding:layout_constraintRight_toRightOf="parent"
</androidx.appcompat.widget.LinearLayoutCompat> binding:layout_constraintTop_toBottomOf="@+id/rv_collect"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/cattle_margin_left"
android:layout_weight="1"
android:background="@drawable/bg_radius_white_5"
android:orientation="vertical"
android:padding="@dimen/cattle_linearlayout_padding">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@mipmap/cattle_color" android:drawableLeft="@mipmap/cattle_color"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:text="健康管理" android:text="@string/immun_record"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<androidx.recyclerview.widget.RecyclerView <com.lingber.mycontrol.datagridview.DataGridView
android:id="@+id/dgv_immun_record"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cattle_margin_top" app:dividerSize="1"
binding:adapter="@{adapter}" app:row_height="50"
binding:itemBinding="@{viewModel.itemBinding}" app:show_header="true"
binding:items="@{viewModel.observableHealthyList}" binding:layout_constraintLeft_toLeftOf="parent"
binding:layoutManager="@{LayoutManagers.linear()}" /> binding:layout_constraintRight_toRightOf="parent"
</androidx.appcompat.widget.LinearLayoutCompat> binding:layout_constraintTop_toBottomOf="@+id/rv_collect"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/cattle_margin_left"
android:layout_weight="1"
android:background="@drawable/bg_radius_white_5"
android:orientation="vertical"
android:padding="@dimen/cattle_linearlayout_padding">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@mipmap/cattle_color" android:drawableLeft="@mipmap/cattle_color"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:text="免疫管理" android:text="@string/breeding_record"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<androidx.recyclerview.widget.RecyclerView <com.lingber.mycontrol.datagridview.DataGridView
android:id="@+id/dgv_breeding_record"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/cattle_margin_top" app:dividerSize="1"
binding:adapter="@{adapter}" app:row_height="50"
binding:itemBinding="@{viewModel.itemBinding}" app:show_header="true"
binding:items="@{viewModel.observableImmunityList}" binding:layout_constraintLeft_toLeftOf="parent"
binding:layoutManager="@{LayoutManagers.linear()}" /> binding:layout_constraintRight_toRightOf="parent"
</androidx.appcompat.widget.LinearLayoutCompat> binding:layout_constraintTop_toBottomOf="@+id/rv_collect"/>
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
</layout> </layout>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<string name="weighting_manage">称重管理</string> <string name="weighting_manage">称重管理</string>
<string name="treatment_record">诊疗记录</string> <string name="treatment_record">诊疗记录</string>
<string name="immun_record">免疫记录</string> <string name="immun_record">免疫记录</string>
<string name="immun_record_detail">免疫详情</string>
<string name="breeding_record">配种记录</string> <string name="breeding_record">配种记录</string>
<string name="breeding_record_detail">配种详情</string> <string name="breeding_record_detail">配种详情</string>
......
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