提交 652fb20a 作者: yanxin

Merge remote-tracking branch 'origin/master'

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