|
|
@ -20,8 +20,6 @@ package com.epmet.service.impl; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.OrderItem; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
@ -52,6 +50,8 @@ import com.epmet.feign.OperCrmOpenFeignClient; |
|
|
|
import com.epmet.service.UserAdviceImgService; |
|
|
|
import com.epmet.service.UserAdviceService; |
|
|
|
import com.epmet.service.UserResiInfoService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import io.jsonwebtoken.lang.Collections; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
@ -242,7 +242,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageData<AdviceListResultDTO> adviceList(AdviceListFormDTO dto) { |
|
|
|
//page分页
|
|
|
|
/*//page分页
|
|
|
|
Page<UserAdviceEntity> page = new Page<>(dto.getPageNo(), dto.getPageSize()); |
|
|
|
//时间降序
|
|
|
|
page.addOrder(OrderItem.desc(FieldConstant.CREATED_TIME)); |
|
|
@ -300,7 +300,30 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd |
|
|
|
} |
|
|
|
result.setRecords(records); |
|
|
|
|
|
|
|
return getPageData(result, AdviceListResultDTO.class); |
|
|
|
return getPageData(result, AdviceListResultDTO.class);*/ |
|
|
|
|
|
|
|
PageHelper.startPage(dto.getPageNo(), dto.getPageSize()); |
|
|
|
List<UserAdviceEntity> list = baseDao.selectListAdvice(dto); |
|
|
|
List<AdviceListResultDTO> records=ConvertUtils.sourceToTarget(list,AdviceListResultDTO.class); |
|
|
|
//拼接type
|
|
|
|
|
|
|
|
for (int i = 0; i < records.size(); i++) { |
|
|
|
if (!"*".equals(records.get(i).getAdviceType())) { |
|
|
|
StringBuilder type = new StringBuilder(); |
|
|
|
if (records.get(i).getAdviceType().contains("gov")) { |
|
|
|
type.append(UserAdviceConstant.GOV_TYPE_TEXT); |
|
|
|
} |
|
|
|
if (records.get(i).getAdviceType().contains("software")) { |
|
|
|
if (type.length() != 0) { |
|
|
|
type.append("\n"); |
|
|
|
} |
|
|
|
type.append(UserAdviceConstant.SOFTWARE_TYPE_TEXT); |
|
|
|
} |
|
|
|
records.get(i).setAdviceType(type.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
PageInfo<AdviceListResultDTO> pageInfo = new PageInfo<>(records); |
|
|
|
return new PageData<>(records, pageInfo.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|