use of com.easy.cloud.core.reptile.datafield.pojo.dto.EcReptileDataFieldDTO in project dq-easy-cloud by dq-open-cloud.
the class EcReptileUtils method buildDynamicField.
/**
* <p>
* 构建动态bean的动态数据属性
* </p>
* <p>
* <pre>
* 所需参数示例及其说明
* 参数名称 : 示例值 : 说明 : 是否必须
* </pre>
*
* @param dynamicBean
* @param dynamicBeanDTO
* @author daiqi
* @创建时间 2018年6月7日 下午8:13:04
*/
private static void buildDynamicField(JavassistDynamicBean dynamicBean, EcReptileDynamicBeanDTO dynamicBeanDTO) {
for (EcReptileDataFieldDTO dataFieldDTO : dynamicBeanDTO.getReptileDataFieldDTOs()) {
if (EcBaseUtils.equals(dataFieldDTO.getAvailable(), EcAvailableEnum.YES.type())) {
DynamicField dynamicField = buildDynamicFieldName(dynamicBean, dataFieldDTO);
dynamicField = buildDynamicValueSourceType(dynamicField, dynamicBean, dataFieldDTO);
dynamicField = buildDynamicValueSource(dynamicField, dynamicBean, dataFieldDTO);
dynamicField.build();
}
}
}
use of com.easy.cloud.core.reptile.datafield.pojo.dto.EcReptileDataFieldDTO in project dq-easy-cloud by dq-open-cloud.
the class EcReptileDynamicBeanServiceImpl method buildDynamicBeanDTOs.
/**
* <p>
* 根据dynamicBeanEntities列表构建EcReptileDynamicBeanDTO列表
* </p>
*
* <pre>
* 所需参数示例及其说明
* 参数名称 : 示例值 : 说明 : 是否必须
* </pre>
*
* @param dynamicBeanEntities
* @return
* @author daiqi
* @创建时间 2018年6月7日 下午8:59:01
*/
private List<EcReptileDynamicBeanDTO> buildDynamicBeanDTOs(List<EcReptileDynamicBeanEntity> dynamicBeanEntities) {
// 1 entity转换为dto
List<EcReptileDynamicBeanDTO> dynamicBeanDTOs = EcJSONUtils.parseArray(dynamicBeanEntities, EcReptileDynamicBeanDTO.class);
// 2 构建dynamicBeanIds
Set<Integer> dynamicBeanNos = new HashSet<>();
for (EcReptileDynamicBeanEntity dynamicBean : dynamicBeanEntities) {
dynamicBeanNos.add(dynamicBean.getDynamicBeanNo());
}
// 3 根据dynamicBeanIds获取数据属性数据传输对象列表
List<EcReptileDataFieldDTO> dataFieldDTOs = reptileDynamicBeanService.findDataFieldsByDynamicBeanNos(dynamicBeanNos);
EcLogUtils.info("buildDynamicBeanDTOs获取到的属性数据为", dataFieldDTOs, logger);
EcAssert.verifyListEmpty(dataFieldDTOs, "reptileDataField");
// 4 将数据属性对象列表放置到对应的dynamicBeanDTO中
for (EcReptileDynamicBeanDTO dynamicBeanDTO : dynamicBeanDTOs) {
List<EcReptileDataFieldDTO> dataFieldDTOsTemp = new ArrayList<>();
for (EcReptileDataFieldDTO dataFieldDTO : dataFieldDTOs) {
if (EcBaseUtils.equals(dynamicBeanDTO.getDynamicBeanNo(), dataFieldDTO.getDynamicBeanNo())) {
dataFieldDTOsTemp.add(dataFieldDTO);
}
}
dynamicBeanDTO.setReptileDataFieldDTOs(dataFieldDTOsTemp);
}
// 5 返回列表
return dynamicBeanDTOs;
}
Aggregations