提交 4d949eab 作者: zgz

智库列表(yjzx)

上级 75e8e756
package com.zzsn.thinktank.controller; package com.zzsn.thinktank.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsn.thinktank.entity.ThinktankBasicInfo; import com.zzsn.thinktank.entity.ThinktankBasicInfo;
import com.zzsn.thinktank.service.ThinktankBasicInfoService; import com.zzsn.thinktank.service.ThinktankBasicInfoService;
import com.zzsn.thinktank.vo.Result; import com.zzsn.thinktank.vo.Result;
...@@ -95,6 +97,20 @@ public class ThinktankBasicInfoController { ...@@ -95,6 +97,20 @@ public class ThinktankBasicInfoController {
return thinktankBasicInfoService.getList(thinktankBasicInfoListVo); return thinktankBasicInfoService.getList(thinktankBasicInfoListVo);
} }
/**
* 智库列表(yjzx)
*/
@PostMapping("/queryPageList")
public Result<?> queryPageList(@RequestBody(required = false) ThinktankBasicInfoListVo vo,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) throws Exception {
Page<ThinktankBasicInfo> page = new Page<ThinktankBasicInfo>(pageNo, pageSize);
IPage<ThinktankBasicInfo> pageList = thinktankBasicInfoService.pageList(page,vo,req);
return Result.OK(pageList);
}
/** /**
* 模板下载 * 模板下载
* @param response * @param response
......
package com.zzsn.thinktank.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 国家地域表
* @Author: jeecg-boot
* @Date: 2022-02-09
* @Version: V1.0
*/
@Data
@TableName("sys_base_region")
public class SysBaseRegion implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**中文名称*/
@Excel(name = "中文名称", width = 15)
private String nameCn;
/**中文标签*/
@Excel(name = "中文标签", width = 15)
private String aliaCn;
/**英文名称*/
@Excel(name = "英文名称", width = 15)
private String nameEn;
/**英文标签*/
@Excel(name = "英文标签", width = 15)
private String aliaEn;
/**经度*/
@Excel(name = "经度", width = 15)
private String longitude;
/**纬度*/
@Excel(name = "纬度", width = 15)
private String latitude;
/**所属洲*/
@Excel(name = "所属洲", width = 15)
private String continent;
/**所属洲英文*/
@Excel(name = "所属洲英文", width = 15)
private String continentEn;
/**所属洲二级中文名*/
@Excel(name = "所属洲二级中文名", width = 15)
private String continentSub;
/**所属洲二级英文名称*/
@Excel(name = "所属洲二级英文名称", width = 15)
private String continentSubEn;
/**国家代码*/
@Excel(name = "国家代码", width = 15)
private String code;
/**货币*/
@Excel(name = "货币", width = 15)
private String currency;
/**官方语言*/
@Excel(name = "官方语言", width = 15)
private String lang;
/**时区*/
@Excel(name = "时区", width = 15)
private String timezone;
/**国土面积*/
@Excel(name = "国土面积", width = 15)
private Integer area;
/**人口数量*/
@Excel(name = "人口数量", width = 15)
private Integer population;
/**描述*/
@Excel(name = "描述", width = 15)
private String regionDesc;
/**地区描述英文*/
@Excel(name = "地区描述英文", width = 15)
private String regionDescEn;
/**创建人*/
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**更新人*/
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**所属部门*/
private String sysOrgCode;
/**父级节点*/
@Excel(name = "父级节点", width = 15)
private String pid;
/**是否有子节点*/
@Excel(name = "是否有子节点", width = 15, dicCode = "yn")
private String hasChild;
/**层级路径id集合*/
@Excel(name = "层级路径id集合", width = 15)
private String pathIds;
/**层级路径id集合*/
@Excel(name = "等级id", width = 15)
private String levelId;
}
package com.zzsn.thinktank.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.thinktank.entity.SysBaseRegion;
/**
* @Description: 国家地域表
* @Author: jeecg-boot
* @Date: 2022-02-09
* @Version: V1.0
*/
public interface SysBaseRegionMapper extends BaseMapper<SysBaseRegion> {
}
package com.zzsn.thinktank.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.thinktank.entity.SysBaseRegion;
/**
* @Description: 国家地域表
* @Author: jeecg-boot
* @Date: 2022-02-09
* @Version: V1.0
*/
public interface ISysBaseRegionService extends IService<SysBaseRegion> {
}
package com.zzsn.thinktank.service; package com.zzsn.thinktank.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.thinktank.entity.ThinktankBasicInfo; import com.zzsn.thinktank.entity.ThinktankBasicInfo;
import com.zzsn.thinktank.vo.Result; import com.zzsn.thinktank.vo.Result;
...@@ -35,4 +37,6 @@ public interface ThinktankBasicInfoService extends IService<ThinktankBasicInfo> ...@@ -35,4 +37,6 @@ public interface ThinktankBasicInfoService extends IService<ThinktankBasicInfo>
byte[] batchExport(ThinktankBasicInfoListVo thinktankBasicInfoListVo, HttpServletRequest request, HttpServletResponse response); byte[] batchExport(ThinktankBasicInfoListVo thinktankBasicInfoListVo, HttpServletRequest request, HttpServletResponse response);
Result<?> getListBaseData(String id, Integer pageNo, Integer pageSize, Integer office); Result<?> getListBaseData(String id, Integer pageNo, Integer pageSize, Integer office);
IPage<ThinktankBasicInfo> pageList(Page page, ThinktankBasicInfoListVo vo, HttpServletRequest req) throws Exception;
} }
package com.zzsn.thinktank.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.thinktank.entity.SysBaseRegion;
import com.zzsn.thinktank.mapper.SysBaseRegionMapper;
import com.zzsn.thinktank.service.ISysBaseRegionService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description: 国家地域表
* @Author: jeecg-boot
* @Date: 2022-02-09
* @Version: V1.0
*/
@Service
public class SysBaseRegionServiceImpl extends ServiceImpl<SysBaseRegionMapper, SysBaseRegion> implements ISysBaseRegionService {
}
...@@ -3,6 +3,7 @@ package com.zzsn.thinktank.service.impl; ...@@ -3,6 +3,7 @@ package com.zzsn.thinktank.service.impl;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter; import cn.hutool.poi.excel.ExcelWriter;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -67,6 +68,10 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -67,6 +68,10 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
@Autowired @Autowired
InfoSourceGroupMapService infoSourceGroupMapService; InfoSourceGroupMapService infoSourceGroupMapService;
//区域国家
@Autowired
ISysBaseRegionService sysBaseRegionService;
@Autowired @Autowired
EsUtil esUtil; EsUtil esUtil;
...@@ -738,5 +743,69 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -738,5 +743,69 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
return Result.OK(page); return Result.OK(page);
} }
@Override
public IPage<ThinktankBasicInfo> pageList(Page page, ThinktankBasicInfoListVo vo, HttpServletRequest req) throws Exception {
List<String> fieldTypeId = vo.getFieldTypeId();
List<String> regionalCountriesTypeId = vo.getRegionalCountriesTypeId();
List<String> regionalCountriesTypeIds = vo.getRegionalCountriesTypeId();
QueryWrapper<ThinktankBasicInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status",1);
if(vo!=null && StringUtils.isNotBlank(vo.getKeyword())){
queryWrapper.and(wreapper->{
wreapper.like("chinese_whole",vo.getKeyword());
wreapper.or();
wreapper.like("chinese_simple",vo.getKeyword());
wreapper.or();
wreapper.like("english_whole",vo.getKeyword());
wreapper.or();
wreapper.like("english_simple",vo.getKeyword());
wreapper.or();
wreapper.like("tag_name",vo.getKeyword());
wreapper.or();
wreapper.like("belong_country",vo.getKeyword());
wreapper.or();
wreapper.like("biographical_notes",vo.getKeyword());
});
}
if(fieldTypeId!=null && fieldTypeId.size()>0){
queryWrapper.and(wreapper->{
for(int i=0;i<fieldTypeId.size();i++){
wreapper.like("tag_id",fieldTypeId.get(i));
if(i != fieldTypeId.size()-1){
wreapper.or();
}
}
});
}
if(regionalCountriesTypeId!=null && regionalCountriesTypeId.size()>0){
for(String id:regionalCountriesTypeId){
SysBaseRegion region = sysBaseRegionService.getById(id);
if(region!=null && region.getLevelId()!=null && region.getLevelId().equals("country")){
regionalCountriesTypeIds.add(id);
}else if(region!=null && region.getLevelId()!=null && region.getLevelId().equals("continent")){
QueryWrapper<SysBaseRegion> query = new QueryWrapper<>();
query.eq("pid","id");
List<SysBaseRegion> list = sysBaseRegionService.list(query);
for(SysBaseRegion obj:list){
regionalCountriesTypeIds.add(obj.getId());
}
}
}
}
if(regionalCountriesTypeIds!=null && regionalCountriesTypeIds.size()>0){
queryWrapper.and(wreapper->{
for(int i=0;i<regionalCountriesTypeIds.size();i++){
wreapper.like("belong_country_id",regionalCountriesTypeIds.get(i));
if(i != regionalCountriesTypeIds.size()-1){
wreapper.or();
}
}
});
}
queryWrapper.orderByDesc("update_time");
return this.getBaseMapper().selectPage(page,queryWrapper);
}
} }
...@@ -2,6 +2,8 @@ package com.zzsn.thinktank.vo; ...@@ -2,6 +2,8 @@ package com.zzsn.thinktank.vo;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @Version 1.0 * @Version 1.0
* @Author: ZhangJingKun * @Author: ZhangJingKun
...@@ -39,4 +41,10 @@ public class ThinktankBasicInfoListVo { ...@@ -39,4 +41,10 @@ public class ThinktankBasicInfoListVo {
//标签 //标签
private String tagId; private String tagId;
//区域国家标签id
private List<String> regionalCountriesTypeId;
//领域标签id
private List<String> fieldTypeId;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论