Commit 2bbdab56 authored by hywang's avatar hywang

1.性能测定修改为每年龄段一条记录;

2.配种修改计算预产期;
3.配种主表改为固定显示品种和所属种蓄站,不再由后台配置;
parent 8db1c32a
...@@ -48,7 +48,7 @@ android { ...@@ -48,7 +48,7 @@ android {
} }
greendao { greendao {
schemaVersion 1 //数据库版本号 schemaVersion 3 //数据库版本号
daoPackage 'com.phlx.anchorcollect_p.db.gen' daoPackage 'com.phlx.anchorcollect_p.db.gen'
targetGenDir 'src/main/java' targetGenDir 'src/main/java'
} }
......
...@@ -50,6 +50,7 @@ public class Configs { ...@@ -50,6 +50,7 @@ public class Configs {
public static final String SP_NAME = "sp_name"; public static final String SP_NAME = "sp_name";
public static final String SP_LOGIN_NAME = "sp_login_name"; public static final String SP_LOGIN_NAME = "sp_login_name";
public static final String SP_DEPT_ID = "sp_dept_id"; public static final String SP_DEPT_ID = "sp_dept_id";
public static final String SP_DEPT_NAME = "sp_dept_name";
public static final String SP_FREQUENCY = "sp_frequency"; public static final String SP_FREQUENCY = "sp_frequency";
public static final String SP_USER_PASSWORD = "sp_user_password"; public static final String SP_USER_PASSWORD = "sp_user_password";
public static final String SP_USER_EMAIL = "sp_user_email"; public static final String SP_USER_EMAIL = "sp_user_email";
...@@ -103,6 +104,7 @@ public class Configs { ...@@ -103,6 +104,7 @@ public class Configs {
public static List<GenTableColumn> immunebatch; public static List<GenTableColumn> immunebatch;
public static List<GenTableColumn> cattlematingMaster; public static List<GenTableColumn> cattlematingMaster;
public static List<GenTableColumn> cattlematingDetaill; public static List<GenTableColumn> cattlematingDetaill;
public static List<GenTableColumn> cattlematingDetaillList;
//字典项 //字典项
public static List<DictEntity> dictList = new ArrayList<>(); public static List<DictEntity> dictList = new ArrayList<>();
......
...@@ -74,6 +74,11 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -74,6 +74,11 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
*/ */
private Long deptId; private Long deptId;
/**
* 部门id
*/
private Long caId;
/** 是否上传 0未上传,1已上传 */ /** 是否上传 0未上传,1已上传 */
private String uploadStatus; private String uploadStatus;
...@@ -127,6 +132,11 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -127,6 +132,11 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
} else { } else {
deptId = in.readLong(); deptId = in.readLong();
} }
if (in.readByte() == 0) {
caId = null;
} else {
caId = in.readLong();
}
uploadStatus = in.readString(); uploadStatus = in.readString();
searchValue = in.readString(); searchValue = in.readString();
createBy = in.readString(); createBy = in.readString();
...@@ -136,10 +146,10 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -136,10 +146,10 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
remark = in.readString(); remark = in.readString();
} }
@Generated(hash = 933327768) @Generated(hash = 1961071723)
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,
String pregnancy, Long deptId, String uploadStatus, String searchValue, String createBy, String pregnancy, Long deptId, Long caId, 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;
...@@ -152,6 +162,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -152,6 +162,7 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
this.dueDate = dueDate; this.dueDate = dueDate;
this.pregnancy = pregnancy; this.pregnancy = pregnancy;
this.deptId = deptId; this.deptId = deptId;
this.caId = caId;
this.uploadStatus = uploadStatus; this.uploadStatus = uploadStatus;
this.searchValue = searchValue; this.searchValue = searchValue;
this.createBy = createBy; this.createBy = createBy;
...@@ -194,6 +205,12 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -194,6 +205,12 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
dest.writeByte((byte) 1); dest.writeByte((byte) 1);
dest.writeLong(deptId); dest.writeLong(deptId);
} }
if (caId == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(caId);
}
dest.writeString(uploadStatus); dest.writeString(uploadStatus);
dest.writeString(searchValue); dest.writeString(searchValue);
dest.writeString(createBy); dest.writeString(createBy);
...@@ -308,6 +325,14 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -308,6 +325,14 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
this.deptId = deptId; this.deptId = deptId;
} }
public Long getCaId() {
return caId;
}
public void setCaId(Long caId) {
this.caId = caId;
}
public String getUploadStatus() { public String getUploadStatus() {
return uploadStatus; return uploadStatus;
} }
...@@ -367,17 +392,18 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -367,17 +392,18 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
@Override @Override
public String toString() { public String toString() {
return "BreedingRecordDetailEntity{" + return "BreedingRecordDetailEntity{" +
"unid='" + unid + '\'' + "unid=" + unid +
", fUnid='" + fUnid + '\'' + ", fUnid=" + fUnid +
", matingStyle='" + matingStyle + '\'' + ", matingStyle='" + matingStyle + '\'' +
", cattleresumeId='" + cattleresumeId + '\'' + ", cattleresumeId=" + cattleresumeId +
", frozenSemenBatch='" + frozenSemenBatch + '\'' + ", frozenSemenBatch='" + frozenSemenBatch + '\'' +
", matingDate='" + matingDate + '\'' + ", matingDate='" + matingDate + '\'' +
", isReturn='" + isReturn + '\'' + ", isReturn='" + isReturn + '\'' +
", backLoveDate='" + backLoveDate + '\'' + ", backLoveDate='" + backLoveDate + '\'' +
", dueDate='" + dueDate + '\'' + ", dueDate='" + dueDate + '\'' +
", pregnancy='" + pregnancy + '\'' + ", pregnancy='" + pregnancy + '\'' +
", deptId='" + deptId + '\'' + ", deptId=" + deptId +
", caId=" + caId +
", uploadStatus='" + uploadStatus + '\'' + ", uploadStatus='" + uploadStatus + '\'' +
", searchValue='" + searchValue + '\'' + ", searchValue='" + searchValue + '\'' +
", createBy='" + createBy + '\'' + ", createBy='" + createBy + '\'' +
...@@ -395,6 +421,4 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel ...@@ -395,6 +421,4 @@ public class BreedingRecordDetailEntity extends BaseObservable implements Parcel
public void setFUnid(Long fUnid) { public void setFUnid(Long fUnid) {
this.fUnid = fUnid; this.fUnid = fUnid;
} }
} }
...@@ -90,6 +90,14 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -90,6 +90,14 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
/** 是否淘汰;0,在用,1淘汰 */ /** 是否淘汰;0,在用,1淘汰 */
private Long isOut; private Long isOut;
/**
* 母牛年龄
*/
private Integer age;
/** 犊牛毛色 */
private String colour;
/** 时间戳 */ /** 时间戳 */
private String inputTime; private String inputTime;
...@@ -161,6 +169,12 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -161,6 +169,12 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
} else { } else {
isOut = in.readLong(); isOut = in.readLong();
} }
if (in.readByte() == 0) {
age = null;
} else {
age = in.readInt();
}
colour = in.readString();
inputTime = in.readString(); inputTime = in.readString();
if (in.readByte() == 0) { if (in.readByte() == 0) {
deptId = null; deptId = null;
...@@ -176,14 +190,14 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -176,14 +190,14 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
remark = in.readString(); remark = in.readString();
} }
@Generated(hash = 1080101721) @Generated(hash = 1369241841)
public CattleResumeEntity(Long unid, String registrationNo, String individualNo, String circleNo, public CattleResumeEntity(Long unid, String registrationNo, String individualNo, String circleNo,
String raiseType, String raiseVarieties, String birthdate, Double birthHeavy, String sex, String raiseType, String raiseVarieties, String birthdate, Double birthHeavy, String sex,
String birthDifficulty, String isTwins, String childTime, String grade, String fatherReg, String birthDifficulty, String isTwins, String childTime, String grade, String fatherReg,
String motherReg, Double fromMilkHeavy, String health, String junHeavy, String decAppScore, String motherReg, Double fromMilkHeavy, String health, String junHeavy, String decAppScore,
String photo, String photoPath, String status, Long isOut, String inputTime, Long deptId, String photo, String photoPath, String status, Long isOut, Integer age, String colour,
String uploadStatus, String uploadTime, String createBy, String createTime, String updateBy, String inputTime, Long deptId, String uploadStatus, String uploadTime, String createBy,
String updateTime, String remark) { String createTime, String updateBy, String updateTime, String remark) {
this.unid = unid; this.unid = unid;
this.registrationNo = registrationNo; this.registrationNo = registrationNo;
this.individualNo = individualNo; this.individualNo = individualNo;
...@@ -207,6 +221,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -207,6 +221,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this.photoPath = photoPath; this.photoPath = photoPath;
this.status = status; this.status = status;
this.isOut = isOut; this.isOut = isOut;
this.age = age;
this.colour = colour;
this.inputTime = inputTime; this.inputTime = inputTime;
this.deptId = deptId; this.deptId = deptId;
this.uploadStatus = uploadStatus; this.uploadStatus = uploadStatus;
...@@ -263,6 +279,13 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -263,6 +279,13 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
dest.writeByte((byte) 1); dest.writeByte((byte) 1);
dest.writeLong(isOut); dest.writeLong(isOut);
} }
if (age == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(age);
}
dest.writeString(colour);
dest.writeString(inputTime); dest.writeString(inputTime);
if (deptId == null) { if (deptId == null) {
dest.writeByte((byte) 0); dest.writeByte((byte) 0);
...@@ -296,6 +319,10 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -296,6 +319,10 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
} }
}; };
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Long getUnid() { public Long getUnid() {
return unid; return unid;
} }
...@@ -480,6 +507,22 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -480,6 +507,22 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
this.isOut = isOut; this.isOut = isOut;
} }
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getColour() {
return colour;
}
public void setColour(String colour) {
this.colour = colour;
}
public String getInputTime() { public String getInputTime() {
return inputTime; return inputTime;
} }
...@@ -578,6 +621,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable { ...@@ -578,6 +621,8 @@ public class CattleResumeEntity extends BaseObservable implements Parcelable {
", photoPath='" + photoPath + '\'' + ", photoPath='" + photoPath + '\'' +
", status='" + status + '\'' + ", status='" + status + '\'' +
", isOut=" + isOut + ", isOut=" + isOut +
", age=" + age +
", colour='" + colour + '\'' +
", inputTime='" + inputTime + '\'' + ", inputTime='" + inputTime + '\'' +
", deptId=" + deptId + ", deptId=" + deptId +
", uploadStatus='" + uploadStatus + '\'' + ", uploadStatus='" + uploadStatus + '\'' +
......
package com.phlx.anchorcollect_p.entity;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.databinding.BaseObservable;
/**
* 部门表 sys_dept
*
* @author ruoyi
*/
public class DeptEntity extends BaseObservable implements Parcelable {
/** 部门ID */
private Long deptId;
/** 父部门ID */
private Long parentId;
/** 祖级列表 */
private String ancestors;
/** 部门名称 */
private String deptName;
/** 显示顺序 */
private String orderNum;
/** 负责人 */
private String leader;
/** 联系电话 */
private String phone;
/** 邮箱 */
private String email;
/** 部门状态:0正常,1停用 */
private String status;
/** 删除标志(0代表存在 2代表删除) */
private String delFlag;
/** 父部门名称 */
private String parentName;
/** 排除编号 */
private Long excludeId;
public DeptEntity() {
}
protected DeptEntity(Parcel in) {
if (in.readByte() == 0) {
deptId = null;
} else {
deptId = in.readLong();
}
if (in.readByte() == 0) {
parentId = null;
} else {
parentId = in.readLong();
}
ancestors = in.readString();
deptName = in.readString();
orderNum = in.readString();
leader = in.readString();
phone = in.readString();
email = in.readString();
status = in.readString();
delFlag = in.readString();
parentName = in.readString();
if (in.readByte() == 0) {
excludeId = null;
} else {
excludeId = in.readLong();
}
}
@Override
public void writeToParcel(Parcel dest, int flags) {
if (deptId == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(deptId);
}
if (parentId == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(parentId);
}
dest.writeString(ancestors);
dest.writeString(deptName);
dest.writeString(orderNum);
dest.writeString(leader);
dest.writeString(phone);
dest.writeString(email);
dest.writeString(status);
dest.writeString(delFlag);
dest.writeString(parentName);
if (excludeId == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(excludeId);
}
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<DeptEntity> CREATOR = new Creator<DeptEntity>() {
@Override
public DeptEntity createFromParcel(Parcel in) {
return new DeptEntity(in);
}
@Override
public DeptEntity[] newArray(int size) {
return new DeptEntity[size];
}
};
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getAncestors() {
return ancestors;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public Long getExcludeId() {
return excludeId;
}
public void setExcludeId(Long excludeId) {
this.excludeId = excludeId;
}
@Override
public String toString() {
return "DeptEntity{" +
"deptId=" + deptId +
", parentId=" + parentId +
", ancestors='" + ancestors + '\'' +
", deptName='" + deptName + '\'' +
", orderNum='" + orderNum + '\'' +
", leader='" + leader + '\'' +
", phone='" + phone + '\'' +
", email='" + email + '\'' +
", status='" + status + '\'' +
", delFlag='" + delFlag + '\'' +
", parentName='" + parentName + '\'' +
", excludeId=" + excludeId +
'}';
}
}
...@@ -13,8 +13,6 @@ import java.util.List; ...@@ -13,8 +13,6 @@ import java.util.List;
* @author ruoyi * @author ruoyi
*/ */
public class UserEntity extends BaseObservable implements Parcelable { public class UserEntity extends BaseObservable implements Parcelable {
private static final long serialVersionUID = 1L;
/** 用户ID */ /** 用户ID */
private String userId; private String userId;
...@@ -69,9 +67,9 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -69,9 +67,9 @@ public class UserEntity extends BaseObservable implements Parcelable {
/** 密码最后更新时间 */ /** 密码最后更新时间 */
private String pwdUpdateDate; private String pwdUpdateDate;
// /** 部门对象 */ /** 部门对象 */
// private SysDept dept; private DeptEntity dept;
//
private List<UserRoleEntity> roles; private List<UserRoleEntity> roles;
/** 角色组 */ /** 角色组 */
...@@ -103,6 +101,7 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -103,6 +101,7 @@ public class UserEntity extends BaseObservable implements Parcelable {
loginIp = in.readString(); loginIp = in.readString();
loginDate = in.readString(); loginDate = in.readString();
pwdUpdateDate = in.readString(); pwdUpdateDate = in.readString();
dept = in.readParcelable(DeptEntity.class.getClassLoader());
roles = in.createTypedArrayList(UserRoleEntity.CREATOR); roles = in.createTypedArrayList(UserRoleEntity.CREATOR);
} }
...@@ -126,6 +125,7 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -126,6 +125,7 @@ public class UserEntity extends BaseObservable implements Parcelable {
dest.writeString(loginIp); dest.writeString(loginIp);
dest.writeString(loginDate); dest.writeString(loginDate);
dest.writeString(pwdUpdateDate); dest.writeString(pwdUpdateDate);
dest.writeParcelable(dept, flags);
dest.writeTypedList(roles); dest.writeTypedList(roles);
} }
...@@ -146,10 +146,6 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -146,10 +146,6 @@ public class UserEntity extends BaseObservable implements Parcelable {
} }
}; };
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getUserId() { public String getUserId() {
return userId; return userId;
} }
...@@ -294,6 +290,14 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -294,6 +290,14 @@ public class UserEntity extends BaseObservable implements Parcelable {
this.pwdUpdateDate = pwdUpdateDate; this.pwdUpdateDate = pwdUpdateDate;
} }
public DeptEntity getDept() {
return dept;
}
public void setDept(DeptEntity dept) {
this.dept = dept;
}
public List<UserRoleEntity> getRoles() { public List<UserRoleEntity> getRoles() {
return roles; return roles;
} }
...@@ -305,10 +309,10 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -305,10 +309,10 @@ public class UserEntity extends BaseObservable implements Parcelable {
@Override @Override
public String toString() { public String toString() {
return "UserEntity{" + return "UserEntity{" +
"userId=" + userId + "userId='" + userId + '\'' +
", deptId=" + deptId + ", deptId='" + deptId + '\'' +
", parentId=" + parentId + ", parentId='" + parentId + '\'' +
", roleId=" + roleId + ", roleId='" + roleId + '\'' +
", loginName='" + loginName + '\'' + ", loginName='" + loginName + '\'' +
", userName='" + userName + '\'' + ", userName='" + userName + '\'' +
", userType='" + userType + '\'' + ", userType='" + userType + '\'' +
...@@ -323,6 +327,7 @@ public class UserEntity extends BaseObservable implements Parcelable { ...@@ -323,6 +327,7 @@ public class UserEntity extends BaseObservable implements Parcelable {
", loginIp='" + loginIp + '\'' + ", loginIp='" + loginIp + '\'' +
", loginDate='" + loginDate + '\'' + ", loginDate='" + loginDate + '\'' +
", pwdUpdateDate='" + pwdUpdateDate + '\'' + ", pwdUpdateDate='" + pwdUpdateDate + '\'' +
", dept=" + dept +
", roles=" + roles + ", roles=" + roles +
'}'; '}';
} }
......
...@@ -49,15 +49,15 @@ public class RetrofitClient { ...@@ -49,15 +49,15 @@ 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 =
"serve.xlglmnmyzspt.org.cn"//正式 // "serve.xlglmnmyzspt.org.cn"//正式
// "39.101.170.186"//阿里云测试 // "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"//董
; ;
private static Context mContext = Utils.getContext(); private static Context mContext = Utils.getContext();
......
...@@ -96,7 +96,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -96,7 +96,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
viewModel.initGen(); viewModel.initGen();
binding.rvCollect.addItemDecoration(new SpaceItemDecoration(10)); // binding.rvCollect.addItemDecoration(new SpaceItemDecoration(10));
binding.rvCollectDetail.addItemDecoration(new SpaceItemDecoration(10)); binding.rvCollectDetail.addItemDecoration(new SpaceItemDecoration(10));
initTimePicker(); initTimePicker();
...@@ -153,7 +153,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -153,7 +153,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
gtc.notifyChange(); gtc.notifyChange();
} }
viewModel.remarkParamEntity.notifyChange(); viewModel.remarkParamEntity.notifyChange();
binding.rvCollect.getAdapter().notifyDataSetChanged(); // binding.rvCollect.getAdapter().notifyDataSetChanged();
binding.rvCollectDetail.getAdapter().notifyDataSetChanged(); binding.rvCollectDetail.getAdapter().notifyDataSetChanged();
if (aBoolean) { if (aBoolean) {
...@@ -382,7 +382,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -382,7 +382,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
//初始化表头 //初始化表头
List<String> headerStr = new ArrayList<>(); List<String> headerStr = new ArrayList<>();
List<String> fieldNameStr = new ArrayList<>(); List<String> fieldNameStr = new ArrayList<>();
for (GenTableColumn gtc : Configs.cattlematingDetaill) { for (GenTableColumn gtc : Configs.cattlematingDetaillList) {
if ("1".equals(gtc.getIsList())) { if ("1".equals(gtc.getIsList())) {
headerStr.add(gtc.getColumnComment()); headerStr.add(gtc.getColumnComment());
fieldNameStr.add(gtc.getJavaField()); fieldNameStr.add(gtc.getJavaField());
...@@ -464,7 +464,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB ...@@ -464,7 +464,7 @@ public class BreedingRecordFragment extends BaseFragment<FragmentBreedingRecordB
if (this != null && !hidden) { if (this != null && !hidden) {
viewModel.clearParamList(); viewModel.clearParamList();
viewModel.clearDetailParamList(); viewModel.clearDetailParamList();
viewModel.queryBreedingRecord(); viewModel.initBreedingRecord();
viewModel.rfid.set(Configs.tempRfid); viewModel.rfid.set(Configs.tempRfid);
} else { } else {
viewModel.rfid.set(""); viewModel.rfid.set("");
......
...@@ -225,11 +225,11 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -225,11 +225,11 @@ public class PerformanceVM extends BaseViewModel<Repository> {
} }
} }
savePerformance(); checkPerformance();
} }
}); });
private void savePerformance() { private void checkPerformance() {
JsonObject jsonObject = new JsonObject(); JsonObject jsonObject = new JsonObject();
for (GenTableColumn gtc : Configs.performance) { for (GenTableColumn gtc : Configs.performance) {
...@@ -250,6 +250,35 @@ public class PerformanceVM extends BaseViewModel<Repository> { ...@@ -250,6 +250,35 @@ public class PerformanceVM extends BaseViewModel<Repository> {
Gson gson = new Gson(); Gson gson = new Gson();
PerformanceEntity performanceEntity = gson.fromJson(jsonObject, PerformanceEntity.class); PerformanceEntity performanceEntity = gson.fromJson(jsonObject, PerformanceEntity.class);
//查询此月龄是否存在,存在拿出主键 做覆盖
QueryBuilder<PerformanceEntity> builder =
DbUtil.getInstance().getQueryBuilder(PerformanceEntity.class)
.where(PerformanceEntityDao.Properties.Age.eq(performanceEntity.getAge())
, PerformanceEntityDao.Properties.CattleresumeId.eq(Configs.tempUnid)
);
DbUtil.getInstance().setDbQueryCallBack(new DbQueryCallBack<PerformanceEntity>() {
@Override
public void onSuccess(List<PerformanceEntity> result) {
if (result != null && result.size() > 0) {
isModify = true;
Configs.resumeId = result.get(0).getUnid();
performanceEntity.setUnid(result.get(0).getUnid());
}
savePerformance(performanceEntity);
ToastUtils.showShort("查询-性能测定月龄数据-成功!");
}
@Override
public void onFailed() {
ToastUtils.showShort("性能测定月龄数据-数据库查询失败");
}
}).queryAsyncAll(PerformanceEntity.class, builder);
}
private void savePerformance(PerformanceEntity performanceEntity) {
dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (!isModify) {//新增 if (!isModify) {//新增
uuid = IdUtil.createSnowflake(3, 1).nextId(); uuid = IdUtil.createSnowflake(3, 1).nextId();
......
...@@ -157,6 +157,7 @@ public class LoginVM extends BaseViewModel<Repository> { ...@@ -157,6 +157,7 @@ public class LoginVM extends BaseViewModel<Repository> {
SPUtils.getInstance().put(Configs.SP_NAME, response.getData().getUser().getUserName()); SPUtils.getInstance().put(Configs.SP_NAME, response.getData().getUser().getUserName());
SPUtils.getInstance().put(Configs.SP_LOGIN_NAME, response.getData().getUser().getLoginName()); SPUtils.getInstance().put(Configs.SP_LOGIN_NAME, response.getData().getUser().getLoginName());
SPUtils.getInstance().put(Configs.SP_DEPT_ID, response.getData().getUser().getDeptId()); SPUtils.getInstance().put(Configs.SP_DEPT_ID, response.getData().getUser().getDeptId());
SPUtils.getInstance().put(Configs.SP_DEPT_NAME, response.getData().getUser().getDept().getDeptName());
String roleIds = ""; String roleIds = "";
List<UserRoleEntity> roles = response.getData().getUser().getRoles(); List<UserRoleEntity> roles = response.getData().getUser().getRoles();
...@@ -295,9 +296,18 @@ public class LoginVM extends BaseViewModel<Repository> { ...@@ -295,9 +296,18 @@ public class LoginVM extends BaseViewModel<Repository> {
QueryBuilder<GenTableColumn> builderDetaile6 = QueryBuilder<GenTableColumn> builderDetaile6 =
DbUtil.getInstance().getQueryBuilder(GenTableColumn.class) DbUtil.getInstance().getQueryBuilder(GenTableColumn.class)
.where(GenTableColumnDao.Properties.TableId.eq(gt.getTableId()) .where(GenTableColumnDao.Properties.TableId.eq(gt.getTableId())
, GenTableColumnDao.Properties.IsQuery.eq("1")) , GenTableColumnDao.Properties.IsQuery.eq("1")
)
.orderAsc(GenTableColumnDao.Properties.Sort); .orderAsc(GenTableColumnDao.Properties.Sort);
Configs.cattlematingDetaill = DbUtil.getInstance().queryAll(GenTableColumn.class, builderDetaile6); Configs.cattlematingDetaill = DbUtil.getInstance().queryAll(GenTableColumn.class, builderDetaile6);
//取详情列表表头
QueryBuilder<GenTableColumn> builderDetaile7 =
DbUtil.getInstance().getQueryBuilder(GenTableColumn.class)
.where(GenTableColumnDao.Properties.TableId.eq(gt.getTableId())
, GenTableColumnDao.Properties.IsList.eq("1")
)
.orderAsc(GenTableColumnDao.Properties.Sort);
Configs.cattlematingDetaillList = DbUtil.getInstance().queryAll(GenTableColumn.class, builderDetaile7);
break; break;
} }
......
...@@ -210,6 +210,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> { ...@@ -210,6 +210,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding, MainVM> {
viewModel.onTabClickEvent.observe(this, new Observer<Integer>() { viewModel.onTabClickEvent.observe(this, new Observer<Integer>() {
@Override @Override
public void onChanged(Integer integer) { public void onChanged(Integer integer) {
Configs.resumeId = null;
labelSwitching(integer); labelSwitching(integer);
Configs.mainPosition = integer; Configs.mainPosition = integer;
......
...@@ -220,9 +220,18 @@ public class SplashVM extends MainBarVM<Repository> { ...@@ -220,9 +220,18 @@ public class SplashVM extends MainBarVM<Repository> {
QueryBuilder<GenTableColumn> builderDetaile6 = QueryBuilder<GenTableColumn> builderDetaile6 =
DbUtil.getInstance().getQueryBuilder(GenTableColumn.class) DbUtil.getInstance().getQueryBuilder(GenTableColumn.class)
.where(GenTableColumnDao.Properties.TableId.eq(gt.getTableId()) .where(GenTableColumnDao.Properties.TableId.eq(gt.getTableId())
, GenTableColumnDao.Properties.IsQuery.eq("1")) , GenTableColumnDao.Properties.IsQuery.eq("1")
)
.orderAsc(GenTableColumnDao.Properties.Sort); .orderAsc(GenTableColumnDao.Properties.Sort);
Configs.cattlematingDetaill = DbUtil.getInstance().queryAll(GenTableColumn.class, builderDetaile6); Configs.cattlematingDetaill = DbUtil.getInstance().queryAll(GenTableColumn.class, builderDetaile6);
//取详情列表表头
QueryBuilder<GenTableColumn> builderDetaile7 =
DbUtil.getInstance().getQueryBuilder(GenTableColumn.class)
.where(GenTableColumnDao.Properties.TableId.eq(gt.getTableId())
, GenTableColumnDao.Properties.IsList.eq("1")
)
.orderAsc(GenTableColumnDao.Properties.Sort);
Configs.cattlematingDetaillList = DbUtil.getInstance().queryAll(GenTableColumn.class, builderDetaile7);
break; break;
} }
......
...@@ -443,6 +443,18 @@ ...@@ -443,6 +443,18 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_click_sync_upload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/one_click_sync"
android:layout_marginBottom="@dimen/dp_15"
android:layout_marginLeft="@dimen/dp_80"
binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintBottom_toBottomOf="parent"
binding:onClickCommand="@{viewModel.OnOneClickUploadClickCommand}"
/>
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_error_data_upload" android:id="@+id/btn_error_data_upload"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -60,21 +60,89 @@ ...@@ -60,21 +60,89 @@
binding:layout_constraintRight_toRightOf="parent" binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toTopOf="parent" /> binding:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/rv_collect" android:id="@+id/rv_collect"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="-5dp" android:orientation="horizontal"
android:layout_marginTop="5dp"
android:nestedScrollingEnabled="false"
binding:adapter="@{adapter}"
binding:itemBinding="@{viewModel.itemBinding}"
binding:items="@{viewModel.observableList}"
binding:layoutManager="@{LayoutManagers.grid(2)}"
binding:layout_constraintBottom_toTopOf="@+id/ll_detail_title" binding:layout_constraintBottom_toTopOf="@+id/ll_detail_title"
binding:layout_constraintLeft_toLeftOf="parent" binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toRightOf="parent" binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toBottomOf="@+id/tv_rfid_text" /> binding:layout_constraintTop_toBottomOf="@+id/tv_rfid_text" >
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/cl_title_1"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_50"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:padding="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center|start"
android:maxLines="1"
android:text="饲养品种"
android:textSize="@dimen/sp_10"
android:textColor="@color/colorPrimary" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center|end"
android:maxLines="1"
android:text="@{viewModel.raiseVarieties}"
android:textSize="@dimen/sp_10"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/cl_title_2"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_50"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_5"
android:padding="@dimen/dp_5"
android:background="@drawable/bg_radius_white_5"
binding:layout_constraintLeft_toLeftOf="parent"
binding:layout_constraintRight_toRightOf="parent"
binding:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center|start"
android:maxLines="1"
android:text="所属种蓄站"
android:textSize="@dimen/sp_10"
android:textColor="@color/colorPrimary"/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center|end"
android:maxLines="1"
android:text="@{viewModel.deptName}"
android:textSize="@dimen/sp_10"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<com.lingber.mycontrol.datagridview.DataGridView <com.lingber.mycontrol.datagridview.DataGridView
android:id="@+id/ll_detail_title" android:id="@+id/ll_detail_title"
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<string name="breeding_record_detail">配种详情</string> <string name="breeding_record_detail">配种详情</string>
<string name="one_click_sync">一键同步</string>
<string name="error_data_upload">错误上报</string> <string name="error_data_upload">错误上报</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