Commit ca9728fd authored by hywang's avatar hywang

1.增加错误数据上传功能;

2.基础信息页面增重显示;
3.登录超时跳转登录页;
4.所有功能的备注功能;
5.修复一些bug
parent 53296ef1
...@@ -5,6 +5,7 @@ import android.content.pm.PackageInfo; ...@@ -5,6 +5,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Typeface; import android.graphics.Typeface;
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;
...@@ -115,6 +116,8 @@ public class Configs { ...@@ -115,6 +116,8 @@ public class Configs {
public static String tempRfid = ""; public static String tempRfid = "";
//临时存放列表查询unid //临时存放列表查询unid
public static Long tempUnid; public static Long tempUnid;
//临时存放耳标数据
public static CattleResumeEntity tempCattleResume;
//首页fragment标签 //首页fragment标签
public static int mainPosition; public static int mainPosition;
......
...@@ -103,7 +103,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -103,7 +103,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
} }
@Override @Override
public Observable<CollectResponse> uploadPerformanceList(RequestBody body) { public Observable<ListResponse<Long>> uploadPerformanceList(RequestBody body) {
return mHttpDataSource.uploadPerformanceList(body); return mHttpDataSource.uploadPerformanceList(body);
} }
...@@ -118,7 +118,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -118,7 +118,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
} }
@Override @Override
public Observable<CollectResponse> uploadBreedingRecordList(RequestBody body) { public Observable<ListResponse<Long>> uploadBreedingRecordList(RequestBody body) {
return mHttpDataSource.uploadBreedingRecordList(body); return mHttpDataSource.uploadBreedingRecordList(body);
} }
...@@ -133,7 +133,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -133,7 +133,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
} }
@Override @Override
public Observable<CollectResponse> uploadBreedingRecordDetailList(RequestBody body) { public Observable<ListResponse<Long>> uploadBreedingRecordDetailList(RequestBody body) {
return mHttpDataSource.uploadBreedingRecordDetailList(body); return mHttpDataSource.uploadBreedingRecordDetailList(body);
} }
...@@ -148,7 +148,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -148,7 +148,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
} }
@Override @Override
public Observable<CollectResponse> uploadWeightManList(RequestBody body) { public Observable<ListResponse<Long>> uploadWeightManList(RequestBody body) {
return mHttpDataSource.uploadWeightManList(body); return mHttpDataSource.uploadWeightManList(body);
} }
...@@ -163,7 +163,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -163,7 +163,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
} }
@Override @Override
public Observable<CollectResponse> uploadMedicalRecordList(RequestBody body) { public Observable<ListResponse<Long>> uploadMedicalRecordList(RequestBody body) {
return mHttpDataSource.uploadMedicalRecordList(body); return mHttpDataSource.uploadMedicalRecordList(body);
} }
...@@ -178,7 +178,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -178,7 +178,7 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
} }
@Override @Override
public Observable<CollectResponse> uploadImmuneBatchList(RequestBody body) { public Observable<ListResponse<Long>> uploadImmuneBatchList(RequestBody body) {
return mHttpDataSource.uploadImmuneBatchList(body); return mHttpDataSource.uploadImmuneBatchList(body);
} }
...@@ -193,10 +193,15 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo ...@@ -193,10 +193,15 @@ public class Repository extends BaseModel implements HttpDataSource, LocalDataSo
} }
@Override @Override
public Observable<CollectResponse> uploadImmuneBatchDetailList(RequestBody body) { public Observable<ListResponse<Long>> uploadImmuneBatchDetailList(RequestBody body) {
return mHttpDataSource.uploadImmuneBatchDetailList(body); return mHttpDataSource.uploadImmuneBatchDetailList(body);
} }
@Override
public Observable<CollectResponse> uploadErrorData(RequestBody body) {
return mHttpDataSource.uploadErrorData(body);
}
/****************************************************************************/ /****************************************************************************/
@Override @Override
......
...@@ -102,7 +102,7 @@ public interface ApiService { ...@@ -102,7 +102,7 @@ public interface ApiService {
*/ */
@Headers({"Content-Type: application/json", "Accept: application/json"}) @Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/performance/add") @POST("/api/performance/add")
Observable<CollectResponse> uploadPerformanceList(@Body RequestBody body); Observable<ListResponse<Long>> uploadPerformanceList(@Body RequestBody body);
/** /**
* 获取-配种记录主表-列表 * 获取-配种记录主表-列表
...@@ -124,7 +124,7 @@ public interface ApiService { ...@@ -124,7 +124,7 @@ public interface ApiService {
*/ */
@Headers({"Content-Type: application/json", "Accept: application/json"}) @Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/cattlematingMaster/add") @POST("/api/cattlematingMaster/add")
Observable<CollectResponse> uploadBreedingRecordList(@Body RequestBody body); Observable<ListResponse<Long>> uploadBreedingRecordList(@Body RequestBody body);
/** /**
* 获取-配种记录子表-列表 * 获取-配种记录子表-列表
...@@ -146,7 +146,7 @@ public interface ApiService { ...@@ -146,7 +146,7 @@ public interface ApiService {
*/ */
@Headers({"Content-Type: application/json", "Accept: application/json"}) @Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/cattlematingDetaill/add") @POST("/api/cattlematingDetaill/add")
Observable<CollectResponse> uploadBreedingRecordDetailList(@Body RequestBody body); Observable<ListResponse<Long>> uploadBreedingRecordDetailList(@Body RequestBody body);
/** /**
* 获取-称重管理-列表 * 获取-称重管理-列表
...@@ -168,7 +168,7 @@ public interface ApiService { ...@@ -168,7 +168,7 @@ public interface ApiService {
*/ */
@Headers({"Content-Type: application/json", "Accept: application/json"}) @Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/weightMan/add") @POST("/api/weightMan/add")
Observable<CollectResponse> uploadWeightManList(@Body RequestBody body); Observable<ListResponse<Long>> uploadWeightManList(@Body RequestBody body);
/** /**
* 获取-诊疗记录-列表 * 获取-诊疗记录-列表
...@@ -190,7 +190,7 @@ public interface ApiService { ...@@ -190,7 +190,7 @@ public interface ApiService {
*/ */
@Headers({"Content-Type: application/json", "Accept: application/json"}) @Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/medicalrecords/add") @POST("/api/medicalrecords/add")
Observable<CollectResponse> uploadMedicalRecordList(@Body RequestBody body); Observable<ListResponse<Long>> uploadMedicalRecordList(@Body RequestBody body);
/** /**
* 获取-免疫记录-列表 * 获取-免疫记录-列表
...@@ -212,7 +212,7 @@ public interface ApiService { ...@@ -212,7 +212,7 @@ public interface ApiService {
*/ */
@Headers({"Content-Type: application/json", "Accept: application/json"}) @Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/immunebatch/add") @POST("/api/immunebatch/add")
Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body); Observable<ListResponse<Long>> uploadImmuneBatchList(@Body RequestBody body);
/** /**
* 获取-免疫记录-子表-列表 * 获取-免疫记录-子表-列表
...@@ -234,9 +234,14 @@ public interface ApiService { ...@@ -234,9 +234,14 @@ public interface ApiService {
*/ */
@Headers({"Content-Type: application/json", "Accept: application/json"}) @Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/immunebatchDetail/add") @POST("/api/immunebatchDetail/add")
Observable<CollectResponse> uploadImmuneBatchDetailList(@Body RequestBody body); Observable<ListResponse<Long>> uploadImmuneBatchDetailList(@Body RequestBody body);
/**
* 上传-错误记录
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/api/error/add")
Observable<CollectResponse> uploadErrorData(@Body RequestBody body);
......
...@@ -82,7 +82,7 @@ public interface HttpDataSource { ...@@ -82,7 +82,7 @@ public interface HttpDataSource {
/** /**
* 上传性能测定列表 * 上传性能测定列表
*/ */
Observable<CollectResponse> uploadPerformanceList(@Body RequestBody body); Observable<ListResponse<Long>> uploadPerformanceList(@Body RequestBody body);
/** /**
* 获取-配种记录主表-列表 * 获取-配种记录主表-列表
...@@ -98,7 +98,7 @@ public interface HttpDataSource { ...@@ -98,7 +98,7 @@ public interface HttpDataSource {
/** /**
* 上传-配种记录主表-列表 * 上传-配种记录主表-列表
*/ */
Observable<CollectResponse> uploadBreedingRecordList(@Body RequestBody body); Observable<ListResponse<Long>> uploadBreedingRecordList(@Body RequestBody body);
/** /**
* 获取-配种记录子表-列表 * 获取-配种记录子表-列表
...@@ -114,7 +114,7 @@ public interface HttpDataSource { ...@@ -114,7 +114,7 @@ public interface HttpDataSource {
/** /**
* 上传-配种记录子表-列表 * 上传-配种记录子表-列表
*/ */
Observable<CollectResponse> uploadBreedingRecordDetailList(@Body RequestBody body); Observable<ListResponse<Long>> uploadBreedingRecordDetailList(@Body RequestBody body);
/** /**
* 获取-称重管理-列表 * 获取-称重管理-列表
...@@ -130,7 +130,7 @@ public interface HttpDataSource { ...@@ -130,7 +130,7 @@ public interface HttpDataSource {
/** /**
* 上传-称重管理-列表 * 上传-称重管理-列表
*/ */
Observable<CollectResponse> uploadWeightManList(@Body RequestBody body); Observable<ListResponse<Long>> uploadWeightManList(@Body RequestBody body);
/** /**
* 获取-诊疗记录-列表 * 获取-诊疗记录-列表
...@@ -146,7 +146,7 @@ public interface HttpDataSource { ...@@ -146,7 +146,7 @@ public interface HttpDataSource {
/** /**
* 上传-诊疗记录-列表 * 上传-诊疗记录-列表
*/ */
Observable<CollectResponse> uploadMedicalRecordList(@Body RequestBody body); Observable<ListResponse<Long>> uploadMedicalRecordList(@Body RequestBody body);
/** /**
* 获取-免疫记录-列表 * 获取-免疫记录-列表
...@@ -162,7 +162,7 @@ public interface HttpDataSource { ...@@ -162,7 +162,7 @@ public interface HttpDataSource {
/** /**
* 上传-免疫记录-列表 * 上传-免疫记录-列表
*/ */
Observable<CollectResponse> uploadImmuneBatchList(@Body RequestBody body); Observable<ListResponse<Long>> uploadImmuneBatchList(@Body RequestBody body);
/** /**
* 获取-免疫记录-子表-列表 * 获取-免疫记录-子表-列表
...@@ -178,5 +178,10 @@ public interface HttpDataSource { ...@@ -178,5 +178,10 @@ public interface HttpDataSource {
/** /**
* 上传-免疫记录-子表-列表 * 上传-免疫记录-子表-列表
*/ */
Observable<CollectResponse> uploadImmuneBatchDetailList(@Body RequestBody body); Observable<ListResponse<Long>> uploadImmuneBatchDetailList(@Body RequestBody body);
/**
* 上传-错误记录
*/
Observable<CollectResponse> uploadErrorData(@Body RequestBody body);
} }
...@@ -95,7 +95,7 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -95,7 +95,7 @@ public class HttpDataSourceImpl implements HttpDataSource {
} }
@Override @Override
public Observable<CollectResponse> uploadPerformanceList(RequestBody body) { public Observable<ListResponse<Long>> uploadPerformanceList(RequestBody body) {
return apiService.uploadPerformanceList(body); return apiService.uploadPerformanceList(body);
} }
...@@ -110,7 +110,7 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -110,7 +110,7 @@ public class HttpDataSourceImpl implements HttpDataSource {
} }
@Override @Override
public Observable<CollectResponse> uploadBreedingRecordList(RequestBody body) { public Observable<ListResponse<Long>> uploadBreedingRecordList(RequestBody body) {
return apiService.uploadBreedingRecordList(body); return apiService.uploadBreedingRecordList(body);
} }
...@@ -125,7 +125,7 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -125,7 +125,7 @@ public class HttpDataSourceImpl implements HttpDataSource {
} }
@Override @Override
public Observable<CollectResponse> uploadBreedingRecordDetailList(RequestBody body) { public Observable<ListResponse<Long>> uploadBreedingRecordDetailList(RequestBody body) {
return apiService.uploadBreedingRecordDetailList(body); return apiService.uploadBreedingRecordDetailList(body);
} }
...@@ -140,7 +140,7 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -140,7 +140,7 @@ public class HttpDataSourceImpl implements HttpDataSource {
} }
@Override @Override
public Observable<CollectResponse> uploadWeightManList(RequestBody body) { public Observable<ListResponse<Long>> uploadWeightManList(RequestBody body) {
return apiService.uploadWeightManList(body); return apiService.uploadWeightManList(body);
} }
...@@ -155,7 +155,7 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -155,7 +155,7 @@ public class HttpDataSourceImpl implements HttpDataSource {
} }
@Override @Override
public Observable<CollectResponse> uploadMedicalRecordList(RequestBody body) { public Observable<ListResponse<Long>> uploadMedicalRecordList(RequestBody body) {
return apiService.uploadMedicalRecordList(body); return apiService.uploadMedicalRecordList(body);
} }
...@@ -170,7 +170,7 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -170,7 +170,7 @@ public class HttpDataSourceImpl implements HttpDataSource {
} }
@Override @Override
public Observable<CollectResponse> uploadImmuneBatchList(RequestBody body) { public Observable<ListResponse<Long>> uploadImmuneBatchList(RequestBody body) {
return apiService.uploadImmuneBatchList(body); return apiService.uploadImmuneBatchList(body);
} }
...@@ -185,7 +185,12 @@ public class HttpDataSourceImpl implements HttpDataSource { ...@@ -185,7 +185,12 @@ public class HttpDataSourceImpl implements HttpDataSource {
} }
@Override @Override
public Observable<CollectResponse> uploadImmuneBatchDetailList(RequestBody body) { public Observable<ListResponse<Long>> uploadImmuneBatchDetailList(RequestBody body) {
return apiService.uploadImmuneBatchDetailList(body); return apiService.uploadImmuneBatchDetailList(body);
} }
@Override
public Observable<CollectResponse> uploadErrorData(RequestBody body) {
return apiService.uploadErrorData(body);
}
} }
...@@ -69,7 +69,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -69,7 +69,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
/** /**
* 配种成功 * 配种成功
*/ */
private Integer pregnancy; private String pregnancy;
/** /**
* 部门id * 部门id
...@@ -123,11 +123,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -123,11 +123,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
isReturn = in.readString(); isReturn = in.readString();
backLoveDate = in.readString(); backLoveDate = in.readString();
dueDate = in.readString(); dueDate = in.readString();
if (in.readByte() == 0) { pregnancy = in.readString();
pregnancy = null;
} else {
pregnancy = in.readInt();
}
if (in.readByte() == 0) { if (in.readByte() == 0) {
deptId = null; deptId = null;
} else { } else {
...@@ -142,10 +138,10 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -142,10 +138,10 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
remark = in.readString(); remark = in.readString();
} }
@Generated(hash = 1374135081) @Generated(hash = 933327768)
public BreedingRecordDetailEntity(Long unid, Long fUnid, String matingStyle, Long cattleresumeId, public BreedingRecordDetailEntity(Long unid, Long fUnid, String matingStyle, Long cattleresumeId,
String frozenSemenBatch, String matingDate, String isReturn, String backLoveDate, String dueDate, String frozenSemenBatch, String matingDate, String isReturn, String backLoveDate, String dueDate,
Integer pregnancy, Long deptId, String uploadStatus, String searchValue, String createBy, String pregnancy, Long deptId, String uploadStatus, String searchValue, String createBy,
String createTime, String updateBy, String updateTime, String remark) { String createTime, String updateBy, String updateTime, String remark) {
this.unid = unid; this.unid = unid;
this.fUnid = fUnid; this.fUnid = fUnid;
...@@ -193,12 +189,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -193,12 +189,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
dest.writeString(isReturn); dest.writeString(isReturn);
dest.writeString(backLoveDate); dest.writeString(backLoveDate);
dest.writeString(dueDate); dest.writeString(dueDate);
if (pregnancy == null) { dest.writeString(pregnancy);
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(pregnancy);
}
if (deptId == null) { if (deptId == null) {
dest.writeByte((byte) 0); dest.writeByte((byte) 0);
} else { } else {
...@@ -303,11 +294,11 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -303,11 +294,11 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
this.dueDate = dueDate; this.dueDate = dueDate;
} }
public Integer getPregnancy() { public String getPregnancy() {
return pregnancy; return pregnancy;
} }
public void setPregnancy(Integer pregnancy) { public void setPregnancy(String pregnancy) {
this.pregnancy = pregnancy; this.pregnancy = pregnancy;
} }
...@@ -407,4 +398,5 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -407,4 +398,5 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
this.fUnid = fUnid; this.fUnid = fUnid;
} }
} }
...@@ -15,7 +15,6 @@ import org.greenrobot.greendao.annotation.Generated; ...@@ -15,7 +15,6 @@ import org.greenrobot.greendao.annotation.Generated;
@Entity @Entity
public class DictEntity extends BaseObservable implements Parcelable { public class DictEntity extends BaseObservable implements Parcelable {
private static final long serialVersionUID = 1L;
/** 字典编码 */ /** 字典编码 */
// @Id(autoincrement = false) // @Id(autoincrement = false)
...@@ -251,8 +250,8 @@ public class DictEntity extends BaseObservable implements Parcelable { ...@@ -251,8 +250,8 @@ public class DictEntity extends BaseObservable implements Parcelable {
@Override @Override
public String toString() { public String toString() {
return "DictEntity{" + return "DictEntity{" +
"dictCode='" + dictCode + '\'' + "dictCode=" + dictCode +
", dictSort='" + dictSort + '\'' + ", dictSort=" + dictSort +
", dictLabel='" + dictLabel + '\'' + ", dictLabel='" + dictLabel + '\'' +
", dictValue='" + dictValue + '\'' + ", dictValue='" + dictValue + '\'' +
", dictType='" + dictType + '\'' + ", dictType='" + dictType + '\'' +
......
package com.phlx.anchorcollect.entity;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.databinding.BaseObservable;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
public class ErrorEntity extends BaseObservable implements Parcelable {
/**
* 主键
*/
private Long id;
/**
* 类型
*/
private String type;
/**
* 内容
*/
private String content;
/**
* 部门id
*/
private Long deptId;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间 "yyyy-MM-dd HH:mm:ss"
*/
private String createTime;
public ErrorEntity() {
}
protected ErrorEntity(Parcel in) {
if (in.readByte() == 0) {
id = null;
} else {
id = in.readLong();
}
type = in.readString();
content = in.readString();
if (in.readByte() == 0) {
deptId = null;
} else {
deptId = in.readLong();
}
createBy = in.readString();
createTime = in.readString();
}
@Generated(hash = 573013660)
public ErrorEntity(Long id, String type, String content, Long deptId,
String createBy, String createTime) {
this.id = id;
this.type = type;
this.content = content;
this.deptId = deptId;
this.createBy = createBy;
this.createTime = createTime;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
if (id == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(id);
}
dest.writeString(type);
dest.writeString(content);
if (deptId == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(deptId);
}
dest.writeString(createBy);
dest.writeString(createTime);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<ErrorEntity> CREATOR = new Creator<ErrorEntity>() {
@Override
public ErrorEntity createFromParcel(Parcel in) {
return new ErrorEntity(in);
}
@Override
public ErrorEntity[] newArray(int size) {
return new ErrorEntity[size];
}
};
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "ErrorEntity{" +
"id=" + id +
", type='" + type + '\'' +
", content='" + content + '\'' +
", deptId=" + deptId +
", createBy='" + createBy + '\'' +
", createTime='" + createTime + '\'' +
'}';
}
}
...@@ -50,12 +50,12 @@ public class GenTableColumn extends BaseObservable implements Parcelable { ...@@ -50,12 +50,12 @@ public class GenTableColumn extends BaseObservable implements Parcelable {
private String isRequired; private String isRequired;
/** /**
* 是否为插入字段(1是)新增时是否显示字段 * 是否为插入字段(1是)新增时是否显示字段(暂时没有用到)
*/ */
private String isInsert; private String isInsert;
/** /**
* 是否编辑字段(1是)修改时是否可编辑 * 是否编辑字段(1是)是否可以修改
*/ */
private String isEdit; private String isEdit;
...@@ -65,7 +65,7 @@ public class GenTableColumn extends BaseObservable implements Parcelable { ...@@ -65,7 +65,7 @@ public class GenTableColumn extends BaseObservable implements Parcelable {
private String isList; private String isList;
/** /**
* 是否查询字段(1是)暂时保留 * 是否查询字段(1是)用来控制是否显示
*/ */
private String isQuery; private String isQuery;
......
...@@ -29,7 +29,7 @@ public class PerformanceEntity extends BaseObservable implements Parcelable { ...@@ -29,7 +29,7 @@ public class PerformanceEntity extends BaseObservable implements Parcelable {
/** /**
* 年龄 * 年龄
*/ */
private Integer age; private String age;
/** /**
* 测量日期 * 测量日期
...@@ -166,11 +166,7 @@ public class PerformanceEntity extends BaseObservable implements Parcelable { ...@@ -166,11 +166,7 @@ public class PerformanceEntity extends BaseObservable implements Parcelable {
} else { } else {
cattleresumeId = in.readLong(); cattleresumeId = in.readLong();
} }
if (in.readByte() == 0) { age = in.readString();
age = null;
} else {
age = in.readInt();
}
measureDate = in.readString(); measureDate = in.readString();
if (in.readByte() == 0) { if (in.readByte() == 0) {
height = null; height = null;
...@@ -260,8 +256,8 @@ public class PerformanceEntity extends BaseObservable implements Parcelable { ...@@ -260,8 +256,8 @@ public class PerformanceEntity extends BaseObservable implements Parcelable {
remark = in.readString(); remark = in.readString();
} }
@Generated(hash = 750638439) @Generated(hash = 2014621603)
public PerformanceEntity(Long unid, Long cattleresumeId, Integer age, String measureDate, public PerformanceEntity(Long unid, Long cattleresumeId, String age, String measureDate,
Double height, Double length, Double bust, Double weight, Double chestWidth, Double height, Double length, Double bust, Double weight, Double chestWidth,
Double chestDeep, Double waistWidth, Double crossWidth, Double guanWei, Double chestDeep, Double waistWidth, Double crossWidth, Double guanWei,
Double eyeMuscleArea, String grade, Double hairLength, Double hairFineness, Double shearing, Double eyeMuscleArea, String grade, Double hairLength, Double hairFineness, Double shearing,
...@@ -314,12 +310,7 @@ public class PerformanceEntity extends BaseObservable implements Parcelable { ...@@ -314,12 +310,7 @@ public class PerformanceEntity extends BaseObservable implements Parcelable {
dest.writeByte((byte) 1); dest.writeByte((byte) 1);
dest.writeLong(cattleresumeId); dest.writeLong(cattleresumeId);
} }
if (age == null) { dest.writeString(age);
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(age);
}
dest.writeString(measureDate); dest.writeString(measureDate);
if (height == null) { if (height == null) {
dest.writeByte((byte) 0); dest.writeByte((byte) 0);
...@@ -457,11 +448,11 @@ public class PerformanceEntity extends BaseObservable implements Parcelable { ...@@ -457,11 +448,11 @@ public class PerformanceEntity extends BaseObservable implements Parcelable {
this.cattleresumeId = cattleresumeId; this.cattleresumeId = cattleresumeId;
} }
public Integer getAge() { public String getAge() {
return age; return age;
} }
public void setAge(Integer age) { public void setAge(String age) {
this.age = age; this.age = age;
} }
......
...@@ -303,4 +303,29 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -303,4 +303,29 @@ public class UserEntity extends BaseObservable implements Parcelable {
public void setRoles(List<UserRoleEntity> roles) { public void setRoles(List<UserRoleEntity> roles) {
this.roles = roles; this.roles = roles;
} }
@Override
public String toString() {
return "UserEntity{" +
"userId=" + userId +
", deptId=" + deptId +
", parentId=" + parentId +
", roleId=" + roleId +
", loginName='" + loginName + '\'' +
", userName='" + userName + '\'' +
", userType='" + userType + '\'' +
", email='" + email + '\'' +
", phonenumber='" + phonenumber + '\'' +
", sex='" + sex + '\'' +
", avatar='" + avatar + '\'' +
", password='" + password + '\'' +
", salt='" + salt + '\'' +
", status='" + status + '\'' +
", delFlag='" + delFlag + '\'' +
", loginIp='" + loginIp + '\'' +
", loginDate='" + loginDate + '\'' +
", pwdUpdateDate='" + pwdUpdateDate + '\'' +
", roles=" + roles +
'}';
}
} }
...@@ -189,14 +189,6 @@ public class WeightManEntity extends BaseObservable implements Parcelable { ...@@ -189,14 +189,6 @@ public class WeightManEntity extends BaseObservable implements Parcelable {
this.weight = weight; this.weight = weight;
} }
public String getwTime() {
return wTime;
}
public void setwTime(String wTime) {
this.wTime = wTime;
}
public String getUploadStatus() { public String getUploadStatus() {
return uploadStatus; return uploadStatus;
} }
......
...@@ -50,12 +50,14 @@ public class RetrofitClient { ...@@ -50,12 +50,14 @@ public class RetrofitClient {
private static final int CACHE_TIMEOUT = 10 * 1024 * 1024; private static final int CACHE_TIMEOUT = 10 * 1024 * 1024;
//服务端根路径 //服务端根路径
public static String baseUrl = public static String baseUrl =
"39.101.170.186"//正式 // "serve.xlglmnmyzspt.org.cn"//正式
"39.101.170.186"//阿里云测试
// "192.168.8.135"//董 // "192.168.8.135"//董
// "192.168.43.154"//张敏 // "192.168.43.154"//张敏
; ;
public static String port = public static String port =
"9000"//正式 // ""//正式
"9000"//阿里云测试
// "9000"//董 // "9000"//董
; ;
......
...@@ -331,14 +331,14 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin ...@@ -331,14 +331,14 @@ public class BasicsCollectFragment extends BaseFragment<FragmentBasicsCollectBin
// dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); // dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
String inputStr = dialog.getInputEditText().getText().toString(); String inputStr = dialog.getInputEditText().getText().toString();
if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) { // if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) {
dialog.getInputEditText().setText(inputStr.subSequence(0, 10)); // dialog.getInputEditText().setText(inputStr.subSequence(0, 10));
ToastUtils.showShort("输入长度超长"); // ToastUtils.showShort("输入长度超长");
} else { // } else {
viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.notifyChange(); viewModel.currentParamEntity.notifyChange();
} // }
} }
}) })
.show(); .show();
......
...@@ -145,10 +145,10 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -145,10 +145,10 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
viewModel.onNotifyAllEvent.observe(getActivity(), new Observer<Boolean>() { viewModel.onNotifyAllEvent.observe(getActivity(), new Observer<Boolean>() {
@Override @Override
public void onChanged(Boolean aBoolean) { public void onChanged(Boolean aBoolean) {
if (aBoolean) { // if (aBoolean) {
viewModel.clearParamList(); // viewModel.clearParamList();
viewModel.clearDetailParamList(); // viewModel.clearDetailParamList();
} // }
for (GenTableColumn gtc : viewModel.uiList) { for (GenTableColumn gtc : viewModel.uiList) {
gtc.notifyChange(); gtc.notifyChange();
...@@ -157,7 +157,9 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -157,7 +157,9 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
binding.rvCollect.getAdapter().notifyDataSetChanged(); binding.rvCollect.getAdapter().notifyDataSetChanged();
binding.rvCollectDetail.getAdapter().notifyDataSetChanged(); binding.rvCollectDetail.getAdapter().notifyDataSetChanged();
updateRecordData(); if (aBoolean) {
updateRecordData();
}
} }
}); });
...@@ -244,12 +246,34 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -244,12 +246,34 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
inputType = InputType.TYPE_CLASS_TEXT; inputType = InputType.TYPE_CLASS_TEXT;
} }
int finalInputType = inputType; int finalInputType = inputType;
//判断下限制的长度
int columnSize = 500;//不限制的设置成500
if (uiParamEntity.getColumnType().indexOf("(") > -1 && uiParamEntity.getColumnType().indexOf(")") > -1) {
if (uiParamEntity.getColumnType().indexOf(",") > -1) {//有“,”说明是Duoble
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(",")
)
);
} else {
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(")")
)
);
}
}
new MaterialDialog.Builder(getActivity()) new MaterialDialog.Builder(getActivity())
.title(uiParamEntity.getColumnComment()) .title(uiParamEntity.getColumnComment())
// .iconRes(R.drawable.ic_logo) // .iconRes(R.drawable.ic_logo)
.content("请输入") .content("请输入")
// .widgetColor(Color.BLUE)//输入框光标的颜色 // .widgetColor(Color.BLUE)//输入框光标的颜色
.inputType(inputType)//可以输入的类型 .inputType(inputType)//可以输入的类型
.inputRangeRes(0, columnSize, android.R.color.black)
//前2个一个是hint一个是预输入的文字 //前2个一个是hint一个是预输入的文字
.input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() { .input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() {
...@@ -265,14 +289,14 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -265,14 +289,14 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
// dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); // dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
String inputStr = dialog.getInputEditText().getText().toString(); String inputStr = dialog.getInputEditText().getText().toString();
if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) { // if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) {
dialog.getInputEditText().setText(inputStr.subSequence(0, 10)); // dialog.getInputEditText().setText(inputStr.subSequence(0, 10));
ToastUtils.showShort("输入长度超长"); // ToastUtils.showShort("输入长度超长");
} else { // } else {
viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.notifyChange(); viewModel.currentParamEntity.notifyChange();
} // }
} }
}) })
.show(); .show();
...@@ -408,7 +432,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -408,7 +432,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
@Override @Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if (which == DialogAction.POSITIVE) { if (which == DialogAction.POSITIVE) {
viewModel.initDetaileData(rowData); viewModel.queryBreedingRecordDetail(rowData.getUnid());
} }
} }
}).show(); }).show();
......
...@@ -231,12 +231,34 @@ public class ImmunRecordFragment extends BaseFragment<FragmentImmunRecordBinding ...@@ -231,12 +231,34 @@ public class ImmunRecordFragment extends BaseFragment<FragmentImmunRecordBinding
inputType = InputType.TYPE_CLASS_TEXT; inputType = InputType.TYPE_CLASS_TEXT;
} }
int finalInputType = inputType; int finalInputType = inputType;
//判断下限制的长度
int columnSize = 500;//不限制的设置成500
if (uiParamEntity.getColumnType().indexOf("(") > -1 && uiParamEntity.getColumnType().indexOf(")") > -1) {
if (uiParamEntity.getColumnType().indexOf(",") > -1) {//有“,”说明是Duoble
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(",")
)
);
} else {
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(")")
)
);
}
}
new MaterialDialog.Builder(getActivity()) new MaterialDialog.Builder(getActivity())
.title(uiParamEntity.getColumnComment()) .title(uiParamEntity.getColumnComment())
// .iconRes(R.drawable.ic_logo) // .iconRes(R.drawable.ic_logo)
.content("请输入") .content("请输入")
// .widgetColor(Color.BLUE)//输入框光标的颜色 // .widgetColor(Color.BLUE)//输入框光标的颜色
.inputType(inputType)//可以输入的类型 .inputType(inputType)//可以输入的类型
.inputRangeRes(0, columnSize, android.R.color.black)
//前2个一个是hint一个是预输入的文字 //前2个一个是hint一个是预输入的文字
.input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() { .input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() {
...@@ -252,14 +274,14 @@ public class ImmunRecordFragment extends BaseFragment<FragmentImmunRecordBinding ...@@ -252,14 +274,14 @@ public class ImmunRecordFragment extends BaseFragment<FragmentImmunRecordBinding
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
// dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); // dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
String inputStr = dialog.getInputEditText().getText().toString(); String inputStr = dialog.getInputEditText().getText().toString();
if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) { // if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) {
dialog.getInputEditText().setText(inputStr.subSequence(0, 10)); // dialog.getInputEditText().setText(inputStr.subSequence(0, 10));
ToastUtils.showShort("输入长度超长"); // ToastUtils.showShort("输入长度超长");
} else { // } else {
viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.notifyChange(); viewModel.currentParamEntity.notifyChange();
} // }
} }
}) })
.show(); .show();
......
...@@ -229,12 +229,34 @@ public class MedicalRecordFragment extends BaseFragment<FragmentMedicalRecordBin ...@@ -229,12 +229,34 @@ public class MedicalRecordFragment extends BaseFragment<FragmentMedicalRecordBin
inputType = InputType.TYPE_CLASS_TEXT; inputType = InputType.TYPE_CLASS_TEXT;
} }
int finalInputType = inputType; int finalInputType = inputType;
//判断下限制的长度
int columnSize = 500;//不限制的设置成500
if (uiParamEntity.getColumnType().indexOf("(") > -1 && uiParamEntity.getColumnType().indexOf(")") > -1) {
if (uiParamEntity.getColumnType().indexOf(",") > -1) {//有“,”说明是Duoble
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(",")
)
);
} else {
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(")")
)
);
}
}
new MaterialDialog.Builder(getActivity()) new MaterialDialog.Builder(getActivity())
.title(uiParamEntity.getColumnComment()) .title(uiParamEntity.getColumnComment())
// .iconRes(R.drawable.ic_logo) // .iconRes(R.drawable.ic_logo)
.content("请输入") .content("请输入")
// .widgetColor(Color.BLUE)//输入框光标的颜色 // .widgetColor(Color.BLUE)//输入框光标的颜色
.inputType(inputType)//可以输入的类型 .inputType(inputType)//可以输入的类型
.inputRangeRes(0, columnSize, android.R.color.black)
//前2个一个是hint一个是预输入的文字 //前2个一个是hint一个是预输入的文字
.input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() { .input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() {
...@@ -250,14 +272,14 @@ public class MedicalRecordFragment extends BaseFragment<FragmentMedicalRecordBin ...@@ -250,14 +272,14 @@ public class MedicalRecordFragment extends BaseFragment<FragmentMedicalRecordBin
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
// dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); // dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
String inputStr = dialog.getInputEditText().getText().toString(); String inputStr = dialog.getInputEditText().getText().toString();
if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) { // if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) {
dialog.getInputEditText().setText(inputStr.subSequence(0, 10)); // dialog.getInputEditText().setText(inputStr.subSequence(0, 10));
ToastUtils.showShort("输入长度超长"); // ToastUtils.showShort("输入长度超长");
} else { // } else {
viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.notifyChange(); viewModel.currentParamEntity.notifyChange();
} // }
} }
}) })
.show(); .show();
......
...@@ -2,6 +2,7 @@ package com.phlx.anchorcollect.ui.fragment; ...@@ -2,6 +2,7 @@ package com.phlx.anchorcollect.ui.fragment;
import android.Manifest; import android.Manifest;
import android.app.Dialog; import android.app.Dialog;
import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.text.InputType; import android.text.InputType;
import android.util.Log; import android.util.Log;
...@@ -161,6 +162,7 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding ...@@ -161,6 +162,7 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
}).show(); }).show();
} }
}); });
} }
...@@ -230,12 +232,34 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding ...@@ -230,12 +232,34 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
inputType = InputType.TYPE_CLASS_TEXT; inputType = InputType.TYPE_CLASS_TEXT;
} }
int finalInputType = inputType; int finalInputType = inputType;
//判断下限制的长度
int columnSize = 500;//不限制的设置成500
if (uiParamEntity.getColumnType().indexOf("(") > -1 && uiParamEntity.getColumnType().indexOf(")") > -1) {
if (uiParamEntity.getColumnType().indexOf(",") > -1) {//有“,”说明是Duoble
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(",")
)
);
} else {
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(")")
)
);
}
}
new MaterialDialog.Builder(getActivity()) new MaterialDialog.Builder(getActivity())
.title(uiParamEntity.getColumnComment()) .title(uiParamEntity.getColumnComment())
// .iconRes(R.drawable.ic_logo) // .iconRes(R.drawable.ic_logo)
.content("请输入") .content("请输入")
// .widgetColor(Color.BLUE)//输入框光标的颜色 // .widgetColor(Color.BLUE)//输入框光标的颜色
.inputType(inputType)//可以输入的类型 .inputType(inputType)//可以输入的类型
.inputRangeRes(0, columnSize, android.R.color.black)
//前2个一个是hint一个是预输入的文字 //前2个一个是hint一个是预输入的文字
.input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() { .input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() {
...@@ -251,14 +275,14 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding ...@@ -251,14 +275,14 @@ public class PerformanceFragment extends BaseFragment<FragmentPerformanceBinding
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
// dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); // dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
String inputStr = dialog.getInputEditText().getText().toString(); String inputStr = dialog.getInputEditText().getText().toString();
if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) { // if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) {
dialog.getInputEditText().setText(inputStr.subSequence(0, 10)); // dialog.getInputEditText().setText(inputStr.subSequence(0, 10));
ToastUtils.showShort("输入长度超长"); // ToastUtils.showShort("输入长度超长");
} else { // } else {
viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.notifyChange(); viewModel.currentParamEntity.notifyChange();
} // }
} }
}) })
.show(); .show();
......
...@@ -40,6 +40,7 @@ import com.phlx.anchorcollect.data.VMFactory; ...@@ -40,6 +40,7 @@ import com.phlx.anchorcollect.data.VMFactory;
import com.phlx.anchorcollect.databinding.FragmentWeightmanBinding; import com.phlx.anchorcollect.databinding.FragmentWeightmanBinding;
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.entity.WeightManEntity;
import com.phlx.anchorcollect.event.EventTag; import com.phlx.anchorcollect.event.EventTag;
import com.phlx.anchorcollect.ui.fragment.vm.WeightManVM; import com.phlx.anchorcollect.ui.fragment.vm.WeightManVM;
import com.phlx.anchorcollect.ui.info.CattleActivity; import com.phlx.anchorcollect.ui.info.CattleActivity;
...@@ -123,7 +124,7 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We ...@@ -123,7 +124,7 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
viewModel.addInventoryListener(); viewModel.addInventoryListener();
viewModel.initDataForUnid(Configs.tempUnid); viewModel.initDataForUnid(Configs.tempUnid);
Configs.currentEvent = EventTag.EVENT_WEIGHT_DATA_WEIGHT; Configs.currentEvent = EventTag.EVENT_WEIGHT_DATA_WEIGHT;
}else{ } else {
viewModel.removeInventoryListener(); viewModel.removeInventoryListener();
Configs.currentEvent = ""; Configs.currentEvent = "";
App.getInstance().getLinkage().stopInventory(); App.getInstance().getLinkage().stopInventory();
...@@ -240,6 +241,37 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We ...@@ -240,6 +241,37 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
binding.rvCollect.getAdapter().notifyDataSetChanged(); binding.rvCollect.getAdapter().notifyDataSetChanged();
} }
}); });
viewModel.onCoverRecordEvent.observe(this, new Observer<WeightManEntity>() {
@Override
public void onChanged(WeightManEntity weightManEntity) {
new MaterialDialog.Builder(getActivity()).title("系统提示").content(weightManEntity.getWTime() + "已有称重记录,是否覆盖").positiveText("确定").negativeText("取消").onAny(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if (which == DialogAction.POSITIVE) {
viewModel.saveWeightMan(weightManEntity);
}
}
}).show();
}
});
viewModel.onShowDialogEvent.observe(getActivity(), new Observer<String>() {
@Override
public void onChanged(String s) {
new MaterialDialog.Builder(getActivity()).title("系统提示").content(s).positiveText("确定").onAny(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if (which == DialogAction.POSITIVE) {
}
}
}).show();
}
});
} }
...@@ -310,12 +342,34 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We ...@@ -310,12 +342,34 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
} }
int finalInputType = inputType; int finalInputType = inputType;
//判断下限制的长度
int columnSize = 500;//不限制的设置成500
if (uiParamEntity.getColumnType().indexOf("(") > -1 && uiParamEntity.getColumnType().indexOf(")") > -1) {
if (uiParamEntity.getColumnType().indexOf(",") > -1) {//有“,”说明是Duoble
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(",")
)
);
} else {
columnSize = Integer.parseInt(
uiParamEntity.getColumnType().substring(
uiParamEntity.getColumnType().indexOf("(") + 1, uiParamEntity.getColumnType().indexOf(")")
)
);
}
}
new MaterialDialog.Builder(getActivity()) new MaterialDialog.Builder(getActivity())
.title(uiParamEntity.getColumnComment()) .title(uiParamEntity.getColumnComment())
// .iconRes(R.drawable.ic_logo) // .iconRes(R.drawable.ic_logo)
.content("请输入") .content("请输入")
// .widgetColor(Color.BLUE)//输入框光标的颜色 // .widgetColor(Color.BLUE)//输入框光标的颜色
.inputType(inputType)//可以输入的类型 .inputType(inputType)//可以输入的类型
.inputRangeRes(0, columnSize, android.R.color.black)
//前2个一个是hint一个是预输入的文字 //前2个一个是hint一个是预输入的文字
.input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() { .input("输入" + uiParamEntity.getColumnComment(), uiParamEntity.getShowName(), new MaterialDialog.InputCallback() {
...@@ -332,14 +386,14 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We ...@@ -332,14 +386,14 @@ public class WeightManFragment extends BaseFragment<FragmentWeightmanBinding, We
// dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); // dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false);
String inputStr = dialog.getInputEditText().getText().toString(); String inputStr = dialog.getInputEditText().getText().toString();
if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) { // if (finalInputType == InputType.TYPE_CLASS_TEXT && inputStr.length() > 10) {
dialog.getInputEditText().setText(inputStr.subSequence(0, 10)); // dialog.getInputEditText().setText(inputStr.subSequence(0, 10));
ToastUtils.showShort("输入长度超长"); // ToastUtils.showShort("输入长度超长");
} else { // } else {
viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setShowName(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString()); viewModel.currentParamEntity.setContent(dialog.getInputEditText().getText().toString());
viewModel.currentParamEntity.notifyChange(); viewModel.currentParamEntity.notifyChange();
} // }
} }
}) })
.show(); .show();
......
...@@ -26,10 +26,12 @@ import com.phlx.anchorcollect.data.Repository; ...@@ -26,10 +26,12 @@ import com.phlx.anchorcollect.data.Repository;
import com.phlx.anchorcollect.db.DbUtil; import com.phlx.anchorcollect.db.DbUtil;
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.gen.WeightManEntityDao;
import com.phlx.anchorcollect.db.interf.DbQueryCallBack; import com.phlx.anchorcollect.db.interf.DbQueryCallBack;
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.entity.WeightManEntity;
import com.phlx.anchorcollect.event.EventMsg; import com.phlx.anchorcollect.event.EventMsg;
import com.phlx.anchorcollect.event.EventTag; import com.phlx.anchorcollect.event.EventTag;
import com.phlx.anchorcollect.ui.fragment.list.CollectGridItem; import com.phlx.anchorcollect.ui.fragment.list.CollectGridItem;
...@@ -43,7 +45,11 @@ import com.uhf.structures.OnInventoryListener; ...@@ -43,7 +45,11 @@ import com.uhf.structures.OnInventoryListener;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
import java.io.File; import java.io.File;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.List; import java.util.List;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
...@@ -83,10 +89,19 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -83,10 +89,19 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
public ObservableField<String> rfid = new ObservableField<>(""); public ObservableField<String> rfid = new ObservableField<>("");
public ObservableField<String> weight = new ObservableField<>("----"); public ObservableField<String> weight = new ObservableField<>("----");
public ObservableField<Double> lastGainWeight = new ObservableField<>(0.0);//上次增重
public ObservableField<Double> adgGainWeight = new ObservableField<>(0.0);//日增重
public ObservableField<Double> totalGainWeight = new ObservableField<>(0.0);//总增重
public ObservableField<String> lastGainDate = new ObservableField<>("");//上次增重日期
public ObservableField<String> adgGainDate = new ObservableField<>("");//日增重日期
public ObservableField<String> totalGainDate = new ObservableField<>("");//总增重日期
private SoundPool soundPool;//盘点到标签时的提示音 private SoundPool soundPool;//盘点到标签时的提示音
private SparseIntArray musicId; private SparseIntArray musicId;
private SimpleDateFormat dateFormat;
public boolean isScan = false;//是否在扫描 public boolean isScan = false;//是否在扫描
private String rfidTag = "";//扫描到的标记 private String rfidTag = "";//扫描到的标记
...@@ -143,6 +158,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -143,6 +158,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
remarkParamEntity.setColumnComment("备注"); remarkParamEntity.setColumnComment("备注");
remarkParamEntity.setHtmlType("input"); remarkParamEntity.setHtmlType("input");
remarkParamEntity.setJavaType("String"); remarkParamEntity.setJavaType("String");
remarkParamEntity.setColumnType("varchar(500)");
remarkParamEntity.setIsEdit("1"); remarkParamEntity.setIsEdit("1");
} }
...@@ -215,6 +231,71 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -215,6 +231,71 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
// } // }
} }
//查询 上次称重 日增重 总体增重
private void queryGainWeight() {
lastGainWeight.set(0.0);
adgGainWeight.set(0.0);
totalGainWeight.set(0.0);
QueryBuilder<WeightManEntity> builder3 =
DbUtil.getInstance().getQueryBuilder(WeightManEntity.class)
.where(WeightManEntityDao.Properties.CattleresumeId.eq(Configs.tempUnid))
.orderDesc(WeightManEntityDao.Properties.WTime);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<WeightManEntity>() {
@Override
public void onSuccess(List<WeightManEntity> result) {
if (result != null && result.size() > 0) {
//总增重
if (Configs.tempCattleResume != null && Configs.tempCattleResume.getBirthHeavy() != null) {
totalGainWeight.set(result.get(0).getWeight() - Configs.tempCattleResume.getBirthHeavy());
lastGainDate.set(result.get(0).getWTime());
adgGainDate.set(result.get(0).getWTime());
totalGainDate.set(result.get(0).getWTime());
// Log.e("weight", "totalGainWeight:" + totalGainWeight.get());
}
if (result.size() >= 1) {
lastGainWeight.set(result.get(0).getWeight());
//// Log.e("weight", "lastGainWeight:" + lastGainWeight.get());
if (result.size() > 1) {//两条以上记录
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar frontCalendar = Calendar.getInstance();
Calendar laterCurcalendar = Calendar.getInstance();
try {
frontCalendar.setTime(dateFormat.parse(result.get(1).getWTime()));
laterCurcalendar.setTime(dateFormat.parse(result.get(0).getWTime()));
// Log.e("weight", "qian" + result.get(1).getWTime());
// Log.e("weight", "hou" + result.get(0).getWTime());
} catch (ParseException e) {
e.printStackTrace();
}
int days = 0; //定义一个变量来计算相隔天数
while (frontCalendar.before(laterCurcalendar)) {
frontCalendar.add(Calendar.DATE, 1);
days++;
}
double doubleADG = (result.get(0).getWeight() - result.get(1).getWeight()) / days;
adgGainWeight.set(Double.parseDouble(new DecimalFormat("0.0").format(doubleADG)));
// Log.e("weight", "days:" + days);
// Log.e("weight", "qian-weight:" + result.get(1).getWeight());
// Log.e("weight", "hou-weight:" + result.get(0).getWeight());
// Log.e("weight", "adgGainWeight:" + adgGainWeight.get());
}
}
}
}
@Override
public void onFailed() {
cn.wandersnail.commons.util.ToastUtils.showShort("查询称重记录失败!");
dismissDialog();
}
}).queryAsyncAll(WeightManEntity.class, builder3);
}
public void onItemClick(GenTableColumn entity) { public void onItemClick(GenTableColumn entity) {
if (!"1".equals(entity.getIsEdit())) return; if (!"1".equals(entity.getIsEdit())) return;
...@@ -310,6 +391,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -310,6 +391,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
+ "/anchorCiq" + result.get(0).getUnid() + ".jpg"; + "/anchorCiq" + result.get(0).getUnid() + ".jpg";
imgFile = new File(imgUrl); imgFile = new File(imgUrl);
Configs.tempCattleResume = result.get(0);
Configs.tempTag = result.get(0).getIndividualNo(); Configs.tempTag = result.get(0).getIndividualNo();
Configs.tempRfid = result.get(0).getRegistrationNo(); Configs.tempRfid = result.get(0).getRegistrationNo();
Configs.tempUnid = result.get(0).getUnid(); Configs.tempUnid = result.get(0).getUnid();
...@@ -317,6 +399,8 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -317,6 +399,8 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
rfid.set(Configs.tempRfid); rfid.set(Configs.tempRfid);
remarkParamEntity.setShowName(result.get(0).getRemark()); remarkParamEntity.setShowName(result.get(0).getRemark());
queryGainWeight();
String[] filedName = EntityUtils.getFiledName(result.get(0)); String[] filedName = EntityUtils.getFiledName(result.get(0));
for (String name : filedName) { for (String name : filedName) {
...@@ -437,6 +521,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve ...@@ -437,6 +521,7 @@ public class BasicsCollectVM extends BaseViewModel<Repository> implements OnInve
Configs.tempTag = ""; Configs.tempTag = "";
Configs.tempUnid = null; Configs.tempUnid = null;
Configs.tempRfid = ""; Configs.tempRfid = "";
Configs.tempCattleResume = null;
tag.set(""); tag.set("");
rfid.set(""); rfid.set("");
rfidTag = ""; rfidTag = "";
......
...@@ -47,6 +47,7 @@ import java.util.HashSet; ...@@ -47,6 +47,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import me.goldze.mvvmhabit.base.BaseViewModel; import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction; import me.goldze.mvvmhabit.binding.command.BindingAction;
...@@ -115,12 +116,15 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -115,12 +116,15 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setColumnComment("备注"); remarkParamEntity.setColumnComment("备注");
remarkParamEntity.setHtmlType("input"); remarkParamEntity.setHtmlType("input");
remarkParamEntity.setJavaType("String"); remarkParamEntity.setJavaType("String");
remarkParamEntity.setColumnType("varchar(500)");
remarkParamEntity.setIsEdit("1"); remarkParamEntity.setIsEdit("1");
} }
private void initData(ImmuneBatchEntity immuneBatchEntity) { private void initData(ImmuneBatchEntity immuneBatchEntity) {
remarkParamEntity.setShowName(immuneBatchEntity.getRemark());
remarkParamEntity.setContent(immuneBatchEntity.getRemark());
String[] filedName = EntityUtils.getFiledName(immuneBatchEntity); String[] filedName = EntityUtils.getFiledName(immuneBatchEntity);
for (String name : filedName) { for (String name : filedName) {
...@@ -185,10 +189,10 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -185,10 +189,10 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
public void onItemClick(GenTableColumn entity) { public void onItemClick(GenTableColumn entity) {
if (Configs.tempUnid == null) { // if (Configs.tempUnid == null) {
ToastUtils.showShort("请扫描耳标或者输入耳标信息"); // ToastUtils.showShort("请扫描耳标或者输入耳标信息");
return; // return;
} // }
if (!"1".equals(entity.getIsEdit()) && isModify) { if (!"1".equals(entity.getIsEdit()) && isModify) {
ToastUtils.showShort("此数据无法修改!!"); ToastUtils.showShort("此数据无法修改!!");
...@@ -221,6 +225,15 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -221,6 +225,15 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
public BindingCommand onSaveClick = new BindingCommand(new BindingAction() { public BindingCommand onSaveClick = new BindingCommand(new BindingAction() {
@Override @Override
public void call() { public void call() {
//判断必填
for (GenTableColumn gtc : Configs.immunebatch) {
if ("1".equals(gtc.getIsRequired()) && StringUtils.isEmpty(gtc.getContent())) {
onShowDialogEvent.setValue("请完成" + gtc.getColumnComment() + "的录入");
return;
}
}
saveImmunRecord(); saveImmunRecord();
} }
}); });
...@@ -229,6 +242,17 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -229,6 +242,17 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
JsonObject jsonObject = new JsonObject(); JsonObject jsonObject = new JsonObject();
for (GenTableColumn gtc : Configs.immunebatch) { for (GenTableColumn gtc : Configs.immunebatch) {
//防止转json类型错误
if ("".equals(gtc.getContent())) {
switch (gtc.getJavaType()) {
case "Long":
case "Double":
case "Integer":
case "BigDecimal":
gtc.setContent("0");
break;
}
}
jsonObject.addProperty(gtc.getJavaField(), gtc.getContent()); jsonObject.addProperty(gtc.getJavaField(), gtc.getContent());
} }
...@@ -245,12 +269,13 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -245,12 +269,13 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
} else {//新增 } else {//新增
uuid = IdUtil.createSnowflake(3, 1).nextId(); uuid = IdUtil.createSnowflake(3, 1).nextId();
immuneBatchEntity.setUnid(uuid); immuneBatchEntity.setUnid(uuid);
immuneBatchEntity.setDeptId(SPUtils.getInstance().getLong(Configs.SP_DEPT_ID)); immuneBatchEntity.setDeptId(Long.parseLong(SPUtils.getInstance().getString(Configs.SP_DEPT_ID)));
immuneBatchEntity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME)); immuneBatchEntity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
immuneBatchEntity.setCreateTime(dateFormat.format(new Date())); immuneBatchEntity.setCreateTime(dateFormat.format(new Date()));
} }
immuneBatchEntity.setUploadStatus("0"); immuneBatchEntity.setUploadStatus("0");
immuneBatchEntity.setRemark(remarkParamEntity.getContent());
uploadData = new ArrayList<>(); uploadData = new ArrayList<>();
detailUploadData = new ArrayList<>(); detailUploadData = new ArrayList<>();
...@@ -263,18 +288,23 @@ public class ImmunRecordVM extends BaseViewModel<Repository> { ...@@ -263,18 +288,23 @@ public class ImmunRecordVM extends BaseViewModel<Repository> {
QueryBuilder<CattleResumeEntity> builder = QueryBuilder<CattleResumeEntity> builder =
DbUtil.getInstance().getQueryBuilder(CattleResumeEntity.class) DbUtil.getInstance().getQueryBuilder(CattleResumeEntity.class)
.where(CattleResumeEntityDao.Properties.CircleNo.eq(circleNo)); .where(CattleResumeEntityDao.Properties.CircleNo.eq(circleNo)
, CattleResumeEntityDao.Properties.DeptId.eq(Long.parseLong(SPUtils.getInstance().getString(Configs.SP_DEPT_ID)))
);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CattleResumeEntity>() { DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<CattleResumeEntity>() {
@Override @Override
public void onSuccess(List<CattleResumeEntity> result) { public void onSuccess(List<CattleResumeEntity> result) {
//查询圈舍内的牲畜 //查询圈舍内的牲畜
if (result != null && result.size() > 0) { if (result != null && result.size() > 0) {
Snowflake snowflake = IdUtil.createSnowflake(3, 1);
for (CattleResumeEntity cre : result) { for (CattleResumeEntity cre : result) {
ImmuneBatchDetailEntity immuneBatchDetailEntity = new ImmuneBatchDetailEntity(); ImmuneBatchDetailEntity immuneBatchDetailEntity = new ImmuneBatchDetailEntity();
immuneBatchDetailEntity.setUnid(IdUtil.createSnowflake(3, 1).nextId()); immuneBatchDetailEntity.setUnid(snowflake.nextId());
immuneBatchDetailEntity.setCattleresumeUnid(cre.getUnid()); immuneBatchDetailEntity.setCattleresumeUnid(cre.getUnid());
immuneBatchDetailEntity.setImmunebatchUnid(immuneBatchEntity.getUnid()); immuneBatchDetailEntity.setImmunebatchUnid(immuneBatchEntity.getUnid());
immuneBatchDetailEntity.setDeptId(Long.parseLong(SPUtils.getInstance().getString(Configs.SP_DEPT_ID)));
immuneBatchDetailEntity.setUploadStatus("0"); immuneBatchDetailEntity.setUploadStatus("0");
detailUploadData.add(immuneBatchDetailEntity); detailUploadData.add(immuneBatchDetailEntity);
} }
......
...@@ -105,12 +105,16 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -105,12 +105,16 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
remarkParamEntity.setColumnComment("备注"); remarkParamEntity.setColumnComment("备注");
remarkParamEntity.setHtmlType("input"); remarkParamEntity.setHtmlType("input");
remarkParamEntity.setJavaType("String"); remarkParamEntity.setJavaType("String");
remarkParamEntity.setColumnType("varchar(500)");
remarkParamEntity.setIsEdit("1"); remarkParamEntity.setIsEdit("1");
} }
private void initData(MedicalRecordEntity medicalRecordEntity) { private void initData(MedicalRecordEntity medicalRecordEntity) {
remarkParamEntity.setShowName(medicalRecordEntity.getRemark());
remarkParamEntity.setContent(medicalRecordEntity.getRemark());
String[] filedName = EntityUtils.getFiledName(medicalRecordEntity); String[] filedName = EntityUtils.getFiledName(medicalRecordEntity);
for (String name : filedName) { for (String name : filedName) {
...@@ -175,7 +179,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -175,7 +179,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
public void onItemClick(GenTableColumn entity) { public void onItemClick(GenTableColumn entity) {
if (Configs.tempUnid==null) { if (Configs.tempUnid == null) {
ToastUtils.showShort("请扫描耳标或者输入耳标信息"); ToastUtils.showShort("请扫描耳标或者输入耳标信息");
return; return;
} }
...@@ -193,7 +197,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -193,7 +197,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
public void click(int id) { public void click(int id) {
if (Configs.tempUnid==null) { if (Configs.tempUnid == null) {
ToastUtils.showShort("请扫描耳标或者输入耳标信息"); ToastUtils.showShort("请扫描耳标或者输入耳标信息");
return; return;
} }
...@@ -213,6 +217,15 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -213,6 +217,15 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
public BindingCommand onSaveClick = new BindingCommand(new BindingAction() { public BindingCommand onSaveClick = new BindingCommand(new BindingAction() {
@Override @Override
public void call() { public void call() {
//判断必填
for (GenTableColumn gtc : Configs.medicalrecords) {
if ("1".equals(gtc.getIsRequired()) && StringUtils.isEmpty(gtc.getContent())) {
onShowDialogEvent.setValue("请完成" + gtc.getColumnComment() + "的录入");
return;
}
}
saveMedicalRecord(); saveMedicalRecord();
} }
}); });
...@@ -221,6 +234,17 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -221,6 +234,17 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
JsonObject jsonObject = new JsonObject(); JsonObject jsonObject = new JsonObject();
for (GenTableColumn gtc : Configs.medicalrecords) { for (GenTableColumn gtc : Configs.medicalrecords) {
//防止转json类型错误
if ("".equals(gtc.getContent())) {
switch (gtc.getJavaType()) {
case "Long":
case "Double":
case "Integer":
case "BigDecimal":
gtc.setContent("0");
break;
}
}
jsonObject.addProperty(gtc.getJavaField(), gtc.getContent()); jsonObject.addProperty(gtc.getJavaField(), gtc.getContent());
} }
...@@ -232,7 +256,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -232,7 +256,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
uuid = IdUtil.createSnowflake(3, 1).nextId(); uuid = IdUtil.createSnowflake(3, 1).nextId();
medicalRecordEntity.setUnid(uuid); medicalRecordEntity.setUnid(uuid);
medicalRecordEntity.setCattleresumeId(Configs.tempUnid); medicalRecordEntity.setCattleresumeId(Configs.tempUnid);
medicalRecordEntity.setDeptId(SPUtils.getInstance().getLong(Configs.SP_DEPT_ID)); medicalRecordEntity.setDeptId(Long.parseLong(SPUtils.getInstance().getString(Configs.SP_DEPT_ID)));
medicalRecordEntity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME)); medicalRecordEntity.setCreateBy(SPUtils.getInstance().getString(Configs.SP_LOGIN_NAME));
medicalRecordEntity.setCreateTime(dateFormat.format(new Date())); medicalRecordEntity.setCreateTime(dateFormat.format(new Date()));
...@@ -244,6 +268,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> { ...@@ -244,6 +268,7 @@ public class MedicalRecordVM extends BaseViewModel<Repository> {
//清除选中unid //清除选中unid
Configs.resumeId = null; Configs.resumeId = null;
} }
medicalRecordEntity.setRemark(remarkParamEntity.getContent());
medicalRecordEntity.setUploadStatus("0"); medicalRecordEntity.setUploadStatus("0");
uploadData = new ArrayList<>(); uploadData = new ArrayList<>();
......
...@@ -27,6 +27,7 @@ import com.phlx.anchorcollect.entity.GenTableColumn; ...@@ -27,6 +27,7 @@ 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 com.phlx.anchorcollect.util.StringUtil;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
...@@ -106,12 +107,16 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -106,12 +107,16 @@ public class PerformanceVM extends BaseViewModel<Repository> {
remarkParamEntity.setColumnComment("备注"); remarkParamEntity.setColumnComment("备注");
remarkParamEntity.setHtmlType("input"); remarkParamEntity.setHtmlType("input");
remarkParamEntity.setJavaType("String"); remarkParamEntity.setJavaType("String");
remarkParamEntity.setColumnType("varchar(500)");
remarkParamEntity.setIsEdit("1"); remarkParamEntity.setIsEdit("1");
} }
private void initData(PerformanceEntity performanceEntity) { private void initData(PerformanceEntity performanceEntity) {
remarkParamEntity.setShowName(performanceEntity.getRemark());
remarkParamEntity.setContent(performanceEntity.getRemark());
String[] filedName = EntityUtils.getFiledName(performanceEntity); String[] filedName = EntityUtils.getFiledName(performanceEntity);
for (String name : filedName) { for (String name : filedName) {
...@@ -214,6 +219,15 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -214,6 +219,15 @@ public class PerformanceVM extends BaseViewModel<Repository> {
public BindingCommand onSaveClick = new BindingCommand(new BindingAction() { public BindingCommand onSaveClick = new BindingCommand(new BindingAction() {
@Override @Override
public void call() { public void call() {
//判断必填
for (GenTableColumn gtc : Configs.performance) {
if ("1".equals(gtc.getIsRequired()) && StringUtils.isEmpty(gtc.getContent())) {
onShowDialogEvent.setValue("请完成" + gtc.getColumnComment() + "的录入");
return;
}
}
savePerformance(); savePerformance();
} }
}); });
...@@ -222,6 +236,17 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -222,6 +236,17 @@ public class PerformanceVM extends BaseViewModel<Repository> {
JsonObject jsonObject = new JsonObject(); JsonObject jsonObject = new JsonObject();
for (GenTableColumn gtc : Configs.performance) { for (GenTableColumn gtc : Configs.performance) {
//防止转json类型错误
if ("".equals(gtc.getContent())) {
switch (gtc.getJavaType()) {
case "Long":
case "Double":
case "Integer":
case "BigDecimal":
gtc.setContent("0");
break;
}
}
jsonObject.addProperty(gtc.getJavaField(), gtc.getContent()); jsonObject.addProperty(gtc.getJavaField(), gtc.getContent());
} }
...@@ -233,7 +258,7 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -233,7 +258,7 @@ public class PerformanceVM extends BaseViewModel<Repository> {
uuid = IdUtil.createSnowflake(3, 1).nextId(); uuid = IdUtil.createSnowflake(3, 1).nextId();
performanceEntity.setUnid(uuid); performanceEntity.setUnid(uuid);
performanceEntity.setCattleresumeId(Configs.tempUnid); performanceEntity.setCattleresumeId(Configs.tempUnid);
performanceEntity.setDeptId(SPUtils.getInstance().getLong(Configs.SP_DEPT_ID)); performanceEntity.setDeptId(Long.parseLong(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));
performanceEntity.setCreateTime(dateFormat.format(new Date())); performanceEntity.setCreateTime(dateFormat.format(new Date()));
...@@ -246,6 +271,7 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -246,6 +271,7 @@ public class PerformanceVM extends BaseViewModel<Repository> {
//清除选中unid //清除选中unid
Configs.resumeId = null; Configs.resumeId = null;
} }
performanceEntity.setRemark(remarkParamEntity.getContent());
performanceEntity.setUploadStatus("0"); performanceEntity.setUploadStatus("0");
uploadData = new ArrayList<>(); uploadData = new ArrayList<>();
......
...@@ -32,6 +32,8 @@ public class LoginActivity extends BaseActivity<ActivityLoginBinding, LoginVM> { ...@@ -32,6 +32,8 @@ public class LoginActivity extends BaseActivity<ActivityLoginBinding, LoginVM> {
private String path ; private String path ;
private int loginType;//登录后是否跳转,0跳转main 1不跳转
@Override @Override
public int initContentView(Bundle savedInstanceState) { public int initContentView(Bundle savedInstanceState) {
return R.layout.activity_login; return R.layout.activity_login;
...@@ -45,6 +47,8 @@ public class LoginActivity extends BaseActivity<ActivityLoginBinding, LoginVM> { ...@@ -45,6 +47,8 @@ public class LoginActivity extends BaseActivity<ActivityLoginBinding, LoginVM> {
@Override @Override
public void initParam() { public void initParam() {
super.initParam(); super.initParam();
loginType = getIntent().getIntExtra("loginType", 0);
} }
@Override @Override
...@@ -57,6 +61,8 @@ public class LoginActivity extends BaseActivity<ActivityLoginBinding, LoginVM> { ...@@ -57,6 +61,8 @@ public class LoginActivity extends BaseActivity<ActivityLoginBinding, LoginVM> {
public void initData() { public void initData() {
super.initData(); super.initData();
viewModel.loginType = loginType;
// downloadUrl = "http://" // downloadUrl = "http://"
// + SPUtils.getInstance().getString(Configs.SP_APP_IP, RetrofitClient.baseUrl) // + SPUtils.getInstance().getString(Configs.SP_APP_IP, RetrofitClient.baseUrl)
// + ":" + // + ":" +
......
...@@ -2,6 +2,7 @@ package com.phlx.anchorcollect.ui.login; ...@@ -2,6 +2,7 @@ package com.phlx.anchorcollect.ui.login;
import android.app.Activity; import android.app.Activity;
import android.app.Application; import android.app.Application;
import android.os.Bundle;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -60,6 +61,9 @@ public class LoginVM extends BaseViewModel<Repository> { ...@@ -60,6 +61,9 @@ public class LoginVM extends BaseViewModel<Repository> {
public SingleLiveEvent<Integer> appUpdateEvent = new SingleLiveEvent<>(); public SingleLiveEvent<Integer> appUpdateEvent = new SingleLiveEvent<>();
public int loginType;//登录后是否跳转, 0跳转main 1不跳转
public LoginVM(@NonNull Application application, Repository model) { public LoginVM(@NonNull Application application, Repository model) {
super(application, model); super(application, model);
...@@ -159,7 +163,9 @@ public class LoginVM extends BaseViewModel<Repository> { ...@@ -159,7 +163,9 @@ public class LoginVM extends BaseViewModel<Repository> {
// SPUtils.getInstance().put(Configs.SP_FREQUENCY, response.getData().getUser().getFrequencyConfig()); // SPUtils.getInstance().put(Configs.SP_FREQUENCY, response.getData().getUser().getFrequencyConfig());
} }
VMFactory.getInstance(getApplication()).refreshRepository(); VMFactory.getInstance(getApplication()).refreshRepository();
startActivity(SplashActivity.class); Bundle bundle = new Bundle();
bundle.putInt("loginType", loginType);
startActivity(SplashActivity.class, bundle);
finish(); finish();
} else { } else {
ToastUtils.showShort("服务器:" + response.getMsg()); ToastUtils.showShort("服务器:" + response.getMsg());
......
...@@ -86,12 +86,6 @@ import okhttp3.RequestBody; ...@@ -86,12 +86,6 @@ import okhttp3.RequestBody;
public class SettingVM extends BaseViewModel<Repository> implements DiscoveryListener { public class SettingVM extends BaseViewModel<Repository> implements DiscoveryListener {
private SoundPool soundPool;//盘点到标签时的提示音
private SparseIntArray musicId;
private static Map<String, Integer> map;//去重
private ArrayList<BluetoothEntity> mList;
private boolean isInventory = false;
//给RecyclerView添加ObservableList //给RecyclerView添加ObservableList
public ObservableList<BLEItem> observableList = new ObservableArrayList<>(); public ObservableList<BLEItem> observableList = new ObservableArrayList<>();
...@@ -224,14 +218,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis ...@@ -224,14 +218,7 @@ public class SettingVM extends BaseViewModel<Repository> implements DiscoveryLis
public BindingCommand OnConnectionClickCommand = new BindingCommand(new BindingAction() { public BindingCommand OnConnectionClickCommand = new BindingCommand(new BindingAction() {
@Override @Override
public void call() { public void call() {
mList.clear();
map.clear();
observableList.clear();
if (isInventory)
App.getInstance().getLinkage().stopInventory();
else
App.getInstance().getLinkage().startInventory(1, 0);
isInventory = !isInventory;
} }
}); });
......
...@@ -21,6 +21,8 @@ import java.util.List; ...@@ -21,6 +21,8 @@ import java.util.List;
public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM> { public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM> {
private int loginType;//登录后是否跳转,0跳转main 1不跳转
@Override @Override
public int initContentView(Bundle bundle) { public int initContentView(Bundle bundle) {
return R.layout.activity_splash; return R.layout.activity_splash;
...@@ -31,6 +33,13 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM ...@@ -31,6 +33,13 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM
return BR.viewModel; return BR.viewModel;
} }
@Override
public void initParam() {
super.initParam();
loginType = getIntent().getIntExtra("loginType", 0);
}
@Override @Override
public SplashVM initViewModel() { public SplashVM initViewModel() {
VMFactory factory = VMFactory.getInstance(getApplication()); VMFactory factory = VMFactory.getInstance(getApplication());
...@@ -41,6 +50,8 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM ...@@ -41,6 +50,8 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding, SplashVM
public void initData() { public void initData() {
super.initData(); super.initData();
showDialog("正在同步基础数据,请稍后"); showDialog("正在同步基础数据,请稍后");
viewModel.loginType = loginType;
viewModel.requestDict(); viewModel.requestDict();
} }
......
...@@ -44,6 +44,8 @@ public class SplashVM extends MainBarVM<Repository> { ...@@ -44,6 +44,8 @@ public class SplashVM extends MainBarVM<Repository> {
private int labelPageIndex = 1; private int labelPageIndex = 1;
private int unitPageIndex = 0; private int unitPageIndex = 0;
public int loginType;//登录后是否跳转, 0跳转main 1不跳转
public SplashVM(@NonNull Application application, Repository repository) { public SplashVM(@NonNull Application application, Repository repository) {
super(application, repository); super(application, repository);
...@@ -229,7 +231,8 @@ public class SplashVM extends MainBarVM<Repository> { ...@@ -229,7 +231,8 @@ public class SplashVM extends MainBarVM<Repository> {
dismissDialog(); dismissDialog();
ToastUtils.showShort("页面配置详情数据更新完成!"); ToastUtils.showShort("页面配置详情数据更新完成!");
SPUtils.getInstance().put("isFirst", false); SPUtils.getInstance().put("isFirst", false);
startActivity(MainActivity.class); if (loginType == 0)
startActivity(MainActivity.class);
finish(); finish();
} }
......
...@@ -43,7 +43,7 @@ public class EntityUtils { ...@@ -43,7 +43,7 @@ public class EntityUtils {
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 Object[]{});
return value; return value;
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
android:textColor="@color/textColor" android:textColor="@color/textColor"
android:textColorHint="@color/textColorHint" android:textColorHint="@color/textColorHint"
android:textSize="@dimen/edit_size" android:textSize="@dimen/edit_size"
android:imeOptions="actionNext"
binding:layout_constraintEnd_toStartOf="@+id/clear_et_img" binding:layout_constraintEnd_toStartOf="@+id/clear_et_img"
binding:layout_constraintStart_toEndOf="@+id/person_code_tip" binding:layout_constraintStart_toEndOf="@+id/person_code_tip"
binding:layout_constraintTop_toTopOf="@+id/login_frame" binding:layout_constraintTop_toTopOf="@+id/login_frame"
...@@ -113,6 +114,7 @@ ...@@ -113,6 +114,7 @@
android:textColor="@color/textColor" android:textColor="@color/textColor"
android:textColorHint="@color/textColorHint" android:textColorHint="@color/textColorHint"
android:textSize="@dimen/edit_size" android:textSize="@dimen/edit_size"
android:imeOptions="actionDone"
binding:layout_constraintEnd_toStartOf="@+id/iv_switch_pwd" binding:layout_constraintEnd_toStartOf="@+id/iv_switch_pwd"
binding:layout_constraintRight_toRightOf="parent" binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintStart_toEndOf="@+id/person_pwd_tip" binding:layout_constraintStart_toEndOf="@+id/person_pwd_tip"
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="50dp"
binding:layout_constraintLeft_toRightOf="@+id/guideline_vertical_left" binding:layout_constraintLeft_toRightOf="@+id/guideline_vertical_left"
binding:layout_constraintRight_toRightOf="parent" binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toTopOf="parent" binding:layout_constraintTop_toTopOf="parent"
...@@ -77,6 +78,18 @@ ...@@ -77,6 +78,18 @@
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_base_archives_sync" binding:layout_constraintBaseline_toBaselineOf="@+id/btn_base_archives_sync"
/> />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_base_archives_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.cattleresumeErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_base_archives_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_base_archives_time"
/>
<!-- sign_measure --> <!-- sign_measure -->
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_sign_measure_sync" android:id="@+id/btn_sign_measure_sync"
...@@ -113,6 +126,18 @@ ...@@ -113,6 +126,18 @@
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_sign_measure_sync" binding:layout_constraintBaseline_toBaselineOf="@+id/btn_sign_measure_sync"
/> />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_sign_measure_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.performanceErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_sign_measure_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_sign_measure_time"
/>
<!-- weighting_manage --> <!-- weighting_manage -->
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_weighting_manage_sync" android:id="@+id/btn_weighting_manage_sync"
...@@ -149,6 +174,18 @@ ...@@ -149,6 +174,18 @@
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_weighting_manage_sync" binding:layout_constraintBaseline_toBaselineOf="@+id/btn_weighting_manage_sync"
/> />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_weighting_manage_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.weightManErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_weighting_manage_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_weighting_manage_time"
/>
<!-- treatment_record --> <!-- treatment_record -->
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_treatment_record_sync" android:id="@+id/btn_treatment_record_sync"
...@@ -184,12 +221,26 @@ ...@@ -184,12 +221,26 @@
binding:layout_constraintLeft_toRightOf="@+id/tv_treatment_record_count" binding:layout_constraintLeft_toRightOf="@+id/tv_treatment_record_count"
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_treatment_record_sync" binding:layout_constraintBaseline_toBaselineOf="@+id/btn_treatment_record_sync"
/> />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_treatment_record_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.medicalrecordsErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_treatment_record_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_treatment_record_time"
/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="50dp"
binding:layout_constraintLeft_toRightOf="@+id/guideline_vertical_right" binding:layout_constraintLeft_toRightOf="@+id/guideline_vertical_right"
binding:layout_constraintRight_toRightOf="parent" binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toTopOf="parent" binding:layout_constraintTop_toTopOf="parent"
...@@ -232,6 +283,18 @@ ...@@ -232,6 +283,18 @@
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_immun_record_sync" binding:layout_constraintBaseline_toBaselineOf="@+id/btn_immun_record_sync"
/> />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_immun_record_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.immunebatchErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_immun_record_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_immun_record_time"
/>
<!-- immun_record_detail --> <!-- immun_record_detail -->
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_immun_record_detail_sync" android:id="@+id/btn_immun_record_detail_sync"
...@@ -268,6 +331,18 @@ ...@@ -268,6 +331,18 @@
binding:layout_constraintBaseline_toBaselineOf="@+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_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.immunebatchDetailErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_immun_record_detail_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_immun_record_detail_time"
/>
<!-- 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"
...@@ -304,6 +379,18 @@ ...@@ -304,6 +379,18 @@
binding:layout_constraintBaseline_toBaselineOf="@+id/btn_breeding_record_sync" binding:layout_constraintBaseline_toBaselineOf="@+id/btn_breeding_record_sync"
/> />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_breeding_record_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.cattlematingMasterErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_breeding_record_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_breeding_record_time"
/>
<!-- breeding_record_detail --> <!-- breeding_record_detail -->
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_breeding_record_detail_sync" android:id="@+id/btn_breeding_record_detail_sync"
...@@ -339,6 +426,31 @@ ...@@ -339,6 +426,31 @@
binding:layout_constraintLeft_toRightOf="@+id/tv_breeding_record_detail_count" binding:layout_constraintLeft_toRightOf="@+id/tv_breeding_record_detail_count"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_breeding_record_detail_count" binding:layout_constraintBaseline_toBaselineOf="@+id/tv_breeding_record_detail_count"
/> />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_breeding_record_detail_error_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="@dimen/sp_18"
android:text="@{viewModel.cattlematingDetaillErrorCount}"
android:textColor="@color/orange"
binding:layout_constraintLeft_toRightOf="@+id/tv_breeding_record_detail_time"
binding:layout_constraintBaseline_toBaselineOf="@+id/tv_breeding_record_detail_time"
/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_error_data_upload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/error_data_upload"
android:layout_marginBottom="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_50"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintBottom_toBottomOf="parent"
binding:onClickCommand="@{viewModel.OnErrorDataUploadClickCommand}"
/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
android:id="@+id/tv_weigh_last" android:id="@+id/tv_weigh_last"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="83" android:text="@{String.valueOf(viewModel.lastGainWeight)}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
binding:layout_constraintBottom_toTopOf="@+id/tv_date_last" binding:layout_constraintBottom_toTopOf="@+id/tv_date_last"
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
android:id="@+id/tv_date_last" android:id="@+id/tv_date_last"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="2021-11-03" android:text="@{viewModel.lastGainDate}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_10" android:textSize="@dimen/sp_10"
binding:layout_constraintBottom_toBottomOf="parent" binding:layout_constraintBottom_toBottomOf="parent"
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
android:id="@+id/tv_weigh_adg" android:id="@+id/tv_weigh_adg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="83" android:text="@{String.valueOf(viewModel.adgGainWeight)}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
binding:layout_constraintBottom_toTopOf="@+id/tv_date_adg" binding:layout_constraintBottom_toTopOf="@+id/tv_date_adg"
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
android:id="@+id/tv_date_adg" android:id="@+id/tv_date_adg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="2021-11-03" android:text="@{viewModel.adgGainDate}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_10" android:textSize="@dimen/sp_10"
binding:layout_constraintBottom_toBottomOf="parent" binding:layout_constraintBottom_toBottomOf="parent"
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
android:id="@+id/tv_weigh_bwg" android:id="@+id/tv_weigh_bwg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="83" android:text="@{String.valueOf(viewModel.totalGainWeight)}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
binding:layout_constraintBottom_toTopOf="@+id/tv_date_bwg" binding:layout_constraintBottom_toTopOf="@+id/tv_date_bwg"
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
android:id="@+id/tv_date_bwg" android:id="@+id/tv_date_bwg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="2021-11-03" android:text="@{viewModel.totalGainDate}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_10" android:textSize="@dimen/sp_10"
binding:layout_constraintBottom_toBottomOf="parent" binding:layout_constraintBottom_toBottomOf="parent"
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
android:id="@+id/tv_weigh_last" android:id="@+id/tv_weigh_last"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="83" android:text="@{String.valueOf(viewModel.lastGainWeight)}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
binding:layout_constraintBottom_toTopOf="@+id/tv_date_last" binding:layout_constraintBottom_toTopOf="@+id/tv_date_last"
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
android:id="@+id/tv_date_last" android:id="@+id/tv_date_last"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="2021-11-03" android:text="@{viewModel.lastGainDate}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_10" android:textSize="@dimen/sp_10"
binding:layout_constraintBottom_toBottomOf="parent" binding:layout_constraintBottom_toBottomOf="parent"
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
android:id="@+id/tv_weigh_adg" android:id="@+id/tv_weigh_adg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="83" android:text="@{String.valueOf(viewModel.adgGainWeight)}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
binding:layout_constraintBottom_toTopOf="@+id/tv_date_adg" binding:layout_constraintBottom_toTopOf="@+id/tv_date_adg"
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
android:id="@+id/tv_date_adg" android:id="@+id/tv_date_adg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="2021-11-03" android:text="@{viewModel.adgGainDate}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_10" android:textSize="@dimen/sp_10"
binding:layout_constraintBottom_toBottomOf="parent" binding:layout_constraintBottom_toBottomOf="parent"
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
android:id="@+id/tv_weigh_bwg" android:id="@+id/tv_weigh_bwg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="83" android:text="@{String.valueOf(viewModel.totalGainWeight)}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
binding:layout_constraintBottom_toTopOf="@+id/tv_date_bwg" binding:layout_constraintBottom_toTopOf="@+id/tv_date_bwg"
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
android:id="@+id/tv_date_bwg" android:id="@+id/tv_date_bwg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="2021-11-03" android:text="@{viewModel.totalGainDate}"
android:textColor="@color/colorSecondary" android:textColor="@color/colorSecondary"
android:textSize="@dimen/sp_10" android:textSize="@dimen/sp_10"
binding:layout_constraintBottom_toBottomOf="parent" binding:layout_constraintBottom_toBottomOf="parent"
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
<string name="breeding_record_detail">配种详情</string> <string name="breeding_record_detail">配种详情</string>
<string name="error_data_upload">错误上报</string>
<string name="jobNum">工号:</string> <string name="jobNum">工号:</string>
<string name="pleaseInputUserName">请输入用户名</string> <string name="pleaseInputUserName">请输入用户名</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