企业更新网站的好处,网站登录系统,北京家居网站建设,东营破产信息网官网问题描述#xff1a;
list中再定义一个list对象#xff0c;循环赋值不同的list数据#xff0c;结果全部都累加到每条数据中了#xff0c;每条数据中都出现重复数据。
问题解决#xff1a;
1.创建树结构方法信息 2.创建一个新的 List 对象#xff0c;避免引用问题 3.使…问题描述
list中再定义一个list对象循环赋值不同的list数据结果全部都累加到每条数据中了每条数据中都出现重复数据。
问题解决
1.创建树结构方法信息 2.创建一个新的 List 对象避免引用问题 3.使用 GongkuangMethodDictVo 的拷贝构造函数
public class PlanSchemeProductionGongkuangStatus
{。。。。。。/** 创建树结构方法信息 */private ListGongkuangMethodDictVo gongkuangMethodDicList;public ListGongkuangMethodDictVo getGongkuangMethodDicList() {return gongkuangMethodDicList;}public void setGongkuangMethodDicList(ListGongkuangMethodDictVo gongkuangMethodDicList) {// 创建一个新的 List 对象避免引用问题this.gongkuangMethodDicList new ArrayList();for (GongkuangMethodDictVo gongkuangMethodDictVo : gongkuangMethodDicList) {// 使用 GongkuangMethodDictVo 的拷贝构造函数this.gongkuangMethodDicList.add(new GongkuangMethodDictVo(gongkuangMethodDictVo));}}。。。。。。
}