Commit 17486fe8 authored by hywang's avatar hywang

1.增加单选和时间的默认值;

2.标签重复提示对换标签位置;
3.基础信息,养殖类型写死。
parent 8e191b0a
...@@ -9,8 +9,8 @@ android { ...@@ -9,8 +9,8 @@ android {
applicationId "com.phlx.anchorcollect_p" applicationId "com.phlx.anchorcollect_p"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 22 versionCode 23
versionName "2.3.1" versionName "2.3.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...@@ -50,7 +50,7 @@ android { ...@@ -50,7 +50,7 @@ android {
} }
greendao { greendao {
schemaVersion 6 //数据库版本号 schemaVersion 7 //数据库版本号
daoPackage 'com.phlx.anchorcollect_p.db.gen' daoPackage 'com.phlx.anchorcollect_p.db.gen'
targetGenDir 'src/main/java' targetGenDir 'src/main/java'
} }
......
...@@ -61,15 +61,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long> ...@@ -61,15 +61,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long>
public final static Property IsOut = new Property(34, Long.class, "isOut", false, "IS_OUT"); public final static Property IsOut = new Property(34, Long.class, "isOut", false, "IS_OUT");
public final static Property Age = new Property(35, Integer.class, "age", false, "AGE"); public final static Property Age = new Property(35, Integer.class, "age", false, "AGE");
public final static Property Colour = new Property(36, String.class, "colour", false, "COLOUR"); public final static Property Colour = new Property(36, String.class, "colour", false, "COLOUR");
public final static Property InputTime = new Property(37, String.class, "inputTime", false, "INPUT_TIME"); public final static Property IsJiao = new Property(37, String.class, "isJiao", false, "IS_JIAO");
public final static Property DeptId = new Property(38, Long.class, "deptId", false, "DEPT_ID"); public final static Property IsZifan = new Property(38, String.class, "isZifan", false, "IS_ZIFAN");
public final static Property UploadStatus = new Property(39, String.class, "uploadStatus", false, "UPLOAD_STATUS"); public final static Property InTime = new Property(39, String.class, "inTime", false, "IN_TIME");
public final static Property UploadTime = new Property(40, String.class, "uploadTime", false, "UPLOAD_TIME"); public final static Property InputTime = new Property(40, String.class, "inputTime", false, "INPUT_TIME");
public final static Property CreateBy = new Property(41, String.class, "createBy", false, "CREATE_BY"); public final static Property DeptId = new Property(41, Long.class, "deptId", false, "DEPT_ID");
public final static Property CreateTime = new Property(42, String.class, "createTime", false, "CREATE_TIME"); public final static Property UploadStatus = new Property(42, String.class, "uploadStatus", false, "UPLOAD_STATUS");
public final static Property UpdateBy = new Property(43, String.class, "updateBy", false, "UPDATE_BY"); public final static Property UploadTime = new Property(43, String.class, "uploadTime", false, "UPLOAD_TIME");
public final static Property UpdateTime = new Property(44, String.class, "updateTime", false, "UPDATE_TIME"); public final static Property CreateBy = new Property(44, String.class, "createBy", false, "CREATE_BY");
public final static Property Remark = new Property(45, String.class, "remark", false, "REMARK"); public final static Property CreateTime = new Property(45, String.class, "createTime", false, "CREATE_TIME");
public final static Property UpdateBy = new Property(46, String.class, "updateBy", false, "UPDATE_BY");
public final static Property UpdateTime = new Property(47, String.class, "updateTime", false, "UPDATE_TIME");
public final static Property Remark = new Property(48, String.class, "remark", false, "REMARK");
} }
...@@ -122,15 +125,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long> ...@@ -122,15 +125,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long>
"\"IS_OUT\" INTEGER," + // 34: isOut "\"IS_OUT\" INTEGER," + // 34: isOut
"\"AGE\" INTEGER," + // 35: age "\"AGE\" INTEGER," + // 35: age
"\"COLOUR\" TEXT," + // 36: colour "\"COLOUR\" TEXT," + // 36: colour
"\"INPUT_TIME\" TEXT," + // 37: inputTime "\"IS_JIAO\" TEXT," + // 37: isJiao
"\"DEPT_ID\" INTEGER," + // 38: deptId "\"IS_ZIFAN\" TEXT," + // 38: isZifan
"\"UPLOAD_STATUS\" TEXT," + // 39: uploadStatus "\"IN_TIME\" TEXT," + // 39: inTime
"\"UPLOAD_TIME\" TEXT," + // 40: uploadTime "\"INPUT_TIME\" TEXT," + // 40: inputTime
"\"CREATE_BY\" TEXT," + // 41: createBy "\"DEPT_ID\" INTEGER," + // 41: deptId
"\"CREATE_TIME\" TEXT," + // 42: createTime "\"UPLOAD_STATUS\" TEXT," + // 42: uploadStatus
"\"UPDATE_BY\" TEXT," + // 43: updateBy "\"UPLOAD_TIME\" TEXT," + // 43: uploadTime
"\"UPDATE_TIME\" TEXT," + // 44: updateTime "\"CREATE_BY\" TEXT," + // 44: createBy
"\"REMARK\" TEXT);"); // 45: remark "\"CREATE_TIME\" TEXT," + // 45: createTime
"\"UPDATE_BY\" TEXT," + // 46: updateBy
"\"UPDATE_TIME\" TEXT," + // 47: updateTime
"\"REMARK\" TEXT);"); // 48: remark
} }
/** Drops the underlying database table. */ /** Drops the underlying database table. */
...@@ -328,49 +334,64 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long> ...@@ -328,49 +334,64 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long>
stmt.bindString(37, colour); stmt.bindString(37, colour);
} }
String isJiao = entity.getIsJiao();
if (isJiao != null) {
stmt.bindString(38, isJiao);
}
String isZifan = entity.getIsZifan();
if (isZifan != null) {
stmt.bindString(39, isZifan);
}
String inTime = entity.getInTime();
if (inTime != null) {
stmt.bindString(40, inTime);
}
String inputTime = entity.getInputTime(); String inputTime = entity.getInputTime();
if (inputTime != null) { if (inputTime != null) {
stmt.bindString(38, inputTime); stmt.bindString(41, inputTime);
} }
Long deptId = entity.getDeptId(); Long deptId = entity.getDeptId();
if (deptId != null) { if (deptId != null) {
stmt.bindLong(39, deptId); stmt.bindLong(42, deptId);
} }
String uploadStatus = entity.getUploadStatus(); String uploadStatus = entity.getUploadStatus();
if (uploadStatus != null) { if (uploadStatus != null) {
stmt.bindString(40, uploadStatus); stmt.bindString(43, uploadStatus);
} }
String uploadTime = entity.getUploadTime(); String uploadTime = entity.getUploadTime();
if (uploadTime != null) { if (uploadTime != null) {
stmt.bindString(41, uploadTime); stmt.bindString(44, uploadTime);
} }
String createBy = entity.getCreateBy(); String createBy = entity.getCreateBy();
if (createBy != null) { if (createBy != null) {
stmt.bindString(42, createBy); stmt.bindString(45, createBy);
} }
String createTime = entity.getCreateTime(); String createTime = entity.getCreateTime();
if (createTime != null) { if (createTime != null) {
stmt.bindString(43, createTime); stmt.bindString(46, createTime);
} }
String updateBy = entity.getUpdateBy(); String updateBy = entity.getUpdateBy();
if (updateBy != null) { if (updateBy != null) {
stmt.bindString(44, updateBy); stmt.bindString(47, updateBy);
} }
String updateTime = entity.getUpdateTime(); String updateTime = entity.getUpdateTime();
if (updateTime != null) { if (updateTime != null) {
stmt.bindString(45, updateTime); stmt.bindString(48, updateTime);
} }
String remark = entity.getRemark(); String remark = entity.getRemark();
if (remark != null) { if (remark != null) {
stmt.bindString(46, remark); stmt.bindString(49, remark);
} }
} }
...@@ -563,49 +584,64 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long> ...@@ -563,49 +584,64 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long>
stmt.bindString(37, colour); stmt.bindString(37, colour);
} }
String isJiao = entity.getIsJiao();
if (isJiao != null) {
stmt.bindString(38, isJiao);
}
String isZifan = entity.getIsZifan();
if (isZifan != null) {
stmt.bindString(39, isZifan);
}
String inTime = entity.getInTime();
if (inTime != null) {
stmt.bindString(40, inTime);
}
String inputTime = entity.getInputTime(); String inputTime = entity.getInputTime();
if (inputTime != null) { if (inputTime != null) {
stmt.bindString(38, inputTime); stmt.bindString(41, inputTime);
} }
Long deptId = entity.getDeptId(); Long deptId = entity.getDeptId();
if (deptId != null) { if (deptId != null) {
stmt.bindLong(39, deptId); stmt.bindLong(42, deptId);
} }
String uploadStatus = entity.getUploadStatus(); String uploadStatus = entity.getUploadStatus();
if (uploadStatus != null) { if (uploadStatus != null) {
stmt.bindString(40, uploadStatus); stmt.bindString(43, uploadStatus);
} }
String uploadTime = entity.getUploadTime(); String uploadTime = entity.getUploadTime();
if (uploadTime != null) { if (uploadTime != null) {
stmt.bindString(41, uploadTime); stmt.bindString(44, uploadTime);
} }
String createBy = entity.getCreateBy(); String createBy = entity.getCreateBy();
if (createBy != null) { if (createBy != null) {
stmt.bindString(42, createBy); stmt.bindString(45, createBy);
} }
String createTime = entity.getCreateTime(); String createTime = entity.getCreateTime();
if (createTime != null) { if (createTime != null) {
stmt.bindString(43, createTime); stmt.bindString(46, createTime);
} }
String updateBy = entity.getUpdateBy(); String updateBy = entity.getUpdateBy();
if (updateBy != null) { if (updateBy != null) {
stmt.bindString(44, updateBy); stmt.bindString(47, updateBy);
} }
String updateTime = entity.getUpdateTime(); String updateTime = entity.getUpdateTime();
if (updateTime != null) { if (updateTime != null) {
stmt.bindString(45, updateTime); stmt.bindString(48, updateTime);
} }
String remark = entity.getRemark(); String remark = entity.getRemark();
if (remark != null) { if (remark != null) {
stmt.bindString(46, remark); stmt.bindString(49, remark);
} }
} }
...@@ -654,15 +690,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long> ...@@ -654,15 +690,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long>
cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34), // isOut cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34), // isOut
cursor.isNull(offset + 35) ? null : cursor.getInt(offset + 35), // age cursor.isNull(offset + 35) ? null : cursor.getInt(offset + 35), // age
cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36), // colour cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36), // colour
cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37), // inputTime cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37), // isJiao
cursor.isNull(offset + 38) ? null : cursor.getLong(offset + 38), // deptId cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38), // isZifan
cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39), // uploadStatus cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39), // inTime
cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40), // uploadTime cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40), // inputTime
cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41), // createBy cursor.isNull(offset + 41) ? null : cursor.getLong(offset + 41), // deptId
cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42), // createTime cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42), // uploadStatus
cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43), // updateBy cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43), // uploadTime
cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44), // updateTime cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44), // createBy
cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45) // remark cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45), // createTime
cursor.isNull(offset + 46) ? null : cursor.getString(offset + 46), // updateBy
cursor.isNull(offset + 47) ? null : cursor.getString(offset + 47), // updateTime
cursor.isNull(offset + 48) ? null : cursor.getString(offset + 48) // remark
); );
return entity; return entity;
} }
...@@ -706,15 +745,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long> ...@@ -706,15 +745,18 @@ public class CattleResumeEntityDao extends AbstractDao<CattleResumeEntity, Long>
entity.setIsOut(cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34)); entity.setIsOut(cursor.isNull(offset + 34) ? null : cursor.getLong(offset + 34));
entity.setAge(cursor.isNull(offset + 35) ? null : cursor.getInt(offset + 35)); entity.setAge(cursor.isNull(offset + 35) ? null : cursor.getInt(offset + 35));
entity.setColour(cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36)); entity.setColour(cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36));
entity.setInputTime(cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37)); entity.setIsJiao(cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37));
entity.setDeptId(cursor.isNull(offset + 38) ? null : cursor.getLong(offset + 38)); entity.setIsZifan(cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38));
entity.setUploadStatus(cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39)); entity.setInTime(cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39));
entity.setUploadTime(cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40)); entity.setInputTime(cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40));
entity.setCreateBy(cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41)); entity.setDeptId(cursor.isNull(offset + 41) ? null : cursor.getLong(offset + 41));
entity.setCreateTime(cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42)); entity.setUploadStatus(cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42));
entity.setUpdateBy(cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43)); entity.setUploadTime(cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43));
entity.setUpdateTime(cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44)); entity.setCreateBy(cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44));
entity.setRemark(cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45)); entity.setCreateTime(cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45));
entity.setUpdateBy(cursor.isNull(offset + 46) ? null : cursor.getString(offset + 46));
entity.setUpdateTime(cursor.isNull(offset + 47) ? null : cursor.getString(offset + 47));
entity.setRemark(cursor.isNull(offset + 48) ? null : cursor.getString(offset + 48));
} }
@Override @Override
......
...@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; ...@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** /**
* Master of DAO (schema version 6): knows all DAOs. * Master of DAO (schema version 7): knows all DAOs.
*/ */
public class DaoMaster extends AbstractDaoMaster { public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 6; public static final int SCHEMA_VERSION = 7;
/** Creates underlying database table using DAOs. */ /** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) { public static void createAllTables(Database db, boolean ifNotExists) {
......
...@@ -135,6 +135,21 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -135,6 +135,21 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
/** 犊牛毛色 */ /** 犊牛毛色 */
private String colour; private String colour;
/**
* 是否有角
*/
private String isJiao;
/**
* 是否自繁
*/
private String isZifan;
/**
* 入场日期
*/
private String inTime;
/** 时间戳 */ /** 时间戳 */
private String inputTime; private String inputTime;
...@@ -224,6 +239,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -224,6 +239,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
age = in.readInt(); age = in.readInt();
} }
colour = in.readString(); colour = in.readString();
isJiao = in.readString();
isZifan = in.readString();
inTime = in.readString();
inputTime = in.readString(); inputTime = in.readString();
if (in.readByte() == 0) { if (in.readByte() == 0) {
deptId = null; deptId = null;
...@@ -239,7 +257,7 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -239,7 +257,7 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
remark = in.readString(); remark = in.readString();
} }
@Generated(hash = 748489987) @Generated(hash = 685246161)
public CattleResumeEntity(Long unid, String registrationNo, String individualNo, String circleNo, public CattleResumeEntity(Long unid, String registrationNo, String individualNo, String circleNo,
String raiseType, String raiseVarieties, String birthdate, Double birthHeavy, String sex, String raiseType, String raiseVarieties, String birthdate, Double birthHeavy, String sex,
String birthDifficulty, String isTwins, String childTime, String grade, String fatherReg, String birthDifficulty, String isTwins, String childTime, String grade, String fatherReg,
...@@ -247,8 +265,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -247,8 +265,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
String ffmNum, String fmfNum, String fmmNum, String mffNum, String mfmNum, String mmfNum, String ffmNum, String fmfNum, String fmmNum, String mffNum, String mfmNum, String mmfNum,
String mmmNum, Double fromMilkHeavy, String health, String junHeavy, String decAppScore, String mmmNum, Double fromMilkHeavy, String health, String junHeavy, String decAppScore,
String photo, String photoPath, String status, Long isOut, Integer age, String colour, String photo, String photoPath, String status, Long isOut, Integer age, String colour,
String inputTime, Long deptId, String uploadStatus, String uploadTime, String createBy, String isJiao, String isZifan, String inTime, String inputTime, Long deptId,
String createTime, String updateBy, String updateTime, String remark) { String uploadStatus, String uploadTime, String createBy, String createTime, String updateBy,
String updateTime, String remark) {
this.unid = unid; this.unid = unid;
this.registrationNo = registrationNo; this.registrationNo = registrationNo;
this.individualNo = individualNo; this.individualNo = individualNo;
...@@ -286,6 +305,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -286,6 +305,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this.isOut = isOut; this.isOut = isOut;
this.age = age; this.age = age;
this.colour = colour; this.colour = colour;
this.isJiao = isJiao;
this.isZifan = isZifan;
this.inTime = inTime;
this.inputTime = inputTime; this.inputTime = inputTime;
this.deptId = deptId; this.deptId = deptId;
this.uploadStatus = uploadStatus; this.uploadStatus = uploadStatus;
...@@ -361,6 +383,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -361,6 +383,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
dest.writeInt(age); dest.writeInt(age);
} }
dest.writeString(colour); dest.writeString(colour);
dest.writeString(isJiao);
dest.writeString(isZifan);
dest.writeString(inTime);
dest.writeString(inputTime); dest.writeString(inputTime);
if (deptId == null) { if (deptId == null) {
dest.writeByte((byte) 0); dest.writeByte((byte) 0);
...@@ -690,6 +715,30 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -690,6 +715,30 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this.colour = colour; this.colour = colour;
} }
public String getIsJiao() {
return isJiao;
}
public void setIsJiao(String isJiao) {
this.isJiao = isJiao;
}
public String getIsZifan() {
return isZifan;
}
public void setIsZifan(String isZifan) {
this.isZifan = isZifan;
}
public String getInTime() {
return inTime;
}
public void setInTime(String inTime) {
this.inTime = inTime;
}
public String getInputTime() { public String getInputTime() {
return inputTime; return inputTime;
} }
...@@ -802,6 +851,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -802,6 +851,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
", isOut=" + isOut + ", isOut=" + isOut +
", age=" + age + ", age=" + age +
", colour='" + colour + '\'' + ", colour='" + colour + '\'' +
", isJiao='" + isJiao + '\'' +
", isZifan='" + isZifan + '\'' +
", inTime='" + inTime + '\'' +
", inputTime='" + inputTime + '\'' + ", inputTime='" + inputTime + '\'' +
", deptId=" + deptId + ", deptId=" + deptId +
", uploadStatus='" + uploadStatus + '\'' + ", uploadStatus='" + uploadStatus + '\'' +
...@@ -853,6 +905,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -853,6 +905,9 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this.isOut= cre.getIsOut(); this.isOut= cre.getIsOut();
this.age= cre.getAge(); this.age= cre.getAge();
this.colour= cre.getColour(); this.colour= cre.getColour();
this.isJiao= cre.getIsJiao();
this.isZifan= cre.getIsZifan();
this.inTime= cre.getInTime();
this.inputTime= cre.getInputTime(); this.inputTime= cre.getInputTime();
this.deptId= cre.getDeptId(); this.deptId= cre.getDeptId();
this.uploadStatus= cre.getUploadStatus(); this.uploadStatus= cre.getUploadStatus();
......
...@@ -172,7 +172,10 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -172,7 +172,10 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
public void initGen() { public void initGen() {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.cattleresume) { for (GenTableColumn gtc : Configs.cattleresume) {
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.BASE_ARCHIVES); CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.BASE_ARCHIVES);
observableList.add(cgi); observableList.add(cgi);
} }
...@@ -419,10 +422,9 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -419,10 +422,9 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
// Configs.tempCattleResume.setPhotoPath(markeImgUrl); // Configs.tempCattleResume.setPhotoPath(markeImgUrl);
String[] filedName = EntityUtils.getFiledName(result.get(0)); String[] filedName = EntityUtils.getFiledName(result.get(0));
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (String name : filedName) { for (String name : filedName) {
for (GenTableColumn gtc : Configs.cattleresume) { for (GenTableColumn gtc : Configs.cattleresume) {
if (name.equals(gtc.getJavaField())) { if (name.equals(gtc.getJavaField())) {
try { try {
// Log.e("key:", name); // Log.e("key:", name);
...@@ -448,8 +450,8 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -448,8 +450,8 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
e.printStackTrace(); e.printStackTrace();
} }
} }
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
onNotifyAllEvent.setValue(false); onNotifyAllEvent.setValue(false);
...@@ -509,6 +511,12 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -509,6 +511,12 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
// if (Configs.tempCattleResume.getPhotoPath() != null && !Configs.tempCattleResume.getPhotoPath().equals("")) { // if (Configs.tempCattleResume.getPhotoPath() != null && !Configs.tempCattleResume.getPhotoPath().equals("")) {
// cattleResumeEntity.setPhoto(BaseImageUtils.bitmapToString(Configs.tempCattleResume.getPhotoPath(), getApplication())); // cattleResumeEntity.setPhoto(BaseImageUtils.bitmapToString(Configs.tempCattleResume.getPhotoPath(), getApplication()));
// } // }
//如果是自繁默认成出生日期
if("Y".equals(cattleResumeEntity.getIsZifan()) && !StringUtils.isEmpty(cattleResumeEntity.getBirthdate())){
cattleResumeEntity.setInTime(cattleResumeEntity.getBirthdate());
}
//设置饲养类型为02
cattleResumeEntity.setRaiseType("02");
cattleResumeEntity.setPhotoPath(Configs.tempCattleResume.getPhotoPath()); cattleResumeEntity.setPhotoPath(Configs.tempCattleResume.getPhotoPath());
cattleResumeEntity.setDeptId(Long.parseLong(SPUtils.getInstance().getString(Configs.SP_DEPT_ID))); cattleResumeEntity.setDeptId(Long.parseLong(SPUtils.getInstance().getString(Configs.SP_DEPT_ID)));
cattleResumeEntity.setRegistrationNo(rfid.get()); cattleResumeEntity.setRegistrationNo(rfid.get());
...@@ -619,9 +627,11 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -619,9 +627,11 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
remarkParamEntity.setContent(""); remarkParamEntity.setContent("");
remarkParamEntity.setShowName(""); remarkParamEntity.setShowName("");
currentParamEntity = new GenTableColumn(); currentParamEntity = new GenTableColumn();
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.cattleresume) { for (GenTableColumn gtc : Configs.cattleresume) {
gtc.setShowName(""); gtc.setShowName("");
gtc.setContent(""); gtc.setContent("");
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
......
...@@ -30,6 +30,7 @@ import com.phlx.anchorcollect_p.entity.GenTableColumn; ...@@ -30,6 +30,7 @@ import com.phlx.anchorcollect_p.entity.GenTableColumn;
import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem;
import com.phlx.anchorcollect_p.util.DateUtils; import com.phlx.anchorcollect_p.util.DateUtils;
import com.phlx.anchorcollect_p.util.EntityUtils; import com.phlx.anchorcollect_p.util.EntityUtils;
import com.phlx.anchorcollect_p.util.LoginInfoUtils;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
...@@ -108,11 +109,13 @@ public class BreedingRecordVM extends BaseViewModel<Repository> { ...@@ -108,11 +109,13 @@ public class BreedingRecordVM extends BaseViewModel<Repository> {
+ "anchorCiq" + tag + ".jpg"; + "anchorCiq" + tag + ".jpg";
imgFile = new File(imgUrl); imgFile = new File(imgUrl);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.cattlematingMaster) { for (GenTableColumn gtc : Configs.cattlematingMaster) {
CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.BREEDING_RECORD); CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.BREEDING_RECORD);
observableList.add(cgi); observableList.add(cgi);
} }
for (GenTableColumn gtc : Configs.cattlematingDetaill) { for (GenTableColumn gtc : Configs.cattlematingDetaill) {
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.BREEDING_RECORD_DETAIL); CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.BREEDING_RECORD_DETAIL);
detailObservableList.add(cgi); detailObservableList.add(cgi);
} }
...@@ -283,10 +286,9 @@ public class BreedingRecordVM extends BaseViewModel<Repository> { ...@@ -283,10 +286,9 @@ public class BreedingRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setContent(brdEntity.getRemark()); remarkParamEntity.setContent(brdEntity.getRemark());
String[] filedName = EntityUtils.getFiledName(brdEntity); String[] filedName = EntityUtils.getFiledName(brdEntity);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (String name : filedName) { for (String name : filedName) {
for (GenTableColumn gtc : Configs.cattlematingDetaill) { for (GenTableColumn gtc : Configs.cattlematingDetaill) {
if (name.equals(gtc.getJavaField())) { if (name.equals(gtc.getJavaField())) {
try { try {
Object fieldValueByName = EntityUtils.getFieldValueByName(name, brdEntity); Object fieldValueByName = EntityUtils.getFieldValueByName(name, brdEntity);
...@@ -311,6 +313,7 @@ public class BreedingRecordVM extends BaseViewModel<Repository> { ...@@ -311,6 +313,7 @@ public class BreedingRecordVM extends BaseViewModel<Repository> {
e.printStackTrace(); e.printStackTrace();
} }
} }
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
onNotifyAllEvent.setValue(false); onNotifyAllEvent.setValue(false);
...@@ -631,9 +634,11 @@ public class BreedingRecordVM extends BaseViewModel<Repository> { ...@@ -631,9 +634,11 @@ public class BreedingRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setShowName(""); remarkParamEntity.setShowName("");
currentParamEntity = new GenTableColumn(); currentParamEntity = new GenTableColumn();
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.cattlematingDetaill) { for (GenTableColumn gtc : Configs.cattlematingDetaill) {
gtc.setShowName(""); gtc.setShowName("");
gtc.setContent(""); gtc.setContent("");
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
} }
...@@ -28,6 +28,7 @@ import com.phlx.anchorcollect_p.entity.ImmuneBatchDetailEntity; ...@@ -28,6 +28,7 @@ import com.phlx.anchorcollect_p.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect_p.entity.ImmuneBatchEntity; import com.phlx.anchorcollect_p.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem;
import com.phlx.anchorcollect_p.util.EntityUtils; import com.phlx.anchorcollect_p.util.EntityUtils;
import com.phlx.anchorcollect_p.util.LoginInfoUtils;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
...@@ -94,7 +95,9 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -94,7 +95,9 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
+ "anchorCiq" + tag + ".jpg"; + "anchorCiq" + tag + ".jpg";
imgFile = new File(imgUrl); imgFile = new File(imgUrl);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.immunebatch) { for (GenTableColumn gtc : Configs.immunebatch) {
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.IMMUN_RECORD); CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.IMMUN_RECORD);
observableList.add(cgi); observableList.add(cgi);
} }
...@@ -117,10 +120,9 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -117,10 +120,9 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setContent(immuneBatchEntity.getRemark()); remarkParamEntity.setContent(immuneBatchEntity.getRemark());
String[] filedName = EntityUtils.getFiledName(immuneBatchEntity); String[] filedName = EntityUtils.getFiledName(immuneBatchEntity);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (String name : filedName) { for (String name : filedName) {
for (GenTableColumn gtc : Configs.immunebatch) { for (GenTableColumn gtc : Configs.immunebatch) {
if (name.equals(gtc.getJavaField())) { if (name.equals(gtc.getJavaField())) {
try { try {
Object fieldValueByName = EntityUtils.getFieldValueByName(name, immuneBatchEntity); Object fieldValueByName = EntityUtils.getFieldValueByName(name, immuneBatchEntity);
...@@ -144,6 +146,7 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -144,6 +146,7 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} }
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
...@@ -352,9 +355,11 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -352,9 +355,11 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setShowName(""); remarkParamEntity.setShowName("");
currentParamEntity = new GenTableColumn(); currentParamEntity = new GenTableColumn();
uuid = 0; uuid = 0;
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.immunebatch) { for (GenTableColumn gtc : Configs.immunebatch) {
gtc.setShowName(""); gtc.setShowName("");
gtc.setContent(""); gtc.setContent("");
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
......
...@@ -25,6 +25,7 @@ import com.phlx.anchorcollect_p.entity.GenTableColumn; ...@@ -25,6 +25,7 @@ import com.phlx.anchorcollect_p.entity.GenTableColumn;
import com.phlx.anchorcollect_p.entity.MedicalRecordEntity; import com.phlx.anchorcollect_p.entity.MedicalRecordEntity;
import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem;
import com.phlx.anchorcollect_p.util.EntityUtils; import com.phlx.anchorcollect_p.util.EntityUtils;
import com.phlx.anchorcollect_p.util.LoginInfoUtils;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
...@@ -91,7 +92,9 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -91,7 +92,9 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
+ "anchorCiq" + tag + ".jpg"; + "anchorCiq" + tag + ".jpg";
imgFile = new File(imgUrl); imgFile = new File(imgUrl);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.medicalrecords) { for (GenTableColumn gtc : Configs.medicalrecords) {
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.TREATMENT_RECORD); CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.TREATMENT_RECORD);
observableList.add(cgi); observableList.add(cgi);
} }
...@@ -114,6 +117,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -114,6 +117,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setContent(medicalRecordEntity.getRemark()); remarkParamEntity.setContent(medicalRecordEntity.getRemark());
String[] filedName = EntityUtils.getFiledName(medicalRecordEntity); String[] filedName = EntityUtils.getFiledName(medicalRecordEntity);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (String name : filedName) { for (String name : filedName) {
for (GenTableColumn gtc : Configs.medicalrecords) { for (GenTableColumn gtc : Configs.medicalrecords) {
...@@ -142,6 +146,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -142,6 +146,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
e.printStackTrace(); e.printStackTrace();
} }
} }
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
onNotifyAllEvent.setValue(false); onNotifyAllEvent.setValue(false);
...@@ -296,9 +301,11 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -296,9 +301,11 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setShowName(""); remarkParamEntity.setShowName("");
currentParamEntity = new GenTableColumn(); currentParamEntity = new GenTableColumn();
uuid = 0; uuid = 0;
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.medicalrecords) { for (GenTableColumn gtc : Configs.medicalrecords) {
gtc.setShowName(""); gtc.setShowName("");
gtc.setContent(""); gtc.setContent("");
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
......
...@@ -25,6 +25,7 @@ import com.phlx.anchorcollect_p.entity.GenTableColumn; ...@@ -25,6 +25,7 @@ import com.phlx.anchorcollect_p.entity.GenTableColumn;
import com.phlx.anchorcollect_p.entity.PerformanceEntity; import com.phlx.anchorcollect_p.entity.PerformanceEntity;
import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem;
import com.phlx.anchorcollect_p.util.EntityUtils; import com.phlx.anchorcollect_p.util.EntityUtils;
import com.phlx.anchorcollect_p.util.LoginInfoUtils;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
...@@ -92,7 +93,9 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -92,7 +93,9 @@ public class PerformanceVM extends BaseViewModel<Repository> {
+ "anchorCiq" + tag + ".jpg"; + "anchorCiq" + tag + ".jpg";
imgFile = new File(imgUrl); imgFile = new File(imgUrl);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.performance) { for (GenTableColumn gtc : Configs.performance) {
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.SIGN_MEASURE); CollectGridItem cgi = new CollectGridItem(this, gtc, Configs.SIGN_MEASURE);
observableList.add(cgi); observableList.add(cgi);
} }
...@@ -115,10 +118,9 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -115,10 +118,9 @@ public class PerformanceVM extends BaseViewModel<Repository> {
remarkParamEntity.setContent(performanceEntity.getRemark()); remarkParamEntity.setContent(performanceEntity.getRemark());
String[] filedName = EntityUtils.getFiledName(performanceEntity); String[] filedName = EntityUtils.getFiledName(performanceEntity);
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (String name : filedName) { for (String name : filedName) {
for (GenTableColumn gtc : Configs.performance) { for (GenTableColumn gtc : Configs.performance) {
if (name.equals(gtc.getJavaField())) { if (name.equals(gtc.getJavaField())) {
try { try {
Object fieldValueByName = EntityUtils.getFieldValueByName(name, performanceEntity); Object fieldValueByName = EntityUtils.getFieldValueByName(name, performanceEntity);
...@@ -143,6 +145,7 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -143,6 +145,7 @@ public class PerformanceVM extends BaseViewModel<Repository> {
e.printStackTrace(); e.printStackTrace();
} }
} }
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
onNotifyAllEvent.setValue(false); onNotifyAllEvent.setValue(false);
...@@ -329,9 +332,11 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -329,9 +332,11 @@ public class PerformanceVM extends BaseViewModel<Repository> {
remarkParamEntity.setShowName(""); remarkParamEntity.setShowName("");
currentParamEntity = new GenTableColumn(); currentParamEntity = new GenTableColumn();
uuid = 0; uuid = 0;
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.performance) { for (GenTableColumn gtc : Configs.performance) {
gtc.setShowName(""); gtc.setShowName("");
gtc.setContent(""); gtc.setContent("");
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
......
...@@ -37,6 +37,7 @@ import com.phlx.anchorcollect_p.event.EventMsg; ...@@ -37,6 +37,7 @@ import com.phlx.anchorcollect_p.event.EventMsg;
import com.phlx.anchorcollect_p.event.EventTag; import com.phlx.anchorcollect_p.event.EventTag;
import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect_p.ui.fragment.list.CollectGridItem;
import com.phlx.anchorcollect_p.util.EntityUtils; import com.phlx.anchorcollect_p.util.EntityUtils;
import com.phlx.anchorcollect_p.util.LoginInfoUtils;
import com.phlx.anchorcollect_p.util.TextUtil; import com.phlx.anchorcollect_p.util.TextUtil;
import com.uhf.structures.InventoryData; import com.uhf.structures.InventoryData;
import com.uhf.structures.OnInventoryListener; import com.uhf.structures.OnInventoryListener;
...@@ -158,7 +159,9 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor ...@@ -158,7 +159,9 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
// imgFile = new File(imgUrl); // imgFile = new File(imgUrl);
uiList.clear(); uiList.clear();
int i = 0; int i = 0;
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.weightMan) { for (GenTableColumn gtc : Configs.weightMan) {
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
if (i < 4) { if (i < 4) {
uiList.add(gtc); uiList.add(gtc);
} else { } else {
...@@ -477,10 +480,9 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor ...@@ -477,10 +480,9 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
queryGainWeight();//刷新一下增重数据 queryGainWeight();//刷新一下增重数据
String[] filedName = EntityUtils.getFiledName(result.get(0)); String[] filedName = EntityUtils.getFiledName(result.get(0));
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (String name : filedName) { for (String name : filedName) {
for (GenTableColumn gtc : Configs.weightMan) { for (GenTableColumn gtc : Configs.weightMan) {
if (name.equals(gtc.getJavaField())) { if (name.equals(gtc.getJavaField())) {
try { try {
Log.e("key:", name); Log.e("key:", name);
...@@ -506,6 +508,7 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor ...@@ -506,6 +508,7 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
e.printStackTrace(); e.printStackTrace();
} }
} }
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
...@@ -639,9 +642,11 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor ...@@ -639,9 +642,11 @@ public class WeightManVM extends BaseViewModel<Repository> implements OnInventor
remarkParamEntity.setContent(""); remarkParamEntity.setContent("");
remarkParamEntity.setShowName(""); remarkParamEntity.setShowName("");
currentParamEntity = new GenTableColumn(); currentParamEntity = new GenTableColumn();
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (GenTableColumn gtc : Configs.weightMan) { for (GenTableColumn gtc : Configs.weightMan) {
gtc.setShowName(""); gtc.setShowName("");
gtc.setContent(""); gtc.setContent("");
LoginInfoUtils.setGenTableColumnDefault(gtc, dateFormat);
} }
} }
} }
...@@ -4,10 +4,15 @@ package com.phlx.anchorcollect_p.util; ...@@ -4,10 +4,15 @@ package com.phlx.anchorcollect_p.util;
import com.phlx.anchorcollect_p.Configs; import com.phlx.anchorcollect_p.Configs;
import com.phlx.anchorcollect_p.entity.DictEntity; import com.phlx.anchorcollect_p.entity.DictEntity;
import com.phlx.anchorcollect_p.entity.FrozenSemenEntity; import com.phlx.anchorcollect_p.entity.FrozenSemenEntity;
import com.phlx.anchorcollect_p.entity.GenTableColumn;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import me.goldze.mvvmhabit.utils.StringUtils;
public class LoginInfoUtils { public class LoginInfoUtils {
public static List<String> getDistNameList(String type){ public static List<String> getDistNameList(String type){
...@@ -49,4 +54,27 @@ public class LoginInfoUtils { ...@@ -49,4 +54,27 @@ public class LoginInfoUtils {
return null; return null;
} }
/**
* 给单选设置默认值,给日期设置默认当天
* @param gtc
* @param dateFormat
*/
public static void setGenTableColumnDefault(GenTableColumn gtc, SimpleDateFormat dateFormat){
//增加单选默认值
if (StringUtils.isEmpty(gtc.getContent()) && (gtc.getHtmlType().equals("select") || gtc.getHtmlType().equals("radio"))) {
List<DictEntity> dictEntities = LoginInfoUtils.getDistList(gtc.getDictType());
for (int i = 0; i < dictEntities.size(); i++) {
if ("Y".equals(dictEntities.get(i).getIsDefault())) {
gtc.setContent(dictEntities.get(i).getDictValue());
gtc.setShowName(dictEntities.get(i).getDictLabel());
}
}
}
//增加时间默认值
if (StringUtils.isEmpty(gtc.getContent()) && gtc.getHtmlType().equals("datetime")) {
gtc.setContent(dateFormat.format(new Date()));
gtc.setShowName(dateFormat.format(new Date()));
}
}
} }
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_1_1_title" android:id="@+id/tv_1_1_title"
style="@style/ItemTitleFontBlueStyle" style="@style/ItemTitleFontBlueStyle"
android:text="@string/registration_no" android:text="@string/individual_no"
binding:layout_constraintTop_toTopOf="parent" binding:layout_constraintTop_toTopOf="parent"
binding:layout_constraintStart_toStartOf="parent" binding:layout_constraintStart_toStartOf="parent"
binding:layout_constraintBottom_toTopOf="@+id/tv_2_1_title" binding:layout_constraintBottom_toTopOf="@+id/tv_2_1_title"
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_1_1" android:id="@+id/tv_1_1"
style="@style/ItemContentFontBlackStyle" style="@style/ItemContentFontBlackStyle"
android:text="@{viewModel.entity.registrationNo}" android:text="@{viewModel.entity.individualNo}"
binding:layout_constraintTop_toTopOf="@+id/tv_1_1_title" binding:layout_constraintTop_toTopOf="@+id/tv_1_1_title"
binding:layout_constraintLeft_toRightOf="@+id/tv_1_1_title" binding:layout_constraintLeft_toRightOf="@+id/tv_1_1_title"
/> />
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_2_1_title" android:id="@+id/tv_2_1_title"
style="@style/ItemTitleFontBlueStyle" style="@style/ItemTitleFontBlueStyle"
android:text="@string/individual_no" android:text="@string/registration_no"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
binding:layout_constraintStart_toStartOf="parent" binding:layout_constraintStart_toStartOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/tv_1_1_title" /> binding:layout_constraintTop_toBottomOf="@+id/tv_1_1_title" />
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_2_1" android:id="@+id/tv_2_1"
style="@style/ItemContentFontBlackStyle" style="@style/ItemContentFontBlackStyle"
android:text="@{viewModel.entity.individualNo}" android:text="@{viewModel.entity.registrationNo}"
binding:layout_constraintTop_toTopOf="@+id/tv_2_1_title" binding:layout_constraintTop_toTopOf="@+id/tv_2_1_title"
binding:layout_constraintLeft_toRightOf="@+id/tv_2_1_title" binding:layout_constraintLeft_toRightOf="@+id/tv_2_1_title"
/> />
......
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