1、package org.springframework.beans;中的
BeanUtils.copyProperties(A,B);
是A中的值付给B
FinCpDocDO finCpDoc = finCpDocService.selectByDocNo(orderNo);
FinCpDocDto finCpDto = new FinCpDocDto();
if (finCpDoc == null){
throw new ServiceException(“查无该订单” + “orderNo:” + orderNo);
}
try{
BeanUtils.copyProperties(finCpDoc, finCpDto);
2、package org.apache.commons.beanutils;(常用)
BeanUtils.copyProperties(A,B);
是B中的值付给A
for(OboFeeDO feeDO : oboFeeList){
if(feeDO.getPayTime()!=null){
ErpOboFeeDto feeDto = new ErpOboFeeDto();
BeanUtils.copyProperties(feeDto, feeDO);
oboFeList.add(feeDto);
}
}