|
@@ -1,11 +1,14 @@
|
|
package com.fjhx.xmhjc.service.about.impl;
|
|
package com.fjhx.xmhjc.service.about.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import com.fjhx.file.entity.FileInfoVo;
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
|
+import com.fjhx.xmhjc.entity.about.po.AboutUsCulture;
|
|
import com.fjhx.xmhjc.entity.about.po.AboutUsHonor;
|
|
import com.fjhx.xmhjc.entity.about.po.AboutUsHonor;
|
|
import com.fjhx.xmhjc.mapper.about.AboutUsHonorMapper;
|
|
import com.fjhx.xmhjc.mapper.about.AboutUsHonorMapper;
|
|
import com.fjhx.xmhjc.service.about.AboutUsHonorService;
|
|
import com.fjhx.xmhjc.service.about.AboutUsHonorService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.ruoyi.common.utils.wrapper.SqlField;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.fjhx.xmhjc.entity.about.vo.AboutUsHonorVo;
|
|
import com.fjhx.xmhjc.entity.about.vo.AboutUsHonorVo;
|
|
@@ -14,7 +17,9 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
import com.fjhx.xmhjc.entity.about.dto.AboutUsHonorDto;
|
|
import com.fjhx.xmhjc.entity.about.dto.AboutUsHonorDto;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
|
* <p>
|
|
* <p>
|
|
@@ -40,9 +45,7 @@ public class AboutUsHonorServiceImpl extends ServiceImpl<AboutUsHonorMapper, Abo
|
|
|
|
|
|
IWrapper<AboutUsHonor> wrapper = getWrapper();
|
|
IWrapper<AboutUsHonor> wrapper = getWrapper();
|
|
wrapper.orderByAsc("auh", AboutUsHonor::getSort);
|
|
wrapper.orderByAsc("auh", AboutUsHonor::getSort);
|
|
- if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
|
|
+ wrapper.keyword(dto,new SqlField("auc", AboutUsHonor::getHonorName));
|
|
- wrapper.and(q -> q.like(AboutUsHonor::getHonorName, dto.getKeyword()));
|
|
|
|
- }
|
|
|
|
Page<AboutUsHonorVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
Page<AboutUsHonorVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
@@ -75,4 +78,22 @@ public class AboutUsHonorServiceImpl extends ServiceImpl<AboutUsHonorMapper, Abo
|
|
this.removeById(id);
|
|
this.removeById(id);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<AboutUsHonorVo> getListByOpen() {
|
|
|
|
+ IWrapper<AboutUsHonor> wrapper = getWrapper();
|
|
|
|
+ wrapper.eq(AboutUsHonor::getStatus,"1");
|
|
|
|
+ wrapper.orderByAsc("auh", AboutUsHonor::getSort);
|
|
|
|
+ List<AboutUsHonorVo> list = this.baseMapper.getList(wrapper);
|
|
|
|
+
|
|
|
|
+ list.forEach(x->{
|
|
|
|
+
|
|
|
|
+ List<Long> businessIdList = new ArrayList<>();
|
|
|
|
+ businessIdList.add(x.getId());
|
|
|
|
+ Map<Long, List<FileInfoVo>> fileMap = ObsFileUtil.getFileMap(businessIdList, 1);
|
|
|
|
+ x.setHonorCoverList(fileMap.get(x.getId()));
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
}
|
|
}
|