use of com.tony.billing.response.taginfo.CostTagListResponse in project BillingDubbo by TonyJiangWJ.
the class TagInfoController method listCostTag.
/**
* 列出账单赋值的标签
*
* @param request
* @return
*/
@RequestMapping(value = "/cost/tag/list")
public CostTagListResponse listCostTag(@ModelAttribute("request") @Validated CostTagListRequest request) {
CostTagListResponse response = new CostTagListResponse();
try {
List<TagInfo> costTagList = tagInfoService.listTagInfoByTradeNo(request.getTradeNo());
TagInfoDTO model;
List<TagInfoDTO> result = new ArrayList<>();
for (TagInfo entity : costTagList) {
model = new TagInfoDTO();
model.setTagName(entity.getTagName());
model.setTagId(entity.getId());
result.add(model);
}
if (!CollectionUtils.isEmpty(result)) {
response.setTagInfoModels(result);
ResponseUtil.success(response);
} else {
ResponseUtil.dataNotExisting(response);
}
} catch (Exception e) {
ResponseUtil.sysError(response);
logger.error("/cost/tag/list error", e);
}
return response;
}
use of com.tony.billing.response.taginfo.CostTagListResponse in project BillingDubbo by TonyJiangWJ.
the class TagInfoController method getCostsCommunalTags.
@RequestMapping(value = "/cost/tag/communal/list")
public CostTagListResponse getCostsCommunalTags(@ModelAttribute("request") @Validated CommunalTagsRequest request) {
List<TagInfoDTO> tagInfoDTOS = tagInfoService.listCommonTagInfos(request.getCostIds());
CostTagListResponse response = new CostTagListResponse();
if (!CollectionUtils.isEmpty(tagInfoDTOS)) {
response.setTagInfoModels(tagInfoDTOS);
return ResponseUtil.success(response);
} else {
return ResponseUtil.dataNotExisting(response);
}
}
Aggregations