提交 20864e65 作者: 925993793@qq.com

导入导出增加是否展示字段

上级 89e1b47c
......@@ -160,6 +160,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)) {
......@@ -184,6 +185,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;
......@@ -193,7 +201,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<>();
......@@ -256,7 +264,8 @@ public class ThinktankBasicInfoController {
&& list.contains("成立时间")
&& list.contains("是否收费(1-是;0-否)")
&& list.contains("地址")
&& list.contains("创办单位/所属单位");
&& list.contains("创办单位/所属单位")
&& list.contains("是否展示(1-是;0-否)");
}
return false;
}
......
......@@ -133,6 +133,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;
}
......
......@@ -525,11 +525,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);
......
......@@ -61,5 +61,7 @@ public class ThinkTankFileVO {
private String address;
//创办单位/所属单位
private String belongUnit;
//是否展示(1-是;0-否)
private Integer ynDisplay;
}
......@@ -12,12 +12,12 @@ spring:
max-request-size: 1000MB
datasource:
url: jdbc:mysql://114.116.44.11:3306/clb_project?useUnicode=true&characterEncoding=utf-8&AllowPublicKeyRetrieval=True&serverTimezone=Asia/Shanghai&autoReconnect=true&rewriteBatchedStatements=true
url: jdbc:mysql://1.95.14.228:3306/clb_project?useUnicode=true&characterEncoding=utf-8&AllowPublicKeyRetrieval=True&serverTimezone=Asia/Shanghai&autoReconnect=true&rewriteBatchedStatements=true
username: ciglobal
password: _PSuWVQ4CLpX
redis:
database: 0
host: 114.116.90.53
host: 1.95.69.2
password: RPHZgkDQ4zGJ
port: 6380
mybatis-plus:
......@@ -28,11 +28,11 @@ mybatis-plus:
#生产es集群
es1:
endpoint1: 114.115.215.250
endpoint1: 1.95.38.69
endpoint1port: 9700
endpoint2: 1.95.3.121
endpoint2port: 9200
endpoint3: 114.115.215.96
endpoint3: 1.95.87.177
endpoint3port: 9200
username: elastic
password: zzsn9988
......@@ -46,4 +46,4 @@ dict:
files:
#storage: D:\\thinktank\\
storage: /zzsn/clb/thinktank/
\ No newline at end of file
storage: /zzsn/clb/thinktank/
......@@ -110,7 +110,7 @@
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
<if test="ids != null and ids.size() > 0">
......@@ -144,4 +144,4 @@
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论