提交 419a8c28 作者: ZhangJingKun

代码提交

上级 2fcfd142
...@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication @SpringBootApplication
@EnableAsync //@EnableAsync
@MapperScan(value = {"com.zzsn.thinktank.mapper*"}) @MapperScan(value = {"com.zzsn.thinktank.mapper*"})
public class ThinkTankApplication { public class ThinkTankApplication {
......
...@@ -69,7 +69,7 @@ public class LeaderCategoryController { ...@@ -69,7 +69,7 @@ public class LeaderCategoryController {
* @param httpServletRequest * @param httpServletRequest
* @return * @return
*/ */
@GetMapping("/list") //@GetMapping("/list")
public Result<?> list( public Result<?> list(
@RequestParam(name="sign",defaultValue = "1") String sign, @RequestParam(name="sign",defaultValue = "1") String sign,
@RequestParam(name="category",required = false) String category, @RequestParam(name="category",required = false) String category,
...@@ -85,6 +85,13 @@ public class LeaderCategoryController { ...@@ -85,6 +85,13 @@ public class LeaderCategoryController {
} }
@GetMapping("/list")
public Result<?> list(){
log.info("查询分类树列表");
return leaderCategoryService.lists();
}
/** /**
* 根据名称模糊查询所有节点及父节点 * 根据名称模糊查询所有节点及父节点
...@@ -107,6 +114,17 @@ public class LeaderCategoryController { ...@@ -107,6 +114,17 @@ public class LeaderCategoryController {
} }
} }
/**
* 国家集合信息
* 所属国家(地区)查询
* 和左侧树展示的列表一致
* @return
*/
@GetMapping("/countryList")
public Result<?> countryList(){
return leaderCategoryService.countryList();
}
// @GetMapping("/type") // @GetMapping("/type")
// public Result<?> type(){ // public Result<?> type(){
......
...@@ -47,7 +47,10 @@ public class ThinktankBindController { ...@@ -47,7 +47,10 @@ public class ThinktankBindController {
@RequestParam(name="groupId", required=true) String groupId, @RequestParam(name="groupId", required=true) String groupId,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
log.info("查询信息源组的绑定列表:{}", infoSourceVo);
log.info("信息源组id:{}---{}",groupId,pageNo);
IPage<InfoSourceVo> pageList = infoSourceService.pageListByGroupId(infoSourceVo, ynBind, groupId, pageNo, pageSize); IPage<InfoSourceVo> pageList = infoSourceService.pageListByGroupId(infoSourceVo, ynBind, groupId, pageNo, pageSize);
List<InfoSourceVo> list = pageList.getRecords();
return Result.OK(pageList); return Result.OK(pageList);
} }
...@@ -66,6 +69,7 @@ public class ThinktankBindController { ...@@ -66,6 +69,7 @@ public class ThinktankBindController {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "infoSourceTypeId", defaultValue = "") String infoSourceTypeId) { @RequestParam(name = "infoSourceTypeId", defaultValue = "") String infoSourceTypeId) {
log.info("信息源分页列表查询:{}",infoSourceVo);
IPage<InfoSourceVo> pageList = infoSourceService.pageListByTypeId(null,null,infoSourceVo, pageNo, pageSize, infoSourceTypeId); IPage<InfoSourceVo> pageList = infoSourceService.pageListByTypeId(null,null,infoSourceVo, pageNo, pageSize, infoSourceTypeId);
return Result.OK(pageList); return Result.OK(pageList);
} }
...@@ -76,6 +80,7 @@ public class ThinktankBindController { ...@@ -76,6 +80,7 @@ public class ThinktankBindController {
*/ */
@PostMapping(value = "/bind") @PostMapping(value = "/bind")
public Result<?> bind(@RequestBody InfoSourceGroupPage infoSourceGroupPage) { public Result<?> bind(@RequestBody InfoSourceGroupPage infoSourceGroupPage) {
log.info("绑定信息源:{}", infoSourceGroupPage);
String message = infoSourceGroupMapService.bind(infoSourceGroupPage.getId(), infoSourceGroupPage.getInfoSourceIds()); String message = infoSourceGroupMapService.bind(infoSourceGroupPage.getId(), infoSourceGroupPage.getInfoSourceIds());
return Result.OK(message); return Result.OK(message);
} }
...@@ -85,6 +90,7 @@ public class ThinktankBindController { ...@@ -85,6 +90,7 @@ public class ThinktankBindController {
*/ */
@PostMapping(value = "/unBound") @PostMapping(value = "/unBound")
public Result<?> unBound(@RequestBody InfoSourceGroupPage infoSourceGroupPage) { public Result<?> unBound(@RequestBody InfoSourceGroupPage infoSourceGroupPage) {
log.info("解绑信息源:{}", infoSourceGroupPage);
infoSourceGroupMapService.unBind(infoSourceGroupPage.getId(), infoSourceGroupPage.getInfoSourceIds()); infoSourceGroupMapService.unBind(infoSourceGroupPage.getId(), infoSourceGroupPage.getInfoSourceIds());
return Result.OK("解绑成功!"); return Result.OK("解绑成功!");
} }
...@@ -104,6 +110,7 @@ public class ThinktankBindController { ...@@ -104,6 +110,7 @@ public class ThinktankBindController {
*/ */
@GetMapping("/upLevel") @GetMapping("/upLevel")
public Result<?> upLevel(@RequestParam("groupId") String groupId){ public Result<?> upLevel(@RequestParam("groupId") String groupId){
log.info("批量紧急:{}", groupId);
List<String> sourceIdList = infoSourceService.listByGroupId(groupId); List<String> sourceIdList = infoSourceService.listByGroupId(groupId);
LambdaUpdateWrapper<InfoSource> update = Wrappers.lambdaUpdate(); LambdaUpdateWrapper<InfoSource> update = Wrappers.lambdaUpdate();
update.set(InfoSource::getSiteLevel,1).in(InfoSource::getId,sourceIdList); update.set(InfoSource::getSiteLevel,1).in(InfoSource::getId,sourceIdList);
......
...@@ -2,10 +2,13 @@ package com.zzsn.thinktank.mapper; ...@@ -2,10 +2,13 @@ package com.zzsn.thinktank.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.thinktank.entity.ThinktankCategoryStructure; import com.zzsn.thinktank.entity.ThinktankCategoryStructure;
import com.zzsn.thinktank.vo.ThinktankCategoryStructureVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
...@@ -20,4 +23,14 @@ public interface LeaderCategoryMapper extends BaseMapper<ThinktankCategoryStruct ...@@ -20,4 +23,14 @@ public interface LeaderCategoryMapper extends BaseMapper<ThinktankCategoryStruct
@Select("select * from character_category_structure limit 10") @Select("select * from character_category_structure limit 10")
List<ThinktankCategoryStructure> getListTop(); List<ThinktankCategoryStructure> getListTop();
@Select("select id,type_name from thinktank_category_structure order by CONVERT (type_name USING gbk) ASC")
List<Map<String, String>> countryList();
@Select("select a.*,b.thinktankCount from thinktank_category_structure a " +
"RIGHT JOIN (select belong_country_id,count(*) as thinktankCount from thinktank_basic_info group by belong_country_id) b " +
"on a.id = b.belong_country_id " +
"where 1=1 " +
"order by CONVERT (type_name USING gbk) ASC ")
List<ThinktankCategoryStructureVo> lists();
} }
...@@ -30,10 +30,14 @@ public interface LeaderCategoryService extends IService<ThinktankCategoryStructu ...@@ -30,10 +30,14 @@ public interface LeaderCategoryService extends IService<ThinktankCategoryStructu
Result<?> lists(String sign, String pid, String category); Result<?> lists(String sign, String pid, String category);
Result<?> lists();
Result<?> getByName(String category, String typeName); Result<?> getByName(String category, String typeName);
Result<?> getAll(String category); Result<?> getAll(String category);
Result<?> countryList();
/** /**
* 通过id获取子节点列表 * 通过id获取子节点列表
* @param id id * @param id id
......
...@@ -10,6 +10,7 @@ import com.zzsn.thinktank.mapper.LeaderCategoryMapper; ...@@ -10,6 +10,7 @@ import com.zzsn.thinktank.mapper.LeaderCategoryMapper;
import com.zzsn.thinktank.service.LeaderCategoryService; import com.zzsn.thinktank.service.LeaderCategoryService;
import com.zzsn.thinktank.vo.CharacterCategoryStructureTreeVo; import com.zzsn.thinktank.vo.CharacterCategoryStructureTreeVo;
import com.zzsn.thinktank.vo.Result; import com.zzsn.thinktank.vo.Result;
import com.zzsn.thinktank.vo.ThinktankCategoryStructureVo;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -157,6 +158,15 @@ public class LeaderCategoryServiceImpl extends ServiceImpl<LeaderCategoryMapper, ...@@ -157,6 +158,15 @@ public class LeaderCategoryServiceImpl extends ServiceImpl<LeaderCategoryMapper,
} }
@Override @Override
public Result<?> lists() {
List<ThinktankCategoryStructureVo> list = baseMapper.lists();
return Result.OK(list);
}
@Override
public Result<?> getByName(String category, String typeName) { public Result<?> getByName(String category, String typeName) {
//根据名称模糊查询 //根据名称模糊查询
List<ThinktankCategoryStructure> characterCategoryStructure = super.list(Wrappers.<ThinktankCategoryStructure>lambdaQuery() List<ThinktankCategoryStructure> characterCategoryStructure = super.list(Wrappers.<ThinktankCategoryStructure>lambdaQuery()
...@@ -224,6 +234,12 @@ public class LeaderCategoryServiceImpl extends ServiceImpl<LeaderCategoryMapper, ...@@ -224,6 +234,12 @@ public class LeaderCategoryServiceImpl extends ServiceImpl<LeaderCategoryMapper,
return Result.OK(collect); return Result.OK(collect);
} }
@Override
public Result<?> countryList() {
List<Map<String, String>> list = baseMapper.countryList();
return Result.OK(list);
}
// 根据当前父类 找出子类, 并通过递归找出子类的子类 // 根据当前父类 找出子类, 并通过递归找出子类的子类
private List<CharacterCategoryStructureTreeVo> getChildList(CharacterCategoryStructureTreeVo projectLeader, Collection<CharacterCategoryStructureTreeVo> list) { private List<CharacterCategoryStructureTreeVo> getChildList(CharacterCategoryStructureTreeVo projectLeader, Collection<CharacterCategoryStructureTreeVo> list) {
return list.stream() return list.stream()
......
...@@ -13,6 +13,7 @@ import com.zzsn.thinktank.service.*; ...@@ -13,6 +13,7 @@ import com.zzsn.thinktank.service.*;
import com.zzsn.thinktank.util.DateUtil; import com.zzsn.thinktank.util.DateUtil;
import com.zzsn.thinktank.util.EsUtil; import com.zzsn.thinktank.util.EsUtil;
import com.zzsn.thinktank.util.ExcelExportUtil; import com.zzsn.thinktank.util.ExcelExportUtil;
import com.zzsn.thinktank.util.StringUtil;
import com.zzsn.thinktank.vo.*; import com.zzsn.thinktank.vo.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -109,6 +110,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -109,6 +110,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
} }
thinktankBasicInfo.setCreateTime(new Date()); thinktankBasicInfo.setCreateTime(new Date());
thinktankBasicInfo.setUpdateTime(new Date());
boolean b = this.save(thinktankBasicInfo); boolean b = this.save(thinktankBasicInfo);
Result result = Result.OK(); Result result = Result.OK();
...@@ -239,6 +241,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -239,6 +241,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
public Result<?> getList(ThinktankBasicInfoListVo thinktankBasicInfoListVo) { public Result<?> getList(ThinktankBasicInfoListVo thinktankBasicInfoListVo) {
IPage page = new Page(); IPage page = new Page();
thinktankBasicInfoListVo.setColumn(StringUtil.humpToLine(thinktankBasicInfoListVo.getColumn()));
//查询列表 //查询列表
List<ThinktankBasicInfoVo> list = thinktankBasicInfoMapper.getList(thinktankBasicInfoListVo); List<ThinktankBasicInfoVo> list = thinktankBasicInfoMapper.getList(thinktankBasicInfoListVo);
page.setRecords(list); page.setRecords(list);
...@@ -305,7 +308,10 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -305,7 +308,10 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
thinktankBasicInfoVo.setInfoSourceCount(listVo.size()); thinktankBasicInfoVo.setInfoSourceCount(listVo.size());
int count = 0; int count = 0;
for (InfoSourceGroupCountVo infoSourceGroupCountVo : listVo) { for (InfoSourceGroupCountVo infoSourceGroupCountVo : listVo) {
count += infoSourceGroupCountVo.getInfoCount(); Integer infoCount = infoSourceGroupCountVo.getInfoCount();
if(infoCount != null){
count += infoCount;
}
} }
thinktankBasicInfoVo.setCollectionCount(count); thinktankBasicInfoVo.setCollectionCount(count);
} }
...@@ -416,6 +422,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -416,6 +422,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
for (List<String> list : excelLists) { for (List<String> list : excelLists) {
ThinktankBasicInfo thinktankBasicInfo = new ThinktankBasicInfo(); ThinktankBasicInfo thinktankBasicInfo = new ThinktankBasicInfo();
if(StringUtils.isNotEmpty(list.get(0))) thinktankBasicInfo.setId(list.get(0));
if(StringUtils.isNotEmpty(list.get(1))) thinktankBasicInfo.setCodeId(list.get(1)); if(StringUtils.isNotEmpty(list.get(1))) thinktankBasicInfo.setCodeId(list.get(1));
if(StringUtils.isNotEmpty(list.get(2))) thinktankBasicInfo.setChineseWhole(list.get(2)); if(StringUtils.isNotEmpty(list.get(2))) thinktankBasicInfo.setChineseWhole(list.get(2));
if(StringUtils.isNotEmpty(list.get(3))) thinktankBasicInfo.setChineseSimple(list.get(3)); if(StringUtils.isNotEmpty(list.get(3))) thinktankBasicInfo.setChineseSimple(list.get(3));
...@@ -462,15 +469,26 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -462,15 +469,26 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
for (ThinktankBasicInfo thinktankBasicInfo : infoList) { for (ThinktankBasicInfo thinktankBasicInfo : infoList) {
boolean b = true; boolean b = true;
//id //序号
String number = thinktankBasicInfo.getId();
String codeId = thinktankBasicInfo.getCodeId(); String codeId = thinktankBasicInfo.getCodeId();
if(codeId == null || codeId.length() ==0){
thinktankBasicInfo.setCodeId(generatorIdService.getIdNo());
thinktankBasicInfo.setId(Long.toString(generatorIdService.getOrderId()));
thinktankBasicInfo.setCreateTime(new Date());
thinktankBasicInfo.setUpdateTime(new Date());
} else {
LambdaQueryWrapper<ThinktankBasicInfo> lambdaQuery = Wrappers.lambdaQuery(); LambdaQueryWrapper<ThinktankBasicInfo> lambdaQuery = Wrappers.lambdaQuery();
lambdaQuery.eq(ThinktankBasicInfo::getCodeId,codeId); lambdaQuery.eq(ThinktankBasicInfo::getCodeId,codeId);
List<ThinktankBasicInfo> listBasicInfo = thinktankBasicInfoMapper.selectList(lambdaQuery); List<ThinktankBasicInfo> listBasicInfo = thinktankBasicInfoMapper.selectList(lambdaQuery);
if(listBasicInfo.size() > 0){ if(listBasicInfo.size() > 0){
thinktankBasicInfo.setId(listBasicInfo.get(0).getId()); thinktankBasicInfo.setId(listBasicInfo.get(0).getId());
thinktankBasicInfo.setUpdateTime(new Date());
} else { } else {
thinktankBasicInfo.setId(Long.toString(generatorIdService.getOrderId())); thinktankBasicInfo.setId(Long.toString(generatorIdService.getOrderId()));
thinktankBasicInfo.setCreateTime(new Date());
thinktankBasicInfo.setUpdateTime(new Date());
}
} }
//国家 //国家
...@@ -478,7 +496,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -478,7 +496,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
String belongCountryId = mapCategoryStructure.get(belongCountry); String belongCountryId = mapCategoryStructure.get(belongCountry);
if(StringUtils.isEmpty(belongCountryId)){ if(StringUtils.isEmpty(belongCountryId)){
b = false; b = false;
sb.append("智库机构编码为'" + codeId + "'的国家’" + belongCountry +"‘数据库没有,导入失败;\n"); sb.append("序号为'" + number + "'的国家’" + belongCountry +"‘数据库没有,导入失败;\n");
} else { } else {
thinktankBasicInfo.setBelongCountryId(belongCountryId); thinktankBasicInfo.setBelongCountryId(belongCountryId);
} }
...@@ -492,7 +510,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -492,7 +510,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
String tagId = mapTag.get(s); String tagId = mapTag.get(s);
if(StringUtils.isEmpty(tagId)){ if(StringUtils.isEmpty(tagId)){
b = false; b = false;
sb.append("智库机构编码为'" + codeId + "'的标签'" + s +"'数据库没有,导入失败;\n"); sb.append("序号为'" + number + "'的标签'" + s +"'数据库没有,导入失败;\n");
} else { } else {
tagIdList.add(tagId); tagIdList.add(tagId);
} }
...@@ -503,6 +521,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -503,6 +521,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
//所属单位 //所属单位
String belongUnit = thinktankBasicInfo.getBelongUnit(); String belongUnit = thinktankBasicInfo.getBelongUnit();
if(belongUnit != null && belongUnit.length() > 0){
List<SysBaseEnterprise> listEnter = enterpriseService.getListByName(belongUnit); List<SysBaseEnterprise> listEnter = enterpriseService.getListByName(belongUnit);
if(listEnter.size() > 0){ if(listEnter.size() > 0){
SysBaseEnterprise enter = listEnter.get(0); SysBaseEnterprise enter = listEnter.get(0);
...@@ -510,14 +529,14 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -510,14 +529,14 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
thinktankBasicInfo.setBelongUnitCode(belongUnitCode); thinktankBasicInfo.setBelongUnitCode(belongUnitCode);
} else { } else {
b = false; b = false;
sb.append("智库机构编码为'" + codeId + "'的创办单位/所属单位'" + belongUnit +"'数据库没有,导入失败;\n"); sb.append("序号为'" + number + "'的创办单位/所属单位'" + belongUnit +"'数据库没有,导入失败;\n");
}
} }
//成立时间 //成立时间
String establishTime = thinktankBasicInfo.getEstablishTime(); String establishTime = thinktankBasicInfo.getEstablishTime();
if(!DateUtil.isDate(establishTime)){ if(!DateUtil.isDate(establishTime)){
b = false; b = false;
sb.append("智库机构编码为'" + codeId + "'的成立时间'" + belongUnit +"'格式错误,导入失败;\n"); sb.append("序号为'" + number + "'的成立时间'" + belongUnit +"'格式错误,导入失败;\n");
} }
if(b){ if(b){
...@@ -576,6 +595,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -576,6 +595,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
writer.addHeaderAlias("webSiteName", "关联信息源名称"); writer.addHeaderAlias("webSiteName", "关联信息源名称");
writer.addHeaderAlias("siteName", "栏目名称"); writer.addHeaderAlias("siteName", "栏目名称");
writer.addHeaderAlias("siteUri", "网址"); writer.addHeaderAlias("siteUri", "网址");
writer.addHeaderAlias("status", "启用状态(1-启用;0-禁用)");
writer.addHeaderAlias("count", "信息源采集数量"); writer.addHeaderAlias("count", "信息源采集数量");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
...@@ -596,6 +616,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -596,6 +616,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
public List<ThinktankBasicInfoExportVo> getExportList(ThinktankBasicInfoListVo thinktankBasicInfoListVo) { public List<ThinktankBasicInfoExportVo> getExportList(ThinktankBasicInfoListVo thinktankBasicInfoListVo) {
thinktankBasicInfoListVo.setColumn(StringUtil.humpToLine(thinktankBasicInfoListVo.getColumn()));
//查询列表 //查询列表
List<ThinktankBasicInfoExportVo> list = thinktankBasicInfoMapper.getExportList(thinktankBasicInfoListVo); List<ThinktankBasicInfoExportVo> list = thinktankBasicInfoMapper.getExportList(thinktankBasicInfoListVo);
......
...@@ -926,7 +926,7 @@ public class EsUtil { ...@@ -926,7 +926,7 @@ public class EsUtil {
// 添加聚合操作 // 添加聚合操作
TermsAggregationBuilder termsAggregationBuilder = AggregationBuilders.terms("group_column").field(group_column).size(size); TermsAggregationBuilder termsAggregationBuilder = AggregationBuilders.terms("group_column").field(group_column).size(size);
termsAggregationBuilder.subAggregation(AggregationBuilders.count("group_column").field(group_column)); termsAggregationBuilder.subAggregation(AggregationBuilders.count("group_column").field(group_column)).size(100000);
searchSourceBuilder.aggregation(termsAggregationBuilder); searchSourceBuilder.aggregation(termsAggregationBuilder);
// 设置查询超时时间 // 设置查询超时时间
searchSourceBuilder.timeout(TimeValue.timeValueSeconds(50)); searchSourceBuilder.timeout(TimeValue.timeValueSeconds(50));
......
...@@ -443,4 +443,43 @@ public class StringUtil { ...@@ -443,4 +443,43 @@ public class StringUtil {
return null; return null;
} }
} }
/**
* 下划线转驼峰
* @param str
* @return
*/
public static String lineToHump(String str) {
if(str == null || str.length() == 0)
return "";
Pattern linePattern = Pattern.compile("_(\\w)");
str = str.toLowerCase();
Matcher matcher = linePattern.matcher(str);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
}
matcher.appendTail(sb);
return sb.toString();
}
/**
* 驼峰转下划线
* @param str
* @return
*/
public static String humpToLine(String str) {
if(str == null || str.length() == 0)
return "";
Pattern humpPattern = Pattern.compile("[A-Z]");
Matcher matcher = humpPattern.matcher(str);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
}
matcher.appendTail(sb);
return sb.toString();
}
} }
...@@ -70,10 +70,13 @@ public class ThinktankBasicInfoExportVo extends Model<ThinktankBasicInfoExportVo ...@@ -70,10 +70,13 @@ public class ThinktankBasicInfoExportVo extends Model<ThinktankBasicInfoExportVo
private String siteName; private String siteName;
//网址 //网址
private String siteUri; private String siteUri;
//启用状态 1启用 0禁用
private String status;
//信息源采集数量 //信息源采集数量
private Integer count; private Integer count;
//国内外 //国内外
// private String countryWithinExternal; // private String countryWithinExternal;
//所在地区 //所在地区
......
package com.zzsn.thinktank.vo;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* <p>
*5.1 人物分类体系表 character_category_structure
* </p>
*
* @since
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class ThinktankCategoryStructureVo
{
/**
* 主键
*/
private String id;
/**
* 类别名称 公安部 财政部
*/
private String typeName;
/**
*类别编码
*/
private String typeCode;
/**
* 创建人
*/
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;
/**
* 更新人
*/
@TableField("")
private String updateBy;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
@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;
/**
* 父级节点id
*/
private String pid;
/**
* 是否有子节点0,没有 1,有
*/
private String hasChild;
/**
* 分类类型: 领导人 专家 企业高管
*/
private String category;
/**
* 状态0启用,1禁用
*/
private Integer status;
/**
* 节点绝对路径
*/
private String fullPath;
/**
* 描述
*/
private String description;
/**
* 排序
*/
private Long sort;
/**
* 智库数量
*/
private Integer thinktankCount;
}
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
like '%${keyword}%' like '%${keyword}%'
</if> </if>
<if test="order != null and order != ''"> <if test="order != null and order != ''">
ORDER BY ${column} ${order} ORDER BY CONVERT (${column} USING gbk) ${order}
</if> </if>
limit #{offset}, #{pageSize} limit #{offset}, #{pageSize}
</select> </select>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<select id="getExportList" resultType="com.zzsn.thinktank.vo.ThinktankBasicInfoExportVo"> <select id="getExportList" resultType="com.zzsn.thinktank.vo.ThinktankBasicInfoExportVo">
select select
a.id, a.code_id, a.chinese_whole, a.chinese_simple, a.english_whole, a.english_simple, a.original_whole, a.original_simple, a.official_website, a.belong_country, a.tag_name, a.biographical_notes, a.establish_time, a.charge, a.address, a.belong_unit, a.id, a.code_id, a.chinese_whole, a.chinese_simple, a.english_whole, a.english_simple, a.original_whole, a.original_simple, a.official_website, a.belong_country, a.tag_name, a.biographical_notes, a.establish_time, a.charge, a.address, a.belong_unit,
c.id as infoSourceId, c.info_source_code, c.web_site_name, c.site_name, c.site_uri c.id as infoSourceId, c.info_source_code, c.web_site_name, c.site_name, c.site_uri, c.status
from thinktank_basic_info a from thinktank_basic_info a
LEFT JOIN thinktank_info_source_group_map b LEFT JOIN thinktank_info_source_group_map b
on a.id = b.group_id on a.id = b.group_id
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论