提交 652fb20a 作者: yanxin

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/application.yml
...@@ -168,6 +168,7 @@ public class ThinktankBasicInfoController { ...@@ -168,6 +168,7 @@ public class ThinktankBasicInfoController {
header.put("是否收费(1-是;0-否)", "charge"); header.put("是否收费(1-是;0-否)", "charge");
header.put("地址", "address"); header.put("地址", "address");
header.put("创办单位/所属单位", "belongUnit"); header.put("创办单位/所属单位", "belongUnit");
header.put("是否展示(1-是;0-否)", "ynDisplay");
reader.setHeaderAlias(header); reader.setHeaderAlias(header);
List<ThinkTankFileVO> thinkTankImportVOList = reader.read(1, 2, ThinkTankFileVO.class); List<ThinkTankFileVO> thinkTankImportVOList = reader.read(1, 2, ThinkTankFileVO.class);
if (CollectionUtils.isNotEmpty(thinkTankImportVOList)) { if (CollectionUtils.isNotEmpty(thinkTankImportVOList)) {
...@@ -192,6 +193,13 @@ public class ThinktankBasicInfoController { ...@@ -192,6 +193,13 @@ public class ThinktankBasicInfoController {
return Result.OK(); return Result.OK();
} }
/**
* 导出
*
* @param one 检索条件
* @author lkg
* @date 2025/4/27
*/
@PostMapping("/batchExport") @PostMapping("/batchExport")
public byte[] batchExport(@RequestBody ThinktankBasicInfoListVo one) { public byte[] batchExport(@RequestBody ThinktankBasicInfoListVo one) {
byte[] bytes = null; byte[] bytes = null;
...@@ -201,7 +209,7 @@ public class ThinktankBasicInfoController { ...@@ -201,7 +209,7 @@ public class ThinktankBasicInfoController {
if (CollectionUtils.isNotEmpty(thinkTankBasicInfos)) { if (CollectionUtils.isNotEmpty(thinkTankBasicInfos)) {
String[] arr = new String[]{"智库机构id", "智库机构编码", "中文全称", "中文简称", "英文全称", "英文简称", "官网", "所属国家", "语言", "经营状态","营利性质", String[] arr = new String[]{"智库机构id", "智库机构编码", "中文全称", "中文简称", "英文全称", "英文简称", "官网", "所属国家", "语言", "经营状态","营利性质",
"智库性质", "研究领域", "影响力和地位", "人员规模","智库规模", "成果类型", "资金来源", "原文全称", "原文简称", "简介", "成立时间", "是否收费(1-是;0-否)", "智库性质", "研究领域", "影响力和地位", "人员规模","智库规模", "成果类型", "资金来源", "原文全称", "原文简称", "简介", "成立时间", "是否收费(1-是;0-否)",
"地址", "创办单位/所属单位"}; "地址", "创办单位/所属单位","是否展示(1-是;0-否)"};
XSSFWorkbook workbook = new XSSFWorkbook(); XSSFWorkbook workbook = new XSSFWorkbook();
//基本信息 //基本信息
List<List<String>> rows = new ArrayList<>(); List<List<String>> rows = new ArrayList<>();
...@@ -316,7 +324,8 @@ public class ThinktankBasicInfoController { ...@@ -316,7 +324,8 @@ public class ThinktankBasicInfoController {
&& list.contains("成立时间") && list.contains("成立时间")
&& list.contains("是否收费(1-是;0-否)") && list.contains("是否收费(1-是;0-否)")
&& list.contains("地址") && list.contains("地址")
&& list.contains("创办单位/所属单位"); && list.contains("创办单位/所属单位")
&& list.contains("是否展示(1-是;0-否)");
} }
return false; return false;
} }
......
...@@ -101,6 +101,8 @@ public class ThinktankBasicInfo extends Model<ThinktankBasicInfo> { ...@@ -101,6 +101,8 @@ public class ThinktankBasicInfo extends Model<ThinktankBasicInfo> {
private String fundsSource; private String fundsSource;
//是否展示(1-是;0-否) //是否展示(1-是;0-否)
private Integer ynDisplay; private Integer ynDisplay;
//删除状态(1-是;0-否)
private Integer deleteStatus;
//信息源id //信息源id
@TableField(exist = false) @TableField(exist = false)
...@@ -137,6 +139,11 @@ public class ThinktankBasicInfo extends Model<ThinktankBasicInfo> { ...@@ -137,6 +139,11 @@ public class ThinktankBasicInfo extends Model<ThinktankBasicInfo> {
} }
list.add(getValue(address)); list.add(getValue(address));
list.add(getValue(belongUnit)); list.add(getValue(belongUnit));
if (ynDisplay != null) {
list.add(String.valueOf(ynDisplay));
} else {
list.add("");
}
return list; return list;
} }
......
...@@ -73,13 +73,16 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -73,13 +73,16 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
@Resource @Resource
private DataImportService dataImportService; private DataImportService dataImportService;
//语种字典 //语种字典
@Value("${dict.language:}") @Value("${dict.language:}")
private String LANGUAGE; private String LANGUAGE;
//营利性质字典吗 //影响力和地位字典码
@Value("${dict.influence_position:}")
private String INFLUENCE_POSITION;
//营利性质字典码
@Value("${dict.think_tank_profit_nature:}") @Value("${dict.think_tank_profit_nature:}")
private String THINK_TANK_PROFIT_NATURE; private String THINK_TANK_PROFIT_NATURE;
//智库性质字典 //智库性质字典
@Value("${dict.think_tank_nature:}") @Value("${dict.think_tank_nature:}")
private String THINK_TANK_NATURE; private String THINK_TANK_NATURE;
//研究领域标签id //研究领域标签id
...@@ -141,12 +144,15 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -141,12 +144,15 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
public Result<?> del(String id) { public Result<?> del(String id) {
String[] idArr = id.split(","); String[] idArr = id.split(",");
List<String> ids = Arrays.asList(idArr); List<String> ids = Arrays.asList(idArr);
boolean b = this.removeByIds(ids); boolean b = this.update(Wrappers.<ThinktankBasicInfo>lambdaUpdate()
.in(ThinktankBasicInfo::getId, ids)
.set(ThinktankBasicInfo::getDeleteStatus, 1)
.set(ThinktankBasicInfo::getUpdateTime, new Date()));
Result result = Result.OK(); Result result = Result.OK();
if (!b) { if (!b) {
result.error500("删除失败!"); result.error500("删除失败!");
} }
thinktankTagService.delLabel(ids); //thinktankTagService.delLabel(ids);
return result; return result;
} }
...@@ -525,11 +531,13 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -525,11 +531,13 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
ThinktankBasicInfo one = thinktankBasicInfoMapper.selectOne(queryWrapper); ThinktankBasicInfo one = thinktankBasicInfoMapper.selectOne(queryWrapper);
if (one != null) { if (one != null) {
thinktankBasicInfo.setId(one.getId()); thinktankBasicInfo.setId(one.getId());
thinktankBasicInfo.setUpdateTime(new Date());
thinktankBasicInfoMapper.updateById(thinktankBasicInfo); thinktankBasicInfoMapper.updateById(thinktankBasicInfo);
//编辑标签数据 //编辑标签数据
thinktankTagService.editLabel(thinktankBasicInfo); thinktankTagService.editLabel(thinktankBasicInfo);
} else { } else {
thinktankBasicInfo.setId(Long.toString(generatorIdService.getOrderId())); thinktankBasicInfo.setId(Long.toString(generatorIdService.getOrderId()));
thinktankBasicInfo.setCreateTime(new Date());
thinktankBasicInfoMapper.insert(thinktankBasicInfo); thinktankBasicInfoMapper.insert(thinktankBasicInfo);
//增加标签数据 //增加标签数据
thinktankTagService.addLabel(thinktankBasicInfo); thinktankTagService.addLabel(thinktankBasicInfo);
...@@ -557,6 +565,9 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -557,6 +565,9 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
//语种 //语种
List<DataChangeVO> languageList = dataImportService.dictItemList(LANGUAGE); List<DataChangeVO> languageList = dataImportService.dictItemList(LANGUAGE);
Map<String, String> languageMap = languageList.stream().collect(Collectors.toMap(DataChangeVO::getValue, DataChangeVO::getDescription, (value1, value2) -> value1)); Map<String, String> languageMap = languageList.stream().collect(Collectors.toMap(DataChangeVO::getValue, DataChangeVO::getDescription, (value1, value2) -> value1));
//影响力和地位
List<DataChangeVO> influencePositionList = dataImportService.dictItemList(INFLUENCE_POSITION);
Map<String, String> influencePositionMap = influencePositionList.stream().collect(Collectors.toMap(DataChangeVO::getValue, DataChangeVO::getDescription, (value1, value2) -> value1));
//营利性质 //营利性质
List<DataChangeVO> profitNatureList = dataImportService.dictItemList(THINK_TANK_PROFIT_NATURE); List<DataChangeVO> profitNatureList = dataImportService.dictItemList(THINK_TANK_PROFIT_NATURE);
Map<String, String> profitNatureMap = profitNatureList.stream().collect(Collectors.toMap(DataChangeVO::getValue, DataChangeVO::getDescription, (value1, value2) -> value1)); Map<String, String> profitNatureMap = profitNatureList.stream().collect(Collectors.toMap(DataChangeVO::getValue, DataChangeVO::getDescription, (value1, value2) -> value1));
...@@ -577,6 +588,15 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -577,6 +588,15 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
} }
thinkTankBasicInfo.setLang(sb.substring(1)); thinkTankBasicInfo.setLang(sb.substring(1));
} }
String influencePosition = thinkTankBasicInfo.getInfluencePosition();
if (StringUtils.isNotEmpty(influencePosition)) {
StringBuilder sb = new StringBuilder();
for (String s : influencePosition.split(",")) {
String value = influencePositionMap.get(s);
sb.append(",").append(value);
}
thinkTankBasicInfo.setInfluencePosition(sb.substring(1));
}
String profitNature = thinkTankBasicInfo.getProfitNature(); String profitNature = thinkTankBasicInfo.getProfitNature();
if (StringUtils.isNotEmpty(profitNature)) { if (StringUtils.isNotEmpty(profitNature)) {
thinkTankBasicInfo.setProfitNature(profitNatureMap.get(profitNature)); thinkTankBasicInfo.setProfitNature(profitNatureMap.get(profitNature));
......
...@@ -61,5 +61,7 @@ public class ThinkTankFileVO { ...@@ -61,5 +61,7 @@ public class ThinkTankFileVO {
private String address; private String address;
//创办单位/所属单位 //创办单位/所属单位
private String belongUnit; private String belongUnit;
//是否展示(1-是;0-否)
private Integer ynDisplay;
} }
...@@ -40,10 +40,11 @@ es1: ...@@ -40,10 +40,11 @@ es1:
sys_base_label_type_id: 1783029731298439170 sys_base_label_type_id: 1783029731298439170
sys_base_label_type: 1792195735429595138 sys_base_label_type: 1792195735429595138
dict: dict:
language: clb_language language: language
influence_position: Influence
think_tank_nature: think_tank_nature think_tank_nature: think_tank_nature
think_tank_profit_nature: think_tank_profit_nature think_tank_profit_nature: think_tank_profit_nature
files: files:
#storage: D:\\thinktank\\ #storage: D:\\thinktank\\
storage: /zzsn/clb/thinktank/ storage: /zzsn/clb/thinktank/
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
belong_unit_code,belong_unit,head_sculpture,biographical_notes,status, belong_unit_code,belong_unit,head_sculpture,biographical_notes,status,
lang,operate_status,profit_nature,nature,influence_position,staff_size,scale,achievement_type,funds_source,yn_display lang,operate_status,profit_nature,nature,influence_position,staff_size,scale,achievement_type,funds_source,yn_display
from thinktank_basic_info a from thinktank_basic_info a
where 1 = 1 where a.delete_status = 0
<if test="codeId != null and codeId != ''"> <if test="codeId != null and codeId != ''">
AND a.code_id = #{codeId} AND a.code_id = #{codeId}
</if> </if>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
select select
count(1) count(1)
from thinktank_basic_info a from thinktank_basic_info a
where 1 = 1 where a.delete_status = 0
<if test="codeId != null and codeId != ''"> <if test="codeId != null and codeId != ''">
AND a.code_id = #{codeId} AND a.code_id = #{codeId}
</if> </if>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
on a.id = b.group_id on a.id = b.group_id
LEFT JOIN info_source c LEFT JOIN info_source c
on b.source_id = c.id on b.source_id = c.id
where 1 = 1 where a.delete_status = 0
<if test="codeId != null and codeId != ''"> <if test="codeId != null and codeId != ''">
AND a.code_id = #{codeId} AND a.code_id = #{codeId}
</if> </if>
...@@ -110,9 +110,9 @@ ...@@ -110,9 +110,9 @@
a.id, a.code_id, a.chinese_whole, a.chinese_simple, a.english_whole, a.english_simple, a.original_whole, 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_id, a.tag_id, a.biographical_notes, a.establish_time, a.original_simple, a.official_website, a.belong_country_id, a.tag_id, a.biographical_notes, a.establish_time,
a.charge, a.address, a.belong_unit_code,a.lang,a.operate_status,a.profit_nature,a.nature,a.influence_position, a.charge, a.address, a.belong_unit_code,a.lang,a.operate_status,a.profit_nature,a.nature,a.influence_position,
a.staff_size,a.scale,a.achievement_type,a.funds_source a.staff_size,a.scale,a.achievement_type,a.funds_source,a.yn_display
from thinktank_basic_info a from thinktank_basic_info a
where 1 = 1 where a.delete_status = 0
<if test="ids != null and ids.size() > 0"> <if test="ids != null and ids.size() > 0">
AND a.id in AND a.id in
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")"> <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
...@@ -158,4 +158,4 @@ ...@@ -158,4 +158,4 @@
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论