/* 文件路径: Bancai.java */
package com.example.kucun2.entity;
import android.annotation.SuppressLint;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
//板材
public class Bancai extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
@RefTo(target = Caizhi.class, type = RefType.SINGLE)
private Caizhi caizhi;
@RefTo(target = Mupi.class, type = RefType.SINGLE)
private Mupi mupi1;
@RefTo(target = Mupi.class, type = RefType.SINGLE)
private Mupi mupi2;
@RefTo(target = Dingdan_chanpin_zujian.class, type = RefType.SINGLE)
private Dingdan_chanpin_zujian Dingdan_chanpin_zujian;
private Double houdu;
public Bancai() {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Bancai bancai = (Bancai) o;
return Objects.equals(id, bancai.id) ;
}
public Bancai(Integer id, Caizhi caizhi, Mupi mupi1, Mupi mupi2, Double houdu) {
this.id = id;
this.caizhi = caizhi;
this.mupi1 = mupi1;
this.mupi2 = mupi2;
this.houdu = houdu;
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public Caizhi getCaizhi() {
return caizhi;
}
public void setCaizhi(Caizhi caizhi) {
Caizhi oldValue = this.caizhi;
this.caizhi = caizhi;
firePropertyChange("caizhi", oldValue, caizhi);
}
public Mupi getMupi1() {
return mupi1;
}
public void setMupi1(Mupi mupi1) {
Mupi oldValue = this.mupi1;
this.mupi1 = mupi1;
firePropertyChange("mupi1", oldValue, mupi1);
}
public Mupi getMupi2() {
return mupi2;
}
public void setMupi2(Mupi mupi2) {
Mupi oldValue = this.mupi2;
this.mupi2 = mupi2;
firePropertyChange("mupi2", oldValue, mupi2);
}
public Double getHoudu() {
return houdu;
}
public void setHoudu(Double houdu) {
Double oldValue = this.houdu;
this.houdu = houdu;
firePropertyChange("houdu", oldValue, houdu);
}
/**
* 表格中显示的文字
*
* @return
*/
@SuppressLint("DefaultLocale")
public String TableText() {
String boardInfo = "";
if (caizhi==null){return "";}
boardInfo += String.format("%.1f", this.getHoudu()) + this.getCaizhi().getName() + "(";
if (mupi1 != null) {
boardInfo += (this.getMupi1().getYou() ? this.getMupi1().getName() + "油" : this.getMupi1().getName());
}
if (mupi2 != null && mupi1 != null) {
boardInfo += ",";
}
if (mupi2 != null) {
boardInfo += (this.getMupi2().getYou() ? this.getMupi2().getName() + "油" : this.getMupi2().getName());
}
boardInfo += ")";
return boardInfo;
}
public com.example.kucun2.entity.Dingdan_chanpin_zujian getDingdan_chanpin_zujian() {
return Dingdan_chanpin_zujian;
}
public void setDingdan_chanpin_zujian(com.example.kucun2.entity.Dingdan_chanpin_zujian dingdan_chanpin_zujian) {
com.example.kucun2.entity.Dingdan_chanpin_zujian oldValue = this.Dingdan_chanpin_zujian;
Dingdan_chanpin_zujian = dingdan_chanpin_zujian;
firePropertyChange("dingdan_chanpin_zujian", oldValue, dingdan_chanpin_zujian);
}
}
================================================================================
/* 文件路径: Caizhi.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
//材质
public class Caizhi extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private String name;
@RefTo(target = Bancai.class, type = RefType.LIST, bidirectional = true, reverseField = "caizhi")
private List<Bancai> bancai = new ArrayList<>();
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public String getName() {
return name;
}
public void setName(String name) {
String oldValue = this.name;
this.name = name;
firePropertyChange("name", oldValue, name);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Caizhi caizhi = (Caizhi) o;
return Objects.equals(name, caizhi.name);
}
@Override
public int hashCode() {
return Objects.hashCode(name);
}
public List<Bancai> getBancai() {
return bancai;
}
public void setBancai(List<Bancai> bancai) {
List<Bancai> oldValue = this.bancai;
this.bancai = bancai;
firePropertyChange("bancai", oldValue, bancai);
}
}
================================================================================
/* 文件路径: Chanpin_Zujian.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
//产品组件关联
public class Chanpin_Zujian extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private Double one_howmany;
@RefTo(target = Chanpin.class, type = RefType.SINGLE)
private Chanpin chanpin;
@RefTo(target = Zujian.class, type = RefType.SINGLE)
private Zujian zujian;
@RefTo(target = Bancai.class, type = RefType.SINGLE)
private Bancai bancai;
public Chanpin_Zujian() {
super();
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public Chanpin getChanpin() {
return chanpin;
}
public void setChanpin(Chanpin chanpin) {
Chanpin oldValue = this.chanpin;
this.chanpin = chanpin;
firePropertyChange("chanpin", oldValue, chanpin);
}
public Zujian getZujian() {
return zujian;
}
public void setZujian(Zujian zujian) {
Zujian oldValue = this.zujian;
this.zujian = zujian;
firePropertyChange("zujian", oldValue, zujian);
}
public Double getOne_howmany() {
return one_howmany;
}
public void setOne_howmany(Double one_howmany) {
Double oldValue = this.one_howmany;
this.one_howmany = one_howmany;
firePropertyChange("one_howmany", oldValue, one_howmany);
}
public Bancai getBancai() {
return bancai;
}
public void setBancai(Bancai bancai) {
Bancai oldValue = this.bancai;
this.bancai = bancai;
firePropertyChange("bancai", oldValue, bancai);
}
}
================================================================================
/* 文件路径: Chanpin.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
import java.util.ArrayList;
import java.util.List;
//产品
public class Chanpin extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private String bianhao;
@RefTo(target = Chanpin_Zujian.class, type = RefType.LIST)
private List<Chanpin_Zujian> chanpinZujian = new ArrayList<>();
@RefTo(target = Dingdan_Chanpin.class, type = RefType.LIST)
private List<Dingdan_Chanpin> dingdanChanpin = new ArrayList<>();
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public List<Chanpin_Zujian> getChanpinZujian() {
return chanpinZujian;
}
public void setChanpinZujian(List<Chanpin_Zujian> chanpinZujian) {
List<Chanpin_Zujian> oldValue = this.chanpinZujian;
this.chanpinZujian = chanpinZujian;
firePropertyChange("chanpinZujian", oldValue, chanpinZujian);
}
public List<Dingdan_Chanpin> getDingdanChanpin() {
return dingdanChanpin;
}
public void setDingdanChanpin(List<Dingdan_Chanpin> dingdanChanpin) {
List<Dingdan_Chanpin> oldValue = this.dingdanChanpin;
this.dingdanChanpin = dingdanChanpin;
firePropertyChange("dingdanChanpin", oldValue, dingdanChanpin);
}
public Chanpin() {
}
public String getBianhao() {
return bianhao;
}
public void setBianhao(String bianhao) {
String oldValue = this.bianhao;
this.bianhao = bianhao;
firePropertyChange("bianhao", oldValue, bianhao);
}
}
================================================================================
/* 文件路径: Dingdan_chanpin_zujian.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
/**
* 、
* 订单板材关联
*/
public class Dingdan_chanpin_zujian extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
@RefTo(target = Dingdan.class, type = RefType.SINGLE)
private Dingdan dingdian;
@RefTo(target = Chanpin_Zujian.class, type = RefType.SINGLE)
private Chanpin_Zujian zujian;
@RefTo(target = Bancai.class, type = RefType.SINGLE)
private Bancai bancai;
private Integer shuliang;
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public Dingdan getDingdian() {
return dingdian;
}
public void setDingdian(Dingdan dingdian) {
Dingdan oldValue = this.dingdian;
this.dingdian = dingdian;
firePropertyChange("dingdian", oldValue, dingdian);
}
public Chanpin_Zujian getZujian() {
return zujian;
}
public void setZujian(Chanpin_Zujian zujian) {
Chanpin_Zujian oldValue = this.zujian;
this.zujian = zujian;
firePropertyChange("zujian", oldValue, zujian);
}
public Bancai getBancai() {
return bancai;
}
public void setBancai(Bancai bancai) {
Bancai oldValue = this.bancai;
this.bancai = bancai;
firePropertyChange("bancai", oldValue, bancai);
}
public Integer getShuliang() {
return shuliang;
}
public void setShuliang(Integer shuliang) {
Integer oldValue = this.shuliang;
this.shuliang = shuliang;
firePropertyChange("shuliang", oldValue, shuliang);
}
public Dingdan_chanpin_zujian() {
}
}
================================================================================
/* 文件路径: Dingdan_Chanpin.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
/**
* 订单产品关联
*/
public class Dingdan_Chanpin extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
@RefTo(target = Dingdan.class, type = RefType.SINGLE)
private Dingdan dingdan;
@RefTo(target = Chanpin.class, type = RefType.SINGLE)
private Chanpin chanpin;
private Integer shuliang;
public Dingdan_Chanpin(Integer id, Dingdan dingdan, Chanpin chanpin, Integer shuliang) {
this.id = id;
this.dingdan = dingdan;
this.chanpin = chanpin;
this.shuliang = shuliang;
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public Dingdan getDingdan() {
return dingdan;
}
public void setDingdan(Dingdan dingdan) {
Dingdan oldValue = this.dingdan;
this.dingdan = dingdan;
firePropertyChange("dingdan", oldValue, dingdan);
}
public Chanpin getChanpin() {
return chanpin;
}
public void setChanpin(Chanpin chanpin) {
Chanpin oldValue = this.chanpin;
this.chanpin = chanpin;
firePropertyChange("chanpin", oldValue, chanpin);
}
public Integer getShuliang() {
return shuliang;
}
public void setShuliang(Integer shuliang) {
Integer oldValue = this.shuliang;
this.shuliang = shuliang;
firePropertyChange("shuliang", oldValue, shuliang);
}
public Dingdan_Chanpin() {
}
}
================================================================================
/* 文件路径: Dingdan.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 订单
*/
public class Dingdan extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private String number;
@RefTo(target = Dingdan_Chanpin.class, type = RefType.LIST)
private List<Dingdan_Chanpin> dingdanChanpin = new ArrayList<>();
@RefTo(target = Dingdan_chanpin_zujian.class, type = RefType.LIST)
private List<Dingdan_chanpin_zujian> dingdanChanpinZujian = new ArrayList<>();
private Date xiadan;
private Date jiaohuo;
public List<Dingdan_Chanpin> getDingdanChanpin() {
return dingdanChanpin;
}
public void setDingdanChanpin(List<Dingdan_Chanpin> dingdanChanpin) {
List<Dingdan_Chanpin> oldValue = this.dingdanChanpin;
this.dingdanChanpin = dingdanChanpin;
firePropertyChange("dingdanChanpin", oldValue, dingdanChanpin);
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
String oldValue = this.number;
this.number = number;
firePropertyChange("number", oldValue, number);
}
public Date getXiadan() {
return xiadan;
}
public void setXiadan(Date xiadan) {
Date oldValue = this.xiadan;
this.xiadan = xiadan;
firePropertyChange("xiadan", oldValue, xiadan);
}
public Date getJiaohuo() {
return jiaohuo;
}
public void setJiaohuo(Date jiaohuo) {
Date oldValue = this.jiaohuo;
this.jiaohuo = jiaohuo;
firePropertyChange("jiaohuo", oldValue, jiaohuo);
}
public Dingdan() {
}
public List<Dingdan_chanpin_zujian> getDingdanChanpinZujian() {
return dingdanChanpinZujian;
}
public void setDingdanChanpinZujian(List<Dingdan_chanpin_zujian> dingdanChanpinZujian) {
List<Dingdan_chanpin_zujian> oldValue = this.dingdanChanpinZujian;
this.dingdanChanpinZujian = dingdanChanpinZujian;
firePropertyChange("dingdanChanpinZujian", oldValue, dingdanChanpinZujian);
}
}
================================================================================
/* 文件路径: Information.java */
package com.example.kucun2.entity;
import android.annotation.SuppressLint;
import androidx.annotation.Keep;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
@Keep // 防止Proguard混淆
public class Information<T> {
private Integer status;
private String text;
private T data; // 使用泛型保证类型安全
private static final Gson gson = new Gson(); // Gson实例复用
// 构造方法
public Information(Integer status, String text, T data) {
this.status = status;
this.text = text;
this.data = data;
}
// JSON反序列化构造方法
@SuppressLint("NewApi")
public Information(Integer status, String text, String jsonData, Type dataType) {
this.status = status;
this.text = text;
try {
this.data = gson.fromJson(jsonData, dataType);
} catch (JsonSyntaxException e) {
this.data = null; // 处理解析失败
}
}
// 空构造方法
public Information() {
}
// 序列化为JSON
public String toJson() {
return gson.toJson(this);
}
// 静态创建方法
public static <T> Information<T> newSuccess(T data) {
return new Information<>(200, "success", data);
}
public static Information<String> newSuccess(String text) {
return new Information<>(200, "success", text);
}
public static <T> Information<T> newFail(int status, String text, T data) {
return new Information<>(status, text, data);
}
// Getter/Setter
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
================================================================================
/* 文件路径: Jinhuo.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
import java.util.Date;
/**
* 进货消耗类
*/
public class Jinhuo extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer shuliang;
private Integer id;
@RefTo(target = Dingdan.class, type = RefType.SINGLE)
private Dingdan dingdan;
@RefTo(target = Chanpin.class, type = RefType.SINGLE)
private Chanpin chanpin;
@RefTo(target = Zujian.class, type = RefType.SINGLE)
private Zujian zujian;
@RefTo(target = Bancai.class, type = RefType.SINGLE)
private Bancai bancai;
@RefTo(target = User.class, type = RefType.SINGLE)
private User user;
private Date date;
public Jinhuo(Integer id, Dingdan dingdan, Chanpin chanpin, Zujian zujian, Bancai bancai, Integer shuliang,
Date date, User user) {
super();
this.id = id;
this.dingdan = dingdan;
this.chanpin = chanpin;
this.zujian = zujian;
this.bancai = bancai;
this.shuliang = shuliang;
this.date = date;
this.user = user;
}
public Jinhuo() {
super();
// TODO Auto-generated constructor stub
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public Dingdan getDingdan() {
return dingdan;
}
public void setDingdan(Dingdan dingdan) {
Dingdan oldValue = this.dingdan;
this.dingdan = dingdan;
firePropertyChange("dingdan", oldValue, dingdan);
}
public Chanpin getChanpin() {
return chanpin;
}
public void setChanpin(Chanpin chanpin) {
Chanpin oldValue = this.chanpin;
this.chanpin = chanpin;
firePropertyChange("chanpin", oldValue, chanpin);
}
public Zujian getZujian() {
return zujian;
}
public void setZujian(Zujian zujian) {
Zujian oldValue = this.zujian;
this.zujian = zujian;
firePropertyChange("zujian", oldValue, zujian);
}
public Bancai getBancai() {
return bancai;
}
public void setBancai(Bancai bancai) {
Bancai oldValue = this.bancai;
this.bancai = bancai;
firePropertyChange("bancai", oldValue, bancai);
}
public Integer getShuliang() {
return shuliang;
}
public void setShuliang(Integer shuliang) {
Integer oldValue = this.shuliang;
this.shuliang = shuliang;
firePropertyChange("shuliang", oldValue, shuliang);
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
Date oldValue = this.date;
this.date = date;
firePropertyChange("date", oldValue, date);
}
public User getUser() {
return user;
}
public void setUser(User user) {
User oldValue = this.user;
this.user = user;
firePropertyChange("user", oldValue, user);
}
}
================================================================================
/* 文件路径: Kucun.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
/**
* 库存
*/
public class Kucun extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private Integer shuliang;
@RefTo(target = Bancai.class, type = RefType.SINGLE)
private Bancai bancai;
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public Integer getShuliang() {
return shuliang;
}
public void setShuliang(Integer shuliang) {
Integer oldValue = this.shuliang;
this.shuliang = shuliang;
firePropertyChange("shuliang", oldValue, shuliang);
}
public Bancai getBancai() {
return bancai;
}
public void setBancai(Bancai bancai) {
Bancai oldValue = this.bancai;
this.bancai = bancai;
firePropertyChange("bancai", oldValue, bancai);
}
public Kucun() {
}
public Kucun(Bancai bancai) {
this.bancai = bancai;
}
public Kucun(Integer id, Integer shuliang, Bancai bancai) {
this.id = id;
this.shuliang = shuliang;
this.bancai = bancai;
}
}
================================================================================
/* 文件路径: Mupi.java */
package com.example.kucun2.entity;
import android.annotation.SuppressLint;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
import java.util.ArrayList;
import java.util.List;
public class Mupi extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private String name;
/**
* 是否有油漆
*/
private Boolean you = false;
@RefTo(target = Bancai.class, type = RefType.LIST, bidirectional = true, reverseField = "mupi1")
private List<Bancai> bancais = new ArrayList<>();
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public String getName() {
return name;
}
public void setName(String name) {
String oldValue = this.name;
this.name = name;
firePropertyChange("name", oldValue, name);
}
public Boolean getYou() {
if (you == null) {
you = false;
return false;
}
return you;
}
public void setYou(Boolean you) {
if (you == null) return;
Boolean oldValue = this.you;
this.you = you;
firePropertyChange("you", oldValue, you);
}
public List<Bancai> getBancais() {
return bancais;
}
public void setBancais(List<Bancai> bancais) {
List<Bancai> oldValue = this.bancais;
this.bancais = bancais;
firePropertyChange("bancais", oldValue, bancais);
}
public Mupi() {
}
public Mupi(Integer id, String name, List<Bancai> bancais) {
this.id = id;
this.name = name;
this.bancais = bancais;
}
public Mupi(List<Bancai> bancais, Boolean you, String name, Integer id) {
this.bancais = bancais;
this.you = you;
this.name = name;
this.id = id;
}
// 3. 木皮显示格式化方法
public String formatMupiDisplay() {
return getName() + (getYou() ? "油" : "");
}
}
================================================================================
/* 文件路径: RefTo.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.SynchronizableEntity;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 关联关系注解
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface RefTo {
/**
* 关联的目标实体类型
*/
Class<?> target();
/**
* 关联类型(单引用/列表)
*/
RefType type() default RefType.SINGLE;
/**
* 存储关联ID的字段名(默认为当前字段)
*/
String idField() default "";
/**
* 是否双向关联
*/
boolean bidirectional() default false;
/**
* 双向关联时的反向字段名
*/
String reverseField() default "";
}
================================================================================
/* 文件路径: RefType.java */
package com.example.kucun2.entity;
/**
* 关联类型枚举
*/
public enum RefType {
SINGLE, // 单实体引用
LIST // 实体列表引用
}
================================================================================
/* 文件路径: User.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
/**
* 用户实体类(扩展版)
* 添加了当前用户标记功能
*/
public class User extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private String name;
private String andy;
private String pass;
private Integer role;
private boolean isCurrentUser; // 新增字段:标记当前用户
// ====================== Getter/Setter ======================
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public String getName() {
return name;
}
public void setName(String name) {
String oldValue = this.name;
this.name = name;
firePropertyChange("name", oldValue, name);
}
public String getAndy() {
return andy;
}
public void setAndy(String andy) {
String oldValue = this.andy;
this.andy = andy;
firePropertyChange("andy", oldValue, andy);
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
String oldValue = this.pass;
this.pass = pass;
firePropertyChange("pass", oldValue, pass);
}
public Integer getRole() {
return role;
}
public void setRole(Integer role) {
Integer oldValue = this.role;
this.role = role;
firePropertyChange("role", oldValue, role);
}
// ====================== 当前用户管理 ======================
public boolean isCurrentUser() {
return isCurrentUser;
}
public void setIsCurrentUser(boolean isCurrentUser) {
boolean oldValue = this.isCurrentUser;
this.isCurrentUser = isCurrentUser;
firePropertyChange("isCurrentUser", oldValue, isCurrentUser);
}
// ====================== 构造方法 ======================
public User(int id, String name, String andy, String pass, int role) {
this.id = id;
this.name = name;
this.andy = andy;
this.pass = pass;
this.role = role;
}
public User() {
// 默认构造器
}
}
================================================================================
/* 文件路径: Zujian.java */
package com.example.kucun2.entity;
import com.example.kucun2.entity.data.EntityClassGrassrootsid;
import com.example.kucun2.entity.data.SynchronizableEntity;
/**
* 组件
*/
public class Zujian extends SynchronizableEntity implements EntityClassGrassrootsid {
private Integer id;
private String name;
public Zujian() {
}
public Zujian(Integer id, String name) {
this.id = id;
this.name = name;
}
@Override
public Integer getId() {
return id;
}
public void setId(Integer id) {
Integer oldValue = this.id;
this.id = id;
firePropertyChange("id", oldValue, id);
}
public String getName() {
return name;
}
public void setName(String name) {
String oldValue = this.name;
this.name = name;
firePropertyChange("name", oldValue, name);
}
}