use of io.choerodon.agile.infra.dto.CustomChartDTO in project agile-service by open-hand.
the class CustomChartServiceImpl method validNameRepeat.
private boolean validNameRepeat(CustomChartDTO customChartDTO) {
CustomChartDTO customChartRecord = new CustomChartDTO();
customChartRecord.setName(customChartDTO.getName());
customChartRecord.setProjectId(customChartDTO.getProjectId());
List<CustomChartDTO> results = customChartMapper.select(customChartRecord);
if (CollectionUtils.isEmpty(results)) {
return false;
}
if (results.size() > (customChartDTO.getId() == null ? 0 : 1)) {
return true;
}
return !results.get(0).getId().equals(customChartDTO.getId());
}
use of io.choerodon.agile.infra.dto.CustomChartDTO in project agile-service by open-hand.
the class CustomChartServiceImpl method queryListByProject.
@Override
public List<CustomChartVO> queryListByProject(Long projectId) {
CustomChartDTO customChartRecord = new CustomChartDTO();
customChartRecord.setProjectId(projectId);
List<CustomChartDTO> customChartList = customChartMapper.select(customChartRecord);
if (CollectionUtils.isEmpty(customChartList)) {
return new ArrayList<>();
}
List<CustomChartVO> results = modelMapper.map(customChartList, new TypeToken<List<CustomChartVO>>() {
}.getType());
results.forEach(customChartVO -> {
if (customChartVO.getSearchJson() != null) {
customChartVO.setSearchJson(EncryptionUtils.handlerPersonFilterJson(customChartVO.getSearchJson(), true));
}
});
return results;
}
use of io.choerodon.agile.infra.dto.CustomChartDTO in project agile-service by open-hand.
the class CustomChartServiceImpl method queryCustomChartDetail.
@Override
public CustomChartVO queryCustomChartDetail(Long projectId, Long customChartId) {
Long organizationId = ConvertUtil.getOrganizationId(projectId);
CustomChartDTO customChart = queryCustomChartByProjectAndId(projectId, customChartId);
if (customChart == null) {
return null;
}
CustomChartSearchVO customChartSearchVO = customChartToDataSearch(customChart);
CustomChartDataVO customChartData = reportService.queryCustomChartData(customChartSearchVO, projectId, organizationId);
CustomChartVO result = modelMapper.map(customChart, CustomChartVO.class);
result.setCustomChartData(customChartData);
if (!StringUtils.isBlank(result.getSearchJson())) {
result.setSearchJson(EncryptionUtils.handlerPersonFilterJson(result.getSearchJson(), true));
}
return result;
}
use of io.choerodon.agile.infra.dto.CustomChartDTO in project agile-service by open-hand.
the class CustomChartServiceImpl method deleteCustomChartById.
@Override
public void deleteCustomChartById(Long customChartId, Long projectId) {
deleteCustomChartRedisById(projectId, customChartId);
CustomChartDTO customChartDTO = new CustomChartDTO();
customChartDTO.setProjectId(projectId);
customChartDTO.setId(customChartId);
int isDelete = customChartMapper.delete(customChartDTO);
if (isDelete != 1) {
throw new CommonException("error.customChart.deleteById");
}
}
Aggregations