Search in sources :

Example 1 with LookupTypeWithValuesVO

use of io.choerodon.agile.api.vo.LookupTypeWithValuesVO in project agile-service by open-hand.

the class LookupValueServiceImpl method queryConstraintLookupValue.

@Override
public LookupTypeWithValuesVO queryConstraintLookupValue() {
    LookupTypeWithValuesDTO typeWithValues = lookupValueMapper.queryLookupValueByCode("constraint");
    LookupTypeWithValuesVO result = modelMapper.map(typeWithValues, LookupTypeWithValuesVO.class);
    result.setLookupValues(modelMapper.map(typeWithValues.getLookupValues(), new TypeToken<List<LookupValueVO>>() {
    }.getType()));
    return result;
}
Also used : LookupTypeWithValuesDTO(io.choerodon.agile.infra.dto.LookupTypeWithValuesDTO) LookupTypeWithValuesVO(io.choerodon.agile.api.vo.LookupTypeWithValuesVO) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with LookupTypeWithValuesVO

use of io.choerodon.agile.api.vo.LookupTypeWithValuesVO in project agile-service by open-hand.

the class LookupValueServiceImpl method queryLookupValueByCode.

@Override
public LookupTypeWithValuesVO queryLookupValueByCode(String typeCode, Long projectId) {
    LookupTypeWithValuesDTO typeWithValues = lookupValueMapper.queryLookupValueByCode(typeCode);
    if (LookupType.CONTEXT.equals(typeCode) && !ObjectUtils.isEmpty(projectId)) {
        List<LookupValueDTO> backlogs = filterBacklog(projectId, typeWithValues);
        List<LookupValueDTO> lookupValues = filterProjectType(projectId, typeWithValues);
        lookupValues.addAll(backlogs);
        typeWithValues.setLookupValues(lookupValues);
    }
    LookupTypeWithValuesVO result = modelMapper.map(typeWithValues, new TypeToken<LookupTypeWithValuesVO>() {
    }.getType());
    result.setLookupValues(modelMapper.map(typeWithValues.getLookupValues(), new TypeToken<List<LookupValueVO>>() {
    }.getType()));
    return result;
}
Also used : LookupTypeWithValuesDTO(io.choerodon.agile.infra.dto.LookupTypeWithValuesDTO) LookupTypeWithValuesVO(io.choerodon.agile.api.vo.LookupTypeWithValuesVO) TypeToken(org.modelmapper.TypeToken) LookupValueDTO(io.choerodon.agile.infra.dto.LookupValueDTO) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

LookupTypeWithValuesVO (io.choerodon.agile.api.vo.LookupTypeWithValuesVO)2 LookupTypeWithValuesDTO (io.choerodon.agile.infra.dto.LookupTypeWithValuesDTO)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 LookupValueDTO (io.choerodon.agile.infra.dto.LookupValueDTO)1 TypeToken (org.modelmapper.TypeToken)1