|
@@ -2,14 +2,15 @@ package com.gis.cms.service.impl;
|
|
|
|
|
|
import com.gis.cms.entity.dto.ExpertPageDto;
|
|
|
import com.gis.cms.entity.dto.ExpertDto;
|
|
|
+import com.gis.cms.entity.dto.ExpertWebDto;
|
|
|
import com.gis.cms.entity.po.ExpertEntity;
|
|
|
import com.gis.cms.mapper.ExpertMapper;
|
|
|
-import com.gis.cms.mapper.MyBaseMapper;
|
|
|
import com.gis.cms.service.SensitiveService;
|
|
|
import com.gis.common.base.exception.BaseRuntimeException;
|
|
|
import com.gis.common.base.mapper.IBaseMapper;
|
|
|
import com.gis.common.base.service.impl.IBaseServiceImpl;
|
|
|
import com.gis.common.constant.MsgCode;
|
|
|
+import com.gis.common.util.RegexUtil;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.cms.service.ExpertService;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
@@ -20,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import javax.validation.constraints.NotBlank;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -132,10 +134,10 @@ public class ExpertServiceImpl extends IBaseServiceImpl<ExpertEntity, Long> impl
|
|
|
// }
|
|
|
|
|
|
@Override
|
|
|
- public Result<ExpertEntity> webList(String type) {
|
|
|
+ public Result<ExpertEntity> webList(ExpertWebDto param) {
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
sql.append("select * from tb_expert where is_delete = '0' and display=1 ");
|
|
|
-
|
|
|
+ @NotBlank(message = "类型不能为空") String type = param.getType();
|
|
|
String [] typeCheck = {"1","2","3","4","5","loyal_1","loyal_2"};
|
|
|
if (!Arrays.asList(typeCheck).contains(type)) {
|
|
|
return Result.failure("非法类型");
|
|
@@ -147,6 +149,12 @@ public class ExpertServiceImpl extends IBaseServiceImpl<ExpertEntity, Long> impl
|
|
|
sql.append(" and level=").append(key);
|
|
|
}
|
|
|
|
|
|
+ String searchKey = param.getSearchKey();
|
|
|
+ if (StringUtils.isNotBlank(searchKey)){
|
|
|
+ searchKey = RegexUtil.sqlReplaceSpecialStr(searchKey);
|
|
|
+ sql.append(" and name like '%").append(searchKey).append("%'");
|
|
|
+ }
|
|
|
+
|
|
|
sql.append(" order by sort, create_time desc");
|
|
|
log.info("sql: {}", sql.toString());
|
|
|
|