package com.vci.pagemodel;
|
|
import com.vci.corba.omd.data.BusinessObject;
|
import com.vci.corba.omd.data.LinkObject;
|
import org.springframework.util.CollectionUtils;
|
import java.util.HashSet;
|
import java.util.Set;
|
import java.util.stream.Collectors;
|
|
/**
|
* 操作的业务类型和链接类型的数据
|
* @author weidy
|
* @date 2021-12-2
|
*/
|
public class BatchCBO {
|
|
/**
|
* 空的业务类型数组
|
*/
|
private BusinessObject[] nullCboArray = new BusinessObject[0];
|
|
/**
|
* 空的链接类型数组
|
*/
|
private LinkObject[] nullCloArray = new LinkObject[0];
|
|
/**
|
* 创建的业务类型
|
*/
|
private Set<BusinessObject> createCbos = new HashSet<BusinessObject>();
|
|
/**
|
* 创建的链接类型
|
*/
|
private Set<LinkObject> createClos = new HashSet<LinkObject>();
|
|
/**
|
* 更新的业务类型
|
*/
|
private Set<BusinessObject> updateCbos = new HashSet<BusinessObject>();
|
|
/**
|
* 更新的链接类型
|
*/
|
private Set<LinkObject> updateClos = new HashSet<LinkObject>();
|
|
/**
|
* 删除业务类型
|
*/
|
private Set<BusinessObject> deleteCbos = new HashSet<BusinessObject>();
|
|
/**
|
* 删除的链接类型
|
*/
|
private Set<LinkObject> deleteClos = new HashSet<LinkObject>();
|
|
/**
|
* 来源数据集合
|
*/
|
private Set<Object> sourceObjectList = new HashSet<Object>();
|
|
/**
|
* 来源数据
|
*/
|
private Object sourceObject = new HashSet<Object>();
|
|
/**
|
* 从其他的拷贝
|
* @param otherCBO 其他的信息
|
*/
|
public void copyFromOther(BatchCBO otherCBO){
|
if(otherCBO!=null){
|
if(!CollectionUtils.isEmpty(otherCBO.getCreateCbos())){
|
getCreateCbos().addAll(otherCBO.getCreateCbos());
|
}
|
if(!CollectionUtils.isEmpty(otherCBO.getUpdateCbos())){
|
getUpdateCbos().addAll(otherCBO.getUpdateCbos());
|
}
|
if(!CollectionUtils.isEmpty(otherCBO.getDeleteCbos())){
|
getDeleteCbos().addAll(otherCBO.getDeleteCbos());
|
}
|
if(!CollectionUtils.isEmpty(otherCBO.getCreateClos())){
|
getCreateClos().addAll(otherCBO.getCreateClos());
|
}
|
if(!CollectionUtils.isEmpty(otherCBO.getUpdateClos())){
|
getUpdateClos().addAll(otherCBO.getUpdateClos());
|
}
|
if(!CollectionUtils.isEmpty(otherCBO.getDeleteClos())){
|
getDeleteClos().addAll(otherCBO.getDeleteClos());
|
}
|
}
|
}
|
|
public void addCreateCbo(BusinessObject cbo){
|
this.createCbos.add(cbo);
|
}
|
|
public void addCreateClo(LinkObject clo){
|
this.createClos.add(clo);
|
}
|
|
public void addUpdateCbo(BusinessObject cbo){
|
this.updateCbos.add(cbo);
|
}
|
|
public void addUpdateClo(LinkObject clo){
|
this.updateClos.add(clo);
|
}
|
|
public void addDeleteCbo(BusinessObject cbo){
|
this.deleteCbos.add(cbo);
|
}
|
|
public void addDeleteClo(LinkObject clo){
|
this.deleteClos.add(clo);
|
}
|
|
|
public BusinessObject[] getCreateCboArray(){
|
if( this.createCbos == null){
|
this.createCbos = new HashSet<BusinessObject>();
|
}
|
return this.createCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCboArray);
|
}
|
|
public LinkObject[] getCreateCloArray(){
|
if( this.createClos == null){
|
this.createClos = new HashSet<LinkObject>();
|
}
|
return this.createClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCloArray);
|
}
|
|
|
public BusinessObject[] getUpdateCboArray(){
|
if( this.updateCbos == null){
|
this.updateCbos = new HashSet<BusinessObject>();
|
}
|
return this.updateCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCboArray);
|
}
|
|
public LinkObject[] getUpdateCloArray(){
|
if( this.updateClos == null){
|
this.updateClos = new HashSet<LinkObject>();
|
}
|
return this.updateClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.createTime - o2.createTime))).collect(Collectors.toList()).toArray(nullCloArray);
|
}
|
|
public BusinessObject[] getDeleteCboArray(){
|
if( this.deleteCbos == null){
|
this.deleteCbos = new HashSet<BusinessObject>();
|
}
|
return this.deleteCbos.toArray(nullCboArray);
|
}
|
|
public LinkObject[] getDeleteCloArray(){
|
if( this.deleteClos == null){
|
this.deleteClos = new HashSet<LinkObject>();
|
}
|
return this.deleteClos.toArray(nullCloArray);
|
}
|
|
public Set<BusinessObject> getCreateCbos() {
|
return createCbos;
|
}
|
|
public void setCreateCbos(Set<BusinessObject> createCbos) {
|
this.createCbos = createCbos;
|
}
|
|
public Set<LinkObject> getCreateClos() {
|
return createClos;
|
}
|
|
public void setCreateClos(Set<LinkObject> createClos) {
|
this.createClos = createClos;
|
}
|
|
public Set<BusinessObject> getUpdateCbos() {
|
return updateCbos;
|
}
|
|
public void setUpdateCbos(Set<BusinessObject> updateCbos) {
|
this.updateCbos = updateCbos;
|
}
|
|
public Set<LinkObject> getUpdateClos() {
|
return updateClos;
|
}
|
|
public void setUpdateClos(Set<LinkObject> updateClos) {
|
this.updateClos = updateClos;
|
}
|
|
public Set<BusinessObject> getDeleteCbos() {
|
return deleteCbos;
|
}
|
|
public void setDeleteCbos(Set<BusinessObject> deleteCbos) {
|
this.deleteCbos = deleteCbos;
|
}
|
|
public Set<LinkObject> getDeleteClos() {
|
return deleteClos;
|
}
|
|
public void setDeleteClos(Set<LinkObject> deleteClos) {
|
this.deleteClos = deleteClos;
|
}
|
|
public Set<Object> getSourceObjectList() {
|
return sourceObjectList;
|
}
|
|
public void setSourceObjectList(Set<Object> sourceObjectList) {
|
this.sourceObjectList = sourceObjectList;
|
}
|
|
public Object getSourceObject() {
|
return sourceObject;
|
}
|
|
public void setSourceObject(Object sourceObject) {
|
this.sourceObject = sourceObject;
|
}
|
|
|
|
}
|